@zeniai/web-app-ui 5.0.9-dev → 5.0.9-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/assets/{AddressRoutes-CL334upZ.js → AddressRoutes-BBrnt8gl.js} +1 -1
  2. package/dist/assets/{AddressScreen-Dnqvk39f.js → AddressScreen-CDhIDDwp.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-DZh-dzaC.js → AiCfoScreen-BMO5rEJv.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-Dks0BYHS.js → BillPayApprovalRoutes-CJE_IX4Q.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DyYN5q_F.js → BillPayRoutes-BVpwpJeS.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DbNtBlq9.js → BusinessVerificationPageScreen-Dxwunudy.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-DDzL8gpY.js → ChargeCardRoutes-DFsJs27j.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-CtaJgM_D.js → CompanyPassportScreen-BJMMhtCv.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-BwirMqZq.js → ConnectionAuthScreen-CJFQNtT-.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-DSGPVAAz.js → CustomerOnboardingAuthScreen-D_RI0hgb.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-5AwlPOlH.js → CustomerOnboardingRoutes-DvOoPfWt.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-BPkQitQx.js → DashboardRoutes-CvNE50xa.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-D_Gz32KF.js → DefaultTenantHome-CQerPq3w.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-Cet8eqve.js → DomesticWireDetailScreen-DS0jhd8K.js} +1 -1
  15. package/dist/assets/{DrawerScreen-C5Pyoiiy.js → DrawerScreen-CjkZs0Cy.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-CVOtLlxx.js → EntityDetailRoutes-BsX1LVY_.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-D-ShrGPq.js → ExpenseAutomationRoutes-B_atYPpu.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-Esm95F3O.js → FeaturePreviewScreen-C7kdCQc-.js} +1 -1
  19. package/dist/assets/{MagicLinkRoutes-CWz8FVdT.js → MagicLinkRoutes-BiIIoUL2.js} +1 -1
  20. package/dist/assets/{MagicLinkSignInScreen-Dy9ZVfaY.js → MagicLinkSignInScreen-B8aDnqqY.js} +1 -1
  21. package/dist/assets/{MobileAppDrawer-DVs4kZOY.js → MobileAppDrawer-C1oJKBTP.js} +1 -1
  22. package/dist/assets/{NotFoundScreen-C3zjg2pa.js → NotFoundScreen-Bi7CPczJ.js} +1 -1
  23. package/dist/assets/{NotificationRoutes-CW6WHRSZ.js → NotificationRoutes-Beu1xrKN.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-JcUTTxdM.js → PandLWithForecastRoutes-Ov1Y7At7.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-B-S9keOO.js → PeopleRoutes-CS4AyLI0.js} +1 -1
  26. package/dist/assets/{PerformanceRoutes-CNYDT1z6.js → PerformanceRoutes-DKTQsu_Y.js} +1 -1
  27. package/dist/assets/{QBOConnectionScreen-CoK1XecU.js → QBOConnectionScreen-ZEEwbiGa.js} +1 -1
  28. package/dist/assets/{ReferralListScreen-H3ugCkel.js → ReferralListScreen-D3bgC_4v.js} +1 -1
  29. package/dist/assets/{ReimbursementApprovalRoutes-BU7MjFhQ.js → ReimbursementApprovalRoutes-BY3O294s.js} +1 -1
  30. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BcC01mNe.js → ReimbursementApprovalRuleDetailScreen-11PK2nAa.js} +1 -1
  31. package/dist/assets/{ReimbursementRoutes-D3zYz8wy.js → ReimbursementRoutes-DbgdD1EK.js} +1 -1
  32. package/dist/assets/{ReportsRoutes-CljixoPv.js → ReportsRoutes-BKtpC9XB.js} +1 -1
  33. package/dist/assets/{RewardsRoutes-dtSU2rm8.js → RewardsRoutes-CQaq7ndw.js} +1 -1
  34. package/dist/assets/{ScreenRoutes-98svW53l.js → ScreenRoutes-DroUcwmE.js} +2 -2
  35. package/dist/assets/{SettingsRoutes-otH5iG80.js → SettingsRoutes-COEmh4Di.js} +1 -1
  36. package/dist/assets/{SetupPagesScreen-BXNBjv3j.js → SetupPagesScreen-D282hX_7.js} +1 -1
  37. package/dist/assets/{SignInScreen-YVvbAXIF.js → SignInScreen-AtppA5UF.js} +1 -1
  38. package/dist/assets/{SignOutScreen-CvxeJUO0.js → SignOutScreen-CtvSHFvd.js} +1 -1
  39. package/dist/assets/{TaskListScreen-DBwhGgZH.js → TaskListScreen-DCBibdTK.js} +1 -1
  40. package/dist/assets/{TaskRoutes-D21v8ON-.js → TaskRoutes-BYGYaLzj.js} +1 -1
  41. package/dist/assets/{TransactionDetailRoutes-BwPxRt-X.js → TransactionDetailRoutes-C90gjzCq.js} +1 -1
  42. package/dist/assets/{TransactionDetailScreen-v_iRnLm6.js → TransactionDetailScreen-Dy0Z71fZ.js} +1 -1
  43. package/dist/assets/{TransactionListRoutes-DelEkqAU.js → TransactionListRoutes-i0dmIphX.js} +1 -1
  44. package/dist/assets/{TreasuryRoutes-DkznvHgV.js → TreasuryRoutes-ByB56Bdd.js} +1 -1
  45. package/dist/assets/{VendorsRoutes-CmyeEzqo.js → VendorsRoutes-BcMQFhN_.js} +1 -1
  46. package/dist/assets/{WiseConfirmationScreen-wKVEK2GQ.js → WiseConfirmationScreen-DnEE5EHJ.js} +1 -1
  47. package/dist/assets/{ZeniAccountRoutes-XGCXjBgv.js → ZeniAccountRoutes-BF2T4rC9.js} +1 -1
  48. package/dist/assets/{ZeniAccountStatementScreen-BxqDty2m.js → ZeniAccountStatementScreen-BEhzvl9P.js} +1 -1
  49. package/dist/assets/{analyticsHelper-B5vDoHXs.js → analyticsHelper-DbL2hXxT.js} +1 -1
  50. package/dist/assets/{getLocaleForTenant-BE1pHVDh.js → getLocaleForTenant-m4i18THA.js} +1 -1
  51. package/dist/assets/{index-CMN0VTWt.js → index-WqxyGdxr.js} +5 -5
  52. package/dist/assets/{routePaths-tLvi4-VJ.js → routePaths-BUUPXGIP.js} +1 -1
  53. package/dist/assets/{useAskAiCfoHostNavButtonProps-CIv6_RmV.js → useAskAiCfoHostNavButtonProps-CnRBupY3.js} +1 -1
  54. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-Bpx2l830.js → useFetchSuggestedQuestionsWhenReady-CnxX7TBH.js} +1 -1
  55. package/dist/assets/{useInitialThreadRequest-guWm_-78.js → useInitialThreadRequest-BliXhJGz.js} +1 -1
  56. package/dist/assets/{withTransactionSidePanel-lvb3ni_e.js → withTransactionSidePanel-9qBDBkF1.js} +1 -1
  57. package/dist/index.html +1 -1
  58. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-BOEQeN-H.js";import{A as d}from"./AddressScreen-Dnqvk39f.js";import i from"./NotFoundScreen-C3zjg2pa.js";import"./sentry-BcE91o8k.js";import{n as s,o as r}from"./core-BxynaUfL.js";import"./zeni-epic-state-C9u4BvTm.js";import"./recharts-DFfCUpO3.js";import"./index-CMN0VTWt.js";import"./mui-D7DqO3YQ.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.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]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}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-BOEQeN-H.js";import{A as d}from"./AddressScreen-CDhIDDwp.js";import i from"./NotFoundScreen-Bi7CPczJ.js";import"./sentry-BcE91o8k.js";import{n as s,o as r}from"./core-BxynaUfL.js";import"./zeni-epic-state-C9u4BvTm.js";import"./recharts-DFfCUpO3.js";import"./index-WqxyGdxr.js";import"./mui-D7DqO3YQ.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.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]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}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-BOEQeN-H.js";import{a as h}from"./sentry-BcE91o8k.js";import{j as P,h as _,u as j,l as E,g as $,k as M}from"./core-BxynaUfL.js";import{J as B,h as D,z as L,S as K,w as N,x as R,c as I,f as m,N as z,k as b,q as F}from"./index-CMN0VTWt.js";import{IZ as C,gI as U,eM as q,I_ as G,b$ as O,I$ as V,k2 as H}from"./zeni-epic-state-C9u4BvTm.js";import{n as J}from"./mui-D7DqO3YQ.js";import Z from"./NotFoundScreen-C3zjg2pa.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]="86a740f4-f3ff-4988-9b1e-64c849c298b5",e._sentryDebugIdIdentifier="sentry-dbid-86a740f4-f3ff-4988-9b1e-64c849c298b5")}catch{}})();const Q=J.div`
1
+ import{j as d}from"./liveblocks-BOEQeN-H.js";import{a as h}from"./sentry-BcE91o8k.js";import{j as P,h as _,u as j,l as E,g as $,k as M}from"./core-BxynaUfL.js";import{J as B,h as D,z as L,S as K,w as N,x as R,c as I,f as m,N as z,k as b,q as F}from"./index-WqxyGdxr.js";import{IZ as C,gI as U,eM as q,I_ as G,b$ as O,I$ as V,k2 as H}from"./zeni-epic-state-C9u4BvTm.js";import{n as J}from"./mui-D7DqO3YQ.js";import Z from"./NotFoundScreen-Bi7CPczJ.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]="86a740f4-f3ff-4988-9b1e-64c849c298b5",e._sentryDebugIdIdentifier="sentry-dbid-86a740f4-f3ff-4988-9b1e-64c849c298b5")}catch{}})();const Q=J.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as S}from"./liveblocks-BOEQeN-H.js";import{a as i}from"./sentry-BcE91o8k.js";import{h as ee,j as te,u as se,g as B,l as ae,k as ne}from"./core-BxynaUfL.js";import{O as oe,cB as ie,z as re,J as le,cC as ce,cD as ue,cE as $,x as de,c as _,T as R,cF as me,cG as fe,f as pe,a1 as he,cH as Se,U as ge,r as Ce,q as we,cI as Ie,cJ as ke}from"./index-CMN0VTWt.js";import{fE as be,f3 as q,eM as Ee,hm as Te,Pv as ye,eL as Pe,hw as _e,hs as xe,fu as ve,fo as Qe,fh as Ae,fl as j,fp as Oe,fq as Fe,fr as De,fs as Le,ft as Me}from"./zeni-epic-state-C9u4BvTm.js";import{D as Ue,n as x,P as Be,S as Re}from"./mui-D7DqO3YQ.js";import{p as je}from"./pathToGoBack-5wx41ypO.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="5cba84d2-e568-4335-9887-40e9307502e9",a._sentryDebugIdIdentifier="sentry-dbid-5cba84d2-e568-4335-9887-40e9307502e9")}catch{}})();const N="chat-response-generated",$e=ne(function(a,r){const n=q(a),d=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&n.uiState.currentChatSessionId==null,aiCfoView:n,isSubmitting:d,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ge}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled}},function(a,r){const{location:n,currentTenant:d,userId:c,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===N&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=Fe(t.type),u=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,u);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,u,ke(h,s),t.metadata.message_id??null):_.trackAICFOChatAnswerGenerated(t.text,C?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,De(t.visualization?.type??"")??null,u,t.summarized_title,t.metadata.message_id??null),a(Le({chatSessionId:t.metadata.chat_session_id,responseType:m,fetchState:{fetchState:"Completed",error:void 0}})),a(Me({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(e,o,t,m)=>{e&&Ie(a,e,o,p,g,c,m,t)},updateCurrentInput:e=>{a(j(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(Oe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=we(n.state?.pathnameStackToGoBack),o=e.poppedPathname??je(1);f(o,{state:{...n.state,pathnameStackToGoBack:e.newStack}}),a(j(""))},togglePageView:()=>{f(`/${d.tenantEmailDomain}/dashboard`,{state:{...n.state,message:"open_ai_cfo_drawer"}})},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{f(-1)},onNewChatClick:()=>{p!=null&&a(Ae());const e=Ce(n.state?.pathnameStackToGoBack,n.pathname);f(`/${d.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{a(Qe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(he(Se)),rt=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:r}=oe(),n=ee(),d=te(),c=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(be())},[n]);const{customPageTitle:g}=ie(),e=B(l=>q(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),u=B(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ce({currentTenant:u,currentChatSessionId:s,aiCfoView:e}),h=c.state,w=h?.aiCfoInitialQuestion,v=!!h?.aiCfoShouldSubmit,[G,b]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||w==null||w===""||(b(w),E(v),Q.current=!0)},[w,v]);const H=i.useCallback(()=>{b(null),E(!1)},[]),A=i.useMemo(()=>new URLSearchParams(c.search),[c.search]),O=A.get("ref")??h?.aiCfoRef,T=A.get("emailRefId")??h?.aiCfoEmailRefId,F=i.useRef(!1);i.useEffect(()=>{F.current||O!=="month-end-email"||T==null||s!=null||o==null||(n(Te("controller",o.userId,T,"MONTH_END_EMAIL")),F.current=!0)},[O,T,s,n,o]);const I=e.uiState.lastContextMessage;i.useEffect(()=>{I!=null&&I!==""&&s!=null&&(b(I),E(!0),n(ye()))},[I,s,n]);const W=u.masterTOSInfo,k=W?.isMasterTOSAccepted??!1,{visitedSessions:D}=ue(s),y=e.fetchState,P=e.uiState.chatSessionsNextPageToken.hasMore||!e.uiState.chatSessionsFirstPageFetched,L=s!=null?e.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",M=s==null||(e.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),U=e.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:z}=$(U,s),J=z.length===0;i.useEffect(()=>{k||d("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[k]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...c.state}})},[s,t]),i.useEffect(()=>{t!=null&&s==null&&t!=="new_chat"&&t!=="explore"&&n(Pe({sessionId:t,agentId:"controller"}))},[]);const X=i.useMemo(()=>({events:D.map(l=>`private-chat-${l}.${N}`),eventCallback:(l,K,Z)=>Z.onEventReceived(l,K)}),[D]);if(i.useEffect(()=>{y!=="In-Progress"&&P&&n(_e())},[y,P,n]),i.useEffect(()=>{s!=null&&L!=="In-Progress"&&M&&o!=null&&y==="Completed"&&!P&&n(xe(s,o.userId))},[L,M,s,o,n]),o==null||t==null)throw Error("Can't access AI Controller page without signing in...");const Y=s!=null&&e.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return S.jsxs(Ne,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),R(m)&&C.drawerElement,S.jsx($e,{...X,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:U,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:c,isSubmitting:Y,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:u,emailLinkQuestion:G??void 0,autoSubmitEmailLinkQuestion:V,onEmailLinkQuestionProcessed:H,onMenuClick:R(m)?C.open:void 0,isFileUploadEnabled:a}),S.jsx(Ue,{anchor:"right",open:f,transitionDuration:250,PaperProps:{component:Ge,style:{width:`${me}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>p(!1),children:S.jsx(qe,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:k,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{k||u.userRoleId==null||n(ve(u.userRoleId)),p(!1)}})})})]})},qe=x(Re)`
1
+ import{j as S}from"./liveblocks-BOEQeN-H.js";import{a as i}from"./sentry-BcE91o8k.js";import{h as ee,j as te,u as se,g as B,l as ae,k as ne}from"./core-BxynaUfL.js";import{O as oe,cB as ie,z as re,J as le,cC as ce,cD as ue,cE as $,x as de,c as _,T as R,cF as me,cG as fe,f as pe,a1 as he,cH as Se,U as ge,r as Ce,q as we,cI as Ie,cJ as ke}from"./index-WqxyGdxr.js";import{fE as be,f3 as q,eM as Ee,hm as Te,Pv as ye,eL as Pe,hw as _e,hs as xe,fu as ve,fo as Qe,fh as Ae,fl as j,fp as Oe,fq as Fe,fr as De,fs as Le,ft as Me}from"./zeni-epic-state-C9u4BvTm.js";import{D as Ue,n as x,P as Be,S as Re}from"./mui-D7DqO3YQ.js";import{p as je}from"./pathToGoBack-5wx41ypO.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="5cba84d2-e568-4335-9887-40e9307502e9",a._sentryDebugIdIdentifier="sentry-dbid-5cba84d2-e568-4335-9887-40e9307502e9")}catch{}})();const N="chat-response-generated",$e=ne(function(a,r){const n=q(a),d=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&n.uiState.currentChatSessionId==null,aiCfoView:n,isSubmitting:d,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ge}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled}},function(a,r){const{location:n,currentTenant:d,userId:c,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===N&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=Fe(t.type),u=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,u);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,u,ke(h,s),t.metadata.message_id??null):_.trackAICFOChatAnswerGenerated(t.text,C?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,De(t.visualization?.type??"")??null,u,t.summarized_title,t.metadata.message_id??null),a(Le({chatSessionId:t.metadata.chat_session_id,responseType:m,fetchState:{fetchState:"Completed",error:void 0}})),a(Me({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(e,o,t,m)=>{e&&Ie(a,e,o,p,g,c,m,t)},updateCurrentInput:e=>{a(j(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(Oe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=we(n.state?.pathnameStackToGoBack),o=e.poppedPathname??je(1);f(o,{state:{...n.state,pathnameStackToGoBack:e.newStack}}),a(j(""))},togglePageView:()=>{f(`/${d.tenantEmailDomain}/dashboard`,{state:{...n.state,message:"open_ai_cfo_drawer"}})},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{f(-1)},onNewChatClick:()=>{p!=null&&a(Ae());const e=Ce(n.state?.pathnameStackToGoBack,n.pathname);f(`/${d.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{a(Qe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(he(Se)),rt=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:r}=oe(),n=ee(),d=te(),c=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(be())},[n]);const{customPageTitle:g}=ie(),e=B(l=>q(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),u=B(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ce({currentTenant:u,currentChatSessionId:s,aiCfoView:e}),h=c.state,w=h?.aiCfoInitialQuestion,v=!!h?.aiCfoShouldSubmit,[G,b]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||w==null||w===""||(b(w),E(v),Q.current=!0)},[w,v]);const H=i.useCallback(()=>{b(null),E(!1)},[]),A=i.useMemo(()=>new URLSearchParams(c.search),[c.search]),O=A.get("ref")??h?.aiCfoRef,T=A.get("emailRefId")??h?.aiCfoEmailRefId,F=i.useRef(!1);i.useEffect(()=>{F.current||O!=="month-end-email"||T==null||s!=null||o==null||(n(Te("controller",o.userId,T,"MONTH_END_EMAIL")),F.current=!0)},[O,T,s,n,o]);const I=e.uiState.lastContextMessage;i.useEffect(()=>{I!=null&&I!==""&&s!=null&&(b(I),E(!0),n(ye()))},[I,s,n]);const W=u.masterTOSInfo,k=W?.isMasterTOSAccepted??!1,{visitedSessions:D}=ue(s),y=e.fetchState,P=e.uiState.chatSessionsNextPageToken.hasMore||!e.uiState.chatSessionsFirstPageFetched,L=s!=null?e.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",M=s==null||(e.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),U=e.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:z}=$(U,s),J=z.length===0;i.useEffect(()=>{k||d("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[k]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...c.state}})},[s,t]),i.useEffect(()=>{t!=null&&s==null&&t!=="new_chat"&&t!=="explore"&&n(Pe({sessionId:t,agentId:"controller"}))},[]);const X=i.useMemo(()=>({events:D.map(l=>`private-chat-${l}.${N}`),eventCallback:(l,K,Z)=>Z.onEventReceived(l,K)}),[D]);if(i.useEffect(()=>{y!=="In-Progress"&&P&&n(_e())},[y,P,n]),i.useEffect(()=>{s!=null&&L!=="In-Progress"&&M&&o!=null&&y==="Completed"&&!P&&n(xe(s,o.userId))},[L,M,s,o,n]),o==null||t==null)throw Error("Can't access AI Controller page without signing in...");const Y=s!=null&&e.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return S.jsxs(Ne,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),R(m)&&C.drawerElement,S.jsx($e,{...X,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:U,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:c,isSubmitting:Y,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:u,emailLinkQuestion:G??void 0,autoSubmitEmailLinkQuestion:V,onEmailLinkQuestionProcessed:H,onMenuClick:R(m)?C.open:void 0,isFileUploadEnabled:a}),S.jsx(Ue,{anchor:"right",open:f,transitionDuration:250,PaperProps:{component:Ge,style:{width:`${me}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>p(!1),children:S.jsx(qe,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:k,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{k||u.userRoleId==null||n(ve(u.userRoleId)),p(!1)}})})})]})},qe=x(Re)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-BOEQeN-H.js";import{a as f}from"./sentry-BcE91o8k.js";import{j as U,u as j,h as B,g as v,N as $,k as T,l as L,n as O,o as h}from"./core-BxynaUfL.js";import{eM as N,Mg as R,LY as b,x5 as w,w$ as F,x3 as I,wU as M,L_ as W,wX as q,x7 as z,x6 as C}from"./zeni-epic-state-C9u4BvTm.js";import{h as P,z as k,w as V,a1 as X,bu as Y,aa as _,bv as G}from"./index-CMN0VTWt.js";import"./mui-D7DqO3YQ.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-BcC01mNe.js";import J from"./NotFoundScreen-C3zjg2pa.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]="52930c10-c22f-49aa-a01b-ee17735f4b17",e._sentryDebugIdIdentifier="sentry-dbid-52930c10-c22f-49aa-a01b-ee17735f4b17")}catch{}})();const x="bill-approval-rule-update",K=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(x)&&e(W(!1))},onBackClick:()=>{_(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(M(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(X(Y)),Q=()=>{const e=U(),o=j(),a=B(),[p,t]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(w())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(F(!0)))},[p,n,a]),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),a(I())),e("./new"))},[u,r,a]);const y={events:c.companyId!=null?[`private-${c.companyId}.${x}`]:[],eventCallback:(i,A,m)=>{i.endsWith(x)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...y})},Z=T(function(e,o){const a=b(e),p=a.billPaySetupApproverViewUpdateData?.type??"approval_create",t=p==="approval_create"&&a.allApprovalRules.length!==0;let u=a.allApprovalRules.length===0;return o.approvalRuleId&&(u=a.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:a,hideUpperBoundField:t,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:a,approvalUpdateDataView:p,approverViewData:t,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=!!H(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(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{a("../")}}})(G);function D(){const e=U(),o=B(),a=j(),{approvalRuleId:p}=L(),t=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(q(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),t==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:a})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Q,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-BOEQeN-H.js";import{a as f}from"./sentry-BcE91o8k.js";import{j as U,u as j,h as B,g as v,N as $,k as T,l as L,n as O,o as h}from"./core-BxynaUfL.js";import{eM as N,Mg as R,LY as b,x5 as w,w$ as F,x3 as I,wU as M,L_ as W,wX as q,x7 as z,x6 as C}from"./zeni-epic-state-C9u4BvTm.js";import{h as P,z as k,w as V,a1 as X,bu as Y,aa as _,bv as G}from"./index-WqxyGdxr.js";import"./mui-D7DqO3YQ.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-11PK2nAa.js";import J from"./NotFoundScreen-Bi7CPczJ.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]="52930c10-c22f-49aa-a01b-ee17735f4b17",e._sentryDebugIdIdentifier="sentry-dbid-52930c10-c22f-49aa-a01b-ee17735f4b17")}catch{}})();const x="bill-approval-rule-update",K=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(x)&&e(W(!1))},onBackClick:()=>{_(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(M(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(X(Y)),Q=()=>{const e=U(),o=j(),a=B(),[p,t]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(w())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(F(!0)))},[p,n,a]),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),a(I())),e("./new"))},[u,r,a]);const y={events:c.companyId!=null?[`private-${c.companyId}.${x}`]:[],eventCallback:(i,A,m)=>{i.endsWith(x)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...y})},Z=T(function(e,o){const a=b(e),p=a.billPaySetupApproverViewUpdateData?.type??"approval_create",t=p==="approval_create"&&a.allApprovalRules.length!==0;let u=a.allApprovalRules.length===0;return o.approvalRuleId&&(u=a.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:a,hideUpperBoundField:t,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:a,approvalUpdateDataView:p,approverViewData:t,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=!!H(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(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{a("../")}}})(G);function D(){const e=U(),o=B(),a=j(),{approvalRuleId:p}=L(),t=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(q(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),t==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:a})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Q,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BOEQeN-H.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as S}from"./core-BxynaUfL.js";import{eM as Z,Ly as Ge,bu as At,GA as ra,bn as xt,bC as ue,Lz as Bt,wp as Et,xz as Ue,wY as ca,bm as je,LA as da,LB as pa,b$ as ua,LC as ma,jm as Dt,LD as jt,LE as Tt,y8 as Oe,wE as Be,LF as ba,wd as it,LG as ha,Bk as ga,wh as ya,wn as Pt,LH as Ie,LI as Ne,xA as ze,LJ as Sa,LK as fa,xD as Ze,LL as Ia,xQ as va,LM as Ft,xk as ot,xp as ka,LN as wa,LO as pe,LP as Rt,LQ as Lt,LR as Vt,fG as Ca,wJ as Me,ct as $t,LS as Aa,gy as xa,LT as Ba,LU as Ea,eT as Ut,eR as Mt,LV as He,LW as Da,LX as ja,Jh as We,LY as Ta,Ji as ie,Jj as qe,LZ as Pa,L_ as Fa,L$ as Ra,xr as lt,xo as La,M0 as Va,M1 as $a,M2 as Ua,xa as Ma,M3 as _a,M4 as Ga,M5 as Oa,cN as _t,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vv as Za,M6 as Ha,B7 as Wa,Bd as qa,s2 as Ja,xB as Ka,yf as Qa,jK as fe,M7 as Ya,M8 as zt,kc as Xa,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M9 as tn,Ma as ve,ig as an,Mb as rt,Mc as nn,ik as on,iG as ln,yt as sn,Md as rn,k5 as cn,yj as dn,Me as ct,yn as pn,ys as un,yp as mn,yh as bn,Mf as Wt,wy as hn,Mg as gn,Mh as yn,fA as Sn,fz as fn,fy as In,jN as vn,k3 as dt,ke as kn,pB as wn,jW as Cn,yl as An,ir as xn,kj as Bn,Mi as En,ii as Dn,ps as jn,Mj as Tn,xg as Pn,bD as Fn,br as Rn,Ig as Ln,cL as Vn,cK as $n,cs as Un,cy as Mn}from"./zeni-epic-state-C9u4BvTm.js";import{h as me,z as L,S as ke,O as Je,i as oe,s as y,aI as Ee,w as ce,o as E,x as Te,c as j,b1 as _n,q as z,U as Ke,r as D,J as we,b2 as pt,b3 as ut,b4 as Gn,af as On,I as Nn,aC as zn,G as qt,D as Qe,K as Ye,b5 as Zn,ao as Jt,b6 as Hn,Q as Wn,f as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,v as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-CMN0VTWt.js";import{n as V,S as di}from"./mui-D7DqO3YQ.js";import{A as mt}from"./AddressScreen-Dnqvk39f.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-Cet8eqve.js";import{a as f}from"./sentry-BcE91o8k.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-CIv6_RmV.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-Bpx2l830.js";import{u as Yt}from"./useInitialThreadRequest-guWm_-78.js";import De from"./NotFoundScreen-C3zjg2pa.js";import{D as bi}from"./DrawerScreen-C5Pyoiiy.js";import{M as Xt}from"./MobileAppDrawer-DVs4kZOY.js";import{F as ea}from"./FeaturePreviewScreen-Esm95F3O.js";import{S as Re}from"./SetupPagesScreen-BXNBjv3j.js";import{B as hi}from"./BillPayApprovalRoutes-Dks0BYHS.js";import{FallBackRoute as gi}from"./ScreenRoutes-98svW53l.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./analyticsHelper-B5vDoHXs.js";import"./routePaths-tLvi4-VJ.js";import"./BusinessVerificationPageScreen-DbNtBlq9.js";import"./ReimbursementApprovalRuleDetailScreen-BcC01mNe.js";import"./getLocaleForTenant-BE1pHVDh.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]="a51f32ba-13dc-4e02-8ebf-ce2a8ec665cf",e._sentryDebugIdIdentifier="sentry-dbid-a51f32ba-13dc-4e02-8ebf-ce2a8ec665cf")}catch{}})();const yi=Y(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),p=ke(),o=v(w=>Z(w)),s=v(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,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(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Ge(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&M?_(!1):!p&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||p||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),p&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[k,M,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(p,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-BOEQeN-H.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as S}from"./core-BxynaUfL.js";import{eM as Z,Ly as Ge,bu as At,GA as ra,bn as xt,bC as ue,Lz as Bt,wp as Et,xz as Ue,wY as ca,bm as je,LA as da,LB as pa,b$ as ua,LC as ma,jm as Dt,LD as jt,LE as Tt,y8 as Oe,wE as Be,LF as ba,wd as it,LG as ha,Bk as ga,wh as ya,wn as Pt,LH as Ie,LI as Ne,xA as ze,LJ as Sa,LK as fa,xD as Ze,LL as Ia,xQ as va,LM as Ft,xk as ot,xp as ka,LN as wa,LO as pe,LP as Rt,LQ as Lt,LR as Vt,fG as Ca,wJ as Me,ct as $t,LS as Aa,gy as xa,LT as Ba,LU as Ea,eT as Ut,eR as Mt,LV as He,LW as Da,LX as ja,Jh as We,LY as Ta,Ji as ie,Jj as qe,LZ as Pa,L_ as Fa,L$ as Ra,xr as lt,xo as La,M0 as Va,M1 as $a,M2 as Ua,xa as Ma,M3 as _a,M4 as Ga,M5 as Oa,cN as _t,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vv as Za,M6 as Ha,B7 as Wa,Bd as qa,s2 as Ja,xB as Ka,yf as Qa,jK as fe,M7 as Ya,M8 as zt,kc as Xa,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M9 as tn,Ma as ve,ig as an,Mb as rt,Mc as nn,ik as on,iG as ln,yt as sn,Md as rn,k5 as cn,yj as dn,Me as ct,yn as pn,ys as un,yp as mn,yh as bn,Mf as Wt,wy as hn,Mg as gn,Mh as yn,fA as Sn,fz as fn,fy as In,jN as vn,k3 as dt,ke as kn,pB as wn,jW as Cn,yl as An,ir as xn,kj as Bn,Mi as En,ii as Dn,ps as jn,Mj as Tn,xg as Pn,bD as Fn,br as Rn,Ig as Ln,cL as Vn,cK as $n,cs as Un,cy as Mn}from"./zeni-epic-state-C9u4BvTm.js";import{h as me,z as L,S as ke,O as Je,i as oe,s as y,aI as Ee,w as ce,o as E,x as Te,c as j,b1 as _n,q as z,U as Ke,r as D,J as we,b2 as pt,b3 as ut,b4 as Gn,af as On,I as Nn,aC as zn,G as qt,D as Qe,K as Ye,b5 as Zn,ao as Jt,b6 as Hn,Q as Wn,f as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,v as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-WqxyGdxr.js";import{n as V,S as di}from"./mui-D7DqO3YQ.js";import{A as mt}from"./AddressScreen-CDhIDDwp.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-DS0jhd8K.js";import{a as f}from"./sentry-BcE91o8k.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-CnRBupY3.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-CnxX7TBH.js";import{u as Yt}from"./useInitialThreadRequest-BliXhJGz.js";import De from"./NotFoundScreen-Bi7CPczJ.js";import{D as bi}from"./DrawerScreen-CjkZs0Cy.js";import{M as Xt}from"./MobileAppDrawer-C1oJKBTP.js";import{F as ea}from"./FeaturePreviewScreen-C7kdCQc-.js";import{S as Re}from"./SetupPagesScreen-D282hX_7.js";import{B as hi}from"./BillPayApprovalRoutes-CJE_IX4Q.js";import{FallBackRoute as gi}from"./ScreenRoutes-DroUcwmE.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./analyticsHelper-DbL2hXxT.js";import"./routePaths-BUUPXGIP.js";import"./BusinessVerificationPageScreen-Dxwunudy.js";import"./ReimbursementApprovalRuleDetailScreen-11PK2nAa.js";import"./getLocaleForTenant-m4i18THA.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]="a51f32ba-13dc-4e02-8ebf-ce2a8ec665cf",e._sentryDebugIdIdentifier="sentry-dbid-a51f32ba-13dc-4e02-8ebf-ce2a8ec665cf")}catch{}})();const yi=Y(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),p=ke(),o=v(w=>Z(w)),s=v(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,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(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Ge(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&M?_(!1):!p&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||p||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),p&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[k,M,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(p,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function ki(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-BOEQeN-H.js";import{a as V}from"./sentry-BcE91o8k.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-BxynaUfL.js";import{S as ce,i as ue,aI as de,z,x as pe,c as B,aa as x,f as M,bq as le,ao as me,r as E,ap as P}from"./index-CMN0VTWt.js";import{M4 as fe,eM as G,rt as ye,GE as Se,xa as ge,zT as Ie,Cq as he,D3 as be,DY as De,Mr as Oe,Ms as Te,Mt as ke,Mu as Ce,Mv as Ve,I_ as we,Lt as Ae,Ja as Ne,k2 as _e,fA as ve,fz as Fe,fy as xe,pB as Me,ps as ze,pp as Be,jW as Ee,rC as Pe,rA as R,bB as L,rO as U,cr as Re}from"./zeni-epic-state-C9u4BvTm.js";import{n as Le}from"./mui-D7DqO3YQ.js";import{c as j}from"./routePaths-tLvi4-VJ.js";import{M as Ue}from"./MobileAppDrawer-DVs4kZOY.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]="53589fcb-1af8-4bd9-988c-c44c3050c7fc",e._sentryDebugIdIdentifier="sentry-dbid-53589fcb-1af8-4bd9-988c-c44c3050c7fc")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-BOEQeN-H.js";import{a as V}from"./sentry-BcE91o8k.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-BxynaUfL.js";import{S as ce,i as ue,aI as de,z,x as pe,c as B,aa as x,f as M,bq as le,ao as me,r as E,ap as P}from"./index-WqxyGdxr.js";import{M4 as fe,eM as G,rt as ye,GE as Se,xa as ge,zT as Ie,Cq as he,D3 as be,DY as De,Mr as Oe,Ms as Te,Mt as ke,Mu as Ce,Mv as Ve,I_ as we,Lt as Ae,Ja as Ne,k2 as _e,fA as ve,fz as Fe,fy as xe,pB as Me,ps as ze,pp as Be,jW as Ee,rC as Pe,rA as R,bB as L,rO as U,cr as Re}from"./zeni-epic-state-C9u4BvTm.js";import{n as Le}from"./mui-D7DqO3YQ.js";import{c as j}from"./routePaths-BUUPXGIP.js";import{M as Ue}from"./MobileAppDrawer-C1oJKBTP.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]="53589fcb-1af8-4bd9-988c-c44c3050c7fc",e._sentryDebugIdIdentifier="sentry-dbid-53589fcb-1af8-4bd9-988c-c44c3050c7fc")}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-BOEQeN-H.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Jt,o as te}from"./core-BxynaUfL.js";import{eM as ie,br as Be,NX as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NY as $e,NZ as $a,sI as Sa,ju as Ia,N_ as Aa,gy as ca,za as aa,zc as Ga,zd as Ya,jk as Ct,N$ as Ge,y_ as pt,O0 as Qt,O1 as Xt,z1 as wa,O2 as en,Mo as Pa,qU as ht,z7 as Za,gJ as an,O3 as ft,O4 as Ye,bp as tn,O5 as nn,fA as Ta,fz as Fa,zH as rn,fy as va,M4 as sn,O6 as gt,cN as bt,cJ as on,Mn as ua,Ah as cn,O7 as rt,zT as Oa,O8 as yt,Ai as dn,MO as ln,Aj as un,Bd as mn,s2 as Cn,B7 as pn,zs as St,zl as hn,O9 as fn,fM as gn,zB as It,zF as At,fL as bn,Oa as yn,A3 as Et,Ob as Sn,Oc as In,Od as An,zD as kt,zo as Dt,z4 as _t,zx as wt,zv as Pt,zz as En,zb as st,Oe as Tt,Of as xa,zQ as Ea,J3 as Ft,cK as Ka,Og as kn,Oh as Dn,Oi as _n,Oj as wn,zN as Ha,Aa as Pn,A6 as Tn,zJ as Fn,A8 as vn,z_ as On,A0 as xn,Ok as vt,Ag as Ot,GA as Bn,Ol as Ln,Om as Un,On as Rn,Oo as xt,Op as jn,AD as Nn,zS as Bt,zM as da,zR as Vn,Oq as Hn,Or as Mn,yX as zn,Os as Lt,Ot as Ut,Ou as $n,yZ as Gn,yY as ot,Ov as Yn,Ow as Zn,Ox as Kn,I$ as Wn,Oy as Wa,Oz as qn,vy as Rt,k2 as Jn,gz as Qn,AI as Xn,OA as jt,OB as er,AJ as ar,OC as tr,db as nr,sC as rr,Ay as sr,As as xe,bu as or,bC as ir,ct as cr,bD as dr,Ig as lr}from"./zeni-epic-state-C9u4BvTm.js";import{z as X,S as Ue,i as oe,s as Z,w as Ze,bU as Ba,c3 as ur,q as ve,c4 as mr,c5 as Cr,J as ma,aI as Fe,r as be,bb as qa,c6 as pr,G as Ca,k as La,h as Ja,c as J,D as Qa,c7 as hr,O as Nt,al as Xa,bn as Xe,c8 as Ma,c9 as fr,x as et,a1 as gr,ca as br,ao as Vt,U as za,Q as Ht,f as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as ja,v as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-CMN0VTWt.js";import{n as _e,D as zt,S as Or}from"./mui-D7DqO3YQ.js";import{a as c}from"./sentry-BcE91o8k.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Re,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Ur,S as it}from"./SetupPagesScreen-BXNBjv3j.js";import Ua from"./NotFoundScreen-C3zjg2pa.js";import{M as ha}from"./MobileAppDrawer-DVs4kZOY.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-CIv6_RmV.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-Bpx2l830.js";import{v as ct}from"./utils-BMw-tiy-.js";import{t as Rr}from"./AddressScreen-Dnqvk39f.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./analyticsHelper-B5vDoHXs.js";import"./routePaths-tLvi4-VJ.js";import"./BusinessVerificationPageScreen-DbNtBlq9.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]="689d7375-7d9a-4f11-9660-871dde427785",e._sentryDebugIdIdentifier="sentry-dbid-689d7375-7d9a-4f11-9660-871dde427785")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=X.getSignedInUser(),n=S(G=>ie(G)),u=Ue(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),R=d.chargeCard,M=R?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=R?.cardHolderUser?.userId,U=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=U?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",K=R?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||i===!1&&I===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,R,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:U?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(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}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=X.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ua,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=X.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Xt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),R=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:R}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=X.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),U=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(U,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,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:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Re(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
1
+ import{j as s}from"./liveblocks-BOEQeN-H.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Jt,o as te}from"./core-BxynaUfL.js";import{eM as ie,br as Be,NX as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NY as $e,NZ as $a,sI as Sa,ju as Ia,N_ as Aa,gy as ca,za as aa,zc as Ga,zd as Ya,jk as Ct,N$ as Ge,y_ as pt,O0 as Qt,O1 as Xt,z1 as wa,O2 as en,Mo as Pa,qU as ht,z7 as Za,gJ as an,O3 as ft,O4 as Ye,bp as tn,O5 as nn,fA as Ta,fz as Fa,zH as rn,fy as va,M4 as sn,O6 as gt,cN as bt,cJ as on,Mn as ua,Ah as cn,O7 as rt,zT as Oa,O8 as yt,Ai as dn,MO as ln,Aj as un,Bd as mn,s2 as Cn,B7 as pn,zs as St,zl as hn,O9 as fn,fM as gn,zB as It,zF as At,fL as bn,Oa as yn,A3 as Et,Ob as Sn,Oc as In,Od as An,zD as kt,zo as Dt,z4 as _t,zx as wt,zv as Pt,zz as En,zb as st,Oe as Tt,Of as xa,zQ as Ea,J3 as Ft,cK as Ka,Og as kn,Oh as Dn,Oi as _n,Oj as wn,zN as Ha,Aa as Pn,A6 as Tn,zJ as Fn,A8 as vn,z_ as On,A0 as xn,Ok as vt,Ag as Ot,GA as Bn,Ol as Ln,Om as Un,On as Rn,Oo as xt,Op as jn,AD as Nn,zS as Bt,zM as da,zR as Vn,Oq as Hn,Or as Mn,yX as zn,Os as Lt,Ot as Ut,Ou as $n,yZ as Gn,yY as ot,Ov as Yn,Ow as Zn,Ox as Kn,I$ as Wn,Oy as Wa,Oz as qn,vy as Rt,k2 as Jn,gz as Qn,AI as Xn,OA as jt,OB as er,AJ as ar,OC as tr,db as nr,sC as rr,Ay as sr,As as xe,bu as or,bC as ir,ct as cr,bD as dr,Ig as lr}from"./zeni-epic-state-C9u4BvTm.js";import{z as X,S as Ue,i as oe,s as Z,w as Ze,bU as Ba,c3 as ur,q as ve,c4 as mr,c5 as Cr,J as ma,aI as Fe,r as be,bb as qa,c6 as pr,G as Ca,k as La,h as Ja,c as J,D as Qa,c7 as hr,O as Nt,al as Xa,bn as Xe,c8 as Ma,c9 as fr,x as et,a1 as gr,ca as br,ao as Vt,U as za,Q as Ht,f as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as ja,v as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-WqxyGdxr.js";import{n as _e,D as zt,S as Or}from"./mui-D7DqO3YQ.js";import{a as c}from"./sentry-BcE91o8k.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Re,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Ur,S as it}from"./SetupPagesScreen-D282hX_7.js";import Ua from"./NotFoundScreen-Bi7CPczJ.js";import{M as ha}from"./MobileAppDrawer-C1oJKBTP.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-CnRBupY3.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-CnxX7TBH.js";import{v as ct}from"./utils-BMw-tiy-.js";import{t as Rr}from"./AddressScreen-CDhIDDwp.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./analyticsHelper-DbL2hXxT.js";import"./routePaths-BUUPXGIP.js";import"./BusinessVerificationPageScreen-Dxwunudy.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]="689d7375-7d9a-4f11-9660-871dde427785",e._sentryDebugIdIdentifier="sentry-dbid-689d7375-7d9a-4f11-9660-871dde427785")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=X.getSignedInUser(),n=S(G=>ie(G)),u=Ue(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),R=d.chargeCard,M=R?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=R?.cardHolderUser?.userId,U=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=U?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",K=R?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||i===!1&&I===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,R,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:U?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(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}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=X.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ua,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=X.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Xt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),R=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:R}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=X.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),U=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(U,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,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:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Re(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-BOEQeN-H.js";import{a as g}from"./sentry-BcE91o8k.js";import{j as w,h as x,u as k,l as T,g as O,k as E}from"./core-BxynaUfL.js";import{z as N,aZ as F,x as P,c as L,f as V,aa as b,a_ as j,ao as A,ap as B,r as U}from"./index-CMN0VTWt.js";import{eM as D,fC as M,rt as _,fx as R,b$ as z,Lt as G,bm as Y,pB as Z,pp as $,jW as q,lq as S,Lu as H,bB as W,cr as C,ly as J,lB as K}from"./zeni-epic-state-C9u4BvTm.js";import"./mui-D7DqO3YQ.js";import{c as Q}from"./routePaths-tLvi4-VJ.js";import{M as X}from"./MobileAppDrawer-DVs4kZOY.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new a.Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="9743363a-8987-413d-8b4d-ae11bc2e93db",a._sentryDebugIdIdentifier="sentry-dbid-9743363a-8987-413d-8b4d-ae11bc2e93db")}catch{}})();const ee=E(function(a){const n=R(a),i=N.getSignedInUser(),l=D(a),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&n.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(a.companyConfigState),t=a.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:n.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:n,allIndustries:e.companyIndustries??[],allNationalityCountries:t,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(a,n){const{companyId:i,currentTenant:l,navigate:c,location:p}=n,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let t=e.href;t.includes("http")||(t="https://".concat(t)),window.open(t,"_blank")},onSaveAll:()=>{a(K())},onAddressClick:e=>{const t=Q(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(t,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{a(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:t,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=t,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...t,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:t.industry.selectedOption,companyIndustryType:t.companyIndustryType?.selectedOption??void 0,companySubIndustry:t.subIndustry?.selectedOption??void 0,businessModel:t.businessModel.selectedOption??"",companySourceOfFunds:t.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:t.companySourceOfFundsDescription??void 0,countriesOfOperations:t.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:B(I))??[],transactionVolume:t.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:t.transactionVolumeDescription??void 0,regulatedStatus:t.regulatedStatus??void 0,regulatedStatusDescription:t.regulatedStatusDescription??void 0,usNexus:t.usNexus??void 0,usNexusTypes:t.usNexusTypes?.selectedOptions??[],purposeOfAccount:t.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:t.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?W(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};a(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{a(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{a(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=>{a(H(e))},onCompanyOfficerUpdated:e=>{a(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=>{a(q({files:e}))},onDeleteFile:e=>{a($(e))},onEditFileName:(e,t)=>{a(Z(e,t.split(".")[0]))}}})(j);function de(){const a=w(),n=x(),i=k(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),t=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||t!=="Not-Started"||d==null||(p(!0),n(M(d)))},[c,t,d,n]),g.useEffect(()=>{o==="Not-Started"&&n(_())},[o,n]);const u=s=>{e(s)},y=t==="Not-Started"||t==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&t==="Error"?m.jsx(F,{onGoHome:()=>a("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:a,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-BOEQeN-H.js";import{a as g}from"./sentry-BcE91o8k.js";import{j as w,h as x,u as k,l as T,g as O,k as E}from"./core-BxynaUfL.js";import{z as N,aZ as F,x as P,c as L,f as V,aa as b,a_ as j,ao as A,ap as B,r as U}from"./index-WqxyGdxr.js";import{eM as D,fC as M,rt as _,fx as R,b$ as z,Lt as G,bm as Y,pB as Z,pp as $,jW as q,lq as S,Lu as H,bB as W,cr as C,ly as J,lB as K}from"./zeni-epic-state-C9u4BvTm.js";import"./mui-D7DqO3YQ.js";import{c as Q}from"./routePaths-BUUPXGIP.js";import{M as X}from"./MobileAppDrawer-C1oJKBTP.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new a.Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="9743363a-8987-413d-8b4d-ae11bc2e93db",a._sentryDebugIdIdentifier="sentry-dbid-9743363a-8987-413d-8b4d-ae11bc2e93db")}catch{}})();const ee=E(function(a){const n=R(a),i=N.getSignedInUser(),l=D(a),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&n.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(a.companyConfigState),t=a.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:n.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:n,allIndustries:e.companyIndustries??[],allNationalityCountries:t,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(a,n){const{companyId:i,currentTenant:l,navigate:c,location:p}=n,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let t=e.href;t.includes("http")||(t="https://".concat(t)),window.open(t,"_blank")},onSaveAll:()=>{a(K())},onAddressClick:e=>{const t=Q(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(t,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{a(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:t,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=t,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...t,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:t.industry.selectedOption,companyIndustryType:t.companyIndustryType?.selectedOption??void 0,companySubIndustry:t.subIndustry?.selectedOption??void 0,businessModel:t.businessModel.selectedOption??"",companySourceOfFunds:t.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:t.companySourceOfFundsDescription??void 0,countriesOfOperations:t.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:B(I))??[],transactionVolume:t.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:t.transactionVolumeDescription??void 0,regulatedStatus:t.regulatedStatus??void 0,regulatedStatusDescription:t.regulatedStatusDescription??void 0,usNexus:t.usNexus??void 0,usNexusTypes:t.usNexusTypes?.selectedOptions??[],purposeOfAccount:t.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:t.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?W(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};a(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{a(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{a(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=>{a(H(e))},onCompanyOfficerUpdated:e=>{a(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=>{a(q({files:e}))},onDeleteFile:e=>{a($(e))},onEditFileName:(e,t)=>{a(Z(e,t.split(".")[0]))}}})(j);function de(){const a=w(),n=x(),i=k(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),t=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||t!=="Not-Started"||d==null||(p(!0),n(M(d)))},[c,t,d,n]),g.useEffect(()=>{o==="Not-Started"&&n(_())},[o,n]);const u=s=>{e(s)},y=t==="Not-Started"||t==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&t==="Error"?m.jsx(F,{onGoHome:()=>a("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:a,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-BOEQeN-H.js";import{a}from"./sentry-BcE91o8k.js";import{h as D,u as v,g as m,N as w}from"./core-BxynaUfL.js";import{Ic as A,eM as O,fj as _,mh as j,fJ as h,fi as U,eN as L,Ik as k}from"./zeni-epic-state-C9u4BvTm.js";import{u as F,z as u,L as b,D as $,o as H}from"./index-CMN0VTWt.js";import{n as z}from"./mui-D7DqO3YQ.js";import{t as R}from"./getLocaleForTenant-BE1pHVDh.js";import{g as P,Q as G}from"./QBOConnectionScreen-CoK1XecU.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./empty-BCapHP-3.js";import"./pdf-lib-DOPLrm4O.js";import"./index-0JOtcwRL.js";import"./url-Cr6I6Veb.js";import"./index-DxCK0Ves.js";import"./decodeURIComponentSafe-C4CdHegQ.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]="36d396b0-c6aa-48c6-bcba-a1bc747bebe9",t._sentryDebugIdIdentifier="sentry-dbid-36d396b0-c6aa-48c6-bcba-a1bc747bebe9")}catch{}})();const J=z.div`
1
+ import{j as C}from"./liveblocks-BOEQeN-H.js";import{a}from"./sentry-BcE91o8k.js";import{h as D,u as v,g as m,N as w}from"./core-BxynaUfL.js";import{Ic as A,eM as O,fj as _,mh as j,fJ as h,fi as U,eN as L,Ik as k}from"./zeni-epic-state-C9u4BvTm.js";import{u as F,z as u,L as b,D as $,o as H}from"./index-WqxyGdxr.js";import{n as z}from"./mui-D7DqO3YQ.js";import{t as R}from"./getLocaleForTenant-m4i18THA.js";import{g as P,Q as G}from"./QBOConnectionScreen-ZEEwbiGa.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./empty-BCapHP-3.js";import"./pdf-lib-DOPLrm4O.js";import"./index-0JOtcwRL.js";import"./url-Cr6I6Veb.js";import"./index-DxCK0Ves.js";import"./decodeURIComponentSafe-C4CdHegQ.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]="36d396b0-c6aa-48c6-bcba-a1bc747bebe9",t._sentryDebugIdIdentifier="sentry-dbid-36d396b0-c6aa-48c6-bcba-a1bc747bebe9")}catch{}})();const J=z.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -1 +1 @@
1
- import{j as d}from"./liveblocks-BOEQeN-H.js";import{z as n}from"./index-CMN0VTWt.js";import{g as p}from"./QBOConnectionScreen-CoK1XecU.js";import"./sentry-BcE91o8k.js";import{u as a,N as i}from"./core-BxynaUfL.js";import"./zeni-epic-state-C9u4BvTm.js";import"./recharts-DFfCUpO3.js";import"./mui-D7DqO3YQ.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./empty-BCapHP-3.js";import"./pdf-lib-DOPLrm4O.js";import"./index-0JOtcwRL.js";import"./url-Cr6I6Veb.js";import"./index-DxCK0Ves.js";import"./decodeURIComponentSafe-C4CdHegQ.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]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
1
+ import{j as d}from"./liveblocks-BOEQeN-H.js";import{z as n}from"./index-WqxyGdxr.js";import{g as p}from"./QBOConnectionScreen-ZEEwbiGa.js";import"./sentry-BcE91o8k.js";import{u as a,N as i}from"./core-BxynaUfL.js";import"./zeni-epic-state-C9u4BvTm.js";import"./recharts-DFfCUpO3.js";import"./mui-D7DqO3YQ.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./empty-BCapHP-3.js";import"./pdf-lib-DOPLrm4O.js";import"./index-0JOtcwRL.js";import"./url-Cr6I6Veb.js";import"./index-DxCK0Ves.js";import"./decodeURIComponentSafe-C4CdHegQ.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]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{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-BOEQeN-H.js";import{t as $e,A as Ce}from"./AddressScreen-Dnqvk39f.js";import ze from"./NotFoundScreen-C3zjg2pa.js";import{a as g}from"./sentry-BcE91o8k.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Me,n as Qe,o as M}from"./core-BxynaUfL.js";import{v as de,S as le,z as B,i as ue,h as qe,s as _,r as V,x as Y,c as N,w as je,f as W,ak as Je,J as Ke,al as Ie,k as te,am as Ze,an as ke,o as Ye,ao as He,ap as Ee,aq as We}from"./index-CMN0VTWt.js";import{bm as Xe,eM as ee,fb as et,eT as pe,eR as me,bu as tt,mf as at,f7 as nt,bL as ot,i_ as ae,j1 as ve,IY as st,bQ as it,b$ as ge,rH as he,rs as rt,J8 as X,rI as _e,GE as ct,k2 as Ue,J9 as Ve,Ja as dt,Jb as lt,Jc as ut,iY as pt,i$ as mt,ru as Be,rG as gt,bB as xe,cr as ht,rU as Te,pB as ft,pp as yt,jW as bt,fA as St,fz as Ct,fy as It,Jd as kt,rm as Et,rV as xt,rY as Tt,r$ as Ot,s5 as Pt,cR as At}from"./zeni-epic-state-C9u4BvTm.js";import{n as fe}from"./mui-D7DqO3YQ.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-CoK1XecU.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./empty-BCapHP-3.js";import"./pdf-lib-DOPLrm4O.js";import"./index-0JOtcwRL.js";import"./url-Cr6I6Veb.js";import"./index-DxCK0Ves.js";import"./decodeURIComponentSafe-C4CdHegQ.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]="d82a622d-091a-4e67-9dd1-6607b25a0fba",t._sentryDebugIdIdentifier="sentry-dbid-d82a622d-091a-4e67-9dd1-6607b25a0fba")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Je),jt=()=>{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(),h=Xe(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(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 j=pe(F,c),P=me(c),A=[],J=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(J===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{b(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)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(Y,{analytics:N,onLoad:l=>(K=>K.trackPageLoaded(W.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-BOEQeN-H.js";import{t as $e,A as Ce}from"./AddressScreen-CDhIDDwp.js";import ze from"./NotFoundScreen-Bi7CPczJ.js";import{a as g}from"./sentry-BcE91o8k.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Me,n as Qe,o as M}from"./core-BxynaUfL.js";import{v as de,S as le,z as B,i as ue,h as qe,s as _,r as V,x as Y,c as N,w as je,f as W,ak as Je,J as Ke,al as Ie,k as te,am as Ze,an as ke,o as Ye,ao as He,ap as Ee,aq as We}from"./index-WqxyGdxr.js";import{bm as Xe,eM as ee,fb as et,eT as pe,eR as me,bu as tt,mf as at,f7 as nt,bL as ot,i_ as ae,j1 as ve,IY as st,bQ as it,b$ as ge,rH as he,rs as rt,J8 as X,rI as _e,GE as ct,k2 as Ue,J9 as Ve,Ja as dt,Jb as lt,Jc as ut,iY as pt,i$ as mt,ru as Be,rG as gt,bB as xe,cr as ht,rU as Te,pB as ft,pp as yt,jW as bt,fA as St,fz as Ct,fy as It,Jd as kt,rm as Et,rV as xt,rY as Tt,r$ as Ot,s5 as Pt,cR as At}from"./zeni-epic-state-C9u4BvTm.js";import{n as fe}from"./mui-D7DqO3YQ.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-ZEEwbiGa.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./empty-BCapHP-3.js";import"./pdf-lib-DOPLrm4O.js";import"./index-0JOtcwRL.js";import"./url-Cr6I6Veb.js";import"./index-DxCK0Ves.js";import"./decodeURIComponentSafe-C4CdHegQ.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]="d82a622d-091a-4e67-9dd1-6607b25a0fba",t._sentryDebugIdIdentifier="sentry-dbid-d82a622d-091a-4e67-9dd1-6607b25a0fba")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Je),jt=()=>{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(),h=Xe(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(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 j=pe(F,c),P=me(c),A=[],J=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(J===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{b(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)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(Y,{analytics:N,onLoad:l=>(K=>K.trackPageLoaded(W.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as i}from"./liveblocks-BOEQeN-H.js";import{l as G,g as k,u as $,h as K,j as q,k as Z,n as We,o as D}from"./core-BxynaUfL.js";import{eM as j,Jt as Fe,bB as Ut,bp as de,KG as Ka,hO as Na,KH as Tt,KI as Ga,hR as Qe,KJ as we,KK as za,hW as $a,KL as wt,KM as qa,h_ as et,KN as xe,KO as Za,cN as at,KP as Ha,KQ as Ja,JN as Xa,iU as Wa,KR as Qa,bm as _e,KS as Yt,Jh as Q,bc as Vt,j6 as Kt,mp as Nt,iR as Gt,Jj as ee,Ji as z,KT as en,KU as tn,KV as zt,KW as pe,tx as ke,ty as ye,tV as ue,tP as te,tC as Se,KX as an,KY as nn,KZ as on,K_ as $t,K$ as he,L0 as sn,dF as Oe,q9 as qt,L1 as rn,L2 as cn,L3 as ln,L4 as nt,IE as ot,jm as st,u1 as rt,qh as dn,L5 as un,tz as xt,qc as ie,q8 as Zt,L6 as oe,L7 as mn,L8 as ct,ID as it,s9 as Ht,L9 as pn,La as hn,Lb as fn,Lc as lt,sm as gn,Ld as bn,tB as Dt,s8 as Jt,Le as se,Lf as Cn,bu as Xt,u5 as Wt,Lg as _n,Lh as kn,Li as yn,Lj as dt,u0 as Sn,Lk as vn,tA as Ft,u4 as Qt,Ll as re,Lm as In,Ln as An,Lo as ea,jb as ta,mm as aa,jg as na,mk as oa,mj as sa,mi as ra,rx as En,fb as Tn,cK as wn,cL as xn,mf as Dn,f7 as Fn,mv as On,Lp as Pn,D9 as Bn,Lq as Rn,Lr as jn,Ls as Ln,b5 as ut,eZ as Mn,gw as Un,fC as Yn,mq as Vn,iK as Kn,mn as Nn,ml as Gn,eT as zn,eR as $n}from"./zeni-epic-state-C9u4BvTm.js";import{z as B,U as H,r as F,c as S,D as N,aP as qn,O as Pe,x as ve,aQ as ca,f as Y,aR as Zn,S as Ie,aS as ia,i as mt,s as L,h as Hn,aT as Jn,aU as Xn,aV as Ae,aW as Wn,a as Qn,al as eo,aI as to,q as ao,Q as no,aX as oo,aY as ge}from"./index-CMN0VTWt.js";import{n as pt}from"./mui-D7DqO3YQ.js";import{a as _}from"./sentry-BcE91o8k.js";import{w as la}from"./withTransactionSidePanel-lvb3ni_e.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-tLvi4-VJ.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-CIv6_RmV.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-Bpx2l830.js";import Ce from"./NotFoundScreen-C3zjg2pa.js";import{t as ua}from"./analyticsHelper-B5vDoHXs.js";import{C as ro}from"./CompanyPassportScreen-CtaJgM_D.js";import{F as co}from"./FeaturePreviewScreen-Esm95F3O.js";import{R as io}from"./ReferralListScreen-H3ugCkel.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./TransactionDetailScreen-v_iRnLm6.js";import"./decodeURIComponentSafe-C4CdHegQ.js";import"./MobileAppDrawer-DVs4kZOY.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]="9f1d6141-c9d8-4a15-9df3-f9b02570b582",e._sentryDebugIdIdentifier="sentry-dbid-9f1d6141-c9d8-4a15-9df3-f9b02570b582")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(T=>T.tenantState.currentTenantId),u=k(T=>j(T)),{tenantEmailDomain:m}=G(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=K(),g=q(),f=k(T=>Ka(T,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Na(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((T,J)=>{p(Tt({sortKey:T,sortOrder:J}))},[]),A=_.useCallback(T=>{p(Tt({downloadState:T}))},[]),I=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(m!=null){const J=da({id:T.transactionId,type:T.transactionType},m);g(J);const Le=F(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Le}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(qn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(I=>Ga(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(we({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(we({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(we({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(we({selectedDate:I,agingDateSelectionType:x})),t(Qe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:E,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=G(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=K(),p=q(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),E=_.useCallback((x,T)=>{d(wt({sortKey:x,sortOrder:T}))},[]),R=_.useCallback(x=>{d(wt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const T=da({id:x.transactionId,type:x.transactionType},u);p(T);const J=F(m.state?.pathnameStackToGoBack,m.pathname);p(T,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(Zn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:E,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(A=>qa(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),E=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(Za({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:E,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Xa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Wa(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=Z(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:N.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=Z(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:N.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
1
+ import{j as i}from"./liveblocks-BOEQeN-H.js";import{l as G,g as k,u as $,h as K,j as q,k as Z,n as We,o as D}from"./core-BxynaUfL.js";import{eM as j,Jt as Fe,bB as Ut,bp as de,KG as Ka,hO as Na,KH as Tt,KI as Ga,hR as Qe,KJ as we,KK as za,hW as $a,KL as wt,KM as qa,h_ as et,KN as xe,KO as Za,cN as at,KP as Ha,KQ as Ja,JN as Xa,iU as Wa,KR as Qa,bm as _e,KS as Yt,Jh as Q,bc as Vt,j6 as Kt,mp as Nt,iR as Gt,Jj as ee,Ji as z,KT as en,KU as tn,KV as zt,KW as pe,tx as ke,ty as ye,tV as ue,tP as te,tC as Se,KX as an,KY as nn,KZ as on,K_ as $t,K$ as he,L0 as sn,dF as Oe,q9 as qt,L1 as rn,L2 as cn,L3 as ln,L4 as nt,IE as ot,jm as st,u1 as rt,qh as dn,L5 as un,tz as xt,qc as ie,q8 as Zt,L6 as oe,L7 as mn,L8 as ct,ID as it,s9 as Ht,L9 as pn,La as hn,Lb as fn,Lc as lt,sm as gn,Ld as bn,tB as Dt,s8 as Jt,Le as se,Lf as Cn,bu as Xt,u5 as Wt,Lg as _n,Lh as kn,Li as yn,Lj as dt,u0 as Sn,Lk as vn,tA as Ft,u4 as Qt,Ll as re,Lm as In,Ln as An,Lo as ea,jb as ta,mm as aa,jg as na,mk as oa,mj as sa,mi as ra,rx as En,fb as Tn,cK as wn,cL as xn,mf as Dn,f7 as Fn,mv as On,Lp as Pn,D9 as Bn,Lq as Rn,Lr as jn,Ls as Ln,b5 as ut,eZ as Mn,gw as Un,fC as Yn,mq as Vn,iK as Kn,mn as Nn,ml as Gn,eT as zn,eR as $n}from"./zeni-epic-state-C9u4BvTm.js";import{z as B,U as H,r as F,c as S,D as N,aP as qn,O as Pe,x as ve,aQ as ca,f as Y,aR as Zn,S as Ie,aS as ia,i as mt,s as L,h as Hn,aT as Jn,aU as Xn,aV as Ae,aW as Wn,a as Qn,al as eo,aI as to,q as ao,Q as no,aX as oo,aY as ge}from"./index-WqxyGdxr.js";import{n as pt}from"./mui-D7DqO3YQ.js";import{a as _}from"./sentry-BcE91o8k.js";import{w as la}from"./withTransactionSidePanel-9qBDBkF1.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-BUUPXGIP.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-CnRBupY3.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-CnxX7TBH.js";import Ce from"./NotFoundScreen-Bi7CPczJ.js";import{t as ua}from"./analyticsHelper-DbL2hXxT.js";import{C as ro}from"./CompanyPassportScreen-BJMMhtCv.js";import{F as co}from"./FeaturePreviewScreen-C7kdCQc-.js";import{R as io}from"./ReferralListScreen-D3bgC_4v.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./TransactionDetailScreen-Dy0Z71fZ.js";import"./decodeURIComponentSafe-C4CdHegQ.js";import"./MobileAppDrawer-C1oJKBTP.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]="9f1d6141-c9d8-4a15-9df3-f9b02570b582",e._sentryDebugIdIdentifier="sentry-dbid-9f1d6141-c9d8-4a15-9df3-f9b02570b582")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(T=>T.tenantState.currentTenantId),u=k(T=>j(T)),{tenantEmailDomain:m}=G(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=K(),g=q(),f=k(T=>Ka(T,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Na(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((T,J)=>{p(Tt({sortKey:T,sortOrder:J}))},[]),A=_.useCallback(T=>{p(Tt({downloadState:T}))},[]),I=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(m!=null){const J=da({id:T.transactionId,type:T.transactionType},m);g(J);const Le=F(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Le}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(qn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(I=>Ga(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(we({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(we({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(we({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(we({selectedDate:I,agingDateSelectionType:x})),t(Qe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:E,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=G(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=K(),p=q(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),E=_.useCallback((x,T)=>{d(wt({sortKey:x,sortOrder:T}))},[]),R=_.useCallback(x=>{d(wt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const T=da({id:x.transactionId,type:x.transactionType},u);p(T);const J=F(m.state?.pathnameStackToGoBack,m.pathname);p(T,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(Zn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:E,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(A=>qa(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),E=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(Za({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:E,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Xa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Wa(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=Z(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:N.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=Z(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:N.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-BOEQeN-H.js";import{a as u}from"./sentry-BcE91o8k.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-BxynaUfL.js";import{Ic as N,eM as _,fj as U,Id as L,mh as R,Ie as z}from"./zeni-epic-state-C9u4BvTm.js";import{u as j,z as f,L as T,t as S,D as O,b as $}from"./index-CMN0VTWt.js";import"./mui-D7DqO3YQ.js";import{t as P}from"./getLocaleForTenant-BE1pHVDh.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.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]="6edb8790-83dc-44ea-9d73-f957931ec959",t._sentryDebugIdIdentifier="sentry-dbid-6edb8790-83dc-44ea-9d73-f957931ec959")}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,I=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,I=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:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>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&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.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,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-BOEQeN-H.js";import{a as u}from"./sentry-BcE91o8k.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-BxynaUfL.js";import{Ic as N,eM as _,fj as U,Id as L,mh as R,Ie as z}from"./zeni-epic-state-C9u4BvTm.js";import{u as j,z as f,L as T,t as S,D as O,b as $}from"./index-WqxyGdxr.js";import"./mui-D7DqO3YQ.js";import{t as P}from"./getLocaleForTenant-m4i18THA.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.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]="6edb8790-83dc-44ea-9d73-f957931ec959",t._sentryDebugIdIdentifier="sentry-dbid-6edb8790-83dc-44ea-9d73-f957931ec959")}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,I=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,I=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:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>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&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.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,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BOEQeN-H.js";import{j as w,u as C,g as h,k as A,l as V}from"./core-BxynaUfL.js";import{Ma as k,Mh as _,fA as J,fz as q,fy as L,ii as W,Ji as K,ps as Q,eM as B,LI as D,ig as T,Mb as S,Mk as F,id as G,iC as j}from"./zeni-epic-state-C9u4BvTm.js";import{bj as X,J as R,i as N,z as U,h as M,q as p,s as v,w as z,bk as Y,o as O,bl as ee,r as te}from"./index-CMN0VTWt.js";import{n as Z}from"./mui-D7DqO3YQ.js";import"./sentry-BcE91o8k.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]="30b007a2-cc8a-4b85-a5c4-faa51b803160",e._sentryDebugIdIdentifier="sentry-dbid-30b007a2-cc8a-4b85-a5c4-faa51b803160")}catch{}})();const ae=A(null,function(e,t){return{onSaveVendor:a=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(K("common")),a!=null&&e(Q(a))},onGetOtp:a=>{e(L(a,"BillPayVendor"))},onResendOtp:a=>{e(q(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(J(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(_(a,n,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=Z.div`
1
+ import{j as l}from"./liveblocks-BOEQeN-H.js";import{j as w,u as C,g as h,k as A,l as V}from"./core-BxynaUfL.js";import{Ma as k,Mh as _,fA as J,fz as q,fy as L,ii as W,Ji as K,ps as Q,eM as B,LI as D,ig as T,Mb as S,Mk as F,id as G,iC as j}from"./zeni-epic-state-C9u4BvTm.js";import{bj as X,J as R,i as N,z as U,h as M,q as p,s as v,w as z,bk as Y,o as O,bl as ee,r as te}from"./index-WqxyGdxr.js";import{n as Z}from"./mui-D7DqO3YQ.js";import"./sentry-BcE91o8k.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]="30b007a2-cc8a-4b85-a5c4-faa51b803160",e._sentryDebugIdIdentifier="sentry-dbid-30b007a2-cc8a-4b85-a5c4-faa51b803160")}catch{}})();const ae=A(null,function(e,t){return{onSaveVendor:a=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(K("common")),a!=null&&e(Q(a))},onGetOtp:a=>{e(L(a,"BillPayVendor"))},onResendOtp:a=>{e(q(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(J(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(_(a,n,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=Z.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-BOEQeN-H.js";import{J as l,G as f,h as c}from"./index-CMN0VTWt.js";import{D as p}from"./mui-D7DqO3YQ.js";import"./sentry-BcE91o8k.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]="e1d2d06e-3e55-4e69-a663-4d50f5b3d062",e._sentryDebugIdIdentifier="sentry-dbid-e1d2d06e-3e55-4e69-a663-4d50f5b3d062")}catch{}})();const u={drawerLeftMargin:new f(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:d}=e,n=l(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),a=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:d,children:t})}export{h as D};
1
+ import{j as i}from"./liveblocks-BOEQeN-H.js";import{J as l,G as f,h as c}from"./index-WqxyGdxr.js";import{D as p}from"./mui-D7DqO3YQ.js";import"./sentry-BcE91o8k.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]="e1d2d06e-3e55-4e69-a663-4d50f5b3d062",e._sentryDebugIdIdentifier="sentry-dbid-e1d2d06e-3e55-4e69-a663-4d50f5b3d062")}catch{}})();const u={drawerLeftMargin:new f(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:d}=e,n=l(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),a=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:d,children:t})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BOEQeN-H.js";import{a as d}from"./sentry-BcE91o8k.js";import{j as A,h as B,u as J,l as q,g as l,N as F,k as M,n as O,o as N}from"./core-BxynaUfL.js";import{Kp as _,eM as K,JO as R,km as W,Gw as I,Ku as Y,Jh as $,jm as z,Gx as S,JT as U,JU as V,Jj as H,Ji as L}from"./zeni-epic-state-C9u4BvTm.js";import{aM as Q,c as X,q as Z,r as tt}from"./index-CMN0VTWt.js";import"./mui-D7DqO3YQ.js";import{d as k}from"./decodeURIComponentSafe-C4CdHegQ.js";import{w as et}from"./withTransactionSidePanel-lvb3ni_e.js";import{e as at,b as nt}from"./routePaths-tLvi4-VJ.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./useAskAiCfoHostNavButtonProps-CIv6_RmV.js";import"./useFetchSuggestedQuestionsWhenReady-Bpx2l830.js";import"./TransactionDetailScreen-v_iRnLm6.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]="7e016723-9ecf-4fde-bfd4-1f3f2819ae45",a._sentryDebugIdIdentifier="sentry-dbid-7e016723-9ecf-4fde-bfd4-1f3f2819ae45")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(U()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=q(),r=k(j??""),f=k(x??""),p=rt(r,f),w=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(W(i)))},[m,p,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,v=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(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:b(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(O,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
1
+ import{j as s}from"./liveblocks-BOEQeN-H.js";import{a as d}from"./sentry-BcE91o8k.js";import{j as A,h as B,u as J,l as q,g as l,N as F,k as M,n as O,o as N}from"./core-BxynaUfL.js";import{Kp as _,eM as K,JO as R,km as W,Gw as I,Ku as Y,Jh as $,jm as z,Gx as S,JT as U,JU as V,Jj as H,Ji as L}from"./zeni-epic-state-C9u4BvTm.js";import{aM as Q,c as X,q as Z,r as tt}from"./index-WqxyGdxr.js";import"./mui-D7DqO3YQ.js";import{d as k}from"./decodeURIComponentSafe-C4CdHegQ.js";import{w as et}from"./withTransactionSidePanel-9qBDBkF1.js";import{e as at,b as nt}from"./routePaths-BUUPXGIP.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./useAskAiCfoHostNavButtonProps-CnRBupY3.js";import"./useFetchSuggestedQuestionsWhenReady-CnxX7TBH.js";import"./TransactionDetailScreen-Dy0Z71fZ.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]="7e016723-9ecf-4fde-bfd4-1f3f2819ae45",a._sentryDebugIdIdentifier="sentry-dbid-7e016723-9ecf-4fde-bfd4-1f3f2819ae45")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(U()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=q(),r=k(j??""),f=k(x??""),p=rt(r,f),w=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(W(i)))},[m,p,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,v=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(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:b(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(O,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BOEQeN-H.js";import un from"./NotFoundScreen-C3zjg2pa.js";import{a as l}from"./sentry-BcE91o8k.js";import{n as Te,D as St,S as ze}from"./mui-D7DqO3YQ.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Oe}from"./core-BxynaUfL.js";import{eM as $e,OI as pn,f0 as me,fe as gn,q3 as Cn,OJ as je,mI as ft,mO as kt,OK as Et,nb as Sn,OL as yt,mB as In,pB as fn,OM as kn,jy as En,ON as yn,Fx as vn,eY as Me,pg as vt,Kq as at,Ks as bn,jp as Tn,Kt as An,jw as Pn,cT as wn,t5 as Le,Jh as xn,jx as Rn,e_ as Dn,mP as bt,ng as be,ob as Tt,oK as Un,e$ as At,nf as ot,mG as ae,ni as Pt,nk as On,bB as Bn,kV as Fn,kS as _n,nj as Ee,nh as ue,OO as Vn,nA as st,Bd as wt,OP as xt,s2 as Rt,oG as jn,jm as Mn,OQ as Ln,Jj as ct,Ji as ke,OR as it,jN as zn,OS as $n,OT as Gn,OU as qn,OV as Jn,mY as Yn,OW as Kn,OX as Nn,OY as Zn,nq as Qn,jA as Hn,jr as Wn,OZ as Xn,jz as lt,KA as ea,O_ as ta,O$ as na,pc as aa,oT as oa,oS as Be,P0 as sa,P1 as ca,l4 as ia,bp as la,k$ as rt,kN as ra,P2 as da,gy as dt,fL as ua,kY as ma,u_ as ha,P3 as pa,nR as ga,nM as Ca,nQ as Sa,nB as Ia,P4 as fa,n4 as ka,mV as Ea,ff as ut,nl as ya,P5 as va,P6 as ba,P7 as Ta,P8 as Aa,P9 as Pa,Pa as mt,po as wa,oB as xa,ok as ht,ot as Ra,og as Da,oH as Ua,ol as Oa,Pb as Ba,Pc as Fa,n_ as _a,Pd as Va,nY as ja,nZ as Ma,nW as La,ov as za}from"./zeni-epic-state-C9u4BvTm.js";import{O as Dt,i as Ut,s as ye,c as M,r as Q,Q as Ot,cq as $a,h as Bt,z as Ae,cr as Ga,ao as ve,cs as qa,w as Ft,ct as Ja,cu as Ya,al as Fe,v as Ka,S as Na,aI as Za,cv as Qa,aZ as Ha,G as Wa,D as Xa,cw as eo,U as to,cx as no}from"./index-CMN0VTWt.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-CIv6_RmV.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-Bpx2l830.js";import{c as pt,C as ao}from"./TransactionDetailScreen-v_iRnLm6.js";import{w as oo}from"./withTransactionSidePanel-lvb3ni_e.js";import{h as so,v as co}from"./routePaths-tLvi4-VJ.js";import{g as _e}from"./accountMappingHelper-BmWub9rZ.js";import{D as io}from"./DrawerScreen-C5Pyoiiy.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./decodeURIComponentSafe-C4CdHegQ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="232faa57-52a8-4bbf-a5c0-3c4e807f6b5d",t._sentryDebugIdIdentifier="sentry-dbid-232faa57-52a8-4bbf-a5c0-3c4e807f6b5d")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),w=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:x}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,U=!1)=>{w(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:U}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),w(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=Q(y.state?.pathnameStackToGoBack,y.pathname),K=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Ot();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&w(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:x,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:K,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})})},ro=Te.div`
1
+ import{j as u}from"./liveblocks-BOEQeN-H.js";import un from"./NotFoundScreen-Bi7CPczJ.js";import{a as l}from"./sentry-BcE91o8k.js";import{n as Te,D as St,S as ze}from"./mui-D7DqO3YQ.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Oe}from"./core-BxynaUfL.js";import{eM as $e,OI as pn,f0 as me,fe as gn,q3 as Cn,OJ as je,mI as ft,mO as kt,OK as Et,nb as Sn,OL as yt,mB as In,pB as fn,OM as kn,jy as En,ON as yn,Fx as vn,eY as Me,pg as vt,Kq as at,Ks as bn,jp as Tn,Kt as An,jw as Pn,cT as wn,t5 as Le,Jh as xn,jx as Rn,e_ as Dn,mP as bt,ng as be,ob as Tt,oK as Un,e$ as At,nf as ot,mG as ae,ni as Pt,nk as On,bB as Bn,kV as Fn,kS as _n,nj as Ee,nh as ue,OO as Vn,nA as st,Bd as wt,OP as xt,s2 as Rt,oG as jn,jm as Mn,OQ as Ln,Jj as ct,Ji as ke,OR as it,jN as zn,OS as $n,OT as Gn,OU as qn,OV as Jn,mY as Yn,OW as Kn,OX as Nn,OY as Zn,nq as Qn,jA as Hn,jr as Wn,OZ as Xn,jz as lt,KA as ea,O_ as ta,O$ as na,pc as aa,oT as oa,oS as Be,P0 as sa,P1 as ca,l4 as ia,bp as la,k$ as rt,kN as ra,P2 as da,gy as dt,fL as ua,kY as ma,u_ as ha,P3 as pa,nR as ga,nM as Ca,nQ as Sa,nB as Ia,P4 as fa,n4 as ka,mV as Ea,ff as ut,nl as ya,P5 as va,P6 as ba,P7 as Ta,P8 as Aa,P9 as Pa,Pa as mt,po as wa,oB as xa,ok as ht,ot as Ra,og as Da,oH as Ua,ol as Oa,Pb as Ba,Pc as Fa,n_ as _a,Pd as Va,nY as ja,nZ as Ma,nW as La,ov as za}from"./zeni-epic-state-C9u4BvTm.js";import{O as Dt,i as Ut,s as ye,c as M,r as Q,Q as Ot,cq as $a,h as Bt,z as Ae,cr as Ga,ao as ve,cs as qa,w as Ft,ct as Ja,cu as Ya,al as Fe,v as Ka,S as Na,aI as Za,cv as Qa,aZ as Ha,G as Wa,D as Xa,cw as eo,U as to,cx as no}from"./index-WqxyGdxr.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-CnRBupY3.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-CnxX7TBH.js";import{c as pt,C as ao}from"./TransactionDetailScreen-Dy0Z71fZ.js";import{w as oo}from"./withTransactionSidePanel-9qBDBkF1.js";import{h as so,v as co}from"./routePaths-BUUPXGIP.js";import{g as _e}from"./accountMappingHelper-BmWub9rZ.js";import{D as io}from"./DrawerScreen-CjkZs0Cy.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.js";import"./decodeURIComponentSafe-C4CdHegQ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="232faa57-52a8-4bbf-a5c0-3c4e807f6b5d",t._sentryDebugIdIdentifier="sentry-dbid-232faa57-52a8-4bbf-a5c0-3c4e807f6b5d")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),w=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:x}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,U=!1)=>{w(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:U}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),w(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=Q(y.state?.pathnameStackToGoBack,y.pathname),K=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Ot();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&w(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:x,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:K,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})})},ro=Te.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BOEQeN-H.js";import{a as r}from"./sentry-BcE91o8k.js";import{X as i,Y as l,Z as p,q as m}from"./index-CMN0VTWt.js";import"./mui-D7DqO3YQ.js";import f from"./NotFoundScreen-C3zjg2pa.js";import{j as u,u as b}from"./core-BxynaUfL.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]="111e36ba-d76e-4111-8ecd-45c7ec984b77",e._sentryDebugIdIdentifier="sentry-dbid-111e36ba-d76e-4111-8ecd-45c7ec984b77")}catch{}})();const D=()=>{const e=u(),t=b(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(t.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(t.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:a,onGoBack:d}):s.jsx(f,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{D as F};
1
+ import{j as s}from"./liveblocks-BOEQeN-H.js";import{a as r}from"./sentry-BcE91o8k.js";import{X as i,Y as l,Z as p,q as m}from"./index-WqxyGdxr.js";import"./mui-D7DqO3YQ.js";import f from"./NotFoundScreen-Bi7CPczJ.js";import{j as u,u as b}from"./core-BxynaUfL.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]="111e36ba-d76e-4111-8ecd-45c7ec984b77",e._sentryDebugIdIdentifier="sentry-dbid-111e36ba-d76e-4111-8ecd-45c7ec984b77")}catch{}})();const D=()=>{const e=u(),t=b(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(t.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(t.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:a,onGoBack:d}):s.jsx(f,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{D as F};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-BOEQeN-H.js";import{l as w,k as x,j,u as y,h as Z,q as ee,g as A,N as te,n as ae,o as p}from"./core-BxynaUfL.js";import{Iu as S,Iv as k,Iw as z,yQ as $,yC as L,Ix as C,Iy as ne,Iz as oe,yG as ie,eN as I,yN as se,yK as le}from"./zeni-epic-state-C9u4BvTm.js";import{J as g,o as r,p as re,c as v,k as E,N as de,q as ce,B as me,r as F,i as pe,s as ue,E as he,v as xe,h as ge,w as be,x as fe,m as we,A as ye,F as Se,G as ke,H as ve}from"./index-CMN0VTWt.js";import{n as c}from"./mui-D7DqO3YQ.js";import b from"./NotFoundScreen-C3zjg2pa.js";import{a as N}from"./sentry-BcE91o8k.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.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]="2f3eb59b-a519-4277-9b1d-51d9193398db",e._sentryDebugIdIdentifier="sentry-dbid-2f3eb59b-a519-4277-9b1d-51d9193398db")}catch{}})();const Ie=c.div`
1
+ import{j as t}from"./liveblocks-BOEQeN-H.js";import{l as w,k as x,j,u as y,h as Z,q as ee,g as A,N as te,n as ae,o as p}from"./core-BxynaUfL.js";import{Iu as S,Iv as k,Iw as z,yQ as $,yC as L,Ix as C,Iy as ne,Iz as oe,yG as ie,eN as I,yN as se,yK as le}from"./zeni-epic-state-C9u4BvTm.js";import{J as g,o as r,p as re,c as v,k as E,N as de,q as ce,B as me,r as F,i as pe,s as ue,E as he,v as xe,h as ge,w as be,x as fe,m as we,A as ye,F as Se,G as ke,H as ve}from"./index-WqxyGdxr.js";import{n as c}from"./mui-D7DqO3YQ.js";import b from"./NotFoundScreen-Bi7CPczJ.js";import{a as N}from"./sentry-BcE91o8k.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.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]="2f3eb59b-a519-4277-9b1d-51d9193398db",e._sentryDebugIdIdentifier="sentry-dbid-2f3eb59b-a519-4277-9b1d-51d9193398db")}catch{}})();const Ie=c.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as f}from"./liveblocks-BOEQeN-H.js";import{a as u}from"./sentry-BcE91o8k.js";import{h as U,u as _,j as w,q as M,g as l,N as T}from"./core-BxynaUfL.js";import{z as r,h as P,D as V,e as A,c as N,f as q,C as R,m as W,g as $}from"./index-CMN0VTWt.js";import{eM as B,Ie as G,Ip as H,If as J,eN as K,fi as Q,Il as X,fF as Y,cR as Z,Iq as ee,Ir as te}from"./zeni-epic-state-C9u4BvTm.js";import{n as ne}from"./mui-D7DqO3YQ.js";import{u as se}from"./useDeviceId-L-TdNFYo.js";import{f as ae}from"./analyticsHelper-B5vDoHXs.js";import{t as ie}from"./getLocaleForTenant-BE1pHVDh.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.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]="5e3178c1-433c-483f-9a05-216ee2fdf7a1",t._sentryDebugIdIdentifier="sentry-dbid-5e3178c1-433c-483f-9a05-216ee2fdf7a1")}catch{}})();const C=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Ce(){const t=U(),a=_(),m=w(),[y]=M(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:D,magicLinkEmail:c,verifyDeviceFetchState:x,resendVerifyDeviceOTPFetchState:z}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),k=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;u.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&C(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),u.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,b,s,o,k,v,a.state,t]);const F=u.useCallback(()=>{m("/signin/auth")},[m]),j=u.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=u.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return f.jsx(R,{phoneNumber:D,verifyOtpFetchState:x.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:j,onVerifyOtp:O,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return f.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!C(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return f.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return f.jsx(oe,{"data-testid":"smooth-loader",children:f.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as f}from"./liveblocks-BOEQeN-H.js";import{a as u}from"./sentry-BcE91o8k.js";import{h as U,u as _,j as w,q as M,g as l,N as T}from"./core-BxynaUfL.js";import{z as r,h as P,D as V,e as A,c as N,f as q,C as R,m as W,g as $}from"./index-WqxyGdxr.js";import{eM as B,Ie as G,Ip as H,If as J,eN as K,fi as Q,Il as X,fF as Y,cR as Z,Iq as ee,Ir as te}from"./zeni-epic-state-C9u4BvTm.js";import{n as ne}from"./mui-D7DqO3YQ.js";import{u as se}from"./useDeviceId-L-TdNFYo.js";import{f as ae}from"./analyticsHelper-DbL2hXxT.js";import{t as ie}from"./getLocaleForTenant-m4i18THA.js";import"./recharts-DFfCUpO3.js";import"./analytics-Fp0p9zzF.js";import"./plaid-lowWm0fK.js";import"./dnd-DTmBUnLk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CHRWrHfY.js";import"./lexical-BgdBwfNo.js";import"./pdf-DEWT-QpZ.js";import"./utils-BMw-tiy-.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]="5e3178c1-433c-483f-9a05-216ee2fdf7a1",t._sentryDebugIdIdentifier="sentry-dbid-5e3178c1-433c-483f-9a05-216ee2fdf7a1")}catch{}})();const C=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Ce(){const t=U(),a=_(),m=w(),[y]=M(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:D,magicLinkEmail:c,verifyDeviceFetchState:x,resendVerifyDeviceOTPFetchState:z}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),k=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;u.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&C(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),u.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,b,s,o,k,v,a.state,t]);const F=u.useCallback(()=>{m("/signin/auth")},[m]),j=u.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=u.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return f.jsx(R,{phoneNumber:D,verifyOtpFetchState:x.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:j,onVerifyOtp:O,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return f.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!C(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return f.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return f.jsx(oe,{"data-testid":"smooth-loader",children:f.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;