@zeniai/web-app-ui 5.1.16-qa → 5.1.17-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/assets/AddressRoutes-ONuQ3ZD_.js +1 -0
  2. package/dist/assets/{AddressScreen-BHOH_WLv.js → AddressScreen-yvk9EJD_.js} +2 -2
  3. package/dist/assets/AiCfoScreen-5Ur-xPG5.js +22 -0
  4. package/dist/assets/{BillPayApprovalRoutes-BK-ZwGIn.js → BillPayApprovalRoutes-CnFFutYF.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-QQCSBZkL.js → BillPayRoutes-DGkvdCBY.js} +18 -18
  6. package/dist/assets/{BusinessVerificationPageScreen-BiLuShF3.js → BusinessVerificationPageScreen-ClHuJd0T.js} +2 -2
  7. package/dist/assets/ChargeCardRoutes-CalH9RqY.js +71 -0
  8. package/dist/assets/{CompanyPassportScreen-Cb1iYJZe.js → CompanyPassportScreen-DNqutLHm.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-avyUSYfj.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-BHrgJ6kV.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-DNVpXl0F.js +23 -0
  12. package/dist/assets/{DashboardRoutes-CDrvRI7s.js → DashboardRoutes-BMckHwEZ.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-BZchPKt2.js → DefaultTenantHome-_Ug_ps6P.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-6696dMHO.js → DomesticWireDetailScreen-CrprHerA.js} +3 -3
  15. package/dist/assets/DrawerScreen-BEUSeYLQ.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-5UgOzlB5.js → EntityDetailRoutes-DKZrs3wB.js} +1 -1
  17. package/dist/assets/ExpenseAutomationRoutes-DTa_pNWl.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-B44hDNmq.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen--wKEcQu5.js +1 -0
  20. package/dist/assets/MagicLinkRoutes-SdZK3Mz9.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-DDFnRNmQ.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-DgVPhlgQ.js → MobileAppDrawer-Dv1dDEZl.js} +1 -1
  23. package/dist/assets/NotFoundScreen-CR8bA5co.js +1 -0
  24. package/dist/assets/{NotificationRoutes-CDYFRT0v.js → NotificationRoutes-DzkYX_vg.js} +1 -1
  25. package/dist/assets/OAuthConsentScreen-knq-X9AY.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-UEoSTLLp.js +1 -0
  27. package/dist/assets/PeopleRoutes-B6cGPNhT.js +22 -0
  28. package/dist/assets/PerformanceRoutes-D6-G4qB1.js +1 -0
  29. package/dist/assets/{Preview-ulACyGAL.js → Preview-B5oHKMPo.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-D0nezBr9.js → QBOConnectionScreen-DKFGeKHi.js} +1 -1
  31. package/dist/assets/ReferralListScreen-BAAuMlvK.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-CiI-Tidw.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BXgtrc7k.js → ReimbursementApprovalRuleDetailScreen-DG5O6VhX.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-qjw4T9lX.js → ReimbursementRoutes-KrIm9xZq.js} +9 -9
  35. package/dist/assets/{ReportsRoutes-CqTf40Qy.js → ReportsRoutes-DcFDfTC4.js} +1 -1
  36. package/dist/assets/RewardsRoutes-B8ZdB3fo.js +1 -0
  37. package/dist/assets/{ScreenRoutes-W867eoTR.js → ScreenRoutes-Dwk26toI.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-DRzTOLku.js → SettingsRoutes-Bi6d-ixQ.js} +8 -8
  39. package/dist/assets/{SetupPagesScreen-CPEy50bJ.js → SetupPagesScreen-DpHUpz4w.js} +5 -5
  40. package/dist/assets/SignInScreen-BbInnfqi.js +1 -0
  41. package/dist/assets/SignOutScreen-Dn-15Gx5.js +9 -0
  42. package/dist/assets/TaskListScreen-D15VKQty.js +9 -0
  43. package/dist/assets/TaskRoutes-uigLJDIH.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-DxRfHR5F.js → TransactionDetailRoutes-DdG2Yk-4.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-C5vka9J3.js → TransactionDetailScreen-oOeAZGGC.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-C4dv3IiR.js → TransactionListRoutes-CznJ-_kx.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-DyL2AmIl.js +37 -0
  48. package/dist/assets/{VendorsRoutes-DqnM7Xdr.js → VendorsRoutes-D4arwcMq.js} +22 -22
  49. package/dist/assets/WiseConfirmationScreen-CACL2cjb.js +12 -0
  50. package/dist/assets/ZeniAccountRoutes-D54O3hSS.js +57 -0
  51. package/dist/assets/ZeniAccountStatementScreen-CWtWfkJV.js +9 -0
  52. package/dist/assets/{accountMappingHelper-W5otorD-.js → accountMappingHelper-Q4AWrIJ8.js} +1 -1
  53. package/dist/assets/{analytics-DXqzaj7k.js → analytics-p-atCQap.js} +1 -1
  54. package/dist/assets/analyticsHelper-B0fBIGUf.js +1 -0
  55. package/dist/assets/{core-C9zW9aiN.js → core-85-jQOHl.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-BPYfhkXa.js → decodeURIComponentSafe-DMY7naVP.js} +1 -1
  57. package/dist/assets/{dnd-CyN5SJrk.js → dnd-aCLmWYWF.js} +1 -1
  58. package/dist/assets/{empty-LAjrKg-c.js → empty-B8YZlU8y.js} +1 -1
  59. package/dist/assets/{empty-CgUWy1ya.js → empty-BUCP1zlD.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-HAOuHOAc.js → emptyVideoElement-BzTeHcqi.js} +1 -1
  61. package/dist/assets/epic-BnLWYuZv.js +2 -0
  62. package/dist/assets/getLocaleForTenant-B58QgT81.js +1 -0
  63. package/dist/assets/{index-BDBxuaUt.js → index--AtO8DLV.js} +1 -1
  64. package/dist/assets/{index-B7J5swVH.js → index-BBYM723i.js} +2 -2
  65. package/dist/assets/{index-BWbah6CI.js → index-BjSilB1q.js} +1 -1
  66. package/dist/assets/{index-1wxiPadS.js → index-Boh_iHRY.js} +11410 -11406
  67. package/dist/assets/{index-DcFcyk9X.js → index-DCnezmp4.js} +1 -1
  68. package/dist/assets/{index-BKXnOOiQ.js → index-Dx_wxYK2.js} +1 -1
  69. package/dist/assets/{index-BaE1yb8B.js → index-RkQAxlvL.js} +1 -1
  70. package/dist/assets/{index-BeiF5atT.js → index-YSSSINh1.js} +1 -1
  71. package/dist/assets/{lexical-C9R0TbF2.js → lexical-BiigqH5F.js} +1 -1
  72. package/dist/assets/{liveblocks-D65YpEzb.js → liveblocks-DPIuO3ZH.js} +1 -1
  73. package/dist/assets/{lottie-CyD5A6ZF.js → lottie-Dyslb7Yt.js} +1 -1
  74. package/dist/assets/{mui-CjAqh33Z.js → mui-bZkpowbW.js} +1 -1
  75. package/dist/assets/{pathToGoBack-CydSZdwJ.js → pathToGoBack-DrUZouuw.js} +1 -1
  76. package/dist/assets/{pdf-BTv9XTca.js → pdf-DmPsD6fu.js} +4 -4
  77. package/dist/assets/{pdf-lib-0B-WwULF.js → pdf-lib-DVsRNJ0B.js} +1 -1
  78. package/dist/assets/{plaid-C7S-w4PD.js → plaid-AGYiNbMg.js} +1 -1
  79. package/dist/assets/{pusher-Cs8HqkwM.js → pusher-BnGrHB5v.js} +1 -1
  80. package/dist/assets/{react-B0ycLXHh.js → react-B2QuP8nN.js} +1 -1
  81. package/dist/assets/{react-CbPt48pi.js → react-Bq1_8StD.js} +1 -1
  82. package/dist/assets/{react-DQfJbxCg.js → react-BrihoTMQ.js} +1 -1
  83. package/dist/assets/{react-UcrcycqM.js → react-CzhAGPyA.js} +1 -1
  84. package/dist/assets/{react-BN4RYnhP.js → react-DBTwfklC.js} +1 -1
  85. package/dist/assets/{react-CRTFund5.js → react-DDzH1t0V.js} +1 -1
  86. package/dist/assets/{recharts-DATP9UFl.js → recharts-DDB6XWY-.js} +1 -1
  87. package/dist/assets/{routePaths-NM47duJ5.js → routePaths-JFefqAnf.js} +1 -1
  88. package/dist/assets/{sentry-Cc7E6KXa.js → sentry-D2jFbVNj.js} +1 -1
  89. package/dist/assets/{url-CYTm1dtu.js → url-B4hbg5S-.js} +1 -1
  90. package/dist/assets/{url-kUZYC_m5.js → url-C3RKXM3D.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Dmb4Bk7D.js → useAiCfoDashboardSuggestedQuestionsChips-6J2Wy56m.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-CLSbJN2Y.js +1 -0
  93. package/dist/assets/{useDeviceId-BlRnIDLL.js → useDeviceId-CS-9EsMC.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-COJ5en-O.js → useInitialThreadRequest-08ACZstL.js} +1 -1
  95. package/dist/assets/{utils-Ufaf0xdt.js → utils-BK-h0w8q.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-DzuPuyV9.js → withTransactionSidePanel-DW2zydUx.js} +3 -3
  97. package/dist/assets/{zeni-epic-state-CSVE6Gls.js → zeni-epic-state-BMMVjv_C.js} +6 -6
  98. package/dist/index.html +1 -1
  99. package/package.json +5 -4
  100. package/dist/assets/AddressRoutes-BmUd4vYL.js +0 -1
  101. package/dist/assets/AiCfoScreen-DAFLwJG_.js +0 -22
  102. package/dist/assets/ChargeCardRoutes-CXqQvycu.js +0 -71
  103. package/dist/assets/ConnectionAuthScreen-CZDo58x5.js +0 -11
  104. package/dist/assets/CustomerOnboardingAuthScreen-CS3Xmka2.js +0 -1
  105. package/dist/assets/CustomerOnboardingRoutes-jCmBO4Mn.js +0 -23
  106. package/dist/assets/DrawerScreen-MbZXqUoq.js +0 -1
  107. package/dist/assets/ExpenseAutomationRoutes-DsR7qPoa.js +0 -25
  108. package/dist/assets/FeaturePreviewScreen-CVSV79yf.js +0 -1
  109. package/dist/assets/HubSpotOAuthCallbackScreen-BZAzKH7-.js +0 -1
  110. package/dist/assets/MagicLinkRoutes-WS_1Q0Lk.js +0 -72
  111. package/dist/assets/MagicLinkSignInScreen-Dl1MbB9d.js +0 -12
  112. package/dist/assets/NotFoundScreen-Bv_nRCjj.js +0 -1
  113. package/dist/assets/OAuthConsentScreen-BkPvVJhS.js +0 -1
  114. package/dist/assets/PandLWithForecastRoutes-Bdh8vsXv.js +0 -1
  115. package/dist/assets/PeopleRoutes-lUM8fGYE.js +0 -22
  116. package/dist/assets/PerformanceRoutes-BGffRGOA.js +0 -1
  117. package/dist/assets/ReferralListScreen-DINWTi1Q.js +0 -5
  118. package/dist/assets/ReimbursementApprovalRoutes-DB7O5cw7.js +0 -1
  119. package/dist/assets/RewardsRoutes-DIkvz1Jt.js +0 -1
  120. package/dist/assets/SignInScreen-D_nrlvPb.js +0 -1
  121. package/dist/assets/SignOutScreen-BRpLavje.js +0 -9
  122. package/dist/assets/TaskListScreen-LsHZDVjF.js +0 -9
  123. package/dist/assets/TaskRoutes-DJ1gNgLs.js +0 -9
  124. package/dist/assets/TreasuryRoutes-bHKI0_zJ.js +0 -37
  125. package/dist/assets/WiseConfirmationScreen-Cke3Uv9t.js +0 -12
  126. package/dist/assets/ZeniAccountRoutes-CLwrbfOg.js +0 -57
  127. package/dist/assets/ZeniAccountStatementScreen-CsDbnZmX.js +0 -9
  128. package/dist/assets/analyticsHelper-CjjD2OUX.js +0 -1
  129. package/dist/assets/epic-Du76qfdK.js +0 -2
  130. package/dist/assets/getLocaleForTenant-C-mTF_-1.js +0 -1
  131. package/dist/assets/useAskAiCfoHostNavButtonProps-BHe-JBXY.js +0 -1
@@ -0,0 +1,25 @@
1
+ import{j as C}from"./liveblocks-DPIuO3ZH.js";import Rn from"./NotFoundScreen-CR8bA5co.js";import{a,b as wt}from"./sentry-D2jFbVNj.js";import{n as Fe,S as Dn}from"./mui-bZkpowbW.js";import{u as de,h as Pt,g as Ge,j as F,n as Un,i as rt,o as Fn,p as ze}from"./core-85-jQOHl.js";import{eP as Re,Q7 as Bn,n4 as ke,fj as _n,qL as Vn,nm as xt,nH as Rt,Q8 as Dt,nR as Mn,Q9 as Ut,nf as jn,qh as On,f3 as Ie,Qa as De,sR as Ft,C2 as Bt,Qb as _t,Qc as zn,pY as qe,LG as dt,LI as Ln,jJ as Qn,LJ as $n,jQ as Gn,cV as qn,tW as Je,ns as Vt,nW as Ue,Qd as Jn,Kz as ut,Ky as we,Qe as mt,k5 as Yn,Qf as Kn,Qg as Nn,Qh as Hn,Qi as Wn,nz as Zn,nk as ue,nZ as Pe,Qj as Xn,Qk as ea,Ql as ta,o4 as na,jU as aa,jL as oa,Qm as sa,jT as ht,LQ as ca,Qn as ia,Qo as la,pU as ra,pw as da,nX as le,pv as Le,Qp as ua,Qq as ma,Qr as ha,lo as pa,bq as ga,lj as pt,l5 as Ca,Qs as Sa,gT as gt,fU as fa,lg as Ia,vP as ka,Qt as Ea,ov as va,oq as ya,ou as ba,of as Aa,Qu as Ta,f6 as Mt,nK as wa,nv as Pa,fk as Ct,n$ as xa,Qv as Ra,nY as jt,Qw as Da,Qx as Ua,Qy as Fa,Qz as Ba,QA as St,q4 as _a,pm as Va,Kx as Ma,jS as ja,QB as Oa,GA as za,jR as La,jG as Qa,f5 as $a,oW as Ot,pe as Ga,nV as ft,n_ as qa,bE as Ja,ld as Ya,la as Ka,QC as Na,oe as It,pc as kt,pa as Ha,o$ as Wa,oG as Za,pd as Xa,QD as eo,QE as to,oK as no,QF as ao,oA as oo,oJ as so,oH as co,ph as io}from"./zeni-epic-state-BMMVjv_C.js";import{v as zt,I as re,c as z,n as H,X as Lt,_ as Qt,cE as lo,z as Be,cF as ro,at as xe,cG as uo,aT as Et,B as $t,cH as mo,aq as Qe,D as ho,cI as po,a2 as go,cJ as Co,W as So,cK as fo,cL as Io,O as ko,k as Eo,aN as vo,b7 as yo,w as bo,cM as Ao}from"./index-Boh_iHRY.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-CLSbJN2Y.js";import{c as vt,C as To}from"./TransactionDetailScreen-oOeAZGGC.js";import{w as wo}from"./withTransactionSidePanel-DW2zydUx.js";import{h as Po,v as xo}from"./routePaths-JFefqAnf.js";import{g as $e}from"./accountMappingHelper-Q4AWrIJ8.js";import{D as Ro}from"./DrawerScreen-BEUSeYLQ.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";import"./decodeURIComponentSafe-DMY7naVP.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]="fa6ebcfe-30ba-42ef-a52e-8df14f63a881",t._sentryDebugIdIdentifier="sentry-dbid-fa6ebcfe-30ba-42ef-a52e-8df14f63a881")}catch{}})();const Do=()=>{const t=de(),i=Pt(),A=Ge(),I=F(d=>Re(d)),{useFeatureGate:E}=zt(),{isFeatureEnabled:g}=E(re.isRealtimeInsightsFeatureEnabled),u=F(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=F(d=>Bn(d,I.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,K=!1)=>{t(ke({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(_n(I.tenantId,d))},[I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[I.tenantId],_=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,I.tenantId,!0)},[m,r,I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:f}=Lt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&f&&m(r,I.tenantId)},[m,r,o.fetchState,I.tenantId,f]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&f&&t(Vn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,f]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&_()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;z.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Uo,{children:C.jsx(lo,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:_,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Uo=Fe.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ background-color: ${t=>t.theme.colors.grey4};
8
+ `,Fo=wt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:A,onFetchLinkTokenClick:I,onEstablishConnectionClick:E})=>{const g=de(),u=Be.getSignedInUser(),o=F(e=>Re(e)),v=t.excludedAccountIDs,S=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:y,statementUploadChosen:r}=t,_=m[i],h=_?.accountReconEntity.statementMetaData?.statementUploadId,T=(e,n)=>{g(On(e,n.split(".")[0]))},f=e=>{h!=null&&g(jn({accountId:i,selectedPeriod:y,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},R=e=>{g(Mn({accountId:i,selectedPeriod:y,payload:e}))},K=e=>{g(Ut({accountId:i,selectedPeriod:y,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),V=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),D=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return _!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(ro,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:_,monthYearPeriod:y,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:I,onEstablishConnectionClick:E,onEditFileName:T,onDeleteFile:f,onSelectSourceType:K,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:S,openFilePicker:r,onStatementUploadSuccess:R,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):D!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(uo,{excludedAccountReconciliation:D,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:V})})}):null}),yt=Fe.div`
9
+ display: flex;
10
+ flex-direction: column;
11
+ height: 100%;
12
+ `,bt=Fe.div`
13
+ flex: 1;
14
+ min-height: 0;
15
+ display: flex;
16
+ flex-direction: column;
17
+ box-sizing: border-box;
18
+ min-width: 0;
19
+ overflow-x: hidden;
20
+ overflow-y: auto;
21
+ `;function Bo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:A,resetCustomerRequest:I}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=F(u=>zn(u,t,E));return a.useEffect(()=>{I()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(mo,{onCloseClick:i,addCustomerRequest:A,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const _o=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Vo,comma:At,space:Mo}},dateFormat:qt}=ho.getLocalizedStrings(),Tt=io,jo=Un(function(t,i){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:I,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=Ie(t),{selectedTransactionCategorizationTab:_}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:I,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${go}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:_,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:A,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:A,isAccountingClassesEnabled:I,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:_,handleEditClick:h,setActivityLogTransactionId:T}=i,{selectedPeriod:f,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:K}=S.jeSchedules,te=Vt(f),V=Ue(te.start),D=Ue(te.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{z.trackMissingReceiptAttached(f.month,f.year),t(Va(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const b=()=>t(St(e,n,{fetchState:"Error"}));Co(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(w=>{w!=null?t(_a(e,w)):b()}).catch(b)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ba(e,n)),m!=null&&t(ke({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Fa(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?Mo+Vo+l+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Ua(e))},onUpdateMissingReceiptsUIState:e=>{t(Da(e))},onFetchMissingReceiptsList:()=>{D!=null&&V!=null&&t(jt({start:V,end:D},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(co(e))},onBulkUploadProgress:e=>{t(so(e))},onBulkUploadSuccess:e=>{t(oo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(ao(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(no(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(to())},onSetBulkUploadResultsTab:e=>{t(eo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Xa(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Za())},onSearchTransactionsForManualMatch:(e,n)=>{t(Tt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Tt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Wa(e,n))},onFetchBulkUploadBatches:e=>{t(Ot(e))},onFetchMoreBatchDetails:()=>{t(Ha())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(Ra())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Le({selectedTab:s,uiState:{searchString:e}})),D!=null&&V!=null&&t(le(s,{start:V,end:D},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(xa(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Pa(e))},onSaveReconciliationReview:e=>{t(wa(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(Mt(e))},handleLogOutClick:()=>{const e=H(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=$e(K.prepaidExpensesAccountList,s.selectedOptions),b=$e(K.fixedAssetsAccountList,l.selectedOptions),w=$e(K.accruedExpensesAccountList,k.selectedOptions),M={selectedPrepaidExpensesAccountIds:p.map(P=>P.accountId),selectedFixedAssetsAccountIds:b.map(P=>P.accountId),selectedAccruedExpensesAccountIds:w.map(P=>P.accountId)};t(Ta({data:M}))},onSaveJeAccountSettingsClick:()=>{t(Aa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:b}=n,{allAccountList:w,allClassList:M,allDepreciationAccountList:P}=S.jeSchedules,Q=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find($=>$.id===b?.selectedOption):void 0,ne={id:Q?.zeniId??b?.selectedOption??"",name:Q?.name??b?.defaultOptions.find($=>$.value===b?.selectedOption)?.label??"",logo:Q?.logo},ae=p?.selectedOption!=null?w.find($=>$.qboId===p.selectedOption):void 0,Ee=k?.selectedOption!=null?M.find($=>$.classId===k.selectedOption):void 0,oe=l?.selectedOption!=null?P.find($=>$.qboId===l.selectedOption):void 0;t(ba({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:ae?.accountId,updatedClassId:Ee?.classId,updatedAccumulatedDepreciationCategoryID:oe?.accountId,updatedVendor:{id:ne.id,name:ne.name}}}))},ignoreRecommendedJeSchedule(e,n){t(ya(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(va({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Ea())},handleJeScheduleClick:(e,n,s)=>{t(ka({selectedJEScheduleKey:n}));const l=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Ia(e,m.companyId,m.tenantId))},onClickCustomerRequest:_,setActivityLogTransactionId:T,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(fa())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Sa(e))},onUpdateFileAttachment:e=>{t(Ca({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=S;m!=null&&l?.auditScorePercentage!=null&&(t(pa(m.companyId,e,m.tenantId)),z.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,ga().format(qt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,b,w,M,P,Q,ne,ae)=>{t(ha(e,n,s,l,y,k,p,b,w,M,P,Q,ne,ae))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),D!=null&&V!=null&&(t(le(e,{start:V,end:D},!1,!1)),t(ma(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{i.closeSidePanel?.(),D!=null&&V!=null&&(t(ua(e)),t(le("autoCategorized",{start:V,end:D},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Le({selectedTab:e,uiState:n})),D!=null&&V!=null&&t(le(e,{start:V,end:D},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Le({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,b)=>{D!=null&&V!=null&&t(le(e,{start:V,end:D},!0,s,n,l,k,p,b))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,b,w)=>{t(da(e,n,s,l,w??null,k,p,!1,b))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:I}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?z.trackTransactionsAutoCategorisedPage(f.month,f.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):z.trackTransactionsReviewPage(f.month,f.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(ra(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(la({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,b)=>{const{transactionId:w,transaction:M,lineIds:P}=n;p!=null&&t(ca({transactionId:w,customerUpdates:p})),t(ia({selectedTab:l,transactionId:w.id,lineId:P[0],selectedTransaction:M,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:I,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Je(k,e,n,s,!0,E,b))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,b)=>{const{transactionId:w,transaction:M,lineIds:P}=n;p!=null&&(t(aa({transactionId:w,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(oa({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:w.id,lineId:P[0],selectedTransaction:M,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:I,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Je(k,e,n,s,!0,E,b))):t(sa({selectedTab:l,transactionId:w.id,lineId:P[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Pe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Pe(f,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{z.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(na(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ta(e))},updateOperatingExpensesIdsForReview:e=>{t(ea({operatingExpenseIds:e,selectedPeriod:f}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=xo(e.id,e.qboId,i.tenantEmailDomain),s=H(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Xn({sectionId:e,selectedPeriod:f}))},onFetchReimbursementView:(e,n,s)=>{t(Pe(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(ue(f,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:f,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ue(f,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Zn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Wn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Hn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Nn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Yn(l)),t(Kn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,qe("bill"));const n=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Jn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,A)=>{const{isMissingReceiptsBulkUploadEnabled:I,...E}=A;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,y,r)=>{u.onUploadTransactionReceipt(v,S,m,y,r,g.authParams)}}}(t,i,E)})(po),Oo=wo(function(t){const i=t.displayName??t.name??"Component",A=wt.memo(t),I=E=>{const g=de(),u=function(){const T=de(),f=F(d=>Ie(d).reconciliation.selectedDrawerAccountId);return{isOpen:f!=null,selectedAccountId:f,openPanel:a.useCallback(d=>{T(De({selectedDrawerAccountId:d}))},[T]),closePanel:a.useCallback(()=>{T(De({selectedDrawerAccountId:void 0}))},[T])}}(),o=F(T=>Ie(T).reconciliation),v=F(T=>Re(T)),S=a.useCallback((T,f)=>{g(Ft("expense_automation_reconcile",T,f))},[g]),m=a.useCallback((T,f)=>{const d=v?.companyId;d!=null&&(g(Bt(T,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",f)),g(_t({accountId:f,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return C.jsx(Fo,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),_=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:_,[u.isOpen,u.closePanel,u.selectedAccountId,_]);return C.jsx(Et.Provider,{value:h,children:C.jsx(A,{...E,...r})})};return I.displayName=`withReconSidePanel(${i})`,I}(({closeSidePanel:t,openTransactionPanel:i,panelContent:A,sidePanelIsFullView:I,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=So(),m=fo(),{isOpen:y}=Io(),r=Pt(),_=Ge(),h=de(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:f}=Gt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&I!==!0&&t?.()},[t,E,I]),{areTenantIdsInSync:R}=Lt(),K=(()=>{const c=F(G=>Ie(G)),O=Ge(),{currentSelectedViewFetchState:Y,currentSelectedView:j,selectedPeriod:B}=c,fe=Qe(j),X=Qe(Y.fetchState),be=a.useCallback(G=>{const N=O.state?.referrer;j==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?z.trackTransactionsReviewPage(B.month,B.year,c.transactionView.totalCountByTab.review,0,G,N??null):z.trackTransactionsAutoCategorisedPage(B.month,B.year,c.transactionView.totalCountByTab.autoCategorized,0,G,N??null)),j==="missing_receipts"&&z.trackMissingReceiptsPage(B.month,B.year,G,c.missingReceipts.transactions.length,N??null),j==="je_schedules"&&z.trackMonthCloseScheduleListPage(B.month,B.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,N??null),j==="flux_analysis"&&z.trackFluxAnalysisPage(B.month,B.year,G,_o(c.fluxAnalysis),N??null),j==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&z.trackInsightsEmailPage(B.month,B.year,G,"draft",c.auditSummary.auditScorePercentage,null,N??null)},[B,c]);return a.useEffect(()=>{X===Y.fetchState&&j===fe||Y.fetchState!=="Completed"||be(!1)},[j,Y.fetchState,fe]),be})(),te=ko(),[V,D]=a.useState(!1),e=F(c=>dt(c)),n=F(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[b,w]=a.useState([]),[M,P]=a.useState(void 0),Q=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),P(c)},[d,v,m,S]),ne=a.useCallback(()=>{m(),P(void 0),d(),f()},[d,f,m]),ae=a.useRef(v);a.useEffect(()=>{v===!0&&ae.current===!1&&(m(),P(void 0),d()),ae.current=v},[d,v,m]);const Ee=a.useRef(y);a.useEffect(()=>{y===!0&&Ee.current===!1&&(v&&S(!1),P(void 0),E===!0&&I!==!0&&t?.()),Ee.current=y},[t,y,v,S,I,E]);const oe=E===!0&&I!==!0,$=a.useRef(oe);a.useEffect(()=>{oe&&!$.current&&(v&&S(!1),m(),P(void 0)),$.current=oe},[v,oe,m,S]);const[Ye,Jt]=a.useState(!1),Ke=a.useRef(!1),{selectedTab:Ne}=rt(),{tenantEmailDomain:Yt}=rt(),[_e,He]=a.useState(_.state?.message==="comingFromTransactionDetail"),We=_.state?.message==="comingFromOverview",Kt=Eo(),Ve=Be.getSignedInUser(),{useDynamicConfig:Nt,useFeatureGate:me}=zt(),{configValue:Ht}=Nt(vo.enableUncategorizedExpenseCategory),W=Ht?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Ze}=me(re.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=me(re.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=me(re.isTransactionActivityEnabled),{isFeatureEnabled:Wt}=me(re.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:Zt}=me(re.isProjectsTransactionsEnabled),Xt=a.useCallback(c=>{const O=qe(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,O)},[i]),en=F(c=>Ma(c,"common")),L=F(c=>Ie(c)),{monthEndCloseChecksView:J,currentSelectedView:x,selectedPeriod:U,selectedTransactionCategorizationTab:se,currentSelectedViewBackgroundRefreshFetchState:tn,currentSelectedViewFetchState:Z,jeSchedules:Me,reconciliation:nn}=L;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||Q(void 0)},[x,Q,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==se&&(ve.current=se,x==="transaction_categorization"&&Q(void 0)):ve.current=se},[x,se,Q]);const an=F(c=>M==null?void 0:ja(c.transactionState,M)),ce=an?.qboId,on=F(c=>ce==null?void 0:Oa(c,ce));a.useEffect(()=>{ce!=null&&h(za(ce))},[h,ce]);const{selectedAccountId:pe}=nn,et=Qe(Me.accountSettingsView.saveState.fetchState),sn=F(c=>La(c.accountState,c.accountListState,"accountList")),cn=F(c=>Qa(c)),ge=Ne!=null?$a(Ne):x,ln=F(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Qt({isDataReady:Z.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(U),Ce=Ue(tt.start),Se=Ue(tt.end);if(Ce==null||Se==null)throw Error(`Invalid start - ${Ce} and end - ${Se} period from given ${U}`);const rn=a.useCallback(()=>{l(!1)},[]),dn=a.useCallback(()=>{p(!0)},[]),un=a.useCallback(c=>{w(c),p(!1)},[]),mn=a.useCallback(()=>{w([])},[]),ye=L.missingReceipts.bulkUpload.phase,nt=L.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{he===!0&&x==="missing_receipts"&&ye==="matching"&&nt!=null&&h(Ot({cacheOverride:!0}))},[he,x,ye,nt,h]);const at=Ve?.userId,hn=U.month,pn=U.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&he!==!1&&ye==="idle"&&at!=null&&ot!=null&&h(Ga())},[x,he,ye,at,ot,hn,pn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?D(!0):D(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{ge!=null&&x!==ge&&h(Mt(ge))},[ge]),a.useEffect(()=>{Ye!==!1||Z.fetchState!=="Completed"&&Z.fetchState!=="Error"||!R||(Jt(!0),h(ft(!1,!1,W)))},[Ye,Z,R,W]),a.useEffect(()=>{!We&&R&&(h(ft(!1,!1,W)),h(ue(U,pe,!1,!1)))},[U.month,U.year,R,W]);const st=a.useCallback((c=!1,O=!1)=>{const Y={start:Ce,end:Se};switch(x){case"transaction_categorization":h(le(se,Y,c,!_e,void 0,void 0,O,void 0,W)),He(!1);break;case"flux_analysis":h(Pe(U,c,O,null));break;case"month_end_insights":if(O===!1){const j=new Date(U.year,U.month,0),B=Ja(j.toDateString()).format(qt.analytics.YYYYDashMMDashDDFormat);h(Ya(!0,n.companyId,n.tenantId,B)),h(Ka(n.companyId,n.tenantId))}break;case"je_schedules":h(qa(Y,O));break;case"missing_receipts":h(jt(Y,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,O));break;default:h(ue(U,pe,c,O))}},[x,Ce,Se,n.companyId,n.tenantId,se,U,pe,_e,He,W]);a.useEffect(()=>{x===ge&&Z.fetchState==="Not-Started"&&R&&st(!0)},[Z,Ce,Se,n.companyId,n.tenantId,R]),a.useEffect(()=>{We||_e||Ke.current||tn.fetchState==="In-Progress"||Z.fetchState!=="Completed"||(Ke.current=!0,st(!0,!0))},[]),a.useEffect(()=>{J.fetchState!=="In-Progress"&&J.fetchState!=="Completed"&&h(ke({tenantId:n.tenantId,period:U,refreshViewInBackground:!1}))},[J.fetchState,n.tenantId]),a.useEffect(()=>{L.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[L.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{L.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(ke({tenantId:n.tenantId,period:U,refreshViewInBackground:!0})),h(Na({companyId:n.companyId})),r("../"))},[L.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,U,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{J.fetchState!=="In-Progress"&&J.fetchState==="Completed"&&h(ke({tenantId:n.tenantId,period:U,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[J.fetchState,n.tenantId,U,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&pe==null&&L.reconciliation.fetchStatus.fetchState==="Completed"&&L.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ue(U,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,L.reconciliation.fetchStatus.fetchState,L.reconciliation.refreshStatus.fetchState,ue,pe,U]);const gn=vt();a.useEffect(()=>{const c=(J.monthEndCloseChecks?.monthEndCloseCheckList.find(O=>O.id==="month_end_insights")?.isDisabled??!1)&&!Ze;x!=="month_end_insights"||!c&&J.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,J.monthEndCloseChecks]);const Cn=u===!0?g:A,Sn=u===!0||E===!0,fn=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Me.accountSettingsView.saveState.fetchState==="Completed"&&h(It())},[et,Me.accountSettingsView.saveState.fetchState,It]);const{transactionId:ct,onSaveVendor:In,onSaveSuccess:kn,onCancel:En,vendorViewDetails:vn}=(({expenseAutomationViewSelector:c,closeDrawerHandler:O,currentSelectedView:Y})=>{const j=de();let B,fe,X;const be=vt(),G=c.transactionView;let N=()=>{};const{transactions:yn,selectedTransactionId:ie,selectedTransactionLineId:Ae,transactionLocalData:bn}=G;if(Y==="transaction_categorization"){const je=bn.find(ee=>ee.transactionId===ie),q=yn.find(ee=>ee.id===ie),it=Ae!=null?je?.transactionReviewLocalData?.lineItemById[Ae]:void 0,lt=it?.account;fe=it?.class?.classId,B=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const Tn=Po(ie,q?.typeOfTransaction);q!=null&&Tn&&(X={id:ie,type:qe(q.typeOfTransaction)}),N=()=>{if(ie!=null&&Ae!=null&&q!=null){const ee=G.transactionLocalData.find(Te=>Te.transactionId===ie)?.transactionReviewLocalData;if(ee!=null&&q.lines!=null&&q.lines.length>0){const Te=ee.lineItemById[Ae];let Oe=ee.selectedEntity;if(qn(q)||(Oe=Te.selectedEntityLine),Oe!=null){const wn=Oe,Pn={transactionId:{id:q.id,type:q.type},transaction:q,lineIds:q.lines.map(xn=>xn.id)??[]};j(Je(wn,Te.amount.amount,Pn,!1,!0,be))}}}}}const An=F(je=>dt(je,void 0,B,fe));return{transactionId:X,onSaveVendor:()=>{j(Gn(X,void 0,!1,!0))},onSaveSuccess:N,onCancel:()=>{X!=null&&j(Ln({transactionId:X})),j(Qn()),j($n()),O()},vendorViewDetails:An}})({expenseAutomationViewSelector:L,closeDrawerHandler:()=>{D(!1)},currentSelectedView:x});return Kt?.loggedInUserRoleMap==null?J.fetchState==="Error"?C.jsx(yo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(Ro,{isOpen:k,drawerLeftMargin:new bo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(zo,{onClick:c=>c.stopPropagation(),children:C.jsx(Bo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:un,resetCustomerRequest:mn})})}),ct!=null&&V&&C.jsx(To,{isOpen:V,transactionId:ct,onSaveVendor:In,onSaveSuccess:kn,onCancel:En,vendorViewDetails:vn}),C.jsx(jo,{navigate:r,location:_,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:ln,entityAutoCompleteView:en},expenseAutomationViewSelector:L,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:b,isRealtimeInsightsFeatureEnabled:Ze,isUncategorizedExpenseCategoryEnabled:W,isAccountingClassesEnabled:cn,isProjectsTransactionsEnabled:Zt,isCOTEnabled:gn,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?M:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&M!=null?C.jsx(Ao,{activityLogView:on,qboId:ce,onClose:()=>Q(void 0),selectedTransactionId:M},String(M)):null,uncategorizedAccounts:sn,onClickCustomerRequest:dn,handleEditClick:rn,tenantEmailDomain:Yt,trackExpenseAutomationTabAnalytics:K,setActivityLogTransactionId:Q,closeSidePanel:fn,openTransactionPanel:i,sidePanelIsOpen:Sn,sidePanelIsFullView:u!==!0&&I,panelContent:Cn,isAiCfoAccessEnabled:T,onAskAiCfoClick:ne,isExpenseAutomationCommentingEnabled:Wt,onExpenseAutomationCommentingThreadClick:Xt,sidePanelListPercent:u===!0?66:void 0})]})})),zo=Fe(Dn)`
22
+ display: flex;
23
+ min-height: 100%;
24
+ flex-direction: column;
25
+ `;function ds(){return C.jsxs(Fn,{children:[C.jsx(ze,{path:"*",element:C.jsx(Do,{})}),C.jsx(ze,{path:"/:selectedTab/:selectedPeriod/*",element:C.jsx(Oo,{})}),C.jsx(ze,{path:"*",element:C.jsx(Rn,{})})]})}export{ds as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-DPIuO3ZH.js";import{a as r}from"./sentry-D2jFbVNj.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-Boh_iHRY.js";import"./mui-bZkpowbW.js";import c from"./NotFoundScreen-CR8bA5co.js";import{h as u,g as b}from"./core-85-jQOHl.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]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -0,0 +1 @@
1
+ import{a as r}from"./sentry-D2jFbVNj.js";import{u as l,h as f,g as m}from"./core-85-jQOHl.js";import{gA as p,JM as g,JN as _}from"./zeni-epic-state-BMMVjv_C.js";import{u as b,L as h,z as y}from"./index-Boh_iHRY.js";import"./liveblocks-DPIuO3ZH.js";import"./recharts-DDB6XWY-.js";import"./mui-bZkpowbW.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c3143327-0e0d-4fc6-83b3-9f591aea766a",e._sentryDebugIdIdentifier="sentry-dbid-c3143327-0e0d-4fc6-83b3-9f591aea766a")}catch{}})();function R(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};
@@ -0,0 +1,72 @@
1
+ import{j as a}from"./liveblocks-DPIuO3ZH.js";import{i as S,n as g,h as C,g as y,u as ee,s as ae,j as E,N as te,o as ne,p}from"./core-85-jQOHl.js";import{JF as k,JG as v,JH as T,zF as z,zr as G,JI as B,JJ as oe,JK as se,zv as ie,eW as I,zC as le,zz as re}from"./zeni-epic-state-BMMVjv_C.js";import{j as x,o as r,m as de,c as j,i as J,K as ce,p as me,F as pe,n as H,v as ue,I as he,N as ge,O as xe,h as fe,q as we,B as be,Z as Se,R as ye,r as ke,s as ve,w as je,H as Ie}from"./index-Boh_iHRY.js";import{n as m}from"./mui-bZkpowbW.js";import f from"./NotFoundScreen-CR8bA5co.js";import{a as $}from"./sentry-D2jFbVNj.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.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]="e1ba482b-aa3f-42dc-8bc5-846172837494",e._sentryDebugIdIdentifier="sentry-dbid-e1ba482b-aa3f-42dc-8bc5-846172837494")}catch{}})();const $e=m.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
+ `,Ce=g(function(e){const t=k(e),n=v(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(z(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(T({data:l}))}}})(de);function F(){const e=x(),{vendorId:t,billId:n}=S();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx($e,{windowSize:e,children:a.jsx(Ce,{vendorId:t,billId:n})})})}const ze=m.div`
11
+ display: flex;
12
+ height: 100vh;
13
+ width: 100%;
14
+ flex: 1 1 auto;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ background-color: ${e=>e.theme.colors.grey4};
18
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
19
+ `,Be=g(function(e,t){const{isSubPage:n}=t;return{addressToEdit:B(e),googleAPIKey:J.googleMapsAPIKey,isSubPage:n}},function(e,t){const{navigate:n,location:o}=t,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Ae();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=Pe(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}})(ce);function De({isSubPage:e}){const t=C(),n=y(),o=x();return a.jsx(a.Fragment,{children:a.jsx(ze,{windowSize:o,children:a.jsx(Be,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:J.googleMapsAPIKey})})})}const Ae=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},Pe=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Ne=m.div`
20
+ display: flex;
21
+ height: 100%;
22
+ width: 100%;
23
+ flex: 1 1 auto;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ background-color: ${e=>e.theme.colors.grey4};
27
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
+ `,Le=g(function(e){const t=k(e),n=v(e),o=B(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(z(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(T({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),t=y(),n=x(),{vendorId:o,billId:s}=S();return o==null||s==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ne,{windowSize:n,children:a.jsx(Le,{location:t,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
29
+ display: flex;
30
+ height: 100%;
31
+ width: 100%;
32
+ flex: 1 1 auto;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Te=g(function(e){const t=k(e),n=v(e),o=B(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(z(i,"international",s,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:d}=i;e(se({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(ge);function Ge(){const e=C(),t=y(),n=x(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?a.jsx(f,{}):a.jsx(Fe,{windowSize:n,children:a.jsx(Te,{location:t,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Je={containerWidth:new je(100,58)},He=m(ke)`
38
+ width: ${r.sp4};
39
+ height: ${r.sp4};
40
+ margin-bottom: ${r.sp3};
41
+ margin-top: ${r.sp3};
42
+ margin-left: ${r.sp8};
43
+ cursor: pointer;
44
+ position: absolute;
45
+ color: ${e=>e.theme.colors.brandColorJade};
46
+ `,Ke=m.div`
47
+ display: flex;
48
+ height: 100vh;
49
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
+ width: 100vw;
51
+ overflow-y: scroll;
52
+ background-color: ${e=>e.theme.colors.grey4};
53
+ `,Me=m.div`
54
+ display: flex;
55
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
+ flex-direction: column;
57
+ width: ${e=>`${Je.containerWidth.value(e.windowSize)}%`};
58
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
+ `,Ve=m.div`
62
+ display: flex;
63
+ flex-direction: column;
64
+ align-items: center;
65
+ justify-content: center;
66
+ padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
67
+ height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
+ overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
+ width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
+ background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
+ margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
+ `,We=g(function(e,t){return{file:t.file,type:t.type}})(ve);function h({appContent:e}){const t=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=ae(),d=i.get("token"),K=n.pathname.includes("address"),w=x(),M=xe(),D=fe(),b=we(),V=()=>{M.toggle()},W=E(u=>k(u)),_=E(u=>v(u)),{authParams:U,fetchState:c,billAttachment:O,billFetchState:A,companyName:R,currencySymbol:Z,amount:q}=W,{tenantId:P,userId:N,sessionId:L}=U,{fetchState:Q,internationalBankAccountCreateStatus:X}=_;return $.useEffect(()=>{I()},[]),$.useEffect(()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&t(le(s,o,d))},[b,c,s,o,d,t]),$.useEffect(()=>{b&&c==="Completed"&&(I(N,L,P),l!=null&&t(re(l)))},[c,b,N,L,P,l,t]),c==="Error"?a.jsx(f,{}):Q==="Completed"||X.fetchState==="Completed"?(I(),a.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?a.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:D.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${D.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[c==="Completed"&&A==="Completed"&&a.jsx(Se,{analytics:j,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",s??"",R,l??"",_e(n.pathname),Z,q))(u)}),a.jsxs(Ke,{windowSize:w,children:[w!=="small"?a.jsx(He,{onClick:V}):null,a.jsx(Ve,{windowSize:w,isAddressPage:K,children:A==="In-Progress"?a.jsx(ye,{size:"ExtraLarge",start:!0}):a.jsx(We,{file:O,type:"bill"})}),a.jsx(Me,{windowSize:w,children:e})]})]})}const _e=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return a.jsx(Ie,{})}function da(){return a.jsxs(ne,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(Ue,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(De,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ee,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Ge,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{da as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-DPIuO3ZH.js";import{a as f}from"./sentry-D2jFbVNj.js";import{u as U,g as w,h as _,s as A,j as l,N as T}from"./core-85-jQOHl.js";import{z as r,h as J,D as P,d as M,c as V,e as N,A as R,R as W,g as q}from"./index-Boh_iHRY.js";import{eP as B,Jq as $,JA as G,Jr as H,eW as K,fn as Q,Jw as X,fL as Y,cT as Z,JB as ee,JC as te}from"./zeni-epic-state-BMMVjv_C.js";import{n as ne}from"./mui-bZkpowbW.js";import{u as se}from"./useDeviceId-CS-9EsMC.js";import{f as ae}from"./analyticsHelper-B0fBIGUf.js";import{t as ie}from"./getLocaleForTenant-B58QgT81.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="f0a2595d-98ed-4d77-aa35-920f755217f1",t._sentryDebugIdIdentifier="sentry-dbid-f0a2595d-98ed-4d77-aa35-920f755217f1")}catch{}})();const C=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Ce(){const t=U(),a=w(),m=_(),[y]=A(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:D,magicLinkEmail:c,verifyDeviceFetchState:x,resendVerifyDeviceOTPFetchState:z}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),h=l(e=>e.tenantState.signInState),I=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),k=l(e=>$(e)),E=r.getSignedInUser(),v=J().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&C(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{h!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=q();e!=null&&M(e)}),setTimeout(()=>{V.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[h,S,b,s,o,k,v,a.state,t]);const j=f.useCallback(()=>{m("/signin/auth")},[m]),F=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:D,verifyOtpFetchState:x.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!C(n,p)||g==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{Ce as default};
@@ -1 +1 @@
1
- import{j as U}from"./liveblocks-D65YpEzb.js";import{a as c}from"./sentry-Cc7E6KXa.js";import{u as pe,j as s,i as We,g as qe,h as Ke,l as M}from"./core-C9zW9aiN.js";import{eP as he,e$ as Qe,f0 as Se,eT as Xe,bn as ea,eO as aa,f1 as ta,f2 as na,f4 as sa,f7 as oa,fg as ia,f8 as g,fa as ra,fb as ue,fe as da,fc as la,fd as ca,ff as ua,cJ as fa,fi as ma,cO as ba,bt as pa,eS as ha,fn as Sa,fo as ga,fm as Ea}from"./zeni-epic-state-CSVE6Gls.js";import{a7 as ka,a8 as Ca,r as ya,v as Ia,z as k,s as Ta,u as wa,I as r,a9 as Aa,aa as _a,k as Fa,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ga,ae as fe,af as me,L as Pa,ag as Ma,ah as be,c as R,$ as Ra,m as A,ai as N,aj as Na}from"./index-1wxiPadS.js";import{D as Ua}from"./mui-CjAqh33Z.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="f90282cd-1101-4544-8742-0b61de5d3f1b",f._sentryDebugIdIdentifier="sentry-dbid-f90282cd-1101-4544-8742-0b61de5d3f1b")}catch{}})();const Va=ka(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=qe(),C=ya(),o=Ke(),V=Xe(),m=pe(),{useFeatureGate:i}=Ia(),O=k.getSignedInUser(),_=ea(O),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,x=s(e=>aa(e)),j=x.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[F,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ke}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ce=Aa(n,ke,H),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),Z=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:J}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabledV2),q=W||J&&_,{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=_||!_&&$e,Ge=n.company!=null&&ia(n.company),w=ve&&Ge,Pe=s(e=>g(e).totalUnreadCount),Me=s(e=>g(e).reducedFetchCountState),K=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),Q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=_a();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&V.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Ue={fetchStatus:Me,count:Pe},ne=t!=null?k.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ve=Fa(),oe=s(e=>la(e,S,h,W,J,w).fetchState),ie=s(e=>ca(e).fetchState),Oe=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",xe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(xe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,H,n),re=Da(),Ye=re&&va(a),de=ba(Ve?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[He,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Ze=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Je=Ba(Ze);return U.jsx(Ua,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:U.jsx(Ga,{signedInUser:O,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Oe,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:Ce,isTreasuryEnabled:w,treasuryYieldPercentage:Je,isTreasuryPopupVisible:He,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:q&&pa(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=K===0&&Q>0?"notifications/comments":"notifications/tasks";me(a)&&(e=K===0&&Q>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Na(e.type);be(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Ee(Pa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ma(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:x,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:_e,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),Ha=f=>{const d=pe(),t=s(C=>he(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ca(o)&&Qe(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Va,{...f,...a})};export{Ha as M};
1
+ import{j as O}from"./liveblocks-DPIuO3ZH.js";import{a as c}from"./sentry-D2jFbVNj.js";import{u as pe,j as s,i as Je,g as We,h as Ke,l as M}from"./core-85-jQOHl.js";import{eP as he,e$ as Qe,f0 as Se,eT as Xe,bn as ea,eO as aa,f1 as ta,f2 as na,f4 as sa,f7 as oa,fg as ia,f8 as g,fa as ra,fb as ue,fe as da,fc as la,fd as ca,ff as ua,cJ as fa,fi as ma,cO as ba,bt as pa,eS as ha,fn as Sa,fo as ga,fm as Ea}from"./zeni-epic-state-BMMVjv_C.js";import{a7 as ka,a8 as Ca,O as ya,v as Ia,z as k,q as Ta,u as wa,I as r,a9 as Aa,aa as _a,k as Fa,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ga,ae as fe,af as me,L as Pa,ag as Ma,ah as be,c as R,$ as Ra,n as A,ai as N,aj as Na}from"./index-Boh_iHRY.js";import{D as Oa}from"./mui-bZkpowbW.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="117a63e5-a568-47c0-a6ce-891af7d5017b",f._sentryDebugIdIdentifier="sentry-dbid-117a63e5-a568-47c0-a6ce-891af7d5017b")}catch{}})();const Ua=ka(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Je(),a=We(),C=ya(),o=Ke(),U=Xe(),m=pe(),{useFeatureGate:i}=Ia(),V=k.getSignedInUser(),_=ea(V),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,x=s(e=>aa(e)),j=x.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[F,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ke}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ce=Aa(n,ke,H),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),Z=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:q}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:J}=i(r.isExpenseAutomationEnabledV2),W=J||q&&_,{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=_||!_&&$e,Ge=n.company!=null&&ia(n.company),w=ve&&Ge,Pe=s(e=>g(e).totalUnreadCount),Me=s(e=>g(e).reducedFetchCountState),K=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),Q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=_a();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Oe={fetchStatus:Me,count:Pe},ne=t!=null?k.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),W===!1&&S.push("expense_automation_card");const Ue=Fa(),oe=s(e=>la(e,S,h,J,q,w).fetchState),ie=s(e=>ca(e).fetchState),Ve=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",xe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(xe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,H,n),re=Da(),Ye=re&&va(a),de=ba(Ue?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[He,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Ze=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,qe=Ba(Ze);return O.jsx(Oa,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:O.jsx(Ga,{signedInUser:V,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Ve,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:Ce,isTreasuryEnabled:w,treasuryYieldPercentage:qe,isTreasuryPopupVisible:He,isNotificationsTabVisible:ze,notificationCountDetails:Oe,isExpenseAutomationEnabledForUser:W&&pa(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=K===0&&Q>0?"notifications/comments":"notifications/tasks";me(a)&&(e=K===0&&Q>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Na(e.type);be(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Ee(Pa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ma(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:x,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:_e,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),Ha=f=>{const d=pe(),t=s(C=>he(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ca(o)&&Qe(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return O.jsx(Ua,{...f,...a})};export{Ha as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-DPIuO3ZH.js";import{h as r,n}from"./core-85-jQOHl.js";import{M as i}from"./index-Boh_iHRY.js";import"./mui-bZkpowbW.js";import"./sentry-D2jFbVNj.js";import"./zeni-epic-state-BMMVjv_C.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="59e35ec1-38d4-48f4-8af2-c43da8d96945",o._sentryDebugIdIdentifier="sentry-dbid-59e35ec1-38d4-48f4-8af2-c43da8d96945")}catch{}})();const a=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
@@ -1 +1 @@
1
- import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-D65YpEzb.js";import lt from"./NotFoundScreen-Bv_nRCjj.js";import{a as k}from"./sentry-Cc7E6KXa.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as J}from"./core-C9zW9aiN.js";import{cr as St,f1 as Y,eP as H,ff as bt,f8 as b,PU as O,fb as d,f0 as y,r1 as M,wo as It,PV as Ct,e$ as Tt,fi as yt,r6 as At,PW as $,bq as F,gT as x,ra as K,PX as Et,cC as _t,cw as Nt}from"./zeni-epic-state-CSVE6Gls.js";import{V as wt,z as Bt,v as xt,I as Pt,Y as Rt,cz as vt,m as N,a7 as Dt,cA as Ut,a8 as Gt,j as $t}from"./index-1wxiPadS.js";import"./mui-CjAqh33Z.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-BHe-JBXY.js";import"./recharts-DATP9UFl.js";import"./analytics-DXqzaj7k.js";import"./plaid-C7S-w4PD.js";import"./dnd-CyN5SJrk.js";import"./stripe-DMRn4zHo.js";import"./lottie-CyD5A6ZF.js";import"./lexical-C9R0TbF2.js";import"./pdf-BTv9XTca.js";import"./utils-Ufaf0xdt.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="0bf4305f-2317-4eed-8f26-a79fcfd624fd",t._sentryDebugIdIdentifier="sentry-dbid-0bf4305f-2317-4eed-8f26-a79fcfd624fd")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=Y(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:w,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(w(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(O(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(K("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(w(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,w).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Dt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=wt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[w,P]=k.useState(!1),a=S(e=>Y(e)),o=S(e=>H(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const Q=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=vt().allUsers,{inboxNotifications:B,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:W,isLoading:z,fetchMore:L,isFetchingMore:q,hasFetchedAll:X}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(O(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{U&&v!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||v!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,v]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&w===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&z===!1&&B!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),it=p.map(f=>{const G=W.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(q||X===!0||L==null||L(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[A,D,q,C,X,z,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];R==="all"?E.push("read","unread"):R!=="mentions"&&E.push(R),s(M("task_manager",T,E,!0))}}}},nt=dt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Q,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return _.jsxs(gt,{children:[_.jsx(J,{path:"/:selectedTab",element:_.jsx(Vt,{})}),_.jsx(J,{path:"*",element:_.jsx(lt,{})})]})}export{ne as default};
1
+ import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-DPIuO3ZH.js";import lt from"./NotFoundScreen-CR8bA5co.js";import{a as k}from"./sentry-D2jFbVNj.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as H}from"./core-85-jQOHl.js";import{cr as St,f1 as K,eP as X,ff as bt,f8 as b,Q2 as O,fb as d,f0 as y,r3 as M,wq as It,Q3 as Ct,e$ as Tt,fi as yt,r8 as _t,Q4 as $,bq as F,gT as x,rc as J,Q5 as At,cC as Et,cw as Nt}from"./zeni-epic-state-BMMVjv_C.js";import{X as Bt,z as wt,v as xt,I as Rt,_ as vt,cB as Dt,n as N,a7 as Pt,cC as Ut,a8 as Gt,p as $t}from"./index-Boh_iHRY.js";import"./mui-bZkpowbW.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-CLSbJN2Y.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="e7383ec9-31a5-4590-9f2f-580b0fc295cf",t._sentryDebugIdIdentifier="sentry-dbid-e7383ec9-31a5-4590-9f2f-580b0fc295cf")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=K(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=X(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(O(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Pt(Ut)),Qt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,R]=k.useState(!1),a=S(e=>K(e)),o=S(e=>X(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});vt({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),Q=S(e=>b(e).currentTab),v=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),D=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Dt().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:C,isFetchingMore:P,fetchMore:ot}=ct(),{threads:V,isLoading:q,fetchMore:L,isFetchingMore:W,hasFetchedAll:z}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(Q!==i&&i!=null&&s(O(i)),i==null){const e=`../${Q}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=_||P===!0||C!==!0||_||P===!0||C!==!0;k.useEffect(()=>{U&&D!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||D!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,D]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&q===!1&&w!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const G=V.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(W||z===!0||L==null||L(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,P,W,C,z,q,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];v==="all"?A.push("read","unread"):v!=="mentions"&&A.push(v),s(M("task_manager",T,A,!0))}}}},nt=dt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(H,{path:"/:selectedTab",element:E.jsx(Qt,{})}),E.jsx(H,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-DPIuO3ZH.js";import{a as r}from"./sentry-D2jFbVNj.js";import{u as P,g as A,j as o,N as j}from"./core-85-jQOHl.js";import{JP as C,eP as J,f7 as R,JQ as x,JR as z,JS as D,JT as L,mW as M,IL as N}from"./zeni-epic-state-BMMVjv_C.js";import{z as h,E as I}from"./index-Boh_iHRY.js";import"./mui-bZkpowbW.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="15826b58-15df-4c68-ac69-4ee093ee98e7",n._sentryDebugIdIdentifier="sentry-dbid-15826b58-15df-4c68-ac69-4ee093ee98e7")}catch{}})();function ee(){const n=P(),s=A(),{params:t,error:i}=r.useMemo(()=>C(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),m=o(e=>J(e)),l=o(e=>R(e)),d=o(e=>e.tenantState.fetchState),y=o(x),S=o(z),c=o(D),[v,b]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(L())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(M(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[m?.tenantId,l]),u=v??U;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:b,approveError:E??S,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(N(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):f.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-DPIuO3ZH.js";import{h as Y,u as Z,g as z,i as X,j as d,n as H,o as J,p as I}from"./core-85-jQOHl.js";import{eP as U,qT as R,qr as Q,Kl as v,qm as T,bt as ee,bn as ae,bT as te,qn as se,Km as oe,K7 as C,dE as ne,un as re,Kn as ce,uK as ie,e_ as le,eY as de}from"./zeni-epic-state-BMMVjv_C.js";import{z as me,X as fe,_ as pe,k as ue,v as q,I as M,Z as he,c as $,ao as ge,n as Fe}from"./index-Boh_iHRY.js";import"./mui-bZkpowbW.js";import be from"./NotFoundScreen-CR8bA5co.js";import{F as Ie}from"./FeaturePreviewScreen-B44hDNmq.js";import{a as g}from"./sentry-D2jFbVNj.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-CLSbJN2Y.js";import{u as Te}from"./useInitialThreadRequest-08ACZstL.js";import{t as Se}from"./routePaths-JFefqAnf.js";import{M as ye}from"./MobileAppDrawer-Dv1dDEZl.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="c9cd8c3d-496c-4a9b-a893-e72b300c428f",s._sentryDebugIdIdentifier="sentry-dbid-c9cd8c3d-496c-4a9b-a893-e72b300c428f")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const n=o??"";s!=null&&s.length>0?a(`../${e}${n}`,{replace:!0}):a(`${e}${n}`,{replace:!0})}},ke=H(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(n=>{a[n]=o[n]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(re(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let n,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(n=o.balanceTimeFrame,c=ne(o)):o.balanceTimeFrame==="year"?(n="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&n!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,n,c),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(ge);function O(){const s=Y(),e=Z(),a=z(),{forecastId:o,tenantEmailDomain:n}=X(),[c,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>U(t)),w=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:K}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!c&&F)p(!0),l||e(Q());else if(l&&!m){u(!0);const t=((f,L,P)=>L!=null?f.forecasts.findIndex(b=>b.id===L):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(i.forecasts[t].id,t)),S(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&F&&e(T(i.forecasts[t].id))}},[c,p,e,l,i,m,u,R,T,F]);const D=ue(),B=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:N}=q(),{isFeatureEnabled:E}=N(M.isReportsCommentingEnabled),W=Te(E?y?.companyId:void 0,{clearParams:l&&m}),[G,V]=g.useState(!1),j=t=>{V(t)};return r.jsxs(r.Fragment,{children:[l?r.jsx(he,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,r.jsx(ye,{isAppContentDrawerOpen:G,handleDrawerToggle:j}),r.jsx(ke,{firstMonthOfFY:w,tenantEmailDomain:n,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:B,isAiCfoAccessEnabled:_,onAskAiCfoClick:K,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:W,onClickMenuIcon:()=>{j(!0)}})]})}function Ve(){const s=d(c=>U(c)),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e(M.isDebitCardFeatureEnabled),o=le(a,s),n=de(s);return o===!0||n===!0?r.jsx(Ie,{}):r.jsxs(J,{children:[r.jsx(I,{path:"/",element:r.jsx(O,{})}),r.jsx(I,{path:"/:forecastId",element:r.jsx(O,{})}),r.jsx(I,{path:"/:forecastId/*",element:r.jsx(be,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
@@ -0,0 +1,22 @@
1
+ import{j as s}from"./liveblocks-DPIuO3ZH.js";import{Kg as te,eP as Y,jG as z,e_ as J,eY as ne,HI as X,JW as oe,tt as Ee,Kh as N,th as ke,tC as Ie,tw as ie,tl as re,tA as Pe,tx as je,Ki as le,v9 as Te,Kj as ve,fB as Le,Kk as K,tq as de,to as ce,tF as Fe,c2 as Ae}from"./zeni-epic-state-BMMVjv_C.js";import{j as pe,v as Q,I as E,z as H,a9 as ue,y as me,ak as ge,al as Re,w as he,o as R,C as fe,D as Ce,am as Oe,X as Ve,_ as Ue,Z as Be,c as be,e as Ze,n as $e,an as Ke,k as _e}from"./index-Boh_iHRY.js";import{D as ye,n as W,S as we}from"./mui-bZkpowbW.js";import ae from"./NotFoundScreen-CR8bA5co.js";import{a as r}from"./sentry-D2jFbVNj.js";import{u as ee,i as Ge,j as m,h as ze,g as He,n as We,o as se,p as $}from"./core-85-jQOHl.js";import{u as qe}from"./useAskAiCfoHostNavButtonProps-CLSbJN2Y.js";import{M as Me}from"./MobileAppDrawer-Dv1dDEZl.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.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]="61b6d9ce-9e84-430a-922d-a8dbed7af74b",a._sentryDebugIdIdentifier="sentry-dbid-61b6d9ce-9e84-430a-922d-a8dbed7af74b")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=Ge(),d=m(e=>te(e)),u=m(e=>Y(e)),D=m(e=>z(e)),{useFeatureGate:f}=Q(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=J(k,u),v=ne(u),L=X(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:L,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(L))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Je,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},Je=W(we)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,Se=W(fe.H6Regular)`
6
+ margin-top: ${R.sp7};
7
+ padding-left: ${R.sp8};
8
+ padding-right: ${R.sp8};
9
+ color: ${a=>a.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,De=W(fe.LargeRegularSp)`
12
+ color: ${a=>a.theme.colors.hero};
13
+ padding-left: ${R.sp8};
14
+ padding-right: ${R.sp8};
15
+ margin-bottom: 30px;
16
+ margin-top: ${R.sp4};
17
+ white-space: pre-line;
18
+ `,Xe={overlayWidth:new he(100,100,48)},G=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),S=m(i=>te(i)),d=m(i=>Y(i)),u=m(i=>z(i)),{useFeatureGate:D}=Q(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=J(f,d),P=ne(d),v=X(d),L=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(N())},C=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},Z=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),T=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(a):je())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:L===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:B};return r.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),p(N()))},[S.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:s.jsxs(ea,{onClick:i=>i.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:G.discardTitle}),descriptionComponent:s.jsx(De,{children:G.discardDescription}),primaryButtonText:G.discard,secondaryButtonText:G.no,action:F}):null,s.jsx(Oe,{...b})]})})},ea=W(we)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,aa=We(function(a,t){const l=le(a),n=H.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:z(a),analytics:be}},function(a,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{a(re(o,y))},onResendInvite:o=>{a(Fe(o))},onReloadPeople:()=>{a(de()),a(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{a(K({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a(K({searchText:o}))}}}})(Ke);function M({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=ze(),n=ee(),g=He(),{areTenantIdsInSync:o}=Ve(),y=H.getSignedInUser(),h=m(e=>Y(e)),{useFeatureGate:p}=Q(),{isFeatureEnabled:O}=p(E.isDebitCardFeatureEnabled),V=m(e=>z(e)),I=!J(O,h)&&V,w=X(h),S=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,v]=r.useState(!1),[L,U]=r.useState("off"),[B,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:Z}=qe({mobileExploreReferrer:"People"}),c=m(e=>le(e));Ue({isDataReady:c.fetchState==="Completed"});const j=m(e=>Te(e.classState,e.classListState)),T=m(e=>ve(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>Le(e)),b=h?.companyId;r.useEffect(()=>{u&&L===c.uiState.mode||!o||(n(K({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,S,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(a!=null&&a===!0),v(t!=null&&t===!0&&t)},[a,t]),r.useEffect(()=>{n(K({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),v(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Be,{analytics:be,onLoad:e=>e.trackPageLoaded(Ze.Event.members)}):null,f===!0?s.jsx(Qe,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?s.jsx(Ye,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,s.jsx(Me,{isAppContentDrawerOpen:B,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:T,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,q)=>{n(K({sortKey:e,sortOrder:q}))},onRowClick:e=>{const q=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=$e(g.state?.pathnameStackToGoBack,g.pathname);l(q,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:Z})]})}function wa(){const a=_e();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx($,{path:"/",element:s.jsx(M,{})}),s.jsx($,{path:"new",element:s.jsx(M,{isInvitePeopleDrawerOpen:!0})}),s.jsx($,{path:":userId/edit",element:s.jsx(M,{isEditPeopleDrawerOpen:!0})}),s.jsx($,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx($,{path:"*",element:s.jsx(ae,{})})})}export{wa as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-DPIuO3ZH.js";import E from"./NotFoundScreen-CR8bA5co.js";import{a as r}from"./sentry-D2jFbVNj.js";import{h as _,g as v,j as p,i as M,u as P,N as U,n as O,o as z,p as h}from"./core-85-jQOHl.js";import{eP as B,Q6 as b,bo as F,bn as N,hn as V,gT as Q}from"./zeni-epic-state-BMMVjv_C.js";import{O as $,z as I,_ as q,cD as G}from"./index-Boh_iHRY.js";import"./mui-bZkpowbW.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-CLSbJN2Y.js";import{M as J}from"./MobileAppDrawer-Dv1dDEZl.js";import"./recharts-DDB6XWY-.js";import"./analytics-p-atCQap.js";import"./plaid-AGYiNbMg.js";import"./dnd-aCLmWYWF.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dyslb7Yt.js";import"./lexical-BiigqH5F.js";import"./pdf-DmPsD6fu.js";import"./utils-BK-h0w8q.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]="9c25fb59-7d16-460a-8e5d-1fbf0fa3bf59",e._sentryDebugIdIdentifier="sentry-dbid-9c25fb59-7d16-460a-8e5d-1fbf0fa3bf59")}catch{}})();const K=O(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(G),L=()=>{const e=_(),t=v(),c=$(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),D=o?.userRole?.includes("bookkeeping_admin")??!1,k=N(l),x=C||D||k,d=r.useCallback((a,i,A)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:A}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(Q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const y=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:T}=H({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:y,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:T})]}):s.jsx(U,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-Cc7E6KXa.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-D2jFbVNj.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-D65YpEzb.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-Cc7E6KXa.js";import{L as dt,bT as Tc,eP as Ac,Jo as Rc,JS as kl,c2 as Tl,fn as Al,fo as Rl}from"./zeni-epic-state-CSVE6Gls.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-Ufaf0xdt.js";import{r as un}from"./empty-CgUWy1ya.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-0B-WwULF.js";import{r as Gl}from"./index-BWbah6CI.js";import{r as zl}from"./index-BeiF5atT.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-C9zW9aiN.js";import{u as Kl,z as Pc,L as Wl,W as Jl,H as Xl,i as Ql,c as tf}from"./index-1wxiPadS.js";import"./mui-CjAqh33Z.js";import{d as Pe}from"./decodeURIComponentSafe-BPYfhkXa.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="34f87684-01bd-4019-a357-6503f9761cf5",t._sentryDebugIdIdentifier="sentry-dbid-34f87684-01bd-4019-a357-6503f9761cf5")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-DPIuO3ZH.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-D2jFbVNj.js";import{L as dt,bT as Tc,eP as Ac,Jq as Rc,JU as kl,c2 as Tl,fn as Al,fo as Rl}from"./zeni-epic-state-BMMVjv_C.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-BK-h0w8q.js";import{r as un}from"./empty-BUCP1zlD.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-DVsRNJ0B.js";import{r as Gl}from"./index-BjSilB1q.js";import{r as zl}from"./index-YSSSINh1.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-85-jQOHl.js";import{u as Kl,z as Pc,L as Wl,V as Jl,G as Xl,i as Ql,c as tf}from"./index-Boh_iHRY.js";import"./mui-bZkpowbW.js";import{d as Pe}from"./decodeURIComponentSafe-DMY7naVP.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="346340f4-8ccc-4ef1-9cea-f7360e94c1b8",t._sentryDebugIdIdentifier="sentry-dbid-346340f4-8ccc-4ef1-9cea-f7360e94c1b8")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -0,0 +1,5 @@
1
+ import{j as s}from"./liveblocks-DPIuO3ZH.js";import{a as o}from"./sentry-D2jFbVNj.js";import{j as f,h as B,u as _,g as F,n as H}from"./core-85-jQOHl.js";import{h as N,j as V,z as R,b9 as W,w as U,X as $,_ as z,Z as X,c as l,e as Z,a7 as q,ba as G}from"./index-Boh_iHRY.js";import{f2 as J,eP as K,ML as P,MM as Q,ud as Y,u3 as g,f4 as ee,bO as ae,u8 as re,MN as ne}from"./zeni-epic-state-BMMVjv_C.js";import{D as te,e as se,n as oe,S as ie}from"./mui-bZkpowbW.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-CLSbJN2Y.js";import{M as de}from"./MobileAppDrawer-Dv1dDEZl.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]="29d4e5f3-7d02-4041-adb7-eb12220e112b",e._sentryDebugIdIdentifier="sentry-dbid-29d4e5f3-7d02-4041-adb7-eb12220e112b")}catch{}})();const ce={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=N(),n=V();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>J(d));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(W,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,I="refer-and-earn-status-update",we=H(function(e){const a=P(e),r=e.referralViewState.rewardsPlanFetchState,n=ae([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(q(G));function ve({isReferralDrawerOpen:e}){const a=B(),r=_(),n=F(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,E]=o.useState(!1),[k,h]=o.useState(!1),w=R.getSignedInUser(),C=f(t=>K(t)),b=f(t=>P(t)),m=b.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),y=Q([b,p]),{areTenantIdsInSync:c}=$();o.useEffect(()=>{C?.rewardsLastViewedTime==null&&D===!1&&(r(Y()),E(!0))},[]),o.useEffect(()=>{!i&&m==="Not-Started"&&c&&(u(!0),r(g(!0)))},[m,r,c]),o.useEffect(()=>{!d&&p.fetchState==="Not-Started"&&c&&(x(!0),r(ee(!0)))},[p,r,c]),o.useEffect(()=>{h(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),v=t=>{A(t)},{isAiCfoAccessEnabled:M,onAskAiCfoClick:O}=le({mobileExploreReferrer:"Rewards"});z({isDataReady:y===!0});const L={events:w?.userId!=null?[`private-encrypted-${w.userId}.${I}`]:[],eventCallback:(t,S,T)=>{T.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx(X,{analytics:l,onLoad:t=>(S=>{w!=null&&S.trackPageLoaded(Z.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:v}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{h(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:a,currentTenant:C,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:M,onAskAiCfoClick:O,...L})]})}export{ve as R};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-DPIuO3ZH.js";import x from"./NotFoundScreen-CR8bA5co.js";import{a as p}from"./sentry-D2jFbVNj.js";import{h as I,g as C,u as D,j as u,N as A,n as E,o as k,p as c}from"./core-85-jQOHl.js";import{eP as V,NF as g,NV as S,Da as T,Cj as N,D9 as d,D0 as U,O9 as _}from"./zeni-epic-state-BMMVjv_C.js";import{h as O,z as $,B,a7 as P,bQ as W,af as z}from"./index-Boh_iHRY.js";import"./mui-bZkpowbW.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-DG5O6VhX.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]="9f1a89f5-5c35-4d8c-a495-35112bbebedb",e._sentryDebugIdIdentifier="sentry-dbid-9f1a89f5-5c35-4d8c-a495-35112bbebedb")}catch{}})();const m="reimbursement-approval-rule-update",F=E(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(m)&&e(_(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(U(s))},onEditRuleClick:s=>{s!=null?(e(d(s)),a(`./${s}/edit`)):(e(d()),a("./new"))}}})(P(W)),Q=()=>{const e=I(),r=C(),a=D(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),b=u(n=>n.remiSetupApproverViewState.fetchState),o=u(n=>V(n)),w=O(),i=u(n=>g(n)),h=u(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(T())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(s(!0),a(N(!0)))},[l,b,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(d())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${m}`]:[],eventCallback:(n,q,R)=>{n.endsWith(m)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(A,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(B,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(F,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(k,{children:[t.jsx(c,{path:"/",element:t.jsx(Q,{})}),t.jsx(c,{path:"/new",element:t.jsx(v,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(c,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-D65YpEzb.js";import{a as y}from"./sentry-Cc7E6KXa.js";import{h as w,u as A,g as T,i as U,j as b,n as E}from"./core-C9zW9aiN.js";import{NT as D,ND as C,D1 as x,Da as _,D8 as S,D9 as h,NU as B}from"./zeni-epic-state-CSVE6Gls.js";import{z as k,h as N,B as V,bH as j,af as F}from"./index-1wxiPadS.js";import"./mui-CjAqh33Z.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]="f23b5203-9f39-49ca-ae0e-2802596f3b85",e._sentryDebugIdIdentifier="sentry-dbid-f23b5203-9f39-49ca-ae0e-2802596f3b85")}catch{}})();function O(e){return B(e)==null}const $=E(function(e,a){const t=D(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=F(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const f=[];return p.forEach(c=>{const R=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!O(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),v=R.concat(I);f.push({action:c.stepType.selectedOption,actors:v,operator:v.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),f};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(j);function J(){const e=w(),a=A(),t=T(),{approvalRuleId:s}=U(),n=k.getSignedInUser(),l=N(),r=b(p=>D(p)),i=b(p=>C(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{J as R,O as i};
1
+ import{j as g}from"./liveblocks-DPIuO3ZH.js";import{a as y}from"./sentry-D2jFbVNj.js";import{h as w,u as A,g as T,i as U,j as b,n as E}from"./core-85-jQOHl.js";import{NV as D,NF as C,D3 as x,Dc as _,Da as S,Db as h,NW as B}from"./zeni-epic-state-BMMVjv_C.js";import{z as V,h as k,B as N,bH as F,af as j}from"./index-Boh_iHRY.js";import"./mui-bZkpowbW.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]="6d9244cd-26ad-4295-b252-0bf60716166c",e._sentryDebugIdIdentifier="sentry-dbid-6d9244cd-26ad-4295-b252-0bf60716166c")}catch{}})();function O(e){return B(e)==null}const $=E(function(e,a){const t=D(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=j(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const R=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!O(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),f=R.concat(I);v.push({action:c.stepType.selectedOption,actors:f,operator:f.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function G(){const e=w(),a=A(),t=T(),{approvalRuleId:s}=U(),n=V.getSignedInUser(),l=k(),r=b(p=>D(p)),i=b(p=>C(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(N,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,O as i};