@zeniai/web-app-ui 5.0.68-qa → 5.0.69-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/assets/AddressRoutes-1NXz8t4Q.js +1 -0
  2. package/dist/assets/{AddressScreen-2d2ovpiZ.js → AddressScreen-DcX4lc_F.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-LLFGWtB2.js → AiCfoScreen-B-SD-BvW.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-Cngtnc1t.js → BillPayApprovalRoutes-Basd0KQv.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-CMrCjkm3.js → BillPayRoutes-xwiyRCEj.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-Ck14gI3x.js → BusinessVerificationPageScreen-B-O4fGng.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-BlpW4les.js → ChargeCardRoutes-CZHJ2f3S.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-DsIgXQcl.js → CompanyPassportScreen-DMNbV7xV.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-Ba4cIzn3.js → ConnectionAuthScreen-DQHN7Yil.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-DWZf1W12.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-k4zdaFbp.js → CustomerOnboardingRoutes-DBczs8W1.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-DQNi4Bls.js → DashboardRoutes-6tX_FJnK.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-DlneJXmh.js → DefaultTenantHome-gdhC8rFn.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-DlrlDnHx.js → DomesticWireDetailScreen-CwGd9Q26.js} +1 -1
  15. package/dist/assets/{DrawerScreen-C5kc-1KR.js → DrawerScreen-DApdgXsr.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-B6pJdYpn.js → EntityDetailRoutes-CGMIAqZF.js} +1 -1
  17. package/dist/assets/ExpenseAutomationRoutes-RczgWR48.js +25 -0
  18. package/dist/assets/{FeaturePreviewScreen-DfcTWDpe.js → FeaturePreviewScreen-DukdbkDU.js} +1 -1
  19. package/dist/assets/{MagicLinkRoutes-7Kk-vZgW.js → MagicLinkRoutes-CJq_o8r6.js} +1 -1
  20. package/dist/assets/{MagicLinkSignInScreen-CLVah6RB.js → MagicLinkSignInScreen-Cq-_I3N7.js} +1 -1
  21. package/dist/assets/{MobileAppDrawer-FuW2cx8a.js → MobileAppDrawer-B0SDRa0y.js} +1 -1
  22. package/dist/assets/NotFoundScreen-DnYi4Alo.js +1 -0
  23. package/dist/assets/{NotificationRoutes-kZE0n5II.js → NotificationRoutes-DE_b-rRI.js} +1 -1
  24. package/dist/assets/{OAuthConsentScreen-MRpg6Yeq.js → OAuthConsentScreen-C4y7IeaO.js} +1 -1
  25. package/dist/assets/{PandLWithForecastRoutes-DBStXMKI.js → PandLWithForecastRoutes-BegSQYJd.js} +1 -1
  26. package/dist/assets/{PeopleRoutes-DSZLNeqx.js → PeopleRoutes-CaRj4nPy.js} +1 -1
  27. package/dist/assets/{PerformanceRoutes-DtpdAAnW.js → PerformanceRoutes-BmdUlT3Y.js} +1 -1
  28. package/dist/assets/{Preview-DVbK_8TN.js → Preview-BzKmpY8q.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-HcQe0eGd.js → QBOConnectionScreen-H8Qvt38d.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-DvrPT4g8.js → ReferralListScreen-Ih6wu8ZB.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-CCv3xLQT.js → ReimbursementApprovalRoutes-B07Q_12k.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Bei2xs0S.js → ReimbursementApprovalRuleDetailScreen-Cs1Oz67I.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-B-Sg6Hqq.js → ReimbursementRoutes-V4aVhNjv.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-Dbi4SYIJ.js → ReportsRoutes-IDUQFhiX.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-BMJQqTth.js → RewardsRoutes-DsoF8WDm.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-DHRRpjB0.js → ScreenRoutes-q84xLWb1.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-pHLO4SVh.js → SettingsRoutes-0j-n-7mu.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-BJApXgeQ.js → SetupPagesScreen-C4GjXjRP.js} +1 -1
  39. package/dist/assets/{SignInScreen-C0lNsIe4.js → SignInScreen-B6ywBnJ6.js} +1 -1
  40. package/dist/assets/{SignOutScreen-Bi-9EAnk.js → SignOutScreen-syLC8-ZX.js} +1 -1
  41. package/dist/assets/{TaskListScreen-QQkoAcfV.js → TaskListScreen-Ute_eU7l.js} +1 -1
  42. package/dist/assets/{TaskRoutes-C88qaxgI.js → TaskRoutes-BqaUB3X4.js} +1 -1
  43. package/dist/assets/TransactionDetailRoutes-RdDsGxG0.js +1 -0
  44. package/dist/assets/{TransactionDetailScreen-8mXHg0UY.js → TransactionDetailScreen-B71792qc.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-CX-Kc7E-.js → TransactionListRoutes-Blo9KvRe.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-CJ7Oy-uL.js → TreasuryRoutes-D4_fryuU.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-DIC-oUiR.js → VendorsRoutes-DKMnK28g.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-Jo50UPm3.js → WiseConfirmationScreen-iZmAunYq.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-Bjeduxw9.js → ZeniAccountRoutes-ByRr-Rvb.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-DutbAsuJ.js → ZeniAccountStatementScreen-DLzmrfoy.js} +1 -1
  51. package/dist/assets/{accountMappingHelper-QtwozoN5.js → accountMappingHelper-CbeIjSvu.js} +1 -1
  52. package/dist/assets/{analytics-DxyMm95L.js → analytics-CX30pJB4.js} +1 -1
  53. package/dist/assets/{analyticsHelper-Djzujhjh.js → analyticsHelper-SG8tB9jY.js} +1 -1
  54. package/dist/assets/{core-BFuZewo1.js → core-Chn6k0lm.js} +1 -1
  55. package/dist/assets/{decodeURIComponentSafe-GFuMfgir.js → decodeURIComponentSafe-B4WuQ5yM.js} +1 -1
  56. package/dist/assets/{dnd-mZw2LJiL.js → dnd-CKKgQZIG.js} +1 -1
  57. package/dist/assets/{empty-Bp3kP_ka.js → empty-BOUM9tFw.js} +1 -1
  58. package/dist/assets/{empty-k_XNQecn.js → empty-CM7hXaA6.js} +1 -1
  59. package/dist/assets/{emptyVideoElement-DkqeoE-M.js → emptyVideoElement-BB3xSIc2.js} +1 -1
  60. package/dist/assets/epic-CWSv6htf.js +2 -0
  61. package/dist/assets/{getLocaleForTenant-BjDLo9MD.js → getLocaleForTenant-j9oTpFdD.js} +1 -1
  62. package/dist/assets/{index-Bya5oAxf.js → index-BOIvqKof.js} +1 -1
  63. package/dist/assets/{index-DyQYRNiR.js → index-BreaiJNl.js} +7 -7
  64. package/dist/assets/{index-4iSF13bs.js → index-CAPfyPqh.js} +1 -1
  65. package/dist/assets/{index-fD_ZJJNS.js → index-Cyof-eFv.js} +1 -1
  66. package/dist/assets/{index-Ly4rr8Gt.js → index-D-iEs16m.js} +2 -2
  67. package/dist/assets/{index-CS3R_7Wp.js → index-Dswa3EzJ.js} +1 -1
  68. package/dist/assets/{index-u5Oc_Hut.js → index-qc05mnSq.js} +1 -1
  69. package/dist/assets/{index-BcBTxYRI.js → index-vkGyITuL.js} +1 -1
  70. package/dist/assets/{lexical-DGyy1g7u.js → lexical-CMmB3hg4.js} +1 -1
  71. package/dist/assets/{liveblocks-Dh2QAkHf.js → liveblocks-DuKOLlGn.js} +1 -1
  72. package/dist/assets/{lottie-DueJpsnD.js → lottie-BzC_z70r.js} +1 -1
  73. package/dist/assets/{mui-sjj8uXYx.js → mui-BKTsYfTF.js} +1 -1
  74. package/dist/assets/{pathToGoBack-CI2c4nh7.js → pathToGoBack-DuG_pESe.js} +1 -1
  75. package/dist/assets/{pdf-BDzUzBn8.js → pdf-DKctSUPl.js} +3 -3
  76. package/dist/assets/{pdf-lib-C3DJztgI.js → pdf-lib-CFnSeXgz.js} +1 -1
  77. package/dist/assets/{plaid-CvsW7WgG.js → plaid-BDw9fPCd.js} +1 -1
  78. package/dist/assets/{pusher-bE72k_fg.js → pusher-C3OEsBE6.js} +1 -1
  79. package/dist/assets/{react-BA6cfPHm.js → react-7DVU8bop.js} +1 -1
  80. package/dist/assets/{react-DazvgizP.js → react-CJKpxSUM.js} +1 -1
  81. package/dist/assets/{react-C2gtub8l.js → react-CyKriL-x.js} +1 -1
  82. package/dist/assets/{react-D9akfTfa.js → react-D6FwTuSW.js} +1 -1
  83. package/dist/assets/{react-CJsxDDv6.js → react-DX8ScWZU.js} +1 -1
  84. package/dist/assets/{react-CEHzE8fT.js → react-w6DB2NS-.js} +1 -1
  85. package/dist/assets/{recharts-Di30TSqm.js → recharts-DDgm0ZY-.js} +1 -1
  86. package/dist/assets/{routePaths-zFH_1U3e.js → routePaths-D5pZG1HW.js} +1 -1
  87. package/dist/assets/{sentry-DK3ab-Mk.js → sentry-8NyHUHYi.js} +1 -1
  88. package/dist/assets/{url-BrRDv2PY.js → url-Ch2k8kvj.js} +1 -1
  89. package/dist/assets/{url-Cw9gHNrq.js → url-KL9dl4eL.js} +1 -1
  90. package/dist/assets/{useAskAiCfoHostNavButtonProps-BBmaNftJ.js → useAskAiCfoHostNavButtonProps-Yc6V_8SE.js} +1 -1
  91. package/dist/assets/{useDeviceId-GTblrVdw.js → useDeviceId-EvuyeVv7.js} +1 -1
  92. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-Cem1fO9j.js → useFetchSuggestedQuestionsWhenReady-Dl_AzQW_.js} +1 -1
  93. package/dist/assets/{useInitialThreadRequest-ZTV3oo-i.js → useInitialThreadRequest-DWCinY7g.js} +1 -1
  94. package/dist/assets/{utils-DdXexb3v.js → utils-BgDKBMSG.js} +1 -1
  95. package/dist/assets/{withTransactionSidePanel-Bd_ziiFV.js → withTransactionSidePanel-BxWHMEM-.js} +1 -1
  96. package/dist/assets/{zeni-epic-state-Bhb0JOZy.js → zeni-epic-state-CrPv4S-z.js} +5 -5
  97. package/dist/index.html +1 -1
  98. package/package.json +3 -3
  99. package/dist/assets/AddressRoutes-DaSOTLqQ.js +0 -1
  100. package/dist/assets/CustomerOnboardingAuthScreen-CD6W8O0B.js +0 -1
  101. package/dist/assets/ExpenseAutomationRoutes-CfsSexJs.js +0 -25
  102. package/dist/assets/NotFoundScreen-CLbpaFRJ.js +0 -1
  103. package/dist/assets/TransactionDetailRoutes-Ch1h2s4g.js +0 -1
  104. package/dist/assets/epic-CNC5mVA8.js +0 -2
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-DuKOLlGn.js";import{A as i}from"./AddressScreen-DcX4lc_F.js";import s from"./NotFoundScreen-DnYi4Alo.js";import"./sentry-8NyHUHYi.js";import{n as d,o as r}from"./core-Chn6k0lm.js";import"./zeni-epic-state-CrPv4S-z.js";import"./recharts-DDgm0ZY-.js";import"./index-BreaiJNl.js";import"./mui-BKTsYfTF.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.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]="7f1b944a-9a7d-4e6b-b1ef-dc3a07ec71ea",t._sentryDebugIdIdentifier="sentry-dbid-7f1b944a-9a7d-4e6b-b1ef-dc3a07ec71ea")}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 d}from"./liveblocks-Dh2QAkHf.js";import{a as S}from"./sentry-DK3ab-Mk.js";import{j as T,h as _,u as E,l as j,g as B,k as M}from"./core-BFuZewo1.js";import{Z as $,m as D,z as L,I as K,B as J,x as N,c as C,f as m,E as z,i as h,p as F}from"./index-DyQYRNiR.js";import{Jm as k,gN as O,eO as R,Jn as U,c1 as G,Jo as V,k7 as q}from"./zeni-epic-state-Bhb0JOZy.js";import{n as H}from"./mui-sjj8uXYx.js";import Z from"./NotFoundScreen-CLbpaFRJ.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]="0bc5a643-44bb-4e12-bf8d-91b0bb8e6ee0",e._sentryDebugIdIdentifier="sentry-dbid-0bc5a643-44bb-4e12-bf8d-91b0bb8e6ee0")}catch{}})();const Q=H.div`
1
+ import{j as d}from"./liveblocks-DuKOLlGn.js";import{a as S}from"./sentry-8NyHUHYi.js";import{j as T,h as _,u as E,l as j,g as B,k as M}from"./core-Chn6k0lm.js";import{Z as $,m as D,z as L,I as K,B as J,x as N,c as C,f as m,E as z,i as h,p as F}from"./index-BreaiJNl.js";import{Jm as k,gN as O,eO as R,Jn as U,c1 as G,Jo as V,k7 as q}from"./zeni-epic-state-CrPv4S-z.js";import{n as H}from"./mui-BKTsYfTF.js";import Z from"./NotFoundScreen-DnYi4Alo.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]="0bc5a643-44bb-4e12-bf8d-91b0bb8e6ee0",e._sentryDebugIdIdentifier="sentry-dbid-0bc5a643-44bb-4e12-bf8d-91b0bb8e6ee0")}catch{}})();const Q=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-Dh2QAkHf.js";import{a as r}from"./sentry-DK3ab-Mk.js";import{h as oe,j as ne,u as ie,g as V,l as re,k as le}from"./core-BFuZewo1.js";import{R as ce,cK as ue,z as de,Z as me,cL as pe,cM as fe,cN as he,cO as q,x as Se,c as v,W as j,cP as ge,cQ as Ce,f as be,a3 as ke,cR as we,X as Ie,s as Ee,p as $,aZ as Pe,cS as Te}from"./index-DyQYRNiR.js";import{fE as ye,f3 as W,eO as _e,hr as xe,PV as ve,eN as Ue,hB as Oe,hx as Qe,fu as Ae,fo as De,fh as Fe,fl as G,fp as Be,fq as Le,fr as Me,fs as Re,ft as Ne}from"./zeni-epic-state-Bhb0JOZy.js";import{D as Ve,n as U,P as je,S as $e}from"./mui-sjj8uXYx.js";import{p as Ge}from"./pathToGoBack-CI2c4nh7.js";import"./recharts-Di30TSqm.js";import"./analytics-DxyMm95L.js";import"./plaid-CvsW7WgG.js";import"./dnd-mZw2LJiL.js";import"./stripe-DMRn4zHo.js";import"./lottie-DueJpsnD.js";import"./lexical-DGyy1g7u.js";import"./pdf-BDzUzBn8.js";import"./utils-DdXexb3v.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="4cb0415c-a30d-4a9a-9fb8-aa3e3b64edd5",s._sentryDebugIdIdentifier="sentry-dbid-4cb0415c-a30d-4a9a-9fb8-aa3e3b64edd5")}catch{}})();const z="chat-response-generated",qe=le(function(s,i){const a=W(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===z&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:E}=q(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(E,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Me(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Ne({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Pe(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(G(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Be(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ge(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(G(""))},togglePageView:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Ee(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=V(u=>W(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=V(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),O=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,Q=!!C?.aiCfoShouldSubmit,[H,P]=r.useState(null),[K,T]=r.useState(!1),A=r.useRef(!1);r.useEffect(()=>{A.current||b==null||b===""||(P(b),T(Q),A.current=!0)},[b,Q]);const X=r.useCallback(()=>{P(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,B=r.useRef(!1);r.useEffect(()=>{B.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),B.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(P(k),T(!0),a(ve()))},[k,t,a]);const Z=c.masterTOSInfo,w=Z?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,M=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),N=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:J}=q(N,t),Y=J.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-encrypted-chat-${u}.${z}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Oe())},[_,x,a]),r.useEffect(()=>{t!=null&&M!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Qe(t,e.userId))},[M,R,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(ze,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),j(n)&&O.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:Y,customPageTitle:S,currentTenant:c,emailLinkQuestion:H??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:X,onMenuClick:j(n)?O.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,onUploadPromoClose:g}),h.jsx(Ve,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:He,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(We,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Ae(c.userRoleId)),f(!1)}})})})]})},We=U($e)`
1
+ import{j as h}from"./liveblocks-DuKOLlGn.js";import{a as r}from"./sentry-8NyHUHYi.js";import{h as oe,j as ne,u as ie,g as V,l as re,k as le}from"./core-Chn6k0lm.js";import{R as ce,cK as ue,z as de,Z as me,cL as pe,cM as fe,cN as he,cO as q,x as Se,c as v,W as j,cP as ge,cQ as Ce,f as be,a3 as ke,cR as we,X as Ie,s as Ee,p as $,aZ as Pe,cS as Te}from"./index-BreaiJNl.js";import{fE as ye,f3 as W,eO as _e,hr as xe,PV as ve,eN as Ue,hB as Oe,hx as Qe,fu as Ae,fo as De,fh as Fe,fl as G,fp as Be,fq as Le,fr as Me,fs as Re,ft as Ne}from"./zeni-epic-state-CrPv4S-z.js";import{D as Ve,n as U,P as je,S as $e}from"./mui-BKTsYfTF.js";import{p as Ge}from"./pathToGoBack-DuG_pESe.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="4cb0415c-a30d-4a9a-9fb8-aa3e3b64edd5",s._sentryDebugIdIdentifier="sentry-dbid-4cb0415c-a30d-4a9a-9fb8-aa3e3b64edd5")}catch{}})();const z="chat-response-generated",qe=le(function(s,i){const a=W(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===z&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:E}=q(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(E,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Me(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Ne({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Pe(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(G(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Be(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ge(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(G(""))},togglePageView:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Ee(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=V(u=>W(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=V(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),O=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,Q=!!C?.aiCfoShouldSubmit,[H,P]=r.useState(null),[K,T]=r.useState(!1),A=r.useRef(!1);r.useEffect(()=>{A.current||b==null||b===""||(P(b),T(Q),A.current=!0)},[b,Q]);const X=r.useCallback(()=>{P(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,B=r.useRef(!1);r.useEffect(()=>{B.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),B.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(P(k),T(!0),a(ve()))},[k,t,a]);const Z=c.masterTOSInfo,w=Z?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,M=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),N=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:J}=q(N,t),Y=J.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-encrypted-chat-${u}.${z}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Oe())},[_,x,a]),r.useEffect(()=>{t!=null&&M!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Qe(t,e.userId))},[M,R,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(ze,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),j(n)&&O.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:Y,customPageTitle:S,currentTenant:c,emailLinkQuestion:H??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:X,onMenuClick:j(n)?O.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,onUploadPromoClose:g}),h.jsx(Ve,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:He,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(We,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Ae(c.userRoleId)),f(!1)}})})})]})},We=U($e)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-Dh2QAkHf.js";import{a as y}from"./sentry-DK3ab-Mk.js";import{j as B,u as U,h as j,g as f,N as $,k as T,l as O,n as F,o as h}from"./core-BFuZewo1.js";import{eO as N,MF as A,Ml as b,x9 as w,x3 as L,x7 as x,wY as M,Mn as z,w$ as W,xb as q,xa as C}from"./zeni-epic-state-Bhb0JOZy.js";import{m as P,z as k,B as V,a3 as Y,bz as G,ac as _,bA as H}from"./index-DyQYRNiR.js";import"./mui-sjj8uXYx.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-Bei2xs0S.js";import K from"./NotFoundScreen-CLbpaFRJ.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]="938536ab-ccac-4424-be12-7857793b062a",e._sentryDebugIdIdentifier="sentry-dbid-938536ab-ccac-4424-be12-7857793b062a")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:n}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(z(!1))},onBackClick:()=>{_(n)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(Y(G)),X=()=>{const e=B(),o=U(),t=j(),[n,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),p=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>N(i)),r=f(i=>A(i)),g=f(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{n||p!=="Not-Started"||(a(!0),t(L(!0)))},[n,p,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const v={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${I}`]:[],eventCallback:(i,R,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...v})},Z=T(function(e,o){const t=b(e),n=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=n==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:n}},function(e,o){const{navigate:t,approvalUpdateDataView:n,approverViewData:a,approvalRuleId:u}=o,s=n.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:p=>{const c=r=>{const g=[];return r.forEach(v=>{const i=v.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=v.actors.selectedNonUsers.map(S=>{const E=!!J(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(R);g.push({action:v.stepType.selectedOption,actors:m,operator:m.length>1?v.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:n}=O(),a=k.getSignedInUser(),u=P(),s=f(r=>b(r)),d=f(r=>A(r)),[p,c]=y.useState(!1);if(y.useEffect(()=>{p||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(n!=null?"../../":"../")},[d,n]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:n,approverViewData:d,location:t})}function se(){return l.jsxs(F,{children:[l.jsx(h,{path:"/",element:l.jsx(X,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(K,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-DuKOLlGn.js";import{a as y}from"./sentry-8NyHUHYi.js";import{j as B,u as U,h as j,g as f,N as $,k as T,l as O,n as F,o as h}from"./core-Chn6k0lm.js";import{eO as N,MF as A,Ml as b,x9 as w,x3 as L,x7 as x,wY as M,Mn as z,w$ as W,xb as q,xa as C}from"./zeni-epic-state-CrPv4S-z.js";import{m as P,z as k,B as V,a3 as Y,bz as G,ac as _,bA as H}from"./index-BreaiJNl.js";import"./mui-BKTsYfTF.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-Cs1Oz67I.js";import K from"./NotFoundScreen-DnYi4Alo.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]="938536ab-ccac-4424-be12-7857793b062a",e._sentryDebugIdIdentifier="sentry-dbid-938536ab-ccac-4424-be12-7857793b062a")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:n}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(z(!1))},onBackClick:()=>{_(n)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(Y(G)),X=()=>{const e=B(),o=U(),t=j(),[n,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),p=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>N(i)),r=f(i=>A(i)),g=f(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{n||p!=="Not-Started"||(a(!0),t(L(!0)))},[n,p,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const v={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${I}`]:[],eventCallback:(i,R,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...v})},Z=T(function(e,o){const t=b(e),n=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=n==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:n}},function(e,o){const{navigate:t,approvalUpdateDataView:n,approverViewData:a,approvalRuleId:u}=o,s=n.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:p=>{const c=r=>{const g=[];return r.forEach(v=>{const i=v.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=v.actors.selectedNonUsers.map(S=>{const E=!!J(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(R);g.push({action:v.stepType.selectedOption,actors:m,operator:m.length>1?v.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:n}=O(),a=k.getSignedInUser(),u=P(),s=f(r=>b(r)),d=f(r=>A(r)),[p,c]=y.useState(!1);if(y.useEffect(()=>{p||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(n!=null?"../../":"../")},[d,n]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:n,approverViewData:d,location:t})}function se(){return l.jsxs(F,{children:[l.jsx(h,{path:"/",element:l.jsx(X,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(K,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-Dh2QAkHf.js";import{j as K,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-BFuZewo1.js";import{eO as Z,LX as Ue,bv as It,GS as oa,bo as wt,bE as pe,LY as xt,wt as Bt,xD as Ve,x0 as la,bn as De,LZ as sa,L_ as ra,c1 as ca,L$ as da,jr as Ct,M0 as At,M1 as Et,yc as _e,wI as Ce,M2 as ua,wh as tt,M3 as pa,Bo as ma,wl as ba,wr as Dt,M4 as ke,M5 as Ge,xE as Oe,M6 as ha,M7 as ga,xH as Ne,M8 as ya,xU as Sa,M9 as jt,xo as at,xt as fa,Ma as ka,Mb as ue,Mc as Tt,Md as Pt,Me as Ft,fI as va,wN as $e,cw as Rt,Mf as Ia,gD as wa,Mg as xa,Mh as Ba,eU as Mt,eS as Vt,Mi as ze,Mj as Ca,Mk as Aa,JG as Ze,Ml as Ea,JH as oe,JI as He,Mm as Da,Mn as ja,Mo as Ta,xv as nt,xs as Pa,Mp as Fa,Mq as Ra,Mr as Ma,xe as Va,Ms as $a,Mt as La,Mu as Ua,ck as $t,cM as Lt,jC as _a,bK as Ga,bq as Ut,bL as _t,vz as Oa,Mv as Na,Bb as za,Bh as Za,s6 as Ha,xF as Wa,yj as qa,jP as fe,Mw as Ja,Mx as Gt,kh as Ka,jJ as Ot,k2 as Nt,k1 as it,bD as be,bJ as Xa,My as Ya,Mz as ve,il as Qa,MA as ot,MB as en,iq as tn,iL as an,yx as nn,MC as on,ka as ln,yn as sn,MD as lt,yr as rn,yw as cn,yt as dn,yl as un,ME as zt,wC as pn,MF as mn,MG as bn,fA as hn,fz as gn,fy as yn,jS as Sn,k8 as st,kj as fn,pF as kn,j$ as vn,yp as In,iw as wn,ko as xn,MH as Bn,io as Cn,pw as An,MI as En,xk as Dn,bF as jn,bs as Tn,IC as Pn,cO as Fn,cN as Rn,cv as Mn,cB as Vn}from"./zeni-epic-state-Bhb0JOZy.js";import{m as me,z as M,I as Ie,C as le,$ as y,aK as Ae,B as re,d as A,x as je,c as D,b6 as $n,p as z,X as We,s as E,Z as we,b7 as rt,b8 as ct,b9 as Ln,ah as Un,F as _n,aE as Gn,A as Zt,D as qe,J as Je,ba as On,aq as Ht,bb as Nn,U as zn,f as Wt,a3 as Zn,bc as Hn,bd as Wn,be as qn,bf as Jn,bg as Kn,bh as Xn,bi as Yn,bj as Qn,bk as ei,H as ti,bl as ai,b2 as ni,bm as ii,bn as oi,a6 as li}from"./index-DyQYRNiR.js";import{n as L,S as si}from"./mui-sjj8uXYx.js";import{A as dt}from"./AddressScreen-2d2ovpiZ.js";import{g as ie,a as Te,i as qt,V as Ke,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-DlrlDnHx.js";import{a as f}from"./sentry-DK3ab-Mk.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-BBmaNftJ.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-Cem1fO9j.js";import{u as Jt}from"./useInitialThreadRequest-ZTV3oo-i.js";import Ee from"./NotFoundScreen-CLbpaFRJ.js";import{D as ui}from"./DrawerScreen-C5kc-1KR.js";import{M as Kt}from"./MobileAppDrawer-FuW2cx8a.js";import{F as Xt}from"./FeaturePreviewScreen-DfcTWDpe.js";import{S as Pe}from"./SetupPagesScreen-BJApXgeQ.js";import{B as pi}from"./BillPayApprovalRoutes-Cngtnc1t.js";import{FallBackRoute as mi}from"./ScreenRoutes-DHRRpjB0.js";import"./recharts-Di30TSqm.js";import"./analytics-DxyMm95L.js";import"./plaid-CvsW7WgG.js";import"./dnd-mZw2LJiL.js";import"./stripe-DMRn4zHo.js";import"./lottie-DueJpsnD.js";import"./lexical-DGyy1g7u.js";import"./pdf-BDzUzBn8.js";import"./utils-DdXexb3v.js";import"./analyticsHelper-Djzujhjh.js";import"./routePaths-zFH_1U3e.js";import"./BusinessVerificationPageScreen-Ck14gI3x.js";import"./ReimbursementApprovalRuleDetailScreen-Bei2xs0S.js";import"./getLocaleForTenant-BjDLo9MD.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]="90ac5f16-65c7-4555-bcd0-c7e6a06af480",e._sentryDebugIdIdentifier="sentry-dbid-90ac5f16-65c7-4555-bcd0-c7e6a06af480")}catch{}})();const bi=Y(function(e,t){const l=Ue(e,t.billId),i=M.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}))}}})($n);function hi(){const e=K(),t=se(),l=X(),{billId:i}=ae(),c=me(),r=M.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(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:U}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=U(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:J}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.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??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,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:O=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:$,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=M.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=M.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Ne(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=M.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,U]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const J=v(F=>Ue(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Q=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Oe(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(U(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(U(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const O={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(Ne(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"||J.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(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Ln,{}),a.jsx(Me,{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:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Me,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();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-DuKOLlGn.js";import{j as K,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-Chn6k0lm.js";import{eO as Z,LX as Ue,bv as It,GS as oa,bo as wt,bE as pe,LY as xt,wt as Bt,xD as Ve,x0 as la,bn as De,LZ as sa,L_ as ra,c1 as ca,L$ as da,jr as Ct,M0 as At,M1 as Et,yc as _e,wI as Ce,M2 as ua,wh as tt,M3 as pa,Bo as ma,wl as ba,wr as Dt,M4 as ke,M5 as Ge,xE as Oe,M6 as ha,M7 as ga,xH as Ne,M8 as ya,xU as Sa,M9 as jt,xo as at,xt as fa,Ma as ka,Mb as ue,Mc as Tt,Md as Pt,Me as Ft,fI as va,wN as $e,cw as Rt,Mf as Ia,gD as wa,Mg as xa,Mh as Ba,eU as Mt,eS as Vt,Mi as ze,Mj as Ca,Mk as Aa,JG as Ze,Ml as Ea,JH as oe,JI as He,Mm as Da,Mn as ja,Mo as Ta,xv as nt,xs as Pa,Mp as Fa,Mq as Ra,Mr as Ma,xe as Va,Ms as $a,Mt as La,Mu as Ua,ck as $t,cM as Lt,jC as _a,bK as Ga,bq as Ut,bL as _t,vz as Oa,Mv as Na,Bb as za,Bh as Za,s6 as Ha,xF as Wa,yj as qa,jP as fe,Mw as Ja,Mx as Gt,kh as Ka,jJ as Ot,k2 as Nt,k1 as it,bD as be,bJ as Xa,My as Ya,Mz as ve,il as Qa,MA as ot,MB as en,iq as tn,iL as an,yx as nn,MC as on,ka as ln,yn as sn,MD as lt,yr as rn,yw as cn,yt as dn,yl as un,ME as zt,wC as pn,MF as mn,MG as bn,fA as hn,fz as gn,fy as yn,jS as Sn,k8 as st,kj as fn,pF as kn,j$ as vn,yp as In,iw as wn,ko as xn,MH as Bn,io as Cn,pw as An,MI as En,xk as Dn,bF as jn,bs as Tn,IC as Pn,cO as Fn,cN as Rn,cv as Mn,cB as Vn}from"./zeni-epic-state-CrPv4S-z.js";import{m as me,z as M,I as Ie,C as le,$ as y,aK as Ae,B as re,d as A,x as je,c as D,b6 as $n,p as z,X as We,s as E,Z as we,b7 as rt,b8 as ct,b9 as Ln,ah as Un,F as _n,aE as Gn,A as Zt,D as qe,J as Je,ba as On,aq as Ht,bb as Nn,U as zn,f as Wt,a3 as Zn,bc as Hn,bd as Wn,be as qn,bf as Jn,bg as Kn,bh as Xn,bi as Yn,bj as Qn,bk as ei,H as ti,bl as ai,b2 as ni,bm as ii,bn as oi,a6 as li}from"./index-BreaiJNl.js";import{n as L,S as si}from"./mui-BKTsYfTF.js";import{A as dt}from"./AddressScreen-DcX4lc_F.js";import{g as ie,a as Te,i as qt,V as Ke,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-CwGd9Q26.js";import{a as f}from"./sentry-8NyHUHYi.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-Yc6V_8SE.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-Dl_AzQW_.js";import{u as Jt}from"./useInitialThreadRequest-DWCinY7g.js";import Ee from"./NotFoundScreen-DnYi4Alo.js";import{D as ui}from"./DrawerScreen-DApdgXsr.js";import{M as Kt}from"./MobileAppDrawer-B0SDRa0y.js";import{F as Xt}from"./FeaturePreviewScreen-DukdbkDU.js";import{S as Pe}from"./SetupPagesScreen-C4GjXjRP.js";import{B as pi}from"./BillPayApprovalRoutes-Basd0KQv.js";import{FallBackRoute as mi}from"./ScreenRoutes-q84xLWb1.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";import"./analyticsHelper-SG8tB9jY.js";import"./routePaths-D5pZG1HW.js";import"./BusinessVerificationPageScreen-B-O4fGng.js";import"./ReimbursementApprovalRuleDetailScreen-Cs1Oz67I.js";import"./getLocaleForTenant-j9oTpFdD.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]="90ac5f16-65c7-4555-bcd0-c7e6a06af480",e._sentryDebugIdIdentifier="sentry-dbid-90ac5f16-65c7-4555-bcd0-c7e6a06af480")}catch{}})();const bi=Y(function(e,t){const l=Ue(e,t.billId),i=M.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}))}}})($n);function hi(){const e=K(),t=se(),l=X(),{billId:i}=ae(),c=me(),r=M.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(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:U}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=U(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:J}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.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??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,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:O=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:$,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=M.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=M.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Ne(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=M.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,U]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const J=v(F=>Ue(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Q=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Oe(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(U(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(U(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const O={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(Ne(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"||J.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(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Ln,{}),a.jsx(Me,{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:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Me,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();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=L.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-Dh2QAkHf.js";import{a as V}from"./sentry-DK3ab-Mk.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-BFuZewo1.js";import{I as ce,C as ue,aK as de,z as E,x as pe,c as M,ac as x,f as z,bv as le,aq as me,s as B,ar as R}from"./index-DyQYRNiR.js";import{Mt as fe,eO as G,rx as ye,GW as Se,xe as ge,zX as Ie,Cu as be,D7 as he,E0 as De,MQ as Oe,MR as Te,MS as ke,MT as Ce,MU as Ve,Jn as we,LS as Ae,Jz as Ne,k7 as _e,fA as Fe,fz as ve,fy as xe,pF as ze,pw as Ee,pt as Me,j$ as Be,rG as Re,rE as P,bD as L,rS as U,cu as Pe}from"./zeni-epic-state-Bhb0JOZy.js";import{n as Le}from"./mui-sjj8uXYx.js";import{c as j}from"./routePaths-zFH_1U3e.js";import{M as Ue}from"./MobileAppDrawer-FuW2cx8a.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]="ee93df97-1eb4-41cc-99d1-69355cbfb0d8",e._sentryDebugIdIdentifier="sentry-dbid-ee93df97-1eb4-41cc-99d1-69355cbfb0d8")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-DuKOLlGn.js";import{a as V}from"./sentry-8NyHUHYi.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-Chn6k0lm.js";import{I as ce,C as ue,aK as de,z as E,x as pe,c as M,ac as x,f as z,bv as le,aq as me,s as B,ar as R}from"./index-BreaiJNl.js";import{Mt as fe,eO as G,rx as ye,GW as Se,xe as ge,zX as Ie,Cu as be,D7 as he,E0 as De,MQ as Oe,MR as Te,MS as ke,MT as Ce,MU as Ve,Jn as we,LS as Ae,Jz as Ne,k7 as _e,fA as Fe,fz as ve,fy as xe,pF as ze,pw as Ee,pt as Me,j$ as Be,rG as Re,rE as P,bD as L,rS as U,cu as Pe}from"./zeni-epic-state-CrPv4S-z.js";import{n as Le}from"./mui-BKTsYfTF.js";import{c as j}from"./routePaths-D5pZG1HW.js";import{M as Ue}from"./MobileAppDrawer-B0SDRa0y.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]="ee93df97-1eb4-41cc-99d1-69355cbfb0d8",e._sentryDebugIdIdentifier="sentry-dbid-ee93df97-1eb4-41cc-99d1-69355cbfb0d8")}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-Dh2QAkHf.js";import{j as le,l as ia,h as ue,g as y,u as fe,k as pe,N as fa,q as ut,n as Wt,o as te}from"./core-BFuZewo1.js";import{eO as ie,bs as Ue,Ok as ka,eS as be,eT as ye,eU as Se,fP as $e,cr as Ge,Ol as Ye,Om as Ma,sM as ba,jz as ya,On as Sa,gD as oa,ze as Je,zg as za,zh as $a,jp as mt,Oo as Ze,z2 as Ct,Op as qt,Oq as Qt,z5 as Da,Or as Xt,MN as _a,qY as pt,zb as Ga,gO as Jt,Os as ht,Ot as Ke,bq as en,Ou as an,fA as wa,fz as Pa,zL as tn,fy as Ta,Mt as nn,Ov as gt,ck as ft,cM as rn,MM as da,Al as sn,Ow as tt,zX as Fa,Ox as bt,Am as on,Nb as cn,An as dn,Bh as ln,s6 as un,Bb as mn,zw as yt,zp as Cn,Oy as pn,fR as hn,zF as St,zJ as It,fQ as gn,Oz as fn,A7 as At,OA as bn,OB as yn,OC as Sn,zH as Et,zs as kt,z8 as Dt,zB as _t,zz as wt,zD as In,zf as nt,OD as Pt,OE as va,zU as Ia,Js as Tt,cN as Ya,OF as An,OG as En,OH as kn,OI as Dn,zR as Na,Ae as _n,Aa as wn,zN as Pn,Ac as Tn,A2 as Fn,A4 as vn,OJ as Ft,Ak as vt,GS as xn,OK as On,OL as Bn,OM as Ln,ON as xt,OO as Un,AH as Rn,zW as Ot,zQ as ca,zV as jn,OP as Nn,OQ as Vn,y$ as Hn,OR as Bt,OS as Lt,OT as Mn,z1 as zn,z0 as rt,OU as $n,OV as Gn,OW as Yn,Jo as Zn,OX as Za,OY as Kn,vC as Ut,k7 as Wn,gE as qn,AM as Qn,OZ as Rt,O_ as Xn,AN as Jn,O$ as er,dd as ar,sG as tr,AC as nr,Aw as Le,bv as rr,bE as sr,cw as or,bF as cr,IC as ir}from"./zeni-epic-state-Bhb0JOZy.js";import{z as J,I as je,C as ce,$ as Y,B as la,bZ as xa,c8 as dr,p as ve,c9 as lr,ca as ur,Z as ua,aK as Fe,s as ge,bg as Ka,cb as mr,A as ma,i as Oa,m as Wa,c as Q,D as qa,cc as Cr,an as Qa,bs as Qe,cd as Va,ce as pr,x as Xa,a3 as hr,cf as gr,aq as jt,X as Ha,U as Nt,f as Vt,cg as fr,ch as br,ci as yr,cj as Sr,ck as Ir,cl as Ar,d as Aa,cm as Er,cn as kr,co as Ua,H as Dr,cp as _r,cq as wr,cr as Pr,cs as Tr,ct as Fr,a6 as vr}from"./index-DyQYRNiR.js";import{n as _e,D as Ht,S as xr}from"./mui-sjj8uXYx.js";import{a as i}from"./sentry-DK3ab-Mk.js";import{g as Ce,a as Ca,b as Mt,c as Ie,d as Ae,e as Re,f as Ne,A as Or,h as Ja,P as Br,i as et,s as Xe,j as zt,k as Me,l as $t,m as Lr,n as Gt,p as Ur,S as st}from"./SetupPagesScreen-BJApXgeQ.js";import Ba from"./NotFoundScreen-CLbpaFRJ.js";import{M as ze}from"./MobileAppDrawer-FuW2cx8a.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-BBmaNftJ.js";import{c as Zt}from"./useFetchSuggestedQuestionsWhenReady-Cem1fO9j.js";import{v as ot}from"./utils-DdXexb3v.js";import{t as Rr}from"./AddressScreen-2d2ovpiZ.js";import"./recharts-Di30TSqm.js";import"./analytics-DxyMm95L.js";import"./plaid-CvsW7WgG.js";import"./dnd-mZw2LJiL.js";import"./stripe-DMRn4zHo.js";import"./lottie-DueJpsnD.js";import"./lexical-DGyy1g7u.js";import"./pdf-BDzUzBn8.js";import"./analyticsHelper-Djzujhjh.js";import"./routePaths-zFH_1U3e.js";import"./BusinessVerificationPageScreen-Ck14gI3x.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]="5ea8b2d5-b2fd-4968-ae31-e35f1c7d3798",e._sentryDebugIdIdentifier="sentry-dbid-5ea8b2d5-b2fd-4968-ae31-e35f1c7d3798")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=J.getSignedInUser(),n=y(X=>ie(X)),C=je(),p=Ue(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Y.isChargeCardFeatureEnabled),g=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=u(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,f=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>$e(X,n.companyId)),N=Ge(v.controllers),{creditAccount:B,creditAccountRepayment:P}=y(X=>Ye(X)),V=y(X=>X.classListState.fetchState),m=!_&&d&&g,l=y(X=>Ma(X,t,m,d)),[w,T]=i.useState(!1),H=l.chargeCard,L=H?.cardCreatedByUser?.userId,K=y(X=>L!=null?ba(X.userRoleState,L):void 0),I=K?.accountingClassIDs[0],O=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,R=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=R?.accountingClassIDs[0],E=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),G=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&&G&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,G,q]),i.useEffect(()=>{w||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,m,!1)))},[w,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(G===!1||G&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,c);e(X)}},[l.fetchState,c,G]),i.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&d&&g&&p&&a(za()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&d&&g&&p&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[B.fetchState,P.fetchState,a,d,g,p,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Re(d,f,D,g),ae=Ca(d,g,p,B,P),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:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:f,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:g,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:B,classListFetchState:V,creditAccountRepayment:P,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:R?.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=fe(),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(Ba,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},zr=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=fe(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[g,U]=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,f=y(E=>Qt(E,n)),d=f.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=v(Y.isDebitCardFeatureEnabled),P=Se(B,k),V=Ie({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:P}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),w=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Ae({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&L&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&f.fetchState==="Not-Started"&&(c(!0),a(Je(n,K,L)))},[o,f.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(f.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=ge(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:G}})}else if(_&&f.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=ge(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:G}})}}},[f.fetchState,d?.type.code,_,f.isRefreshingViewInBackground]);const O=J.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),R=()=>{d?.status?.code!=="active"&&a(Ga(n,!0))};i.useEffect(()=>{f.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(R,3e3),A(!0))},[f.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{U(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(ze,{isAppContentDrawerOpen:g,handleDrawerToggle:W}),s.jsx($r,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:f,signedInUserToken:O,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(Gr,{windowSize:t,children:e}):null]})},$r=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:Oa.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(Pa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(wa(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),Gr=_e.div`
1
+ import{j as s}from"./liveblocks-DuKOLlGn.js";import{j as le,l as ia,h as ue,g as y,u as fe,k as pe,N as fa,q as ut,n as Wt,o as te}from"./core-Chn6k0lm.js";import{eO as ie,bs as Ue,Ok as ka,eS as be,eT as ye,eU as Se,fP as $e,cr as Ge,Ol as Ye,Om as Ma,sM as ba,jz as ya,On as Sa,gD as oa,ze as Je,zg as za,zh as $a,jp as mt,Oo as Ze,z2 as Ct,Op as qt,Oq as Qt,z5 as Da,Or as Xt,MN as _a,qY as pt,zb as Ga,gO as Jt,Os as ht,Ot as Ke,bq as en,Ou as an,fA as wa,fz as Pa,zL as tn,fy as Ta,Mt as nn,Ov as gt,ck as ft,cM as rn,MM as da,Al as sn,Ow as tt,zX as Fa,Ox as bt,Am as on,Nb as cn,An as dn,Bh as ln,s6 as un,Bb as mn,zw as yt,zp as Cn,Oy as pn,fR as hn,zF as St,zJ as It,fQ as gn,Oz as fn,A7 as At,OA as bn,OB as yn,OC as Sn,zH as Et,zs as kt,z8 as Dt,zB as _t,zz as wt,zD as In,zf as nt,OD as Pt,OE as va,zU as Ia,Js as Tt,cN as Ya,OF as An,OG as En,OH as kn,OI as Dn,zR as Na,Ae as _n,Aa as wn,zN as Pn,Ac as Tn,A2 as Fn,A4 as vn,OJ as Ft,Ak as vt,GS as xn,OK as On,OL as Bn,OM as Ln,ON as xt,OO as Un,AH as Rn,zW as Ot,zQ as ca,zV as jn,OP as Nn,OQ as Vn,y$ as Hn,OR as Bt,OS as Lt,OT as Mn,z1 as zn,z0 as rt,OU as $n,OV as Gn,OW as Yn,Jo as Zn,OX as Za,OY as Kn,vC as Ut,k7 as Wn,gE as qn,AM as Qn,OZ as Rt,O_ as Xn,AN as Jn,O$ as er,dd as ar,sG as tr,AC as nr,Aw as Le,bv as rr,bE as sr,cw as or,bF as cr,IC as ir}from"./zeni-epic-state-CrPv4S-z.js";import{z as J,I as je,C as ce,$ as Y,B as la,bZ as xa,c8 as dr,p as ve,c9 as lr,ca as ur,Z as ua,aK as Fe,s as ge,bg as Ka,cb as mr,A as ma,i as Oa,m as Wa,c as Q,D as qa,cc as Cr,an as Qa,bs as Qe,cd as Va,ce as pr,x as Xa,a3 as hr,cf as gr,aq as jt,X as Ha,U as Nt,f as Vt,cg as fr,ch as br,ci as yr,cj as Sr,ck as Ir,cl as Ar,d as Aa,cm as Er,cn as kr,co as Ua,H as Dr,cp as _r,cq as wr,cr as Pr,cs as Tr,ct as Fr,a6 as vr}from"./index-BreaiJNl.js";import{n as _e,D as Ht,S as xr}from"./mui-BKTsYfTF.js";import{a as i}from"./sentry-8NyHUHYi.js";import{g as Ce,a as Ca,b as Mt,c as Ie,d as Ae,e as Re,f as Ne,A as Or,h as Ja,P as Br,i as et,s as Xe,j as zt,k as Me,l as $t,m as Lr,n as Gt,p as Ur,S as st}from"./SetupPagesScreen-C4GjXjRP.js";import Ba from"./NotFoundScreen-DnYi4Alo.js";import{M as ze}from"./MobileAppDrawer-B0SDRa0y.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-Yc6V_8SE.js";import{c as Zt}from"./useFetchSuggestedQuestionsWhenReady-Dl_AzQW_.js";import{v as ot}from"./utils-BgDKBMSG.js";import{t as Rr}from"./AddressScreen-DcX4lc_F.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./analyticsHelper-SG8tB9jY.js";import"./routePaths-D5pZG1HW.js";import"./BusinessVerificationPageScreen-B-O4fGng.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]="5ea8b2d5-b2fd-4968-ae31-e35f1c7d3798",e._sentryDebugIdIdentifier="sentry-dbid-5ea8b2d5-b2fd-4968-ae31-e35f1c7d3798")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=J.getSignedInUser(),n=y(X=>ie(X)),C=je(),p=Ue(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Y.isChargeCardFeatureEnabled),g=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=u(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,f=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>$e(X,n.companyId)),N=Ge(v.controllers),{creditAccount:B,creditAccountRepayment:P}=y(X=>Ye(X)),V=y(X=>X.classListState.fetchState),m=!_&&d&&g,l=y(X=>Ma(X,t,m,d)),[w,T]=i.useState(!1),H=l.chargeCard,L=H?.cardCreatedByUser?.userId,K=y(X=>L!=null?ba(X.userRoleState,L):void 0),I=K?.accountingClassIDs[0],O=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,R=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=R?.accountingClassIDs[0],E=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),G=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&&G&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,G,q]),i.useEffect(()=>{w||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,m,!1)))},[w,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(G===!1||G&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,c);e(X)}},[l.fetchState,c,G]),i.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&d&&g&&p&&a(za()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&d&&g&&p&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[B.fetchState,P.fetchState,a,d,g,p,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Re(d,f,D,g),ae=Ca(d,g,p,B,P),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:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:f,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:g,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:B,classListFetchState:V,creditAccountRepayment:P,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:R?.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=fe(),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(Ba,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},zr=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=fe(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[g,U]=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,f=y(E=>Qt(E,n)),d=f.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=v(Y.isDebitCardFeatureEnabled),P=Se(B,k),V=Ie({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:P}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),w=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Ae({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&L&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&f.fetchState==="Not-Started"&&(c(!0),a(Je(n,K,L)))},[o,f.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(f.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=ge(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:G}})}else if(_&&f.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=ge(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:G}})}}},[f.fetchState,d?.type.code,_,f.isRefreshingViewInBackground]);const O=J.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),R=()=>{d?.status?.code!=="active"&&a(Ga(n,!0))};i.useEffect(()=>{f.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(R,3e3),A(!0))},[f.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{U(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(ze,{isAppContentDrawerOpen:g,handleDrawerToggle:W}),s.jsx($r,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:f,signedInUserToken:O,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(Gr,{windowSize:t,children:e}):null]})},$r=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:Oa.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(Pa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(wa(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),Gr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-Dh2QAkHf.js";import{a as g}from"./sentry-DK3ab-Mk.js";import{j as w,h as x,u as T,l as k,g as O,k as E}from"./core-BFuZewo1.js";import{z as D,b2 as F,x as P,c as L,f as V,ac as b,b3 as j,aq as A,ar as U,s as B}from"./index-DyQYRNiR.js";import{eO as C,fC as M,rx as _,fx as G,c1 as R,LS as z,bn as Y,pF as $,pt as q,j$ as H,lv as S,LT as Z,bD as J,cu as N,lD as K,lG as Q}from"./zeni-epic-state-Bhb0JOZy.js";import"./mui-sjj8uXYx.js";import{c as W}from"./routePaths-zFH_1U3e.js";import{M as X}from"./MobileAppDrawer-FuW2cx8a.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]="ed7754fb-0071-416b-aa0a-2183e77631c6",n._sentryDebugIdIdentifier="sentry-dbid-ed7754fb-0071-416b-aa0a-2183e77631c6")}catch{}})();const ee=E(function(n){const t=G(n),i=D.getSignedInUser(),l=C(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(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:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(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(Q())},onAddressClick:e=>{const a=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(K({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:U(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?J(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(Z(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(q(e))},onEditFileName:(e,a)=>{n($(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=x(),i=T(),{tenantEmailDomain:l}=k(),[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=>C(s)),d=r.companyId??D.getSignedInUserTenant(l)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(M(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[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:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-DuKOLlGn.js";import{a as g}from"./sentry-8NyHUHYi.js";import{j as w,h as x,u as T,l as k,g as O,k as E}from"./core-Chn6k0lm.js";import{z as D,b2 as F,x as P,c as L,f as V,ac as b,b3 as j,aq as A,ar as U,s as B}from"./index-BreaiJNl.js";import{eO as C,fC as M,rx as _,fx as G,c1 as R,LS as z,bn as Y,pF as $,pt as q,j$ as H,lv as S,LT as Z,bD as J,cu as N,lD as K,lG as Q}from"./zeni-epic-state-CrPv4S-z.js";import"./mui-BKTsYfTF.js";import{c as W}from"./routePaths-D5pZG1HW.js";import{M as X}from"./MobileAppDrawer-B0SDRa0y.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]="ed7754fb-0071-416b-aa0a-2183e77631c6",n._sentryDebugIdIdentifier="sentry-dbid-ed7754fb-0071-416b-aa0a-2183e77631c6")}catch{}})();const ee=E(function(n){const t=G(n),i=D.getSignedInUser(),l=C(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(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:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(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(Q())},onAddressClick:e=>{const a=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(K({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:U(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?J(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(Z(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(q(e))},onEditFileName:(e,a)=>{n($(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=x(),i=T(),{tenantEmailDomain:l}=k(),[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=>C(s)),d=r.companyId??D.getSignedInUserTenant(l)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(M(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[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:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate: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-Dh2QAkHf.js";import{a}from"./sentry-DK3ab-Mk.js";import{h as D,u as v,g as u,N as w}from"./core-BFuZewo1.js";import{Iy as O,eO as A,fj as j,mm as L,fL as h,fi as U,eP as _,IF as F}from"./zeni-epic-state-Bhb0JOZy.js";import{u as $,z as p,L as g,D as k,d as H}from"./index-DyQYRNiR.js";import{n as P}from"./mui-sjj8uXYx.js";import{t as z}from"./getLocaleForTenant-BjDLo9MD.js";import{g as R,Q as G}from"./QBOConnectionScreen-HcQe0eGd.js";import"./recharts-Di30TSqm.js";import"./analytics-DxyMm95L.js";import"./plaid-CvsW7WgG.js";import"./dnd-mZw2LJiL.js";import"./stripe-DMRn4zHo.js";import"./lottie-DueJpsnD.js";import"./lexical-DGyy1g7u.js";import"./pdf-BDzUzBn8.js";import"./utils-DdXexb3v.js";import"./empty-k_XNQecn.js";import"./pdf-lib-C3DJztgI.js";import"./index-fD_ZJJNS.js";import"./url-Cw9gHNrq.js";import"./index-BcBTxYRI.js";import"./decodeURIComponentSafe-GFuMfgir.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]="564ddb9a-be40-4663-bd95-1f7215e73359",t._sentryDebugIdIdentifier="sentry-dbid-564ddb9a-be40-4663-bd95-1f7215e73359")}catch{}})();const Q=P.div`
1
+ import{j as C}from"./liveblocks-DuKOLlGn.js";import{a}from"./sentry-8NyHUHYi.js";import{h as D,u as v,g as u,N as w}from"./core-Chn6k0lm.js";import{Iy as O,eO as A,fj as j,mm as L,fL as h,fi as U,eP as _,IF as F}from"./zeni-epic-state-CrPv4S-z.js";import{u as $,z as p,L as g,D as k,d as H}from"./index-BreaiJNl.js";import{n as P}from"./mui-BKTsYfTF.js";import{t as z}from"./getLocaleForTenant-j9oTpFdD.js";import{g as R,Q as G}from"./QBOConnectionScreen-H8Qvt38d.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";import"./empty-CM7hXaA6.js";import"./pdf-lib-CFnSeXgz.js";import"./index-Cyof-eFv.js";import"./url-KL9dl4eL.js";import"./index-vkGyITuL.js";import"./decodeURIComponentSafe-B4WuQ5yM.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]="564ddb9a-be40-4663-bd95-1f7215e73359",t._sentryDebugIdIdentifier="sentry-dbid-564ddb9a-be40-4663-bd95-1f7215e73359")}catch{}})();const Q=P.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-DuKOLlGn.js";import{z as m}from"./index-BreaiJNl.js";import{g as n}from"./QBOConnectionScreen-H8Qvt38d.js";import"./sentry-8NyHUHYi.js";import{u as p,N as s}from"./core-Chn6k0lm.js";import"./zeni-epic-state-CrPv4S-z.js";import"./recharts-DDgm0ZY-.js";import"./mui-BKTsYfTF.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";import"./empty-CM7hXaA6.js";import"./pdf-lib-CFnSeXgz.js";import"./index-Cyof-eFv.js";import"./url-KL9dl4eL.js";import"./index-vkGyITuL.js";import"./decodeURIComponentSafe-B4WuQ5yM.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]="9b06c105-de24-4a38-a62b-e92ff6d04824",t._sentryDebugIdIdentifier="sentry-dbid-9b06c105-de24-4a38-a62b-e92ff6d04824")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),a=m.getSignedInUser()?.userId??"";if(f(o,r,e,a)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:d})}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-Dh2QAkHf.js";import{t as $e,A as Ce}from"./AddressScreen-2d2ovpiZ.js";import ze from"./NotFoundScreen-CLbpaFRJ.js";import{a as g}from"./sentry-DK3ab-Mk.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as qe,o as M}from"./core-BFuZewo1.js";import{H as de,I as le,z as B,C as ue,m as Je,$ as _,s as V,x as H,c as N,B as we,f as Y,am as Ke,Z as Qe,an as Ie,i as te,ao as Ze,ap as ke,d as He,aq as We,ar as xe,as as Ye}from"./index-DyQYRNiR.js";import{bn as Xe,eO as ee,fb as et,eU as pe,eS as me,bv as tt,mk as at,f7 as nt,bN as ot,j3 as ae,j6 as ve,J0 as st,bS as it,c1 as ge,rL as he,rw as rt,Jx as X,rM as _e,GW as ct,k7 as Ue,Jy as Ve,Jz as dt,JA as lt,JB as ut,j1 as pt,j4 as mt,ry as Be,rK as gt,bD as Te,cu as ht,rY as Ee,pF as ft,pt as yt,j$ as bt,fA as St,fz as Ct,fy as It,JC as kt,rq as xt,rZ as Tt,s0 as Et,s3 as Ot,s9 as At,cT as Pt}from"./zeni-epic-state-Bhb0JOZy.js";import{n as fe}from"./mui-sjj8uXYx.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-HcQe0eGd.js";import"./recharts-Di30TSqm.js";import"./analytics-DxyMm95L.js";import"./plaid-CvsW7WgG.js";import"./dnd-mZw2LJiL.js";import"./stripe-DMRn4zHo.js";import"./lottie-DueJpsnD.js";import"./lexical-DGyy1g7u.js";import"./pdf-BDzUzBn8.js";import"./utils-DdXexb3v.js";import"./empty-k_XNQecn.js";import"./pdf-lib-C3DJztgI.js";import"./index-fD_ZJJNS.js";import"./url-Cw9gHNrq.js";import"./index-BcBTxYRI.js";import"./decodeURIComponentSafe-GFuMfgir.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]="5443579e-7737-4ec9-a9ae-89b61f18aabb",t._sentryDebugIdIdentifier="sentry-dbid-5443579e-7737-4ec9-a9ae-89b61f18aabb")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),k=Je(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:E}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),G=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),A=me(c),P=[],K=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!q,J=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&P.push("top_expenses"),z===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),J===!1&&P.push("reimbursement_card","reimbursement_promo_card"),I===!1&&P.push("zeni_accounts_promo_card"),f===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||A||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,P)))},[d,O,w,A,i,c.tenantId,s]),g.useEffect(()=>{(w||A)&&setTimeout(()=>{b(!0)},5e3)},[w,A]),O!=="Completed")return a.jsx(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(x,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Q=>Q.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:E,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-DuKOLlGn.js";import{t as $e,A as Ce}from"./AddressScreen-DcX4lc_F.js";import ze from"./NotFoundScreen-DnYi4Alo.js";import{a as g}from"./sentry-8NyHUHYi.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as qe,o as M}from"./core-Chn6k0lm.js";import{H as de,I as le,z as B,C as ue,m as Je,$ as _,s as V,x as H,c as N,B as we,f as Y,am as Ke,Z as Qe,an as Ie,i as te,ao as Ze,ap as ke,d as He,aq as We,ar as xe,as as Ye}from"./index-BreaiJNl.js";import{bn as Xe,eO as ee,fb as et,eU as pe,eS as me,bv as tt,mk as at,f7 as nt,bN as ot,j3 as ae,j6 as ve,J0 as st,bS as it,c1 as ge,rL as he,rw as rt,Jx as X,rM as _e,GW as ct,k7 as Ue,Jy as Ve,Jz as dt,JA as lt,JB as ut,j1 as pt,j4 as mt,ry as Be,rK as gt,bD as Te,cu as ht,rY as Ee,pF as ft,pt as yt,j$ as bt,fA as St,fz as Ct,fy as It,JC as kt,rq as xt,rZ as Tt,s0 as Et,s3 as Ot,s9 as At,cT as Pt}from"./zeni-epic-state-CrPv4S-z.js";import{n as fe}from"./mui-BKTsYfTF.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-H8Qvt38d.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";import"./empty-CM7hXaA6.js";import"./pdf-lib-CFnSeXgz.js";import"./index-Cyof-eFv.js";import"./url-KL9dl4eL.js";import"./index-vkGyITuL.js";import"./decodeURIComponentSafe-B4WuQ5yM.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]="5443579e-7737-4ec9-a9ae-89b61f18aabb",t._sentryDebugIdIdentifier="sentry-dbid-5443579e-7737-4ec9-a9ae-89b61f18aabb")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),k=Je(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:E}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),G=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),A=me(c),P=[],K=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!q,J=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&P.push("top_expenses"),z===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),J===!1&&P.push("reimbursement_card","reimbursement_promo_card"),I===!1&&P.push("zeni_accounts_promo_card"),f===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||A||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,P)))},[d,O,w,A,i,c.tenantId,s]),g.useEffect(()=>{(w||A)&&setTimeout(()=>{b(!0)},5e3)},[w,A]),O!=="Completed")return a.jsx(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(x,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Q=>Q.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:E,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-Dh2QAkHf.js";import{l as $,g as S,u as K,h as V,j as q,k as H,s as Ka,n as at,o as w}from"./core-BFuZewo1.js";import{eO as L,JS as Me,bD as Yt,bq as ue,L3 as qa,hT as Za,L4 as xt,L5 as Ha,hW as nt,L6 as Re,L7 as Ja,h$ as Qa,L8 as Tt,L9 as Wa,i3 as ot,La as Le,Lb as Xa,ck as rt,Lc as en,Ld as tn,Ka as an,iZ as nn,Le as on,bn as Ae,Lf as Gt,JG as ee,bc as Nt,jb as Vt,mu as $t,iW as zt,JI as te,JH as Z,f3 as sn,fl as rn,Lg as cn,Lh as ln,Li as Kt,Lj as be,tB as ve,tC as Ie,tZ as me,tT as ae,tG as Ee,Lk as dn,Ll as un,Lm as mn,Ln as qt,Lo as Ce,Lp as pn,dC as Ue,qd as Zt,Lq as hn,Lr as fn,Ls as gn,Lt as it,J3 as ct,jr as pe,u5 as lt,ql as bn,Lu as Cn,tD as wt,qg as le,qc as Ht,Lv as se,Lw as _n,Lx as dt,J1 as ut,sd as Jt,Ly as kn,Lz as Sn,LA as yn,LB as mt,sq as An,LC as vn,tF as Dt,sc as Qt,LD as re,LE as In,bv as Wt,u9 as Xt,LF as En,LG as xn,LH as Tn,LI as pt,u4 as wn,LJ as Dn,tE as Ft,u8 as ea,LK as ie,LL as Fn,LM as On,LN as ta,jg as aa,mr as na,jl as oa,mp as sa,mo as ra,mn as ia,rB as Pn,fb as Bn,cN as Rn,cO as Ln,mk as jn,f7 as Mn,mB as Un,Dd as Ot,LO as Yn,LP as Gn,LQ as Nn,LR as Vn,b5 as ht,e_ as $n,gB as zn,fC as Kn,mv as qn,iP as Zn,ms as Hn,mq as Jn,eU as Qn,eS as Wn}from"./zeni-epic-state-Bhb0JOZy.js";import{z as R,X as J,s as D,c as I,D as z,aR as Xn,x as xe,aS as ca,f as G,aT as eo,I as Te,aU as la,C as Ye,$ as j,m as to,aV as ao,aW as no,R as da,Z as oo,a as ua,a1 as so,aX as ro,aK as ma,aY as io,aZ as co,W as lo,a_ as uo,a$ as mo,an as po,p as ho,U as fo,b0 as go,b1 as ke}from"./index-DyQYRNiR.js";import{n as ft}from"./mui-sjj8uXYx.js";import{a as b}from"./sentry-DK3ab-Mk.js";import{w as pa}from"./withTransactionSidePanel-Bd_ziiFV.js";import{b as ha,t as he,e as ne,a as gt,v as bo}from"./routePaths-zFH_1U3e.js";import{u as Q}from"./useAskAiCfoHostNavButtonProps-BBmaNftJ.js";import{c as we,b as Co}from"./useFetchSuggestedQuestionsWhenReady-Cem1fO9j.js";import ye from"./NotFoundScreen-CLbpaFRJ.js";import{t as fa}from"./analyticsHelper-Djzujhjh.js";import{C as _o}from"./CompanyPassportScreen-DsIgXQcl.js";import{F as ko}from"./FeaturePreviewScreen-DfcTWDpe.js";import{R as So}from"./ReferralListScreen-DvrPT4g8.js";import"./recharts-Di30TSqm.js";import"./analytics-DxyMm95L.js";import"./plaid-CvsW7WgG.js";import"./dnd-mZw2LJiL.js";import"./stripe-DMRn4zHo.js";import"./lottie-DueJpsnD.js";import"./lexical-DGyy1g7u.js";import"./pdf-BDzUzBn8.js";import"./utils-DdXexb3v.js";import"./TransactionDetailScreen-8mXHg0UY.js";import"./decodeURIComponentSafe-GFuMfgir.js";import"./MobileAppDrawer-FuW2cx8a.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]="cd2e0533-bea8-4b78-ab7a-d154fbc48e02",e._sentryDebugIdIdentifier="sentry-dbid-cd2e0533-bea8-4b78-ab7a-d154fbc48e02")}catch{}})();const yo=pa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(x=>x.tenantState.currentTenantId),d=S(x=>L(x)),{tenantEmailDomain:p}=$(),C=K(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=b.useMemo(()=>r!=null?Yt(r):ue(),[r]),h=V(),f=q(),k=S(x=>qa(x,m,o)),y=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),A=b.useCallback((x,P)=>{h(xt({sortKey:x,sortOrder:P}))},[]),E=b.useCallback(x=>{h(xt({downloadState:x}))},[]),M=b.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(p!=null){const P=ha({id:x.transactionId,type:x.transactionType},p);f(P);const fe=D(C.state?.pathnameStackToGoBack,C.pathname);f(P,{state:{pathnameStackToGoBack:fe}})}},[p,e]),F=b.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(Xn,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:M,onReload:y,onBackClick:_,onColumnSortConfigChanged:A,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ao=()=>{const e=V(),a=q(),t=S(A=>Ha(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AP Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>L(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},C=b.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),g=t.apAgingUIState.selectedDate??ue(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(nt(g))},[]);b.useEffect(()=>{u()},[]);const c=b.useCallback(()=>{a("../",{relative:"path"})},[]),m=b.useCallback(A=>{e(Re({searchString:A}))},[]),h=b.useCallback((A,E)=>{e(Re({sortKey:E,sortOrder:A}))},[]),f=b.useCallback(A=>{a(`./${A}/${g.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=b.useCallback(A=>{e(Re({downloadState:A}))},[]),y=b.useCallback((A,E)=>{},[]),_=b.useCallback((A,E)=>{e(Re({selectedDate:A,agingDateSelectionType:E})),e(nt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:A=>A.trackPageLoaded(G.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:t.apAgingUIState,report:t,downloadParams:C,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:_,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},vo=pa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(F=>L(F)),{tenantEmailDomain:d}=$(),p=K(),C=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:g,companyName:C,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=b.useMemo(()=>r!=null?Yt(r):ue(),[r]),m=V(),h=q(),f=S(F=>Ja(F,c,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Qa(o,c))},[c]),y=b.useCallback(()=>{h("../../",{relative:"path"})},[]),_=b.useCallback((F,x)=>{m(Tt({sortKey:F,sortOrder:x}))},[]),A=b.useCallback(F=>{m(Tt({downloadState:F}))},[]),E=b.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const x=ha({id:F.transactionId,type:F.transactionType},d);h(x);const P=D(p.state?.pathnameStackToGoBack,p.pathname);h(x,{state:{pathnameStackToGoBack:P}})}},[d,e]),M=b.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(eo,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:E,onReload:k,onBackClick:y,onColumnSortConfigChanged:_,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=V(),a=q(),t=S(_=>Wa(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AR Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(_=>L(_)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=b.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),C=t.arAgingUIState.selectedDate??ue(),g=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(ot(C))},[]);b.useEffect(()=>{g()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),c=b.useCallback(_=>{e(Le({searchString:_}))},[]),m=b.useCallback((_,A)=>{e(Le({sortKey:A,sortOrder:_}))},[]),h=b.useCallback(_=>{a(`./${_}/${C.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),f=b.useCallback(_=>{e(Le({downloadState:_}))},[]),k=b.useCallback((_,A)=>{e(Le({selectedDate:_,agingDateSelectionType:A})),e(ot(_))},[]),y=b.useCallback((_,A)=>{e(Xa({nodeId:_,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:_=>_.trackPageLoaded(G.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ba(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=he(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 Eo=H(function(e){const a=en(e).accountsInOrder.map((n,o)=>ga(n,o)),t=tn(e);return{sectionTitle:z.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ba)(la),xo=H(function(e){const a=on(e).accountsInOrder.map((o,r)=>ga(o,r)),t=R.getSignedInUser(),n=Ae(t);return{sectionTitle:z.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ba)(la);function To(){const e=q(),a=K(),{tenantEmailDomain:t}=$(),n=Te(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=rt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=K(),{tenantEmailDomain:t}=$(),n=Te(),o=rt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Do=ft.div`
1
+ import{j as l}from"./liveblocks-DuKOLlGn.js";import{l as $,g as S,u as K,h as V,j as q,k as H,s as Ka,n as at,o as w}from"./core-Chn6k0lm.js";import{eO as L,JS as Me,bD as Yt,bq as ue,L3 as qa,hT as Za,L4 as xt,L5 as Ha,hW as nt,L6 as Re,L7 as Ja,h$ as Qa,L8 as Tt,L9 as Wa,i3 as ot,La as Le,Lb as Xa,ck as rt,Lc as en,Ld as tn,Ka as an,iZ as nn,Le as on,bn as Ae,Lf as Gt,JG as ee,bc as Nt,jb as Vt,mu as $t,iW as zt,JI as te,JH as Z,f3 as sn,fl as rn,Lg as cn,Lh as ln,Li as Kt,Lj as be,tB as ve,tC as Ie,tZ as me,tT as ae,tG as Ee,Lk as dn,Ll as un,Lm as mn,Ln as qt,Lo as Ce,Lp as pn,dC as Ue,qd as Zt,Lq as hn,Lr as fn,Ls as gn,Lt as it,J3 as ct,jr as pe,u5 as lt,ql as bn,Lu as Cn,tD as wt,qg as le,qc as Ht,Lv as se,Lw as _n,Lx as dt,J1 as ut,sd as Jt,Ly as kn,Lz as Sn,LA as yn,LB as mt,sq as An,LC as vn,tF as Dt,sc as Qt,LD as re,LE as In,bv as Wt,u9 as Xt,LF as En,LG as xn,LH as Tn,LI as pt,u4 as wn,LJ as Dn,tE as Ft,u8 as ea,LK as ie,LL as Fn,LM as On,LN as ta,jg as aa,mr as na,jl as oa,mp as sa,mo as ra,mn as ia,rB as Pn,fb as Bn,cN as Rn,cO as Ln,mk as jn,f7 as Mn,mB as Un,Dd as Ot,LO as Yn,LP as Gn,LQ as Nn,LR as Vn,b5 as ht,e_ as $n,gB as zn,fC as Kn,mv as qn,iP as Zn,ms as Hn,mq as Jn,eU as Qn,eS as Wn}from"./zeni-epic-state-CrPv4S-z.js";import{z as R,X as J,s as D,c as I,D as z,aR as Xn,x as xe,aS as ca,f as G,aT as eo,I as Te,aU as la,C as Ye,$ as j,m as to,aV as ao,aW as no,R as da,Z as oo,a as ua,a1 as so,aX as ro,aK as ma,aY as io,aZ as co,W as lo,a_ as uo,a$ as mo,an as po,p as ho,U as fo,b0 as go,b1 as ke}from"./index-BreaiJNl.js";import{n as ft}from"./mui-BKTsYfTF.js";import{a as b}from"./sentry-8NyHUHYi.js";import{w as pa}from"./withTransactionSidePanel-BxWHMEM-.js";import{b as ha,t as he,e as ne,a as gt,v as bo}from"./routePaths-D5pZG1HW.js";import{u as Q}from"./useAskAiCfoHostNavButtonProps-Yc6V_8SE.js";import{c as we,b as Co}from"./useFetchSuggestedQuestionsWhenReady-Dl_AzQW_.js";import ye from"./NotFoundScreen-DnYi4Alo.js";import{t as fa}from"./analyticsHelper-SG8tB9jY.js";import{C as _o}from"./CompanyPassportScreen-DMNbV7xV.js";import{F as ko}from"./FeaturePreviewScreen-DukdbkDU.js";import{R as So}from"./ReferralListScreen-Ih6wu8ZB.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";import"./TransactionDetailScreen-B71792qc.js";import"./decodeURIComponentSafe-B4WuQ5yM.js";import"./MobileAppDrawer-B0SDRa0y.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]="cd2e0533-bea8-4b78-ab7a-d154fbc48e02",e._sentryDebugIdIdentifier="sentry-dbid-cd2e0533-bea8-4b78-ab7a-d154fbc48e02")}catch{}})();const yo=pa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(x=>x.tenantState.currentTenantId),d=S(x=>L(x)),{tenantEmailDomain:p}=$(),C=K(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=b.useMemo(()=>r!=null?Yt(r):ue(),[r]),h=V(),f=q(),k=S(x=>qa(x,m,o)),y=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),A=b.useCallback((x,P)=>{h(xt({sortKey:x,sortOrder:P}))},[]),E=b.useCallback(x=>{h(xt({downloadState:x}))},[]),M=b.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(p!=null){const P=ha({id:x.transactionId,type:x.transactionType},p);f(P);const fe=D(C.state?.pathnameStackToGoBack,C.pathname);f(P,{state:{pathnameStackToGoBack:fe}})}},[p,e]),F=b.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(Xn,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:M,onReload:y,onBackClick:_,onColumnSortConfigChanged:A,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ao=()=>{const e=V(),a=q(),t=S(A=>Ha(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AP Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>L(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},C=b.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),g=t.apAgingUIState.selectedDate??ue(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(nt(g))},[]);b.useEffect(()=>{u()},[]);const c=b.useCallback(()=>{a("../",{relative:"path"})},[]),m=b.useCallback(A=>{e(Re({searchString:A}))},[]),h=b.useCallback((A,E)=>{e(Re({sortKey:E,sortOrder:A}))},[]),f=b.useCallback(A=>{a(`./${A}/${g.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=b.useCallback(A=>{e(Re({downloadState:A}))},[]),y=b.useCallback((A,E)=>{},[]),_=b.useCallback((A,E)=>{e(Re({selectedDate:A,agingDateSelectionType:E})),e(nt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:A=>A.trackPageLoaded(G.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:t.apAgingUIState,report:t,downloadParams:C,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:_,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},vo=pa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(F=>L(F)),{tenantEmailDomain:d}=$(),p=K(),C=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:g,companyName:C,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=b.useMemo(()=>r!=null?Yt(r):ue(),[r]),m=V(),h=q(),f=S(F=>Ja(F,c,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Qa(o,c))},[c]),y=b.useCallback(()=>{h("../../",{relative:"path"})},[]),_=b.useCallback((F,x)=>{m(Tt({sortKey:F,sortOrder:x}))},[]),A=b.useCallback(F=>{m(Tt({downloadState:F}))},[]),E=b.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const x=ha({id:F.transactionId,type:F.transactionType},d);h(x);const P=D(p.state?.pathnameStackToGoBack,p.pathname);h(x,{state:{pathnameStackToGoBack:P}})}},[d,e]),M=b.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(eo,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:E,onReload:k,onBackClick:y,onColumnSortConfigChanged:_,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=V(),a=q(),t=S(_=>Wa(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AR Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(_=>L(_)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=b.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),C=t.arAgingUIState.selectedDate??ue(),g=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(ot(C))},[]);b.useEffect(()=>{g()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),c=b.useCallback(_=>{e(Le({searchString:_}))},[]),m=b.useCallback((_,A)=>{e(Le({sortKey:A,sortOrder:_}))},[]),h=b.useCallback(_=>{a(`./${_}/${C.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),f=b.useCallback(_=>{e(Le({downloadState:_}))},[]),k=b.useCallback((_,A)=>{e(Le({selectedDate:_,agingDateSelectionType:A})),e(ot(_))},[]),y=b.useCallback((_,A)=>{e(Xa({nodeId:_,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:_=>_.trackPageLoaded(G.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ba(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=he(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 Eo=H(function(e){const a=en(e).accountsInOrder.map((n,o)=>ga(n,o)),t=tn(e);return{sectionTitle:z.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ba)(la),xo=H(function(e){const a=on(e).accountsInOrder.map((o,r)=>ga(o,r)),t=R.getSignedInUser(),n=Ae(t);return{sectionTitle:z.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ba)(la);function To(){const e=q(),a=K(),{tenantEmailDomain:t}=$(),n=Te(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=rt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=K(),{tenantEmailDomain:t}=$(),n=Te(),o=rt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Do=ft.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-Dh2QAkHf.js";import{a as u}from"./sentry-DK3ab-Mk.js";import{h as y,g as b,k as A,u as w,N as k}from"./core-BFuZewo1.js";import{Iy as N,eO as _,fj as U,Iz as z,mm as L,IA as R}from"./zeni-epic-state-Bhb0JOZy.js";import{u as O,z as f,L as T,t as S,D as j,b as $}from"./index-DyQYRNiR.js";import"./mui-sjj8uXYx.js";import{t as P}from"./getLocaleForTenant-BjDLo9MD.js";import"./recharts-Di30TSqm.js";import"./analytics-DxyMm95L.js";import"./plaid-CvsW7WgG.js";import"./dnd-mZw2LJiL.js";import"./stripe-DMRn4zHo.js";import"./lottie-DueJpsnD.js";import"./lexical-DGyy1g7u.js";import"./pdf-BDzUzBn8.js";import"./utils-DdXexb3v.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]="7c1b996e-f0e3-428e-a01b-680e39933f04",t._sentryDebugIdIdentifier="sentry-dbid-7c1b996e-f0e3-428e-a01b-680e39933f04")}catch{}})();const Q=A(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:R(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=w(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,I=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=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&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!z(i))&&t(L(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-DuKOLlGn.js";import{a as u}from"./sentry-8NyHUHYi.js";import{h as y,g as b,k as A,u as w,N as k}from"./core-Chn6k0lm.js";import{Iy as N,eO as _,fj as U,Iz as z,mm as L,IA as R}from"./zeni-epic-state-CrPv4S-z.js";import{u as O,z as f,L as T,t as S,D as j,b as $}from"./index-BreaiJNl.js";import"./mui-BKTsYfTF.js";import{t as P}from"./getLocaleForTenant-j9oTpFdD.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.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]="7c1b996e-f0e3-428e-a01b-680e39933f04",t._sentryDebugIdIdentifier="sentry-dbid-7c1b996e-f0e3-428e-a01b-680e39933f04")}catch{}})();const Q=A(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:R(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=w(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,I=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=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&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!z(i))&&t(L(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-Dh2QAkHf.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-BFuZewo1.js";import{Mz as k,MG as _,fA as J,fz as q,fy as W,io as K,JH as L,pw as Q,eO as V,M5 as D,il as T,MA as S,MJ as F,ij as G,iH as j}from"./zeni-epic-state-Bhb0JOZy.js";import{bo as X,Z as R,C as N,z as U,m as z,p,$ as v,B as H,bp as Y,d as M,bq as ee,s as te}from"./index-DyQYRNiR.js";import{n as O}from"./mui-sjj8uXYx.js";import"./sentry-DK3ab-Mk.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]="3f6bb051-4771-41f5-932a-9716dc17ff2d",e._sentryDebugIdIdentifier="sentry-dbid-3f6bb051-4771-41f5-932a-9716dc17ff2d")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(K(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function Z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
1
+ import{j as l}from"./liveblocks-DuKOLlGn.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-Chn6k0lm.js";import{Mz as k,MG as _,fA as J,fz as q,fy as W,io as K,JH as L,pw as Q,eO as V,M5 as D,il as T,MA as S,MJ as F,ij as G,iH as j}from"./zeni-epic-state-CrPv4S-z.js";import{bo as X,Z as R,C as N,z as U,m as z,p,$ as v,B as H,bp as Y,d as M,bq as ee,s as te}from"./index-BreaiJNl.js";import{n as O}from"./mui-BKTsYfTF.js";import"./sentry-8NyHUHYi.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]="3f6bb051-4771-41f5-932a-9716dc17ff2d",e._sentryDebugIdIdentifier="sentry-dbid-3f6bb051-4771-41f5-932a-9716dc17ff2d")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(K(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function Z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-Dh2QAkHf.js";import{Z as c,A as l,m as f}from"./index-DyQYRNiR.js";import{D as p}from"./mui-sjj8uXYx.js";import"./sentry-DK3ab-Mk.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]="6c7fcb16-2846-45a2-9de2-7f28416bec9e",e._sentryDebugIdIdentifier="sentry-dbid-6c7fcb16-2846-45a2-9de2-7f28416bec9e")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=c(),a=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
1
+ import{j as i}from"./liveblocks-DuKOLlGn.js";import{Z as c,A as l,m as f}from"./index-BreaiJNl.js";import{D as p}from"./mui-BKTsYfTF.js";import"./sentry-8NyHUHYi.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]="6c7fcb16-2846-45a2-9de2-7f28416bec9e",e._sentryDebugIdIdentifier="sentry-dbid-6c7fcb16-2846-45a2-9de2-7f28416bec9e")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=c(),a=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-Dh2QAkHf.js";import{a as d}from"./sentry-DK3ab-Mk.js";import{j as A,h as B,u as O,l as q,g as l,N as K,k as F,n as J,o as N}from"./core-BFuZewo1.js";import{KO as _,eO as M,Kb as R,kr as W,GO as I,KT as Y,JG as $,jr as z,GP as S,Kg as H,Kh as V,JI as L,JH as Q}from"./zeni-epic-state-Bhb0JOZy.js";import{aO as U,c as X,p as Z,s as tt}from"./index-DyQYRNiR.js";import"./mui-sjj8uXYx.js";import{d as k}from"./decodeURIComponentSafe-GFuMfgir.js";import{w as et}from"./withTransactionSidePanel-Bd_ziiFV.js";import{e as at,b as nt}from"./routePaths-zFH_1U3e.js";import"./recharts-Di30TSqm.js";import"./analytics-DxyMm95L.js";import"./plaid-CvsW7WgG.js";import"./dnd-mZw2LJiL.js";import"./stripe-DMRn4zHo.js";import"./lottie-DueJpsnD.js";import"./lexical-DGyy1g7u.js";import"./pdf-BDzUzBn8.js";import"./utils-DdXexb3v.js";import"./useAskAiCfoHostNavButtonProps-BBmaNftJ.js";import"./useFetchSuggestedQuestionsWhenReady-Cem1fO9j.js";import"./TransactionDetailScreen-8mXHg0UY.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]="112dda24-24ff-4376-91d5-cabc75842ef4",a._sentryDebugIdIdentifier="sentry-dbid-112dda24-24ff-4376-91d5-cabc75842ef4")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=O(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=q(),r=k(j??""),p=k(x??""),f=rt(r,p),G=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>M(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(W(i)))},[m,f,i]);const P=l(n=>n.trendState.fetchState),E=u?.selectedPeriod?.timePeriod??D,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&P==="Completed"&&(g(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,P]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(K,{to:b(G.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(J,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
1
+ import{j as s}from"./liveblocks-DuKOLlGn.js";import{a as d}from"./sentry-8NyHUHYi.js";import{j as A,h as B,u as O,l as q,g as l,N as K,k as F,n as J,o as N}from"./core-Chn6k0lm.js";import{KO as _,eO as M,Kb as R,kr as W,GO as I,KT as Y,JG as $,jr as z,GP as S,Kg as H,Kh as V,JI as L,JH as Q}from"./zeni-epic-state-CrPv4S-z.js";import{aO as U,c as X,p as Z,s as tt}from"./index-BreaiJNl.js";import"./mui-BKTsYfTF.js";import{d as k}from"./decodeURIComponentSafe-B4WuQ5yM.js";import{w as et}from"./withTransactionSidePanel-BxWHMEM-.js";import{e as at,b as nt}from"./routePaths-D5pZG1HW.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";import"./useAskAiCfoHostNavButtonProps-Yc6V_8SE.js";import"./useFetchSuggestedQuestionsWhenReady-Dl_AzQW_.js";import"./TransactionDetailScreen-B71792qc.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]="112dda24-24ff-4376-91d5-cabc75842ef4",a._sentryDebugIdIdentifier="sentry-dbid-112dda24-24ff-4376-91d5-cabc75842ef4")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=O(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=q(),r=k(j??""),p=k(x??""),f=rt(r,p),G=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>M(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(W(i)))},[m,f,i]);const P=l(n=>n.trendState.fetchState),E=u?.selectedPeriod?.timePeriod??D,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&P==="Completed"&&(g(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,P]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(K,{to:b(G.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(J,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};