@zeniai/web-app-ui 5.1.52-qa → 5.1.53-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/assets/AddressRoutes-Ct2UHIee.js +1 -0
  2. package/dist/assets/AddressScreen-DzlfvttE.js +9 -0
  3. package/dist/assets/{AiCfoScreen-CRoxnDRU.js → AiCfoScreen-D83FklRr.js} +5 -5
  4. package/dist/assets/{BillPayApprovalRoutes-BWlPp4gg.js → BillPayApprovalRoutes-Dh8a42Hh.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BcERL4gz.js → BillPayRoutes-C6_AK3AV.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DWX7ySZI.js → BusinessVerificationPageScreen-6o8gENq-.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-DEKa5Xew.js → CardsAiCfoScreen-D5tWDH0n.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-FSWFOO49.js → ChargeCardRoutes-2ad2KSI-.js} +10 -10
  9. package/dist/assets/CompanyPassportScreen-DBpHUeez.js +1 -0
  10. package/dist/assets/{ConnectionAuthScreen-DDK9ow_u.js → ConnectionAuthScreen-BDQnLY2-.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-Yzg3cHZm.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-BdqZkh_s.js → CustomerOnboardingRoutes-Cd6aEpRT.js} +5 -5
  13. package/dist/assets/{DashboardRoutes-BGmqy8sI.js → DashboardRoutes-BqteLe-_.js} +3 -3
  14. package/dist/assets/{DefaultTenantHome-dUxiOroS.js → DefaultTenantHome-BmKNJTAE.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-ByI1UAeb.js +18 -0
  16. package/dist/assets/DrawerScreen-CVn6NI6C.js +1 -0
  17. package/dist/assets/{EntityDetailRoutes-VUYCsTyx.js → EntityDetailRoutes-CJCW4lau.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-Baf_deUk.js → ExpenseAutomationRoutes-Bw8DwzWR.js} +3 -3
  19. package/dist/assets/FeaturePreviewScreen-D7L8dftQ.js +1 -0
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-DLXvcbO1.js → HubSpotOAuthCallbackScreen-BhR_n_gC.js} +1 -1
  21. package/dist/assets/MagicLinkRoutes-GquONAuy.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-D99xSkpp.js +12 -0
  23. package/dist/assets/{MobileAppDrawer-BzOopfIc.js → MobileAppDrawer-CzOm0Sxs.js} +1 -1
  24. package/dist/assets/NotFoundScreen-D51sUkWb.js +1 -0
  25. package/dist/assets/{NotificationRoutes-BfWTxi_L.js → NotificationRoutes-Bk-3HBBq.js} +1 -1
  26. package/dist/assets/OAuthConsentScreen-CnnMYT9D.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-Cmu8H8NO.js +1 -0
  28. package/dist/assets/{PeopleRoutes-Cd2xa-tF.js → PeopleRoutes-BW2q_Dmg.js} +4 -4
  29. package/dist/assets/PerformanceRoutes-B6NZ0t5W.js +1 -0
  30. package/dist/assets/{Preview-BBgrn4cd.js → Preview-L8h-Ibqx.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-DiXbUmxS.js → QBOConnectionScreen-BTT5tOv0.js} +1 -1
  32. package/dist/assets/{ReferralListScreen-BFHfgY0C.js → ReferralListScreen-xE93Ck03.js} +2 -2
  33. package/dist/assets/{ReimbursementApprovalRoutes-BYBFJrYx.js → ReimbursementApprovalRoutes-D2Kon39b.js} +1 -1
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DiIBy_Kn.js → ReimbursementApprovalRuleDetailScreen-CEzdk50o.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-Byj4p7dn.js → ReimbursementRoutes-BJgLWv6y.js} +4 -4
  36. package/dist/assets/{ReportsRoutes-urJtOHDo.js → ReportsRoutes-ImAHwLCG.js} +1 -1
  37. package/dist/assets/RewardsRoutes-BQc5zm_c.js +1 -0
  38. package/dist/assets/{ScreenRoutes-DgHGyuTa.js → ScreenRoutes-BSFeQNd5.js} +2 -2
  39. package/dist/assets/{SettingsRoutes-B9XEOz3c.js → SettingsRoutes-CAmtpUik.js} +1 -1
  40. package/dist/assets/{SetupPagesScreen-DiqU6iZv.js → SetupPagesScreen-BEBa0Bcm.js} +4 -4
  41. package/dist/assets/SignInScreen-CoLktDu5.js +1 -0
  42. package/dist/assets/{SignOutScreen-BcKxVgCr.js → SignOutScreen-DR8PJ_Dr.js} +1 -1
  43. package/dist/assets/{TaskListScreen-CIIrTWF0.js → TaskListScreen-B0DRrcBn.js} +2 -2
  44. package/dist/assets/{TaskRoutes-C3BwKdkV.js → TaskRoutes-46kHJnwt.js} +2 -2
  45. package/dist/assets/{TransactionDetailRoutes-L60jmvh4.js → TransactionDetailRoutes-B7idB5XF.js} +1 -1
  46. package/dist/assets/{TransactionDetailScreen-BHKf3UvG.js → TransactionDetailScreen-DhBRM2u-.js} +2 -2
  47. package/dist/assets/{TransactionListRoutes-B8V8eaVr.js → TransactionListRoutes-Bmu0vt6n.js} +1 -1
  48. package/dist/assets/{TreasuryRoutes-BIv9NJIQ.js → TreasuryRoutes-BqzqJLAw.js} +5 -5
  49. package/dist/assets/{VendorsRoutes-CInyDoSC.js → VendorsRoutes-DnOFtiAo.js} +1 -1
  50. package/dist/assets/WiseConfirmationScreen-f5jOSttP.js +12 -0
  51. package/dist/assets/{ZeniAccountRoutes-CbhJXy_a.js → ZeniAccountRoutes-Bl_KyIZU.js} +13 -13
  52. package/dist/assets/ZeniAccountStatementScreen-BhYmNPRG.js +9 -0
  53. package/dist/assets/{accountMappingHelper-DoYWzqd9.js → accountMappingHelper-BwC4ZXQT.js} +1 -1
  54. package/dist/assets/{analytics-DVTbnjlr.js → analytics-BpWjaxbv.js} +1 -1
  55. package/dist/assets/{analyticsHelper-CfMFPPIh.js → analyticsHelper-B5EDEZrW.js} +1 -1
  56. package/dist/assets/{core-k_c8SCBE.js → core-Cj3sxYL7.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-ClSfwHJC.js → decodeURIComponentSafe-CyYkfiHv.js} +1 -1
  58. package/dist/assets/{dnd-CKEs-Nbe.js → dnd-WLAr-qfO.js} +1 -1
  59. package/dist/assets/{empty-rBU__xZH.js → empty-DFc-bsca.js} +1 -1
  60. package/dist/assets/{empty-CaaFsHZq.js → empty-rEpgHEWF.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-BiPjnR5F.js → emptyVideoElement-ClAxGPrQ.js} +1 -1
  62. package/dist/assets/{epic-BY3t4hzo.js → epic-B2EfNSKx.js} +1 -1
  63. package/dist/assets/getLocaleForTenant-DI_-EIej.js +1 -0
  64. package/dist/assets/{index-C9JBC9EP.js → index-2KyAy7Zy.js} +1 -1
  65. package/dist/assets/{index-B0M_M2si.js → index-B5wYRZoC.js} +1 -1
  66. package/dist/assets/{index-B4wUHn-k.js → index-BHgTWK3A.js} +1752 -1762
  67. package/dist/assets/{index-D7n4W-6R.js → index-BW1XqAyr.js} +1 -1
  68. package/dist/assets/{index-CrxfuqRy.js → index-BftEKN_-.js} +2 -2
  69. package/dist/assets/{index-CBl-jehm.js → index-BhXRaXnd.js} +1 -1
  70. package/dist/assets/{index-_Ds-L3qG.js → index-DUBqop-_.js} +1 -1
  71. package/dist/assets/{index-CAPOi0Fj.js → index-e7I5m4bW.js} +1 -1
  72. package/dist/assets/{lexical-k-PQZXkn.js → lexical--OluaPRa.js} +1 -1
  73. package/dist/assets/{liveblocks-D3ESVZyk.js → liveblocks-DmbDY3sa.js} +1 -1
  74. package/dist/assets/{lottie-BYni7Ovk.js → lottie-W8sR2m8i.js} +1 -1
  75. package/dist/assets/{mui-UJrLjp1k.js → mui-1V4hRqCa.js} +1 -1
  76. package/dist/assets/{pathToGoBack-D0Z5Ycmy.js → pathToGoBack-PTW4YbNu.js} +1 -1
  77. package/dist/assets/{pdf-CaeTpLUv.js → pdf-aJCOHARS.js} +3 -3
  78. package/dist/assets/{pdf-lib-Cgly_u4z.js → pdf-lib-ovfXHDuI.js} +1 -1
  79. package/dist/assets/{plaid-B1j5PXHV.js → plaid-JtkXopjw.js} +1 -1
  80. package/dist/assets/{pusher-IzmLENf0.js → pusher-CHPQmkEo.js} +1 -1
  81. package/dist/assets/{react-RV2byy3l.js → react-6mQxD1Me.js} +1 -1
  82. package/dist/assets/{react-BPazXlgj.js → react-BdMLdzsp.js} +1 -1
  83. package/dist/assets/{react-BhDdWL-M.js → react-CA6ko42q.js} +1 -1
  84. package/dist/assets/{react-Cbn9UGi3.js → react-CU-y_lik.js} +1 -1
  85. package/dist/assets/{react-iNsCZPRe.js → react-Ch-GNhUs.js} +1 -1
  86. package/dist/assets/{react-D9CNJCXY.js → react-GL1Pyhji.js} +1 -1
  87. package/dist/assets/{recharts-Q-kkTNuO.js → recharts-mFhBBFnU.js} +1 -1
  88. package/dist/assets/{routePaths-ooqctjvV.js → routePaths-CKR4MRfB.js} +1 -1
  89. package/dist/assets/{sentry-B_92GPgU.js → sentry--Yi43Gx7.js} +1 -1
  90. package/dist/assets/{url-CGw_V4gG.js → url-10vNaoth.js} +1 -1
  91. package/dist/assets/{url-DLQKrj-e.js → url-C6HCkI0M.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Cx3WWldL.js → useAiCfoDashboardSuggestedQuestionsChips-C8eUPCD2.js} +1 -1
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-DvB8uvB7.js +1 -0
  94. package/dist/assets/useCashManagementBanner-WDwkWALo.js +1 -0
  95. package/dist/assets/{useDeviceId-BE1s-3Wf.js → useDeviceId-n-Ow0WdN.js} +1 -1
  96. package/dist/assets/{useInitialThreadRequest-C_cJhQDA.js → useInitialThreadRequest-ITLu-S1Q.js} +1 -1
  97. package/dist/assets/{utils-Mjhh9T8E.js → utils-Bt5dYICv.js} +1 -1
  98. package/dist/assets/{withTransactionSidePanel-3cc8um6s.js → withTransactionSidePanel-txS5Vf1E.js} +2 -2
  99. package/dist/assets/{zeni-epic-state-C3zBO1No.js → zeni-epic-state-BG_x9wwl.js} +5 -5
  100. package/dist/index.html +1 -1
  101. package/package.json +3 -3
  102. package/dist/assets/AddressRoutes-odXkPzQ0.js +0 -1
  103. package/dist/assets/AddressScreen-BJ-IOcKb.js +0 -9
  104. package/dist/assets/CompanyPassportScreen-CrpUoXvt.js +0 -1
  105. package/dist/assets/CustomerOnboardingAuthScreen-CDJwl_XS.js +0 -1
  106. package/dist/assets/DomesticWireDetailScreen-BA2EKhEI.js +0 -18
  107. package/dist/assets/DrawerScreen-BSfM66hM.js +0 -1
  108. package/dist/assets/FeaturePreviewScreen-DoKDdD4M.js +0 -1
  109. package/dist/assets/MagicLinkRoutes-NK00hAHs.js +0 -72
  110. package/dist/assets/MagicLinkSignInScreen-DnxlEFNW.js +0 -12
  111. package/dist/assets/NotFoundScreen-6vyCFr5S.js +0 -1
  112. package/dist/assets/OAuthConsentScreen-DKtWI-tp.js +0 -1
  113. package/dist/assets/PandLWithForecastRoutes-DgT8jx_6.js +0 -1
  114. package/dist/assets/PerformanceRoutes-xYB_POFo.js +0 -1
  115. package/dist/assets/RewardsRoutes-CHiDiriW.js +0 -1
  116. package/dist/assets/SignInScreen-DqVi8QMM.js +0 -1
  117. package/dist/assets/WiseConfirmationScreen-DmiV73IN.js +0 -12
  118. package/dist/assets/ZeniAccountStatementScreen-BuDvio8F.js +0 -9
  119. package/dist/assets/getLocaleForTenant-CTwYyvWj.js +0 -1
  120. package/dist/assets/useAskAiCfoHostNavButtonProps-BJGg886y.js +0 -1
  121. package/dist/assets/useCashManagementBanner-Cjm3Ayi5.js +0 -1
@@ -1,4 +1,4 @@
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`
1
+ import{j as u}from"./liveblocks-DmbDY3sa.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-Cj3sxYL7.js";import{bJ as en,cp as Ie,Pr as ye,eW as V,cB as nn,zk as $,z4 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 ze,PX as zn,PY as Nn,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-BG_x9wwl.js";import{j as ie,F as se,x as de,m as Te,aN as Q,bz as Xe,z as T,A 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,r as Ne,au as Le,K as Xn,E as Yn,bF as et,bG as nt,bH as tt,a7 as at}from"./index-BHgTWK3A.js";import{a as C}from"./sentry--Yi43Gx7.js";import{n as xe,D as it,S as st}from"./mui-1V4hRqCa.js";import{M as fe}from"./MobileAppDrawer-CzOm0Sxs.js";import N from"./NotFoundScreen-D51sUkWb.js";import{a as Me}from"./analyticsHelper-B5EDEZrW.js";import{d as Ze}from"./routePaths-CKR4MRfB.js";import{B as Fe}from"./BusinessVerificationPageScreen-6o8gENq-.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]="db10a3f3-d775-444d-bfca-5ebe5e774916",e._sentryDebugIdIdentifier="sentry-dbid-db10a3f3-d775-444d-bfca-5ebe5e774916")}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-D3ESVZyk.js";import{h as X,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=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`
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=z=>z.trackPageLoaded(G.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},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),z=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:z,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,7 +14,7 @@ import{j as u}from"./liveblocks-D3ESVZyk.js";import{h as X,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=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)`
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: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: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: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: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=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(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(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=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,z=_(O=>Qe(O,E)),K=z.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:z,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},At=xe(st)`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  flex-direction: column;
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-D3ESVZyk.js";import{h as X,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=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};
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(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??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,Nt as p,na as s};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-DmbDY3sa.js";import{a as u,b as D,q as T}from"./sentry--Yi43Gx7.js";import{u as A,h as z,j as l,g as M,N as O,n as j}from"./core-Cj3sxYL7.js";import{u as F,z as s,m as P,c as w,D as _,d as B,e as N,G,g as V,f as W,h as v}from"./index-BHgTWK3A.js";import{eW as Y,Ly as $,Lz as q,fa as H,fD as J,LE as K,gn as Q,cY as R,LF as b,LG as X,LH as Z,bY as y}from"./zeni-epic-state-BG_x9wwl.js";import"./mui-1V4hRqCa.js";import{u as ee}from"./useDeviceId-n-Ow0WdN.js";import{f as te}from"./analyticsHelper-B5EDEZrW.js";import{t as ne}from"./getLocaleForTenant-DI_-EIej.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.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]="868d9f90-4b1b-4fbd-a449-92666ff3216c",t._sentryDebugIdIdentifier="sentry-dbid-868d9f90-4b1b-4fbd-a449-92666ff3216c")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}},function(t,i){const{location:d,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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.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())}}})(W),ae=D.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:C,accountUnlockTime:h}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),k=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>Y(e)),I=l(e=>$(e)),m=M(),E=P().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{L.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[L.fetchState,c]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(q(I.tenantsInOrder),o.zeniSessionId),H(o.userId,o.zeniSessionId,r.tenantId),i(J(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),Q().then(()=>{const e=V();e!=null&&B(e)}),setTimeout(()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))},2e3))},[S,p,k,o,r,I,E,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:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&h!=null?f.jsx(G,{onClose:()=>i(b()),unlockDate:h}):null]})}export{ve as default};
@@ -1,4 +1,4 @@
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`
1
+ import{j as s}from"./liveblocks-DmbDY3sa.js";import{a as n}from"./sentry--Yi43Gx7.js";import{u,g as m,h as g,N as p}from"./core-Cj3sxYL7.js";import{z as c,B as y,t as b,c as d,e as h}from"./index-BHgTWK3A.js";import{gs as x,gt as I,LW as w}from"./zeni-epic-state-BG_x9wwl.js";import{n as j}from"./mui-1V4hRqCa.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.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-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`
1
+ import{j as u}from"./liveblocks-DmbDY3sa.js";import{a as G}from"./sentry--Yi43Gx7.js";import{h as _,u as v,g as K,j as b,i as z,n as q}from"./core-Cj3sxYL7.js";import{z as F,F as W,x as p,_ as H,A as M,c as O,e as V,d8 as Z,r as g,n as Q}from"./index-BHgTWK3A.js";import{eW as J,Th as x,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-BG_x9wwl.js";import{n as Ta}from"./mui-1V4hRqCa.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-DvB8uvB7.js";import{M as ga}from"./MobileAppDrawer-CzOm0Sxs.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.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]="f1c60d74-5f1e-4d92-923e-36c1be763911",e._sentryDebugIdIdentifier="sentry-dbid-f1c60d74-5f1e-4d92-923e-36c1be763911")}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-D3ESVZyk.js";import{a as b}from"./sentry-B_92GPg
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
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};
9
+ `,ha=q(function(e,t){const o=x(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=F.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=F.getSignedInUser(),n=b(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]=G.useState(!1),h=b(r=>x(r,l)),D=b(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:$,onAskAiCfoClick:N}=ma({mobileExploreReferrer:"Task Checklist"});if(H({isDataReady:m==="Completed"}),G.useEffect(()=>{t(C(!1,l))},[n?.tenantId,t,l]),G.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};
@@ -1,4 +1,4 @@
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`
1
+ import{j as n}from"./liveblocks-DmbDY3sa.js";import se from"./NotFoundScreen-D51sUkWb.js";import{a as c}from"./sentry--Yi43Gx7.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-Cj3sxYL7.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 W,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-BG_x9wwl.js";import{z as G,d6 as xe,w as ye,F as je,x as b,n as X,r as v,A as we,c as A,e as ve,d7 as Re,h as V,at as Fe}from"./index-BHgTWK3A.js";import{n as Be}from"./mui-1V4hRqCa.js";import{u as Pe}from"./useInitialThreadRequest-ITLu-S1Q.js";import{M as Ue}from"./MobileAppDrawer-CzOm0Sxs.js";import Le from"./TaskListScreen-B0DRrcBn.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./useAskAiCfoHostNavButtonProps-DvB8uvB7.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]="fc02abff-a893-42a0-af0f-65130099599f",e._sentryDebugIdIdentifier="sentry-dbid-fc02abff-a893-42a0-af0f-65130099599f")}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 z,_=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(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?`${V.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==z&&(z=I,_=Object.values(I)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.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(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 w(){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,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=>K(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(Y(!0),t(Q(!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=>W(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:A,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:A,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-D3ESVZyk.js";import se from"./NotFoundScreen-6vy
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(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};
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};
@@ -1 +1 @@
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};
1
+ import{j as t}from"./liveblocks-DmbDY3sa.js";import i from"./NotFoundScreen-D51sUkWb.js";import{T as r}from"./TransactionDetailScreen-DhBRM2u-.js";import"./sentry--Yi43Gx7.js";import{o as a,p as o}from"./core-Cj3sxYL7.js";import"./zeni-epic-state-BG_x9wwl.js";import"./recharts-mFhBBFnU.js";import"./index-BHgTWK3A.js";import"./mui-1V4hRqCa.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./useAskAiCfoHostNavButtonProps-DvB8uvB7.js";import"./decodeURIComponentSafe-CyYkfiHv.js";import"./routePaths-CKR4MRfB.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,5 +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)`
1
+ import{j as x}from"./liveblocks-DmbDY3sa.js";import{a as i}from"./sentry--Yi43Gx7.js";import{u as W,k as Qe,j as S,s as fe,g as ge,h as Te,i as Ee,N as Ze,n as Xe}from"./core-Cj3sxYL7.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 be,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 Et,N_ as bt,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-BG_x9wwl.js";import{F as J,x as _,z as Pe,aN as we,m as _t,K as Pt,aO as wt,E as Ft,n as ae,j as Ot,aP as Vt,r as ne,_ as Bt,aQ as Rt,c as Fe,aR as Lt,at as zt,a2 as te}from"./index-BHgTWK3A.js";import{n as Gt,S as Mt,D as jt}from"./mui-1V4hRqCa.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-DvB8uvB7.js";import{d as Oe}from"./decodeURIComponentSafe-CyYkfiHv.js";import{h as Ve,c as Be,g as Wt,e as qt}from"./routePaths-CKR4MRfB.js";import{u as Ht}from"./utils-Bt5dYICv.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]="48c2e624-3844-47c8-9094-a29f255e9498",t._sentryDebugIdIdentifier="sentry-dbid-48c2e624-3844-47c8-9094-a29f255e9498")}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)),E=k.companyId,U=S(h=>Ke(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:P,capitalizableAccountOverrides:V,dismissedAccounts:z}=S(h=>{const b=h.tenantState.currentTenantId,u=b!=null?h.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(P);G.current=P;const B=i.useRef(V);B.current=V;const w=i.useRef(z);w.current=z;const R=S(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const b of R)b.accountId!=null&&b.accountName!=null&&(h[b.accountId]=b.accountName);return h},[R]),l=m!=null?I[m]??null:null,M=i.useCallback(h=>{if(!v)return;const b=G.current;if(b==null)return;const u=b.accounts??[],j=new Set(h),X=B.current??{},Y=w.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,b)=>{r(tt(E,h,b,!0)),g(!1),y(null),N(null)},[r,E]),F=i.useCallback(()=>{m!=null&&(r(at(E,m)),g(!1),y(null),N(null))},[r,E,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=Pe.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&&be(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(_.isExpenseAutomationEnabled),{configValue:y}=n(we.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"}),E=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=S(u=>{if(E!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")}),P=S(u=>oe(u)),V=S(u=>{if(E!=null)return De(u.trendWithTransactionsState,E,"TransactionDetail")}),z=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[B,w]=i.useState(!1),[R,I]=i.useState(!1),[l,M]=i.useState(!1);i.useEffect(()=>{w(!1),I(!1),M(!1)},[t,e]);const D=i.useCallback(()=>{w(!1),I(!1)},[]),[F,h]=i.useState(!1),b=V?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),M(!0)),E!=null&&(!c||r&&p===!1)&&(B?R||U==null||(I(!0),s(ie(E,"TransactionDetail",{timeframe:"month",timePeriod:b??U}))):(s(se()),s(ce()),w(!0),s(Ae(E))))},[s,l,f?.fetchState,f?.transaction,E,c,r,p,B,R,U,b]),i.useEffect(()=>{P.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[P.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:E,defaultTrendTransactionTimePeriod:U,vendorViewDetails:P,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=Pt(),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(wt,{...A})})})},Xt=Gt(Mt)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
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};
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}=Ee(),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=Pe.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(bt(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Et(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&&be(c.userRole),g=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(_.isExpenseAutomationEnabled),{configValue:m}=n(we.enableUncategorizedExpenseCategory),N=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=Ee(),[v,k]=i.useState(!1),E=Oe(f??""),U=Ve(C,E),P=S(d=>d.transactionVendorViewState),V=re(),{isFeatureEnabled:z}=a(_.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(_.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=a(_.isProjectsTransactionsEnabled),w=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(U)return{id:C,type:q(E)}},[U,C,E]),l=I!=null?S(d=>H(d,I)):void 0,M=l?.transactionDetailLocalData.vendorUpdates?.id!=null?P.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)),b=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:b?.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:w,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-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};
1
+ import{j as s}from"./liveblocks-DmbDY3sa.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-Cj3sxYL7.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-BG_x9wwl.js";import{D as de,F as X,x as G,c as z,cl as ce,r as J,n as oe,X as Re,z as Oe}from"./index-BHgTWK3A.js";import"./mui-1V4hRqCa.js";import{a as S}from"./sentry--Yi43Gx7.js";import{w as se}from"./withTransactionSidePanel-txS5Vf1E.js";import{p as ie,c as re}from"./routePaths-CKR4MRfB.js";import{v as ze}from"./utils-Bt5dYICv.js";import{d as E}from"./decodeURIComponentSafe-CyYkfiHv.js";import{Z as we}from"./ZeniAccountStatementScreen-BhYmNPRG.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./useAskAiCfoHostNavButtonProps-DvB8uvB7.js";import"./TransactionDetailScreen-DhBRM2u-.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]="b6dfffe6-8379-4f97-af09-b94b81e18ba5",a._sentryDebugIdIdentifier="sentry-dbid-b6dfffe6-8379-4f97-af09-b94b81e18ba5")}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};