@zeniai/web-app-ui 5.1.58-next → 5.1.58-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/assets/AddressRoutes-CPX14XSj.js +1 -0
  2. package/dist/assets/{AddressScreen-NGqy9EJ7.js → AddressScreen-V8qhbu9d.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-MVmylog3.js → AiCfoScreen-B2v4oX4h.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-BevyFJ6d.js → BillPayApprovalRoutes-B6jqtEYg.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-B1mi6Ds8.js → BillPayRoutes-CKtJupU-.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DiIuM-D8.js → BusinessVerificationPageScreen-DO1Qhw6D.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-BzGz3a3W.js → ChargeCardRoutes-BHdVO9a5.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-CkbdVUtF.js → CompanyPassportScreen-DkvfpbMw.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-CRAMd_hY.js → ConnectionAuthScreen-DaGPpRPO.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-CD5LwsDH.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-ABpY4goC.js → CustomerOnboardingRoutes-CTpQNO2Q.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-C2pOofR0.js → DashboardRoutes-jRDsqXRC.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-C3yP5OK2.js → DefaultTenantHome-_pdrgccv.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BPQIJHK1.js → DomesticWireDetailScreen-CCXVWOri.js} +1 -1
  15. package/dist/assets/{DrawerScreen-BzT5AGON.js → DrawerScreen-B7V2OyqL.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-BC37wk97.js → EntityDetailRoutes-DfRfi9XQ.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-BX8gOstA.js → ExpenseAutomationRoutes-cFT1NB2O.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-CGQO6rrQ.js → FeaturePreviewScreen-2R9FJdWJ.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-PcnvYCi4.js → HubSpotOAuthCallbackScreen-rd4Kj3vC.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-C-bIYXLF.js → MagicLinkRoutes-BO0Lexxe.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-bLw2jUow.js → MagicLinkSignInScreen-BAuy3KLO.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-CpuZ4FmH.js → MobileAppDrawer-DIls_BW2.js} +1 -1
  23. package/dist/assets/NotFoundScreen-D4Av36kV.js +1 -0
  24. package/dist/assets/{NotificationRoutes-BJBzVHog.js → NotificationRoutes-lCQFJz0z.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-BOuGnAwE.js → OAuthConsentScreen-COgy1n70.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-DdHC34Ro.js → PandLWithForecastRoutes-Bkidve9i.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-CCg2DBSx.js → PeopleRoutes-B7wvEYYp.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-Cb2YGWNA.js → PerformanceRoutes-CjXTt9vm.js} +1 -1
  29. package/dist/assets/{Preview-BfB4HVdK.js → Preview-KE8R1SN3.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-D258LG2R.js → QBOConnectionScreen-CGgBpuke.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-BwIy2cSH.js → ReferralListScreen-BA5RvLF7.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-C6wWe3sJ.js → ReimbursementApprovalRoutes-BGkN9M7Q.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CFhmMv-O.js → ReimbursementApprovalRuleDetailScreen-6mUow2wt.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-Bd4-AuJN.js → ReimbursementRoutes-MbRZIHuu.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-Bm5A3Erh.js → ReportsRoutes-BBKUYNc0.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-C1Nn83TR.js → RewardsRoutes-BbXQsLmk.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-kdWvpwla.js → ScreenRoutes-BxoMc-Es.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-BTNIK9kJ.js → SettingsRoutes-DLxDXOLE.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-CnA3Wri8.js → SetupPagesScreen-DLtasQoq.js} +1 -1
  40. package/dist/assets/{SignInScreen-DMAVaX-m.js → SignInScreen-CJnKhy_P.js} +1 -1
  41. package/dist/assets/{SignOutScreen-DFUBT0l6.js → SignOutScreen-DNLOQn_i.js} +1 -1
  42. package/dist/assets/{TaskListScreen-Be8rPRdA.js → TaskListScreen-G6lL0uD5.js} +1 -1
  43. package/dist/assets/{TaskRoutes-D0oghATf.js → TaskRoutes-DQA7zeTW.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-9MvCo6y3.js → TransactionDetailRoutes-yWhhHCBD.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-CyNORpj2.js → TransactionDetailScreen-gAhskOIn.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-sp9KoTms.js → TransactionListRoutes-CzgCZLFm.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-Ct_kXwX_.js → TreasuryRoutes-BmIGoFg4.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-DvSjojkg.js → VendorsRoutes-BjMVmZbA.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-Bo4AMnlc.js → WiseConfirmationScreen-Co4RuLhn.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-o75tEEaE.js → ZeniAccountRoutes-C_Otg4hI.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-BY3qJV21.js → ZeniAccountStatementScreen-BbupcIsJ.js} +1 -1
  52. package/dist/assets/{accountMappingHelper-DqixY6R_.js → accountMappingHelper-B_qiWmeW.js} +1 -1
  53. package/dist/assets/{analytics-DNNAdslX.js → analytics-BUNQWYXz.js} +1 -1
  54. package/dist/assets/{analyticsHelper-BbXHYbAA.js → analyticsHelper-DNuTbD5B.js} +1 -1
  55. package/dist/assets/{core-vQwuHvL7.js → core-C8Y7fm3n.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-BdZ4SOfU.js → decodeURIComponentSafe-pK1yrQsS.js} +1 -1
  57. package/dist/assets/{dnd-D0_5bRGE.js → dnd-RzzQg6oJ.js} +1 -1
  58. package/dist/assets/{empty-BeaWkyOf.js → empty-Bs_WirIs.js} +1 -1
  59. package/dist/assets/{empty-CnyNmiVC.js → empty-CTn7RkAu.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-BTfNRyxQ.js → emptyVideoElement-BE2d8kYR.js} +1 -1
  61. package/dist/assets/{epic-B3mgDH2T.js → epic-CPnluZX0.js} +1 -1
  62. package/dist/assets/{getLocaleForTenant-TLA-QJ0n.js → getLocaleForTenant-CYgluMQL.js} +1 -1
  63. package/dist/assets/{index-Dd5iEsAg.js → index-BCOcxjVj.js} +1 -1
  64. package/dist/assets/{index-C3mA9Q5U.js → index-C3-objML.js} +7 -7
  65. package/dist/assets/{index-DxV18t5K.js → index-C_oqefR-.js} +1 -1
  66. package/dist/assets/{index-BNPk90w6.js → index-Cv6pmWIm.js} +2 -2
  67. package/dist/assets/{index-DTo5dSWh.js → index-CyWBxegb.js} +1 -1
  68. package/dist/assets/{index-BHPHyzCZ.js → index-DhPN3gNQ.js} +1 -1
  69. package/dist/assets/{index-w8pg-Inj.js → index-DjeTRCsF.js} +1 -1
  70. package/dist/assets/{index-8G42QJyV.js → index-eBlD3uTi.js} +1 -1
  71. package/dist/assets/{lexical-BUO93qJ-.js → lexical-CPmqnx9k.js} +1 -1
  72. package/dist/assets/{liveblocks-DrgIMsec.js → liveblocks-fDjf6Tur.js} +1 -1
  73. package/dist/assets/{lottie-BNwbvBq3.js → lottie-DmArr_jQ.js} +1 -1
  74. package/dist/assets/{mui-Rvgr2IA7.js → mui-Ky-KJxLh.js} +1 -1
  75. package/dist/assets/{pathToGoBack-wMl64PVR.js → pathToGoBack-9QBEItSt.js} +1 -1
  76. package/dist/assets/{pdf-DHm_gs_H.js → pdf-NvioK7wV.js} +3 -3
  77. package/dist/assets/{pdf-lib-C-bgig4f.js → pdf-lib-6uw_qC-k.js} +1 -1
  78. package/dist/assets/{plaid-7_KuF832.js → plaid-D50ZkdQf.js} +1 -1
  79. package/dist/assets/{pusher-DYkQlAWH.js → pusher-CAUUsTgW.js} +1 -1
  80. package/dist/assets/{react-Zeb_l_tr.js → react-BX04XLg-.js} +1 -1
  81. package/dist/assets/{react-CBTAKfXu.js → react-BzVo9cuE.js} +1 -1
  82. package/dist/assets/{react-Cdak1-Nq.js → react-C7YWBeDO.js} +1 -1
  83. package/dist/assets/{react-BYpJ9xCH.js → react-CHUA3ysh.js} +1 -1
  84. package/dist/assets/{react-BrywtdUD.js → react-CzlxEg73.js} +1 -1
  85. package/dist/assets/{react-CHWpdU-f.js → react-DsRQdKTx.js} +1 -1
  86. package/dist/assets/{recharts-BA6FOoyE.js → recharts-CgIjuHOA.js} +1 -1
  87. package/dist/assets/{routePaths-CmhI8CxC.js → routePaths-B8EWQXPr.js} +1 -1
  88. package/dist/assets/{sentry-BkoKwCRV.js → sentry-DjzU4p1F.js} +1 -1
  89. package/dist/assets/{url-Dy9mvWN5.js → url-DBETAWzw.js} +1 -1
  90. package/dist/assets/{url-Bq7l5eBz.js → url-mCw4Y0mb.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DYxbqQ5e.js → useAiCfoDashboardSuggestedQuestionsChips-DN1K5TAQ.js} +1 -1
  92. package/dist/assets/{useAskAiCfoHostNavButtonProps-QJAyq3s4.js → useAskAiCfoHostNavButtonProps-DDzinN2F.js} +1 -1
  93. package/dist/assets/{useDeviceId-HmnPloI4.js → useDeviceId-DBHwhChu.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-Baw9vJ__.js → useInitialThreadRequest-X7WpfR49.js} +1 -1
  95. package/dist/assets/{utils-O0lAHdlb.js → utils-Djk4rnCT.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-BY401AJ2.js → withTransactionSidePanel-BvWwtSm-.js} +1 -1
  97. package/dist/assets/{zeni-epic-state-6BXRR44j.js → zeni-epic-state-DvHgUD1-.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +1 -1
  100. package/dist/assets/AddressRoutes-B0zuAR6F.js +0 -1
  101. package/dist/assets/CustomerOnboardingAuthScreen-useDkA39.js +0 -1
  102. package/dist/assets/NotFoundScreen-BvZXxX08.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-fDjf6Tur.js";import{A as d}from"./AddressScreen-V8qhbu9d.js";import i from"./NotFoundScreen-D4Av36kV.js";import"./sentry-DjzU4p1F.js";import{o as s,p as r}from"./core-C8Y7fm3n.js";import"./zeni-epic-state-DvHgUD1-.js";import"./recharts-CgIjuHOA.js";import"./index-C3-objML.js";import"./mui-Ky-KJxLh.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.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]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-DrgIMsec.js";import{a as S}from"./sentry-BkoKwCRV.js";import{h as T,u as _,g as E,i as j,j as K,n as B}from"./core-vQwuHvL7.js";import{J as M,m as L,z as $,k as D,B as R,x as z,c as C,e as m,n as F,h,p as N}from"./index-C3mA9Q5U.js";import{KK as k,h2 as U,eQ as G,KL as O,c1 as V,KM as q,kn as H}from"./zeni-epic-state-6BXRR44j.js";import{n as J}from"./mui-Rvgr2IA7.js";import Q from"./NotFoundScreen-BvZXxX08.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]="f27ce78d-17b0-47b0-9b1f-b7de6b4d18f6",e._sentryDebugIdIdentifier="sentry-dbid-f27ce78d-17b0-47b0-9b1f-b7de6b4d18f6")}catch{}})();const W=J.div`
1
+ import{j as r}from"./liveblocks-fDjf6Tur.js";import{a as S}from"./sentry-DjzU4p1F.js";import{h as T,u as _,g as E,i as j,j as K,n as B}from"./core-C8Y7fm3n.js";import{J as M,m as L,z as $,k as D,B as R,x as z,c as C,e as m,n as F,h,p as N}from"./index-C3-objML.js";import{KK as k,h2 as U,eQ as G,KL as O,c1 as V,KM as q,kn as H}from"./zeni-epic-state-DvHgUD1-.js";import{n as J}from"./mui-Ky-KJxLh.js";import Q from"./NotFoundScreen-D4Av36kV.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]="f27ce78d-17b0-47b0-9b1f-b7de6b4d18f6",e._sentryDebugIdIdentifier="sentry-dbid-f27ce78d-17b0-47b0-9b1f-b7de6b4d18f6")}catch{}})();const W=J.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as c}from"./liveblocks-DrgIMsec.js";import{a as r}from"./sentry-BkoKwCRV.js";import{u as ge,h as Ce,g as Ie,j as X,i as ke,n as be}from"./core-vQwuHvL7.js";import{X as xe,z as we,J as Pe,cU as Ee,cV as Te,b6 as Y,cW as ve,b5 as K,p as D,x as L,c as I,cX as F,cY as ye,cZ as Qe,a1 as _e,e as Oe,a7 as Ae,c_ as Ue,a2 as je,q as Le,b1 as Fe,c$ as Re}from"./index-C3mA9Q5U.js";import{fJ as De,eP as ee,eQ as Be,hI as Me,Rx as Ve,eT as Ge,hS as $e,hO as Ne,eR as R,fu as qe,fn as ze,fr as J,fv as He,fw as We,fx as Xe,fy as Ye,fz as Je}from"./zeni-epic-state-6BXRR44j.js";import{D as Ze,n as k,S as Ke,P as et}from"./mui-Rvgr2IA7.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-DYxbqQ5e.js";import{p as st}from"./pathToGoBack-wMl64PVR.js";import"./recharts-BA6FOoyE.js";import"./analytics-DNNAdslX.js";import"./plaid-7_KuF832.js";import"./dnd-D0_5bRGE.js";import"./stripe-DMRn4zHo.js";import"./lottie-BNwbvBq3.js";import"./lexical-BUO93qJ-.js";import"./pdf-DHm_gs_H.js";import"./utils-O0lAHdlb.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="81e05e92-f302-4fd4-9df3-2d4ad3340ebc",a._sentryDebugIdIdentifier="sentry-dbid-81e05e92-f302-4fd4-9df3-2d4ad3340ebc")}catch{}})();const te="chat-response-generated",ot=be(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:S,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:d,setIsAiCfoOpen:f}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,u=We(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:b,currentQuestionAnswerSummary:T}=K(d,t);u!=="answer"?I.trackAICFOChatResponseGenerated(u,b?.question.questionText??"",o.text,t,Re(T,E),o.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(o.text,b?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Xe(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Ye({chatSessionId:o.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),a(Je({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,u)=>{e&&Fe(a,e,p,h,d,l,u,o)},updateCurrentInput:e=>{a(J(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(He(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(J(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{h!=null&&a(ze());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Ae(Ue)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=xe(),s=ge(),m=Ce(),l=Ie(),[S,h]=r.useState(!1);r.useEffect(()=>{s(De())},[s]);const d=X(n=>ee(n)),f=we.getSignedInUser(),{session_id:e}=ke(),p=Pe(),o=_e(p),u=X(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:b,isUploadPromoVisible:T}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),v=Te({currentTenant:u,currentChatSessionId:t,aiCfoView:d}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),x=l.state,w=x?.aiCfoInitialQuestion,B=!!x?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[Y]!==!0)return;h(!0);const g={...n};delete g[Y],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,y]=r.useState(null),[ne,Q]=r.useState(!1),[ie,_]=r.useState(void 0),[re,O]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&w!=null&&w!==""){const n=l.state;y(w),Q(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;O(typeof g=="number"?g:void 0),M.current=!0}},[w,B,l.state]);const le=r.useCallback(()=>{y(null),Q(!1),_(void 0),O(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??x?.aiCfoRef,A=V.get("emailRefId")??x?.aiCfoEmailRefId,$=r.useRef(!1);r.useEffect(()=>{$.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),$.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(y(P),Q(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:N}=ve(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",z=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),H=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=K(H,t),de=ue.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=D(l.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[u.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:N.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[N]);r.useEffect(()=>{U!=="In-Progress"&&j&&s($e())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&z&&f!=null&&U==="Completed"&&!j&&s(Ne(t,f.userId))},[q,z,t,f,s]);const W=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=t!=null&&d.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:I,onLoad:W}),v.drawerElement,c.jsx(it,{children:c.jsx(Z,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(R(u.userRoleId))}})})})]});const Se=c.jsxs(c.Fragment,{children:[S&&!C?c.jsx(L,{analytics:I,onLoad:W}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:I,onLoad:n=>n.trackPageLoaded(Oe.Event.aiCFOPage)}),o&&v.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:H,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:he,isEmptyChatWithSession:de,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?v.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:T,onUploadPromoClose:b,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Ze,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:c.jsx(Z,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})})}):null]}),S&&!o?c.jsx(ye,{open:S,onClose:()=>h(!1),children:c.jsx(Qe,{children:Se})}):null]})},Z=k(Ke)`
1
+ import{j as c}from"./liveblocks-fDjf6Tur.js";import{a as r}from"./sentry-DjzU4p1F.js";import{u as ge,h as Ce,g as Ie,j as X,i as ke,n as be}from"./core-C8Y7fm3n.js";import{X as xe,z as we,J as Pe,cU as Ee,cV as Te,b6 as Y,cW as ve,b5 as K,p as D,x as L,c as I,cX as F,cY as ye,cZ as Qe,a1 as _e,e as Oe,a7 as Ae,c_ as Ue,a2 as je,q as Le,b1 as Fe,c$ as Re}from"./index-C3-objML.js";import{fJ as De,eP as ee,eQ as Be,hI as Me,Rx as Ve,eT as Ge,hS as $e,hO as Ne,eR as R,fu as qe,fn as ze,fr as J,fv as He,fw as We,fx as Xe,fy as Ye,fz as Je}from"./zeni-epic-state-DvHgUD1-.js";import{D as Ze,n as k,S as Ke,P as et}from"./mui-Ky-KJxLh.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-DN1K5TAQ.js";import{p as st}from"./pathToGoBack-9QBEItSt.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="81e05e92-f302-4fd4-9df3-2d4ad3340ebc",a._sentryDebugIdIdentifier="sentry-dbid-81e05e92-f302-4fd4-9df3-2d4ad3340ebc")}catch{}})();const te="chat-response-generated",ot=be(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:S,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:d,setIsAiCfoOpen:f}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,u=We(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:b,currentQuestionAnswerSummary:T}=K(d,t);u!=="answer"?I.trackAICFOChatResponseGenerated(u,b?.question.questionText??"",o.text,t,Re(T,E),o.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(o.text,b?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Xe(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Ye({chatSessionId:o.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),a(Je({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,u)=>{e&&Fe(a,e,p,h,d,l,u,o)},updateCurrentInput:e=>{a(J(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(He(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(J(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{h!=null&&a(ze());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Ae(Ue)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=xe(),s=ge(),m=Ce(),l=Ie(),[S,h]=r.useState(!1);r.useEffect(()=>{s(De())},[s]);const d=X(n=>ee(n)),f=we.getSignedInUser(),{session_id:e}=ke(),p=Pe(),o=_e(p),u=X(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:b,isUploadPromoVisible:T}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),v=Te({currentTenant:u,currentChatSessionId:t,aiCfoView:d}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),x=l.state,w=x?.aiCfoInitialQuestion,B=!!x?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[Y]!==!0)return;h(!0);const g={...n};delete g[Y],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,y]=r.useState(null),[ne,Q]=r.useState(!1),[ie,_]=r.useState(void 0),[re,O]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&w!=null&&w!==""){const n=l.state;y(w),Q(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;O(typeof g=="number"?g:void 0),M.current=!0}},[w,B,l.state]);const le=r.useCallback(()=>{y(null),Q(!1),_(void 0),O(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??x?.aiCfoRef,A=V.get("emailRefId")??x?.aiCfoEmailRefId,$=r.useRef(!1);r.useEffect(()=>{$.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),$.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(y(P),Q(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:N}=ve(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",z=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),H=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=K(H,t),de=ue.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=D(l.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[u.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:N.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[N]);r.useEffect(()=>{U!=="In-Progress"&&j&&s($e())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&z&&f!=null&&U==="Completed"&&!j&&s(Ne(t,f.userId))},[q,z,t,f,s]);const W=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=t!=null&&d.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:I,onLoad:W}),v.drawerElement,c.jsx(it,{children:c.jsx(Z,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(R(u.userRoleId))}})})})]});const Se=c.jsxs(c.Fragment,{children:[S&&!C?c.jsx(L,{analytics:I,onLoad:W}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:I,onLoad:n=>n.trackPageLoaded(Oe.Event.aiCFOPage)}),o&&v.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:H,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:he,isEmptyChatWithSession:de,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?v.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:T,onUploadPromoClose:b,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Ze,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:c.jsx(Z,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})})}):null]}),S&&!o?c.jsx(ye,{open:S,onClose:()=>h(!1),children:c.jsx(Qe,{children:Se})}):null]})},Z=k(Ke)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-DrgIMsec.js";import{a as y}from"./sentry-BkoKwCRV.js";import{h as B,g as U,u as j,j as v,N,n as T,i as O,o as $,p as S}from"./core-vQwuHvL7.js";import{eQ as F,O0 as A,NI as h,yo as I,yi as L,ym as w,yb as q,NK as W,ye as z,yq as H,yp as C}from"./zeni-epic-state-6BXRR44j.js";import{m as P,z as k,B as V,a7 as K,bH as Q,af as _,bI as G}from"./index-C3mA9Q5U.js";import"./mui-Rvgr2IA7.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-CFhmMv-O.js";import M from"./NotFoundScreen-BvZXxX08.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]="eb4b7ca5-9b72-4fc6-9ba6-b34d2b9c6c57",e._sentryDebugIdIdentifier="sentry-dbid-eb4b7ca5-9b72-4fc6-9ba6-b34d2b9c6c57")}catch{}})();const R="bill-approval-rule-update",X=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(R)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a))},onEditRuleClick:a=>{a!=null?(e(w(a)),t(`./${a}/edit`)):(e(w()),t("./new"))}}})(K(Q)),Y=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>A(i)),g=v(i=>h(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(I())},[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(w())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${R}`]:[],eventCallback:(i,x,m)=>{i.endsWith(R)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{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(X,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const t=h(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(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),x=f.actors.selectedNonUsers.map(b=>{const E=!!J(b.value);return{type:E?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(x);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(I()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(I()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(H())},onSaveRuleSuccess:()=>{t("../")}}})(G);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>h(r)),d=v(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(z(!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(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs($,{children:[l.jsx(S,{path:"/",element:l.jsx(Y,{})}),l.jsx(S,{path:"/new",element:l.jsx(D,{})}),l.jsx(S,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(S,{path:"*",element:l.jsx(M,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-fDjf6Tur.js";import{a as y}from"./sentry-DjzU4p1F.js";import{h as B,g as U,u as j,j as v,N,n as T,i as O,o as $,p as S}from"./core-C8Y7fm3n.js";import{eQ as F,O0 as A,NI as h,yo as I,yi as L,ym as w,yb as q,NK as W,ye as z,yq as H,yp as C}from"./zeni-epic-state-DvHgUD1-.js";import{m as P,z as k,B as V,a7 as K,bH as Q,af as _,bI as G}from"./index-C3-objML.js";import"./mui-Ky-KJxLh.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-6mUow2wt.js";import M from"./NotFoundScreen-D4Av36kV.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]="eb4b7ca5-9b72-4fc6-9ba6-b34d2b9c6c57",e._sentryDebugIdIdentifier="sentry-dbid-eb4b7ca5-9b72-4fc6-9ba6-b34d2b9c6c57")}catch{}})();const R="bill-approval-rule-update",X=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(R)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a))},onEditRuleClick:a=>{a!=null?(e(w(a)),t(`./${a}/edit`)):(e(w()),t("./new"))}}})(K(Q)),Y=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>A(i)),g=v(i=>h(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(I())},[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(w())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${R}`]:[],eventCallback:(i,x,m)=>{i.endsWith(R)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{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(X,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const t=h(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(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),x=f.actors.selectedNonUsers.map(b=>{const E=!!J(b.value);return{type:E?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(x);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(I()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(I()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(H())},onSaveRuleSuccess:()=>{t("../")}}})(G);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>h(r)),d=v(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(z(!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(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs($,{children:[l.jsx(S,{path:"/",element:l.jsx(Y,{})}),l.jsx(S,{path:"/new",element:l.jsx(D,{})}),l.jsx(S,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(S,{path:"*",element:l.jsx(M,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DrgIMsec.js";import{h as J,u as se,g as Q,i as ae,j as v,N as te,n as X,l as na,o as ia,p as S}from"./core-vQwuHvL7.js";import{eQ as Z,Ni as Ue,bs as It,Id as oa,bq as wt,bF as pe,Nj as Ct,xI as xt,yS as Ve,yf as la,bn as De,Nk as sa,Nl as ra,c1 as ca,Nm as da,jH as At,Nn as Bt,No as Et,zr as _e,xX as Ae,Np as ua,xw as tt,Nq as pa,CD as ma,xA as ba,xG as Dt,Nr as ke,Ns as Ge,yT as Me,Nt as ha,Nu as ga,yW as Oe,Nv as ya,z7 as Sa,Nw as jt,yD as at,yI as fa,Nx as ka,Ny as ue,Nz as Tt,NA as Pt,NB as Ft,fN as va,y0 as $e,cw as Rt,NC as Ia,gU as wa,ND as Ca,NE as xa,e$ as Nt,eZ as Vt,NF as ze,NG as Aa,NH as Ba,L2 as Ze,NI as Ea,L3 as oe,L4 as He,NJ as Da,NK as ja,NL as Ta,yK as nt,yH as Pa,NM as Fa,NN as Ra,NO as Na,yt as Va,NP as $a,NQ as La,NR as Ua,ck as $t,cL as Lt,jS as _a,bL as Ga,bo as Ut,bM as _t,wO as Ma,NS as Oa,Cq as za,Cw as Za,tb as Ha,yU as Wa,zy as qa,k3 as fe,NT as Ka,NU as Gt,kx as Ja,jZ as Mt,ki as Ot,kh as it,bE as be,bK as Qa,NV as Xa,NW as ve,iC as Ya,NX as ot,NY as en,iG as tn,i$ as an,zM as nn,NZ as on,kq as ln,zC as sn,N_ as lt,zG as rn,zL as cn,zI as dn,zA as un,N$ as zt,xR as pn,O0 as mn,O1 as bn,fF as hn,fE as gn,fD as yn,k6 as Sn,ko as st,kz as fn,qK as kn,kf as vn,zE as In,iM as wn,kE as Cn,O2 as xn,iE as An,qB as Bn,O3 as En,yz as Dn,bG as jn,bt as Tn,JZ as Pn,cN as Fn,cM as Rn,cv as Nn,cB as Vn}from"./zeni-epic-state-6BXRR44j.js";import{m as me,z as N,k as Ie,_ as We,s as le,U as y,aN as Be,B as re,o as B,x as je,c as D,be as $n,p as z,a2 as qe,q as E,J as we,bf as rt,bg as ct,bh as Ln,ak as Un,C as _n,aH as Gn,A as Zt,D as Ke,E as Je,bi as Mn,at as Ht,bj as On,Y as zn,e as Wt,a7 as Zn,bk as Hn,bl as Wn,bm as qn,bn as Kn,bo as Jn,bp as Qn,bq as Xn,br as Yn,bs as ei,H as ti,bt as ai,b9 as ni,bu as ii,bv as oi,a9 as li}from"./index-C3mA9Q5U.js";import{n as L,S as si}from"./mui-Rvgr2IA7.js";import{A as dt}from"./AddressScreen-NGqy9EJ7.js";import{g as ie,a as Te,i as qt,V as Qe,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-BPQIJHK1.js";import{a as f}from"./sentry-BkoKwCRV.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-QJAyq3s4.js";import{u as Kt}from"./useInitialThreadRequest-Baw9vJ__.js";import Ee from"./NotFoundScreen-BvZXxX08.js";import{D as ui}from"./DrawerScreen-BzT5AGON.js";import{M as Jt}from"./MobileAppDrawer-CpuZ4FmH.js";import{F as Qt}from"./FeaturePreviewScreen-CGQO6rrQ.js";import{S as Pe}from"./SetupPagesScreen-CnA3Wri8.js";import{B as pi}from"./BillPayApprovalRoutes-BevyFJ6d.js";import{FallBackRoute as mi}from"./ScreenRoutes-kdWvpwla.js";import"./recharts-BA6FOoyE.js";import"./analytics-DNNAdslX.js";import"./plaid-7_KuF832.js";import"./dnd-D0_5bRGE.js";import"./stripe-DMRn4zHo.js";import"./lottie-BNwbvBq3.js";import"./lexical-BUO93qJ-.js";import"./pdf-DHm_gs_H.js";import"./utils-O0lAHdlb.js";import"./analyticsHelper-BbXHYbAA.js";import"./routePaths-CmhI8CxC.js";import"./BusinessVerificationPageScreen-DiIuM-D8.js";import"./ReimbursementApprovalRuleDetailScreen-CFhmMv-O.js";import"./getLocaleForTenant-TLA-QJ0n.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]="29faa98d-379f-48cc-a221-3b5448890dfa",e._sentryDebugIdIdentifier="sentry-dbid-29faa98d-379f-48cc-a221-3b5448890dfa")}catch{}})();const bi=X(function(e,t){const l=Ue(e,t.billId),i=N.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:At(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/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(Ae(l,"retry")):e(Ae(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(Ae(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(Bt({billId:l}))}}})($n);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=N.getSignedInUser(),u=Ie(),o=v(M=>Z(M)),s=v(M=>Ue(M,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}=Ye({mobileExploreReferrer:"Bill Details"});We({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,C]=f.useState(!1),[x,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:U}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=U(Be.zeniAssistConfig),A=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"&&A===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(M=>M.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,A,r]),f.useEffect(()=>{i!=null&&t(Ct(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(xt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!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 ${B.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:M=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(M)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:x,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=N.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:B.sp10,paddingRight:B.sp3,paddingBottom:"15px",paddingLeft:B.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=N.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Me(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=N.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(Be.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),C=v(F=>Z(F)),[x,_]=f.useState(!1),[T,U]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),A=v(F=>Ge(F,m,g,i));let q=A.fetchState,W=A.file,$=A.showAutofill;const K=v(F=>Ue(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],$=!1);const Y=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;f.useEffect(()=>{i==null&&t(Me(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&x&&_(!1))},[i]),f.useEffect(()=>{x||i==null||u||(_(!0),t(xt(i,h,j,!1)),T||(U(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(U(!0),t(Ve(!1,h,j,b,i)))},[x,T,u,i,t]);const M={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(Oe(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(C.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,C.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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!A.isInitialEdit,billStage:Y}),a.jsx(Ne,{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(Ln,{}),a.jsx(Ne,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ci,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:M,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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,A),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,A),isInitialEdit:!!A.isInitialEdit,billStage:F}),a.jsx(Ne,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Mn();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-fDjf6Tur.js";import{h as J,u as se,g as Q,i as ae,j as v,N as te,n as X,l as na,o as ia,p as S}from"./core-C8Y7fm3n.js";import{eQ as Z,Ni as Ue,bs as It,Id as oa,bq as wt,bF as pe,Nj as Ct,xI as xt,yS as Ve,yf as la,bn as De,Nk as sa,Nl as ra,c1 as ca,Nm as da,jH as At,Nn as Bt,No as Et,zr as _e,xX as Ae,Np as ua,xw as tt,Nq as pa,CD as ma,xA as ba,xG as Dt,Nr as ke,Ns as Ge,yT as Me,Nt as ha,Nu as ga,yW as Oe,Nv as ya,z7 as Sa,Nw as jt,yD as at,yI as fa,Nx as ka,Ny as ue,Nz as Tt,NA as Pt,NB as Ft,fN as va,y0 as $e,cw as Rt,NC as Ia,gU as wa,ND as Ca,NE as xa,e$ as Nt,eZ as Vt,NF as ze,NG as Aa,NH as Ba,L2 as Ze,NI as Ea,L3 as oe,L4 as He,NJ as Da,NK as ja,NL as Ta,yK as nt,yH as Pa,NM as Fa,NN as Ra,NO as Na,yt as Va,NP as $a,NQ as La,NR as Ua,ck as $t,cL as Lt,jS as _a,bL as Ga,bo as Ut,bM as _t,wO as Ma,NS as Oa,Cq as za,Cw as Za,tb as Ha,yU as Wa,zy as qa,k3 as fe,NT as Ka,NU as Gt,kx as Ja,jZ as Mt,ki as Ot,kh as it,bE as be,bK as Qa,NV as Xa,NW as ve,iC as Ya,NX as ot,NY as en,iG as tn,i$ as an,zM as nn,NZ as on,kq as ln,zC as sn,N_ as lt,zG as rn,zL as cn,zI as dn,zA as un,N$ as zt,xR as pn,O0 as mn,O1 as bn,fF as hn,fE as gn,fD as yn,k6 as Sn,ko as st,kz as fn,qK as kn,kf as vn,zE as In,iM as wn,kE as Cn,O2 as xn,iE as An,qB as Bn,O3 as En,yz as Dn,bG as jn,bt as Tn,JZ as Pn,cN as Fn,cM as Rn,cv as Nn,cB as Vn}from"./zeni-epic-state-DvHgUD1-.js";import{m as me,z as N,k as Ie,_ as We,s as le,U as y,aN as Be,B as re,o as B,x as je,c as D,be as $n,p as z,a2 as qe,q as E,J as we,bf as rt,bg as ct,bh as Ln,ak as Un,C as _n,aH as Gn,A as Zt,D as Ke,E as Je,bi as Mn,at as Ht,bj as On,Y as zn,e as Wt,a7 as Zn,bk as Hn,bl as Wn,bm as qn,bn as Kn,bo as Jn,bp as Qn,bq as Xn,br as Yn,bs as ei,H as ti,bt as ai,b9 as ni,bu as ii,bv as oi,a9 as li}from"./index-C3-objML.js";import{n as L,S as si}from"./mui-Ky-KJxLh.js";import{A as dt}from"./AddressScreen-V8qhbu9d.js";import{g as ie,a as Te,i as qt,V as Qe,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-CCXVWOri.js";import{a as f}from"./sentry-DjzU4p1F.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-DDzinN2F.js";import{u as Kt}from"./useInitialThreadRequest-X7WpfR49.js";import Ee from"./NotFoundScreen-D4Av36kV.js";import{D as ui}from"./DrawerScreen-B7V2OyqL.js";import{M as Jt}from"./MobileAppDrawer-DIls_BW2.js";import{F as Qt}from"./FeaturePreviewScreen-2R9FJdWJ.js";import{S as Pe}from"./SetupPagesScreen-DLtasQoq.js";import{B as pi}from"./BillPayApprovalRoutes-B6jqtEYg.js";import{FallBackRoute as mi}from"./ScreenRoutes-BxoMc-Es.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";import"./analyticsHelper-DNuTbD5B.js";import"./routePaths-B8EWQXPr.js";import"./BusinessVerificationPageScreen-DO1Qhw6D.js";import"./ReimbursementApprovalRuleDetailScreen-6mUow2wt.js";import"./getLocaleForTenant-CYgluMQL.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]="29faa98d-379f-48cc-a221-3b5448890dfa",e._sentryDebugIdIdentifier="sentry-dbid-29faa98d-379f-48cc-a221-3b5448890dfa")}catch{}})();const bi=X(function(e,t){const l=Ue(e,t.billId),i=N.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:At(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/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(Ae(l,"retry")):e(Ae(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(Ae(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(Bt({billId:l}))}}})($n);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=N.getSignedInUser(),u=Ie(),o=v(M=>Z(M)),s=v(M=>Ue(M,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}=Ye({mobileExploreReferrer:"Bill Details"});We({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,C]=f.useState(!1),[x,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:U}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=U(Be.zeniAssistConfig),A=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"&&A===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(M=>M.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,A,r]),f.useEffect(()=>{i!=null&&t(Ct(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(xt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!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 ${B.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:M=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(M)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:x,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=N.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:B.sp10,paddingRight:B.sp3,paddingBottom:"15px",paddingLeft:B.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=N.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Me(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=N.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(Be.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),C=v(F=>Z(F)),[x,_]=f.useState(!1),[T,U]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),A=v(F=>Ge(F,m,g,i));let q=A.fetchState,W=A.file,$=A.showAutofill;const K=v(F=>Ue(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],$=!1);const Y=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;f.useEffect(()=>{i==null&&t(Me(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&x&&_(!1))},[i]),f.useEffect(()=>{x||i==null||u||(_(!0),t(xt(i,h,j,!1)),T||(U(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(U(!0),t(Ve(!1,h,j,b,i)))},[x,T,u,i,t]);const M={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(Oe(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(C.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,C.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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!A.isInitialEdit,billStage:Y}),a.jsx(Ne,{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(Ln,{}),a.jsx(Ne,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ci,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:M,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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,A),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,A),isInitialEdit:!!A.isInitialEdit,billStage:F}),a.jsx(Ne,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Mn();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=L.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-DrgIMsec.js";import{a as V}from"./sentry-BkoKwCRV.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-vQwuHvL7.js";import{k as ce,s as ue,aN as de,z as B,x as pe,c as z,af as x,e as E,bD as le,at as me,q as L,au as P}from"./index-C3mA9Q5U.js";import{NQ as fe,eQ as q,sC as ye,Ih as Se,yt as ge,Ba as Ie,DJ as he,Em as be,Fn as Oe,Ob as De,Oc as Te,Od as ke,Oe as Ce,Of as Ve,KL as Ne,Nd as we,KX as Ae,kn as Fe,fF as _e,fE as ve,fD as xe,qK as Ee,qB as Be,qy as ze,kf as Le,sL as Pe,sJ as R,bE as M,sX as U,cu as Re}from"./zeni-epic-state-6BXRR44j.js";import{n as Me}from"./mui-Rvgr2IA7.js";import{d as j}from"./routePaths-CmhI8CxC.js";import{M as Ue}from"./MobileAppDrawer-CpuZ4FmH.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]="9452981a-62ee-4681-95eb-104608210cc9",e._sentryDebugIdIdentifier="sentry-dbid-9452981a-62ee-4681-95eb-104608210cc9")}catch{}})();const je=Me.div`
1
+ import{j as k}from"./liveblocks-fDjf6Tur.js";import{a as V}from"./sentry-DjzU4p1F.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-C8Y7fm3n.js";import{k as ce,s as ue,aN as de,z as B,x as pe,c as z,af as x,e as E,bD as le,at as me,q as L,au as P}from"./index-C3-objML.js";import{NQ as fe,eQ as q,sC as ye,Ih as Se,yt as ge,Ba as Ie,DJ as he,Em as be,Fn as Oe,Ob as De,Oc as Te,Od as ke,Oe as Ce,Of as Ve,KL as Ne,Nd as we,KX as Ae,kn as Fe,fF as _e,fE as ve,fD as xe,qK as Ee,qB as Be,qy as ze,kf as Le,sL as Pe,sJ as R,bE as M,sX as U,cu as Re}from"./zeni-epic-state-DvHgUD1-.js";import{n as Me}from"./mui-Ky-KJxLh.js";import{d as j}from"./routePaths-B8EWQXPr.js";import{M as Ue}from"./MobileAppDrawer-DIls_BW2.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]="9452981a-62ee-4681-95eb-104608210cc9",e._sentryDebugIdIdentifier="sentry-dbid-9452981a-62ee-4681-95eb-104608210cc9")}catch{}})();const je=Me.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-DrgIMsec.js";import{h as me,i as ba,u as Ce,j as S,g as Se,n as he,N as Fa,s as jt,o as Rn,p as se}from"./core-vQwuHvL7.js";import{eQ as de,bt as Ne,PL as ja,eZ as Ie,e_ as Ae,e$ as Ee,fU as Ke,cr as qe,PM as Je,PN as lt,tR as Ba,jP as La,PO as xa,gU as pa,At as ca,Av as He,Aw as ut,jF as Vt,PP as Xe,Ah as ha,PQ as Un,PR as On,Ak as Va,PS as jn,O8 as Ha,s1 as Ht,Aq as na,h3 as Vn,PT as Nt,PU as ea,bo as Hn,PV as Nn,fF as Na,fE as Ma,A_ as Mn,fD as $a,NQ as $n,PW as Mt,ck as $t,cL as Gn,O7 as ya,BA as Gt,PX as Tt,Ba as fa,PY as zt,BB as zn,OA as Qn,BC as Yn,Cw as Zn,tb as Wn,Cq as Kn,PZ as qn,Au as Ye,P_ as Jn,P$ as Xn,Q0 as er,Q1 as ar,Q2 as tr,Q3 as mt,Q4 as nr,AL as Qt,AE as rr,Q5 as sr,fW as cr,AU as Yt,AY as Zt,fV as or,Q6 as ir,Bm as Wt,Q7 as dr,Q8 as lr,Q9 as ur,AW as Kt,AH as qt,An as Jt,AQ as Xt,AO as en,AS as mr,Qa as an,Qb as Ga,B7 as ga,KQ as tn,cM as Ct,Qc as Cr,Qd as pr,Qe as hr,Qf as fr,B4 as st,Bt as gr,Bp as br,B0 as yr,Br as Sr,Bh as Ir,Bj as Ar,Qg as nn,Bz as Ta,Id as Er,Qh as kr,Qi as _r,Qj as Dr,Qk as rn,Ql as wr,BW as Pr,B9 as sn,B3 as ve,B8 as vr,Qm as Tr,Qn as Fr,Ae as Br,Qo as cn,Qp as on,Qq as Lr,Ag as xr,Af as Ft,Qr as Rr,Qs as Ur,Qt as Or,KM as jr,Qu as pt,Qv as Vr,wR as dn,kn as Hr,gV as Nr,B$ as Mr,Qw as ln,Qx as $r,C0 as Gr,Qy as zr,dd as Qr,tL as Yr,BR as Zr,BL as Ve,bs as Wr,bF as Kr,cw as qr,bG as Jr,JZ as Xr}from"./zeni-epic-state-6BXRR44j.js";import{z as ee,k as $e,s as oe,U as Q,B as Sa,c4 as za,cf as es,cg as as,ch as ts,p as Re,ci as ns,cj as rs,J as Ia,aN as xe,q as ye,bo as ht,ck as ss,A as Aa,h as Qa,m as ft,c as K,D as gt,a7 as Ya,cl as cs,_ as un,aq as bt,bA as ra,cm as ct,cn as os,x as yt,co as is,at as mn,a2 as ot,Y as Cn,e as pn,cp as ds,cq as ls,cr as us,cs as ms,ct as Cs,cu as ps,o as Ra,cv as hs,cw as fs,cx as at,H as gs,cy as bs,cz as ys,cA as Ss,cB as Is,cC as As,a9 as Es}from"./index-C3mA9Q5U.js";import{n as Te,D as hn,S as ks}from"./mui-Rvgr2IA7.js";import{a as d}from"./sentry-BkoKwCRV.js";import{g as pe,a as Ea,b as fn,c as ke,d as _e,e as Me,f as Ge,h as ze,A as _s,i as St,P as Ds,j as It,s as sa,k as gn,l as Ze,m as bn,n as ws,o as yn,p as Ps,S as Bt}from"./SetupPagesScreen-CnA3Wri8.js";import{u as Sn}from"./useInitialThreadRequest-Baw9vJ__.js";import Za from"./NotFoundScreen-BvZXxX08.js";import{M as We}from"./MobileAppDrawer-CpuZ4FmH.js";import{u as In}from"./useAskAiCfoHostNavButtonProps-QJAyq3s4.js";import{v as Lt}from"./utils-O0lAHdlb.js";import{d as vs}from"./recharts-BA6FOoyE.js";import{t as Ts}from"./AddressScreen-NGqy9EJ7.js";import"./analytics-DNNAdslX.js";import"./plaid-7_KuF832.js";import"./dnd-D0_5bRGE.js";import"./stripe-DMRn4zHo.js";import"./lottie-BNwbvBq3.js";import"./lexical-BUO93qJ-.js";import"./pdf-DHm_gs_H.js";import"./analyticsHelper-BbXHYbAA.js";import"./routePaths-CmhI8CxC.js";import"./BusinessVerificationPageScreen-DiIuM-D8.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]="08065324-95b6-4a7e-aeb4-76ca9734a9d1",e._sentryDebugIdIdentifier="sentry-dbid-08065324-95b6-4a7e-aeb4-76ca9734a9d1")}catch{}})();function Fs(){const e=me(),{cardId:a}=ba(),t=Ce(),r=ee.getSignedInUser(),n=S(Z=>de(Z)),f=$e(),p=Ne(f?.loggedInUserRoleMap),{useFeatureGate:g}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,c]=d.useState(!1),l=S(Z=>ja(Z).firstViewAfterActivation);if(a==null)throw Error("Empty card id is not valid...");const v=n.userRole.includes("charge_card_user"),{isFeatureEnabled:y}=g(Q.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:L}=g(Q.isDebitCardFeatureEnabled),F=Ie(n),x=Ae(n),C=Ee(L,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=ke({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:C}),o=_e({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:y,isBookKeepingTenant:x,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:u}),I=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S(Z=>Ke(Z,n.companyId)),j=qe(A.controllers),{creditAccount:E,creditAccountRepayment:b}=S(Z=>Je(Z)),B=S(Z=>Z.classListState.fetchState),i=!v&&o&&h,m=S(Z=>lt(Z,a,i,o)),[U,M]=d.useState(!1),R=m.chargeCard,T=R?.cardCreatedByUser?.userId,$=S(Z=>T!=null?Ba(Z.userRoleState,T):void 0),G=$?.accountingClassIDs[0],V=S(Z=>G!=null?La(Z.classState,{classId:G,reportId:"class_list"}):void 0),w=R?.cardHolderUser?.userId,Y=S(Z=>w!=null?Ba(Z.userRoleState,w):void 0),q=Y?.accountingClassIDs[0],P=S(Z=>q!=null?La(Z.classState,{classId:q,reportId:"class_list"}):void 0),O=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",te=R?.type.code==="business_physical_debit_card";d.useEffect(()=>{l&&_===!1&&O&&(c(!0),setTimeout(()=>{t(xa()),te&&t(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[l,_,O,te]),d.useEffect(()=>{U||m.fetchState==="Completed"||m.fetchState==="In-Progress"||a==null||(M(!0),t(ca(a,i,!1)))},[U,m,a,t]),d.useEffect(()=>{if(m.fetchState==="Completed"&&(O===!1||O&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||l===!1&&_===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const Z=pe(n.tenantEmailDomain,a,r,R,l);e(Z)}},[m.fetchState,l,O]),d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&o&&h&&p&&t(He()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&o&&h&&p&&t(ut()),B!=="Completed"&&B!=="In-Progress"&&t(Vt())},[E.fetchState,b.fetchState,t,o,h,p,B]);const ae=()=>{if(r!=null&&a!=null){t(xa());const Z=pe(n.tenantEmailDomain,a,r);e(Z)}},k=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",z=Me(o,D,I,h),J=Ea(o,h,p,E,b),X=fn(k,m);return m.fetchState!=="Completed"?s.jsx(Sa,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:l}),s.jsx(es,{onGotItClick:ae,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:o,isDebitCardFeatureEnabled:D,isDebitCardSetupEnabled:I,isChargeCardSetupEnabled:h,productInformation:z,creditAccountInformation:J,debitAccountInformation:X,chargeCardDetailView:m,creditAccount:E,classListFetchState:B,creditAccountRepayment:b,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:Y?.userRoles,cardHolderDepartmentName:P?.className})]})}const At=e=>{const{events:a,onEvent:t,onSubscribed:r}=e,n=as(),f=d.useRef(t),p=d.useRef(r),g=d.useRef(0);d.useEffect(()=>{f.current=t},[t]),d.useEffect(()=>{p.current=r},[r]);const _=d.useMemo(()=>[...a].sort().join("|"),[a]);d.useEffect(()=>{if(n==null||a.length===0)return;const c=[],l=new Set,v=()=>{if(p.current==null)return;const y=Date.now();y-g.current<5e3||(g.current=y,p.current())};return a.forEach(y=>{const[h,L]=ts(y);if(L==="")return;const F=n.channel(h),x=u=>{f.current(L,u)};let C;if(F?.subscribed===!0)C=F,C.bind(L,x),l.has(h)||(l.add(h),v()),c.push(()=>{F.unbind(L,x)});else{if(C=F??n.subscribe(h),C.bind(L,x),!l.has(h)){l.add(h);const u=()=>{v()};C.bind("pusher:subscription_succeeded",u),c.push(()=>{C.unbind("pusher:subscription_succeeded",u)})}c.push(()=>{C.unbind(L,x)})}}),()=>{c.forEach(y=>y())}},[n,_])},An="charge-card-transaction-update",En="charge-card-transaction-created",kn="charge-card-transaction-declined",_n="charge-card-transaction-updated",Dn="charge-card-transaction-receipt-uploaded",aa="charge-card-status-update",Et="charge-card-spending-updated",Wa="credit-account-balance-updated",Ka="charge-card-created",kt="charge-card-limit-updated",_t="charge-card-limit-reset",Dt="charge-card-renamed",Bs="charge-card-department-updated",wn="charge-card-repayment-completed",Pn="charge-card-payment-date-updated",ka="charge-card-cashback-redeemed",_a="charge-card-cashback-earned",ta=(e,a)=>e==null||e===""?[]:a.map(t=>`private-encrypted-${e}.${t}`),Ls=[_a,ka],xs=he(function(e){const a=Xe(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(a,t)=>{e(Un({uiState:{sortKey:a,sortOrder:t}}))}}})(rs);function Rs(){const e=me(),a=Ce(),t=Se(),r=ee.getSignedInUser(),n=S(L=>de(L)),{useFeatureGate:f}=oe(),{isFeatureEnabled:p}=f(Q.isCardsCommentingEnabled),[g,_]=d.useState(!1),c=S(L=>Xe(L)),l=Sn(n.companyId,{clearParams:c.fetchState==="Completed"}),v=d.useCallback(()=>{const L=Re(t.state?.pathnameStackToGoBack),F=L.poppedPathname??Us(n.tenantEmailDomain);e(F,{state:{pathnameStackToGoBack:L.newStack}})},[e,t,n.tenantEmailDomain]),y=Ge(n);if(At({events:ta(y,Ls),onEvent:L=>{switch(L){case _a:case ka:return void a(ha(!0))}},onSubscribed:()=>{a(ha(!0))}}),d.useEffect(()=>{g||c.fetchState==="Completed"||c.fetchState==="In-Progress"||(_(!0),a(ha()))},[g,c,a]),r==null)throw Error("Can't access cashback detail page without signing in...");const h=c.cashbackSummary?.cashbackEarned?.amount!=null&&c.fetchState!=="Not-Started";return c.fetchState!=="In-Progress"||h?(c.cashbackSummary?.cashbackEarned?.amount??0)===0&&c.fetchState==="Completed"?s.jsx(Za,{}):s.jsx(xs,{onBackClick:v,isCardsCommentingEnabled:p,initialOpenThreadRequest:l}):s.jsx(ns,{onBackClick:v})}const Us=e=>`/${e}/cards`,Os={containerWidth:new Aa(100,58)},js=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p}=oe(),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,L]=d.useState(!1),F=ee.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const x=S(P=>de(P));if(n==null)throw Error("Empty card id is not valid...");const{configValue:C}=p(xe.zeniCardsConfig),u=C.max_charge_card_activation_attempts_by_card_id,D=S(P=>On(P,n)),o=D.chargeCard,I=S(P=>P.chargeCardConfigState.fetchState),{useFeatureGate:A}=oe(),{isFeatureEnabled:j}=A(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=A(Q.isDebitCardFeatureEnabled),b=Ee(E,x),B=ke({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:b}),i=!!x.companyChargeCardInfo?.info?.isChargeCardEnabled,m=x.userRole.includes("charge_card_user"),U=Ie(x),M=Ae(x),R=x.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,T=_e({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:j,isBookKeepingTenant:M,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:R}),$=!m&&T&&i;d.useEffect(()=>{g===!1&&I!=="In-Progress"&&I!=="Completed"&&(t(Va()),_(!0)),c===!1&&D.fetchState==="Not-Started"&&(l(!0),t(ca(n,$,T)))},[c,D.fetchState,g,I]);const G=o?.type.code==="business_physical_credit_card"||o?.type.code==="business_physical_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(v===!1&&(G===!1||G&&o?.status?.code!=="inactive"||o?.cardHolderUserId!==F.userId)){const P=pe(x.tenantEmailDomain,n,F,o,!0),O=ye(f.state?.pathnameStackToGoBack,f.pathname);r(P,{state:{pathnameStackToGoBack:O}})}else if(v&&D.isRefreshingViewInBackground===!1&&o?.status?.code==="active"){t(jn({chargeCardId:n}));const P=pe(x.tenantEmailDomain,n,F,o,!0),O=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Ha()),r(P,{state:{pathnameStackToGoBack:O}})}}},[D.fetchState,o?.type.code,v,D.isRefreshingViewInBackground]);const V=ee.getZeniOtpTokenForCardHolder(n),w=S(P=>Ht(P.userState,F.userId)),Y=()=>{o?.status?.code!=="active"&&t(na(n,!0))};d.useEffect(()=>{D.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&o?.cardActivationAttemptHistory.some(P=>P.statusCode==="success")===!0&&v===!1&&(setTimeout(Y,3e3),y(!0))},[D.updatePhysicalChargeCardAttemptFetchState.fetchState,o?.cardActivationAttemptHistory]);const q=P=>{L(P)};if(I!=="Completed"||o==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(o.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(w?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Ns,{children:[s.jsx(We,{isAppContentDrawerOpen:h,handleDrawerToggle:q}),s.jsx(Vs,{cardId:n,card:o,shippingAddressId:o.shippingAddressId,phone:w.phone,signedInUser:F,isSandboxEnv:ht(),chargeCardDetailState:D,signedInUserToken:V,navigate:r,currentTenant:x,location:f,maxChargeCardActivationAttempts:u[n]!=null?u[n]:C.default_max_charge_card_activation_attempts!=null?C.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{q(!0)}}),e!=null?s.jsx(Hs,{windowSize:a,children:e}):null]})},Vs=he(function(e,{chargeCardDetailState:a,shippingAddressId:t,location:r,cardId:n}){const f=Vn(e.addressState,t);if(f==null)throw Error("Can't access shippingAddress.");const p=Nt(e,n),g=a.updateStatus,_=ea(e,!1,!1,!1);let c=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(c=!0);const l=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Hn())||l,showMenuIcon:c,shippingAddress:f,vgsVaultId:Qa.cardVaultId,twoFAView:p,activationWaitStatus:g,isRefreshingViewInBackground:a.isRefreshingViewInBackground}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,chargeCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e($a(c,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:c=>{e(Mn(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Na(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onCVVActivateSuccess:()=>{e(Nn({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("onboard")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(ss),Hs=Te.div`
1
+ import{j as s}from"./liveblocks-fDjf6Tur.js";import{h as me,i as ba,u as Ce,j as S,g as Se,n as he,N as Fa,s as jt,o as Rn,p as se}from"./core-C8Y7fm3n.js";import{eQ as de,bt as Ne,PL as ja,eZ as Ie,e_ as Ae,e$ as Ee,fU as Ke,cr as qe,PM as Je,PN as lt,tR as Ba,jP as La,PO as xa,gU as pa,At as ca,Av as He,Aw as ut,jF as Vt,PP as Xe,Ah as ha,PQ as Un,PR as On,Ak as Va,PS as jn,O8 as Ha,s1 as Ht,Aq as na,h3 as Vn,PT as Nt,PU as ea,bo as Hn,PV as Nn,fF as Na,fE as Ma,A_ as Mn,fD as $a,NQ as $n,PW as Mt,ck as $t,cL as Gn,O7 as ya,BA as Gt,PX as Tt,Ba as fa,PY as zt,BB as zn,OA as Qn,BC as Yn,Cw as Zn,tb as Wn,Cq as Kn,PZ as qn,Au as Ye,P_ as Jn,P$ as Xn,Q0 as er,Q1 as ar,Q2 as tr,Q3 as mt,Q4 as nr,AL as Qt,AE as rr,Q5 as sr,fW as cr,AU as Yt,AY as Zt,fV as or,Q6 as ir,Bm as Wt,Q7 as dr,Q8 as lr,Q9 as ur,AW as Kt,AH as qt,An as Jt,AQ as Xt,AO as en,AS as mr,Qa as an,Qb as Ga,B7 as ga,KQ as tn,cM as Ct,Qc as Cr,Qd as pr,Qe as hr,Qf as fr,B4 as st,Bt as gr,Bp as br,B0 as yr,Br as Sr,Bh as Ir,Bj as Ar,Qg as nn,Bz as Ta,Id as Er,Qh as kr,Qi as _r,Qj as Dr,Qk as rn,Ql as wr,BW as Pr,B9 as sn,B3 as ve,B8 as vr,Qm as Tr,Qn as Fr,Ae as Br,Qo as cn,Qp as on,Qq as Lr,Ag as xr,Af as Ft,Qr as Rr,Qs as Ur,Qt as Or,KM as jr,Qu as pt,Qv as Vr,wR as dn,kn as Hr,gV as Nr,B$ as Mr,Qw as ln,Qx as $r,C0 as Gr,Qy as zr,dd as Qr,tL as Yr,BR as Zr,BL as Ve,bs as Wr,bF as Kr,cw as qr,bG as Jr,JZ as Xr}from"./zeni-epic-state-DvHgUD1-.js";import{z as ee,k as $e,s as oe,U as Q,B as Sa,c4 as za,cf as es,cg as as,ch as ts,p as Re,ci as ns,cj as rs,J as Ia,aN as xe,q as ye,bo as ht,ck as ss,A as Aa,h as Qa,m as ft,c as K,D as gt,a7 as Ya,cl as cs,_ as un,aq as bt,bA as ra,cm as ct,cn as os,x as yt,co as is,at as mn,a2 as ot,Y as Cn,e as pn,cp as ds,cq as ls,cr as us,cs as ms,ct as Cs,cu as ps,o as Ra,cv as hs,cw as fs,cx as at,H as gs,cy as bs,cz as ys,cA as Ss,cB as Is,cC as As,a9 as Es}from"./index-C3-objML.js";import{n as Te,D as hn,S as ks}from"./mui-Ky-KJxLh.js";import{a as d}from"./sentry-DjzU4p1F.js";import{g as pe,a as Ea,b as fn,c as ke,d as _e,e as Me,f as Ge,h as ze,A as _s,i as St,P as Ds,j as It,s as sa,k as gn,l as Ze,m as bn,n as ws,o as yn,p as Ps,S as Bt}from"./SetupPagesScreen-DLtasQoq.js";import{u as Sn}from"./useInitialThreadRequest-X7WpfR49.js";import Za from"./NotFoundScreen-D4Av36kV.js";import{M as We}from"./MobileAppDrawer-DIls_BW2.js";import{u as In}from"./useAskAiCfoHostNavButtonProps-DDzinN2F.js";import{v as Lt}from"./utils-Djk4rnCT.js";import{d as vs}from"./recharts-CgIjuHOA.js";import{t as Ts}from"./AddressScreen-V8qhbu9d.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./analyticsHelper-DNuTbD5B.js";import"./routePaths-B8EWQXPr.js";import"./BusinessVerificationPageScreen-DO1Qhw6D.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]="08065324-95b6-4a7e-aeb4-76ca9734a9d1",e._sentryDebugIdIdentifier="sentry-dbid-08065324-95b6-4a7e-aeb4-76ca9734a9d1")}catch{}})();function Fs(){const e=me(),{cardId:a}=ba(),t=Ce(),r=ee.getSignedInUser(),n=S(Z=>de(Z)),f=$e(),p=Ne(f?.loggedInUserRoleMap),{useFeatureGate:g}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,c]=d.useState(!1),l=S(Z=>ja(Z).firstViewAfterActivation);if(a==null)throw Error("Empty card id is not valid...");const v=n.userRole.includes("charge_card_user"),{isFeatureEnabled:y}=g(Q.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:L}=g(Q.isDebitCardFeatureEnabled),F=Ie(n),x=Ae(n),C=Ee(L,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=ke({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:C}),o=_e({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:y,isBookKeepingTenant:x,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:u}),I=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S(Z=>Ke(Z,n.companyId)),j=qe(A.controllers),{creditAccount:E,creditAccountRepayment:b}=S(Z=>Je(Z)),B=S(Z=>Z.classListState.fetchState),i=!v&&o&&h,m=S(Z=>lt(Z,a,i,o)),[U,M]=d.useState(!1),R=m.chargeCard,T=R?.cardCreatedByUser?.userId,$=S(Z=>T!=null?Ba(Z.userRoleState,T):void 0),G=$?.accountingClassIDs[0],V=S(Z=>G!=null?La(Z.classState,{classId:G,reportId:"class_list"}):void 0),w=R?.cardHolderUser?.userId,Y=S(Z=>w!=null?Ba(Z.userRoleState,w):void 0),q=Y?.accountingClassIDs[0],P=S(Z=>q!=null?La(Z.classState,{classId:q,reportId:"class_list"}):void 0),O=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",te=R?.type.code==="business_physical_debit_card";d.useEffect(()=>{l&&_===!1&&O&&(c(!0),setTimeout(()=>{t(xa()),te&&t(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[l,_,O,te]),d.useEffect(()=>{U||m.fetchState==="Completed"||m.fetchState==="In-Progress"||a==null||(M(!0),t(ca(a,i,!1)))},[U,m,a,t]),d.useEffect(()=>{if(m.fetchState==="Completed"&&(O===!1||O&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||l===!1&&_===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const Z=pe(n.tenantEmailDomain,a,r,R,l);e(Z)}},[m.fetchState,l,O]),d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&o&&h&&p&&t(He()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&o&&h&&p&&t(ut()),B!=="Completed"&&B!=="In-Progress"&&t(Vt())},[E.fetchState,b.fetchState,t,o,h,p,B]);const ae=()=>{if(r!=null&&a!=null){t(xa());const Z=pe(n.tenantEmailDomain,a,r);e(Z)}},k=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",z=Me(o,D,I,h),J=Ea(o,h,p,E,b),X=fn(k,m);return m.fetchState!=="Completed"?s.jsx(Sa,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:l}),s.jsx(es,{onGotItClick:ae,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:o,isDebitCardFeatureEnabled:D,isDebitCardSetupEnabled:I,isChargeCardSetupEnabled:h,productInformation:z,creditAccountInformation:J,debitAccountInformation:X,chargeCardDetailView:m,creditAccount:E,classListFetchState:B,creditAccountRepayment:b,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:Y?.userRoles,cardHolderDepartmentName:P?.className})]})}const At=e=>{const{events:a,onEvent:t,onSubscribed:r}=e,n=as(),f=d.useRef(t),p=d.useRef(r),g=d.useRef(0);d.useEffect(()=>{f.current=t},[t]),d.useEffect(()=>{p.current=r},[r]);const _=d.useMemo(()=>[...a].sort().join("|"),[a]);d.useEffect(()=>{if(n==null||a.length===0)return;const c=[],l=new Set,v=()=>{if(p.current==null)return;const y=Date.now();y-g.current<5e3||(g.current=y,p.current())};return a.forEach(y=>{const[h,L]=ts(y);if(L==="")return;const F=n.channel(h),x=u=>{f.current(L,u)};let C;if(F?.subscribed===!0)C=F,C.bind(L,x),l.has(h)||(l.add(h),v()),c.push(()=>{F.unbind(L,x)});else{if(C=F??n.subscribe(h),C.bind(L,x),!l.has(h)){l.add(h);const u=()=>{v()};C.bind("pusher:subscription_succeeded",u),c.push(()=>{C.unbind("pusher:subscription_succeeded",u)})}c.push(()=>{C.unbind(L,x)})}}),()=>{c.forEach(y=>y())}},[n,_])},An="charge-card-transaction-update",En="charge-card-transaction-created",kn="charge-card-transaction-declined",_n="charge-card-transaction-updated",Dn="charge-card-transaction-receipt-uploaded",aa="charge-card-status-update",Et="charge-card-spending-updated",Wa="credit-account-balance-updated",Ka="charge-card-created",kt="charge-card-limit-updated",_t="charge-card-limit-reset",Dt="charge-card-renamed",Bs="charge-card-department-updated",wn="charge-card-repayment-completed",Pn="charge-card-payment-date-updated",ka="charge-card-cashback-redeemed",_a="charge-card-cashback-earned",ta=(e,a)=>e==null||e===""?[]:a.map(t=>`private-encrypted-${e}.${t}`),Ls=[_a,ka],xs=he(function(e){const a=Xe(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(a,t)=>{e(Un({uiState:{sortKey:a,sortOrder:t}}))}}})(rs);function Rs(){const e=me(),a=Ce(),t=Se(),r=ee.getSignedInUser(),n=S(L=>de(L)),{useFeatureGate:f}=oe(),{isFeatureEnabled:p}=f(Q.isCardsCommentingEnabled),[g,_]=d.useState(!1),c=S(L=>Xe(L)),l=Sn(n.companyId,{clearParams:c.fetchState==="Completed"}),v=d.useCallback(()=>{const L=Re(t.state?.pathnameStackToGoBack),F=L.poppedPathname??Us(n.tenantEmailDomain);e(F,{state:{pathnameStackToGoBack:L.newStack}})},[e,t,n.tenantEmailDomain]),y=Ge(n);if(At({events:ta(y,Ls),onEvent:L=>{switch(L){case _a:case ka:return void a(ha(!0))}},onSubscribed:()=>{a(ha(!0))}}),d.useEffect(()=>{g||c.fetchState==="Completed"||c.fetchState==="In-Progress"||(_(!0),a(ha()))},[g,c,a]),r==null)throw Error("Can't access cashback detail page without signing in...");const h=c.cashbackSummary?.cashbackEarned?.amount!=null&&c.fetchState!=="Not-Started";return c.fetchState!=="In-Progress"||h?(c.cashbackSummary?.cashbackEarned?.amount??0)===0&&c.fetchState==="Completed"?s.jsx(Za,{}):s.jsx(xs,{onBackClick:v,isCardsCommentingEnabled:p,initialOpenThreadRequest:l}):s.jsx(ns,{onBackClick:v})}const Us=e=>`/${e}/cards`,Os={containerWidth:new Aa(100,58)},js=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p}=oe(),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,L]=d.useState(!1),F=ee.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const x=S(P=>de(P));if(n==null)throw Error("Empty card id is not valid...");const{configValue:C}=p(xe.zeniCardsConfig),u=C.max_charge_card_activation_attempts_by_card_id,D=S(P=>On(P,n)),o=D.chargeCard,I=S(P=>P.chargeCardConfigState.fetchState),{useFeatureGate:A}=oe(),{isFeatureEnabled:j}=A(Q.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=A(Q.isDebitCardFeatureEnabled),b=Ee(E,x),B=ke({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:b}),i=!!x.companyChargeCardInfo?.info?.isChargeCardEnabled,m=x.userRole.includes("charge_card_user"),U=Ie(x),M=Ae(x),R=x.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,T=_e({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:j,isBookKeepingTenant:M,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:R}),$=!m&&T&&i;d.useEffect(()=>{g===!1&&I!=="In-Progress"&&I!=="Completed"&&(t(Va()),_(!0)),c===!1&&D.fetchState==="Not-Started"&&(l(!0),t(ca(n,$,T)))},[c,D.fetchState,g,I]);const G=o?.type.code==="business_physical_credit_card"||o?.type.code==="business_physical_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(v===!1&&(G===!1||G&&o?.status?.code!=="inactive"||o?.cardHolderUserId!==F.userId)){const P=pe(x.tenantEmailDomain,n,F,o,!0),O=ye(f.state?.pathnameStackToGoBack,f.pathname);r(P,{state:{pathnameStackToGoBack:O}})}else if(v&&D.isRefreshingViewInBackground===!1&&o?.status?.code==="active"){t(jn({chargeCardId:n}));const P=pe(x.tenantEmailDomain,n,F,o,!0),O=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Ha()),r(P,{state:{pathnameStackToGoBack:O}})}}},[D.fetchState,o?.type.code,v,D.isRefreshingViewInBackground]);const V=ee.getZeniOtpTokenForCardHolder(n),w=S(P=>Ht(P.userState,F.userId)),Y=()=>{o?.status?.code!=="active"&&t(na(n,!0))};d.useEffect(()=>{D.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&o?.cardActivationAttemptHistory.some(P=>P.statusCode==="success")===!0&&v===!1&&(setTimeout(Y,3e3),y(!0))},[D.updatePhysicalChargeCardAttemptFetchState.fetchState,o?.cardActivationAttemptHistory]);const q=P=>{L(P)};if(I!=="Completed"||o==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(o.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(w?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Ns,{children:[s.jsx(We,{isAppContentDrawerOpen:h,handleDrawerToggle:q}),s.jsx(Vs,{cardId:n,card:o,shippingAddressId:o.shippingAddressId,phone:w.phone,signedInUser:F,isSandboxEnv:ht(),chargeCardDetailState:D,signedInUserToken:V,navigate:r,currentTenant:x,location:f,maxChargeCardActivationAttempts:u[n]!=null?u[n]:C.default_max_charge_card_activation_attempts!=null?C.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{q(!0)}}),e!=null?s.jsx(Hs,{windowSize:a,children:e}):null]})},Vs=he(function(e,{chargeCardDetailState:a,shippingAddressId:t,location:r,cardId:n}){const f=Vn(e.addressState,t);if(f==null)throw Error("Can't access shippingAddress.");const p=Nt(e,n),g=a.updateStatus,_=ea(e,!1,!1,!1);let c=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(c=!0);const l=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Hn())||l,showMenuIcon:c,shippingAddress:f,vgsVaultId:Qa.cardVaultId,twoFAView:p,activationWaitStatus:g,isRefreshingViewInBackground:a.isRefreshingViewInBackground}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,chargeCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e($a(c,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:c=>{e(Mn(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Na(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onCVVActivateSuccess:()=>{e(Nn({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("onboard")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(ss),Hs=Te.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Os.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-DrgIMsec.js";import{a as g}from"./sentry-BkoKwCRV.js";import{h as w,u as T,g as x,i as k,j as O,n as E}from"./core-vQwuHvL7.js";import{z as N,b9 as F,x as P,c as V,e as L,af as C,ba as A,at as j,au as U,q as B}from"./index-C3mA9Q5U.js";import{eQ as D,fH as M,sC as _,fC as R,c1 as q,Nd as z,bn as G,qK as H,qy as Y,kf as K,lL as S,Ne as Q,bE as W,cu as b,lT as Z,lW as $}from"./zeni-epic-state-6BXRR44j.js";import"./mui-Rvgr2IA7.js";import{d as J}from"./routePaths-CmhI8CxC.js";import{M as X}from"./MobileAppDrawer-CpuZ4FmH.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="a68ed615-fdf7-4992-892d-d89b0e0e9695",t._sentryDebugIdIdentifier="sentry-dbid-a68ed615-fdf7-4992-892d-d89b0e0e9695")}catch{}})();const ee=E(function(t){const a=R(t),i=N.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=q(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${j.fileMicroServiceBaseUrl}`,isZeniUser:G(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t($())},onAddressClick:e=>{const n=J(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(Z({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?b(u):void 0,meetingLink:y!=""&&y!=null?b(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?W(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]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(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=>{t(Q(e))},onCompanyOfficerUpdated:e=>{t(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=>{t(K({files:e}))},onDeleteFile:e=>{t(Y(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}})(A);function de(){const t=w(),a=T(),i=x(),{tenantEmailDomain:l}=k(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(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||n!=="Not-Started"||d==null||(p(!0),a(M(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(L.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-fDjf6Tur.js";import{a as g}from"./sentry-DjzU4p1F.js";import{h as w,u as T,g as x,i as k,j as O,n as E}from"./core-C8Y7fm3n.js";import{z as N,b9 as F,x as P,c as V,e as L,af as C,ba as A,at as j,au as U,q as B}from"./index-C3-objML.js";import{eQ as D,fH as M,sC as _,fC as R,c1 as q,Nd as z,bn as G,qK as H,qy as Y,kf as K,lL as S,Ne as Q,bE as W,cu as b,lT as Z,lW as $}from"./zeni-epic-state-DvHgUD1-.js";import"./mui-Ky-KJxLh.js";import{d as J}from"./routePaths-B8EWQXPr.js";import{M as X}from"./MobileAppDrawer-DIls_BW2.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="a68ed615-fdf7-4992-892d-d89b0e0e9695",t._sentryDebugIdIdentifier="sentry-dbid-a68ed615-fdf7-4992-892d-d89b0e0e9695")}catch{}})();const ee=E(function(t){const a=R(t),i=N.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=q(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${j.fileMicroServiceBaseUrl}`,isZeniUser:G(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t($())},onAddressClick:e=>{const n=J(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(Z({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?b(u):void 0,meetingLink:y!=""&&y!=null?b(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?W(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]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(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=>{t(Q(e))},onCompanyOfficerUpdated:e=>{t(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=>{t(K({files:e}))},onDeleteFile:e=>{t(Y(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}})(A);function de(){const t=w(),a=T(),i=x(),{tenantEmailDomain:l}=k(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(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||n!=="Not-Started"||d==null||(p(!0),a(M(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(L.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,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-DrgIMsec.js";import{a}from"./sentry-BkoKwCRV.js";import{u as D,g as v,j as u,N as w}from"./core-vQwuHvL7.js";import{JV as A,eQ as O,fp as j,nf as U,fQ as h,fo as _,eX as L,K0 as F}from"./zeni-epic-state-6BXRR44j.js";import{u as $,z as f,L as g,D as k,o as H}from"./index-C3mA9Q5U.js";import{n as Q}from"./mui-Rvgr2IA7.js";import{t as z}from"./getLocaleForTenant-TLA-QJ0n.js";import{g as R,Q as P}from"./QBOConnectionScreen-D258LG2R.js";import"./recharts-BA6FOoyE.js";import"./analytics-DNNAdslX.js";import"./plaid-7_KuF832.js";import"./dnd-D0_5bRGE.js";import"./stripe-DMRn4zHo.js";import"./lottie-BNwbvBq3.js";import"./lexical-BUO93qJ-.js";import"./pdf-DHm_gs_H.js";import"./utils-O0lAHdlb.js";import"./empty-CnyNmiVC.js";import"./pdf-lib-C-bgig4f.js";import"./index-w8pg-Inj.js";import"./url-Bq7l5eBz.js";import"./index-Dd5iEsAg.js";import"./decodeURIComponentSafe-BdZ4SOfU.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="72e10b19-a3cc-48c4-a4bf-ec490844fb10",t._sentryDebugIdIdentifier="sentry-dbid-72e10b19-a3cc-48c4-a4bf-ec490844fb10")}catch{}})();const V=Q.div`
1
+ import{j as C}from"./liveblocks-fDjf6Tur.js";import{a}from"./sentry-DjzU4p1F.js";import{u as D,g as v,j as u,N as w}from"./core-C8Y7fm3n.js";import{JV as A,eQ as O,fp as j,nf as U,fQ as h,fo as _,eX as L,K0 as F}from"./zeni-epic-state-DvHgUD1-.js";import{u as $,z as f,L as g,D as k,o as H}from"./index-C3-objML.js";import{n as Q}from"./mui-Ky-KJxLh.js";import{t as z}from"./getLocaleForTenant-CYgluMQL.js";import{g as R,Q as P}from"./QBOConnectionScreen-CGgBpuke.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";import"./empty-CTn7RkAu.js";import"./pdf-lib-6uw_qC-k.js";import"./index-DjeTRCsF.js";import"./url-mCw4Y0mb.js";import"./index-BCOcxjVj.js";import"./decodeURIComponentSafe-pK1yrQsS.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="72e10b19-a3cc-48c4-a4bf-ec490844fb10",t._sentryDebugIdIdentifier="sentry-dbid-72e10b19-a3cc-48c4-a4bf-ec490844fb10")}catch{}})();const V=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-fDjf6Tur.js";import{z as n}from"./index-C3-objML.js";import{g as d}from"./QBOConnectionScreen-CGgBpuke.js";import"./sentry-DjzU4p1F.js";import{g as p,N as a}from"./core-C8Y7fm3n.js";import"./zeni-epic-state-DvHgUD1-.js";import"./recharts-CgIjuHOA.js";import"./mui-Ky-KJxLh.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";import"./empty-CTn7RkAu.js";import"./pdf-lib-6uw_qC-k.js";import"./index-DjeTRCsF.js";import"./url-mCw4Y0mb.js";import"./index-BCOcxjVj.js";import"./decodeURIComponentSafe-pK1yrQsS.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]="e53e9b9f-4e1e-4d41-afae-a46e42efc4b3",e._sentryDebugIdIdentifier="sentry-dbid-e53e9b9f-4e1e-4d41-afae-a46e42efc4b3")}catch{}})();const U=()=>{const e=p(),{code:t,realmId:o,state:r}=d(e.search),s=n.getSignedInUser()?.userId??"";if(f(t,o,r,s)===!0){const m=`../../${r}/onboarding?code=${t}&realmId=${o}&state=auth_flow`;return i.jsx(a,{to:m})}return i.jsx(a,{to:"../../"})},f=(e,t,o,r)=>e!=""&&t!=""&&o!=""&&r!=null&&r!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DrgIMsec.js";import{t as $e,A as Ce}from"./AddressScreen-NGqy9EJ7.js";import Ke from"./NotFoundScreen-BvZXxX08.js";import{a as g}from"./sentry-BkoKwCRV.js";import{h as oe,g as se,u as ie,i as re,j,N as D,n as ce,l as ze,o as qe,p as K}from"./core-vQwuHvL7.js";import{H as de,k as le,z as V,s as ue,m as Me,U as _,T as Qe,q as U,x as H,c as R,B as we,e as J,ap as Ze,J as He,aq as Ie,h as te,ar as We,as as ke,o as Je,at as Xe,au as Ee,av as Ye}from"./index-C3mA9Q5U.js";import{eQ as Y,fh as et,e$ as pe,eZ as me,bs as tt,nd as at,fd as nt,bO as ot,jj as ae,jm as ve,Kp as st,bT as it,c1 as ge,sQ as he,sB as rt,KV as X,sR as _e,Ih as ct,kn as Ue,KW as Ve,KX as dt,KY as lt,KZ as ut,jh as pt,jk as mt,sD as Be,sP as gt,bE as Te,cu as ht,t1 as xe,qK as ft,qy as yt,kf as St,fF as bt,fE as Ct,fD as It,K_ as kt,sv as Et,t2 as Tt,t5 as xt,t8 as Ot,te as Pt,cS as Dt}from"./zeni-epic-state-6BXRR44j.js";import{n as fe}from"./mui-Rvgr2IA7.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-D258LG2R.js";import"./recharts-BA6FOoyE.js";import"./analytics-DNNAdslX.js";import"./plaid-7_KuF832.js";import"./dnd-D0_5bRGE.js";import"./stripe-DMRn4zHo.js";import"./lottie-BNwbvBq3.js";import"./lexical-BUO93qJ-.js";import"./pdf-DHm_gs_H.js";import"./utils-O0lAHdlb.js";import"./empty-CnyNmiVC.js";import"./pdf-lib-C-bgig4f.js";import"./index-w8pg-Inj.js";import"./url-Bq7l5eBz.js";import"./index-Dd5iEsAg.js";import"./decodeURIComponentSafe-BdZ4SOfU.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]="1dd0d2e6-ddde-4e97-a698-40cff28795a3",t._sentryDebugIdIdentifier="sentry-dbid-1dd0d2e6-ddde-4e97-a698-40cff28795a3")}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 d=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(d.reportsInOrder.map(c=>({fetchState:c.fetchState,error:c.error}))).fetchState}},function(t,o){const{themeState:s,navigate:d,location:c}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=U(c.state?.pathnameStackToGoBack,c.pathname);d("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ze),wt=()=>{const t=oe(),o=se(),s=ie(),d=de(),[c,r]=g.useState(!1),[p,y]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=V.getSignedInUser(),{useFeatureGate:l}=ue(),C=Me(),{isFeatureEnabled:T}=l(_.isApAgingFeatureEnabled),{isFeatureEnabled:A}=l(_.isArAgingFeatureEnabled),{isFeatureEnabled:x}=l(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:k}=l(_.isReferralFeatureEnabled),{isFeatureEnabled:S}=l(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:v}=l(_.isDebitCardFeatureEnabled),I=Qe(),h=j(u=>Y(u)),{isFeatureEnabled:G}=l(_.isTreasuryEnabled),m=h.company!=null&&et(h.company),B=G&&m,E=j(u=>u.onboardingCustomerViewState.fetchState),F=h.excludedResources,L=h.companyId??V.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const b=pe(v,h),O=me(h),P=[],N=F?.resources?.find(u=>u.resource==="/reports/top_expenses")==null,M=F?.resources?.find(u=>u.resource==="/reports/task_card")==null,Q=h?.userRole!=null&&tt(h?.userRole),$=F?.resources?.find(u=>u.resource==="/bills")==null&&!Q,z=F?.resources?.find(u=>u.resource==="/reimbursements")==null;if(N===!1&&P.push("top_expenses"),M===!1&&P.push("task_card"),$===!1&&P.push("bill_pay_card","bill_pay_promo_card"),z===!1&&P.push("reimbursement_card","reimbursement_promo_card"),x===!1&&P.push("zeni_accounts_promo_card"),k===!1&&P.push("rewards_card"),g.useEffect(()=>{E!=="Completed"||c||b||O||(r(!0),s(at(i.userId,L,h.tenantId,!0,!1,P)))},[c,E,b,O,i,h.tenantId,s]),g.useEffect(()=>{(b||O)&&setTimeout(()=>{y(!0)},5e3)},[b,O]),E!=="Completed")return a.jsx(D,{to:"../"});if(E==="Completed"&&p){const u=U(o.state?.pathnameStackToGoBack,o.pathname);if(b)return a.jsx(D,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:u,message:"activation"}});if(O)return a.jsx(D,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:u,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:R,onLoad:u=>(q=>q.trackPageLoaded(J.Event.onboardingDashboardActivation))(u)}),a.jsx(jt,{navigate:t,location:o,themeState:d,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:A,shouldFetchZeniAccountsPromoCard:x,shouldFetchRewardsPlanCard:k,isExpenseAutomationEnabledForUser:I,isExpenseAutomationFeatureEnabledV2:S,isTreasuryEnabled:B,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:C.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-fDjf6Tur.js";import{t as $e,A as Ce}from"./AddressScreen-V8qhbu9d.js";import Ke from"./NotFoundScreen-D4Av36kV.js";import{a as g}from"./sentry-DjzU4p1F.js";import{h as oe,g as se,u as ie,i as re,j,N as D,n as ce,l as ze,o as qe,p as K}from"./core-C8Y7fm3n.js";import{H as de,k as le,z as V,s as ue,m as Me,U as _,T as Qe,q as U,x as H,c as R,B as we,e as J,ap as Ze,J as He,aq as Ie,h as te,ar as We,as as ke,o as Je,at as Xe,au as Ee,av as Ye}from"./index-C3-objML.js";import{eQ as Y,fh as et,e$ as pe,eZ as me,bs as tt,nd as at,fd as nt,bO as ot,jj as ae,jm as ve,Kp as st,bT as it,c1 as ge,sQ as he,sB as rt,KV as X,sR as _e,Ih as ct,kn as Ue,KW as Ve,KX as dt,KY as lt,KZ as ut,jh as pt,jk as mt,sD as Be,sP as gt,bE as Te,cu as ht,t1 as xe,qK as ft,qy as yt,kf as St,fF as bt,fE as Ct,fD as It,K_ as kt,sv as Et,t2 as Tt,t5 as xt,t8 as Ot,te as Pt,cS as Dt}from"./zeni-epic-state-DvHgUD1-.js";import{n as fe}from"./mui-Ky-KJxLh.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-CGgBpuke.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";import"./empty-CTn7RkAu.js";import"./pdf-lib-6uw_qC-k.js";import"./index-DjeTRCsF.js";import"./url-mCw4Y0mb.js";import"./index-BCOcxjVj.js";import"./decodeURIComponentSafe-pK1yrQsS.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]="1dd0d2e6-ddde-4e97-a698-40cff28795a3",t._sentryDebugIdIdentifier="sentry-dbid-1dd0d2e6-ddde-4e97-a698-40cff28795a3")}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 d=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(d.reportsInOrder.map(c=>({fetchState:c.fetchState,error:c.error}))).fetchState}},function(t,o){const{themeState:s,navigate:d,location:c}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=U(c.state?.pathnameStackToGoBack,c.pathname);d("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ze),wt=()=>{const t=oe(),o=se(),s=ie(),d=de(),[c,r]=g.useState(!1),[p,y]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=V.getSignedInUser(),{useFeatureGate:l}=ue(),C=Me(),{isFeatureEnabled:T}=l(_.isApAgingFeatureEnabled),{isFeatureEnabled:A}=l(_.isArAgingFeatureEnabled),{isFeatureEnabled:x}=l(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:k}=l(_.isReferralFeatureEnabled),{isFeatureEnabled:S}=l(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:v}=l(_.isDebitCardFeatureEnabled),I=Qe(),h=j(u=>Y(u)),{isFeatureEnabled:G}=l(_.isTreasuryEnabled),m=h.company!=null&&et(h.company),B=G&&m,E=j(u=>u.onboardingCustomerViewState.fetchState),F=h.excludedResources,L=h.companyId??V.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const b=pe(v,h),O=me(h),P=[],N=F?.resources?.find(u=>u.resource==="/reports/top_expenses")==null,M=F?.resources?.find(u=>u.resource==="/reports/task_card")==null,Q=h?.userRole!=null&&tt(h?.userRole),$=F?.resources?.find(u=>u.resource==="/bills")==null&&!Q,z=F?.resources?.find(u=>u.resource==="/reimbursements")==null;if(N===!1&&P.push("top_expenses"),M===!1&&P.push("task_card"),$===!1&&P.push("bill_pay_card","bill_pay_promo_card"),z===!1&&P.push("reimbursement_card","reimbursement_promo_card"),x===!1&&P.push("zeni_accounts_promo_card"),k===!1&&P.push("rewards_card"),g.useEffect(()=>{E!=="Completed"||c||b||O||(r(!0),s(at(i.userId,L,h.tenantId,!0,!1,P)))},[c,E,b,O,i,h.tenantId,s]),g.useEffect(()=>{(b||O)&&setTimeout(()=>{y(!0)},5e3)},[b,O]),E!=="Completed")return a.jsx(D,{to:"../"});if(E==="Completed"&&p){const u=U(o.state?.pathnameStackToGoBack,o.pathname);if(b)return a.jsx(D,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:u,message:"activation"}});if(O)return a.jsx(D,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:u,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:R,onLoad:u=>(q=>q.trackPageLoaded(J.Event.onboardingDashboardActivation))(u)}),a.jsx(jt,{navigate:t,location:o,themeState:d,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:A,shouldFetchZeniAccountsPromoCard:x,shouldFetchRewardsPlanCard:k,isExpenseAutomationEnabledForUser:I,isExpenseAutomationFeatureEnabledV2:S,isTreasuryEnabled:B,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:C.colors.grey5}})},Oe=fe.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 d}from"./liveblocks-DrgIMsec.js";import{i as K,j as S,g as H,u as z,h as W,n as ee,k as ia,o as Ct,p as F}from"./core-vQwuHvL7.js";import{eQ as U,Le as We,bE as ca,bo as De,Mr as Pn,i7 as Fn,Ms as qt,Mt as On,ia as _t,Mu as Ze,Mv as Mn,ig as Rn,Mw as Zt,Mx as Bn,ik as St,My as Qe,Mz as jn,ck as vt,MA as Ln,MB as Un,Ly as Nn,jd as Gn,MC as Vn,bn as Xe,MD as la,L2 as ce,bc as da,jr as ua,nn as ma,ja as pa,L4 as le,L3 as J,eP as ha,eV as Yn,fr as kt,ME as $n,MF as zn,MG as fa,MH as Oe,uQ as Le,uR as Ue,vc as xe,v6 as de,uV as Ne,MI as Kn,MJ as qn,MK as Zn,ML as ga,MM as Me,MN as Qn,dD as Je,ri as ba,MO as Hn,MP as Wn,MQ as Xn,MR as At,Kr as Et,jH as we,vk as It,rq as Jn,MS as eo,uS as Qt,rl as Ie,rh as Ca,MT as ge,MU as to,MV as Tt,Kq as Dt,ti as _a,MW as ao,MX as no,MY as oo,MZ as xt,tv as so,M_ as ro,uU as Ht,th as Sa,M$ as be,N0 as io,bs as ka,vo as ya,N1 as co,N2 as lo,N3 as uo,N4 as wt,vj as mo,N5 as po,uT as Wt,vn as va,N6 as Ce,N7 as ho,N8 as fo,N9 as Aa,jw as Ea,nk as Ia,jB as Ta,ni as Da,nh as xa,ng as wa,sG as go,fh as bo,cM as Co,cN as _o,nd as So,fd as ko,nu as yo,EA as ut,Es as vo,Ew as Ao,Na as Eo,Nb as Io,Nc as To,b5 as et,f5 as Do,gS as xo,fH as wo,no as Po,j3 as Fo,nl as Oo,nj as Mo,e$ as Ro,eZ as Bo}from"./zeni-epic-state-6BXRR44j.js";import{z as j,a2 as te,q as x,c as T,D as q,aV as jo,_ as Ge,x as Ve,aW as Pa,e as Y,aX as Lo,k as Se,aY as Fa,s as ke,U as R,m as Uo,aZ as No,a_ as Go,X as Oa,J as Ma,a as Ra,Z as Vo,a$ as Yo,R as $o,aN as Ba,$ as se,b0 as ja,b1 as La,a1 as Ua,b2 as zo,b3 as Ko,T as qo,aq as Zo,p as Qo,Y as Ho,b4 as Wo,b5 as Xo,b6 as Jo,b7 as es,b8 as _e}from"./index-C3mA9Q5U.js";import{n as Pt}from"./mui-Rvgr2IA7.js";import{a as b}from"./sentry-BkoKwCRV.js";import{w as Na}from"./withTransactionSidePanel-BY401AJ2.js";import{c as Ga,t as Pe,f as ue,a as Ft,v as ts}from"./routePaths-CmhI8CxC.js";import{u as ae}from"./useAskAiCfoHostNavButtonProps-QJAyq3s4.js";import je from"./NotFoundScreen-BvZXxX08.js";import{u as Ot}from"./useInitialThreadRequest-Baw9vJ__.js";import{t as Va}from"./analyticsHelper-BbXHYbAA.js";import{C as as}from"./CompanyPassportScreen-CkbdVUtF.js";import{u as ns}from"./useAiCfoDashboardSuggestedQuestionsChips-DYxbqQ5e.js";import{F as os}from"./FeaturePreviewScreen-CGQO6rrQ.js";import{R as ss}from"./ReferralListScreen-BwIy2cSH.js";import"./recharts-BA6FOoyE.js";import"./analytics-DNNAdslX.js";import"./plaid-7_KuF832.js";import"./dnd-D0_5bRGE.js";import"./stripe-DMRn4zHo.js";import"./lottie-BNwbvBq3.js";import"./lexical-BUO93qJ-.js";import"./pdf-DHm_gs_H.js";import"./utils-O0lAHdlb.js";import"./TransactionDetailScreen-CyNORpj2.js";import"./decodeURIComponentSafe-BdZ4SOfU.js";import"./MobileAppDrawer-CpuZ4FmH.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]="8157ea92-8de3-4f79-9368-b8fcab4dd9db",e._sentryDebugIdIdentifier="sentry-dbid-8157ea92-8de3-4f79-9368-b8fcab4dd9db")}catch{}})();const rs=Na(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=S(E=>E.tenantState.currentTenantId),c=S(E=>U(E)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()}),[]),h=b.useMemo(()=>r!=null?ca(r):De(),[r]),p=z(),f=W(),k=S(E=>Pn(E,h,o)),I=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&p(Fn(o,h))},[h]),v=b.useCallback(()=>{f("../../",{relative:"path"})},[]),_=b.useCallback((E,L)=>{p(qt({sortKey:E,sortOrder:L}))},[]),D=b.useCallback(E=>{p(qt({downloadState:E}))},[]),w=b.useCallback(E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const L=Ga({id:E.transactionId,type:E.transactionType},m);f(L);const ne=x(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:ne}})}},[m,e]),y=b.useCallback(()=>{k.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,h]);return b.useEffect(()=>{I()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&y()},[y,k.fetchState]),d.jsx(jo,{apAgingDetail:k,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:w,onReload:I,onBackClick:v,onColumnSortConfigChanged:_,updateDownloadStateHandler:D,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),is=()=>{const e=z(),a=W(),t=S(_=>On(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AP Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=S(_=>_.tenantState.currentTenantId),i=S(_=>U(_)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${te}/agingReport`,timezone:We()}),[]),C=t.apAgingUIState.selectedDate??De(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(_t(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(_=>{e(Ze({searchString:_}))},[]),p=b.useCallback((_,D)=>{e(Ze({sortKey:D,sortOrder:_}))},[]),f=b.useCallback(_=>{a(`./${_}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),k=b.useCallback(_=>{e(Ze({downloadState:_}))},[]),I=b.useCallback((_,D)=>{},[]),v=b.useCallback((_,D)=>{e(Ze({selectedDate:_,agingDateSelectionType:D})),e(_t(_))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:_=>_.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,d.jsx(Pa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:v,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Na(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=S(y=>U(y)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()}),[]),l=b.useMemo(()=>r!=null?ca(r):De(),[r]),h=z(),p=W(),f=S(y=>Mn(y,l,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(Rn(o,l))},[l]),I=b.useCallback(()=>{p("../../",{relative:"path"})},[]),v=b.useCallback((y,E)=>{h(Zt({sortKey:y,sortOrder:E}))},[]),_=b.useCallback(y=>{h(Zt({downloadState:y}))},[]),D=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(c!=null){const E=Ga({id:y.transactionId,type:y.transactionType},c);p(E);const L=x(m.state?.pathnameStackToGoBack,m.pathname);p(E,{state:{pathnameStackToGoBack:L}})}},[c,e]),w=b.useCallback(()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&w()},[f.fetchState,w]),d.jsx(Lo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:D,onReload:k,onBackClick:I,onColumnSortConfigChanged:v,updateDownloadStateHandler:_,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ls=()=>{const e=z(),a=W(),t=S(v=>Bn(v)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AR Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=S(v=>U(v)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${te}/agingReport`,timezone:We()}),[]),g=t.arAgingUIState.selectedDate??De(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(St(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(v=>{e(Qe({searchString:v}))},[]),h=b.useCallback((v,_)=>{e(Qe({sortKey:_,sortOrder:v}))},[]),p=b.useCallback(v=>{a(`./${v}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(v=>{e(Qe({downloadState:v}))},[]),k=b.useCallback((v,_)=>{e(Qe({selectedDate:v,agingDateSelectionType:_})),e(St(v))},[]),I=b.useCallback((v,_)=>{e(jn({nodeId:v,isCollapsed:_}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:v=>v.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,d.jsx(Pa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ya=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function $a(e,a){const t=Nn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Gn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=ee(function(e){const a=Ln(e).accountsInOrder.map((n,o)=>Ya(n,o)),t=Un(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}},$a)(Fa),us=ee(function(e){const a=Vn(e).accountsInOrder.map((o,r)=>Ya(o,r)),t=j.getSignedInUser(),n=Xe(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}},$a)(Fa);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=vt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(je,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=vt(n?.loggedInUserRoleMap),r=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(je,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=Pt.div`
1
+ import{j as d}from"./liveblocks-fDjf6Tur.js";import{i as K,j as S,g as H,u as z,h as W,n as ee,k as ia,o as Ct,p as F}from"./core-C8Y7fm3n.js";import{eQ as U,Le as We,bE as ca,bo as De,Mr as Pn,i7 as Fn,Ms as qt,Mt as On,ia as _t,Mu as Ze,Mv as Mn,ig as Rn,Mw as Zt,Mx as Bn,ik as St,My as Qe,Mz as jn,ck as vt,MA as Ln,MB as Un,Ly as Nn,jd as Gn,MC as Vn,bn as Xe,MD as la,L2 as ce,bc as da,jr as ua,nn as ma,ja as pa,L4 as le,L3 as J,eP as ha,eV as Yn,fr as kt,ME as $n,MF as zn,MG as fa,MH as Oe,uQ as Le,uR as Ue,vc as xe,v6 as de,uV as Ne,MI as Kn,MJ as qn,MK as Zn,ML as ga,MM as Me,MN as Qn,dD as Je,ri as ba,MO as Hn,MP as Wn,MQ as Xn,MR as At,Kr as Et,jH as we,vk as It,rq as Jn,MS as eo,uS as Qt,rl as Ie,rh as Ca,MT as ge,MU as to,MV as Tt,Kq as Dt,ti as _a,MW as ao,MX as no,MY as oo,MZ as xt,tv as so,M_ as ro,uU as Ht,th as Sa,M$ as be,N0 as io,bs as ka,vo as ya,N1 as co,N2 as lo,N3 as uo,N4 as wt,vj as mo,N5 as po,uT as Wt,vn as va,N6 as Ce,N7 as ho,N8 as fo,N9 as Aa,jw as Ea,nk as Ia,jB as Ta,ni as Da,nh as xa,ng as wa,sG as go,fh as bo,cM as Co,cN as _o,nd as So,fd as ko,nu as yo,EA as ut,Es as vo,Ew as Ao,Na as Eo,Nb as Io,Nc as To,b5 as et,f5 as Do,gS as xo,fH as wo,no as Po,j3 as Fo,nl as Oo,nj as Mo,e$ as Ro,eZ as Bo}from"./zeni-epic-state-DvHgUD1-.js";import{z as j,a2 as te,q as x,c as T,D as q,aV as jo,_ as Ge,x as Ve,aW as Pa,e as Y,aX as Lo,k as Se,aY as Fa,s as ke,U as R,m as Uo,aZ as No,a_ as Go,X as Oa,J as Ma,a as Ra,Z as Vo,a$ as Yo,R as $o,aN as Ba,$ as se,b0 as ja,b1 as La,a1 as Ua,b2 as zo,b3 as Ko,T as qo,aq as Zo,p as Qo,Y as Ho,b4 as Wo,b5 as Xo,b6 as Jo,b7 as es,b8 as _e}from"./index-C3-objML.js";import{n as Pt}from"./mui-Ky-KJxLh.js";import{a as b}from"./sentry-DjzU4p1F.js";import{w as Na}from"./withTransactionSidePanel-BvWwtSm-.js";import{c as Ga,t as Pe,f as ue,a as Ft,v as ts}from"./routePaths-B8EWQXPr.js";import{u as ae}from"./useAskAiCfoHostNavButtonProps-DDzinN2F.js";import je from"./NotFoundScreen-D4Av36kV.js";import{u as Ot}from"./useInitialThreadRequest-X7WpfR49.js";import{t as Va}from"./analyticsHelper-DNuTbD5B.js";import{C as as}from"./CompanyPassportScreen-DkvfpbMw.js";import{u as ns}from"./useAiCfoDashboardSuggestedQuestionsChips-DN1K5TAQ.js";import{F as os}from"./FeaturePreviewScreen-2R9FJdWJ.js";import{R as ss}from"./ReferralListScreen-BA5RvLF7.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";import"./TransactionDetailScreen-gAhskOIn.js";import"./decodeURIComponentSafe-pK1yrQsS.js";import"./MobileAppDrawer-DIls_BW2.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]="8157ea92-8de3-4f79-9368-b8fcab4dd9db",e._sentryDebugIdIdentifier="sentry-dbid-8157ea92-8de3-4f79-9368-b8fcab4dd9db")}catch{}})();const rs=Na(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=S(E=>E.tenantState.currentTenantId),c=S(E=>U(E)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()}),[]),h=b.useMemo(()=>r!=null?ca(r):De(),[r]),p=z(),f=W(),k=S(E=>Pn(E,h,o)),I=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&p(Fn(o,h))},[h]),v=b.useCallback(()=>{f("../../",{relative:"path"})},[]),_=b.useCallback((E,L)=>{p(qt({sortKey:E,sortOrder:L}))},[]),D=b.useCallback(E=>{p(qt({downloadState:E}))},[]),w=b.useCallback(E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const L=Ga({id:E.transactionId,type:E.transactionType},m);f(L);const ne=x(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:ne}})}},[m,e]),y=b.useCallback(()=>{k.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,h]);return b.useEffect(()=>{I()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&y()},[y,k.fetchState]),d.jsx(jo,{apAgingDetail:k,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:w,onReload:I,onBackClick:v,onColumnSortConfigChanged:_,updateDownloadStateHandler:D,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),is=()=>{const e=z(),a=W(),t=S(_=>On(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AP Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=S(_=>_.tenantState.currentTenantId),i=S(_=>U(_)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${te}/agingReport`,timezone:We()}),[]),C=t.apAgingUIState.selectedDate??De(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(_t(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(_=>{e(Ze({searchString:_}))},[]),p=b.useCallback((_,D)=>{e(Ze({sortKey:D,sortOrder:_}))},[]),f=b.useCallback(_=>{a(`./${_}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),k=b.useCallback(_=>{e(Ze({downloadState:_}))},[]),I=b.useCallback((_,D)=>{},[]),v=b.useCallback((_,D)=>{e(Ze({selectedDate:_,agingDateSelectionType:D})),e(_t(_))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:_=>_.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,d.jsx(Pa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:v,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Na(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=S(y=>U(y)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()}),[]),l=b.useMemo(()=>r!=null?ca(r):De(),[r]),h=z(),p=W(),f=S(y=>Mn(y,l,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(Rn(o,l))},[l]),I=b.useCallback(()=>{p("../../",{relative:"path"})},[]),v=b.useCallback((y,E)=>{h(Zt({sortKey:y,sortOrder:E}))},[]),_=b.useCallback(y=>{h(Zt({downloadState:y}))},[]),D=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(c!=null){const E=Ga({id:y.transactionId,type:y.transactionType},c);p(E);const L=x(m.state?.pathnameStackToGoBack,m.pathname);p(E,{state:{pathnameStackToGoBack:L}})}},[c,e]),w=b.useCallback(()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&w()},[f.fetchState,w]),d.jsx(Lo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:D,onReload:k,onBackClick:I,onColumnSortConfigChanged:v,updateDownloadStateHandler:_,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ls=()=>{const e=z(),a=W(),t=S(v=>Bn(v)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AR Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=S(v=>U(v)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${te}/agingReport`,timezone:We()}),[]),g=t.arAgingUIState.selectedDate??De(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(St(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(v=>{e(Qe({searchString:v}))},[]),h=b.useCallback((v,_)=>{e(Qe({sortKey:_,sortOrder:v}))},[]),p=b.useCallback(v=>{a(`./${v}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(v=>{e(Qe({downloadState:v}))},[]),k=b.useCallback((v,_)=>{e(Qe({selectedDate:v,agingDateSelectionType:_})),e(St(v))},[]),I=b.useCallback((v,_)=>{e(jn({nodeId:v,isCollapsed:_}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:v=>v.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,d.jsx(Pa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ya=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function $a(e,a){const t=Nn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Gn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=ee(function(e){const a=Ln(e).accountsInOrder.map((n,o)=>Ya(n,o)),t=Un(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}},$a)(Fa),us=ee(function(e){const a=Vn(e).accountsInOrder.map((o,r)=>Ya(o,r)),t=j.getSignedInUser(),n=Xe(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}},$a)(Fa);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=vt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(je,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=vt(n?.loggedInUserRoleMap),r=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(je,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=Pt.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-DrgIMsec.js";import{a as u}from"./sentry-BkoKwCRV.js";import{u as y,j as b,n as w,g as A,N}from"./core-vQwuHvL7.js";import{JV as U,eQ as _,fp as k,JW as L,nf as R,JX as z}from"./zeni-epic-state-6BXRR44j.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-C3mA9Q5U.js";import"./mui-Rvgr2IA7.js";import{t as P}from"./getLocaleForTenant-TLA-QJ0n.js";import"./recharts-BA6FOoyE.js";import"./analytics-DNNAdslX.js";import"./plaid-7_KuF832.js";import"./dnd-D0_5bRGE.js";import"./stripe-DMRn4zHo.js";import"./lottie-BNwbvBq3.js";import"./lexical-BUO93qJ-.js";import"./pdf-DHm_gs_H.js";import"./utils-O0lAHdlb.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]="18ba0186-39cb-4872-aeed-67a9d96bd87c",t._sentryDebugIdIdentifier="sentry-dbid-18ba0186-39cb-4872-aeed-67a9d96bd87c")}catch{}})();const Q=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(),p=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=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.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=$(c,p);return v.jsx(N,{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}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>U(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.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(k(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"&&!L(i))&&t(R(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||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const J=["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"],V={"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 J)if(t.toLocaleLowerCase().includes(s))return V[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-fDjf6Tur.js";import{a as u}from"./sentry-DjzU4p1F.js";import{u as y,j as b,n as w,g as A,N}from"./core-C8Y7fm3n.js";import{JV as U,eQ as _,fp as k,JW as L,nf as R,JX as z}from"./zeni-epic-state-DvHgUD1-.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-C3-objML.js";import"./mui-Ky-KJxLh.js";import{t as P}from"./getLocaleForTenant-CYgluMQL.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.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]="18ba0186-39cb-4872-aeed-67a9d96bd87c",t._sentryDebugIdIdentifier="sentry-dbid-18ba0186-39cb-4872-aeed-67a9d96bd87c")}catch{}})();const Q=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(),p=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=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.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=$(c,p);return v.jsx(N,{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}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>U(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.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(k(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"&&!L(i))&&t(R(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||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const J=["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"],V={"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 J)if(t.toLocaleLowerCase().includes(s))return V[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-DrgIMsec.js";import{h as w,g as C,j as h,n as A,i as P}from"./core-vQwuHvL7.js";import{NW as k,O1 as q,fF as W,fE as X,fD as J,iE as L,L3 as Q,qB as K,eQ as V,Ns as D,iC as F,NX as S,O4 as T,iA as G,iX as j}from"./zeni-epic-state-6BXRR44j.js";import{bw as M,J as N,s as R,z as U,m as O,p as b,U as v,B as Z,bx as Y,o as z,by as ee,q as te}from"./index-C3mA9Q5U.js";import{n as H}from"./mui-Rvgr2IA7.js";import"./sentry-BkoKwCRV.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]="fc1d7aec-94a5-4306-9e81-981a96e7d3fd",e._sentryDebugIdIdentifier="sentry-dbid-fc1d7aec-94a5-4306-9e81-981a96e7d3fd")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(L(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(Q("common")),n!=null&&e(K(n))},onGetOtp:n=>{e(J(n,"BillPayVendor"))},onResendOtp:n=>{e(X(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(M);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,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-fDjf6Tur.js";import{h as w,g as C,j as h,n as A,i as P}from"./core-C8Y7fm3n.js";import{NW as k,O1 as q,fF as W,fE as X,fD as J,iE as L,L3 as Q,qB as K,eQ as V,Ns as D,iC as F,NX as S,O4 as T,iA as G,iX as j}from"./zeni-epic-state-DvHgUD1-.js";import{bw as M,J as N,s as R,z as U,m as O,p as b,U as v,B as Z,bx as Y,o as z,by as ee,q as te}from"./index-C3-objML.js";import{n as H}from"./mui-Ky-KJxLh.js";import"./sentry-DjzU4p1F.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]="fc1d7aec-94a5-4306-9e81-981a96e7d3fd",e._sentryDebugIdIdentifier="sentry-dbid-fc1d7aec-94a5-4306-9e81-981a96e7d3fd")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(L(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(Q("common")),n!=null&&e(K(n))},onGetOtp:n=>{e(J(n,"BillPayVendor"))},onResendOtp:n=>{e(X(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(M);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,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-DrgIMsec.js";import{J as f,A as l,m as c}from"./index-C3mA9Q5U.js";import{D as b}from"./mui-Rvgr2IA7.js";import"./sentry-BkoKwCRV.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]="55f76821-2be0-486b-a7fc-493ddb9425df",e._sentryDebugIdIdentifier="sentry-dbid-55f76821-2be0-486b-a7fc-493ddb9425df")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=f(),d=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),a=c();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${d})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
1
+ import{j as i}from"./liveblocks-fDjf6Tur.js";import{J as f,A as l,m as c}from"./index-C3-objML.js";import{D as b}from"./mui-Ky-KJxLh.js";import"./sentry-DjzU4p1F.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]="55f76821-2be0-486b-a7fc-493ddb9425df",e._sentryDebugIdIdentifier="sentry-dbid-55f76821-2be0-486b-a7fc-493ddb9425df")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=f(),d=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),a=c();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${d})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DrgIMsec.js";import{a as d}from"./sentry-BkoKwCRV.js";import{h as B,u as G,g as q,i as L,j as l,N as F,n as M,o as N,p as _}from"./core-vQwuHvL7.js";import{Ma as z,eQ as O,Lz as H,kH as R,I9 as I,Mf as W,L2 as Y,jH as $,Ia as P,LE as Q,LF as V,L4 as J,L3 as K}from"./zeni-epic-state-6BXRR44j.js";import{aS as U,c as X,p as Z,q as tt}from"./index-C3mA9Q5U.js";import"./mui-Rvgr2IA7.js";import{d as S}from"./decodeURIComponentSafe-BdZ4SOfU.js";import{w as et}from"./withTransactionSidePanel-BY401AJ2.js";import{f as at,c as nt}from"./routePaths-CmhI8CxC.js";import"./recharts-BA6FOoyE.js";import"./analytics-DNNAdslX.js";import"./plaid-7_KuF832.js";import"./dnd-D0_5bRGE.js";import"./stripe-DMRn4zHo.js";import"./lottie-BNwbvBq3.js";import"./lexical-BUO93qJ-.js";import"./pdf-DHm_gs_H.js";import"./utils-O0lAHdlb.js";import"./useAskAiCfoHostNavButtonProps-QJAyq3s4.js";import"./TransactionDetailScreen-CyNORpj2.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]="bdaf522b-ba80-4e9f-bed4-27b2820b6953",a._sentryDebugIdIdentifier="sentry-dbid-bdaf522b-ba80-4e9f-bed4-27b2820b6953")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=W(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:$(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(J({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(K("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Q()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??k();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(P(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(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(P(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:C,entityIdEncoded:j,entityNameEncoded:w}=L(),r=S(j??""),p=S(w??""),f=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>O(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>H(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(R(i)))},[m,f,i]);const E=l(n=>n.trendState.fetchState),b=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),b!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:b})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:k(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,k=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
1
+ import{j as s}from"./liveblocks-fDjf6Tur.js";import{a as d}from"./sentry-DjzU4p1F.js";import{h as B,u as G,g as q,i as L,j as l,N as F,n as M,o as N,p as _}from"./core-C8Y7fm3n.js";import{Ma as z,eQ as O,Lz as H,kH as R,I9 as I,Mf as W,L2 as Y,jH as $,Ia as P,LE as Q,LF as V,L4 as J,L3 as K}from"./zeni-epic-state-DvHgUD1-.js";import{aS as U,c as X,p as Z,q as tt}from"./index-C3-objML.js";import"./mui-Ky-KJxLh.js";import{d as S}from"./decodeURIComponentSafe-pK1yrQsS.js";import{w as et}from"./withTransactionSidePanel-BvWwtSm-.js";import{f as at,c as nt}from"./routePaths-B8EWQXPr.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";import"./useAskAiCfoHostNavButtonProps-DDzinN2F.js";import"./TransactionDetailScreen-gAhskOIn.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]="bdaf522b-ba80-4e9f-bed4-27b2820b6953",a._sentryDebugIdIdentifier="sentry-dbid-bdaf522b-ba80-4e9f-bed4-27b2820b6953")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=W(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:$(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(J({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(K("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Q()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??k();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(P(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(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(P(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:C,entityIdEncoded:j,entityNameEncoded:w}=L(),r=S(j??""),p=S(w??""),f=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>O(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>H(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(R(i)))},[m,f,i]);const E=l(n=>n.trendState.fetchState),b=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),b!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:b})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:k(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,k=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-DrgIMsec.js";import aa from"./NotFoundScreen-BvZXxX08.js";import{a as o,b as Nt}from"./sentry-BkoKwCRV.js";import{n as Fe,S as oa}from"./mui-Rvgr2IA7.js";import{u as pe,h as Jt,g as Ye,j as w,n as sa,i as wt,o as ca,p as qe}from"./core-vQwuHvL7.js";import{eQ as xe,QE as ia,np as Ee,fk as la,rc as ra,nH as Yt,o0 as Kt,QF as Ht,oa as da,QG as Zt,nA as ua,qK as ma,f4 as Ie,QH as De,tb as Wt,Cw as Xt,QI as en,QJ as pa,qi as Ke,Mb as Pt,Md as ha,jK as ga,Me as Ca,jR as Sa,cU as fa,uo as He,nN as tn,of as Ue,nF as le,QK as Ia,L4 as xt,L3 as Re,QL as Dt,k6 as Ea,QM as ka,QN as ya,QO as ba,QP as va,nU as Ta,oi as we,QQ as Aa,QR as Ra,QS as wa,op as Pa,jV as xa,jM as Da,QT as Ua,jU as Ut,Ml as Fa,QU as Ba,QV as Va,qe as Oa,pS as _a,og as me,pR as Ge,QW as Ma,QX as za,QY as ja,lp as La,bo as $a,lk as Ft,l6 as Qa,QZ as qa,gU as Bt,fV as Ga,lh as Na,wh as Ja,Q_ as Ya,oQ as Ka,oL as Ha,oP as Za,oA as Wa,Q$ as Xa,f7 as nn,o3 as eo,nQ as to,fl as Vt,ok as no,R0 as ao,R1 as oo,oh as an,R2 as so,R3 as co,R4 as io,R5 as lo,R6 as Ot,qq as ro,pJ as uo,L2 as mo,R7 as po,R8 as ho,jT as go,R9 as Co,Ha as So,jS as fo,jH as Io,f6 as Eo,pg as on,pB as ko,oe as _t,oj as yo,bE as bo,le as vo,lb as To,Ra as Ao,oz as Mt,px as zt,pv as Ro,Rb as wo,p1 as Po,o$ as xo,py as Do,Rc as Uo,Rd as Fo,p5 as Bo,Re as Vo,oV as Oo,p4 as _o,p2 as Mo,pE as zo}from"./zeni-epic-state-6BXRR44j.js";import{s as sn,U as ne,c as Q,q as te,Y as cn,_ as ln,cG as jo,z as Be,cH as Lo,at as Pe,cI as $o,aU as jt,B as rn,cJ as Qo,aq as Ne,D as qo,a7 as Go,cK as No,a2 as Jo,cL as Yo,X as Ko,cM as Ho,cN as Zo,H as Wo,k as Xo,aN as es,cO as ts,cP as ns,b9 as as,A as os,aQ as ss}from"./index-C3mA9Q5U.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-QJAyq3s4.js";import{f as Lt,a as cs,b as is,g as ls,C as rs}from"./TransactionDetailScreen-CyNORpj2.js";import{w as ds}from"./withTransactionSidePanel-BY401AJ2.js";import{h as us,v as ms}from"./routePaths-CmhI8CxC.js";import{g as Je}from"./accountMappingHelper-DqixY6R_.js";import{D as ps}from"./DrawerScreen-BzT5AGON.js";import"./recharts-BA6FOoyE.js";import"./analytics-DNNAdslX.js";import"./plaid-7_KuF832.js";import"./dnd-D0_5bRGE.js";import"./stripe-DMRn4zHo.js";import"./lottie-BNwbvBq3.js";import"./lexical-BUO93qJ-.js";import"./pdf-DHm_gs_H.js";import"./utils-O0lAHdlb.js";import"./decodeURIComponentSafe-BdZ4SOfU.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="ad584eba-43d7-4fc1-a357-096b9944c7d6",t._sentryDebugIdIdentifier="sentry-dbid-ad584eba-43d7-4fc1-a357-096b9944c7d6")}catch{}})();const hs=()=>{const t=pe(),l=Jt(),B=Ye(),f=w(d=>xe(d)),{useFeatureGate:v}=sn(),{isFeatureEnabled:S}=v(ne.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=v(ne.aiAuditScorePercentage),I=w(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=w(d=>ia(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,q,X=!1)=>{t(Ee({tenantId:q,period:{month:d.month,year:d.year},refreshViewInBackground:X}))},[]),T=o.useCallback(d=>{const q=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,q??null),t(la(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),g=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(g.month,g.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(g,f.tenantId,!0)},[k,g,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=te(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&g!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(q=>q.progress<100);if(d!=null)return void l(`./${d.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,g]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(g,f.tenantId)},[k,g,s.fetchState,f.tenantId,y]),o.useEffect(()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(ra(g))},[g,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;Q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(gs,{children:h.jsx(jo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:T,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Fe.div`
1
+ import{j as h}from"./liveblocks-fDjf6Tur.js";import aa from"./NotFoundScreen-D4Av36kV.js";import{a as o,b as Nt}from"./sentry-DjzU4p1F.js";import{n as Fe,S as oa}from"./mui-Ky-KJxLh.js";import{u as pe,h as Jt,g as Ye,j as w,n as sa,i as wt,o as ca,p as qe}from"./core-C8Y7fm3n.js";import{eQ as xe,QE as ia,np as Ee,fk as la,rc as ra,nH as Yt,o0 as Kt,QF as Ht,oa as da,QG as Zt,nA as ua,qK as ma,f4 as Ie,QH as De,tb as Wt,Cw as Xt,QI as en,QJ as pa,qi as Ke,Mb as Pt,Md as ha,jK as ga,Me as Ca,jR as Sa,cU as fa,uo as He,nN as tn,of as Ue,nF as le,QK as Ia,L4 as xt,L3 as Re,QL as Dt,k6 as Ea,QM as ka,QN as ya,QO as ba,QP as va,nU as Ta,oi as we,QQ as Aa,QR as Ra,QS as wa,op as Pa,jV as xa,jM as Da,QT as Ua,jU as Ut,Ml as Fa,QU as Ba,QV as Va,qe as Oa,pS as _a,og as me,pR as Ge,QW as Ma,QX as za,QY as ja,lp as La,bo as $a,lk as Ft,l6 as Qa,QZ as qa,gU as Bt,fV as Ga,lh as Na,wh as Ja,Q_ as Ya,oQ as Ka,oL as Ha,oP as Za,oA as Wa,Q$ as Xa,f7 as nn,o3 as eo,nQ as to,fl as Vt,ok as no,R0 as ao,R1 as oo,oh as an,R2 as so,R3 as co,R4 as io,R5 as lo,R6 as Ot,qq as ro,pJ as uo,L2 as mo,R7 as po,R8 as ho,jT as go,R9 as Co,Ha as So,jS as fo,jH as Io,f6 as Eo,pg as on,pB as ko,oe as _t,oj as yo,bE as bo,le as vo,lb as To,Ra as Ao,oz as Mt,px as zt,pv as Ro,Rb as wo,p1 as Po,o$ as xo,py as Do,Rc as Uo,Rd as Fo,p5 as Bo,Re as Vo,oV as Oo,p4 as _o,p2 as Mo,pE as zo}from"./zeni-epic-state-DvHgUD1-.js";import{s as sn,U as ne,c as Q,q as te,Y as cn,_ as ln,cG as jo,z as Be,cH as Lo,at as Pe,cI as $o,aU as jt,B as rn,cJ as Qo,aq as Ne,D as qo,a7 as Go,cK as No,a2 as Jo,cL as Yo,X as Ko,cM as Ho,cN as Zo,H as Wo,k as Xo,aN as es,cO as ts,cP as ns,b9 as as,A as os,aQ as ss}from"./index-C3-objML.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-DDzinN2F.js";import{f as Lt,a as cs,b as is,g as ls,C as rs}from"./TransactionDetailScreen-gAhskOIn.js";import{w as ds}from"./withTransactionSidePanel-BvWwtSm-.js";import{h as us,v as ms}from"./routePaths-B8EWQXPr.js";import{g as Je}from"./accountMappingHelper-B_qiWmeW.js";import{D as ps}from"./DrawerScreen-B7V2OyqL.js";import"./recharts-CgIjuHOA.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.js";import"./decodeURIComponentSafe-pK1yrQsS.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="ad584eba-43d7-4fc1-a357-096b9944c7d6",t._sentryDebugIdIdentifier="sentry-dbid-ad584eba-43d7-4fc1-a357-096b9944c7d6")}catch{}})();const hs=()=>{const t=pe(),l=Jt(),B=Ye(),f=w(d=>xe(d)),{useFeatureGate:v}=sn(),{isFeatureEnabled:S}=v(ne.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=v(ne.aiAuditScorePercentage),I=w(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=w(d=>ia(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,q,X=!1)=>{t(Ee({tenantId:q,period:{month:d.month,year:d.year},refreshViewInBackground:X}))},[]),T=o.useCallback(d=>{const q=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,q??null),t(la(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),g=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(g.month,g.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(g,f.tenantId,!0)},[k,g,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=te(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&g!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(q=>q.progress<100);if(d!=null)return void l(`./${d.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,g]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(g,f.tenantId)},[k,g,s.fetchState,f.tenantId,y]),o.useEffect(()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(ra(g))},[g,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;Q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(gs,{children:h.jsx(jo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:T,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DrgIMsec.js";import{a as r}from"./sentry-BkoKwCRV.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-C3mA9Q5U.js";import"./mui-Rvgr2IA7.js";import c from"./NotFoundScreen-BvZXxX08.js";import{h as u,g as b}from"./core-vQwuHvL7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
1
+ import{j as s}from"./liveblocks-fDjf6Tur.js";import{a as r}from"./sentry-DjzU4p1F.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-C3-objML.js";import"./mui-Ky-KJxLh.js";import c from"./NotFoundScreen-D4Av36kV.js";import{h as u,g as b}from"./core-C8Y7fm3n.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as i}from"./sentry-BkoKwCRV.js";import{u as l,h as m,g as p}from"./core-vQwuHvL7.js";import{gB as f,Kh as g,Ki as b}from"./zeni-epic-state-6BXRR44j.js";import{u as _,L as h,z as y}from"./index-C3mA9Q5U.js";import"./liveblocks-DrgIMsec.js";import"./recharts-BA6FOoyE.js";import"./mui-Rvgr2IA7.js";import"./analytics-DNNAdslX.js";import"./plaid-7_KuF832.js";import"./dnd-D0_5bRGE.js";import"./stripe-DMRn4zHo.js";import"./lottie-BNwbvBq3.js";import"./lexical-BUO93qJ-.js";import"./pdf-DHm_gs_H.js";import"./utils-O0lAHdlb.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]="bb38e756-3c8d-4932-8d69-6506b71d54ac",e._sentryDebugIdIdentifier="sentry-dbid-bb38e756-3c8d-4932-8d69-6506b71d54ac")}catch{}})();function R(){const e=l(),n=m(),r=p(),{setLoading:o,clearAllLoading:u}=_(),s=i.useRef(!1);return i.useLayoutEffect(()=>{o(h.CONNECTION_AUTH)},[o]),i.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(r.search).get("code"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(f(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}))}u();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};
1
+ import{a as i}from"./sentry-DjzU4p1F.js";import{u as l,h as m,g as p}from"./core-C8Y7fm3n.js";import{gB as f,Kh as g,Ki as b}from"./zeni-epic-state-DvHgUD1-.js";import{u as _,L as h,z as y}from"./index-C3-objML.js";import"./liveblocks-fDjf6Tur.js";import"./recharts-CgIjuHOA.js";import"./mui-Ky-KJxLh.js";import"./analytics-BUNQWYXz.js";import"./plaid-D50ZkdQf.js";import"./dnd-RzzQg6oJ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DmArr_jQ.js";import"./lexical-CPmqnx9k.js";import"./pdf-NvioK7wV.js";import"./utils-Djk4rnCT.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]="bb38e756-3c8d-4932-8d69-6506b71d54ac",e._sentryDebugIdIdentifier="sentry-dbid-bb38e756-3c8d-4932-8d69-6506b71d54ac")}catch{}})();function R(){const e=l(),n=m(),r=p(),{setLoading:o,clearAllLoading:u}=_(),s=i.useRef(!1);return i.useLayoutEffect(()=>{o(h.CONNECTION_AUTH)},[o]),i.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(r.search).get("code"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(f(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}))}u();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};