@zeniai/web-app-ui 5.3.53-qa → 5.3.54-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/assets/{AccountMappingScreen-B05quPfB.js → AccountMappingScreen-BlrRRyYK.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-D94Dqvel.js → ActualMatchingMatchDetailScreen-KBRWoEoc.js} +1 -1
  3. package/dist/assets/AddressRoutes-Coz5Rzvv.js +1 -0
  4. package/dist/assets/AddressScreen-DWOW-12j.js +9 -0
  5. package/dist/assets/{AiCfoScreen-Dj6jKppq.js → AiCfoScreen-DcDfH2LH.js} +1 -1
  6. package/dist/assets/{AppDrawer-DB1lzCTO.js → AppDrawer-ODeNF0Av.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-vJIdZGym.js → BillPayApprovalRoutes-CwQ70Jsb.js} +1 -1
  8. package/dist/assets/BillPayRoutes-DkWEe87D.js +119 -0
  9. package/dist/assets/{BusinessVerificationPageScreen-Bh9Wow-A.js → BusinessVerificationPageScreen-fkSKuDKx.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-Hsh2FpvU.js → CardsAiCfoScreen-D2h73Hql.js} +2 -2
  11. package/dist/assets/{ChargeCardRoutes-0m2CNq4x.js → ChargeCardRoutes-BPu1nuyG.js} +8 -8
  12. package/dist/assets/{CompanyPassportScreen-Cvbu6LUT.js → CompanyPassportScreen-DFwJSL9V.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-CRvnQSlr.js → ConnectionAuthScreen-rwpCK8vj.js} +1 -1
  14. package/dist/assets/CustomerOnboardingAuthScreen-CsmvVXX5.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-kZOJ1QhA.js → CustomerOnboardingRoutes-2FuFx1YW.js} +1 -1
  16. package/dist/assets/DashboardRoutes-CsVUKDom.js +20 -0
  17. package/dist/assets/{DefaultTenantHome-CTOQPic5.js → DefaultTenantHome-EK1ZTLpJ.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-DgaHcUL_.js → DomesticWireDetailScreen-B2sK3gnq.js} +3 -3
  19. package/dist/assets/{DrawerScreen-BeSv1Aix.js → DrawerScreen-Cxs0fLXJ.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-D5eIJPR7.js → EntityDetailRoutes-J1t-f_rN.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-DHppK74x.js → ExpenseAutomationRoutes-CdYiuFY6.js} +1 -1
  22. package/dist/assets/FeaturePreviewScreen-DWnnuRXB.js +1 -0
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-CThBYwg5.js → HubSpotOAuthCallbackScreen-BKy1DBij.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-D6QvVVj8.js → InboxNotificationsProvider-B8qyHdbE.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-DvFmEcE9.js → InvoicingRoutes-_2bztMtp.js} +1 -1
  26. package/dist/assets/{MagicLinkRoutes-B1yYt0y7.js → MagicLinkRoutes-BMUhHQh1.js} +8 -8
  27. package/dist/assets/MagicLinkSignInScreen-BWBaBqgd.js +12 -0
  28. package/dist/assets/{MobileAppDrawer-D3MVdjfj.js → MobileAppDrawer-DEHTsboI.js} +1 -1
  29. package/dist/assets/NotFoundScreen-tLaFUNLQ.js +1 -0
  30. package/dist/assets/{NotificationRoutes-3MhigWw8.js → NotificationRoutes-CbQ2m8ON.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-Br6J-Kjw.js → OAuthConsentScreen-CDpRBEpx.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-BT242PEu.js → PandLWithForecastRoutes-DA-gkwnG.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-D304LK9q.js → PaymentLinkScreen-BRzaAbpf.js} +1 -1
  34. package/dist/assets/{PeopleRoutes-Cs1oFIJn.js → PeopleRoutes-DFwhgdPC.js} +3 -3
  35. package/dist/assets/PerformanceRoutes-D0mskpFQ.js +1 -0
  36. package/dist/assets/{Preview-CDuSXomS.js → Preview-BBxDhQ0O.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-CXR9MUeu.js → QBOConnectionScreen-BajGDFuL.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-CADwX7m0.js → ReimbursementApprovalRoutes-BTAP_qed.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-C__AcyMO.js → ReimbursementApprovalRuleDetailScreen-DJEm2XXH.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-DE9--ARn.js → ReimbursementRoutes-BgavHl4p.js} +4 -4
  41. package/dist/assets/{ReportsRoutes-B_EvlWob.js → ReportsRoutes-C93h6574.js} +1 -1
  42. package/dist/assets/RewardsRoutes-CjIMfvYV.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-270QQSkr.js → ScheduleDetailsPrepaidExpensesScreen-bMBkbiJF.js} +4 -4
  44. package/dist/assets/ScreenRoutes-HNN5txks.js +2 -0
  45. package/dist/assets/{SettingsRoutes-DjTGDDEp.js → SettingsRoutes-CslaKFsZ.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-mQ33CI-8.js → SetupPagesScreen-BknhxMJr.js} +1 -1
  47. package/dist/assets/SignInScreen-DDXFdnmo.js +1 -0
  48. package/dist/assets/SignOutScreen-CdohYlzt.js +9 -0
  49. package/dist/assets/{TaskListScreen-_mHmu42Q.js → TaskListScreen-BamiN5-8.js} +2 -2
  50. package/dist/assets/{TaskRoutes-DRFV_DYt.js → TaskRoutes-B2KOXvdP.js} +2 -2
  51. package/dist/assets/TransactionDetailRoutes-VLp4TIB7.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-Dmc1SB66.js → TransactionDetailScreen-DUQhWS53.js} +1 -1
  53. package/dist/assets/{TransactionListRoutes-2uPIfsci.js → TransactionListRoutes-BiDSTFZP.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-C62UHGaV.js → TreasuryRoutes-B0bQBu4a.js} +1 -1
  55. package/dist/assets/{VendorsRoutes-Dp-COjet.js → VendorsRoutes-CyexNe36.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-DEQwqZwF.js → WiseConfirmationScreen-BsFUJuRp.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-DjudE9ka.js → ZeniAccountRoutes-Bn27iI8z.js} +1 -1
  58. package/dist/assets/ZeniAccountStatementScreen-DnKhFx6b.js +9 -0
  59. package/dist/assets/{accountMappingHelper-DNRaFM1C.js → accountMappingHelper-y0E9h6aC.js} +1 -1
  60. package/dist/assets/{analytics-Y9Rn1Gu7.js → analytics-BDCkEq_I.js} +1 -1
  61. package/dist/assets/{analyticsHelper-Czpx502m.js → analyticsHelper-HN-E8Xpa.js} +1 -1
  62. package/dist/assets/{core-Dh_SHcAD.js → core-B2JcUSRu.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-B9wRnGXi.js → decodeURIComponentSafe-CIM8Yd6k.js} +1 -1
  64. package/dist/assets/{dnd-CwwWYFuT.js → dnd-BAPMa4RJ.js} +1 -1
  65. package/dist/assets/{empty-BT_7GI6y.js → empty-D7vR8z68.js} +1 -1
  66. package/dist/assets/{empty-XI8MiQF0.js → empty-M8CZcWYb.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-JNmKZqZz.js → emptyVideoElement-nUJqd2nB.js} +1 -1
  68. package/dist/assets/{epic-COW9EFJg.js → epic-IH41xxG2.js} +1 -1
  69. package/dist/assets/{expenseAutomationHelper-jy143DnO.js → expenseAutomationHelper-Dd7fQN5z.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-BTnTjmTv.js → getLocaleForTenant-CHied7Hb.js} +1 -1
  71. package/dist/assets/{index-8Q8Cb_pA.js → index-BTTj-4b5.js} +1 -1
  72. package/dist/assets/{index-D_bKIveY.js → index-DKVU_IvY.js} +2 -2
  73. package/dist/assets/{index-C4rZANm7.js → index-DKZ4YAZy.js} +1 -1
  74. package/dist/assets/{index-CHaKE3QQ.js → index-DoNDPHnj.js} +14545 -14423
  75. package/dist/assets/{index-DTprL6g9.js → index-P1XHqiT-.js} +1 -1
  76. package/dist/assets/{index-D3h8toFn.js → index-PCu_2P3b.js} +1 -1
  77. package/dist/assets/{index-DOYaY83A.js → index-dmkrZYpO.js} +1 -1
  78. package/dist/assets/{index-B23hmQHl.js → index-gjFAkOOB.js} +1 -1
  79. package/dist/assets/{lexical-CaftfZ9D.js → lexical-DGZ06Yv6.js} +1 -1
  80. package/dist/assets/{liveblocks-DR8KfETq.js → liveblocks-DXYs6rwe.js} +1 -1
  81. package/dist/assets/{lottie-ODKvpFjz.js → lottie-C9Rxpkwh.js} +1 -1
  82. package/dist/assets/{mui-BYn_Ugho.js → mui-BLmtkCLd.js} +1 -1
  83. package/dist/assets/{pathToGoBack-BiqpVJeS.js → pathToGoBack-DqGGHSwL.js} +1 -1
  84. package/dist/assets/{pdf-DnQo5-Qw.js → pdf-DMCYUxGc.js} +3 -3
  85. package/dist/assets/{pdf-lib-DdZd3IiB.js → pdf-lib-D7-8SdHl.js} +1 -1
  86. package/dist/assets/{plaid-Dw8l1kdg.js → plaid-DHQC2tsw.js} +1 -1
  87. package/dist/assets/{pusher-CewboUYG.js → pusher-C76wt9sK.js} +1 -1
  88. package/dist/assets/{react-gSPYEWZo.js → react-B2hEGyNu.js} +1 -1
  89. package/dist/assets/{react-CWd2ZkNi.js → react-BX0k_7jA.js} +1 -1
  90. package/dist/assets/{react-8By583h-.js → react-D7gGxl9M.js} +1 -1
  91. package/dist/assets/{react-B8IvMjeE.js → react-Dvat3Ckm.js} +1 -1
  92. package/dist/assets/{react-BgmP_PBP.js → react-DzK6xFD8.js} +1 -1
  93. package/dist/assets/{react-ygIo2ccY.js → react-Y6cTJufT.js} +1 -1
  94. package/dist/assets/{recharts-BTL88W4R.js → recharts-UN7cJOXN.js} +1 -1
  95. package/dist/assets/{routePaths-DXpM4tZj.js → routePaths-V2hUGG4a.js} +1 -1
  96. package/dist/assets/{sentry-FwaDhTzy.js → sentry-BmkYxd02.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-CvpfThkG.js → stripSplatSuffix-DXBpTroJ.js} +1 -1
  98. package/dist/assets/{url-DHu7Ejzz.js → url-Cjk2PJJX.js} +1 -1
  99. package/dist/assets/{url-DybJ-sxa.js → url-DgDGkycQ.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-uLKulkDS.js → useActualMatchingMatchDetail-RtuBBjbC.js} +1 -1
  101. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Bn69qFOr.js +1 -0
  102. package/dist/assets/{useAskAiCfoHostNavButtonProps-PLm72Ozi.js → useAskAiCfoHostNavButtonProps-qSqQpxG4.js} +1 -1
  103. package/dist/assets/{useChargeCardPusherEvents-LUqnb4UF.js → useChargeCardPusherEvents-BPnD4KLb.js} +1 -1
  104. package/dist/assets/{useDeviceId-CUJxM_KE.js → useDeviceId-IlYBwHEv.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-CKnBwo84.js → useEmailConnectResultRefresh-dPGnutjz.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-DLA6PIFe.js → useInitialThreadRequest-DK2o3yi9.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-BNcDbxmw.js +1 -0
  108. package/dist/assets/{useTaskManagerPusherEvents-DchZU-tO.js → useTaskManagerPusherEvents-DoGLBnPU.js} +1 -1
  109. package/dist/assets/{utils-DEAaFgLU.js → utils-BGWE7tXK.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-DLRTZIl6.js → withTransactionSidePanel-BJHiJX6z.js} +2 -2
  111. package/dist/assets/{zeni-epic-state-DJh0-ZeR.js → zeni-epic-state-DpjvBN7b.js} +3 -3
  112. package/dist/index.html +1 -1
  113. package/package.json +2 -2
  114. package/dist/assets/AddressRoutes-BBXKWkgP.js +0 -1
  115. package/dist/assets/AddressScreen-DkOVp1Il.js +0 -9
  116. package/dist/assets/BillPayRoutes-Ie8KE_Pm.js +0 -119
  117. package/dist/assets/CustomerOnboardingAuthScreen-SW-uc7QE.js +0 -1
  118. package/dist/assets/DashboardRoutes-DTB-wwS1.js +0 -20
  119. package/dist/assets/FeaturePreviewScreen-vWprV4-Z.js +0 -1
  120. package/dist/assets/MagicLinkSignInScreen-CZM8ZeV4.js +0 -12
  121. package/dist/assets/NotFoundScreen-BG5HsGgf.js +0 -1
  122. package/dist/assets/PerformanceRoutes-DevypuzE.js +0 -1
  123. package/dist/assets/RewardsRoutes-fsFKnuDQ.js +0 -1
  124. package/dist/assets/ScreenRoutes-B0DNEVGO.js +0 -2
  125. package/dist/assets/SignInScreen-BVOxylXT.js +0 -1
  126. package/dist/assets/SignOutScreen-BXBPUD_K.js +0 -9
  127. package/dist/assets/TransactionDetailRoutes-BqJM9clh.js +0 -1
  128. package/dist/assets/ZeniAccountStatementScreen-fuK8OSl5.js +0 -9
  129. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CJfIwtxx.js +0 -1
  130. package/dist/assets/useTaskManagerAccess-D4PJ1zkK.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as y}from"./liveblocks-DR8KfETq.js";import{a as A}from"./sentry-FwaDhTzy.js";import{i as G,u as H,h as X,g as ee,j as h,l as te}from"./core-Dh_SHcAD.js";import{WI as Ve,WJ as Fe,l$ as ae,sr as Me,sD as Ge,sT as $e,sR as Re,sU as Ke,sW as Ue,WK as We,fF as K,VH as pe,WL as Se,g_ as ne,cB as se,cC as le,Fa as ve,WM as Ce,Fe as Ye,gO as ce,su as ze,t2 as qe,dD as Ze,dC as Qe,T3 as fe,F8 as He,F2 as Xe,WN as De,EW as et,EV as tt,EQ as at,E$ as nt,Ff as st,WO as W,WP as ge,EX as lt,VI as oe,Fv as Ae,Fo as Ie,WQ as xe,sx as Te,Fi as Be,Fg as Le,WR as we,FC as Je,Fz as je,Fj as be,FB as _e}from"./zeni-epic-state-DJh0-ZeR.js";import{a5 as de,aZ as ie,a_ as ct,z as ot,h as dt,a8 as it,a9 as ue,j as N,aw as ut,a$ as rt,p as F,G as Ee,O as ye,b0 as ht,b1 as mt,b2 as pt}from"./index-CHaKE3QQ.js";import{n as re}from"./mui-BYn_Ugho.js";import{p as St}from"./pathToGoBack-BiqpVJeS.js";import Q from"./NotFoundScreen-BG5HsGgf.js";import{c as M}from"./routePaths-DXpM4tZj.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]="3492f0ab-4e55-48f5-814f-d68454cd3681",e._sentryDebugIdIdentifier="sentry-dbid-3492f0ab-4e55-48f5-814f-d68454cd3681")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=H(),i=X(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Ve(u,l??""))),p=h((u=>Fe(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?y.jsx(Q,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?y.jsx(ie,{}):y.jsx(Q,{}):y.jsx(ft,{children:y.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(We({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(l,u,r))},onSkip:(u,r)=>{n($e(l,u,r))}})})}const ft=re.div`
1
+ import{j as y}from"./liveblocks-DXYs6rwe.js";import{a as A}from"./sentry-BmkYxd02.js";import{i as G,u as H,h as X,g as ee,j as h,l as te}from"./core-B2JcUSRu.js";import{WI as Ve,WJ as Fe,l$ as ae,sr as Me,sD as Ge,sT as $e,sR as Re,sU as Ke,sW as Ue,WK as We,fF as K,VH as pe,WL as Se,g_ as ne,cB as se,cC as le,Fa as ve,WM as Ce,Fe as Ye,gO as ce,su as ze,t2 as qe,dD as Ze,dC as Qe,T3 as fe,F8 as He,F2 as Xe,WN as De,EW as et,EV as tt,EQ as at,E$ as nt,Ff as st,WO as W,WP as ge,EX as lt,VI as oe,Fv as Ae,Fo as Ie,WQ as xe,sx as Te,Fi as Be,Fg as Le,WR as be,FC as we,Fz as Je,Fj as je,FB as _e}from"./zeni-epic-state-DpjvBN7b.js";import{a5 as de,aZ as ie,a_ as ct,z as ot,h as dt,a8 as it,a9 as ue,j as N,aw as ut,a$ as rt,p as F,G as Ee,V as ye,b0 as ht,b1 as mt,b2 as pt}from"./index-DoNDPHnj.js";import{n as re}from"./mui-BLmtkCLd.js";import{p as St}from"./pathToGoBack-DqGGHSwL.js";import Q from"./NotFoundScreen-tLaFUNLQ.js";import{c as M}from"./routePaths-V2hUGG4a.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]="d913bd74-98eb-4ea3-bf7c-96c88c71c6c7",e._sentryDebugIdIdentifier="sentry-dbid-d913bd74-98eb-4ea3-bf7c-96c88c71c6c7")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=H(),i=X(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Ve(u,l??""))),p=h((u=>Fe(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?y.jsx(Q,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?y.jsx(ie,{}):y.jsx(Q,{}):y.jsx(ft,{children:y.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(We({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(l,u,r))},onSkip:(u,r)=>{n($e(l,u,r))}})})}const ft=re.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -14,7 +14,7 @@ import{j as y}from"./liveblocks-DR8KfETq.js";import{a as A}from"./sentry-FwaDhTz
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,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(W("common"))},onCancelAutoComplete:()=>{e(W("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=F(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=F(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=F(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=F(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,w=I?.selectedOption;e(et({scheduleType:l,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||w==null||e(tt({scheduleType:l}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=X(),I=ee(),p=H(),C=ye(),{tenantEmailDomain:g}=G(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=G(),v=s??r;let D;v!=="new"&&(D=v);const w=Ct(v),B=h((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),J="accrued_expenses",k=h((L=>Se(L,"accrued_expenses"))),j=h((L=>fe(L))),b=h((L=>L.classListState.fetchState)),x=h((L=>ae(L))),_=j!=="Completed"||b!=="Completed";A.useEffect((()=>{f===!1&&_?(p(He(J,D)),u(!0)):_===!1&&f===!1&&v!=="new"&&(p(Xe(J,v)),u(!0))}),[f]);const P=h((L=>K(L))),T=h((L=>ne(L,P.companyId))),O=I.state?.message==="expenseAutomation",Y=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(l==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:L,year:Pe}=Y;m(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else l()}}),V=k.fetchState,$=k.allAccountList,Z=k.allClassList,E=k.allAccruedAccountList,S=k.scheduleAccruedDetailsLocalData;if(w!==!0||k.fetchState==="Error")return y.jsx(Q,{});const R=V==="Completed"&&f===!0,Oe=k.selectedJEAccruedSchedule!=null;return V==="Completed"||V==="Not-Started"||c===!0&&Oe?y.jsxs(yt,{children:[R===!0?y.jsx(ue,{analytics:N,onLoad:()=>{vt(k,J,T)}}):null,y.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:E,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):y.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{...Ne(s)},vendorName:s.vendor.name??null,controllerEmails:l,controllerUserIds:n})},At=re.div`
17
+ `,kt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(W("common"))},onCancelAutoComplete:()=>{e(W("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=F(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=F(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=F(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=F(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,b=I?.selectedOption;e(et({scheduleType:l,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||b==null||e(tt({scheduleType:l}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=X(),I=ee(),p=H(),C=ye(),{tenantEmailDomain:g}=G(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=G(),v=s??r;let D;v!=="new"&&(D=v);const b=Ct(v),B=h((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),w="accrued_expenses",k=h((L=>Se(L,"accrued_expenses"))),J=h((L=>fe(L))),j=h((L=>L.classListState.fetchState)),x=h((L=>ae(L))),_=J!=="Completed"||j!=="Completed";A.useEffect((()=>{f===!1&&_?(p(He(w,D)),u(!0)):_===!1&&f===!1&&v!=="new"&&(p(Xe(w,v)),u(!0))}),[f]);const P=h((L=>K(L))),T=h((L=>ne(L,P.companyId))),O=I.state?.message==="expenseAutomation",Y=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(l==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:L,year:Pe}=Y;m(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else l()}}),V=k.fetchState,$=k.allAccountList,Z=k.allClassList,E=k.allAccruedAccountList,S=k.scheduleAccruedDetailsLocalData;if(b!==!0||k.fetchState==="Error")return y.jsx(Q,{});const R=V==="Completed"&&f===!0,Oe=k.selectedJEAccruedSchedule!=null;return V==="Completed"||V==="Not-Started"||c===!0&&Oe?y.jsxs(yt,{children:[R===!0?y.jsx(ue,{analytics:N,onLoad:()=>{vt(k,w,T)}}):null,y.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:E,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):y.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{...Ne(s)},vendorName:s.vendor.name??null,controllerEmails:l,controllerUserIds:n})},At=re.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as y}from"./liveblocks-DR8KfETq.js";import{a as A}from"./sentry-FwaDhTz
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,he=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(_e(i,d,a.length>0))},onDelete:d=>{e(be(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(je(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(Je(i,d,o))},onJELinkClick:d=>{e(we({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=F(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=F(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(W("common"))},onCancelAutoComplete:()=>{e(W("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,w=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:w?.zeniId??D?.selectedOption??"",name:w?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:w?.logo},J=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,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}}))),_=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:j?.accountId,selectedDate:r,selectedMonths:b,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,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&&J?.classId==null||r==null||b==null||P!==!0&&_==null||e(Le({scheduleType:i}))}}}))(mt),Wt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=X(),n=ee(),i=H(),a=ye(),{tenantEmailDomain:d}=G(),[o,m]=A.useState(!1),{scheduleDetailId:I}=G(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((E=>E.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||l("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((E=>oe(E,u))),v=h((E=>E.entityAutoCompleteState.autoCompleteText.common)),D=h((E=>De(E,"common"))),w=h((E=>fe(E))),B=h((E=>E.classListState.fetchState)),J=h((E=>ae(E))),k=h((E=>ce(E).selectedPeriod)),j=w!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&j?(i(Ae(u,V,!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:E,year:S}=k;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else l("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const b=h((E=>K(E))),x=h((E=>ne(E,b.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:E,year:S}=k;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else c()}}),O=r.fetchState,Y=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,q=r.scheduleDetailsLocalData.fixed_assets;let V;if(p!=="new"&&(V=p),g!==!0||r.fetchState==="Error")return y.jsx(Q,{});const $=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?y.jsxs(At,{children:[$===!0?y.jsx(ue,{analytics:N,onLoad:()=>{Bt(r,u,x)}}):null,y.jsx(It,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(E,S)=>{i(Te(E,S))},accountList:Y,depAccountList:z,scheduleLocalData:q,selectedJEScheduleKey:f,scheduleDetailId:V,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:J,status:r.selectedJEScheduleTransaction?.status.code})]}):y.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Lt=re.div`
25
+ `,he=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(_e(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(Je(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(we(i,d,o))},onJELinkClick:d=>{e(be({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=F(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=F(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(W("common"))},onCancelAutoComplete:()=>{e(W("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,b=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:b?.zeniId??D?.selectedOption??"",name:b?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:b?.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,j=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),_=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:k?.accountId,selectedClass:w?.classId,selectedAccumulatedDepreciationCategory:J?.accountId,selectedDate:r,selectedMonths:j,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,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||j==null||P!==!0&&_==null||e(Le({scheduleType:i}))}}}))(mt),Wt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=X(),n=ee(),i=H(),a=ye(),{tenantEmailDomain:d}=G(),[o,m]=A.useState(!1),{scheduleDetailId:I}=G(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((E=>E.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||l("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((E=>oe(E,u))),v=h((E=>E.entityAutoCompleteState.autoCompleteText.common)),D=h((E=>De(E,"common"))),b=h((E=>fe(E))),B=h((E=>E.classListState.fetchState)),w=h((E=>ae(E))),k=h((E=>ce(E).selectedPeriod)),J=b!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&J?(i(Ae(u,V,!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:E,year:S}=k;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else l("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const j=h((E=>K(E))),x=h((E=>ne(E,j.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:E,year:S}=k;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else c()}}),O=r.fetchState,Y=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,q=r.scheduleDetailsLocalData.fixed_assets;let V;if(p!=="new"&&(V=p),g!==!0||r.fetchState==="Error")return y.jsx(Q,{});const $=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?y.jsxs(At,{children:[$===!0?y.jsx(ue,{analytics:N,onLoad:()=>{Bt(r,u,x)}}):null,y.jsx(It,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(E,S)=>{i(Te(E,S))},accountList:Y,depAccountList:z,scheduleLocalData:q,selectedJEScheduleKey:f,scheduleDetailId:V,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:w,status:r.selectedJEScheduleTransaction?.status.code})]}):y.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Lt=re.div`
26
26
  display: flex;
27
27
  min-height: 100%;
28
28
  width: 100%;
@@ -30,4 +30,4 @@ import{j as y}from"./liveblocks-DR8KfETq.js";import{a as A}from"./sentry-FwaDhTz
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,me=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,wt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(be(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(je(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(Je(t.scheduleTab,a,d))},onJELinkClick:a=>{e(we({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=F(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=F(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(W("common"))},onCancelAutoComplete:()=>{e(W("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,w=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,J=m.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),k=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,j=f.type==="lastDayOfMonth"||void 0,b={selectedAccount:w?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:J,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"||w?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||j!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=X(),i=ee(),a=H(),d=ye(),{tenantEmailDomain:o}=G(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=G(),f=t??g,u=Jt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),w=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),J=h((S=>fe(S))),k=h((S=>S.classListState.fetchState)),j=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 _=h((S=>K(S))),P=h((S=>ne(S,_.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:Y}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(s==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:R}=b;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else s()}}),U=D.fetchState,z=D.allAccountList,q=D.allClassList,V=D.scheduleDetailsLocalData;let $;if(f!=="new"&&($=f),u!==!0||D.fetchState==="Error")return y.jsx(Q,{});const Z=U==="Completed"&&m===!0,E=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&E?y.jsxs(Lt,{children:[Z===!0?y.jsx(ue,{analytics:N,onLoad:()=>{bt(D,v,P)}}):null,y.jsx(wt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:Y,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:w,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,R)=>{a(Te(S,R))},expenseAutomationSelectedPeriod:b,navigate:n,classList:q,accountList:z,scheduleLocalData:V[v],selectedJEScheduleKey:r,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:j,status:D.selectedJEScheduleTransaction?.status.code})]}):y.jsx(ie,{})},Jt=(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 s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...jt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Rt as J,Wt as S,Ut as a,Yt as b,Kt as c};
33
+ `,me=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,bt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(Je(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(we(t.scheduleTab,a,d))},onJELinkClick:a=>{e(be({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=F(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=F(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(W("common"))},onCancelAutoComplete:()=>{e(W("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,b=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,w=m.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),k=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,J=f.type==="lastDayOfMonth"||void 0,j={selectedAccount:b?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:w,lastDayOfMonth:J,selectedVendor:v,selectedDayOfMonth:k};e(Be({scheduleType:t.scheduleTab,localData:j,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||b?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||J!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=X(),i=ee(),a=H(),d=ye(),{tenantEmailDomain:o}=G(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=G(),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))),b=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))),j=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}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const _=h((S=>K(S))),P=h((S=>ne(S,_.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:Y}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(s==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:R}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else s()}}),U=D.fetchState,z=D.allAccountList,q=D.allClassList,V=D.scheduleDetailsLocalData;let $;if(f!=="new"&&($=f),u!==!0||D.fetchState==="Error")return y.jsx(Q,{});const Z=U==="Completed"&&m===!0,E=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&E?y.jsxs(Lt,{children:[Z===!0?y.jsx(ue,{analytics:N,onLoad:()=>{jt(D,v,P)}}):null,y.jsx(bt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:Y,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:b,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,R)=>{a(Te(S,R))},expenseAutomationSelectedPeriod:j,navigate:n,classList:q,accountList:z,scheduleLocalData:V[v],selectedJEScheduleKey:r,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:J,status:D.selectedJEScheduleTransaction?.status.code})]}):y.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}),jt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Jt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Rt as J,Wt as S,Ut as a,Yt as b,Kt as c};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-tLaFUNLQ.js","assets/sentry-BmkYxd02.js","assets/core-B2JcUSRu.js","assets/zeni-epic-state-DpjvBN7b.js","assets/index-DoNDPHnj.js","assets/mui-BLmtkCLd.js","assets/analytics-BDCkEq_I.js","assets/utils-BGWE7tXK.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-CsVUKDom.js","assets/withTransactionSidePanel-BJHiJX6z.js","assets/useAskAiCfoHostNavButtonProps-qSqQpxG4.js","assets/TransactionDetailScreen-DUQhWS53.js","assets/decodeURIComponentSafe-CIM8Yd6k.js","assets/useInitialThreadRequest-DK2o3yi9.js","assets/routePaths-V2hUGG4a.js","assets/expenseAutomationHelper-Dd7fQN5z.js","assets/stripSplatSuffix-DXBpTroJ.js","assets/analyticsHelper-HN-E8Xpa.js","assets/CompanyPassportScreen-DFwJSL9V.js","assets/MobileAppDrawer-DEHTsboI.js","assets/InboxNotificationsProvider-B8qyHdbE.js","assets/useTaskManagerAccess-BNcDbxmw.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Bn69qFOr.js","assets/FeaturePreviewScreen-DWnnuRXB.js","assets/BillPayRoutes-DkWEe87D.js","assets/AddressScreen-DWOW-12j.js","assets/DomesticWireDetailScreen-B2sK3gnq.js","assets/BusinessVerificationPageScreen-fkSKuDKx.js","assets/DrawerScreen-Cxs0fLXJ.js","assets/SetupPagesScreen-BknhxMJr.js","assets/BillPayApprovalRoutes-CwQ70Jsb.js","assets/ReimbursementApprovalRuleDetailScreen-DJEm2XXH.js","assets/getLocaleForTenant-CHied7Hb.js","assets/ReimbursementRoutes-BgavHl4p.js","assets/ReimbursementApprovalRoutes-BTAP_qed.js","assets/TransactionListRoutes-BiDSTFZP.js","assets/ZeniAccountStatementScreen-DnKhFx6b.js","assets/SettingsRoutes-CslaKFsZ.js","assets/AccountMappingScreen-BlrRRyYK.js","assets/QBOConnectionScreen-BajGDFuL.js","assets/empty-M8CZcWYb.js","assets/index-gjFAkOOB.js","assets/url-Cjk2PJJX.js","assets/index-PCu_2P3b.js","assets/accountMappingHelper-y0E9h6aC.js","assets/useEmailConnectResultRefresh-dPGnutjz.js","assets/ReportsRoutes-C93h6574.js","assets/ChargeCardRoutes-BPu1nuyG.js","assets/useChargeCardPusherEvents-BPnD4KLb.js","assets/PeopleRoutes-DFwhgdPC.js","assets/ExpenseAutomationRoutes-CdYiuFY6.js","assets/useActualMatchingMatchDetail-RtuBBjbC.js","assets/ScheduleDetailsPrepaidExpensesScreen-bMBkbiJF.js","assets/pathToGoBack-DqGGHSwL.js","assets/TreasuryRoutes-B0bQBu4a.js","assets/VendorsRoutes-CyexNe36.js","assets/ZeniAccountRoutes-Bn27iI8z.js","assets/AddressRoutes-Coz5Rzvv.js","assets/PandLWithForecastRoutes-DA-gkwnG.js","assets/CustomerOnboardingRoutes-2FuFx1YW.js","assets/TransactionDetailRoutes-VLp4TIB7.js","assets/EntityDetailRoutes-J1t-f_rN.js","assets/InvoicingRoutes-_2bztMtp.js","assets/NotificationRoutes-CbQ2m8ON.js","assets/PerformanceRoutes-D0mskpFQ.js","assets/ActualMatchingMatchDetailScreen-KBRWoEoc.js","assets/RewardsRoutes-CjIMfvYV.js","assets/TaskRoutes-B2KOXvdP.js","assets/TaskListScreen-BamiN5-8.js","assets/useTaskManagerPusherEvents-DoGLBnPU.js","assets/AiCfoScreen-DcDfH2LH.js","assets/CardsAiCfoScreen-D2h73Hql.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as hs,fF as ps,d_ as xs,dZ as gs,AZ as Rs,di as js,c8 as Is,gJ as Ts,g9 as As,df as pe,cG as fs,gn as bs,cy as Ds,bE as ys,br as vs,U8 as Cs,v as Os,Ub as Us,bq as Ps,Uc as ws,bK as Fs,bJ as Ls,bt as ks,cu as Hs,Ud as Vs,Ue as Ss,da as Bs,dd as Ns,dc as Ms,cF as Zs,cM as Gs,pS as xe,gi as ge,gY as $s,gk as Re,gL as je,gM as Ie,gl as zs}from"./zeni-epic-state-DpjvBN7b.js";import{j as e}from"./liveblocks-DXYs6rwe.js";import{a as P}from"./sentry-BmkYxd02.js";import{N as u,u as Ys,h as qs,i as Js,g as Ws,j as G,q as Te,n as Ks,o as n}from"./core-B2JcUSRu.js";import{J as l,E as Qs,u as Xs,z as y,c as et,e as st,H as tt,v as B,g as nt,N as at,Q as ot,L as F,G as Ae,t as _,O as rt,P as it,S as lt,j as ne}from"./index-DoNDPHnj.js";import"./mui-BLmtkCLd.js";import{f as fe}from"./analyticsHelper-HN-E8Xpa.js";import{t as ut}from"./getLocaleForTenant-CHied7Hb.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},b=new o.Error().stack;b&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[b]="4409e8bd-fca3-40ff-9996-386a2505e85f",o._sentryDebugIdIdentifier="sentry-dbid-4409e8bd-fca3-40ff-9996-386a2505e85f")}catch{}})();const dt=l((()=>s((()=>import("./NotFoundScreen-tLaFUNLQ.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ct=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),mt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),be=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:b,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:k,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(k===!0){if(o)return e.jsx(De,{tenantEmailDomain:C});if(i)return e.jsx(be,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(De,{tenantEmailDomain:C}):i?e.jsx(be,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):b?e.jsx(mt,{tenantEmailDomain:C}):N?e.jsx(ct,{tenantEmailDomain:C}):e.jsx(dt,{})},_t={dashboard:()=>s((()=>import("./DashboardRoutes-CsVUKDom.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-DkWEe87D.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-BgavHl4p.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-BiDSTFZP.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-CslaKFsZ.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-C93h6574.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-BPu1nuyG.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-DFwhgdPC.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-CdYiuFY6.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-B0bQBu4a.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-CyexNe36.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-Bn27iI8z.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]))},Et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},ht=l((()=>s((()=>import("./ReportsRoutes-C93h6574.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),pt=l((()=>s((()=>import("./AddressRoutes-Coz5Rzvv.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),xt=l((()=>s((()=>import("./PeopleRoutes-DFwhgdPC.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),gt=l((()=>s((()=>import("./PandLWithForecastRoutes-DA-gkwnG.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),Rt=l((()=>s((()=>import("./CustomerOnboardingRoutes-2FuFx1YW.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),jt=l((()=>s((()=>import("./VendorsRoutes-CyexNe36.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),It=l((()=>s((()=>import("./TransactionDetailRoutes-VLp4TIB7.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-J1t-f_rN.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),Tt=l((()=>s((()=>import("./DashboardRoutes-CsVUKDom.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-DkWEe87D.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])))),At=l((()=>s((()=>import("./SettingsRoutes-CslaKFsZ.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])))),ft=l((()=>s((()=>import("./InvoicingRoutes-_2bztMtp.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-BgavHl4p.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])))),bt=l((()=>s((()=>import("./ZeniAccountRoutes-Bn27iI8z.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])))),Dt=l((()=>s((()=>import("./TreasuryRoutes-B0bQBu4a.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),yt=l((()=>s((()=>import("./TransactionListRoutes-BiDSTFZP.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),vt=l((()=>s((()=>import("./ChargeCardRoutes-BPu1nuyG.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),Ct=l((()=>s((()=>import("./NotificationRoutes-CbQ2m8ON.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Ot=l((()=>s((()=>import("./PerformanceRoutes-D0mskpFQ.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ut=l((()=>s((()=>import("./ExpenseAutomationRoutes-CdYiuFY6.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])))),Pt=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-KBRWoEoc.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),wt=l((()=>s((()=>import("./RewardsRoutes-CjIMfvYV.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Ft=l((()=>s((()=>import("./TaskRoutes-B2KOXvdP.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),Lt=l((()=>s((()=>import("./AiCfoScreen-DcDfH2LH.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-D2h73Hql.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),f=l((()=>s((()=>import("./NotFoundScreen-tLaFUNLQ.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),kt=l((()=>s((()=>import("./TaskListScreen-BamiN5-8.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Ht=({isDashboardAccess:o,showZeniAccountRoute:b,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:k,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:H})=>{if(O===!0){if(b)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return C===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):b?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):H?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`}),zt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const b=Ys(),N=qs(),{tenantEmailDomain:i}=Js(),k=Qs().mode,{setLoading:O,clearAllLoading:C,clearLoading:H}=Xs(),D=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),W=hs(I),$=Ws(),[L,we]=P.useState(!1),r=G((a=>ps(a))),{useFeatureGate:V}=et(),M=st(),K=tt(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=V(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=V(B.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?xs(oe,r):void 0,Q=p==="Completed"||T==="Completed"?gs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!js(r):void 0,He=nt(r,ke,oe),{isCardsHidden:Ve}=at(r?.tenantId),Se=!He||!!Ve,{isFeatureEnabled:Be}=V(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=V(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=V(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||lt==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),z=G((a=>Ts(a)));if(i!=null){const a=y.getSignedInUserTenant(i);I!=null&&a!=null&&fe(I,r,k)}const Z={tenantId:D,userId:I?.userId,sessionId:I?.zeniSessionId},ie=As(),h=ot(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=fs(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,Ye=G((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=ys(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=vs();t.isAfter(d,"month")===!1?b(Cs(D,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,D]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,I,b,y]),P.useLayoutEffect((()=>{!Os(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(ut(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,b,Ye))}),[D]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,Y,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const q=t!=null&&d?.zeniSessionId!=null,ms=c==null||c.tenantId!==t,_s=c!=null&&c.excludedResources==null,Es=c!=null&&c.externalConnections==null;if(q&&ms){S(Re(t));const J=y.getSignedInUserTenantWithId(t);J?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else q&&_s&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),q&&Es&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(q){ne.identify(d.userId,{tenant_id:t});const J=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),Y(F.TENANT_FETCHING),S(zs(d.userId,t,d.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,D,I,O,b))}),[D,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),y.saveSignedInUserTenants(Us(z.tenantsBaseInOrder)),I!=null&&fe(I,r,k,void 0,z.tenantsBaseInOrder))}),[z,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(C(),_.markActiveTenantFetchCompleted(D)):p==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,D,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=Et,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],Y=_t[d];Y!=null?Y().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:qe}=V(B.isReferralFeatureEnabled),{isFeatureEnabled:Je}=V(B.isAccrualEnabled),We=rt(),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Se&&!U,Xe=ws(h?.loggedInUserRoleMap),es=r.externalConnections?.accounting[0]?.isValid,ss=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&Fs(h?.loggedInUserRoleMap),_e=Fe&&!U,ts=Le&&!U,ns=ue&&Ls(h?.loggedInUserRoleMap),as=de&&ks(h?.loggedInUserRoleMap),os=_e&&Hs(h?.loggedInUserRoleMap),rs=Vs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),ds=Ms(h?.loggedInUserRoleMap),x=Zs(h?.loggedInUserRoleMap),g=Gs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&ls,j=ts&&us,m=de&&ds,cs=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Xe===!0||rs===!0||is===!0;return y.isSignedIn()?D==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&T!=="In-Progress"&&b(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||W&&!ee)&&ss&&es!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||W?!L||te!==!1||ee||W?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(it,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Ht,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(Tt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(ht,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:cs||w?e.jsx(xt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(gt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(Rt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Ke||Qe?e.jsx(It,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(yt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,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:j,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:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(kt,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ft,{})}),e.jsx(n,{path:"address/*",element:ns||me||os||as?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(bt,{}):e.jsx(f,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(Dt,{}):e.jsx(f,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ot,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&U===!1?e.jsx(Ut,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&U===!1&&Je===!0&&We===!0?e.jsx(Pt,{}):e.jsx(f,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(Ct,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(jt,{}):e.jsx(f,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,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:j,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:j,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:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(At,{hasAdminLevelAccess:me}):e.jsx(f,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(ft,{}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(vt,{}):e.jsx(f,{})}),e.jsx(n,{path:"rewards/*",element:qe?e.jsx(wt,{}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(Lt,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"*",element:e.jsx(f,{})})]})}):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:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,zt as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DR8KfETq.js";import{a as d}from"./sentry-FwaDhTzy.js";import{h as N,g as H,u as _,i as O,j as C,l as K,n as Y,o as k}from"./core-Dh_SHcAD.js";import{fF as w,Zl as ve,NA as Pe,YV as we,Z2 as Ae,c8 as X,cT as De,cU as Ue,bq as _e,de as Te,FV as Me,Zm as Re,P1 as Be,Mr as Ze,Mi as de,Mf as Fe,FZ as ue,Ml as pe,Mo as ge,Mu as W,C9 as ee,FY as Ve,lu as $,lx as me,Zn as Ne,mH as Oe,Ge as Le,VB as Ge,VC as $e,ls as He,Zo as Ke,lv as qe,uA as ze,Vw as Qe,Vx as Ye,uE as Je,hV as Xe,Uv as Q,hN as ae,hK as We,hS as en,Uw as nn,Gb as tn,Zp as an,Zq as on,MI as sn,l$ as rn,dZ as fe,d_ as he,Zr as ln,gC as cn,UL as dn,Ga as oe,gH as se,gG as un,G9 as pn,gF as gn,gE as mn,Zs as fn,TX as Ce,Zt as hn,Zu as Cn,Zv as yn,Zw as Sn,Zx as bn,Zy as In,Gh as xn,Zz as En,G8 as ie,G2 as G,ZA as kn,ZB as jn,ZC as re,ZD as vn,dS as Pn,ZE as wn,ZF as An,ZG as Dn,U7 as Un,c0 as _n,c7 as Tn,c6 as Mn,c1 as Rn,ZH as Bn,c4 as Zn,c3 as Fn,c5 as Vn,c2 as Nn}from"./zeni-epic-state-DJh0-ZeR.js";import{bT as On,z as P,Q as L,a8 as ne,c3 as Ln,j as q,c as te,A as F,g as ye,I as Se,c4 as Gn,h as $n,_ as be,c5 as Hn,aj as Kn,c6 as qn,c7 as zn,ar as Qn,c8 as Yn,p as Jn,d as Ie,c9 as Xn}from"./index-CHaKE3QQ.js";import{n as B}from"./mui-BYn_Ugho.js";import{u as xe}from"./useTaskManagerAccess-D4PJ1zkK.js";import{U as Wn}from"./AccountMappingScreen-B05quPfB.js";import{t as et,A as nt}from"./AddressScreen-DkOVp1Il.js";import V from"./NotFoundScreen-BG5HsGgf.js";import{g as tt}from"./analyticsHelper-Czpx502m.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-Bh9Wow-A.js";import{C as st}from"./CompanyPassportScreen-Cvbu6LUT.js";import{M}from"./MobileAppDrawer-D3MVdjfj.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-CKnBwo84.js";import{q as le}from"./QBOConnectionScreen-CXR9MUeu.js";import{B as lt}from"./BillPayApprovalRoutes-vJIdZGym.js";import{R as ct}from"./ReimbursementApprovalRoutes-CADwX7m0.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";import"./accountMappingHelper-DNRaFM1C.js";import"./routePaths-DXpM4tZj.js";import"./InboxNotificationsProvider-D6QvVVj8.js";import"./empty-XI8MiQF0.js";import"./pdf-lib-DdZd3IiB.js";import"./index-B23hmQHl.js";import"./url-DHu7Ejzz.js";import"./index-D3h8toFn.js";import"./decodeURIComponentSafe-B9wRnGXi.js";import"./ReimbursementApprovalRuleDetailScreen-C__AcyMO.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]="95416d27-0b83-433f-9c2d-5df2a5d847f3",e._sentryDebugIdIdentifier="sentry-dbid-95416d27-0b83-433f-9c2d-5df2a5d847f3")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-DXYs6rwe.js";import{a as d}from"./sentry-BmkYxd02.js";import{h as N,g as H,u as _,i as O,j as C,l as K,n as Y,o as k}from"./core-B2JcUSRu.js";import{fF as w,Zl as ve,NA as Pe,YV as we,Z2 as Ae,c8 as X,cT as De,cU as Ue,bq as _e,de as Me,FV as Re,Zm as Te,P1 as Be,Mr as Ze,Mi as de,Mf as Fe,FZ as ue,Ml as pe,Mo as ge,Mu as W,C9 as ee,FY as Ve,lu as $,lx as me,Zn as Ne,mH as Oe,Ge as Le,VB as Ge,VC as $e,ls as He,Zo as Ke,lv as qe,uA as ze,Vw as Qe,Vx as Ye,uE as Je,hV as Xe,Uv as Q,hN as ae,hK as We,hS as en,Uw as nn,Gb as tn,Zp as an,Zq as on,MI as sn,l$ as rn,dZ as fe,d_ as he,Zr as ln,gC as cn,UL as dn,Ga as oe,gH as se,gG as un,G9 as pn,gF as gn,gE as mn,Zs as fn,TX as Ce,Zt as hn,Zu as Cn,Zv as yn,Zw as Sn,Zx as bn,Zy as In,Gh as xn,Zz as En,G8 as ie,G2 as G,ZA as kn,ZB as jn,ZC as re,ZD as vn,dS as Pn,ZE as wn,ZF as An,ZG as Dn,U7 as Un,c0 as _n,c7 as Mn,c6 as Rn,c1 as Tn,ZH as Bn,c4 as Zn,c3 as Fn,c5 as Vn,c2 as Nn}from"./zeni-epic-state-DpjvBN7b.js";import{bU as On,z as P,Q as L,a8 as ne,c4 as Ln,j as q,c as te,v as F,g as ye,N as Se,c5 as Gn,h as $n,_ as be,c6 as Hn,aj as Kn,c7 as qn,c8 as zn,ar as Qn,c9 as Yn,p as Jn,d as Ie,ca as Xn}from"./index-DoNDPHnj.js";import{n as B}from"./mui-BLmtkCLd.js";import{u as xe}from"./useTaskManagerAccess-BNcDbxmw.js";import{U as Wn}from"./AccountMappingScreen-BlrRRyYK.js";import{t as et,A as nt}from"./AddressScreen-DWOW-12j.js";import V from"./NotFoundScreen-tLaFUNLQ.js";import{g as tt}from"./analyticsHelper-HN-E8Xpa.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-fkSKuDKx.js";import{C as st}from"./CompanyPassportScreen-DFwJSL9V.js";import{M as R}from"./MobileAppDrawer-DEHTsboI.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-dPGnutjz.js";import{q as le}from"./QBOConnectionScreen-BajGDFuL.js";import{B as lt}from"./BillPayApprovalRoutes-CwQ70Jsb.js";import{R as ct}from"./ReimbursementApprovalRoutes-BTAP_qed.js";import"./recharts-UN7cJOXN.js";import"./analytics-BDCkEq_I.js";import"./plaid-DHQC2tsw.js";import"./dnd-BAPMa4RJ.js";import"./stripe-cKAAJElX.js";import"./lottie-C9Rxpkwh.js";import"./lexical-DGZ06Yv6.js";import"./pdf-DMCYUxGc.js";import"./utils-BGWE7tXK.js";import"./accountMappingHelper-y0E9h6aC.js";import"./routePaths-V2hUGG4a.js";import"./InboxNotificationsProvider-B8qyHdbE.js";import"./empty-M8CZcWYb.js";import"./pdf-lib-D7-8SdHl.js";import"./index-gjFAkOOB.js";import"./url-Cjk2PJJX.js";import"./index-PCu_2P3b.js";import"./decodeURIComponentSafe-CIM8Yd6k.js";import"./ReimbursementApprovalRuleDetailScreen-DJEm2XXH.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]="23c3db3f-1b28-4a28-aeac-bd23ff192d51",e._sentryDebugIdIdentifier="sentry-dbid-23c3db3f-1b28-4a28-aeac-bd23ff192d51")}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-DR8KfETq.js";import{a as d}from"./sentry-FwaDhTz
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:q}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=N(),l=H(),o=_(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>ve(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=On(c?.tenantId),p=c.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(Pe(!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(M,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
9
+ `,ut=K((function(e,l){const o=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:q}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=N(),l=H(),o=_(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>ve(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=On(c?.tenantId),p=c.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(Pe(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-DR8KfETq.js";import{a as d}from"./sentry-FwaDhTz
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:Re(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(W(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Fe(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ze(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=N(),l=H(),o=_(),{tenantEmailDomain:i}=O(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(F.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(F.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&_e(m.userRole),v=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,T=ye(m,t,s),D=Te(m,r?.loggedInUserRoleMap)&&T,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Me(!1)))}),[h,o,p]);const R=A=>{u(A)};return b||v||E||D?a.jsxs(gt,{children:[a.jsx(M,{isAppContentDrawerOpen:c,handleDrawerToggle:R}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:v,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{R(!0)}})]}):a.jsx(V,{})},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:Te(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(W(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Fe(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ze(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=N(),l=H(),o=_(),{tenantEmailDomain:i}=O(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(F.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(F.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&_e(m.userRole),v=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,M=ye(m,t,s),D=Me(m,r?.loggedInUserRoleMap)&&M,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Re(!1)))}),[h,o,p]);const T=A=>{u(A)};return b||v||E||D?a.jsxs(gt,{children:[a.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:T}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:v,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{T(!0)}})]}):a.jsx(V,{})},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-DR8KfETq.js";import{a as d}from"./sentry-FwaDhTz
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=Ne(e,o),{uiState:t}=n,s=(X(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(W(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(qe(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Oe({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=N(),l=H(),o=_(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>w(j))),S=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Ve(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 v=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(M,{isAppContentDrawerOpen:r,handleDrawerToggle:v}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},J="external_integrations",St=K((function(e){const l=Ye(e,J);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(We(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=>{q.trackIntegrationsNotifyMeClicked("Settings",s),e(Je(J,s,r))}}}))(qn),bt=()=>{const e=Kn(),l=N(),o=_(),{tenantEmailDomain:i}=O(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??P.getSignedInUserTenant(i)?.companyId,h=P.getSignedInUser(),S=L(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(J))}),[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))),v=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:T,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(M,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:T,onReLoginPlaidAccount:D,plaidConnectionDetails:v})]}):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=Ne(e,o),{uiState:t}=n,s=(X(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(W(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(qe(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Oe({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=N(),l=H(),o=_(),{tenantEmailDomain:i}=O(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>w(j))),S=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Ve(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 v=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:v}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},J="external_integrations",St=K((function(e){const l=Ye(e,J);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(We(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=>{q.trackIntegrationsNotifyMeClicked("Settings",s),e(Je(J,s,r))}}}))(qn),bt=()=>{const e=Kn(),l=N(),o=_(),{tenantEmailDomain:i}=O(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??P.getSignedInUserTenant(i)?.companyId,h=P.getSignedInUser(),S=L(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(J))}),[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))),v=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:M,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:M,onReLoginPlaidAccount:D,plaidConnectionDetails:v})]}):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-DR8KfETq.js";import{a as d}from"./sentry-FwaDhTz
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,Et=()=>{const e=_(),{tenantEmailDomain:l}=O(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??P.getSignedInUserTenant(l)?.companyId,n=P.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(W(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(M,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
41
+ `,Et=()=>{const e=_(),{tenantEmailDomain:l}=O(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??P.getSignedInUserTenant(l)?.companyId,n=P.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(W(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(R,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-DR8KfETq.js";import{a as d}from"./sentry-FwaDhTz
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=_(),o=N(),i=H(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??P.getSignedInUserTenant(s)?.companyId;if(P.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(F.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(F.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),v=!g&&b,j=ye(t,S,m),{isCardsHidden:T}=Se(t?.tenantId),D=!j||T,{areTenantIdsInSync:I}=Qn();d.useEffect((()=>{I&&l(ln(c,v))}),[c,l,v,I]);const x=C((y=>cn(y,v))),R=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(M,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Yn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:R,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const Z=(function(ke,je){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${je}`),z})(s,y),Ee=Jn(i.state?.pathnameStackToGoBack,i.pathname);o(Z,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const Z={...x.myProfileLocalData,phone:y};l(oe({localData:Z})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,Z)=>{l(un(y,Z,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&P.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=_(),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]),v=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]),T=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,y)=>{e(jn({eventId:f,channel:re(U),enabled:y}))}),[e]),I=d.useCallback(((f,U)=>{e(vn({groupId:f,frequency:Pn(U)}))}),[e]),x=d.useCallback(((f,U,y)=>{e(wn({groupId:f,channel:re(U),enabled:y}))}),[e]),R=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(M,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:v,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:T,taskNotifications:R,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>w(b))),n=L(),t=Ie(),s=_(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(F.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?_n(r)?a.jsxs(Y,{children:[Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Wn,{})}),Mn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(vt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Rn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Zn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Fn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Vn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Nn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]}):a.jsx(Y,{children:a.jsx(k,{path:"*",element:a.jsx(V,{})})}):null}function vt(e){return a.jsxs(Y,{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(V,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]})}export{da as default};
49
+ `,ce=({appContent:e})=>{const l=_(),o=N(),i=H(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??P.getSignedInUserTenant(s)?.companyId;if(P.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(F.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(F.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),v=!g&&b,j=ye(t,S,m),{isCardsHidden:M}=Se(t?.tenantId),D=!j||M,{areTenantIdsInSync:I}=Qn();d.useEffect((()=>{I&&l(ln(c,v))}),[c,l,v,I]);const x=C((y=>cn(y,v))),T=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Yn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:T,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const Z=(function(ke,je){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${je}`),z})(s,y),Ee=Jn(i.state?.pathnameStackToGoBack,i.pathname);o(Z,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const Z={...x.myProfileLocalData,phone:y};l(oe({localData:Z})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,Z)=>{l(un(y,Z,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&P.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=_(),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]),v=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]),M=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,y)=>{e(jn({eventId:f,channel:re(U),enabled:y}))}),[e]),I=d.useCallback(((f,U)=>{e(vn({groupId:f,frequency:Pn(U)}))}),[e]),x=d.useCallback(((f,U,y)=>{e(wn({groupId:f,channel:re(U),enabled:y}))}),[e]),T=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e(G()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(R,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:v,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:M,taskNotifications:T,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>w(b))),n=L(),t=Ie(),s=_(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(F.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?_n(r)?a.jsxs(Y,{children:[Mn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Wn,{})}),Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(vt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Tn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Zn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Fn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Vn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Nn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]}):a.jsx(Y,{children:a.jsx(k,{path:"*",element:a.jsx(V,{})})}):null}function vt(e){return a.jsxs(Y,{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(V,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]})}export{da as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-DR8KfETq.js";import{h as Q,g as X,u as ee,i as W,j as v,N as j,l as G,t as Xe}from"./core-Dh_SHcAD.js";import{bJ as en,fF as F,cG as nn,HN as $,YV as tn,YY as an,uT as ne,uH as te,mz as ae,BH as R,Y_ as Ce,gG as He,gF as We,gE as Ge,Y$ as sn,HW as on,Mr as he,Mi as Ie,Mf as Ae,LZ as J,Ml as _e,Mo as ke,Mu as ve,C9 as Pe,g_ as cn,cB as rn,d_ as un,dZ as dn,di as ln,bt as pn,cu as Fe,Z0 as mn,KZ as de,LB as yn,Z1 as fn,bK as gn,NM as le,NA as Sn,Z2 as bn,Z3 as Cn,NQ as hn,NU as In,Z4 as je,BA as An,Sg as _n,Oq as be,Pf as pe,Z5 as kn,Z6 as vn,Z7 as Pn,Z8 as Ye,Z9 as Tn,Vk as En,Ya as Dn,Vz as Un,Za as Ke,M1 as On,VA as wn,M5 as Fn,Zb as we,OA as qe,mH as Vn,uK as Je,BJ as xn,bE as Ne,BV as Re,cE as Bn,Zc as Qe,O7 as jn,O8 as Nn,Oc as Rn,Zd as Ln,Ot as Le,Ze as Mn,Zf as zn,Zg as Zn,Zh as $n,gV as Hn,J6 as Wn,Zi as Gn,Jb as Yn,Ja as Kn}from"./zeni-epic-state-DJh0-ZeR.js";import{aj as Te,Q as ie,c as me,A as q,E as Ee,z as E,a9 as se,j as D,a8 as De,S as H,bQ as qn,af as oe,bR as V,bj as Ve,bS as Jn,bT as Qn,bU as Xn,n as Be,bV as et,p as Me,aH as ze,a2 as nt,ac as tt,bW as at,bX as it,bY as st,w as ot}from"./index-CHaKE3QQ.js";import{a as h}from"./sentry-FwaDhTzy.js";import{n as xe,D as ct,S as rt}from"./mui-BYn_Ugho.js";import{u as ut,B as Oe}from"./BusinessVerificationPageScreen-Bh9Wow-A.js";import{M as ye}from"./MobileAppDrawer-D3MVdjfj.js";import N from"./NotFoundScreen-BG5HsGgf.js";import{a as Ze}from"./analyticsHelper-Czpx502m.js";import{d as $e}from"./routePaths-DXpM4tZj.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]="8b4d6404-ef0c-445b-84be-088e6c9e7722",e._sentryDebugIdIdentifier="sentry-dbid-8b4d6404-ef0c-445b-84be-088e6c9e7722")}catch{}})();const dt=xe.div`
1
+ import{j as u}from"./liveblocks-DXYs6rwe.js";import{h as Q,g as X,u as ee,i as W,j as v,N as j,l as G,t as Xe}from"./core-B2JcUSRu.js";import{bJ as en,fF as F,cG as nn,HN as $,YV as tn,YY as an,uT as ne,uH as te,mz as ae,BH as R,Y_ as Ce,gG as He,gF as We,gE as Ge,Y$ as sn,HW as on,Mr as he,Mi as Ie,Mf as Ae,LZ as J,Ml as _e,Mo as ke,Mu as ve,C9 as Pe,g_ as cn,cB as rn,d_ as un,dZ as dn,di as ln,bt as pn,cu as Fe,Z0 as mn,KZ as de,LB as yn,Z1 as fn,bK as gn,NM as le,NA as Sn,Z2 as bn,Z3 as Cn,NQ as hn,NU as In,Z4 as je,BA as An,Sg as _n,Oq as be,Pf as pe,Z5 as kn,Z6 as vn,Z7 as Pn,Z8 as Ye,Z9 as Tn,Vk as En,Ya as Dn,Vz as Un,Za as Ke,M1 as On,VA as wn,M5 as Fn,Zb as we,OA as qe,mH as Vn,uK as Je,BJ as xn,bE as Ne,BV as Re,cE as Bn,Zc as Qe,O7 as jn,O8 as Nn,Oc as Rn,Zd as Ln,Ot as Le,Ze as Mn,Zf as zn,Zg as Zn,Zh as $n,gV as Hn,J6 as Wn,Zi as Gn,Jb as Yn,Ja as Kn}from"./zeni-epic-state-DpjvBN7b.js";import{aj as Te,Q as ie,c as me,v as q,E as Ee,z as E,a9 as se,j as D,a8 as De,W as H,bR as qn,af as oe,bS as V,bj as Ve,bT as Jn,bU as Qn,bV as Xn,n as Be,bW as et,p as Me,aH as ze,a2 as nt,ac as tt,bX as at,bY as it,bZ as st,w as ot}from"./index-DoNDPHnj.js";import{a as h}from"./sentry-BmkYxd02.js";import{n as xe,D as ct,S as rt}from"./mui-BLmtkCLd.js";import{u as ut,B as Oe}from"./BusinessVerificationPageScreen-fkSKuDKx.js";import{M as ye}from"./MobileAppDrawer-DEHTsboI.js";import N from"./NotFoundScreen-tLaFUNLQ.js";import{a as Ze}from"./analyticsHelper-HN-E8Xpa.js";import{d as $e}from"./routePaths-V2hUGG4a.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]="28d5c3f9-ca39-4224-957a-40f15402d492",e._sentryDebugIdIdentifier="sentry-dbid-28d5c3f9-ca39-4224-957a-40f15402d492")}catch{}})();const dt=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-DXYs6rwe.js";import{a as u,R as T,q as A}from"./sentry-BmkYxd02.js";import{u as j,h as z,j as l,g as D,N as F,l as M}from"./core-B2JcUSRu.js";import{u as O,z as s,E as P,j as w,G as _,U as N,W as B,X as $,Y as V,Z as W,_ as v}from"./index-DoNDPHnj.js";import{fF as q,TT as J,Ub as R,gi as X,gk as G,Ug as H,gU as Y,dj as Z,Uh as y,Ui as K,Uj as Q,b$ as U}from"./zeni-epic-state-DpjvBN7b.js";import"./mui-BLmtkCLd.js";import{u as ee}from"./useDeviceId-IlYBwHEv.js";import{f as te}from"./analyticsHelper-HN-E8Xpa.js";import{t as ne}from"./getLocaleForTenant-CHied7Hb.js";import"./recharts-UN7cJOXN.js";import"./analytics-BDCkEq_I.js";import"./plaid-DHQC2tsw.js";import"./dnd-BAPMa4RJ.js";import"./stripe-cKAAJElX.js";import"./lottie-C9Rxpkwh.js";import"./lexical-DGZ06Yv6.js";import"./pdf-DMCYUxGc.js";import"./utils-BGWE7tXK.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]="0d3ff2b3-076d-4833-a40e-57b5d00f8584",t._sentryDebugIdIdentifier="sentry-dbid-0d3ff2b3-076d-4833-a40e-57b5d00f8584")}catch{}})();const ie=M((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(Q({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(K(n,a)))},clearSignInError:()=>{t(y())}}}))(W),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=j(),d=z(),{clearAllLoading:g}=O(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:b,accountUnlockTime:k}=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=>q(e))),I=l((e=>J(e))),m=D(),E=P().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.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(R(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),Y().then((()=>{const e=V();e!=null&&N(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",Z(r.productSettings))}),2e3))}),[S,p,L,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(F,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&k!=null?f.jsx($,{onClose:()=>i(y()),unlockDate:k}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-DXYs6rwe.js";import{a as i}from"./sentry-BmkYxd02.js";import{u as f,g as l,N as u}from"./core-B2JcUSRu.js";import{z as n,j as a,W as m,a8 as p}from"./index-DoNDPHnj.js";import{gX as g,Ux as b}from"./zeni-epic-state-DpjvBN7b.js";import{n as y}from"./mui-BLmtkCLd.js";import"./recharts-UN7cJOXN.js";import"./analytics-BDCkEq_I.js";import"./plaid-DHQC2tsw.js";import"./dnd-BAPMa4RJ.js";import"./stripe-cKAAJElX.js";import"./lottie-C9Rxpkwh.js";import"./lexical-DGZ06Yv6.js";import"./pdf-DMCYUxGc.js";import"./utils-BGWE7tXK.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]="20beedd5-6178-4f71-a2a5-5bcccb68bdba",e._sentryDebugIdIdentifier="sentry-dbid-20beedd5-6178-4f71-a2a5-5bcccb68bdba")}catch{}})();function N(){const e=f(),t=l(),r=i.useRef(!1),c=n.isSignedIn(),o=t.state?.message==="logout"||c;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.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{N as default};
@@ -1,4 +1,4 @@
1
- import{j as f}from"./liveblocks-DR8KfETq.js";import{a as A}from"./sentry-FwaDhTzy.js";import{h as pa,u as Ta,g as ga,k as fa,j as v,i as _a,l as ma}from"./core-Dh_SHcAD.js";import{z as R,c as Da,A as _,at as Sa,a9 as ya,j as Ea,S as ba,e6 as ha,p as C,a5 as Aa}from"./index-CHaKE3QQ.js";import{fF as Ca,a1$ as V,R2 as D,a20 as q,a1X as Ga,Qq as N,a21 as Ia,Qy as O,Q8 as Ba,PM as La,R3 as Q,a22 as z,gh as Ka,QV as va,Q_ as wa,QN as Ra,QL as Z,Q$ as Ua,QI as Pa,a23 as Fa,a24 as ja,a25 as $a,a26 as xa,a27 as m,dx as Na,dw as Oa,a28 as Qa,Q5 as za}from"./zeni-epic-state-DJh0-ZeR.js";import{n as Za}from"./mui-BYn_Ugho.js";import{u as Ma}from"./useAskAiCfoHostNavButtonProps-PLm72Ozi.js";import{M as Va}from"./MobileAppDrawer-D3MVdjfj.js";import{u as qa}from"./useTaskManagerPusherEvents-DchZU-tO.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]="598f72e5-1d61-4ca3-bc20-8b9ee332400f",e._sentryDebugIdIdentifier="sentry-dbid-598f72e5-1d61-4ca3-bc20-8b9ee332400f")}catch{}})();const c={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"},Wa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Xa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),G=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ha=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const i={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(i.is_private=a.is_private),G(a.assignees)&&(i.assignees=a.assignees),G(a.direct_assignees)&&(i.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(i.created_by=a.created_by),G(a.task_group_ids)&&(i.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(i.name=a.name),typeof a.parent_task_id=="string"&&(i.parent_task_id=a.parent_task_id),i},Ja=e=>{if(e==null||typeof e!="object")return null;const a=e;return G(a.task_ids)?{task_ids:a.task_ids}:null},ke=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},Ya=Za.div`
1
+ import{j as g}from"./liveblocks-DXYs6rwe.js";import{a as A}from"./sentry-BmkYxd02.js";import{h as pa,u as Ta,g as fa,k as ga,j as v,i as _a,l as ma}from"./core-B2JcUSRu.js";import{z as R,c as Da,v as _,at as Sa,a9 as ya,j as Ea,W as ba,e6 as ha,p as C,a5 as Aa}from"./index-DoNDPHnj.js";import{fF as Ca,a1$ as V,R2 as D,a20 as W,a1X as Ga,Qq as N,a21 as Ia,Qy as O,Q8 as Ba,PM as La,R3 as Q,a22 as z,gh as Ka,QV as va,Q_ as wa,QN as Ra,QL as Z,Q$ as Ua,QI as Pa,a23 as Fa,a24 as ja,a25 as $a,a26 as xa,a27 as m,dx as Na,dw as Oa,a28 as Qa,Q5 as za}from"./zeni-epic-state-DpjvBN7b.js";import{n as Za}from"./mui-BLmtkCLd.js";import{u as Ma}from"./useAskAiCfoHostNavButtonProps-qSqQpxG4.js";import{M as Va}from"./MobileAppDrawer-DEHTsboI.js";import{u as Wa}from"./useTaskManagerPusherEvents-DoGLBnPU.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]="08932f2d-a3d8-4a00-b49f-94d50592f874",e._sentryDebugIdIdentifier="sentry-dbid-08932f2d-a3d8-4a00-b49f-94d50592f874")}catch{}})();const c={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"},qa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Xa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),G=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ha=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const i={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(i.is_private=a.is_private),G(a.assignees)&&(i.assignees=a.assignees),G(a.direct_assignees)&&(i.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(i.created_by=a.created_by),G(a.task_group_ids)&&(i.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(i.name=a.name),typeof a.parent_task_id=="string"&&(i.parent_task_id=a.parent_task_id),i},Ja=e=>{if(e==null||typeof e!="object")return null;const a=e;return G(a.task_ids)?{task_ids:a.task_ids}:null},ke=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},Ya=Za.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as f}from"./liveblocks-DR8KfETq.js";import{a as A}from"./sentry-FwaDhTz
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ae=ma((function(e,a){const n=V(e,a.isTaskTemplatesEnabled),{taskGroupId:i}=a,r=i!=null&&i!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(i)))}))).filter((t=>t.tasks.length>0))}:n,T=Ga(e),l=R.isZeniUser(),S=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:r,tagListView:T,localData:r.localData,isTaskTemplatesEnabled:a.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:S}}),(function(e,a){const{navigate:n,currentTenant:i,location:r,isTaskTemplatesEnabled:T}=a,{tenantEmailDomain:l}=i,{groupByKey:S}=a.uiState;return{onTaskManagementRowClick:t=>{const s=M(l,t),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(D(!0,T))},onTabChange:t=>{e(xa(t))},onParentTaskClick:t=>{const s=M(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{e(Z(t,null,s))},onNewTaskClick:()=>{if(a.localData.defaultTaskGroupId!=null){const t=w(l,a.localData.defaultTaskGroupId),s=C(r.state?.pathnameStackToGoBack,r.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{e(z({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{e($a({filters:t}))},onSearchTextChanged:t=>{e(ja({searchText:t}))},onReloadCards:()=>{e(D(!0,T))},onBackClick:()=>{if(r.state?.message==="triggerBackClick"){const t=Aa(r.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{e(Fa({localData:t}))},resetLocalData:()=>{e(q({taskGroupById:a.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{e(Pa(a.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{e(Z(a.localData.selectedTaskIds,t,Ua(a.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{e(Ra(t))},onAddNewTaskToTaskGroup:t=>{if(a.localData.defaultTaskGroupId!=null){const s=te(S,t);e(N({taskDetailLocalData:s}));const k=w(l,a.uiState.groupByKey==="groupName"?t:a.localData.defaultTaskGroupId),I=C(r.state?.pathnameStackToGoBack,r.pathname);n(k,{state:{pathnameStackToGoBack:I,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{e(wa(a.localData.selectedTaskIds.length>0?a.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{e(va(t,s))},onTimeSpentUpdate:(t,s)=>{e(Q({task:t,updates:s}))},onShowToast:t=>{e(Ka(t))},onGroupByFilterChange:t=>{e(z({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{e(Q({task:t,updates:s}))},onCreateTagClick:(t,s)=>{e(La(t,s))},onSubtaskCreation:(t,s)=>{e(Ba({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{e(O(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{e(O(t,[s]))},handleNewTaskInitialization:t=>{if(e(N({taskDetailLocalData:{...Ia,name:t}})),a.localData.defaultTaskGroupId!=null){const s=w(l,a.localData.defaultTaskGroupId),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(ha);function ee(){const e=pa(),a=Ta(),n=ga(),i=R.getSignedInUser(),r=R.isZeniUser(),T=fa(),l=v((u=>Ca(u))),{taskGroupId:S}=_a(),{useFeatureGate:t}=Da(),{isFeatureEnabled:s}=t(_.isTaskTemplatesEnabled),{isFeatureEnabled:k}=t(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:I}=t(_.isTaskCategorizationEnabled),{isFeatureEnabled:W}=t(_.isTaskBulkResolutionEnabled),{isFeatureEnabled:X}=t(_.isTaskGroupAssigneesEnabled),{isFeatureEnabled:H}=t(_.isTaskRecurringParentEnabled),[J,Y]=A.useState(!1),B=v((u=>V(u,s))),L=v((u=>u.taskGroupState)),y=B.fetchState,{isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea}=Ma({mobileExploreReferrer:"Task Checklist"});Sa({isDataReady:y==="Completed"}),A.useEffect((()=>{a(D(!1,s))}),[l?.tenantId,a,s]);const ta=A.useMemo((()=>{const u=[c.TASK_CREATED,c.TASK_UPDATED,c.TASKS_BULK_UPDATED,c.TASKS_BULK_DELETED],g=[c.TASK_CREATED,c.TASK_UPDATED,c.TASK_SNOOZE_RESURFACED,c.TASKS_BULK_UPDATED];return[...Wa(l?.companyId,u),...Xa(i?.userId,g)]}),[l?.companyId,i?.userId]);if(qa({events:ta,onEvent:(u,g)=>{switch(u){case c.TASK_CREATED:case c.TASK_UPDATED:{const o=Ha(g);if(o!=null){const h=T.getState(),U=o.task_id,p=U!=null?h.taskState.taskByID?.[U]:void 0,K=p!=null;if(!r)if(o.is_private===!0){if(!K)return}else{const E=i?.userId,b=new Set([...o.assignees??[],...o.direct_assignees??[]]);if(o.created_by!=null&&o.created_by!==""&&b.add(o.created_by),!(E!=null&&b.has(E))&&!K)return}if(u===c.TASK_UPDATED&&K&&p!=null&&Array.isArray(o.task_group_ids)){const E=new Set(Object.values(h.taskGroupState.taskGroupById??{}).filter((d=>d!=null&&!d.isDeleted)).map((d=>d.id))),b=(p.taskGroupIds??[]).filter((d=>E.has(d))),P=(o.task_group_ids??[]).filter((d=>E.has(d))),sa=b.length===P.length&&b.every((d=>P.includes(d))),F=p.taskGroupIds??[],j=o.task_group_ids??[],na=F.length!==j.length||!F.every((d=>j.includes(d))),oa=(d,da)=>{const $=d??[],x=da??[];if($.length!==x.length)return!1;const ca=new Set(x);return $.every((ka=>ca.has(ka)))},ia=o.name==null||o.name===p.name,ra=o.is_private==null||o.is_private===p.isPrivate,la=o.assignees==null||oa(o.assignees,p.assignees),ua=o.direct_assignees==null;if(sa&&na&&ia&&ra&&la&&ua)return}}return void a(D(!0,s))}case c.TASKS_BULK_DELETED:{const o=Ja(g);return o==null?void 0:void o.task_ids.forEach((h=>a(za(h))))}case c.TASKS_BULK_UPDATED:case c.TASK_SNOOZE_RESURFACED:return void a(D(!0,s))}},onSubscribed:()=>{a(D(!0,s))}}),A.useEffect((()=>{y==="Completed"&&a(q({taskGroupById:L.taskGroupById}))}),[y,L.taskGroupById]),i==null)throw Error("Can't access task list page without signing in...");return f.jsxs(f.Fragment,{children:[y==="Completed"?f.jsx(ya,{analytics:Ea,onLoad:u=>(g=>g.trackPageLoaded(ba.Event.taskListPage))(u)}):null,f.jsxs(Ya,{children:[f.jsx(Va,{isAppContentDrawerOpen:J,handleDrawerToggle:u=>{Y(u)}}),f.jsx(ae,{location:n,navigate:e,currentTenant:l,taskGroupId:S,taskGroupState:L,localData:B.localData,uiState:B.uiState,isTaskTemplatesEnabled:s,taskListFetchState:y,isTaskCategorizationEnabled:I,isTaskCannedResponsesEnabled:k,isTaskBulkResolutionEnabled:W,isTaskGroupAssigneesEnabled:X,isTaskRecurringParentEnabled:H,isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea})]})]})}const M=(e,a)=>`/${e}/tasks/${encodeURIComponent(a)}`,w=(e,a)=>`/${e}/tasks/new/${a}`,te=(e,a)=>{if(e==="assignee"){const n=a.split(",");return{...m.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Na(a);return{...m.taskDetailLocalData,priority:n}}if(e==="status"){const n=Oa(a);return{...m.taskDetailLocalData,status:n}}if(e==="tag"){const n=a.split(",");return{...m.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Qa(a);return{...m.taskDetailLocalData,dueDate:n}}return{...m.taskDetailLocalData}},pe=Object.freeze(Object.defineProperty({__proto__:null,default:ee},Symbol.toStringTag,{value:"Module"}));export{c as T,Xa as a,Wa as b,Ja as c,Ha as d,ee as e,pe as f,ke as t};
9
+ `,ae=ma((function(e,a){const n=V(e,a.isTaskTemplatesEnabled),{taskGroupId:i}=a,r=i!=null&&i!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(i)))}))).filter((t=>t.tasks.length>0))}:n,T=Ga(e),l=R.isZeniUser(),S=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:r,tagListView:T,localData:r.localData,isTaskTemplatesEnabled:a.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:S}}),(function(e,a){const{navigate:n,currentTenant:i,location:r,isTaskTemplatesEnabled:T}=a,{tenantEmailDomain:l}=i,{groupByKey:S}=a.uiState;return{onTaskManagementRowClick:t=>{const s=M(l,t),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(D(!0,T))},onTabChange:t=>{e(xa(t))},onParentTaskClick:t=>{const s=M(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{e(Z(t,null,s))},onNewTaskClick:()=>{if(a.localData.defaultTaskGroupId!=null){const t=w(l,a.localData.defaultTaskGroupId),s=C(r.state?.pathnameStackToGoBack,r.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{e(z({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{e($a({filters:t}))},onSearchTextChanged:t=>{e(ja({searchText:t}))},onReloadCards:()=>{e(D(!0,T))},onBackClick:()=>{if(r.state?.message==="triggerBackClick"){const t=Aa(r.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{e(Fa({localData:t}))},resetLocalData:()=>{e(W({taskGroupById:a.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{e(Pa(a.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{e(Z(a.localData.selectedTaskIds,t,Ua(a.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{e(Ra(t))},onAddNewTaskToTaskGroup:t=>{if(a.localData.defaultTaskGroupId!=null){const s=te(S,t);e(N({taskDetailLocalData:s}));const k=w(l,a.uiState.groupByKey==="groupName"?t:a.localData.defaultTaskGroupId),I=C(r.state?.pathnameStackToGoBack,r.pathname);n(k,{state:{pathnameStackToGoBack:I,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{e(wa(a.localData.selectedTaskIds.length>0?a.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{e(va(t,s))},onTimeSpentUpdate:(t,s)=>{e(Q({task:t,updates:s}))},onShowToast:t=>{e(Ka(t))},onGroupByFilterChange:t=>{e(z({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{e(Q({task:t,updates:s}))},onCreateTagClick:(t,s)=>{e(La(t,s))},onSubtaskCreation:(t,s)=>{e(Ba({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{e(O(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{e(O(t,[s]))},handleNewTaskInitialization:t=>{if(e(N({taskDetailLocalData:{...Ia,name:t}})),a.localData.defaultTaskGroupId!=null){const s=w(l,a.localData.defaultTaskGroupId),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(ha);function ee(){const e=pa(),a=Ta(),n=fa(),i=R.getSignedInUser(),r=R.isZeniUser(),T=ga(),l=v((u=>Ca(u))),{taskGroupId:S}=_a(),{useFeatureGate:t}=Da(),{isFeatureEnabled:s}=t(_.isTaskTemplatesEnabled),{isFeatureEnabled:k}=t(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:I}=t(_.isTaskCategorizationEnabled),{isFeatureEnabled:q}=t(_.isTaskBulkResolutionEnabled),{isFeatureEnabled:X}=t(_.isTaskGroupAssigneesEnabled),{isFeatureEnabled:H}=t(_.isTaskRecurringParentEnabled),[J,Y]=A.useState(!1),B=v((u=>V(u,s))),L=v((u=>u.taskGroupState)),y=B.fetchState,{isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea}=Ma({mobileExploreReferrer:"Task Checklist"});Sa({isDataReady:y==="Completed"}),A.useEffect((()=>{a(D(!1,s))}),[l?.tenantId,a,s]);const ta=A.useMemo((()=>{const u=[c.TASK_CREATED,c.TASK_UPDATED,c.TASKS_BULK_UPDATED,c.TASKS_BULK_DELETED],f=[c.TASK_CREATED,c.TASK_UPDATED,c.TASK_SNOOZE_RESURFACED,c.TASKS_BULK_UPDATED];return[...qa(l?.companyId,u),...Xa(i?.userId,f)]}),[l?.companyId,i?.userId]);if(Wa({events:ta,onEvent:(u,f)=>{switch(u){case c.TASK_CREATED:case c.TASK_UPDATED:{const o=Ha(f);if(o!=null){const h=T.getState(),U=o.task_id,p=U!=null?h.taskState.taskByID?.[U]:void 0,K=p!=null;if(!r)if(o.is_private===!0){if(!K)return}else{const E=i?.userId,b=new Set([...o.assignees??[],...o.direct_assignees??[]]);if(o.created_by!=null&&o.created_by!==""&&b.add(o.created_by),!(E!=null&&b.has(E))&&!K)return}if(u===c.TASK_UPDATED&&K&&p!=null&&Array.isArray(o.task_group_ids)){const E=new Set(Object.values(h.taskGroupState.taskGroupById??{}).filter((d=>d!=null&&!d.isDeleted)).map((d=>d.id))),b=(p.taskGroupIds??[]).filter((d=>E.has(d))),P=(o.task_group_ids??[]).filter((d=>E.has(d))),sa=b.length===P.length&&b.every((d=>P.includes(d))),F=p.taskGroupIds??[],j=o.task_group_ids??[],na=F.length!==j.length||!F.every((d=>j.includes(d))),oa=(d,da)=>{const $=d??[],x=da??[];if($.length!==x.length)return!1;const ca=new Set(x);return $.every((ka=>ca.has(ka)))},ia=o.name==null||o.name===p.name,ra=o.is_private==null||o.is_private===p.isPrivate,la=o.assignees==null||oa(o.assignees,p.assignees),ua=o.direct_assignees==null;if(sa&&na&&ia&&ra&&la&&ua)return}}return void a(D(!0,s))}case c.TASKS_BULK_DELETED:{const o=Ja(f);return o==null?void 0:void o.task_ids.forEach((h=>a(za(h))))}case c.TASKS_BULK_UPDATED:case c.TASK_SNOOZE_RESURFACED:return void a(D(!0,s))}},onSubscribed:()=>{a(D(!0,s))}}),A.useEffect((()=>{y==="Completed"&&a(W({taskGroupById:L.taskGroupById}))}),[y,L.taskGroupById]),i==null)throw Error("Can't access task list page without signing in...");return g.jsxs(g.Fragment,{children:[y==="Completed"?g.jsx(ya,{analytics:Ea,onLoad:u=>(f=>f.trackPageLoaded(ba.Event.taskListPage))(u)}):null,g.jsxs(Ya,{children:[g.jsx(Va,{isAppContentDrawerOpen:J,handleDrawerToggle:u=>{Y(u)}}),g.jsx(ae,{location:n,navigate:e,currentTenant:l,taskGroupId:S,taskGroupState:L,localData:B.localData,uiState:B.uiState,isTaskTemplatesEnabled:s,taskListFetchState:y,isTaskCategorizationEnabled:I,isTaskCannedResponsesEnabled:k,isTaskBulkResolutionEnabled:q,isTaskGroupAssigneesEnabled:X,isTaskRecurringParentEnabled:H,isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea})]})]})}const M=(e,a)=>`/${e}/tasks/${encodeURIComponent(a)}`,w=(e,a)=>`/${e}/tasks/new/${a}`,te=(e,a)=>{if(e==="assignee"){const n=a.split(",");return{...m.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Na(a);return{...m.taskDetailLocalData,priority:n}}if(e==="status"){const n=Oa(a);return{...m.taskDetailLocalData,status:n}}if(e==="tag"){const n=a.split(",");return{...m.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Qa(a);return{...m.taskDetailLocalData,dueDate:n}}return{...m.taskDetailLocalData}},pe=Object.freeze(Object.defineProperty({__proto__:null,default:ee},Symbol.toStringTag,{value:"Module"}));export{c as T,Xa as a,qa as b,Ja as c,Ha as d,ee as e,pe as f,ke as t};
@@ -1,4 +1,4 @@
1
- import{j as i}from"./liveblocks-DR8KfETq.js";import ue from"./NotFoundScreen-BG5HsGgf.js";import{a as k}from"./sentry-FwaDhTzy.js";import{h as J,u as ee,j as b,g as de,i as ke,N as pe,l as me,n as Se,o as E}from"./core-Dh_SHcAD.js";import{PZ as ae,Q0 as fe,PW as Te,a1W as ge,fF as te,a1X as se,Qm as g,Qe as T,PT as he,QS as Ee,QL as be,a1Y as ne,gh as oe,a1Z as V,PP as Ie,PM as De,uT as Ce,uH as Ge,mz as _e,Qc as Re,a1_ as ye,R3 as Ue,Q8 as xe,Qx as Be,Qu as Pe,Q3 as we,Qr as Ae,Qq as je}from"./zeni-epic-state-DJh0-ZeR.js";import{z as R,e4 as ve,O as Fe,c as Le,A as G,a5 as re,p as _,a9 as Ke,j as q,S as Qe,e5 as $e,_ as M,af as Ne}from"./index-CHaKE3QQ.js";import{n as Oe}from"./mui-BYn_Ugho.js";import{u as ze}from"./useInitialThreadRequest-DLA6PIFe.js";import{M as Ze}from"./MobileAppDrawer-D3MVdjfj.js";import{b as Ve,a as qe,T as f,t as Me,c as W,d as X,e as We}from"./TaskListScreen-_mHmu42Q.js";import{u as Xe}from"./useTaskManagerPusherEvents-DchZU-tO.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";import"./InboxNotificationsProvider-D6QvVVj8.js";import"./useTaskManagerAccess-D4PJ1zkK.js";import"./useAskAiCfoHostNavButtonProps-PLm72Ozi.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]="14d539c5-2e85-4ae2-be97-f225e83f903c",e._sentryDebugIdIdentifier="sentry-dbid-14d539c5-2e85-4ae2-be97-f225e83f903c")}catch{}})();function Ye(){const e=J(),a=ee(),n=R.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=b((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return i.jsx(ve,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const L=e=>e?.taskState?.taskByID,v=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},He=ge([v,(e,a)=>{const n=v(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=v(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let Y,H=[];const Je=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=He(e,a.taskId),m=s.taskGroupId??c,t=m!=null?V(e.taskGroupState,m):void 0,o=R.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},B=se(e),{tenantEmailDomain:P}=u,y=s.recurringSourceTaskId,w=y!=null?`${M.appUrl}/${P}/tasks/${encodeURIComponent(y)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:R.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==Y&&(Y=h,H=Object.values(h)),H),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Ne.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${M.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:w,tagListView:B,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>V(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(je({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(Ae(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(we(a.taskId))},onSnoozeTask:(t,o)=>{e(Pe(t,o))},onUnsnoozeTask:t=>{e(Be(t))},onCreateSubtask:(t,o)=>{e(xe({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Ue({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=re(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=x(m),o=_(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(ye({taskId:n}))},onDeleteTaskClick:()=>{e(Re(n))},updateFilesEntity:t=>{e(_e({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))($e);function F(){const e=J(),a=ee(),n=de(),c=Fe(),{taskId:s,taskGroupId:u}=ke(),d=b((r=>te(r))),m=ze(d?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:B}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:P}=t(G.isTaskGroupAssigneesEnabled),[y,w]=k.useState(!1),[h,S]=k.useState(!1),[K,ie]=k.useState(!1),[Q,A]=k.useState(!1),C=k.useRef(!1),U=b((r=>r.taskListState.updateTasksFetchState.fetchState)),$=b((r=>se(r))),N=b((r=>r.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const O=R.getSignedInUser()?.userId,ce=k.useMemo((()=>{const r=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...r,f.TASK_SNOOZE_RESURFACED];return[...Ve(d?.companyId,r),...qe(O,l)]}),[d?.companyId,O]);Xe({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(r,l)=>{if(s!=null)switch(r){case f.TASK_CREATED:{X(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=X(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=W(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=W(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(x(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{Me(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||$.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,$.fetchState]),k.useEffect((()=>{K||N==="Completed"||(ie(!0),a(Ee()))}),[K,a,N]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(be([s],null,{isArchived:!1})),A(!0))}),[a,s]);k.useEffect((()=>{if(Q)if(U!=="In-Progress"){if(C.current){if(U==="Error")return A(!1),void(C.current=!1);if(U==="Completed"){A(!1),C.current=!1;const{tenantEmailDomain:r}=d;if(n.state?.message==="triggerBackClick"){const l=re(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=x(r);e(l,{state:{pathnameStackToGoBack:_(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[Q,U,d,n,e]);const z=b((r=>ne(r,s))),j=z.fetchState,Z=R.getSignedInUser();if(Z==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&z.error?.code===400){const{tenantEmailDomain:r}=d,l=x(r),p=_(n.state?.pathnameStackToGoBack,n.pathname);return i.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return i.jsxs(i.Fragment,{children:[j==="Completed"?i.jsx(Ke,{analytics:q,onLoad:r=>(l=>l.trackPageLoaded(Qe.Event.taskDetailPage))(r)}):null,i.jsxs(ea,{children:[i.jsx(Ze,{isAppContentDrawerOpen:y,handleDrawerToggle:r=>{w(r)}}),i.jsx(Je,{analytics:q,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:Z,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:j,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:B,isTaskGroupAssigneesEnabled:P})]})]})}const ea=Oe.div`
1
+ import{j as i}from"./liveblocks-DXYs6rwe.js";import ue from"./NotFoundScreen-tLaFUNLQ.js";import{a as k}from"./sentry-BmkYxd02.js";import{h as J,u as ee,j as E,g as de,i as ke,N as pe,l as me,n as Se,o as b}from"./core-B2JcUSRu.js";import{PZ as ae,Q0 as fe,PW as Te,a1W as ge,fF as te,a1X as se,Qm as g,Qe as T,PT as he,QS as be,QL as Ee,a1Y as ne,gh as oe,a1Z as Z,PP as Ie,PM as De,uT as Ce,uH as Ge,mz as _e,Qc as Re,a1_ as ye,R3 as Ue,Q8 as xe,Qx as Be,Qu as Pe,Q3 as ve,Qr as we,Qq as je}from"./zeni-epic-state-DpjvBN7b.js";import{z as R,e4 as Ae,V as Fe,c as Le,v as G,a5 as re,p as _,a9 as Ke,j as q,W as Qe,e5 as $e,_ as M,af as Ne}from"./index-DoNDPHnj.js";import{n as ze}from"./mui-BLmtkCLd.js";import{u as Oe}from"./useInitialThreadRequest-DK2o3yi9.js";import{M as Ve}from"./MobileAppDrawer-DEHTsboI.js";import{b as Ze,a as qe,T as f,t as Me,c as H,d as W,e as He}from"./TaskListScreen-BamiN5-8.js";import{u as We}from"./useTaskManagerPusherEvents-DoGLBnPU.js";import"./recharts-UN7cJOXN.js";import"./analytics-BDCkEq_I.js";import"./plaid-DHQC2tsw.js";import"./dnd-BAPMa4RJ.js";import"./stripe-cKAAJElX.js";import"./lottie-C9Rxpkwh.js";import"./lexical-DGZ06Yv6.js";import"./pdf-DMCYUxGc.js";import"./utils-BGWE7tXK.js";import"./InboxNotificationsProvider-B8qyHdbE.js";import"./useTaskManagerAccess-BNcDbxmw.js";import"./useAskAiCfoHostNavButtonProps-qSqQpxG4.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]="1ab8c478-1dfb-498d-9ef6-9d1791e0a7fd",e._sentryDebugIdIdentifier="sentry-dbid-1ab8c478-1dfb-498d-9ef6-9d1791e0a7fd")}catch{}})();function Xe(){const e=J(),a=ee(),n=R.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=E((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return i.jsx(Ae,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const L=e=>e?.taskState?.taskByID,A=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},Ye=ge([A,(e,a)=>{const n=A(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=A(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let X,Y=[];const Je=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=Ye(e,a.taskId),m=s.taskGroupId??c,t=m!=null?Z(e.taskGroupState,m):void 0,o=R.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},B=se(e),{tenantEmailDomain:P}=u,y=s.recurringSourceTaskId,v=y!=null?`${M.appUrl}/${P}/tasks/${encodeURIComponent(y)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:R.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==X&&(X=h,Y=Object.values(h)),Y),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Ne.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${M.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:v,tagListView:B,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>Z(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(je({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(we(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(ve(a.taskId))},onSnoozeTask:(t,o)=>{e(Pe(t,o))},onUnsnoozeTask:t=>{e(Be(t))},onCreateSubtask:(t,o)=>{e(xe({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Ue({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=re(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=x(m),o=_(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(ye({taskId:n}))},onDeleteTaskClick:()=>{e(Re(n))},updateFilesEntity:t=>{e(_e({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))($e);function F(){const e=J(),a=ee(),n=de(),c=Fe(),{taskId:s,taskGroupId:u}=ke(),d=E((r=>te(r))),m=Oe(d?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:B}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:P}=t(G.isTaskGroupAssigneesEnabled),[y,v]=k.useState(!1),[h,S]=k.useState(!1),[K,ie]=k.useState(!1),[Q,w]=k.useState(!1),C=k.useRef(!1),U=E((r=>r.taskListState.updateTasksFetchState.fetchState)),$=E((r=>se(r))),N=E((r=>r.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const z=R.getSignedInUser()?.userId,ce=k.useMemo((()=>{const r=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...r,f.TASK_SNOOZE_RESURFACED];return[...Ze(d?.companyId,r),...qe(z,l)]}),[d?.companyId,z]);We({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(r,l)=>{if(s!=null)switch(r){case f.TASK_CREATED:{W(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=W(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=H(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=H(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(x(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{Me(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||$.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,$.fetchState]),k.useEffect((()=>{K||N==="Completed"||(ie(!0),a(be()))}),[K,a,N]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(Ee([s],null,{isArchived:!1})),w(!0))}),[a,s]);k.useEffect((()=>{if(Q)if(U!=="In-Progress"){if(C.current){if(U==="Error")return w(!1),void(C.current=!1);if(U==="Completed"){w(!1),C.current=!1;const{tenantEmailDomain:r}=d;if(n.state?.message==="triggerBackClick"){const l=re(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=x(r);e(l,{state:{pathnameStackToGoBack:_(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[Q,U,d,n,e]);const O=E((r=>ne(r,s))),j=O.fetchState,V=R.getSignedInUser();if(V==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&O.error?.code===400){const{tenantEmailDomain:r}=d,l=x(r),p=_(n.state?.pathnameStackToGoBack,n.pathname);return i.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return i.jsxs(i.Fragment,{children:[j==="Completed"?i.jsx(Ke,{analytics:q,onLoad:r=>(l=>l.trackPageLoaded(Qe.Event.taskDetailPage))(r)}):null,i.jsxs(ea,{children:[i.jsx(Ve,{isAppContentDrawerOpen:y,handleDrawerToggle:r=>{v(r)}}),i.jsx(Je,{analytics:q,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:V,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:j,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:B,isTaskGroupAssigneesEnabled:P})]})]})}const ea=ze.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as i}from"./liveblocks-DR8KfETq.js";import ue from"./NotFoundScreen-BG5
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,x=e=>`/${e}/tasks`;function Ca(){return i.jsxs(Se,{children:[i.jsx(E,{path:"/new",element:i.jsx(F,{})}),i.jsx(E,{path:"/new/:taskGroupId",element:i.jsx(F,{})}),i.jsx(E,{path:"/group/:taskGroupId",element:i.jsx(We,{})}),i.jsx(E,{path:"/quick-responses",element:i.jsx(Ye,{})}),i.jsx(E,{path:"/:taskId",element:i.jsx(F,{})}),i.jsx(E,{path:"*",element:i.jsx(ue,{})})]})}export{Ca as default};
9
+ `,x=e=>`/${e}/tasks`;function Ca(){return i.jsxs(Se,{children:[i.jsx(b,{path:"/new",element:i.jsx(F,{})}),i.jsx(b,{path:"/new/:taskGroupId",element:i.jsx(F,{})}),i.jsx(b,{path:"/group/:taskGroupId",element:i.jsx(He,{})}),i.jsx(b,{path:"/quick-responses",element:i.jsx(Xe,{})}),i.jsx(b,{path:"/:taskId",element:i.jsx(F,{})}),i.jsx(b,{path:"*",element:i.jsx(ue,{})})]})}export{Ca as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-DXYs6rwe.js";import i from"./NotFoundScreen-tLaFUNLQ.js";import{T as r}from"./TransactionDetailScreen-DUQhWS53.js";import"./sentry-BmkYxd02.js";import{n as a,o as e}from"./core-B2JcUSRu.js";import"./zeni-epic-state-DpjvBN7b.js";import"./recharts-UN7cJOXN.js";import"./index-DoNDPHnj.js";import"./mui-BLmtkCLd.js";import"./analytics-BDCkEq_I.js";import"./plaid-DHQC2tsw.js";import"./dnd-BAPMa4RJ.js";import"./stripe-cKAAJElX.js";import"./lottie-C9Rxpkwh.js";import"./lexical-DGZ06Yv6.js";import"./pdf-DMCYUxGc.js";import"./utils-BGWE7tXK.js";import"./useAskAiCfoHostNavButtonProps-qSqQpxG4.js";import"./decodeURIComponentSafe-CIM8Yd6k.js";import"./useInitialThreadRequest-DK2o3yi9.js";import"./routePaths-V2hUGG4a.js";import"./expenseAutomationHelper-Dd7fQN5z.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 C}from"./liveblocks-DR8KfETq.js";import{a as i}from"./sentry-FwaDhTzy.js";import{u as W,k as sn,j as g,s as ge,g as ke,h as Ce,i as Ae,N as cn,l as rn}from"./core-Dh_SHcAD.js";import{pv as Ie,fF as ee,gV as ln,UE as dn,oB as un,ob as mn,DB as se,bn as pn,df as Re,bq as _e,sP as H,VK as Y,WS as Pe,WT as le,W8 as we,ma as Fe,WU as Ue,Wd as de,We as ue,m$ as xe,S9 as me,WO as G,m4 as Ve,m2 as Be,me as fn,pi as hn,WV as Sn,WW as yn,Ds as Z,m9 as Le,Ru as Oe,cm as Tn,dl as bn,WX as gn,WN as In,WY as vn,WZ as En,W_ as Dn,W$ as kn,Do as Cn,X0 as An,X1 as Rn,X2 as _n,X3 as Pn,X4 as wn,md as Fn,X5 as Un,X6 as xn,WP as Vn,X7 as Bn,X8 as Ln,X9 as On,Ro as Nn,Re as Wn,RD as zn,mf as jn,Sa as ve,pn as Mn}from"./zeni-epic-state-DJh0-ZeR.js";import{c as K,A,j as $,b3 as Gn,z as Ne,E as $n,a2 as Xn,b4 as qn,ac as Hn,a5 as ce,Q as Yn,b5 as Kn,p as ie,at as Qn,b6 as Zn,b7 as Jn,b8 as et,af as nt,aw as oe}from"./index-CHaKE3QQ.js";import{n as tt,S as at,D as ot}from"./mui-BYn_Ugho.js";import{u as st}from"./useAskAiCfoHostNavButtonProps-PLm72Ozi.js";import{d as We}from"./decodeURIComponentSafe-B9wRnGXi.js";import{u as ct}from"./useInitialThreadRequest-DLA6PIFe.js";import{h as ze,c as je,g as it,e as rt}from"./routePaths-DXpM4tZj.js";import{u as lt}from"./expenseAutomationHelper-jy143DnO.js";import{A as dt}from"./utils-DEAaFgLU.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="0af2b9d1-6d81-4a57-b4c6-ff6680f6e830",n._sentryDebugIdIdentifier="sentry-dbid-0af2b9d1-6d81-4a57-b4c6-ff6680f6e830")}catch{}})();function ut(n=!0){const e=W(),o=sn(),{useFeatureGate:t}=K(),{isFeatureEnabled:a}=t(A.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!n||a!==!0)return;const s=c=>{const u=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return u!=="In-Progress"&&u!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[n,a,e,o])}function mt(n,e){const o=(function(){const u=W(),[h,y]=i.useState(!1),[f,d]=i.useState(null),[r,S]=i.useState(null),{useDynamicConfig:I}=K(),{configValue:k,isDynamicConfigLoading:T}=I("transaction_categorization_config"),b=!T&&k?.capitalization_enabled===!0,v=g((l=>ee(l))),R=v.companyId,X=g((l=>ln(l.companyState,v.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:U,capitalizableAccountOverrides:_,dismissedAccounts:P}=g((l=>{const E=l.tenantState.currentTenantId,D=E!=null?l.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:D?.capitalizableAccounts??null,capitalizableAccountOverrides:D?.capitalizableAccountOverrides??null,dismissedAccounts:D?.capitalizationOnboardingDismissedAccounts??null}}),ge),x=i.useRef(U);x.current=U;const w=i.useRef(_);w.current=_;const V=i.useRef(P);V.current=P;const B=g((l=>dn(l.accountState)),ge),q=i.useMemo((()=>{const l={};for(const E of B)E.accountId!=null&&E.accountName!=null&&(l[E.accountId]=E.accountName);return l}),[B]),z=r!=null?q[r]??null:null,L=i.useCallback((l=>{if(!b)return;const E=x.current;if(E==null)return;const D=E.accounts??[],M=new Set(l),Q=w.current??{},ne=V.current;for(const O of D)if(M.has(O.accountId)&&Q[O.accountId]==null&&ne?.[O.accountId]==null)return d(O.classificationType),S(O.accountId),void y(!0)}),[b]),j=i.useCallback(((l,E)=>{u(un(R,l,E,!0)),y(!1),d(null),S(null)}),[u,R]),p=i.useCallback((()=>{r!=null&&(u(mn(R,r)),y(!1),d(null),S(null))}),[u,R,r]);return{showPopup:h&&b,popupType:f,popupAccountId:r,popupAccountName:z,currencySymbol:X,checkAndShowPopup:L,handleSubmit:j,handleDismiss:p}})(),t=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((()=>{n==="In-Progress"&&(a.current=c.current()),n==="Completed"&&t.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),t.current=n}),[n]),o}const N=new Map,Ee=(n,e,o)=>`${n}|${e??""}|${o}`,J=(n,e)=>{const[o,t]=n.shownRecommendations;return{recommendationFor:n.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:t?.name??null,alternativeRecommendationSource:t?.engine??null,alternativeRecommendationConfidencePercentage:t?.confidencePercentage??null,selectedValue:n.selected.name,numberOfRecommendations:n.shownRecommendations.length,transactionId:e,lineId:n.lineId??null}},re=(n,e,o)=>({transactionId:e,lineId:n.lineId,dimension:n.dimension,outcome:n.outcome,selected:{name:n.selected.name,id:n.selected.id},matchedSource:n.matchedSource,matchedRank:n.matchedRank,topPickSource:n.topPickSource,shownRecommendations:n.shownRecommendations.map((t=>({source:t.source,rank:t.rank,value:{name:t.name,id:t.id},confidence:t.confidencePercentage!=null?t.confidencePercentage/100:void 0}))),...o}),Me=(n,e,o)=>{$.trackRecommendationFeedbackRetracted(J(e,o)),n(se(re(e,o,{outcome:"retracted"})))},Vt=(n,e)=>{const o=new Set(e.map(String));N.forEach(((t,a)=>{o.has(t.transactionId)&&(N.delete(a),Me(n,t.feedback,t.transactionId))}))},Bt=n=>{const e=new Set(n.map(String));N.forEach(((o,t)=>{e.has(o.transactionId)&&N.delete(t)}))};function pt(n){const e=W(),[o,t]=i.useState(null),{isEnabled:a,fallbackTransactionId:s}=n,c=i.useCallback((f=>f.transactionId??s??""),[s]),u=i.useCallback((f=>{if(!a)return;const d=c(f);if(d==="")return;if(f.outcome!=="accepted")return void t(f);((S,I,k,T)=>{const b=Ee(I,k,T),v=N.get(b);return v!=null&&(N.delete(b),Me(S,v.feedback,v.transactionId),!0)})(e,d,f.lineId,f.dimension)||(((S,I)=>{$.trackRecommendationAccepted(J(S,I))})(f,d),e(se(re(f,d,{}))))}),[a,c,e]),h=i.useCallback((f=>{if(o==null)return;const d=c(o);((r,S,I)=>{$.trackRecommendationFeedbackSubmitted({...J(r,S),feedbackReason:I})})(o,d,f),e(se(re(o,d,{reasonText:f,skipped:!1}))),((r,S)=>{N.set(Ee(S,r.lineId,r.dimension),{feedback:r,transactionId:S})})(o,d),t(null)}),[o,c,e]),y=i.useCallback((()=>{var f,d;o!=null&&(f=o,d=c(o),$.trackRecommendationFeedbackSkipped(J(f,d)),t(null))}),[o,c]);return{onRecommendationSelection:u,popup:o!=null?C.jsx(Gn,{feedback:o,onSubmit:h,onSkip:y}):null}}const pe=()=>{const n=Ne.getSignedInUser(),{useFeatureGate:e}=K(),{isFeatureEnabled:o}=e(A.isChainOfThoughtEnabled);return i.useMemo((()=>pn(n)&&o),[n,o])};function Ge(n){if(n!=null){if("customer"in n&&n.customer!=null){const{customer:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in n&&n.vendor!=null){const{vendor:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Lt(n,e){const o=W(),{useFeatureGate:t}=K(),a=g((p=>ee(p))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),u=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:h}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=t(A.isExpenseAutomationEnabled),f=pe(),d=i.useMemo((()=>({id:n,type:H(e)})),[n,e]),r=g((p=>Y(p,d))),S=r?.transactionDetailUpdateStatus?.fetchState,I=r?.transactionDetailLocalData?.lineItemById,k=g((p=>{const l=Y(p,d)?.transactionDetailLocalData.vendorUpdates?.id;return l==null?"Not-Started":p.transactionVendorViewState.editVendorStateById[l]?.saveStatus.fetchState??"Not-Started"})),T=i.useMemo((()=>r?.fetchState==="Completed"?Ge(r?.transaction):void 0),[r?.fetchState,r?.transaction]),b=g((p=>{if(T!=null)return Pe(p.customerIncomeState,p.vendorExpenseState,p.trendState,T,"month")})),v=g((p=>le(p))),R=g((p=>{if(T!=null)return we(p.trendWithTransactionsState,T,"TransactionDetail")})),X=a.company?.companyInfo.firstMonthOfFY??1,U=g((p=>Fe(p.accountState,p.accountListState,"accountList"))),[_,P]=i.useState(!1),[x,w]=i.useState(!1),[V,B]=i.useState(!1);i.useEffect((()=>{P(!1),w(!1),B(!1)}),[n,e]);const q=i.useCallback((()=>{P(!1),w(!1)}),[]),[z,L]=i.useState(!1),j=R?.selectedPeriod?.timePeriod;return i.useEffect((()=>{V||r==null||r.transaction==null||(o(Ue({id:r.transaction.id,type:r.transaction.type})),B(!0)),T!=null&&(!s||c&&u===!1)&&(_?x||b==null||(w(!0),o(me(T,"TransactionDetail",{timeframe:"month",timePeriod:j??b}))):(o(de()),o(ue()),P(!0),o(xe(T))))}),[o,V,r?.fetchState,r?.transaction,T,s,c,u,_,x,b,j]),i.useEffect((()=>{v.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)}),[v.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:u,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:y,isChainOfThoughtEnabled:f,selectedTransaction:d,transactionDetail:r,rawDetailSaveStatus:S,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:T,defaultTrendTransactionTimePeriod:b,vendorViewDetails:v,uiState:R,firstMonthOfFY:X,uncategorizedAccounts:U,resetTrendIsFetchedStates:q,isCreateVendorDrawerOpen:z,setIsCreateVendorDrawerOpen:L}}const ft={overlayWidth:new Hn(100,100,58)},ht=({isOpen:n,onSaveVendor:e,onSaveSuccess:o,onCancel:t,vendorViewDetails:a})=>{const s=$n(),c=Xn(),u=W(),h=g((d=>le(d))),y=()=>{t()},f={vendorDetailView:a??h,onSaveSuccess:()=>{u(Be()),u(fn("Not-Started")),o()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:d=>{u(Ve({vendorId:void 0,localData:d}))}};return C.jsx(ot,{anchor:"right",open:n,PaperProps:{style:{width:ft.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:C.jsx(St,{onClick:d=>d.stopPropagation(),children:C.jsx(qn,{...f})})})},St=tt(at)`
1
+ import{j as C}from"./liveblocks-DXYs6rwe.js";import{a as i}from"./sentry-BmkYxd02.js";import{u as W,k as sn,j as g,s as ge,g as ke,h as Ce,i as Ae,N as cn,l as rn}from"./core-B2JcUSRu.js";import{pv as Ie,fF as ee,gV as ln,UE as dn,oB as un,ob as mn,DB as se,bn as pn,df as Re,bq as _e,sP as H,VK as Y,WS as Pe,WT as le,W8 as we,ma as Fe,WU as Ue,Wd as de,We as ue,m$ as xe,S9 as me,WO as G,m4 as Ve,m2 as Be,me as fn,pi as hn,WV as Sn,WW as yn,Ds as Z,m9 as Le,Ru as Oe,cm as Tn,dl as bn,WX as gn,WN as In,WY as vn,WZ as En,W_ as Dn,W$ as kn,Do as Cn,X0 as An,X1 as Rn,X2 as _n,X3 as Pn,X4 as wn,md as Fn,X5 as Un,X6 as xn,WP as Vn,X7 as Bn,X8 as Ln,X9 as On,Ro as Nn,Re as Wn,RD as zn,mf as jn,Sa as ve,pn as Mn}from"./zeni-epic-state-DpjvBN7b.js";import{c as K,v as A,j as $,b3 as Gn,z as Ne,E as $n,a2 as Xn,b4 as qn,ac as Hn,a5 as ce,Q as Yn,b5 as Kn,p as ie,at as Qn,b6 as Zn,b7 as Jn,b8 as et,af as nt,aw as oe}from"./index-DoNDPHnj.js";import{n as tt,S as at,D as ot}from"./mui-BLmtkCLd.js";import{u as st}from"./useAskAiCfoHostNavButtonProps-qSqQpxG4.js";import{d as We}from"./decodeURIComponentSafe-CIM8Yd6k.js";import{u as ct}from"./useInitialThreadRequest-DK2o3yi9.js";import{h as ze,c as je,g as it,e as rt}from"./routePaths-V2hUGG4a.js";import{u as lt}from"./expenseAutomationHelper-Dd7fQN5z.js";import{A as dt}from"./utils-BGWE7tXK.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="4308de40-4b9d-47aa-883c-0f73cebe2918",n._sentryDebugIdIdentifier="sentry-dbid-4308de40-4b9d-47aa-883c-0f73cebe2918")}catch{}})();function ut(n=!0){const e=W(),o=sn(),{useFeatureGate:t}=K(),{isFeatureEnabled:a}=t(A.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!n||a!==!0)return;const s=c=>{const u=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return u!=="In-Progress"&&u!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[n,a,e,o])}function mt(n,e){const o=(function(){const u=W(),[h,y]=i.useState(!1),[f,d]=i.useState(null),[r,S]=i.useState(null),{useDynamicConfig:I}=K(),{configValue:k,isDynamicConfigLoading:T}=I("transaction_categorization_config"),b=!T&&k?.capitalization_enabled===!0,v=g((l=>ee(l))),R=v.companyId,X=g((l=>ln(l.companyState,v.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:U,capitalizableAccountOverrides:_,dismissedAccounts:P}=g((l=>{const E=l.tenantState.currentTenantId,D=E!=null?l.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:D?.capitalizableAccounts??null,capitalizableAccountOverrides:D?.capitalizableAccountOverrides??null,dismissedAccounts:D?.capitalizationOnboardingDismissedAccounts??null}}),ge),x=i.useRef(U);x.current=U;const w=i.useRef(_);w.current=_;const V=i.useRef(P);V.current=P;const B=g((l=>dn(l.accountState)),ge),q=i.useMemo((()=>{const l={};for(const E of B)E.accountId!=null&&E.accountName!=null&&(l[E.accountId]=E.accountName);return l}),[B]),z=r!=null?q[r]??null:null,L=i.useCallback((l=>{if(!b)return;const E=x.current;if(E==null)return;const D=E.accounts??[],M=new Set(l),Q=w.current??{},ne=V.current;for(const O of D)if(M.has(O.accountId)&&Q[O.accountId]==null&&ne?.[O.accountId]==null)return d(O.classificationType),S(O.accountId),void y(!0)}),[b]),j=i.useCallback(((l,E)=>{u(un(R,l,E,!0)),y(!1),d(null),S(null)}),[u,R]),p=i.useCallback((()=>{r!=null&&(u(mn(R,r)),y(!1),d(null),S(null))}),[u,R,r]);return{showPopup:h&&b,popupType:f,popupAccountId:r,popupAccountName:z,currencySymbol:X,checkAndShowPopup:L,handleSubmit:j,handleDismiss:p}})(),t=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((()=>{n==="In-Progress"&&(a.current=c.current()),n==="Completed"&&t.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),t.current=n}),[n]),o}const N=new Map,Ee=(n,e,o)=>`${n}|${e??""}|${o}`,J=(n,e)=>{const[o,t]=n.shownRecommendations;return{recommendationFor:n.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:t?.name??null,alternativeRecommendationSource:t?.engine??null,alternativeRecommendationConfidencePercentage:t?.confidencePercentage??null,selectedValue:n.selected.name,numberOfRecommendations:n.shownRecommendations.length,transactionId:e,lineId:n.lineId??null}},re=(n,e,o)=>({transactionId:e,lineId:n.lineId,dimension:n.dimension,outcome:n.outcome,selected:{name:n.selected.name,id:n.selected.id},matchedSource:n.matchedSource,matchedRank:n.matchedRank,topPickSource:n.topPickSource,shownRecommendations:n.shownRecommendations.map((t=>({source:t.source,rank:t.rank,value:{name:t.name,id:t.id},confidence:t.confidencePercentage!=null?t.confidencePercentage/100:void 0}))),...o}),Me=(n,e,o)=>{$.trackRecommendationFeedbackRetracted(J(e,o)),n(se(re(e,o,{outcome:"retracted"})))},Vt=(n,e)=>{const o=new Set(e.map(String));N.forEach(((t,a)=>{o.has(t.transactionId)&&(N.delete(a),Me(n,t.feedback,t.transactionId))}))},Bt=n=>{const e=new Set(n.map(String));N.forEach(((o,t)=>{e.has(o.transactionId)&&N.delete(t)}))};function pt(n){const e=W(),[o,t]=i.useState(null),{isEnabled:a,fallbackTransactionId:s}=n,c=i.useCallback((f=>f.transactionId??s??""),[s]),u=i.useCallback((f=>{if(!a)return;const d=c(f);if(d==="")return;if(f.outcome!=="accepted")return void t(f);((S,I,k,T)=>{const b=Ee(I,k,T),v=N.get(b);return v!=null&&(N.delete(b),Me(S,v.feedback,v.transactionId),!0)})(e,d,f.lineId,f.dimension)||(((S,I)=>{$.trackRecommendationAccepted(J(S,I))})(f,d),e(se(re(f,d,{}))))}),[a,c,e]),h=i.useCallback((f=>{if(o==null)return;const d=c(o);((r,S,I)=>{$.trackRecommendationFeedbackSubmitted({...J(r,S),feedbackReason:I})})(o,d,f),e(se(re(o,d,{reasonText:f,skipped:!1}))),((r,S)=>{N.set(Ee(S,r.lineId,r.dimension),{feedback:r,transactionId:S})})(o,d),t(null)}),[o,c,e]),y=i.useCallback((()=>{var f,d;o!=null&&(f=o,d=c(o),$.trackRecommendationFeedbackSkipped(J(f,d)),t(null))}),[o,c]);return{onRecommendationSelection:u,popup:o!=null?C.jsx(Gn,{feedback:o,onSubmit:h,onSkip:y}):null}}const pe=()=>{const n=Ne.getSignedInUser(),{useFeatureGate:e}=K(),{isFeatureEnabled:o}=e(A.isChainOfThoughtEnabled);return i.useMemo((()=>pn(n)&&o),[n,o])};function Ge(n){if(n!=null){if("customer"in n&&n.customer!=null){const{customer:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in n&&n.vendor!=null){const{vendor:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Lt(n,e){const o=W(),{useFeatureGate:t}=K(),a=g((p=>ee(p))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),u=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:h}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=t(A.isExpenseAutomationEnabled),f=pe(),d=i.useMemo((()=>({id:n,type:H(e)})),[n,e]),r=g((p=>Y(p,d))),S=r?.transactionDetailUpdateStatus?.fetchState,I=r?.transactionDetailLocalData?.lineItemById,k=g((p=>{const l=Y(p,d)?.transactionDetailLocalData.vendorUpdates?.id;return l==null?"Not-Started":p.transactionVendorViewState.editVendorStateById[l]?.saveStatus.fetchState??"Not-Started"})),T=i.useMemo((()=>r?.fetchState==="Completed"?Ge(r?.transaction):void 0),[r?.fetchState,r?.transaction]),b=g((p=>{if(T!=null)return Pe(p.customerIncomeState,p.vendorExpenseState,p.trendState,T,"month")})),v=g((p=>le(p))),R=g((p=>{if(T!=null)return we(p.trendWithTransactionsState,T,"TransactionDetail")})),X=a.company?.companyInfo.firstMonthOfFY??1,U=g((p=>Fe(p.accountState,p.accountListState,"accountList"))),[_,P]=i.useState(!1),[x,w]=i.useState(!1),[V,B]=i.useState(!1);i.useEffect((()=>{P(!1),w(!1),B(!1)}),[n,e]);const q=i.useCallback((()=>{P(!1),w(!1)}),[]),[z,L]=i.useState(!1),j=R?.selectedPeriod?.timePeriod;return i.useEffect((()=>{V||r==null||r.transaction==null||(o(Ue({id:r.transaction.id,type:r.transaction.type})),B(!0)),T!=null&&(!s||c&&u===!1)&&(_?x||b==null||(w(!0),o(me(T,"TransactionDetail",{timeframe:"month",timePeriod:j??b}))):(o(de()),o(ue()),P(!0),o(xe(T))))}),[o,V,r?.fetchState,r?.transaction,T,s,c,u,_,x,b,j]),i.useEffect((()=>{v.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)}),[v.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:u,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:y,isChainOfThoughtEnabled:f,selectedTransaction:d,transactionDetail:r,rawDetailSaveStatus:S,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:T,defaultTrendTransactionTimePeriod:b,vendorViewDetails:v,uiState:R,firstMonthOfFY:X,uncategorizedAccounts:U,resetTrendIsFetchedStates:q,isCreateVendorDrawerOpen:z,setIsCreateVendorDrawerOpen:L}}const ft={overlayWidth:new Hn(100,100,58)},ht=({isOpen:n,onSaveVendor:e,onSaveSuccess:o,onCancel:t,vendorViewDetails:a})=>{const s=$n(),c=Xn(),u=W(),h=g((d=>le(d))),y=()=>{t()},f={vendorDetailView:a??h,onSaveSuccess:()=>{u(Be()),u(fn("Not-Started")),o()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:d=>{u(Ve({vendorId:void 0,localData:d}))}};return C.jsx(ot,{anchor:"right",open:n,PaperProps:{style:{width:ft.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:C.jsx(St,{onClick:d=>d.stopPropagation(),children:C.jsx(qn,{...f})})})},St=tt(at)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;