@zeniai/web-app-ui 5.1.51-qa → 5.1.52-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/assets/AddressRoutes-odXkPzQ0.js +1 -0
  2. package/dist/assets/{AddressScreen-DHENiPsE.js → AddressScreen-BJ-IOcKb.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-BDeqJ8PX.js → AiCfoScreen-CRoxnDRU.js} +5 -5
  4. package/dist/assets/{BillPayApprovalRoutes-re8xxMBE.js → BillPayApprovalRoutes-BWlPp4gg.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BKu8tYXF.js → BillPayRoutes-BcERL4gz.js} +8 -8
  6. package/dist/assets/{BusinessVerificationPageScreen-7ydI8UR9.js → BusinessVerificationPageScreen-DWX7ySZI.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-QyowC-mN.js → CardsAiCfoScreen-DEKa5Xew.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-BbZEL-b5.js → ChargeCardRoutes-FSWFOO49.js} +10 -10
  9. package/dist/assets/{CompanyPassportScreen-AZhDXSZE.js → CompanyPassportScreen-CrpUoXvt.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-DDij7-L5.js → ConnectionAuthScreen-DDK9ow_u.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-CDJwl_XS.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-COHKYeEq.js → CustomerOnboardingRoutes-BdqZkh_s.js} +4 -4
  13. package/dist/assets/{DashboardRoutes-B1cE2wJc.js → DashboardRoutes-BGmqy8sI.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-DivCz85L.js → DefaultTenantHome-dUxiOroS.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-BA2EKhEI.js +18 -0
  16. package/dist/assets/DrawerScreen-BSfM66hM.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-VUYCsTyx.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-pmgLYKV-.js → ExpenseAutomationRoutes-Baf_deUk.js} +3 -3
  19. package/dist/assets/FeaturePreviewScreen-DoKDdD4M.js +1 -0
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-BrjX8V0E.js → HubSpotOAuthCallbackScreen-DLXvcbO1.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-Dn4g326h.js → MagicLinkRoutes-NK00hAHs.js} +9 -9
  22. package/dist/assets/MagicLinkSignInScreen-DnxlEFNW.js +12 -0
  23. package/dist/assets/{MobileAppDrawer-CjoW3Rax.js → MobileAppDrawer-BzOopfIc.js} +1 -1
  24. package/dist/assets/NotFoundScreen-6vyCFr5S.js +1 -0
  25. package/dist/assets/{NotificationRoutes-DE-Z8DSv.js → NotificationRoutes-BfWTxi_L.js} +1 -1
  26. package/dist/assets/OAuthConsentScreen-DKtWI-tp.js +1 -0
  27. package/dist/assets/{PandLWithForecastRoutes-C3Yczwgv.js → PandLWithForecastRoutes-DgT8jx_6.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-ZidIbEdd.js → PeopleRoutes-Cd2xa-tF.js} +3 -3
  29. package/dist/assets/PerformanceRoutes-xYB_POFo.js +1 -0
  30. package/dist/assets/{Preview-OiplHjn8.js → Preview-BBgrn4cd.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-B8QVReQm.js → QBOConnectionScreen-DiXbUmxS.js} +1 -1
  32. package/dist/assets/{ReferralListScreen-Cnd7u4T9.js → ReferralListScreen-BFHfgY0C.js} +2 -2
  33. package/dist/assets/ReimbursementApprovalRoutes-BYBFJrYx.js +1 -0
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BgYFphfr.js → ReimbursementApprovalRuleDetailScreen-DiIBy_Kn.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-BeD0lwna.js → ReimbursementRoutes-Byj4p7dn.js} +5 -5
  36. package/dist/assets/{ReportsRoutes-CPI-jy1F.js → ReportsRoutes-urJtOHDo.js} +1 -1
  37. package/dist/assets/RewardsRoutes-CHiDiriW.js +1 -0
  38. package/dist/assets/{ScreenRoutes-B24ySlpK.js → ScreenRoutes-DgHGyuTa.js} +2 -2
  39. package/dist/assets/SettingsRoutes-B9XEOz3c.js +57 -0
  40. package/dist/assets/{SetupPagesScreen-DtddTp_T.js → SetupPagesScreen-DiqU6iZv.js} +5 -5
  41. package/dist/assets/SignInScreen-DqVi8QMM.js +1 -0
  42. package/dist/assets/{SignOutScreen-Djs9TXWR.js → SignOutScreen-BcKxVgCr.js} +1 -1
  43. package/dist/assets/{TaskListScreen-DMgU1v4z.js → TaskListScreen-CIIrTWF0.js} +2 -2
  44. package/dist/assets/{TaskRoutes-Cmtr7KFm.js → TaskRoutes-C3BwKdkV.js} +2 -2
  45. package/dist/assets/{TransactionDetailRoutes-CjrDVjtT.js → TransactionDetailRoutes-L60jmvh4.js} +1 -1
  46. package/dist/assets/TransactionDetailScreen-BHKf3UvG.js +5 -0
  47. package/dist/assets/{TransactionListRoutes-uZihQK3F.js → TransactionListRoutes-B8V8eaVr.js} +1 -1
  48. package/dist/assets/{TreasuryRoutes-ZtY_hGM6.js → TreasuryRoutes-BIv9NJIQ.js} +6 -6
  49. package/dist/assets/{VendorsRoutes-DcUkIEvd.js → VendorsRoutes-CInyDoSC.js} +1 -1
  50. package/dist/assets/WiseConfirmationScreen-DmiV73IN.js +12 -0
  51. package/dist/assets/{ZeniAccountRoutes-Cbm2k-08.js → ZeniAccountRoutes-CbhJXy_a.js} +11 -11
  52. package/dist/assets/ZeniAccountStatementScreen-BuDvio8F.js +9 -0
  53. package/dist/assets/{accountMappingHelper-DDqSB3xQ.js → accountMappingHelper-DoYWzqd9.js} +1 -1
  54. package/dist/assets/{analytics-DoyQ8ezf.js → analytics-DVTbnjlr.js} +1 -1
  55. package/dist/assets/{analyticsHelper-CvGdvadP.js → analyticsHelper-CfMFPPIh.js} +1 -1
  56. package/dist/assets/{core-CQnSJ9vO.js → core-k_c8SCBE.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-BprI0TcI.js → decodeURIComponentSafe-ClSfwHJC.js} +1 -1
  58. package/dist/assets/{dnd-DoHm848q.js → dnd-CKEs-Nbe.js} +1 -1
  59. package/dist/assets/{empty-BZMPWXIo.js → empty-CaaFsHZq.js} +1 -1
  60. package/dist/assets/{empty-DjW_4H8B.js → empty-rBU__xZH.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-CD9clJu_.js → emptyVideoElement-BiPjnR5F.js} +1 -1
  62. package/dist/assets/{epic-2G17lmbK.js → epic-BY3t4hzo.js} +2 -2
  63. package/dist/assets/getLocaleForTenant-CTwYyvWj.js +1 -0
  64. package/dist/assets/{index-BtlQ6O6E.js → index-B0M_M2si.js} +1 -1
  65. package/dist/assets/{index-W83PhAZh.js → index-B4wUHn-k.js} +12999 -13025
  66. package/dist/assets/{index-CF7DasjB.js → index-C9JBC9EP.js} +1 -1
  67. package/dist/assets/{index-Ci7GqulV.js → index-CAPOi0Fj.js} +1 -1
  68. package/dist/assets/{index-C6MtcitK.js → index-CBl-jehm.js} +1 -1
  69. package/dist/assets/{index-B6GtF9yZ.js → index-CrxfuqRy.js} +2 -2
  70. package/dist/assets/{index-DgHQU_66.js → index-D7n4W-6R.js} +1 -1
  71. package/dist/assets/{index-KsPtT3xm.js → index-_Ds-L3qG.js} +1 -1
  72. package/dist/assets/{lexical-WXHH1XHj.js → lexical-k-PQZXkn.js} +1 -1
  73. package/dist/assets/{liveblocks-DvKPzrwo.js → liveblocks-D3ESVZyk.js} +1 -1
  74. package/dist/assets/{lottie-DNsrs-P3.js → lottie-BYni7Ovk.js} +1 -1
  75. package/dist/assets/{mui-sKCdI-e6.js → mui-UJrLjp1k.js} +1 -1
  76. package/dist/assets/{pathToGoBack-DDBtlyQ4.js → pathToGoBack-D0Z5Ycmy.js} +1 -1
  77. package/dist/assets/{pdf-iXI4qQyj.js → pdf-CaeTpLUv.js} +4 -4
  78. package/dist/assets/{pdf-lib-C9eLuUx2.js → pdf-lib-Cgly_u4z.js} +1 -1
  79. package/dist/assets/{plaid-BOu_8LCE.js → plaid-B1j5PXHV.js} +1 -1
  80. package/dist/assets/{pusher-BxMucY8d.js → pusher-IzmLENf0.js} +1 -1
  81. package/dist/assets/{react-BfWAIeRe.js → react-BPazXlgj.js} +1 -1
  82. package/dist/assets/{react-Bfv7BUzV.js → react-BhDdWL-M.js} +1 -1
  83. package/dist/assets/{react-CHbhfie6.js → react-Cbn9UGi3.js} +1 -1
  84. package/dist/assets/{react-DW2tK8z_.js → react-D9CNJCXY.js} +1 -1
  85. package/dist/assets/{react-BY08R1tD.js → react-RV2byy3l.js} +1 -1
  86. package/dist/assets/{react-DVBLaOmV.js → react-iNsCZPRe.js} +1 -1
  87. package/dist/assets/{recharts-Cv5d-Vxs.js → recharts-Q-kkTNuO.js} +1 -1
  88. package/dist/assets/{routePaths-stnXzrYV.js → routePaths-ooqctjvV.js} +1 -1
  89. package/dist/assets/{sentry-Be8twC83.js → sentry-B_92GPgU.js} +1 -1
  90. package/dist/assets/{url-CuDHWvgT.js → url-CGw_V4gG.js} +1 -1
  91. package/dist/assets/{url-AlENSCVt.js → url-DLQKrj-e.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CKfyn0VP.js → useAiCfoDashboardSuggestedQuestionsChips-Cx3WWldL.js} +1 -1
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-BJGg886y.js +1 -0
  94. package/dist/assets/useCashManagementBanner-Cjm3Ayi5.js +1 -0
  95. package/dist/assets/{useDeviceId-KC-rY1dP.js → useDeviceId-BE1s-3Wf.js} +1 -1
  96. package/dist/assets/{useInitialThreadRequest-BDAn-AM4.js → useInitialThreadRequest-C_cJhQDA.js} +1 -1
  97. package/dist/assets/{utils-BcJ2NV01.js → utils-Mjhh9T8E.js} +1 -1
  98. package/dist/assets/withTransactionSidePanel-3cc8um6s.js +21 -0
  99. package/dist/assets/{zeni-epic-state-DKeO4Z0C.js → zeni-epic-state-C3zBO1No.js} +4 -4
  100. package/dist/index.html +1 -1
  101. package/package.json +3 -3
  102. package/dist/assets/AddressRoutes-gPXkxz7s.js +0 -1
  103. package/dist/assets/CustomerOnboardingAuthScreen-DO3NyaR6.js +0 -1
  104. package/dist/assets/DomesticWireDetailScreen-Bx2DINVR.js +0 -18
  105. package/dist/assets/DrawerScreen-BtLrlXnn.js +0 -1
  106. package/dist/assets/EntityDetailRoutes-CTo7No6n.js +0 -1
  107. package/dist/assets/FeaturePreviewScreen-9NvuDbvP.js +0 -1
  108. package/dist/assets/MagicLinkSignInScreen-CTkVv0M2.js +0 -12
  109. package/dist/assets/NotFoundScreen-FcrdBNP0.js +0 -1
  110. package/dist/assets/OAuthConsentScreen-Swpq9wju.js +0 -1
  111. package/dist/assets/PerformanceRoutes-VzYGFOXy.js +0 -1
  112. package/dist/assets/ReimbursementApprovalRoutes-DOhkjING.js +0 -1
  113. package/dist/assets/RewardsRoutes-Vdol6ACr.js +0 -1
  114. package/dist/assets/SettingsRoutes-D7qVKl5_.js +0 -57
  115. package/dist/assets/SignInScreen-u3NwSgsj.js +0 -1
  116. package/dist/assets/TransactionDetailScreen-ABqf1zzA.js +0 -5
  117. package/dist/assets/WiseConfirmationScreen-DYcjQlfc.js +0 -12
  118. package/dist/assets/ZeniAccountStatementScreen-Ciuw5n7i.js +0 -9
  119. package/dist/assets/getLocaleForTenant-CAvD8CfA.js +0 -1
  120. package/dist/assets/useAskAiCfoHostNavButtonProps-DAlpTVgV.js +0 -1
  121. package/dist/assets/useCashManagementBanner-D8slgHwh.js +0 -1
  122. package/dist/assets/withTransactionSidePanel-B9fglQqM.js +0 -21
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-DvKPzrwo.js";import{h as Q,g as Y,u as ee,i as W,j as _,N as j,n as G,t as Ye}from"./core-CQnSJ9vO.js";import{bJ as en,cp as Ie,Pq as ye,eW as V,cB as nn,zk as $,z3 as tn,PC as an,PF as sn,ry as ne,rm as te,l0 as ae,tw as L,PH as Ae,gg as $e,gf as He,ge as We,PI as on,zt as cn,E4 as ke,DX as Pe,DU as _e,DL as J,D_ as ve,E1 as Ee,E7 as we,t_ as Te,gv as rn,cw as un,fe as dn,fc as ln,fd as pn,bs as mn,PJ as yn,CL as le,Dn as fn,PK as gn,bK as Sn,Fn as pe,Eo as bn,PL as hn,PM as Cn,Fr as In,Fv as An,tp as kn,JV as Pn,G0 as Ce,H0 as me,PN as _n,PO as vn,PP as En,PQ as Ge,PR as wn,Mm as Tn,OP as Dn,Mx as Un,PS as Ke,PT as Ve,Gm as qe,l8 as On,rp as Je,ty as Fn,bE as je,tK as Re,cz as Vn,PU as Xe,fx as xn,FK as Bn,FO as jn,PV as Rn,G3 as ze,PW as zn,PX as Nn,PY as Ln,PZ as Mn,go as Zn,AE as $n,P_ as Hn,AJ as Wn,AI as Gn}from"./zeni-epic-state-DKeO4Z0C.js";import{j as ie,H as se,x as de,m as De,aN as X,bz as Qe,z as D,w as oe,c as U,B as Ue,e as H,bA as Kn,at as ce,bB as x,bC as qn,bD as Jn,af as Be,bE as Xn,r as Ne,au as Le,K as Qn,A as Yn,bF as et,bG as nt,bH as tt,a7 as at}from"./index-W83PhAZh.js";import{a as C}from"./sentry-Be8twC83.js";import{n as xe,D as it,S as st}from"./mui-sKCdI-e6.js";import{M as fe}from"./MobileAppDrawer-CjoW3Rax.js";import N from"./NotFoundScreen-FcrdBNP0.js";import{a as Me}from"./analyticsHelper-CvGdvadP.js";import{d as Ze}from"./routePaths-stnXzrYV.js";import{B as Fe}from"./BusinessVerificationPageScreen-7ydI8UR9.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]="a43db33a-501c-4730-8007-f0990568feea",e._sentryDebugIdIdentifier="sentry-dbid-a43db33a-501c-4730-8007-f0990568feea")}catch{}})();const ot=xe.div`
1
+ import{j as u}from"./liveblocks-D3ESVZyk.js";import{h as X,g as Y,u as ee,i as W,j as _,N as j,n as H,t as Ye}from"./core-k_c8SCBE.js";import{bJ as en,cp as Ie,Pr as ye,eW as V,cB as nn,zk as $,z3 as tn,PD as an,PG as sn,ry as ne,rm as te,l0 as ae,tw as L,PI as Ae,gg as $e,gf as Ge,ge as We,PJ as on,zt as cn,E4 as ke,DX as Pe,DU as _e,DL as J,D_ as ve,E1 as Ee,E7 as we,t_ as De,gv as rn,cw as un,fe as dn,fc as ln,fd as pn,bs as mn,PK as yn,CL as le,Dn as fn,PL as gn,bK as Sn,Fn as pe,Eo as bn,PM as hn,PN as Cn,Fr as In,Fv as An,tp as kn,JV as Pn,G0 as Ce,H0 as me,PO as _n,PP as vn,PQ as En,PR as He,PS as wn,Mm as Dn,OQ as Tn,Mx as Un,PT as Ke,PU as Ve,Gm as qe,l8 as On,rp as Je,ty as Fn,bE as je,tK as Re,cz as Vn,PV as Qe,fx as xn,FK as Bn,FO as jn,PW as Rn,G3 as Ne,PX as Nn,PY as zn,PZ as Ln,P_ as Mn,go as Zn,AE as $n,P$ as Gn,AJ as Wn,AI as Hn}from"./zeni-epic-state-C3zBO1No.js";import{j as ie,N as se,x as de,m as Te,aN as Q,bz as Xe,z as T,r as oe,c as U,B as Ue,e as G,bA as Kn,at as ce,bB as x,bC as qn,bD as Jn,af as Be,bE as Qn,n as ze,au as Le,h as Xn,w as Yn,bF as et,bG as nt,bH as tt,a7 as at}from"./index-B4wUHn-k.js";import{a as C}from"./sentry-B_92GPgU.js";import{n as xe,D as it,S as st}from"./mui-UJrLjp1k.js";import{M as fe}from"./MobileAppDrawer-BzOopfIc.js";import z from"./NotFoundScreen-6vyCFr5S.js";import{a as Me}from"./analyticsHelper-CfMFPPIh.js";import{d as Ze}from"./routePaths-ooqctjvV.js";import{B as Fe}from"./BusinessVerificationPageScreen-DWX7ySZI.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]="3439180c-0cd8-4ca5-8bd7-019f763bee66",e._sentryDebugIdIdentifier="sentry-dbid-3439180c-0cd8-4ca5-8bd7-019f763bee66")}catch{}})();const ot=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-DvKPzrwo.js";import{h as Q,g as Y,u as ee,i as W
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ct=G(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=an(e),i=D.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=sn(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e($(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ve(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e($(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(a))},onAcceptUpdatedTOSSuccess:()=>{e($(a,!0))},onGetOtp:(n,i)=>{e(We(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(He(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),rt=()=>{const e=Q(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),n=en(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=se(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),f=De(),{configValue:A}=s(X.zeniAccountsConfig),d=ye(A),[y,b]=C.useState(!1),P=C.useRef(!1),[g,S]=C.useState(!1),w=_(E=>E.billPaySetupViewState.fetchState),I=_(E=>V(E)),h=_(E=>E.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:T,isLoading:k}=Qe(I?.tenantId),m=I.companyId??D.getSignedInUserTenant(a)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!I.companyBillPayInfo?.info?.isBillPayTOSAccepted,R=nn(c?.loggedInUserRoleMap);C.useEffect(()=>{P.current||w!=="Not-Started"||m==null?P.current||w!=="Completed"||m==null||I.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(P.current=!0,t($(m,!1,!0))):(P.current=!0,t($(m,!0)))},[w,m,t]),C.useEffect(()=>{g||h!=="Not-Started"||k||(S(!0),t(tn(!0,!0,T)))},[g,h,k,T,t]);const F=E=>{b(E)};if(v===!1||R&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const E=z=>z.trackPageLoaded(H.Event.billPaySetup);return u.jsxs(ot,{children:[u.jsx(oe,{analytics:U,onLoad:z=>E(z)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:F}),u.jsx(ct,{navigate:e,location:o,companyId:m,currentTenant:I,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})},Nt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,Lt=e=>`/${e}/cards`,Mt=e=>`/${e}/cards/setup`,Zt=e=>`/${e}/cards/onboard`,$t=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Ht=(e,o)=>e.find(t=>t.id===o),Wt=(e,o,t)=>!e||!o||t.fetchState==="Completed",ut=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Gt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Kt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:x(a.limit.amount),creditAccountAvailableAmount:x(a.available.amount),creditAccountSpentAmount:x(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:x(c.remainingAmountDue.amount)}:void 0,qt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>x(n.accountBalance.available.amount)),debitCardsSpend:x(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Jt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Xt=80,Qt=80,Yt=e=>e.companyId??D.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,dt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,lt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ea=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,na=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),pt=G(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=V(e),l=D.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:f,businessVerificationStatus:A}=o;return{onBusinessVerificationSectionClick:()=>{U.trackCardsVerifyIdentityCompanyDetailsClick(f,p,A?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onCardPolicySectionClick:()=>{t("../policy")},onFetchLinkTokenClick:(d,y)=>{e(Te("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,b)=>{e(Ee(d,y,"charge_cards","charge_card_setup",b))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(ve(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{U.trackCardsEnableCardsClick(f,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(J(a,"charge_cards")):i===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,y,b)=>{const P=n.allBankAccounts.find(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(S=>S.accountId===d);U.trackCardsZeniCashAccountChangeClick(f,p,{oldZeniCashAccount:P?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(b==="paymentAccount"?Pe(d,y,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const b=n.allFundingAccounts.find(S=>S.id===d),P=n.allFundingAccounts.findIndex(S=>S.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(S=>S.id===d)+1;U.trackCardsPaymentAccountChangeClick(f,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:b?.label??"",newPaymentAccountBalance:x(b?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:b?.accType==="depositAccount",oldPaymentAccountPosition:P,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ae({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(L(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(L(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(fn(a,d))}}})(qn),mt=()=>{const e=Q(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),n=_(M=>V(M)),{useDynamicConfig:i,useFeatureGate:l}=se(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(X.zeniAccountsConfig),{configValue:p}=i(X.zeniCardsConfig),f=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:A}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(de.isEarlyPayFeatureEnabled),b=_(M=>rn(M,n.companyId)),P=un(b.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,S=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,w=dn(A,n),I=dt({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:w}),h=ln(n),T=pn(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,m=lt({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:d,isBookKeepingTenant:T,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:k}),v=I&&m===!1,R=I===!1&&m,F=ye(r),E=mn(c?.loggedInUserRoleMap),z=Ie(c?.loggedInUserRoleMap),[K,ge]=C.useState(!1),[q,re]=C.useState(!1),Z=_(M=>M.chargeCardSetupViewState.fetchState),B=D.getSignedInUserTenant(a)?.companyId??n.companyId,O=D.getSignedInUser(),Oe=M=>{ge(M)},Se=_(M=>yn(M,B));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||Z!=="Not-Started"||B==null?q||Z!=="Completed"||B==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(B,!1,!0)):(re(!0),t(le(B,!0)))},[q,Z,B,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=ut(m,I,S,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{U.trackPageLoaded(H.Event.cardsSetupVisited),U.trackCardsCardSetupView(P,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:K,handleDrawerToggle:Oe}),u.jsx(pt,{autoPayThreshold:f,navigate:e,location:o,companyId:B,currentTenant:n,isEarlyPayEnabled:y,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:E,isDebitCardOnlyEnabled:v,isCreditCardOnlyEnabled:R,chargeCardSetUpView:Se,isCreditCardProductVisible:m,isDebitCardFeatureEnabled:I,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:S,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:P,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:z,accountsPromoConfig:F})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},yt=xe.div`
9
+ `,ct=H(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=an(e),i=T.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=sn(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e($(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ve(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e($(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(a))},onAcceptUpdatedTOSSuccess:()=>{e($(a,!0))},onGetOtp:(n,i)=>{e(We(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),rt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),n=en(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=se(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),f=Te(),{configValue:A}=s(Q.zeniAccountsConfig),d=ye(A),[y,b]=C.useState(!1),P=C.useRef(!1),[g,S]=C.useState(!1),w=_(E=>E.billPaySetupViewState.fetchState),I=_(E=>V(E)),h=_(E=>E.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:D,isLoading:k}=Xe(I?.tenantId),m=I.companyId??T.getSignedInUserTenant(a)?.companyId;if(T.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!I.companyBillPayInfo?.info?.isBillPayTOSAccepted,R=nn(c?.loggedInUserRoleMap);C.useEffect(()=>{P.current||w!=="Not-Started"||m==null?P.current||w!=="Completed"||m==null||I.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(P.current=!0,t($(m,!1,!0))):(P.current=!0,t($(m,!0)))},[w,m,t]),C.useEffect(()=>{g||h!=="Not-Started"||k||(S(!0),t(tn(!0,!0,D)))},[g,h,k,D,t]);const F=E=>{b(E)};if(v===!1||R&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const E=N=>N.trackPageLoaded(G.Event.billPaySetup);return u.jsxs(ot,{children:[u.jsx(oe,{analytics:U,onLoad:N=>E(N)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:F}),u.jsx(ct,{navigate:e,location:o,companyId:m,currentTenant:I,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})},zt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,Lt=e=>`/${e}/cards`,Mt=e=>`/${e}/cards/setup`,Zt=e=>`/${e}/cards/onboard`,$t=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Gt=(e,o)=>e.find(t=>t.id===o),Wt=(e,o,t)=>!e||!o||t.fetchState==="Completed",ut=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Ht=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Kt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:x(a.limit.amount),creditAccountAvailableAmount:x(a.available.amount),creditAccountSpentAmount:x(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:x(c.remainingAmountDue.amount)}:void 0,qt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>x(n.accountBalance.available.amount)),debitCardsSpend:x(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Jt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Qt=80,Xt=80,Yt=e=>e.companyId??T.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,dt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,lt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ea=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,na=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),pt=H(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=V(e),l=T.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:f,businessVerificationStatus:A}=o;return{onBusinessVerificationSectionClick:()=>{U.trackCardsVerifyIdentityCompanyDetailsClick(f,p,A?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onCardPolicySectionClick:()=>{t("../policy")},onFetchLinkTokenClick:(d,y)=>{e(De("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,b)=>{e(Ee(d,y,"charge_cards","charge_card_setup",b))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(ve(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{U.trackCardsEnableCardsClick(f,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(J(a,"charge_cards")):i===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,y,b)=>{const P=n.allBankAccounts.find(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(S=>S.accountId===d);U.trackCardsZeniCashAccountChangeClick(f,p,{oldZeniCashAccount:P?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(b==="paymentAccount"?Pe(d,y,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const b=n.allFundingAccounts.find(S=>S.id===d),P=n.allFundingAccounts.findIndex(S=>S.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(S=>S.id===d)+1;U.trackCardsPaymentAccountChangeClick(f,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:b?.label??"",newPaymentAccountBalance:x(b?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:b?.accType==="depositAccount",oldPaymentAccountPosition:P,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ae({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(L(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(L(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(fn(a,d))}}})(qn),mt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),n=_(M=>V(M)),{useDynamicConfig:i,useFeatureGate:l}=se(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(Q.zeniAccountsConfig),{configValue:p}=i(Q.zeniCardsConfig),f=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:A}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(de.isEarlyPayFeatureEnabled),b=_(M=>rn(M,n.companyId)),P=un(b.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,S=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,w=dn(A,n),I=dt({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:w}),h=ln(n),D=pn(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,m=lt({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:d,isBookKeepingTenant:D,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:k}),v=I&&m===!1,R=I===!1&&m,F=ye(r),E=mn(c?.loggedInUserRoleMap),N=Ie(c?.loggedInUserRoleMap),[K,ge]=C.useState(!1),[q,re]=C.useState(!1),Z=_(M=>M.chargeCardSetupViewState.fetchState),B=T.getSignedInUserTenant(a)?.companyId??n.companyId,O=T.getSignedInUser(),Oe=M=>{ge(M)},Se=_(M=>yn(M,B));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||Z!=="Not-Started"||B==null?q||Z!=="Completed"||B==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(B,!1,!0)):(re(!0),t(le(B,!0)))},[q,Z,B,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=ut(m,I,S,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{U.trackPageLoaded(G.Event.cardsSetupVisited),U.trackCardsCardSetupView(P,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:K,handleDrawerToggle:Oe}),u.jsx(pt,{autoPayThreshold:f,navigate:e,location:o,companyId:B,currentTenant:n,isEarlyPayEnabled:y,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:E,isDebitCardOnlyEnabled:v,isCreditCardOnlyEnabled:R,chargeCardSetUpView:Se,isCreditCardProductVisible:m,isDebitCardFeatureEnabled:I,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:S,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:P,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:N,accountsPromoConfig:F})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},yt=xe.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-DvKPzrwo.js";import{h as Q,g as Y,u as ee,i as W
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,ft=G(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=hn(e),i=Cn(e,a),l=D.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,description:d}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(In(a)),U.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ve(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Jn),gt=()=>{const e=Q(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),{useDynamicConfig:n}=se(),i=De(),{configValue:l}=n(X.zeniAccountsConfig),s=ye(l),r=Sn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[f,A]=C.useState(!1),d=C.useRef(!1),[y,b]=C.useState(!1),P=_(m=>m.remiSetupViewState.fetchState),g=_(m=>V(m)),S=_(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:w,isLoading:I}=Qe(g?.tenantId),h=D.getSignedInUserTenant(a)?.companyId??g.companyId,T=D.getSignedInUser(),k=m=>{A(m)};if(T==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||P!=="Not-Started"||h==null?d.current||P!=="Completed"||h==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(h,!1,!0))):(d.current=!0,t(pe(h,!0)))},[P,h,t]),C.useEffect(()=>{y||S!=="Not-Started"||I||(b(!0),t(bn(!0,!1,!1,w)))},[y,S,I,w,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded(H.Event.reimbursementSetup);return u.jsxs(yt,{children:[u.jsx(oe,{analytics:U,onLoad:v=>m(v)}),u.jsx(fe,{isAppContentDrawerOpen:f,handleDrawerToggle:k}),u.jsx(ft,{navigate:e,location:o,companyId:h,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{k(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},St=G(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Tn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Dn(e.companyConfigState),p=Un(e.userRoleConfigState),f=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:f}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:f,companyLegalName:A,companyTaxId:d,companyWebsite:y,companyPhone:b,primaryContactEmail:P,primaryContactName:g,primaryContactUserId:S,primaryContactSyncToken:w,syncToken:I,fileIds:h,incDate:T,typeOfIncorporation:k,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:R,countriesOfOperations:F,companySourceOfFunds:E,companySourceOfFundsDescription:z,transactionVolume:K,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:B,usNexus:O,usNexusTypes:Oe}=s,Se=f?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:A,taxIdOrEIN:d,website:y!=""&&y!=null?Vn(y):void 0,phone:b,syncToken:I,fileIds:h,incDate:T!=null?je(T?.toString()):T,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:R?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:E?.selectedOption??"",companySourceOfFundsDescription:z,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:B,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:S,firstName:g.firstName,lastName:g.lastName,email:P,syncToken:w};e(Re({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:f,userId:A,name:d,email:y,nationalityCountryCode:b,ssn:P,dob:g,phone:S,syncToken:w,selectDocument:I,role:h,ownership:T,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R}=p;let F;return I.selectDocumentType==="driverLicense"?F="driving_license":I.selectDocumentType==="passport"?F="passport":I.selectDocumentType==="stateId"?F="id_document":I.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:f,userId:A,firstName:d.firstName,lastName:d.lastName,email:y,ssn:P,nationalityCountryCode:b?.selectedOption!=null?Le(b.selectedOption):void 0,phone:S,birthday:g!=null?je(g?.toString()):g,syncToken:w,titleAtCompany:h.selectedOption,ownershipInCompany:T,documentTypeSelectedForVerification:F,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Re({officers:r}))},onSaveDetailsClick:s=>{e(L(t,s,a))},onSendForVerificationClick:s=>{e(L(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=Ne(i.state?.pathnameStackToGoBack,i.pathname),f=new URLSearchParams(i.search),A={};f.forEach((d,y)=>{A[y]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=Ne(i.state?.pathnameStackToGoBack,i.pathname),f=new URLSearchParams(i.search),A=Object.fromEntries(f.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onBackClick:()=>{e(Fn({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ne(s,r.split(".")[0]))},onGetOtp:s=>{e(We(s,"SpendManagementSetup"))},onResendOtp:s=>{e(He(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(On({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(Ve())}}})(Xn),bt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Q(),c=Y(),n=ee(),[i]=Ye(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:f}=W(),A=ie(),{useDynamicConfig:d}=se(),y=De(),{configValue:b}=d(X.zeniAccountsConfig),P=ye(b),g=_(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),S=_(m=>m.companyConfigState.fetchState),w=_(m=>m.userRoleConfigState.fetchState),I=_(m=>V(m)),h=I.companyId??D.getSignedInUserTenant(f)?.companyId;if(C.useEffect(()=>{S==="Not-Started"&&n(kn()),w==="Not-Started"&&n(Pn(!0))},[S,w,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&h!=null)switch(p(!0),e){case"zeni_accounts":n(me(h,!0));break;case"zeni_treasury":n(Ce(h,!0));break;case"reimbursement":n(pe(h,!0));break;case"charge_cards":n(le(h,!0));break;default:n($(h,!0))}},[r,g,h,n]),D.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let T;switch(e){case"zeni_accounts":T=I.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":T=I.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":T=I.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||I.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":T=I.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:T=I.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=_(m=>{let v;switch(e){case"zeni_accounts":v=wn(m,h);break;case"zeni_treasury":v=Ge(m,h);break;case"charge_cards":v=En(m,h);break;case"reimbursement":v=vn(m,h);break;default:v=_n(m,h)}return v});return T===!1?null:k.fetchState==="Completed"&&T===!0&&A?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded(H.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded(H.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded(H.Event.billPayBusinessVerification,Be(c)?"Settings":void 0)}})(m)}),u.jsx(St,{businessVerificationDetails:k,navigate:a,location:c,companyId:h,analytics:U,currentTenant:I,productType:e,roleMap:A.loggedInUserRoleMap,isSettings:Be(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:P.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},ht={overlayWidth:new Yn(100,100,59)},Ct=G(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),i=D.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Xe(e,a),p=Ge(e,a),f=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",A=Rn(e),d=A.transactions,y=Ke(e),b=A.accountSummary?.totalBalance?.amount,P=d.length===0||b===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:y,isFirstTransfer:P,isDisabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Ln(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(Te("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(ve(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?Pe(s,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(L(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(ze(!1))}r===!0&&e(qe())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,r)=>{e(ne(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(Nn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(zn(s))},onConfirmFundAllocation:()=>{e(ze(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Ve())}}})(et),It=()=>{const e=Q(),o=Y(),t=ee(),a=De(),c=Qn(),{tenantEmailDomain:n}=W(),{useDynamicConfig:i}=se(),l=ie(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:f}=i(X.zeniAccountsConfig),A=ye(f),[d,y]=C.useState(!1),[b,P]=C.useState(!1),[g,S]=C.useState(!1),[w,I]=C.useState(!1),[h,T]=C.useState(!1),k=_(O=>O.treasurySetupViewState.fetchState),m=_(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),v=_(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),R=_(O=>O.treasuryDetailState.transactionsState?.fetchState),F=_(O=>V(O)),E=D.getSignedInUserTenant(n)?.companyId??F.companyId,z=_(O=>Xe(O,E)),K=z.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=D.getSignedInUser(),re=O=>{y(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{b||k!=="Not-Started"||E==null||(P(!0),t(Ce(E,!0,!1)))},[b,k,E,t]),C.useEffect(()=>{g||m!=="Not-Started"||E==null||(S(!0),t(xn()))},[g,m,E,t]),C.useEffect(()=>{w||v!=="Not-Started"||E==null||(I(!0),t(Bn()))},[w,v,E,t]),C.useEffect(()=>{h||R!=="Not-Started"||E==null||(T(!0),t(jn(!0)))},[h,R,E,t]);const Z=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,B=Z==="pending_review"||Z==="verified";return C.useEffect(()=>{s||k!=="Completed"||K||B||!o.pathname.includes("setup")||r(!0)},[k,K,B]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(it,{onClose:()=>{t(Ve()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(At,{onClick:O=>O.stopPropagation(),children:u.jsx(bt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ve()),e("../setup")}})})}),u.jsx(Ct,{navigate:e,location:o,companyId:E,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:A,isAccountsEnabled:ge,isAllocationDone:K,analytics:U,treasurySetupView:z,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},At=xe(st)`
17
+ `,ft=H(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=hn(e),i=Cn(e,a),l=T.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,description:d}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(In(a)),U.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ve(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Jn),gt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),{useDynamicConfig:n}=se(),i=Te(),{configValue:l}=n(Q.zeniAccountsConfig),s=ye(l),r=Sn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[f,A]=C.useState(!1),d=C.useRef(!1),[y,b]=C.useState(!1),P=_(m=>m.remiSetupViewState.fetchState),g=_(m=>V(m)),S=_(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:w,isLoading:I}=Xe(g?.tenantId),h=T.getSignedInUserTenant(a)?.companyId??g.companyId,D=T.getSignedInUser(),k=m=>{A(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||P!=="Not-Started"||h==null?d.current||P!=="Completed"||h==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(h,!1,!0))):(d.current=!0,t(pe(h,!0)))},[P,h,t]),C.useEffect(()=>{y||S!=="Not-Started"||I||(b(!0),t(bn(!0,!1,!1,w)))},[y,S,I,w,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded(G.Event.reimbursementSetup);return u.jsxs(yt,{children:[u.jsx(oe,{analytics:U,onLoad:v=>m(v)}),u.jsx(fe,{isAppContentDrawerOpen:f,handleDrawerToggle:k}),u.jsx(ft,{navigate:e,location:o,companyId:h,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{k(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},St=H(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=T.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Tn(e.companyConfigState),p=Un(e.userRoleConfigState),f=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:f}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:f,companyLegalName:A,companyTaxId:d,companyWebsite:y,companyPhone:b,primaryContactEmail:P,primaryContactName:g,primaryContactUserId:S,primaryContactSyncToken:w,syncToken:I,fileIds:h,incDate:D,typeOfIncorporation:k,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:R,countriesOfOperations:F,companySourceOfFunds:E,companySourceOfFundsDescription:N,transactionVolume:K,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:B,usNexus:O,usNexusTypes:Oe}=s,Se=f?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:A,taxIdOrEIN:d,website:y!=""&&y!=null?Vn(y):void 0,phone:b,syncToken:I,fileIds:h,incDate:D!=null?je(D?.toString()):D,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:R?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:E?.selectedOption??"",companySourceOfFundsDescription:N,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:B,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:S,firstName:g.firstName,lastName:g.lastName,email:P,syncToken:w};e(Re({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:f,userId:A,name:d,email:y,nationalityCountryCode:b,ssn:P,dob:g,phone:S,syncToken:w,selectDocument:I,role:h,ownership:D,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R}=p;let F;return I.selectDocumentType==="driverLicense"?F="driving_license":I.selectDocumentType==="passport"?F="passport":I.selectDocumentType==="stateId"?F="id_document":I.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:f,userId:A,firstName:d.firstName,lastName:d.lastName,email:y,ssn:P,nationalityCountryCode:b?.selectedOption!=null?Le(b.selectedOption):void 0,phone:S,birthday:g!=null?je(g?.toString()):g,syncToken:w,titleAtCompany:h.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Re({officers:r}))},onSaveDetailsClick:s=>{e(L(t,s,a))},onSendForVerificationClick:s=>{e(L(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),f=new URLSearchParams(i.search),A={};f.forEach((d,y)=>{A[y]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),f=new URLSearchParams(i.search),A=Object.fromEntries(f.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onBackClick:()=>{e(Fn({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ne(s,r.split(".")[0]))},onGetOtp:s=>{e(We(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(On({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(Ve())}}})(Qn),bt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=X(),c=Y(),n=ee(),[i]=Ye(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:f}=W(),A=ie(),{useDynamicConfig:d}=se(),y=Te(),{configValue:b}=d(Q.zeniAccountsConfig),P=ye(b),g=_(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),S=_(m=>m.companyConfigState.fetchState),w=_(m=>m.userRoleConfigState.fetchState),I=_(m=>V(m)),h=I.companyId??T.getSignedInUserTenant(f)?.companyId;if(C.useEffect(()=>{S==="Not-Started"&&n(kn()),w==="Not-Started"&&n(Pn(!0))},[S,w,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&h!=null)switch(p(!0),e){case"zeni_accounts":n(me(h,!0));break;case"zeni_treasury":n(Ce(h,!0));break;case"reimbursement":n(pe(h,!0));break;case"charge_cards":n(le(h,!0));break;default:n($(h,!0))}},[r,g,h,n]),T.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=I.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=I.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=I.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||I.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=I.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=I.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=_(m=>{let v;switch(e){case"zeni_accounts":v=wn(m,h);break;case"zeni_treasury":v=He(m,h);break;case"charge_cards":v=En(m,h);break;case"reimbursement":v=vn(m,h);break;default:v=_n(m,h)}return v});return D===!1?null:k.fetchState==="Completed"&&D===!0&&A?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded(G.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded(G.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded(G.Event.billPayBusinessVerification,Be(c)?"Settings":void 0)}})(m)}),u.jsx(St,{businessVerificationDetails:k,navigate:a,location:c,companyId:h,analytics:U,currentTenant:I,productType:e,roleMap:A.loggedInUserRoleMap,isSettings:Be(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:P.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},ht={overlayWidth:new Yn(100,100,59)},Ct=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),i=T.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Qe(e,a),p=He(e,a),f=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",A=Rn(e),d=A.transactions,y=Ke(e),b=A.accountSummary?.totalBalance?.amount,P=d.length===0||b===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:y,isFirstTransfer:P,isDisabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Ln(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(De("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(ve(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?Pe(s,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(L(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(Ne(!1))}r===!0&&e(qe())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,r)=>{e(ne(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(zn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(Nn(s))},onConfirmFundAllocation:()=>{e(Ne(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Ve())}}})(et),It=()=>{const e=X(),o=Y(),t=ee(),a=Te(),c=Xn(),{tenantEmailDomain:n}=W(),{useDynamicConfig:i}=se(),l=ie(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:f}=i(Q.zeniAccountsConfig),A=ye(f),[d,y]=C.useState(!1),[b,P]=C.useState(!1),[g,S]=C.useState(!1),[w,I]=C.useState(!1),[h,D]=C.useState(!1),k=_(O=>O.treasurySetupViewState.fetchState),m=_(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),v=_(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),R=_(O=>O.treasuryDetailState.transactionsState?.fetchState),F=_(O=>V(O)),E=T.getSignedInUserTenant(n)?.companyId??F.companyId,N=_(O=>Qe(O,E)),K=N.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=T.getSignedInUser(),re=O=>{y(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{b||k!=="Not-Started"||E==null||(P(!0),t(Ce(E,!0,!1)))},[b,k,E,t]),C.useEffect(()=>{g||m!=="Not-Started"||E==null||(S(!0),t(xn()))},[g,m,E,t]),C.useEffect(()=>{w||v!=="Not-Started"||E==null||(I(!0),t(Bn()))},[w,v,E,t]),C.useEffect(()=>{h||R!=="Not-Started"||E==null||(D(!0),t(jn(!0)))},[h,R,E,t]);const Z=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,B=Z==="pending_review"||Z==="verified";return C.useEffect(()=>{s||k!=="Completed"||K||B||!o.pathname.includes("setup")||r(!0)},[k,K,B]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(it,{onClose:()=>{t(Ve()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(At,{onClick:O=>O.stopPropagation(),children:u.jsx(bt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ve()),e("../setup")}})})}),u.jsx(Ct,{navigate:e,location:o,companyId:E,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:A,isAccountsEnabled:ge,isAllocationDone:K,analytics:U,treasurySetupView:N,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},At=xe(st)`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  flex-direction: column;
21
- `,kt=G(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Mn(e,a),r=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(Te("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ve(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"zeni_accounts","account_setup"):_e("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}})(nt),Pt=()=>{const e=Q(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),{useDynamicConfig:c}=se(),n=ie(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(X.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[f,A]=C.useState(!1),d=_(S=>S.zeniAccountSetupViewState.fetchState),y=_(S=>V(S)),b=D.getSignedInUserTenant(a)?.companyId??y.companyId,P=D.getSignedInUser(),g=S=>{p(S)};if(P==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{f||d!=="Not-Started"||b==null?f||d!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(b,!1,!0)):(A(!0),t(me(b,!0)))},[f,d,b,t]),y.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const S=w=>w.trackPageLoaded(H.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:w=>S(w)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(kt,{navigate:e,location:o,companyId:b,currentTenant:y,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=xe.div`
21
+ `,kt=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=T.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Mn(e,a),r=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(De("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ve(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"zeni_accounts","account_setup"):_e("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}})(nt),Pt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),{useDynamicConfig:c}=se(),n=ie(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(Q.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[f,A]=C.useState(!1),d=_(S=>S.zeniAccountSetupViewState.fetchState),y=_(S=>V(S)),b=T.getSignedInUserTenant(a)?.companyId??y.companyId,P=T.getSignedInUser(),g=S=>{p(S)};if(P==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{f||d!=="Not-Started"||b==null?f||d!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(b,!1,!0)):(A(!0),t(me(b,!0)))},[f,d,b,t]),y.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const S=w=>w.trackPageLoaded(G.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:w=>S(w)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(kt,{navigate:e,location:o,companyId:b,currentTenant:y,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=xe.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-DvKPzrwo.js";import{h as Q,g as Y,u as ee,i as W
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${e=>e.theme.colors.grey4};
29
- `,vt=G(function(e,o){const t=V(e),a=D.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:Hn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:n,analytics:U}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Gn(a))},onSubmitClick:()=>{e(Wn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ae({files:a}))},onDeleteFile:a=>{e(te(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ne(a,c.split(".")[0]))}}})(tt),Et=()=>{const e=Q(),o=Y(),t=ee(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=W(),p=ie(),{useFeatureGate:f}=se(),{isFeatureEnabled:A}=f(de.isBillPayLocalCurrencyFeatureEnabled),d=_(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),y=_(k=>k.billPaySetupViewState.fetchState),b=_(k=>V(k)),P=De(),g=b.companyId??D.getSignedInUserTenant(r)?.companyId,S=_(k=>Zn(k.companyState,b.companyId)),w=S?.company.companyBillPayInfo.internationalWireOnboardingStatus,I=w?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t($n(g)))},[a,d,g,t]),C.useEffect(()=>{n||y!=="Not-Started"||g==null||(i(!0),t($(g,!0)))},[y,n,g,t]),D.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const h=b.companyBillPayInfo?.info?.isBillPayTOSAccepted,T=k=>{s(k)};return h===!1?u.jsx(j,{to:"../promo"}):h===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(oe,{analytics:U,onLoad:k=>(m=>m.trackPageLoaded(H.Event.billPayBusinessVerification,void 0))(k)}),Be(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:T}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:U,currentTenant:b,roleMap:p.loggedInUserRoleMap,isFormReadonly:I,isLocalCurrencyEnabled:A})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:P.colors.grey5}})},wt=G(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e($(t,!0,!0))}}}}})(at(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Fe,{productType:s}):t?u.jsx(j,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Et,{}):t?u.jsx(j,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(rt,{}):t?u.jsx(j,{to:"../"}):u.jsx(N,{})}case"reimbursement":return r==="verification"?a?u.jsx(Fe,{productType:s}):u.jsx(N,{}):a?u.jsx(gt,{}):u.jsx(N,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Fe,{productType:"zeni_accounts"}):u.jsx(N,{}):c?u.jsx(Pt,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(It,{}):u.jsx(N,{});case"charge_cards":return r==="verification"?i?u.jsx(Fe,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(N,{}):i?u.jsx(mt,{}):l?u.jsx(j,{to:"../"}):u.jsx(N,{})}}));function ta(e){const{tenantEmailDomain:o}=W(),t=_(c=>V(c)).companyId??D.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(D.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(wt,{...e,companyId:t,...a})}export{Xt as A,Qt as P,ta as S,Kt as a,Jt as b,dt as c,lt as d,ut as e,Yt as f,$t as g,Lt as h,Gt as i,qt as j,ea as k,Wt as l,Ht as m,Mt as n,Zt as o,Nt as p,na as s};
29
+ `,vt=H(function(e,o){const t=V(e),a=T.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:Gn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:n,analytics:U}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Hn(a))},onSubmitClick:()=>{e(Wn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ae({files:a}))},onDeleteFile:a=>{e(te(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ne(a,c.split(".")[0]))}}})(tt),Et=()=>{const e=X(),o=Y(),t=ee(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=W(),p=ie(),{useFeatureGate:f}=se(),{isFeatureEnabled:A}=f(de.isBillPayLocalCurrencyFeatureEnabled),d=_(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),y=_(k=>k.billPaySetupViewState.fetchState),b=_(k=>V(k)),P=Te(),g=b.companyId??T.getSignedInUserTenant(r)?.companyId,S=_(k=>Zn(k.companyState,b.companyId)),w=S?.company.companyBillPayInfo.internationalWireOnboardingStatus,I=w?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t($n(g)))},[a,d,g,t]),C.useEffect(()=>{n||y!=="Not-Started"||g==null||(i(!0),t($(g,!0)))},[y,n,g,t]),T.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const h=b.companyBillPayInfo?.info?.isBillPayTOSAccepted,D=k=>{s(k)};return h===!1?u.jsx(j,{to:"../promo"}):h===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(oe,{analytics:U,onLoad:k=>(m=>m.trackPageLoaded(G.Event.billPayBusinessVerification,void 0))(k)}),Be(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:U,currentTenant:b,roleMap:p.loggedInUserRoleMap,isFormReadonly:I,isLocalCurrencyEnabled:A})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:P.colors.grey5}})},wt=H(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e($(t,!0,!0))}}}}})(at(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Fe,{productType:s}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});case"international-wire":return o?u.jsx(Et,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});default:return o?u.jsx(rt,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{})}case"reimbursement":return r==="verification"?a?u.jsx(Fe,{productType:s}):u.jsx(z,{}):a?u.jsx(gt,{}):u.jsx(z,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Fe,{productType:"zeni_accounts"}):u.jsx(z,{}):c?u.jsx(Pt,{}):u.jsx(z,{});case"zeni_treasury":return n===!0?u.jsx(It,{}):u.jsx(z,{});case"charge_cards":return r==="verification"?i?u.jsx(Fe,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(z,{}):i?u.jsx(mt,{}):l?u.jsx(j,{to:"../"}):u.jsx(z,{})}}));function ta(e){const{tenantEmailDomain:o}=W(),t=_(c=>V(c)).companyId??T.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(T.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(wt,{...e,companyId:t,...a})}export{Qt as A,Xt as P,ta as S,Kt as a,Jt as b,dt as c,lt as d,ut as e,Yt as f,$t as g,Lt as h,Ht as i,qt as j,ea as k,Wt as l,Gt as m,Mt as n,Zt as o,zt as p,na as s};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-D3ESVZyk.js";import{a as u,b as D,q as T}from"./sentry-B_92GPgU.js";import{u as A,h as z,j as d,g as M,N as O,n as j}from"./core-k_c8SCBE.js";import{u as F,z as s,m as P,c as w,D as B,d as _,e as N,K as V,g as W,R as Y,f as v}from"./index-B4wUHn-k.js";import{eW as $,Ly as q,Lz as G,fa as H,fD as J,LE as K,gn as R,cY as Q,LF as b,LG as X,LH as Z,bY as y}from"./zeni-epic-state-C3zBO1No.js";import"./mui-UJrLjp1k.js";import{u as ee}from"./useDeviceId-BE1s-3Wf.js";import{f as te}from"./analyticsHelper-CfMFPPIh.js";import{t as ne}from"./getLocaleForTenant-CTwYyvWj.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="cb012bf1-16ff-4c3f-90f8-d2ac834c3cb5",t._sentryDebugIdIdentifier="sentry-dbid-cb012bf1-16ff-4c3f-90f8-d2ac834c3cb5")}catch{}})();const ie=j(function(t,i){const c=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:c,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:c,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(c.state!=null?c.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=c.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(b())}}})(Y),ae=D.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),c=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=d(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:C,accountUnlockTime:k}=d(e=>e.tenantState),p=d(e=>e.tenantState.fetchState),E=d(e=>e.tenantState.activeTenantFetchState.fetchState),S=d(e=>e.tenantState.signInState),o=d(e=>e.tenantState.loggedInUser),r=d(e=>$(e)),I=d(e=>q(e)),m=M(),h=P().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{L.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[L.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&E!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(G(I.tenantsInOrder),o.zeniSessionId),H(o.userId,o.zeniSessionId,r.tenantId),i(J(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,h,void 0,I.tenantsInOrder),R().then(()=>{const e=W();e!=null&&_(e)}),setTimeout(()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",Q(r.productSettings))},2e3))},[S,p,E,o,r,I,h,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:c,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-DvKPzrwo.js";import{a as n}from"./sentry-Be8twC83.js";import{u,g as m,h as g,N as p}from"./core-CQnSJ9vO.js";import{z as c,B as y,t as b,c as d,e as h}from"./index-W83PhAZh.js";import{gs as x,gt as I,LW as w}from"./zeni-epic-state-DKeO4Z0C.js";import{n as j}from"./mui-sKCdI-e6.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.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]="d4c898fa-41ea-4d93-8abe-4eb34c475780",e._sentryDebugIdIdentifier="sentry-dbid-d4c898fa-41ea-4d93-8abe-4eb34c475780")}catch{}})();function $(){const e=u(),t=m(),i=g(),a=n.useRef(!1),f=c.isSignedIn(),r=t.state?.message==="logout",o=r||f;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{c.clearAll(),e(x()),e(I(!1)),w(),b.reset(),d.trackLogout(h.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
1
+ import{j as s}from"./liveblocks-D3ESVZyk.js";import{a as n}from"./sentry-B_92GPgU.js";import{u,g as m,h as g,N as p}from"./core-k_c8SCBE.js";import{z as c,B as y,t as b,c as d,e as h}from"./index-B4wUHn-k.js";import{gs as x,gt as I,LW as w}from"./zeni-epic-state-C3zBO1No.js";import{n as j}from"./mui-UJrLjp1k.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.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]="d4c898fa-41ea-4d93-8abe-4eb34c475780",e._sentryDebugIdIdentifier="sentry-dbid-d4c898fa-41ea-4d93-8abe-4eb34c475780")}catch{}})();function $(){const e=u(),t=m(),i=g(),a=n.useRef(!1),f=c.isSignedIn(),r=t.state?.message==="logout",o=r||f;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{c.clearAll(),e(x()),e(I(!1)),w(),b.reset(),d.trackLogout(h.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-DvKPzrwo.js";import{a as b}from"./sentry-Be8twC83.js";import{h as _,u as v,g as K,j as G,i as q,n as z}from"./core-CQnSJ9vO.js";import{z as x,H,x as p,_ as W,w as M,c as O,e as V,d8 as Z,r as g,q as Q}from"./index-W83PhAZh.js";import{eW as J,Th as F,IH as C,Ti as R,Td as X,I3 as y,Tj as Y,Ib as E,Hx as aa,II as S,Tk as B,f9 as ea,Iy as ta,ID as sa,Iq as oa,Io as w,IE as na,Il as ia,Tl as la,Tm as ra,Tn as ka,To as ca,Tp as T,ei as da,Tq as ua,Tr as pa}from"./zeni-epic-state-DKeO4Z0C.js";import{n as Ta}from"./mui-sKCdI-e6.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import{M as ga}from"./MobileAppDrawer-CjoW3Rax.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.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]="6615deed-6a9a-473c-bb9d-ed662f7a514b",e._sentryDebugIdIdentifier="sentry-dbid-6615deed-6a9a-473c-bb9d-ed662f7a514b")}catch{}})();const fa=Ta.div`
1
+ import{j as u}from"./liveblocks-D3ESVZyk.js";import{a as b}from"./sentry-B_92GPgU.js";import{h as _,u as v,g as K,j as G,i as z,n as q}from"./core-k_c8SCBE.js";import{z as x,N as W,x as p,_ as H,r as M,c as O,e as V,d8 as Z,n as g,p as Q}from"./index-B4wUHn-k.js";import{eW as J,Th as F,IH as C,Ti as R,Td as X,I3 as y,Tj as Y,Ib as E,Hx as aa,II as S,Tk as B,f9 as ea,Iy as ta,ID as sa,Iq as oa,Io as w,IE as na,Il as ia,Tl as la,Tm as ra,Tn as ka,To as ca,Tp as T,ei as da,Tq as ua,Tr as pa}from"./zeni-epic-state-C3zBO1No.js";import{n as Ta}from"./mui-UJrLjp1k.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-BJGg886y.js";import{M as ga}from"./MobileAppDrawer-BzOopfIc.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.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]="f7d887e0-53e5-40f8-bb0f-b0ee9d502938",e._sentryDebugIdIdentifier="sentry-dbid-f7d887e0-53e5-40f8-bb0f-b0ee9d502938")}catch{}})();const fa=Ta.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as u}from"./liveblocks-DvKPzrwo.js";import{a as b}from"./sentry-Be8twC8
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ha=z(function(e,t){const o=F(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,n=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(k))})).filter(l=>l.tasks.length>0)}:o,d=X(e),i=x.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:k,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(C(!0,d))},onTabChange:a=>{e(ca(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=I(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ka({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(C(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=Q(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(R({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Da(l,a);e(y({taskDetailLocalData:s}));const c=I(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(c,{state:{pathnameStackToGoBack:f,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(S({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(E(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(E(a,[s]))},handleNewTaskInitialization:a=>{if(e(y({taskDetailLocalData:{...Y,name:a}})),t.localData.defaultTaskGroupId!=null){const s=I(i,t.localData.defaultTaskGroupId),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(Z);function Na(){const e=_(),t=v(),o=K(),k=x.getSignedInUser(),n=G(r=>J(r)),{taskGroupId:d}=q(),{useFeatureGate:i}=H(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:c}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,j]=b.useState(!1),h=G(r=>F(r,l)),D=G(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:$,onAskAiCfoClick:N}=ma({mobileExploreReferrer:"Task Checklist"});if(W({isDataReady:m==="Completed"}),b.useEffect(()=>{t(C(!1,l))},[n?.tenantId,t,l]),b.useEffect(()=>{m==="Completed"&&t(R({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[m==="Completed"?u.jsx(M,{analytics:O,onLoad:r=>(U=>U.trackPageLoaded(V.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{j(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:$,onAskAiCfoClick:N})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,I=(e,t)=>`/${e}/tasks/new/${t}`,Da=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{Na as default};
9
+ `,ha=q(function(e,t){const o=F(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,n=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(k))})).filter(l=>l.tasks.length>0)}:o,d=X(e),i=x.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:k,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(C(!0,d))},onTabChange:a=>{e(ca(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=I(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ka({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(C(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=Q(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(R({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Da(l,a);e(y({taskDetailLocalData:s}));const c=I(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(c,{state:{pathnameStackToGoBack:f,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(S({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(E(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(E(a,[s]))},handleNewTaskInitialization:a=>{if(e(y({taskDetailLocalData:{...Y,name:a}})),t.localData.defaultTaskGroupId!=null){const s=I(i,t.localData.defaultTaskGroupId),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(Z);function $a(){const e=_(),t=v(),o=K(),k=x.getSignedInUser(),n=G(r=>J(r)),{taskGroupId:d}=z(),{useFeatureGate:i}=W(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:c}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,j]=b.useState(!1),h=G(r=>F(r,l)),D=G(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:$}=ma({mobileExploreReferrer:"Task Checklist"});if(H({isDataReady:m==="Completed"}),b.useEffect(()=>{t(C(!1,l))},[n?.tenantId,t,l]),b.useEffect(()=>{m==="Completed"&&t(R({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[m==="Completed"?u.jsx(M,{analytics:O,onLoad:r=>(U=>U.trackPageLoaded(V.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{j(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:N,onAskAiCfoClick:$})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,I=(e,t)=>`/${e}/tasks/new/${t}`,Da=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{$a as default};
@@ -1,4 +1,4 @@
1
- import{j as n}from"./liveblocks-DvKPzrwo.js";import se from"./NotFoundScreen-FcrdBNP0.js";import{a as c}from"./sentry-Be8twC83.js";import{h as _,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-CQnSJ9vO.js";import{HK as Z,HN as le,HH as de,eW as M,Td as W,H$ as K,HE as pe,Iv as ue,Io as ke,Te as Q,Tf as N,HA as me,Hx as fe,ry as ge,rm as he,l0 as Se,HV as Ie,Tg as Te,Ia as be,I7 as Ee,HQ as Ce,I4 as Ge,I3 as De}from"./zeni-epic-state-DKeO4Z0C.js";import{z as G,d6 as xe,W as ye,H as je,x as b,q as X,r as v,w as we,c as V,e as ve,d7 as Re,h as z,at as Fe}from"./index-W83PhAZh.js";import{n as Be}from"./mui-sKCdI-e6.js";import{u as Pe}from"./useInitialThreadRequest-BDAn-AM4.js";import{M as Ue}from"./MobileAppDrawer-CjoW3Rax.js";import Le from"./TaskListScreen-DMgU1v4z.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./useAskAiCfoHostNavButtonProps-DAlpTVgV.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]="f961ac76-1e7f-4837-b3c3-82626ba0c2c0",e._sentryDebugIdIdentifier="sentry-dbid-f961ac76-1e7f-4837-b3c3-82626ba0c2c0")}catch{}})();function He(){const e=_(),t=O(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,q=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=W(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${z.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,q=Object.values(I)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${z.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>N(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(K(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function w(){const e=_(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>M(i)),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,I]=c.useState(!1),[p,Y]=c.useState(!1),[F,J]=c.useState(!1),[B,ee]=c.useState(!1),[P,y]=c.useState(!1),T=c.useRef(!1),C=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>W(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(Y(!0),t(K(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(J(!0),t(pe()))},[F,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))},[t,r]);c.useEffect(()=>{if(P)if(C!=="In-Progress"){if(T.current){if(C==="Error")return y(!1),void(T.current=!1);if(C==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,C,l,s,e]);const H=g(i=>Q(i,r)),j=H.fetchState,$=G.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&H.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(we,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ne=Be.div`
1
+ import{j as n}from"./liveblocks-D3ESVZyk.js";import se from"./NotFoundScreen-6vyCFr5S.js";import{a as c}from"./sentry-B_92GPgU.js";import{h as q,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-k_c8SCBE.js";import{HK as Z,HN as le,HH as de,eW as M,Td as K,H$ as Q,HE as pe,Iv as ue,Io as ke,Te as J,Tf as N,HA as me,Hx as fe,ry as ge,rm as he,l0 as Se,HV as Ie,Tg as Te,Ia as be,I7 as Ee,HQ as Ce,I4 as Ge,I3 as De}from"./zeni-epic-state-C3zBO1No.js";import{z as G,d6 as xe,Y as ye,N as je,x as b,p as W,n as w,r as ve,c as V,e as we,d7 as Re,f as z,at as Fe}from"./index-B4wUHn-k.js";import{n as Be}from"./mui-UJrLjp1k.js";import{u as Pe}from"./useInitialThreadRequest-C_cJhQDA.js";import{M as Ue}from"./MobileAppDrawer-BzOopfIc.js";import Le from"./TaskListScreen-CIIrTWF0.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";import"./useAskAiCfoHostNavButtonProps-BJGg886y.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]="6c1768b8-5a21-4c4f-9507-8065a33cc145",e._sentryDebugIdIdentifier="sentry-dbid-6c1768b8-5a21-4c4f-9507-8065a33cc145")}catch{}})();function He(){const e=q(),t=O(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,_=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=J(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=K(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${z.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,_=Object.values(I)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${z.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>N(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=W(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(Q(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function v(){const e=q(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>M(i)),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,I]=c.useState(!1),[p,X]=c.useState(!1),[F,Y]=c.useState(!1),[B,ee]=c.useState(!1),[P,y]=c.useState(!1),T=c.useRef(!1),C=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>K(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(X(!0),t(Q(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(Y(!0),t(pe()))},[F,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))},[t,r]);c.useEffect(()=>{if(P)if(C!=="In-Progress"){if(T.current){if(C==="Error")return y(!1),void(T.current=!1);if(C==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=W(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,C,l,s,e]);const H=g(i=>J(i,r)),j=H.fetchState,$=G.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&H.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ve,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ne=Be.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as n}from"./liveblocks-DvKPzrwo.js";import se from"./NotFoundScreen-Fcr
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(w,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(w,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx(He,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(w,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
9
+ `,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(v,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(v,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx(He,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(v,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-DvKPzrwo.js";import i from"./NotFoundScreen-FcrdBNP0.js";import{T as r}from"./TransactionDetailScreen-ABqf1zzA.js";import"./sentry-Be8twC83.js";import{o as a,p as o}from"./core-CQnSJ9vO.js";import"./zeni-epic-state-DKeO4Z0C.js";import"./recharts-Cv5d-Vxs.js";import"./index-W83PhAZh.js";import"./mui-sKCdI-e6.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import"./decodeURIComponentSafe-BprI0TcI.js";import"./routePaths-stnXzrYV.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="56b6774e-1a6b-43e6-92ce-ea2969956395",e._sentryDebugIdIdentifier="sentry-dbid-56b6774e-1a6b-43e6-92ce-ea2969956395")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
1
+ import{j as t}from"./liveblocks-D3ESVZyk.js";import i from"./NotFoundScreen-6vyCFr5S.js";import{T as r}from"./TransactionDetailScreen-BHKf3UvG.js";import"./sentry-B_92GPgU.js";import{o as a,p as o}from"./core-k_c8SCBE.js";import"./zeni-epic-state-C3zBO1No.js";import"./recharts-Q-kkTNuO.js";import"./index-B4wUHn-k.js";import"./mui-UJrLjp1k.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";import"./useAskAiCfoHostNavButtonProps-BJGg886y.js";import"./decodeURIComponentSafe-ClSfwHJC.js";import"./routePaths-ooqctjvV.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="56b6774e-1a6b-43e6-92ce-ea2969956395",e._sentryDebugIdIdentifier="sentry-dbid-56b6774e-1a6b-43e6-92ce-ea2969956395")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
@@ -0,0 +1,5 @@
1
+ import{j as x}from"./liveblocks-D3ESVZyk.js";import{a as i}from"./sentry-B_92GPgU.js";import{u as W,k as Qe,j as S,s as fe,g as ge,h as Te,i as be,N as Ze,n as Xe}from"./core-k_c8SCBE.js";import{nJ as he,eW as Z,go as Ke,NM as et,mW as tt,mE as at,bn as nt,cU as Ee,bt as Ie,r6 as q,ML as H,NN as ve,NO as oe,N9 as De,kD as Ce,NP as ke,Ne as se,Nf as ce,ls as Ae,JO as ie,MF as $,kx as Ne,kv as Ue,kH as ot,nw as st,NQ as ct,NR as it,va as Q,kC as xe,J7 as _e,cZ as rt,c_ as lt,NS as dt,ME as ut,NT as mt,v6 as pt,NU as ft,NV as ht,NW as yt,NX as St,NY as gt,kG as Tt,NZ as bt,N_ as Et,MG as It,N$ as vt,O0 as Dt,O1 as Ct,J1 as kt,IT as At,Jg as Nt,kI as Ut,JP as ye,nB as xt}from"./zeni-epic-state-C3zBO1No.js";import{N as J,x as _,z as we,aN as Pe,m as _t,h as wt,aO as Pt,w as Ft,p as ae,j as Ot,aP as Vt,n as ne,_ as Bt,aQ as Rt,c as Fe,aR as Lt,at as zt,a2 as te}from"./index-B4wUHn-k.js";import{n as Gt,S as Mt,D as jt}from"./mui-UJrLjp1k.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-BJGg886y.js";import{d as Oe}from"./decodeURIComponentSafe-ClSfwHJC.js";import{h as Ve,c as Be,g as Wt,e as qt}from"./routePaths-ooqctjvV.js";import{u as Ht}from"./utils-Mjhh9T8E.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="594aadfb-bf1c-4db7-9bc7-364c884f2745",t._sentryDebugIdIdentifier="sentry-dbid-594aadfb-bf1c-4db7-9bc7-364c884f2745")}catch{}})();function Jt(t=!0){const e=W(),s=Qe(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(_.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Yt(t,e){const s=function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,N]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S(h=>Z(h)),b=k.companyId,U=S(h=>Ke(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:w,capitalizableAccountOverrides:V,dismissedAccounts:z}=S(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(w);G.current=w;const B=i.useRef(V);B.current=V;const P=i.useRef(z);P.current=z;const R=S(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?I[m]??null:null,M=i.useCallback(h=>{if(!v)return;const E=G.current;if(E==null)return;const u=E.accounts??[],j=new Set(h),X=B.current??{},Y=P.current;for(const L of u)if(j.has(L.accountId)&&X[L.accountId]==null&&Y?.[L.accountId]==null)return y(L.classificationType),N(L.accountId),void g(!0)},[v]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),N(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(b,m)),g(!1),y(null),N(null))},[r,b,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:M,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=we.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(_.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S(u=>Z(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(_.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,N=re(),T=i.useMemo(()=>({id:t,type:q(e)}),[t,e]),f=S(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const j=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return j==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[j]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=S(u=>{if(b!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),w=S(u=>oe(u)),V=S(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),z=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[B,P]=i.useState(!1),[R,I]=i.useState(!1),[l,M]=i.useState(!1);i.useEffect(()=>{P(!1),I(!1),M(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),I(!1)},[]),[F,h]=i.useState(!1),E=V?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),M(!0)),b!=null&&(!c||r&&p===!1)&&(B?R||U==null||(I(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,B,R,U,E]),i.useEffect(()=>{w.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[w.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s($("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:N,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:w,uiState:V,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Qt={overlayWidth:new Ft(100,100,58)},Zt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=_t(),c=wt(),r=W(),p=S(y=>oe(y)),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Ne({vendorId:void 0,localData:y}))}};return x.jsx(jt,{anchor:"right",open:t,PaperProps:{style:{width:Qt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Xt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Xt=Gt(Mt)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `;function Kt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))},[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=ge(),n=Te(),o=W(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),g=e??p,A=s??Oe(r??"");let y;Ve(g,A)&&(y={id:g,type:q(A)});const m=y!=null?S(T=>H(T,y)):void 0,N=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(xe(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map(v=>v.id)??[]};o(Q({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}N()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(Ue()),o(it()),t(!0),N()}}},aa=Xe(function(t,e){const s=H(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=we.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=Z(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${zt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t($("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??Le(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(xt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Be(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?xe(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):Ut({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t($("common"))},onUploadAttachmentAttachment:a=>{t(Nt(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Ht(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(_e(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t($("common"))},onCancelAutoComplete:()=>{t($("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(Q({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(Et(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(bt(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Q({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Ne({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,g=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:g}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Q({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Kt(t,a):void 0}})(Lt);function ya(){const t=Te(),e=W(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=Ot(),c=S(d=>Z(d)),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&Ee(c.userRole),g=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(_.isExpenseAutomationEnabled),{configValue:m}=n(Pe.enableUncategorizedExpenseCategory),N=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[v,k]=i.useState(!1),b=Oe(f??""),U=Ve(C,b),w=S(d=>d.transactionVendorViewState),V=re(),{isFeatureEnabled:z}=a(_.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(_.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=a(_.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(U)return{id:C,type:q(b)}},[U,C,b]),l=I!=null?S(d=>H(d,I)):void 0,M=l?.transactionDetailLocalData.vendorUpdates?.id!=null?w.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Re(l?.transaction):void 0,F=S(d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0),h=S(d=>oe(d)),E=S(d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=c.company?.companyInfo.firstMonthOfFY??1,j=S(d=>Ce(d.accountState,d.accountListState,"accountList")),[X,Y]=i.useState(!1),[L,le]=i.useState(!1),[ze,de]=i.useState(!1),Ge=i.useCallback(d=>Be(d,T??"")+s.search,[T,s.search]),Me=i.useCallback(()=>{de(!1)},[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:Me,navigate:t,navigateState:s.state});const ue=()=>{Y(!1),le(!1)},me=Vt();Jt();const K=i.useRef(l?.transaction);K.current=l?.transaction;const je=l?.transactionDetailUpdateStatus?.fetchState,O=Yt(je,()=>{const d=[];if(K.current!=null)for(const ee of K.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d});i.useEffect(()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(_e(I,!1)),ue())},[e,I,l?.fetchState]),i.useEffect(()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[I,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect(()=>{ze||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&Se(l?.transaction),D!=null&&(!r||p&&g===!1)&&(X?L||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),Y(!0),e(Ae(D))))},[l?.fetchState,l?.transaction,F,r]),i.useEffect(()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)},[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{e($("common"))},[]);const $e=[f,C].filter(d=>d!=null),{transactionId:pe,onSaveVendor:We,onSaveSuccess:qe,onCancel:He}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye}=$t({mobileExploreReferrer:"Transaction Details"});return Bt({isDataReady:l?.fetchState==="Completed"}),U?x.jsxs(x.Fragment,{children:[pe!=null&&v&&x.jsx(Zt,{isOpen:v,transactionId:pe,onSaveVendor:We,onSaveSuccess:qe,onCancel:He}),x.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:I,entity:D,isCOTEnabled:V,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:j,vendorSaveStatus:M,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:N,isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye,isTransactionCommentingEnabled:z,isProjectsTransactionsEnabled:B,companyId:P,companyName:R}),O.showPopup&&O.popupType!=null&&x.jsx(Rt,{popupType:O.popupType,currencySymbol:O.currencySymbol,accountId:O.popupAccountId??"",accountName:O.popupAccountName??"",onSubmit:O.handleSubmit,onDismiss:O.handleDismiss})]}):x.jsx(Ze,{to:Le($e.length)})}const Le=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map(n=>n.fileName))}},na=t=>{const e=[],s=[];return t.lines?.forEach(a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Zt as C,ya as T,Jt as a,Yt as b,ta as c,aa as d,ea as e,re as f,Kt as g,ha as u};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-DvKPzrwo.js";import{h as Z,g as U,u as K,i as Q,j as h,N as w,n as X,o as be,p as j}from"./core-CQnSJ9vO.js";import{eW as H,qN as ee,jR as p,Rc as te,JF as De,bq as le,Rd as Ee,ks as ae,Nb as ne,Re as ue,Rf as ve,bE as Y,JB as ye,Rg as Pe,Rh as me,Ri as je,JE as Ae,Rj as xe,Rk as pe,Rl as Me,Rm as ge,Rn as Fe,Ro as Le,Rp as fe,KR as Be,bn as Ce}from"./zeni-epic-state-DKeO4Z0C.js";import{D as de,H as W,x as G,c as z,cl as ce,r as q,q as oe,Y as Re,z as Oe}from"./index-W83PhAZh.js";import"./mui-sKCdI-e6.js";import{a as S}from"./sentry-Be8twC83.js";import{w as se}from"./withTransactionSidePanel-B9fglQqM.js";import{p as ie,c as re}from"./routePaths-stnXzrYV.js";import{v as ze}from"./utils-BcJ2NV01.js";import{d as E}from"./decodeURIComponentSafe-BprI0TcI.js";import{Z as we}from"./ZeniAccountStatementScreen-Ciuw5n7i.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import"./TransactionDetailScreen-ABqf1zzA.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="3a03f5b9-53f1-4b31-a328-1fdb937ac8e5",a._sentryDebugIdIdentifier="sentry-dbid-3a03f5b9-53f1-4b31-a328-1fdb937ac8e5")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>ze(a),_e=X(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=N(e.selectedAccount.tranListType),u=Je(t,n,c,l,e.bookCloseDate);z.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:u},type:N(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=Z(),t=U(),n=K(),c=t.pathname.split("/").find(r=>Ge.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),u=de.getLocalizedStrings(),{accountType:m,title:D,subTitle:y}=$e(o),A="month",I=h(r=>H(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=W(),{isFeatureEnabled:k}=g(G.isProjectsTransactionsEnabled),x=h(r=>ee(r))&&k,{dataAvailable:L,initialTimeframeTick:v}=Ve(o,f,I.bookCloseDate),[B,P]=S.useState(!1),[C,R]=S.useState(void 0),T=S.useMemo(()=>{const r=p(v);return{tranListType:o,accountType:te(m),title:D,subTitle:y,timeframe:A,period:r}},[o,A,m,L]);S.useEffect(()=>{if(!B&&T!=null){P(!0),z.trackTransactionList(void 0,void 0,void 0,T.title);const r=N(T.tranListType);n(De(r,T.period,!0,r==="missingReceipts"?u.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,T,n]);let M=T;return T!=null&&C!=null&&(M={...T,period:C}),c==null||M==null?s.jsx(w,{to:"../"}):s.jsx(_e,{firstMonthOfFY:f,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:L,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>R(r),...a})}),$e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},Ve=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Je=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ne=X(function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),z.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=Z(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,classIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=Q(),f=E(l??""),g=E(u??""),k=E(m??""),x=E(I??""),L=h(d=>ve(d.transactionListState,g,f,k)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(d=>H(d)),T=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=W(),{isFeatureEnabled:r}=M(G.isProjectsTransactionsEnabled),_=h(d=>ee(d))&&r;let i;const O=Ue(f,g,k,D,y,A,x);if(O){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=He(L?.dateRange,d);i={accountId:g,accountType:te(f),classId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(B(!0),z.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[v,i,c]);let F=i;i!=null&&P!=null&&(F={...i,period:P});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&F!=null?s.jsx(Ne,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:d=>C(d),...e}):s.jsx(w,{to:Se(V.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ue=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),We=X(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),z.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Ze=se(function({referrerType:a,...e}){const t=Z(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,projectIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=Q(),f=E(l??""),g=E(u??""),k=E(m??""),x=E(I??""),L=h(d=>je(d.transactionListState,g,f,k)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(d=>H(d)),T=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=W(),{isFeatureEnabled:r}=M(G.isProjectsTransactionsEnabled),_=h(d=>ee(d))&&r;let i;const O=Ke(f,g,k,D,y,A,x);if(O){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=Qe(L?.dateRange,d);i={accountId:g,accountType:te(f),projectId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(B(!0),z.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[v,i,c]);let F=i;i!=null&&P!=null&&(F={...i,period:P});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&F!=null?s.jsx(We,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:d=>C(d),...e}):s.jsx(w,{to:he(V.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Xe=X(function(a,e){const t=Fe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Le(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),z.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=at(e.tenantEmailDomain),n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Z(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,timeframe:m,startDate:D,endDate:y,titleEncoded:A,excludeSubAccounts:I}=Q(),f=E(l??""),g=E(u??""),k=E(A??""),x=!(I!=null&&I==="exclude_subaccounts"),L=h(b=>Me(b.transactionListState,g,f)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(b=>H(b)),T=R.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=R.company?.companyInfo.firstMonthOfFY??1;let r;const _=et(f,g,m,D,y,k);if(_){const b={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},Ye=tt(L?.dateRange,b);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:Ye}}let i=r;r!=null&&P!=null&&(i={...r,period:P});const{useFeatureGate:O}=W(),{isFeatureEnabled:F}=O(G.isTransactionCommentingEnabled),{isFeatureEnabled:V}=O(G.isProjectsTransactionsEnabled),d=h(b=>ee(b))&&V,{areTenantIdsInSync:$}=Re();S.useEffect(()=>{!v&&r!=null&&$&&(B(!0),z.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[v,r,c,$]);const ke=[l,u,m,D,y,A].filter(b=>b!=null);return _&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:T,isTransactionCommentingEnabled:F,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:b=>C(b),...e}):s.jsx(w,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},et=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,tt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),at=a=>`/${a}/transactions/${Be}/statements`;function Yt(){const a=U().state?.referrer,e=Oe.getSignedInUser(),t=Ce(e),{useFeatureGate:n}=W(),{isFeatureEnabled:c}=n(G.isExpenseAutomationEnabled),o=h(m=>m.expenseAutomationViewState.selectedPeriodByTenantId)[h(m=>H(m)).tenantId],{isFeatureEnabled:l}=n(G.isExpenseAutomationEnabledV2),u=l||c&&t;return s.jsxs(be,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/missing-receipts/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})})]})}export{Yt as default};
1
+ import{j as s}from"./liveblocks-D3ESVZyk.js";import{h as Z,g as U,u as H,i as K,j as h,N as w,n as Q,o as be,p as j}from"./core-k_c8SCBE.js";import{eW as W,qN as ee,jR as p,Rc as te,JF as De,bq as le,Rd as Ee,ks as ae,Nb as ne,Re as ue,Rf as ve,bE as Y,JB as ye,Rg as Pe,Rh as me,Ri as je,JE as Ae,Rj as xe,Rk as pe,Rl as Me,Rm as ge,Rn as Fe,Ro as Le,Rp as fe,KR as Be,bn as Ce}from"./zeni-epic-state-C3zBO1No.js";import{D as de,N as X,x as G,c as z,cl as ce,n as J,p as oe,X as Re,z as Oe}from"./index-B4wUHn-k.js";import"./mui-UJrLjp1k.js";import{a as S}from"./sentry-B_92GPgU.js";import{w as se}from"./withTransactionSidePanel-3cc8um6s.js";import{p as ie,c as re}from"./routePaths-ooqctjvV.js";import{v as ze}from"./utils-Mjhh9T8E.js";import{d as E}from"./decodeURIComponentSafe-ClSfwHJC.js";import{Z as we}from"./ZeniAccountStatementScreen-BuDvio8F.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./useAskAiCfoHostNavButtonProps-BJGg886y.js";import"./TransactionDetailScreen-BHKf3UvG.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="8c780700-a0e3-4d5d-bf7a-c63f6c47d309",a._sentryDebugIdIdentifier="sentry-dbid-8c780700-a0e3-4d5d-bf7a-c63f6c47d309")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],q=a=>ze(a),_e=Q(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,q(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=q(e.selectedAccount.tranListType),u=Ne(t,n,c,l,e.bookCloseDate);z.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:u},type:q(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:q(e.selectedAccount.tranListType)}))}}})(ce),N=se(function({...a}){const e=Z(),t=U(),n=H(),c=t.pathname.split("/").find(r=>Ge.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=K(),u=de.getLocalizedStrings(),{accountType:m,title:D,subTitle:y}=$e(o),A="month",I=h(r=>W(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=X(),{isFeatureEnabled:k}=g(G.isProjectsTransactionsEnabled),x=h(r=>ee(r))&&k,{dataAvailable:L,initialTimeframeTick:v}=Ve(o,f,I.bookCloseDate),[B,P]=S.useState(!1),[C,R]=S.useState(void 0),T=S.useMemo(()=>{const r=p(v);return{tranListType:o,accountType:te(m),title:D,subTitle:y,timeframe:A,period:r}},[o,A,m,L]);S.useEffect(()=>{if(!B&&T!=null){P(!0),z.trackTransactionList(void 0,void 0,void 0,T.title);const r=q(T.tranListType);n(De(r,T.period,!0,r==="missingReceipts"?u.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,T,n]);let M=T;return T!=null&&C!=null&&(M={...T,period:C}),c==null||M==null?s.jsx(w,{to:"../"}):s.jsx(_e,{firstMonthOfFY:f,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:L,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>R(r),...a})}),$e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},Ve=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ne=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},qe=Q(function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),z.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),Je=se(function({referrerType:a,...e}){const t=Z(),n=U(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,classIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=K(),f=E(l??""),g=E(u??""),k=E(m??""),x=E(I??""),L=h(d=>ve(d.transactionListState,g,f,k)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(d=>W(d)),T=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=X(),{isFeatureEnabled:r}=M(G.isProjectsTransactionsEnabled),_=h(d=>ee(d))&&r;let i;const O=Ue(f,g,k,D,y,A,x);if(O){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=We(L?.dateRange,d);i={accountId:g,accountType:te(f),classId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(B(!0),z.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[v,i,c]);let F=i;i!=null&&P!=null&&(F={...i,period:P});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&F!=null?s.jsx(qe,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:d=>C(d),...e}):s.jsx(w,{to:Se(V.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ue=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,We=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Xe=Q(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),z.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Ze=se(function({referrerType:a,...e}){const t=Z(),n=U(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,projectIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=K(),f=E(l??""),g=E(u??""),k=E(m??""),x=E(I??""),L=h(d=>je(d.transactionListState,g,f,k)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(d=>W(d)),T=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=X(),{isFeatureEnabled:r}=M(G.isProjectsTransactionsEnabled),_=h(d=>ee(d))&&r;let i;const O=He(f,g,k,D,y,A,x);if(O){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=Ke(L?.dateRange,d);i={accountId:g,accountType:te(f),projectId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(B(!0),z.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[v,i,c]);let F=i;i!=null&&P!=null&&(F={...i,period:P});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&F!=null?s.jsx(Xe,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:d=>C(d),...e}):s.jsx(w,{to:he(V.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ke=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Qe=Q(function(a,e){const t=Fe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Le(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),z.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=at(e.tenantEmailDomain),n=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Z(),n=U(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,timeframe:m,startDate:D,endDate:y,titleEncoded:A,excludeSubAccounts:I}=K(),f=E(l??""),g=E(u??""),k=E(A??""),x=!(I!=null&&I==="exclude_subaccounts"),L=h(b=>Me(b.transactionListState,g,f)),[v,B]=S.useState(!1),[P,C]=S.useState(void 0),R=h(b=>W(b)),T=R.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=R.company?.companyInfo.firstMonthOfFY??1;let r;const _=et(f,g,m,D,y,k);if(_){const b={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},Ye=tt(L?.dateRange,b);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:Ye}}let i=r;r!=null&&P!=null&&(i={...r,period:P});const{useFeatureGate:O}=X(),{isFeatureEnabled:F}=O(G.isTransactionCommentingEnabled),{isFeatureEnabled:V}=O(G.isProjectsTransactionsEnabled),d=h(b=>ee(b))&&V,{areTenantIdsInSync:$}=Re();S.useEffect(()=>{!v&&r!=null&&$&&(B(!0),z.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[v,r,c,$]);const ke=[l,u,m,D,y,A].filter(b=>b!=null);return _&&i!=null?s.jsx(Qe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:T,isTransactionCommentingEnabled:F,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:b=>C(b),...e}):s.jsx(w,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},et=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,tt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),at=a=>`/${a}/transactions/${Be}/statements`;function Yt(){const a=U().state?.referrer,e=Oe.getSignedInUser(),t=Ce(e),{useFeatureGate:n}=X(),{isFeatureEnabled:c}=n(G.isExpenseAutomationEnabled),o=h(m=>m.expenseAutomationViewState.selectedPeriodByTenantId)[h(m=>W(m)).tenantId],{isFeatureEnabled:l}=n(G.isExpenseAutomationEnabledV2),u=l||c&&t;return s.jsxs(be,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:u?s.jsx(w,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Je,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})})]})}export{Yt as default};