@zeniai/web-app-ui 5.1.16-prod → 5.1.16-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-BmUd4vYL.js +1 -0
  2. package/dist/assets/{AddressScreen-kxW0VXwU.js → AddressScreen-BHOH_WLv.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-BD9LuPbq.js → AiCfoScreen-DAFLwJG_.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-Q0bYZW0T.js → BillPayApprovalRoutes-BK-ZwGIn.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BtXh9WDW.js → BillPayRoutes-QQCSBZkL.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DqVUAhbH.js → BusinessVerificationPageScreen-BiLuShF3.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-CcR0Kg4Y.js → ChargeCardRoutes-CXqQvycu.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-BV2a_i6I.js → CompanyPassportScreen-Cb1iYJZe.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-nS5UA39_.js → ConnectionAuthScreen-CZDo58x5.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-CS3Xmka2.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-zynbVbT1.js → CustomerOnboardingRoutes-jCmBO4Mn.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-uHr8Sl8R.js → DashboardRoutes-CDrvRI7s.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-DFimLn-s.js → DefaultTenantHome-BZchPKt2.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-CbiDMLSl.js → DomesticWireDetailScreen-6696dMHO.js} +1 -1
  15. package/dist/assets/{DrawerScreen-B8qy6piZ.js → DrawerScreen-MbZXqUoq.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-ChMyPkBw.js → EntityDetailRoutes-5UgOzlB5.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-Dbs8jAQC.js → ExpenseAutomationRoutes-DsR7qPoa.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-zYylsmMO.js → FeaturePreviewScreen-CVSV79yf.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-URGZ5Ekz.js → HubSpotOAuthCallbackScreen-BZAzKH7-.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-BbIaUZ6F.js → MagicLinkRoutes-WS_1Q0Lk.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-CTSvCkzk.js → MagicLinkSignInScreen-Dl1MbB9d.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-COGIpIoc.js → MobileAppDrawer-DgVPhlgQ.js} +1 -1
  23. package/dist/assets/NotFoundScreen-Bv_nRCjj.js +1 -0
  24. package/dist/assets/{NotificationRoutes-CoI1I0UX.js → NotificationRoutes-CDYFRT0v.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-Dj4ZZB6A.js → OAuthConsentScreen-BkPvVJhS.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-DFoNlsD5.js → PandLWithForecastRoutes-Bdh8vsXv.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-DD4sacjZ.js → PeopleRoutes-lUM8fGYE.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-Cz6YUxSp.js → PerformanceRoutes-BGffRGOA.js} +1 -1
  29. package/dist/assets/{Preview-CoTRJ68H.js → Preview-ulACyGAL.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-Bp_uUyx7.js → QBOConnectionScreen-D0nezBr9.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-ENnmEy2s.js → ReferralListScreen-DINWTi1Q.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-Cbx66GuE.js → ReimbursementApprovalRoutes-DB7O5cw7.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CihX7RJp.js → ReimbursementApprovalRuleDetailScreen-BXgtrc7k.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-XYw6ylOw.js → ReimbursementRoutes-qjw4T9lX.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-yASgFceO.js → ReportsRoutes-CqTf40Qy.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-BZPv2dJJ.js → RewardsRoutes-DIkvz1Jt.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-T9RlS2PP.js → ScreenRoutes-W867eoTR.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-Dh-XsJNw.js → SettingsRoutes-DRzTOLku.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-D5yVGK0c.js → SetupPagesScreen-CPEy50bJ.js} +1 -1
  40. package/dist/assets/{SignInScreen-CI-24AM2.js → SignInScreen-D_nrlvPb.js} +1 -1
  41. package/dist/assets/{SignOutScreen-BiH831Xb.js → SignOutScreen-BRpLavje.js} +1 -1
  42. package/dist/assets/{TaskListScreen-Dx4MLZkj.js → TaskListScreen-LsHZDVjF.js} +1 -1
  43. package/dist/assets/{TaskRoutes-m59AlWYW.js → TaskRoutes-DJ1gNgLs.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-CnoyseN8.js → TransactionDetailRoutes-DxRfHR5F.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-CRrD1rrU.js → TransactionDetailScreen-C5vka9J3.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-DMcMw7xZ.js → TransactionListRoutes-C4dv3IiR.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-swKkwa_X.js → TreasuryRoutes-bHKI0_zJ.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-BpeZSkrq.js → VendorsRoutes-DqnM7Xdr.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-ClPWF8w3.js → WiseConfirmationScreen-Cke3Uv9t.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-BwLuDOzt.js → ZeniAccountRoutes-CLwrbfOg.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-BgjrMmvf.js → ZeniAccountStatementScreen-CsDbnZmX.js} +1 -1
  52. package/dist/assets/{accountMappingHelper-BxXl62E-.js → accountMappingHelper-W5otorD-.js} +1 -1
  53. package/dist/assets/{analytics-DVcHd5D4.js → analytics-DXqzaj7k.js} +1 -1
  54. package/dist/assets/{analyticsHelper-D8mqdnP1.js → analyticsHelper-CjjD2OUX.js} +1 -1
  55. package/dist/assets/{core-Cy60pewc.js → core-C9zW9aiN.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-CvAV2ZH_.js → decodeURIComponentSafe-BPYfhkXa.js} +1 -1
  57. package/dist/assets/{dnd-B7KA0YNa.js → dnd-CyN5SJrk.js} +1 -1
  58. package/dist/assets/{empty-C0r2LR8d.js → empty-CgUWy1ya.js} +1 -1
  59. package/dist/assets/{empty-BinKjDMu.js → empty-LAjrKg-c.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-C_Y4KTAc.js → emptyVideoElement-HAOuHOAc.js} +1 -1
  61. package/dist/assets/{epic-DLFk3lb5.js → epic-Du76qfdK.js} +1 -1
  62. package/dist/assets/{getLocaleForTenant-RkomRM_7.js → getLocaleForTenant-C-mTF_-1.js} +1 -1
  63. package/dist/assets/{index-DXfCjMwK.js → index-1wxiPadS.js} +7 -7
  64. package/dist/assets/{index-jjkr5xKv.js → index-B7J5swVH.js} +2 -2
  65. package/dist/assets/{index-Lu-vRYTK.js → index-BDBxuaUt.js} +1 -1
  66. package/dist/assets/{index-B9ZC8BBd.js → index-BKXnOOiQ.js} +1 -1
  67. package/dist/assets/{index-CyER2VFG.js → index-BWbah6CI.js} +1 -1
  68. package/dist/assets/{index-e5kQpVcT.js → index-BaE1yb8B.js} +1 -1
  69. package/dist/assets/{index-lS13JcL7.js → index-BeiF5atT.js} +1 -1
  70. package/dist/assets/{index-BAxidMKK.js → index-DcFcyk9X.js} +1 -1
  71. package/dist/assets/{lexical-BTXEvig3.js → lexical-C9R0TbF2.js} +1 -1
  72. package/dist/assets/{liveblocks-Cj_tHvtA.js → liveblocks-D65YpEzb.js} +1 -1
  73. package/dist/assets/{lottie-KAslBocY.js → lottie-CyD5A6ZF.js} +1 -1
  74. package/dist/assets/{mui-CRLIhCCm.js → mui-CjAqh33Z.js} +1 -1
  75. package/dist/assets/{pathToGoBack-DM0_tn07.js → pathToGoBack-CydSZdwJ.js} +1 -1
  76. package/dist/assets/{pdf-DKyxBlDM.js → pdf-BTv9XTca.js} +3 -3
  77. package/dist/assets/{pdf-lib-CGSxq5us.js → pdf-lib-0B-WwULF.js} +1 -1
  78. package/dist/assets/{plaid-DkEItuLc.js → plaid-C7S-w4PD.js} +1 -1
  79. package/dist/assets/{pusher-DioeXKnY.js → pusher-Cs8HqkwM.js} +1 -1
  80. package/dist/assets/{react-D7y_-2_F.js → react-B0ycLXHh.js} +1 -1
  81. package/dist/assets/{react-BKylHzuD.js → react-BN4RYnhP.js} +1 -1
  82. package/dist/assets/{react-CsmCEt-f.js → react-CRTFund5.js} +1 -1
  83. package/dist/assets/{react-DlOJcc0C.js → react-CbPt48pi.js} +1 -1
  84. package/dist/assets/{react-CFXHw0r2.js → react-DQfJbxCg.js} +1 -1
  85. package/dist/assets/{react-DBJb8vBz.js → react-UcrcycqM.js} +1 -1
  86. package/dist/assets/{recharts-Btsi-yTh.js → recharts-DATP9UFl.js} +1 -1
  87. package/dist/assets/{routePaths-BHuMCYZS.js → routePaths-NM47duJ5.js} +1 -1
  88. package/dist/assets/{sentry-pDh2qSl7.js → sentry-Cc7E6KXa.js} +1 -1
  89. package/dist/assets/{url-DQEg-S7X.js → url-CYTm1dtu.js} +1 -1
  90. package/dist/assets/{url-8O3uL66H.js → url-kUZYC_m5.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BrY2cg9j.js → useAiCfoDashboardSuggestedQuestionsChips-Dmb4Bk7D.js} +1 -1
  92. package/dist/assets/{useAskAiCfoHostNavButtonProps-BZkbW7CL.js → useAskAiCfoHostNavButtonProps-BHe-JBXY.js} +1 -1
  93. package/dist/assets/{useDeviceId-BqeoLOMn.js → useDeviceId-BlRnIDLL.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-Jto-q518.js → useInitialThreadRequest-COJ5en-O.js} +1 -1
  95. package/dist/assets/{utils-BEyM61hw.js → utils-Ufaf0xdt.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-Pig-pzDa.js → withTransactionSidePanel-DzuPuyV9.js} +1 -1
  97. package/dist/assets/{zeni-epic-state-CRkqEZ9n.js → zeni-epic-state-CSVE6Gls.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +1 -1
  100. package/dist/assets/AddressRoutes-DTTDbfyu.js +0 -1
  101. package/dist/assets/CustomerOnboardingAuthScreen-BSR7thHq.js +0 -1
  102. package/dist/assets/NotFoundScreen-VuNCYuY2.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-D65YpEzb.js";import{A as d}from"./AddressScreen-BHOH_WLv.js";import i from"./NotFoundScreen-Bv_nRCjj.js";import"./sentry-Cc7E6KXa.js";import{o as s,p as r}from"./core-C9zW9aiN.js";import"./zeni-epic-state-CSVE6Gls.js";import"./recharts-DATP9UFl.js";import"./index-1wxiPadS.js";import"./mui-CjAqh33Z.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.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-Cj_tHvtA.js";import{a as h}from"./sentry-pDh2qSl7.js";import{h as T,u as _,g as j,i as E,j as B,n as K}from"./core-Cy60pewc.js";import{J as M,h as $,z as D,k as L,B as R,x as z,c as C,e as S,Z as F,i as b,j as N}from"./index-DXfCjMwK.js";import{Kb as k,h1 as U,eP as G,Kc as O,c2 as V,Kd as q,km as H}from"./zeni-epic-state-CRkqEZ9n.js";import{n as J}from"./mui-CRLIhCCm.js";import Z from"./NotFoundScreen-VuNCYuY2.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]="6b6e8f55-cd68-4736-a3d4-5960c04f967c",e._sentryDebugIdIdentifier="sentry-dbid-6b6e8f55-cd68-4736-a3d4-5960c04f967c")}catch{}})();const Q=J.div`
1
+ import{j as r}from"./liveblocks-D65YpEzb.js";import{a as h}from"./sentry-Cc7E6KXa.js";import{h as T,u as _,g as j,i as E,j as B,n as K}from"./core-C9zW9aiN.js";import{J as M,h as $,z as D,k as L,B as R,x as z,c as C,e as S,Z as F,i as b,j as N}from"./index-1wxiPadS.js";import{Kb as k,h1 as U,eP as G,Kc as O,c2 as V,Kd as q,km as H}from"./zeni-epic-state-CSVE6Gls.js";import{n as J}from"./mui-CjAqh33Z.js";import Z from"./NotFoundScreen-Bv_nRCjj.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]="6b6e8f55-cd68-4736-a3d4-5960c04f967c",e._sentryDebugIdIdentifier="sentry-dbid-6b6e8f55-cd68-4736-a3d4-5960c04f967c")}catch{}})();const Q=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-Cj_tHvtA.js";import{a as r}from"./sentry-pDh2qSl7.js";import{u as ge,h as Ce,g as Ie,j as J,i as be,n as ke}from"./core-Cy60pewc.js";import{U as xe,z as we,J as Pe,cP as Ee,cQ as Qe,b4 as Y,cR as Te,b3 as Z,j as D,x as L,c as I,cS as F,cT as ve,cU as ye,a1 as _e,e as Oe,a7 as Ae,cV as Ue,a2 as je,m as Le,b0 as Fe,cW as Re}from"./index-DXfCjMwK.js";import{fI as De,eO as ee,eP as Be,hH as Me,QN as Ve,eS as Ge,hR as Ne,hN as $e,eQ as R,ft as qe,fm as We,fq as X,fu as ze,fv as He,fw as Je,fx as Ye,fy as Xe}from"./zeni-epic-state-CRkqEZ9n.js";import{D as Ke,n as b,S as Ze,P as et}from"./mui-CRLIhCCm.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-BrY2cg9j.js";import{p as st}from"./pathToGoBack-DM0_tn07.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.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]="798b1d0c-d6f0-4a7d-b945-671a630e258a",a._sentryDebugIdIdentifier="sentry-dbid-798b1d0c-d6f0-4a7d-b945-671a630e258a")}catch{}})();const te="chat-response-generated",ot=ke(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=He(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:k,currentQuestionAnswerSummary:Q}=Z(d,t);u!=="answer"?I.trackAICFOChatResponseGenerated(u,k?.question.questionText??"",o.text,t,Re(Q,E),o.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(o.text,k?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Je(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(Xe({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(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(ze(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(X(""))},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(We());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=J(n=>ee(n)),f=we.getSignedInUser(),{session_id:e}=be(),p=Pe(),o=_e(p),u=J(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:k,isUploadPromoVisible:Q}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),T=Qe({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,v]=r.useState(null),[ne,y]=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;v(w),y(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(()=>{v(null),y(!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,N=r.useRef(!1);r.useEffect(()=>{N.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),N.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(v(P),y(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:$}=Te(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",W=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),z=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Z(z,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:$.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[$]);r.useEffect(()=>{U!=="In-Progress"&&j&&s(Ne())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&W&&f!=null&&U==="Completed"&&!j&&s($e(t,f.userId))},[q,W,t,f,s]);const H=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:H}),T.drawerElement,c.jsx(it,{children:c.jsx(K,{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:H}):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&&T.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:z,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?T.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:Q,onUploadPromoClose:k,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Ke,{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(K,{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(ve,{open:S,onClose:()=>h(!1),children:c.jsx(ye,{children:Se})}):null]})},K=b(Ze)`
1
+ import{j as c}from"./liveblocks-D65YpEzb.js";import{a as r}from"./sentry-Cc7E6KXa.js";import{u as ge,h as Ce,g as Ie,j as J,i as be,n as ke}from"./core-C9zW9aiN.js";import{U as xe,z as we,J as Pe,cP as Ee,cQ as Qe,b4 as Y,cR as Te,b3 as Z,j as D,x as L,c as I,cS as F,cT as ve,cU as ye,a1 as _e,e as Oe,a7 as Ae,cV as Ue,a2 as je,m as Le,b0 as Fe,cW as Re}from"./index-1wxiPadS.js";import{fI as De,eO as ee,eP as Be,hH as Me,QN as Ve,eS as Ge,hR as Ne,hN as $e,eQ as R,ft as qe,fm as We,fq as X,fu as ze,fv as He,fw as Je,fx as Ye,fy as Xe}from"./zeni-epic-state-CSVE6Gls.js";import{D as Ke,n as b,S as Ze,P as et}from"./mui-CjAqh33Z.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-Dmb4Bk7D.js";import{p as st}from"./pathToGoBack-CydSZdwJ.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.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]="798b1d0c-d6f0-4a7d-b945-671a630e258a",a._sentryDebugIdIdentifier="sentry-dbid-798b1d0c-d6f0-4a7d-b945-671a630e258a")}catch{}})();const te="chat-response-generated",ot=ke(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=He(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:k,currentQuestionAnswerSummary:Q}=Z(d,t);u!=="answer"?I.trackAICFOChatResponseGenerated(u,k?.question.questionText??"",o.text,t,Re(Q,E),o.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(o.text,k?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Je(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(Xe({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(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(ze(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(X(""))},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(We());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=J(n=>ee(n)),f=we.getSignedInUser(),{session_id:e}=be(),p=Pe(),o=_e(p),u=J(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:k,isUploadPromoVisible:Q}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),T=Qe({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,v]=r.useState(null),[ne,y]=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;v(w),y(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(()=>{v(null),y(!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,N=r.useRef(!1);r.useEffect(()=>{N.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),N.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(v(P),y(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:$}=Te(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",W=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),z=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Z(z,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:$.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[$]);r.useEffect(()=>{U!=="In-Progress"&&j&&s(Ne())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&W&&f!=null&&U==="Completed"&&!j&&s($e(t,f.userId))},[q,W,t,f,s]);const H=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:H}),T.drawerElement,c.jsx(it,{children:c.jsx(K,{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:H}):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&&T.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:z,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?T.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:Q,onUploadPromoClose:k,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Ke,{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(K,{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(ve,{open:S,onClose:()=>h(!1),children:c.jsx(ye,{children:Se})}):null]})},K=b(Ze)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-Cj_tHvtA.js";import{a as y}from"./sentry-pDh2qSl7.js";import{h as U,g as B,u as j,j as v,N,n as T,i as O,o as $,p as h}from"./core-Cy60pewc.js";import{eP as F,Nu as R,Na as b,xU as x,xO as L,xS as I,xH as W,Nc as q,xK as z,xW as G,xV as C}from"./zeni-epic-state-CRkqEZ9n.js";import{h as P,z as k,B as V,a7 as H,bF as K,af as _,bG as J}from"./index-DXfCjMwK.js";import"./mui-CRLIhCCm.js";import{i as M}from"./ReimbursementApprovalRuleDetailScreen-CihX7RJp.js";import Q from"./NotFoundScreen-VuNCYuY2.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]="59936905-5c2d-40b9-bd54-e49b0600fc7d",e._sentryDebugIdIdentifier="sentry-dbid-59936905-5c2d-40b9-bd54-e49b0600fc7d")}catch{}})();const w="bill-approval-rule-update",X=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(q(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(W(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(H(K)),Y=()=>{const e=U(),o=B(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,S)=>{i.endsWith(w)&&S.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=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(m=>({type:"user",userId:m.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(m=>{const E=!!M(m.value);return{type:E?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),S=i.concat(A);g.push({action:f.stepType.selectedOption,actors:S,operator:S.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{t("../")}}})(J);function D(){const e=U(),o=j(),t=B(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(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(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Q,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-D65YpEzb.js";import{a as y}from"./sentry-Cc7E6KXa.js";import{h as U,g as B,u as j,j as v,N,n as T,i as O,o as $,p as h}from"./core-C9zW9aiN.js";import{eP as F,Nu as R,Na as b,xU as x,xO as L,xS as I,xH as W,Nc as q,xK as z,xW as G,xV as C}from"./zeni-epic-state-CSVE6Gls.js";import{h as P,z as k,B as V,a7 as H,bF as K,af as _,bG as J}from"./index-1wxiPadS.js";import"./mui-CjAqh33Z.js";import{i as M}from"./ReimbursementApprovalRuleDetailScreen-BXgtrc7k.js";import Q from"./NotFoundScreen-Bv_nRCjj.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]="59936905-5c2d-40b9-bd54-e49b0600fc7d",e._sentryDebugIdIdentifier="sentry-dbid-59936905-5c2d-40b9-bd54-e49b0600fc7d")}catch{}})();const w="bill-approval-rule-update",X=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(q(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(W(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(H(K)),Y=()=>{const e=U(),o=B(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,S)=>{i.endsWith(w)&&S.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=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(m=>({type:"user",userId:m.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(m=>{const E=!!M(m.value);return{type:E?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),S=i.concat(A);g.push({action:f.stepType.selectedOption,actors:S,operator:S.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{t("../")}}})(J);function D(){const e=U(),o=j(),t=B(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(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(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Q,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-Cj_tHvtA.js";import{h as Y,u as se,g as J,i as ae,j as v,N as te,n as X,l as na,o as ia,p as S}from"./core-Cy60pewc.js";import{eP as Z,MM as Ue,bt as It,HG as oa,bo as wt,bF as pe,MN as xt,xc as Ct,ym as $e,xL as la,bn as De,MO as sa,MP as ra,c2 as ca,MQ as da,jG as Bt,MR as At,MS as Et,yX as _e,xr as Be,MT as ua,x0 as tt,MU as pa,C7 as ma,x4 as ba,xa as Dt,MV as ke,MW as Me,yn as Ge,MX as ha,MY as ga,yq as Oe,MZ as ya,yD as Sa,M_ as jt,y7 as at,yc as fa,M$ as ka,N0 as ue,N1 as Tt,N2 as Pt,N3 as Ft,fM as va,xw as Le,cx as Rt,N4 as Ia,gT as wa,N5 as xa,N6 as Ca,e_ as Vt,eY as $t,N7 as ze,N8 as Ba,N9 as Aa,Kv as Ze,Na as Ea,Kw as oe,Kx as He,Nb as Da,Nc as ja,Nd as Ta,ye as nt,yb as Pa,Ne as Fa,Nf as Ra,Ng as Va,xZ as $a,Nh as La,Ni as Na,Nj as Ua,cl as Lt,cM as Nt,jR as _a,bL as Ma,bq as Ut,bM as _t,wi as Ga,Nk as Oa,BW as za,C0 as Za,sP as Ha,yo as Wa,z2 as qa,k2 as fe,Nl as Ka,Nm as Mt,kw as Ya,jY as Gt,kh as Ot,kg as it,bE as be,bK as Ja,Nn as Xa,No as ve,iB as Qa,Np as ot,Nq as en,iF as tn,i_ as an,zg as nn,Nr as on,kp as ln,z6 as sn,Ns as lt,za as rn,zf as cn,zc as dn,z4 as un,Nt as zt,xl as pn,Nu as mn,Nv as bn,fE as hn,fD as gn,fC as yn,k5 as Sn,kn as st,ky as fn,qf as kn,ke as vn,z8 as In,iL as wn,kD as xn,Nw as Cn,iD as Bn,q6 as An,Nx as En,y3 as Dn,bG as jn,bs as Tn,Jq as Pn,cO as Fn,cN as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-CRkqEZ9n.js";import{h as me,z as V,k as Ie,Y as We,v as le,I as y,aN as Ae,B as re,o as A,x as je,c as D,bc as Ln,j as z,a2 as qe,m as E,J as we,bd as rt,be as ct,bf as Nn,ak as Un,C as _n,aH as Mn,A as Zt,D as Ke,F as Ye,bg as Gn,at as Ht,bh as On,V as zn,e as Wt,a7 as Zn,bi as Hn,bj as Wn,bk as qn,bl as Kn,bm as Yn,bn as Jn,bo as Xn,bp as Qn,bq as ei,r as ti,br as ai,b7 as ni,bs as ii,bt as oi,a9 as li}from"./index-DXfCjMwK.js";import{n as N,S as si}from"./mui-CRLIhCCm.js";import{A as dt}from"./AddressScreen-kxW0VXwU.js";import{g as ie,a as Te,i as qt,V as Je,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-CbiDMLSl.js";import{a as f}from"./sentry-pDh2qSl7.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-BZkbW7CL.js";import{u as Kt}from"./useInitialThreadRequest-Jto-q518.js";import Ee from"./NotFoundScreen-VuNCYuY2.js";import{D as ui}from"./DrawerScreen-B8qy6piZ.js";import{M as Yt}from"./MobileAppDrawer-COGIpIoc.js";import{F as Jt}from"./FeaturePreviewScreen-zYylsmMO.js";import{S as Pe}from"./SetupPagesScreen-D5yVGK0c.js";import{B as pi}from"./BillPayApprovalRoutes-Q0bYZW0T.js";import{FallBackRoute as mi}from"./ScreenRoutes-T9RlS2PP.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";import"./analyticsHelper-D8mqdnP1.js";import"./routePaths-BHuMCYZS.js";import"./BusinessVerificationPageScreen-DqVUAhbH.js";import"./ReimbursementApprovalRuleDetailScreen-CihX7RJp.js";import"./getLocaleForTenant-RkomRM_7.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]="ed044064-acd1-4587-821d-a58350f5223c",e._sentryDebugIdIdentifier="sentry-dbid-ed044064-acd1-4587-821d-a58350f5223c")}catch{}})();const bi=X(function(e,t){const l=Ue(e,t.billId),i=V.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:Bt(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(Be(l,"retry")):e(Be(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(Be(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Ln);function hi(){const e=Y(),t=se(),l=J(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Ue(G,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}=Qe({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,x]=f.useState(!1),[C,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:U}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=U(Ae.zeniAssistConfig),B=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&B===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,B,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,L,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,L,Q,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:L,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=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.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(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=Y(),{billId:i}=ae(),c=J(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,_]=f.useState(!1),[T,U]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),B=v(F=>Me(F,m,g,i));let q=B.fetchState,W=B.file,L=B.showAutofill;const K=v(F=>Ue(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],L=!1);const Q=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&C&&_(!1))},[i]),f.useEffect(()=>{C||i==null||u||(_(!0),t(Ct(i,h,j,!1)),T||(U(!0),t($e(!1,h,j,b,i)))),u&&!T&&(U(!0),t($e(!1,h,j,b,i)))},[C,T,u,i,t]);const G={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",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(Q??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:Q}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Nn,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:G,isEditPopup:!0}):null,o==="small"||L?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:L,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,B),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();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-D65YpEzb.js";import{h as Y,u as se,g as J,i as ae,j as v,N as te,n as X,l as na,o as ia,p as S}from"./core-C9zW9aiN.js";import{eP as Z,MM as Ue,bt as It,HG as oa,bo as wt,bF as pe,MN as xt,xc as Ct,ym as $e,xL as la,bn as De,MO as sa,MP as ra,c2 as ca,MQ as da,jG as Bt,MR as At,MS as Et,yX as _e,xr as Be,MT as ua,x0 as tt,MU as pa,C7 as ma,x4 as ba,xa as Dt,MV as ke,MW as Me,yn as Ge,MX as ha,MY as ga,yq as Oe,MZ as ya,yD as Sa,M_ as jt,y7 as at,yc as fa,M$ as ka,N0 as ue,N1 as Tt,N2 as Pt,N3 as Ft,fM as va,xw as Le,cx as Rt,N4 as Ia,gT as wa,N5 as xa,N6 as Ca,e_ as Vt,eY as $t,N7 as ze,N8 as Ba,N9 as Aa,Kv as Ze,Na as Ea,Kw as oe,Kx as He,Nb as Da,Nc as ja,Nd as Ta,ye as nt,yb as Pa,Ne as Fa,Nf as Ra,Ng as Va,xZ as $a,Nh as La,Ni as Na,Nj as Ua,cl as Lt,cM as Nt,jR as _a,bL as Ma,bq as Ut,bM as _t,wi as Ga,Nk as Oa,BW as za,C0 as Za,sP as Ha,yo as Wa,z2 as qa,k2 as fe,Nl as Ka,Nm as Mt,kw as Ya,jY as Gt,kh as Ot,kg as it,bE as be,bK as Ja,Nn as Xa,No as ve,iB as Qa,Np as ot,Nq as en,iF as tn,i_ as an,zg as nn,Nr as on,kp as ln,z6 as sn,Ns as lt,za as rn,zf as cn,zc as dn,z4 as un,Nt as zt,xl as pn,Nu as mn,Nv as bn,fE as hn,fD as gn,fC as yn,k5 as Sn,kn as st,ky as fn,qf as kn,ke as vn,z8 as In,iL as wn,kD as xn,Nw as Cn,iD as Bn,q6 as An,Nx as En,y3 as Dn,bG as jn,bs as Tn,Jq as Pn,cO as Fn,cN as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-CSVE6Gls.js";import{h as me,z as V,k as Ie,Y as We,v as le,I as y,aN as Ae,B as re,o as A,x as je,c as D,bc as Ln,j as z,a2 as qe,m as E,J as we,bd as rt,be as ct,bf as Nn,ak as Un,C as _n,aH as Mn,A as Zt,D as Ke,F as Ye,bg as Gn,at as Ht,bh as On,V as zn,e as Wt,a7 as Zn,bi as Hn,bj as Wn,bk as qn,bl as Kn,bm as Yn,bn as Jn,bo as Xn,bp as Qn,bq as ei,r as ti,br as ai,b7 as ni,bs as ii,bt as oi,a9 as li}from"./index-1wxiPadS.js";import{n as N,S as si}from"./mui-CjAqh33Z.js";import{A as dt}from"./AddressScreen-BHOH_WLv.js";import{g as ie,a as Te,i as qt,V as Je,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-6696dMHO.js";import{a as f}from"./sentry-Cc7E6KXa.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-BHe-JBXY.js";import{u as Kt}from"./useInitialThreadRequest-COJ5en-O.js";import Ee from"./NotFoundScreen-Bv_nRCjj.js";import{D as ui}from"./DrawerScreen-MbZXqUoq.js";import{M as Yt}from"./MobileAppDrawer-DgVPhlgQ.js";import{F as Jt}from"./FeaturePreviewScreen-CVSV79yf.js";import{S as Pe}from"./SetupPagesScreen-CPEy50bJ.js";import{B as pi}from"./BillPayApprovalRoutes-BK-ZwGIn.js";import{FallBackRoute as mi}from"./ScreenRoutes-W867eoTR.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.js";import"./analyticsHelper-CjjD2OUX.js";import"./routePaths-NM47duJ5.js";import"./BusinessVerificationPageScreen-BiLuShF3.js";import"./ReimbursementApprovalRuleDetailScreen-BXgtrc7k.js";import"./getLocaleForTenant-C-mTF_-1.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]="ed044064-acd1-4587-821d-a58350f5223c",e._sentryDebugIdIdentifier="sentry-dbid-ed044064-acd1-4587-821d-a58350f5223c")}catch{}})();const bi=X(function(e,t){const l=Ue(e,t.billId),i=V.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:Bt(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(Be(l,"retry")):e(Be(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(Be(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Ln);function hi(){const e=Y(),t=se(),l=J(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Ue(G,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}=Qe({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,x]=f.useState(!1),[C,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:U}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=U(Ae.zeniAssistConfig),B=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&B===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,B,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,L,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,L,Q,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:L,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=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.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(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=Y(),{billId:i}=ae(),c=J(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,_]=f.useState(!1),[T,U]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),B=v(F=>Me(F,m,g,i));let q=B.fetchState,W=B.file,L=B.showAutofill;const K=v(F=>Ue(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],L=!1);const Q=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&C&&_(!1))},[i]),f.useEffect(()=>{C||i==null||u||(_(!0),t(Ct(i,h,j,!1)),T||(U(!0),t($e(!1,h,j,b,i)))),u&&!T&&(U(!0),t($e(!1,h,j,b,i)))},[C,T,u,i,t]);const G={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",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(Q??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:Q}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Nn,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:G,isEditPopup:!0}):null,o==="small"||L?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:L,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,B),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();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=N.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-Cj_tHvtA.js";import{a as N}from"./sentry-pDh2qSl7.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-Cy60pewc.js";import{k as ce,v as ue,aN as de,z,x as pe,c as B,af as x,e as E,bB as le,at as me,m as P,au as R}from"./index-DXfCjMwK.js";import{Ni as fe,eP as G,se as ye,HK as Se,xZ as ge,AG as Ie,Dd as he,DS as be,EL as De,NF as Oe,NG as Te,NH as ke,NI as Ce,NJ as Ne,Kc as Ve,MH as we,Ko as Ae,km as _e,fE as ve,fD as Fe,fC as xe,qf as Ee,q6 as ze,q3 as Be,ke as Pe,sn as Re,sl as L,bE as M,sz as U,cv as Le}from"./zeni-epic-state-CRkqEZ9n.js";import{n as Me}from"./mui-CRLIhCCm.js";import{d as j}from"./routePaths-BHuMCYZS.js";import{M as Ue}from"./MobileAppDrawer-COGIpIoc.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]="b331d371-af2c-4760-a1c5-1793fe50edd1",e._sentryDebugIdIdentifier="sentry-dbid-b331d371-af2c-4760-a1c5-1793fe50edd1")}catch{}})();const je=Me.div`
1
+ import{j as k}from"./liveblocks-D65YpEzb.js";import{a as N}from"./sentry-Cc7E6KXa.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-C9zW9aiN.js";import{k as ce,v as ue,aN as de,z,x as pe,c as B,af as x,e as E,bB as le,at as me,m as P,au as R}from"./index-1wxiPadS.js";import{Ni as fe,eP as G,se as ye,HK as Se,xZ as ge,AG as Ie,Dd as he,DS as be,EL as De,NF as Oe,NG as Te,NH as ke,NI as Ce,NJ as Ne,Kc as Ve,MH as we,Ko as Ae,km as _e,fE as ve,fD as Fe,fC as xe,qf as Ee,q6 as ze,q3 as Be,ke as Pe,sn as Re,sl as L,bE as M,sz as U,cv as Le}from"./zeni-epic-state-CSVE6Gls.js";import{n as Me}from"./mui-CjAqh33Z.js";import{d as j}from"./routePaths-NM47duJ5.js";import{M as Ue}from"./MobileAppDrawer-DgVPhlgQ.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]="b331d371-af2c-4760-a1c5-1793fe50edd1",e._sentryDebugIdIdentifier="sentry-dbid-b331d371-af2c-4760-a1c5-1793fe50edd1")}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-Cj_tHvtA.js";import{h as le,i as ca,u as ue,j as y,g as ge,n as pe,N as ga,s as ut,o as qt,p as ne}from"./core-Cy60pewc.js";import{eP as ce,bs as Ue,Pc as ka,eY as be,eZ as ye,e_ as Se,fT as $e,cs as ze,Pd as Ze,Pe as Ma,tt as ba,jO as ya,Pf as Sa,gT as oa,zZ as Je,z$ as Ga,A0 as $a,jE as mt,Pg as Ye,zN as Ct,Ph as Qt,Pi as Xt,zQ as Da,Pj as Jt,NC as _a,rF as pt,zW as za,h2 as en,Pk as ht,Pl as Ke,bq as an,Pm as tn,fE as Pa,fD as wa,Au as nn,fC as Ta,Ni as rn,Pn as ft,cl as gt,cM as sn,NB as da,B4 as on,Po as tt,AG as Fa,Pp as bt,B5 as cn,O1 as dn,B6 as ln,C0 as un,sP as mn,BW as Cn,Af as yt,A8 as pn,Pq as hn,fV as fn,Ao as St,As as It,fU as gn,Pr as bn,AS as At,Ps as yn,Pt as Sn,Pu as In,Aq as Et,Ab as kt,zT as Dt,Ak as _t,Ai as Pt,Am as An,z_ as nt,Pv as wt,Pw as va,AD as Ia,Kh as Tt,cN as Za,Px as En,Py as kn,Pz as Dn,PA as _n,AA as Va,AZ as Pn,AV as wn,Aw as Tn,AX as Fn,AN as vn,AP as xn,PB as Ft,B3 as vt,HG as Bn,PC as Ln,PD as Rn,PE as Un,PF as xt,PG as On,Bq as jn,AF as Bt,Az as ia,AE as Vn,PH as Nn,PI as Hn,zK as Mn,PJ as Lt,PK as Rt,PL as Gn,zM as $n,zL as rt,PM as zn,PN as Zn,PO as Yn,Kd as Kn,PP as Ya,PQ as Wn,wl as Ut,km as qn,gU as Qn,Bv as Xn,PR as Ot,PS as Jn,Bw as er,PT as ar,de as tr,tn as nr,Bl as rr,Bf as Re,bt as sr,bF as or,cx as ir,bG as cr,Jq as dr}from"./zeni-epic-state-CRkqEZ9n.js";import{z as J,k as je,v as se,I as Z,B as la,c2 as xa,cd as lr,j as ve,ce as ur,cf as mr,J as ua,aN as Fe,m as fe,bm as Ka,cg as Cr,A as ma,i as Ba,h as Wa,c as Q,D as qa,ch as pr,Y as jt,aq as Qa,by as Qe,ci as Na,cj as hr,x as Xa,a7 as fr,ck as gr,at as Vt,a2 as Ha,V as Nt,e as Ht,cl as br,cm as yr,cn as Sr,co as Ir,cp as Ar,cq as Er,o as Aa,cr as kr,cs as Dr,ct as Ua,r as _r,cu as Pr,cv as wr,cw as Tr,cx as Fr,cy as vr,a9 as xr}from"./index-DXfCjMwK.js";import{n as _e,D as Mt,S as Br}from"./mui-CRLIhCCm.js";import{a as c}from"./sentry-pDh2qSl7.js";import{g as Ce,a as Ca,b as Gt,c as Ie,d as Ae,e as Oe,f as Ve,A as Lr,h as Ja,P as Rr,i as et,s as Xe,j as $t,k as Me,l as zt,m as Ur,n as Zt,p as Or,S as st}from"./SetupPagesScreen-D5yVGK0c.js";import{u as Yt}from"./useInitialThreadRequest-Jto-q518.js";import La from"./NotFoundScreen-VuNCYuY2.js";import{M as Ge}from"./MobileAppDrawer-COGIpIoc.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-BZkbW7CL.js";import{v as ot}from"./utils-BEyM61hw.js";import{t as jr}from"./AddressScreen-kxW0VXwU.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./analyticsHelper-D8mqdnP1.js";import"./routePaths-BHuMCYZS.js";import"./BusinessVerificationPageScreen-DqVUAhbH.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]="e772e0c1-2fef-4a88-bbd9-01277f6ff494",e._sentryDebugIdIdentifier="sentry-dbid-e772e0c1-2fef-4a88-bbd9-01277f6ff494")}catch{}})();function Vr(){const e=le(),{cardId:t}=ca(),a=ue(),r=J.getSignedInUser(),n=y(X=>ce(X)),C=je(),m=Ue(C?.loggedInUserRoleMap),{useFeatureGate:g}=se();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const E=n.userRole.includes("charge_card_user"),{isFeatureEnabled:S}=g(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:O}=g(Z.isDebitCardFeatureEnabled),v=be(n),D=ye(n),p=Se(O,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,b=Ie({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:p}),l=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:S,isBookKeepingTenant:D,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:u}),_=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,F=y(X=>$e(X,n.companyId)),R=ze(F.controllers),{creditAccount:B,creditAccountRepayment:T}=y(X=>Ze(X)),N=y(X=>X.classListState.fetchState),d=!E&&l&&f,h=y(X=>Ma(X,t,d,l)),[P,w]=c.useState(!1),U=h.chargeCard,j=U?.cardCreatedByUser?.userId,$=y(X=>j!=null?ba(X.userRoleState,j):void 0),H=$?.accountingClassIDs[0],V=y(X=>H!=null?ya(X.classState,{classId:H,reportId:"class_list"}):void 0),A=U?.cardHolderUser?.userId,L=y(X=>A!=null?ba(X.userRoleState,A):void 0),W=L?.accountingClassIDs[0],k=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),Y=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",q=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&Y&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,Y,q]),c.useEffect(()=>{P||h.fetchState==="Completed"||h.fetchState==="In-Progress"||t==null||(w(!0),a(Je(t,d,!1)))},[P,h,t,a]),c.useEffect(()=>{if(h.fetchState==="Completed"&&(Y===!1||Y&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,U,i);e(X)}},[h.fetchState,i,Y]),c.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a($a()),N!=="Completed"&&N!=="In-Progress"&&a(mt())},[B.fetchState,T.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",oe=Oe(l,b,_,f),ee=Ca(l,f,m,B,T),te=Gt(x,h);return h.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:i}),s.jsx(lr,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:R,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:b,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:f,productInformation:oe,creditAccountInformation:ee,debitAccountInformation:te,chargeCardDetailView:h,creditAccount:B,classListFetchState:N,creditAccountRepayment:T,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:L?.userRoles,cardHolderDepartmentName:k?.className})]})}const Nr=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Qt({uiState:{sortKey:t,sortOrder:a}}))}}})(mr);function Hr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(S=>ce(S)),{useFeatureGate:C}=se(),{isFeatureEnabled:m}=C(Z.isCardsCommentingEnabled),[g,I]=c.useState(!1),o=y(S=>Ye(S)),i=Yt(n.companyId,{clearParams:o.fetchState==="Completed"}),E=c.useCallback(()=>{const S=ve(a.state?.pathnameStackToGoBack),f=S.poppedPathname??Mr(n.tenantEmailDomain);e(f,{state:{pathnameStackToGoBack:S.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{g||o.fetchState==="Completed"||o.fetchState==="In-Progress"||(I(!0),t(Ct()))},[g,o,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return o.fetchState==="In-Progress"?s.jsx(ur,{onBackClick:E}):o.cashbackSummary.cashbackEarned.amount===0&&o.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:E,isCardsCommentingEnabled:m,initialOpenThreadRequest:i})}const Mr=e=>`/${e}/cards`,Gr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m}=se(),[g,I]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[f,O]=c.useState(!1),v=J.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const D=y(k=>ce(k));if(n==null)throw Error("Empty card id is not valid...");const{configValue:p}=m(Fe.zeniCardsConfig),u=p.max_charge_card_activation_attempts_by_card_id,b=y(k=>Xt(k,n)),l=b.chargeCard,_=y(k=>k.chargeCardConfigState.fetchState),{useFeatureGate:F}=se(),{isFeatureEnabled:R}=F(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=F(Z.isDebitCardFeatureEnabled),T=Se(B,D),N=Ie({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:T}),d=!!D.companyChargeCardInfo?.info?.isChargeCardEnabled,h=D.userRole.includes("charge_card_user"),P=be(D),w=ye(D),U=D.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,j=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:R,isBookKeepingTenant:w,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:U}),$=!h&&j&&d;c.useEffect(()=>{g===!1&&_!=="In-Progress"&&_!=="Completed"&&(a(Da()),I(!0)),o===!1&&b.fetchState==="Not-Started"&&(i(!0),a(Je(n,$,j)))},[o,b.fetchState,g,_]);const H=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(b.fetchState==="Completed"){if(E===!1&&(H===!1||H&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const k=Ce(D.tenantEmailDomain,n,v,l,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);r(k,{state:{pathnameStackToGoBack:Y}})}else if(E&&b.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(Jt({chargeCardId:n}));const k=Ce(D.tenantEmailDomain,n,v,l,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(k,{state:{pathnameStackToGoBack:Y}})}}},[b.fetchState,l?.type.code,E,b.isRefreshingViewInBackground]);const V=J.getZeniOtpTokenForCardHolder(n),A=y(k=>pt(k.userState,v.userId)),L=()=>{l?.status?.code!=="active"&&a(za(n,!0))};c.useEffect(()=>{b.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(k=>k.statusCode==="success")===!0&&E===!1&&(setTimeout(L,3e3),S(!0))},[b.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const W=k=>{O(k)};if(_!=="Completed"||l==null)return s.jsx(la,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(A?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(zr,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:A.phone,signedInUser:v,isSandboxEnv:Ka(),chargeCardDetailState:b,signedInUserToken:V,navigate:r,currentTenant:D,location:C,maxChargeCardActivationAttempts:u[n]!=null?u[n]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Zr,{windowSize:t,children:e}):null]})},zr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=en(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const m=ht(e,n),g=t.updateStatus,I=Ke(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(an())||i,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:m,activationWaitStatus:g,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:m}=t,g=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=C;return{onGetOtp:o=>{g!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(nn(r,o))},onResendOtp:o=>{g!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{g!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(tn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ve(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(Cr),Zr=_e.div`
1
+ import{j as s}from"./liveblocks-D65YpEzb.js";import{h as le,i as ca,u as ue,j as y,g as ge,n as pe,N as ga,s as ut,o as qt,p as ne}from"./core-C9zW9aiN.js";import{eP as ce,bs as Ue,Pc as ka,eY as be,eZ as ye,e_ as Se,fT as $e,cs as ze,Pd as Ze,Pe as Ma,tt as ba,jO as ya,Pf as Sa,gT as oa,zZ as Je,z$ as Ga,A0 as $a,jE as mt,Pg as Ye,zN as Ct,Ph as Qt,Pi as Xt,zQ as Da,Pj as Jt,NC as _a,rF as pt,zW as za,h2 as en,Pk as ht,Pl as Ke,bq as an,Pm as tn,fE as Pa,fD as wa,Au as nn,fC as Ta,Ni as rn,Pn as ft,cl as gt,cM as sn,NB as da,B4 as on,Po as tt,AG as Fa,Pp as bt,B5 as cn,O1 as dn,B6 as ln,C0 as un,sP as mn,BW as Cn,Af as yt,A8 as pn,Pq as hn,fV as fn,Ao as St,As as It,fU as gn,Pr as bn,AS as At,Ps as yn,Pt as Sn,Pu as In,Aq as Et,Ab as kt,zT as Dt,Ak as _t,Ai as Pt,Am as An,z_ as nt,Pv as wt,Pw as va,AD as Ia,Kh as Tt,cN as Za,Px as En,Py as kn,Pz as Dn,PA as _n,AA as Va,AZ as Pn,AV as wn,Aw as Tn,AX as Fn,AN as vn,AP as xn,PB as Ft,B3 as vt,HG as Bn,PC as Ln,PD as Rn,PE as Un,PF as xt,PG as On,Bq as jn,AF as Bt,Az as ia,AE as Vn,PH as Nn,PI as Hn,zK as Mn,PJ as Lt,PK as Rt,PL as Gn,zM as $n,zL as rt,PM as zn,PN as Zn,PO as Yn,Kd as Kn,PP as Ya,PQ as Wn,wl as Ut,km as qn,gU as Qn,Bv as Xn,PR as Ot,PS as Jn,Bw as er,PT as ar,de as tr,tn as nr,Bl as rr,Bf as Re,bt as sr,bF as or,cx as ir,bG as cr,Jq as dr}from"./zeni-epic-state-CSVE6Gls.js";import{z as J,k as je,v as se,I as Z,B as la,c2 as xa,cd as lr,j as ve,ce as ur,cf as mr,J as ua,aN as Fe,m as fe,bm as Ka,cg as Cr,A as ma,i as Ba,h as Wa,c as Q,D as qa,ch as pr,Y as jt,aq as Qa,by as Qe,ci as Na,cj as hr,x as Xa,a7 as fr,ck as gr,at as Vt,a2 as Ha,V as Nt,e as Ht,cl as br,cm as yr,cn as Sr,co as Ir,cp as Ar,cq as Er,o as Aa,cr as kr,cs as Dr,ct as Ua,r as _r,cu as Pr,cv as wr,cw as Tr,cx as Fr,cy as vr,a9 as xr}from"./index-1wxiPadS.js";import{n as _e,D as Mt,S as Br}from"./mui-CjAqh33Z.js";import{a as c}from"./sentry-Cc7E6KXa.js";import{g as Ce,a as Ca,b as Gt,c as Ie,d as Ae,e as Oe,f as Ve,A as Lr,h as Ja,P as Rr,i as et,s as Xe,j as $t,k as Me,l as zt,m as Ur,n as Zt,p as Or,S as st}from"./SetupPagesScreen-CPEy50bJ.js";import{u as Yt}from"./useInitialThreadRequest-COJ5en-O.js";import La from"./NotFoundScreen-Bv_nRCjj.js";import{M as Ge}from"./MobileAppDrawer-DgVPhlgQ.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-BHe-JBXY.js";import{v as ot}from"./utils-Ufaf0xdt.js";import{t as jr}from"./AddressScreen-BHOH_WLv.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./analyticsHelper-CjjD2OUX.js";import"./routePaths-NM47duJ5.js";import"./BusinessVerificationPageScreen-BiLuShF3.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]="e772e0c1-2fef-4a88-bbd9-01277f6ff494",e._sentryDebugIdIdentifier="sentry-dbid-e772e0c1-2fef-4a88-bbd9-01277f6ff494")}catch{}})();function Vr(){const e=le(),{cardId:t}=ca(),a=ue(),r=J.getSignedInUser(),n=y(X=>ce(X)),C=je(),m=Ue(C?.loggedInUserRoleMap),{useFeatureGate:g}=se();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const E=n.userRole.includes("charge_card_user"),{isFeatureEnabled:S}=g(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:O}=g(Z.isDebitCardFeatureEnabled),v=be(n),D=ye(n),p=Se(O,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,b=Ie({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:p}),l=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:S,isBookKeepingTenant:D,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:u}),_=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,F=y(X=>$e(X,n.companyId)),R=ze(F.controllers),{creditAccount:B,creditAccountRepayment:T}=y(X=>Ze(X)),N=y(X=>X.classListState.fetchState),d=!E&&l&&f,h=y(X=>Ma(X,t,d,l)),[P,w]=c.useState(!1),U=h.chargeCard,j=U?.cardCreatedByUser?.userId,$=y(X=>j!=null?ba(X.userRoleState,j):void 0),H=$?.accountingClassIDs[0],V=y(X=>H!=null?ya(X.classState,{classId:H,reportId:"class_list"}):void 0),A=U?.cardHolderUser?.userId,L=y(X=>A!=null?ba(X.userRoleState,A):void 0),W=L?.accountingClassIDs[0],k=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),Y=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",q=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&Y&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,Y,q]),c.useEffect(()=>{P||h.fetchState==="Completed"||h.fetchState==="In-Progress"||t==null||(w(!0),a(Je(t,d,!1)))},[P,h,t,a]),c.useEffect(()=>{if(h.fetchState==="Completed"&&(Y===!1||Y&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,U,i);e(X)}},[h.fetchState,i,Y]),c.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a($a()),N!=="Completed"&&N!=="In-Progress"&&a(mt())},[B.fetchState,T.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",oe=Oe(l,b,_,f),ee=Ca(l,f,m,B,T),te=Gt(x,h);return h.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:i}),s.jsx(lr,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:R,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:b,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:f,productInformation:oe,creditAccountInformation:ee,debitAccountInformation:te,chargeCardDetailView:h,creditAccount:B,classListFetchState:N,creditAccountRepayment:T,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:L?.userRoles,cardHolderDepartmentName:k?.className})]})}const Nr=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Qt({uiState:{sortKey:t,sortOrder:a}}))}}})(mr);function Hr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(S=>ce(S)),{useFeatureGate:C}=se(),{isFeatureEnabled:m}=C(Z.isCardsCommentingEnabled),[g,I]=c.useState(!1),o=y(S=>Ye(S)),i=Yt(n.companyId,{clearParams:o.fetchState==="Completed"}),E=c.useCallback(()=>{const S=ve(a.state?.pathnameStackToGoBack),f=S.poppedPathname??Mr(n.tenantEmailDomain);e(f,{state:{pathnameStackToGoBack:S.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{g||o.fetchState==="Completed"||o.fetchState==="In-Progress"||(I(!0),t(Ct()))},[g,o,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return o.fetchState==="In-Progress"?s.jsx(ur,{onBackClick:E}):o.cashbackSummary.cashbackEarned.amount===0&&o.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:E,isCardsCommentingEnabled:m,initialOpenThreadRequest:i})}const Mr=e=>`/${e}/cards`,Gr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m}=se(),[g,I]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[f,O]=c.useState(!1),v=J.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const D=y(k=>ce(k));if(n==null)throw Error("Empty card id is not valid...");const{configValue:p}=m(Fe.zeniCardsConfig),u=p.max_charge_card_activation_attempts_by_card_id,b=y(k=>Xt(k,n)),l=b.chargeCard,_=y(k=>k.chargeCardConfigState.fetchState),{useFeatureGate:F}=se(),{isFeatureEnabled:R}=F(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=F(Z.isDebitCardFeatureEnabled),T=Se(B,D),N=Ie({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:T}),d=!!D.companyChargeCardInfo?.info?.isChargeCardEnabled,h=D.userRole.includes("charge_card_user"),P=be(D),w=ye(D),U=D.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,j=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:R,isBookKeepingTenant:w,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:U}),$=!h&&j&&d;c.useEffect(()=>{g===!1&&_!=="In-Progress"&&_!=="Completed"&&(a(Da()),I(!0)),o===!1&&b.fetchState==="Not-Started"&&(i(!0),a(Je(n,$,j)))},[o,b.fetchState,g,_]);const H=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(b.fetchState==="Completed"){if(E===!1&&(H===!1||H&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const k=Ce(D.tenantEmailDomain,n,v,l,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);r(k,{state:{pathnameStackToGoBack:Y}})}else if(E&&b.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(Jt({chargeCardId:n}));const k=Ce(D.tenantEmailDomain,n,v,l,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(k,{state:{pathnameStackToGoBack:Y}})}}},[b.fetchState,l?.type.code,E,b.isRefreshingViewInBackground]);const V=J.getZeniOtpTokenForCardHolder(n),A=y(k=>pt(k.userState,v.userId)),L=()=>{l?.status?.code!=="active"&&a(za(n,!0))};c.useEffect(()=>{b.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(k=>k.statusCode==="success")===!0&&E===!1&&(setTimeout(L,3e3),S(!0))},[b.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const W=k=>{O(k)};if(_!=="Completed"||l==null)return s.jsx(la,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(A?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(zr,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:A.phone,signedInUser:v,isSandboxEnv:Ka(),chargeCardDetailState:b,signedInUserToken:V,navigate:r,currentTenant:D,location:C,maxChargeCardActivationAttempts:u[n]!=null?u[n]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Zr,{windowSize:t,children:e}):null]})},zr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=en(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const m=ht(e,n),g=t.updateStatus,I=Ke(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(an())||i,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:m,activationWaitStatus:g,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:m}=t,g=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=C;return{onGetOtp:o=>{g!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(nn(r,o))},onResendOtp:o=>{g!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{g!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(tn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ve(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(Cr),Zr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Gr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-Cj_tHvtA.js";import{a as g}from"./sentry-pDh2qSl7.js";import{h as w,u as x,g as k,i as T,j as O,n as E}from"./core-Cy60pewc.js";import{z as C,b7 as P,x as F,c as V,e as j,af as b,b8 as A,at as L,au as M,m as U}from"./index-DXfCjMwK.js";import{eP as D,fG as B,se as _,fB as G,c2 as R,MH as z,bn as q,qf as H,q3 as Y,ke as K,lK as S,MI as Z,bE as $,cv as N,lS as J,lV as Q}from"./zeni-epic-state-CRkqEZ9n.js";import"./mui-CRLIhCCm.js";import{d as W}from"./routePaths-BHuMCYZS.js";import{M as X}from"./MobileAppDrawer-COGIpIoc.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]="513bb435-7e8f-4d9b-9678-f9fa76b7d5e3",t._sentryDebugIdIdentifier="sentry-dbid-513bb435-7e8f-4d9b-9678-f9fa76b7d5e3")}catch{}})();const ee=E(function(t){const a=G(t),i=C.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(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:`${L.fileMicroServiceBaseUrl}`,isZeniUser:q(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(Q())},onAddressClick:e=>{const n=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({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?N(u):void 0,meetingLink:y!=""&&y!=null?N(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:M(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?$(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(Z(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=x(),i=k(),{tenantEmailDomain:l}=T(),[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??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(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(P,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-D65YpEzb.js";import{a as g}from"./sentry-Cc7E6KXa.js";import{h as w,u as x,g as k,i as T,j as O,n as E}from"./core-C9zW9aiN.js";import{z as C,b7 as P,x as F,c as V,e as j,af as b,b8 as A,at as L,au as M,m as U}from"./index-1wxiPadS.js";import{eP as D,fG as B,se as _,fB as G,c2 as R,MH as z,bn as q,qf as H,q3 as Y,ke as K,lK as S,MI as Z,bE as $,cv as N,lS as J,lV as Q}from"./zeni-epic-state-CSVE6Gls.js";import"./mui-CjAqh33Z.js";import{d as W}from"./routePaths-NM47duJ5.js";import{M as X}from"./MobileAppDrawer-DgVPhlgQ.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]="513bb435-7e8f-4d9b-9678-f9fa76b7d5e3",t._sentryDebugIdIdentifier="sentry-dbid-513bb435-7e8f-4d9b-9678-f9fa76b7d5e3")}catch{}})();const ee=E(function(t){const a=G(t),i=C.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(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:`${L.fileMicroServiceBaseUrl}`,isZeniUser:q(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(Q())},onAddressClick:e=>{const n=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({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?N(u):void 0,meetingLink:y!=""&&y!=null?N(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:M(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?$(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(Z(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=x(),i=k(),{tenantEmailDomain:l}=T(),[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??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(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(P,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-Cj_tHvtA.js";import{a}from"./sentry-pDh2qSl7.js";import{u as D,g as v,j as u,N as w}from"./core-Cy60pewc.js";import{Jm as A,eP as O,fo as j,mW as U,fP as h,fn as _,eW as L,Jt as F}from"./zeni-epic-state-CRkqEZ9n.js";import{u as P,z as c,L as g,D as $,o as k}from"./index-DXfCjMwK.js";import{n as H}from"./mui-CRLIhCCm.js";import{t as z}from"./getLocaleForTenant-RkomRM_7.js";import{g as R,Q as J}from"./QBOConnectionScreen-Bp_uUyx7.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";import"./empty-C0r2LR8d.js";import"./pdf-lib-CGSxq5us.js";import"./index-CyER2VFG.js";import"./url-8O3uL66H.js";import"./index-lS13JcL7.js";import"./decodeURIComponentSafe-CvAV2ZH_.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="d9735e6d-9385-4cb9-a9a7-880f042883c1",t._sentryDebugIdIdentifier="sentry-dbid-d9735e6d-9385-4cb9-a9a7-880f042883c1")}catch{}})();const W=H.div`
1
+ import{j as C}from"./liveblocks-D65YpEzb.js";import{a}from"./sentry-Cc7E6KXa.js";import{u as D,g as v,j as u,N as w}from"./core-C9zW9aiN.js";import{Jm as A,eP as O,fo as j,mW as U,fP as h,fn as _,eW as L,Jt as F}from"./zeni-epic-state-CSVE6Gls.js";import{u as P,z as c,L as g,D as $,o as k}from"./index-1wxiPadS.js";import{n as H}from"./mui-CjAqh33Z.js";import{t as z}from"./getLocaleForTenant-C-mTF_-1.js";import{g as R,Q as J}from"./QBOConnectionScreen-D0nezBr9.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.js";import"./empty-CgUWy1ya.js";import"./pdf-lib-0B-WwULF.js";import"./index-BWbah6CI.js";import"./url-kUZYC_m5.js";import"./index-BeiF5atT.js";import"./decodeURIComponentSafe-BPYfhkXa.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="d9735e6d-9385-4cb9-a9a7-880f042883c1",t._sentryDebugIdIdentifier="sentry-dbid-d9735e6d-9385-4cb9-a9a7-880f042883c1")}catch{}})();const W=H.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-D65YpEzb.js";import{z as n}from"./index-1wxiPadS.js";import{g as d}from"./QBOConnectionScreen-D0nezBr9.js";import"./sentry-Cc7E6KXa.js";import{g as p,N as a}from"./core-C9zW9aiN.js";import"./zeni-epic-state-CSVE6Gls.js";import"./recharts-DATP9UFl.js";import"./mui-CjAqh33Z.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.js";import"./empty-CgUWy1ya.js";import"./pdf-lib-0B-WwULF.js";import"./index-BWbah6CI.js";import"./url-kUZYC_m5.js";import"./index-BeiF5atT.js";import"./decodeURIComponentSafe-BPYfhkXa.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-Cj_tHvtA.js";import{t as $e,A as Ce}from"./AddressScreen-kxW0VXwU.js";import Ke from"./NotFoundScreen-VuNCYuY2.js";import{a as g}from"./sentry-pDh2qSl7.js";import{h as se,g as oe,u as ie,i as re,j as A,N as E,n as ce,l as ze,o as Me,p as z}from"./core-Cy60pewc.js";import{r as de,k as le,z as B,v as ue,h as qe,I as _,m as V,x as H,c as N,B as we,e as Y,ap as Qe,J as Ze,aq as Ie,i as te,ar as Je,as as ke,o as He,at as We,au as Ee,av as Ye}from"./index-DXfCjMwK.js";import{bn as Xe,eP as ee,fg as et,e_ as pe,eY as me,bt as tt,mU as at,fc as nt,bO as st,ji as ae,jl as ve,JS as ot,bT as it,c2 as ge,ss as he,sd as rt,Km as X,st as _e,HK as ct,km as Ue,Kn as Ve,Ko as dt,Kp as lt,Kq as ut,jg as pt,jj as mt,sf as Be,sr as gt,bE as Te,cv as ht,sF as xe,qf as ft,q3 as yt,ke as St,fE as bt,fD as Ct,fC as It,Kr as kt,s7 as Et,sG as Tt,sJ as xt,sM as Ot,sS as Pt,cT as Dt}from"./zeni-epic-state-CRkqEZ9n.js";import{n as fe}from"./mui-CRLIhCCm.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-Bp_uUyx7.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";import"./empty-C0r2LR8d.js";import"./pdf-lib-CGSxq5us.js";import"./index-CyER2VFG.js";import"./url-8O3uL66H.js";import"./index-lS13JcL7.js";import"./decodeURIComponentSafe-CvAV2ZH_.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]="74141cbd-d059-4a98-9605-c9978092b853",t._sentryDebugIdIdentifier="sentry-dbid-74141cbd-d059-4a98-9605-c9978092b853")}catch{}})();const jt=ce(function(t,s){const o=[];s.isApAgingFeatureEnabled===!1&&o.push("accounts_payable_aging"),s.isArAgingFeatureEnabled===!1&&o.push("accounts_receivable_aging"),s.shouldFetchZeniAccountsPromoCard===!1&&o.push("zeni_accounts_promo_card"),s.shouldFetchRewardsPlanCard===!1&&o.push("rewards_card"),s.isExpenseAutomationEnabledForUser===!1&&o.push("expense_automation_card");const u=nt(t,o,s.signedInUser,s.isExpenseAutomationFeatureEnabledV2,s.isExpenseAutomationEnabledForUser,s.isTreasuryEnabled);return{dashboardFetchState:st(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,s){const{themeState:o,navigate:u,location:d}=s;return{onZeniLogoClick:()=>{o.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),wt=()=>{const t=se(),s=oe(),o=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),G=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),D=[],Q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,K=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),K===!1&&D.push("task_card"),v===!1&&D.push("bill_pay_card","bill_pay_promo_card"),q===!1&&D.push("reimbursement_card","reimbursement_promo_card"),I===!1&&D.push("zeni_accounts_promo_card"),f===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),o(at(i.userId,R,c.tenantId,!0,!1,D)))},[d,O,w,P,i,c.tenantId,o]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(s.state?.pathnameStackToGoBack,s.pathname);if(w)return a.jsx(E,{to:"../../checking",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:s,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-D65YpEzb.js";import{t as $e,A as Ce}from"./AddressScreen-BHOH_WLv.js";import Ke from"./NotFoundScreen-Bv_nRCjj.js";import{a as g}from"./sentry-Cc7E6KXa.js";import{h as se,g as oe,u as ie,i as re,j as A,N as E,n as ce,l as ze,o as Me,p as z}from"./core-C9zW9aiN.js";import{r as de,k as le,z as B,v as ue,h as qe,I as _,m as V,x as H,c as N,B as we,e as Y,ap as Qe,J as Ze,aq as Ie,i as te,ar as Je,as as ke,o as He,at as We,au as Ee,av as Ye}from"./index-1wxiPadS.js";import{bn as Xe,eP as ee,fg as et,e_ as pe,eY as me,bt as tt,mU as at,fc as nt,bO as st,ji as ae,jl as ve,JS as ot,bT as it,c2 as ge,ss as he,sd as rt,Km as X,st as _e,HK as ct,km as Ue,Kn as Ve,Ko as dt,Kp as lt,Kq as ut,jg as pt,jj as mt,sf as Be,sr as gt,bE as Te,cv as ht,sF as xe,qf as ft,q3 as yt,ke as St,fE as bt,fD as Ct,fC as It,Kr as kt,s7 as Et,sG as Tt,sJ as xt,sM as Ot,sS as Pt,cT as Dt}from"./zeni-epic-state-CSVE6Gls.js";import{n as fe}from"./mui-CjAqh33Z.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-D0nezBr9.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.js";import"./empty-CgUWy1ya.js";import"./pdf-lib-0B-WwULF.js";import"./index-BWbah6CI.js";import"./url-kUZYC_m5.js";import"./index-BeiF5atT.js";import"./decodeURIComponentSafe-BPYfhkXa.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]="74141cbd-d059-4a98-9605-c9978092b853",t._sentryDebugIdIdentifier="sentry-dbid-74141cbd-d059-4a98-9605-c9978092b853")}catch{}})();const jt=ce(function(t,s){const o=[];s.isApAgingFeatureEnabled===!1&&o.push("accounts_payable_aging"),s.isArAgingFeatureEnabled===!1&&o.push("accounts_receivable_aging"),s.shouldFetchZeniAccountsPromoCard===!1&&o.push("zeni_accounts_promo_card"),s.shouldFetchRewardsPlanCard===!1&&o.push("rewards_card"),s.isExpenseAutomationEnabledForUser===!1&&o.push("expense_automation_card");const u=nt(t,o,s.signedInUser,s.isExpenseAutomationFeatureEnabledV2,s.isExpenseAutomationEnabledForUser,s.isTreasuryEnabled);return{dashboardFetchState:st(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,s){const{themeState:o,navigate:u,location:d}=s;return{onZeniLogoClick:()=>{o.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),wt=()=>{const t=se(),s=oe(),o=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),G=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),D=[],Q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,K=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),K===!1&&D.push("task_card"),v===!1&&D.push("bill_pay_card","bill_pay_promo_card"),q===!1&&D.push("reimbursement_card","reimbursement_promo_card"),I===!1&&D.push("zeni_accounts_promo_card"),f===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),o(at(i.userId,R,c.tenantId,!0,!1,D)))},[d,O,w,P,i,c.tenantId,o]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(s.state?.pathnameStackToGoBack,s.pathname);if(w)return a.jsx(E,{to:"../../checking",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:s,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.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-Cj_tHvtA.js";import{i as K,j as _,g as H,u as z,h as W,n as te,k as oa,o as gt,p as F}from"./core-Cy60pewc.js";import{eP as L,KH as Xe,bE as sa,bq as xe,LU as In,i6 as Tn,LV as Nt,LW as xn,i9 as bt,LX as Qe,LY as Dn,ie as wn,LZ as $t,L_ as Fn,ij as Ct,L$ as He,M0 as On,cl as St,M1 as Pn,M2 as Mn,K$ as Rn,jc as Bn,M3 as jn,bn as Ge,M4 as ra,Kv as ce,bc as ia,jq as ca,n2 as la,j9 as da,Kx as le,Kw as ee,eO as ua,eU as Un,fq as kt,M5 as Ln,M6 as Gn,M7 as ma,M8 as Re,uk as Ye,ul as Ve,uI as De,uC as de,up as Ne,M9 as Yn,Ma as Vn,Mb as Nn,Mc as pa,Md as Be,Me as $n,dE as Je,qP as ha,Mf as zn,Mg as Kn,Mh as qn,Mi as yt,JU as At,jG as we,uQ as vt,qX as Zn,Mj as Qn,um as zt,qS as Ie,qO as fa,Mk as ge,Ml as Hn,Mm as Et,JT as It,sW as ga,Mn as Wn,Mo as Xn,Mp as Jn,Mq as Tt,t7 as eo,Mr as to,uo as Kt,sV as ba,Ms as be,Mt as ao,bt as Ca,uU as ka,Mu as no,Mv as oo,Mw as so,Mx as xt,uP as ro,My as io,un as qt,uT as _a,Mz as Ce,MA as co,MB as lo,MC as Sa,jv as ya,m$ as Aa,jA as va,mZ as Ea,mY as Ia,mX as Ta,si as uo,fg as mo,cN as po,cO as ho,mU as fo,fc as go,n9 as bo,DY as Zt,MD as Co,ME as ko,MF as _o,MG as So,b5 as et,f4 as yo,gR as Ao,fG as vo,n3 as Eo,j2 as Io,n0 as To,m_ as xo,e_ as Do,eY as wo}from"./zeni-epic-state-CRkqEZ9n.js";import{z as j,a2 as ae,m as D,c as x,D as q,aU as Fo,Y as $e,x as ze,aV as xa,e as N,aW as Oo,k as _e,aX as Da,v as Se,I as R,h as Po,aY as Mo,aZ as Ro,U as wa,J as Fa,a as Oa,X as Bo,a_ as jo,R as Uo,aN as Pa,$ as se,a$ as Ma,b0 as Ra,a1 as Ba,b1 as Lo,b2 as Go,aq as Yo,j as Vo,V as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-DXfCjMwK.js";import{n as Dt}from"./mui-CRLIhCCm.js";import{a as b}from"./sentry-pDh2qSl7.js";import{w as ja}from"./withTransactionSidePanel-Pig-pzDa.js";import{c as Ua,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-BHuMCYZS.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-BZkbW7CL.js";import Le from"./NotFoundScreen-VuNCYuY2.js";import{u as Ft}from"./useInitialThreadRequest-Jto-q518.js";import{t as La}from"./analyticsHelper-D8mqdnP1.js";import{C as Zo}from"./CompanyPassportScreen-BV2a_i6I.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-BrY2cg9j.js";import{F as Ho}from"./FeaturePreviewScreen-zYylsmMO.js";import{R as Wo}from"./ReferralListScreen-ENnmEy2s.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";import"./TransactionDetailScreen-CRrD1rrU.js";import"./decodeURIComponentSafe-CvAV2ZH_.js";import"./MobileAppDrawer-COGIpIoc.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]="6369a9fc-4aba-4818-8164-b8abe1f4dc3a",e._sentryDebugIdIdentifier="sentry-dbid-6369a9fc-4aba-4818-8164-b8abe1f4dc3a")}catch{}})();const Xo=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(y=>y.tenantState.currentTenantId),c=_(y=>L(y)),{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:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?sa(r):xe(),[r]),p=z(),f=W(),A=_(y=>In(y,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Tn(o,h))},[h]),S=b.useCallback(()=>{f("../../",{relative:"path"})},[]),I=b.useCallback((y,M)=>{p(Nt({sortKey:y,sortOrder:M}))},[]),T=b.useCallback(y=>{p(Nt({downloadState:y}))},[]),U=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(m!=null){const M=Ua({id:y.transactionId,type:y.transactionType},m);f(M);const X=D(g.state?.pathnameStackToGoBack,g.pathname);f(M,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&x.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Fo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:x,onTransactionClick:U,onReload:E,onBackClick:S,onColumnSortConfigChanged:I,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Jo=()=>{const e=z(),a=W(),t=_(I=>xn(I)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(I=>I.tenantState.currentTenantId),i=_(I=>L(I)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??xe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(I=>{e(Qe({searchString:I}))},[]),p=b.useCallback((I,T)=>{e(Qe({sortKey:T,sortOrder:I}))},[]),f=b.useCallback(I=>{a(`./${I}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(I=>{e(Qe({downloadState:I}))},[]),E=b.useCallback((I,T)=>{},[]),S=b.useCallback((I,T)=>{e(Qe({selectedDate:I,agingDateSelectionType:T})),e(bt(I))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:x,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},es=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(k=>L(k)),{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:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?sa(r):xe(),[r]),h=z(),p=W(),f=_(k=>Dn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(wn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),S=b.useCallback((k,y)=>{h($t({sortKey:k,sortOrder:y}))},[]),I=b.useCallback(k=>{h($t({downloadState:k}))},[]),T=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const y=Ua({id:k.transactionId,type:k.transactionType},c);p(y);const M=D(m.state?.pathnameStackToGoBack,m.pathname);p(y,{state:{pathnameStackToGoBack:M}})}},[c,e]),U=b.useCallback(()=>{f.customer!=null&&x.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&U()},[f.fetchState,U]),d.jsx(Oo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:x,onTransactionClick:T,onReload:A,onBackClick:E,onColumnSortConfigChanged:S,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ts=()=>{const e=z(),a=W(),t=_(S=>Fn(S)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(S=>L(S)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??xe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(S=>{e(He({searchString:S}))},[]),h=b.useCallback((S,I)=>{e(He({sortKey:I,sortOrder:S}))},[]),p=b.useCallback(S=>{a(`./${S}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(S=>{e(He({downloadState:S}))},[]),A=b.useCallback((S,I)=>{e(He({selectedDate:S,agingDateSelectionType:I})),e(Ct(S))},[]),E=b.useCallback((S,I)=>{e(On({nodeId:S,isCollapsed:I}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:x,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Rn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Fe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Bn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?x.trackZeniAccountsCashBalancePromoClicked("Move Money"):(x.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else x.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const as=te(function(e){const a=Pn(e).accountsInOrder.map((n,o)=>Ga(n,o)),t=Mn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:x}},Ya)(Da),ns=te(function(e){const a=jn(e).accountsInOrder.map((o,r)=>Ga(o,r)),t=j.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:x}},Ya)(Da);function os(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=St(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Le,{}):d.jsx(as,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ss(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=St(n?.loggedInUserRoleMap),r=_(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Le,{}):d.jsx(ns,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const rs=Dt.div`
1
+ import{j as d}from"./liveblocks-D65YpEzb.js";import{i as K,j as _,g as H,u as z,h as W,n as te,k as oa,o as gt,p as F}from"./core-C9zW9aiN.js";import{eP as L,KH as Xe,bE as sa,bq as xe,LU as In,i6 as Tn,LV as Nt,LW as xn,i9 as bt,LX as Qe,LY as Dn,ie as wn,LZ as $t,L_ as Fn,ij as Ct,L$ as He,M0 as On,cl as St,M1 as Pn,M2 as Mn,K$ as Rn,jc as Bn,M3 as jn,bn as Ge,M4 as ra,Kv as ce,bc as ia,jq as ca,n2 as la,j9 as da,Kx as le,Kw as ee,eO as ua,eU as Un,fq as kt,M5 as Ln,M6 as Gn,M7 as ma,M8 as Re,uk as Ye,ul as Ve,uI as De,uC as de,up as Ne,M9 as Yn,Ma as Vn,Mb as Nn,Mc as pa,Md as Be,Me as $n,dE as Je,qP as ha,Mf as zn,Mg as Kn,Mh as qn,Mi as yt,JU as At,jG as we,uQ as vt,qX as Zn,Mj as Qn,um as zt,qS as Ie,qO as fa,Mk as ge,Ml as Hn,Mm as Et,JT as It,sW as ga,Mn as Wn,Mo as Xn,Mp as Jn,Mq as Tt,t7 as eo,Mr as to,uo as Kt,sV as ba,Ms as be,Mt as ao,bt as Ca,uU as ka,Mu as no,Mv as oo,Mw as so,Mx as xt,uP as ro,My as io,un as qt,uT as _a,Mz as Ce,MA as co,MB as lo,MC as Sa,jv as ya,m$ as Aa,jA as va,mZ as Ea,mY as Ia,mX as Ta,si as uo,fg as mo,cN as po,cO as ho,mU as fo,fc as go,n9 as bo,DY as Zt,MD as Co,ME as ko,MF as _o,MG as So,b5 as et,f4 as yo,gR as Ao,fG as vo,n3 as Eo,j2 as Io,n0 as To,m_ as xo,e_ as Do,eY as wo}from"./zeni-epic-state-CSVE6Gls.js";import{z as j,a2 as ae,m as D,c as x,D as q,aU as Fo,Y as $e,x as ze,aV as xa,e as N,aW as Oo,k as _e,aX as Da,v as Se,I as R,h as Po,aY as Mo,aZ as Ro,U as wa,J as Fa,a as Oa,X as Bo,a_ as jo,R as Uo,aN as Pa,$ as se,a$ as Ma,b0 as Ra,a1 as Ba,b1 as Lo,b2 as Go,aq as Yo,j as Vo,V as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-1wxiPadS.js";import{n as Dt}from"./mui-CjAqh33Z.js";import{a as b}from"./sentry-Cc7E6KXa.js";import{w as ja}from"./withTransactionSidePanel-DzuPuyV9.js";import{c as Ua,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-NM47duJ5.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-BHe-JBXY.js";import Le from"./NotFoundScreen-Bv_nRCjj.js";import{u as Ft}from"./useInitialThreadRequest-COJ5en-O.js";import{t as La}from"./analyticsHelper-CjjD2OUX.js";import{C as Zo}from"./CompanyPassportScreen-Cb1iYJZe.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-Dmb4Bk7D.js";import{F as Ho}from"./FeaturePreviewScreen-CVSV79yf.js";import{R as Wo}from"./ReferralListScreen-DINWTi1Q.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.js";import"./TransactionDetailScreen-C5vka9J3.js";import"./decodeURIComponentSafe-BPYfhkXa.js";import"./MobileAppDrawer-DgVPhlgQ.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]="6369a9fc-4aba-4818-8164-b8abe1f4dc3a",e._sentryDebugIdIdentifier="sentry-dbid-6369a9fc-4aba-4818-8164-b8abe1f4dc3a")}catch{}})();const Xo=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(y=>y.tenantState.currentTenantId),c=_(y=>L(y)),{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:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?sa(r):xe(),[r]),p=z(),f=W(),A=_(y=>In(y,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Tn(o,h))},[h]),S=b.useCallback(()=>{f("../../",{relative:"path"})},[]),I=b.useCallback((y,M)=>{p(Nt({sortKey:y,sortOrder:M}))},[]),T=b.useCallback(y=>{p(Nt({downloadState:y}))},[]),U=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(m!=null){const M=Ua({id:y.transactionId,type:y.transactionType},m);f(M);const X=D(g.state?.pathnameStackToGoBack,g.pathname);f(M,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&x.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Fo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:x,onTransactionClick:U,onReload:E,onBackClick:S,onColumnSortConfigChanged:I,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Jo=()=>{const e=z(),a=W(),t=_(I=>xn(I)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(I=>I.tenantState.currentTenantId),i=_(I=>L(I)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??xe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(I=>{e(Qe({searchString:I}))},[]),p=b.useCallback((I,T)=>{e(Qe({sortKey:T,sortOrder:I}))},[]),f=b.useCallback(I=>{a(`./${I}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(I=>{e(Qe({downloadState:I}))},[]),E=b.useCallback((I,T)=>{},[]),S=b.useCallback((I,T)=>{e(Qe({selectedDate:I,agingDateSelectionType:T})),e(bt(I))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:x,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},es=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(k=>L(k)),{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:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?sa(r):xe(),[r]),h=z(),p=W(),f=_(k=>Dn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(wn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),S=b.useCallback((k,y)=>{h($t({sortKey:k,sortOrder:y}))},[]),I=b.useCallback(k=>{h($t({downloadState:k}))},[]),T=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const y=Ua({id:k.transactionId,type:k.transactionType},c);p(y);const M=D(m.state?.pathnameStackToGoBack,m.pathname);p(y,{state:{pathnameStackToGoBack:M}})}},[c,e]),U=b.useCallback(()=>{f.customer!=null&&x.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&U()},[f.fetchState,U]),d.jsx(Oo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:x,onTransactionClick:T,onReload:A,onBackClick:E,onColumnSortConfigChanged:S,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ts=()=>{const e=z(),a=W(),t=_(S=>Fn(S)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(S=>L(S)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??xe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(S=>{e(He({searchString:S}))},[]),h=b.useCallback((S,I)=>{e(He({sortKey:I,sortOrder:S}))},[]),p=b.useCallback(S=>{a(`./${S}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(S=>{e(He({downloadState:S}))},[]),A=b.useCallback((S,I)=>{e(He({selectedDate:S,agingDateSelectionType:I})),e(Ct(S))},[]),E=b.useCallback((S,I)=>{e(On({nodeId:S,isCollapsed:I}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:x,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Rn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Fe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Bn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?x.trackZeniAccountsCashBalancePromoClicked("Move Money"):(x.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else x.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const as=te(function(e){const a=Pn(e).accountsInOrder.map((n,o)=>Ga(n,o)),t=Mn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:x}},Ya)(Da),ns=te(function(e){const a=jn(e).accountsInOrder.map((o,r)=>Ga(o,r)),t=j.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:x}},Ya)(Da);function os(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=St(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Le,{}):d.jsx(as,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ss(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=St(n?.loggedInUserRoleMap),r=_(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Le,{}):d.jsx(ns,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const rs=Dt.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-Cj_tHvtA.js";import{a as u}from"./sentry-pDh2qSl7.js";import{u as y,j as b,n as w,g as A,N}from"./core-Cy60pewc.js";import{Jm as U,eP as _,fo as k,Jn as L,mW as R,Jo as z}from"./zeni-epic-state-CRkqEZ9n.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-DXfCjMwK.js";import"./mui-CRLIhCCm.js";import{t as P}from"./getLocaleForTenant-RkomRM_7.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.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]="9356f07c-2473-4edf-97be-06ac737bd8f1",t._sentryDebugIdIdentifier="sentry-dbid-9356f07c-2473-4edf-97be-06ac737bd8f1")}catch{}})();const J=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(J,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-D65YpEzb.js";import{a as u}from"./sentry-Cc7E6KXa.js";import{u as y,j as b,n as w,g as A,N}from"./core-C9zW9aiN.js";import{Jm as U,eP as _,fo as k,Jn as L,mW as R,Jo as z}from"./zeni-epic-state-CSVE6Gls.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-1wxiPadS.js";import"./mui-CjAqh33Z.js";import{t as P}from"./getLocaleForTenant-C-mTF_-1.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.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]="9356f07c-2473-4edf-97be-06ac737bd8f1",t._sentryDebugIdIdentifier="sentry-dbid-9356f07c-2473-4edf-97be-06ac737bd8f1")}catch{}})();const J=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(J,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-Cj_tHvtA.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-Cy60pewc.js";import{No as k,Nv as _,fE as q,fD as J,fC as K,iD as M,Kw as L,q6 as Q,eP as D,MW as V,iB as T,Np as v,Ny as F,iz as G,iW as j}from"./zeni-epic-state-CRkqEZ9n.js";import{bu as X,J as N,v as R,z as U,h as z,j as p,I as S,B as O,bv as Y,o as Z,bw as ee,m as te}from"./index-DXfCjMwK.js";import{n as H}from"./mui-CRLIhCCm.js";import"./sentry-pDh2qSl7.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]="cfe83ea6-c34d-4868-99ef-fffb716be07f",e._sentryDebugIdIdentifier="sentry-dbid-cfe83ea6-c34d-4868-99ef-fffb716be07f")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(M(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(K(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function W({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
1
+ import{j as l}from"./liveblocks-D65YpEzb.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-C9zW9aiN.js";import{No as k,Nv as _,fE as q,fD as J,fC as K,iD as M,Kw as L,q6 as Q,eP as D,MW as V,iB as T,Np as v,Ny as F,iz as G,iW as j}from"./zeni-epic-state-CSVE6Gls.js";import{bu as X,J as N,v as R,z as U,h as z,j as p,I as S,B as O,bv as Y,o as Z,bw as ee,m as te}from"./index-1wxiPadS.js";import{n as H}from"./mui-CjAqh33Z.js";import"./sentry-Cc7E6KXa.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]="cfe83ea6-c34d-4868-99ef-fffb716be07f",e._sentryDebugIdIdentifier="sentry-dbid-cfe83ea6-c34d-4868-99ef-fffb716be07f")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(M(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(K(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function W({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as c}from"./liveblocks-Cj_tHvtA.js";import{J as d,A as l,h as f}from"./index-DXfCjMwK.js";import{D as p}from"./mui-CRLIhCCm.js";import"./sentry-pDh2qSl7.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]="c6ac78c5-2e61-4396-9a04-09300c52b2a8",e._sentryDebugIdIdentifier="sentry-dbid-c6ac78c5-2e61-4396-9a04-09300c52b2a8")}catch{}})();const u={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=d(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),i=f();return c.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
1
+ import{j as c}from"./liveblocks-D65YpEzb.js";import{J as d,A as l,h as f}from"./index-1wxiPadS.js";import{D as p}from"./mui-CjAqh33Z.js";import"./sentry-Cc7E6KXa.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]="c6ac78c5-2e61-4396-9a04-09300c52b2a8",e._sentryDebugIdIdentifier="sentry-dbid-c6ac78c5-2e61-4396-9a04-09300c52b2a8")}catch{}})();const u={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=d(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),i=f();return c.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-Cj_tHvtA.js";import{a as c}from"./sentry-pDh2qSl7.js";import{h as A,u as B,g as L,i as F,j as d,N as q,n as K,o as N,p as _}from"./core-Cy60pewc.js";import{LD as H,eP as O,L0 as R,kG as M,HC as I,LI as W,Kv as Y,jG as $,HD as S,L5 as z,L6 as V,Kx as J,Kw as Q}from"./zeni-epic-state-CRkqEZ9n.js";import{aR as U,c as X,j as Z,m as tt}from"./index-DXfCjMwK.js";import"./mui-CRLIhCCm.js";import{d as k}from"./decodeURIComponentSafe-CvAV2ZH_.js";import{w as et}from"./withTransactionSidePanel-Pig-pzDa.js";import{f as at,c as nt}from"./routePaths-BHuMCYZS.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";import"./useAskAiCfoHostNavButtonProps-BZkbW7CL.js";import"./TransactionDetailScreen-CRrD1rrU.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]="4ca685d6-43ac-4201-ac5c-f487246ca26e",a._sentryDebugIdIdentifier="sentry-dbid-4ca685d6-43ac-4201-ac5c-f487246ca26e")}catch{}})();const ot=K(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)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(J({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(z()),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??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=L(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:b,entityIdEncoded:j,entityNameEncoded:x}=F(),r=k(j??""),p=k(x??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=d(n=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=d(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=d(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));c.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const P=d(n=>n.trendState.fetchState),E=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return c.useEffect(()=>{m===!0&&h===!1&&P==="Completed"&&(D(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,P]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:b,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:C(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(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-D65YpEzb.js";import{a as c}from"./sentry-Cc7E6KXa.js";import{h as A,u as B,g as L,i as F,j as d,N as q,n as K,o as N,p as _}from"./core-C9zW9aiN.js";import{LD as H,eP as O,L0 as R,kG as M,HC as I,LI as W,Kv as Y,jG as $,HD as S,L5 as z,L6 as V,Kx as J,Kw as Q}from"./zeni-epic-state-CSVE6Gls.js";import{aR as U,c as X,j as Z,m as tt}from"./index-1wxiPadS.js";import"./mui-CjAqh33Z.js";import{d as k}from"./decodeURIComponentSafe-BPYfhkXa.js";import{w as et}from"./withTransactionSidePanel-DzuPuyV9.js";import{f as at,c as nt}from"./routePaths-NM47duJ5.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.js";import"./useAskAiCfoHostNavButtonProps-BHe-JBXY.js";import"./TransactionDetailScreen-C5vka9J3.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]="4ca685d6-43ac-4201-ac5c-f487246ca26e",a._sentryDebugIdIdentifier="sentry-dbid-4ca685d6-43ac-4201-ac5c-f487246ca26e")}catch{}})();const ot=K(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)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(J({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(z()),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??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=L(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:b,entityIdEncoded:j,entityNameEncoded:x}=F(),r=k(j??""),p=k(x??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=d(n=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=d(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=d(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));c.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const P=d(n=>n.trendState.fetchState),E=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return c.useEffect(()=>{m===!0&&h===!1&&P==="Completed"&&(D(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,P]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:b,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:C(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(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 C}from"./liveblocks-Cj_tHvtA.js";import Rn from"./NotFoundScreen-VuNCYuY2.js";import{a,b as Pt}from"./sentry-pDh2qSl7.js";import{n as Fe,S as Dn}from"./mui-CRLIhCCm.js";import{u as re,h as wt,g as Ge,j as U,n as Un,i as rt,o as Fn,p as Le}from"./core-Cy60pewc.js";import{eP as Re,PZ as Bn,n4 as ke,fj as _n,qJ as Vn,nm as xt,nH as Rt,P_ as Dt,nR as jn,P$ as Ut,nf as On,qf as Mn,f3 as Ie,Q0 as De,sP as Ft,C0 as Bt,Q1 as _t,Q2 as Ln,pW as qe,LE as dt,LG as zn,jJ as Qn,LH as $n,jQ as Gn,cV as qn,tU as Je,ns as Vt,nW as Ue,Q3 as Jn,Kx as ut,Kw as Pe,Q4 as mt,k5 as Nn,Q5 as Yn,Q6 as Kn,Q7 as Hn,Q8 as Wn,nz as Zn,nk as de,nZ as we,Q9 as Xn,Qa as ea,Qb as ta,o4 as na,jU as aa,jL as oa,Qc as sa,jT as ht,LO as ca,Qd as ia,Qe as la,pS as ra,pv as da,nX as fe,pu as ze,Qf as ua,Qg as ma,lo as ha,bq as pa,lj as pt,l5 as ga,Qh as Ca,gT as gt,fU as Sa,lg as Ia,vN as fa,Qi as ka,ov as Ea,oq as va,ou as ya,of as ba,Qj as Aa,f6 as jt,nK as Ta,nv as Pa,fk as Ct,n$ as wa,Qk as xa,nY as Ot,Ql as Ra,Qm as Da,Qn as Ua,Qo as Fa,Qp as St,q2 as Ba,pl as _a,Kv as Va,jS as ja,Qq as Oa,Gy as Ma,jR as La,jG as za,f5 as Qa,oW as Mt,pd as $a,nV as It,n_ as Ga,bE as qa,ld as Ja,la as Na,Qr as Ya,oe as ft,pb as kt,p9 as Ka,o$ as Ha,oG as Wa,pc as Za,Qs as Xa,Qt as eo,oK as to,Qu as no,oA as ao,oJ as oo,oH as so,pg as co}from"./zeni-epic-state-CRkqEZ9n.js";import{v as Lt,I as le,c as L,m as H,V as zt,Y as Qt,cC as io,z as Be,cD as lo,at as xe,cE as ro,aT as Et,B as $t,cF as uo,aq as Qe,D as mo,cG as ho,a2 as po,cH as go,U as Co,cI as So,cJ as Io,r as fo,k as ko,aN as Eo,b7 as vo,A as yo,cK as bo}from"./index-DXfCjMwK.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-BZkbW7CL.js";import{c as vt,C as Ao}from"./TransactionDetailScreen-CRrD1rrU.js";import{w as To}from"./withTransactionSidePanel-Pig-pzDa.js";import{h as Po,v as wo}from"./routePaths-BHuMCYZS.js";import{g as $e}from"./accountMappingHelper-BxXl62E-.js";import{D as xo}from"./DrawerScreen-B8qy6piZ.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.js";import"./decodeURIComponentSafe-CvAV2ZH_.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="6580d999-e796-43cc-9fba-2793d772886d",t._sentryDebugIdIdentifier="sentry-dbid-6580d999-e796-43cc-9fba-2793d772886d")}catch{}})();const Ro=()=>{const t=re(),i=wt(),A=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(le.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Bn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,Y=!1)=>{t(ke({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:Y}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(_n(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(Vn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Do,{children:C.jsx(io,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Do=Fe.div`
1
+ import{j as C}from"./liveblocks-D65YpEzb.js";import Rn from"./NotFoundScreen-Bv_nRCjj.js";import{a,b as Pt}from"./sentry-Cc7E6KXa.js";import{n as Fe,S as Dn}from"./mui-CjAqh33Z.js";import{u as re,h as wt,g as Ge,j as U,n as Un,i as rt,o as Fn,p as Le}from"./core-C9zW9aiN.js";import{eP as Re,PZ as Bn,n4 as ke,fj as _n,qJ as Vn,nm as xt,nH as Rt,P_ as Dt,nR as jn,P$ as Ut,nf as On,qf as Mn,f3 as Ie,Q0 as De,sP as Ft,C0 as Bt,Q1 as _t,Q2 as Ln,pW as qe,LE as dt,LG as zn,jJ as Qn,LH as $n,jQ as Gn,cV as qn,tU as Je,ns as Vt,nW as Ue,Q3 as Jn,Kx as ut,Kw as Pe,Q4 as mt,k5 as Nn,Q5 as Yn,Q6 as Kn,Q7 as Hn,Q8 as Wn,nz as Zn,nk as de,nZ as we,Q9 as Xn,Qa as ea,Qb as ta,o4 as na,jU as aa,jL as oa,Qc as sa,jT as ht,LO as ca,Qd as ia,Qe as la,pS as ra,pv as da,nX as fe,pu as ze,Qf as ua,Qg as ma,lo as ha,bq as pa,lj as pt,l5 as ga,Qh as Ca,gT as gt,fU as Sa,lg as Ia,vN as fa,Qi as ka,ov as Ea,oq as va,ou as ya,of as ba,Qj as Aa,f6 as jt,nK as Ta,nv as Pa,fk as Ct,n$ as wa,Qk as xa,nY as Ot,Ql as Ra,Qm as Da,Qn as Ua,Qo as Fa,Qp as St,q2 as Ba,pl as _a,Kv as Va,jS as ja,Qq as Oa,Gy as Ma,jR as La,jG as za,f5 as Qa,oW as Mt,pd as $a,nV as It,n_ as Ga,bE as qa,ld as Ja,la as Na,Qr as Ya,oe as ft,pb as kt,p9 as Ka,o$ as Ha,oG as Wa,pc as Za,Qs as Xa,Qt as eo,oK as to,Qu as no,oA as ao,oJ as oo,oH as so,pg as co}from"./zeni-epic-state-CSVE6Gls.js";import{v as Lt,I as le,c as L,m as H,V as zt,Y as Qt,cC as io,z as Be,cD as lo,at as xe,cE as ro,aT as Et,B as $t,cF as uo,aq as Qe,D as mo,cG as ho,a2 as po,cH as go,U as Co,cI as So,cJ as Io,r as fo,k as ko,aN as Eo,b7 as vo,A as yo,cK as bo}from"./index-1wxiPadS.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-BHe-JBXY.js";import{c as vt,C as Ao}from"./TransactionDetailScreen-C5vka9J3.js";import{w as To}from"./withTransactionSidePanel-DzuPuyV9.js";import{h as Po,v as wo}from"./routePaths-NM47duJ5.js";import{g as $e}from"./accountMappingHelper-W5otorD-.js";import{D as xo}from"./DrawerScreen-MbZXqUoq.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.js";import"./decodeURIComponentSafe-BPYfhkXa.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="6580d999-e796-43cc-9fba-2793d772886d",t._sentryDebugIdIdentifier="sentry-dbid-6580d999-e796-43cc-9fba-2793d772886d")}catch{}})();const Ro=()=>{const t=re(),i=wt(),A=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(le.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Bn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,Y=!1)=>{t(ke({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:Y}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(_n(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(Vn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Do,{children:C.jsx(io,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Do=Fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-Cj_tHvtA.js";import{a as r}from"./sentry-pDh2qSl7.js";import{a3 as i,a4 as l,a5 as p,j as b}from"./index-DXfCjMwK.js";import"./mui-CRLIhCCm.js";import f from"./NotFoundScreen-VuNCYuY2.js";import{h as m,g as u}from"./core-Cy60pewc.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]="1c227906-6efc-4ece-9b3c-3dd5d3b61bbc",e._sentryDebugIdIdentifier="sentry-dbid-1c227906-6efc-4ece-9b3c-3dd5d3b61bbc")}catch{}})();const D=()=>{const e=m(),t=u(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),c=r.useCallback(()=>{(()=>{const n=b(t.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(t.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:a,onGoBack:c}):s.jsx(f,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{D as F};
1
+ import{j as s}from"./liveblocks-D65YpEzb.js";import{a as r}from"./sentry-Cc7E6KXa.js";import{a3 as i,a4 as l,a5 as p,j as b}from"./index-1wxiPadS.js";import"./mui-CjAqh33Z.js";import f from"./NotFoundScreen-Bv_nRCjj.js";import{h as m,g as u}from"./core-C9zW9aiN.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]="1c227906-6efc-4ece-9b3c-3dd5d3b61bbc",e._sentryDebugIdIdentifier="sentry-dbid-1c227906-6efc-4ece-9b3c-3dd5d3b61bbc")}catch{}})();const D=()=>{const e=m(),t=u(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),c=r.useCallback(()=>{(()=>{const n=b(t.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(t.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:a,onGoBack:c}):s.jsx(f,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{D as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-pDh2qSl7.js";import{u as l,h as f,g as m}from"./core-Cy60pewc.js";import{gA as p,JK as g,JL as _}from"./zeni-epic-state-CRkqEZ9n.js";import{u as b,L as h,z as y}from"./index-DXfCjMwK.js";import"./liveblocks-Cj_tHvtA.js";import"./recharts-Btsi-yTh.js";import"./mui-CRLIhCCm.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.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]="2e2261c3-368d-4035-9d6b-fd93dac48db4",e._sentryDebugIdIdentifier="sentry-dbid-2e2261c3-368d-4035-9d6b-fd93dac48db4")}catch{}})();function R(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(p(t.tenant_id,t.connection_id,g("revenue"),_("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 r}from"./sentry-Cc7E6KXa.js";import{u as l,h as f,g as m}from"./core-C9zW9aiN.js";import{gA as p,JK as g,JL as _}from"./zeni-epic-state-CSVE6Gls.js";import{u as b,L as h,z as y}from"./index-1wxiPadS.js";import"./liveblocks-D65YpEzb.js";import"./recharts-DATP9UFl.js";import"./mui-CjAqh33Z.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.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]="2e2261c3-368d-4035-9d6b-fd93dac48db4",e._sentryDebugIdIdentifier="sentry-dbid-2e2261c3-368d-4035-9d6b-fd93dac48db4")}catch{}})();function R(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(p(t.tenant_id,t.connection_id,g("revenue"),_("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,4 +1,4 @@
1
- import{j as t}from"./liveblocks-Cj_tHvtA.js";import{i as S,n as x,h as C,g as y,u as ee,s as te,j as L,N as ae,o as ne,p}from"./core-Cy60pewc.js";import{JD as k,JE as v,JF as T,zD as D,zp as G,JG as z,JH as oe,JI as se,zt as ie,eW as I,zA as le,zx as re}from"./zeni-epic-state-CRkqEZ9n.js";import{J as g,o as r,M as de,c as j,i as J,Z as ce,j as me,_ as pe,m as H,v as ue,I as he,q as xe,r as ge,h as fe,s as be,B as we,x as Se,E as ye,S as ke,y as ve,A as je,O as Ie}from"./index-DXfCjMwK.js";import{n as m}from"./mui-CRLIhCCm.js";import f from"./NotFoundScreen-VuNCYuY2.js";import{a as $}from"./sentry-pDh2qSl7.js";import"./recharts-Btsi-yTh.js";import"./analytics-DVcHd5D4.js";import"./plaid-DkEItuLc.js";import"./dnd-B7KA0YNa.js";import"./stripe-DMRn4zHo.js";import"./lottie-KAslBocY.js";import"./lexical-BTXEvig3.js";import"./pdf-DKyxBlDM.js";import"./utils-BEyM61hw.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]="b946c4cd-8787-4962-8a7c-3e6db6fa35b6",e._sentryDebugIdIdentifier="sentry-dbid-b946c4cd-8787-4962-8a7c-3e6db6fa35b6")}catch{}})();const $e=m.div`
1
+ import{j as t}from"./liveblocks-D65YpEzb.js";import{i as S,n as x,h as C,g as y,u as ee,s as te,j as L,N as ae,o as ne,p}from"./core-C9zW9aiN.js";import{JD as k,JE as v,JF as T,zD as D,zp as G,JG as z,JH as oe,JI as se,zt as ie,eW as I,zA as le,zx as re}from"./zeni-epic-state-CSVE6Gls.js";import{J as g,o as r,M as de,c as j,i as J,Z as ce,j as me,_ as pe,m as H,v as ue,I as he,q as xe,r as ge,h as fe,s as be,B as we,x as Se,E as ye,S as ke,y as ve,A as je,O as Ie}from"./index-1wxiPadS.js";import{n as m}from"./mui-CjAqh33Z.js";import f from"./NotFoundScreen-Bv_nRCjj.js";import{a as $}from"./sentry-Cc7E6KXa.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.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]="b946c4cd-8787-4962-8a7c-3e6db6fa35b6",e._sentryDebugIdIdentifier="sentry-dbid-b946c4cd-8787-4962-8a7c-3e6db6fa35b6")}catch{}})();const $e=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;