@zeniai/web-app-ui 5.3.70-qa → 5.3.71-next

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 (150) hide show
  1. package/dist/assets/AccountMappingScreen-CfmMe_fw.js +9 -0
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-YIiKaKQ5.js → ActualMatchingMatchDetailScreen-D3C6jjK4.js} +1 -1
  3. package/dist/assets/AddressRoutes-DJR1UTd-.js +1 -0
  4. package/dist/assets/{AddressScreen-i3P2ph6T.js → AddressScreen-CUr_aEMc.js} +2 -2
  5. package/dist/assets/AiCfoScreen-BWl90IlM.js +22 -0
  6. package/dist/assets/{AppDrawer-Dql_QZ37.js → AppDrawer-D5PfLYY9.js} +2 -2
  7. package/dist/assets/{BillPayApprovalRoutes-BCU4pCRz.js → BillPayApprovalRoutes-DAUa7ONB.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-7r9rU7sl.js → BillPayRoutes-DLiB7rcg.js} +18 -18
  9. package/dist/assets/BusinessVerificationPageScreen-0_5o_ZM_.js +9 -0
  10. package/dist/assets/{CardsAiCfoScreen-C4xeVeSy.js → CardsAiCfoScreen-DgEHpSc7.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-BKebJlhL.js → ChargeCardRoutes-CGicSScL.js} +6 -6
  12. package/dist/assets/{CompanyPassportScreen-BTV6sqcv.js → CompanyPassportScreen-Cc-A-J9-.js} +1 -1
  13. package/dist/assets/ConnectionAuthScreen-DFY2TNuF.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-Dr48JwuC.js +1 -0
  15. package/dist/assets/CustomerOnboardingRoutes-D0tIE0Z1.js +30 -0
  16. package/dist/assets/{DashboardRoutes-D-v8IdFM.js → DashboardRoutes-fO2Q95Pi.js} +3 -3
  17. package/dist/assets/{DefaultTenantHome-Ctr8hbVg.js → DefaultTenantHome-CgyMoJcG.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-BhmYhgk9.js → DomesticWireDetailScreen-lCsi4C5H.js} +4 -4
  19. package/dist/assets/{DrawerScreen-CiI0UwZ_.js → DrawerScreen-Cc5wz0h5.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-gyNpo9F4.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-gNYcLYcp.js → ExpenseAutomationRoutes-BRpV-BG_.js} +6 -6
  22. package/dist/assets/FeaturePreviewScreen-pBtwBr_N.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-DSWdP7lt.js +1 -0
  24. package/dist/assets/{InboxNotificationsProvider-RMyde6sE.js → InboxNotificationsProvider-acJ-mQYX.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-OgCHCVmr.js → InvoicingRoutes-p_zZErJa.js} +2 -2
  26. package/dist/assets/{MagicLinkRoutes-BwkRRCJu.js → MagicLinkRoutes-CSV8DIoI.js} +20 -20
  27. package/dist/assets/MagicLinkSignInScreen-D1OLFxKv.js +12 -0
  28. package/dist/assets/MobileAppDrawer-jc7oeqcf.js +1 -0
  29. package/dist/assets/NotFoundScreen-n2sZiHTP.js +1 -0
  30. package/dist/assets/NotificationRoutes-M5pxGUeG.js +1 -0
  31. package/dist/assets/OAuthConsentScreen-DOREZoqh.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-DK6RjofB.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-CUXZafMx.js → PaymentLinkScreen-n1UNE3U9.js} +5 -5
  34. package/dist/assets/PeopleRoutes-CNPCr-L4.js +22 -0
  35. package/dist/assets/PerformanceRoutes-BTjLeNmT.js +1 -0
  36. package/dist/assets/{Preview-CHfSVeda.js → Preview-CJRvnEAv.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-2QWv8Ryp.js → QBOConnectionScreen-DTOowkWU.js} +1 -1
  38. package/dist/assets/ReimbursementApprovalRoutes-BQnKvM2a.js +1 -0
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Wh8YBERv.js → ReimbursementApprovalRuleDetailScreen-ChdeAEEo.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-Cn40tr84.js → ReimbursementRoutes-DeDFifAg.js} +7 -7
  41. package/dist/assets/{ReportsRoutes-DnLayxiF.js → ReportsRoutes-ltsKJmPq.js} +1 -1
  42. package/dist/assets/RewardsRoutes-B0axXfBN.js +1 -0
  43. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-B48cCmOD.js +33 -0
  44. package/dist/assets/ScreenRoutes-BrOWRtN9.js +2 -0
  45. package/dist/assets/{SettingsRoutes-C253rFo8.js → SettingsRoutes-qM6FOrI_.js} +6 -6
  46. package/dist/assets/SetupPagesScreen-CUMRQWyq.js +29 -0
  47. package/dist/assets/SignInScreen-Cp0FNmL9.js +1 -0
  48. package/dist/assets/SignOutScreen-Cltpt53S.js +9 -0
  49. package/dist/assets/TaskListScreen-Cz8JRv3L.js +9 -0
  50. package/dist/assets/TaskRoutes-BVnvgieb.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-3ahF1J6v.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-ZbhuUtai.js → TransactionDetailScreen-mapOUu_X.js} +2 -2
  53. package/dist/assets/TransactionListRoutes-CG-fcybo.js +1 -0
  54. package/dist/assets/{TreasuryRoutes-DULHfT4a.js → TreasuryRoutes-oCzS5EKy.js} +4 -4
  55. package/dist/assets/{VendorsRoutes-DDjSbdmH.js → VendorsRoutes-D10u79fF.js} +13 -13
  56. package/dist/assets/WiseConfirmationScreen-CegbLvI-.js +12 -0
  57. package/dist/assets/{ZeniAccountRoutes-ZpQZTXfH.js → ZeniAccountRoutes-CM6btkjV.js} +11 -11
  58. package/dist/assets/ZeniAccountStatementScreen-DKETk0FT.js +9 -0
  59. package/dist/assets/{accountMappingHelper-CDXfdGYB.js → accountMappingHelper-de51OWcB.js} +1 -1
  60. package/dist/assets/{analytics-Bwul-sh2.js → analytics-DzL27tck.js} +1 -1
  61. package/dist/assets/{analyticsHelper-CJXbjLla.js → analyticsHelper-Dbh_ZdOH.js} +1 -1
  62. package/dist/assets/{core-BTRpO5kD.js → core-BNc5eMdk.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-gQrUmSgy.js → decodeURIComponentSafe-BSiJLIqU.js} +1 -1
  64. package/dist/assets/{dnd-2ZjyQ0g9.js → dnd-0zxechDA.js} +1 -1
  65. package/dist/assets/{empty-Cb7Nu9Hh.js → empty-5vTmg9PS.js} +1 -1
  66. package/dist/assets/{empty-W69oI4tU.js → empty-De8i1B-J.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-BykFTq6U.js → emptyVideoElement-D0I6gChS.js} +1 -1
  68. package/dist/assets/epic-Cmq979ri.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-BNtWlCNK.js +1 -0
  70. package/dist/assets/{getLocaleForTenant-COzbHLDP.js → getLocaleForTenant-DE5c6zm1.js} +1 -1
  71. package/dist/assets/{index-BNStHB6B.js → index-B7i4OQ4V.js} +1 -1
  72. package/dist/assets/{index-Ds59pPsN.js → index-B9mu9yU0.js} +1 -1
  73. package/dist/assets/{index-CyWlZL1X.js → index-BM08vDhu.js} +2 -2
  74. package/dist/assets/{index-EIrua76A.js → index-Bqsu77NP.js} +1 -1
  75. package/dist/assets/{index-D-DXs1ug.js → index-BuQOQ6cA.js} +16978 -16837
  76. package/dist/assets/{index-O5NQ6O4f.js → index-C01KTNGe.js} +1 -1
  77. package/dist/assets/{index-Dt8qJC5s.js → index-DCd9c8XG.js} +1 -1
  78. package/dist/assets/{index-BpHR89qw.js → index-DtUEcHPx.js} +1 -1
  79. package/dist/assets/{lexical-B4Vx7iXM.js → lexical-BSajFjJy.js} +1 -1
  80. package/dist/assets/{liveblocks-CSh_vLcI.js → liveblocks-CgcSlW4Z.js} +1 -1
  81. package/dist/assets/{lottie-CkDkDB9t.js → lottie-VLEWAz4K.js} +1 -1
  82. package/dist/assets/{mui-DxxQrDXb.js → mui-BCV14xpx.js} +1 -1
  83. package/dist/assets/{pathToGoBack-CVTu70jh.js → pathToGoBack-Ct0_tDyX.js} +1 -1
  84. package/dist/assets/{pdf-B5u-xbSo.js → pdf-fIozDtKP.js} +4 -4
  85. package/dist/assets/{pdf-lib-reHt5MEc.js → pdf-lib-ZHcF2OoC.js} +1 -1
  86. package/dist/assets/{plaid-BETTZw7O.js → plaid-BGKcPjuF.js} +1 -1
  87. package/dist/assets/{pusher-Ckps79Gu.js → pusher-DF3U6TjN.js} +1 -1
  88. package/dist/assets/{react-2QuTt-Yq.js → react-BEP9leHw.js} +1 -1
  89. package/dist/assets/{react-BwbSXuKk.js → react-C0FU-bd-.js} +1 -1
  90. package/dist/assets/{react-D5AIOkBV.js → react-CYkS38FV.js} +1 -1
  91. package/dist/assets/{react-CnCpDB3_.js → react-DEqnxI-0.js} +1 -1
  92. package/dist/assets/{react-BEHSpArB.js → react-Dl_BCpnf.js} +1 -1
  93. package/dist/assets/{react-DAYatQOH.js → react-DnOLcQ-R.js} +1 -1
  94. package/dist/assets/{recharts-TU-ixTpA.js → recharts-B1fIlvhf.js} +1 -1
  95. package/dist/assets/{routePaths-BpwABclb.js → routePaths-Fw-tznCi.js} +1 -1
  96. package/dist/assets/{sentry-BbRn6Rps.js → sentry-CkAdiuiy.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-CHEOIiL-.js → stripSplatSuffix-0Sr2Qpml.js} +1 -1
  98. package/dist/assets/{url-DFeqMB02.js → url-BWjQ6tZk.js} +1 -1
  99. package/dist/assets/{url-COMcQU2v.js → url-DZkAnGE1.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-BhC_BwjK.js +1 -0
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BeQw4E92.js → useAiCfoDashboardSuggestedQuestionsChips-Dl7t0rfD.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-BAZ88gr3.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-6cwlQnL1.js → useChargeCardPusherEvents-B37-5iMJ.js} +1 -1
  104. package/dist/assets/{useDeviceId-BNqfuCC6.js → useDeviceId-iZ_-Itv9.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-BVltkRYL.js +1 -0
  106. package/dist/assets/{useInitialThreadRequest-CVcZLc8x.js → useInitialThreadRequest-BLqSoxJq.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-CvCLmUXb.js +1 -0
  108. package/dist/assets/{useTaskManagerPusherEvents-QjRM_WrB.js → useTaskManagerPusherEvents-Du_KDQdo.js} +1 -1
  109. package/dist/assets/{utils-CG6WKZWt.js → utils-CqmAwzS_.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-_2doqhuK.js → withTransactionSidePanel-D7Qark8_.js} +4 -4
  111. package/dist/assets/{zeni-epic-state-GGdMfKwk.js → zeni-epic-state-DGPmp0NT.js} +5 -5
  112. package/dist/index.html +1 -1
  113. package/package.json +4 -4
  114. package/dist/assets/AccountMappingScreen-DqcX7eSX.js +0 -9
  115. package/dist/assets/AddressRoutes-BQwEhrxO.js +0 -1
  116. package/dist/assets/AiCfoScreen-BssUSHKh.js +0 -22
  117. package/dist/assets/BusinessVerificationPageScreen-BtYE51TA.js +0 -9
  118. package/dist/assets/ConnectionAuthScreen-CxytsIZE.js +0 -11
  119. package/dist/assets/CustomerOnboardingAuthScreen-BihvMY31.js +0 -1
  120. package/dist/assets/CustomerOnboardingRoutes-DNk5fzPY.js +0 -30
  121. package/dist/assets/EntityDetailRoutes-DvFtuOf8.js +0 -1
  122. package/dist/assets/FeaturePreviewScreen-DiNAV9z-.js +0 -1
  123. package/dist/assets/HubSpotOAuthCallbackScreen-DweVccIt.js +0 -1
  124. package/dist/assets/MagicLinkSignInScreen-wnNTguw6.js +0 -12
  125. package/dist/assets/MobileAppDrawer-C0d1iVMA.js +0 -1
  126. package/dist/assets/NotFoundScreen-BEmDKBPw.js +0 -1
  127. package/dist/assets/NotificationRoutes-CI7va7e0.js +0 -1
  128. package/dist/assets/OAuthConsentScreen-DV8WsAVC.js +0 -1
  129. package/dist/assets/PandLWithForecastRoutes-B1Gfn6ud.js +0 -1
  130. package/dist/assets/PeopleRoutes-Bn8rhJs3.js +0 -22
  131. package/dist/assets/PerformanceRoutes-CvtwCDup.js +0 -1
  132. package/dist/assets/ReimbursementApprovalRoutes-EobIM3L1.js +0 -1
  133. package/dist/assets/RewardsRoutes-xdDqPM6d.js +0 -1
  134. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-CwSWMHf6.js +0 -33
  135. package/dist/assets/ScreenRoutes-B8Lww7Hb.js +0 -2
  136. package/dist/assets/SetupPagesScreen-K8aynBOv.js +0 -29
  137. package/dist/assets/SignInScreen-B673IWUl.js +0 -1
  138. package/dist/assets/SignOutScreen-BY00T1e6.js +0 -9
  139. package/dist/assets/TaskListScreen-DqA1P3PO.js +0 -9
  140. package/dist/assets/TaskRoutes-BXCCg41Z.js +0 -9
  141. package/dist/assets/TransactionDetailRoutes-fr5aBjbx.js +0 -1
  142. package/dist/assets/TransactionListRoutes-skEyucsa.js +0 -1
  143. package/dist/assets/WiseConfirmationScreen-BeEAkT2z.js +0 -12
  144. package/dist/assets/ZeniAccountStatementScreen-fYBBQyBB.js +0 -9
  145. package/dist/assets/epic-dVflju6K.js +0 -2
  146. package/dist/assets/expenseAutomationHelper-D83VUSa4.js +0 -1
  147. package/dist/assets/useActualMatchingMatchDetail-CCjKruLV.js +0 -1
  148. package/dist/assets/useAskAiCfoHostNavButtonProps-B9dKaXC2.js +0 -1
  149. package/dist/assets/useEmailConnectResultRefresh-CD4x3asD.js +0 -1
  150. package/dist/assets/useTaskManagerAccess-DkfJ_Uxt.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-CSh_vLcI.js";import{u as ne,j as A,h as Q,g as K,i as se,N as P,l as J,q as lt,n as mt,o as x}from"./core-BTRpO5kD.js";import{fI as V,NQ as ct,$3 as be,c9 as ge,MW as $e,md as dt,N9 as me,N8 as ce,$4 as ut,bn as he,gY as Ue,$5 as pt,X1 as bt,m2 as Fe,X2 as Re,X3 as gt,kQ as ht,Z5 as ft,l3 as St,MK as It,Ck as yt,kX as vt,Nv as Le,$6 as Ne,$7 as Ae,$8 as kt,$9 as Rt,$a as At,Nf as Ce,l9 as Ct,Ze as wt,N7 as xt,MU as Et,$b as Bt,MT as Tt,$c as Dt,M$ as we,Nj as jt,Ni as $t,Ne as Ut,$d as Me,St as Ft,bo as Lt,N2 as Nt,NN as Mt,$e as Pt,$f as _t,Nr as Ot,No as xe,YB as Zt,MR as zt,$g as Pe,Oe as Ee,Om as Gt,$h as Vt,$i as X,$j as Ht,$k as _e,$l as Wt,$m as Oe,$n as Ze,ND as de,bv as qt,bL as fe,cN as Se,e0 as ze,d$ as Ge,$o as Xt,gk as Yt,YO as Kt,$p as Qt,$q as Ve,YS as Jt,ZB as en,$r as tn,Z_ as nn,Oj as Be,Oi as an,$s as sn,$t as on,$u as rn,$v as ln,$w as mn,Zk as cn,O9 as dn,Od as un,bq as pn,bK as bn,cH as gn,cv as hn,bu as fn,Us as Sn,db as In,de as yn,dd as vn,cG as kn}from"./zeni-epic-state-GGdMfKwk.js";import{bT as Rn,y as He,a1 as We,c as ie,g as j,z as F,cS as qe,a8 as oe,m as C,aS as Te,N as D,ae,af as An,G as Xe,cT as Cn,p as Y,as as Ye,cU as wn,W as re,cV as xn,aq as En,ab as Bn,a7 as Ie,T as Ke,w as Tn,bB as Dn,av as jn,ai as $n,E as Qe,cW as Un,h as Fn}from"./index-D-DXs1ug.js";import{n as _,S as Ln}from"./mui-DxxQrDXb.js";import ue from"./NotFoundScreen-BEmDKBPw.js";import{S as De}from"./SetupPagesScreen-K8aynBOv.js";import{F as Je}from"./FeaturePreviewScreen-DiNAV9z-.js";import{a as f}from"./sentry-BbRn6Rps.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-B9dKaXC2.js";import{u as et}from"./useInitialThreadRequest-CVcZLc8x.js";import{D as Nn}from"./DrawerScreen-CiI0UwZ_.js";import{M as tt}from"./MobileAppDrawer-C0d1iVMA.js";import{F as Mn}from"./ScreenRoutes-B8Lww7Hb.js";import{R as Pn}from"./ReimbursementApprovalRoutes-EobIM3L1.js";import"./recharts-TU-ixTpA.js";import"./analytics-Bwul-sh2.js";import"./plaid-BETTZw7O.js";import"./dnd-2ZjyQ0g9.js";import"./stripe-cKAAJElX.js";import"./lottie-CkDkDB9t.js";import"./lexical-B4Vx7iXM.js";import"./pdf-B5u-xbSo.js";import"./utils-CG6WKZWt.js";import"./BusinessVerificationPageScreen-BtYE51TA.js";import"./routePaths-BpwABclb.js";import"./analyticsHelper-CJXbjLla.js";import"./InboxNotificationsProvider-RMyde6sE.js";import"./useTaskManagerAccess-DkfJ_Uxt.js";import"./getLocaleForTenant-COzbHLDP.js";import"./ReimbursementApprovalRuleDetailScreen-Wh8YBERv.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]="a2b07acf-3f80-4d67-a8d7-cccab8fae776",e._sentryDebugIdIdentifier="sentry-dbid-a2b07acf-3f80-4d67-a8d7-cccab8fae776")}catch{}})();const nt=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:te}}}=Xe.getLocalizedStrings(),On=J((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),c=F.getSignedInUser(),d=he(c),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=be(e,t.reimbursementId),b=pt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,u=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=c?.userId===l.createdBy?.userId);const E=e.entityAutoCompleteState?.autoCompleteText?.common,I=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:E,entityAutoCompleteView:I},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:ge(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=F.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ce(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(we(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ut(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e($t())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(we(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Tt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Bt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Et({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ce(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Ct(i))},submitRemiDetails:()=>{e(Ce("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ae({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(me({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(At({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Rt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Ne()),e(Ae({}));const i=nt(o),l=Y(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Le(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Re("common"))},onCancelAutoComplete:()=>{e(Re("common"))}}}}))(Cn);function je(){const e=Q(),t=ne(),n=K(),{reimbursementId:r}=se(),c=He(),d=We(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ie(),{isFeatureEnabled:b}=l(j.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(j.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:u,onAskAiCfoClick:E}=ye({mobileExploreReferrer:"Reimbursement Details"}),I=K().pathname,B=I.includes("edit"),T=I.includes("reimbursement/new"),[v,w]=f.useState(!1),h=F.getSignedInUser(),k=A((p=>V(p))),g=A((p=>be(p,r))),L=et(k?.companyId,{clearParams:g.fetchState==="Completed"}),$=ge(k?.userRole??[]);(function(){const p=ne(),N=A((M=>V(M))),O=N?.tenantId,{isApprovalRulesV3Enabled:H,isLoading:Z}=Rn(O),W=A((M=>M.remiSetupApproverViewState.fetchState));f.useEffect((()=>{O==null||Z||W==="Not-Started"&&p(ct(!0,!1,!1,H))}),[O,Z,H,W,p])})(),f.useEffect((()=>{(T&&!v||B&&!v&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t($e(!1,b,y,r)))}));const U=A((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(h==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||$&&g.billStatus==="rejected"||$===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(P,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(oe,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(zn,{}):null,m&&d!=="small"?s.jsx(Gn,{children:s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:k?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:k?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:d,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,location:n,navigate:e,currentTenant:k,reimbursementId:r,themeState:c,uncategorizedAccounts:U,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:u,onAskAiCfoClick:E})})]})}const Zn=_.div`
1
+ import{j as s}from"./liveblocks-CgcSlW4Z.js";import{u as ne,j as R,h as Q,g as J,i as se,N as P,l as X,q as lt,n as mt,o as x}from"./core-BNc5eMdk.js";import{fI as V,NM as ct,__ as be,c9 as ge,MS as $e,md as dt,N5 as me,N4 as ce,_$ as ut,bn as he,gY as Ue,$0 as pt,WZ as bt,m2 as Fe,W_ as Ae,W$ as gt,kQ as ht,Z1 as ft,l3 as St,MG as It,Cj as yt,kX as vt,Nr as Le,$1 as Me,$2 as Re,$3 as kt,$4 as At,$5 as Rt,Nb as Ce,l9 as Ct,Za as wt,N3 as xt,MQ as Et,$6 as Bt,MP as Tt,$7 as Dt,MX as we,Nf as jt,Ne as $t,Na as Ut,$8 as Ne,Sp as Ft,bo as Lt,M_ as Mt,NJ as Nt,$9 as Pt,$a as _t,Nn as Ot,Nk as xe,Yx as Zt,MN as zt,$b as Pe,Oa as Ee,Oi as Gt,$c as Vt,$d as Y,$e as Wt,$f as _e,$g as Ht,$h as Oe,$i as Ze,Nz as de,bv as qt,bL as fe,cN as Se,e0 as ze,d$ as Ge,$j as Yt,gk as Kt,YK as Jt,$k as Qt,$l as Ve,YO as Xt,Zw as en,$m as tn,ZV as nn,Of as Be,Oe as an,$n as sn,$o as on,$p as rn,$q as ln,$r as mn,Zg as cn,O5 as dn,O9 as un,bq as pn,bK as bn,cH as gn,cv as hn,bu as fn,Uo as Sn,db as In,de as yn,dd as vn,cG as kn}from"./zeni-epic-state-DGPmp0NT.js";import{bT as An,c as We,a1 as He,_ as ie,f as j,z as F,cS as qe,a8 as oe,n as C,aS as Te,M as D,ae,af as Rn,G as Ye,cT as Cn,p as K,as as Ke,cU as wn,P as re,cV as xn,aq as En,ab as Bn,a7 as Ie,T as Je,w as Tn,bB as Dn,av as jn,ai as $n,E as Qe,cW as Un,j as Fn}from"./index-BuQOQ6cA.js";import{n as _,S as Ln}from"./mui-BCV14xpx.js";import ue from"./NotFoundScreen-n2sZiHTP.js";import{S as De}from"./SetupPagesScreen-CUMRQWyq.js";import{F as Xe}from"./FeaturePreviewScreen-pBtwBr_N.js";import{a as f}from"./sentry-CkAdiuiy.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-BAZ88gr3.js";import{u as et}from"./useInitialThreadRequest-BLqSoxJq.js";import{D as Mn}from"./DrawerScreen-Cc5wz0h5.js";import{M as tt}from"./MobileAppDrawer-jc7oeqcf.js";import{F as Nn}from"./ScreenRoutes-BrOWRtN9.js";import{R as Pn}from"./ReimbursementApprovalRoutes-BQnKvM2a.js";import"./recharts-B1fIlvhf.js";import"./analytics-DzL27tck.js";import"./plaid-BGKcPjuF.js";import"./dnd-0zxechDA.js";import"./stripe-cKAAJElX.js";import"./lottie-VLEWAz4K.js";import"./lexical-BSajFjJy.js";import"./pdf-fIozDtKP.js";import"./utils-CqmAwzS_.js";import"./BusinessVerificationPageScreen-0_5o_ZM_.js";import"./routePaths-Fw-tznCi.js";import"./analyticsHelper-Dbh_ZdOH.js";import"./InboxNotificationsProvider-acJ-mQYX.js";import"./useTaskManagerAccess-CvCLmUXb.js";import"./getLocaleForTenant-DE5c6zm1.js";import"./ReimbursementApprovalRuleDetailScreen-ChdeAEEo.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]="708634ce-e35a-4eee-a62e-e634f0516f1c",e._sentryDebugIdIdentifier="sentry-dbid-708634ce-e35a-4eee-a62e-e634f0516f1c")}catch{}})();const nt=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:te}}}=Ye.getLocalizedStrings(),On=X((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),c=F.getSignedInUser(),d=he(c),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=be(e,t.reimbursementId),b=pt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,u=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=c?.userId===l.createdBy?.userId);const E=e.entityAutoCompleteState?.autoCompleteText?.common,I=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:E,entityAutoCompleteView:I},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:ge(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=F.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ce(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(we(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ut(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e($t())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(we(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Tt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Bt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Et({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ce(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Ct(i))},submitRemiDetails:()=>{e(Ce("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Re({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(me({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Rt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(At({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(Re({}));const i=nt(o),l=K(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Le(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(Cn);function je(){const e=Q(),t=ne(),n=J(),{reimbursementId:r}=se(),c=We(),d=He(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ie(),{isFeatureEnabled:b}=l(j.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(j.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:u,onAskAiCfoClick:E}=ye({mobileExploreReferrer:"Reimbursement Details"}),I=J().pathname,B=I.includes("edit"),T=I.includes("reimbursement/new"),[v,w]=f.useState(!1),h=F.getSignedInUser(),k=R((p=>V(p))),g=R((p=>be(p,r))),L=et(k?.companyId,{clearParams:g.fetchState==="Completed"}),$=ge(k?.userRole??[]);(function(){const p=ne(),M=R((N=>V(N))),O=M?.tenantId,{isApprovalRulesV3Enabled:W,isLoading:Z}=An(O),H=R((N=>N.remiSetupApproverViewState.fetchState));f.useEffect((()=>{O==null||Z||H==="Not-Started"&&p(ct(!0,!1,!1,W))}),[O,Z,W,H,p])})(),f.useEffect((()=>{(T&&!v||B&&!v&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t($e(!1,b,y,r)))}));const U=R((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(h==null)throw Error("Can't access address page without signing in...");const A={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||$&&g.billStatus==="rejected"||$===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(P,{to:A}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(oe,{analytics:C,onLoad:p=>(M=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(zn,{}):null,m&&d!=="small"?s.jsx(Gn,{children:s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:k?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Vn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:k?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Hn,{windowSize:d,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,location:n,navigate:e,currentTenant:k,reimbursementId:r,themeState:c,uncategorizedAccounts:U,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:u,onAskAiCfoClick:E})})]})}const Zn=_.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -10,7 +10,7 @@ import{j as s}from"./liveblocks-CSh_vLcI.js";import{u as ne,j as A,h as Q,g as K
10
10
  left: 0;
11
11
  right: 0;
12
12
  bottom: 0;
13
- background-color: ${An.overlayBackgroundBlack};
13
+ background-color: ${Rn.overlayBackgroundBlack};
14
14
  z-index: 5;
15
15
  `,Gn=_.div`
16
16
  position: absolute;
@@ -33,7 +33,7 @@ import{j as s}from"./liveblocks-CSh_vLcI.js";import{u as ne,j as A,h as Q,g as K
33
33
  flex-direction: column;
34
34
  overflow-y: auto;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
- `,Hn=_.button`
36
+ `,Wn=_.button`
37
37
  align-self: flex-end;
38
38
  background: none;
39
39
  border: none;
@@ -48,12 +48,12 @@ import{j as s}from"./liveblocks-CSh_vLcI.js";import{u as ne,j as A,h as Q,g as K
48
48
  width: ${D.sp4};
49
49
  height: ${D.sp4};
50
50
  }
51
- `,Wn=_.div`
51
+ `,Hn=_.div`
52
52
  display: flex;
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,qn=J((function(e,t){const n=Me(e,t.reimbursementId),r=F.getSignedInUser(),c=he(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Pt(n.remiActivities,_t(t.currentTenant),r));const i=ge(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Ne());const a=nt(o),i=Y(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(xe(n,a.type,"")):e(xe(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Y(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(Le(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(wn);function Xn(){const e=Q(),t=ne(),n=K(),r=n.hash.substring(1),c=He(),{reimbursementId:d}=se(),m=F.getSignedInUser(),o=A((R=>V(R))),a=A((R=>Me(R,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=ye({mobileExploreReferrer:"Reimbursement Details"});Ye({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=ie(),{isFeatureEnabled:E}=u(j.isLimitedCategoryForReimbursement),[I,B]=f.useState(!1),[T,v]=f.useState(!1),[w,h]=f.useState(!1),{isFeatureEnabled:k}=u(j.isShowDeletedReimbursementsFeatureEnabled),g=A((R=>be(R,d??""))),L=Ft(o),$=Lt(o.userRole),U=a.fetchState;if(f.useEffect((()=>{I||d==null?I==1&&U==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Nt(d,!1,k)))}),[I,d,t,U]),f.useEffect((()=>{k&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?h(!1):h(a.remiActivities[0]?.isRealTimeApprovalEnabled&&($||a.allApprovers.find((R=>R.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,$,o.isZeni,L,m]),f.useEffect((()=>{T||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(v(!0),t($e(!1,E,k,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Mt(!1,!0,!0,a.lastUpdatedByUserId)))}),[T,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(P,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:R=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(R)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:k,location:n,navigate:e,isRealTimeApprovalEnabled:w,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Yn=J((function(e,t){return{remisReviewView:Pe(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(X())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Gt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(xn);function Kn({tenantEmailDomain:e}){const t=Q(),n=A((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=A((m=>Pe(m))),c=re(),d=c?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Yn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const G=Jt(),at="bulk-operation-update",pe="reimbursement-approval-rule-update",{spendManagement:Qn,common:le}=Xe.getLocalizedStrings(),Jn=Qn.reimbursement.bulkActions,ea=_.div`
56
+ `,qn=X((function(e,t){const n=Ne(e,t.reimbursementId),r=F.getSignedInUser(),c=he(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Pt(n.remiActivities,_t(t.currentTenant),r));const i=ge(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Me());const a=nt(o),i=K(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(xe(n,a.type,"")):e(xe(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=K(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(Le(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(wn);function Yn(){const e=Q(),t=ne(),n=J(),r=n.hash.substring(1),c=We(),{reimbursementId:d}=se(),m=F.getSignedInUser(),o=R((A=>V(A))),a=R((A=>Ne(A,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=ye({mobileExploreReferrer:"Reimbursement Details"});Ke({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=ie(),{isFeatureEnabled:E}=u(j.isLimitedCategoryForReimbursement),[I,B]=f.useState(!1),[T,v]=f.useState(!1),[w,h]=f.useState(!1),{isFeatureEnabled:k}=u(j.isShowDeletedReimbursementsFeatureEnabled),g=R((A=>be(A,d??""))),L=Ft(o),$=Lt(o.userRole),U=a.fetchState;if(f.useEffect((()=>{I||d==null?I==1&&U==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Mt(d,!1,k)))}),[I,d,t,U]),f.useEffect((()=>{k&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?h(!1):h(a.remiActivities[0]?.isRealTimeApprovalEnabled&&($||a.allApprovers.find((A=>A.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,$,o.isZeni,L,m]),f.useEffect((()=>{T||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(v(!0),t($e(!1,E,k,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))}),[T,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(P,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:A=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(A)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:k,location:n,navigate:e,isRealTimeApprovalEnabled:w,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Kn=X((function(e,t){return{remisReviewView:Pe(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(Y())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Gt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(xn);function Jn({tenantEmailDomain:e}){const t=Q(),n=R((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=R((m=>Pe(m))),c=re(),d=c?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Kn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const G=Xt(),at="bulk-operation-update",pe="reimbursement-approval-rule-update",{spendManagement:Qn,common:le}=Ye.getLocalizedStrings(),Xn=Qn.reimbursement.bulkActions,ea=_.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-CSh_vLcI.js";import{u as ne,j as A,h as Q,g as K
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ta=J((function(e,t){const n=Ze(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const c=F.getSignedInUser(),d=he(c),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((u=>u!=="deleted")));const b=n.fetchState,y=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:G,spendManagementEndPoint:`${jn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(X()),e(_e(o))},onSubtabChange:o=>{e(X()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=Y(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=Y(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Y(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(mn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(ln(o))},onFiltersChange:o=>{e(rn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(on({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(de(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(sn(o))},removeAllTransactionsFromBulkActionList:()=>{e(X())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(an(o,a??""));break;case"send_for_approval":e(Be("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Be("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(pe)&&e(nn(!1))},onEventReceived:o=>{o===at&&e(tn())}}}))(Tn(Dn));function na(){const e=Q(),t=ne(),n=K(),r=n.state,c=We(),[d,m]=f.useState(null),o=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Ht(r.tab.toString());S!=null?t(_e(S)):console.log("Warning:Not a valid remiListTab");const z=Wt(r.subTab.toString());z!=null?t(Oe(z)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(X())}}),[]);const{useFeatureGate:a}=ie(),{isFeatureEnabled:i}=a(j.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(j.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(j.isReimbursementBulkActionEnabled),y=F.getSignedInUser(),u=A((S=>V(S))),[E,I]=f.useState(!1),[B,T]=f.useState(!1),v=re(),w=v?.loggedInUserRole?.includes("admin")===!0,h=A((S=>Ze(S,G,b))),{areTenantIdsInSync:k}=En(),g=h.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=ye({mobileExploreReferrer:"Reimbursement List"});if(Ye({isDataReady:g==="Completed"}),f.useEffect((()=>{!B&&k&&(T(!0),t(de(G,!0,l,!1,!0)))}),[B,G,t,k]),y==null)throw Error("Can't access address page without signing in...");const U=!!u?.userRole&&qt(u),R=fe(v?.loggedInUserRoleMap),p=Se(v?.loggedInUserRoleMap),N=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,O=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,H=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,Z=A((S=>Ue(S.companyState,u.companyId))),W=Z?.company.featuresActivationInfo.connectedAccountProvider,M=S=>{I(S)},{isFeatureEnabled:st}=a(j.isDebitCardFeatureEnabled),it=ze(st,u),ot=Ge(u),{remisProcessed:ee,remisProcessing:ve}=A((S=>Xt(S)));f.useEffect((()=>{ee===ve&&d!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:ee>1?le.texts.reports2:Jn.report},{variableName:"_has_",variableValue:ee>1?le.texts.have:le.texts.has},{variableName:"_action_",variableValue:Kt(d)}]})),t(Qt()),setTimeout((()=>{t(de(G,!0,l,!1,!0,!0))}),3e3),m(null))}),[ee,ve]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${pe}`]:[],eventCallback:(S,z,ke)=>{S.endsWith(pe)?ke.onReimbursementApprovalRulesEventReceived?.(S):z.entity_type==="reimbursement"&&(m(z.operation_type),ke.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(Je,{}):O&&(!U||R)||p&&N?s.jsxs(s.Fragment,{children:[g==="Completed"?s.jsx(oe,{analytics:C,onLoad:S=>(z=>z.trackPageLoaded(Ke.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:E,handleDrawerToggle:M}),s.jsxs(ea,{windowSize:c,children:[s.jsx(Nn,{isOpen:o,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(X())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Kn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:G,isAdmin:w,isEmployee:U,entity:"reimbursement",onClickMenuIcon:()=>{M(!0)},createdByUserList:h.createdByUserList,createdByUserListFetchState:h.createdByUserListFetchState,isDownloadEnabled:h.isDownloadEnabled,connectedAccountProvider:W,isBulkActionEnabled:b,bulkSubmissionLimit:h.remiBulkSubmissionLimit,bulkSubmissionFetchState:h.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...rt})]})]}):H&&R?s.jsx(P,{to:"../setup"}):v!=null&&Ve(u,v.loggedInUserRoleMap)?s.jsx(P,{to:"../promo"}):s.jsx(Ie,{fetchState:"In-Progress"}):s.jsx(ue,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=_(Ln)`
64
+ `,ta=X((function(e,t){const n=Ze(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const c=F.getSignedInUser(),d=he(c),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((u=>u!=="deleted")));const b=n.fetchState,y=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:G,spendManagementEndPoint:`${jn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(Y()),e(_e(o))},onSubtabChange:o=>{e(Y()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=K(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=K(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=K(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(mn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(ln(o))},onFiltersChange:o=>{e(rn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(on({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(de(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(sn(o))},removeAllTransactionsFromBulkActionList:()=>{e(Y())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(an(o,a??""));break;case"send_for_approval":e(Be("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Be("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(pe)&&e(nn(!1))},onEventReceived:o=>{o===at&&e(tn())}}}))(Tn(Dn));function na(){const e=Q(),t=ne(),n=J(),r=n.state,c=He(),[d,m]=f.useState(null),o=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(_e(S)):console.log("Warning:Not a valid remiListTab");const z=Ht(r.subTab.toString());z!=null?t(Oe(z)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(Y())}}),[]);const{useFeatureGate:a}=ie(),{isFeatureEnabled:i}=a(j.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(j.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(j.isReimbursementBulkActionEnabled),y=F.getSignedInUser(),u=R((S=>V(S))),[E,I]=f.useState(!1),[B,T]=f.useState(!1),v=re(),w=v?.loggedInUserRole?.includes("admin")===!0,h=R((S=>Ze(S,G,b))),{areTenantIdsInSync:k}=En(),g=h.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=ye({mobileExploreReferrer:"Reimbursement List"});if(Ke({isDataReady:g==="Completed"}),f.useEffect((()=>{!B&&k&&(T(!0),t(de(G,!0,l,!1,!0)))}),[B,G,t,k]),y==null)throw Error("Can't access address page without signing in...");const U=!!u?.userRole&&qt(u),A=fe(v?.loggedInUserRoleMap),p=Se(v?.loggedInUserRoleMap),M=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,O=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,W=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,Z=R((S=>Ue(S.companyState,u.companyId))),H=Z?.company.featuresActivationInfo.connectedAccountProvider,N=S=>{I(S)},{isFeatureEnabled:st}=a(j.isDebitCardFeatureEnabled),it=ze(st,u),ot=Ge(u),{remisProcessed:ee,remisProcessing:ve}=R((S=>Yt(S)));f.useEffect((()=>{ee===ve&&d!=null&&(t(Kt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:ee>1?le.texts.reports2:Xn.report},{variableName:"_has_",variableValue:ee>1?le.texts.have:le.texts.has},{variableName:"_action_",variableValue:Jt(d)}]})),t(Qt()),setTimeout((()=>{t(de(G,!0,l,!1,!0,!0))}),3e3),m(null))}),[ee,ve]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${pe}`]:[],eventCallback:(S,z,ke)=>{S.endsWith(pe)?ke.onReimbursementApprovalRulesEventReceived?.(S):z.entity_type==="reimbursement"&&(m(z.operation_type),ke.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(Xe,{}):O&&(!U||A)||p&&M?s.jsxs(s.Fragment,{children:[g==="Completed"?s.jsx(oe,{analytics:C,onLoad:S=>(z=>z.trackPageLoaded(Je.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:E,handleDrawerToggle:N}),s.jsxs(ea,{windowSize:c,children:[s.jsx(Mn,{isOpen:o,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(Y())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Jn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:G,isAdmin:w,isEmployee:U,entity:"reimbursement",onClickMenuIcon:()=>{N(!0)},createdByUserList:h.createdByUserList,createdByUserListFetchState:h.createdByUserListFetchState,isDownloadEnabled:h.isDownloadEnabled,connectedAccountProvider:H,isBulkActionEnabled:b,bulkSubmissionLimit:h.remiBulkSubmissionLimit,bulkSubmissionFetchState:h.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...rt})]})]}):W&&A?s.jsx(P,{to:"../setup"}):v!=null&&Ve(u,v.loggedInUserRoleMap)?s.jsx(P,{to:"../promo"}):s.jsx(Ie,{fetchState:"In-Progress"}):s.jsx(ue,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=_(Ln)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,oa=J((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(e,n),analytics:C,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Un),ra=()=>{const e=$n(),t=Q(),n=K(),{tenantEmailDomain:r}=se(),c=Qe(),[d,m]=f.useState(!1),o=A((w=>V(w))),a=F.getSignedInUserTenant(r)?.companyId??o.companyId,i=F.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=re(),u=fe(y?.loggedInUserRoleMap),E=Se(y?.loggedInUserRoleMap),I=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,T=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,v=w=>{m(w)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&E&&I?s.jsx(P,{to:"../../../reimbursements"}):T&&u?s.jsx(P,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!T||o.userReimbursementInfo&&E&&I===!1?s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:w=>(h=>h.trackPageLoaded(Ke.Event.reimbursementPromoPage))(w)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:v}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{v(!0)}})]}):s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Pa(){const e=A((M=>V(M))),t=re(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Qe(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ie(),{isFeatureEnabled:o}=m(j.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(j.isDebitCardFeatureEnabled),i=ze(a,e),l=Ge(e),b=e?.userRole!=null&&pn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),E=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,I=fe(t?.loggedInUserRoleMap),B=E&&I,T=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,v=T&&hn(t?.loggedInUserRoleMap),w=Fn(e,o,a)&&!b,h=w&&fn(t?.loggedInUserRoleMap),k=Sn(t?.loggedInUserRoleMap),g=In(t?.loggedInUserRoleMap),L=yn(t?.loggedInUserRoleMap),$=T&&g,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&L,R=vn(t?.loggedInUserRoleMap),p=kn(t?.loggedInUserRoleMap),N=Se(t?.loggedInUserRoleMap),O=w&&R,{tenantEmailDomain:H}=se(),Z=K(),W=n===!0&&(I||N&&d);return s.jsxs(mt,{children:[Z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"verification",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"verification"})}),s.jsx(x,{path:"setup",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"setup"})}),s.jsx(x,{path:"promo",element:s.jsx(ra,{})}),s.jsx(x,{path:"approval-rules/*",element:B?s.jsx(Pn,{}):s.jsx(Mn,{showZeniAccountRoute:$,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:N,showTreasuryRoute:U,isTenantBankingOnly:i,showChargeCardRoute:O,tenantEmailDomain:H??""})}),W&&s.jsx(x,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(x,{path:"/*",element:s.jsx(Je,{})}),t!=null&&Ve(e,t?.loggedInUserRoleMap)&&s.jsx(x,{path:"*",element:s.jsx(P,{to:"../promo"})}),c&&I&&s.jsx(x,{path:"*",element:s.jsx(P,{to:"../setup"})})]}):Z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"new",element:s.jsx(je,{})}),s.jsx(x,{path:":reimbursementId",element:s.jsx(Xn,{})}),s.jsx(x,{path:":reimbursementId/edit",element:s.jsx(je,{})}),s.jsx(x,{path:"*",element:s.jsx(ue,{})})]}):s.jsx(x,{path:"*",element:s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(x,{path:"*",element:s.jsx(ue,{})})]})}export{Pa as default};
68
+ `,oa=X((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(e,n),analytics:C,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Un),ra=()=>{const e=$n(),t=Q(),n=J(),{tenantEmailDomain:r}=se(),c=Qe(),[d,m]=f.useState(!1),o=R((w=>V(w))),a=F.getSignedInUserTenant(r)?.companyId??o.companyId,i=F.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=re(),u=fe(y?.loggedInUserRoleMap),E=Se(y?.loggedInUserRoleMap),I=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,T=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,v=w=>{m(w)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&E&&I?s.jsx(P,{to:"../../../reimbursements"}):T&&u?s.jsx(P,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!T||o.userReimbursementInfo&&E&&I===!1?s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:w=>(h=>h.trackPageLoaded(Je.Event.reimbursementPromoPage))(w)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:v}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{v(!0)}})]}):s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Pa(){const e=R((N=>V(N))),t=re(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Qe(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ie(),{isFeatureEnabled:o}=m(j.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(j.isDebitCardFeatureEnabled),i=ze(a,e),l=Ge(e),b=e?.userRole!=null&&pn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),E=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,I=fe(t?.loggedInUserRoleMap),B=E&&I,T=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,v=T&&hn(t?.loggedInUserRoleMap),w=Fn(e,o,a)&&!b,h=w&&fn(t?.loggedInUserRoleMap),k=Sn(t?.loggedInUserRoleMap),g=In(t?.loggedInUserRoleMap),L=yn(t?.loggedInUserRoleMap),$=T&&g,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&L,A=vn(t?.loggedInUserRoleMap),p=kn(t?.loggedInUserRoleMap),M=Se(t?.loggedInUserRoleMap),O=w&&A,{tenantEmailDomain:W}=se(),Z=J(),H=n===!0&&(I||M&&d);return s.jsxs(mt,{children:[Z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"verification",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"verification"})}),s.jsx(x,{path:"setup",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"setup"})}),s.jsx(x,{path:"promo",element:s.jsx(ra,{})}),s.jsx(x,{path:"approval-rules/*",element:B?s.jsx(Pn,{}):s.jsx(Nn,{showZeniAccountRoute:$,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:M,showTreasuryRoute:U,isTenantBankingOnly:i,showChargeCardRoute:O,tenantEmailDomain:W??""})}),H&&s.jsx(x,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(x,{path:"/*",element:s.jsx(Xe,{})}),t!=null&&Ve(e,t?.loggedInUserRoleMap)&&s.jsx(x,{path:"*",element:s.jsx(P,{to:"../promo"})}),c&&I&&s.jsx(x,{path:"*",element:s.jsx(P,{to:"../setup"})})]}):Z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"new",element:s.jsx(je,{})}),s.jsx(x,{path:":reimbursementId",element:s.jsx(Yn,{})}),s.jsx(x,{path:":reimbursementId/edit",element:s.jsx(je,{})}),s.jsx(x,{path:"*",element:s.jsx(ue,{})})]}):s.jsx(x,{path:"*",element:s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(x,{path:"*",element:s.jsx(ue,{})})]})}export{Pa as default};
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-CSh_vLcI.js";import{g as Q,h as ke,u as Fe,i as Oe,j as d,l as De,n as Ae,o as W}from"./core-BTRpO5kD.js";import{fI as N,Ei as R,U_ as Pe,m2 as ne,ug as re,v5 as D,lJ as Ee,lS as A,lK as P,kN as E,kE as L,kD as Le,Dq as le,va as Me,bq as ve,U$ as Be,bn as Ue,EF as xe,V0 as ze,V1 as Ge,cj as S,Dj as He,V2 as X,V3 as Ye,V4 as qe,V5 as Ne,V6 as $e,V7 as Ze,V8 as Je,V9 as Ke,Va as Qe,Vb as We,Vc as Xe,Vd as ea,Ve as aa,Vf as V,Vg as M,Vh as v,Vi as B,Vj as U,Vk as x,Vl as z,Vm as G,Vn as H,Vo as Y,ek as sa,Ej as ta,E6 as ee,E7 as ae,Ep as oa,Eb as se,Ev as na,Vp as ra,Vq as la,Vr as ca,Vs as ia,Vt as da,Vu as pa,Vv as _a,Vw as fa,Vx as ma,Vy as ua,e0 as ba,d$ as ha}from"./zeni-epic-state-GGdMfKwk.js";import{an as ya,ao as wa,ap as Ca,a as ga,a1 as Sa,c as ce,g as ie,z as de,aq as Ia,W as Ra,e as Ta,ar as Va,as as ja,a8 as ka,m as q,T as Fa,D as Oa,p as pe,at as Da,au as Aa,av as Pa}from"./index-D-DXs1ug.js";import"./mui-DxxQrDXb.js";import Ea from"./NotFoundScreen-BEmDKBPw.js";import{F as La}from"./FeaturePreviewScreen-DiNAV9z-.js";import{a as u}from"./sentry-BbRn6Rps.js";import{u as Ma}from"./useInitialThreadRequest-CVcZLc8x.js";import{t as te,a as oe,b as va}from"./routePaths-BpwABclb.js";import{M as Ba}from"./MobileAppDrawer-C0d1iVMA.js";import"./recharts-TU-ixTpA.js";import"./analytics-Bwul-sh2.js";import"./plaid-BETTZw7O.js";import"./dnd-2ZjyQ0g9.js";import"./stripe-cKAAJElX.js";import"./lottie-CkDkDB9t.js";import"./lexical-B4Vx7iXM.js";import"./pdf-B5u-xbSo.js";import"./utils-CG6WKZWt.js";import"./InboxNotificationsProvider-RMyde6sE.js";import"./useTaskManagerAccess-DkfJ_Uxt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="c29b2a6a-760f-417c-b77e-f907ae08293a",e._sentryDebugIdIdentifier="sentry-dbid-c29b2a6a-760f-417c-b77e-f907ae08293a")}catch{}})();const Ua=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(v({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=N(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=Be(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:q,isZeniUser:Ue(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(V(a)),(I(a)||S(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(ta({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=sa(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?va(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(U({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(v({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=S(t);l?(e(Ke({viewMode:a})),e(Qe({viewMode:a}))):r?(e(We({viewMode:a})),e(Xe({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(V(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(V(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(V(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e($e({classesToFilterOut:a})):I(o.selectedReportID)?e(Ze({classesToFilterOut:a})):e(Je({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):I(o.selectedReportID)?e(qe({projectsToFilterOut:a})):e(Ne({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(X({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ga(),_=Sa(),m=Aa(_),a=ke(),s=Fe(),t=Q(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=u.useState(!1),[$,_e]=u.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const k=d((n=>N(n))),fe=k.masterTOSInfo?.isMasterTOSAccepted??!1,me=k.company?.companyInfo.firstMonthOfFY??1,ue=Ma(k?.companyId),C=d((n=>R(n).fetchState)),be=d((n=>Pe(n))),{areTenantIdsInSync:b}=Ia(),F=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>ne(n))),g=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!$&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,$,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":g&&s(le());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());break;case"balance_sheet_by_projects":g&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":g&&s(A());break;case"cash_flow":s(Ee(h.timeframe))}}),[c,F,O,b,T,g]);const Z=Ra(),we=Z?.loggedInUserRole!=null&&ve(Z?.loggedInUserRole)!==!0,[Ce,ge]=u.useState(!1),J=n=>{ge(n)},Se=Ta(),Ie=Va();return(function(n){const{isDataReady:Re}=n,{pathname:Te}=Q(),K=ya(Te??"")==="reports",Ve=wa(Re),je=u.useMemo((()=>K?Ua:void 0),[K]);Ca({canFetchSuggestedQuestions:Ve,pageContexts:je})})({isDataReady:C==="Completed"}),ja({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ka,{analytics:q,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(Ba,{isAppContentDrawerOpen:Ce,handleDrawerToggle:J}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:q,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:J,reportsResyncFetchState:be.reportsResyncFetchState,isAiCfoAccessEnabled:Ie&&Se&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,initialOpenThreadRequest:ue})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ps(){const e=d((s=>N(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ba(_,e),a=ha(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Ae,{children:[p.jsx(W,{path:"/",element:p.jsx(Ga,{})}),p.jsx(W,{path:"*",element:p.jsx(Ea,{})})]})}export{ps as default};
1
+ import{j as p}from"./liveblocks-CgcSlW4Z.js";import{g as Q,h as Ve,u as Fe,i as Oe,j as d,l as De,n as Ae,o as W}from"./core-BNc5eMdk.js";import{fI as q,Eh as R,UW as Pe,m2 as ne,ug as re,v5 as D,lJ as Ee,lS as A,lK as P,kN as E,kE as L,kD as Le,Dp as le,va as Me,bq as Be,UX as ve,bn as Ue,EE as xe,UY as ze,UZ as Ge,cj as g,Di as Ye,U_ as X,U$ as He,V0 as Ne,V1 as qe,V2 as $e,V3 as Ze,V4 as Je,V5 as Ke,V6 as Qe,V7 as We,V8 as Xe,V9 as ea,Va as aa,Vb as j,Vc as M,Vd as B,Ve as v,Vf as U,Vg as x,Vh as z,Vi as G,Vj as Y,Vk as H,ek as sa,Ei as ta,E5 as ee,E6 as ae,Eo as oa,Ea as se,Eu as na,Vl as ra,Vm as la,Vn as ca,Vo as ia,Vp as da,Vq as pa,Vr as _a,Vs as fa,Vt as ma,Vu as ua,e0 as ba,d$ as ha}from"./zeni-epic-state-DGPmp0NT.js";import{an as ya,ao as wa,ap as Ca,a as Sa,a1 as ga,_ as ce,f as ie,z as de,aq as Ia,P as Ra,e as Ta,ar as ja,as as ka,a8 as Va,n as N,T as Fa,B as Oa,p as pe,at as Da,au as Aa,av as Pa}from"./index-BuQOQ6cA.js";import"./mui-BCV14xpx.js";import Ea from"./NotFoundScreen-n2sZiHTP.js";import{F as La}from"./FeaturePreviewScreen-pBtwBr_N.js";import{a as u}from"./sentry-CkAdiuiy.js";import{u as Ma}from"./useInitialThreadRequest-BLqSoxJq.js";import{t as te,a as oe,b as Ba}from"./routePaths-Fw-tznCi.js";import{M as va}from"./MobileAppDrawer-jc7oeqcf.js";import"./recharts-B1fIlvhf.js";import"./analytics-DzL27tck.js";import"./plaid-BGKcPjuF.js";import"./dnd-0zxechDA.js";import"./stripe-cKAAJElX.js";import"./lottie-VLEWAz4K.js";import"./lexical-BSajFjJy.js";import"./pdf-fIozDtKP.js";import"./utils-CqmAwzS_.js";import"./InboxNotificationsProvider-acJ-mQYX.js";import"./useTaskManagerAccess-CvCLmUXb.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="52ddcbcf-bf6e-48ab-86f3-f66ae2c8c263",e._sentryDebugIdIdentifier="sentry-dbid-52ddcbcf-bf6e-48ab-86f3-f66ae2c8c263")}catch{}})();const Ua=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(H({resetLeftScroll:!0})),e(Y({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:N,isZeniUser:Ue(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(j(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(ta({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=sa(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:k(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(H({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(U({scrollPosition:s}));break;case"cash_flow_by_classes":e(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=g(t);l?(e(Ke({viewMode:a})),e(Qe({viewMode:a}))):r?(e(We({viewMode:a})),e(Xe({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",k(t)),e(j(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(j(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(j(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e($e({classesToFilterOut:a})):I(o.selectedReportID)?e(Ze({classesToFilterOut:a})):e(Je({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(He({projectsToFilterOut:a})):I(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(X({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():Ye()),o.isAccountingProjectsEnabled&&e(s?A():a?E():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=ga(),m=Aa(_),a=Ve(),s=Fe(),t=Q(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=u.useState(!1),[$,_e]=u.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const V=d((n=>q(n))),fe=V.masterTOSInfo?.isMasterTOSAccepted??!1,me=V.company?.companyInfo.firstMonthOfFY??1,ue=Ma(V?.companyId),C=d((n=>R(n).fetchState)),be=d((n=>Pe(n))),{areTenantIdsInSync:b}=Ia(),F=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>ne(n))),S=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!$&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,$,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(le());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());break;case"balance_sheet_by_projects":S&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":S&&s(A());break;case"cash_flow":s(Ee(h.timeframe))}}),[c,F,O,b,T,S]);const Z=Ra(),we=Z?.loggedInUserRole!=null&&Be(Z?.loggedInUserRole)!==!0,[Ce,Se]=u.useState(!1),J=n=>{Se(n)},ge=Ta(),Ie=ja();return(function(n){const{isDataReady:Re}=n,{pathname:Te}=Q(),K=ya(Te??"")==="reports",je=wa(Re),ke=u.useMemo((()=>K?Ua:void 0),[K]);Ca({canFetchSuggestedQuestions:je,pageContexts:ke})})({isDataReady:C==="Completed"}),ka({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Va,{analytics:N,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Ce,handleDrawerToggle:J}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:N,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:J,reportsResyncFetchState:be.reportsResyncFetchState,isAiCfoAccessEnabled:Ie&&ge&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,initialOpenThreadRequest:ue})]})}const k=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ps(){const e=d((s=>q(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ba(_,e),a=ha(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Ae,{children:[p.jsx(W,{path:"/",element:p.jsx(Ga,{})}),p.jsx(W,{path:"*",element:p.jsx(Ea,{})})]})}export{ps as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-CgcSlW4Z.js";import{z as b,a8 as N,n as d,T as S,e2 as E,_ as I,f as k}from"./index-BuQOQ6cA.js";import"./mui-BCV14xpx.js";import g from"./NotFoundScreen-n2sZiHTP.js";import{a as m}from"./sentry-CkAdiuiy.js";import{u as C,j as h,h as F,g as L,l as T,n as _,o as f,N as y}from"./core-BNc5eMdk.js";import{fI as U,a28 as w,a29 as p,DY as P,q2 as V,a2a as q,DW as z}from"./zeni-epic-state-DGPmp0NT.js";import"./recharts-B1fIlvhf.js";import"./analytics-DzL27tck.js";import"./plaid-BGKcPjuF.js";import"./dnd-0zxechDA.js";import"./stripe-cKAAJElX.js";import"./lottie-VLEWAz4K.js";import"./lexical-BSajFjJy.js";import"./pdf-fIozDtKP.js";import"./utils-CqmAwzS_.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]="a51a029c-ab90-4425-8100-4b47acfce802",e._sentryDebugIdIdentifier="sentry-dbid-a51a029c-ab90-4425-8100-4b47acfce802")}catch{}})();const G=T((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),d.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&d.trackInviteEmailClicked("cancel")}}}))(E),R=()=>{const e=C(),[t,n]=m.useState(!1),[i,s]=m.useState(!1),r=h((o=>U(o))),c=F(),j=L(),u=b.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>w(o))),x=u?.firstName!=null?u.firstName:"User";m.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),m.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const D=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(N,{analytics:d,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:c,location:j,currentTenant:r,companyName:D,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(k.isReferralFeatureEnabled);return a.jsxs(_,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(R,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -0,0 +1,33 @@
1
+ import{j as k}from"./liveblocks-CgcSlW4Z.js";import{a as A}from"./sentry-CkAdiuiy.js";import{i as G,u as H,h as Q,g as ee,j as h,l as te}from"./core-BNc5eMdk.js";import{WU as Fe,WV as Ve,m2 as ae,sA as Me,sM as Ge,t0 as $e,s_ as Re,t1 as Ke,t3 as Ue,WW as Ye,fI as K,VT as pe,WX as Se,h1 as ne,cC as se,cD as le,Fm as ve,WY as Ce,Fq as We,gR as ce,sD as qe,tc as ze,dE as Ze,dD as Xe,Tf as fe,Fk as He,Fe as Qe,WZ as De,F6 as et,F5 as tt,F0 as at,Fb as nt,Fr as st,W_ as Y,W$ as ge,F7 as lt,VU as oe,FH as Ae,FA as Ie,X0 as xe,sG as Te,Fu as Be,Fs as Le,X1 as we,FO as Je,FL as be,Fv as je,FN as _e}from"./zeni-epic-state-DGPmp0NT.js";import{a4 as de,aY as ie,aZ as ct,z as ot,m as dt,a7 as it,a8 as ue,n as N,av as ut,a_ as rt,p as V,G as ye,c as ke,a$ as ht,b0 as mt,b1 as pt}from"./index-BuQOQ6cA.js";import{n as re}from"./mui-BCV14xpx.js";import{p as St}from"./pathToGoBack-Ct0_tDyX.js";import X from"./NotFoundScreen-n2sZiHTP.js";import{c as M}from"./routePaths-Fw-tznCi.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]="8c590aff-206b-4419-8d97-20e18140e1d5",e._sentryDebugIdIdentifier="sentry-dbid-8c590aff-206b-4419-8d97-20e18140e1d5")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ve(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?k.jsx(X,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?k.jsx(ie,{}):k.jsx(X,{}):k.jsx(ft,{children:k.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(l,u,r))},onSkip:(u,r)=>{n($e(l,u,r))}})})}const ft=re.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 0 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,Dt=ye.getLocalizedStrings(),gt=te((function(e,t){const c=Se(e,t.scheduleTab),s=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:s??""},linkBillExpenseView:c.linkBillExpenseView,transactions:c.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:c,location:s}=t;return{onTransactionSelect(l){e(Ce({selectedTransaction:l}))},onBackClick:()=>{c("..",{relative:"path"})},onCancel(){e(Ce({selectedTransaction:void 0})),e(We()),c("..",{relative:"path"})},onTransactionClick:l=>{const n=`${M(l,t.tenantEmailDomain)}`,i=V(s.state?.pathnameStackToGoBack,s.pathname);c(n,{state:{pathnameStackToGoBack:i}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ve(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(rt),Kt=({setShouldNavigateBack:e})=>{const t=Q(),c=ee(),{scheduleDetailId:s,tenantEmailDomain:l}=G(),{scheduleType:n}=G();if(l==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const i=h((g=>K(g))),a=pe(n)??"accrued_expenses",d=ot.getSignedInUser();if(d==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(s==null)throw Error("Invalid Schedule Detail Id");const o=h((g=>Se(g,a))),m=o.selectedJELinkRowIndex,I=h((g=>ne(g,i.companyId))),p=dt(o.updateStatus.fetchState);A.useEffect((()=>{p==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[p,o.updateStatus.fetchState]),A.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),A.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const C=o.linkBillExpenseView.fetchState==="Completed";return k.jsx(k.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?k.jsx(it,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&m!=null?k.jsxs(k.Fragment,{children:[C===!0?k.jsx(ue,{analytics:N,onLoad:()=>{yt(o,a,I)}}):null,k.jsx(gt,{signedInUser:d,attachmentEndPoint:`${ut}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:c,tenantEmailDomain:l,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:N,controllerUserDetails:I,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},Ne=e=>{const t=Dt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},yt=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=e.selectedJELinkRowIndex;let n;l!=null&&s!=null&&(n=s.scheduledJournalEntry[l]);const{transactions:i}=e.linkBillExpenseView,a=i.some((m=>m.isRecommendedTransaction===!0)),d=se(c.controllers),o=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{...Ne(s)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:s.vendor.name??null,controllerEmails:d,controllerUserIds:o})};function Ee({jeScheduleId:e,scheduleKey:t,scheduleType:c,onDecided:s}){const l=H(),{ignoreStatusById:n,revertStatusById:i}=h((I=>ce(I).jeSchedules)),a=A.useRef(void 0),d=t==null||a.current==null?void 0:a.current==="ignore"?n[t]?.fetchState:i[t]?.fetchState,o=A.useRef(!1),m=A.useRef(s);return m.current=s,A.useEffect((()=>{o.current&&d==="Completed"&&(o.current=!1,m.current())}),[d]),{onScheduleDecision:A.useCallback(((I,p,C)=>{if(t!=null){if(I==="ignore")return(function(g){return Ze.includes(g)})(p)?(o.current=!0,a.current="ignore",void l(qe(t,c,p,C))):void 0;e!=null&&(function(g){return Xe.includes(g)})(p)&&(o.current=!0,a.current="revert",l(ze(e,t,c,p,C)))}}),[l,e,t,c]),scheduleDecisionStatus:d}}const kt=re.div`
10
+ display: flex;
11
+ min-height: 100%;
12
+ width: 100%;
13
+ flex: 1 0 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ `,Et=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,w=I?.selectedOption;e(et({scheduleType:l,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||w==null||e(tt({scheduleType:l}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=H(),C=ke(),{tenantEmailDomain:g}=G(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=G(),v=s??r;let D;v!=="new"&&(D=v);const w=Ct(v),B=h((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),J="accrued_expenses",E=h((L=>Se(L,"accrued_expenses"))),b=h((L=>fe(L))),j=h((L=>L.classListState.fetchState)),x=h((L=>ae(L))),_=b!=="Completed"||j!=="Completed";A.useEffect((()=>{f===!1&&_?(p(He(J,D)),u(!0)):_===!1&&f===!1&&v!=="new"&&(p(Qe(J,v)),u(!0))}),[f]);const P=h((L=>K(L))),T=h((L=>ne(L,P.companyId))),O=I.state?.message==="expenseAutomation",W=h((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:q,scheduleDecisionStatus:z}=Ee({jeScheduleId:E.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:E.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:J,onDecided:()=>{if(l==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:L,year:Pe}=W;m(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else l()}}),F=E.fetchState,$=E.allAccountList,Z=E.allClassList,y=E.allAccruedAccountList,S=E.scheduleAccruedDetailsLocalData;if(w!==!0||E.fetchState==="Error")return k.jsx(X,{});const R=F==="Completed"&&f===!0,Oe=E.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?k.jsxs(kt,{children:[R===!0?k.jsx(ue,{analytics:N,onLoad:()=>{vt(E,J,T)}}):null,k.jsx(Et,{onScheduleDecision:U?q:void 0,scheduleDecisionStatus:z,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:E,location:I,navigate:m,classList:Z,accountList:$,shouldNavigateBack:d,accruedAccountList:y,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:E.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:E.selectedJEAccruedSchedule?.status.code})]}):k.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{...Ne(s)},vendorName:s.vendor.name??null,controllerEmails:l,controllerUserIds:n})},At=re.div`
18
+ display: flex;
19
+ min-height: 100%;
20
+ width: 100%;
21
+ flex: 1 0 auto;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ background-color: ${e=>e.theme.colors.grey4};
25
+ `,he=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(_e(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(be(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(Je(i,d,o))},onJELinkClick:d=>{e(we({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,w=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:w?.zeniId??D?.selectedOption??"",name:w?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:w?.logo},J=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,E=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,b=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,j=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),_=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:E?.accountId,selectedClass:J?.classId,selectedAccumulatedDepreciationCategory:b?.accountId,selectedDate:r,selectedMonths:j,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||b?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||E?.accountId==null||t.isAccountingClassesEnabled!==!1&&J?.classId==null||r==null||j==null||P!==!0&&_==null||e(Le({scheduleType:i}))}}}))(mt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=Q(),n=ee(),i=H(),a=ke(),{tenantEmailDomain:d}=G(),[o,m]=A.useState(!1),{scheduleDetailId:I}=G(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((y=>y.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||l("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((y=>oe(y,u))),v=h((y=>y.entityAutoCompleteState.autoCompleteText.common)),D=h((y=>De(y,"common"))),w=h((y=>fe(y))),B=h((y=>y.classListState.fetchState)),J=h((y=>ae(y))),E=h((y=>ce(y).selectedPeriod)),b=w!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&b?(i(Ae(u,F,!0)),m(!0)):b===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:y,year:S}=E;l(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else l("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const j=h((y=>K(y))),x=h((y=>ne(y,j.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=Ee({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:y,year:S}=E;l(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else c()}}),O=r.fetchState,W=r.allAccountList,U=r.allClassList,q=r.allDepreciationAccountList,z=r.scheduleDetailsLocalData.fixed_assets;let F;if(p!=="new"&&(F=p),g!==!0||r.fetchState==="Error")return k.jsx(X,{});const $=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?k.jsxs(At,{children:[$===!0?k.jsx(ue,{analytics:N,onLoad:()=>{Bt(r,u,x)}}):null,k.jsx(It,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:E,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(y,S)=>{i(Te(y,S))},accountList:W,depAccountList:q,scheduleLocalData:z,selectedJEScheduleKey:f,scheduleDetailId:F,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:J,status:r.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Lt=re.div`
26
+ display: flex;
27
+ min-height: 100%;
28
+ width: 100%;
29
+ flex: 1 0 auto;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ background-color: ${e=>e.theme.colors.grey4};
33
+ `,me=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,wt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(be(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(Je(t.scheduleTab,a,d))},onJELinkClick:a=>{e(we({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,w=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,J=m.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),E=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,b=f.type==="lastDayOfMonth"||void 0,j={selectedAccount:w?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:J,lastDayOfMonth:b,selectedVendor:v,selectedDayOfMonth:E};e(Be({scheduleType:t.scheduleTab,localData:j,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||w?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||b!==!0&&E==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Wt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=Q(),i=ee(),a=H(),d=ke(),{tenantEmailDomain:o}=G(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=G(),f=t??g,u=Jt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),w=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),J=h((S=>fe(S))),E=h((S=>S.classListState.fetchState)),b=h((S=>ae(S))),j=h((S=>ce(S).selectedPeriod)),x=J!=="Completed"||E!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,$,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:R}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const _=h((S=>K(S))),P=h((S=>ne(S,_.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:W}=Ee({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(s==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:R}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else s()}}),U=D.fetchState,q=D.allAccountList,z=D.allClassList,F=D.scheduleDetailsLocalData;let $;if(f!=="new"&&($=f),u!==!0||D.fetchState==="Error")return k.jsx(X,{});const Z=U==="Completed"&&m===!0,y=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&y?k.jsxs(Lt,{children:[Z===!0?k.jsx(ue,{analytics:N,onLoad:()=>{jt(D,v,P)}}):null,k.jsx(wt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:W,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:w,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,R)=>{a(Te(S,R))},expenseAutomationSelectedPeriod:j,navigate:n,classList:z,accountList:q,scheduleLocalData:F[v],selectedJEScheduleKey:r,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:b,status:D.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},Jt=(e,t)=>pe(e)!=null&&t!=null,bt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),jt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...bt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Rt as J,Yt as S,Ut as a,Wt as b,Kt as c};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-n2sZiHTP.js","assets/sentry-CkAdiuiy.js","assets/core-BNc5eMdk.js","assets/zeni-epic-state-DGPmp0NT.js","assets/index-BuQOQ6cA.js","assets/mui-BCV14xpx.js","assets/analytics-DzL27tck.js","assets/utils-CqmAwzS_.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-fO2Q95Pi.js","assets/withTransactionSidePanel-D7Qark8_.js","assets/useAskAiCfoHostNavButtonProps-BAZ88gr3.js","assets/TransactionDetailScreen-mapOUu_X.js","assets/decodeURIComponentSafe-BSiJLIqU.js","assets/useInitialThreadRequest-BLqSoxJq.js","assets/routePaths-Fw-tznCi.js","assets/expenseAutomationHelper-BNtWlCNK.js","assets/stripSplatSuffix-0Sr2Qpml.js","assets/analyticsHelper-Dbh_ZdOH.js","assets/CompanyPassportScreen-Cc-A-J9-.js","assets/MobileAppDrawer-jc7oeqcf.js","assets/InboxNotificationsProvider-acJ-mQYX.js","assets/useTaskManagerAccess-CvCLmUXb.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Dl7t0rfD.js","assets/FeaturePreviewScreen-pBtwBr_N.js","assets/BillPayRoutes-DLiB7rcg.js","assets/AddressScreen-CUr_aEMc.js","assets/DomesticWireDetailScreen-lCsi4C5H.js","assets/BusinessVerificationPageScreen-0_5o_ZM_.js","assets/DrawerScreen-Cc5wz0h5.js","assets/SetupPagesScreen-CUMRQWyq.js","assets/BillPayApprovalRoutes-DAUa7ONB.js","assets/ReimbursementApprovalRuleDetailScreen-ChdeAEEo.js","assets/getLocaleForTenant-DE5c6zm1.js","assets/ReimbursementRoutes-DeDFifAg.js","assets/ReimbursementApprovalRoutes-BQnKvM2a.js","assets/TransactionListRoutes-CG-fcybo.js","assets/ZeniAccountStatementScreen-DKETk0FT.js","assets/SettingsRoutes-qM6FOrI_.js","assets/AccountMappingScreen-CfmMe_fw.js","assets/QBOConnectionScreen-DTOowkWU.js","assets/empty-5vTmg9PS.js","assets/index-Bqsu77NP.js","assets/url-DZkAnGE1.js","assets/index-B9mu9yU0.js","assets/accountMappingHelper-de51OWcB.js","assets/useEmailConnectResultRefresh-BVltkRYL.js","assets/ReportsRoutes-ltsKJmPq.js","assets/ChargeCardRoutes-CGicSScL.js","assets/useChargeCardPusherEvents-B37-5iMJ.js","assets/PeopleRoutes-CNPCr-L4.js","assets/ExpenseAutomationRoutes-BRpV-BG_.js","assets/useActualMatchingMatchDetail-BhC_BwjK.js","assets/ScheduleDetailsPrepaidExpensesScreen-B48cCmOD.js","assets/pathToGoBack-Ct0_tDyX.js","assets/TreasuryRoutes-oCzS5EKy.js","assets/VendorsRoutes-D10u79fF.js","assets/ZeniAccountRoutes-CM6btkjV.js","assets/AddressRoutes-DJR1UTd-.js","assets/PandLWithForecastRoutes-DK6RjofB.js","assets/CustomerOnboardingRoutes-D0tIE0Z1.js","assets/TransactionDetailRoutes-3ahF1J6v.js","assets/EntityDetailRoutes-gyNpo9F4.js","assets/InvoicingRoutes-p_zZErJa.js","assets/NotificationRoutes-M5pxGUeG.js","assets/PerformanceRoutes-BTjLeNmT.js","assets/ActualMatchingMatchDetailScreen-D3C6jjK4.js","assets/RewardsRoutes-B0axXfBN.js","assets/TaskRoutes-BVnvgieb.js","assets/TaskListScreen-Cz8JRv3L.js","assets/useTaskManagerPusherEvents-Du_KDQdo.js","assets/AiCfoScreen-BWl90IlM.js","assets/CardsAiCfoScreen-DgEHpSc7.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as Es,fI as hs,e0 as ps,d$ as gs,B7 as xs,dj as Rs,c9 as js,gM as Is,gc as Ts,dg as pe,cH as As,gq as bs,cz as Ds,bF as fs,br as ys,Uk as vs,v as Cs,Un as Os,bq as Us,Uo as Ps,bL as ws,bK as Fs,bu as Ls,cv as Vs,Up as ks,Uq as Hs,db as Bs,de as Ss,dd as Ns,cG as Ms,cN as Zs,pV as ge,gl as xe,g$ as $s,gn as Re,gO as je,gP as Ie,go as zs}from"./zeni-epic-state-DGPmp0NT.js";import{j as e}from"./liveblocks-CgcSlW4Z.js";import{a as P}from"./sentry-CkAdiuiy.js";import{N as u,u as Gs,h as qs,i as Ys,g as Ws,j as $,q as Te,n as Ks,o as t}from"./core-BNc5eMdk.js";import{O as l,E as Qs,u as Xs,z as y,_ as Js,e as en,g as sn,f as S,j as nn,U as tn,P as an,L as F,G as Ae,t as _,Q as on,R as rn,n as te}from"./index-BuQOQ6cA.js";import"./mui-BCV14xpx.js";import{f as be}from"./analyticsHelper-Dbh_ZdOH.js";import{t as ln}from"./getLocaleForTenant-DE5c6zm1.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="4ed25008-ae33-4238-9408-56aa7babf0a9",o._sentryDebugIdIdentifier="sentry-dbid-4ed25008-ae33-4238-9408-56aa7babf0a9")}catch{}})();const un=l((()=>s((()=>import("./NotFoundScreen-n2sZiHTP.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),dn=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),cn=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(V===!0){if(o)return e.jsx(fe,{tenantEmailDomain:C});if(i)return e.jsx(De,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(fe,{tenantEmailDomain:C}):i?e.jsx(De,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):D?e.jsx(cn,{tenantEmailDomain:C}):N?e.jsx(dn,{tenantEmailDomain:C}):e.jsx(un,{})},mn={dashboard:()=>s((()=>import("./DashboardRoutes-fO2Q95Pi.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-DLiB7rcg.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-DeDFifAg.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-CG-fcybo.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-qM6FOrI_.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-ltsKJmPq.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-CGicSScL.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-CNPCr-L4.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-BRpV-BG_.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-oCzS5EKy.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-D10u79fF.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-CM6btkjV.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},_n=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},En=l((()=>s((()=>import("./ReportsRoutes-ltsKJmPq.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),hn=l((()=>s((()=>import("./AddressRoutes-DJR1UTd-.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),pn=l((()=>s((()=>import("./PeopleRoutes-CNPCr-L4.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),gn=l((()=>s((()=>import("./PandLWithForecastRoutes-DK6RjofB.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xn=l((()=>s((()=>import("./CustomerOnboardingRoutes-D0tIE0Z1.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),Rn=l((()=>s((()=>import("./VendorsRoutes-D10u79fF.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),jn=l((()=>s((()=>import("./TransactionDetailRoutes-3ahF1J6v.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-gyNpo9F4.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),In=l((()=>s((()=>import("./DashboardRoutes-fO2Q95Pi.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),Ce=l((()=>s((()=>import("./BillPayRoutes-DLiB7rcg.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),Tn=l((()=>s((()=>import("./SettingsRoutes-qM6FOrI_.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),An=l((()=>s((()=>import("./InvoicingRoutes-p_zZErJa.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-DeDFifAg.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),bn=l((()=>s((()=>import("./ZeniAccountRoutes-CM6btkjV.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),Dn=l((()=>s((()=>import("./TreasuryRoutes-oCzS5EKy.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),fn=l((()=>s((()=>import("./TransactionListRoutes-CG-fcybo.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),yn=l((()=>s((()=>import("./ChargeCardRoutes-CGicSScL.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),vn=l((()=>s((()=>import("./NotificationRoutes-M5pxGUeG.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Cn=l((()=>s((()=>import("./PerformanceRoutes-BTjLeNmT.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),On=l((()=>s((()=>import("./ExpenseAutomationRoutes-BRpV-BG_.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Un=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-D3C6jjK4.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Pn=l((()=>s((()=>import("./RewardsRoutes-B0axXfBN.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),wn=l((()=>s((()=>import("./TaskRoutes-BVnvgieb.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),Fn=l((()=>s((()=>import("./AiCfoScreen-BWl90IlM.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-DgEHpSc7.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-n2sZiHTP.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ln=l((()=>s((()=>import("./TaskListScreen-Cz8JRv3L.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Vn=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(O===!0){if(D)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),zn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=Gs(),N=qs(),{tenantEmailDomain:i}=Ys(),V=Qs().mode,{setLoading:O,clearAllLoading:C,clearLoading:k}=Xs(),f=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),K=Es(I),z=Ws(),[L,we]=P.useState(!1),r=$((a=>hs(a))),{useFeatureGate:H}=Js(),M=en(),Q=sn(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=H(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(S.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?ps(oe,r):void 0,X=p==="Completed"||T==="Completed"?gs(r):void 0,re=p==="Completed"||T==="Completed"?xs(r)&&!Rs(r):void 0,ke=nn(r,Ve,oe),{isCardsHidden:He}=tn(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Se}=H(S.isSettingsFeatureEnabled),{isFeatureEnabled:J}=H(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||rn==="DEV",Ze=r?.userRole!=null&&js(r.userRole),G=$((a=>Is(a)));if(i!=null){const a=y.getSignedInUserTenant(i);I!=null&&a!=null&&be(I,r,V)}const Z={tenantId:f,userId:I?.userId,sessionId:I?.zeniSessionId},ie=Ts(),h=an(),$e=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),ze=As(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,Ge=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Ge?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&f!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),n=fs(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();n.isAfter(d,"month")===!1?D(vs(f,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,f]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,I,D,y]),P.useLayoutEffect((()=>{!Cs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,n){if(xe(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);n&&Ae.updateAppLocaleID(ln(n)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?te.identify(a.userId,{tenant_id:a.tenantId}):te.resetUserIdentity()})(Z,I,D,qe))}),[f]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,n,d,q,B){if(c==null&&n==null)return void console.warn("There is no current tenant selected!!");const Y=n!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==n,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(Y&&cs){B(Re(n));const W=y.getSignedInUserTenantWithId(n);W?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(W?.tenantEmailDomain),xe(d?.userId,d?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),B(je(d.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),B(Ie(d.userId,n)))}else Y&&ms&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),B(je(d.userId,n))),Y&&_s&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),B(Ie(d.userId,n)));if(Y){te.identify(d.userId,{tenant_id:n});const W=n==null||n!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),q(F.TENANT_FETCHING),B(zs(d.userId,n,d.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(ge(d.userId,d.zeniSessionId)))}})(T,p,r,f,I,O,D))}),[f,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&G.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(G.tenantsBaseInOrder)),I!=null&&be(I,r,V,void 0,G.tenantsBaseInOrder))}),[G,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&f!=null?(C(),_.markActiveTenantFetchCompleted(f)):p==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,f,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=_n,A=3e3){setTimeout((()=>{const c=n=>{if(n>=a.length)return;const d=a[n],q=mn[d];q!=null?q().then((()=>ae((()=>c(n+1))))).catch((()=>ae((()=>c(n+1))))):c(n+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:Ye}=H(S.isReferralFeatureEnabled),{isFeatureEnabled:We}=H(S.isAccrualEnabled),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Be&&!U,Xe=Ps(h?.loggedInUserRoleMap),Je=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",ne=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&ws(h?.loggedInUserRoleMap),_e=Fe&&!U,ss=Le&&!U,ns=ue&&Fs(h?.loggedInUserRoleMap),ts=de&&Ls(h?.loggedInUserRoleMap),as=_e&&Vs(h?.loggedInUserRoleMap),os=ks(h?.loggedInUserRoleMap),rs=Hs(h?.loggedInUserRoleMap),is=Bs(h?.loggedInUserRoleMap),ls=Ss(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),g=Ms(h?.loggedInUserRoleMap),x=Zs(h?.loggedInUserRoleMap),Ee=ue&&g,he=ce&&x,R=_e&&is,j=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||ze===!0||Xe===!0||os===!0||rs===!0;return y.isSignedIn()?f==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(I!=null&&T!=="In-Progress"&&D(ge(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(ne===!0||K&&!ee)&&es&&Je!==!0&&E===!1&&X===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||ne!==!0||ee||K?!L||ne!==!1||ee||K?L&&r?.userRole&&E!=null&&X!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(t,{element:e.jsx(on,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Vn,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(t,{path:"dashboard/*",element:w?e.jsx(In,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reports/*",element:w?e.jsx(En,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"people/*",element:ds||w?e.jsx(pn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"forecast/*",element:w?e.jsx(gn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(xn,{})}),e.jsx(t,{path:"transaction/*",element:w&&U===!1||Ke||Qe?e.jsx(jn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"transactions/*",element:w&&U===!1?e.jsx(fn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"tasks",element:e.jsx(Ln,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(wn,{})}),e.jsx(t,{path:"address/*",element:ns||me||as||ts?e.jsx(hn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"checking/*",element:R?e.jsx(bn,{}):e.jsx(b,{})}),e.jsx(t,{path:"treasury/*",element:j?e.jsx(Dn,{}):e.jsx(b,{})}),e.jsx(t,{path:"performance",element:Q===!0?e.jsx(Cn,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:Q===!0&&U===!1?e.jsx(On,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"expense-automation/actual-matching/:matchId",element:Q===!0&&U===!1&&We===!0?e.jsx(Un,{}):e.jsx(b,{})}),e.jsx(t,{path:"notifications/*",element:e.jsx(vn,{})}),e.jsx(t,{path:"vendors/*",element:$e?e.jsx(Rn,{}):e.jsx(b,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"settings/*",element:Se?e.jsx(Tn,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(t,{path:"invoicing/*",element:Me&&Ze?e.jsx(An,{}):e.jsx(b,{})}),e.jsx(t,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(t,{path:"cards/*",element:m?e.jsx(yn,{}):e.jsx(b,{})}),e.jsx(t,{path:"rewards/*",element:Ye?e.jsx(Pn,{}):e.jsx(b,{})}),e.jsx(t,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(t,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:M?e.jsx(Fn,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(t,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,zn as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-CSh_vLcI.js";import{a as d}from"./sentry-BbRn6Rps.js";import{h as F,g as K,u as M,i as O,j as C,l as H,n as J,o as k}from"./core-BTRpO5kD.js";import{fI as w,ZD as je,NQ as ve,Za as we,Zj as Ae,c9 as W,cU as De,cV as Ue,bq as Me,df as Re,G6 as _e,ZE as Te,Ph as Be,MH as Ze,My as de,Mv as Ve,Ga as ue,MB as pe,ME as ge,MK as X,Ck as ee,G9 as Ne,lx as $,lA as me,ZF as Fe,mK as Oe,Gr as Le,VR as Ge,VS as $e,lv as Ke,ZG as He,ly as qe,uK as Qe,VM as ze,VN as Je,uO as Ye,hY as We,UL as z,hQ as ae,hN as Xe,hV as en,UM as nn,Go as tn,ZH as an,ZI as on,MY as sn,m2 as rn,d$ as fe,e0 as he,ZJ as ln,gF as cn,U$ as dn,Gn as oe,gK as se,gJ as un,Gm as pn,gI as gn,gH as mn,ZK as fn,Ub as Ce,ZL as hn,ZM as Cn,ZN as yn,ZO as Sn,ZP as bn,ZQ as In,Gu as xn,ZR as En,Gl as ie,Gf as G,ZS as kn,ZT as Pn,ZU as re,ZV as jn,dU as vn,ZW as wn,ZX as An,ZY as Dn,Un,c1 as Mn,c8 as Rn,c7 as _n,c2 as Tn,ZZ as Bn,c5 as Zn,c4 as Vn,c6 as Nn,c3 as Fn}from"./zeni-epic-state-GGdMfKwk.js";import{bT as On,z as v,W as L,a7 as ne,c3 as Ln,m as q,c as te,g as V,h as ye,X as Se,c4 as Gn,l as $n,Z as be,c5 as Kn,ai as Hn,c6 as qn,c7 as Qn,aq as zn,c8 as Jn,p as Yn,d as Ie,c9 as Wn}from"./index-D-DXs1ug.js";import{n as B}from"./mui-DxxQrDXb.js";import{u as xe}from"./useTaskManagerAccess-DkfJ_Uxt.js";import{U as Xn}from"./AccountMappingScreen-DqcX7eSX.js";import{t as et,A as nt}from"./AddressScreen-i3P2ph6T.js";import N from"./NotFoundScreen-BEmDKBPw.js";import{g as tt}from"./analyticsHelper-CJXbjLla.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-BtYE51TA.js";import{C as st}from"./CompanyPassportScreen-BTV6sqcv.js";import{M as _}from"./MobileAppDrawer-C0d1iVMA.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-CD4x3asD.js";import{q as le}from"./QBOConnectionScreen-2QWv8Ryp.js";import{B as lt}from"./BillPayApprovalRoutes-BCU4pCRz.js";import{R as ct}from"./ReimbursementApprovalRoutes-EobIM3L1.js";import"./recharts-TU-ixTpA.js";import"./analytics-Bwul-sh2.js";import"./plaid-BETTZw7O.js";import"./dnd-2ZjyQ0g9.js";import"./stripe-cKAAJElX.js";import"./lottie-CkDkDB9t.js";import"./lexical-B4Vx7iXM.js";import"./pdf-B5u-xbSo.js";import"./utils-CG6WKZWt.js";import"./accountMappingHelper-CDXfdGYB.js";import"./routePaths-BpwABclb.js";import"./InboxNotificationsProvider-RMyde6sE.js";import"./empty-Cb7Nu9Hh.js";import"./pdf-lib-reHt5MEc.js";import"./index-EIrua76A.js";import"./url-COMcQU2v.js";import"./index-Ds59pPsN.js";import"./decodeURIComponentSafe-gQrUmSgy.js";import"./ReimbursementApprovalRuleDetailScreen-Wh8YBERv.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="81c52c07-592e-4e99-9dbe-cc89f54c5c88",e._sentryDebugIdIdentifier="sentry-dbid-81c52c07-592e-4e99-9dbe-cc89f54c5c88")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-CgcSlW4Z.js";import{a as d}from"./sentry-CkAdiuiy.js";import{h as O,g as H,u as M,i as F,j as C,l as K,n as Q,o as k}from"./core-BNc5eMdk.js";import{fI as A,Zy as Pe,NM as ve,Z6 as Ae,Zf as we,c9 as X,cU as De,cV as Ue,bq as Me,df as _e,G5 as Re,Zz as Te,Pd as Be,MD as Ze,Mu as de,Mr as Ve,G9 as ue,Mx as pe,MA as ge,MG as W,Cj as ee,G8 as Ne,lx as $,lA as me,ZA as Oe,mK as Fe,Gq as Le,VN as Ge,VO as $e,lv as He,ZB as Ke,ly as qe,uK as ze,VI as Je,VJ as Qe,uO as Ye,hY as Xe,UH as J,hQ as ae,hN as We,hV as en,UI as nn,Gn as tn,ZC as an,ZD as on,MU as sn,m2 as rn,d$ as fe,e0 as he,ZE as ln,gF as cn,UX as dn,Gm as oe,gK as se,gJ as un,Gl as pn,gI as gn,gH as mn,ZF as fn,U7 as Ce,ZG as hn,ZH as Cn,ZI as yn,ZJ as Sn,ZK as bn,ZL as In,Gt as xn,ZM as En,Gk as ie,Ge as G,ZN as kn,ZO as jn,ZP as re,ZQ as Pn,dU as vn,ZR as An,ZS as wn,ZT as Dn,Uj as Un,c1 as Mn,c8 as _n,c7 as Rn,c2 as Tn,ZU as Bn,c5 as Zn,c4 as Vn,c6 as Nn,c3 as On}from"./zeni-epic-state-DGPmp0NT.js";import{bT as Fn,z as v,P as L,a7 as ne,c3 as Ln,n as q,_ as te,f as V,j as ye,U as Se,c4 as Gn,m as $n,Y as be,c5 as Hn,ai as Kn,c6 as qn,c7 as zn,aq as Jn,c8 as Qn,p as Yn,d as Ie,c9 as Xn}from"./index-BuQOQ6cA.js";import{n as B}from"./mui-BCV14xpx.js";import{u as xe}from"./useTaskManagerAccess-CvCLmUXb.js";import{U as Wn}from"./AccountMappingScreen-CfmMe_fw.js";import{t as et,A as nt}from"./AddressScreen-CUr_aEMc.js";import N from"./NotFoundScreen-n2sZiHTP.js";import{g as tt}from"./analyticsHelper-Dbh_ZdOH.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-0_5o_ZM_.js";import{C as st}from"./CompanyPassportScreen-Cc-A-J9-.js";import{M as R}from"./MobileAppDrawer-jc7oeqcf.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-BVltkRYL.js";import{q as le}from"./QBOConnectionScreen-DTOowkWU.js";import{B as lt}from"./BillPayApprovalRoutes-DAUa7ONB.js";import{R as ct}from"./ReimbursementApprovalRoutes-BQnKvM2a.js";import"./recharts-B1fIlvhf.js";import"./analytics-DzL27tck.js";import"./plaid-BGKcPjuF.js";import"./dnd-0zxechDA.js";import"./stripe-cKAAJElX.js";import"./lottie-VLEWAz4K.js";import"./lexical-BSajFjJy.js";import"./pdf-fIozDtKP.js";import"./utils-CqmAwzS_.js";import"./accountMappingHelper-de51OWcB.js";import"./routePaths-Fw-tznCi.js";import"./InboxNotificationsProvider-acJ-mQYX.js";import"./empty-5vTmg9PS.js";import"./pdf-lib-ZHcF2OoC.js";import"./index-Bqsu77NP.js";import"./url-DZkAnGE1.js";import"./index-B9mu9yU0.js";import"./decodeURIComponentSafe-BSiJLIqU.js";import"./ReimbursementApprovalRuleDetailScreen-ChdeAEEo.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="48643538-23f5-4aea-a665-d9fcccdb74d3",e._sentryDebugIdIdentifier="sentry-dbid-48643538-23f5-4aea-a665-d9fcccdb74d3")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-CSh_vLcI.js";import{a as d}from"./sentry-BbRn6Rp
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ut=H((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(W(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=F(),l=K(),o=M(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>je(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=On(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(_,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
9
+ `,ut=K((function(e,l){const o=A(e),i=Ae(e),r=we(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(X(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=O(),l=H(),o=M(),{tenantEmailDomain:i}=F(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>A(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Fn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-CSh_vLcI.js";import{a as d}from"./sentry-BbRn6Rp
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,mt=H((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Te(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(X(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ze(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=F(),l=K(),o=M(),{tenantEmailDomain:i}=O(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Me(m.userRole),j=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,P=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),D=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(_e(!1)))}),[h,o,p]);const T=A=>{u(A)};return b||j||E||D?a.jsxs(gt,{children:[a.jsx(_,{isAppContentDrawerOpen:c,handleDrawerToggle:T}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:j,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:P,onClickMenuIcon:()=>{T(!0)}})]}):a.jsx(N,{})},ht=B.div`
17
+ `,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=A(e);return{bankSetupView:Te(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(W(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ze(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=O(),l=H(),o=M(),{tenantEmailDomain:i}=F(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((w=>A(w))),p=C((w=>w.settingsViewState.bankConnection.fetchState)),b=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Me(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,_=ye(m,t,s),D=_e(m,r?.loggedInUserRoleMap)&&_,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Re(!1)))}),[h,o,p]);const T=w=>{u(w)};return b||P||E||D?a.jsxs(gt,{children:[a.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:T}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{T(!0)}})]}):a.jsx(N,{})},ht=B.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-CSh_vLcI.js";import{a as d}from"./sentry-BbRn6Rp
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ct=H((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Fe(e,o),{uiState:t}=n,s=(W(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(X(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(qe(n))},updateCardPaymentModalState:n=>{e(He({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(Ke(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Oe({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Kn),yt=()=>{const e=F(),l=K(),o=M(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((P=>w(P))),S=C((P=>P.cardPaymentViewState)),m=C((P=>P.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Ne(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o($())}),[p,b]);const j=P=>{n(P)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(_,{isAppContentDrawerOpen:r,handleDrawerToggle:j}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Y="external_integrations",St=H((function(e){const l=Je(e,Y);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,z("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Xe(t,s,z(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(We(t,z("payments"),s))},onNotifyMe:s=>{q.trackIntegrationsNotifyMeClicked("Settings",s),e(Ye(Y,s,r))}}}))(qn),bt=()=>{const e=Hn(),l=F(),o=M(),{tenantEmailDomain:i}=O(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=L(),m=W(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(Qe(Y))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>ze(I,u))),j=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:P,onAddPlaidAccount:R,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:P,onAddPlaidAccount:R,onReLoginPlaidAccount:D,plaidConnectionDetails:j})]}):a.jsx(ne,{fetchState:s})},It=B.div`
25
+ `,Ct=K((function(e,l){const{companyId:o}=l,i=A(e),r=l.roleMap.bill_pay_admin,n=Oe(e,o),{uiState:t}=n,s=(X(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(W(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(qe(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Fe({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=O(),l=H(),o=M(),{tenantEmailDomain:i}=F(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>A(j))),S=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Ne(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o($())}),[p,b]);const P=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Y="external_integrations",St=K((function(e){const l=Qe(e,Y);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,J("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(We(t,s,J(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Xe(t,J("payments"),s))},onNotifyMe:s=>{q.trackIntegrationsNotifyMeClicked("Settings",s),e(Ye(Y,s,r))}}}))(qn),bt=()=>{const e=Kn(),l=O(),o=M(),{tenantEmailDomain:i}=F(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>A(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=L(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Y))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>Je(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:_,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:_,onReLoginPlaidAccount:D,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-CSh_vLcI.js";import{a as d}from"./sentry-BbRn6Rp
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,Et=()=>{const e=M(),{tenantEmailDomain:l}=O(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(X(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(_,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(Qn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
41
+ `,Et=()=>{const e=M(),{tenantEmailDomain:l}=F(),[o,i]=d.useState(!1),r=C((p=>A(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(W(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(R,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-CSh_vLcI.js";import{a as d}from"./sentry-BbRn6Rp
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,ce=({appContent:e})=>{const l=M(),o=F(),i=K(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(V.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(V.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),j=!g&&b,P=ye(t,S,m),{isCardsHidden:R}=Se(t?.tenantId),D=!P||R,{areTenantIdsInSync:I}=zn();d.useEffect((()=>{I&&l(ln(c,j))}),[c,l,j,I]);const x=C((y=>cn(y,j))),T=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(_,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:T,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const Z=(function(ke,Pe){let Q=`/${ke}/settings/my_profile`;return Q=Q.concat(`/new/${Pe}`),Q})(s,y),Ee=Yn(i.state?.pathnameStackToGoBack,i.pathname);o(Z,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const Z={...x.myProfileLocalData,phone:y};l(oe({localData:Z})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,Z)=>{l(un(y,Z,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&v.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function Pt(){const e=M(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),j=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const P=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,y)=>{e(Pn({eventId:f,channel:re(U),enabled:y}))}),[e]),I=d.useCallback(((f,U)=>{e(jn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,y)=>{e(wn({groupId:f,channel:re(U),enabled:y}))}),[e]),T=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(_,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Wn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:j,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:P,resetUpdateStatus:R,taskNotifications:T,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>w(b))),n=L(),t=Ie(),s=M(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(V.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Mn(r)?a.jsxs(J,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Xn,{})}),_n(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(jt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Tn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Zn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Nn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Fn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(Pt,{})}),a.jsx(k,{path:"*",element:a.jsx(N,{})})]}):a.jsx(J,{children:a.jsx(k,{path:"*",element:a.jsx(N,{})})}):null}function jt(e){return a.jsxs(J,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(N,{})}),a.jsx(k,{path:"*",element:a.jsx(N,{})})]})}export{da as default};
49
+ `,ce=({appContent:e})=>{const l=M(),o=O(),i=H(),[r,n]=d.useState(!1),t=C((y=>A(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(V.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(V.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),P=!g&&b,j=ye(t,S,m),{isCardsHidden:_}=Se(t?.tenantId),D=!j||_,{areTenantIdsInSync:I}=Jn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((y=>cn(y,P))),T=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,w=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Qn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:w===!1,onClickMenuIcon:()=>{U(!0)},isLoading:T,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const Z=(function(ke,je){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${je}`),z})(s,y),Ee=Yn(i.state?.pathnameStackToGoBack,i.pathname);o(Z,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const Z={...x.myProfileLocalData,phone:y};l(oe({localData:Z})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,Z)=>{l(un(y,Z,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&v.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function jt(){const e=M(),l=C((f=>A(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),_=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,y)=>{e(jn({eventId:f,channel:re(U),enabled:y}))}),[e]),I=d.useCallback(((f,U)=>{e(Pn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,y)=>{e(An({groupId:f,channel:re(U),enabled:y}))}),[e]),T=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const w=d.useRef(i);return d.useEffect((()=>{w.current!==i&&(e(wn()),e(Dn()),e(G()),w.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(R,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:_,taskNotifications:T,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>A(b))),n=L(),t=Ie(),s=M(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(V.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Mn(r)?a.jsxs(Q,{children:[_n(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Wn,{})}),Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Tn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Zn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Nn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),On(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(N,{})})]}):a.jsx(Q,{children:a.jsx(k,{path:"*",element:a.jsx(N,{})})}):null}function Pt(e){return a.jsxs(Q,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(N,{})}),a.jsx(k,{path:"*",element:a.jsx(N,{})})]})}export{da as default};