@zeniai/web-app-ui 5.3.85-qa → 5.3.86-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 (128) hide show
  1. package/dist/assets/{AccountMappingScreen-BuwkeoBc.js → AccountMappingScreen-BXvURRvs.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-CA07KB7H.js → ActualMatchingMatchDetailScreen-CkPu1Iyz.js} +1 -1
  3. package/dist/assets/AddressRoutes-CRV9O3fJ.js +1 -0
  4. package/dist/assets/{AddressScreen-BQzZxu3k.js → AddressScreen-CbqqBPeg.js} +2 -2
  5. package/dist/assets/{AiCfoScreen-AHCQkXau.js → AiCfoScreen-Akbbu7OO.js} +1 -1
  6. package/dist/assets/{AppDrawer-3NWyYsn9.js → AppDrawer-B4rZP8Bn.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-k2-8BIKO.js → BillPayApprovalRoutes-BG_fZlTC.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-CXX74Xh9.js → BillPayRoutes-pg5PH9Oh.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-DIQMAYWw.js → BusinessVerificationPageScreen-B81g6W18.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-DKfeOMFZ.js → CardsAiCfoScreen-hMGqj2aq.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-vFV09m-r.js → ChargeCardRoutes-STh2Wp7w.js} +7 -7
  12. package/dist/assets/{CompanyPassportScreen-DY8v9wzP.js → CompanyPassportScreen-LxcAg-6u.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-tUGWDRZ0.js → ConnectionAuthScreen-BKVwXbSh.js} +1 -1
  14. package/dist/assets/CustomerOnboardingAuthScreen-yvp5XDgC.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-CACGUc5p.js → CustomerOnboardingRoutes-CNIJctLU.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-9wJwZmVm.js → DashboardRoutes-Cq-Lxh3h.js} +3 -3
  17. package/dist/assets/{DefaultTenantHome-CRe8IpcR.js → DefaultTenantHome-CshmDcap.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-DgvNoIMW.js → DomesticWireDetailScreen-BSEUD6C3.js} +1 -1
  19. package/dist/assets/{DrawerScreen-DW4aq5XN.js → DrawerScreen-CBAh6dJa.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-CKxj6mH-.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-CcNUDI_6.js → ExpenseAutomationRoutes-FZqTLeVo.js} +7 -7
  22. package/dist/assets/FeaturePreviewScreen-CZR8YW-L.js +1 -0
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-DVRDPCZi.js → HubSpotOAuthCallbackScreen-CUlI7cbh.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-Y4y90RT-.js → InboxNotificationsProvider-T1CjerOs.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-tFs2gEBq.js → InvoicingRoutes-Ys89tvz2.js} +1 -1
  26. package/dist/assets/{MagicLinkRoutes-BQZh-ZA0.js → MagicLinkRoutes-DR9AEDCZ.js} +17 -17
  27. package/dist/assets/MagicLinkSignInScreen-2HP7A3da.js +12 -0
  28. package/dist/assets/MobileAppDrawer-CtIgBgQ-.js +1 -0
  29. package/dist/assets/NotFoundScreen-oJupr3pq.js +1 -0
  30. package/dist/assets/{NotificationRoutes-CsYj3xuh.js → NotificationRoutes-DPQX5f6K.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-CM5WqOSd.js → OAuthConsentScreen-BFDI6eC9.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-DFS1IxXV.js → PandLWithForecastRoutes-DyZHHb1Z.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen--QRHLP7B.js → PaymentLinkScreen-EXZ3ZrN9.js} +1 -1
  34. package/dist/assets/{PeopleRoutes-Bwp5ERTC.js → PeopleRoutes-CCoQcfmM.js} +5 -5
  35. package/dist/assets/PerformanceRoutes-Bx8pszb9.js +1 -0
  36. package/dist/assets/{Preview-BQSDDH-8.js → Preview-C3KwiSeU.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-CjVsbpZ2.js → QBOConnectionScreen-B_IVukb7.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-iazqFfnr.js → ReimbursementApprovalRoutes-Dm2Et1-C.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CQPH9FaV.js → ReimbursementApprovalRuleDetailScreen-CKOH-HzU.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-BW15_3VM.js → ReimbursementRoutes-D1jTtRL_.js} +1 -1
  41. package/dist/assets/{ReportsRoutes-BtMM_1wG.js → ReportsRoutes-DwdL-iuL.js} +1 -1
  42. package/dist/assets/{RewardsRoutes-zS19eFGH.js → RewardsRoutes-CKpKVKBM.js} +1 -1
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-BBHAZAS5.js → ScheduleDetailsPrepaidExpensesScreen-BTUJ8zwC.js} +4 -4
  44. package/dist/assets/ScreenRoutes-_NAgJfqV.js +2 -0
  45. package/dist/assets/{SettingsRoutes-BVwkoEMp.js → SettingsRoutes-BK2pVuXm.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-BvCCuMSm.js → SetupPagesScreen-CUiMxOyt.js} +1 -1
  47. package/dist/assets/SignInScreen-B16ytfH2.js +1 -0
  48. package/dist/assets/SignOutScreen-CYY1dAbn.js +9 -0
  49. package/dist/assets/{TaskListScreen-BsRsR--d.js → TaskListScreen-DHzPd6H5.js} +2 -2
  50. package/dist/assets/TaskRoutes-hldsrW8n.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-Cii1a7bV.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-D9CfWvVq.js → TransactionDetailScreen-DFFAXF6x.js} +1 -1
  53. package/dist/assets/{TransactionListRoutes-BHv73oJy.js → TransactionListRoutes-bvLvzle-.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-BPEFlHRm.js → TreasuryRoutes-DYIO-YgE.js} +4 -4
  55. package/dist/assets/{VendorsRoutes-CR9Y1eNj.js → VendorsRoutes-DxWng3tY.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-13sFR__Q.js → WiseConfirmationScreen-3GfsXfj0.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-CYNWLOIV.js → ZeniAccountRoutes-bTRWcMAn.js} +7 -7
  58. package/dist/assets/{ZeniAccountStatementScreen-Ctnms777.js → ZeniAccountStatementScreen-ulCu2kq_.js} +1 -1
  59. package/dist/assets/{accountMappingHelper-Cn1k0M89.js → accountMappingHelper-Cl-vw8fd.js} +1 -1
  60. package/dist/assets/{analytics-C3OGAM2y.js → analytics-bcpq8FmH.js} +1 -1
  61. package/dist/assets/{analyticsHelper-ClHM6CQs.js → analyticsHelper-DTKAaOR4.js} +1 -1
  62. package/dist/assets/{core-Cj3U3cFh.js → core-CLbwxogo.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-W__PfZ-Y.js → decodeURIComponentSafe-CTII6a9j.js} +1 -1
  64. package/dist/assets/{dnd-Dih1Xu4b.js → dnd-D7kr6gj3.js} +1 -1
  65. package/dist/assets/{empty-B7CgpoOt.js → empty-BIuVl5i4.js} +1 -1
  66. package/dist/assets/{empty-CuNFLk2m.js → empty-BdckjUGv.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-Dq8y1Qvv.js → emptyVideoElement-CsPLODSh.js} +1 -1
  68. package/dist/assets/epic-AKFDmlZB.js +2 -0
  69. package/dist/assets/{expenseAutomationHelper-aHgcT1ne.js → expenseAutomationHelper-C40iB_7D.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-TCXkWP7P.js → getLocaleForTenant-BdgPeU-B.js} +1 -1
  71. package/dist/assets/{index-CA5QFofF.js → index-BGZGT2EB.js} +1 -1
  72. package/dist/assets/{index-KnYY5zwU.js → index-BWTXRZ02.js} +14315 -14289
  73. package/dist/assets/{index-DJWSjQbN.js → index-C31Y0QTF.js} +1 -1
  74. package/dist/assets/{index-EjAzz8bZ.js → index-CFqdtjWk.js} +2 -2
  75. package/dist/assets/{index-VQSqCSZx.js → index-CGtk3Boq.js} +1 -1
  76. package/dist/assets/{index-7UEr1Awi.js → index-COZnX9q1.js} +1 -1
  77. package/dist/assets/{index-z2tqnUo6.js → index-CtHN3MJR.js} +1 -1
  78. package/dist/assets/{index-B5LYeAvN.js → index-DPWxOeVp.js} +1 -1
  79. package/dist/assets/{lexical-C8BAzKz5.js → lexical-DBQnrckW.js} +1 -1
  80. package/dist/assets/{liveblocks-Cf7-opLz.js → liveblocks-B8NMVuJ_.js} +1 -1
  81. package/dist/assets/{lottie-BpGDoXJk.js → lottie-DZboDKA6.js} +1 -1
  82. package/dist/assets/{mui-CUe0LVoD.js → mui-DB2eP-4H.js} +1 -1
  83. package/dist/assets/{pathToGoBack-kVkV2g_9.js → pathToGoBack-kLAH7lQZ.js} +1 -1
  84. package/dist/assets/{pdf-Du3UOlZ4.js → pdf-ByO6Vz9p.js} +4 -4
  85. package/dist/assets/{pdf-lib-CP93X7zu.js → pdf-lib-B2sKhaXv.js} +1 -1
  86. package/dist/assets/{plaid-BUpPduy-.js → plaid-BjkLQcpb.js} +1 -1
  87. package/dist/assets/{pusher-BOniCLD9.js → pusher-DLAXsv5D.js} +1 -1
  88. package/dist/assets/{react-D4a-GjAE.js → react-3YBksWOJ.js} +1 -1
  89. package/dist/assets/{react-C_H9ts7r.js → react-6e8jc3Wj.js} +1 -1
  90. package/dist/assets/{react-BZ7m_E2Q.js → react-Bdnz9ur-.js} +1 -1
  91. package/dist/assets/{react-CaoFbpB3.js → react-Bnoavnug.js} +1 -1
  92. package/dist/assets/{react-DS3lah6b.js → react-CSeNOqFc.js} +1 -1
  93. package/dist/assets/{react-_CSuBH5V.js → react-DnFO_FFm.js} +1 -1
  94. package/dist/assets/{recharts-VaUsvfKb.js → recharts-DLaK4yUy.js} +1 -1
  95. package/dist/assets/{routePaths-BIMkK6Ss.js → routePaths-D7Q4znoA.js} +1 -1
  96. package/dist/assets/{sentry-Mj6kP2Z9.js → sentry-Di8VmQH9.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-r_gaa4L3.js → stripSplatSuffix-vknm6I0a.js} +1 -1
  98. package/dist/assets/{url-CfMy8sp4.js → url-D-LhAzLP.js} +1 -1
  99. package/dist/assets/{url-D3SIPh4k.js → url-DQtqpgyq.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-DM3M2COt.js → useActualMatchingMatchDetail-BtihcKgk.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CgqjFWAt.js → useAiCfoDashboardSuggestedQuestionsChips-CoIOeMrO.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-2NTBRuLk.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-BeDAIJ0H.js → useChargeCardPusherEvents-CyCKOPqT.js} +1 -1
  104. package/dist/assets/{useDeviceId-CY1W62eM.js → useDeviceId-D9wKXTe6.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-rNalhWMO.js → useEmailConnectResultRefresh-CLDF1mnr.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-DzJGR1TJ.js → useInitialThreadRequest-_cR9E-my.js} +1 -1
  107. package/dist/assets/{useTaskManagerAccess-B4bSQmXP.js → useTaskManagerAccess-DYYDLTVZ.js} +1 -1
  108. package/dist/assets/{useTaskManagerPusherEvents-D_IezYvP.js → useTaskManagerPusherEvents-DaFacbHX.js} +1 -1
  109. package/dist/assets/{utils-BwyofOud.js → utils-cD9C-nwV.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-CBhA4lBe.js → withTransactionSidePanel-BOBG-nk3.js} +1 -1
  111. package/dist/assets/{zeni-epic-state-C-mhDdNi.js → zeni-epic-state-DuYWeJse.js} +5 -5
  112. package/dist/index.html +1 -1
  113. package/package.json +4 -4
  114. package/dist/assets/AddressRoutes-CtpGlrPG.js +0 -1
  115. package/dist/assets/CustomerOnboardingAuthScreen-BDTeb5CM.js +0 -1
  116. package/dist/assets/EntityDetailRoutes-DQTrRkIT.js +0 -1
  117. package/dist/assets/FeaturePreviewScreen-BCNXThsH.js +0 -1
  118. package/dist/assets/MagicLinkSignInScreen-LPwV6caW.js +0 -12
  119. package/dist/assets/MobileAppDrawer-Cuo2h2uO.js +0 -1
  120. package/dist/assets/NotFoundScreen-CdcXQx5L.js +0 -1
  121. package/dist/assets/PerformanceRoutes-BB3hLsCU.js +0 -1
  122. package/dist/assets/ScreenRoutes-Bv6OBZ9-.js +0 -2
  123. package/dist/assets/SignInScreen-BQQKsxyW.js +0 -1
  124. package/dist/assets/SignOutScreen-Cmkalm59.js +0 -9
  125. package/dist/assets/TaskRoutes-DI_c9WWj.js +0 -9
  126. package/dist/assets/TransactionDetailRoutes-DS464M-R.js +0 -1
  127. package/dist/assets/epic-Cgjlnh3D.js +0 -2
  128. package/dist/assets/useAskAiCfoHostNavButtonProps-uoMOLAFI.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as E}from"./liveblocks-Cf7-opLz.js";import{a as A}from"./sentry-Mj6kP2Z9.js";import{i as M,u as H,h as Q,g as ee,j as h,l as te}from"./core-Cj3U3cFh.js";import{Xc as Fe,Xd as Ve,m3 as ae,sB as Ge,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,Xe as Ye,fI as K,Wb as pe,Xf as Se,h2 as ne,cC as le,cD as se,FA as ve,Xg as Ce,FE as Xe,gS as ce,sE as ze,td as qe,dE as Ze,dD as We,Tz as fe,Fy as He,Fs as Qe,Xh as De,Fk as et,Fj as tt,Fe as at,Fp as nt,FF as lt,Xi as Y,Xj as ge,Fl as st,Wc as oe,FV as Ae,FO as Ie,Xk as xe,sH as Te,FI as Be,FG as Le,Xl as Je,G0 as je,FZ as we,FJ as be,F$ as Ne}from"./zeni-epic-state-C-mhDdNi.js";import{a2 as de,aW as ie,aX as ct,z as ot,h as dt,a5 as it,a6 as ue,j as _,at as ut,aY as rt,p as V,G as ye,X as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-KnYY5zwU.js";import{n as re}from"./mui-CUe0LVoD.js";import{p as St}from"./pathToGoBack-kVkV2g_9.js";import W from"./NotFoundScreen-CdcXQx5L.js";import{c as G}from"./routePaths-BIMkK6Ss.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]="5d2fb9e1-80e4-4bd0-a886-5ea579e9a303",e._sentryDebugIdIdentifier="sentry-dbid-5d2fb9e1-80e4-4bd0-a886-5ea579e9a303")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:l}=M(),s=t??l,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,s??""))),p=h((u=>Ve(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{s!=null&&d==null&&m.fetchState==="Not-Started"&&n(Ge(s))}),[s,d,m.fetchState]),A.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?E.jsx(W,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(W,{}):E.jsx(ft,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(s,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(s,u,r))},onSkip:(u,r)=>{n($e(s,u,r))}})})}const ft=re.div`
1
+ import{j as E}from"./liveblocks-B8NMVuJ_.js";import{a as A}from"./sentry-Di8VmQH9.js";import{i as M,u as H,h as Q,g as ee,j as h,l as te}from"./core-CLbwxogo.js";import{Xc as Fe,Xd as Ve,m3 as ae,sB as Ge,sN as Me,t1 as $e,s$ as Re,t2 as Ke,t4 as Ue,Xe as Ye,fI as K,Wb as pe,Xf as Se,h2 as ne,cC as le,cD as se,FA as ve,Xg as Ce,FE as Xe,gS as ce,sE as ze,td as qe,dE as Ze,dD as We,Tz as fe,Fy as He,Fs as Qe,Xh as De,Fk as et,Fj as tt,Fe as at,Fp as nt,FF as lt,Xi as Y,Xj as ge,Fl as st,Wc as oe,FV as Ae,FO as Ie,Xk as xe,sH as Te,FI as Be,FG as Le,Xl as Je,G0 as we,FZ as je,FJ as be,F$ as Ne}from"./zeni-epic-state-DuYWeJse.js";import{a2 as de,aW as ie,aX as ct,z as ot,g as dt,a5 as it,a6 as ue,h as _,at as ut,aY as rt,p as V,G as ye,o as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-BWTXRZ02.js";import{n as re}from"./mui-DB2eP-4H.js";import{p as St}from"./pathToGoBack-kLAH7lQZ.js";import W from"./NotFoundScreen-oJupr3pq.js";import{c as G}from"./routePaths-D7Q4znoA.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]="a82c7566-8a71-4232-8382-fc44238e8a0a",e._sentryDebugIdIdentifier="sentry-dbid-a82c7566-8a71-4232-8382-fc44238e8a0a")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:l}=M(),s=t??l,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,s??""))),p=h((u=>Ve(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{s!=null&&d==null&&m.fetchState==="Not-Started"&&n(Ge(s))}),[s,d,m.fetchState]),A.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?E.jsx(W,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(W,{}):E.jsx(ft,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(s,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(s,u,r))},onSkip:(u,r)=>{n($e(s,u,r))}})})}const ft=re.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -14,7 +14,7 @@ import{j as E}from"./liveblocks-Cf7-opLz.js";import{a as A}from"./sentry-Mj6kP2Z
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,kt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,l=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:l}}}),(function(e,t){const{navigate:c,location:l}=t,s="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(l.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(s,n))},onDelete:n=>{e(st(s,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(lt(s,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,J=I?.selectedOption;e(et({scheduleType:s,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||J==null||e(tt({scheduleType:s}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:l,onPanelCloseAfterDecision:s,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=H(),C=Ee(),{tenantEmailDomain:g}=M(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=M(),v=l??r;let D;v!=="new"&&(D=v);const J=Ct(v),B=h((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),j="accrued_expenses",k=h((L=>Se(L,"accrued_expenses"))),w=h((L=>fe(L))),b=h((L=>L.classListState.fetchState)),x=h((L=>ae(L))),N=w!=="Completed"||b!=="Completed";A.useEffect((()=>{f===!1&&N?(p(He(j,D)),u(!0)):N===!1&&f===!1&&v!=="new"&&(p(Qe(j,v)),u(!0))}),[f]);const P=h((L=>K(L))),T=h((L=>ne(L,P.companyId))),O=I.state?.message==="expenseAutomation",X=h((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:z,scheduleDecisionStatus:q}=ke({jeScheduleId:k.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:k.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:j,onDecided:()=>{if(s==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:L,year:Pe}=X;m(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else s()}}),F=k.fetchState,$=k.allAccountList,Z=k.allClassList,y=k.allAccruedAccountList,S=k.scheduleAccruedDetailsLocalData;if(J!==!0||k.fetchState==="Error")return E.jsx(W,{});const R=F==="Completed"&&f===!0,Oe=k.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?E.jsxs(Et,{children:[R===!0?E.jsx(ue,{analytics:_,onLoad:()=>{vt(k,j,T)}}):null,E.jsx(kt,{onScheduleDecision:U?z:void 0,scheduleDecisionStatus:q,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:k,location:I,navigate:m,classList:Z,accountList:$,shouldNavigateBack:d,accruedAccountList:y,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:_,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=le(c.controllers),n=se(c.controllerUserIds);l!=null&&_.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},schedule:{..._e(l)},vendorName:l.vendor.name??null,controllerEmails:s,controllerUserIds:n})},At=re.div`
17
+ `,kt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,l=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:l}}}),(function(e,t){const{navigate:c,location:l}=t,s="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(l.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(s,n))},onDelete:n=>{e(st(s,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(lt(s,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=V(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,J=I?.selectedOption;e(et({scheduleType:s,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||J==null||e(tt({scheduleType:s}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:l,onPanelCloseAfterDecision:s,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=H(),C=Ee(),{tenantEmailDomain:g}=M(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=M(),v=l??r;let D;v!=="new"&&(D=v);const J=Ct(v),B=h((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),w="accrued_expenses",k=h((L=>Se(L,"accrued_expenses"))),j=h((L=>fe(L))),b=h((L=>L.classListState.fetchState)),x=h((L=>ae(L))),N=j!=="Completed"||b!=="Completed";A.useEffect((()=>{f===!1&&N?(p(He(w,D)),u(!0)):N===!1&&f===!1&&v!=="new"&&(p(Qe(w,v)),u(!0))}),[f]);const P=h((L=>K(L))),T=h((L=>ne(L,P.companyId))),O=I.state?.message==="expenseAutomation",X=h((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:z,scheduleDecisionStatus:q}=ke({jeScheduleId:k.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:k.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:w,onDecided:()=>{if(s==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:L,year:Pe}=X;m(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else s()}}),F=k.fetchState,$=k.allAccountList,Z=k.allClassList,y=k.allAccruedAccountList,S=k.scheduleAccruedDetailsLocalData;if(J!==!0||k.fetchState==="Error")return E.jsx(W,{});const R=F==="Completed"&&f===!0,Oe=k.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?E.jsxs(Et,{children:[R===!0?E.jsx(ue,{analytics:_,onLoad:()=>{vt(k,w,T)}}):null,E.jsx(kt,{onScheduleDecision:U?z:void 0,scheduleDecisionStatus:q,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:k,location:I,navigate:m,classList:Z,accountList:$,shouldNavigateBack:d,accruedAccountList:y,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:_,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=le(c.controllers),n=se(c.controllerUserIds);l!=null&&_.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},schedule:{..._e(l)},vendorName:l.vendor.name??null,controllerEmails:s,controllerUserIds:n})},At=re.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as E}from"./liveblocks-Cf7-opLz.js";import{a as A}from"./sentry-Mj6kP2Z
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,he=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(Ne(i,d,a.length>0))},onDelete:d=>{e(be(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(je(i,d,o))},onJELinkClick:d=>{e(Je({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${G(d,t.tenantEmailDomain)}`,m=V(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${G(d,t.tenantEmailDomain)}`,m=V(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,J=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:J?.zeniId??D?.selectedOption??"",name:J?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:J?.logo},j=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,k=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,w=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,b=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),N=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:k?.accountId,selectedClass:j?.classId,selectedAccumulatedDepreciationCategory:w?.accountId,selectedDate:r,selectedMonths:b,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:N,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||w?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||k?.accountId==null||t.isAccountingClassesEnabled!==!1&&j?.classId==null||r==null||b==null||P!==!0&&N==null||e(Le({scheduleType:i}))}}}))(mt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:l}={})=>{const s=Q(),n=ee(),i=H(),a=Ee(),{tenantEmailDomain:d}=M(),[o,m]=A.useState(!1),{scheduleDetailId:I}=M(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((y=>y.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||s("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((y=>oe(y,u))),v=h((y=>y.entityAutoCompleteState.autoCompleteText.common)),D=h((y=>De(y,"common"))),J=h((y=>fe(y))),B=h((y=>y.classListState.fetchState)),j=h((y=>ae(y))),k=h((y=>ce(y).selectedPeriod)),w=J!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&w?(i(Ae(u,F,!0)),m(!0)):w===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:y,year:S}=k;s(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else s("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const b=h((y=>K(y))),x=h((y=>ne(y,b.companyId))),N=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)s("../schedules/fixed_assets");else{const{month:y,year:S}=k;s(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else c()}}),O=r.fetchState,X=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,q=r.scheduleDetailsLocalData.fixed_assets;let F;if(p!=="new"&&(F=p),g!==!0||r.fetchState==="Error")return E.jsx(W,{});const $=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?E.jsxs(At,{children:[$===!0?E.jsx(ue,{analytics:_,onLoad:()=>{Bt(r,u,x)}}):null,E.jsx(It,{onScheduleDecision:N?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:l,location:n,navigate:s,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(y,S)=>{i(Te(y,S))},accountList:X,depAccountList:z,scheduleLocalData:q,selectedJEScheduleKey:f,scheduleDetailId:F,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:_,controllerUserDetails:x,isAccountingClassesEnabled:j,status:r.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:s.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:s.jeCredit.account?.accountName??null,assetId:s.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Lt=re.div`
25
+ `,he=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(Ne(i,d,a.length>0))},onDelete:d=>{e(be(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(je(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(we(i,d,o))},onJELinkClick:d=>{e(Je({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${G(d,t.tenantEmailDomain)}`,m=V(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${G(d,t.tenantEmailDomain)}`,m=V(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,J=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:J?.zeniId??D?.selectedOption??"",name:J?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:J?.logo},w=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,k=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,j=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,b=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),N=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:k?.accountId,selectedClass:w?.classId,selectedAccumulatedDepreciationCategory:j?.accountId,selectedDate:r,selectedMonths:b,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:N,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||j?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||k?.accountId==null||t.isAccountingClassesEnabled!==!1&&w?.classId==null||r==null||b==null||P!==!0&&N==null||e(Le({scheduleType:i}))}}}))(mt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:l}={})=>{const s=Q(),n=ee(),i=H(),a=Ee(),{tenantEmailDomain:d}=M(),[o,m]=A.useState(!1),{scheduleDetailId:I}=M(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((y=>y.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||s("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((y=>oe(y,u))),v=h((y=>y.entityAutoCompleteState.autoCompleteText.common)),D=h((y=>De(y,"common"))),J=h((y=>fe(y))),B=h((y=>y.classListState.fetchState)),w=h((y=>ae(y))),k=h((y=>ce(y).selectedPeriod)),j=J!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&j?(i(Ae(u,F,!0)),m(!0)):j===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:y,year:S}=k;s(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else s("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const b=h((y=>K(y))),x=h((y=>ne(y,b.companyId))),N=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)s("../schedules/fixed_assets");else{const{month:y,year:S}=k;s(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else c()}}),O=r.fetchState,X=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,q=r.scheduleDetailsLocalData.fixed_assets;let F;if(p!=="new"&&(F=p),g!==!0||r.fetchState==="Error")return E.jsx(W,{});const $=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?E.jsxs(At,{children:[$===!0?E.jsx(ue,{analytics:_,onLoad:()=>{Bt(r,u,x)}}):null,E.jsx(It,{onScheduleDecision:N?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:l,location:n,navigate:s,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(y,S)=>{i(Te(y,S))},accountList:X,depAccountList:z,scheduleLocalData:q,selectedJEScheduleKey:f,scheduleDetailId:F,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:_,controllerUserDetails:x,isAccountingClassesEnabled:w,status:r.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:s.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:s.jeCredit.account?.accountName??null,assetId:s.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Lt=re.div`
26
26
  display: flex;
27
27
  min-height: 100%;
28
28
  width: 100%;
@@ -30,4 +30,4 @@ import{j as E}from"./liveblocks-Cf7-opLz.js";import{a as A}from"./sentry-Mj6kP2Z
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,me=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Jt=te((function(e,t){const c=K(e),l=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:l}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(Ne(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(be(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(je(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Je({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${G(a,t.tenantEmailDomain)}`,o=V(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${G(a,t.tenantEmailDomain)}`,o=V(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,J=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,j=m.map(((x,N)=>({...t.scheduleLocalData.jeScheduleDetails[N],amount:{...t.scheduleLocalData.jeScheduleDetails[N].amount,amount:x.amount}}))),k=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,w=f.type==="lastDayOfMonth"||void 0,b={selectedAccount:J?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:j,lastDayOfMonth:w,selectedVendor:v,selectedDayOfMonth:k};e(Be({scheduleType:t.scheduleTab,localData:b,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||J?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||w!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Xt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:l,onPanelNavigateBack:s}={})=>{const n=Q(),i=ee(),a=H(),d=Ee(),{tenantEmailDomain:o}=M(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=M(),f=t??g,u=jt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),J=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),j=h((S=>fe(S))),k=h((S=>S.classListState.fetchState)),w=h((S=>ae(S))),b=h((S=>ce(S).selectedPeriod)),x=j!=="Completed"||k!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,$,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:R}=b;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const N=h((S=>K(S))),P=h((S=>ne(S,N.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:X}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(l==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:R}=b;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else l()}}),U=D.fetchState,z=D.allAccountList,q=D.allClassList,F=D.scheduleDetailsLocalData;let $;if(f!=="new"&&($=f),u!==!0||D.fetchState==="Error")return E.jsx(W,{});const Z=U==="Completed"&&m===!0,y=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&y?E.jsxs(Lt,{children:[Z===!0?E.jsx(ue,{analytics:_,onLoad:()=>{bt(D,v,P)}}):null,E.jsx(Jt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:X,isRenderedInPanel:e,onPanelNavigateBack:s,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:J,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,R)=>{a(Te(S,R))},expenseAutomationSelectedPeriod:b,navigate:n,classList:q,accountList:z,scheduleLocalData:F[v],selectedJEScheduleKey:r,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:_,controllerUserDetails:P,isAccountingClassesEnabled:w,status:D.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},jt=(e,t)=>pe(e)!=null&&t!=null,wt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),bt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...wt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:s.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Rt as J,Yt as S,Ut as a,Xt as b,Kt as c};
33
+ `,me=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Jt=te((function(e,t){const c=K(e),l=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:l}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(Ne(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(be(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(je(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(we(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Je({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${G(a,t.tenantEmailDomain)}`,o=V(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${G(a,t.tenantEmailDomain)}`,o=V(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,J=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,w=m.map(((x,N)=>({...t.scheduleLocalData.jeScheduleDetails[N],amount:{...t.scheduleLocalData.jeScheduleDetails[N].amount,amount:x.amount}}))),k=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,j=f.type==="lastDayOfMonth"||void 0,b={selectedAccount:J?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:w,lastDayOfMonth:j,selectedVendor:v,selectedDayOfMonth:k};e(Be({scheduleType:t.scheduleTab,localData:b,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||J?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||j!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Xt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:l,onPanelNavigateBack:s}={})=>{const n=Q(),i=ee(),a=H(),d=Ee(),{tenantEmailDomain:o}=M(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=M(),f=t??g,u=wt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),J=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),w=h((S=>fe(S))),k=h((S=>S.classListState.fetchState)),j=h((S=>ae(S))),b=h((S=>ce(S).selectedPeriod)),x=w!=="Completed"||k!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,$,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:R}=b;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const N=h((S=>K(S))),P=h((S=>ne(S,N.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:X}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(l==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:R}=b;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else l()}}),U=D.fetchState,z=D.allAccountList,q=D.allClassList,F=D.scheduleDetailsLocalData;let $;if(f!=="new"&&($=f),u!==!0||D.fetchState==="Error")return E.jsx(W,{});const Z=U==="Completed"&&m===!0,y=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&y?E.jsxs(Lt,{children:[Z===!0?E.jsx(ue,{analytics:_,onLoad:()=>{bt(D,v,P)}}):null,E.jsx(Jt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:X,isRenderedInPanel:e,onPanelNavigateBack:s,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:J,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,R)=>{a(Te(S,R))},expenseAutomationSelectedPeriod:b,navigate:n,classList:q,accountList:z,scheduleLocalData:F[v],selectedJEScheduleKey:r,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:_,controllerUserDetails:P,isAccountingClassesEnabled:j,status:D.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},wt=(e,t)=>pe(e)!=null&&t!=null,jt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),bt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...jt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:s.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Rt as J,Yt as S,Ut as a,Xt as b,Kt as c};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-oJupr3pq.js","assets/sentry-Di8VmQH9.js","assets/core-CLbwxogo.js","assets/zeni-epic-state-DuYWeJse.js","assets/index-BWTXRZ02.js","assets/mui-DB2eP-4H.js","assets/analytics-bcpq8FmH.js","assets/utils-cD9C-nwV.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-Cq-Lxh3h.js","assets/withTransactionSidePanel-BOBG-nk3.js","assets/useAskAiCfoHostNavButtonProps-2NTBRuLk.js","assets/TransactionDetailScreen-DFFAXF6x.js","assets/decodeURIComponentSafe-CTII6a9j.js","assets/useInitialThreadRequest-_cR9E-my.js","assets/routePaths-D7Q4znoA.js","assets/expenseAutomationHelper-C40iB_7D.js","assets/stripSplatSuffix-vknm6I0a.js","assets/analyticsHelper-DTKAaOR4.js","assets/CompanyPassportScreen-LxcAg-6u.js","assets/MobileAppDrawer-CtIgBgQ-.js","assets/InboxNotificationsProvider-T1CjerOs.js","assets/useTaskManagerAccess-DYYDLTVZ.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CoIOeMrO.js","assets/FeaturePreviewScreen-CZR8YW-L.js","assets/BillPayRoutes-pg5PH9Oh.js","assets/AddressScreen-CbqqBPeg.js","assets/DomesticWireDetailScreen-BSEUD6C3.js","assets/BusinessVerificationPageScreen-B81g6W18.js","assets/DrawerScreen-CBAh6dJa.js","assets/SetupPagesScreen-CUiMxOyt.js","assets/BillPayApprovalRoutes-BG_fZlTC.js","assets/ReimbursementApprovalRuleDetailScreen-CKOH-HzU.js","assets/getLocaleForTenant-BdgPeU-B.js","assets/ReimbursementRoutes-D1jTtRL_.js","assets/ReimbursementApprovalRoutes-Dm2Et1-C.js","assets/TransactionListRoutes-bvLvzle-.js","assets/ZeniAccountStatementScreen-ulCu2kq_.js","assets/SettingsRoutes-BK2pVuXm.js","assets/AccountMappingScreen-BXvURRvs.js","assets/QBOConnectionScreen-B_IVukb7.js","assets/empty-BdckjUGv.js","assets/index-C31Y0QTF.js","assets/url-D-LhAzLP.js","assets/index-CtHN3MJR.js","assets/accountMappingHelper-Cl-vw8fd.js","assets/useEmailConnectResultRefresh-CLDF1mnr.js","assets/ReportsRoutes-DwdL-iuL.js","assets/ChargeCardRoutes-STh2Wp7w.js","assets/useChargeCardPusherEvents-CyCKOPqT.js","assets/PeopleRoutes-CCoQcfmM.js","assets/ExpenseAutomationRoutes-FZqTLeVo.js","assets/useActualMatchingMatchDetail-BtihcKgk.js","assets/ScheduleDetailsPrepaidExpensesScreen-BTUJ8zwC.js","assets/pathToGoBack-kLAH7lQZ.js","assets/TreasuryRoutes-DYIO-YgE.js","assets/VendorsRoutes-DxWng3tY.js","assets/ZeniAccountRoutes-bTRWcMAn.js","assets/AddressRoutes-CRV9O3fJ.js","assets/PandLWithForecastRoutes-DyZHHb1Z.js","assets/CustomerOnboardingRoutes-CNIJctLU.js","assets/TransactionDetailRoutes-Cii1a7bV.js","assets/EntityDetailRoutes-CKxj6mH-.js","assets/InvoicingRoutes-Ys89tvz2.js","assets/NotificationRoutes-DPQX5f6K.js","assets/PerformanceRoutes-Bx8pszb9.js","assets/ActualMatchingMatchDetailScreen-CkPu1Iyz.js","assets/RewardsRoutes-CKpKVKBM.js","assets/TaskRoutes-hldsrW8n.js","assets/TaskListScreen-DHzPd6H5.js","assets/useTaskManagerPusherEvents-DaFacbHX.js","assets/AiCfoScreen-Akbbu7OO.js","assets/CardsAiCfoScreen-hMGqj2aq.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as Es,fI as hs,e0 as ps,d$ as xs,Bl as gs,dj as Rs,c9 as Is,gM as js,gc as Ts,dg as pe,cH as As,gq as bs,cz as Ds,bF as fs,br as ys,UE as vs,v as Cs,UH as Os,bq as Us,UI as Ps,bL as ws,bK as Fs,bu as Ls,cv as Hs,UJ as Vs,UK as ks,db as Bs,de as Ss,dd as Ns,cG as Ms,cN as Zs,pW as xe,gl as ge,h0 as $s,gn as Re,gO as Ie,gP as je,go as zs}from"./zeni-epic-state-DuYWeJse.js";import{j as e}from"./liveblocks-B8NMVuJ_.js";import{a as P}from"./sentry-Di8VmQH9.js";import{N as u,u as Gs,h as qs,i as Ws,g as Ks,j as $,q as Te,n as Ys,o as n}from"./core-CLbwxogo.js";import{I as l,u as Js,z as y,W as Xs,d as Qs,X as et,A as S,f as st,J as tt,V as nt,L as F,G as Ae,t as _,P as at,K as ot,h as ne}from"./index-BWTXRZ02.js";import{u as rt}from"./mui-DB2eP-4H.js";import{f as be}from"./analyticsHelper-DTKAaOR4.js";import{t as it}from"./getLocaleForTenant-BdgPeU-B.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="68c00621-43dc-484a-8e1a-51e343f0eb2d",o._sentryDebugIdIdentifier="sentry-dbid-68c00621-43dc-484a-8e1a-51e343f0eb2d")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-oJupr3pq.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:H,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(H===!0){if(o)return e.jsx(fe,{tenantEmailDomain:C});if(i)return e.jsx(De,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(fe,{tenantEmailDomain:C}):i?e.jsx(De,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):D?e.jsx(dt,{tenantEmailDomain:C}):N?e.jsx(ut,{tenantEmailDomain:C}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-Cq-Lxh3h.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-pg5PH9Oh.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-D1jTtRL_.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-bvLvzle-.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-BK2pVuXm.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-DwdL-iuL.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-STh2Wp7w.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-CCoQcfmM.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-FZqTLeVo.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-DYIO-YgE.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-DxWng3tY.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-bTRWcMAn.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-DwdL-iuL.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),Et=l((()=>s((()=>import("./AddressRoutes-CRV9O3fJ.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),ht=l((()=>s((()=>import("./PeopleRoutes-CCoQcfmM.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-DyZHHb1Z.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-CNIJctLU.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),gt=l((()=>s((()=>import("./VendorsRoutes-DxWng3tY.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),Rt=l((()=>s((()=>import("./TransactionDetailRoutes-Cii1a7bV.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-CKxj6mH-.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),It=l((()=>s((()=>import("./DashboardRoutes-Cq-Lxh3h.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),Ce=l((()=>s((()=>import("./BillPayRoutes-pg5PH9Oh.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),jt=l((()=>s((()=>import("./SettingsRoutes-BK2pVuXm.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-Ys89tvz2.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-D1jTtRL_.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-bTRWcMAn.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),bt=l((()=>s((()=>import("./TreasuryRoutes-DYIO-YgE.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),Dt=l((()=>s((()=>import("./TransactionListRoutes-bvLvzle-.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),ft=l((()=>s((()=>import("./ChargeCardRoutes-STh2Wp7w.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-DPQX5f6K.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),vt=l((()=>s((()=>import("./PerformanceRoutes-Bx8pszb9.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ct=l((()=>s((()=>import("./ExpenseAutomationRoutes-FZqTLeVo.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-CkPu1Iyz.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ut=l((()=>s((()=>import("./RewardsRoutes-CKpKVKBM.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-hldsrW8n.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-Akbbu7OO.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-hMGqj2aq.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-oJupr3pq.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-DHzPd6H5.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:H,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:V})=>{if(O===!0){if(D)return e.jsx(u,{to:"checking"});if(H)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return C===!0&&V?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):H?e.jsx(u,{to:"treasury"}):V?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),$t=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=Gs(),N=qs(),{tenantEmailDomain:i}=Ws(),H=rt().mode,{setLoading:O,clearAllLoading:C,clearLoading:V}=Js(),f=y.getSignedInUserTenant(i)?.tenantId,j=y.getSignedInUser(),Y=Es(j),z=Ks(),[L,we]=P.useState(!1),r=$((a=>hs(a))),{useFeatureGate:k}=Xs(),M=Qs(),J=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=k(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=k(S.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?ps(oe,r):void 0,X=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?gs(r)&&!Rs(r):void 0,Ve=st(r,He,oe),{isCardsHidden:ke}=tt(r?.tenantId),Be=!Ve||!!ke,{isFeatureEnabled:Se}=k(S.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=k(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=k(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),G=$((a=>js(a)));if(i!=null){const a=y.getSignedInUserTenant(i);j!=null&&a!=null&&be(j,r,H)}const Z={tenantId:f,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Ts(),h=nt(),$e=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),ze=As(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,Ge=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Ge?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&f!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=fs(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?D(vs(f,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,f]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,j,D,y]),P.useLayoutEffect((()=>{!Cs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,D,qe))}),[f]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,B){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const W=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(W&&cs){B(Re(t));const K=y.getSignedInUserTenantWithId(t);K?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(K?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)))}else W&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),W&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)));if(W){ne.identify(d.userId,{tenant_id:t});const K=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),B(zs(d.userId,t,d.zeniSessionId))),K&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(T,p,r,f,j,O,D))}),[f,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&G.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(G.tenantsBaseInOrder)),j!=null&&be(j,r,H,void 0,G.tenantsBaseInOrder))}),[G,T,r,j]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&f!=null?(C(),_.markActiveTenantFetchCompleted(f)):p==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),V(F.TENANT_FETCHING),V(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,f,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:We}=k(S.isReferralFeatureEnabled),{isFeatureEnabled:Ke}=k(S.isAccrualEnabled),Ye=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Je=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Be&&!U,Xe=Ps(h?.loggedInUserRoleMap),Qe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&ws(h?.loggedInUserRoleMap),_e=Fe&&!U,ss=Le&&!U,ts=ue&&Fs(h?.loggedInUserRoleMap),ns=de&&Ls(h?.loggedInUserRoleMap),as=_e&&Hs(h?.loggedInUserRoleMap),os=Vs(h?.loggedInUserRoleMap),rs=ks(h?.loggedInUserRoleMap),is=Bs(h?.loggedInUserRoleMap),ls=Ss(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),x=Ms(h?.loggedInUserRoleMap),g=Zs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&is,I=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||ze===!0||Xe===!0||os===!0||rs===!0;return y.isSignedIn()?f==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(j!=null&&T!=="In-Progress"&&D(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||Y&&!ee)&&es&&Qe!==!0&&E===!1&&X===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||Y?!L||te!==!1||ee||Y?L&&r?.userRole&&E!=null&&X!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ys,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(It,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(ht,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Ye||Je?e.jsx(Rt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(Dt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Pt,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(Et,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:J===!0?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:J===!0&&U===!1?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:J===!0&&U===!1&&Ke===!0?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:$e?e.jsx(gt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(jt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(ft,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:We?e.jsx(Ut,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,$t as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-Cf7-opLz.js";import{a as d}from"./sentry-Mj6kP2Z9.js";import{h as L,g as H,u as U,i as N,j as C,l as K,n as J,o as k}from"./core-Cj3U3cFh.js";import{fI as w,ZT as Pe,O1 as ve,Zq as we,Zz as Ae,c9 as X,cU as _e,cV as De,bq as Ue,df as Re,Gj as Te,ZU as Me,Pu as Be,MU as Oe,ML as de,MI as Ve,Gn as ue,MO as pe,MR as ge,MX as Y,Cx as ee,Gm as Fe,ly as $,lB as me,ZV as Le,mL as Ne,GE as Ze,W5 as Ge,W6 as $e,lw as He,ZW as Ke,lz as We,uL as ze,W0 as qe,W1 as Je,uP as Qe,hZ as Xe,U$ as q,hR as ae,hO as Ye,hW as en,V0 as nn,GB as tn,ZX as an,ZY as on,N9 as sn,m3 as rn,d$ as fe,e0 as he,ZZ as ln,gF as cn,Vf as dn,GA as oe,gK as se,gJ as un,Gz as pn,gI as gn,gH as mn,Z_ as fn,Ur as Ce,Z$ as hn,_0 as Cn,_1 as yn,_2 as bn,_3 as Sn,_4 as In,GH as xn,_5 as En,Gy as ie,Gs as G,_6 as kn,_7 as jn,_8 as re,_9 as Pn,dU as vn,_a as wn,_b as An,_c as _n,UD as Dn,c1 as Un,c8 as Rn,c7 as Tn,c2 as Mn,_d as Bn,c5 as On,c4 as Vn,c6 as Fn,c3 as Ln}from"./zeni-epic-state-C-mhDdNi.js";import{bR as Nn,z as v,V as Z,a5 as ne,c1 as Zn,j as W,W as te,A as V,g as ye,H as be,c2 as Gn,h as $n,U as Se,c3 as Hn,ag as Kn,c4 as Wn,c5 as zn,ao as qn,c6 as Jn,p as Qn,c as Ie,c7 as Xn}from"./index-KnYY5zwU.js";import{n as B}from"./mui-CUe0LVoD.js";import{u as xe}from"./useTaskManagerAccess-B4bSQmXP.js";import{U as Yn}from"./AccountMappingScreen-BuwkeoBc.js";import{t as et,A as nt}from"./AddressScreen-BQzZxu3k.js";import F from"./NotFoundScreen-CdcXQx5L.js";import{g as tt}from"./analyticsHelper-ClHM6CQs.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-DIQMAYWw.js";import{C as st}from"./CompanyPassportScreen-DY8v9wzP.js";import{M as T}from"./MobileAppDrawer-Cuo2h2uO.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-rNalhWMO.js";import{q as le}from"./QBOConnectionScreen-CjVsbpZ2.js";import{B as lt}from"./BillPayApprovalRoutes-k2-8BIKO.js";import{R as ct}from"./ReimbursementApprovalRoutes-iazqFfnr.js";import"./recharts-VaUsvfKb.js";import"./analytics-C3OGAM2y.js";import"./plaid-BUpPduy-.js";import"./dnd-Dih1Xu4b.js";import"./stripe-cKAAJElX.js";import"./lottie-BpGDoXJk.js";import"./lexical-C8BAzKz5.js";import"./pdf-Du3UOlZ4.js";import"./utils-BwyofOud.js";import"./accountMappingHelper-Cn1k0M89.js";import"./routePaths-BIMkK6Ss.js";import"./InboxNotificationsProvider-Y4y90RT-.js";import"./empty-CuNFLk2m.js";import"./pdf-lib-CP93X7zu.js";import"./index-DJWSjQbN.js";import"./url-CfMy8sp4.js";import"./index-z2tqnUo6.js";import"./decodeURIComponentSafe-W__PfZ-Y.js";import"./ReimbursementApprovalRuleDetailScreen-CQPH9FaV.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="789389d6-eb54-44a7-8008-7ee9a5bcbbc0",e._sentryDebugIdIdentifier="sentry-dbid-789389d6-eb54-44a7-8008-7ee9a5bcbbc0")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-B8NMVuJ_.js";import{a as d}from"./sentry-Di8VmQH9.js";import{h as L,g as H,u as U,i as N,j as C,l as K,n as J,o as k}from"./core-CLbwxogo.js";import{fI as w,ZT as je,O1 as ve,Zq as we,Zz as Ae,c9 as X,cU as _e,cV as De,bq as Ue,df as Re,Gj as Te,ZU as Me,Pu as Be,MU as Oe,ML as de,MI as Ve,Gn as ue,MO as pe,MR as ge,MX as Y,Cx as ee,Gm as Fe,ly as $,lB as me,ZV as Le,mL as Ne,GE as Ze,W5 as Ge,W6 as $e,lw as He,ZW as Ke,lz as We,uL as ze,W0 as qe,W1 as Je,uP as Qe,hZ as Xe,U$ as q,hR as ae,hO as Ye,hW as en,V0 as nn,GB as tn,ZX as an,ZY as on,N9 as sn,m3 as rn,d$ as fe,e0 as he,ZZ as ln,gF as cn,Vf as dn,GA as oe,gK as se,gJ as un,Gz as pn,gI as gn,gH as mn,Z_ as fn,Ur as Ce,Z$ as hn,_0 as Cn,_1 as yn,_2 as Sn,_3 as bn,_4 as In,GH as xn,_5 as En,Gy as ie,Gs as G,_6 as kn,_7 as Pn,_8 as re,_9 as jn,dU as vn,_a as wn,_b as An,_c as _n,UD as Dn,c1 as Un,c8 as Rn,c7 as Tn,c2 as Mn,_d as Bn,c5 as On,c4 as Vn,c6 as Fn,c3 as Ln}from"./zeni-epic-state-DuYWeJse.js";import{bR as Nn,z as v,V as Z,a5 as ne,c1 as Zn,h as W,W as te,A as V,f as ye,J as Se,c2 as Gn,g as $n,T as be,c3 as Hn,ag as Kn,c4 as Wn,c5 as zn,ao as qn,c6 as Jn,p as Qn,c as Ie,c7 as Xn}from"./index-BWTXRZ02.js";import{n as B}from"./mui-DB2eP-4H.js";import{u as xe}from"./useTaskManagerAccess-DYYDLTVZ.js";import{U as Yn}from"./AccountMappingScreen-BXvURRvs.js";import{t as et,A as nt}from"./AddressScreen-CbqqBPeg.js";import F from"./NotFoundScreen-oJupr3pq.js";import{g as tt}from"./analyticsHelper-DTKAaOR4.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-B81g6W18.js";import{C as st}from"./CompanyPassportScreen-LxcAg-6u.js";import{M as T}from"./MobileAppDrawer-CtIgBgQ-.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-CLDF1mnr.js";import{q as le}from"./QBOConnectionScreen-B_IVukb7.js";import{B as lt}from"./BillPayApprovalRoutes-BG_fZlTC.js";import{R as ct}from"./ReimbursementApprovalRoutes-Dm2Et1-C.js";import"./recharts-DLaK4yUy.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.js";import"./accountMappingHelper-Cl-vw8fd.js";import"./routePaths-D7Q4znoA.js";import"./InboxNotificationsProvider-T1CjerOs.js";import"./empty-BdckjUGv.js";import"./pdf-lib-B2sKhaXv.js";import"./index-C31Y0QTF.js";import"./url-D-LhAzLP.js";import"./index-CtHN3MJR.js";import"./decodeURIComponentSafe-CTII6a9j.js";import"./ReimbursementApprovalRuleDetailScreen-CKOH-HzU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="ed12b44a-ec17-4be5-a4c9-f64e65a35caa",e._sentryDebugIdIdentifier="sentry-dbid-ed12b44a-ec17-4be5-a4c9-f64e65a35caa")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-Cf7-opLz.js";import{a as d}from"./sentry-Mj6kP2Z
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ut=K((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(X(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Zn),pt=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:b,isLoading:m}=Nn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const S=Z();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,b)))}),[t,u,m,b,c?.tenantId,o]);const E=g=>{n(g)};return S?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:S.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
9
+ `,ut=K((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(X(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Zn),pt=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>je(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Nn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=Z();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-Cf7-opLz.js";import{a as d}from"./sentry-Mj6kP2Z
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(Y(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Oe(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),r=Z(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,b]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),S=_e(m,r?.loggedInUserRoleMap),E=De(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Ue(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),_=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=be(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(b(!0),o(Te(!1)))}),[h,o,p]);const M=A=>{u(A)};return S||P||E||_?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:S,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:_,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(F,{})},ht=B.div`
17
+ `,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(Y(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Oe(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),r=Z(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=_e(m,r?.loggedInUserRoleMap),E=De(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Ue(m.userRole),j=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,P=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),_=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Te(!1)))}),[h,o,p]);const M=A=>{u(A)};return b||j||E||_?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:j,isChargeCardEnabled:_,isChargeCardsHidden:I,isTreasuryEnabled:P,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(F,{})},ht=B.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-Cf7-opLz.js";import{a as d}from"./sentry-Mj6kP2Z
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ct=K((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Le(e,o),{uiState:t}=n,s=(X(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Se.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(Y(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Ne({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>w(j))),b=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(b.addCardPaymentSourceStatus.fetchState),S=b.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=Z();d.useEffect((()=>{E!=null&&o(Fe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&S==="Completed"&&o($())}),[p,S]);const P=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:Se.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Q="external_integrations",bt=K((function(e){const l=Je(e,Q);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const b="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(b)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Ye(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Xe(t,q("payments"),s))},onNotifyMe:s=>{W.trackIntegrationsNotifyMeClicked("Settings",s),e(Qe(Q,s,r))}}}))(Wn),St=()=>{const e=Kn(),l=L(),o=U(),{tenantEmailDomain:i}=N(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),b=Z(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Q))}),[o]);const[p,S]=d.useState(!1);d.useEffect((()=>{p||(S(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>qe(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:_}=rt({companyId:u??c.companyId});return b?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(bt,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:R,onReLoginPlaidAccount:_,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
25
+ `,Ct=K((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Le(e,o),{uiState:t}=n,s=(X(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(Y(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Ne({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=L(),l=H(),o=U(),{tenantEmailDomain:i}=N(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((P=>w(P))),S=C((P=>P.cardPaymentViewState)),m=C((P=>P.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=Z();d.useEffect((()=>{E!=null&&o(Fe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o($())}),[p,b]);const j=P=>{n(P)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:j}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Q="external_integrations",St=K((function(e){const l=Je(e,Q);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Ye(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Xe(t,q("payments"),s))},onNotifyMe:s=>{W.trackIntegrationsNotifyMeClicked("Settings",s),e(Qe(Q,s,r))}}}))(Wn),bt=()=>{const e=Kn(),l=L(),o=U(),{tenantEmailDomain:i}=N(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=Z(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Q))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>qe(I,u))),j=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:P,onAddPlaidAccount:R,onReLoginPlaidAccount:_}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:P,onAddPlaidAccount:R,onReLoginPlaidAccount:_,plaidConnectionDetails:j})]}):a.jsx(ne,{fetchState:s})},It=B.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-Cf7-opLz.js";import{a as d}from"./sentry-Mj6kP2Z
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,Et=()=>{const e=U(),{tenantEmailDomain:l}=N(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),b=d.useCallback((p=>{e(Y(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(T,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:b,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
41
+ `,Et=()=>{const e=U(),{tenantEmailDomain:l}=N(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(Y(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(T,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-Cf7-opLz.js";import{a as d}from"./sentry-Mj6kP2Z
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,ce=({appContent:e})=>{const l=U(),o=L(),i=H(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:b}=u(V.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(V.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=C((y=>rn(y))),E=fe(t),g=he(m,t),P=!g&&S,j=ye(t,b,m),{isCardsHidden:R}=be(t?.tenantId),_=!j||R,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((y=>cn(y,P))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,D=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:D}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:x,isAccountingClassesEnabled:S,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:_,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{D(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const O=(function(ke,je){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${je}`),z})(s,y),Ee=Qn(i.state?.pathnameStackToGoBack,i.pathname);o(O,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const O={...x.myProfileLocalData,phone:y};l(oe({localData:O})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,O)=>{l(un(y,O,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&v.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function jt(){const e=U(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:b}=xe(u),[m,p]=d.useState(!1),S=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(bn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(Sn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),_=d.useCallback(((f,D,y)=>{e(jn({eventId:f,channel:re(D),enabled:y}))}),[e]),I=d.useCallback(((f,D)=>{e(Pn({groupId:f,frequency:vn(D)}))}),[e]),x=d.useCallback(((f,D,y)=>{e(wn({groupId:f,channel:re(D),enabled:y}))}),[e]),M=d.useMemo((()=>{if(b&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:_,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[b,h,t,s,_,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(_n()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(T,{isAppContentDrawerOpen:m,handleDrawerToggle:S}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{S(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:R,taskNotifications:M,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((S=>Ce(S))),r=C((S=>w(S))),n=Z(),t=Ie(),s=U(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(V.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),b=t?.userEmail==null||i.fetchState!=="Completed"||Dn(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||b!==!0?Un(r)?a.jsxs(J,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Yn,{})}),Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),On(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Fn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Ln(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(St,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),b&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]}):a.jsx(J,{children:a.jsx(k,{path:"*",element:a.jsx(F,{})})}):null}function Pt(e){return a.jsxs(J,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(F,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]})}export{da as default};
49
+ `,ce=({appContent:e})=>{const l=U(),o=L(),i=H(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(V.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(V.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),j=!g&&b,P=ye(t,S,m),{isCardsHidden:R}=Se(t?.tenantId),_=!P||R,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,j))}),[c,l,j,I]);const x=C((y=>cn(y,j))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,D=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:D}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:_,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{D(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const O=(function(ke,Pe){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${Pe}`),z})(s,y),Ee=Qn(i.state?.pathnameStackToGoBack,i.pathname);o(O,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const O={...x.myProfileLocalData,phone:y};l(oe({localData:O})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,O)=>{l(un(y,O,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&v.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function Pt(){const e=U(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),j=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const P=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),_=d.useCallback(((f,D,y)=>{e(Pn({eventId:f,channel:re(D),enabled:y}))}),[e]),I=d.useCallback(((f,D)=>{e(jn({groupId:f,frequency:vn(D)}))}),[e]),x=d.useCallback(((f,D,y)=>{e(wn({groupId:f,channel:re(D),enabled:y}))}),[e]),M=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:_,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,_,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(_n()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(T,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:j,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:P,resetUpdateStatus:R,taskNotifications:M,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>w(b))),n=Z(),t=Ie(),s=U(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(V.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Dn(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Un(r)?a.jsxs(J,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Yn,{})}),Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(jt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),On(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Fn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Ln(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(Pt,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]}):a.jsx(J,{children:a.jsx(k,{path:"*",element:a.jsx(F,{})})}):null}function jt(e){return a.jsxs(J,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(F,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]})}export{da as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-Cf7-opLz.js";import{h as Y,g as X,u as ee,i as W,j as _,N as R,l as H,t as en}from"./core-Cj3U3cFh.js";import{bK as nn,fI as x,cH as tn,Ib as J,Zq as an,Zt as sn,v2 as ne,uS as te,mD as ae,C3 as N,Zv as be,gJ as He,gI as Ge,gH as Ke,Zw as on,Ik as cn,MU as Ce,ML as he,MI as Ie,Mn as Q,MO as Ae,MR as ke,MX as _e,Cx as ve,h2 as rn,cC as un,e0 as dn,d$ as ln,dj as pn,bu as mn,cv as Fe,Zx as yn,Ln as fe,L$ as fn,Zy as gn,bL as Sn,Od as ge,O1 as bn,Zz as Cn,ZA as hn,Oh as In,Ol as An,ZB as je,BY as kn,SM as _n,ZC as vn,ZD as Pn,ZE as Tn,ZF as qe,ZG as En,ZH as Dn,VQ as On,YH as Un,W3 as wn,ZI as Je,Mz as Fn,Mr as xn,W4 as Vn,Mv as Bn,ZJ as Ue,P1 as Qe,mL as jn,uV as Ye,C5 as Rn,bF as Re,Ch as Le,cF as Ln,ZK as Xe,OT as we,OA as Nn,OB as Mn,OF as zn,ZL as Zn,OW as Ne,ZM as $n,ZN as Wn,ZO as Hn,PI as Se,ZP as Gn,gZ as Kn,Jw as qn,ZQ as Jn,JB as Qn,JA as Yn}from"./zeni-epic-state-C-mhDdNi.js";import{ag as Pe,V as ie,W as de,A as q,z as E,a6 as se,j as D,a5 as Te,N as $,bO as Xn,ac as oe,bP as V,bg as xe,bQ as et,bR as nt,bS as tt,n as Be,bT as at,p as Me,aE as ze,$ as it,a9 as st,bU as ot,bV as ct,bW as rt,w as ut}from"./index-KnYY5zwU.js";import{a as h}from"./sentry-Mj6kP2Z9.js";import{u as Ee,n as Ve,D as dt,S as lt}from"./mui-CUe0LVoD.js";import{u as pt,d as Ze,B as Oe}from"./BusinessVerificationPageScreen-DIQMAYWw.js";import{M as le}from"./MobileAppDrawer-Cuo2h2uO.js";import L from"./NotFoundScreen-CdcXQx5L.js";import{a as $e}from"./analyticsHelper-ClHM6CQs.js";import{d as We}from"./routePaths-BIMkK6Ss.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]="16258408-e1ce-419f-b6e9-b3e9f58a96cc",e._sentryDebugIdIdentifier="sentry-dbid-16258408-e1ce-419f-b6e9-b3e9f58a96cc")}catch{}})();const mt=Ve.div`
1
+ import{j as u}from"./liveblocks-B8NMVuJ_.js";import{h as Y,g as X,u as ee,i as W,j as _,N as R,l as H,t as en}from"./core-CLbwxogo.js";import{bK as nn,fI as x,cH as tn,Ib as J,Zq as an,Zt as sn,v2 as ne,uS as te,mD as ae,C3 as N,Zv as be,gJ as He,gI as Ge,gH as Ke,Zw as on,Ik as cn,MU as Ce,ML as he,MI as Ie,Mn as Q,MO as Ae,MR as ke,MX as _e,Cx as ve,h2 as rn,cC as un,e0 as dn,d$ as ln,dj as pn,bu as mn,cv as Fe,Zx as yn,Ln as fe,L$ as fn,Zy as gn,bL as Sn,Od as ge,O1 as bn,Zz as Cn,ZA as hn,Oh as In,Ol as An,ZB as je,BY as kn,SM as _n,ZC as vn,ZD as Pn,ZE as Tn,ZF as qe,ZG as En,ZH as Dn,VQ as On,YH as Un,W3 as wn,ZI as Je,Mz as Fn,Mr as xn,W4 as Vn,Mv as Bn,ZJ as Ue,P1 as Qe,mL as jn,uV as Ye,C5 as Rn,bF as Re,Ch as Le,cF as Ln,ZK as Xe,OT as we,OA as Nn,OB as Mn,OF as zn,ZL as Zn,OW as Ne,ZM as $n,ZN as Wn,ZO as Hn,PI as Se,ZP as Gn,gZ as Kn,Jw as qn,ZQ as Jn,JB as Qn,JA as Yn}from"./zeni-epic-state-DuYWeJse.js";import{ag as Pe,V as ie,W as de,A as q,z as E,a6 as se,h as D,a5 as Te,N as $,bO as Xn,ac as oe,bP as V,bg as xe,bQ as et,bR as nt,bS as tt,l as Be,bT as at,p as Me,aE as ze,$ as it,a9 as st,bU as ot,bV as ct,bW as rt,w as ut}from"./index-BWTXRZ02.js";import{a as h}from"./sentry-Di8VmQH9.js";import{u as Ee,n as Ve,D as dt,S as lt}from"./mui-DB2eP-4H.js";import{u as pt,d as Ze,B as Oe}from"./BusinessVerificationPageScreen-B81g6W18.js";import{M as le}from"./MobileAppDrawer-CtIgBgQ-.js";import L from"./NotFoundScreen-oJupr3pq.js";import{a as $e}from"./analyticsHelper-DTKAaOR4.js";import{d as We}from"./routePaths-D7Q4znoA.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]="67601190-9ea5-47cd-ab50-486830b95544",e._sentryDebugIdIdentifier="sentry-dbid-67601190-9ea5-47cd-ab50-486830b95544")}catch{}})();const mt=Ve.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-B8NMVuJ_.js";import{a as u,R as b,t as A}from"./sentry-Di8VmQH9.js";import{u as z,h as D,j as l,g as M,N as O,l as P}from"./core-CLbwxogo.js";import{u as j,z as s,h as E,G as F,M as N,N as _,O as B,R,S as V,T as v}from"./index-BWTXRZ02.js";import{fI as $,Un as H,UH as J,gl as W,gn as Y,UM as q,gY as G,dk as K,UN as y,UO as Q,UP as X,c0 as U}from"./zeni-epic-state-DuYWeJse.js";import{u as Z}from"./mui-DB2eP-4H.js";import{u as ee}from"./useDeviceId-D9wKXTe6.js";import{f as te}from"./analyticsHelper-DTKAaOR4.js";import{t as ne}from"./getLocaleForTenant-BdgPeU-B.js";import"./recharts-DLaK4yUy.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.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]="ae54e72a-0928-4f3f-98d7-6c6cf06866fd",t._sentryDebugIdIdentifier="sentry-dbid-ae54e72a-0928-4f3f-98d7-6c6cf06866fd")}catch{}})();const ie=P((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(X({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(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(y())}}}))(V),ae=b.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:C,accountUnlockTime:h}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>$(e))),I=l((e=>H(e))),m=M(),w=Z().mode,x=m.state?.magicLinkExpired,T=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(Y(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(q("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then((()=>{const e=R();e!=null&&N(e)})),setTimeout((()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,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:!!x,magicLinkAlreadyUsed:!!T,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&h!=null?f.jsx(B,{onClose:()=>i(y()),unlockDate:h}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as a}from"./liveblocks-B8NMVuJ_.js";import{a as s}from"./sentry-Di8VmQH9.js";import{u as l,g as f,N as u}from"./core-CLbwxogo.js";import{z as i,h as n,N as m,a5 as p}from"./index-BWTXRZ02.js";import{g$ as g,V1 as y}from"./zeni-epic-state-DuYWeJse.js";import{n as b}from"./mui-DB2eP-4H.js";import"./recharts-DLaK4yUy.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.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]="1ceba2ba-2204-411a-aa4d-73c62648a41d",e._sentryDebugIdIdentifier="sentry-dbid-1ceba2ba-2204-411a-aa4d-73c62648a41d")}catch{}})();function L(){const e=l(),t=f(),r=s.useRef(!1),c=i.isSignedIn(),o=t.state?.message==="logout"||c;return s.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),n.trackLogout(m.Event.logoutSuccess),n.resetUserIdentity(),i.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?a.jsx(h,{children:a.jsx(p,{fetchState:"In-Progress"})}):a.jsx(u,{to:"../",replace:!0})}const h=b.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{L as default};
@@ -1,4 +1,4 @@
1
- import{j as A}from"./liveblocks-Cf7-opLz.js";import{a as u}from"./sentry-Mj6kP2Z9.js";import{u as H,k as J,j as C,h as me,g as Se,i as ye,l as De}from"./core-Cj3U3cFh.js";import{z as Z,W as Ee,A as I,aq as be,a6 as he,j as Ce,N as Ge,e3 as Ae,p as F,a2 as Ie}from"./index-KnYY5zwU.js";import{Qz as Re,Rn as ve,fI as Be,a2C as ne,gQ as q,a2D as re,a2y as Le,QR as X,a2E as Ke,R3 as Y,QB as we,Qd as Ue,Rz as ee,a2F as ae,gk as Pe,Rq as Fe,Rv as je,Ri as xe,Rg as te,Rw as $e,Rd as Ne,a2G as Oe,a2H as ze,a2I as Qe,a2J as Ze,a2K as R,dy as qe,dx as Me,a2L as Ve,Qy as We}from"./zeni-epic-state-C-mhDdNi.js";import{n as He}from"./mui-CUe0LVoD.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-uoMOLAFI.js";import{M as Xe}from"./MobileAppDrawer-Cuo2h2uO.js";import{u as Ye}from"./useTaskManagerPusherEvents-D_IezYvP.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]="cd8dc281-4ec0-4e74-ac35-1dfc53de63f2",e._sentryDebugIdIdentifier="sentry-dbid-cd8dc281-4ec0-4e74-ac35-1dfc53de63f2")}catch{}})();const _={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},ea=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),aa=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),j=e=>Array.isArray(e)&&e.every((t=>typeof t=="string")),oe=e=>typeof e.task_id=="string"?e.task_id:typeof e.id=="string"?e.id:null,ga=e=>{if(e==null||typeof e!="object")return null;const t=e,n=oe(t);if(n==null)return null;const c={task_id:n};return typeof t.parent_task_id=="string"&&(c.parent_task_id=t.parent_task_id),typeof t.sync_token=="string"&&(c.sync_token=t.sync_token),typeof t.is_deleted=="boolean"&&(c.is_deleted=t.is_deleted),typeof t.is_private=="boolean"&&(c.is_private=t.is_private),c},ta=e=>{if(e==null||typeof e!="object")return null;const t=e;return j(t.task_ids)?{task_ids:t.task_ids}:null},_a=e=>{if(e==null||typeof e!="object")return null;const t=e;return typeof t.task_id!="string"?null:{task_id:t.task_id}},sa=He.div`
1
+ import{j as A}from"./liveblocks-B8NMVuJ_.js";import{a as u}from"./sentry-Di8VmQH9.js";import{u as H,k as J,j as C,h as me,g as Se,i as ye,l as be}from"./core-CLbwxogo.js";import{z as Z,W as De,A as I,aq as Ee,a6 as he,h as Ce,N as Ge,e3 as Ae,p as F,a2 as Ie}from"./index-BWTXRZ02.js";import{Qz as Re,Rn as ve,fI as Be,a2C as ne,gQ as q,a2D as re,a2y as Le,QR as X,a2E as Ke,R3 as Y,QB as we,Qd as Ue,Rz as ee,a2F as ae,gk as Pe,Rq as Fe,Rv as je,Ri as xe,Rg as te,Rw as $e,Rd as Ne,a2G as Oe,a2H as ze,a2I as Qe,a2J as Ze,a2K as R,dy as qe,dx as Me,a2L as Ve,Qy as We}from"./zeni-epic-state-DuYWeJse.js";import{n as He}from"./mui-DB2eP-4H.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-2NTBRuLk.js";import{M as Xe}from"./MobileAppDrawer-CtIgBgQ-.js";import{u as Ye}from"./useTaskManagerPusherEvents-DaFacbHX.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]="10bbc481-65a7-4751-9bbe-a34744e8dcd9",e._sentryDebugIdIdentifier="sentry-dbid-10bbc481-65a7-4751-9bbe-a34744e8dcd9")}catch{}})();const _={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},ea=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),aa=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),j=e=>Array.isArray(e)&&e.every((t=>typeof t=="string")),oe=e=>typeof e.task_id=="string"?e.task_id:typeof e.id=="string"?e.id:null,ga=e=>{if(e==null||typeof e!="object")return null;const t=e,n=oe(t);if(n==null)return null;const c={task_id:n};return typeof t.parent_task_id=="string"&&(c.parent_task_id=t.parent_task_id),typeof t.sync_token=="string"&&(c.sync_token=t.sync_token),typeof t.is_deleted=="boolean"&&(c.is_deleted=t.is_deleted),typeof t.is_private=="boolean"&&(c.is_private=t.is_private),c},ta=e=>{if(e==null||typeof e!="object")return null;const t=e;return j(t.task_ids)?{task_ids:t.task_ids}:null},_a=e=>{if(e==null||typeof e!="object")return null;const t=e;return typeof t.task_id!="string"?null:{task_id:t.task_id}},sa=He.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as A}from"./liveblocks-Cf7-opLz.js";import{a as u}from"./sentry-Mj6kP2Z
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,na=De((function(e,t){const n=ne(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,p=c!=null&&c!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((a=>({...a,tasks:a.tasks.filter((s=>s.taskGroupIds.includes(c)))}))).filter((a=>a.tasks.length>0))}:n,y=Le(e),f=Z.isZeniUser(),v=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:p,tagListView:y,localData:p.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:f,subTaskCreateStatus:v}}),(function(e,t){const{navigate:n,currentTenant:c,location:p,isTaskTemplatesEnabled:y}=t,{tenantEmailDomain:f}=c,{groupByKey:v}=t.uiState;return{onTaskManagementRowClick:a=>{const s=se(f,a),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D}})},onReloadTasks:()=>{e(q(!0,y))},onTabChange:a=>{e(Ze(a))},onParentTaskClick:a=>{const s=se(f,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(te(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=Q(f,t.localData.defaultTaskGroupId),s=F(p.state?.pathnameStackToGoBack,p.pathname);n(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(ae({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(Qe({filters:a}))},onSearchTextChanged:a=>{e(ze({searchText:a}))},onReloadCards:()=>{e(q(!0,y))},onBackClick:()=>{if(p.state?.message==="triggerBackClick"){const a=Ie(p.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:a.newStack}})}else n("../")},updateLocalData:a=>{e(Oe({localData:a}))},resetLocalData:()=>{e(re({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(Ne(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(te(t.localData.selectedTaskIds,a,$e(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(xe(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=oa(v,a);e(X({taskDetailLocalData:s}));const D=Q(f,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),x=F(p.state?.pathnameStackToGoBack,p.pathname);n(D,{state:{pathnameStackToGoBack:x,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(je(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(Fe(a,s))},onTimeSpentUpdate:(a,s)=>{e(ee({task:a,updates:s}))},onShowToast:a=>{e(Pe(a))},onGroupByFilterChange:a=>{e(ae({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(ee({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(Ue(a,s))},onSubtaskCreation:(a,s)=>{e(we({...s,parentTaskId:a}))},handleGroupTemplateClick:a=>{e(Y(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(Y(a,[s]))},handleNewTaskInitialization:a=>{if(e(X({taskDetailLocalData:{...Ke,name:a}})),t.localData.defaultTaskGroupId!=null){const s=Q(f,t.localData.defaultTaskGroupId),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{n(`/${f}/tasks/group/${a}`)},onQuickResponsesClick:()=>{n(`/${f}/tasks/quick-responses`)}}}))(Ae);function ra(){const e=me(),t=H(),n=Se(),c=Z.getSignedInUser(),p=Z.isZeniUser(),y=J(),f=C((d=>Be(d))),{taskGroupId:v}=ye(),{useFeatureGate:a}=Ee(),{isFeatureEnabled:s}=a(I.isTaskTemplatesEnabled),{isFeatureEnabled:D}=a(I.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=a(I.isTaskCategorizationEnabled),{isFeatureEnabled:ie}=a(I.isTaskBulkResolutionEnabled),{isFeatureEnabled:le}=a(I.isTaskGroupAssigneesEnabled),{isFeatureEnabled:ue}=a(I.isTaskRecurringParentEnabled),[ce,de]=u.useState(!1),$=C((d=>ne(d,s))),N=C((d=>d.taskGroupState)),B=$.fetchState,{isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe}=Je({mobileExploreReferrer:"Task Checklist"});be({isDataReady:B==="Completed"});const{markBoardFetchInFlight:M,requestTaskRefetch:O}=(function(d){const m=H(),r=J(),T=u.useRef(!1),o=u.useRef(!1),k=u.useRef(!1),g=u.useRef(),l=u.useRef(),S=u.useRef(!1),L=u.useRef(),K=u.useCallback((()=>{L.current=r.getState().taskListState.byTab.live,S.current=!0}),[r]),w=u.useCallback((()=>{K(),m(Re())}),[m,K]),E=u.useCallback((()=>{g.current=r.getState().taskGroupState.taskGroupById,k.current=!0,m(ve())}),[m,r]),b=u.useCallback((()=>{T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0),w(),k.current||r.getState().taskGroupViewState.fetchState==="In-Progress"?o.current=!0:E()}),[w,E,r]),z=u.useCallback((()=>{S.current?(T.current=!0,l.current==null&&(l.current=setTimeout((()=>{l.current=void 0,T.current&&r.getState().taskListState.fetchState!=="In-Progress"&&(S.current=!1,b())}),6e3))):b()}),[b,r]);u.useEffect((()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0),T.current=!1,o.current=!1,k.current=!1}),[d]);const h=C((i=>i.taskListState.fetchState)),G=C((i=>i.taskGroupViewState.fetchState)),U=C((i=>i.taskListState.byTab.live)),P=C((i=>i.taskGroupState.taskGroupById));return u.useEffect((()=>{h!=="In-Progress"&&(!S.current||U!==L.current||h==="Error")&&(S.current=!1,T.current&&(h!=="Completed"?h==="Error"&&(T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0)):b()))}),[h,U,b]),u.useEffect((()=>{G!=="In-Progress"&&(!k.current||P!==g.current||G==="Error")&&(k.current=!1,o.current&&(o.current=!1,G!=="Error"&&E()))}),[G,P,E]),u.useEffect((()=>()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0)}),[]),{markBoardFetchInFlight:K,requestTaskRefetch:z}})(f?.tenantId);u.useEffect((()=>{y.getState().taskListState.hasValidState()||M(),t(q(!1,s))}),[f?.tenantId,t,s,M,y]);const fe=u.useMemo((()=>{const d=[_.TASK_CREATED,_.TASK_UPDATED,_.TASKS_BULK_UPDATED,_.TASKS_BULK_DELETED],m=[_.TASK_CREATED,_.TASK_UPDATED,_.TASK_SNOOZE_RESURFACED,_.TASKS_BULK_UPDATED];return[...ea(f?.companyId,d),...aa(c?.userId,m)]}),[f?.companyId,c?.userId]);if(Ye({events:fe,onEvent:(d,m)=>{switch(d){case _.TASK_CREATED:case _.TASK_UPDATED:{const r=(T=>{if(T==null||typeof T!="object")return null;const o=T,k=oe(o);if(k==null||typeof o.tenant_id!="string"||typeof o.event_type!="string")return null;const g={task_id:k,tenant_id:o.tenant_id,event_type:o.event_type};return typeof o.is_private=="boolean"&&(g.is_private=o.is_private),j(o.assignees)&&(g.assignees=o.assignees),j(o.direct_assignees)&&(g.direct_assignees=o.direct_assignees),typeof o.created_by=="string"&&(g.created_by=o.created_by),j(o.task_group_ids)&&(g.task_group_ids=o.task_group_ids),typeof o.name=="string"&&(g.name=o.name),typeof o.parent_task_id=="string"&&(g.parent_task_id=o.parent_task_id),g})(m);if(r!=null){const T=y.getState(),o=r.task_id,k=o!=null?T.taskState.taskByID?.[o]:void 0,g=k!=null;if(!p)if(r.is_private===!0){if(!g)return}else{const l=c?.userId,S=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&S.add(r.created_by),!(l!=null&&S.has(l))&&!g)return}if(d===_.TASK_UPDATED&&g&&k!=null&&Array.isArray(r.task_group_ids)){const l=new Set(Object.values(T.taskGroupState.taskGroupById??{}).filter((i=>i!=null&&!i.isDeleted)).map((i=>i.id))),S=(k.taskGroupIds??[]).filter((i=>l.has(i))),L=(r.task_group_ids??[]).filter((i=>l.has(i))),K=S.length===L.length&&S.every((i=>L.includes(i))),w=k.taskGroupIds??[],E=r.task_group_ids??[],b=w.length!==E.length||!w.every((i=>E.includes(i))),z=(i,Te)=>{const V=i??[],W=Te??[];if(V.length!==W.length)return!1;const ge=new Set(W);return V.every((_e=>ge.has(_e)))},h=r.name==null||r.name===k.name,G=r.is_private==null||r.is_private===k.isPrivate,U=r.assignees==null||z(r.assignees,k.assignees),P=r.direct_assignees==null;if(K&&b&&h&&G&&U&&P)return}}return void O()}case _.TASKS_BULK_DELETED:{const r=ta(m);return r==null?void 0:void r.task_ids.forEach((T=>t(We(T))))}case _.TASKS_BULK_UPDATED:case _.TASK_SNOOZE_RESURFACED:return void O()}},onSubscribed:()=>{O()}}),u.useEffect((()=>{B==="Completed"&&t(re({taskGroupById:N.taskGroupById}))}),[B,N.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return A.jsxs(A.Fragment,{children:[B==="Completed"?A.jsx(he,{analytics:Ce,onLoad:d=>(m=>m.trackPageLoaded(Ge.Event.taskListPage))(d)}):null,A.jsxs(sa,{children:[A.jsx(Xe,{isAppContentDrawerOpen:ce,handleDrawerToggle:d=>{de(d)}}),A.jsx(na,{location:n,navigate:e,currentTenant:f,taskGroupId:v,taskGroupState:N,localData:$.localData,uiState:$.uiState,isTaskTemplatesEnabled:s,taskListFetchState:B,isTaskCategorizationEnabled:x,isTaskCannedResponsesEnabled:D,isTaskBulkResolutionEnabled:ie,isTaskGroupAssigneesEnabled:le,isTaskRecurringParentEnabled:ue,isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe})]})]})}const se=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,Q=(e,t)=>`/${e}/tasks/new/${t}`,oa=(e,t)=>{if(e==="assignee"){const n=t.split(",");return{...R.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=qe(t);return{...R.taskDetailLocalData,priority:n}}if(e==="status"){const n=Me(t);return{...R.taskDetailLocalData,status:n}}if(e==="tag"){const n=t.split(",");return{...R.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Ve(t);return{...R.taskDetailLocalData,dueDate:n}}return{...R.taskDetailLocalData}},ma=Object.freeze(Object.defineProperty({__proto__:null,default:ra},Symbol.toStringTag,{value:"Module"}));export{_ as T,aa as a,ea as b,_a as c,ta as d,ra as e,ma as f,ga as t};
9
+ `,na=be((function(e,t){const n=ne(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,p=c!=null&&c!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((a=>({...a,tasks:a.tasks.filter((s=>s.taskGroupIds.includes(c)))}))).filter((a=>a.tasks.length>0))}:n,y=Le(e),T=Z.isZeniUser(),v=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:p,tagListView:y,localData:p.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:T,subTaskCreateStatus:v}}),(function(e,t){const{navigate:n,currentTenant:c,location:p,isTaskTemplatesEnabled:y}=t,{tenantEmailDomain:T}=c,{groupByKey:v}=t.uiState;return{onTaskManagementRowClick:a=>{const s=se(T,a),b=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:b}})},onReloadTasks:()=>{e(q(!0,y))},onTabChange:a=>{e(Ze(a))},onParentTaskClick:a=>{const s=se(T,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(te(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=Q(T,t.localData.defaultTaskGroupId),s=F(p.state?.pathnameStackToGoBack,p.pathname);n(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(ae({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(Qe({filters:a}))},onSearchTextChanged:a=>{e(ze({searchText:a}))},onReloadCards:()=>{e(q(!0,y))},onBackClick:()=>{if(p.state?.message==="triggerBackClick"){const a=Ie(p.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:a.newStack}})}else n("../")},updateLocalData:a=>{e(Oe({localData:a}))},resetLocalData:()=>{e(re({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(Ne(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(te(t.localData.selectedTaskIds,a,$e(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(xe(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=oa(v,a);e(X({taskDetailLocalData:s}));const b=Q(T,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),x=F(p.state?.pathnameStackToGoBack,p.pathname);n(b,{state:{pathnameStackToGoBack:x,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(je(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(Fe(a,s))},onTimeSpentUpdate:(a,s)=>{e(ee({task:a,updates:s}))},onShowToast:a=>{e(Pe(a))},onGroupByFilterChange:a=>{e(ae({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(ee({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(Ue(a,s))},onSubtaskCreation:(a,s)=>{e(we({...s,parentTaskId:a}))},handleGroupTemplateClick:a=>{e(Y(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(Y(a,[s]))},handleNewTaskInitialization:a=>{if(e(X({taskDetailLocalData:{...Ke,name:a}})),t.localData.defaultTaskGroupId!=null){const s=Q(T,t.localData.defaultTaskGroupId),b=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:b,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{n(`/${T}/tasks/group/${a}`)},onQuickResponsesClick:()=>{n(`/${T}/tasks/quick-responses`)}}}))(Ae);function ra(){const e=me(),t=H(),n=Se(),c=Z.getSignedInUser(),p=Z.isZeniUser(),y=J(),T=C((d=>Be(d))),{taskGroupId:v}=ye(),{useFeatureGate:a}=De(),{isFeatureEnabled:s}=a(I.isTaskTemplatesEnabled),{isFeatureEnabled:b}=a(I.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=a(I.isTaskCategorizationEnabled),{isFeatureEnabled:ie}=a(I.isTaskBulkResolutionEnabled),{isFeatureEnabled:le}=a(I.isTaskGroupAssigneesEnabled),{isFeatureEnabled:ue}=a(I.isTaskRecurringParentEnabled),[ce,de]=u.useState(!1),$=C((d=>ne(d,s))),N=C((d=>d.taskGroupState)),B=$.fetchState,{isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe}=Je({mobileExploreReferrer:"Task Checklist"});Ee({isDataReady:B==="Completed"});const{markBoardFetchInFlight:M,requestTaskRefetch:O}=(function(d){const m=H(),r=J(),f=u.useRef(!1),o=u.useRef(!1),k=u.useRef(!1),g=u.useRef(),l=u.useRef(),S=u.useRef(!1),L=u.useRef(),K=u.useCallback((()=>{L.current=r.getState().taskListState.byTab.live,S.current=!0}),[r]),w=u.useCallback((()=>{K(),m(Re())}),[m,K]),D=u.useCallback((()=>{g.current=r.getState().taskGroupState.taskGroupById,k.current=!0,m(ve())}),[m,r]),E=u.useCallback((()=>{f.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0),w(),k.current||r.getState().taskGroupViewState.fetchState==="In-Progress"?o.current=!0:D()}),[w,D,r]),z=u.useCallback((()=>{S.current?(f.current=!0,l.current==null&&(l.current=setTimeout((()=>{l.current=void 0,f.current&&r.getState().taskListState.fetchState!=="In-Progress"&&(S.current=!1,E())}),6e3))):E()}),[E,r]);u.useEffect((()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0),f.current=!1,o.current=!1,k.current=!1}),[d]);const h=C((i=>i.taskListState.fetchState)),G=C((i=>i.taskGroupViewState.fetchState)),U=C((i=>i.taskListState.byTab.live)),P=C((i=>i.taskGroupState.taskGroupById));return u.useEffect((()=>{h!=="In-Progress"&&(!S.current||U!==L.current||h==="Error")&&(S.current=!1,f.current&&(h!=="Completed"?h==="Error"&&(f.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0)):E()))}),[h,U,E]),u.useEffect((()=>{G!=="In-Progress"&&(!k.current||P!==g.current||G==="Error")&&(k.current=!1,o.current&&(o.current=!1,G!=="Error"&&D()))}),[G,P,D]),u.useEffect((()=>()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0)}),[]),{markBoardFetchInFlight:K,requestTaskRefetch:z}})(T?.tenantId);u.useEffect((()=>{y.getState().taskListState.hasValidState()||M(),t(q(!1,s))}),[T?.tenantId,t,s,M,y]);const Te=u.useMemo((()=>{const d=[_.TASK_CREATED,_.TASK_UPDATED,_.TASKS_BULK_UPDATED,_.TASKS_BULK_DELETED],m=[_.TASK_CREATED,_.TASK_UPDATED,_.TASK_SNOOZE_RESURFACED,_.TASKS_BULK_UPDATED];return[...ea(T?.companyId,d),...aa(c?.userId,m)]}),[T?.companyId,c?.userId]);if(Ye({events:Te,onEvent:(d,m)=>{switch(d){case _.TASK_CREATED:case _.TASK_UPDATED:{const r=(f=>{if(f==null||typeof f!="object")return null;const o=f,k=oe(o);if(k==null||typeof o.tenant_id!="string"||typeof o.event_type!="string")return null;const g={task_id:k,tenant_id:o.tenant_id,event_type:o.event_type};return typeof o.is_private=="boolean"&&(g.is_private=o.is_private),j(o.assignees)&&(g.assignees=o.assignees),j(o.direct_assignees)&&(g.direct_assignees=o.direct_assignees),typeof o.created_by=="string"&&(g.created_by=o.created_by),j(o.task_group_ids)&&(g.task_group_ids=o.task_group_ids),typeof o.name=="string"&&(g.name=o.name),typeof o.parent_task_id=="string"&&(g.parent_task_id=o.parent_task_id),g})(m);if(r!=null){const f=y.getState(),o=r.task_id,k=o!=null?f.taskState.taskByID?.[o]:void 0,g=k!=null;if(!p)if(r.is_private===!0){if(!g)return}else{const l=c?.userId,S=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&S.add(r.created_by),!(l!=null&&S.has(l))&&!g)return}if(d===_.TASK_UPDATED&&g&&k!=null&&Array.isArray(r.task_group_ids)){const l=new Set(Object.values(f.taskGroupState.taskGroupById??{}).filter((i=>i!=null&&!i.isDeleted)).map((i=>i.id))),S=(k.taskGroupIds??[]).filter((i=>l.has(i))),L=(r.task_group_ids??[]).filter((i=>l.has(i))),K=S.length===L.length&&S.every((i=>L.includes(i))),w=k.taskGroupIds??[],D=r.task_group_ids??[],E=w.length!==D.length||!w.every((i=>D.includes(i))),z=(i,fe)=>{const V=i??[],W=fe??[];if(V.length!==W.length)return!1;const ge=new Set(W);return V.every((_e=>ge.has(_e)))},h=r.name==null||r.name===k.name,G=r.is_private==null||r.is_private===k.isPrivate,U=r.assignees==null||z(r.assignees,k.assignees),P=r.direct_assignees==null;if(K&&E&&h&&G&&U&&P)return}}return void O()}case _.TASKS_BULK_DELETED:{const r=ta(m);return r==null?void 0:void r.task_ids.forEach((f=>t(We(f))))}case _.TASKS_BULK_UPDATED:case _.TASK_SNOOZE_RESURFACED:return void O()}},onSubscribed:()=>{O()}}),u.useEffect((()=>{B==="Completed"&&t(re({taskGroupById:N.taskGroupById}))}),[B,N.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return A.jsxs(A.Fragment,{children:[B==="Completed"?A.jsx(he,{analytics:Ce,onLoad:d=>(m=>m.trackPageLoaded(Ge.Event.taskListPage))(d)}):null,A.jsxs(sa,{children:[A.jsx(Xe,{isAppContentDrawerOpen:ce,handleDrawerToggle:d=>{de(d)}}),A.jsx(na,{location:n,navigate:e,currentTenant:T,taskGroupId:v,taskGroupState:N,localData:$.localData,uiState:$.uiState,isTaskTemplatesEnabled:s,taskListFetchState:B,isTaskCategorizationEnabled:x,isTaskCannedResponsesEnabled:b,isTaskBulkResolutionEnabled:ie,isTaskGroupAssigneesEnabled:le,isTaskRecurringParentEnabled:ue,isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe})]})]})}const se=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,Q=(e,t)=>`/${e}/tasks/new/${t}`,oa=(e,t)=>{if(e==="assignee"){const n=t.split(",");return{...R.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=qe(t);return{...R.taskDetailLocalData,priority:n}}if(e==="status"){const n=Me(t);return{...R.taskDetailLocalData,status:n}}if(e==="tag"){const n=t.split(",");return{...R.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Ve(t);return{...R.taskDetailLocalData,dueDate:n}}return{...R.taskDetailLocalData}},ma=Object.freeze(Object.defineProperty({__proto__:null,default:ra},Symbol.toStringTag,{value:"Module"}));export{_ as T,aa as a,ea as b,_a as c,ta as d,ra as e,ma as f,ga as t};
@@ -0,0 +1,9 @@
1
+ import{j as i}from"./liveblocks-B8NMVuJ_.js";import ge from"./NotFoundScreen-oJupr3pq.js";import{a as k}from"./sentry-Di8VmQH9.js";import{h as te,u as ne,j as h,g as Ee,i as be,N as De,l as Ie,n as Ce,o as E}from"./core-CLbwxogo.js";import{Qq as oe,Qt as Ge,Qn as ye,a2x as _e,fI as re,a2y as ie,QU as D,QH as b,Qk as Ae,Rn as Re,Rg as Ue,a2z as ce,gk as le,a2A as H,Qg as ve,Qd as Be,v2 as xe,uS as we,mD as je,QF as Pe,a2B as Fe,Rz as Le,QB as Ke,R2 as Qe,Q$ as $e,Qw as Ne,QY as ze,QR as Ze}from"./zeni-epic-state-DuYWeJse.js";import{z as I,e1 as Oe,o as Ve,W as qe,A as _,a2 as ue,p as A,a6 as Me,h as J,N as We,e2 as Ye,T as X,ac as He}from"./index-BWTXRZ02.js";import{n as Je}from"./mui-DB2eP-4H.js";import{u as Xe}from"./useInitialThreadRequest-_cR9E-my.js";import{M as ea}from"./MobileAppDrawer-CtIgBgQ-.js";import{T as m,t as aa,b as sa,a as ta,c as na,d as ee,e as oa}from"./TaskListScreen-DHzPd6H5.js";import{u as ra}from"./useTaskManagerPusherEvents-DaFacbHX.js";import"./recharts-DLaK4yUy.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.js";import"./InboxNotificationsProvider-T1CjerOs.js";import"./useTaskManagerAccess-DYYDLTVZ.js";import"./useAskAiCfoHostNavButtonProps-2NTBRuLk.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="9482206a-41b2-4265-922a-2870cfadf49b",e._sentryDebugIdIdentifier="sentry-dbid-9482206a-41b2-4265-922a-2870cfadf49b")}catch{}})();function ia(){const e=te(),a=ne(),n=I.getSignedInUser(),{cannedResponses:c,fetchState:t,saveFetchState:l}=h((r=>r.cannedResponsesState)),u=k.useCallback((()=>{a(oe())}),[a]),S=k.useCallback(((r,C,G)=>{a(Ge({name:r,content:C,cannedResponseId:G}))}),[a]),s=k.useCallback((r=>{a(ye({cannedResponseId:r}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return i.jsx(Oe,{cannedResponses:c,isLoading:t==="In-Progress"||t==="Not-Started",isSaving:l==="In-Progress",onBackClick:()=>e(-1),onDelete:s,onFetch:u,onSave:S})}const Q=e=>e?.taskState?.taskByID,L=(e,a)=>{const n=Q(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},ca=_e([L,(e,a)=>{const n=L(e,a),c=Q(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=L(e,a),c=Q(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let ae,se=[];const la=Ie((function(e,a){const{location:n,taskGroupId:c}=a,t=ce(e,a.taskId),l=re(e),u=ca(e,a.taskId),S=t.taskGroupId??c,s=S!=null?H(e.taskGroupState,S):void 0,r=I.getSignedInUser(),C=l.tenantId,G={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:C??""},B=ie(e),{tenantEmailDomain:x}=l,R=t.recurringSourceTaskId,w=R!=null?`${X.appUrl}/${x}/tasks/${encodeURIComponent(R)}`:void 0;var g;return{taskDetailSelectorView:t,authParams:G,isZeniUser:I.isZeniUser(),userGroupList:((g=e.userGroupsState.userGroupByUserGroupId)!==ae&&(ae=g,se=Object.values(g)),se),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:He.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${X.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:w,tagListView:B,taskGroupName:S!=null&&s!=null&&s.isDefault===!1?s.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((f=>H(e.taskGroupState,f))).filter((f=>f!=null&&!f.isDeleted)).map((f=>({id:f.id,name:f.name,isDefault:f.isDefault}))),subtasks:t.subtasks,parentTaskRef:u,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:t,location:l,taskGroupId:u}=a,{tenantEmailDomain:S}=t;return{onSaveChangesToLocalStore:s=>{e(Ze({taskDetailLocalData:s,taskId:n}))},onSaveDetailClick:s=>{e(ze(n,s??u))},onArchiveTaskClick:()=>{a.taskId!=null&&e(Ne(a.taskId))},onSnoozeTask:(s,r)=>{e($e(s,r))},onUnsnoozeTask:s=>{e(Qe(s))},onCreateSubtask:(s,r)=>{e(Ke({...r,parentTaskId:s}))},onSubtaskUpdate:(s,r)=>{e(Le({task:s,updates:r}))},onShowToast:s=>{e(le(s))},onSubtaskRowClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:A(l.state?.pathnameStackToGoBack,l.pathname)}})},onParentBreadcrumbClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:A(l.state?.pathnameStackToGoBack,l.pathname)}})},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const s=ue(l.state?.pathnameStackToGoBack),r=s.poppedPathname??"../../dashboard";c(r,{state:{pathnameStackToGoBack:s.newStack}})}else{const s=v(S),r=A(l.state?.pathnameStackToGoBack,l.pathname);c(s,{state:{pathnameStackToGoBack:r}})}e(Fe({taskId:n}))},onDeleteTaskClick:()=>{e(Pe(n))},updateFilesEntity:s=>{e(je({files:s}))},onDeleteFile:s=>{e(we(s))},onEditFileName:(s,r)=>{e(xe(s,r.split(".")[0]))},onReloadTaskDetailPage:()=>{e(D(!1,n))},onCreateTagClick:s=>{e(Be(s,n))},onDeleteTagClick:s=>{e(ve(s,n))},onFetchCannedResponses:()=>{e(oe())},onManageTemplatesClick:()=>{c(`/${t.tenantEmailDomain}/tasks/quick-responses`)}}}))(Ye);function K(){const e=te(),a=ne(),n=Ee(),c=Ve(),{taskId:t,taskGroupId:l}=be(),u=h((o=>re(o))),S=Xe(u?.companyId),{useFeatureGate:s}=qe(),{isFeatureEnabled:r}=s(_.isTaskSnoozeEnabled),{isFeatureEnabled:C}=s(_.isTaskVisibilityEnabled),{isFeatureEnabled:G}=s(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:B}=s(_.isTaskRecurringParentEnabled),{isFeatureEnabled:x}=s(_.isTaskGroupAssigneesEnabled),[R,w]=k.useState(!1),[g,f]=k.useState(!1),[$,de]=k.useState(!1),[N,j]=k.useState(!1),y=k.useRef(!1),U=h((o=>o.taskListState.updateTasksFetchState.fetchState)),z=h((o=>ie(o))),Z=h((o=>o.taskGroupViewState.fetchState));k.useEffect((()=>{a(D(!1,t)),t!=null&&a(b(t))}),[a,t]);const O=I.getSignedInUser()?.userId,ke=I.isZeniUser(),pe=h((o=>t!=null?o.taskState.taskByID[t]?.syncToken:void 0)),V=()=>{u?.tenantEmailDomain!=null&&e(v(u.tenantEmailDomain))},q=()=>{a(le({messageSection:"delete_task",messageText:"success",type:"success"})),V()},me=k.useMemo((()=>{const o=[m.TASK_CREATED,m.TASK_UPDATED,m.TASKS_BULK_UPDATED,m.TASKS_BULK_DELETED],d=[...o,m.TASK_SNOOZE_RESURFACED];return[...sa(u?.companyId,o),...ta(O,d)]}),[u?.companyId,O]);ra({events:me,onSubscribed:()=>{t!=null&&(a(D(!0,t)),a(b(t)))},onEvent:(o,d)=>{if(t!=null)switch(o){case m.TASK_CREATED:case m.TASK_UPDATED:{const p=((F,fe,{isZeniUser:Te,storedSyncToken:he,taskId:Y})=>{if(F!==m.TASK_CREATED&&F!==m.TASK_UPDATED)return"none";const T=aa(fe);return T==null?"none":T.parent_task_id===Y?"refreshSubtasks":F!==m.TASK_UPDATED||T.task_id!==Y?"none":T.is_deleted===!0?"leaveDeleted":T.is_private!==!0||Te?T.sync_token!=null&&T.sync_token===he?"none":"refreshTask":"leaveNoAccess"})(o,d,{isZeniUser:ke,storedSyncToken:pe,taskId:t});p==="refreshTask"?(a(D(!0,t)),a(b(t))):p==="refreshSubtasks"?a(b(t)):p==="leaveDeleted"?q():p==="leaveNoAccess"&&V();break}case m.TASKS_BULK_UPDATED:{const p=ee(d);if(p==null)break;p.task_ids.includes(t)&&a(D(!0,t)),a(b(t));break}case m.TASKS_BULK_DELETED:{const p=ee(d);if(p==null)break;if(p.task_ids.includes(t)){q();break}a(b(t));break}case m.TASK_SNOOZE_RESURFACED:{na(d)?.task_id===t&&a(D(!0,t));break}}}}),k.useEffect((()=>{g||z.fetchState==="Completed"||(f(!0),a(Ae()))}),[g,a,z.fetchState]),k.useEffect((()=>{$||Z==="Completed"||(de(!0),a(Re()))}),[$,a,Z]);const Se=k.useCallback((()=>{t!=null&&(y.current=!1,a(Ue([t],null,{isArchived:!1})),j(!0))}),[a,t]);k.useEffect((()=>{if(N)if(U!=="In-Progress"){if(y.current){if(U==="Error")return j(!1),void(y.current=!1);if(U==="Completed"){j(!1),y.current=!1;const{tenantEmailDomain:o}=u;if(n.state?.message==="triggerBackClick"){const d=ue(n.state?.pathnameStackToGoBack);e(d.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:d.newStack}})}else{const d=v(o);e(d,{state:{pathnameStackToGoBack:A(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else y.current=!0}),[N,U,u,n,e]);const M=h((o=>ce(o,t))),P=M.fetchState,W=I.getSignedInUser();if(W==null)throw Error("Can't access task detail page without signing in...");if(P==="Error"&&M.error?.code===400){const{tenantEmailDomain:o}=u,d=v(o),p=A(n.state?.pathnameStackToGoBack,n.pathname);return i.jsx(De,{to:d,state:{pathnameStackToGoBack:p}})}return i.jsxs(i.Fragment,{children:[P==="Completed"?i.jsx(Me,{analytics:J,onLoad:o=>(d=>d.trackPageLoaded(We.Event.taskDetailPage))(o)}):null,i.jsxs(ua,{children:[i.jsx(ea,{isAppContentDrawerOpen:R,handleDrawerToggle:o=>{w(o)}}),i.jsx(la,{analytics:J,currentTenant:u,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:S,location:n,loggedInUser:W,navigate:e,taskGroupId:l,taskId:t,taskDetailFetchState:P,onUnarchiveTaskClick:Se,isTaskSnoozeEnabled:r,isTaskVisibilityEnabled:C,isTaskCannedResponsesEnabled:G,isTaskRecurringParentEnabled:B,isTaskGroupAssigneesEnabled:x})]})]})}const ua=Je.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
+ `,v=e=>`/${e}/tasks`;function wa(){return i.jsxs(Ce,{children:[i.jsx(E,{path:"/new",element:i.jsx(K,{})}),i.jsx(E,{path:"/new/:taskGroupId",element:i.jsx(K,{})}),i.jsx(E,{path:"/group/:taskGroupId",element:i.jsx(oa,{})}),i.jsx(E,{path:"/quick-responses",element:i.jsx(ia,{})}),i.jsx(E,{path:"/:taskId",element:i.jsx(K,{})}),i.jsx(E,{path:"*",element:i.jsx(ge,{})})]})}export{wa as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-B8NMVuJ_.js";import i from"./NotFoundScreen-oJupr3pq.js";import{T as r}from"./TransactionDetailScreen-DFFAXF6x.js";import"./sentry-Di8VmQH9.js";import{n as a,o as e}from"./core-CLbwxogo.js";import"./zeni-epic-state-DuYWeJse.js";import"./recharts-DLaK4yUy.js";import"./index-BWTXRZ02.js";import"./mui-DB2eP-4H.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.js";import"./useAskAiCfoHostNavButtonProps-2NTBRuLk.js";import"./decodeURIComponentSafe-CTII6a9j.js";import"./useInitialThreadRequest-_cR9E-my.js";import"./routePaths-D7Q4znoA.js";import"./expenseAutomationHelper-C40iB_7D.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="bfd19369-9f5a-4875-9ff9-f0a50fe2624d",o._sentryDebugIdIdentifier="sentry-dbid-bfd19369-9f5a-4875-9ff9-f0a50fe2624d")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
@@ -1,4 +1,4 @@
1
- import{j as R}from"./liveblocks-Cf7-opLz.js";import{a as i}from"./sentry-Mj6kP2Z9.js";import{u as j,k as ot,j as g,s as ge,g as ke,h as Ce,i as Ae,N as st,l as ct}from"./core-Cj3U3cFh.js";import{pz as Ie,fI as Q,gZ as it,V8 as rt,oF as lt,of as dt,DZ as se,Xm as ut,gk as mt,bn as pt,dg as Re,bq as _e,sZ as q,We as H,Xn as we,Xo as le,WE as Pe,me as Fe,Xp as Ue,WJ as de,WK as ue,n3 as xe,SF as me,Xi as M,m8 as Le,m6 as Ve,mi as ft,pm as ht,Xq as St,Xr as yt,DQ as K,md as Be,R_ as Oe,cn as Tt,dm as bt,Xs as gt,Xh as It,Xt as vt,Xu as Et,Xv as Dt,Xw as kt,DM as Ct,Xx as At,Xy as Rt,Xz as _t,XA as wt,XB as Pt,mh as Ft,XC as Ut,XD as xt,Xj as Lt,XE as Vt,XF as Bt,XG as Ot,RU as Nt,RK as zt,S7 as Xt,mj as jt,SG as ve,pr as Gt}from"./zeni-epic-state-C-mhDdNi.js";import{W as Y,A as w,j as $,b0 as Mt,z as Ne,$ as $t,b1 as Wt,a9 as qt,a2 as ce,V as Ht,b2 as Yt,p as ie,aq as Zt,b3 as Kt,b4 as Jt,b5 as Qt,ac as en,at as oe}from"./index-KnYY5zwU.js";import{n as tn,S as nn,u as an,D as on}from"./mui-CUe0LVoD.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-uoMOLAFI.js";import{d as ze}from"./decodeURIComponentSafe-W__PfZ-Y.js";import{u as cn}from"./useInitialThreadRequest-DzJGR1TJ.js";import{h as Xe,c as je,g as rn,e as ln}from"./routePaths-BIMkK6Ss.js";import{u as dn}from"./expenseAutomationHelper-aHgcT1ne.js";import{A as un}from"./utils-BwyofOud.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]="041650cf-2c04-4a3f-acc4-edb960c24c0b",t._sentryDebugIdIdentifier="sentry-dbid-041650cf-2c04-4a3f-acc4-edb960c24c0b")}catch{}})();function mn(t=!0){const e=j(),o=ot(),{useFeatureGate:n}=Y(),{isFeatureEnabled:a}=n(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||a!==!0)return;const s=c=>{const d=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return d!=="In-Progress"&&d!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[t,a,e,o])}function pn(t,e){const o=(function(){const d=j(),[y,h]=i.useState(!1),[k,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:S}=Y(),{configValue:v,isDynamicConfigLoading:f}=S("transaction_categorization_config"),T=!f&&v?.capitalization_enabled===!0,D=g((I=>Q(I))),C=D.companyId,P=g((I=>it(I.companyState,D.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:F,dismissedAccounts:U}=g((I=>{const b=I.tenantState.currentTenantId,_=b!=null?I.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:_?.capitalizableAccounts??null,capitalizableAccountOverrides:_?.capitalizableAccountOverrides??null,dismissedAccounts:_?.capitalizationOnboardingDismissedAccounts??null}}),ge),V=i.useRef(A);V.current=A;const x=i.useRef(F);x.current=F;const B=i.useRef(U);B.current=U;const O=g((I=>rt(I.accountState)),ge),G=i.useMemo((()=>{const I={};for(const b of O)b.accountId!=null&&b.accountName!=null&&(I[b.accountId]=b.accountName);return I}),[O]),W=l!=null?G[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=V.current;if(b==null)return;const _=b.accounts??[],Z=new Set(I),ee=x.current??{},te=B.current;for(const z of _)if(Z.has(z.accountId)&&ee[z.accountId]==null&&te?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void h(!0)}),[T]),E=i.useCallback(((I,b)=>{d(lt(C,I,b,!0)),h(!1),p(null),u(null)}),[d,C]),r=i.useCallback((()=>{l!=null&&(d(dt(C,l)),h(!1),p(null),u(null))}),[d,C,l]);return{showPopup:y&&T,popupType:k,popupAccountId:l,popupAccountName:W,currencySymbol:P,checkAndShowPopup:N,handleSubmit:E,handleDismiss:r}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const X=new Map,Ee=(t,e,o)=>`${t}|${e??""}|${o}`,J=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Ge=(t,e,o)=>{$.trackRecommendationFeedbackRetracted(J(e,o)),t(se(re(e,o,{outcome:"retracted"})))},Vn=(t,e)=>{const o=new Set(e.map(String));X.forEach(((n,a)=>{o.has(n.transactionId)&&(X.delete(a),Ge(t,n.feedback,n.transactionId))}))},Bn=t=>{const e=new Set(t.map(String));X.forEach(((o,n)=>{e.has(o.transactionId)&&X.delete(n)}))};function fn(t){const e=j(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=g(ut),{isEnabled:d,fallbackTransactionId:y}=t,h=i.useCallback((u=>u.transactionId??y??""),[y]),k=i.useCallback((u=>{if(!d)return;const S=h(u);if(S==="")return;if(u.outcome!=="accepted")return void n(u);((f,T,D,C)=>{const P=Ee(T,D,C),A=X.get(P);return A!=null&&(X.delete(P),Ge(f,A.feedback,A.transactionId),!0)})(e,S,u.lineId,u.dimension)||(((f,T)=>{$.trackRecommendationAccepted(J(f,T))})(u,S),e(se(re(u,S,{}))))}),[d,h,e]),p=i.useCallback((u=>{if(o==null)return;const S=h(o);((v,f,T)=>{$.trackRecommendationFeedbackSubmitted({...J(v,f),feedbackReason:T})})(o,S,u),e(se(re(o,S,{reasonText:u,skipped:!1}))),((v,f)=>{X.set(Ee(f,v.lineId,v.dimension),{feedback:v,transactionId:f})})(o,S),s(!0)}),[o,h,e]),l=i.useCallback((()=>{var u,S;o!=null&&(u=o,S=h(o),$.trackRecommendationFeedbackSkipped(J(u,S)),s(!1),n(null))}),[o,h]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(mt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:k,popup:o!=null?R.jsx(Mt,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:o}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>pt(t)&&o),[t,o])};function Me(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 On(t,e){const o=j(),{useFeatureGate:n}=Y(),a=g((r=>Q(r))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),d=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:y}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=n(w.isExpenseAutomationEnabled),k=pe(),p=i.useMemo((()=>({id:t,type:q(e)})),[t,e]),l=g((r=>H(r,p))),u=l?.transactionDetailUpdateStatus?.fetchState,S=l?.transactionDetailLocalData?.lineItemById,v=g((r=>{const I=H(r,p)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":r.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),f=i.useMemo((()=>l?.fetchState==="Completed"?Me(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=g((r=>{if(f!=null)return we(r.customerIncomeState,r.vendorExpenseState,r.trendState,f,"month")})),D=g((r=>le(r))),C=g((r=>{if(f!=null)return Pe(r.trendWithTransactionsState,f,"TransactionDetail")})),P=a.company?.companyInfo.firstMonthOfFY??1,A=g((r=>Fe(r.accountState,r.accountListState,"accountList"))),[F,U]=i.useState(!1),[V,x]=i.useState(!1),[B,O]=i.useState(!1);i.useEffect((()=>{U(!1),x(!1),O(!1)}),[t,e]);const G=i.useCallback((()=>{U(!1),x(!1)}),[]),[W,N]=i.useState(!1),E=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{B||l==null||l.transaction==null||(o(Ue({id:l.transaction.id,type:l.transaction.type})),O(!0)),f!=null&&(!s||c&&d===!1)&&(F?V||T==null||(x(!0),o(me(f,"TransactionDetail",{timeframe:"month",timePeriod:E??T}))):(o(de()),o(ue()),U(!0),o(xe(f))))}),[o,B,l?.fetchState,l?.transaction,f,s,c,d,F,V,T,E]),i.useEffect((()=>{D.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[D.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(M("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:y,isExpenseAutomationEnabled:h,isChainOfThoughtEnabled:k,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:S,vendorSaveStatus:v,tranEntity:f,defaultTrendTransactionTimePeriod:T,vendorViewDetails:D,uiState:C,firstMonthOfFY:P,uncategorizedAccounts:A,resetTrendIsFetchedStates:G,isCreateVendorDrawerOpen:W,setIsCreateVendorDrawerOpen:N}}const hn={overlayWidth:new qt(100,100,58)},Sn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=an(),c=$t(),d=j(),y=g((p=>le(p))),h=()=>{n()},k={vendorDetailView:a??y,onSaveSuccess:()=>{d(Ve()),d(ft("Not-Started")),o()},onSaveVendor:e,onCancelClick:h,saveVendorDetailLocalData:p=>{d(Le({vendorId:void 0,localData:p}))}};return R.jsx(on,{anchor:"right",open:t,PaperProps:{style:{width:hn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:h,children:R.jsx(yn,{onClick:p=>p.stopPropagation(),children:R.jsx(Wt,{...k})})})},yn=tn(nn)`
1
+ import{j as R}from"./liveblocks-B8NMVuJ_.js";import{a as i}from"./sentry-Di8VmQH9.js";import{u as j,k as ot,j as g,s as ge,g as ke,h as Ce,i as Ae,N as st,l as ct}from"./core-CLbwxogo.js";import{pz as Ie,fI as Q,gZ as it,V8 as rt,oF as lt,of as dt,DZ as se,Xm as ut,gk as mt,bn as pt,dg as Re,bq as _e,sZ as q,We as H,Xn as we,Xo as le,WE as Pe,me as Fe,Xp as Ue,WJ as de,WK as ue,n3 as xe,SF as me,Xi as M,m8 as Le,m6 as Ve,mi as ft,pm as ht,Xq as St,Xr as yt,DQ as K,md as Be,R_ as Oe,cn as Tt,dm as bt,Xs as gt,Xh as It,Xt as vt,Xu as Et,Xv as Dt,Xw as kt,DM as Ct,Xx as At,Xy as Rt,Xz as _t,XA as wt,XB as Pt,mh as Ft,XC as Ut,XD as xt,Xj as Lt,XE as Vt,XF as Bt,XG as Ot,RU as Nt,RK as zt,S7 as Xt,mj as jt,SG as ve,pr as Gt}from"./zeni-epic-state-DuYWeJse.js";import{W as Y,A as w,h as $,b0 as Mt,z as Ne,$ as $t,b1 as Wt,a9 as qt,a2 as ce,V as Ht,b2 as Yt,p as ie,aq as Zt,b3 as Kt,b4 as Jt,b5 as Qt,ac as en,at as oe}from"./index-BWTXRZ02.js";import{n as tn,S as nn,u as an,D as on}from"./mui-DB2eP-4H.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-2NTBRuLk.js";import{d as ze}from"./decodeURIComponentSafe-CTII6a9j.js";import{u as cn}from"./useInitialThreadRequest-_cR9E-my.js";import{h as Xe,c as je,g as rn,e as ln}from"./routePaths-D7Q4znoA.js";import{u as dn}from"./expenseAutomationHelper-C40iB_7D.js";import{A as un}from"./utils-cD9C-nwV.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]="03687b0b-5835-4251-90ba-7b3f42a349cf",t._sentryDebugIdIdentifier="sentry-dbid-03687b0b-5835-4251-90ba-7b3f42a349cf")}catch{}})();function mn(t=!0){const e=j(),o=ot(),{useFeatureGate:n}=Y(),{isFeatureEnabled:a}=n(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||a!==!0)return;const s=c=>{const d=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return d!=="In-Progress"&&d!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[t,a,e,o])}function pn(t,e){const o=(function(){const d=j(),[y,h]=i.useState(!1),[k,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:S}=Y(),{configValue:v,isDynamicConfigLoading:f}=S("transaction_categorization_config"),T=!f&&v?.capitalization_enabled===!0,D=g((I=>Q(I))),C=D.companyId,P=g((I=>it(I.companyState,D.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:F,dismissedAccounts:U}=g((I=>{const b=I.tenantState.currentTenantId,_=b!=null?I.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:_?.capitalizableAccounts??null,capitalizableAccountOverrides:_?.capitalizableAccountOverrides??null,dismissedAccounts:_?.capitalizationOnboardingDismissedAccounts??null}}),ge),V=i.useRef(A);V.current=A;const x=i.useRef(F);x.current=F;const B=i.useRef(U);B.current=U;const O=g((I=>rt(I.accountState)),ge),G=i.useMemo((()=>{const I={};for(const b of O)b.accountId!=null&&b.accountName!=null&&(I[b.accountId]=b.accountName);return I}),[O]),W=l!=null?G[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=V.current;if(b==null)return;const _=b.accounts??[],Z=new Set(I),ee=x.current??{},te=B.current;for(const z of _)if(Z.has(z.accountId)&&ee[z.accountId]==null&&te?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void h(!0)}),[T]),E=i.useCallback(((I,b)=>{d(lt(C,I,b,!0)),h(!1),p(null),u(null)}),[d,C]),r=i.useCallback((()=>{l!=null&&(d(dt(C,l)),h(!1),p(null),u(null))}),[d,C,l]);return{showPopup:y&&T,popupType:k,popupAccountId:l,popupAccountName:W,currencySymbol:P,checkAndShowPopup:N,handleSubmit:E,handleDismiss:r}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const X=new Map,Ee=(t,e,o)=>`${t}|${e??""}|${o}`,J=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Ge=(t,e,o)=>{$.trackRecommendationFeedbackRetracted(J(e,o)),t(se(re(e,o,{outcome:"retracted"})))},Vn=(t,e)=>{const o=new Set(e.map(String));X.forEach(((n,a)=>{o.has(n.transactionId)&&(X.delete(a),Ge(t,n.feedback,n.transactionId))}))},Bn=t=>{const e=new Set(t.map(String));X.forEach(((o,n)=>{e.has(o.transactionId)&&X.delete(n)}))};function fn(t){const e=j(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=g(ut),{isEnabled:d,fallbackTransactionId:y}=t,h=i.useCallback((u=>u.transactionId??y??""),[y]),k=i.useCallback((u=>{if(!d)return;const S=h(u);if(S==="")return;if(u.outcome!=="accepted")return void n(u);((f,T,D,C)=>{const P=Ee(T,D,C),A=X.get(P);return A!=null&&(X.delete(P),Ge(f,A.feedback,A.transactionId),!0)})(e,S,u.lineId,u.dimension)||(((f,T)=>{$.trackRecommendationAccepted(J(f,T))})(u,S),e(se(re(u,S,{}))))}),[d,h,e]),p=i.useCallback((u=>{if(o==null)return;const S=h(o);((v,f,T)=>{$.trackRecommendationFeedbackSubmitted({...J(v,f),feedbackReason:T})})(o,S,u),e(se(re(o,S,{reasonText:u,skipped:!1}))),((v,f)=>{X.set(Ee(f,v.lineId,v.dimension),{feedback:v,transactionId:f})})(o,S),s(!0)}),[o,h,e]),l=i.useCallback((()=>{var u,S;o!=null&&(u=o,S=h(o),$.trackRecommendationFeedbackSkipped(J(u,S)),s(!1),n(null))}),[o,h]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(mt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:k,popup:o!=null?R.jsx(Mt,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:o}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>pt(t)&&o),[t,o])};function Me(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 On(t,e){const o=j(),{useFeatureGate:n}=Y(),a=g((r=>Q(r))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),d=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:y}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=n(w.isExpenseAutomationEnabled),k=pe(),p=i.useMemo((()=>({id:t,type:q(e)})),[t,e]),l=g((r=>H(r,p))),u=l?.transactionDetailUpdateStatus?.fetchState,S=l?.transactionDetailLocalData?.lineItemById,v=g((r=>{const I=H(r,p)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":r.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),f=i.useMemo((()=>l?.fetchState==="Completed"?Me(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=g((r=>{if(f!=null)return we(r.customerIncomeState,r.vendorExpenseState,r.trendState,f,"month")})),D=g((r=>le(r))),C=g((r=>{if(f!=null)return Pe(r.trendWithTransactionsState,f,"TransactionDetail")})),P=a.company?.companyInfo.firstMonthOfFY??1,A=g((r=>Fe(r.accountState,r.accountListState,"accountList"))),[F,U]=i.useState(!1),[V,x]=i.useState(!1),[B,O]=i.useState(!1);i.useEffect((()=>{U(!1),x(!1),O(!1)}),[t,e]);const G=i.useCallback((()=>{U(!1),x(!1)}),[]),[W,N]=i.useState(!1),E=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{B||l==null||l.transaction==null||(o(Ue({id:l.transaction.id,type:l.transaction.type})),O(!0)),f!=null&&(!s||c&&d===!1)&&(F?V||T==null||(x(!0),o(me(f,"TransactionDetail",{timeframe:"month",timePeriod:E??T}))):(o(de()),o(ue()),U(!0),o(xe(f))))}),[o,B,l?.fetchState,l?.transaction,f,s,c,d,F,V,T,E]),i.useEffect((()=>{D.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[D.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(M("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:y,isExpenseAutomationEnabled:h,isChainOfThoughtEnabled:k,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:S,vendorSaveStatus:v,tranEntity:f,defaultTrendTransactionTimePeriod:T,vendorViewDetails:D,uiState:C,firstMonthOfFY:P,uncategorizedAccounts:A,resetTrendIsFetchedStates:G,isCreateVendorDrawerOpen:W,setIsCreateVendorDrawerOpen:N}}const hn={overlayWidth:new qt(100,100,58)},Sn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=an(),c=$t(),d=j(),y=g((p=>le(p))),h=()=>{n()},k={vendorDetailView:a??y,onSaveSuccess:()=>{d(Ve()),d(ft("Not-Started")),o()},onSaveVendor:e,onCancelClick:h,saveVendorDetailLocalData:p=>{d(Le({vendorId:void 0,localData:p}))}};return R.jsx(on,{anchor:"right",open:t,PaperProps:{style:{width:hn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:h,children:R.jsx(yn,{onClick:p=>p.stopPropagation(),children:R.jsx(Wt,{...k})})})},yn=tn(nn)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;