@zeniai/web-app-ui 5.0.82-qa → 5.0.83-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/assets/AddressRoutes-JvTiiWK5.js +1 -0
  2. package/dist/assets/{AddressScreen-DYJtp3rR.js → AddressScreen-DT0Q15o7.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-16WuXbzR.js → AiCfoScreen-v5CVNL3j.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-BWMOAOlT.js → BillPayApprovalRoutes-BVQZfKuM.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-B09hsZxH.js → BillPayRoutes-BnuP6nVO.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-CUpYNJV1.js → BusinessVerificationPageScreen-CdptLI3O.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-CPTqfiRA.js → ChargeCardRoutes-D3SdjHvX.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-rc6B6jQO.js → CompanyPassportScreen-BSC4O5TV.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-tfuuBbmw.js → ConnectionAuthScreen-Dr1IfznG.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-YfK_o0qz.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-LGKmlzIc.js → CustomerOnboardingRoutes-BXabGwpN.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-C2ef-K95.js → DashboardRoutes-CvNojOn1.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-BT3Az_rt.js → DefaultTenantHome-BkycKg61.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BjQDaDck.js → DomesticWireDetailScreen-cxTAfHcb.js} +1 -1
  15. package/dist/assets/{DrawerScreen-DrwckvEs.js → DrawerScreen-C7_25xjY.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-BcSDilaM.js → EntityDetailRoutes-CQUv4fcU.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-BNDMkpzP.js → ExpenseAutomationRoutes-DMlkcAnN.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-SE_WbAPr.js → FeaturePreviewScreen-C38iY35s.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-DbE9LBTM.js → HubSpotOAuthCallbackScreen-453Cbbtd.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-0u_xoKBS.js → MagicLinkRoutes-CyBHzAa4.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-DTyecCfT.js → MagicLinkSignInScreen-DUAV5Zdq.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-BMQqN7ku.js → MobileAppDrawer-B5ryN7bV.js} +1 -1
  23. package/dist/assets/NotFoundScreen-CiYbMRBm.js +1 -0
  24. package/dist/assets/{NotificationRoutes-D5fQKI26.js → NotificationRoutes-DVeyMkq-.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-D-VtAnkb.js → OAuthConsentScreen-_8k8Mx_3.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-Dfu0OUnK.js → PandLWithForecastRoutes-C2_HmJpg.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-ByvnXmHE.js → PeopleRoutes-BP3GsUae.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-Edk_soJ0.js → PerformanceRoutes-Do9BajCP.js} +1 -1
  29. package/dist/assets/{Preview-7pvb10lj.js → Preview-Dk35mkO2.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-6XjCJ6tV.js → QBOConnectionScreen-D3T_HW3H.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-DEPmERTK.js → ReferralListScreen-BIW3RLSW.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-DzXpytre.js → ReimbursementApprovalRoutes-v95q9aWZ.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-EWELQ8Ed.js → ReimbursementApprovalRuleDetailScreen-DxQnj1Nr.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-Cg4HykVN.js → ReimbursementRoutes-_EXm0KMO.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-CvILior4.js → ReportsRoutes-C1AXA5Bz.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-DXyevwO9.js → RewardsRoutes-GXGSL_JR.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-BOiy-cJd.js → ScreenRoutes-BFCvivVX.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-DnYuO6Bo.js → SettingsRoutes-DtVKDqWM.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-DjVgUhrA.js → SetupPagesScreen-BbHEiKJR.js} +1 -1
  40. package/dist/assets/{SignInScreen-vp_2J5tg.js → SignInScreen-DsOYu6LX.js} +1 -1
  41. package/dist/assets/{SignOutScreen-Dd3ojPV4.js → SignOutScreen-BLqW2pDa.js} +1 -1
  42. package/dist/assets/{TaskListScreen-OGLjSMvV.js → TaskListScreen-BBtnIRpq.js} +1 -1
  43. package/dist/assets/{TaskRoutes-BIwNQ7xr.js → TaskRoutes-D8Wkm19g.js} +1 -1
  44. package/dist/assets/TransactionDetailRoutes-l-T5k5a_.js +1 -0
  45. package/dist/assets/{TransactionDetailScreen-DmjDqinu.js → TransactionDetailScreen-DBF06PeT.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-COI5Pcjz.js → TransactionListRoutes-BocCKVMK.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-zxlESFiz.js → TreasuryRoutes-B9p98adV.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-DKCtALRq.js → VendorsRoutes-D5Vv_W7I.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-BOtJtkdK.js → WiseConfirmationScreen-Br0VqiWX.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-DJ-aA7zo.js → ZeniAccountRoutes-D4wfXaC9.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-DhuEsjqw.js → ZeniAccountStatementScreen-C83btU9G.js} +1 -1
  52. package/dist/assets/{accountMappingHelper-BonLh9TQ.js → accountMappingHelper-DN2NK9FA.js} +1 -1
  53. package/dist/assets/{analytics-B4UJAsLA.js → analytics-B134UjSL.js} +1 -1
  54. package/dist/assets/{analyticsHelper-YeXzy43q.js → analyticsHelper-CRpkSjLL.js} +1 -1
  55. package/dist/assets/{core-BR1djmRq.js → core-B1Jz41nC.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-rU-V5qiY.js → decodeURIComponentSafe-HQbzOYEL.js} +1 -1
  57. package/dist/assets/{dnd-WGKE6-QR.js → dnd-DumzdahX.js} +1 -1
  58. package/dist/assets/{empty-Ojvc40D_.js → empty-ByyVwI2e.js} +1 -1
  59. package/dist/assets/{empty-fPNr7WEf.js → empty-oTLwTSll.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-CELRYPbu.js → emptyVideoElement-C6Cu7fXI.js} +1 -1
  61. package/dist/assets/{epic-qi_TA2Na.js → epic-BnAvJDb_.js} +1 -1
  62. package/dist/assets/{getLocaleForTenant-H-2L0ToN.js → getLocaleForTenant-D68g9mo1.js} +1 -1
  63. package/dist/assets/{index-FsVF33P-.js → index-B90Cr8bv.js} +1 -1
  64. package/dist/assets/{index-RLXxDu6p.js → index-C6t5Pm8y.js} +1 -1
  65. package/dist/assets/{index-GH_WOHnD.js → index-C8wkuIN5.js} +1 -1
  66. package/dist/assets/{index-Cp8OWlD9.js → index-DbMluP3a.js} +1 -1
  67. package/dist/assets/{index-C2lHPYmZ.js → index-DegTeG1R.js} +1 -1
  68. package/dist/assets/{index-DTNnwrfZ.js → index-DnoGJKuR.js} +7 -7
  69. package/dist/assets/{index-CjfIOV0m.js → index-Ve4RRM-O.js} +1 -1
  70. package/dist/assets/{index-BC1PrBTy.js → index-jkshGKhR.js} +2 -2
  71. package/dist/assets/{lexical-GYG14AuY.js → lexical-DsIUchFW.js} +1 -1
  72. package/dist/assets/{liveblocks-DNAiUJc8.js → liveblocks-Cjqg1XsV.js} +1 -1
  73. package/dist/assets/{lottie-CXwx4IFe.js → lottie-B-v1nIzb.js} +1 -1
  74. package/dist/assets/{mui-CgXDoZXy.js → mui-DSSmRxLI.js} +1 -1
  75. package/dist/assets/{pathToGoBack-oVjtOboc.js → pathToGoBack-DUiwH7Zn.js} +1 -1
  76. package/dist/assets/{pdf-B31DLhP9.js → pdf-SAu_SEbF.js} +3 -3
  77. package/dist/assets/{pdf-lib-BJaZbPRK.js → pdf-lib-DFDlNXnV.js} +1 -1
  78. package/dist/assets/{plaid-A3mYO1wj.js → plaid-H6p_O3yl.js} +1 -1
  79. package/dist/assets/{pusher-CUyOQlLA.js → pusher-fPmkj0tk.js} +1 -1
  80. package/dist/assets/{react-ByhUurzo.js → react-B5_vH0ZV.js} +1 -1
  81. package/dist/assets/{react-D0AyXc_c.js → react-BNA9zwlm.js} +1 -1
  82. package/dist/assets/{react-C9za7tht.js → react-CmgKrC8_.js} +1 -1
  83. package/dist/assets/{react-LoJfqmu-.js → react-CykgLUvo.js} +1 -1
  84. package/dist/assets/{react-C10xY9rt.js → react-Db4JNA42.js} +1 -1
  85. package/dist/assets/{react-ggLrwSum.js → react-OAg8acZB.js} +1 -1
  86. package/dist/assets/{recharts-DzRX0aWK.js → recharts-DW5j2-RD.js} +1 -1
  87. package/dist/assets/{routePaths-OfzBAr6P.js → routePaths-DBUEUOgS.js} +1 -1
  88. package/dist/assets/{sentry-3H-Lcjnl.js → sentry-DTwqiEdO.js} +1 -1
  89. package/dist/assets/{url-c0rW6TXY.js → url-CFX7crLz.js} +1 -1
  90. package/dist/assets/{url-0VTK57Fm.js → url-CQOi-x1h.js} +1 -1
  91. package/dist/assets/{useAskAiCfoHostNavButtonProps-1lbCkmvt.js → useAskAiCfoHostNavButtonProps-D1ncSYVo.js} +1 -1
  92. package/dist/assets/{useDeviceId-D7AFffaE.js → useDeviceId-DOSS9iCb.js} +1 -1
  93. package/dist/assets/{useFetchSuggestedQuestionsWhenReady--BxYx_7U.js → useFetchSuggestedQuestionsWhenReady-BD5FIrcH.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-DcJwlozW.js → useInitialThreadRequest-CPdwuo-t.js} +1 -1
  95. package/dist/assets/{utils-BrTYpNjH.js → utils-CCEyXo02.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-DiSHE4Oz.js → withTransactionSidePanel-75BTvZCV.js} +1 -1
  97. package/dist/assets/{zeni-epic-state-B1K_6mks.js → zeni-epic-state-CFJ-5drS.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +3 -3
  100. package/dist/assets/AddressRoutes-CuR_H9u-.js +0 -1
  101. package/dist/assets/CustomerOnboardingAuthScreen-b5dhjVHv.js +0 -1
  102. package/dist/assets/NotFoundScreen-BbHcWObl.js +0 -1
  103. package/dist/assets/TransactionDetailRoutes-DnOwqpsk.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-Cjqg1XsV.js";import{A as i}from"./AddressScreen-DT0Q15o7.js";import s from"./NotFoundScreen-CiYbMRBm.js";import"./sentry-DTwqiEdO.js";import{n as d,o as r}from"./core-B1Jz41nC.js";import"./zeni-epic-state-CFJ-5drS.js";import"./recharts-DW5j2-RD.js";import"./index-DnoGJKuR.js";import"./mui-DSSmRxLI.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="624154e3-3694-4a3c-b645-a66b8e12404c",t._sentryDebugIdIdentifier="sentry-dbid-624154e3-3694-4a3c-b645-a66b8e12404c")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-DNAiUJc8.js";import{a as h}from"./sentry-3H-Lcjnl.js";import{j as T,h as _,u as j,l as E,g as $,k as B}from"./core-BR1djmRq.js";import{Z as K,m as M,z as D,c as L,v as R,x as z,d as C,f as S,j as F,h as b,p as N}from"./index-DTNnwrfZ.js";import{J$ as k,gY as U,eQ as G,K0 as O,c2 as V,K1 as q,ki as H}from"./zeni-epic-state-B1K_6mks.js";import{n as J}from"./mui-CgXDoZXy.js";import Q from"./NotFoundScreen-BbHcWObl.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]="ee6d5e0a-8fe8-4b7a-9851-63a0ad277e87",e._sentryDebugIdIdentifier="sentry-dbid-ee6d5e0a-8fe8-4b7a-9851-63a0ad277e87")}catch{}})();const Y=J.div`
1
+ import{j as r}from"./liveblocks-Cjqg1XsV.js";import{a as h}from"./sentry-DTwqiEdO.js";import{j as T,h as _,u as j,l as E,g as $,k as B}from"./core-B1Jz41nC.js";import{Z as K,m as M,z as D,c as L,v as R,x as z,d as C,f as S,j as F,h as b,p as N}from"./index-DnoGJKuR.js";import{J$ as k,gY as U,eQ as G,K0 as O,c2 as V,K1 as q,ki as H}from"./zeni-epic-state-CFJ-5drS.js";import{n as J}from"./mui-DSSmRxLI.js";import Q from"./NotFoundScreen-CiYbMRBm.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]="ee6d5e0a-8fe8-4b7a-9851-63a0ad277e87",e._sentryDebugIdIdentifier="sentry-dbid-ee6d5e0a-8fe8-4b7a-9851-63a0ad277e87")}catch{}})();const Y=J.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-DNAiUJc8.js";import{a as l}from"./sentry-3H-Lcjnl.js";import{h as de,j as me,u as pe,g as N,l as he,k as fe}from"./core-BR1djmRq.js";import{Q as Se,cJ as ge,z as Ce,Z as ke,cK as be,cL as we,cM as V,cN as Ie,cO as J,p as U,x as q,d as T,cP as z,cQ as Ee,W as Pe,f as Te,a3 as xe,cR as ye,X as _e,q as ve,aY as Oe,cS as Qe}from"./index-DTNnwrfZ.js";import{fG as Ae,f5 as K,eQ as Ue,hC as je,Qz as De,eP as Fe,hM as Be,hI as Le,fw as W,fq as Me,fj as Re,fn as H,fr as Ge,fs as $e,ft as Ne,fu as Ve,fv as qe}from"./zeni-epic-state-B1K_6mks.js";import{D as ze,n as b,S as We,P as He}from"./mui-CgXDoZXy.js";import{p as Ye}from"./pathToGoBack-oVjtOboc.js";import"./recharts-DzRX0aWK.js";import"./analytics-B4UJAsLA.js";import"./plaid-A3mYO1wj.js";import"./dnd-WGKE6-QR.js";import"./stripe-DMRn4zHo.js";import"./lottie-CXwx4IFe.js";import"./lexical-GYG14AuY.js";import"./pdf-B31DLhP9.js";import"./utils-BrTYpNjH.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="f90f9c4b-c9a8-4371-8410-22b37515616b",s._sentryDebugIdIdentifier="sentry-dbid-f90f9c4b-c9a8-4371-8410-22b37515616b")}catch{}})();const X="chat-response-generated",Je=fe(function(s,r){const t=K(s),m=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose}},function(s,r){const{location:t,currentTenant:m,userId:c,navigate:S,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:u}=r;return{onEventReceived:(e,o)=>{if(e===X&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,p=$e(n.type),d=n.metadata.chat_session_id??null,{currentChatSession:a,currentQuestionAnswer:w,currentQuestionAnswerSummary:x}=J(C,d);p!=="answer"?T.trackAICFOChatResponseGenerated(p,w?.question.questionText??"",n.text,d,Qe(x,a),n.metadata.message_id??null):T.trackAICFOChatAnswerGenerated(n.text,w?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Ne(n.visualization?.type??"")??null,d,n.summarized_title,n.metadata.message_id??null),s(Ve({chatSessionId:n.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),s(qe({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:c}))}},onSubmit:(e,o,n,p)=>{e&&Oe(s,e,o,f,C,c,p,n)},updateCurrentInput:e=>{s(H(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Ge(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??Ye(1);S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),s(H(""))},togglePageView:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),u(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{f!=null&&s(Re());const e=ve(t.state?.pathnameStackToGoBack,t.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Me({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(xe(ye)),gt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Se(),t=de(),m=me(),c=pe(),[S,f]=l.useState(!1);l.useEffect(()=>{t(Ae())},[t]);const{customPageTitle:C}=ge(),u=N(i=>K(i)),e=Ce.getSignedInUser(),{session_id:o}=he(),n=ke(),p=Pe(n),d=N(i=>Ue(i)),a=u.uiState.currentChatSessionId,w=d.tenantEmailDomain,{handleUploadPromoClose:x,isUploadPromoVisible:Z}=be({isFileUploadEnabled:s,tenantEmailDomain:w}),y=we({currentTenant:d,currentChatSessionId:a,aiCfoView:u}),I=c.state,E=I?.aiCfoInitialQuestion,j=!!I?.aiCfoShouldSubmit;l.useEffect(()=>{const i=c.state;if(i?.[V]!==!0)return;f(!0);const g={...i};delete g[V],m(c,{replace:!0,state:g})},[c.pathname,c.search,c.state,m]);const[ee,_]=l.useState(null),[te,v]=l.useState(!1),D=l.useRef(!1);l.useEffect(()=>{D.current||E==null||E===""||(_(E),v(j),D.current=!0)},[E,j]);const ae=l.useCallback(()=>{_(null),v(!1)},[]),F=l.useMemo(()=>new URLSearchParams(c.search),[c.search]),B=F.get("ref")??I?.aiCfoRef,O=F.get("emailRefId")??I?.aiCfoEmailRefId,L=l.useRef(!1);l.useEffect(()=>{L.current||B!=="month-end-email"||O==null||a!=null||e==null||(t(je("controller",e.userId,O,"MONTH_END_EMAIL")),L.current=!0)},[B,O,a,t,e]);const P=u.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&a!=null&&(_(P),v(!0),t(De()))},[P,a,t]);const se=d.masterTOSInfo,k=se?.isMasterTOSAccepted??!1,{visitedSessions:M}=Ie(a),Q=u.fetchState,A=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,R=a!=null?u.fetchChatSessionHistoryByChatSessionId?.[a]?.fetchState??"Not-Started":"Not-Started",G=a==null||(u.uiState.chatHistoryNextPageToken[a]?.hasMore??!0),$=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:oe}=J($,a),ne=oe.length===0;l.useEffect(()=>{k||p||m("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[k,p,m,c.state]);const ie=l.useCallback(()=>{const i=U(c.state?.pathnameStackToGoBack),g=d.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...c.state,pathnameStackToGoBack:i.newStack}})},[d.tenantEmailDomain,c.state,m]);l.useEffect(()=>{a!=null&&o!==a&&m(`../ai-cfo/${a}`,{state:{...c.state}})},[a,o]),l.useEffect(()=>{o!=null&&a==null&&o!=="new_chat"&&o!=="explore"&&t(Fe({sessionId:o,agentId:"controller"}))},[]);const le=l.useMemo(()=>({events:M.map(i=>`private-encrypted-chat-${i}.${X}`),eventCallback:(i,g,ue)=>ue.onEventReceived(i,g)}),[M]);l.useEffect(()=>{Q!=="In-Progress"&&A&&t(Be())},[Q,A,t]),l.useEffect(()=>{a!=null&&R!=="In-Progress"&&G&&e!=null&&Q==="Completed"&&!A&&t(Le(a,e.userId))},[R,G,a,e,t]);const re=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const ce=a!=null&&u.responseStateByChatSessionId?.[a]?.answer?.fetchState==="In-Progress";return!k&&p?h.jsxs(Xe,{children:[h.jsx(q,{analytics:T,onLoad:re}),y.drawerElement,h.jsx(Ze,{children:h.jsx(Y,{children:h.jsx(z,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:ie,onCompleteClick:()=>{d.userRoleId!=null&&t(W(d.userRoleId))}})})})]}):h.jsxs(Ke,{children:[h.jsx(q,{analytics:T,onLoad:i=>i.trackPageLoaded(Te.Event.aiCFOPage)}),p&&y.drawerElement,h.jsx(Je,{...le,currentChatSessionId:a,allSessionsWithOrderedQuestionAnswers:$,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:o,location:c,isSubmitting:ce,isEmptyChatWithSession:ne,customPageTitle:C,currentTenant:d,emailLinkQuestion:ee??void 0,autoSubmitEmailLinkQuestion:te,onEmailLinkQuestionProcessed:ae,onMenuClick:p?y.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:Z,onUploadPromoClose:x}),h.jsx(ze,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:et,style:{width:p?"100%":`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(Y,{onClick:i=>i.stopPropagation(),children:h.jsx(z,{isTOSAccepted:k,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>f(!1),onCompleteClick:()=>{k||d.userRoleId==null||t(W(d.userRoleId)),f(!1)}})})})]})},Y=b(We)`
1
+ import{j as h}from"./liveblocks-Cjqg1XsV.js";import{a as l}from"./sentry-DTwqiEdO.js";import{h as de,j as me,u as pe,g as N,l as he,k as fe}from"./core-B1Jz41nC.js";import{Q as Se,cJ as ge,z as Ce,Z as ke,cK as be,cL as we,cM as V,cN as Ie,cO as J,p as U,x as q,d as T,cP as z,cQ as Ee,W as Pe,f as Te,a3 as xe,cR as ye,X as _e,q as ve,aY as Oe,cS as Qe}from"./index-DnoGJKuR.js";import{fG as Ae,f5 as K,eQ as Ue,hC as je,Qz as De,eP as Fe,hM as Be,hI as Le,fw as W,fq as Me,fj as Re,fn as H,fr as Ge,fs as $e,ft as Ne,fu as Ve,fv as qe}from"./zeni-epic-state-CFJ-5drS.js";import{D as ze,n as b,S as We,P as He}from"./mui-DSSmRxLI.js";import{p as Ye}from"./pathToGoBack-DUiwH7Zn.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="f90f9c4b-c9a8-4371-8410-22b37515616b",s._sentryDebugIdIdentifier="sentry-dbid-f90f9c4b-c9a8-4371-8410-22b37515616b")}catch{}})();const X="chat-response-generated",Je=fe(function(s,r){const t=K(s),m=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose}},function(s,r){const{location:t,currentTenant:m,userId:c,navigate:S,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:u}=r;return{onEventReceived:(e,o)=>{if(e===X&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,p=$e(n.type),d=n.metadata.chat_session_id??null,{currentChatSession:a,currentQuestionAnswer:w,currentQuestionAnswerSummary:x}=J(C,d);p!=="answer"?T.trackAICFOChatResponseGenerated(p,w?.question.questionText??"",n.text,d,Qe(x,a),n.metadata.message_id??null):T.trackAICFOChatAnswerGenerated(n.text,w?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Ne(n.visualization?.type??"")??null,d,n.summarized_title,n.metadata.message_id??null),s(Ve({chatSessionId:n.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),s(qe({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:c}))}},onSubmit:(e,o,n,p)=>{e&&Oe(s,e,o,f,C,c,p,n)},updateCurrentInput:e=>{s(H(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Ge(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??Ye(1);S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),s(H(""))},togglePageView:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),u(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{f!=null&&s(Re());const e=ve(t.state?.pathnameStackToGoBack,t.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Me({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(xe(ye)),gt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Se(),t=de(),m=me(),c=pe(),[S,f]=l.useState(!1);l.useEffect(()=>{t(Ae())},[t]);const{customPageTitle:C}=ge(),u=N(i=>K(i)),e=Ce.getSignedInUser(),{session_id:o}=he(),n=ke(),p=Pe(n),d=N(i=>Ue(i)),a=u.uiState.currentChatSessionId,w=d.tenantEmailDomain,{handleUploadPromoClose:x,isUploadPromoVisible:Z}=be({isFileUploadEnabled:s,tenantEmailDomain:w}),y=we({currentTenant:d,currentChatSessionId:a,aiCfoView:u}),I=c.state,E=I?.aiCfoInitialQuestion,j=!!I?.aiCfoShouldSubmit;l.useEffect(()=>{const i=c.state;if(i?.[V]!==!0)return;f(!0);const g={...i};delete g[V],m(c,{replace:!0,state:g})},[c.pathname,c.search,c.state,m]);const[ee,_]=l.useState(null),[te,v]=l.useState(!1),D=l.useRef(!1);l.useEffect(()=>{D.current||E==null||E===""||(_(E),v(j),D.current=!0)},[E,j]);const ae=l.useCallback(()=>{_(null),v(!1)},[]),F=l.useMemo(()=>new URLSearchParams(c.search),[c.search]),B=F.get("ref")??I?.aiCfoRef,O=F.get("emailRefId")??I?.aiCfoEmailRefId,L=l.useRef(!1);l.useEffect(()=>{L.current||B!=="month-end-email"||O==null||a!=null||e==null||(t(je("controller",e.userId,O,"MONTH_END_EMAIL")),L.current=!0)},[B,O,a,t,e]);const P=u.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&a!=null&&(_(P),v(!0),t(De()))},[P,a,t]);const se=d.masterTOSInfo,k=se?.isMasterTOSAccepted??!1,{visitedSessions:M}=Ie(a),Q=u.fetchState,A=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,R=a!=null?u.fetchChatSessionHistoryByChatSessionId?.[a]?.fetchState??"Not-Started":"Not-Started",G=a==null||(u.uiState.chatHistoryNextPageToken[a]?.hasMore??!0),$=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:oe}=J($,a),ne=oe.length===0;l.useEffect(()=>{k||p||m("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[k,p,m,c.state]);const ie=l.useCallback(()=>{const i=U(c.state?.pathnameStackToGoBack),g=d.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...c.state,pathnameStackToGoBack:i.newStack}})},[d.tenantEmailDomain,c.state,m]);l.useEffect(()=>{a!=null&&o!==a&&m(`../ai-cfo/${a}`,{state:{...c.state}})},[a,o]),l.useEffect(()=>{o!=null&&a==null&&o!=="new_chat"&&o!=="explore"&&t(Fe({sessionId:o,agentId:"controller"}))},[]);const le=l.useMemo(()=>({events:M.map(i=>`private-encrypted-chat-${i}.${X}`),eventCallback:(i,g,ue)=>ue.onEventReceived(i,g)}),[M]);l.useEffect(()=>{Q!=="In-Progress"&&A&&t(Be())},[Q,A,t]),l.useEffect(()=>{a!=null&&R!=="In-Progress"&&G&&e!=null&&Q==="Completed"&&!A&&t(Le(a,e.userId))},[R,G,a,e,t]);const re=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const ce=a!=null&&u.responseStateByChatSessionId?.[a]?.answer?.fetchState==="In-Progress";return!k&&p?h.jsxs(Xe,{children:[h.jsx(q,{analytics:T,onLoad:re}),y.drawerElement,h.jsx(Ze,{children:h.jsx(Y,{children:h.jsx(z,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:ie,onCompleteClick:()=>{d.userRoleId!=null&&t(W(d.userRoleId))}})})})]}):h.jsxs(Ke,{children:[h.jsx(q,{analytics:T,onLoad:i=>i.trackPageLoaded(Te.Event.aiCFOPage)}),p&&y.drawerElement,h.jsx(Je,{...le,currentChatSessionId:a,allSessionsWithOrderedQuestionAnswers:$,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:o,location:c,isSubmitting:ce,isEmptyChatWithSession:ne,customPageTitle:C,currentTenant:d,emailLinkQuestion:ee??void 0,autoSubmitEmailLinkQuestion:te,onEmailLinkQuestionProcessed:ae,onMenuClick:p?y.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:Z,onUploadPromoClose:x}),h.jsx(ze,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:et,style:{width:p?"100%":`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(Y,{onClick:i=>i.stopPropagation(),children:h.jsx(z,{isTOSAccepted:k,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>f(!1),onCompleteClick:()=>{k||d.userRoleId==null||t(W(d.userRoleId)),f(!1)}})})})]})},Y=b(We)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-DNAiUJc8.js";import{a as y}from"./sentry-3H-Lcjnl.js";import{j as U,u as B,h as j,g as v,N,k as T,l as O,n as $,o as S}from"./core-BR1djmRq.js";import{eQ as F,Ni as R,M_ as h,xM as x,xG as L,xK as I,xz as z,N0 as M,xC as W,xO as q,xN as E}from"./zeni-epic-state-B1K_6mks.js";import{m as P,z as k,v as V,a3 as G,by as K,ac as _,bz as Q}from"./index-DTNnwrfZ.js";import"./mui-CgXDoZXy.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-EWELQ8Ed.js";import J from"./NotFoundScreen-BbHcWObl.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]="bc5482af-bb8b-488a-8fa2-2ba976526bb1",e._sentryDebugIdIdentifier="sentry-dbid-bc5482af-bb8b-488a-8fa2-2ba976526bb1")}catch{}})();const w="bill-approval-rule-update",X=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(w)&&e(M(!1))},onBackClick:()=>{_(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(z(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(G(K)),Y=()=>{const e=U(),o=B(),a=j(),[p,t]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>h(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(x())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(L(!0)))},[p,n,a]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),a(I())),e("./new"))},[u,r,a]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const a=h(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(f=>{const i=f.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(b=>{const C=!!H(b.value);return{type:C?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!C}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(E(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(E(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{a("../")}}})(Q);function D(){const e=U(),o=j(),a=B(),{approvalRuleId:p}=O(),t=k.getSignedInUser(),u=P(),s=v(r=>h(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),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($,{children:[l.jsx(S,{path:"/",element:l.jsx(Y,{})}),l.jsx(S,{path:"/new",element:l.jsx(D,{})}),l.jsx(S,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(S,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-Cjqg1XsV.js";import{a as y}from"./sentry-DTwqiEdO.js";import{j as U,u as B,h as j,g as v,N,k as T,l as O,n as $,o as S}from"./core-B1Jz41nC.js";import{eQ as F,Ni as R,M_ as h,xM as x,xG as L,xK as I,xz as z,N0 as M,xC as W,xO as q,xN as E}from"./zeni-epic-state-CFJ-5drS.js";import{m as P,z as k,v as V,a3 as G,by as K,ac as _,bz as Q}from"./index-DnoGJKuR.js";import"./mui-DSSmRxLI.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-DxQnj1Nr.js";import J from"./NotFoundScreen-CiYbMRBm.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]="bc5482af-bb8b-488a-8fa2-2ba976526bb1",e._sentryDebugIdIdentifier="sentry-dbid-bc5482af-bb8b-488a-8fa2-2ba976526bb1")}catch{}})();const w="bill-approval-rule-update",X=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(w)&&e(M(!1))},onBackClick:()=>{_(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(z(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(G(K)),Y=()=>{const e=U(),o=B(),a=j(),[p,t]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>h(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(x())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(L(!0)))},[p,n,a]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),a(I())),e("./new"))},[u,r,a]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const a=h(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(f=>{const i=f.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(b=>{const C=!!H(b.value);return{type:C?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!C}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(E(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(E(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{a("../")}}})(Q);function D(){const e=U(),o=j(),a=B(),{approvalRuleId:p}=O(),t=k.getSignedInUser(),u=P(),s=v(r=>h(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),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($,{children:[l.jsx(S,{path:"/",element:l.jsx(Y,{})}),l.jsx(S,{path:"/new",element:l.jsx(D,{})}),l.jsx(S,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(S,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DNAiUJc8.js";import{j as J,h as se,u as X,l as ae,g as v,N as te,k as Y,i as na,n as ia,o as S}from"./core-BR1djmRq.js";import{eQ as Z,MA as Le,bv as It,Ht as oa,bo as wt,bF as pe,MB as xt,x4 as Bt,ye as $e,xD as la,bn as De,MC as sa,MD as ra,c2 as ca,ME as da,jC as Ct,MF as At,MG as Et,yP as _e,xj as Ce,MH as ua,wU as tt,MI as pa,B$ as ma,wY as ba,x2 as Dt,MJ as ke,MK as Ge,yf as Ne,ML as ha,MM as ga,yi as Oe,MN as ya,yv as Sa,MO as jt,x$ as at,y4 as fa,MP as ka,MQ as ue,MR as Tt,MS as Pt,MT as Ft,fK as va,xo as Me,cx as Rt,MU as Ia,gO as wa,MV as xa,MW as Ba,eW as Vt,eU as $t,MX as ze,MY as Ca,MZ as Aa,Kj as Ze,M_ as Ea,Kk as oe,Kl as He,M$ as Da,N0 as ja,N1 as Ta,y6 as nt,y3 as Pa,N2 as Fa,N3 as Ra,N4 as Va,xR as $a,N5 as Ma,N6 as Ua,N7 as La,cl as Mt,cN as Ut,jN as _a,bL as Ga,bq as Lt,bM as _t,wa as Na,N8 as Oa,BO as za,BU as Za,sJ as Ha,yg as Wa,yW as qa,j_ as fe,N9 as Ka,Na as Gt,ks as Ja,jU as Nt,kd as Ot,kc as it,bE as be,bK as Xa,Nb as Ya,Nc as ve,ix as Qa,Nd as ot,Ne as en,iB as tn,iW as an,z8 as nn,Nf as on,kl as ln,y_ as sn,Ng as lt,z2 as rn,z7 as cn,z4 as dn,yY as un,Nh as zt,xd as pn,Ni as mn,Nj as bn,fC as hn,fB as gn,fA as yn,k1 as Sn,kj as st,ku as fn,q9 as kn,ka as vn,z0 as In,iH as wn,kz as xn,Nk as Bn,iz as Cn,q0 as An,Nl as En,xX as Dn,bG as jn,bs as Tn,Jd as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-B1K_6mks.js";import{m as me,z as V,c as Ie,y as le,S as y,aK as Ae,v as re,o as A,x as je,d as D,b5 as Mn,p as z,X as We,q as E,Z as we,b6 as rt,b7 as ct,b8 as Un,ah as Ln,H as _n,aE as Gn,G as Zt,D as qe,I as Ke,b9 as Nn,aq as Ht,ba as On,T as zn,f as Wt,a3 as Zn,bb as Hn,bc as Wn,bd as qn,be as Kn,bf as Jn,bg as Xn,bh as Yn,bi as Qn,bj as ei,r as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a6 as li}from"./index-DTNnwrfZ.js";import{n as U,S as si}from"./mui-CgXDoZXy.js";import{A as dt}from"./AddressScreen-DYJtp3rR.js";import{g as ie,a as Te,i as qt,V as Je,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-BjQDaDck.js";import{a as f}from"./sentry-3H-Lcjnl.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-1lbCkmvt.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady--BxYx_7U.js";import{u as Kt}from"./useInitialThreadRequest-DcJwlozW.js";import Ee from"./NotFoundScreen-BbHcWObl.js";import{D as ui}from"./DrawerScreen-DrwckvEs.js";import{M as Jt}from"./MobileAppDrawer-BMQqN7ku.js";import{F as Xt}from"./FeaturePreviewScreen-SE_WbAPr.js";import{S as Pe}from"./SetupPagesScreen-DjVgUhrA.js";import{B as pi}from"./BillPayApprovalRoutes-BWMOAOlT.js";import{FallBackRoute as mi}from"./ScreenRoutes-BOiy-cJd.js";import"./recharts-DzRX0aWK.js";import"./analytics-B4UJAsLA.js";import"./plaid-A3mYO1wj.js";import"./dnd-WGKE6-QR.js";import"./stripe-DMRn4zHo.js";import"./lottie-CXwx4IFe.js";import"./lexical-GYG14AuY.js";import"./pdf-B31DLhP9.js";import"./utils-BrTYpNjH.js";import"./analyticsHelper-YeXzy43q.js";import"./routePaths-OfzBAr6P.js";import"./BusinessVerificationPageScreen-CUpYNJV1.js";import"./ReimbursementApprovalRuleDetailScreen-EWELQ8Ed.js";import"./getLocaleForTenant-H-2L0ToN.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]="4b9ffc5a-bdf1-4eca-b0c7-e5fc48931e1c",e._sentryDebugIdIdentifier="sentry-dbid-4b9ffc5a-bdf1-4eca-b0c7-e5fc48931e1c")}catch{}})();const bi=Y(function(e,t){const l=Le(e,t.billId),i=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Mn);function hi(){const e=J(),t=se(),l=X(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(N=>Z(N)),s=v(N=>Le(N,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});Qe({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:L}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=L(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),M=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(N=>N.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",$,M,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,M,Q,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:N=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(N)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:M,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ne(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,L]=f.useState(!1),[$,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,M=C.showAutofill;const K=v(F=>Le(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],M=!1);const Q=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Ne(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?L(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(L(!0),t($e(!1,h,j,b,i)))),u&&!T&&(L(!0),t($e(!1,h,j,b,i)))},[B,T,u,i,t]);const N={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Q}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||M?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[M&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:N,isEditPopup:!0}):null,o==="small"||M?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:M,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Nn();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-Cjqg1XsV.js";import{j as J,h as se,u as X,l as ae,g as v,N as te,k as Y,i as na,n as ia,o as S}from"./core-B1Jz41nC.js";import{eQ as Z,MA as Le,bv as It,Ht as oa,bo as wt,bF as pe,MB as xt,x4 as Bt,ye as $e,xD as la,bn as De,MC as sa,MD as ra,c2 as ca,ME as da,jC as Ct,MF as At,MG as Et,yP as _e,xj as Ce,MH as ua,wU as tt,MI as pa,B$ as ma,wY as ba,x2 as Dt,MJ as ke,MK as Ge,yf as Ne,ML as ha,MM as ga,yi as Oe,MN as ya,yv as Sa,MO as jt,x$ as at,y4 as fa,MP as ka,MQ as ue,MR as Tt,MS as Pt,MT as Ft,fK as va,xo as Me,cx as Rt,MU as Ia,gO as wa,MV as xa,MW as Ba,eW as Vt,eU as $t,MX as ze,MY as Ca,MZ as Aa,Kj as Ze,M_ as Ea,Kk as oe,Kl as He,M$ as Da,N0 as ja,N1 as Ta,y6 as nt,y3 as Pa,N2 as Fa,N3 as Ra,N4 as Va,xR as $a,N5 as Ma,N6 as Ua,N7 as La,cl as Mt,cN as Ut,jN as _a,bL as Ga,bq as Lt,bM as _t,wa as Na,N8 as Oa,BO as za,BU as Za,sJ as Ha,yg as Wa,yW as qa,j_ as fe,N9 as Ka,Na as Gt,ks as Ja,jU as Nt,kd as Ot,kc as it,bE as be,bK as Xa,Nb as Ya,Nc as ve,ix as Qa,Nd as ot,Ne as en,iB as tn,iW as an,z8 as nn,Nf as on,kl as ln,y_ as sn,Ng as lt,z2 as rn,z7 as cn,z4 as dn,yY as un,Nh as zt,xd as pn,Ni as mn,Nj as bn,fC as hn,fB as gn,fA as yn,k1 as Sn,kj as st,ku as fn,q9 as kn,ka as vn,z0 as In,iH as wn,kz as xn,Nk as Bn,iz as Cn,q0 as An,Nl as En,xX as Dn,bG as jn,bs as Tn,Jd as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-CFJ-5drS.js";import{m as me,z as V,c as Ie,y as le,S as y,aK as Ae,v as re,o as A,x as je,d as D,b5 as Mn,p as z,X as We,q as E,Z as we,b6 as rt,b7 as ct,b8 as Un,ah as Ln,H as _n,aE as Gn,G as Zt,D as qe,I as Ke,b9 as Nn,aq as Ht,ba as On,T as zn,f as Wt,a3 as Zn,bb as Hn,bc as Wn,bd as qn,be as Kn,bf as Jn,bg as Xn,bh as Yn,bi as Qn,bj as ei,r as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a6 as li}from"./index-DnoGJKuR.js";import{n as U,S as si}from"./mui-DSSmRxLI.js";import{A as dt}from"./AddressScreen-DT0Q15o7.js";import{g as ie,a as Te,i as qt,V as Je,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-cxTAfHcb.js";import{a as f}from"./sentry-DTwqiEdO.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-D1ncSYVo.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-BD5FIrcH.js";import{u as Kt}from"./useInitialThreadRequest-CPdwuo-t.js";import Ee from"./NotFoundScreen-CiYbMRBm.js";import{D as ui}from"./DrawerScreen-C7_25xjY.js";import{M as Jt}from"./MobileAppDrawer-B5ryN7bV.js";import{F as Xt}from"./FeaturePreviewScreen-C38iY35s.js";import{S as Pe}from"./SetupPagesScreen-BbHEiKJR.js";import{B as pi}from"./BillPayApprovalRoutes-BVQZfKuM.js";import{FallBackRoute as mi}from"./ScreenRoutes-BFCvivVX.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";import"./analyticsHelper-CRpkSjLL.js";import"./routePaths-DBUEUOgS.js";import"./BusinessVerificationPageScreen-CdptLI3O.js";import"./ReimbursementApprovalRuleDetailScreen-DxQnj1Nr.js";import"./getLocaleForTenant-D68g9mo1.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]="4b9ffc5a-bdf1-4eca-b0c7-e5fc48931e1c",e._sentryDebugIdIdentifier="sentry-dbid-4b9ffc5a-bdf1-4eca-b0c7-e5fc48931e1c")}catch{}})();const bi=Y(function(e,t){const l=Le(e,t.billId),i=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Mn);function hi(){const e=J(),t=se(),l=X(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(N=>Z(N)),s=v(N=>Le(N,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});Qe({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:L}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=L(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),M=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(N=>N.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",$,M,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,M,Q,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:N=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(N)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:M,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ne(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,L]=f.useState(!1),[$,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,M=C.showAutofill;const K=v(F=>Le(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],M=!1);const Q=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Ne(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?L(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(L(!0),t($e(!1,h,j,b,i)))),u&&!T&&(L(!0),t($e(!1,h,j,b,i)))},[B,T,u,i,t]);const N={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Q}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||M?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[M&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:N,isEditPopup:!0}):null,o==="small"||M?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:M,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Nn();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=U.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-DNAiUJc8.js";import{a as V}from"./sentry-3H-Lcjnl.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-BR1djmRq.js";import{c as ce,y as ue,aK as de,z,x as pe,d as B,ac as F,f as E,bu as le,aq as me,q as R,ar as P}from"./index-DTNnwrfZ.js";import{N6 as fe,eQ as q,s8 as ye,Hx as Se,xR as ge,Ay as Ie,D5 as he,DK as be,ED as De,Nt as Oe,Nu as Te,Nv as ke,Nw as Ce,Nx as Ve,K0 as Ne,Mv as we,Kc as Ae,ki as ve,fC as _e,fB as xe,fA as Fe,q9 as Ee,q0 as ze,pZ as Be,ka as Re,sh as Pe,sf as M,bE as L,st as U,cv as Me}from"./zeni-epic-state-B1K_6mks.js";import{n as Le}from"./mui-CgXDoZXy.js";import{c as j}from"./routePaths-OfzBAr6P.js";import{M as Ue}from"./MobileAppDrawer-BMQqN7ku.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]="4ca37fa6-e467-4ae2-8b74-798e5f5777f8",e._sentryDebugIdIdentifier="sentry-dbid-4ca37fa6-e467-4ae2-8b74-798e5f5777f8")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-Cjqg1XsV.js";import{a as V}from"./sentry-DTwqiEdO.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-B1Jz41nC.js";import{c as ce,y as ue,aK as de,z,x as pe,d as B,ac as F,f as E,bu as le,aq as me,q as R,ar as P}from"./index-DnoGJKuR.js";import{N6 as fe,eQ as q,s8 as ye,Hx as Se,xR as ge,Ay as Ie,D5 as he,DK as be,ED as De,Nt as Oe,Nu as Te,Nv as ke,Nw as Ce,Nx as Ve,K0 as Ne,Mv as we,Kc as Ae,ki as ve,fC as _e,fB as xe,fA as Fe,q9 as Ee,q0 as ze,pZ as Be,ka as Re,sh as Pe,sf as M,bE as L,st as U,cv as Me}from"./zeni-epic-state-CFJ-5drS.js";import{n as Le}from"./mui-DSSmRxLI.js";import{c as j}from"./routePaths-DBUEUOgS.js";import{M as Ue}from"./MobileAppDrawer-B5ryN7bV.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]="4ca37fa6-e467-4ae2-8b74-798e5f5777f8",e._sentryDebugIdIdentifier="sentry-dbid-4ca37fa6-e467-4ae2-8b74-798e5f5777f8")}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-DNAiUJc8.js";import{j as le,l as ia,h as ue,g as y,u as ge,k as pe,N as ga,q as ut,n as Wt,o as te}from"./core-BR1djmRq.js";import{eQ as ie,bs as Re,O_ as ka,eU as be,eV as ye,eW as Se,fR as Ge,cs as ze,O$ as Ye,P0 as Ma,tn as ba,jK as ya,P1 as Sa,gO as oa,zR as Je,zT as $a,zU as Ga,jA as mt,P2 as Ze,zF as Ct,P3 as qt,P4 as Xt,zI as Da,P5 as Qt,Nq as _a,rz as pt,zO as za,gZ as Jt,P6 as ht,P7 as Ke,bq as en,P8 as an,fC as Pa,fB as wa,Am as tn,fA as Ta,N6 as nn,P9 as ft,cl as gt,cN as rn,Np as da,AY as sn,Pa as tt,Ay as Fa,Pb as bt,AZ as on,NR as cn,A_ as dn,BU as ln,sJ as un,BO as mn,A7 as yt,A0 as Cn,Pc as pn,fT as hn,Ag as St,Ak as It,fS as fn,Pd as gn,AK as At,Pe as bn,Pf as yn,Pg as Sn,Ai as Et,A3 as kt,zL as Dt,Ac as _t,Aa as Pt,Ae as In,zS as nt,Ph as wt,Pi as va,Av as Ia,K5 as Tt,cO as Ya,Pj as An,Pk as En,Pl as kn,Pm as Dn,As as Na,AR as _n,AN as Pn,Ao as wn,AP as Tn,AF as Fn,AH as vn,Pn as Ft,AX as vt,Ht as xn,Po as Bn,Pp as Ln,Pq as Un,Pr as xt,Ps as Rn,Bi as On,Ax as Bt,Ar as ca,Aw as jn,Pt as Nn,Pu as Vn,zC as Hn,Pv as Lt,Pw as Ut,Px as Mn,zE as $n,zD as rt,Py as Gn,Pz as zn,PA as Yn,K1 as Zn,PB as Za,PC as Kn,wd as Rt,ki as Wn,gP as qn,Bn as Xn,PD as Ot,PE as Qn,Bo as Jn,PF as er,df as ar,th as tr,Bd as nr,B7 as Ue,bv as rr,bF as sr,cx as or,bG as cr,Jd as ir}from"./zeni-epic-state-B1K_6mks.js";import{z as J,c as je,y as ce,S as Y,v as la,bY as xa,c7 as dr,p as ve,c8 as lr,c9 as ur,Z as ua,aK as Fe,q as fe,bf as Ka,ca as mr,G as ma,h as Ba,m as Wa,d as X,D as qa,cb as Cr,an as Xa,br as Xe,cc as Va,cd as pr,x as Qa,a3 as hr,ce as fr,aq as jt,X as Ha,T as Nt,f as Vt,cf as gr,cg as br,ch as yr,ci as Sr,cj as Ir,ck as Ar,o as Aa,cl as Er,cm as kr,cn as Ra,r as Dr,co as _r,cp as Pr,cq as wr,cr as Tr,cs as Fr,a6 as vr}from"./index-DTNnwrfZ.js";import{n as _e,D as Ht,S as xr}from"./mui-CgXDoZXy.js";import{a as i}from"./sentry-3H-Lcjnl.js";import{g as Ce,a as Ca,b as Mt,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Ja,P as Lr,i as et,s as Qe,j as $t,k as Me,l as Gt,m as Ur,n as zt,p as Rr,S as st}from"./SetupPagesScreen-DjVgUhrA.js";import La from"./NotFoundScreen-BbHcWObl.js";import{M as $e}from"./MobileAppDrawer-BMQqN7ku.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-1lbCkmvt.js";import{c as Zt}from"./useFetchSuggestedQuestionsWhenReady--BxYx_7U.js";import{v as ot}from"./utils-BrTYpNjH.js";import{t as Or}from"./AddressScreen-DYJtp3rR.js";import"./recharts-DzRX0aWK.js";import"./analytics-B4UJAsLA.js";import"./plaid-A3mYO1wj.js";import"./dnd-WGKE6-QR.js";import"./stripe-DMRn4zHo.js";import"./lottie-CXwx4IFe.js";import"./lexical-GYG14AuY.js";import"./pdf-B31DLhP9.js";import"./analyticsHelper-YeXzy43q.js";import"./routePaths-OfzBAr6P.js";import"./BusinessVerificationPageScreen-CUpYNJV1.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]="c608f513-cb92-4eff-8360-476bda2237af",e._sentryDebugIdIdentifier="sentry-dbid-c608f513-cb92-4eff-8360-476bda2237af")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=J.getSignedInUser(),n=y(Q=>ie(Q)),C=je(),p=Re(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(Q=>ka(Q).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=u(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(R,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(Q=>Ge(Q,n.companyId)),N=ze(v.controllers),{creditAccount:L,creditAccountRepayment:w}=y(Q=>Ye(Q)),V=y(Q=>Q.classListState.fetchState),m=!_&&d&&f,l=y(Q=>Ma(Q,t,m,d)),[P,T]=i.useState(!1),H=l.chargeCard,U=H?.cardCreatedByUser?.userId,K=y(Q=>U!=null?ba(Q.userRoleState,U):void 0),I=K?.accountingClassIDs[0],B=y(Q=>I!=null?ya(Q.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,O=y(Q=>j!=null?ba(Q.userRoleState,j):void 0),W=O?.accountingClassIDs[0],E=y(Q=>W!=null?ya(Q.classState,{classId:W,reportId:"class_list"}):void 0),z=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&z&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,z,q]),i.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,m,!1)))},[P,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(z===!1||z&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const Q=Ce(n.tenantEmailDomain,t,r,H,c);e(Q)}},[l.fetchState,c,z]),i.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&f&&p&&a($a()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&f&&p&&a(Ga()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,f,p,V]);const G=()=>{if(r!=null&&t!=null){a(Sa());const Q=Ce(n.tenantEmailDomain,t,r);e(Q)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Oe(d,g,D,f),ae=Ca(d,f,p,L,w),ne=Mt(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:G,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ze(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ze(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=ge(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,R]=i.useState(!1),F=J.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>Xt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(Y.isDebitCardFeatureEnabled),w=Se(L,k),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),P=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&U&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Je(n,K,U)))},[o,g.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:z}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Qt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:z}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const B=J.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(O,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{R(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx($e,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(Gr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:B,navigate:r,currentTenant:k,location:C,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(zr,{windowSize:t,children:e}):null]})},Gr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Jt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ke(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(Pa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),zr=_e.div`
1
+ import{j as s}from"./liveblocks-Cjqg1XsV.js";import{j as le,l as ia,h as ue,g as y,u as ge,k as pe,N as ga,q as ut,n as Wt,o as te}from"./core-B1Jz41nC.js";import{eQ as ie,bs as Re,O_ as ka,eU as be,eV as ye,eW as Se,fR as Ge,cs as ze,O$ as Ye,P0 as Ma,tn as ba,jK as ya,P1 as Sa,gO as oa,zR as Je,zT as $a,zU as Ga,jA as mt,P2 as Ze,zF as Ct,P3 as qt,P4 as Xt,zI as Da,P5 as Qt,Nq as _a,rz as pt,zO as za,gZ as Jt,P6 as ht,P7 as Ke,bq as en,P8 as an,fC as Pa,fB as wa,Am as tn,fA as Ta,N6 as nn,P9 as ft,cl as gt,cN as rn,Np as da,AY as sn,Pa as tt,Ay as Fa,Pb as bt,AZ as on,NR as cn,A_ as dn,BU as ln,sJ as un,BO as mn,A7 as yt,A0 as Cn,Pc as pn,fT as hn,Ag as St,Ak as It,fS as fn,Pd as gn,AK as At,Pe as bn,Pf as yn,Pg as Sn,Ai as Et,A3 as kt,zL as Dt,Ac as _t,Aa as Pt,Ae as In,zS as nt,Ph as wt,Pi as va,Av as Ia,K5 as Tt,cO as Ya,Pj as An,Pk as En,Pl as kn,Pm as Dn,As as Na,AR as _n,AN as Pn,Ao as wn,AP as Tn,AF as Fn,AH as vn,Pn as Ft,AX as vt,Ht as xn,Po as Bn,Pp as Ln,Pq as Un,Pr as xt,Ps as Rn,Bi as On,Ax as Bt,Ar as ca,Aw as jn,Pt as Nn,Pu as Vn,zC as Hn,Pv as Lt,Pw as Ut,Px as Mn,zE as $n,zD as rt,Py as Gn,Pz as zn,PA as Yn,K1 as Zn,PB as Za,PC as Kn,wd as Rt,ki as Wn,gP as qn,Bn as Xn,PD as Ot,PE as Qn,Bo as Jn,PF as er,df as ar,th as tr,Bd as nr,B7 as Ue,bv as rr,bF as sr,cx as or,bG as cr,Jd as ir}from"./zeni-epic-state-CFJ-5drS.js";import{z as J,c as je,y as ce,S as Y,v as la,bY as xa,c7 as dr,p as ve,c8 as lr,c9 as ur,Z as ua,aK as Fe,q as fe,bf as Ka,ca as mr,G as ma,h as Ba,m as Wa,d as X,D as qa,cb as Cr,an as Xa,br as Xe,cc as Va,cd as pr,x as Qa,a3 as hr,ce as fr,aq as jt,X as Ha,T as Nt,f as Vt,cf as gr,cg as br,ch as yr,ci as Sr,cj as Ir,ck as Ar,o as Aa,cl as Er,cm as kr,cn as Ra,r as Dr,co as _r,cp as Pr,cq as wr,cr as Tr,cs as Fr,a6 as vr}from"./index-DnoGJKuR.js";import{n as _e,D as Ht,S as xr}from"./mui-DSSmRxLI.js";import{a as i}from"./sentry-DTwqiEdO.js";import{g as Ce,a as Ca,b as Mt,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Ja,P as Lr,i as et,s as Qe,j as $t,k as Me,l as Gt,m as Ur,n as zt,p as Rr,S as st}from"./SetupPagesScreen-BbHEiKJR.js";import La from"./NotFoundScreen-CiYbMRBm.js";import{M as $e}from"./MobileAppDrawer-B5ryN7bV.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-D1ncSYVo.js";import{c as Zt}from"./useFetchSuggestedQuestionsWhenReady-BD5FIrcH.js";import{v as ot}from"./utils-CCEyXo02.js";import{t as Or}from"./AddressScreen-DT0Q15o7.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./analyticsHelper-CRpkSjLL.js";import"./routePaths-DBUEUOgS.js";import"./BusinessVerificationPageScreen-CdptLI3O.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]="c608f513-cb92-4eff-8360-476bda2237af",e._sentryDebugIdIdentifier="sentry-dbid-c608f513-cb92-4eff-8360-476bda2237af")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=J.getSignedInUser(),n=y(Q=>ie(Q)),C=je(),p=Re(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(Q=>ka(Q).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=u(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(R,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(Q=>Ge(Q,n.companyId)),N=ze(v.controllers),{creditAccount:L,creditAccountRepayment:w}=y(Q=>Ye(Q)),V=y(Q=>Q.classListState.fetchState),m=!_&&d&&f,l=y(Q=>Ma(Q,t,m,d)),[P,T]=i.useState(!1),H=l.chargeCard,U=H?.cardCreatedByUser?.userId,K=y(Q=>U!=null?ba(Q.userRoleState,U):void 0),I=K?.accountingClassIDs[0],B=y(Q=>I!=null?ya(Q.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,O=y(Q=>j!=null?ba(Q.userRoleState,j):void 0),W=O?.accountingClassIDs[0],E=y(Q=>W!=null?ya(Q.classState,{classId:W,reportId:"class_list"}):void 0),z=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&z&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,z,q]),i.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,m,!1)))},[P,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(z===!1||z&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const Q=Ce(n.tenantEmailDomain,t,r,H,c);e(Q)}},[l.fetchState,c,z]),i.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&f&&p&&a($a()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&f&&p&&a(Ga()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,f,p,V]);const G=()=>{if(r!=null&&t!=null){a(Sa());const Q=Ce(n.tenantEmailDomain,t,r);e(Q)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Oe(d,g,D,f),ae=Ca(d,f,p,L,w),ne=Mt(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:G,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ze(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ze(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=ge(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,R]=i.useState(!1),F=J.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>Xt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(Y.isDebitCardFeatureEnabled),w=Se(L,k),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),P=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&U&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Je(n,K,U)))},[o,g.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:z}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Qt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:z}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const B=J.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(O,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{R(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx($e,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(Gr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:B,navigate:r,currentTenant:k,location:C,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(zr,{windowSize:t,children:e}):null]})},Gr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Jt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ke(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(Pa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),zr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-DNAiUJc8.js";import{a as g}from"./sentry-3H-Lcjnl.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-BR1djmRq.js";import{z as C,b1 as F,x as P,d as V,f as j,ac as b,b2 as A,aq as L,ar as M,q as U}from"./index-DTNnwrfZ.js";import{eQ as D,fE as B,s8 as R,fz as _,c2 as z,Mv as G,bn as q,q9 as Y,pZ as Z,ka as H,lG as S,Mw as Q,bE as $,cv as N,lO as J,lR as K}from"./zeni-epic-state-B1K_6mks.js";import"./mui-CgXDoZXy.js";import{c as W}from"./routePaths-OfzBAr6P.js";import{M as X}from"./MobileAppDrawer-BMQqN7ku.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="bbdbaa48-f704-475b-92d0-74a21579752e",n._sentryDebugIdIdentifier="sentry-dbid-bbdbaa48-f704-475b-92d0-74a21579752e")}catch{}})();const ee=E(function(n){const t=_(n),i=C.getSignedInUser(),l=D(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:q(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(K())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.companySubIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(Q(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n(H({files:e}))},onDeleteFile:e=>{n(Z(e))},onEditFileName:(e,a)=>{n(Y(e,a.split(".")[0]))}}})(A);function de(){const n=w(),t=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(R())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(F,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-Cjqg1XsV.js";import{a as g}from"./sentry-DTwqiEdO.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-B1Jz41nC.js";import{z as C,b1 as F,x as P,d as V,f as j,ac as b,b2 as A,aq as L,ar as M,q as U}from"./index-DnoGJKuR.js";import{eQ as D,fE as B,s8 as R,fz as _,c2 as z,Mv as G,bn as q,q9 as Y,pZ as Z,ka as H,lG as S,Mw as Q,bE as $,cv as N,lO as J,lR as K}from"./zeni-epic-state-CFJ-5drS.js";import"./mui-DSSmRxLI.js";import{c as W}from"./routePaths-DBUEUOgS.js";import{M as X}from"./MobileAppDrawer-B5ryN7bV.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="bbdbaa48-f704-475b-92d0-74a21579752e",n._sentryDebugIdIdentifier="sentry-dbid-bbdbaa48-f704-475b-92d0-74a21579752e")}catch{}})();const ee=E(function(n){const t=_(n),i=C.getSignedInUser(),l=D(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:q(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(K())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.companySubIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(Q(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n(H({files:e}))},onDeleteFile:e=>{n(Z(e))},onEditFileName:(e,a)=>{n(Y(e,a.split(".")[0]))}}})(A);function de(){const n=w(),t=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(R())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(F,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,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-DNAiUJc8.js";import{a}from"./sentry-3H-Lcjnl.js";import{h as D,u as v,g as u,N as w}from"./core-BR1djmRq.js";import{J9 as A,eQ as O,fl as U,mS as _,fN as E,fk as j,eR as L,Jg as k}from"./zeni-epic-state-B1K_6mks.js";import{u as F,z as p,L as g,D as $,o as H}from"./index-DTNnwrfZ.js";import{n as R}from"./mui-CgXDoZXy.js";import{t as z}from"./getLocaleForTenant-H-2L0ToN.js";import{g as Q,Q as J}from"./QBOConnectionScreen-6XjCJ6tV.js";import"./recharts-DzRX0aWK.js";import"./analytics-B4UJAsLA.js";import"./plaid-A3mYO1wj.js";import"./dnd-WGKE6-QR.js";import"./stripe-DMRn4zHo.js";import"./lottie-CXwx4IFe.js";import"./lexical-GYG14AuY.js";import"./pdf-B31DLhP9.js";import"./utils-BrTYpNjH.js";import"./empty-fPNr7WEf.js";import"./pdf-lib-BJaZbPRK.js";import"./index-RLXxDu6p.js";import"./url-c0rW6TXY.js";import"./index-FsVF33P-.js";import"./decodeURIComponentSafe-rU-V5qiY.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="0a98b192-a0c4-4670-822f-b14995350685",t._sentryDebugIdIdentifier="sentry-dbid-0a98b192-a0c4-4670-822f-b14995350685")}catch{}})();const P=R.div`
1
+ import{j as C}from"./liveblocks-Cjqg1XsV.js";import{a}from"./sentry-DTwqiEdO.js";import{h as D,u as v,g as u,N as w}from"./core-B1Jz41nC.js";import{J9 as A,eQ as O,fl as U,mS as _,fN as E,fk as j,eR as L,Jg as k}from"./zeni-epic-state-CFJ-5drS.js";import{u as F,z as p,L as g,D as $,o as H}from"./index-DnoGJKuR.js";import{n as R}from"./mui-DSSmRxLI.js";import{t as z}from"./getLocaleForTenant-D68g9mo1.js";import{g as Q,Q as J}from"./QBOConnectionScreen-D3T_HW3H.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";import"./empty-oTLwTSll.js";import"./pdf-lib-DFDlNXnV.js";import"./index-C6t5Pm8y.js";import"./url-CFX7crLz.js";import"./index-B90Cr8bv.js";import"./decodeURIComponentSafe-HQbzOYEL.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="0a98b192-a0c4-4670-822f-b14995350685",t._sentryDebugIdIdentifier="sentry-dbid-0a98b192-a0c4-4670-822f-b14995350685")}catch{}})();const P=R.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -0,0 +1 @@
1
+ import{j as i}from"./liveblocks-Cjqg1XsV.js";import{z as a}from"./index-DnoGJKuR.js";import{g as n}from"./QBOConnectionScreen-D3T_HW3H.js";import"./sentry-DTwqiEdO.js";import{u as p,N as s}from"./core-B1Jz41nC.js";import"./zeni-epic-state-CFJ-5drS.js";import"./recharts-DW5j2-RD.js";import"./mui-DSSmRxLI.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";import"./empty-oTLwTSll.js";import"./pdf-lib-DFDlNXnV.js";import"./index-C6t5Pm8y.js";import"./url-CFX7crLz.js";import"./index-B90Cr8bv.js";import"./decodeURIComponentSafe-HQbzOYEL.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="8d904e89-6b8e-4c86-980c-585a84d9d789",t._sentryDebugIdIdentifier="sentry-dbid-8d904e89-6b8e-4c86-980c-585a84d9d789")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DNAiUJc8.js";import{t as Ke,A as Ce}from"./AddressScreen-DYJtp3rR.js";import $e from"./NotFoundScreen-BbHcWObl.js";import{a as g}from"./sentry-3H-Lcjnl.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 ze,n as Me,o as z}from"./core-BR1djmRq.js";import{r as de,c as le,z as B,y as ue,m as qe,S as _,q as V,x as W,d as N,v as je,f as X,am as Qe,Z as Ze,an as ke,h as te,ao as He,ap as Ie,o as We,aq as Je,ar as Ee,as as Xe}from"./index-DTNnwrfZ.js";import{bn as Ye,eQ as ee,fd as et,eW as pe,eU as me,bv as tt,mQ as at,f9 as nt,bO as ot,je as ae,jh as ve,JF as st,bT as it,c2 as ge,sm as fe,s7 as rt,Ka as Y,sn as _e,Hx as ct,ki as Ue,Kb as Ve,Kc as dt,Kd as lt,Ke as ut,jc as pt,jf as mt,s9 as Be,sl as gt,bE as xe,cv as ft,sz as Te,q9 as ht,pZ as yt,ka as St,fC as bt,fB as Ct,fA as kt,Kf as It,s1 as Et,sA as xt,sD as Tt,sG as Ot,sM as At,cU as Pt}from"./zeni-epic-state-B1K_6mks.js";import{n as he}from"./mui-CgXDoZXy.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-6XjCJ6tV.js";import"./recharts-DzRX0aWK.js";import"./analytics-B4UJAsLA.js";import"./plaid-A3mYO1wj.js";import"./dnd-WGKE6-QR.js";import"./stripe-DMRn4zHo.js";import"./lottie-CXwx4IFe.js";import"./lexical-GYG14AuY.js";import"./pdf-B31DLhP9.js";import"./utils-BrTYpNjH.js";import"./empty-fPNr7WEf.js";import"./pdf-lib-BJaZbPRK.js";import"./index-RLXxDu6p.js";import"./url-c0rW6TXY.js";import"./index-FsVF33P-.js";import"./decodeURIComponentSafe-rU-V5qiY.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]="c8cce3e5-0d11-4c25-983b-70fad6be712f",t._sentryDebugIdIdentifier="sentry-dbid-c8cce3e5-0d11-4c25-983b-70fad6be712f")}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"}})}}})(Qe),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),G=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),A=me(c),P=[],Q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&P.push("top_expenses"),$===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),q===!1&&P.push("reimbursement_card","reimbursement_promo_card"),k===!1&&P.push("zeni_accounts_promo_card"),h===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||A||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,P)))},[d,O,j,A,i,c.tenantId,s]),g.useEffect(()=>{(j||A)&&setTimeout(()=>{S(!0)},5e3)},[j,A]),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(A)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-Cjqg1XsV.js";import{t as Ke,A as Ce}from"./AddressScreen-DT0Q15o7.js";import $e from"./NotFoundScreen-CiYbMRBm.js";import{a as g}from"./sentry-DTwqiEdO.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 ze,n as Me,o as z}from"./core-B1Jz41nC.js";import{r as de,c as le,z as B,y as ue,m as qe,S as _,q as V,x as W,d as N,v as je,f as X,am as Qe,Z as Ze,an as ke,h as te,ao as He,ap as Ie,o as We,aq as Je,ar as Ee,as as Xe}from"./index-DnoGJKuR.js";import{bn as Ye,eQ as ee,fd as et,eW as pe,eU as me,bv as tt,mQ as at,f9 as nt,bO as ot,je as ae,jh as ve,JF as st,bT as it,c2 as ge,sm as fe,s7 as rt,Ka as Y,sn as _e,Hx as ct,ki as Ue,Kb as Ve,Kc as dt,Kd as lt,Ke as ut,jc as pt,jf as mt,s9 as Be,sl as gt,bE as xe,cv as ft,sz as Te,q9 as ht,pZ as yt,ka as St,fC as bt,fB as Ct,fA as kt,Kf as It,s1 as Et,sA as xt,sD as Tt,sG as Ot,sM as At,cU as Pt}from"./zeni-epic-state-CFJ-5drS.js";import{n as he}from"./mui-DSSmRxLI.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-D3T_HW3H.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";import"./empty-oTLwTSll.js";import"./pdf-lib-DFDlNXnV.js";import"./index-C6t5Pm8y.js";import"./url-CFX7crLz.js";import"./index-B90Cr8bv.js";import"./decodeURIComponentSafe-HQbzOYEL.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]="c8cce3e5-0d11-4c25-983b-70fad6be712f",t._sentryDebugIdIdentifier="sentry-dbid-c8cce3e5-0d11-4c25-983b-70fad6be712f")}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"}})}}})(Qe),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),G=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),A=me(c),P=[],Q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&P.push("top_expenses"),$===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),q===!1&&P.push("reimbursement_card","reimbursement_promo_card"),k===!1&&P.push("zeni_accounts_promo_card"),h===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||A||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,P)))},[d,O,j,A,i,c.tenantId,s]),g.useEffect(()=>{(j||A)&&setTimeout(()=>{S(!0)},5e3)},[j,A]),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(A)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-DNAiUJc8.js";import{l as z,g as S,u as q,h as $,j as Z,k as H,s as Ka,n as st,o as w}from"./core-BR1djmRq.js";import{eQ as j,Kv as Ge,bE as Vt,bq as he,LI as qa,i2 as Za,LJ as wt,LK as Qa,i5 as rt,LL as Le,LM as Ha,ia as Wa,LN as Dt,LO as Xa,ie as it,LP as Ue,LQ as Ja,cl as lt,LR as en,LS as tn,KP as an,j8 as nn,LT as on,bn as Ee,LU as Nt,Kj as ae,bc as $t,jm as zt,m_ as Kt,j5 as qt,Kl as ne,Kk as Q,f5 as sn,eN as rn,fn as cn,LV as ln,LW as dn,LX as Zt,LY as _e,uc as Ie,ud as Te,uA as fe,uu as oe,uh as xe,LZ as un,L_ as mn,L$ as pn,M0 as Qt,M1 as ke,M2 as hn,dE as Ve,qJ as Ht,M3 as fn,M4 as gn,M5 as bn,M6 as dt,JI as ut,jC as ge,uI as mt,qR as Cn,M7 as _n,ue as Ft,qM as me,qI as Wt,M8 as ie,M9 as kn,Ma as pt,JG as ht,sQ as Xt,Mb as Sn,Mc as yn,Md as An,Me as ft,t1 as vn,Mf as En,ug as Pt,sP as Jt,Mg as ce,Mh as In,bv as ea,uM as ta,Mi as Tn,Mj as xn,Mk as wn,Ml as gt,uH as Dn,Mm as Fn,uf as Ot,uL as aa,Mn as le,Mo as Pn,Mp as On,Mq as na,jr as oa,mX as sa,jw as ra,mV as ia,mU as ca,mT as la,sc as Mn,fd as Rn,cO as Bn,cP as jn,mQ as Ln,f9 as Un,n5 as Yn,DQ as Mt,Mr as Gn,Ms as Vn,Mt as Nn,Mu as $n,b5 as bt,f0 as zn,gM as Kn,fE as qn,m$ as Zn,i_ as Qn,mY as Hn,mW as Wn,eW as Xn,eU as Jn}from"./zeni-epic-state-B1K_6mks.js";import{z as R,X as W,q as D,d as I,D as K,aR as eo,x as we,aS as da,f as V,aT as to,c as De,aU as ua,y as Fe,S as B,m as ao,aV as no,aW as oo,Q as ma,Z as so,a as pa,a1 as ro,aK as ha,aX as io,aY as co,W as lo,aZ as uo,a_ as mo,an as po,p as ho,T as fo,a$ as go,b0 as ye}from"./index-DTNnwrfZ.js";import{n as Ct}from"./mui-CgXDoZXy.js";import{a as C}from"./sentry-3H-Lcjnl.js";import{w as fa}from"./withTransactionSidePanel-DiSHE4Oz.js";import{b as ga,t as be,e as se,a as _t,v as bo}from"./routePaths-OfzBAr6P.js";import{u as X}from"./useAskAiCfoHostNavButtonProps-1lbCkmvt.js";import{c as Pe,b as Co,u as _o}from"./useFetchSuggestedQuestionsWhenReady--BxYx_7U.js";import ve from"./NotFoundScreen-BbHcWObl.js";import{u as ko}from"./useInitialThreadRequest-DcJwlozW.js";import{t as ba}from"./analyticsHelper-YeXzy43q.js";import{C as So}from"./CompanyPassportScreen-rc6B6jQO.js";import{F as yo}from"./FeaturePreviewScreen-SE_WbAPr.js";import{R as Ao}from"./ReferralListScreen-DEPmERTK.js";import"./recharts-DzRX0aWK.js";import"./analytics-B4UJAsLA.js";import"./plaid-A3mYO1wj.js";import"./dnd-WGKE6-QR.js";import"./stripe-DMRn4zHo.js";import"./lottie-CXwx4IFe.js";import"./lexical-GYG14AuY.js";import"./pdf-B31DLhP9.js";import"./utils-BrTYpNjH.js";import"./TransactionDetailScreen-DmjDqinu.js";import"./decodeURIComponentSafe-rU-V5qiY.js";import"./MobileAppDrawer-BMQqN7ku.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]="e06e160a-64f2-4a6e-9881-7dc4b7167c5c",e._sentryDebugIdIdentifier="sentry-dbid-e06e160a-64f2-4a6e-9881-7dc4b7167c5c")}catch{}})();const vo=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(v=>v.tenantState.currentTenantId),d=S(v=>j(v)),{tenantEmailDomain:p}=z(),_=q(),b=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=C.useMemo(()=>({authParams:u,companyName:b,downloadEndPoint:`${W}/agingDetailedReport`,timezone:Ge()}),[]),m=C.useMemo(()=>r!=null?Vt(r):he(),[r]),h=$(),f=Z(),k=S(v=>qa(v,m,o)),y=C.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),g=C.useCallback(()=>{f("../../",{relative:"path"})},[]),A=C.useCallback((v,L)=>{h(wt({sortKey:v,sortOrder:L}))},[]),P=C.useCallback(v=>{h(wt({downloadState:v}))},[]),U=C.useCallback(v=>{if(e)e(v.transactionId,v.transactionType);else if(p!=null){const L=ga({id:v.transactionId,type:v.transactionType},p);f(L);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f(L,{state:{pathnameStackToGoBack:de}})}},[p,e]),T=C.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return C.useEffect(()=>{y()},[]),C.useEffect(()=>{k.fetchState==="Completed"&&T()},[T,k.fetchState]),l.jsx(eo,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:U,onReload:y,onBackClick:g,onColumnSortConfigChanged:A,updateDownloadStateHandler:P,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Eo=()=>{const e=$(),a=Z(),t=S(A=>Qa(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=X({mobileExploreReferrer:"AP Aging"});Pe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>j(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=C.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${W}/agingReport`,timezone:Ge()}),[]),b=t.apAgingUIState.selectedDate??he(),u=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(b))},[]);C.useEffect(()=>{u()},[]);const c=C.useCallback(()=>{a("../",{relative:"path"})},[]),m=C.useCallback(A=>{e(Le({searchString:A}))},[]),h=C.useCallback((A,P)=>{e(Le({sortKey:P,sortOrder:A}))},[]),f=C.useCallback(A=>{a(`./${A}/${b.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[b]),k=C.useCallback(A=>{e(Le({downloadState:A}))},[]),y=C.useCallback((A,P)=>{},[]),g=C.useCallback((A,P)=>{e(Le({selectedDate:A,agingDateSelectionType:P})),e(rt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:I,onLoad:A=>A.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:g,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Io=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(T=>j(T)),{tenantEmailDomain:d}=z(),p=q(),_=i.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=C.useMemo(()=>({authParams:b,companyName:_,downloadEndPoint:`${W}/agingDetailedReport`,timezone:Ge()}),[]),c=C.useMemo(()=>r!=null?Vt(r):he(),[r]),m=$(),h=Z(),f=S(T=>Ha(T,c,o)),k=C.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Wa(o,c))},[c]),y=C.useCallback(()=>{h("../../",{relative:"path"})},[]),g=C.useCallback((T,v)=>{m(Dt({sortKey:T,sortOrder:v}))},[]),A=C.useCallback(T=>{m(Dt({downloadState:T}))},[]),P=C.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(d!=null){const v=ga({id:T.transactionId,type:T.transactionType},d);h(v);const L=D(p.state?.pathnameStackToGoBack,p.pathname);h(v,{state:{pathnameStackToGoBack:L}})}},[d,e]),U=C.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return C.useEffect(()=>{k()},[]),C.useEffect(()=>{f.fetchState==="Completed"&&U()},[f.fetchState,U]),l.jsx(to,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:P,onReload:k,onBackClick:y,onColumnSortConfigChanged:g,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),To=()=>{const e=$(),a=Z(),t=S(g=>Xa(g)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=X({mobileExploreReferrer:"AR Aging"});Pe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(g=>j(g)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=C.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${W}/agingReport`,timezone:Ge()}),[]),_=t.arAgingUIState.selectedDate??he(),b=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);C.useEffect(()=>{b()},[]);const u=C.useCallback(()=>{a("../",{relative:"path"})},[]),c=C.useCallback(g=>{e(Ue({searchString:g}))},[]),m=C.useCallback((g,A)=>{e(Ue({sortKey:A,sortOrder:g}))},[]),h=C.useCallback(g=>{a(`./${g}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=C.useCallback(g=>{e(Ue({downloadState:g}))},[]),k=C.useCallback((g,A)=>{e(Ue({selectedDate:g,agingDateSelectionType:A})),e(it(g))},[]),y=C.useCallback((g,A)=>{e(Ja({nodeId:g,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:I,onLoad:g=>g.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:b,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ca=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function _a(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=be(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const xo=H(function(e){const a=en(e).accountsInOrder.map((n,o)=>Ca(n,o)),t=tn(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},_a)(ua),wo=H(function(e){const a=on(e).accountsInOrder.map((o,r)=>Ca(o,r)),t=R.getSignedInUser(),n=Ee(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},_a)(ua);function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=De(),o=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Fo(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=De(),o=lt(n?.loggedInUserRoleMap),r=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(wo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Po=Ct.div`
1
+ import{j as l}from"./liveblocks-Cjqg1XsV.js";import{l as z,g as S,u as q,h as $,j as Z,k as H,s as Ka,n as st,o as w}from"./core-B1Jz41nC.js";import{eQ as j,Kv as Ge,bE as Vt,bq as he,LI as qa,i2 as Za,LJ as wt,LK as Qa,i5 as rt,LL as Le,LM as Ha,ia as Wa,LN as Dt,LO as Xa,ie as it,LP as Ue,LQ as Ja,cl as lt,LR as en,LS as tn,KP as an,j8 as nn,LT as on,bn as Ee,LU as Nt,Kj as ae,bc as $t,jm as zt,m_ as Kt,j5 as qt,Kl as ne,Kk as Q,f5 as sn,eN as rn,fn as cn,LV as ln,LW as dn,LX as Zt,LY as _e,uc as Ie,ud as Te,uA as fe,uu as oe,uh as xe,LZ as un,L_ as mn,L$ as pn,M0 as Qt,M1 as ke,M2 as hn,dE as Ve,qJ as Ht,M3 as fn,M4 as gn,M5 as bn,M6 as dt,JI as ut,jC as ge,uI as mt,qR as Cn,M7 as _n,ue as Ft,qM as me,qI as Wt,M8 as ie,M9 as kn,Ma as pt,JG as ht,sQ as Xt,Mb as Sn,Mc as yn,Md as An,Me as ft,t1 as vn,Mf as En,ug as Pt,sP as Jt,Mg as ce,Mh as In,bv as ea,uM as ta,Mi as Tn,Mj as xn,Mk as wn,Ml as gt,uH as Dn,Mm as Fn,uf as Ot,uL as aa,Mn as le,Mo as Pn,Mp as On,Mq as na,jr as oa,mX as sa,jw as ra,mV as ia,mU as ca,mT as la,sc as Mn,fd as Rn,cO as Bn,cP as jn,mQ as Ln,f9 as Un,n5 as Yn,DQ as Mt,Mr as Gn,Ms as Vn,Mt as Nn,Mu as $n,b5 as bt,f0 as zn,gM as Kn,fE as qn,m$ as Zn,i_ as Qn,mY as Hn,mW as Wn,eW as Xn,eU as Jn}from"./zeni-epic-state-CFJ-5drS.js";import{z as R,X as W,q as D,d as I,D as K,aR as eo,x as we,aS as da,f as V,aT as to,c as De,aU as ua,y as Fe,S as B,m as ao,aV as no,aW as oo,Q as ma,Z as so,a as pa,a1 as ro,aK as ha,aX as io,aY as co,W as lo,aZ as uo,a_ as mo,an as po,p as ho,T as fo,a$ as go,b0 as ye}from"./index-DnoGJKuR.js";import{n as Ct}from"./mui-DSSmRxLI.js";import{a as C}from"./sentry-DTwqiEdO.js";import{w as fa}from"./withTransactionSidePanel-75BTvZCV.js";import{b as ga,t as be,e as se,a as _t,v as bo}from"./routePaths-DBUEUOgS.js";import{u as X}from"./useAskAiCfoHostNavButtonProps-D1ncSYVo.js";import{c as Pe,b as Co,u as _o}from"./useFetchSuggestedQuestionsWhenReady-BD5FIrcH.js";import ve from"./NotFoundScreen-CiYbMRBm.js";import{u as ko}from"./useInitialThreadRequest-CPdwuo-t.js";import{t as ba}from"./analyticsHelper-CRpkSjLL.js";import{C as So}from"./CompanyPassportScreen-BSC4O5TV.js";import{F as yo}from"./FeaturePreviewScreen-C38iY35s.js";import{R as Ao}from"./ReferralListScreen-BIW3RLSW.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";import"./TransactionDetailScreen-DBF06PeT.js";import"./decodeURIComponentSafe-HQbzOYEL.js";import"./MobileAppDrawer-B5ryN7bV.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]="e06e160a-64f2-4a6e-9881-7dc4b7167c5c",e._sentryDebugIdIdentifier="sentry-dbid-e06e160a-64f2-4a6e-9881-7dc4b7167c5c")}catch{}})();const vo=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(v=>v.tenantState.currentTenantId),d=S(v=>j(v)),{tenantEmailDomain:p}=z(),_=q(),b=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=C.useMemo(()=>({authParams:u,companyName:b,downloadEndPoint:`${W}/agingDetailedReport`,timezone:Ge()}),[]),m=C.useMemo(()=>r!=null?Vt(r):he(),[r]),h=$(),f=Z(),k=S(v=>qa(v,m,o)),y=C.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),g=C.useCallback(()=>{f("../../",{relative:"path"})},[]),A=C.useCallback((v,L)=>{h(wt({sortKey:v,sortOrder:L}))},[]),P=C.useCallback(v=>{h(wt({downloadState:v}))},[]),U=C.useCallback(v=>{if(e)e(v.transactionId,v.transactionType);else if(p!=null){const L=ga({id:v.transactionId,type:v.transactionType},p);f(L);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f(L,{state:{pathnameStackToGoBack:de}})}},[p,e]),T=C.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return C.useEffect(()=>{y()},[]),C.useEffect(()=>{k.fetchState==="Completed"&&T()},[T,k.fetchState]),l.jsx(eo,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:U,onReload:y,onBackClick:g,onColumnSortConfigChanged:A,updateDownloadStateHandler:P,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Eo=()=>{const e=$(),a=Z(),t=S(A=>Qa(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=X({mobileExploreReferrer:"AP Aging"});Pe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>j(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=C.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${W}/agingReport`,timezone:Ge()}),[]),b=t.apAgingUIState.selectedDate??he(),u=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(b))},[]);C.useEffect(()=>{u()},[]);const c=C.useCallback(()=>{a("../",{relative:"path"})},[]),m=C.useCallback(A=>{e(Le({searchString:A}))},[]),h=C.useCallback((A,P)=>{e(Le({sortKey:P,sortOrder:A}))},[]),f=C.useCallback(A=>{a(`./${A}/${b.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[b]),k=C.useCallback(A=>{e(Le({downloadState:A}))},[]),y=C.useCallback((A,P)=>{},[]),g=C.useCallback((A,P)=>{e(Le({selectedDate:A,agingDateSelectionType:P})),e(rt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:I,onLoad:A=>A.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:g,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Io=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(T=>j(T)),{tenantEmailDomain:d}=z(),p=q(),_=i.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=C.useMemo(()=>({authParams:b,companyName:_,downloadEndPoint:`${W}/agingDetailedReport`,timezone:Ge()}),[]),c=C.useMemo(()=>r!=null?Vt(r):he(),[r]),m=$(),h=Z(),f=S(T=>Ha(T,c,o)),k=C.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Wa(o,c))},[c]),y=C.useCallback(()=>{h("../../",{relative:"path"})},[]),g=C.useCallback((T,v)=>{m(Dt({sortKey:T,sortOrder:v}))},[]),A=C.useCallback(T=>{m(Dt({downloadState:T}))},[]),P=C.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(d!=null){const v=ga({id:T.transactionId,type:T.transactionType},d);h(v);const L=D(p.state?.pathnameStackToGoBack,p.pathname);h(v,{state:{pathnameStackToGoBack:L}})}},[d,e]),U=C.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return C.useEffect(()=>{k()},[]),C.useEffect(()=>{f.fetchState==="Completed"&&U()},[f.fetchState,U]),l.jsx(to,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:P,onReload:k,onBackClick:y,onColumnSortConfigChanged:g,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),To=()=>{const e=$(),a=Z(),t=S(g=>Xa(g)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=X({mobileExploreReferrer:"AR Aging"});Pe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(g=>j(g)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=C.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${W}/agingReport`,timezone:Ge()}),[]),_=t.arAgingUIState.selectedDate??he(),b=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);C.useEffect(()=>{b()},[]);const u=C.useCallback(()=>{a("../",{relative:"path"})},[]),c=C.useCallback(g=>{e(Ue({searchString:g}))},[]),m=C.useCallback((g,A)=>{e(Ue({sortKey:A,sortOrder:g}))},[]),h=C.useCallback(g=>{a(`./${g}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=C.useCallback(g=>{e(Ue({downloadState:g}))},[]),k=C.useCallback((g,A)=>{e(Ue({selectedDate:g,agingDateSelectionType:A})),e(it(g))},[]),y=C.useCallback((g,A)=>{e(Ja({nodeId:g,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:I,onLoad:g=>g.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:b,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ca=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function _a(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=be(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const xo=H(function(e){const a=en(e).accountsInOrder.map((n,o)=>Ca(n,o)),t=tn(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},_a)(ua),wo=H(function(e){const a=on(e).accountsInOrder.map((o,r)=>Ca(o,r)),t=R.getSignedInUser(),n=Ee(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},_a)(ua);function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=De(),o=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Fo(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=De(),o=lt(n?.loggedInUserRoleMap),r=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(wo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Po=Ct.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-DNAiUJc8.js";import{a as u}from"./sentry-3H-Lcjnl.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-BR1djmRq.js";import{J9 as N,eQ as _,fl as U,Ja as L,mS as R,Jb as z}from"./zeni-epic-state-B1K_6mks.js";import{u as O,z as f,L as T,t as I,D as $,b as j}from"./index-DTNnwrfZ.js";import"./mui-CgXDoZXy.js";import{t as P}from"./getLocaleForTenant-H-2L0ToN.js";import"./recharts-DzRX0aWK.js";import"./analytics-B4UJAsLA.js";import"./plaid-A3mYO1wj.js";import"./dnd-WGKE6-QR.js";import"./stripe-DMRn4zHo.js";import"./lottie-CXwx4IFe.js";import"./lexical-GYG14AuY.js";import"./pdf-B31DLhP9.js";import"./utils-BrTYpNjH.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]="0690d749-15fd-46f1-9347-543338f7fa14",t._sentryDebugIdIdentifier="sentry-dbid-0690d749-15fd-46f1-9347-543338f7fa14")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const J=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of J)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-Cjqg1XsV.js";import{a as u}from"./sentry-DTwqiEdO.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-B1Jz41nC.js";import{J9 as N,eQ as _,fl as U,Ja as L,mS as R,Jb as z}from"./zeni-epic-state-CFJ-5drS.js";import{u as O,z as f,L as T,t as I,D as $,b as j}from"./index-DnoGJKuR.js";import"./mui-DSSmRxLI.js";import{t as P}from"./getLocaleForTenant-D68g9mo1.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.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]="0690d749-15fd-46f1-9347-543338f7fa14",t._sentryDebugIdIdentifier="sentry-dbid-0690d749-15fd-46f1-9347-543338f7fa14")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const J=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of J)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-DNAiUJc8.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-BR1djmRq.js";import{Nc as k,Nj as q,fC as K,fB as M,fA as Q,iz as W,Kk as J,q0 as L,eQ as V,MK as D,ix as T,Nd as S,Nm as F,iv as G,iS as j}from"./zeni-epic-state-B1K_6mks.js";import{bn as X,Z as N,y as R,z as U,m as Z,p,S as v,v as z,bo as Y,o as O,bp as ee,q as te}from"./index-DTNnwrfZ.js";import{n as H}from"./mui-CgXDoZXy.js";import"./sentry-3H-Lcjnl.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]="2ca4bf58-31bb-4991-9036-2964a563801c",e._sentryDebugIdIdentifier="sentry-dbid-2ca4bf58-31bb-4991-9036-2964a563801c")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(J("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
1
+ import{j as l}from"./liveblocks-Cjqg1XsV.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-B1Jz41nC.js";import{Nc as k,Nj as q,fC as K,fB as M,fA as Q,iz as W,Kk as J,q0 as L,eQ as V,MK as D,ix as T,Nd as S,Nm as F,iv as G,iS as j}from"./zeni-epic-state-CFJ-5drS.js";import{bn as X,Z as N,y as R,z as U,m as Z,p,S as v,v as z,bo as Y,o as O,bp as ee,q as te}from"./index-DnoGJKuR.js";import{n as H}from"./mui-DSSmRxLI.js";import"./sentry-DTwqiEdO.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]="2ca4bf58-31bb-4991-9036-2964a563801c",e._sentryDebugIdIdentifier="sentry-dbid-2ca4bf58-31bb-4991-9036-2964a563801c")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(J("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-DNAiUJc8.js";import{Z as c,G as l,m as f}from"./index-DTNnwrfZ.js";import{D as b}from"./mui-CgXDoZXy.js";import"./sentry-3H-Lcjnl.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]="b26b4ae4-0c9b-47d2-a9ac-ad4f0f5041c7",e._sentryDebugIdIdentifier="sentry-dbid-b26b4ae4-0c9b-47d2-a9ac-ad4f0f5041c7")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=c(),s=o?.valuePx(a)??p.drawerLeftMargin.valuePx(a),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{m as D};
1
+ import{j as i}from"./liveblocks-Cjqg1XsV.js";import{Z as c,G as l,m as f}from"./index-DnoGJKuR.js";import{D as b}from"./mui-DSSmRxLI.js";import"./sentry-DTwqiEdO.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]="b26b4ae4-0c9b-47d2-a9ac-ad4f0f5041c7",e._sentryDebugIdIdentifier="sentry-dbid-b26b4ae4-0c9b-47d2-a9ac-ad4f0f5041c7")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=c(),s=o?.valuePx(a)??p.drawerLeftMargin.valuePx(a),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{m as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DNAiUJc8.js";import{a as d}from"./sentry-3H-Lcjnl.js";import{j as A,h as B,u as K,l as G,g as l,N as F,k as O,n as N,o as W}from"./core-BR1djmRq.js";import{Lr as _,eQ as H,KQ as L,kC as M,Hp as k,Lw as Q,Kj as R,jC as V,Hq as S,KV as Y,KW as $,Kl as z,Kk as J}from"./zeni-epic-state-B1K_6mks.js";import{aO as U,d as X,p as Z,q as tt}from"./index-DTNnwrfZ.js";import"./mui-CgXDoZXy.js";import{d as b}from"./decodeURIComponentSafe-rU-V5qiY.js";import{w as et}from"./withTransactionSidePanel-DiSHE4Oz.js";import{e as at,b as nt}from"./routePaths-OfzBAr6P.js";import"./recharts-DzRX0aWK.js";import"./analytics-B4UJAsLA.js";import"./plaid-A3mYO1wj.js";import"./dnd-WGKE6-QR.js";import"./stripe-DMRn4zHo.js";import"./lottie-CXwx4IFe.js";import"./lexical-GYG14AuY.js";import"./pdf-B31DLhP9.js";import"./utils-BrTYpNjH.js";import"./useAskAiCfoHostNavButtonProps-1lbCkmvt.js";import"./useFetchSuggestedQuestionsWhenReady--BxYx_7U.js";import"./TransactionDetailScreen-DmjDqinu.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]="44e034a2-e3b7-466a-8b38-2784ed16bdab",a._sentryDebugIdIdentifier="sentry-dbid-44e034a2-e3b7-466a-8b38-2784ed16bdab")}catch{}})();const ot=O(function(a,t){const e=t.entity,o=Q(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:R(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:V(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(z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Y()),a($()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=K(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:I,entityIdEncoded:j,entityNameEncoded:w}=G(),r=b(j??""),p=b(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),q=l(n=>H(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>L(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:q,tenantEmailDomain:I,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:C(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(N,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
1
+ import{j as s}from"./liveblocks-Cjqg1XsV.js";import{a as d}from"./sentry-DTwqiEdO.js";import{j as A,h as B,u as K,l as G,g as l,N as F,k as O,n as N,o as W}from"./core-B1Jz41nC.js";import{Lr as _,eQ as H,KQ as L,kC as M,Hp as k,Lw as Q,Kj as R,jC as V,Hq as S,KV as Y,KW as $,Kl as z,Kk as J}from"./zeni-epic-state-CFJ-5drS.js";import{aO as U,d as X,p as Z,q as tt}from"./index-DnoGJKuR.js";import"./mui-DSSmRxLI.js";import{d as b}from"./decodeURIComponentSafe-HQbzOYEL.js";import{w as et}from"./withTransactionSidePanel-75BTvZCV.js";import{e as at,b as nt}from"./routePaths-DBUEUOgS.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";import"./useAskAiCfoHostNavButtonProps-D1ncSYVo.js";import"./useFetchSuggestedQuestionsWhenReady-BD5FIrcH.js";import"./TransactionDetailScreen-DBF06PeT.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]="44e034a2-e3b7-466a-8b38-2784ed16bdab",a._sentryDebugIdIdentifier="sentry-dbid-44e034a2-e3b7-466a-8b38-2784ed16bdab")}catch{}})();const ot=O(function(a,t){const e=t.entity,o=Q(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:R(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:V(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(z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Y()),a($()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=K(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:I,entityIdEncoded:j,entityNameEncoded:w}=G(),r=b(j??""),p=b(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),q=l(n=>H(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>L(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:q,tenantEmailDomain:I,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:C(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(N,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-DNAiUJc8.js";import xn from"./NotFoundScreen-BbHcWObl.js";import{a,b as Pt}from"./sentry-3H-Lcjnl.js";import{n as Fe,S as Rn}from"./mui-CgXDoZXy.js";import{h as ce,j as wt,u as Ge,g as U,k as Dn,l as rt,n as Un,o as Le}from"./core-BR1djmRq.js";import{eQ as Re,PL as Fn,n0 as Se,fg as Bn,qD as _n,ni as xt,nD as Rt,PM as Dt,nN as Mn,PN as Ut,nb as Vn,q9 as On,e$ as pe,PO as De,sJ as Ft,BU as Bt,PP as _t,PQ as jn,pQ as Qe,Ls as dt,Lu as Ln,jF as zn,Lv as $n,jM as qn,cW as Gn,tM as Ne,no as Mt,nS as Ue,PR as Qn,Kl as ut,Kk as Pe,PS as mt,k1 as Nn,PT as Jn,PU as Yn,PV as Kn,PW as Wn,nv as Hn,ng as ie,nV as we,PX as Xn,PY as Zn,PZ as ea,o0 as ta,jQ as na,jH as aa,P_ as oa,jP as ht,LC as sa,P$ as ca,Q0 as ia,pM as la,pr as ra,nT as ge,pq as ze,Q1 as da,Q2 as ua,lk as ma,bq as ha,lf as pt,l1 as pa,Q3 as ga,gO as gt,fS as Ca,lc as Sa,vF as Ia,Q4 as fa,or as ka,om as Ea,oq as va,ob as ya,Q5 as ba,f2 as Vt,nG as Aa,nr as Ta,fh as Ct,nX as Pa,Q6 as wa,nU as Ot,Q7 as xa,Q8 as Ra,Q9 as Da,Qa as Ua,Qb as St,pY as Fa,ph as Ba,Kj as _a,jO as Ma,Qc as Va,Gq as Oa,jN as ja,jC as La,f1 as za,oS as jt,p9 as $a,nR as It,nW as qa,bE as Ga,l9 as Qa,l6 as Na,Qd as Ja,oa as ft,p7 as kt,p5 as Ya,oX as Ka,oC as Wa,p8 as Ha,Qe as Xa,Qf as Za,oG as eo,Qg as to,ow as no,oF as ao,oD as oo,pc as so}from"./zeni-epic-state-B1K_6mks.js";import{y as Lt,S as Ce,d as L,q as W,T as zt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,v as $t,cz as ro,an as $e,D as uo,cA as mo,X as ho,cB as po,Q as go,cC as Co,cD as So,r as Io,c as fo,aK as ko,b1 as Eo,G as vo,cE as yo}from"./index-DTNnwrfZ.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-1lbCkmvt.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady--BxYx_7U.js";import{c as vt,C as bo}from"./TransactionDetailScreen-DmjDqinu.js";import{w as Ao}from"./withTransactionSidePanel-DiSHE4Oz.js";import{h as To,v as Po}from"./routePaths-OfzBAr6P.js";import{g as qe}from"./accountMappingHelper-BonLh9TQ.js";import{D as wo}from"./DrawerScreen-DrwckvEs.js";import"./recharts-DzRX0aWK.js";import"./analytics-B4UJAsLA.js";import"./plaid-A3mYO1wj.js";import"./dnd-WGKE6-QR.js";import"./stripe-DMRn4zHo.js";import"./lottie-CXwx4IFe.js";import"./lexical-GYG14AuY.js";import"./pdf-B31DLhP9.js";import"./utils-BrTYpNjH.js";import"./decodeURIComponentSafe-rU-V5qiY.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]="a92ade64-28c7-4e95-a3a5-d635416f38df",t._sentryDebugIdIdentifier="sentry-dbid-a92ade64-28c7-4e95-a3a5-d635416f38df")}catch{}})();const xo=()=>{const t=ce(),i=wt(),A=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,Y=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:Y}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=W(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Gt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
1
+ import{j as C}from"./liveblocks-Cjqg1XsV.js";import xn from"./NotFoundScreen-CiYbMRBm.js";import{a,b as Pt}from"./sentry-DTwqiEdO.js";import{n as Fe,S as Rn}from"./mui-DSSmRxLI.js";import{h as ce,j as wt,u as Ge,g as U,k as Dn,l as rt,n as Un,o as Le}from"./core-B1Jz41nC.js";import{eQ as Re,PL as Fn,n0 as Se,fg as Bn,qD as _n,ni as xt,nD as Rt,PM as Dt,nN as Mn,PN as Ut,nb as Vn,q9 as On,e$ as pe,PO as De,sJ as Ft,BU as Bt,PP as _t,PQ as jn,pQ as Qe,Ls as dt,Lu as Ln,jF as zn,Lv as $n,jM as qn,cW as Gn,tM as Ne,no as Mt,nS as Ue,PR as Qn,Kl as ut,Kk as Pe,PS as mt,k1 as Nn,PT as Jn,PU as Yn,PV as Kn,PW as Wn,nv as Hn,ng as ie,nV as we,PX as Xn,PY as Zn,PZ as ea,o0 as ta,jQ as na,jH as aa,P_ as oa,jP as ht,LC as sa,P$ as ca,Q0 as ia,pM as la,pr as ra,nT as ge,pq as ze,Q1 as da,Q2 as ua,lk as ma,bq as ha,lf as pt,l1 as pa,Q3 as ga,gO as gt,fS as Ca,lc as Sa,vF as Ia,Q4 as fa,or as ka,om as Ea,oq as va,ob as ya,Q5 as ba,f2 as Vt,nG as Aa,nr as Ta,fh as Ct,nX as Pa,Q6 as wa,nU as Ot,Q7 as xa,Q8 as Ra,Q9 as Da,Qa as Ua,Qb as St,pY as Fa,ph as Ba,Kj as _a,jO as Ma,Qc as Va,Gq as Oa,jN as ja,jC as La,f1 as za,oS as jt,p9 as $a,nR as It,nW as qa,bE as Ga,l9 as Qa,l6 as Na,Qd as Ja,oa as ft,p7 as kt,p5 as Ya,oX as Ka,oC as Wa,p8 as Ha,Qe as Xa,Qf as Za,oG as eo,Qg as to,ow as no,oF as ao,oD as oo,pc as so}from"./zeni-epic-state-CFJ-5drS.js";import{y as Lt,S as Ce,d as L,q as W,T as zt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,v as $t,cz as ro,an as $e,D as uo,cA as mo,X as ho,cB as po,Q as go,cC as Co,cD as So,r as Io,c as fo,aK as ko,b1 as Eo,G as vo,cE as yo}from"./index-DnoGJKuR.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-D1ncSYVo.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-BD5FIrcH.js";import{c as vt,C as bo}from"./TransactionDetailScreen-DBF06PeT.js";import{w as Ao}from"./withTransactionSidePanel-75BTvZCV.js";import{h as To,v as Po}from"./routePaths-DBUEUOgS.js";import{g as qe}from"./accountMappingHelper-DN2NK9FA.js";import{D as wo}from"./DrawerScreen-C7_25xjY.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";import"./decodeURIComponentSafe-HQbzOYEL.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]="a92ade64-28c7-4e95-a3a5-d635416f38df",t._sentryDebugIdIdentifier="sentry-dbid-a92ade64-28c7-4e95-a3a5-d635416f38df")}catch{}})();const xo=()=>{const t=ce(),i=wt(),A=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,Y=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:Y}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=W(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Gt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DNAiUJc8.js";import{a as r}from"./sentry-3H-Lcjnl.js";import{Y as i,_ as l,a0 as p,p as d}from"./index-DTNnwrfZ.js";import"./mui-CgXDoZXy.js";import m from"./NotFoundScreen-BbHcWObl.js";import{j as u,u as b}from"./core-BR1djmRq.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]="6cc6e893-8e4c-439b-a6ff-557044a4a5fa",e._sentryDebugIdIdentifier="sentry-dbid-6cc6e893-8e4c-439b-a6ff-557044a4a5fa")}catch{}})();const j=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),c=r.useCallback(()=>{(()=>{const n=d(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:c}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{j as F};
1
+ import{j as s}from"./liveblocks-Cjqg1XsV.js";import{a as r}from"./sentry-DTwqiEdO.js";import{Y as i,_ as l,a0 as p,p as d}from"./index-DnoGJKuR.js";import"./mui-DSSmRxLI.js";import m from"./NotFoundScreen-CiYbMRBm.js";import{j as u,u as b}from"./core-B1Jz41nC.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]="6cc6e893-8e4c-439b-a6ff-557044a4a5fa",e._sentryDebugIdIdentifier="sentry-dbid-6cc6e893-8e4c-439b-a6ff-557044a4a5fa")}catch{}})();const j=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),c=r.useCallback(()=>{(()=>{const n=d(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:c}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{j as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-3H-Lcjnl.js";import{h as l,j as f,u as m}from"./core-BR1djmRq.js";import{gv as p,Jx as g,Jy as _}from"./zeni-epic-state-B1K_6mks.js";import{u as b,L as h,z as y}from"./index-DTNnwrfZ.js";import"./liveblocks-DNAiUJc8.js";import"./recharts-DzRX0aWK.js";import"./mui-CgXDoZXy.js";import"./analytics-B4UJAsLA.js";import"./plaid-A3mYO1wj.js";import"./dnd-WGKE6-QR.js";import"./stripe-DMRn4zHo.js";import"./lottie-CXwx4IFe.js";import"./lexical-GYG14AuY.js";import"./pdf-B31DLhP9.js";import"./utils-BrTYpNjH.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="38346526-e167-43b6-a777-34fdf3173551",e._sentryDebugIdIdentifier="sentry-dbid-38346526-e167-43b6-a777-34fdf3173551")}catch{}})();function z(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:c}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{z as default};
1
+ import{a as r}from"./sentry-DTwqiEdO.js";import{h as l,j as f,u as m}from"./core-B1Jz41nC.js";import{gv as p,Jx as g,Jy as _}from"./zeni-epic-state-CFJ-5drS.js";import{u as b,L as h,z as y}from"./index-DnoGJKuR.js";import"./liveblocks-Cjqg1XsV.js";import"./recharts-DW5j2-RD.js";import"./mui-DSSmRxLI.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="38346526-e167-43b6-a777-34fdf3173551",e._sentryDebugIdIdentifier="sentry-dbid-38346526-e167-43b6-a777-34fdf3173551")}catch{}})();function z(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:c}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{z as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-DNAiUJc8.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as E,N as ae,n as ne,o as p}from"./core-BR1djmRq.js";import{Jq as k,Jr as v,Js as T,zv as z,zh as G,Jt as B,Ju as oe,Jv as se,zl as ie,eR as $,zs as le,zp as re}from"./zeni-epic-state-B1K_6mks.js";import{Z as g,o as r,C as de,d as j,h as J,j as ce,p as me,k as pe,q as H,y as ue,S as he,w as xe,r as ge,m as fe,s as we,v as be,x as Se,B as ye,A as ke,E as ve,G as je,$ as $e}from"./index-DTNnwrfZ.js";import{n as m}from"./mui-CgXDoZXy.js";import f from"./NotFoundScreen-BbHcWObl.js";import{a as I}from"./sentry-3H-Lcjnl.js";import"./recharts-DzRX0aWK.js";import"./analytics-B4UJAsLA.js";import"./plaid-A3mYO1wj.js";import"./dnd-WGKE6-QR.js";import"./stripe-DMRn4zHo.js";import"./lottie-CXwx4IFe.js";import"./lexical-GYG14AuY.js";import"./pdf-B31DLhP9.js";import"./utils-BrTYpNjH.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]="7e8cd412-b43c-4c7c-8647-dc97c492e142",e._sentryDebugIdIdentifier="sentry-dbid-7e8cd412-b43c-4c7c-8647-dc97c492e142")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-Cjqg1XsV.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as E,N as ae,n as ne,o as p}from"./core-B1Jz41nC.js";import{Jq as k,Jr as v,Js as T,zv as z,zh as G,Jt as B,Ju as oe,Jv as se,zl as ie,eR as $,zs as le,zp as re}from"./zeni-epic-state-CFJ-5drS.js";import{Z as g,o as r,C as de,d as j,h as J,j as ce,p as me,k as pe,q as H,y as ue,S as he,w as xe,r as ge,m as fe,s as we,v as be,x as Se,B as ye,A as ke,E as ve,G as je,$ as $e}from"./index-DnoGJKuR.js";import{n as m}from"./mui-DSSmRxLI.js";import f from"./NotFoundScreen-CiYbMRBm.js";import{a as I}from"./sentry-DTwqiEdO.js";import"./recharts-DW5j2-RD.js";import"./analytics-B134UjSL.js";import"./plaid-H6p_O3yl.js";import"./dnd-DumzdahX.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-v1nIzb.js";import"./lexical-DsIUchFW.js";import"./pdf-SAu_SEbF.js";import"./utils-CCEyXo02.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]="7e8cd412-b43c-4c7c-8647-dc97c492e142",e._sentryDebugIdIdentifier="sentry-dbid-7e8cd412-b43c-4c7c-8647-dc97c492e142")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;