@zeniai/web-app-ui 5.0.92-dev → 5.0.92-pune

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/assets/{AddressRoutes-CojtNX27.js → AddressRoutes-SDz-_T5y.js} +1 -1
  2. package/dist/assets/{AddressScreen-CuGNy3IM.js → AddressScreen-B_N8Ph8N.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-C9ttZvTj.js → AiCfoScreen-BeCZtwkp.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-CL6D_7dw.js → BillPayApprovalRoutes-TrUK0wRL.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-fvhaclgV.js → BillPayRoutes-XWUZO_iA.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-Lfv0XtEV.js → BusinessVerificationPageScreen-B8MKmqGF.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-D1tC8X9c.js → ChargeCardRoutes-DpO_fUF4.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-BwKa_LUc.js → CompanyPassportScreen-BnIZacZN.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-DcxIu2av.js → ConnectionAuthScreen-BN7qjNY8.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-D76H2W7e.js → CustomerOnboardingAuthScreen-C3xpPMSn.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-BjxUysyp.js → CustomerOnboardingRoutes-DoiJ9fem.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-DSV2c9Hg.js → DashboardRoutes-BCmZ07MG.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-BM5doKP0.js → DefaultTenantHome-DJ8dBXyl.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-XA3QzAyw.js → DomesticWireDetailScreen-B65sMSHn.js} +1 -1
  15. package/dist/assets/{DrawerScreen-2PFFQiRL.js → DrawerScreen-stWlc2vB.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-Cpm2zn0V.js → EntityDetailRoutes-CxkW_nmk.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-BXsX48QL.js → ExpenseAutomationRoutes-DdBKz-CH.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-DBbU3hyx.js → FeaturePreviewScreen-Brw2pKph.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-mukQpBXO.js → HubSpotOAuthCallbackScreen-NpzUFNw6.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-DKenhM-1.js → MagicLinkRoutes-CXjYezWQ.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-0g7D-J_c.js → MagicLinkSignInScreen-BUNdHIhe.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-C1owD1l4.js → MobileAppDrawer-B9kM1EIv.js} +1 -1
  23. package/dist/assets/{NotFoundScreen-CDTENjn3.js → NotFoundScreen-dTz3iSg6.js} +1 -1
  24. package/dist/assets/{NotificationRoutes-CKh3SMt4.js → NotificationRoutes-B-SWdCsl.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-28eY7N8v.js → OAuthConsentScreen-DpFLAm33.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-BRmUZUjI.js → PandLWithForecastRoutes-DhM58Kw_.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-DhjKygIO.js → PeopleRoutes-DB7-Q-pp.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-CnVEsdqq.js → PerformanceRoutes-nR-Ij0h8.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-WmVdfC19.js → QBOConnectionScreen-DjicJ7JC.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-PEBFhlmP.js → ReferralListScreen-MpCR-kMi.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-BkLIE_PW.js → ReimbursementApprovalRoutes-BIvv53K-.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-dkA2aqfF.js → ReimbursementApprovalRuleDetailScreen-DQE0YCtt.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-BiXGzoNt.js → ReimbursementRoutes-DGdeFppj.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-C6YTBKT9.js → ReportsRoutes-CPoRc-ap.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-CvorIu5L.js → RewardsRoutes-VzWE8H0v.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-Dk4hXC7S.js → ScreenRoutes-Csidbsz6.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-D8oriWAW.js → SettingsRoutes-B5QpNyhz.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-BHZjOSHJ.js → SetupPagesScreen-DMid48FW.js} +1 -1
  39. package/dist/assets/{SignInScreen-Y6BuxpSu.js → SignInScreen-DIlWcSpv.js} +1 -1
  40. package/dist/assets/{SignOutScreen-CdkUNxjq.js → SignOutScreen-CB6vGVFT.js} +1 -1
  41. package/dist/assets/{TaskListScreen-DuuYXRRr.js → TaskListScreen-DWM1Gir_.js} +1 -1
  42. package/dist/assets/{TaskRoutes-BMtkIWCF.js → TaskRoutes-C66bYwTH.js} +1 -1
  43. package/dist/assets/{TransactionDetailRoutes-C3Fb8KbQ.js → TransactionDetailRoutes-C_-PAgkA.js} +1 -1
  44. package/dist/assets/{TransactionDetailScreen-CUNFX6ex.js → TransactionDetailScreen-DnPYNeZ7.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-C4xg5Sow.js → TransactionListRoutes-XcZ7A_dZ.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-DJhXjsa5.js → TreasuryRoutes-CKiDepbo.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-WEkjdTRS.js → VendorsRoutes-DAF-DUOI.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-B3-p2tMs.js → WiseConfirmationScreen-DVepuJzy.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-C9ludMke.js → ZeniAccountRoutes-CGnyjoVT.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-BOPEKBSK.js → ZeniAccountStatementScreen-Bevdi5E9.js} +1 -1
  51. package/dist/assets/{analyticsHelper-Dc1kU1of.js → analyticsHelper-BSjlNTux.js} +1 -1
  52. package/dist/assets/{getLocaleForTenant-CXwRfDGi.js → getLocaleForTenant-3fU8tTuw.js} +1 -1
  53. package/dist/assets/{index-DWCyzMUX.js → index-RWsKop8i.js} +5 -5
  54. package/dist/assets/{routePaths-aWjSXoc2.js → routePaths-BLCfZXKg.js} +1 -1
  55. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D5XSlLnm.js → useAiCfoDashboardSuggestedQuestionsChips-N0S9Le6J.js} +1 -1
  56. package/dist/assets/{useAskAiCfoHostNavButtonProps-DbBvDdaC.js → useAskAiCfoHostNavButtonProps-BeZ-XlW0.js} +1 -1
  57. package/dist/assets/{useInitialThreadRequest-DS5F5QV2.js → useInitialThreadRequest-DRsrnmSs.js} +1 -1
  58. package/dist/assets/{withTransactionSidePanel-Bsk-acAb.js → withTransactionSidePanel-C4tDX_iT.js} +1 -1
  59. package/dist/index.html +1 -1
  60. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-BNlilBXq.js";import{A as d}from"./AddressScreen-CuGNy3IM.js";import i from"./NotFoundScreen-CDTENjn3.js";import"./sentry-CH2pQ4tM.js";import{o as s,p as r}from"./core-BeBBWfga.js";import"./zeni-epic-state-5fEaVO5b.js";import"./recharts-C5E4pGR4.js";import"./index-DWCyzMUX.js";import"./mui-CnlqDSRv.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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
+ import{j as e}from"./liveblocks-BNlilBXq.js";import{A as d}from"./AddressScreen-B_N8Ph8N.js";import i from"./NotFoundScreen-dTz3iSg6.js";import"./sentry-CH2pQ4tM.js";import{o as s,p as r}from"./core-BeBBWfga.js";import"./zeni-epic-state-5fEaVO5b.js";import"./recharts-C5E4pGR4.js";import"./index-RWsKop8i.js";import"./mui-CnlqDSRv.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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 d}from"./liveblocks-BNlilBXq.js";import{a as h}from"./sentry-CH2pQ4tM.js";import{l as T,h as _,u as j,i as E,g as B,n as K}from"./core-BeBBWfga.js";import{K as M,m as $,z as D,d as L,B as R,v as z,f as C,h as S,_ as F,j as b,p as N}from"./index-DWCyzMUX.js";import{K8 as k,g_ as U,eQ as G,K9 as O,c2 as V,Ka as q,kj as H}from"./zeni-epic-state-5fEaVO5b.js";import{n as Q}from"./mui-CnlqDSRv.js";import J from"./NotFoundScreen-CDTENjn3.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]="977f0672-ce37-4e0c-885e-68dac1365f2a",e._sentryDebugIdIdentifier="sentry-dbid-977f0672-ce37-4e0c-885e-68dac1365f2a")}catch{}})();const W=Q.div`
1
+ import{j as d}from"./liveblocks-BNlilBXq.js";import{a as h}from"./sentry-CH2pQ4tM.js";import{l as T,h as _,u as j,i as E,g as B,n as K}from"./core-BeBBWfga.js";import{K as M,m as $,z as D,d as L,B as R,v as z,f as C,h as S,_ as F,j as b,p as N}from"./index-RWsKop8i.js";import{K8 as k,g_ as U,eQ as G,K9 as O,c2 as V,Ka as q,kj as H}from"./zeni-epic-state-5fEaVO5b.js";import{n as Q}from"./mui-CnlqDSRv.js";import J from"./NotFoundScreen-dTz3iSg6.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]="977f0672-ce37-4e0c-885e-68dac1365f2a",e._sentryDebugIdIdentifier="sentry-dbid-977f0672-ce37-4e0c-885e-68dac1365f2a")}catch{}})();const W=Q.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as f}from"./liveblocks-BNlilBXq.js";import{a as i}from"./sentry-CH2pQ4tM.js";import{h as ge,l as Ce,u as Ie,g as q,i as be,n as ke}from"./core-BeBBWfga.js";import{Q as we,cO as Pe,z as xe,K as Ee,cP as Qe,cQ as Te,cR as z,cS as ve,cT as Y,p as D,v as W,f as E,cU as H,cV as ye,a0 as _e,h as Oe,a6 as Ue,cW as Ae,a1 as Le,q as De,b0 as Fe,cX as Be}from"./index-DWCyzMUX.js";import{fI as je,f7 as Z,eQ as Re,hE as Me,QL as Ge,eP as Ve,hO as $e,hK as Ne,fy as K,fs as qe,fl as ze,fp as X,ft as We,fu as He,fv as Ke,fw as Xe,fx as Je}from"./zeni-epic-state-5fEaVO5b.js";import{D as Ye,n as b,S as Ze,P as et}from"./mui-CnlqDSRv.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-D5XSlLnm.js";import{p as st}from"./pathToGoBack-CHG8tIif.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="44e0a9f1-7773-4a11-8d43-36fbf55bea8e",o._sentryDebugIdIdentifier="sentry-dbid-44e0a9f1-7773-4a11-8d43-36fbf55bea8e")}catch{}})();const ee="chat-response-generated",ot=ke(function(o,n){const t=Z(o),m=n.isSubmitting;return{showSampleQuestions:n.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:n.sessionFromUrl==="new_chat"||n.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Le}/tableDownload`,emailLinkQuestion:n.emailLinkQuestion,autoSubmitEmailLinkQuestion:n.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:n.onEmailLinkQuestionProcessed,routedInitialQuestionSource:n.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:n.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:n.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:n.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:n.isFileUploadEnabled,isUploadPromoVisible:n.isUploadPromoVisible,onUploadPromoClose:n.onUploadPromoClose}},function(o,n){const{location:t,currentTenant:m,userId:r,navigate:g,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:c}=n;return{onEventReceived:(e,l)=>{if(e===ee&&typeof l.text=="string"&&typeof l.metadata=="object"){const u=l,p=He(u.type),d=u.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:k,currentQuestionAnswerSummary:Q}=Y(C,d);p!=="answer"?E.trackAICFOChatResponseGenerated(p,k?.question.questionText??"",u.text,d,Be(Q,s),u.metadata.message_id??null):E.trackAICFOChatAnswerGenerated(u.text,k?.question.questionText??"",(u.follow_up_questions?.length??0)>0,!!u.assumptions,!!u.insights,u.visualization!=null,Ke(u.visualization?.type??"")??null,d,u.summarized_title,u.metadata.message_id??null),o(Xe({chatSessionId:u.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),o(Je({chatSessionId:u.metadata.chat_session_id,answerPayload:u,userId:r}))}},onSubmit:(e,l,u,p)=>{e&&Fe(o,e,l,S,C,r,p,u)},updateCurrentInput:e=>{o(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{o(We(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{g(-1)},onCloseClick:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??st(1);g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),o(X(""))},togglePageView:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),c(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{g(-1)},onNewChatClick:()=>{S!=null&&o(ze());const e=De(t.state?.pathnameStackToGoBack,t.pathname);g(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,l)=>{o(qe({questionAnswerId:e,isCollapsed:l}))},onMenuClick:n.onMenuClick}})(Ue(Ae)),Et=({isFileUploadEnabled:o})=>{const{setIsAiCfoOpen:n}=we(),t=ge(),m=Ce(),r=Ie(),[g,S]=i.useState(!1);i.useEffect(()=>{t(je())},[t]);const{customPageTitle:C}=Pe(),c=q(a=>Z(a)),e=xe.getSignedInUser(),{session_id:l}=be(),u=Ee(),p=_e(u),d=q(a=>Re(a)),s=c.uiState.currentChatSessionId,k=d.tenantEmailDomain,{handleUploadPromoClose:Q,isUploadPromoVisible:te}=Qe({isFileUploadEnabled:o,tenantEmailDomain:k}),T=Te({currentTenant:d,currentChatSessionId:s,aiCfoView:c}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=r.state,P=w?.aiCfoInitialQuestion,F=!!w?.aiCfoShouldSubmit;i.useEffect(()=>{const a=r.state;if(a?.[z]!==!0)return;S(!0);const h={...a};delete h[z],m(r,{replace:!0,state:h})},[r.pathname,r.search,r.state,m]);const[ae,v]=i.useState(null),[ne,y]=i.useState(!1),[ie,_]=i.useState(void 0),[re,O]=i.useState(void 0),B=i.useRef(!1);i.useEffect(()=>{if(!B.current&&P!=null&&P!==""){const a=r.state;v(P),y(F),_(a?.aiCfoInitialSubmissionSource!=null?a.aiCfoInitialSubmissionSource:void 0);const h=a?.aiCfoSuggestionIndex;O(typeof h=="number"?h:void 0),B.current=!0}},[P,F,r.state]);const le=i.useCallback(()=>{v(null),y(!1),_(void 0),O(void 0)},[]),j=i.useMemo(()=>new URLSearchParams(r.search),[r.search]),R=j.get("ref")??w?.aiCfoRef,U=j.get("emailRefId")??w?.aiCfoEmailRefId,M=i.useRef(!1);i.useEffect(()=>{M.current||R!=="month-end-email"||U==null||s!=null||e==null||(t(Me("controller",e.userId,U,"MONTH_END_EMAIL")),M.current=!0)},[R,U,s,t,e]);const x=c.uiState.lastContextMessage;i.useEffect(()=>{x!=null&&x!==""&&s!=null&&(v(x),y(!0),_(void 0),O(void 0),t(Ge()))},[x,s,t]);const ue=d.masterTOSInfo,I=ue?.isMasterTOSAccepted??!1,{visitedSessions:G}=ve(s),A=c.fetchState,L=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,V=s!=null?c.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",$=s==null||(c.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),N=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ce}=Y(N,s),de=ce.length===0;i.useEffect(()=>{I||p||m("../dashboard",{state:{...r.state,message:"open_ai_cfo_drawer"}})},[I,p,m,r.state]);const me=i.useCallback(()=>{const a=D(r.state?.pathnameStackToGoBack),h=d.tenantEmailDomain;m(a.poppedPathname??(h!=null?`/${h}/dashboard`:".."),{state:{...r.state,pathnameStackToGoBack:a.newStack}})},[d.tenantEmailDomain,r.state,m]);i.useEffect(()=>{s!=null&&l!==s&&m(`../ai-cfo/${s}`,{state:{...r.state}})},[s,l]),i.useEffect(()=>{l!=null&&s==null&&l!=="new_chat"&&l!=="explore"&&t(Ve({sessionId:l,agentId:"controller"}))},[]);const pe=i.useMemo(()=>({events:G.map(a=>`private-encrypted-chat-${a}.${ee}`),eventCallback:(a,h,Se)=>Se.onEventReceived(a,h)}),[G]);i.useEffect(()=>{A!=="In-Progress"&&L&&t($e())},[A,L,t]),i.useEffect(()=>{s!=null&&V!=="In-Progress"&&$&&e!=null&&A==="Completed"&&!L&&t(Ne(s,e.userId))},[V,$,s,e,t]);const fe=a=>a.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||l==null)throw Error("Can't access AI Controller page without signing in...");const he=s!=null&&c.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return!I&&p?f.jsxs(nt,{children:[f.jsx(W,{analytics:E,onLoad:fe}),T.drawerElement,f.jsx(it,{children:f.jsx(J,{children:f.jsx(H,{isTOSAccepted:!1,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:me,onCompleteClick:()=>{d.userRoleId!=null&&t(K(d.userRoleId))}})})})]}):f.jsxs(at,{children:[f.jsx(W,{analytics:E,onLoad:a=>a.trackPageLoaded(Oe.Event.aiCFOPage)}),p&&T.drawerElement,f.jsx(ot,{...pe,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>S(!0),userId:e.userId,setIsAiCfoOpen:n,navigate:m,sessionFromUrl:l,location:r,isSubmitting:he,isEmptyChatWithSession:de,customPageTitle:C,currentTenant:d,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:p?T.open:void 0,isFileUploadEnabled:o,isUploadPromoVisible:te,onUploadPromoClose:Q,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),f.jsx(Ye,{anchor:"right",open:g,transitionDuration:250,PaperProps:{component:rt,style:{width:p?"100%":`${ye}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:f.jsx(J,{onClick:a=>a.stopPropagation(),children:f.jsx(H,{isTOSAccepted:I,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>S(!1),onCompleteClick:()=>{I||d.userRoleId==null||t(K(d.userRoleId)),S(!1)}})})})]})},J=b(Ze)`
1
+ import{j as f}from"./liveblocks-BNlilBXq.js";import{a as i}from"./sentry-CH2pQ4tM.js";import{h as ge,l as Ce,u as Ie,g as q,i as be,n as ke}from"./core-BeBBWfga.js";import{Q as we,cO as Pe,z as xe,K as Ee,cP as Qe,cQ as Te,cR as z,cS as ve,cT as Y,p as D,v as W,f as E,cU as H,cV as ye,a0 as _e,h as Oe,a6 as Ue,cW as Ae,a1 as Le,q as De,b0 as Fe,cX as Be}from"./index-RWsKop8i.js";import{fI as je,f7 as Z,eQ as Re,hE as Me,QL as Ge,eP as Ve,hO as $e,hK as Ne,fy as K,fs as qe,fl as ze,fp as X,ft as We,fu as He,fv as Ke,fw as Xe,fx as Je}from"./zeni-epic-state-5fEaVO5b.js";import{D as Ye,n as b,S as Ze,P as et}from"./mui-CnlqDSRv.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-N0S9Le6J.js";import{p as st}from"./pathToGoBack-CHG8tIif.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="44e0a9f1-7773-4a11-8d43-36fbf55bea8e",o._sentryDebugIdIdentifier="sentry-dbid-44e0a9f1-7773-4a11-8d43-36fbf55bea8e")}catch{}})();const ee="chat-response-generated",ot=ke(function(o,n){const t=Z(o),m=n.isSubmitting;return{showSampleQuestions:n.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:n.sessionFromUrl==="new_chat"||n.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Le}/tableDownload`,emailLinkQuestion:n.emailLinkQuestion,autoSubmitEmailLinkQuestion:n.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:n.onEmailLinkQuestionProcessed,routedInitialQuestionSource:n.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:n.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:n.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:n.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:n.isFileUploadEnabled,isUploadPromoVisible:n.isUploadPromoVisible,onUploadPromoClose:n.onUploadPromoClose}},function(o,n){const{location:t,currentTenant:m,userId:r,navigate:g,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:c}=n;return{onEventReceived:(e,l)=>{if(e===ee&&typeof l.text=="string"&&typeof l.metadata=="object"){const u=l,p=He(u.type),d=u.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:k,currentQuestionAnswerSummary:Q}=Y(C,d);p!=="answer"?E.trackAICFOChatResponseGenerated(p,k?.question.questionText??"",u.text,d,Be(Q,s),u.metadata.message_id??null):E.trackAICFOChatAnswerGenerated(u.text,k?.question.questionText??"",(u.follow_up_questions?.length??0)>0,!!u.assumptions,!!u.insights,u.visualization!=null,Ke(u.visualization?.type??"")??null,d,u.summarized_title,u.metadata.message_id??null),o(Xe({chatSessionId:u.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),o(Je({chatSessionId:u.metadata.chat_session_id,answerPayload:u,userId:r}))}},onSubmit:(e,l,u,p)=>{e&&Fe(o,e,l,S,C,r,p,u)},updateCurrentInput:e=>{o(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{o(We(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{g(-1)},onCloseClick:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??st(1);g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),o(X(""))},togglePageView:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),c(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{g(-1)},onNewChatClick:()=>{S!=null&&o(ze());const e=De(t.state?.pathnameStackToGoBack,t.pathname);g(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,l)=>{o(qe({questionAnswerId:e,isCollapsed:l}))},onMenuClick:n.onMenuClick}})(Ue(Ae)),Et=({isFileUploadEnabled:o})=>{const{setIsAiCfoOpen:n}=we(),t=ge(),m=Ce(),r=Ie(),[g,S]=i.useState(!1);i.useEffect(()=>{t(je())},[t]);const{customPageTitle:C}=Pe(),c=q(a=>Z(a)),e=xe.getSignedInUser(),{session_id:l}=be(),u=Ee(),p=_e(u),d=q(a=>Re(a)),s=c.uiState.currentChatSessionId,k=d.tenantEmailDomain,{handleUploadPromoClose:Q,isUploadPromoVisible:te}=Qe({isFileUploadEnabled:o,tenantEmailDomain:k}),T=Te({currentTenant:d,currentChatSessionId:s,aiCfoView:c}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=r.state,P=w?.aiCfoInitialQuestion,F=!!w?.aiCfoShouldSubmit;i.useEffect(()=>{const a=r.state;if(a?.[z]!==!0)return;S(!0);const h={...a};delete h[z],m(r,{replace:!0,state:h})},[r.pathname,r.search,r.state,m]);const[ae,v]=i.useState(null),[ne,y]=i.useState(!1),[ie,_]=i.useState(void 0),[re,O]=i.useState(void 0),B=i.useRef(!1);i.useEffect(()=>{if(!B.current&&P!=null&&P!==""){const a=r.state;v(P),y(F),_(a?.aiCfoInitialSubmissionSource!=null?a.aiCfoInitialSubmissionSource:void 0);const h=a?.aiCfoSuggestionIndex;O(typeof h=="number"?h:void 0),B.current=!0}},[P,F,r.state]);const le=i.useCallback(()=>{v(null),y(!1),_(void 0),O(void 0)},[]),j=i.useMemo(()=>new URLSearchParams(r.search),[r.search]),R=j.get("ref")??w?.aiCfoRef,U=j.get("emailRefId")??w?.aiCfoEmailRefId,M=i.useRef(!1);i.useEffect(()=>{M.current||R!=="month-end-email"||U==null||s!=null||e==null||(t(Me("controller",e.userId,U,"MONTH_END_EMAIL")),M.current=!0)},[R,U,s,t,e]);const x=c.uiState.lastContextMessage;i.useEffect(()=>{x!=null&&x!==""&&s!=null&&(v(x),y(!0),_(void 0),O(void 0),t(Ge()))},[x,s,t]);const ue=d.masterTOSInfo,I=ue?.isMasterTOSAccepted??!1,{visitedSessions:G}=ve(s),A=c.fetchState,L=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,V=s!=null?c.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",$=s==null||(c.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),N=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ce}=Y(N,s),de=ce.length===0;i.useEffect(()=>{I||p||m("../dashboard",{state:{...r.state,message:"open_ai_cfo_drawer"}})},[I,p,m,r.state]);const me=i.useCallback(()=>{const a=D(r.state?.pathnameStackToGoBack),h=d.tenantEmailDomain;m(a.poppedPathname??(h!=null?`/${h}/dashboard`:".."),{state:{...r.state,pathnameStackToGoBack:a.newStack}})},[d.tenantEmailDomain,r.state,m]);i.useEffect(()=>{s!=null&&l!==s&&m(`../ai-cfo/${s}`,{state:{...r.state}})},[s,l]),i.useEffect(()=>{l!=null&&s==null&&l!=="new_chat"&&l!=="explore"&&t(Ve({sessionId:l,agentId:"controller"}))},[]);const pe=i.useMemo(()=>({events:G.map(a=>`private-encrypted-chat-${a}.${ee}`),eventCallback:(a,h,Se)=>Se.onEventReceived(a,h)}),[G]);i.useEffect(()=>{A!=="In-Progress"&&L&&t($e())},[A,L,t]),i.useEffect(()=>{s!=null&&V!=="In-Progress"&&$&&e!=null&&A==="Completed"&&!L&&t(Ne(s,e.userId))},[V,$,s,e,t]);const fe=a=>a.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||l==null)throw Error("Can't access AI Controller page without signing in...");const he=s!=null&&c.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return!I&&p?f.jsxs(nt,{children:[f.jsx(W,{analytics:E,onLoad:fe}),T.drawerElement,f.jsx(it,{children:f.jsx(J,{children:f.jsx(H,{isTOSAccepted:!1,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:me,onCompleteClick:()=>{d.userRoleId!=null&&t(K(d.userRoleId))}})})})]}):f.jsxs(at,{children:[f.jsx(W,{analytics:E,onLoad:a=>a.trackPageLoaded(Oe.Event.aiCFOPage)}),p&&T.drawerElement,f.jsx(ot,{...pe,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>S(!0),userId:e.userId,setIsAiCfoOpen:n,navigate:m,sessionFromUrl:l,location:r,isSubmitting:he,isEmptyChatWithSession:de,customPageTitle:C,currentTenant:d,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:p?T.open:void 0,isFileUploadEnabled:o,isUploadPromoVisible:te,onUploadPromoClose:Q,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),f.jsx(Ye,{anchor:"right",open:g,transitionDuration:250,PaperProps:{component:rt,style:{width:p?"100%":`${ye}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:f.jsx(J,{onClick:a=>a.stopPropagation(),children:f.jsx(H,{isTOSAccepted:I,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>S(!1),onCompleteClick:()=>{I||d.userRoleId==null||t(K(d.userRoleId)),S(!1)}})})})]})},J=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-BNlilBXq.js";import{a as f}from"./sentry-CH2pQ4tM.js";import{l as B,u as U,h as T,g as v,N,n as j,i as $,o as O,p as h}from"./core-BeBBWfga.js";import{eQ as L,Nr as R,N7 as b,xR as x,xL as F,xP as I,xE as W,N9 as q,xH as z,xT as H,xS as D}from"./zeni-epic-state-5fEaVO5b.js";import{m as P,z as k,B as V,a6 as Q,bD as G,af as _,bE as J}from"./index-DWCyzMUX.js";import"./mui-CnlqDSRv.js";import{i as K}from"./ReimbursementApprovalRuleDetailScreen-dkA2aqfF.js";import M from"./NotFoundScreen-CDTENjn3.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]="a2107945-fc7d-49b8-85a1-35e50dd0b61f",e._sentryDebugIdIdentifier="sentry-dbid-a2107945-fc7d-49b8-85a1-35e50dd0b61f")}catch{}})();const w="bill-approval-rule-update",X=j(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"))}}})(Q(G)),Y=()=>{const e=B(),o=U(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(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,...y})},Z=j(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(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(S=>{const E=!!K(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.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(D(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(D(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(H())},onSaveRuleSuccess:()=>{t("../")}}})(J);function C(){const e=B(),o=T(),t=U(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.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(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(C,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(C,{})}),l.jsx(h,{path:"*",element:l.jsx(M,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-BNlilBXq.js";import{a as f}from"./sentry-CH2pQ4tM.js";import{l as B,u as U,h as T,g as v,N,n as j,i as $,o as O,p as h}from"./core-BeBBWfga.js";import{eQ as L,Nr as R,N7 as b,xR as x,xL as F,xP as I,xE as W,N9 as q,xH as z,xT as H,xS as D}from"./zeni-epic-state-5fEaVO5b.js";import{m as P,z as k,B as V,a6 as Q,bD as G,af as _,bE as J}from"./index-RWsKop8i.js";import"./mui-CnlqDSRv.js";import{i as K}from"./ReimbursementApprovalRuleDetailScreen-DQE0YCtt.js";import M from"./NotFoundScreen-dTz3iSg6.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]="a2107945-fc7d-49b8-85a1-35e50dd0b61f",e._sentryDebugIdIdentifier="sentry-dbid-a2107945-fc7d-49b8-85a1-35e50dd0b61f")}catch{}})();const w="bill-approval-rule-update",X=j(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"))}}})(Q(G)),Y=()=>{const e=B(),o=U(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(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,...y})},Z=j(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(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(S=>{const E=!!K(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.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(D(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(D(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(H())},onSaveRuleSuccess:()=>{t("../")}}})(J);function C(){const e=B(),o=T(),t=U(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.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(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(C,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(C,{})}),l.jsx(h,{path:"*",element:l.jsx(M,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BNlilBXq.js";import{l as J,h as se,u as Q,i as ae,g as v,N as te,n as Y,k as na,o as ia,p as S}from"./core-BeBBWfga.js";import{eQ as Z,MJ as Me,bv as It,HD as oa,bo as wt,bF as pe,MK as xt,x9 as Ct,yj as $e,xI as la,bn as De,ML as sa,MM as ra,c2 as ca,MN as da,jD as At,MO as Bt,MP as Et,yU as Ne,xo as Ae,MQ as ua,wZ as tt,MR as pa,C4 as ma,x1 as ba,x7 as Dt,MS as ke,MT as _e,yk as Ge,MU as ha,MV as ga,yn as Oe,MW as ya,yA as Sa,MX as jt,y4 as at,y9 as fa,MY as ka,MZ as ue,M_ as Tt,M$ as Pt,N0 as Ft,fM as va,xt as Le,cx as Rt,N1 as Ia,gQ as wa,N2 as xa,N3 as Ca,eY as Vt,eW as $t,N4 as ze,N5 as Aa,N6 as Ba,Ks as Ze,N7 as Ea,Kt as oe,Ku as He,N8 as Da,N9 as ja,Na as Ta,yb as nt,y8 as Pa,Nb as Fa,Nc as Ra,Nd as Va,xW as $a,Ne as La,Nf as Ua,Ng as Ma,cl as Lt,cN as Ut,jO as Na,bL as _a,bq as Mt,bM as Nt,wf as Ga,Nh as Oa,BT as za,BZ as Za,sM as Ha,yl as Wa,y$ as qa,j$ as fe,Ni as Ka,Nj as _t,kt as Ja,jV as Gt,ke as Ot,kd as it,bE as be,bK as Qa,Nk as Ya,Nl as ve,iy as Xa,Nm as ot,Nn as en,iC as tn,iX as an,zd as nn,No as on,km as ln,z3 as sn,Np as lt,z7 as rn,zc as cn,z9 as dn,z1 as un,Nq as zt,xi as pn,Nr as mn,Ns as bn,fE as hn,fD as gn,fC as yn,k2 as Sn,kk as st,kv as fn,qc as kn,kb as vn,z5 as In,iI as wn,kA as xn,Nt as Cn,iA as An,q3 as Bn,Nu as En,y0 as Dn,bG as jn,bs as Tn,Jn as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-5fEaVO5b.js";import{m as me,z as V,d as Ie,Z as We,a as le,I as y,aN as Be,B as re,o as B,v as je,f as D,ba as Ln,p as z,a1 as qe,q as E,K as we,bb as rt,bc as ct,bd as Un,ak as Mn,y as Nn,aH as _n,w as Zt,O as Ke,Y as Je,be as Gn,at as Ht,bf as On,V as zn,h as Wt,a6 as Zn,bg as Hn,bh as Wn,bi as qn,bj as Kn,bk as Jn,bl as Qn,bm as Yn,bn as Xn,bo as ei,R as ti,bp as ai,b5 as ni,bq as ii,br as oi,a9 as li}from"./index-DWCyzMUX.js";import{n as U,S as si}from"./mui-CnlqDSRv.js";import{A as dt}from"./AddressScreen-CuGNy3IM.js";import{g as ie,a as Te,i as qt,V as Qe,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-XA3QzAyw.js";import{a as f}from"./sentry-CH2pQ4tM.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{u as Kt}from"./useInitialThreadRequest-DS5F5QV2.js";import Ee from"./NotFoundScreen-CDTENjn3.js";import{D as ui}from"./DrawerScreen-2PFFQiRL.js";import{M as Jt}from"./MobileAppDrawer-C1owD1l4.js";import{F as Qt}from"./FeaturePreviewScreen-DBbU3hyx.js";import{S as Pe}from"./SetupPagesScreen-BHZjOSHJ.js";import{B as pi}from"./BillPayApprovalRoutes-CL6D_7dw.js";import{FallBackRoute as mi}from"./ScreenRoutes-Dk4hXC7S.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./analyticsHelper-Dc1kU1of.js";import"./routePaths-aWjSXoc2.js";import"./BusinessVerificationPageScreen-Lfv0XtEV.js";import"./ReimbursementApprovalRuleDetailScreen-dkA2aqfF.js";import"./getLocaleForTenant-CXwRfDGi.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]="b9dbf9c6-5ea3-4f6c-ab4f-93dab9d8bdd0",e._sentryDebugIdIdentifier="sentry-dbid-b9dbf9c6-5ea3-4f6c-ab4f-93dab9d8bdd0")}catch{}})();const bi=Y(function(e,t){const l=Me(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:At(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ae(l,"retry")):e(Ae(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ae(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Ne(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}})(Ln);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Me(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}=Xe({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,N]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:M}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:_}=M(Be.zeniAssistConfig),A=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=_.user_ids!=null&&r?.userId!=null&&_.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&A===!1?N(!1):N(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,A,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,X,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${B.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad: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=Y(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:B.sp10,paddingRight:B.sp3,paddingBottom:"15px",paddingLeft:B.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)}}})(_n);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=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(Be.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,N]=f.useState(!1),[T,M]=f.useState(!1),[$,I]=f.useState(!1),[H,_]=f.useState(),A=v(F=>_e(F,m,g,i));let q=A.fetchState,W=A.file,L=A.showAutofill;const K=v(F=>Me(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],L=!1);const X=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?M(!1):!u&&C&&N(!1))},[i]),f.useEffect(()=>{C||i==null||u||(N(!0),t(Ct(i,h,j,!1)),T||(M(!0),t($e(!1,h,j,b,i)))),u&&!T&&(M(!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(X??"",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(X??"",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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:_,showActionButtons:!1,isInitialEdit:!!A.isInitialEdit,billStage:X}),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(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Mn,{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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,A),setShowConfirmationPopup:I,setPayload:_,showActionButtons:fi(u,A),isInitialEdit:!!A.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();return a.jsx(Yt,{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-BNlilBXq.js";import{l as J,h as se,u as Q,i as ae,g as v,N as te,n as Y,k as na,o as ia,p as S}from"./core-BeBBWfga.js";import{eQ as Z,MJ as Me,bv as It,HD as oa,bo as wt,bF as pe,MK as xt,x9 as Ct,yj as $e,xI as la,bn as De,ML as sa,MM as ra,c2 as ca,MN as da,jD as At,MO as Bt,MP as Et,yU as Ne,xo as Ae,MQ as ua,wZ as tt,MR as pa,C4 as ma,x1 as ba,x7 as Dt,MS as ke,MT as _e,yk as Ge,MU as ha,MV as ga,yn as Oe,MW as ya,yA as Sa,MX as jt,y4 as at,y9 as fa,MY as ka,MZ as ue,M_ as Tt,M$ as Pt,N0 as Ft,fM as va,xt as Le,cx as Rt,N1 as Ia,gQ as wa,N2 as xa,N3 as Ca,eY as Vt,eW as $t,N4 as ze,N5 as Aa,N6 as Ba,Ks as Ze,N7 as Ea,Kt as oe,Ku as He,N8 as Da,N9 as ja,Na as Ta,yb as nt,y8 as Pa,Nb as Fa,Nc as Ra,Nd as Va,xW as $a,Ne as La,Nf as Ua,Ng as Ma,cl as Lt,cN as Ut,jO as Na,bL as _a,bq as Mt,bM as Nt,wf as Ga,Nh as Oa,BT as za,BZ as Za,sM as Ha,yl as Wa,y$ as qa,j$ as fe,Ni as Ka,Nj as _t,kt as Ja,jV as Gt,ke as Ot,kd as it,bE as be,bK as Qa,Nk as Ya,Nl as ve,iy as Xa,Nm as ot,Nn as en,iC as tn,iX as an,zd as nn,No as on,km as ln,z3 as sn,Np as lt,z7 as rn,zc as cn,z9 as dn,z1 as un,Nq as zt,xi as pn,Nr as mn,Ns as bn,fE as hn,fD as gn,fC as yn,k2 as Sn,kk as st,kv as fn,qc as kn,kb as vn,z5 as In,iI as wn,kA as xn,Nt as Cn,iA as An,q3 as Bn,Nu as En,y0 as Dn,bG as jn,bs as Tn,Jn as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-5fEaVO5b.js";import{m as me,z as V,d as Ie,Z as We,a as le,I as y,aN as Be,B as re,o as B,v as je,f as D,ba as Ln,p as z,a1 as qe,q as E,K as we,bb as rt,bc as ct,bd as Un,ak as Mn,y as Nn,aH as _n,w as Zt,O as Ke,Y as Je,be as Gn,at as Ht,bf as On,V as zn,h as Wt,a6 as Zn,bg as Hn,bh as Wn,bi as qn,bj as Kn,bk as Jn,bl as Qn,bm as Yn,bn as Xn,bo as ei,R as ti,bp as ai,b5 as ni,bq as ii,br as oi,a9 as li}from"./index-RWsKop8i.js";import{n as U,S as si}from"./mui-CnlqDSRv.js";import{A as dt}from"./AddressScreen-B_N8Ph8N.js";import{g as ie,a as Te,i as qt,V as Qe,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-B65sMSHn.js";import{a as f}from"./sentry-CH2pQ4tM.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-BeZ-XlW0.js";import{u as Kt}from"./useInitialThreadRequest-DRsrnmSs.js";import Ee from"./NotFoundScreen-dTz3iSg6.js";import{D as ui}from"./DrawerScreen-stWlc2vB.js";import{M as Jt}from"./MobileAppDrawer-B9kM1EIv.js";import{F as Qt}from"./FeaturePreviewScreen-Brw2pKph.js";import{S as Pe}from"./SetupPagesScreen-DMid48FW.js";import{B as pi}from"./BillPayApprovalRoutes-TrUK0wRL.js";import{FallBackRoute as mi}from"./ScreenRoutes-Csidbsz6.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./analyticsHelper-BSjlNTux.js";import"./routePaths-BLCfZXKg.js";import"./BusinessVerificationPageScreen-B8MKmqGF.js";import"./ReimbursementApprovalRuleDetailScreen-DQE0YCtt.js";import"./getLocaleForTenant-3fU8tTuw.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]="b9dbf9c6-5ea3-4f6c-ab4f-93dab9d8bdd0",e._sentryDebugIdIdentifier="sentry-dbid-b9dbf9c6-5ea3-4f6c-ab4f-93dab9d8bdd0")}catch{}})();const bi=Y(function(e,t){const l=Me(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:At(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ae(l,"retry")):e(Ae(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ae(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Ne(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}})(Ln);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Me(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}=Xe({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,N]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:M}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:_}=M(Be.zeniAssistConfig),A=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=_.user_ids!=null&&r?.userId!=null&&_.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&A===!1?N(!1):N(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,A,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,X,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${B.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad: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=Y(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:B.sp10,paddingRight:B.sp3,paddingBottom:"15px",paddingLeft:B.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)}}})(_n);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=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(Be.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,N]=f.useState(!1),[T,M]=f.useState(!1),[$,I]=f.useState(!1),[H,_]=f.useState(),A=v(F=>_e(F,m,g,i));let q=A.fetchState,W=A.file,L=A.showAutofill;const K=v(F=>Me(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],L=!1);const X=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?M(!1):!u&&C&&N(!1))},[i]),f.useEffect(()=>{C||i==null||u||(N(!0),t(Ct(i,h,j,!1)),T||(M(!0),t($e(!1,h,j,b,i)))),u&&!T&&(M(!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(X??"",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(X??"",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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:_,showActionButtons:!1,isInitialEdit:!!A.isInitialEdit,billStage:X}),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(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Mn,{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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,A),setShowConfirmationPopup:I,setPayload:_,showActionButtons:fi(u,A),isInitialEdit:!!A.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=U.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-BNlilBXq.js";import{a as N}from"./sentry-CH2pQ4tM.js";import{l as ae,u as ne,h as se,i as ie,g as C,N as oe,n as re}from"./core-BeBBWfga.js";import{d as ce,a as ue,aN as de,z,v as pe,f as B,af as E,h as x,bz as le,at as me,q as P,au as R}from"./index-DWCyzMUX.js";import{Nf as fe,eQ as q,sb as ye,HH as Se,xW as ge,AD as Ie,Da as he,DP as be,EI as De,NC as Oe,ND as Te,NE as ke,NF as Ce,NG as Ne,K9 as Ve,ME as we,Kl as Ae,kj as _e,fE as ve,fD as Fe,fC as Ee,qc as xe,q3 as ze,q0 as Be,kb as Pe,sk as Re,si as M,bE as L,sw as U,cv as Me}from"./zeni-epic-state-5fEaVO5b.js";import{n as Le}from"./mui-CnlqDSRv.js";import{d as j}from"./routePaths-aWjSXoc2.js";import{M as Ue}from"./MobileAppDrawer-C1owD1l4.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]="d6d8c367-3065-48b5-8797-6297c50a5a98",e._sentryDebugIdIdentifier="sentry-dbid-d6d8c367-3065-48b5-8797-6297c50a5a98")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-BNlilBXq.js";import{a as N}from"./sentry-CH2pQ4tM.js";import{l as ae,u as ne,h as se,i as ie,g as C,N as oe,n as re}from"./core-BeBBWfga.js";import{d as ce,a as ue,aN as de,z,v as pe,f as B,af as E,h as x,bz as le,at as me,q as P,au as R}from"./index-RWsKop8i.js";import{Nf as fe,eQ as q,sb as ye,HH as Se,xW as ge,AD as Ie,Da as he,DP as be,EI as De,NC as Oe,ND as Te,NE as ke,NF as Ce,NG as Ne,K9 as Ve,ME as we,Kl as Ae,kj as _e,fE as ve,fD as Fe,fC as Ee,qc as xe,q3 as ze,q0 as Be,kb as Pe,sk as Re,si as M,bE as L,sw as U,cv as Me}from"./zeni-epic-state-5fEaVO5b.js";import{n as Le}from"./mui-CnlqDSRv.js";import{d as j}from"./routePaths-BLCfZXKg.js";import{M as Ue}from"./MobileAppDrawer-B9kM1EIv.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]="d6d8c367-3065-48b5-8797-6297c50a5a98",e._sentryDebugIdIdentifier="sentry-dbid-d6d8c367-3065-48b5-8797-6297c50a5a98")}catch{}})();const je=Le.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BNlilBXq.js";import{l as le,i as ia,h as ue,g as y,u as ge,n as pe,N as ga,s as ut,o as Wt,p as te}from"./core-BeBBWfga.js";import{eQ as ie,bs as Re,Pa as ka,eW as be,eX as ye,eY as Se,fT as Ge,cs as ze,Pb as Ze,Pc as Ma,tq as ba,jL as ya,Pd as Sa,gQ as oa,zW as Qe,zY as $a,zZ as Ga,jB as mt,Pe as Ye,zK as Ct,Pf as qt,Pg as Jt,zN as Da,Ph as Xt,Nz as _a,rC as pt,zT as za,g$ as Qt,Pi as ht,Pj as Ke,bq as en,Pk as an,fE as Pa,fD as wa,Ar as tn,fC as Ta,Nf as nn,Pl as ft,cl as gt,cN as rn,Ny as da,B1 as sn,Pm as tt,AD as Fa,Pn as bt,B2 as on,N_ as cn,B3 as dn,BZ as ln,sM as un,BT as mn,Ac as yt,A5 as Cn,Po as pn,fV as hn,Al as St,Ap as It,fU as fn,Pp as gn,AP as At,Pq as bn,Pr as yn,Ps as Sn,An as Et,A8 as kt,zQ as Dt,Ah as _t,Af as Pt,Aj as In,zX as nt,Pt as wt,Pu as va,AA as Ia,Ke as Tt,cO as Za,Pv as An,Pw as En,Px as kn,Py as Dn,Ax as Na,AW as _n,AS as Pn,At as wn,AU as Tn,AK as Fn,AM as vn,Pz as Ft,B0 as vt,HD as xn,PA as Bn,PB as Ln,PC as Un,PD as xt,PE as Rn,Bn as On,AC as Bt,Aw as ca,AB as jn,PF as Nn,PG as Vn,zH as Hn,PH as Lt,PI as Ut,PJ as Mn,zJ as $n,zI as rt,PK as Gn,PL as zn,PM as Zn,Ka as Yn,PN as Ya,PO as Kn,wi as Rt,kj as Wn,gR as qn,Bs as Jn,PP as Ot,PQ as Xn,Bt as Qn,PR as er,df as ar,tk as tr,Bi as nr,Bc as Ue,bv as rr,bF as sr,cx as or,bG as cr,Jn as ir}from"./zeni-epic-state-5fEaVO5b.js";import{z as Q,d as je,a as ce,I as Z,B as la,c1 as xa,cc as dr,p as ve,cd as lr,ce as ur,K as ua,aN as Fe,q as fe,bk as Ka,cf as mr,w as ma,j as Ba,m as Wa,f as J,O as qa,cg as Cr,Z as jt,aq as Ja,bw as Je,ch as Va,ci as pr,v as Xa,a6 as hr,cj as fr,at as Nt,a1 as Ha,V as Vt,h as Ht,ck as gr,cl as br,cm as yr,cn as Sr,co as Ir,cp as Ar,o as Aa,cq as Er,cr as kr,cs as Ra,R as Dr,ct as _r,cu as Pr,cv as wr,cw as Tr,cx as Fr,a9 as vr}from"./index-DWCyzMUX.js";import{n as _e,D as Mt,S as xr}from"./mui-CnlqDSRv.js";import{a as i}from"./sentry-CH2pQ4tM.js";import{g as Ce,a as Ca,b as $t,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Qa,P as Lr,i as et,s as Xe,j as Gt,k as Me,l as zt,m as Ur,n as Zt,p as Rr,S as st}from"./SetupPagesScreen-BHZjOSHJ.js";import La from"./NotFoundScreen-CDTENjn3.js";import{M as $e}from"./MobileAppDrawer-C1owD1l4.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{v as ot}from"./utils-C2zbYn9G.js";import{t as Or}from"./AddressScreen-CuGNy3IM.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./analyticsHelper-Dc1kU1of.js";import"./routePaths-aWjSXoc2.js";import"./BusinessVerificationPageScreen-Lfv0XtEV.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]="e189317d-f0e9-4ba5-a7fb-cf4c3b1f53af",e._sentryDebugIdIdentifier="sentry-dbid-e189317d-f0e9-4ba5-a7fb-cf4c3b1f53af")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=Q.getSignedInUser(),n=y(X=>ie(X)),C=je(),p=Re(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=u(Z.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(R,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>Ge(X,n.companyId)),N=ze(v.controllers),{creditAccount:L,creditAccountRepayment:w}=y(X=>Ze(X)),V=y(X=>X.classListState.fetchState),m=!_&&d&&f,l=y(X=>Ma(X,t,m,d)),[P,T]=i.useState(!1),H=l.chargeCard,U=H?.cardCreatedByUser?.userId,K=y(X=>U!=null?ba(X.userRoleState,U):void 0),I=K?.accountingClassIDs[0],B=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,O=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=O?.accountingClassIDs[0],E=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),z=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&z&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,z,q]),i.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Qe(t,m,!1)))},[P,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(z===!1||z&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,c);e(X)}},[l.fetchState,c,z]),i.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&f&&p&&a($a()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&f&&p&&a(Ga()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,f,p,V]);const G=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Oe(d,g,D,f),ae=Ca(d,f,p,L,w),ne=$t(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:G,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=ge(),r=Q.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ye(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=ge(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,R]=i.useState(!1),F=Q.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>Jt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(Z.isDebitCardFeatureEnabled),w=Se(L,k),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),P=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&U&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Qe(n,K,U)))},[o,g.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:z}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:z}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const B=Q.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(O,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{R(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx($e,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(Gr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:B,navigate:r,currentTenant:k,location:C,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(zr,{windowSize:t,children:e}):null]})},Gr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Qt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ke(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(Pa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),zr=_e.div`
1
+ import{j as s}from"./liveblocks-BNlilBXq.js";import{l as le,i as ia,h as ue,g as y,u as ge,n as pe,N as ga,s as ut,o as Wt,p as te}from"./core-BeBBWfga.js";import{eQ as ie,bs as Re,Pa as ka,eW as be,eX as ye,eY as Se,fT as Ge,cs as ze,Pb as Ze,Pc as Ma,tq as ba,jL as ya,Pd as Sa,gQ as oa,zW as Qe,zY as $a,zZ as Ga,jB as mt,Pe as Ye,zK as Ct,Pf as qt,Pg as Jt,zN as Da,Ph as Xt,Nz as _a,rC as pt,zT as za,g$ as Qt,Pi as ht,Pj as Ke,bq as en,Pk as an,fE as Pa,fD as wa,Ar as tn,fC as Ta,Nf as nn,Pl as ft,cl as gt,cN as rn,Ny as da,B1 as sn,Pm as tt,AD as Fa,Pn as bt,B2 as on,N_ as cn,B3 as dn,BZ as ln,sM as un,BT as mn,Ac as yt,A5 as Cn,Po as pn,fV as hn,Al as St,Ap as It,fU as fn,Pp as gn,AP as At,Pq as bn,Pr as yn,Ps as Sn,An as Et,A8 as kt,zQ as Dt,Ah as _t,Af as Pt,Aj as In,zX as nt,Pt as wt,Pu as va,AA as Ia,Ke as Tt,cO as Za,Pv as An,Pw as En,Px as kn,Py as Dn,Ax as Na,AW as _n,AS as Pn,At as wn,AU as Tn,AK as Fn,AM as vn,Pz as Ft,B0 as vt,HD as xn,PA as Bn,PB as Ln,PC as Un,PD as xt,PE as Rn,Bn as On,AC as Bt,Aw as ca,AB as jn,PF as Nn,PG as Vn,zH as Hn,PH as Lt,PI as Ut,PJ as Mn,zJ as $n,zI as rt,PK as Gn,PL as zn,PM as Zn,Ka as Yn,PN as Ya,PO as Kn,wi as Rt,kj as Wn,gR as qn,Bs as Jn,PP as Ot,PQ as Xn,Bt as Qn,PR as er,df as ar,tk as tr,Bi as nr,Bc as Ue,bv as rr,bF as sr,cx as or,bG as cr,Jn as ir}from"./zeni-epic-state-5fEaVO5b.js";import{z as Q,d as je,a as ce,I as Z,B as la,c1 as xa,cc as dr,p as ve,cd as lr,ce as ur,K as ua,aN as Fe,q as fe,bk as Ka,cf as mr,w as ma,j as Ba,m as Wa,f as J,O as qa,cg as Cr,Z as jt,aq as Ja,bw as Je,ch as Va,ci as pr,v as Xa,a6 as hr,cj as fr,at as Nt,a1 as Ha,V as Vt,h as Ht,ck as gr,cl as br,cm as yr,cn as Sr,co as Ir,cp as Ar,o as Aa,cq as Er,cr as kr,cs as Ra,R as Dr,ct as _r,cu as Pr,cv as wr,cw as Tr,cx as Fr,a9 as vr}from"./index-RWsKop8i.js";import{n as _e,D as Mt,S as xr}from"./mui-CnlqDSRv.js";import{a as i}from"./sentry-CH2pQ4tM.js";import{g as Ce,a as Ca,b as $t,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Qa,P as Lr,i as et,s as Xe,j as Gt,k as Me,l as zt,m as Ur,n as Zt,p as Rr,S as st}from"./SetupPagesScreen-DMid48FW.js";import La from"./NotFoundScreen-dTz3iSg6.js";import{M as $e}from"./MobileAppDrawer-B9kM1EIv.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-BeZ-XlW0.js";import{v as ot}from"./utils-C2zbYn9G.js";import{t as Or}from"./AddressScreen-B_N8Ph8N.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./analyticsHelper-BSjlNTux.js";import"./routePaths-BLCfZXKg.js";import"./BusinessVerificationPageScreen-B8MKmqGF.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]="e189317d-f0e9-4ba5-a7fb-cf4c3b1f53af",e._sentryDebugIdIdentifier="sentry-dbid-e189317d-f0e9-4ba5-a7fb-cf4c3b1f53af")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=Q.getSignedInUser(),n=y(X=>ie(X)),C=je(),p=Re(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=u(Z.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(R,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>Ge(X,n.companyId)),N=ze(v.controllers),{creditAccount:L,creditAccountRepayment:w}=y(X=>Ze(X)),V=y(X=>X.classListState.fetchState),m=!_&&d&&f,l=y(X=>Ma(X,t,m,d)),[P,T]=i.useState(!1),H=l.chargeCard,U=H?.cardCreatedByUser?.userId,K=y(X=>U!=null?ba(X.userRoleState,U):void 0),I=K?.accountingClassIDs[0],B=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,O=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=O?.accountingClassIDs[0],E=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),z=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&z&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,z,q]),i.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Qe(t,m,!1)))},[P,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(z===!1||z&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,c);e(X)}},[l.fetchState,c,z]),i.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&f&&p&&a($a()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&f&&p&&a(Ga()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,f,p,V]);const G=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Oe(d,g,D,f),ae=Ca(d,f,p,L,w),ne=$t(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:G,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=ge(),r=Q.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ye(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=ge(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,R]=i.useState(!1),F=Q.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>Jt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(Z.isDebitCardFeatureEnabled),w=Se(L,k),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),P=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&U&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Qe(n,K,U)))},[o,g.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:z}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:z}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const B=Q.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(O,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{R(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx($e,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(Gr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:B,navigate:r,currentTenant:k,location:C,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(zr,{windowSize:t,children:e}):null]})},Gr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Qt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ke(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(Pa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),zr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-BNlilBXq.js";import{a as g}from"./sentry-CH2pQ4tM.js";import{l as w,h as T,u as k,i as x,g as b,n as E}from"./core-BeBBWfga.js";import{z as C,b5 as F,v as P,f as V,h as A,af as O,b6 as L,at as M,au as j,q as U}from"./index-DWCyzMUX.js";import{eQ as h,fG as B,sb as _,fB as G,c2 as R,ME as q,bn as z,qc as H,q0 as Y,kb as Q,lH as S,MF as Z,bE as $,cv as N,lP as J,lS as K}from"./zeni-epic-state-5fEaVO5b.js";import"./mui-CnlqDSRv.js";import{d as W}from"./routePaths-aWjSXoc2.js";import{M as X}from"./MobileAppDrawer-C1owD1l4.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]="334b5b7a-4fdf-49cb-9961-4a48f551d2b8",t._sentryDebugIdIdentifier="sentry-dbid-334b5b7a-4fdf-49cb-9961-4a48f551d2b8")}catch{}})();const ee=E(function(t){const a=G(t),i=C.getSignedInUser(),l=h(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=q(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:`${M.fileMicroServiceBaseUrl}`,isZeniUser:z(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(K())},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:D}=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:j(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:D.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(Q({files:e}))},onDeleteFile:e=>{t(Y(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}})(L);function de(){const t=w(),a=T(),i=k(),{tenantEmailDomain:l}=x(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=b(s=>s.companyViewState.passportView.fetchState),o=b(s=>s.companyConfigState.fetchState),r=b(s=>h(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(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(A.Event.companyPassport,O(i)?"Settings":"Company Passport")}),O(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:O(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-BNlilBXq.js";import{a as g}from"./sentry-CH2pQ4tM.js";import{l as w,h as T,u as k,i as x,g as b,n as E}from"./core-BeBBWfga.js";import{z as C,b5 as F,v as P,f as V,h as A,af as O,b6 as L,at as M,au as j,q as U}from"./index-RWsKop8i.js";import{eQ as h,fG as B,sb as _,fB as G,c2 as R,ME as q,bn as z,qc as H,q0 as Y,kb as Q,lH as S,MF as Z,bE as $,cv as N,lP as J,lS as K}from"./zeni-epic-state-5fEaVO5b.js";import"./mui-CnlqDSRv.js";import{d as W}from"./routePaths-BLCfZXKg.js";import{M as X}from"./MobileAppDrawer-B9kM1EIv.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]="334b5b7a-4fdf-49cb-9961-4a48f551d2b8",t._sentryDebugIdIdentifier="sentry-dbid-334b5b7a-4fdf-49cb-9961-4a48f551d2b8")}catch{}})();const ee=E(function(t){const a=G(t),i=C.getSignedInUser(),l=h(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=q(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:`${M.fileMicroServiceBaseUrl}`,isZeniUser:z(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(K())},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:D}=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:j(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:D.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(Q({files:e}))},onDeleteFile:e=>{t(Y(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}})(L);function de(){const t=w(),a=T(),i=k(),{tenantEmailDomain:l}=x(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=b(s=>s.companyViewState.passportView.fetchState),o=b(s=>s.companyConfigState.fetchState),r=b(s=>h(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(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(A.Event.companyPassport,O(i)?"Settings":"Company Passport")}),O(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:O(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-BNlilBXq.js";import{a}from"./sentry-CH2pQ4tM.js";import{h as D,u as v,g as f,N as w}from"./core-BeBBWfga.js";import{Jj as O,eQ as A,fn as U,mT as j,fP as h,fm as _,eU as L,Jq as F}from"./zeni-epic-state-5fEaVO5b.js";import{u as $,z as u,L as g,O as k,o as H}from"./index-DWCyzMUX.js";import{n as P}from"./mui-CnlqDSRv.js";import{t as z}from"./getLocaleForTenant-CXwRfDGi.js";import{g as Q,Q as J}from"./QBOConnectionScreen-WmVdfC19.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./empty-BaCT02t1.js";import"./pdf-lib-BEgmFXIU.js";import"./index-DS8xe4Yw.js";import"./url-BcTKj4a2.js";import"./index-_ohVjyws.js";import"./decodeURIComponentSafe-OtMMCMcE.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]="d937ea5f-77fa-489f-85c1-7204d316c462",t._sentryDebugIdIdentifier="sentry-dbid-d937ea5f-77fa-489f-85c1-7204d316c462")}catch{}})();const R=P.div`
1
+ import{j as C}from"./liveblocks-BNlilBXq.js";import{a}from"./sentry-CH2pQ4tM.js";import{h as D,u as v,g as f,N as w}from"./core-BeBBWfga.js";import{Jj as O,eQ as A,fn as U,mT as j,fP as h,fm as _,eU as L,Jq as F}from"./zeni-epic-state-5fEaVO5b.js";import{u as $,z as u,L as g,O as k,o as H}from"./index-RWsKop8i.js";import{n as P}from"./mui-CnlqDSRv.js";import{t as z}from"./getLocaleForTenant-3fU8tTuw.js";import{g as Q,Q as J}from"./QBOConnectionScreen-DjicJ7JC.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./empty-BaCT02t1.js";import"./pdf-lib-BEgmFXIU.js";import"./index-DS8xe4Yw.js";import"./url-BcTKj4a2.js";import"./index-_ohVjyws.js";import"./decodeURIComponentSafe-OtMMCMcE.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]="d937ea5f-77fa-489f-85c1-7204d316c462",t._sentryDebugIdIdentifier="sentry-dbid-d937ea5f-77fa-489f-85c1-7204d316c462")}catch{}})();const R=P.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-BNlilBXq.js";import{z as a}from"./index-DWCyzMUX.js";import{g as n}from"./QBOConnectionScreen-WmVdfC19.js";import"./sentry-CH2pQ4tM.js";import{u as p,N as s}from"./core-BeBBWfga.js";import"./zeni-epic-state-5fEaVO5b.js";import"./recharts-C5E4pGR4.js";import"./mui-CnlqDSRv.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./empty-BaCT02t1.js";import"./pdf-lib-BEgmFXIU.js";import"./index-DS8xe4Yw.js";import"./url-BcTKj4a2.js";import"./index-_ohVjyws.js";import"./decodeURIComponentSafe-OtMMCMcE.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="8d904e89-6b8e-4c86-980c-585a84d9d789",t._sentryDebugIdIdentifier="sentry-dbid-8d904e89-6b8e-4c86-980c-585a84d9d789")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
1
+ import{j as i}from"./liveblocks-BNlilBXq.js";import{z as a}from"./index-RWsKop8i.js";import{g as n}from"./QBOConnectionScreen-DjicJ7JC.js";import"./sentry-CH2pQ4tM.js";import{u as p,N as s}from"./core-BeBBWfga.js";import"./zeni-epic-state-5fEaVO5b.js";import"./recharts-C5E4pGR4.js";import"./mui-CnlqDSRv.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./empty-BaCT02t1.js";import"./pdf-lib-BEgmFXIU.js";import"./index-DS8xe4Yw.js";import"./url-BcTKj4a2.js";import"./index-_ohVjyws.js";import"./decodeURIComponentSafe-OtMMCMcE.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="8d904e89-6b8e-4c86-980c-585a84d9d789",t._sentryDebugIdIdentifier="sentry-dbid-8d904e89-6b8e-4c86-980c-585a84d9d789")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BNlilBXq.js";import{t as Ke,A as Ce}from"./AddressScreen-CuGNy3IM.js";import $e from"./NotFoundScreen-CDTENjn3.js";import{a as g}from"./sentry-CH2pQ4tM.js";import{l as oe,u as se,h as ie,i as re,g as A,N as E,n as ce,k as qe,o as ze,p as q}from"./core-BeBBWfga.js";import{R as de,d as le,z as B,a as ue,m as Me,I as _,q as V,v as J,f as N,B as ve,h as Y,ap as Qe,K as Ze,aq as ke,j as te,ar as He,as as Ie,o as Je,at as We,au as Ee,av as Ye}from"./index-DWCyzMUX.js";import{bn as Xe,eQ as ee,ff as et,eY as pe,eW as me,bv as tt,mR as at,fb as nt,bO as ot,jf as ae,ji as we,JP as st,bT as it,c2 as ge,sp as fe,sa as rt,Kj as X,sq as _e,HH as ct,kj as Ue,Kk as Ve,Kl as dt,Km as lt,Kn as ut,jd as pt,jg as mt,sc as Be,so as gt,bE as Te,cv as ft,sC as xe,qc as ht,q0 as yt,kb as bt,fE as St,fD as Ct,fC as kt,Ko as It,s4 as Et,sD as Tt,sG as xt,sJ as Ot,sP as Pt,cU as Dt}from"./zeni-epic-state-5fEaVO5b.js";import{n as he}from"./mui-CnlqDSRv.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-WmVdfC19.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./empty-BaCT02t1.js";import"./pdf-lib-BEgmFXIU.js";import"./index-DS8xe4Yw.js";import"./url-BcTKj4a2.js";import"./index-_ohVjyws.js";import"./decodeURIComponentSafe-OtMMCMcE.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]="a888af32-8829-4704-9b40-d0f93fc4b6a1",t._sentryDebugIdIdentifier="sentry-dbid-a888af32-8829-4704-9b40-d0f93fc4b6a1")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),vt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),I=Me(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&f,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const v=pe(F,c),P=me(c),D=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,z=c?.userRole!=null&&tt(c?.userRole),w=S?.resources?.find(l=>l.resource==="/bills")==null&&!z,M=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),$===!1&&D.push("task_card"),w===!1&&D.push("bill_pay_card","bill_pay_promo_card"),M===!1&&D.push("reimbursement_card","reimbursement_promo_card"),k===!1&&D.push("zeni_accounts_promo_card"),h===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||v||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,D)))},[d,O,v,P,i,c.tenantId,s]),g.useEffect(()=>{(v||P)&&setTimeout(()=>{b(!0)},5e3)},[v,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(v)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(ve,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-BNlilBXq.js";import{t as Ke,A as Ce}from"./AddressScreen-B_N8Ph8N.js";import $e from"./NotFoundScreen-dTz3iSg6.js";import{a as g}from"./sentry-CH2pQ4tM.js";import{l as oe,u as se,h as ie,i as re,g as A,N as E,n as ce,k as qe,o as ze,p as q}from"./core-BeBBWfga.js";import{R as de,d as le,z as B,a as ue,m as Me,I as _,q as V,v as J,f as N,B as ve,h as Y,ap as Qe,K as Ze,aq as ke,j as te,ar as He,as as Ie,o as Je,at as We,au as Ee,av as Ye}from"./index-RWsKop8i.js";import{bn as Xe,eQ as ee,ff as et,eY as pe,eW as me,bv as tt,mR as at,fb as nt,bO as ot,jf as ae,ji as we,JP as st,bT as it,c2 as ge,sp as fe,sa as rt,Kj as X,sq as _e,HH as ct,kj as Ue,Kk as Ve,Kl as dt,Km as lt,Kn as ut,jd as pt,jg as mt,sc as Be,so as gt,bE as Te,cv as ft,sC as xe,qc as ht,q0 as yt,kb as bt,fE as St,fD as Ct,fC as kt,Ko as It,s4 as Et,sD as Tt,sG as xt,sJ as Ot,sP as Pt,cU as Dt}from"./zeni-epic-state-5fEaVO5b.js";import{n as he}from"./mui-CnlqDSRv.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-DjicJ7JC.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./empty-BaCT02t1.js";import"./pdf-lib-BEgmFXIU.js";import"./index-DS8xe4Yw.js";import"./url-BcTKj4a2.js";import"./index-_ohVjyws.js";import"./decodeURIComponentSafe-OtMMCMcE.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]="a888af32-8829-4704-9b40-d0f93fc4b6a1",t._sentryDebugIdIdentifier="sentry-dbid-a888af32-8829-4704-9b40-d0f93fc4b6a1")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),vt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),I=Me(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&f,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const v=pe(F,c),P=me(c),D=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,z=c?.userRole!=null&&tt(c?.userRole),w=S?.resources?.find(l=>l.resource==="/bills")==null&&!z,M=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),$===!1&&D.push("task_card"),w===!1&&D.push("bill_pay_card","bill_pay_promo_card"),M===!1&&D.push("reimbursement_card","reimbursement_promo_card"),k===!1&&D.push("zeni_accounts_promo_card"),h===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||v||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,D)))},[d,O,v,P,i,c.tenantId,s]),g.useEffect(()=>{(v||P)&&setTimeout(()=>{b(!0)},5e3)},[v,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(v)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(ve,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-BNlilBXq.js";import{i as K,g as k,u as Q,h as z,l as H,n as J,j as ta,o as ut,p as F}from"./core-BeBBWfga.js";import{eQ as U,KE as Ze,bE as aa,bq as ve,LR as Sn,i3 as yn,LS as Gt,LT as An,i6 as mt,LU as ze,LV as vn,ib as En,LW as Yt,LX as In,ig as pt,LY as Ke,LZ as Tn,cl as gt,L_ as xn,L$ as Dn,KY as wn,j9 as Fn,M0 as Pn,bn as Re,M1 as na,Ks as re,bc as oa,jn as sa,m$ as ra,j6 as ia,Ku as ie,Kt as X,f7 as ca,eS as On,fp as ht,M2 as Mn,M3 as Rn,M4 as la,M5 as we,uh as Be,ui as je,uF as Ee,uz as ce,um as Le,M6 as Bn,M7 as jn,M8 as Ln,M9 as da,Ma as Fe,Mb as Un,dE as Qe,qM as ua,Mc as Gn,Md as Yn,Me as Vn,Mf as bt,JR as Ct,jD as Ie,uN as _t,qU as Nn,Mg as $n,uj as Vt,qP as ye,qL as ma,Mh as pe,Mi as zn,Mj as kt,JQ as St,sT as pa,Mk as Kn,Ml as qn,Mm as Zn,Mn as yt,t4 as Qn,Mo as Hn,ul as Nt,sS as ha,Mp as he,Mq as Wn,bv as fa,uR as ga,Mr as Xn,Ms as Jn,Mt as eo,Mu as At,uM as to,Mv as ao,uk as $t,uQ as ba,Mw as fe,Mx as no,My as oo,Mz as Ca,js as _a,mY as ka,jx as Sa,mW as ya,mV as Aa,mU as va,sf as so,ff as ro,cO as io,cP as co,mR as lo,fb as uo,n6 as mo,DV as zt,MA as po,MB as ho,MC as fo,MD as go,b5 as He,f2 as bo,gO as Co,fG as _o,n0 as ko,i$ as So,mZ as yo,mX as Ao,eY as vo,eW as Eo}from"./zeni-epic-state-5fEaVO5b.js";import{z as j,a1 as ee,q as D,f as T,O as q,aU as Io,Z as Ue,v as Ge,aV as Ea,h as N,aW as To,d as be,aX as Ia,a as Ce,I as M,m as xo,aY as Do,aZ as wo,Q as Ta,K as xa,c as Da,W as Fo,a_ as Po,H as Oo,aN as wa,a$ as Fa,b0 as Pa,a0 as Oa,b1 as Mo,b2 as Ro,aq as Bo,p as jo,V as Lo,b3 as Uo,b4 as ge}from"./index-DWCyzMUX.js";import{n as vt}from"./mui-CnlqDSRv.js";import{a as b}from"./sentry-CH2pQ4tM.js";import{w as Ma}from"./withTransactionSidePanel-Bsk-acAb.js";import{c as Ra,t as Te,f as le,a as Et,v as Go}from"./routePaths-aWjSXoc2.js";import{u as te}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import Me from"./NotFoundScreen-CDTENjn3.js";import{u as It}from"./useInitialThreadRequest-DS5F5QV2.js";import{t as Ba}from"./analyticsHelper-Dc1kU1of.js";import{C as Yo}from"./CompanyPassportScreen-BwKa_LUc.js";import{u as Vo}from"./useAiCfoDashboardSuggestedQuestionsChips-D5XSlLnm.js";import{F as No}from"./FeaturePreviewScreen-DBbU3hyx.js";import{R as $o}from"./ReferralListScreen-PEBFhlmP.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./TransactionDetailScreen-CUNFX6ex.js";import"./decodeURIComponentSafe-OtMMCMcE.js";import"./MobileAppDrawer-C1owD1l4.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]="4712961f-6386-4e1a-b288-8e33ed1cd01b",e._sentryDebugIdIdentifier="sentry-dbid-4712961f-6386-4e1a-b288-8e33ed1cd01b")}catch{}})();const zo=Ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(A=>A.tenantState.currentTenantId),c=k(A=>U(A)),{tenantEmailDomain:m}=K(),g=Q(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ee}/agingDetailedReport`,timezone:Ze()}),[]),h=b.useMemo(()=>r!=null?aa(r):ve(),[r]),p=z(),f=H(),y=k(A=>Sn(A,h,o)),I=b.useCallback(()=>{o!=null&&y.fetchState!=="In-Progress"&&y.fetchState!=="Completed"&&p(yn(o,h))},[h]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),E=b.useCallback((A,L)=>{p(Gt({sortKey:A,sortOrder:L}))},[]),x=b.useCallback(A=>{p(Gt({downloadState:A}))},[]),R=b.useCallback(A=>{if(e)e(A.transactionId,A.transactionType);else if(m!=null){const L=Ra({id:A.transactionId,type:A.transactionType},m);f(L);const de=D(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:de}})}},[m,e]),S=b.useCallback(()=>{y.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),y.vendor.id,y.vendor.name)},[y.vendor,h]);return b.useEffect(()=>{I()},[]),b.useEffect(()=>{y.fetchState==="Completed"&&S()},[S,y.fetchState]),d.jsx(Io,{apAgingDetail:y,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:R,onReload:I,onBackClick:_,onColumnSortConfigChanged:E,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ko=()=>{const e=z(),a=H(),t=k(E=>An(E)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=te({mobileExploreReferrer:"AP Aging"});Ue({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=k(E=>E.tenantState.currentTenantId),i=k(E=>U(E)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ee}/agingReport`,timezone:Ze()}),[]),C=t.apAgingUIState.selectedDate??ve(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(mt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(E=>{e(ze({searchString:E}))},[]),p=b.useCallback((E,x)=>{e(ze({sortKey:x,sortOrder:E}))},[]),f=b.useCallback(E=>{a(`./${E}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),y=b.useCallback(E=>{e(ze({downloadState:E}))},[]),I=b.useCallback((E,x)=>{},[]),_=b.useCallback((E,x)=>{e(ze({selectedDate:E,agingDateSelectionType:x})),e(mt(E))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:T,onLoad:E=>E.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Ea,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:y,onSelectedDateChanged:_,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},qo=Ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(S=>U(S)),{tenantEmailDomain:c}=K(),m=Q(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ee}/agingDetailedReport`,timezone:Ze()}),[]),l=b.useMemo(()=>r!=null?aa(r):ve(),[r]),h=z(),p=H(),f=k(S=>vn(S,l,o)),y=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(En(o,l))},[l]),I=b.useCallback(()=>{p("../../",{relative:"path"})},[]),_=b.useCallback((S,A)=>{h(Yt({sortKey:S,sortOrder:A}))},[]),E=b.useCallback(S=>{h(Yt({downloadState:S}))},[]),x=b.useCallback(S=>{if(e)e(S.transactionId,S.transactionType);else if(c!=null){const A=Ra({id:S.transactionId,type:S.transactionType},c);p(A);const L=D(m.state?.pathnameStackToGoBack,m.pathname);p(A,{state:{pathnameStackToGoBack:L}})}},[c,e]),R=b.useCallback(()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&R()},[f.fetchState,R]),d.jsx(To,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:x,onReload:y,onBackClick:I,onColumnSortConfigChanged:_,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Zo=()=>{const e=z(),a=H(),t=k(_=>In(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=te({mobileExploreReferrer:"AR Aging"});Ue({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=k(_=>U(_)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ee}/agingReport`,timezone:Ze()}),[]),g=t.arAgingUIState.selectedDate??ve(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(pt(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(_=>{e(Ke({searchString:_}))},[]),h=b.useCallback((_,E)=>{e(Ke({sortKey:E,sortOrder:_}))},[]),p=b.useCallback(_=>{a(`./${_}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(_=>{e(Ke({downloadState:_}))},[]),y=b.useCallback((_,E)=>{e(Ke({selectedDate:_,agingDateSelectionType:E})),e(pt(_))},[]),I=b.useCallback((_,E)=>{e(Tn({nodeId:_,isCollapsed:E}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:T,onLoad:_=>_.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Ea,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:y,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ja=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function La(e,a){const t=wn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Te(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(Fn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Qo=J(function(e){const a=xn(e).accountsInOrder.map((n,o)=>ja(n,o)),t=Dn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}},La)(Ia),Ho=J(function(e){const a=Pn(e).accountsInOrder.map((o,r)=>ja(o,r)),t=j.getSignedInUser(),n=Re(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}},La)(Ia);function Wo(){const e=H(),a=Q(),{tenantEmailDomain:t}=K(),n=be(),o=k(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=gt(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Me,{}):d.jsx(Qo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Xo(){const e=H(),a=Q(),{tenantEmailDomain:t}=K(),n=be(),o=gt(n?.loggedInUserRoleMap),r=k(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Me,{}):d.jsx(Ho,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Jo=vt.div`
1
+ import{j as d}from"./liveblocks-BNlilBXq.js";import{i as K,g as k,u as Q,h as z,l as H,n as J,j as ta,o as ut,p as F}from"./core-BeBBWfga.js";import{eQ as U,KE as Ze,bE as aa,bq as ve,LR as Sn,i3 as yn,LS as Gt,LT as An,i6 as mt,LU as ze,LV as vn,ib as En,LW as Yt,LX as In,ig as pt,LY as Ke,LZ as Tn,cl as gt,L_ as xn,L$ as Dn,KY as wn,j9 as Fn,M0 as Pn,bn as Re,M1 as na,Ks as re,bc as oa,jn as sa,m$ as ra,j6 as ia,Ku as ie,Kt as X,f7 as ca,eS as On,fp as ht,M2 as Mn,M3 as Rn,M4 as la,M5 as we,uh as Be,ui as je,uF as Ee,uz as ce,um as Le,M6 as Bn,M7 as jn,M8 as Ln,M9 as da,Ma as Fe,Mb as Un,dE as Qe,qM as ua,Mc as Gn,Md as Yn,Me as Vn,Mf as bt,JR as Ct,jD as Ie,uN as _t,qU as Nn,Mg as $n,uj as Vt,qP as ye,qL as ma,Mh as pe,Mi as zn,Mj as kt,JQ as St,sT as pa,Mk as Kn,Ml as qn,Mm as Zn,Mn as yt,t4 as Qn,Mo as Hn,ul as Nt,sS as ha,Mp as he,Mq as Wn,bv as fa,uR as ga,Mr as Xn,Ms as Jn,Mt as eo,Mu as At,uM as to,Mv as ao,uk as $t,uQ as ba,Mw as fe,Mx as no,My as oo,Mz as Ca,js as _a,mY as ka,jx as Sa,mW as ya,mV as Aa,mU as va,sf as so,ff as ro,cO as io,cP as co,mR as lo,fb as uo,n6 as mo,DV as zt,MA as po,MB as ho,MC as fo,MD as go,b5 as He,f2 as bo,gO as Co,fG as _o,n0 as ko,i$ as So,mZ as yo,mX as Ao,eY as vo,eW as Eo}from"./zeni-epic-state-5fEaVO5b.js";import{z as j,a1 as ee,q as D,f as T,O as q,aU as Io,Z as Ue,v as Ge,aV as Ea,h as N,aW as To,d as be,aX as Ia,a as Ce,I as M,m as xo,aY as Do,aZ as wo,Q as Ta,K as xa,c as Da,W as Fo,a_ as Po,H as Oo,aN as wa,a$ as Fa,b0 as Pa,a0 as Oa,b1 as Mo,b2 as Ro,aq as Bo,p as jo,V as Lo,b3 as Uo,b4 as ge}from"./index-RWsKop8i.js";import{n as vt}from"./mui-CnlqDSRv.js";import{a as b}from"./sentry-CH2pQ4tM.js";import{w as Ma}from"./withTransactionSidePanel-C4tDX_iT.js";import{c as Ra,t as Te,f as le,a as Et,v as Go}from"./routePaths-BLCfZXKg.js";import{u as te}from"./useAskAiCfoHostNavButtonProps-BeZ-XlW0.js";import Me from"./NotFoundScreen-dTz3iSg6.js";import{u as It}from"./useInitialThreadRequest-DRsrnmSs.js";import{t as Ba}from"./analyticsHelper-BSjlNTux.js";import{C as Yo}from"./CompanyPassportScreen-BnIZacZN.js";import{u as Vo}from"./useAiCfoDashboardSuggestedQuestionsChips-N0S9Le6J.js";import{F as No}from"./FeaturePreviewScreen-Brw2pKph.js";import{R as $o}from"./ReferralListScreen-MpCR-kMi.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./TransactionDetailScreen-DnPYNeZ7.js";import"./decodeURIComponentSafe-OtMMCMcE.js";import"./MobileAppDrawer-B9kM1EIv.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]="4712961f-6386-4e1a-b288-8e33ed1cd01b",e._sentryDebugIdIdentifier="sentry-dbid-4712961f-6386-4e1a-b288-8e33ed1cd01b")}catch{}})();const zo=Ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(A=>A.tenantState.currentTenantId),c=k(A=>U(A)),{tenantEmailDomain:m}=K(),g=Q(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ee}/agingDetailedReport`,timezone:Ze()}),[]),h=b.useMemo(()=>r!=null?aa(r):ve(),[r]),p=z(),f=H(),y=k(A=>Sn(A,h,o)),I=b.useCallback(()=>{o!=null&&y.fetchState!=="In-Progress"&&y.fetchState!=="Completed"&&p(yn(o,h))},[h]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),E=b.useCallback((A,L)=>{p(Gt({sortKey:A,sortOrder:L}))},[]),x=b.useCallback(A=>{p(Gt({downloadState:A}))},[]),R=b.useCallback(A=>{if(e)e(A.transactionId,A.transactionType);else if(m!=null){const L=Ra({id:A.transactionId,type:A.transactionType},m);f(L);const de=D(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:de}})}},[m,e]),S=b.useCallback(()=>{y.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),y.vendor.id,y.vendor.name)},[y.vendor,h]);return b.useEffect(()=>{I()},[]),b.useEffect(()=>{y.fetchState==="Completed"&&S()},[S,y.fetchState]),d.jsx(Io,{apAgingDetail:y,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:R,onReload:I,onBackClick:_,onColumnSortConfigChanged:E,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ko=()=>{const e=z(),a=H(),t=k(E=>An(E)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=te({mobileExploreReferrer:"AP Aging"});Ue({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=k(E=>E.tenantState.currentTenantId),i=k(E=>U(E)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ee}/agingReport`,timezone:Ze()}),[]),C=t.apAgingUIState.selectedDate??ve(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(mt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(E=>{e(ze({searchString:E}))},[]),p=b.useCallback((E,x)=>{e(ze({sortKey:x,sortOrder:E}))},[]),f=b.useCallback(E=>{a(`./${E}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),y=b.useCallback(E=>{e(ze({downloadState:E}))},[]),I=b.useCallback((E,x)=>{},[]),_=b.useCallback((E,x)=>{e(ze({selectedDate:E,agingDateSelectionType:x})),e(mt(E))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:T,onLoad:E=>E.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Ea,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:y,onSelectedDateChanged:_,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},qo=Ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(S=>U(S)),{tenantEmailDomain:c}=K(),m=Q(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ee}/agingDetailedReport`,timezone:Ze()}),[]),l=b.useMemo(()=>r!=null?aa(r):ve(),[r]),h=z(),p=H(),f=k(S=>vn(S,l,o)),y=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(En(o,l))},[l]),I=b.useCallback(()=>{p("../../",{relative:"path"})},[]),_=b.useCallback((S,A)=>{h(Yt({sortKey:S,sortOrder:A}))},[]),E=b.useCallback(S=>{h(Yt({downloadState:S}))},[]),x=b.useCallback(S=>{if(e)e(S.transactionId,S.transactionType);else if(c!=null){const A=Ra({id:S.transactionId,type:S.transactionType},c);p(A);const L=D(m.state?.pathnameStackToGoBack,m.pathname);p(A,{state:{pathnameStackToGoBack:L}})}},[c,e]),R=b.useCallback(()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&R()},[f.fetchState,R]),d.jsx(To,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:x,onReload:y,onBackClick:I,onColumnSortConfigChanged:_,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Zo=()=>{const e=z(),a=H(),t=k(_=>In(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=te({mobileExploreReferrer:"AR Aging"});Ue({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=k(_=>U(_)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ee}/agingReport`,timezone:Ze()}),[]),g=t.arAgingUIState.selectedDate??ve(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(pt(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(_=>{e(Ke({searchString:_}))},[]),h=b.useCallback((_,E)=>{e(Ke({sortKey:E,sortOrder:_}))},[]),p=b.useCallback(_=>{a(`./${_}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(_=>{e(Ke({downloadState:_}))},[]),y=b.useCallback((_,E)=>{e(Ke({selectedDate:_,agingDateSelectionType:E})),e(pt(_))},[]),I=b.useCallback((_,E)=>{e(Tn({nodeId:_,isCollapsed:E}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:T,onLoad:_=>_.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Ea,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:y,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ja=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function La(e,a){const t=wn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Te(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(Fn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Qo=J(function(e){const a=xn(e).accountsInOrder.map((n,o)=>ja(n,o)),t=Dn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}},La)(Ia),Ho=J(function(e){const a=Pn(e).accountsInOrder.map((o,r)=>ja(o,r)),t=j.getSignedInUser(),n=Re(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}},La)(Ia);function Wo(){const e=H(),a=Q(),{tenantEmailDomain:t}=K(),n=be(),o=k(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=gt(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Me,{}):d.jsx(Qo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Xo(){const e=H(),a=Q(),{tenantEmailDomain:t}=K(),n=be(),o=gt(n?.loggedInUserRoleMap),r=k(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Me,{}):d.jsx(Ho,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Jo=vt.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-BNlilBXq.js";import{a as u}from"./sentry-CH2pQ4tM.js";import{h as y,g as b,n as w,u as A,N as k}from"./core-BeBBWfga.js";import{Jj as N,eQ as _,fn as U,Jk as L,mT as R,Jl as z}from"./zeni-epic-state-5fEaVO5b.js";import{u as O,z as f,L as T,t as I,O as j,b as $}from"./index-DWCyzMUX.js";import"./mui-CnlqDSRv.js";import{t as P}from"./getLocaleForTenant-CXwRfDGi.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="7c61f76c-eee4-4f0f-92a0-c6e004fe73f1",t._sentryDebugIdIdentifier="sentry-dbid-7c61f76c-eee4-4f0f-92a0-c6e004fe73f1")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(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(U(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||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const J=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],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 J)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-BNlilBXq.js";import{a as u}from"./sentry-CH2pQ4tM.js";import{h as y,g as b,n as w,u as A,N as k}from"./core-BeBBWfga.js";import{Jj as N,eQ as _,fn as U,Jk as L,mT as R,Jl as z}from"./zeni-epic-state-5fEaVO5b.js";import{u as O,z as f,L as T,t as I,O as j,b as $}from"./index-RWsKop8i.js";import"./mui-CnlqDSRv.js";import{t as P}from"./getLocaleForTenant-3fU8tTuw.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="7c61f76c-eee4-4f0f-92a0-c6e004fe73f1",t._sentryDebugIdIdentifier="sentry-dbid-7c61f76c-eee4-4f0f-92a0-c6e004fe73f1")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(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(U(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||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const J=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],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 J)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BNlilBXq.js";import{l as w,u as C,g as h,n as A,i as B}from"./core-BeBBWfga.js";import{Nl as k,Ns as q,fE as K,fD as M,fC as Q,iA as W,Kt as J,q3 as L,eQ as V,MT as D,iy as T,Nm as v,Nv as F,iw as G,iT as N}from"./zeni-epic-state-5fEaVO5b.js";import{bs as X,K as j,a as R,z as U,m as O,p,I as S,B as Z,bt as Y,o as z,bu as ee,q as te}from"./index-DWCyzMUX.js";import{n as H}from"./mui-CnlqDSRv.js";import"./sentry-CH2pQ4tM.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]="6b7418ed-e996-4c37-87e7-2f85ccf66d5f",e._sentryDebugIdIdentifier="sentry-dbid-6b7418ed-e996-4c37-87e7-2f85ccf66d5f")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(J("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
1
+ import{j as l}from"./liveblocks-BNlilBXq.js";import{l as w,u as C,g as h,n as A,i as B}from"./core-BeBBWfga.js";import{Nl as k,Ns as q,fE as K,fD as M,fC as Q,iA as W,Kt as J,q3 as L,eQ as V,MT as D,iy as T,Nm as v,Nv as F,iw as G,iT as N}from"./zeni-epic-state-5fEaVO5b.js";import{bs as X,K as j,a as R,z as U,m as O,p,I as S,B as Z,bt as Y,o as z,bu as ee,q as te}from"./index-RWsKop8i.js";import{n as H}from"./mui-CnlqDSRv.js";import"./sentry-CH2pQ4tM.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]="6b7418ed-e996-4c37-87e7-2f85ccf66d5f",e._sentryDebugIdIdentifier="sentry-dbid-6b7418ed-e996-4c37-87e7-2f85ccf66d5f")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(J("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-BNlilBXq.js";import{K as l,w as f,m as c}from"./index-DWCyzMUX.js";import{D as p}from"./mui-CnlqDSRv.js";import"./sentry-CH2pQ4tM.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]="f52e2d2c-9a6b-4671-9467-14f9341190b0",e._sentryDebugIdIdentifier="sentry-dbid-f52e2d2c-9a6b-4671-9467-14f9341190b0")}catch{}})();const b={drawerLeftMargin:new f(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=l(),a=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
1
+ import{j as i}from"./liveblocks-BNlilBXq.js";import{K as l,w as f,m as c}from"./index-RWsKop8i.js";import{D as p}from"./mui-CnlqDSRv.js";import"./sentry-CH2pQ4tM.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]="f52e2d2c-9a6b-4671-9467-14f9341190b0",e._sentryDebugIdIdentifier="sentry-dbid-f52e2d2c-9a6b-4671-9467-14f9341190b0")}catch{}})();const b={drawerLeftMargin:new f(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=l(),a=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BNlilBXq.js";import{a as d}from"./sentry-CH2pQ4tM.js";import{l as B,h as G,u as F,i as q,g as c,N as K,n as L,o as N,p as _}from"./core-BeBBWfga.js";import{LA as z,eQ as O,KZ as R,kD as H,Hz as k,LF as M,Ks as W,jD as Y,HA as b,L2 as $,L3 as Q,Ku as V,Kt as Z}from"./zeni-epic-state-5fEaVO5b.js";import{aR as J,f as U,p as X,q as tt}from"./index-DWCyzMUX.js";import"./mui-CnlqDSRv.js";import{d as S}from"./decodeURIComponentSafe-OtMMCMcE.js";import{w as et}from"./withTransactionSidePanel-Bsk-acAb.js";import{f as at,c as nt}from"./routePaths-aWjSXoc2.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import"./TransactionDetailScreen-CUNFX6ex.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]="41f9cd29-47fa-4bdf-bbaf-72c1c357fbb6",a._sentryDebugIdIdentifier="sentry-dbid-41f9cd29-47fa-4bdf-bbaf-72c1c357fbb6")}catch{}})();const ot=L(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:Y(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(V({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Z("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=X(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(b(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(J),it=et(function({entityType:a,...t}){const e=B(),o=G(),l=F(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:j}=q(),r=S(x??""),f=S(j??""),p=rt(r,f),v=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=c(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),w=c(n=>O(n).company?.companyInfo.firstMonthOfFY??1),u=c(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(H(i)))},[m,p,i]);const E=c(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:w,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(K,{to:I(v.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
1
+ import{j as s}from"./liveblocks-BNlilBXq.js";import{a as d}from"./sentry-CH2pQ4tM.js";import{l as B,h as G,u as F,i as q,g as c,N as K,n as L,o as N,p as _}from"./core-BeBBWfga.js";import{LA as z,eQ as O,KZ as R,kD as H,Hz as k,LF as M,Ks as W,jD as Y,HA as b,L2 as $,L3 as Q,Ku as V,Kt as Z}from"./zeni-epic-state-5fEaVO5b.js";import{aR as J,f as U,p as X,q as tt}from"./index-RWsKop8i.js";import"./mui-CnlqDSRv.js";import{d as S}from"./decodeURIComponentSafe-OtMMCMcE.js";import{w as et}from"./withTransactionSidePanel-C4tDX_iT.js";import{f as at,c as nt}from"./routePaths-BLCfZXKg.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./useAskAiCfoHostNavButtonProps-BeZ-XlW0.js";import"./TransactionDetailScreen-DnPYNeZ7.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]="41f9cd29-47fa-4bdf-bbaf-72c1c357fbb6",a._sentryDebugIdIdentifier="sentry-dbid-41f9cd29-47fa-4bdf-bbaf-72c1c357fbb6")}catch{}})();const ot=L(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:Y(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(V({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Z("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=X(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(b(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(J),it=et(function({entityType:a,...t}){const e=B(),o=G(),l=F(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:j}=q(),r=S(x??""),f=S(j??""),p=rt(r,f),v=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=c(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),w=c(n=>O(n).company?.companyInfo.firstMonthOfFY??1),u=c(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(H(i)))},[m,p,i]);const E=c(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:w,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(K,{to:I(v.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-BNlilBXq.js";import Rn from"./NotFoundScreen-CDTENjn3.js";import{a,b as Pt}from"./sentry-CH2pQ4tM.js";import{n as Fe,S as Dn}from"./mui-CnlqDSRv.js";import{h as re,l as wt,u as Ge,g as U,n as Un,i as rt,o as Fn,p as Le}from"./core-BeBBWfga.js";import{eQ as Re,PX as Bn,n1 as ke,fi as _n,qG as Vn,nj as xt,nE as Rt,PY as Dt,nO as On,PZ as Ut,nc as Mn,qc as jn,f1 as Ie,P_ as De,sM as Ft,BZ as Bt,P$ as _t,Q0 as Ln,pT as qe,LB as dt,LD as zn,jG as Qn,LE as $n,jN as Gn,cW as qn,tR as Ye,np as Vt,nT as Ue,Q1 as Yn,Ku as ut,Kt as Pe,Q2 as mt,k2 as Jn,Q3 as Nn,Q4 as Kn,Q5 as Hn,Q6 as Zn,nw as Wn,nh as de,nW as we,Q7 as Xn,Q8 as ea,Q9 as ta,o1 as na,jR as aa,jI as oa,Qa as sa,jQ as ht,LL as ca,Qb as ia,Qc as la,pP as ra,ps as da,nU as fe,pr as ze,Qd as ua,Qe as ma,ll as ha,bq as pa,lg as pt,l2 as ga,Qf as Ca,gQ as gt,fU as Sa,ld as Ia,vK as fa,Qg as ka,os as Ea,on as va,or as ya,oc as ba,Qh as Aa,f4 as Ot,nH as Ta,ns as Pa,fj as Ct,nY as wa,Qi as xa,nV as Mt,Qj as Ra,Qk as Da,Ql as Ua,Qm as Fa,Qn as St,p$ as Ba,pi as _a,Ks as Va,jP as Oa,Qo as Ma,Gv as ja,jO as La,jD as za,f3 as Qa,oT as jt,pa as $a,nS as It,nX as Ga,bE as qa,la as Ya,l7 as Ja,Qp as Na,ob as ft,p8 as kt,p6 as Ka,oY as Ha,oD as Za,p9 as Wa,Qq as Xa,Qr as eo,oH as to,Qs as no,ox as ao,oG as oo,oE as so,pd as co}from"./zeni-epic-state-5fEaVO5b.js";import{a as Lt,I as le,f as L,q as H,V as zt,Z as Qt,cB as io,z as Be,cC as lo,at as xe,cD as ro,aT as Et,B as $t,cE as uo,aq as Qe,O as mo,cF as ho,a1 as po,cG as go,Q as Co,cH as So,cI as Io,R as fo,d as ko,aN as Eo,b5 as vo,w as yo,cJ as bo}from"./index-DWCyzMUX.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{c as vt,C as Ao}from"./TransactionDetailScreen-CUNFX6ex.js";import{w as To}from"./withTransactionSidePanel-Bsk-acAb.js";import{h as Po,v as wo}from"./routePaths-aWjSXoc2.js";import{g as $e}from"./accountMappingHelper-DWvcSK1C.js";import{D as xo}from"./DrawerScreen-2PFFQiRL.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./decodeURIComponentSafe-OtMMCMcE.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]="533475d0-7ccc-4b78-a68c-2ccdcccc2863",t._sentryDebugIdIdentifier="sentry-dbid-533475d0-7ccc-4b78-a68c-2ccdcccc2863")}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,N=!1)=>{t(ke({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:N}))},[]),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-BNlilBXq.js";import Rn from"./NotFoundScreen-dTz3iSg6.js";import{a,b as Pt}from"./sentry-CH2pQ4tM.js";import{n as Fe,S as Dn}from"./mui-CnlqDSRv.js";import{h as re,l as wt,u as Ge,g as U,n as Un,i as rt,o as Fn,p as Le}from"./core-BeBBWfga.js";import{eQ as Re,PX as Bn,n1 as ke,fi as _n,qG as Vn,nj as xt,nE as Rt,PY as Dt,nO as On,PZ as Ut,nc as Mn,qc as jn,f1 as Ie,P_ as De,sM as Ft,BZ as Bt,P$ as _t,Q0 as Ln,pT as qe,LB as dt,LD as zn,jG as Qn,LE as $n,jN as Gn,cW as qn,tR as Ye,np as Vt,nT as Ue,Q1 as Yn,Ku as ut,Kt as Pe,Q2 as mt,k2 as Jn,Q3 as Nn,Q4 as Kn,Q5 as Hn,Q6 as Zn,nw as Wn,nh as de,nW as we,Q7 as Xn,Q8 as ea,Q9 as ta,o1 as na,jR as aa,jI as oa,Qa as sa,jQ as ht,LL as ca,Qb as ia,Qc as la,pP as ra,ps as da,nU as fe,pr as ze,Qd as ua,Qe as ma,ll as ha,bq as pa,lg as pt,l2 as ga,Qf as Ca,gQ as gt,fU as Sa,ld as Ia,vK as fa,Qg as ka,os as Ea,on as va,or as ya,oc as ba,Qh as Aa,f4 as Ot,nH as Ta,ns as Pa,fj as Ct,nY as wa,Qi as xa,nV as Mt,Qj as Ra,Qk as Da,Ql as Ua,Qm as Fa,Qn as St,p$ as Ba,pi as _a,Ks as Va,jP as Oa,Qo as Ma,Gv as ja,jO as La,jD as za,f3 as Qa,oT as jt,pa as $a,nS as It,nX as Ga,bE as qa,la as Ya,l7 as Ja,Qp as Na,ob as ft,p8 as kt,p6 as Ka,oY as Ha,oD as Za,p9 as Wa,Qq as Xa,Qr as eo,oH as to,Qs as no,ox as ao,oG as oo,oE as so,pd as co}from"./zeni-epic-state-5fEaVO5b.js";import{a as Lt,I as le,f as L,q as H,V as zt,Z as Qt,cB as io,z as Be,cC as lo,at as xe,cD as ro,aT as Et,B as $t,cE as uo,aq as Qe,O as mo,cF as ho,a1 as po,cG as go,Q as Co,cH as So,cI as Io,R as fo,d as ko,aN as Eo,b5 as vo,w as yo,cJ as bo}from"./index-RWsKop8i.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-BeZ-XlW0.js";import{c as vt,C as Ao}from"./TransactionDetailScreen-DnPYNeZ7.js";import{w as To}from"./withTransactionSidePanel-C4tDX_iT.js";import{h as Po,v as wo}from"./routePaths-BLCfZXKg.js";import{g as $e}from"./accountMappingHelper-DWvcSK1C.js";import{D as xo}from"./DrawerScreen-stWlc2vB.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./decodeURIComponentSafe-OtMMCMcE.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]="533475d0-7ccc-4b78-a68c-2ccdcccc2863",t._sentryDebugIdIdentifier="sentry-dbid-533475d0-7ccc-4b78-a68c-2ccdcccc2863")}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,N=!1)=>{t(ke({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:N}))},[]),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-BNlilBXq.js";import{a as r}from"./sentry-CH2pQ4tM.js";import{a2 as i,a3 as l,a4 as p,p as b}from"./index-DWCyzMUX.js";import"./mui-CnlqDSRv.js";import m from"./NotFoundScreen-CDTENjn3.js";import{l as c,u}from"./core-BeBBWfga.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]="962e43b2-96f5-4d4d-bf4b-69fb382a754a",e._sentryDebugIdIdentifier="sentry-dbid-962e43b2-96f5-4d4d-bf4b-69fb382a754a")}catch{}})();const _=()=>{const e=c(),a=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=b(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
1
+ import{j as s}from"./liveblocks-BNlilBXq.js";import{a as r}from"./sentry-CH2pQ4tM.js";import{a2 as i,a3 as l,a4 as p,p as b}from"./index-RWsKop8i.js";import"./mui-CnlqDSRv.js";import m from"./NotFoundScreen-dTz3iSg6.js";import{l as c,u}from"./core-BeBBWfga.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]="962e43b2-96f5-4d4d-bf4b-69fb382a754a",e._sentryDebugIdIdentifier="sentry-dbid-962e43b2-96f5-4d4d-bf4b-69fb382a754a")}catch{}})();const _=()=>{const e=c(),a=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=b(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-CH2pQ4tM.js";import{h as l,l as f,u as m}from"./core-BeBBWfga.js";import{gx as p,JH as g,JI as _}from"./zeni-epic-state-5fEaVO5b.js";import{u as b,L as h,z as y}from"./index-DWCyzMUX.js";import"./liveblocks-BNlilBXq.js";import"./recharts-C5E4pGR4.js";import"./mui-CnlqDSRv.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="c79c3850-dde0-4ee5-927c-1b14a6cf997f",e._sentryDebugIdIdentifier="sentry-dbid-c79c3850-dde0-4ee5-927c-1b14a6cf997f")}catch{}})();function C(){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"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
1
+ import{a as r}from"./sentry-CH2pQ4tM.js";import{h as l,l as f,u as m}from"./core-BeBBWfga.js";import{gx as p,JH as g,JI as _}from"./zeni-epic-state-5fEaVO5b.js";import{u as b,L as h,z as y}from"./index-RWsKop8i.js";import"./liveblocks-BNlilBXq.js";import"./recharts-C5E4pGR4.js";import"./mui-CnlqDSRv.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="c79c3850-dde0-4ee5-927c-1b14a6cf997f",e._sentryDebugIdIdentifier="sentry-dbid-c79c3850-dde0-4ee5-927c-1b14a6cf997f")}catch{}})();function C(){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"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-BNlilBXq.js";import{i as S,n as x,l as C,u as y,h as ee,s as te,g as E,N as ae,o as ne,p}from"./core-BeBBWfga.js";import{JA as k,JB as v,JC as T,zA as B,zm as G,JD as D,JE as oe,JF as se,zq as ie,eU as $,zx as le,zu as re}from"./zeni-epic-state-5fEaVO5b.js";import{K as g,o as r,k as de,f as j,j as J,_ as ce,p as me,n as pe,q as H,a as ue,I as he,r as xe,R as ge,m as fe,s as we,B as be,v as Se,T as ye,S as ke,G as ve,w as je,x as $e}from"./index-DWCyzMUX.js";import{n as m}from"./mui-CnlqDSRv.js";import f from"./NotFoundScreen-CDTENjn3.js";import{a as I}from"./sentry-CH2pQ4tM.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="77d95c34-a05f-46c2-bec4-c06808d3f1b3",e._sentryDebugIdIdentifier="sentry-dbid-77d95c34-a05f-46c2-bec4-c06808d3f1b3")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-BNlilBXq.js";import{i as S,n as x,l as C,u as y,h as ee,s as te,g as E,N as ae,o as ne,p}from"./core-BeBBWfga.js";import{JA as k,JB as v,JC as T,zA as B,zm as G,JD as D,JE as oe,JF as se,zq as ie,eU as $,zx as le,zu as re}from"./zeni-epic-state-5fEaVO5b.js";import{K as g,o as r,k as de,f as j,j as J,_ as ce,p as me,n as pe,q as H,a as ue,I as he,r as xe,R as ge,m as fe,s as we,B as be,v as Se,T as ye,S as ke,G as ve,w as je,x as $e}from"./index-RWsKop8i.js";import{n as m}from"./mui-CnlqDSRv.js";import f from"./NotFoundScreen-dTz3iSg6.js";import{a as I}from"./sentry-CH2pQ4tM.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="77d95c34-a05f-46c2-bec4-c06808d3f1b3",e._sentryDebugIdIdentifier="sentry-dbid-77d95c34-a05f-46c2-bec4-c06808d3f1b3")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;