@zeniai/web-app-ui 5.1.56-dev → 5.1.57-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 (153) hide show
  1. package/dist/assets/AddressRoutes-Btsu-Pr2.js +1 -0
  2. package/dist/assets/{AddressScreen-w3BS5T__.js → AddressScreen-uQ5DG6RP.js} +2 -2
  3. package/dist/assets/AiCfoScreen-C79maxqZ.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-Diu_Qczl.js +1 -0
  5. package/dist/assets/BillPayRoutes-DomFtcrh.js +119 -0
  6. package/dist/assets/BusinessVerificationPageScreen-CTU28kRu.js +9 -0
  7. package/dist/assets/ChargeCardRoutes-B_Xq4AX2.js +71 -0
  8. package/dist/assets/{CompanyPassportScreen-CLNMvqEv.js → CompanyPassportScreen-CNZfdpGE.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-9uLQVh7r.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-DxID2vZg.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-CtEh9ZQ3.js +23 -0
  12. package/dist/assets/DashboardRoutes-C0VrIF3t.js +20 -0
  13. package/dist/assets/DefaultTenantHome-DV2g1Cag.js +1 -0
  14. package/dist/assets/DomesticWireDetailScreen-WAgZ5MVK.js +18 -0
  15. package/dist/assets/{DrawerScreen-BkOQSI_V.js → DrawerScreen-p0fVIC2O.js} +1 -1
  16. package/dist/assets/EntityDetailRoutes-BZiwq_x8.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-C13mP6Ld.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-vqWA1iAu.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-DRJFxPVL.js +1 -0
  20. package/dist/assets/{MagicLinkRoutes-C4TLmrqp.js → MagicLinkRoutes-CCHMK5nR.js} +20 -20
  21. package/dist/assets/MagicLinkSignInScreen-DxG_4feq.js +12 -0
  22. package/dist/assets/MobileAppDrawer-DfGezxMQ.js +1 -0
  23. package/dist/assets/NotFoundScreen-DGu_qIhZ.js +1 -0
  24. package/dist/assets/NotificationRoutes-uMWrErpy.js +1 -0
  25. package/dist/assets/OAuthConsentScreen-DOqYjznz.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-x4jJOk7g.js +1 -0
  27. package/dist/assets/PeopleRoutes-DtjJ5ui_.js +22 -0
  28. package/dist/assets/PerformanceRoutes-BloPT0Gr.js +1 -0
  29. package/dist/assets/{Preview-f2ns8xny.js → Preview-DUJTupxJ.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-BEi0Zm8x.js → QBOConnectionScreen-DqtdpzBM.js} +1 -1
  31. package/dist/assets/ReferralListScreen-CmiBzw21.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-Bi4gR0EY.js +1 -0
  33. package/dist/assets/ReimbursementApprovalRuleDetailScreen-DAMceMDV.js +1 -0
  34. package/dist/assets/{ReimbursementRoutes-COtGoxgk.js → ReimbursementRoutes-LVhtQ1QR.js} +13 -13
  35. package/dist/assets/ReportsRoutes-hERwKlR6.js +1 -0
  36. package/dist/assets/RewardsRoutes-CCP5Ycwd.js +1 -0
  37. package/dist/assets/ScreenRoutes-Dkx6t2M6.js +2 -0
  38. package/dist/assets/SettingsRoutes-iDdQWuGR.js +57 -0
  39. package/dist/assets/SetupPagesScreen-CykvAPwk.js +29 -0
  40. package/dist/assets/SignInScreen-C1AbxNiZ.js +1 -0
  41. package/dist/assets/SignOutScreen-ZWnRWBaT.js +9 -0
  42. package/dist/assets/TaskListScreen-eAFg78l5.js +9 -0
  43. package/dist/assets/TaskRoutes-C_sRnJzp.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-yKry3lon.js +1 -0
  45. package/dist/assets/TransactionDetailScreen-H4gr8jU7.js +5 -0
  46. package/dist/assets/TransactionListRoutes-C9jwZ51n.js +1 -0
  47. package/dist/assets/TreasuryRoutes-DzUIIbIL.js +37 -0
  48. package/dist/assets/{VendorsRoutes-Im4S2wjo.js → VendorsRoutes-BAxfd2en.js} +27 -27
  49. package/dist/assets/WiseConfirmationScreen-Dj60kDPw.js +12 -0
  50. package/dist/assets/ZeniAccountRoutes-a5E3OMoh.js +57 -0
  51. package/dist/assets/ZeniAccountStatementScreen-gH7pO1hx.js +9 -0
  52. package/dist/assets/{accountMappingHelper-DS9ya8eF.js → accountMappingHelper-CQ-cPZ2Q.js} +1 -1
  53. package/dist/assets/{analytics-BLbM2ksu.js → analytics-Dp5zEMRl.js} +1 -1
  54. package/dist/assets/{analyticsHelper-B_k9Kjrd.js → analyticsHelper-Dgpf5RH0.js} +1 -1
  55. package/dist/assets/{core-OMb8nkC1.js → core-Bz75oBBS.js} +2 -2
  56. package/dist/assets/{decodeURIComponentSafe-CrZYJ6cg.js → decodeURIComponentSafe-C4sdX50I.js} +1 -1
  57. package/dist/assets/dnd-CZ-V7Opk.js +6 -0
  58. package/dist/assets/empty-7OUXq_pa.js +1 -0
  59. package/dist/assets/{empty-BACf_dXg.js → empty-BOJvSC1K.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-wUn7k4Wi.js → emptyVideoElement-B7aN1P9v.js} +1 -1
  61. package/dist/assets/epic-BcqgfxS9.js +2 -0
  62. package/dist/assets/getLocaleForTenant-1kUhHovP.js +1 -0
  63. package/dist/assets/{index-BNIZfLgU.js → index-6BzK0FJL.js} +1 -1
  64. package/dist/assets/{index-CPre97x9.js → index-B580fqwk.js} +1 -1
  65. package/dist/assets/{index-5gq8gNHx.js → index-BQTqLUth.js} +2 -2
  66. package/dist/assets/{index-CVJX5WNC.js → index-Bs6X6A75.js} +1 -1
  67. package/dist/assets/{index-DLAYU8mN.js → index-C6CKWv1Y.js} +26987 -31191
  68. package/dist/assets/{index-DmsNrKhC.js → index-DqlK4s6f.js} +1 -1
  69. package/dist/assets/{empty-CyDTyMxd.js → index-PPRJ7txt.js} +1 -1
  70. package/dist/assets/{index-BUmr5maU.css → index-R6GjjTB3.css} +1 -1
  71. package/dist/assets/index-uPeOzU7i.js +1 -0
  72. package/dist/assets/{lexical-CNfNgAkp.js → lexical-BhoV9klE.js} +1 -1
  73. package/dist/assets/{liveblocks-BUQfB0Zp.js → liveblocks-Dtw-cIpm.js} +1 -1
  74. package/dist/assets/{lottie-DDI83OWz.js → lottie-DCGoGDCc.js} +1 -1
  75. package/dist/assets/{mui-JZY-3hhJ.js → mui-XIlJ9bNw.js} +1 -1
  76. package/dist/assets/{pathToGoBack-iJW8VSI1.js → pathToGoBack-DF7meFK5.js} +1 -1
  77. package/dist/assets/{pdf-6FZlivdz.js → pdf-DY4XXQdH.js} +3 -3
  78. package/dist/assets/{pdf-lib-CtBKoWQc.js → pdf-lib-BwfYoiDb.js} +1 -1
  79. package/dist/assets/{plaid-B_OuebQv.js → plaid-HhKeWLGl.js} +1 -1
  80. package/dist/assets/{pusher-BqrLLY7v.js → pusher-yKpXr-6q.js} +1 -1
  81. package/dist/assets/{react-PG_EpTGq.js → react-4ndjzott.js} +1 -1
  82. package/dist/assets/{react-uplfhPO2.js → react-5mDvcVHb.js} +1 -1
  83. package/dist/assets/{react-BVW_zt6p.js → react-B27fDKOl.js} +1 -1
  84. package/dist/assets/{react-D-VI0x0-.js → react-BU60ZCxp.js} +1 -1
  85. package/dist/assets/{react-axoushfz.js → react-BihThLEf.js} +1 -1
  86. package/dist/assets/{react-Crq75Q-S.js → react-PQlAUPJl.js} +1 -1
  87. package/dist/assets/{recharts-DAM4r1-u.js → recharts-P1XbTErv.js} +3 -3
  88. package/dist/assets/{routePaths-CLQbotzs.js → routePaths-qyRAZ1-v.js} +1 -1
  89. package/dist/assets/{sentry-BLIwU6uZ.js → sentry-CcjRjG-d.js} +1 -1
  90. package/dist/assets/{url-CbGZb3kM.js → url-CywC97He.js} +1 -1
  91. package/dist/assets/{url-BMb7_G4N.js → url-t5z6Dd8t.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Dtkjagus.js → useAiCfoDashboardSuggestedQuestionsChips--tZ2M5qy.js} +1 -1
  93. package/dist/assets/{useAskAiCfoHostNavButtonProps-Cw5yceVN.js → useAskAiCfoHostNavButtonProps-DltkBD6G.js} +1 -1
  94. package/dist/assets/{useDeviceId-l9JfwAte.js → useDeviceId-iq2z2ZGf.js} +1 -1
  95. package/dist/assets/useInitialThreadRequest-DQr5vayF.js +1 -0
  96. package/dist/assets/{utils-Bia5qc4p.js → utils-CSFJzIqP.js} +2 -2
  97. package/dist/assets/withTransactionSidePanel-CnttXHns.js +21 -0
  98. package/dist/assets/zeni-epic-state-qHZitSu9.js +13 -0
  99. package/dist/index.html +1 -1
  100. package/package.json +4 -4
  101. package/dist/assets/AddressRoutes-DOG6BtAE.js +0 -1
  102. package/dist/assets/AiCfoScreen-C4K6FzbI.js +0 -22
  103. package/dist/assets/BillPayApprovalRoutes-D2l3MfyU.js +0 -1
  104. package/dist/assets/BillPayRoutes-puCF7hIb.js +0 -119
  105. package/dist/assets/BusinessVerificationPageScreen-BCOKpvnp.js +0 -9
  106. package/dist/assets/CardsAiCfoScreen-DkQHJJyD.js +0 -14
  107. package/dist/assets/ChargeCardRoutes-Ch4Au-Rk.js +0 -71
  108. package/dist/assets/ConnectionAuthScreen-yTkCaoK1.js +0 -11
  109. package/dist/assets/CustomerOnboardingAuthScreen-DSnDsx1L.js +0 -1
  110. package/dist/assets/CustomerOnboardingRoutes-_QxL9WL8.js +0 -23
  111. package/dist/assets/DashboardRoutes-BKcrEPsw.js +0 -20
  112. package/dist/assets/DefaultTenantHome-DWIyuza_.js +0 -1
  113. package/dist/assets/DomesticWireDetailScreen-CG8HU9uQ.js +0 -18
  114. package/dist/assets/EntityDetailRoutes-QX_SVg1Y.js +0 -1
  115. package/dist/assets/ExpenseAutomationRoutes-BoyNxPcQ.js +0 -25
  116. package/dist/assets/FeaturePreviewScreen-DVS7yzIQ.js +0 -1
  117. package/dist/assets/HubSpotOAuthCallbackScreen-Dsb1nJdq.js +0 -1
  118. package/dist/assets/MagicLinkSignInScreen-Cp5Vo4Py.js +0 -12
  119. package/dist/assets/MobileAppDrawer-BzjU__HS.js +0 -1
  120. package/dist/assets/NotFoundScreen-uCKl6Wx4.js +0 -1
  121. package/dist/assets/NotificationRoutes-CC398QC1.js +0 -1
  122. package/dist/assets/OAuthConsentScreen-DNPJKfDX.js +0 -1
  123. package/dist/assets/PandLWithForecastRoutes-C3ftWleu.js +0 -1
  124. package/dist/assets/PeopleRoutes-DAFt_Bcx.js +0 -22
  125. package/dist/assets/PerformanceRoutes-DbR-tZSr.js +0 -1
  126. package/dist/assets/ReferralListScreen-DUY0_-v6.js +0 -5
  127. package/dist/assets/ReimbursementApprovalRoutes-Chh2ITQV.js +0 -1
  128. package/dist/assets/ReimbursementApprovalRuleDetailScreen-CoaTNR2u.js +0 -1
  129. package/dist/assets/ReportsRoutes-BcPE2nyn.js +0 -1
  130. package/dist/assets/RewardsRoutes-Dok3xTzo.js +0 -1
  131. package/dist/assets/ScreenRoutes-C6QOgyjY.js +0 -2
  132. package/dist/assets/SettingsRoutes-NVzDxtS7.js +0 -57
  133. package/dist/assets/SetupPagesScreen-Df4FCfYh.js +0 -29
  134. package/dist/assets/SignInScreen-DroHIon2.js +0 -1
  135. package/dist/assets/SignOutScreen-DoPJci6D.js +0 -9
  136. package/dist/assets/TaskListScreen-NFjvdEWw.js +0 -9
  137. package/dist/assets/TaskRoutes-8aOjIEkV.js +0 -9
  138. package/dist/assets/TransactionDetailRoutes-D3MSXmNL.js +0 -1
  139. package/dist/assets/TransactionDetailScreen-CSArdLSZ.js +0 -5
  140. package/dist/assets/TransactionListRoutes-UucRW17G.js +0 -1
  141. package/dist/assets/TreasuryRoutes-DwgadYGN.js +0 -37
  142. package/dist/assets/WiseConfirmationScreen-C6UoDkmK.js +0 -12
  143. package/dist/assets/ZeniAccountRoutes-Dczw62ti.js +0 -73
  144. package/dist/assets/ZeniAccountStatementScreen-prmZg4t5.js +0 -9
  145. package/dist/assets/dnd-DVcQZAG5.js +0 -6
  146. package/dist/assets/epic-C0I2MvV5.js +0 -2
  147. package/dist/assets/getLocaleForTenant-CDmBpg_y.js +0 -1
  148. package/dist/assets/index-BQIzm-tN.js +0 -1
  149. package/dist/assets/index-SfOqAjbR.js +0 -1
  150. package/dist/assets/useCashManagementBanner-COC9VygZ.js +0 -1
  151. package/dist/assets/useInitialThreadRequest-CgLG7-4I.js +0 -1
  152. package/dist/assets/withTransactionSidePanel-Dtr8LlVa.js +0 -21
  153. package/dist/assets/zeni-epic-state-BZ6N8nVI.js +0 -13
@@ -1,57 +0,0 @@
1
- import{j as o}from"./liveblocks-BUQfB0Zp.js";import{a as p}from"./sentry-BLIwU6uZ.js";import{h as L,g as Q,u as T,j as h,s as ce,n as $,i as K,o as W,p as A}from"./core-OMb8nkC1.js";import{bn as we,eV as D,gm as je,mU as le,NL as Pe,hy as me,NC as De,qL as Ue,kq as he,mQ as Me,hA as Te,NE as _e,ND as Re,Q1 as Fe,z2 as Be,En as Oe,PC as Le,PL as Ve,c6 as ee,cL as ze,cM as Ne,LK as Qe,Q2 as $e,LL as Ke,xu as Ge,Q3 as Ze,GO as He,E3 as qe,DW as fe,DT as Je,xy as be,DZ as Se,E0 as ye,E6 as ne,tY as te,xx as We,k2 as Y,k5 as Ce,Q4 as Ye,l6 as Xe,xN as en,Mx as nn,My as tn,k0 as an,Q5 as on,k3 as sn,rd as cn,Q6 as ln,Q7 as rn,rh as dn,hj as un,LT as J,hc as pn,hf as gn,LU as mn,xK as hn,Q8 as fn,Q9 as bn,Ek as Sn,fy as Ie,fA as xe,Qa as yn,ga as Cn,M1 as In,xJ as re,gf as de,ge as xn,xI as En,gd as An,gc as vn,Qb as kn,fD as Ee,Qc as wn,Qd as jn,xQ as Pn,xH as ue,Qe as Dn,fU as Un,xE as Mn,bZ as Tn,c5 as _n,c4 as Rn,b_ as Fn,c2 as Bn,c1 as On,c0 as Ln,c3 as Vn,b$ as zn}from"./zeni-epic-state-BZ6N8nVI.js";import{a as ae,F as R,z as j,af as Ae,bO as Nn,d as q,f as Qn,bz as $n,j as G,B as oe,bP as Kn,bQ as Gn,aq as Zn,k as ve,bR as Hn,bS as qn,bT as Jn,a9 as Wn,W as Yn,bU as Xn,s as et,bV as nt}from"./index-DLAYU8mN.js";import{n as F}from"./mui-JZY-3hhJ.js";import{M as _}from"./MobileAppDrawer-BzjU__HS.js";import{a as Z,g as H,m as tt}from"./accountMappingHelper-DS9ya8eF.js";import{t as at,A as ot}from"./AddressScreen-w3BS5T__.js";import N from"./NotFoundScreen-uCKl6Wx4.js";import{g as st}from"./analyticsHelper-B_k9Kjrd.js";import{B as it}from"./BusinessVerificationPageScreen-BCOKpvnp.js";import{C as ct}from"./CompanyPassportScreen-CLNMvqEv.js";import{q as pe}from"./QBOConnectionScreen-BEi0Zm8x.js";import{B as lt}from"./BillPayApprovalRoutes-D2l3MfyU.js";import{R as rt}from"./ReimbursementApprovalRoutes-Chh2ITQV.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./routePaths-CLQbotzs.js";import"./empty-BACf_dXg.js";import"./pdf-lib-CtBKoWQc.js";import"./index-CPre97x9.js";import"./url-BMb7_G4N.js";import"./index-BQIzm-tN.js";import"./decodeURIComponentSafe-CrZYJ6cg.js";import"./ReimbursementApprovalRuleDetailScreen-CoaTNR2u.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]="1371b605-91d6-4af0-b9cd-47983463115f",e._sentryDebugIdIdentifier="sentry-dbid-1371b605-91d6-4af0-b9cd-47983463115f")}catch{}})();const dt=F.div`
2
- display: flex;
3
- height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,ut=$(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:he(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizableAccountOverrides:t.capitalizableAccountOverrides,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:t.onSaveCapitalizationAccountThreshold}},function(e,t){const{navigate:s,location:r,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:m}=n,{incomeAccount:f,expenseAccount:g}=a,{billPayAccount:l}=c,{reimbursementsAccount:C}=u,{prepaidExpensesAccount:I,fixedAssetsAccount:P,accruedExpensesAccount:v}=d,{bankAccount:y,expenseCategory1099:E}=m,k=Z(t.accountMappingView.incomeAccountList,f.selectedOption),B=Z(t.accountMappingView.expenseAccountList,g.selectedOption),V=Z(t.accountMappingView.billPayAccountList,l.selectedOption),z=Z(t.accountMappingView.reimbursementsAccountList,C.selectedOption),O=H(t.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),b=H(t.accountMappingView.fixedAssetsAccountList,P.selectedOptions),U=H(t.accountMappingView.accruedExpensesAccountList,v.selectedOptions),S=H(t.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),x=tt(t.accountMappingView.expenseAccounts1099FilingAccountList,E),M={selectedIncomeAccountId:k?.accountId,selectedExpenseAccountId:B?.accountId,selectedBillPayAccountId:V?.accountId,selectedReimbursementsAccountId:z?.accountId,selectedPrepaidExpensesAccountIds:O.map(w=>w.accountId),selectedFixedAssetsAccountIds:b.map(w=>w.accountId),selectedAccruedExpensesAccountIds:U.map(w=>w.accountId),selectedBankAccounts1099FilingAccountIds:S.map(w=>w.accountId),selectedExpenseAccounts1099FilingAccountIds:x};e(Re({data:M}))},onBackClick:()=>{Ae(r)===!1?(s("../../dashboard"),e(_e())):e(me())},onSaveClick:()=>{e(Te()),i&&q.track(Qn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Me(t.currentTenant.companyId,n))}}})(Nn),pt=()=>{const e=L(),t=Q(),s=T(),{useFeatureGate:r,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=r(R.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=r(R.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),d=!u&&c?.capitalization_enabled===!0,m=j.getSignedInUser(),f=we(m),g=h(S=>D(S)),{capitalizableAccounts:l,capitalizableAccountOverrides:C,isCapitalizationThresholdSaving:I,currencySymbol:P}=h(S=>{const x=S.tenantState.currentTenantId,M=x!=null?S.tenantState.tenantsById[x]:void 0,w=je(S.companyState,g.companyId);return{capitalizableAccounts:M?.capitalizableAccounts??null,capitalizableAccountOverrides:M?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:S.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:w?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),v=p.useCallback((S,x)=>{s(le(g.companyId,S,x))},[s,g.companyId]),y=p.useCallback(S=>{const x={...C??{}},M=Object.entries(S);for(const[se,ie]of M)ie===null?delete x[se]:x[se]=ie;const[w,ke]=M[0]??[];w!=null&&s(le(g.companyId,w,ke,void 0,Object.keys(x).length>0?x:null))},[s,g.companyId,C]),E=h(S=>Pe(S.accountState),ce),k=p.useMemo(()=>{const S={};for(const x of E)x.accountId!=null&&x.accountName!=null&&(S[x.accountId]=x.accountName);return S},[E]),[B,V]=p.useState(!1),[z,O]=p.useState(!1);p.useEffect(()=>{B===!1&&(s(me()),V(!0))},[B]);const b=h(S=>De(S)),U=S=>{O(S)};return o.jsxs(dt,{children:[o.jsx(_,{isAppContentDrawerOpen:z,handleDrawerToggle:U}),o.jsx(ut,{currentTenant:g,navigate:e,accountMappingView:b,isFiling1099FeatureEnabled:n&&f,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:l,accountNamesById:k,capitalizableAccountOverrides:C,currencySymbol:P,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:v,onSaveCapitalizationAccountThresholds:y,location:t,isSettings:Ae(t),onClickMenuIcon:()=>U(!0)})]})},gt=F.div`
10
- display: flex;
11
- height: 100%;
12
- width: 100%;
13
- flex: 1 1 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- `,mt=$(function(e,t){const s=D(e),r=Le(e),i=Ve(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:r,remiApproverView:i,analytics:q}},function(e,t){const{navigate:s,currentTenant:r}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),ht=()=>{const e=L(),t=Q(),s=T(),{tenantEmailDomain:r}=K(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(E=>D(E)),f=h(E=>E.billPaySetupApproverViewState.fetchState),g=h(E=>E.remiSetupApproverViewState.fetchState),l=h(E=>Fe(E)),{isApprovalRulesV3Enabled:C,isLoading:I}=$n(m?.tenantId),P=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const v=G();p.useEffect(()=>{u||f!=="Not-Started"||I||(d(!0),s(Be(!0,!0,C)))},[u,f,I,C,s]),p.useEffect(()=>{a||g!=="Not-Started"||I||(c(!0),s(Oe(!0,!1,!1,C)))},[a,g,I,C,s]);const y=E=>{n(E)};return v?.loggedInUserRoleMap!=null?o.jsxs(gt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:y}),o.jsx(mt,{navigate:e,location:t,companyId:P,currentTenant:m,roleMap:v.loggedInUserRoleMap,onClickMenuIcon:()=>{y(!0)}})]}):o.jsx(oe,{fetchState:l.fetchState})},ft=F.div`
18
- display: flex;
19
- height: 100%;
20
- width: 100%;
21
- flex: 1 1 auto;
22
- flex-direction: column;
23
- align-items: center;
24
- background-color: ${e=>e.theme.colors.grey4};
25
- `,bt=$(function(e,t){const{companyId:s,isZeniAccountEnabled:r,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=D(e);return{bankSetupView:Ze(e,s,n,a,r,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(te(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(ne(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,u,d)=>{e(ye(n,a,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(Se(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(be(a,n))},onUpdateAccountClick:(n,a,c,u,d)=>{e(d==="paymentAccount"?fe(n,a,c,u):Je(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(qe(i,a,n,c))},onRemoveConnection:n=>{e(He(n))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),St=()=>{const e=L(),t=Q(),s=T(),{tenantEmailDomain:r}=K(),i=G(),[n,a]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>D(y)),m=h(y=>y.settingsViewState.bankConnection.fetchState),f=ze(d,i?.loggedInUserRoleMap),g=Ne(d,i?.loggedInUserRoleMap),l=Qe(d,i?.loggedInUserRoleMap),C=$e(d,i?.loggedInUserRoleMap),I=Ke(d,i?.loggedInUserRoleMap),P=d.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||m==="Completed"||(u(!0),s(Ge(!1)))},[c,s,m]);const v=y=>{a(y)};return f||l||g||I?o.jsxs(ft,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:v}),o.jsx(bt,{navigate:e,location:t,companyId:P,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:I,isTreasuryEnabled:C,onClickMenuIcon:()=>{v(!0)}})]}):o.jsx(N,{})},yt=F.div`
26
- display: flex;
27
- height: 100%;
28
- width: 100%;
29
- flex: 1 1 auto;
30
- flex-direction: column;
31
- align-items: center;
32
- background-color: ${e=>e.theme.colors.grey4};
33
- `,Ct=$(function(e,t){const{companyId:s}=t,r=D(e),i=t.roleMap.bill_pay_admin,n=Ye(e,s),{uiState:a}=n,c=(ee(r?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:a,stripeKey:ve.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(te("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(be("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(ye(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(Se(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(fe(n,a,"billing","billing_setup"))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ce(n))},handleConfirmCardSetupIntent:n=>{e(sn(n))},updateCardPaymentModalState:n=>{e(on({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(an(n,a,c))},handleFetchPaymentSources:()=>{e(Y())},resetCardPaymentViewState:()=>{e(tn())},handleResetCardPaymentErrorStatuses:()=>{e(nn())},onBillingAddressSave:n=>{e(en(n))},onAddressEditHandler:n=>{if(n!=null){const a=at(n);e(Xe({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Hn),It=()=>{const e=L(),t=Q(),s=T(),{tenantEmailDomain:r}=K(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(y=>D(y)),f=h(y=>y.cardPaymentViewState),g=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Zn(f.addCardPaymentSourceStatus.fetchState),C=f.addCardPaymentSourceStatus.fetchState,I=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const P=G();p.useEffect(()=>{I!=null&&s(We(I,!1))},[I,s]),p.useEffect(()=>{a||(c(!0),s(Y()))},[a,s]),p.useEffect(()=>{u||(Ce(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&C==="Completed"&&s(Y())},[l,C]);const v=y=>{n(y)};return P?.loggedInUserRoleMap!=null?o.jsxs(yt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:v}),o.jsx(Ct,{navigate:e,location:t,companyId:I,currentTenant:m,roleMap:P.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)},googleAPIKey:ve.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},X="external_integrations",xt=$(function(e){const t=rn(e,X);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:r,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{pe.init("/connection/auth",n),pe.handleClick()},onRefreshClick:()=>{r.integrations.refreshQBO.fetchState!=="In-Progress"&&e(hn())},onSaveChargeBeeCredentials:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;d!=null&&e(gn(a,d,J("revenue"),mn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(d!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:m,tenant_id:a}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(c,u)=>{e(pn(a,c,J(u)))},onSaveConnectorCredentials:c=>{e(un(a,J("payments"),c))},onNotifyMe:c=>{e(dn(X,c,i))}}})(qn),Et=()=>{const e=L(),t=T(),{tenantEmailDomain:s}=K(),[r,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),a=h(l=>D(l)),c=a.companyId??j.getSignedInUserTenant(s)?.companyId,u=j.getSignedInUser(),d=G(),m=ee(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(cn(X))},[t]);const f=l=>{i(l)},g=h(l=>ln(l,c));return d?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(_,{isAppContentDrawerOpen:r,handleDrawerToggle:f}),o.jsx(xt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([l,C])=>[l,C?.message])),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},At=F.div`
34
- display: flex;
35
- height: 100%;
36
- width: 100%;
37
- flex: 1 1 auto;
38
- flex-direction: column;
39
- align-items: center;
40
- background-color: ${e=>e.theme.colors.grey4};
41
- `,vt=F.div`
42
- display: flex;
43
- height: 100%;
44
- width: 100%;
45
- flex: 1 1 auto;
46
- flex-direction: column;
47
- align-items: center;
48
- background-color: ${e=>e.theme.colors.grey4};
49
- `,kt=()=>{const e=T(),{tenantEmailDomain:t}=K(),[s,r]=p.useState(!1),i=h(l=>D(l)).companyId??j.getSignedInUserTenant(t)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=h(l=>fn(l,n.userId)),c=h(l=>bn(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=l=>{r(l)},m=p.useCallback(l=>{e(te("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ne(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(Sn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(vt,{children:[o.jsx(_,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(Jn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},wt=F.div`
50
- display: flex;
51
- height: 100%;
52
- width: 100%;
53
- flex: 1 1 auto;
54
- flex-direction: column;
55
- align-items: center;
56
- background-color: ${e=>e.theme.colors.grey4};
57
- `,ge=({appContent:e})=>{const t=T(),s=L(),r=Q(),[i,n]=p.useState(!1),a=h(b=>D(b)),{tenantEmailDomain:c}=a,u=a.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:m}=d(R.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(R.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(R.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(R.isTreasuryEnabled),C=h(b=>he(b)),I=Ie(a),P=xe(g,a),v=!P&&C,y=Wn(a,f,g),{areTenantIdsInSync:E}=Yn();p.useEffect(()=>{E&&t(yn(u,v))},[u,t,v,E]);const k=h(b=>Cn(b,v)),B=k.fetchState==="Not-Started"||k.fetchState==="In-Progress"||u==null,V=In(a),z=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=b=>{n(b)};return o.jsxs(wt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(Xn,{myProfileView:k,isAccountingClassesEnabled:C,isReimbursementDisabled:z===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:V===!1,onClickMenuIcon:()=>{O(!0)},isLoading:B,isBankingOnlyTenant:P,isCardsOnlyTenant:I,onAddressClick:b=>{const U=function(x,M){let w=`/${x}/settings/my_profile`;return w=w.concat(`/new/${M}`),w}(c,b),S=et(r.state?.pathnameStackToGoBack,r.pathname);s(U,{state:{pathnameStackToGoBack:S}})},onGetOtp:b=>{const U={...k.myProfileLocalData,phone:b};t(re({localData:U})),t(vn(b,"MyProfile"))},onResendOtp:b=>{t(An(b,"MyProfile"))},onCancelClick:()=>{t(En())},onSaveClick:()=>{t(de("MyProfile",k.myProfileLocalData.phone,k.myProfileLocalData.otpChallenge,k.myProfileLocalData.dateOfBirth,k.addressData?.addressToCreate))},onVerifyOtp:(b,U)=>{t(xn(b,U,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&j.saveZeniOtpToken(b),t(de("MyProfile",k.myProfileLocalData.phone,k.myProfileLocalData.otpChallenge,k.myProfileLocalData.dateOfBirth,k.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{t(re({localData:b}))}})]})};function jt(){const e=T(),t=h(l=>D(l)).companyId,s=h(l=>kn(l)),r=h(l=>Ee(l)),i=j.getSignedInUser(),[n,a]=p.useState(!1),c=p.useCallback(l=>{a(l)},[]),u=p.useCallback(l=>{e(wn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(jn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(Pn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ue(l,t))},[t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=p.useCallback(()=>{e(Dn())},[]);return p.useEffect(()=>{if(r.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ue(l,t))}},[s.fetchState,t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled,r.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(nt,{notificationSettingsView:s,onFormDataChange:u,onCancel:d,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:g})]})}function ra(e){const[t,s]=p.useState(!1),r=h(l=>Ee(l)),i=h(l=>D(l)),n=G(),a=j.getSignedInUser(),c=T(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(R.isDebitCardFeatureEnabled),m=a?.userEmail==null||r.fetchState!=="Completed"||Un(r.notificationSettings,a.userEmail,d,i);p.useEffect(()=>{r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&t===!1&&(s(!0),c(Mn()))},[r.fetchState,t]);const f=xe(d,i),g=Ie(i);return r.fetchState!=="In-Progress"&&r.fetchState!=="Not-Started"||m!==!0?Tn(i)?o.jsxs(W,{children:[_n(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"accounting/*",element:o.jsx(pt,{})}),Rn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"approval_rules/*",element:o.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Fn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"my_bank_connections",element:o.jsx(kt,{})}),Bn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"bank_connections",element:o.jsx(St,{})}),On(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"business_verification",element:o.jsx(it,{productType:f?"zeni_accounts":g?"charge_cards":st(i,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"company_details",element:o.jsx(ct,{})}),Vn(n?.loggedInUserRole??[],i)&&o.jsx(A,{path:"billing",element:o.jsx(It,{})}),zn(n?.loggedInUserRole??[],d,i)&&o.jsx(A,{path:"integrations",element:o.jsx(Et,{})}),o.jsx(A,{path:"my_profile/new/:addressType",element:o.jsx(ge,{appContent:o.jsx(ot,{isSubPage:!1})})}),o.jsx(A,{path:"my_profile",element:o.jsx(ge,{})}),m&&o.jsx(A,{path:"notifications",element:o.jsx(jt,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]}):o.jsx(W,{children:o.jsx(A,{path:"*",element:o.jsx(N,{})})}):null}function Pt(e){return o.jsxs(W,{children:[o.jsx(A,{path:"/",element:o.jsx(ht,{})}),o.jsx(A,{path:"bills/approval-rules/*",element:o.jsx(lt,{})}),o.jsx(A,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(rt,{}):o.jsx(N,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]})}export{ra as default};
@@ -1,29 +0,0 @@
1
- import{j as u}from"./liveblocks-BUQfB0Zp.js";import{h as Q,g as X,u as ee,i as W,j as _,N as j,n as H,t as Xe}from"./core-OMb8nkC1.js";import{bJ as en,co as Ie,Pq as ye,eV as V,cA as nn,zi as $,z2 as tn,PC as an,PF as sn,rw as ne,rk as te,k_ as ae,tu as L,PH as Ae,ge as $e,gd as Ge,gc as We,PI as on,zr as cn,E3 as ke,DW as Pe,DT as _e,DK as J,DZ as ve,E0 as Ee,E6 as we,tY as Te,gt as rn,cv as un,fA as dn,fy as ln,fz as pn,bt as mn,PJ as yn,CK as le,Dm as fn,PK as gn,bK as Sn,Fm as pe,En as bn,PL as hn,PM as Cn,Fq as In,Fu as An,tn as kn,JU as Pn,F$ as Ce,G$ as me,PN as _n,PO as vn,PP as En,PQ as He,PR as wn,Ml as Tn,OP as Dn,Mw as Un,PS as Ke,PT as Ve,Gl as qe,l6 as On,rn as Je,tw as Fn,bE as je,tI as Re,cy as Vn,PU as Ye,fT as Bn,FJ as xn,FN as jn,PV as Rn,G2 as Ne,PW as Nn,PX as zn,PY as Ln,PZ as Mn,gm as Zn,AC as $n,P_ as Gn,AH as Wn,AG as Hn}from"./zeni-epic-state-BZ6N8nVI.js";import{j as ie,a as se,F as de,m as De,aN as Y,bz as Qe,z as D,E as oe,d as U,B as Ue,f as G,bA as Kn,at as ce,bB as B,bC as qn,bD as Jn,af as xe,bE as Yn,s as ze,au as Le,J as Qn,A as Xn,bF as et,bG as nt,bH as tt,a7 as at}from"./index-DLAYU8mN.js";import{a as C}from"./sentry-BLIwU6uZ.js";import{n as Be,D as it,S as st}from"./mui-JZY-3hhJ.js";import{M as fe}from"./MobileAppDrawer-BzjU__HS.js";import z from"./NotFoundScreen-uCKl6Wx4.js";import{a as Me}from"./analyticsHelper-B_k9Kjrd.js";import{d as Ze}from"./routePaths-CLQbotzs.js";import{B as Fe}from"./BusinessVerificationPageScreen-BCOKpvnp.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]="c4bd3323-22fe-449b-9f79-bd873d9ed214",e._sentryDebugIdIdentifier="sentry-dbid-c4bd3323-22fe-449b-9f79-bd873d9ed214")}catch{}})();const ot=Be.div`
2
- display: flex;
3
- height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,ct=H(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=an(e),i=D.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=sn(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e($(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ve(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e($(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(a))},onAcceptUpdatedTOSSuccess:()=>{e($(a,!0))},onGetOtp:(n,i)=>{e(We(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(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=Q(),o=X(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),n=en(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=se(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),f=De(),{configValue:A}=s(Y.zeniAccountsConfig),d=ye(A),[y,b]=C.useState(!1),P=C.useRef(!1),[g,S]=C.useState(!1),w=_(E=>E.billPaySetupViewState.fetchState),I=_(E=>V(E)),h=_(E=>E.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:T,isLoading:k}=Qe(I?.tenantId),m=I.companyId??D.getSignedInUserTenant(a)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!I.companyBillPayInfo?.info?.isBillPayTOSAccepted,R=nn(c?.loggedInUserRoleMap);C.useEffect(()=>{P.current||w!=="Not-Started"||m==null?P.current||w!=="Completed"||m==null||I.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(P.current=!0,t($(m,!1,!0))):(P.current=!0,t($(m,!0)))},[w,m,t]),C.useEffect(()=>{g||h!=="Not-Started"||k||(S(!0),t(tn(!0,!0,T)))},[g,h,k,T,t]);const F=E=>{b(E)};if(v===!1||R&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const E=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:B(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:B(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:B(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:B(a.limit.amount),creditAccountAvailableAmount:B(a.available.amount),creditAccountSpentAmount:B(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:B(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=>B(n.accountBalance.available.amount)),debitCardsSpend:B(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:B(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:B(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Yt=80,Qt=80,Xt=e=>e.companyId??D.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,dt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,lt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ea=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,na=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),pt=H(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=V(e),l=D.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:f,businessVerificationStatus:A}=o;return{onBusinessVerificationSectionClick:()=>{U.trackCardsVerifyIdentityCompanyDetailsClick(f,p,A?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onCardPolicySectionClick:()=>{t("../policy")},onFetchLinkTokenClick:(d,y)=>{e(Te("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,b)=>{e(Ee(d,y,"charge_cards","charge_card_setup",b))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(ve(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{U.trackCardsEnableCardsClick(f,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(J(a,"charge_cards")):i===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,y,b)=>{const P=n.allBankAccounts.find(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(S=>S.accountId===d);U.trackCardsZeniCashAccountChangeClick(f,p,{oldZeniCashAccount:P?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(b==="paymentAccount"?Pe(d,y,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const b=n.allFundingAccounts.find(S=>S.id===d),P=n.allFundingAccounts.findIndex(S=>S.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(S=>S.id===d)+1;U.trackCardsPaymentAccountChangeClick(f,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:B(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:b?.label??"",newPaymentAccountBalance:B(b?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:b?.accType==="depositAccount",oldPaymentAccountPosition:P,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ae({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(L(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(L(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(fn(a,d))}}})(qn),mt=()=>{const e=Q(),o=X(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),n=_(M=>V(M)),{useDynamicConfig:i,useFeatureGate:l}=se(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(Y.zeniAccountsConfig),{configValue:p}=i(Y.zeniCardsConfig),f=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:A}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(de.isEarlyPayFeatureEnabled),b=_(M=>rn(M,n.companyId)),P=un(b.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,S=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,w=dn(A,n),I=dt({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:w}),h=ln(n),T=pn(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,m=lt({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:d,isBookKeepingTenant:T,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:k}),v=I&&m===!1,R=I===!1&&m,F=ye(r),E=mn(c?.loggedInUserRoleMap),N=Ie(c?.loggedInUserRoleMap),[K,ge]=C.useState(!1),[q,re]=C.useState(!1),Z=_(M=>M.chargeCardSetupViewState.fetchState),x=D.getSignedInUserTenant(a)?.companyId??n.companyId,O=D.getSignedInUser(),Oe=M=>{ge(M)},Se=_(M=>yn(M,x));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||Z!=="Not-Started"||x==null?q||Z!=="Completed"||x==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(x,!1,!0)):(re(!0),t(le(x,!0)))},[q,Z,x,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:x,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=Be.div`
10
- display: flex;
11
- height: 100%;
12
- width: 100%;
13
- flex: 1 1 auto;
14
- flex-direction: column;
15
- align-items: center;
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=D.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,description:d}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(In(a)),U.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ve(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Jn),gt=()=>{const e=Q(),o=X(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),{useDynamicConfig:n}=se(),i=De(),{configValue:l}=n(Y.zeniAccountsConfig),s=ye(l),r=Sn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[f,A]=C.useState(!1),d=C.useRef(!1),[y,b]=C.useState(!1),P=_(m=>m.remiSetupViewState.fetchState),g=_(m=>V(m)),S=_(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:w,isLoading:I}=Qe(g?.tenantId),h=D.getSignedInUserTenant(a)?.companyId??g.companyId,T=D.getSignedInUser(),k=m=>{A(m)};if(T==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||P!=="Not-Started"||h==null?d.current||P!=="Completed"||h==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(h,!1,!0))):(d.current=!0,t(pe(h,!0)))},[P,h,t]),C.useEffect(()=>{y||S!=="Not-Started"||I||(b(!0),t(bn(!0,!1,!1,w)))},[y,S,I,w,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded(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=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Tn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Dn(e.companyConfigState),p=Un(e.userRoleConfigState),f=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:f}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:f,companyLegalName:A,companyTaxId:d,companyWebsite:y,companyPhone:b,primaryContactEmail:P,primaryContactName:g,primaryContactUserId:S,primaryContactSyncToken:w,syncToken:I,fileIds:h,incDate:T,typeOfIncorporation:k,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:R,countriesOfOperations:F,companySourceOfFunds:E,companySourceOfFundsDescription:N,transactionVolume:K,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:x,usNexus:O,usNexusTypes:Oe}=s,Se=f?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:A,taxIdOrEIN:d,website:y!=""&&y!=null?Vn(y):void 0,phone:b,syncToken:I,fileIds:h,incDate:T!=null?je(T?.toString()):T,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:R?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:E?.selectedOption??"",companySourceOfFundsDescription:N,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:x,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:S,firstName:g.firstName,lastName:g.lastName,email:P,syncToken:w};e(Re({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:f,userId:A,name:d,email:y,nationalityCountryCode:b,ssn:P,dob:g,phone:S,syncToken:w,selectDocument:I,role:h,ownership:T,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R}=p;let F;return I.selectDocumentType==="driverLicense"?F="driving_license":I.selectDocumentType==="passport"?F="passport":I.selectDocumentType==="stateId"?F="id_document":I.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:f,userId:A,firstName:d.firstName,lastName:d.lastName,email:y,ssn:P,nationalityCountryCode:b?.selectedOption!=null?Le(b.selectedOption):void 0,phone:S,birthday:g!=null?je(g?.toString()):g,syncToken:w,titleAtCompany:h.selectedOption,ownershipInCompany:T,documentTypeSelectedForVerification:F,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Re({officers:r}))},onSaveDetailsClick:s=>{e(L(t,s,a))},onSendForVerificationClick:s=>{e(L(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=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())}}})(Yn),bt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Q(),c=X(),n=ee(),[i]=Xe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:f}=W(),A=ie(),{useDynamicConfig:d}=se(),y=De(),{configValue:b}=d(Y.zeniAccountsConfig),P=ye(b),g=_(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),S=_(m=>m.companyConfigState.fetchState),w=_(m=>m.userRoleConfigState.fetchState),I=_(m=>V(m)),h=I.companyId??D.getSignedInUserTenant(f)?.companyId;if(C.useEffect(()=>{S==="Not-Started"&&n(kn()),w==="Not-Started"&&n(Pn(!0))},[S,w,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&h!=null)switch(p(!0),e){case"zeni_accounts":n(me(h,!0));break;case"zeni_treasury":n(Ce(h,!0));break;case"reimbursement":n(pe(h,!0));break;case"charge_cards":n(le(h,!0));break;default:n($(h,!0))}},[r,g,h,n]),D.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let T;switch(e){case"zeni_accounts":T=I.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":T=I.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":T=I.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||I.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":T=I.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:T=I.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=_(m=>{let v;switch(e){case"zeni_accounts":v=wn(m,h);break;case"zeni_treasury":v=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 T===!1?null:k.fetchState==="Completed"&&T===!0&&A?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded(G.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded(G.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded(G.Event.billPayBusinessVerification,xe(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:xe(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 Xn(100,100,59)},Ct=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),i=D.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Ye(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(Te("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(ve(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?Pe(s,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(L(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(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=Q(),o=X(),t=ee(),a=De(),c=Qn(),{tenantEmailDomain:n}=W(),{useDynamicConfig:i}=se(),l=ie(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:f}=i(Y.zeniAccountsConfig),A=ye(f),[d,y]=C.useState(!1),[b,P]=C.useState(!1),[g,S]=C.useState(!1),[w,I]=C.useState(!1),[h,T]=C.useState(!1),k=_(O=>O.treasurySetupViewState.fetchState),m=_(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),v=_(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),R=_(O=>O.treasuryDetailState.transactionsState?.fetchState),F=_(O=>V(O)),E=D.getSignedInUserTenant(n)?.companyId??F.companyId,N=_(O=>Ye(O,E)),K=N.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=D.getSignedInUser(),re=O=>{y(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{b||k!=="Not-Started"||E==null||(P(!0),t(Ce(E,!0,!1)))},[b,k,E,t]),C.useEffect(()=>{g||m!=="Not-Started"||E==null||(S(!0),t(Bn()))},[g,m,E,t]),C.useEffect(()=>{w||v!=="Not-Started"||E==null||(I(!0),t(xn()))},[w,v,E,t]),C.useEffect(()=>{h||R!=="Not-Started"||E==null||(T(!0),t(jn(!0)))},[h,R,E,t]);const Z=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,x=Z==="pending_review"||Z==="verified";return C.useEffect(()=>{s||k!=="Completed"||K||x||!o.pathname.includes("setup")||r(!0)},[k,K,x]),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=Be(st)`
18
- display: flex;
19
- min-height: 100%;
20
- flex-direction: column;
21
- `,kt=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Mn(e,a),r=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(Te("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ve(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"zeni_accounts","account_setup"):_e("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}})(nt),Pt=()=>{const e=Q(),o=X(),t=ee(),{tenantEmailDomain:a}=W(),{useDynamicConfig:c}=se(),n=ie(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(Y.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[f,A]=C.useState(!1),d=_(S=>S.zeniAccountSetupViewState.fetchState),y=_(S=>V(S)),b=D.getSignedInUserTenant(a)?.companyId??y.companyId,P=D.getSignedInUser(),g=S=>{p(S)};if(P==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{f||d!=="Not-Started"||b==null?f||d!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(b,!1,!0)):(A(!0),t(me(b,!0)))},[f,d,b,t]),y.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const S=w=>w.trackPageLoaded(G.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:w=>S(w)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(kt,{navigate:e,location:o,companyId:b,currentTenant:y,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=Be.div`
22
- display: flex;
23
- height: 100vh;
24
- width: 100%;
25
- flex: 1 1 auto;
26
- flex-direction: column;
27
- align-items: center;
28
- background-color: ${e=>e.theme.colors.grey4};
29
- `,vt=H(function(e,o){const t=V(e),a=D.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=Q(),o=X(),t=ee(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=W(),p=ie(),{useFeatureGate:f}=se(),{isFeatureEnabled:A}=f(de.isBillPayLocalCurrencyFeatureEnabled),d=_(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),y=_(k=>k.billPaySetupViewState.fetchState),b=_(k=>V(k)),P=De(),g=b.companyId??D.getSignedInUserTenant(r)?.companyId,S=_(k=>Zn(k.companyState,b.companyId)),w=S?.company.companyBillPayInfo.internationalWireOnboardingStatus,I=w?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t($n(g)))},[a,d,g,t]),C.useEffect(()=>{n||y!=="Not-Started"||g==null||(i(!0),t($(g,!0)))},[y,n,g,t]),D.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const h=b.companyBillPayInfo?.info?.isBillPayTOSAccepted,T=k=>{s(k)};return h===!1?u.jsx(j,{to:"../promo"}):h===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(oe,{analytics:U,onLoad:k=>(m=>m.trackPageLoaded(G.Event.billPayBusinessVerification,void 0))(k)}),xe(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:T}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:U,currentTenant:b,roleMap:p.loggedInUserRoleMap,isFormReadonly:I,isLocalCurrencyEnabled:A})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:P.colors.grey5}})},wt=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??D.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(D.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(wt,{...e,companyId:t,...a})}export{Yt as A,Qt as P,ta as S,Kt as a,Jt as b,dt as c,lt as d,ut as e,Xt 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};
@@ -1 +0,0 @@
1
- import{j as f}from"./liveblocks-BUQfB0Zp.js";import{a as u,b as D,q as T}from"./sentry-BLIwU6uZ.js";import{u as A,h as z,j as c,g as M,N as O,n as j}from"./core-OMb8nkC1.js";import{u as F,z as s,m as P,d as w,D as B,e as _,f as N,G as V,g as G,i as $,k as v}from"./index-DLAYU8mN.js";import{eV as q,Lx as J,Ly as W,fw as X,fZ as Y,LD as H,gl as Z,cX as K,LE as b,LF as Q,LG as R,bY as y}from"./zeni-epic-state-BZ6N8nVI.js";import"./mui-JZY-3hhJ.js";import{u as ee}from"./useDeviceId-l9JfwAte.js";import{f as te}from"./analyticsHelper-B_k9Kjrd.js";import{t as ne}from"./getLocaleForTenant-CDmBpg_y.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.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]="a63f69ab-1369-4715-a66c-c9c1087d9e02",t._sentryDebugIdIdentifier="sentry-dbid-a63f69ab-1369-4715-a66c-c9c1087d9e02")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},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 l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(R({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),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(Q(n,a)))},clearSignInError:()=>{t(b())}}})($),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(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:x,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),E=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>q(e)),I=c(e=>J(e)),m=M(),h=P().mode,C=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{L.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[L.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&E!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(Y(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,h,void 0,I.tenantsInOrder),Z().then(()=>{const e=G();e!=null&&_(e)}),setTimeout(()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))},2e3))},[S,p,E,o,r,I,h,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),x===!0&&k!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-BUQfB0Zp.js";import{a as n}from"./sentry-BLIwU6uZ.js";import{u,g as m,h as g,N as p}from"./core-OMb8nkC1.js";import{z as f,B as b,t as y,d,f as h}from"./index-DLAYU8mN.js";import{gq as x,gr as I,LV as w}from"./zeni-epic-state-BZ6N8nVI.js";import{n as j}from"./mui-JZY-3hhJ.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.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]="29f85011-f1e8-4b83-8d01-6cbeb1adefae",e._sentryDebugIdIdentifier="sentry-dbid-29f85011-f1e8-4b83-8d01-6cbeb1adefae")}catch{}})();function V(){const e=u(),t=m(),i=g(),a=n.useRef(!1),l=f.isSignedIn(),r=t.state?.message==="logout",o=r||l;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{f.clearAll(),e(x()),e(I(!1)),w(),y.reset(),d.trackLogout(h.Event.logoutSuccess),d.resetUserIdentity()}catch(c){console.error("Error during sign out:",c)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `;export{V as default};
@@ -1,9 +0,0 @@
1
- import{j as u}from"./liveblocks-BUQfB0Zp.js";import{a as G}from"./sentry-BLIwU6uZ.js";import{h as U,u as _,g as K,j as b,i as z,n as q}from"./core-OMb8nkC1.js";import{z as F,a as V,F as p,_ as H,E as M,d as O,f as W,d8 as Z,s as g,q as Q}from"./index-DLAYU8mN.js";import{eV as J,Tg as R,IG as C,Th as x,Tc as X,I2 as E,Ti as Y,Ia as y,Hw as aa,IH as S,Tj as B,fv as ea,Ix as ta,IC as sa,Ip as oa,In as w,ID as na,Ik as ia,Tk as la,Tl as ra,Tm as ka,Tn as ca,To as T,eh as da,Tp as ua,Tq as pa}from"./zeni-epic-state-BZ6N8nVI.js";import{n as Ta}from"./mui-JZY-3hhJ.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import{M as ga}from"./MobileAppDrawer-BzjU__HS.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.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]="492f170c-a6a1-477d-9cff-7b4958dbd772",e._sentryDebugIdIdentifier="sentry-dbid-492f170c-a6a1-477d-9cff-7b4958dbd772")}catch{}})();const fa=Ta.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,ha=q(function(e,t){const o=R(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(x({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(E({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(y(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(y(a,[s]))},handleNewTaskInitialization:a=>{if(e(E({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=U(),t=_(),o=K(),k=F.getSignedInUser(),n=b(r=>J(r)),{taskGroupId:d}=z(),{useFeatureGate:i}=V(),{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=>R(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(x({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=>(v=>v.trackPageLoaded(W.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,9 +0,0 @@
1
- import{j as n}from"./liveblocks-BUQfB0Zp.js";import se from"./NotFoundScreen-uCKl6Wx4.js";import{a as c}from"./sentry-BLIwU6uZ.js";import{h as A,u as Z,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-OMb8nkC1.js";import{HJ as M,HM as le,HG as de,eV as O,Tc as J,H_ as W,HD as pe,Iu as ue,In as ke,Td as X,Te as z,Hz as me,Hw as fe,rw as ge,rk as he,k_ as Se,HU as Ie,Tf as Te,I9 as be,I6 as Ee,HP as Ge,I3 as Ce,I2 as De}from"./zeni-epic-state-BZ6N8nVI.js";import{z as C,d6 as xe,Z as we,a as je,F as b,q as Y,s as v,E as ye,d as N,f as ve,d7 as Re,k as V,at as Fe}from"./index-DLAYU8mN.js";import{n as Ue}from"./mui-JZY-3hhJ.js";import{u as Be}from"./useInitialThreadRequest-CgLG7-4I.js";import{M as Pe}from"./MobileAppDrawer-BzjU__HS.js";import Le from"./TaskListScreen-NFjvdEWw.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./useAskAiCfoHostNavButtonProps-Cw5yceVN.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]="18cdd220-b63a-40a2-9f08-697a6c0f16d2",e._sentryDebugIdIdentifier="sentry-dbid-18cdd220-b63a-40a2-9f08-697a6c0f16d2")}catch{}})();function He(){const e=A(),t=Z(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(M())},[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 _,q=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=X(e,t.taskId),d=O(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=J(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:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=I,q=Object.values(I)),q),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=>z(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(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Y(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(W(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function y(){const e=A(),t=Z(),s=ne(),u=we(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>O(i)),k=Be(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,K]=c.useState(!1),[F,Q]=c.useState(!1),[U,ee]=c.useState(!1),[B,w]=c.useState(!1),T=c.useRef(!1),G=g(i=>i.taskListState.updateTasksFetchState.fetchState),P=g(i=>J(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(K(!0),t(W(!1,r)))},[p,t]),c.useEffect(()=>{F||P.fetchState==="Completed"||(Q(!0),t(pe()))},[F,t,P.fetchState]),c.useEffect(()=>{U||L==="Completed"||(ee(!0),t(ue()))},[U,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),w(!0))},[t,r]);c.useEffect(()=>{if(B)if(G!=="In-Progress"){if(T.current){if(G==="Error")return w(!1),void(T.current=!1);if(G==="Completed"){w(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Y(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},[B,G,l,s,e]);const H=g(i=>X(i,r)),j=H.fetchState,$=C.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(ye,{analytics:N,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Pe,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:N,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 ze=Ue.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(y,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(y,{})}),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(y,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-BUQfB0Zp.js";import i from"./NotFoundScreen-uCKl6Wx4.js";import{T as r}from"./TransactionDetailScreen-CSArdLSZ.js";import"./sentry-BLIwU6uZ.js";import{o as a,p as o}from"./core-OMb8nkC1.js";import"./zeni-epic-state-BZ6N8nVI.js";import"./recharts-DAM4r1-u.js";import"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import"./decodeURIComponentSafe-CrZYJ6cg.js";import"./routePaths-CLQbotzs.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 +0,0 @@
1
- import{j as _}from"./liveblocks-BUQfB0Zp.js";import{a as i}from"./sentry-BLIwU6uZ.js";import{u as q,k as Qe,j as S,s as fe,g as ge,h as Te,i as be,N as Ze,n as Ke}from"./core-OMb8nkC1.js";import{nH as he,eV as Z,gm as Xe,NL as et,mU as tt,mC as at,bn as nt,cT as Ee,bs as Ie,r4 as W,MK as H,NM as ve,NN as oe,N8 as De,kB as Ce,NO as ke,Nd as se,Ne as ce,lq as Ae,JN as ie,ME as $,kv as Ne,kt as Ue,kF as ot,nu as st,NP as ct,NQ as it,v8 as Q,kA as _e,J6 as xe,cY as rt,cZ as lt,NR as dt,MD as ut,NS as mt,v4 as pt,NT as ft,NU as ht,NV as yt,NW as St,NX as gt,kE as Tt,NY as bt,NZ as Et,MF as It,N_ as vt,N$ as Dt,O0 as Ct,J0 as kt,IS as At,Jf as Nt,kG as Ut,JO as ye,nz as _t}from"./zeni-epic-state-BZ6N8nVI.js";import{a as J,F as x,z as Pe,aN as Fe,m as xt,J as Pt,aO as Ft,A as wt,q as ae,j as Vt,aP as Ot,s as ne,_ as Bt,aQ as Rt,d as we,aR as zt,at as Lt,a2 as te}from"./index-DLAYU8mN.js";import{n as Gt,S as Mt,D as jt}from"./mui-JZY-3hhJ.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import{d as Ve}from"./decodeURIComponentSafe-CrZYJ6cg.js";import{h as Oe,c as Be,g as qt,e as Wt}from"./routePaths-CLQbotzs.js";import{u as Ht}from"./utils-Bia5qc4p.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]="f92fa72b-b6dc-4f17-acf2-5ebac0132194",t._sentryDebugIdIdentifier="sentry-dbid-f92fa72b-b6dc-4f17-acf2-5ebac0132194")}catch{}})();function Jt(t=!0){const e=q(),s=Qe(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(x.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=q(),[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=>Xe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:P,capitalizableAccountOverrides:O,dismissedAccounts:L}=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(P);G.current=P;const B=i.useRef(O);B.current=O;const F=i.useRef(L);F.current=L;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),K=B.current??{},Y=F.current;for(const z of u)if(j.has(z.accountId)&&K[z.accountId]==null&&Y?.[z.accountId]==null)return y(z.classificationType),N(z.accountId),void g(!0)},[v]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),N(null)},[r,b]),w=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:w}}(),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(x.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=q(),{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(x.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(x.isExpenseAutomationEnabled),{configValue:y}=n(Fe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,N=re(),T=i.useMemo(()=>({id:t,type:W(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")}),P=S(u=>oe(u)),O=S(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),L=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[B,F]=i.useState(!1),[R,I]=i.useState(!1),[l,M]=i.useState(!1);i.useEffect(()=>{F(!1),I(!1),M(!1)},[t,e]);const D=i.useCallback(()=>{F(!1),I(!1)},[]),[w,h]=i.useState(!1),E=O?.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()),F(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,B,R,U,E]),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:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:P,uiState:O,firstMonthOfFY:L,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:w,setIsCreateVendorDrawerOpen:h}}const Qt={overlayWidth:new wt(100,100,58)},Zt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=xt(),c=Pt(),r=q(),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 _.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:_.jsx(Kt,{onClick:y=>y.stopPropagation(),children:_.jsx(Ft,{...A})})})},Kt=Gt(Mt)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `;function Xt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:W(e.transactionType),sourceTransactionType:W(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=q(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),g=e??p,A=s??Ve(r??"");let y;Oe(g,A)&&(y={id:g,type:W(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(_e(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=Ke(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:`${Lt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:we,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??ze(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(_t({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?_e(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=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(xe(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=>Xt(t,a):void 0}})(zt);function ya(){const t=Te(),e=q(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=Vt(),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(x.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(x.isExpenseAutomationEnabled),{configValue:m}=n(Fe.enableUncategorizedExpenseCategory),N=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[v,k]=i.useState(!1),b=Ve(f??""),U=Oe(C,b),P=S(d=>d.transactionVendorViewState),O=re(),{isFeatureEnabled:L}=a(x.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(x.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=a(x.isProjectsTransactionsEnabled),F=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(U)return{id:C,type:W(b)}},[U,C,b]),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,w=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")),[K,Y]=i.useState(!1),[z,le]=i.useState(!1),[Le,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=Ot();Jt();const X=i.useRef(l?.transaction);X.current=l?.transaction;const je=l?.transactionDetailUpdateStatus?.fetchState,V=Yt(je,()=>{const d=[];if(X.current!=null)for(const ee of X.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(xe(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(()=>{Le||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)&&(K?z||w==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??w}))):(e(se()),e(ce()),Se(l?.transaction),Y(!0),e(Ae(D))))},[l?.fetchState,l?.transaction,w,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:qe,onSaveSuccess:We,onCancel:He}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye}=$t({mobileExploreReferrer:"Transaction Details"});return Bt({isDataReady:l?.fetchState==="Completed"}),U?_.jsxs(_.Fragment,{children:[pe!=null&&v&&_.jsx(Zt,{isOpen:v,transactionId:pe,onSaveVendor:qe,onSaveSuccess:We,onCancel:He}),_.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:O,defaultTrendTransactionTimePeriod:w,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:j,vendorSaveStatus:M,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:N,isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye,isTransactionCommentingEnabled:L,isProjectsTransactionsEnabled:B,companyId:F,companyName:R}),V.showPopup&&V.popupType!=null&&_.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):_.jsx(Ze,{to:ze($e.length)})}const ze=(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);we.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,Xt as g,ha as u};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-BUQfB0Zp.js";import{h as Z,g as U,u as H,i as K,j as h,N as w,n as X,o as be,p as j}from"./core-OMb8nkC1.js";import{eV as Q,qL as ee,jP as p,Rb as te,JE as De,bo as le,Rc as Ee,kq as ae,Na as ne,Rd as ue,Re as ve,bE as Y,JA as ye,Rf as Pe,Rg as me,Rh as je,JD as Ae,Ri as xe,Rj as pe,Rk as Me,Rl as ge,Rm as Le,Rn as Fe,Ro as fe,KQ as Ce,bn as Be}from"./zeni-epic-state-BZ6N8nVI.js";import{D as de,a as W,F as G,d as z,cl as ce,s as J,q as oe,W as Re,z as Oe}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import{a as S}from"./sentry-BLIwU6uZ.js";import{w as se}from"./withTransactionSidePanel-Dtr8LlVa.js";import{p as ie,c as re}from"./routePaths-CLQbotzs.js";import{v as ze}from"./utils-Bia5qc4p.js";import{d as E}from"./decodeURIComponentSafe-CrZYJ6cg.js";import{Z as we}from"./ZeniAccountStatementScreen-prmZg4t5.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import"./TransactionDetailScreen-CSArdLSZ.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]="197cc59e-8209-4c38-9a9e-8e97b37e496e",a._sentryDebugIdIdentifier="sentry-dbid-197cc59e-8209-4c38-9a9e-8e97b37e496e")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>ze(a),_e=X(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=N(e.selectedAccount.tranListType),u=qe(t,n,c,l,e.bookCloseDate);z.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:u},type:N(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),q=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=>Q(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=W(),{isFeatureEnabled:k}=g(G.isProjectsTransactionsEnabled),x=h(r=>ee(r))&&k,{dataAvailable:F,initialTimeframeTick:v}=Ve(o,f,I.bookCloseDate),[C,P]=S.useState(!1),[B,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,F]);S.useEffect(()=>{if(!C&&T!=null){P(!0),z.trackTransactionList(void 0,void 0,void 0,T.title);const r=N(T.tranListType);n(De(r,T.period,!0,r==="missingReceipts"?u.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[C,T,n]);let M=T;return T!=null&&B!=null&&(M={...T,period:B}),c==null||M==null?s.jsx(w,{to:"../"}):s.jsx(_e,{firstMonthOfFY:f,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:F,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}}},qe=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ne=X(function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),z.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=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??""),F=h(d=>ve(d.transactionListState,g,f,k)),[v,C]=S.useState(!1),[P,B]=S.useState(void 0),R=h(d=>Q(d)),T=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=W(),{isFeatureEnabled:r}=M(G.isProjectsTransactionsEnabled),_=h(d=>ee(d))&&r;let i;const O=Ue(f,g,k,D,y,A,x);if(O){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=Qe(F?.dateRange,d);i={accountId:g,accountType:te(f),classId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(C(!0),z.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[v,i,c]);let L=i;i!=null&&P!=null&&(L={...i,period:P});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&L!=null?s.jsx(Ne,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(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,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),We=X(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),z.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=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??""),F=h(d=>je(d.transactionListState,g,f,k)),[v,C]=S.useState(!1),[P,B]=S.useState(void 0),R=h(d=>Q(d)),T=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=W(),{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(F?.dateRange,d);i={accountId:g,accountType:te(f),projectId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{v||i==null||(C(!0),z.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[v,i,c]);let L=i;i!=null&&P!=null&&(L={...i,period:P});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return O&&L!=null?s.jsx(We,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:_,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(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),Xe=X(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Fe(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"),F=h(b=>Me(b.transactionListState,g,f)),[v,C]=S.useState(!1),[P,B]=S.useState(void 0),R=h(b=>Q(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(F?.dateRange,b);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:Ye}}let i=r;r!=null&&P!=null&&(i={...r,period:P});const{useFeatureGate:O}=W(),{isFeatureEnabled:L}=O(G.isTransactionCommentingEnabled),{isFeatureEnabled:V}=O(G.isProjectsTransactionsEnabled),d=h(b=>ee(b))&&V,{areTenantIdsInSync:$}=Re();S.useEffect(()=>{!v&&r!=null&&$&&(C(!0),z.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[v,r,c,$]);const ke=[l,u,m,D,y,A].filter(b=>b!=null);return _&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:T,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:b=>B(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/${Ce}/statements`;function Yt(){const a=U().state?.referrer,e=Oe.getSignedInUser(),t=Be(e),{useFeatureGate:n}=W(),{isFeatureEnabled:c}=n(G.isExpenseAutomationEnabled),o=h(m=>m.expenseAutomationViewState.selectedPeriodByTenantId)[h(m=>Q(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(q,{})}),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(q,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(q,{})}),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(q,{})}),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(q,{})}),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,37 +0,0 @@
1
- import{j as e}from"./liveblocks-BUQfB0Zp.js";import{h as L,g as U,u as B,i as O,j as y,N as P,n as N,o as we,p as k}from"./core-OMb8nkC1.js";import{cp as _,eV as F,PU as R,F$ as ae,fT as H,FJ as ne,PW as Ie,G2 as ke,PS as be,PT as se,Q9 as je,E6 as Ae,tY as Ee,PY as ve,Gl as Fe,PV as re,cS as W,yb as oe,fy as De,fA as Pe,R8 as Le,R9 as Ue,FK as Be,Ra as Re,FL as Me,FU as Ve,bs as Oe,bJ as Ne,cA as _e,bK as ze,co as $e,fS as Ge,bt as qe,Lz as He,cn as We}from"./zeni-epic-state-BZ6N8nVI.js";import{j as z,aq as Je,z as A,E as $,d as b,ce as Ke,cf as Ze,cg as q,J,m as Ye,W as Qe,_ as Xe,a as ie,F as E,A as et,B as tt,ch as at,at as K,s as nt,ci as st,q as Z,cj as rt,M as Q,ck as ot,a9 as it}from"./index-DLAYU8mN.js";import{D as ct,n as M,S as lt}from"./mui-JZY-3hhJ.js";import ut from"./NotFoundScreen-uCKl6Wx4.js";import{S as X}from"./SetupPagesScreen-Df4FCfYh.js";import{a as p}from"./sentry-BLIwU6uZ.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import{u as pt}from"./useInitialThreadRequest-CgLG7-4I.js";import{u as mt}from"./useCashManagementBanner-COC9VygZ.js";import{M as ce}from"./MobileAppDrawer-BzjU__HS.js";import{F as ft}from"./FeaturePreviewScreen-DVS7yzIQ.js";import{a as ee}from"./analyticsHelper-B_k9Kjrd.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./routePaths-CLQbotzs.js";import"./BusinessVerificationPageScreen-BCOKpvnp.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="59c9ca20-c9d5-4b40-850e-76baf42637a1",t._sentryDebugIdIdentifier="sentry-dbid-59c9ca20-c9d5-4b40-850e-76baf42637a1")}catch{}})();const yt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{o.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}})(Ke);function gt(){const t=L(),a=U(),n=B(),{tenantEmailDomain:o}=O(),m=z(),s=y(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=Je(s),r=_(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,C]=p.useState(!1),[d,c]=p.useState(!1),h=y(I=>F(I)),g=A.getSignedInUserTenant(o)?.companyId??h.companyId,T=A.getSignedInUser(),S=y(I=>R(I,g)),w=y(I=>I.treasurySetupViewState.fetchState),x=y(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),D=y(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(T==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||w!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,w,g,n]),p.useEffect(()=>{d||D!=="Not-Started"||g==null||(c(!0),n(H()))},[d,D,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(C(!0),n(ne()))},[u,x,g,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(P,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{navigate:t,location:a,companyId:g,isEditMode:!0,isLoading:v,isReadOnly:!r,treasurySetupView:S,analytics:b})]})}const ht=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:m}=a,s=o.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{q(a.analytics,"confirm",s,f,"Transfer"),t(Fe())},onSaveChangesToLocalStore:r=>{t(ve(r))},onFetchLinkTokenClick:r=>{t(Ee("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ae(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Ze),St=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=O(),o=B(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,C]=p.useState(!1),d=y(x=>x.treasurySetupViewState.fetchState),c=y(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=y(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),g=y(x=>F(x)),T=A.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),w=y(x=>R(x,T));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||T==null||(r(!0),o(ae(T,!0,!1)))},[f,d,T,o]),p.useEffect(()=>{l||c!=="Not-Started"||T==null||(i(!0),o(H()))},[l,c,T,o]),p.useEffect(()=>{u||h!=="Not-Started"||T==null||(C(!0),o(ne()))},[u,h,T,o]),e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{q(b,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${t=>t.theme.colors.grey4};
9
- `,Tt={overlayWidth:new et(100,100,48)},Ct=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:m,handleDrawerToggle:s,analytics:f,isCashManagementFeatureEnabled:r}=a,{tenantEmailDomain:l}=o;return{onSettingsClick:()=>{f.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:i=>{let u="page-not-found";i==="editPortfolio"?u=wt(l):i==="statements"?u=It(l):i==="taxLetter"?u=kt(l):i==="settings"&&(u=bt(l));const C=nt(m.state?.pathnameStackToGoBack,m.pathname);n(u,{state:{pathnameStackToGoBack:C}})},onColumnSortConfigChanged:(i,u)=>{t(Le({uiState:{sortKey:i,sortOrder:u}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{s(!0)},onAutoTransferClick:()=>{n(r?"../../checking/cash_management/auto-transfer":"../../checking/auto-transfer")},onCashManagementClick:()=>{n(`/${l}/checking/cash_management`)}}})(at);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=U(),o=L(),m=B(),s=J(),f=Ye(),r=y(j=>F(j)),{tenantEmailDomain:l}=O(),i=r.companyId??A.getSignedInUserTenant(l)?.companyId,[u,C]=p.useState(!1),d=y(j=>re(j)),c=d.fetchState,h=d.accountSummary?.totalBalance?.amount,g=y(j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),T=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=z(),w=!!r.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=_(S?.loggedInUserRoleMap),D=W(S?.loggedInUserRoleMap),{areTenantIdsInSync:v}=Qe();p.useEffect(()=>{c==="Not-Started"&&!u&&v&&(C(!0),m(oe(!0)))},[u,m,c,v]),p.useEffect(()=>{d.transactionsFetchState.fetchState==="Completed"&&d.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[d.transactionsFetchState.fetchState,d.transactions.length]);const I=()=>{o("..")},[le,ue]=p.useState(!1),Y=j=>{ue(j)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=dt({mobileExploreReferrer:"Treasury"});Xe({isDataReady:c==="Completed"});const me=mt(),{useFeatureGate:V}=ie(),{isFeatureEnabled:fe}=V(E.isDebitCardFeatureEnabled),{isFeatureEnabled:ye}=V(E.isAutoTransferRuleEnabled),{isFeatureEnabled:ge}=V(E.isTreasuryCommentingEnabled),{isFeatureEnabled:he}=V(E.isCashManagementFeatureEnabled),Se=pt(i,{clearParams:c==="Completed"&&g?.fetchState==="Completed"}),xe=De(r),Te=Pe(fe,r);if(xe===!0&&Te!==!0)return e.jsx(ft,{});if(T){const j=g?.fetchState!=="Completed"||d.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[d.accountSummaryFetchState.fetchState==="Completed"&&g?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx($,{analytics:b,onLoad:()=>{}}):null,e.jsx(ct,{onClose:I,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:Tt.overlayWidth.valuePercentage(s),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:f.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(jt,{onClick:Ce=>Ce.stopPropagation(),children:[t===!0?e.jsx(St,{isFirstTransfer:d.transactions.length===0||h===0}):null,a===!0?e.jsx(gt,{}):null]})}),e.jsxs(xt,{windowSize:s,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Y}),e.jsx(Ct,{treasuryDetailsView:d,isAutoTransferRuleEnabled:ye,navigate:o,currentTenant:r,location:n,companyId:i,analytics:b,cashManagementBannerProps:me,isCashManagementFeatureEnabled:he,isTreasuryCommentingEnabled:ge,handleDrawerToggle:Y,initialOpenThreadRequest:Se,isLoading:j,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return w&&x?e.jsx(P,{to:"../setup"}):r.companyTreasuryInfo?.info&&!w&&D?e.jsx(P,{to:"../promo",state:n.state}):e.jsx(tt,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})}const wt=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,kt=t=>`/${t}/treasury/tax-letter`,bt=t=>`/${t}/treasury/setup`,jt=M(lt)`
10
- display: flex;
11
- min-height: 100%;
12
- flex-direction: column;
13
- `,At=M.div`
14
- display: flex;
15
- height: 100vh;
16
- width: 100%;
17
- flex: 1 1 auto;
18
- flex-direction: column;
19
- align-items: center;
20
- background-color: ${t=>t.theme.colors.grey4};
21
- `;function Et(){const t=L(),a=B(),n=J(),o=U(),m=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Ue(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),a(Be(!1)))},[s,r.fetchState,a]);const l=A.getSignedInUser(),i=y(c=>F(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},C=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(At,{windowSize:n,children:e.jsx(st,{currentTenantCompanyName:C,statementListView:r,isLoading:d,onBackClick:()=>{const c=Z(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const vt=M.div`
22
- display: flex;
23
- height: 100vh;
24
- width: 100%;
25
- flex: 1 1 auto;
26
- flex-direction: column;
27
- align-items: center;
28
- background-color: ${t=>t.theme.colors.grey4};
29
- `;function Ft(){const t=L(),a=J(),n=U(),o=B(),m=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Re(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),o(Me(!1)))},[s,r.fetchState,o]);const l=A.getSignedInUser(),i=y(c=>F(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},C=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(vt,{windowSize:a,children:e.jsx(rt,{currentTenantCompanyName:C,taxLetterListView:r,isLoading:d,onBackClick:()=>{const c=Z(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const Dt=N(function(t,a){const{companyId:n}=a,o=R(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Ve(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:m=>{n(m?"..":"../setup",{relative:"path"})}}})(ot),Pt=()=>{const t=L(),a=U(),n=B(),{tenantEmailDomain:o}=O(),[m,s]=p.useState(!1),f=y(S=>F(S)),[r,l]=p.useState(!1),i=y(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);p.useEffect(()=>{r||i?.fetchState!=="Not-Started"||u==null||(l(!0),n(H()))},[i,n]);const u=A.getSignedInUserTenant(o)?.companyId??f.companyId,C=A.getSignedInUser(),d=!!f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{s(S)};if(C==null)throw Error("Can't access treasury promo page without signing in...");const h=z(),g=_(h?.loggedInUserRoleMap),T=W(h?.loggedInUserRoleMap);if(d&&g)return e.jsx(P,{to:"../../treasury/setup"});if(f.company?.companyTreasuryInfo&&(!d&&g||T)){if(a.state?.message==="activation"){const S=Z(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:b,onLoad:S=>(w=>w.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:m,handleDrawerToggle:c}),e.jsx(Dt,{analytics:b,navigate:t,companyId:u,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})})},te=M.div`
30
- display: flex;
31
- width: 100%;
32
- height: 100%;
33
- flex-direction: row;
34
- justify-content: center;
35
- align-items: center;
36
- background-color: ${t=>t.theme.colors.grey5};
37
- `;function sa(){const t=U(),a=y(v=>F(v)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(E.isTreasuryEnabled),m=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,s=z(),f=W(s?.loggedInUserRoleMap),r=a?.userRole!=null&&Oe(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!r)&&Ne(s?.loggedInUserRoleMap),i=_e(s?.loggedInUserRoleMap),u=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!r)&&ze(s?.loggedInUserRoleMap),{isFeatureEnabled:C}=n(E.isDepositAccountsFeatureEnabled),d=C&&!r&&$e(s?.loggedInUserRoleMap),c=a.company!=null&&Ge(a.company),h=o&&c===!0&&!r&&_(s?.loggedInUserRoleMap),{isFeatureEnabled:g}=n(E.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=n(E.isDebitCardFeatureEnabled),S=it(a,g,T)&&!r&&qe(s?.loggedInUserRoleMap),w=He(s?.loggedInUserRoleMap),x=We(s?.loggedInUserRoleMap),D=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(we,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(X,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(X,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Pt,{})}),e.jsx(k,{path:"statements",element:e.jsx(Et,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Ft,{})}),D?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ut,{})})]}):m&&h?e.jsx(k,{path:"*",element:e.jsx(P,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&f?e.jsx(k,{path:"*",element:e.jsx(P,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{sa as default};
@@ -1,12 +0,0 @@
1
- import{j as o}from"./liveblocks-BUQfB0Zp.js";import{a as f}from"./sentry-BLIwU6uZ.js";import{t as u,u as h,j as y,N as b}from"./core-OMb8nkC1.js";import{LS as I,fw as w,B1 as j}from"./zeni-epic-state-BZ6N8nVI.js";import{z as l,B as x,H as S,N as D}from"./index-DLAYU8mN.js";import{n as p}from"./mui-JZY-3hhJ.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.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]="6ae81a5d-6183-4111-bf37-724e6b29106d",e._sentryDebugIdIdentifier="sentry-dbid-6ae81a5d-6183-4111-bf37-724e6b29106d")}catch{}})();const A=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",g=e.get("profileId")??"",[n,m]=f.useState(!1),a=h(),i=y(c=>I(c)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(b,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect(()=>{n||(m(!0),a(j(t,g,s)))},[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=p.div`
2
- display: flex;
3
- width: 100%;
4
- height: 100vh;
5
- flex-direction: row;
6
- justify-content: center;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey5};
9
- `,_=p(D.LargeRegular)`
10
- display: flex;
11
- color: ${S.important};
12
- `;export{A as default};