@zeniai/web-app-ui 5.2.2-qa → 5.2.3-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/assets/AddressRoutes-DDXG_kNK.js +1 -0
  2. package/dist/assets/{AddressScreen-CdOHQVhF.js → AddressScreen-BtOzCXFh.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-DOUPM7rP.js → AiCfoScreen-uWZbUYJU.js} +2 -2
  4. package/dist/assets/{BillPayApprovalRoutes-CJg0dZ-0.js → BillPayApprovalRoutes-DBNwOrc9.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-C06pIc-T.js → BillPayRoutes-CZg3tLma.js} +17 -17
  6. package/dist/assets/BusinessVerificationPageScreen-BJO3N4aI.js +9 -0
  7. package/dist/assets/{CardsAiCfoScreen-Dgeg8L5P.js → CardsAiCfoScreen-BaHcD5bd.js} +3 -3
  8. package/dist/assets/{ChargeCardRoutes-CtlJHX5L.js → ChargeCardRoutes-BDr7Wpp2.js} +10 -10
  9. package/dist/assets/CompanyPassportScreen-CgMOUldv.js +1 -0
  10. package/dist/assets/ConnectionAuthScreen-CIELK18J.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-C1MiVKfW.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-DOFZAYAR.js → CustomerOnboardingRoutes-szs5YaFT.js} +4 -4
  13. package/dist/assets/{DashboardRoutes-BxV1iUQp.js → DashboardRoutes-CqEqTG-q.js} +4 -4
  14. package/dist/assets/{DefaultTenantHome-cdKEQ1Zh.js → DefaultTenantHome-B3it7aUC.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-D6ldO-v5.js +18 -0
  16. package/dist/assets/{DrawerScreen-C5RcL6Av.js → DrawerScreen-BZIHG-iJ.js} +1 -1
  17. package/dist/assets/EntityDetailRoutes-Bq0acXd0.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-BQa33iBx.js → ExpenseAutomationRoutes-DTr3_gWW.js} +3 -3
  19. package/dist/assets/FeaturePreviewScreen-BPUW_5KC.js +1 -0
  20. package/dist/assets/HubSpotOAuthCallbackScreen-PL_f01P7.js +1 -0
  21. package/dist/assets/{MagicLinkRoutes-Dtg6cdNu.js → MagicLinkRoutes-DuFsZ2Eq.js} +9 -9
  22. package/dist/assets/MagicLinkSignInScreen-DbD5ghXu.js +12 -0
  23. package/dist/assets/MobileAppDrawer-DUA8Lay7.js +1 -0
  24. package/dist/assets/NotFoundScreen-B314Xa6t.js +1 -0
  25. package/dist/assets/NotificationRoutes-CDcyYyhL.js +1 -0
  26. package/dist/assets/OAuthConsentScreen-O2iLZgF8.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-DHyD--lG.js +1 -0
  28. package/dist/assets/PeopleRoutes-DFw_evkY.js +22 -0
  29. package/dist/assets/PerformanceRoutes-BUjcMitb.js +1 -0
  30. package/dist/assets/{Preview-CHT0pnbn.js → Preview-DmA_5jAt.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-CrBf0ZH9.js → QBOConnectionScreen-RdiPTNMo.js} +1 -1
  32. package/dist/assets/ReimbursementApprovalRoutes-CMiVs8Po.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-bM59MORR.js → ReimbursementApprovalRuleDetailScreen-B2zgMKIa.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-B5HVjH8Y.js → ReimbursementRoutes-BoKZcV1C.js} +10 -10
  35. package/dist/assets/{ReportsRoutes-CYtGOUsB.js → ReportsRoutes-DbWvQfgf.js} +1 -1
  36. package/dist/assets/RewardsRoutes-B-e311Ed.js +1 -0
  37. package/dist/assets/ScreenRoutes-DmFUCsMU.js +2 -0
  38. package/dist/assets/SettingsRoutes-CQXKJAna.js +57 -0
  39. package/dist/assets/{SetupPagesScreen-DRG5vd-9.js → SetupPagesScreen-BZtlpfQh.js} +5 -5
  40. package/dist/assets/{SignInScreen-zNyfWVA9.js → SignInScreen-EBAhC-wy.js} +1 -1
  41. package/dist/assets/SignOutScreen-Bcc_zMXg.js +9 -0
  42. package/dist/assets/{TaskListScreen-BDLMS5dP.js → TaskListScreen-CenYjOPZ.js} +2 -2
  43. package/dist/assets/TaskRoutes-Cyyv5CFi.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-D0d4b5Ur.js → TransactionDetailRoutes-Xm9FzfXs.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-utZ3W4nX.js → TransactionDetailScreen-SXa23sv8.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-X_kqX55n.js → TransactionListRoutes-gIKSQcT7.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-CITGUjLb.js → TreasuryRoutes-DKrjcHSF.js} +6 -6
  48. package/dist/assets/{VendorsRoutes-BtS1dxCL.js → VendorsRoutes-DkVc55j_.js} +23 -23
  49. package/dist/assets/WiseConfirmationScreen-DbekQU5I.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-D-wSuSJp.js → ZeniAccountRoutes-mC4kRmgc.js} +9 -9
  51. package/dist/assets/ZeniAccountStatementScreen-BtAb3Raq.js +9 -0
  52. package/dist/assets/{accountMappingHelper-Ttvv9gGx.js → accountMappingHelper-J0OcQc2L.js} +1 -1
  53. package/dist/assets/{analytics-KG6ixMlm.js → analytics-Ci054ctJ.js} +1 -1
  54. package/dist/assets/analyticsHelper-0Z_ii5dt.js +1 -0
  55. package/dist/assets/{core-mESSAfOQ.js → core-DXwLSsqn.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-DbCsPqxw.js → decodeURIComponentSafe-BbzvGEmo.js} +1 -1
  57. package/dist/assets/{dnd-CSfP84QM.js → dnd-BFL9IlQe.js} +1 -1
  58. package/dist/assets/{empty-DVvGRFs6.js → empty-Cv3ER6tQ.js} +1 -1
  59. package/dist/assets/{empty-BvFicJ_U.js → empty-DpUFxs_n.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-DvlDeyQe.js → emptyVideoElement-D04Keje3.js} +1 -1
  61. package/dist/assets/{epic-B1aRR19W.js → epic-fjG6tcBj.js} +2 -2
  62. package/dist/assets/getLocaleForTenant-YGwofgWv.js +1 -0
  63. package/dist/assets/{index-BaPbXLUq.js → index-61HgEKPh.js} +1 -1
  64. package/dist/assets/{index-D7gkfb4V.js → index-B0pSShvk.js} +1 -1
  65. package/dist/assets/{index-BKEcQaqa.js → index-BxpV0MpM.js} +13891 -13899
  66. package/dist/assets/{index-eo1wUHmi.js → index-CVcXqlHF.js} +1 -1
  67. package/dist/assets/{index-BLMTWNWn.js → index-CVs7DNpe.js} +2 -2
  68. package/dist/assets/{index-DkcCsLFx.js → index-Cg02-3bW.js} +1 -1
  69. package/dist/assets/{index-DiteDp_N.js → index-DGTgYWnK.js} +1 -1
  70. package/dist/assets/{index-4Dyd9GPr.js → index-e9nNUNV2.js} +1 -1
  71. package/dist/assets/{lexical-D2OXt6dk.js → lexical-t8hl9adA.js} +1 -1
  72. package/dist/assets/{liveblocks-C2MSzkBq.js → liveblocks-DIKy4lot.js} +1 -1
  73. package/dist/assets/{lottie-B4YQ42M8.js → lottie-DAe41SWX.js} +1 -1
  74. package/dist/assets/{mui-HfiFUvSH.js → mui-BPWJk-fl.js} +2 -2
  75. package/dist/assets/{pathToGoBack-DbEkWxz2.js → pathToGoBack-6O-km18d.js} +1 -1
  76. package/dist/assets/{pdf-BP_s4vmv.js → pdf-CG1NUThf.js} +3 -3
  77. package/dist/assets/{pdf-lib-CRY1KWKJ.js → pdf-lib-Ko4-CUFO.js} +1 -1
  78. package/dist/assets/{plaid-CYvf8Mhe.js → plaid-CgXOv8Rh.js} +1 -1
  79. package/dist/assets/{pusher-D60JIDr8.js → pusher-_T7D1pQS.js} +1 -1
  80. package/dist/assets/{react-CgL2gyia.js → react-BHrI4XX9.js} +1 -1
  81. package/dist/assets/{react-BQJ7Toax.js → react-CVvf4qEx.js} +1 -1
  82. package/dist/assets/{react-CKddYYnK.js → react-Cp9hwg2n.js} +1 -1
  83. package/dist/assets/{react-dDYuHA_9.js → react-DGBs1odx.js} +1 -1
  84. package/dist/assets/{react-YAV02L6r.js → react-k5dCLAFT.js} +1 -1
  85. package/dist/assets/{react-Cl8sk40E.js → react-uMnEgX8u.js} +1 -1
  86. package/dist/assets/{recharts-BO9Ej9mf.js → recharts-BKU02zoL.js} +1 -1
  87. package/dist/assets/{routePaths-CwyjQmpj.js → routePaths-BZ65TmUh.js} +1 -1
  88. package/dist/assets/{sentry-CeqBlNHw.js → sentry-Dy6CjI9o.js} +1 -1
  89. package/dist/assets/{url-CQv8CxL0.js → url-DHOGOqHo.js} +1 -1
  90. package/dist/assets/{url-Dc9KdglV.js → url-QgpJHG1D.js} +1 -1
  91. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-UffvQ0vC.js +1 -0
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-CaQ8KV1j.js +1 -0
  93. package/dist/assets/useCashManagementBanner-m4TLytI4.js +1 -0
  94. package/dist/assets/{useChargeCardPusherEvents-29aueUB4.js → useChargeCardPusherEvents-D6iq2dOY.js} +1 -1
  95. package/dist/assets/{useDeviceId-CAQm00Vu.js → useDeviceId-k_nSwj7f.js} +1 -1
  96. package/dist/assets/{useEmailConnectResultRefresh-Cklgqkov.js → useEmailConnectResultRefresh-Csb_ew9X.js} +1 -1
  97. package/dist/assets/{useInitialThreadRequest-F3dij7mS.js → useInitialThreadRequest-BNKJrNID.js} +1 -1
  98. package/dist/assets/{utils-Dk_ckawD.js → utils-BfVxqb_k.js} +1 -1
  99. package/dist/assets/{withTransactionSidePanel-DMXAzZMG.js → withTransactionSidePanel-Do9-2jkM.js} +1 -1
  100. package/dist/assets/{zeni-epic-state-60_rE4ne.js → zeni-epic-state-Cehmp_zm.js} +4 -4
  101. package/dist/index.html +1 -1
  102. package/package.json +4 -4
  103. package/dist/assets/AddressRoutes-B8MzeBCg.js +0 -1
  104. package/dist/assets/BusinessVerificationPageScreen-Db9q9uYx.js +0 -9
  105. package/dist/assets/CompanyPassportScreen-CKfvJUAa.js +0 -1
  106. package/dist/assets/ConnectionAuthScreen-DMGQFB1R.js +0 -11
  107. package/dist/assets/CustomerOnboardingAuthScreen-9HWCL1l9.js +0 -1
  108. package/dist/assets/DomesticWireDetailScreen-BExO61cs.js +0 -18
  109. package/dist/assets/EntityDetailRoutes-CsKP6pMV.js +0 -1
  110. package/dist/assets/FeaturePreviewScreen-DPhRQC-g.js +0 -1
  111. package/dist/assets/HubSpotOAuthCallbackScreen-DVrCtGv0.js +0 -1
  112. package/dist/assets/MagicLinkSignInScreen-zvCsYrE5.js +0 -12
  113. package/dist/assets/MobileAppDrawer-htYnICxs.js +0 -1
  114. package/dist/assets/NotFoundScreen-C776OUyD.js +0 -1
  115. package/dist/assets/NotificationRoutes-cptvFCxC.js +0 -1
  116. package/dist/assets/OAuthConsentScreen-DPbf6t0f.js +0 -1
  117. package/dist/assets/PandLWithForecastRoutes-BUWhNsA2.js +0 -1
  118. package/dist/assets/PeopleRoutes-CbPmDeZI.js +0 -22
  119. package/dist/assets/PerformanceRoutes-ZIBhEpSc.js +0 -1
  120. package/dist/assets/ReferralListScreen-BorbGQJn.js +0 -5
  121. package/dist/assets/ReimbursementApprovalRoutes-F5G7crbN.js +0 -1
  122. package/dist/assets/RewardsRoutes-nQlpVOTR.js +0 -1
  123. package/dist/assets/ScreenRoutes-CZMbLMJr.js +0 -2
  124. package/dist/assets/SettingsRoutes-DjoLPcL9.js +0 -57
  125. package/dist/assets/SignOutScreen-D0n1VF_F.js +0 -9
  126. package/dist/assets/TaskRoutes-BpMbMrBo.js +0 -9
  127. package/dist/assets/WiseConfirmationScreen-D5tL2FQm.js +0 -12
  128. package/dist/assets/ZeniAccountStatementScreen-BsGBbztb.js +0 -9
  129. package/dist/assets/analyticsHelper-DCaJKlVt.js +0 -1
  130. package/dist/assets/getLocaleForTenant-Bwg2HGhN.js +0 -1
  131. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-8pbQDI6Z.js +0 -1
  132. package/dist/assets/useAskAiCfoHostNavButtonProps-C9yAFzX7.js +0 -1
  133. package/dist/assets/useCashManagementBanner-CZmm0jyx.js +0 -1
@@ -0,0 +1,18 @@
1
+ import{j as l}from"./liveblocks-DIKy4lot.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-DXwLSsqn.js";import{Q0 as k,Q7 as _,gg as W,gf as K,ge as M,jt as q,Na as J,rs as L,eW as V,Py as D,jr as T,Q1 as S,Qa as j,jp as F,jM as G}from"./zeni-epic-state-Cehmp_zm.js";import{bz as X,K as N,C as R,z as U,y as z,r as b,G as v,B as O,bA as Y,o as Q,bB as ee,s as te}from"./index-BxpV0MpM.js";import{n as Z}from"./mui-BPWJk-fl.js";import"./sentry-Dy6CjI9o.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]="19418176-7490-45da-8d19-c13acee8d7c1",e._sentryDebugIdIdentifier="sentry-dbid-19418176-7490-45da-8d19-c13acee8d7c1")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(q(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(J("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(M(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Z.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
+ `,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{e(F(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=b(a.state?.pathnameStackToGoBack),c=s.poppedPathname??E();n(c,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:c}=s;e(j({data:c}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=b(t.location.state?.pathnameStackToGoBack),c=s.poppedPathname??E(0);t.navigate(c,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function me({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:c}=B(),i=e??s,{useFeatureGate:r}=R(),d=U.getSignedInUser(),p=h(u=>V(u)),g=z(),x=b(a.state?.pathnameStackToGoBack),m=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),f=h(u=>k(u,i)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(d==null)throw Error("Can't access address page without signing in...");return m==="billDetail"&&f.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:f.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:c}),l.jsx(oe,{location:a,navigate:n,billId:c,vendorId:i,currentTenant:p,bankAccountContext:m,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},fe=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},P=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return P(e,"ach",t,n)}function ve(e,t,n){return P(e,"domestic",t,n)}function ge(e,t,n){return P(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=Z.div`
10
+ display: flex;
11
+ height: 100vh;
12
+ width: 100%;
13
+ flex: 1 1 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ box-shadow: ${e=>`0px 2px ${Q.sp1} ${e.theme.colors.dropShadowNormal}`};
18
+ `,ce=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:c}=t,{tenantEmailDomain:i}=c;return{onFetchBankName:r=>{e(G(r))},onSaveHandler:r=>{e(F(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:d}=r;e(j({data:d}))},onCancel:()=>{(()=>{const r=b(o.state?.pathnameStackToGoBack),d=r.poppedPathname??$();a(d,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const d=se(i,r,n),p=te(o.state?.pathnameStackToGoBack,o.pathname);a(d,{state:{pathnameStackToGoBack:p}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=b(t.location.state?.pathnameStackToGoBack),d=r.poppedPathname??$(0);t.navigate(d,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:c}=B(),i=e??s,r=U.getSignedInUser(),{useFeatureGate:d}=R(),p=z(),g=h(u=>V(u)),x=b(a.state?.pathnameStackToGoBack),m=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),f=h(u=>k(u,i)),{isFeatureEnabled:I}=d(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return m==="billDetail"&&f.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(O,{fetchState:f.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:p.colors.grey5,boxShadow:`0px 2px ${Q.sp1} ${p.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:c}),l.jsx(ce,{location:a,navigate:n,billId:c,vendorId:i,currentTenant:g,bankAccountContext:m,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{me as A,xe as D,H as V,fe as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -1 +1 @@
1
- import{j as d}from"./liveblocks-C2MSzkBq.js";import{K as b,F as l,y as f}from"./index-BKEcQaqa.js";import{D as c}from"./mui-HfiFUvSH.js";import"./sentry-CeqBlNHw.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="89fbbb96-b48a-4b8e-a23e-0117ebf93880",e._sentryDebugIdIdentifier="sentry-dbid-89fbbb96-b48a-4b8e-a23e-0117ebf93880")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=b(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),i=f();return d.jsx(c,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
1
+ import{j as d}from"./liveblocks-DIKy4lot.js";import{K as b,F as l,y as f}from"./index-BxpV0MpM.js";import{D as c}from"./mui-BPWJk-fl.js";import"./sentry-Dy6CjI9o.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="89fbbb96-b48a-4b8e-a23e-0117ebf93880",e._sentryDebugIdIdentifier="sentry-dbid-89fbbb96-b48a-4b8e-a23e-0117ebf93880")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=b(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),i=f();return d.jsx(c,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-DIKy4lot.js";import{a as d}from"./sentry-Dy6CjI9o.js";import{h as A,u as B,g as G,i as q,j as c,N as O,n as F,o as M,p as W}from"./core-DXwLSsqn.js";import{Oi as _,eW as K,NG as R,lw as Y,Kb as k,On as $,N9 as z,kw as L,Kc as S,NL as V,NM as X,Nb as H,Na as J}from"./zeni-epic-state-Cehmp_zm.js";import{aX as Q,d as U,r as Z,s as tt}from"./index-BxpV0MpM.js";import"./mui-BPWJk-fl.js";import{d as b}from"./decodeURIComponentSafe-BbzvGEmo.js";import{w as et}from"./withTransactionSidePanel-Do9-2jkM.js";import{f as at,c as nt}from"./routePaths-BZ65TmUh.js";import"./recharts-BKU02zoL.js";import"./analytics-Ci054ctJ.js";import"./plaid-CgXOv8Rh.js";import"./dnd-BFL9IlQe.js";import"./stripe-DMRn4zHo.js";import"./lottie-DAe41SWX.js";import"./lexical-t8hl9adA.js";import"./pdf-CG1NUThf.js";import"./utils-BfVxqb_k.js";import"./useAskAiCfoHostNavButtonProps-CaQ8KV1j.js";import"./TransactionDetailScreen-SXa23sv8.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="6baddcce-0752-4336-ba33-2cddec73ff42",a._sentryDebugIdIdentifier="sentry-dbid-6baddcce-0752-4336-ba33-2cddec73ff42")}catch{}})();const it=F(function(a,t){const e=t.entity,i=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:i,analytics:U,isAccountingClassesEnabled:L(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const i=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(i,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const i=at(e,t.tenantEmailDomain);a(V()),a(X()),t.resetTrendIsFetchedStates(),t.navigate(i,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),i=e.poppedPathname??I();t.navigate(i,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const i=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:i}))}}}})(Q),ot=et(function({entityType:a,...t}){const e=A(),i=B(),l=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:w,entityNameEncoded:x}=q(),r=b(w??""),p=b(x??""),f=rt(r,p),N=[r,p].filter(n=>n!=null),o={name:p,id:r,type:a,zeniId:r,qboId:r},g=c(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,o,"quarter")),j=c(n=>K(n).company?.companyInfo.firstMonthOfFY??1),u=c(n=>R(n.trendWithTransactionsState,o,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),i(Y(o)))},[m,f,o]);const E=c(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&i(k(o,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(it,{firstMonthOfFY:j,tenantEmailDomain:C,location:l,navigate:e,entity:o,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(O,{to:I(N.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(M,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(ot,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
@@ -1,11 +1,11 @@
1
- import{j as h}from"./liveblocks-C2MSzkBq.js";import oa from"./NotFoundScreen-C776OUyD.js";import{a as o,b as Nt}from"./sentry-CeqBlNHw.js";import{n as Ue,S as sa}from"./mui-HfiFUvSH.js";import{u as pe,h as Yt,g as Ke,j as x,n as ca,i as xt,o as ia,p as Ge}from"./core-mESSAfOQ.js";import{eX as Re,T2 as la,oj as ke,fY as ra,s4 as da,oB as Kt,oW as Zt,T3 as Ht,p4 as ua,T4 as Qt,ou as ma,rC as pa,fJ as Ie,T5 as De,ub as Wt,Ex as Xt,T6 as en,T7 as ha,ra as Ze,Ok as Pt,Om as ga,kA as Ca,On as Sa,kH as fa,c_ as Ia,vr as He,oH as tn,p9 as Fe,oz as de,T8 as ka,Nc as Rt,Nb as we,T9 as Dt,kY as Ea,Ta,Tb as ya,Tc as ba,Td as va,oO as Aa,pc as xe,Te as wa,Tf as xa,Tg as Pa,pj as Ra,kL as Da,kC as Fa,Th as Ua,kK as Ft,Ou as Ba,Ti as Oa,Tj as Va,r6 as _a,qK as za,pa as me,qJ as Je,Tk as Ma,Tl as ja,Tm as La,mf as $a,bo as qa,ma as Ut,lY as Ga,Tn as Ja,fz as Bt,gx as Na,m7 as Ya,xk as Ka,To as Za,pK as Ha,pF as Qa,pJ as Wa,pu as Xa,Tp as eo,fM as nn,oZ as to,oK as no,fZ as Ot,pe as ao,Tq as oo,Tr as so,pb as an,Ts as co,Tt as io,Tu as lo,Tv as ro,Tw as Vt,ri as uo,qB as mo,Na as po,Tx as ho,Ty as go,kJ as Co,Tz as So,Jd as fo,kI as Io,kx as ko,fL as Eo,q7 as on,qt as To,p8 as _t,pd as yo,bE as bo,m4 as vo,m1 as Ao,TA as wo,pt as zt,qp as Mt,qn as xo,TB as Po,qc as Ro,pU as Do,qq as Fo,TC as Uo,TD as Bo,pY as Oo,TE as Vo,pP as _o,pX as zo,pV as Mo,qw as jo}from"./zeni-epic-state-60_rE4ne.js";import{C as sn,G as X,d as q,v as ae,_ as cn,a0 as ln,c$ as Lo,z as Be,d0 as $o,au as Pe,d1 as qo,aZ as jt,B as rn,d2 as Go,ar as Ne,a as Jo,a9 as No,d3 as Yo,a4 as Ko,d4 as Zo,Z as Ho,d5 as Qo,d6 as Wo,x as Xo,I as es,aS as ts,d7 as ns,d8 as as,be as os,F as ss,aV as cs}from"./index-BKEcQaqa.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-C9yAFzX7.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-utZ3W4nX.js";import{w as us}from"./withTransactionSidePanel-DMXAzZMG.js";import{h as ms,v as ps}from"./routePaths-CwyjQmpj.js";import{g as Ye}from"./accountMappingHelper-Ttvv9gGx.js";import{D as hs}from"./DrawerScreen-C5RcL6Av.js";import"./recharts-BO9Ej9mf.js";import"./analytics-KG6ixMlm.js";import"./plaid-CYvf8Mhe.js";import"./dnd-CSfP84QM.js";import"./stripe-DMRn4zHo.js";import"./lottie-B4YQ42M8.js";import"./lexical-D2OXt6dk.js";import"./pdf-BP_s4vmv.js";import"./utils-Dk_ckawD.js";import"./decodeURIComponentSafe-DbCsPqxw.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="45e87a79-d0a8-43be-80a7-84d20af380bb",t._sentryDebugIdIdentifier="sentry-dbid-45e87a79-d0a8-43be-80a7-84d20af380bb")}catch{}})();const gs=()=>{const t=pe(),l=Yt(),B=Ke(),f=x(d=>Re(d)),{useFeatureGate:b}=sn(),{isFeatureEnabled:S}=b(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=b(X.aiAuditScorePercentage),I=x(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=x(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),E=o.useCallback((d,G,ee=!1)=>{t(ke({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),g=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(g.month,g.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),E(g,f.tenantId,!0)},[E,g,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ae(B.state?.pathnameStackToGoBack,B.pathname),k=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&g!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,g]),{areTenantIdsInSync:T}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&T&&E(g,f.tenantId)},[E,g,s.fetchState,f.tenantId,T]),o.useEffect(()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&T&&t(da(g))},[g,s.monthClosePerformanceTrendFetchStatus.fetchState,T]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(Cs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:k,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},Cs=Ue.div`
1
+ import{j as h}from"./liveblocks-DIKy4lot.js";import oa from"./NotFoundScreen-B314Xa6t.js";import{a as o,b as Nt}from"./sentry-Dy6CjI9o.js";import{n as Ue,S as sa}from"./mui-BPWJk-fl.js";import{u as pe,h as Yt,g as Ke,j as x,n as ca,i as xt,o as ia,p as Ge}from"./core-DXwLSsqn.js";import{eW as Re,S_ as la,oi as Ee,fX as ra,s3 as da,oA as Kt,oV as Zt,S$ as Xt,p3 as ua,T0 as Ht,ot as ma,rB as pa,fI as Ie,T1 as De,ua as Qt,Ew as Wt,T2 as en,T3 as ha,r9 as Ze,Oj as Pt,Ol as ga,kz as Ca,Om as Sa,kG as fa,c_ as Ia,vq as Xe,oG as tn,p8 as Fe,oy as de,T4 as Ea,Nb as Rt,Na as we,T5 as Dt,kX as ka,T6 as Ta,T7 as ya,T8 as ba,T9 as va,oN as Aa,pb as xe,Ta as wa,Tb as xa,Tc as Pa,pi as Ra,kK as Da,kB as Fa,Td as Ua,kJ as Ft,Ot as Ba,Te as Oa,Tf as Va,r5 as _a,qJ as za,p9 as me,qI as Je,Tg as Ma,Th as ja,Ti as La,me as $a,bo as qa,m9 as Ut,lX as Ga,Tj as Ja,fy as Bt,gw as Na,m6 as Ya,xj as Ka,Tk as Za,pJ as Xa,pE as Ha,pI as Qa,pt as Wa,Tl as eo,fL as nn,oY as to,oJ as no,fY as Ot,pd as ao,Tm as oo,Tn as so,pa as an,To as co,Tp as io,Tq as lo,Tr as ro,Ts as Vt,rh as uo,qA as mo,N9 as po,Tt as ho,Tu as go,kI as Co,Tv as So,Jc as fo,kH as Io,kw as Eo,fK as ko,q6 as on,qs as To,p7 as _t,pc as yo,bE as bo,m3 as vo,m0 as Ao,Tw as wo,ps as zt,qo as Mt,qm as xo,Tx as Po,qb as Ro,pT as Do,qp as Fo,Ty as Uo,Tz as Bo,pX as Oo,TA as Vo,pO as _o,pW as zo,pU as Mo,qv as jo}from"./zeni-epic-state-Cehmp_zm.js";import{C as sn,G as W,d as q,s as ae,Z as cn,a0 as ln,cZ as Lo,z as Be,c_ as $o,au as Pe,c$ as qo,aZ as jt,B as rn,d0 as Go,ar as Ne,a as Jo,a9 as No,d1 as Yo,a4 as Ko,d2 as Zo,X as Xo,d3 as Ho,d4 as Qo,w as Wo,I as es,aS as ts,d5 as ns,d6 as as,be as os,F as ss,aV as cs}from"./index-BxpV0MpM.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-CaQ8KV1j.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-SXa23sv8.js";import{w as us}from"./withTransactionSidePanel-Do9-2jkM.js";import{h as ms,v as ps}from"./routePaths-BZ65TmUh.js";import{g as Ye}from"./accountMappingHelper-J0OcQc2L.js";import{D as hs}from"./DrawerScreen-BZIHG-iJ.js";import"./recharts-BKU02zoL.js";import"./analytics-Ci054ctJ.js";import"./plaid-CgXOv8Rh.js";import"./dnd-BFL9IlQe.js";import"./stripe-DMRn4zHo.js";import"./lottie-DAe41SWX.js";import"./lexical-t8hl9adA.js";import"./pdf-CG1NUThf.js";import"./utils-BfVxqb_k.js";import"./decodeURIComponentSafe-BbzvGEmo.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="471427c7-a482-4be0-81c6-d7270584dd48",t._sentryDebugIdIdentifier="sentry-dbid-471427c7-a482-4be0-81c6-d7270584dd48")}catch{}})();const gs=()=>{const t=pe(),l=Yt(),B=Ke(),f=x(d=>Re(d)),{useFeatureGate:b}=sn(),{isFeatureEnabled:S}=b(W.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=b(W.aiAuditScorePercentage),I=x(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=x(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),g=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(g.month,g.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(g,f.tenantId,!0)},[k,g,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ae(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&g!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,g]),{areTenantIdsInSync:T}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&T&&k(g,f.tenantId)},[k,g,s.fetchState,f.tenantId,T]),o.useEffect(()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&T&&t(da(g))},[g,s.monthClosePerformanceTrendFetchStatus.fetchState,T]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(Cs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},Cs=Ue.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
5
5
  flex: 1 1 auto;
6
6
  flex-direction: column;
7
7
  background-color: ${t=>t.theme.colors.grey4};
8
- `,Ss=Nt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:b})=>{const S=pe(),r=Be.getSignedInUser(),I=x(e=>Re(e)),s=t.excludedAccountIDs,p=o.useMemo(()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""}),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:E,statementUploadChosen:v}=t,g=u[l],m=g?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{S(pa(e,n.split(".")[0]))},k=e=>{m!=null&&S(ma({accountId:l,selectedPeriod:E,fileId:e,statementUploadId:m}))},T=()=>{S(Ht({statementUploadChosen:!1}))},d=e=>{S(ua({accountId:l,selectedPeriod:E,payload:e}))},G=e=>{S(Qt({accountId:l,selectedPeriod:E,localData:{accountSource:e}}))},ee=o.useCallback(()=>{S(Kt({accountId:l}))},[S,l]),z=o.useCallback(()=>{S(Zt({accountId:l}))},[S,l]),V=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return g!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx($o,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:g,monthYearPeriod:E,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onEditFileName:P,onDeleteFile:k,onSelectSourceType:G,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:T,onExcludeFromReconciliation:ee})})}):V!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx(qo,{excludedAccountReconciliation:V,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:z})})}):null}),$t=Ue.div`
8
+ `,Ss=Nt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:b})=>{const S=pe(),r=Be.getSignedInUser(),I=x(e=>Re(e)),s=t.excludedAccountIDs,p=o.useMemo(()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""}),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:k,statementUploadChosen:v}=t,g=u[l],m=g?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{S(pa(e,n.split(".")[0]))},E=e=>{m!=null&&S(ma({accountId:l,selectedPeriod:k,fileId:e,statementUploadId:m}))},T=()=>{S(Xt({statementUploadChosen:!1}))},d=e=>{S(ua({accountId:l,selectedPeriod:k,payload:e}))},G=e=>{S(Ht({accountId:l,selectedPeriod:k,localData:{accountSource:e}}))},ee=o.useCallback(()=>{S(Kt({accountId:l}))},[S,l]),z=o.useCallback(()=>{S(Zt({accountId:l}))},[S,l]),V=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return g!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx($o,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:g,monthYearPeriod:k,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onEditFileName:P,onDeleteFile:E,onSelectSourceType:G,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:T,onExcludeFromReconciliation:ee})})}):V!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx(qo,{excludedAccountReconciliation:V,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:z})})}):null}),$t=Ue.div`
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  height: 100%;
@@ -18,7 +18,7 @@ import{j as h}from"./liveblocks-C2MSzkBq.js";import oa from"./NotFoundScreen-C77
18
18
  min-width: 0;
19
19
  overflow-x: hidden;
20
20
  overflow-y: auto;
21
- `;function fs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const b=Be.getSignedInUser();if(b==null)throw Error("Can't access Customer Request page without signing in...");const S=x(r=>ha(r,t,b));return o.useEffect(()=>{f()},[]),h.jsx(h.Fragment,{children:S.fetchState==="In-Progress"||S.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Go,{onCloseClick:l,addCustomerRequest:B,snippets:S.companyMonthEndReportTemplatesData,bulletPoints:S.zeniRequestsData??[]})})}const Is=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:ks,comma:Gt,space:Es}},dateFormat:pn}=Jo.getLocalizedStrings(),Jt=jo,Ts=ca(function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,E={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:g}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:E,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ko}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:g,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}},function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:b,isUncategorizedExpenseCategoryEnabled:S,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:E,navigate:v,onClickCustomerRequest:g,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:k,currentSelectedView:T,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,ee=tn(k),z=Fe(ee.start),V=Fe(ee.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(k.month,k.year),t(mo(e))},onUploadTransactionReceipt:(e,n,c,i,y,C)=>{t(Vt(e,n,{fetchState:"In-Progress"}));const A=()=>t(Vt(e,n,{fetchState:"Error"}));Zo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,C,n,c,i,y).then(O=>{O!=null?t(uo(e,O)):A()}).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(ro(e,n)),u!=null&&t(ke({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(lo(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?Es+ks+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(io(e))},onUpdateMissingReceiptsUIState:e=>{t(co(e))},onFetchMissingReceiptsList:()=>{V!=null&&z!=null&&t(an({start:z,end:V},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(_o({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Vo(e))},onConfirmBulkUploadMatch:(e,n,c,i,y)=>{t(Oo(e,n,c,i,y))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Bo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Fo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Do())},onSearchTransactionsForManualMatch:(e,n)=>{t(Jt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Jt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ro(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(Po())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(xo())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(so())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Je({selectedTab:c,uiState:{searchString:e}})),V!=null&&z!=null&&t(me(c,{start:z,end:V},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(oo({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(ao(S))},onClose:()=>{T==="reconciliation"&&d!=null&&t(Ot({selectedAccountId:void 0})),v("../")},onBack:()=>{T==="reconciliation"&&d!=null&&t(Ot({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(no(e))},onSaveReconciliationReview:e=>{t(to(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ae(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:y}=n,C=Ye(G.prepaidExpensesAccountList,c.selectedOptions),A=Ye(G.fixedAssetsAccountList,i.selectedOptions),O=Ye(G.accruedExpensesAccountList,y.selectedOptions),R={selectedPrepaidExpensesAccountIds:C.map(D=>D.accountId),selectedFixedAssetsAccountIds:A.map(D=>D.accountId),selectedAccruedExpensesAccountIds:O.map(D=>D.accountId)};t(eo({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Xa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:y,scheduleExpenseCategory:C,vendor:A}=n,{allAccountList:O,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,j=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find(N=>N.id===A?.selectedOption):void 0,oe={id:j?.zeniId??A?.selectedOption??"",name:j?.name??A?.defaultOptions.find(N=>N.value===A?.selectedOption)?.label??"",logo:j?.logo},se=C?.selectedOption!=null?O.find(N=>N.qboId===C.selectedOption):void 0,Oe=y?.selectedOption!=null?R.find(N=>N.classId===y.selectedOption):void 0,Ve=i?.selectedOption!=null?D.find(N=>N.qboId===i.selectedOption):void 0;t(Wa({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:se?.accountId,updatedClassId:Oe?.classId,updatedAccumulatedDepreciationCategoryID:Ve?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Qa(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Ha({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Za())},handleJeScheduleClick:(e,n,c)=>{t(Ka({selectedJEScheduleKey:n}));const i=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ya(e,u.companyId,u.tenantId))},onClickCustomerRequest:g,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Na())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Ja(e))},onUpdateFileAttachment:e=>{t(Ga({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t($a(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,qa().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,y,C,A,O,R,D,j,oe,se)=>{t(La(e,n,c,i,E,y,C,A,O,R,D,j,oe,se))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),V!=null&&z!=null&&(t(me(e,{start:z,end:V},!1,!1)),t(ja(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),V!=null&&z!=null&&(t(Ma(e)),t(me("autoCategorized",{start:z,end:V},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Je({selectedTab:e,uiState:n})),V!=null&&z!=null&&t(me(e,{start:z,end:V},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Je({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,y,C,A)=>{V!=null&&z!=null&&t(me(e,{start:z,end:V},!0,c,n,i,y,C,A))},resetTransactionCategorizationLocalData:(e,n,c,i,y,C,A,O)=>{t(za(e,n,c,i,O??null,y,C,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,y)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:E,updatedVendor:y,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(k.month,k.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(k.month,k.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(_a(e,n,c,S))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Va({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,y,C,A)=>{const{transactionId:O,transaction:R,lineIds:D}=n;C!=null&&t(Ba({transactionId:O,customerUpdates:C})),t(Oa({selectedTab:i,transactionId:O.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:E,updatedCustomer:C,selectedEntity:y,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),y!=null&&t(He({entity:y,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,y,C,A)=>{const{transactionId:O,transaction:R,lineIds:D}=n;C!=null&&(t(Da({transactionId:O,vendorUpdates:{name:C.name,id:C.id?C.id:void 0}})),t(Fa({vendorId:C.id?C.id:void 0,localData:{vendorName:C.name,vendorId:C.id?C.id:void 0}}))),C?.id?(t(Ft({selectedTab:i,transactionId:O.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:E,updatedVendor:C,selectedEntity:y,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),y!=null&&t(He({entity:y,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:O.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(xe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(xe(k,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Ra(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(Pa(e))},updateOperatingExpensesIdsForReview:e=>{t(xa({operatingExpenseIds:e,selectedPeriod:k}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ps(e.id,e.qboId,l.tenantEmailDomain),c=ae(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(wa({sectionId:e,selectedPeriod:k}))},onFetchReimbursementView:(e,n,c)=>{t(xe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(de(k,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Wt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Qt({accountId:e,selectedPeriod:k,localData:{accountSource:"bank_statement"}})),t(Ht({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(k,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Aa({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(ba({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ya({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(Ea(i)),t(Ta({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ze("bill"));const n=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(ka({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Kt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Zt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||T!=="reconciliation"||t(de(k,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...b}=B;return function(S,r,I){return{...S,...r,...I,onUploadTransactionReceipt:(s,p,u,E,v)=>{r.onUploadTransactionReceipt(s,p,u,E,v,S.authParams)}}}(t,l,b)})(No(Yo)),ys=us(function(t){const l=t.displayName??t.name??"Component",B=Nt.memo(t),f=b=>{const S=pe(),r=function(){const P=pe(),k=x(T=>Ie(T).reconciliation.selectedDrawerAccountId);return{isOpen:k!=null,selectedAccountId:k,openPanel:o.useCallback(T=>{P(De({selectedDrawerAccountId:T}))},[P]),closePanel:o.useCallback(()=>{P(De({selectedDrawerAccountId:void 0}))},[P])}}(),I=x(P=>Ie(P).reconciliation),s=x(P=>Re(P)),p=o.useCallback((P,k)=>{S(Wt("expense_automation_reconcile",P,k))},[S]),u=o.useCallback((P,k)=>{const T=s?.companyId;T!=null&&(S(Xt(P,T,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",k)),S(en({accountId:k,connectionInProgress:!0})))},[S,s?.companyId]),E=o.useMemo(()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Ss,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})},[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo(()=>({reconPanelContent:E,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[E,r.isOpen,r.closePanel]),g=o.useContext(jt),m=o.useMemo(()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:g,[r.isOpen,r.closePanel,r.selectedAccountId,g]);return h.jsx(jt.Provider,{value:m,children:h.jsx(B,{...b,...v})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:b,reconPanelContent:S,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Ho(),u=Qo(),{isOpen:E}=Wo(),v=Yt(),g=Ke(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:k}=dn({mobileExploreReferrer:"Transaction categorization"}),T=o.useCallback(()=>{b===!0&&f!==!0&&t?.()},[t,b,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=x(J=>Ie(J)),U=Ke(),{currentSelectedViewFetchState:L,currentSelectedView:$,selectedPeriod:w}=a,Q=Ne($),Y=Ne(L.fetchState),H=o.useCallback(J=>{const W=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,J,W??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,J,W??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,J,a.missingReceipts.transactions.length,W??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,J,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,W??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,J,Is(a.fluxAnalysis),W??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,J,"draft",a.auditSummary.auditScorePercentage,null,W??null)},[w,a]);return o.useEffect(()=>{Y===L.fetchState&&$===Q||L.fetchState!=="Completed"||H(!1)},[$,L.fetchState,Q]),H})(),ee=Xo(),[z,V]=o.useState(!1),e=x(a=>Pt(a)),n=x(a=>Re(a)),[c,i]=o.useState(!1),[y,C]=o.useState(!1),[A,O]=o.useState([]),[R,D]=o.useState(null),j=o.useCallback(()=>{D(null)},[]),oe=R?.contentType==="activity"?R.detail.transactionId:void 0,se=o.useCallback(a=>{a!=null?(s&&p(!1),u(),T(),D({contentType:"activity",detail:{transactionId:a}})):D(U=>U?.contentType==="activity"?null:U)},[T,s,u,p]),Oe=o.useCallback(a=>{s&&p(!1),u(),T(),D({contentType:"transfer",detail:a})},[T,s,u,p]),Ve=o.useCallback(()=>{u(),j(),T(),k()},[T,j,k,u]),N=o.useRef(s);o.useEffect(()=>{s===!0&&N.current===!1&&(u(),j(),T()),N.current=s},[T,j,s,u]);const Qe=o.useRef(E);o.useEffect(()=>{E===!0&&Qe.current===!1&&(s&&p(!1),j(),b===!0&&f!==!0&&t?.()),Qe.current=E},[j,t,E,s,p,f,b]);const Ee=b===!0&&f!==!0,We=o.useRef(Ee);o.useEffect(()=>{Ee&&!We.current&&(s&&p(!1),u(),j()),We.current=Ee},[j,s,Ee,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=xt(),{tenantEmailDomain:gn}=xt(),[_e,nt]=o.useState(g.state?.message==="comingFromTransactionDetail"),at=g.state?.message==="comingFromOverview",Cn=es(),ze=Be.getSignedInUser(),{useDynamicConfig:Sn,useFeatureGate:ce}=sn(),{configValue:fn}=Sn(ts.enableUncategorizedExpenseCategory),te=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=ce(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=ce(X.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=ce(X.isTransactionActivityEnabled),{isFeatureEnabled:st}=ce(X.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=ce(X.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:kn}=ce(X.isProjectsTransactionsEnabled),{isFeatureEnabled:En}=ce(X.isJEScheduleCOTEnabled),Tn=o.useCallback(a=>{const U=Ze(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)},[l]),yn=x(a=>po(a,"common")),M=x(a=>Ie(a)),{categoryOptions:bn,paymentAccountNames:vn}=x(a=>ho(a.accountState)),An=x(a=>go(a.classState)),{monthEndCloseChecksView:Z,currentSelectedView:F,selectedPeriod:_,selectedTransactionCategorizationTab:je,currentSelectedViewBackgroundRefreshFetchState:wn,currentSelectedViewFetchState:ie,jeSchedules:Le,reconciliation:xn}=M;is(F==="transaction_categorization");const Pn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=x(a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView),rt=x(a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const ne=ls(Pn,()=>{const a=[],U=ut.current,L=dt.current,$=L!=null&&U!=null?L[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const Q of Object.values($.transactionReviewLocalDataById)){const Y=Q?.transactionReviewLocalData?.lineItemById;if(Y!=null)for(const H of Object.values(Y)){const J=H?.account;J?.accountId!=null&&a.push(J.accountId)}}const w=it.current;for(const Q of w)for(const Y of Q.lines??[])"account"in Y&&Y.account?.accountId!=null&&a.push(Y.account.accountId);return a});o.useEffect(()=>{F==="transaction_categorization"&&b!==!0||se(void 0)},[F,se,b]);const Rn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,Te=`${je}|${Rn}`,ye=o.useRef(null);o.useEffect(()=>{ye.current!==null?ye.current!==Te&&(ye.current=Te,F==="transaction_categorization"&&j()):ye.current=Te},[j,F,Te]);const Dn=x(a=>oe==null?void 0:Co(a.transactionState,oe)),le=Dn?.qboId,mt=x(a=>le==null?void 0:So(a,le));o.useEffect(()=>{le!=null&&m(fo(le))},[m,le]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:gt}=M.transactionView,Ct=o.useCallback(a=>rs(m,a),[m]),St=o.useMemo(()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ns,{activityLogView:mt,qboId:le,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(as,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:gt,onClose:()=>D(null),onCreateTransfer:Ct,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null,[F,R,Me,mt,le,pt,ht,gt,Ct]),Fn=St!=null,{selectedAccountId:ge}=xn,ft=Ne(Le.accountSettingsView.saveState.fetchState),Un=x(a=>Io(a.accountState,a.accountListState,"accountList")),Bn=x(a=>ko(a)),Ce=tt!=null?Eo(tt):F,On=x(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:ie.fetchState==="Completed"}),ze==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(_),Se=Fe(It.start),fe=Fe(It.end);if(Se==null||fe==null)throw Error(`Invalid start - ${Se} and end - ${fe} period from given ${_}`);const Vn=o.useCallback(()=>{i(!1)},[]),_n=o.useCallback(()=>{C(!0)},[]),zn=o.useCallback(a=>{O(a),C(!1)},[]),Mn=o.useCallback(()=>{O([])},[]),be=M.missingReceipts.bulkUpload.phase,kt=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&F==="missing_receipts"&&be==="matching"&&kt!=null&&m(on({cacheOverride:!0}))},[he,F,be,kt,m]);const Et=ze?.userId,jn=_.month,Ln=_.year,Tt=n?.tenantId;o.useEffect(()=>{F==="missing_receipts"&&he!==!1&&be==="idle"&&Et!=null&&Tt!=null&&m(To())},[F,he,be,Et,Tt,jn,Ln,m]),o.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?V(!0):V(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{Ce!=null&&F!==Ce&&m(nn(Ce))},[Ce]),o.useEffect(()=>{Xe!==!1||ie.fetchState!=="Completed"&&ie.fetchState!=="Error"||!d||(hn(!0),m(_t(!1,!1,te)))},[Xe,ie,d,te]),o.useEffect(()=>{!at&&d&&(m(_t(!1,!1,te)),m(de(_,ge,!1,!1)))},[_.month,_.year,d,te]);const yt=o.useCallback((a=!1,U=!1)=>{const L={start:Se,end:fe};switch(F){case"transaction_categorization":m(me(je,L,a,!_e,void 0,void 0,U,void 0,te)),nt(!1);break;case"flux_analysis":m(xe(_,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(_.year,_.month,0),w=bo($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(Ao(n.companyId,n.tenantId))}break;case"je_schedules":m(yo(L,U));break;case"missing_receipts":m(an(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(de(_,ge,a,U))}},[F,Se,fe,n.companyId,n.tenantId,je,_,ge,_e,nt,te]);o.useEffect(()=>{F===Ce&&ie.fetchState==="Not-Started"&&d&&yt(!0)},[ie,Se,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||_e||et.current||wn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(et.current=!0,yt(!0,!0))},[]),o.useEffect(()=>{Z.fetchState!=="In-Progress"&&Z.fetchState!=="Completed"&&m(ke({tenantId:n.tenantId,period:_,refreshViewInBackground:!1}))},[Z.fetchState,n.tenantId]),o.useEffect(()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)},[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(ke({tenantId:n.tenantId,period:_,refreshViewInBackground:!0})),m(wo({companyId:n.companyId})),v("../"))},[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,_,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{Z.fetchState!=="In-Progress"&&Z.fetchState==="Completed"&&m(ke({tenantId:n.tenantId,period:_,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[Z.fetchState,n.tenantId,_,m]),o.useEffect(()=>{const a=setInterval(()=>{F==="reconciliation"&&ge==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(de(_,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,de,ge,_]);const $n=Lt();o.useEffect(()=>{const a=(Z.monthEndCloseChecks?.monthEndCloseCheckList.find(U=>U.id==="month_end_insights")?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&Z.monthEndCloseChecks?.reportEmailSentDate==null||v("../")},[F,Z.monthEndCloseChecks]);const qn=r===!0?S:B,Gn=r===!0||b===!0,Jn=r===!0?I:t;o.useEffect(()=>{ft==="In-Progress"&&Le.accountSettingsView.saveState.fetchState==="Completed"&&m(zt())},[ft,Le.accountSettingsView.saveState.fetchState,zt]);const{transactionId:bt,onSaveVendor:Nn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Zn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:L,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let Q,Y,H;const J=Lt(),W=a.transactionView;let vt=()=>{};const{transactions:Qn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Wn}=W;if(L==="transaction_categorization"){const $e=Wn.find(re=>re.transactionId===ue),K=Qn.find(re=>re.id===ue),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,wt=At?.account;Y=At?.class?.classId,Q=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const ea=ms(ue,K?.typeOfTransaction);K!=null&&ea&&(H={id:ue,type:Ze(K.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&K!=null){const re=W.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(re!=null&&K.lines!=null&&K.lines.length>0){const Ae=re.lineItemById[ve];let qe=re.selectedEntity;if(Ia(K)||(qe=Ae.selectedEntityLine),qe!=null){const ta=qe,na={transactionId:{id:K.id,type:K.type},transaction:K,lineIds:K.lines.map(aa=>aa.id)??[]};w(He({entity:ta,amount:Ae.amount.amount,transactionDetails:na,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:J,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Xn=x($e=>Pt($e,void 0,Q,Y));return{transactionId:H,onSaveVendor:()=>{w(fa(H,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{H!=null&&w(ga({transactionId:H})),w(Ca()),w(Sa()),U()},vendorViewDetails:Xn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{V(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:te}),Hn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,L)=>{L.onReconciliationPusherEventReceived(a)}};return Cn?.loggedInUserRoleMap==null?Z.fetchState==="Error"?h.jsx(os,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{isOpen:y,drawerLeftMargin:new ss(0,0,300,650),onClose:()=>{C(!1)},children:h.jsx(bs,{onClick:a=>a.stopPropagation(),children:h.jsx(fs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>C(!1),addCustomerRequest:zn,resetCustomerRequest:Mn})})}),bt!=null&&z&&h.jsx(ds,{isOpen:z,transactionId:bt,onSaveVendor:Nn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Zn}),h.jsx(Ts,{...Hn,navigate:v,location:g,themeState:ee,categoryOptions:bn,classesForFilters:An,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:On,entityAutoCompleteView:yn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:te,isAccountingClassesEnabled:Bn,isProjectsTransactionsEnabled:kn,isCOTEnabled:$n,isJEScheduleCOTEnabled:En,currentTenant:n,companyId:n.companyId,signedInUser:ze,isTransactionActivityEnabled:Me,isRightPanelOpen:Fn,rightSidePanel:St,onOpenTransferRightPanel:st===!0?Oe:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:_n,handleEditClick:Vn,tenantEmailDomain:gn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:se,closeSidePanel:Jn,openTransactionPanel:l,sidePanelIsOpen:Gn,sidePanelIsFullView:r!==!0&&f,panelContent:qn,isAiCfoAccessEnabled:P,onAskAiCfoClick:Ve,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:Tn,sidePanelListPercent:r===!0?66:void 0}),ne.showPopup&&ne.popupType!=null&&h.jsx(cs,{popupType:ne.popupType,currencySymbol:ne.currencySymbol,accountId:ne.popupAccountId??"",accountName:ne.popupAccountName??"",onSubmit:ne.handleSubmit,onDismiss:ne.handleDismiss})]})})),bs=Ue(sa)`
21
+ `;function fs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const b=Be.getSignedInUser();if(b==null)throw Error("Can't access Customer Request page without signing in...");const S=x(r=>ha(r,t,b));return o.useEffect(()=>{f()},[]),h.jsx(h.Fragment,{children:S.fetchState==="In-Progress"||S.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Go,{onCloseClick:l,addCustomerRequest:B,snippets:S.companyMonthEndReportTemplatesData,bulletPoints:S.zeniRequestsData??[]})})}const Is=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:Es,comma:Gt,space:ks}},dateFormat:pn}=Jo.getLocalizedStrings(),Jt=jo,Ts=ca(function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,k={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:g}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:k,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ko}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:g,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}},function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:b,isUncategorizedExpenseCategoryEnabled:S,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:k,navigate:v,onClickCustomerRequest:g,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:E,currentSelectedView:T,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,ee=tn(E),z=Fe(ee.start),V=Fe(ee.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(E.month,E.year),t(mo(e))},onUploadTransactionReceipt:(e,n,c,i,y,C)=>{t(Vt(e,n,{fetchState:"In-Progress"}));const A=()=>t(Vt(e,n,{fetchState:"Error"}));Zo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,C,n,c,i,y).then(O=>{O!=null?t(uo(e,O)):A()}).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(ro(e,n)),u!=null&&t(Ee({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(lo(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?ks+Es+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(io(e))},onUpdateMissingReceiptsUIState:e=>{t(co(e))},onFetchMissingReceiptsList:()=>{V!=null&&z!=null&&t(an({start:z,end:V},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(_o({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Vo(e))},onConfirmBulkUploadMatch:(e,n,c,i,y)=>{t(Oo(e,n,c,i,y))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Bo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Fo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Do())},onSearchTransactionsForManualMatch:(e,n)=>{t(Jt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Jt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ro(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(Po())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(xo())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(so())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Je({selectedTab:c,uiState:{searchString:e}})),V!=null&&z!=null&&t(me(c,{start:z,end:V},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(oo({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(ao(S))},onClose:()=>{T==="reconciliation"&&d!=null&&t(Ot({selectedAccountId:void 0})),v("../")},onBack:()=>{T==="reconciliation"&&d!=null&&t(Ot({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(no(e))},onSaveReconciliationReview:e=>{t(to(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ae(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:y}=n,C=Ye(G.prepaidExpensesAccountList,c.selectedOptions),A=Ye(G.fixedAssetsAccountList,i.selectedOptions),O=Ye(G.accruedExpensesAccountList,y.selectedOptions),R={selectedPrepaidExpensesAccountIds:C.map(D=>D.accountId),selectedFixedAssetsAccountIds:A.map(D=>D.accountId),selectedAccruedExpensesAccountIds:O.map(D=>D.accountId)};t(eo({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Wa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:y,scheduleExpenseCategory:C,vendor:A}=n,{allAccountList:O,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,j=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find(N=>N.id===A?.selectedOption):void 0,oe={id:j?.zeniId??A?.selectedOption??"",name:j?.name??A?.defaultOptions.find(N=>N.value===A?.selectedOption)?.label??"",logo:j?.logo},se=C?.selectedOption!=null?O.find(N=>N.qboId===C.selectedOption):void 0,Oe=y?.selectedOption!=null?R.find(N=>N.classId===y.selectedOption):void 0,Ve=i?.selectedOption!=null?D.find(N=>N.qboId===i.selectedOption):void 0;t(Qa({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:se?.accountId,updatedClassId:Oe?.classId,updatedAccumulatedDepreciationCategoryID:Ve?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ha(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Xa({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Za())},handleJeScheduleClick:(e,n,c)=>{t(Ka({selectedJEScheduleKey:n}));const i=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ya(e,u.companyId,u.tenantId))},onClickCustomerRequest:g,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Na())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Ja(e))},onUpdateFileAttachment:e=>{t(Ga({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t($a(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,qa().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,y,C,A,O,R,D,j,oe,se)=>{t(La(e,n,c,i,k,y,C,A,O,R,D,j,oe,se))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),V!=null&&z!=null&&(t(me(e,{start:z,end:V},!1,!1)),t(ja(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),V!=null&&z!=null&&(t(Ma(e)),t(me("autoCategorized",{start:z,end:V},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Je({selectedTab:e,uiState:n})),V!=null&&z!=null&&t(me(e,{start:z,end:V},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Je({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,y,C,A)=>{V!=null&&z!=null&&t(me(e,{start:z,end:V},!0,c,n,i,y,C,A))},resetTransactionCategorizationLocalData:(e,n,c,i,y,C,A,O)=>{t(za(e,n,c,i,O??null,y,C,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,y)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:k,updatedVendor:y,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(E.month,E.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(E.month,E.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(_a(e,n,c,S))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Va({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,y,C,A)=>{const{transactionId:O,transaction:R,lineIds:D}=n;C!=null&&t(Ba({transactionId:O,customerUpdates:C})),t(Oa({selectedTab:i,transactionId:O.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedCustomer:C,selectedEntity:y,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),y!=null&&t(Xe({entity:y,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,y,C,A)=>{const{transactionId:O,transaction:R,lineIds:D}=n;C!=null&&(t(Da({transactionId:O,vendorUpdates:{name:C.name,id:C.id?C.id:void 0}})),t(Fa({vendorId:C.id?C.id:void 0,localData:{vendorName:C.name,vendorId:C.id?C.id:void 0}}))),C?.id?(t(Ft({selectedTab:i,transactionId:O.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedVendor:C,selectedEntity:y,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),y!=null&&t(Xe({entity:y,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:b,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:O.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(xe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(xe(E,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Ra(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(Pa(e))},updateOperatingExpensesIdsForReview:e=>{t(xa({operatingExpenseIds:e,selectedPeriod:E}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ps(e.id,e.qboId,l.tenantEmailDomain),c=ae(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(wa({sectionId:e,selectedPeriod:E}))},onFetchReimbursementView:(e,n,c)=>{t(xe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(de(E,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Qt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Wt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ht({accountId:e,selectedPeriod:E,localData:{accountSource:"bank_statement"}})),t(Xt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(E,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Aa({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(ba({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ya({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(ka(i)),t(Ta({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ze("bill"));const n=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ea({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Kt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Zt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||T!=="reconciliation"||t(de(E,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...b}=B;return function(S,r,I){return{...S,...r,...I,onUploadTransactionReceipt:(s,p,u,k,v)=>{r.onUploadTransactionReceipt(s,p,u,k,v,S.authParams)}}}(t,l,b)})(No(Yo)),ys=us(function(t){const l=t.displayName??t.name??"Component",B=Nt.memo(t),f=b=>{const S=pe(),r=function(){const P=pe(),E=x(T=>Ie(T).reconciliation.selectedDrawerAccountId);return{isOpen:E!=null,selectedAccountId:E,openPanel:o.useCallback(T=>{P(De({selectedDrawerAccountId:T}))},[P]),closePanel:o.useCallback(()=>{P(De({selectedDrawerAccountId:void 0}))},[P])}}(),I=x(P=>Ie(P).reconciliation),s=x(P=>Re(P)),p=o.useCallback((P,E)=>{S(Qt("expense_automation_reconcile",P,E))},[S]),u=o.useCallback((P,E)=>{const T=s?.companyId;T!=null&&(S(Wt(P,T,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",E)),S(en({accountId:E,connectionInProgress:!0})))},[S,s?.companyId]),k=o.useMemo(()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Ss,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})},[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo(()=>({reconPanelContent:k,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[k,r.isOpen,r.closePanel]),g=o.useContext(jt),m=o.useMemo(()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:g,[r.isOpen,r.closePanel,r.selectedAccountId,g]);return h.jsx(jt.Provider,{value:m,children:h.jsx(B,{...b,...v})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:b,reconPanelContent:S,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Xo(),u=Ho(),{isOpen:k}=Qo(),v=Yt(),g=Ke(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:E}=dn({mobileExploreReferrer:"Transaction categorization"}),T=o.useCallback(()=>{b===!0&&f!==!0&&t?.()},[t,b,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=x(J=>Ie(J)),U=Ke(),{currentSelectedViewFetchState:L,currentSelectedView:$,selectedPeriod:w}=a,H=Ne($),Y=Ne(L.fetchState),X=o.useCallback(J=>{const Q=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,J,Q??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,J,Q??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,J,a.missingReceipts.transactions.length,Q??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,J,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,Q??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,J,Is(a.fluxAnalysis),Q??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,J,"draft",a.auditSummary.auditScorePercentage,null,Q??null)},[w,a]);return o.useEffect(()=>{Y===L.fetchState&&$===H||L.fetchState!=="Completed"||X(!1)},[$,L.fetchState,H]),X})(),ee=Wo(),[z,V]=o.useState(!1),e=x(a=>Pt(a)),n=x(a=>Re(a)),[c,i]=o.useState(!1),[y,C]=o.useState(!1),[A,O]=o.useState([]),[R,D]=o.useState(null),j=o.useCallback(()=>{D(null)},[]),oe=R?.contentType==="activity"?R.detail.transactionId:void 0,se=o.useCallback(a=>{a!=null?(s&&p(!1),u(),T(),D({contentType:"activity",detail:{transactionId:a}})):D(U=>U?.contentType==="activity"?null:U)},[T,s,u,p]),Oe=o.useCallback(a=>{s&&p(!1),u(),T(),D({contentType:"transfer",detail:a})},[T,s,u,p]),Ve=o.useCallback(()=>{u(),j(),T(),E()},[T,j,E,u]),N=o.useRef(s);o.useEffect(()=>{s===!0&&N.current===!1&&(u(),j(),T()),N.current=s},[T,j,s,u]);const He=o.useRef(k);o.useEffect(()=>{k===!0&&He.current===!1&&(s&&p(!1),j(),b===!0&&f!==!0&&t?.()),He.current=k},[j,t,k,s,p,f,b]);const ke=b===!0&&f!==!0,Qe=o.useRef(ke);o.useEffect(()=>{ke&&!Qe.current&&(s&&p(!1),u(),j()),Qe.current=ke},[j,s,ke,u,p]);const[We,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=xt(),{tenantEmailDomain:gn}=xt(),[_e,nt]=o.useState(g.state?.message==="comingFromTransactionDetail"),at=g.state?.message==="comingFromOverview",Cn=es(),ze=Be.getSignedInUser(),{useDynamicConfig:Sn,useFeatureGate:ce}=sn(),{configValue:fn}=Sn(ts.enableUncategorizedExpenseCategory),te=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=ce(W.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=ce(W.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=ce(W.isTransactionActivityEnabled),{isFeatureEnabled:st}=ce(W.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=ce(W.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:En}=ce(W.isProjectsTransactionsEnabled),{isFeatureEnabled:kn}=ce(W.isJEScheduleCOTEnabled),Tn=o.useCallback(a=>{const U=Ze(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)},[l]),yn=x(a=>po(a,"common")),M=x(a=>Ie(a)),{categoryOptions:bn,paymentAccountNames:vn}=x(a=>ho(a.accountState)),An=x(a=>go(a.classState)),{monthEndCloseChecksView:Z,currentSelectedView:F,selectedPeriod:_,selectedTransactionCategorizationTab:je,currentSelectedViewBackgroundRefreshFetchState:wn,currentSelectedViewFetchState:ie,jeSchedules:Le,reconciliation:xn}=M;is(F==="transaction_categorization");const Pn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=x(a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView),rt=x(a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const ne=ls(Pn,()=>{const a=[],U=ut.current,L=dt.current,$=L!=null&&U!=null?L[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const H of Object.values($.transactionReviewLocalDataById)){const Y=H?.transactionReviewLocalData?.lineItemById;if(Y!=null)for(const X of Object.values(Y)){const J=X?.account;J?.accountId!=null&&a.push(J.accountId)}}const w=it.current;for(const H of w)for(const Y of H.lines??[])"account"in Y&&Y.account?.accountId!=null&&a.push(Y.account.accountId);return a});o.useEffect(()=>{F==="transaction_categorization"&&b!==!0||se(void 0)},[F,se,b]);const Rn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,Te=`${je}|${Rn}`,ye=o.useRef(null);o.useEffect(()=>{ye.current!==null?ye.current!==Te&&(ye.current=Te,F==="transaction_categorization"&&j()):ye.current=Te},[j,F,Te]);const Dn=x(a=>oe==null?void 0:Co(a.transactionState,oe)),le=Dn?.qboId,mt=x(a=>le==null?void 0:So(a,le));o.useEffect(()=>{le!=null&&m(fo(le))},[m,le]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:gt}=M.transactionView,Ct=o.useCallback(a=>rs(m,a),[m]),St=o.useMemo(()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ns,{activityLogView:mt,qboId:le,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(as,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:gt,onClose:()=>D(null),onCreateTransfer:Ct,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null,[F,R,Me,mt,le,pt,ht,gt,Ct]),Fn=St!=null,{selectedAccountId:ge}=xn,ft=Ne(Le.accountSettingsView.saveState.fetchState),Un=x(a=>Io(a.accountState,a.accountListState,"accountList")),Bn=x(a=>Eo(a)),Ce=tt!=null?ko(tt):F,On=x(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:ie.fetchState==="Completed"}),ze==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(_),Se=Fe(It.start),fe=Fe(It.end);if(Se==null||fe==null)throw Error(`Invalid start - ${Se} and end - ${fe} period from given ${_}`);const Vn=o.useCallback(()=>{i(!1)},[]),_n=o.useCallback(()=>{C(!0)},[]),zn=o.useCallback(a=>{O(a),C(!1)},[]),Mn=o.useCallback(()=>{O([])},[]),be=M.missingReceipts.bulkUpload.phase,Et=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&F==="missing_receipts"&&be==="matching"&&Et!=null&&m(on({cacheOverride:!0}))},[he,F,be,Et,m]);const kt=ze?.userId,jn=_.month,Ln=_.year,Tt=n?.tenantId;o.useEffect(()=>{F==="missing_receipts"&&he!==!1&&be==="idle"&&kt!=null&&Tt!=null&&m(To())},[F,he,be,kt,Tt,jn,Ln,m]),o.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?V(!0):V(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{Ce!=null&&F!==Ce&&m(nn(Ce))},[Ce]),o.useEffect(()=>{We!==!1||ie.fetchState!=="Completed"&&ie.fetchState!=="Error"||!d||(hn(!0),m(_t(!1,!1,te)))},[We,ie,d,te]),o.useEffect(()=>{!at&&d&&(m(_t(!1,!1,te)),m(de(_,ge,!1,!1)))},[_.month,_.year,d,te]);const yt=o.useCallback((a=!1,U=!1)=>{const L={start:Se,end:fe};switch(F){case"transaction_categorization":m(me(je,L,a,!_e,void 0,void 0,U,void 0,te)),nt(!1);break;case"flux_analysis":m(xe(_,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(_.year,_.month,0),w=bo($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(Ao(n.companyId,n.tenantId))}break;case"je_schedules":m(yo(L,U));break;case"missing_receipts":m(an(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(de(_,ge,a,U))}},[F,Se,fe,n.companyId,n.tenantId,je,_,ge,_e,nt,te]);o.useEffect(()=>{F===Ce&&ie.fetchState==="Not-Started"&&d&&yt(!0)},[ie,Se,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||_e||et.current||wn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(et.current=!0,yt(!0,!0))},[]),o.useEffect(()=>{Z.fetchState!=="In-Progress"&&Z.fetchState!=="Completed"&&m(Ee({tenantId:n.tenantId,period:_,refreshViewInBackground:!1}))},[Z.fetchState,n.tenantId]),o.useEffect(()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)},[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(Ee({tenantId:n.tenantId,period:_,refreshViewInBackground:!0})),m(wo({companyId:n.companyId})),v("../"))},[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,_,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{Z.fetchState!=="In-Progress"&&Z.fetchState==="Completed"&&m(Ee({tenantId:n.tenantId,period:_,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[Z.fetchState,n.tenantId,_,m]),o.useEffect(()=>{const a=setInterval(()=>{F==="reconciliation"&&ge==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(de(_,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,de,ge,_]);const $n=Lt();o.useEffect(()=>{const a=(Z.monthEndCloseChecks?.monthEndCloseCheckList.find(U=>U.id==="month_end_insights")?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&Z.monthEndCloseChecks?.reportEmailSentDate==null||v("../")},[F,Z.monthEndCloseChecks]);const qn=r===!0?S:B,Gn=r===!0||b===!0,Jn=r===!0?I:t;o.useEffect(()=>{ft==="In-Progress"&&Le.accountSettingsView.saveState.fetchState==="Completed"&&m(zt())},[ft,Le.accountSettingsView.saveState.fetchState,zt]);const{transactionId:bt,onSaveVendor:Nn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Zn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:L,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let H,Y,X;const J=Lt(),Q=a.transactionView;let vt=()=>{};const{transactions:Hn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Qn}=Q;if(L==="transaction_categorization"){const $e=Qn.find(re=>re.transactionId===ue),K=Hn.find(re=>re.id===ue),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,wt=At?.account;Y=At?.class?.classId,H=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const ea=ms(ue,K?.typeOfTransaction);K!=null&&ea&&(X={id:ue,type:Ze(K.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&K!=null){const re=Q.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(re!=null&&K.lines!=null&&K.lines.length>0){const Ae=re.lineItemById[ve];let qe=re.selectedEntity;if(Ia(K)||(qe=Ae.selectedEntityLine),qe!=null){const ta=qe,na={transactionId:{id:K.id,type:K.type},transaction:K,lineIds:K.lines.map(aa=>aa.id)??[]};w(Xe({entity:ta,amount:Ae.amount.amount,transactionDetails:na,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:J,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Wn=x($e=>Pt($e,void 0,H,Y));return{transactionId:X,onSaveVendor:()=>{w(fa(X,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{X!=null&&w(ga({transactionId:X})),w(Ca()),w(Sa()),U()},vendorViewDetails:Wn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{V(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:te}),Xn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,L)=>{L.onReconciliationPusherEventReceived(a)}};return Cn?.loggedInUserRoleMap==null?Z.fetchState==="Error"?h.jsx(os,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{isOpen:y,drawerLeftMargin:new ss(0,0,300,650),onClose:()=>{C(!1)},children:h.jsx(bs,{onClick:a=>a.stopPropagation(),children:h.jsx(fs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>C(!1),addCustomerRequest:zn,resetCustomerRequest:Mn})})}),bt!=null&&z&&h.jsx(ds,{isOpen:z,transactionId:bt,onSaveVendor:Nn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Zn}),h.jsx(Ts,{...Xn,navigate:v,location:g,themeState:ee,categoryOptions:bn,classesForFilters:An,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:On,entityAutoCompleteView:yn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:te,isAccountingClassesEnabled:Bn,isProjectsTransactionsEnabled:En,isCOTEnabled:$n,isJEScheduleCOTEnabled:kn,currentTenant:n,companyId:n.companyId,signedInUser:ze,isTransactionActivityEnabled:Me,isRightPanelOpen:Fn,rightSidePanel:St,onOpenTransferRightPanel:st===!0?Oe:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:_n,handleEditClick:Vn,tenantEmailDomain:gn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:se,closeSidePanel:Jn,openTransactionPanel:l,sidePanelIsOpen:Gn,sidePanelIsFullView:r!==!0&&f,panelContent:qn,isAiCfoAccessEnabled:P,onAskAiCfoClick:Ve,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:Tn,sidePanelListPercent:r===!0?66:void 0}),ne.showPopup&&ne.popupType!=null&&h.jsx(cs,{popupType:ne.popupType,currencySymbol:ne.currencySymbol,accountId:ne.popupAccountId??"",accountName:ne.popupAccountName??"",onSubmit:ne.handleSubmit,onDismiss:ne.handleDismiss})]})})),bs=Ue(sa)`
22
22
  display: flex;
23
23
  min-height: 100%;
24
24
  flex-direction: column;
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-DIKy4lot.js";import{a as r}from"./sentry-Dy6CjI9o.js";import{a5 as l,a6 as p,a7 as m,r as c}from"./index-BxpV0MpM.js";import"./mui-BPWJk-fl.js";import f from"./NotFoundScreen-B314Xa6t.js";import{h as u,g as b}from"./core-DXwLSsqn.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]="5a21547d-8d37-447e-91de-3190153d226c",e._sentryDebugIdIdentifier="sentry-dbid-5a21547d-8d37-447e-91de-3190153d226c")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=c(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:m(o),onDemoClick:t,onGoBack:d}):s.jsx(f,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -0,0 +1 @@
1
+ import{a as r}from"./sentry-Dy6CjI9o.js";import{u as f,h as l,g as m}from"./core-DXwLSsqn.js";import{hs as p,Mh as g,Mi as b}from"./zeni-epic-state-Cehmp_zm.js";import{u as _,L as h,z as y}from"./index-BxpV0MpM.js";import"./liveblocks-DIKy4lot.js";import"./recharts-BKU02zoL.js";import"./mui-BPWJk-fl.js";import"./analytics-Ci054ctJ.js";import"./plaid-CgXOv8Rh.js";import"./dnd-BFL9IlQe.js";import"./stripe-DMRn4zHo.js";import"./lottie-DAe41SWX.js";import"./lexical-t8hl9adA.js";import"./pdf-CG1NUThf.js";import"./utils-BfVxqb_k.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="723db24f-bab0-4eaf-a2c1-69fc41d32033",e._sentryDebugIdIdentifier="sentry-dbid-723db24f-bab0-4eaf-a2c1-69fc41d32033")}catch{}})();function R(){const e=f(),n=l(),i=m(),{setLoading:o,clearAllLoading:u}=_(),s=r.useRef(!1);return r.useLayoutEffect(()=>{o(h.CONNECTION_AUTH)},[o]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(i.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-C2MSzkBq.js";import{i as S,n as g,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-mESSAfOQ.js";import{Mb as k,Mc as v,Md as M,Bf as B,B1 as T,Me as D,Mf as oe,Mg as ie,B5 as se,fA as $,Bc as le,B9 as re}from"./zeni-epic-state-60_rE4ne.js";import{K as x,o as r,k as de,d as j,j as G,m as ce,p as me,n as pe,v as K,C as ue,G as he,w as ge,x as xe,y as fe,A as be,B as we,D as Se,W as ye,E as ke,T as ve,F as je,J as $e}from"./index-BKEcQaqa.js";import{n as m}from"./mui-HfiFUvSH.js";import f from"./NotFoundScreen-C776OUyD.js";import{a as I}from"./sentry-CeqBlNHw.js";import"./recharts-BO9Ej9mf.js";import"./analytics-KG6ixMlm.js";import"./plaid-CYvf8Mhe.js";import"./dnd-CSfP84QM.js";import"./stripe-DMRn4zHo.js";import"./lottie-B4YQ42M8.js";import"./lexical-D2OXt6dk.js";import"./pdf-BP_s4vmv.js";import"./utils-Dk_ckawD.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]="f847bf08-56d2-474e-8574-28bb82e656b8",e._sentryDebugIdIdentifier="sentry-dbid-f847bf08-56d2-474e-8574-28bb82e656b8")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-DIKy4lot.js";import{i as S,n as x,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-DXwLSsqn.js";import{Ma as k,Mb as v,Mc as M,Be as B,B0 as T,Md as D,Me as oe,Mf as se,B4 as ie,fz as $,Bb as le,B8 as re}from"./zeni-epic-state-Cehmp_zm.js";import{K as g,o as r,p as de,d as j,k as G,q as ce,r as me,v as pe,s as H,C as ue,G as he,$ as xe,w as ge,y as fe,x as we,B as be,D as Se,m as ye,S as ke,E as ve,F as je,H as $e}from"./index-BxpV0MpM.js";import{n as m}from"./mui-BPWJk-fl.js";import f from"./NotFoundScreen-B314Xa6t.js";import{a as I}from"./sentry-Dy6CjI9o.js";import"./recharts-BKU02zoL.js";import"./analytics-Ci054ctJ.js";import"./plaid-CgXOv8Rh.js";import"./dnd-BFL9IlQe.js";import"./stripe-DMRn4zHo.js";import"./lottie-DAe41SWX.js";import"./lexical-t8hl9adA.js";import"./pdf-CG1NUThf.js";import"./utils-BfVxqb_k.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]="6afc7062-e224-46f0-8e9f-0a8e126c8edb",e._sentryDebugIdIdentifier="sentry-dbid-6afc7062-e224-46f0-8e9f-0a8e126c8edb")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -7,7 +7,7 @@ import{j as t}from"./liveblocks-C2MSzkBq.js";import{i as S,n as g,h as C,g as y,
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
9
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
- `,Ce=g(function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(M({data:l}))}}})(de);function F(){const e=x(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const Be=m.div`
10
+ `,Ce=x(function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(M({data:l}))}}})(de);function F(){const e=g(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const Be=m.div`
11
11
  display: flex;
12
12
  height: 100vh;
13
13
  width: 100%;
@@ -16,7 +16,7 @@ import{j as t}from"./liveblocks-C2MSzkBq.js";import{i as S,n as g,h as C,g as y,
16
16
  align-items: center;
17
17
  background-color: ${e=>e.theme.colors.grey4};
18
18
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
19
- `,De=g(function(e,a){const{isSubPage:n}=a;return{addressToEdit:D(e),googleAPIKey:G.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,i=()=>{const l=me(o.state?.pathnameStackToGoBack),s=l.poppedPathname??Pe();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=ze(l);e(oe({addressToCreate:s})),i()},onCancel:()=>{i()}}})(ce);function Ae({isSubPage:e}){const a=C(),n=y(),o=x();return t.jsx(t.Fragment,{children:t.jsx(Be,{windowSize:o,children:t.jsx(De,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:G.googleMapsAPIKey})})})}const Pe=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},ze=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
19
+ `,De=x(function(e,a){const{isSubPage:n}=a;return{addressToEdit:D(e),googleAPIKey:G.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Pe();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=ze(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}})(ce);function Ae({isSubPage:e}){const a=C(),n=y(),o=g();return t.jsx(t.Fragment,{children:t.jsx(Be,{windowSize:o,children:t.jsx(De,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:G.googleMapsAPIKey})})})}const Pe=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},ze=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
20
20
  display: flex;
21
21
  height: 100%;
22
22
  width: 100%;
@@ -25,7 +25,7 @@ import{j as t}from"./liveblocks-C2MSzkBq.js";import{i as S,n as g,h as C,g as y,
25
25
  align-items: center;
26
26
  background-color: ${e=>e.theme.colors.grey4};
27
27
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
- `,Ne=g(function(e){const a=k(e),n=v(e),o=D(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(M({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=K(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),a=y(),n=x(),{vendorId:o,billId:i}=S();return o==null||i==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Le,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:i})})})}const Fe=m.div`
28
+ `,Ne=x(function(e){const a=k(e),n=v(e),o=D(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(M({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Le,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
29
29
  display: flex;
30
30
  height: 100%;
31
31
  width: 100%;
@@ -34,7 +34,7 @@ import{j as t}from"./liveblocks-C2MSzkBq.js";import{i as S,n as g,h as C,g as y,
34
34
  align-items: center;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
36
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
- `,Me=g(function(e){const a=k(e),n=v(e),o=D(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankNameBySwift:s=>{e(se(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(s,"international",i,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(ie({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=K(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(ge);function Te(){const e=C(),a=y(),n=x(),{vendorId:o,billId:i}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:s}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Me,{location:a,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Ge={containerWidth:new je(100,58)},Ke=m(ke)`
37
+ `,Me=x(function(e){const a=k(e),n=v(e),o=D(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"international",s,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:d}=i;e(se({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(xe);function Te(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Me,{location:a,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Ge={containerWidth:new je(100,58)},He=m(ke)`
38
38
  width: ${r.sp4};
39
39
  height: ${r.sp4};
40
40
  margin-bottom: ${r.sp3};
@@ -43,14 +43,14 @@ import{j as t}from"./liveblocks-C2MSzkBq.js";import{i as S,n as g,h as C,g as y,
43
43
  cursor: pointer;
44
44
  position: absolute;
45
45
  color: ${e=>e.theme.colors.brandColorJade};
46
- `,Ve=m.div`
46
+ `,Ke=m.div`
47
47
  display: flex;
48
48
  height: 100vh;
49
49
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
50
  width: 100vw;
51
51
  overflow-y: scroll;
52
52
  background-color: ${e=>e.theme.colors.grey4};
53
- `,We=m.div`
53
+ `,Ve=m.div`
54
54
  display: flex;
55
55
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
56
  flex-direction: column;
@@ -58,7 +58,7 @@ import{j as t}from"./liveblocks-C2MSzkBq.js";import{i as S,n as g,h as C,g as y,
58
58
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
59
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
60
  padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
- `,He=m.div`
61
+ `,_e=m.div`
62
62
  display: flex;
63
63
  flex-direction: column;
64
64
  align-items: center;
@@ -69,4 +69,4 @@ import{j as t}from"./liveblocks-C2MSzkBq.js";import{i as S,n as g,h as C,g as y,
69
69
  width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
70
  background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
71
  margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
- `,_e=g(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=S(),[s]=te(),d=s.get("token"),V=n.pathname.includes("address"),b=x(),W=xe(),A=fe(),w=be(),H=()=>{W.toggle()},_=E(u=>k(u)),U=E(u=>v(u)),{authParams:J,fetchState:c,billAttachment:q,billFetchState:P,companyName:O,currencySymbol:Q,amount:R}=_,{tenantId:z,userId:L,sessionId:N}=J,{fetchState:X,internationalBankAccountCreateStatus:Y}=U;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{w&&c==="Not-Started"&&i!=null&&o!=null&&d!=null&&a(le(i,o,d))},[w,c,i,o,d,a]),I.useEffect(()=>{w&&c==="Completed"&&($(L,N,z),l!=null&&a(re(l)))},[c,w,L,N,z,l,a]),c==="Error"?t.jsx(f,{}):X==="Completed"||Y.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(we,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${A.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&P==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",i??"",O,l??"",Ue(n.pathname),Q,R))(u)}),t.jsxs(Ve,{windowSize:b,children:[b!=="small"?t.jsx(Ke,{onClick:H}):null,t.jsx(He,{windowSize:b,isAddressPage:V,children:P==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(_e,{file:q,type:"bill"})}),t.jsx(We,{windowSize:b,children:e})]})]})}const Ue=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Je(){return t.jsx($e,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(Je,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(Ae,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Te,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
72
+ `,We=x(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=te(),d=i.get("token"),K=n.pathname.includes("address"),w=g(),V=ge(),A=fe(),b=we(),_=()=>{V.toggle()},W=E(u=>k(u)),U=E(u=>v(u)),{authParams:q,fetchState:c,billAttachment:J,billFetchState:P,companyName:O,currencySymbol:Q,amount:R}=W,{tenantId:z,userId:L,sessionId:N}=q,{fetchState:X,internationalBankAccountCreateStatus:Y}=U;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&a(le(s,o,d))},[b,c,s,o,d,a]),I.useEffect(()=>{b&&c==="Completed"&&($(L,N,z),l!=null&&a(re(l)))},[c,b,L,N,z,l,a]),c==="Error"?t.jsx(f,{}):X==="Completed"||Y.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${A.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&P==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",s??"",O,l??"",Ue(n.pathname),Q,R))(u)}),t.jsxs(Ke,{windowSize:w,children:[w!=="small"?t.jsx(He,{onClick:_}):null,t.jsx(_e,{windowSize:w,isAddressPage:K,children:P==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(We,{file:J,type:"bill"})}),t.jsx(Ve,{windowSize:w,children:e})]})]})}const Ue=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function qe(){return t.jsx($e,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(qe,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(Ae,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Te,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
@@ -0,0 +1,12 @@
1
+ import{j as f}from"./liveblocks-DIKy4lot.js";import{a as u}from"./sentry-Dy6CjI9o.js";import{u as F,g as O,h as _,t as w,j as l,N as z}from"./core-DXwLSsqn.js";import{z as r,y as P,a as V,e as A,d as N,f as W,n as $,m as R,h as X}from"./index-BxpV0MpM.js";import{eW as Y,LX as Z,M5 as q,LY as B,fz as G,f$ as H,M1 as J,gn as K,cZ as Q,M6 as ee,M7 as te}from"./zeni-epic-state-Cehmp_zm.js";import{n as ne}from"./mui-BPWJk-fl.js";import{u as ae}from"./useDeviceId-k_nSwj7f.js";import{f as se}from"./analyticsHelper-0Z_ii5dt.js";import{t as ie}from"./getLocaleForTenant-YGwofgWv.js";import"./recharts-BKU02zoL.js";import"./analytics-Ci054ctJ.js";import"./plaid-CgXOv8Rh.js";import"./dnd-BFL9IlQe.js";import"./stripe-DMRn4zHo.js";import"./lottie-DAe41SWX.js";import"./lexical-t8hl9adA.js";import"./pdf-CG1NUThf.js";import"./utils-BfVxqb_k.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="ee2c722f-8fc7-4a9f-ab68-f41d3a1deaf5",t._sentryDebugIdIdentifier="sentry-dbid-ee2c722f-8fc7-4a9f-ab68-f41d3a1deaf5")}catch{}})();const T=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function Te(){const t=F(),s=O(),m=_(),[k]=w(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),h=l(e=>e.tenantState.signInState),I=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>Y(e)),y=l(e=>Z(e)),E=r.getSignedInUser(),v=P().mode;u.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&T(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(q(n,i,g)))},[n,p,t,i,g,a?.zeniSessionId]),u.useEffect(()=>{h!=="In-Progress"||S!=="Completed"&&b!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(B(y.tenantsInOrder),a.zeniSessionId),G(a.userId,a.zeniSessionId,o.tenantId),t(H(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(J("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,v,void 0,y.tenantsInOrder),K().then(()=>{const e=X();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(W.Event.loginSuccess,"email",Q(o.productSettings))},2e3))},[h,S,b,a,o,y,v,s.state,t]);const M=u.useCallback(()=>{m("/signin/auth")},[m]),U=u.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),j=u.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(I==="Completed"&&d!=null)return f.jsx($,{phoneNumber:x,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:U,onVerifyOtp:j,onCancelVerifyDevice:M});if(h==="In-Progress"&&S==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return f.jsx(z,{to:e,state:{...s.state,origin:""}})}if(!T(n,p)||g==null||I==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return f.jsx(z,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&a?.zeniSessionId==null)}})}return f.jsx(oe,{"data-testid":"smooth-loader",children:f.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{Te as default};
@@ -0,0 +1 @@
1
+ import{j as V}from"./liveblocks-DIKy4lot.js";import{a as c}from"./sentry-Dy6CjI9o.js";import{u as fe,j as n,i as We,g as Ye,h as qe,l as M}from"./core-DXwLSsqn.js";import{eW as me,fE as Je,fF as pe,fq as Qe,bn as Ke,eV as Xe,fG as ea,fH as aa,fJ as ta,fM as na,fN as g,fP as sa,fQ as de,fT as oa,fR as ia,fS as ra,fU as da,cP as la,fW as ca,cV as ua,fp as fa,f$ as ma,g0 as pa,f_ as ba}from"./zeni-epic-state-Cehmp_zm.js";import{a9 as ha,aa as Sa,w as ga,C as Ea,z as k,x as ka,u as Ca,G as r,i as ya,A as Ia,ab as Ta,I as _a,c as wa,ac as Aa,a5 as Fa,ad as Da,ae as va,af as le,ag as ce,L as $a,ah as Ga,ai as ue,d as x,a1 as Pa,s as _,aj as R,ak as Ma}from"./index-BxpV0MpM.js";import{D as xa}from"./mui-BPWJk-fl.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="41205883-e4c7-45a1-b4e8-bd35e4bdf852",f._sentryDebugIdIdentifier="sentry-dbid-41205883-e4c7-45a1-b4e8-bd35e4bdf852")}catch{}})();const Ra=ha(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=Ye(),C=ga(),o=qe(),N=Qe(),m=fe(),{useFeatureGate:i}=Ea(),B=k.getSignedInUser(),U=Ke(B),s=n(e=>me(e)),be=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n(e=>Xe(e)),j=O.uiState.currentChatSessionId,y=ka(),{setLoading:he}=Ca(),[w,L]=c.useState(void 0),A=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,Se=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Ee=ya(s,ge,Z),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),H=n(e=>ea(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),F=n(e=>aa(e));c.useEffect(()=>{y&&T&&!I&&F.fetchState==="Not-Started"&&m(ta(!0))},[y,T,F.fetchState,I]);const h=k.getSignedInUser(),D=n(e=>e.tenantState),Ce=n(e=>D.fetchState==="Completed"?na(e):[]),E=n(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:_e}=i(r.isExpenseAutomationEnabledV2),W=Ia(),{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),v=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=U||!U&&ve,Ge=n(e=>g(e).totalUnreadCount),Pe=n(e=>g(e).reducedFetchCountState),Y=n(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),q=n(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Me=n(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),$=n(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:J,isLoading:Q,isFetchingMore:K,hasFetchedAll:X,fetchMore:xe}=Ta();c.useEffect(()=>{const e=setTimeout(()=>xe?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(Q===!1&&K===!1&&X===!0)if(s?.companyId!=null&&J!=null){const e=`dashboard_${s.companyId}`;L(J.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[Q,K,X]),c.useEffect(()=>{y&&!I&&Me.fetchState==="Not-Started"&&N.tenantId!=null&&m(sa("task_manager","dashboard"))},[y,N.tenantId]),c.useEffect(()=>{I||$.fetchState!=="Not-Started"||m(de({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{w!=null&&$.fetchState==="In-Progress"&&(m(de({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:w},"comments")))},[w,$.fetchState]);const Re={fetchStatus:Pe,count:Ge},ee=t!=null?k.getSignedInUserTenant(t):null,ae=n(e=>ee?.tenantId!=null?oa(e,ee.tenantId):void 0),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),S.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&S.push("rewards_card"),W===!1&&S.push("expense_automation_card");const Ve=_a(),te=n(e=>ia(e,S,h,_e,Te).fetchState),ne=n(e=>ra(e).fetchState),Ne=A&&(te==="Completed"||te==="Error")||z&&(ne==="Completed"||ne==="Error")||!A&&!z?void 0:"disabled",Be=c.useMemo(()=>da(s.userRole),[s.userRole]),Ue=la(Be),Oe=s?.rewardsLastViewedTime==null,je=h?.userEmail!=null&&H.fetchState==="Completed"&&ca(H.notificationSettings,h.userEmail,Z,s),se=wa(),Le=se&&Aa(a),oe=ua(Ve?.loggedInUserRoleMap),ie=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>v&&oe&&!k.getTreasuryPopupSeen(t??"")&&ie===!1&&Fa(a.pathname)!=="treasury",[v,oe,ie,a.pathname,t]),[ze,re]=c.useState(G);c.useEffect(()=>{re(G())},[G]);const Ze=n(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,He=Da(Ze);return V.jsx(xa,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(va,{signedInUser:B,currentTenantId:D.currentTenantId??"",tenants:D.fetchState==="Completed"?Ce:ae!=null?[ae]:[],currentTenant:s,isTenantDropdownDisabled:Ne,isSettings:ce(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Ue,isZeniAccountEnabled:Se,isChargeCardEnabled:Ee,isTreasuryEnabled:v,treasuryYieldPercentage:He,isTreasuryPopupVisible:ze,isNotificationsTabVisible:je,notificationCountDetails:Re,isExpenseAutomationEnabledForUser:W,selectedMenu:le(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:F.rewardsPlan},isAiCfoAccessEnabled:se,onNotificationIconClick:()=>{d(!1);let e=Y===0&&q>0?"notifications/comments":"notifications/tasks";ce(a)&&(e=Y===0&&q>0?"../../notifications/comments":"../../notifications/tasks");const u=_(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(x.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!be)return void Pa({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const b=_(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar"}})}const u=_(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,p=R(l)&&l!=="command_center";if(R(e.type)&&E[s.tenantId]!=null&&x.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),p&&E[s.tenantId]!=null){const b=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${b.month}-${b.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Ma(e.type);ue(e.type)?(j!=null&&m(ba()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{he($a.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=le(a);let p=`/${encodeURIComponent(u)}/`;const P=R(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":Ga(l)?p+="settings/my_profile":ue(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(m(ma(e.tenantId)),m(pa(h.userId,e.tenantId,h.zeniSessionId)));const b=e;x.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),re(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Le,aiCfoView:O,isOnDashboard:A,updateCurrentChatSessionId:e=>{m(fa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),La=f=>{const d=fe(),t=n(C=>me(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Sa(o)&&Je(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ra,{...f,...a})};export{La as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-DIKy4lot.js";import{h as r,n}from"./core-DXwLSsqn.js";import{Q as i}from"./index-BxpV0MpM.js";import"./mui-BPWJk-fl.js";import"./sentry-Dy6CjI9o.js";import"./zeni-epic-state-Cehmp_zm.js";import"./recharts-BKU02zoL.js";import"./analytics-Ci054ctJ.js";import"./plaid-CgXOv8Rh.js";import"./dnd-BFL9IlQe.js";import"./stripe-DMRn4zHo.js";import"./lottie-DAe41SWX.js";import"./lexical-t8hl9adA.js";import"./pdf-CG1NUThf.js";import"./utils-BfVxqb_k.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="e552295f-ad8f-4911-819f-e7382b348622",o._sentryDebugIdIdentifier="sentry-dbid-e552295f-ad8f-4911-819f-e7382b348622")}catch{}})();const f=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=r();return e.jsx(f,{navigate:o})}export{_ as default};
@@ -0,0 +1 @@
1
+ import{l as ct,a as dt,m as mt,j as A}from"./liveblocks-DIKy4lot.js";import lt from"./NotFoundScreen-B314Xa6t.js";import{a as k}from"./sentry-Dy6CjI9o.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as Z}from"./core-DXwLSsqn.js";import{cw as St,fG as H,eW as Q,fU as bt,fN as b,SV as J,fQ as m,fF as y,sn as M,xW as It,SW as Ct,fE as Tt,fW as yt,ss as Et,SX as F,bo as $,fy as x,sw as q,SY as _t,cI as At,cB as Nt}from"./zeni-epic-state-Cehmp_zm.js";import{Z as Bt,z as wt,C as xt,G as Gt,a0 as Rt,cW as Ut,s as N,a9 as Dt,cX as vt,aa as Pt,r as Ft}from"./index-BxpV0MpM.js";import"./mui-BPWJk-fl.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-CaQ8KV1j.js";import"./recharts-BKU02zoL.js";import"./analytics-Ci054ctJ.js";import"./plaid-CgXOv8Rh.js";import"./dnd-BFL9IlQe.js";import"./stripe-DMRn4zHo.js";import"./lottie-DAe41SWX.js";import"./lexical-t8hl9adA.js";import"./pdf-CG1NUThf.js";import"./utils-BfVxqb_k.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="eddb4b1d-80c5-45b9-9061-76fb0f108d66",t._sentryDebugIdIdentifier="sentry-dbid-eddb4b1d-80c5-45b9-9061-76fb0f108d66")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=H(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Q(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:G}=l;return{onNotificationClick:(a,o,d,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}d==="unread"&&t(q("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,d)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){d==="unread"&&(B(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!At(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(m(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(J(a,o));const d=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(d,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(_t(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const d=[];o==="all"?d.push("read","unread"):o!=="mentions"&&d.push(o),t(M("task_manager","dashboard",d))}else G?.()},onUpdateNotificationStatus:(a,o,d,c)=>{a==="tasks"?t(q("task_manager",d,c)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{d==="read"&&(B(r),t(F([r],$())))})).then(()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(Et("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then(()=>{t(F(s,$())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(m({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Dt(vt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,G]=k.useState(!1),a=S(e=>H(e)),o=S(e=>Q(e)),{useFeatureGate:d}=xt(),{isFeatureEnabled:c}=d(Gt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const K=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),O=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Ut().allUsers,{inboxNotifications:w,isLoading:E,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:W,isLoading:X,fetchMore:z,isFetchingMore:L,hasFetchedAll:Y}=dt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(J(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{O.fetchState==="Not-Started"&&s(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(E===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[E,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const v=E||D===!0||C!==!0||E||D===!0||C!==!0;k.useEffect(()=>{v&&U!=="In-Progress"?s(m({fetchState:"In-Progress",error:void 0},"comments")):v||U!=="In-Progress"||s(m({fetchState:"Completed",error:void 0},"comments"))},[v,U]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(G(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(E===!1&&X===!1&&w!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),_=p.map(f=>f.id),it=p.map(f=>{const P=W.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(L||Y===!0||z==null||z(),null)}).filter(f=>f!=null);s(m({allNotificationsIds:_},"comments")),s(y({totalCount:_.length,unreadCount:T.length},"comments")),s(Ct(it))}},[E,D,L,C,Y,X,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const _=[];R==="all"?_.push("read","unread"):R!=="mentions"&&_.push(R),s(M("task_manager",T,_,!0))}}}},nt=mt();return A.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:K,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return A.jsxs(gt,{children:[A.jsx(Z,{path:"/:selectedTab",element:A.jsx(Vt,{})}),A.jsx(Z,{path:"*",element:A.jsx(lt,{})})]})}export{ne as default};
@@ -0,0 +1 @@
1
+ import{j as m}from"./liveblocks-DIKy4lot.js";import{a as r}from"./sentry-Dy6CjI9o.js";import{u as T,g as A,j as o,N as j}from"./core-DXwLSsqn.js";import{Mk as C,eW as P,fM as x,Ml as z,Mm as D,Mn as L,Mo as R,o8 as k,Lh as N}from"./zeni-epic-state-Cehmp_zm.js";import{z as h,M as I}from"./index-BxpV0MpM.js";import"./mui-BPWJk-fl.js";import"./recharts-BKU02zoL.js";import"./analytics-Ci054ctJ.js";import"./plaid-CgXOv8Rh.js";import"./dnd-BFL9IlQe.js";import"./stripe-DMRn4zHo.js";import"./lottie-DAe41SWX.js";import"./lexical-t8hl9adA.js";import"./pdf-CG1NUThf.js";import"./utils-BfVxqb_k.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="86a68f55-b8c8-4713-98d3-19fb5b5da082",n._sentryDebugIdIdentifier="sentry-dbid-86a68f55-b8c8-4713-98d3-19fb5b5da082")}catch{}})();function ee(){const n=T(),s=A(),{params:t,error:i}=r.useMemo(()=>C(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),b=o(z),y=o(D),u=o(L),[v,S]=r.useState(null),[E,M]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[f,a,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const _=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(U=>U.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),c=v??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&a!=null&&c!=null&&n(N(a.userId,a.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{M("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-DIKy4lot.js";import{h as V,u as z,g as H,i as J,j as d,n as K,o as Q,p as I}from"./core-DXwLSsqn.js";import{eW as O,sb as M,rL as X,MR as U,rG as T,bs as ee,bn as ae,bZ as te,rH as se,MS as oe,ME as C,dI as re,vT as ne,MT as ie,we as ce,fD as le,fB as de}from"./zeni-epic-state-Cehmp_zm.js";import{z as me,Z as fe,a0 as pe,I as ue,C as v,G as $,D as he,d as w,ap as ge,s as Fe}from"./index-BxpV0MpM.js";import"./mui-BPWJk-fl.js";import be from"./NotFoundScreen-B314Xa6t.js";import{F as Ie}from"./FeaturePreviewScreen-BPUW_5KC.js";import{a as g}from"./sentry-Dy6CjI9o.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-CaQ8KV1j.js";import{u as Te}from"./useInitialThreadRequest-BNKJrNID.js";import{t as Se}from"./routePaths-BZ65TmUh.js";import{M as ye}from"./MobileAppDrawer-DUA8Lay7.js";import"./recharts-BKU02zoL.js";import"./analytics-Ci054ctJ.js";import"./plaid-CgXOv8Rh.js";import"./dnd-BFL9IlQe.js";import"./stripe-DMRn4zHo.js";import"./lottie-DAe41SWX.js";import"./lexical-t8hl9adA.js";import"./pdf-CG1NUThf.js";import"./utils-BfVxqb_k.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="f4ef9c3e-411d-4703-adeb-c0d1ea56fd42",s._sentryDebugIdIdentifier="sentry-dbid-f4ef9c3e-411d-4703-adeb-c0d1ea56fd42")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},De=K(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(U(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(ge);function P(){const s=V(),e=z(),a=H(),{forecastId:o,tenantEmailDomain:r}=J(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>O(t)),B=y.company?.companyInfo.firstMonthOfFY??1,c=d(t=>M(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),D=d(t=>t.profitAndLossState),k=d(t=>t.reportUIOptionsState.selectedForecast),A=t=>D.pandLByForecastID[t]!=null&&se(t,D).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:q}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,j,R)=>j!=null?f.forecasts.findIndex(b=>b.id===j):R!=null?f.forecasts.findIndex(b=>b.id===R):f.forecasts.length>0?0:-1)(c,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(U(c.forecasts[t].id,t)),S(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!A(c.forecasts[t].id)&&F&&e(T(c.forecasts[t].id))}},[i,p,e,l,c,m,u,M,T,F]);const x=ue(),N=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:W}=v(),{isFeatureEnabled:E}=W($.isReportsCommentingEnabled),_=Te(E?y?.companyId:void 0,{clearParams:l&&m}),[Y,Z]=g.useState(!1),L=t=>{Z(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:Y,handleDrawerToggle:L}),n.jsx(De,{firstMonthOfFY:B,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:A,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:N,isAiCfoAccessEnabled:G,onAskAiCfoClick:q,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:_,onClickMenuIcon:()=>{L(!0)}})]})}function Ze(){const s=d(i=>O(i)),{useFeatureGate:e}=v(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ze as PandLWithForecastRoutes,Ze as default};
@@ -0,0 +1,22 @@
1
+ import{j as a}from"./liveblocks-DIKy4lot.js";import{MN as ne,eW as X,kw as z,fD as Y,fB as oe,Kf as q,Mr as ie,uQ as ke,MO as N,uF as Pe,u_ as Ee,uU as re,uJ as le,uY as je,uV as ve,MP as de,wF as Le,fn as Te,gd as Fe,MQ as _,uN as ce,uM as pe,v1 as Ae,c7 as Oe}from"./zeni-epic-state-Cehmp_zm.js";import{K as ue,C as ee,G as H,z as G,i as me,W as ge,J as fe,al as he,am as Re,F as Ce,o as R,Y as be,a as ye,an as Ve,Z as Ze,a0 as Be,D as Ue,d as Se,f as $e,s as Me,ao as _e,I as He}from"./index-BxpV0MpM.js";import{D as we,n as J,S as De}from"./mui-BPWJk-fl.js";import se from"./NotFoundScreen-B314Xa6t.js";import{a as d}from"./sentry-Dy6CjI9o.js";import{u as ae,i as Ke,j as g,h as We,g as ze,n as Ge,o as te,p as M}from"./core-DXwLSsqn.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-CaQ8KV1j.js";import{M as Qe}from"./MobileAppDrawer-DUA8Lay7.js";import"./recharts-BKU02zoL.js";import"./analytics-Ci054ctJ.js";import"./plaid-CgXOv8Rh.js";import"./dnd-BFL9IlQe.js";import"./stripe-DMRn4zHo.js";import"./lottie-DAe41SWX.js";import"./lexical-t8hl9adA.js";import"./pdf-CG1NUThf.js";import"./utils-BfVxqb_k.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]="607b7156-ed63-4be3-883b-1990adc15e2e",e._sentryDebugIdIdentifier="sentry-dbid-607b7156-ed63-4be3-883b-1990adc15e2e")}catch{}})();const Ne={overlayWidth:new Ce(100,100,48)},K=ye.getLocalizedStrings().peoplePage.invitePage,Xe=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=ue(),m=ae(),[V,Z]=d.useState(!1),[k,S]=d.useState(!1),{userId:w}=Ke(),r=g(l=>ne(l)),p=g(l=>X(l)),P=g(l=>z(l)),{useFeatureGate:x}=ee(),{isFeatureEnabled:I}=x(H.isDebitCardFeatureEnabled),E=Y(I,p),L=oe(p),T=q(p),B=ie(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,D=!E&&P&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(N()),y()},F=()=>{V===!0?S(!0):C()},$=c.companyView?.controllers?.map(l=>l.user),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(H.isChargeCardFeatureEnabled),v=me(p,j,I),{isCardsHidden:A}=ge(p?.tenantId),b=!v||A,O=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:P,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:O===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:E,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:l=>{m(le(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(re({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?Pe(e):Ee(T))},onCloseClick:F,isLoading:D||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return d.useEffect(()=>{D===!1&&w!=null&&m(ke(w))},[D,w]),d.useEffect(()=>{r.updatePersonState.fetchState==="Completed"&&C()},[r.updatePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:F,children:a.jsxs(Ye,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(he,{titleComponent:a.jsx(xe,{children:K.discardTitle}),descriptionComponent:a.jsx(Ie,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:o,isEditPopup:!0}):null,a.jsx(Re,{...s})]})})},Ye=J(De)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,xe=J(be.H6Regular)`
6
+ margin-top: ${R.sp7};
7
+ padding-left: ${R.sp8};
8
+ padding-right: ${R.sp8};
9
+ color: ${e=>e.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,Ie=J(be.LargeRegularSp)`
12
+ color: ${e=>e.theme.colors.hero};
13
+ padding-left: ${R.sp8};
14
+ padding-right: ${R.sp8};
15
+ margin-bottom: 30px;
16
+ margin-top: ${R.sp4};
17
+ white-space: pre-line;
18
+ `,qe={overlayWidth:new Ce(100,100,48)},W=ye.getLocalizedStrings().peoplePage.invitePage,ea=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=ue(),m=ae(),[V,Z]=d.useState(!1),[k,S]=d.useState(!1),w=g(o=>ne(o)),r=g(o=>X(o)),p=g(o=>z(o)),{useFeatureGate:P}=ee(),{isFeatureEnabled:x}=P(H.isDebitCardFeatureEnabled),I=Y(x,r),E=oe(r),L=q(r),T=ie(r),B=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const D=()=>{y(),m(N())},C=()=>{V===!0?S(!0):D()},F={onOkClick:()=>{S(!1),D()},onCancelClick:()=>{S(!1)}},$=c.companyView?.controllers.map(o=>o.user),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=P(H.isChargeCardFeatureEnabled),v=me(r,j,x),{isCardsHidden:A}=ge(r?.tenantId),b=!v||A,O=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:L,onPeopleLocalDataUpdated:o=>{m(re({peopleLocalData:o})),Z(!0)},onResetClick:D,onSaveClick:()=>{m(f==="zeni_only"?je(e):ve())},onCloseClick:C,peopleDetails:w,isAccountingClassesEnabled:p,isReimbursementDisabled:B===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:O===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:E,isLoading:U};return d.useEffect(()=>{w.invitePersonState.fetchState==="Completed"&&(y(),m(N()))},[w.invitePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(aa,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(he,{titleComponent:a.jsx(xe,{children:W.discardTitle}),descriptionComponent:a.jsx(Ie,{children:W.discardDescription}),primaryButtonText:W.discard,secondaryButtonText:W.no,action:F}):null,a.jsx(Ve,{...s})]})})},aa=J(De)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,sa=Ge(function(e,t){const c=de(e),n=G.getSignedInUser();return{data:c,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:z(e),analytics:Se}},function(e,t){const{navigate:c,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,y)=>{e(le(i,y))},onResendInvite:i=>{e(Ae(i))},onReloadPeople:()=>{e(ce()),e(pe(n,f))},onBackClick:()=>{c("../../")},onModeChange:i=>{e(_({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(_({searchText:i}))}}}})(_e);function Q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const c=We(),n=ae(),f=ze(),{areTenantIdsInSync:i}=Ze(),y=G.getSignedInUser(),h=g(s=>X(s)),{useFeatureGate:m}=ee(),{isFeatureEnabled:V}=m(H.isDebitCardFeatureEnabled),Z=g(s=>z(s)),k=!Y(V,h)&&Z,S=q(h),w=h?.tenantId,{tenantEmailDomain:r}=h,[p,P]=d.useState(!1),[x,I]=d.useState(!1),[E,L]=d.useState(!1),[T,B]=d.useState("off"),[U,D]=d.useState(!1),C=s=>{D(s)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:$}=Je({mobileExploreReferrer:"People"}),u=g(s=>de(s));Be({isDataReady:u.fetchState==="Completed"});const j=g(s=>Le(s.classState,s.classListState)),v=g(s=>Te(s.userState,s.userRoleState,s.userListViewState,"manager")),A=g(s=>Fe(s)),b=h?.companyId;d.useEffect(()=>{p&&T===u.uiState.mode||!i||(n(_({searchText:"",sortKey:"name",sortOrder:"ascending"})),B(u.uiState.mode),P(!0),n(ce()))},[p,y,w,n,u.uiState.mode,i]),d.useEffect(()=>{b!=null&&i&&n(pe(b,k))},[b,k,i]),d.useEffect(()=>{I(e!=null&&e===!0),L(t!=null&&t===!0&&t)},[e,t]),d.useEffect(()=>{n(_({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const O=()=>{I(!1),L(!1),c("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(Ue,{analytics:Se,onLoad:s=>s.trackPageLoaded($e.Event.members)}):null,x===!0?a.jsx(ea,{closeDrawerHandler:O,isInvitePeopleDrawerOpen:x,managersListView:v,companyPassportView:A,classListView:j,companyId:b,mode:u.uiState.mode}):null,E===!0?a.jsx(Xe,{closeDrawerHandler:O,isEditPeopleDrawerOpen:E,managersListView:v,companyPassportView:A,classListView:j,companyId:b,mode:u.uiState.mode}):null,a.jsx(Qe,{isAppContentDrawerOpen:U,handleDrawerToggle:C}),a.jsx(sa,{navigate:c,signedInUser:y,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:b,shouldFetchClasses:k,classList:j,managersView:v,peopleView:u,onInvitePeopleClick:()=>{c("./new")},onColumnSortConfigChanged:(s,o)=>{n(_({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=Me(f.state?.pathnameStackToGoBack,f.pathname);c(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:$})]})}function wa(){const e=He();return Oe(e?.loggedInUserRole??[])?a.jsxs(te,{children:[a.jsx(M,{path:"/",element:a.jsx(Q,{})}),a.jsx(M,{path:"new",element:a.jsx(Q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(M,{path:":userId/edit",element:a.jsx(Q,{isEditPeopleDrawerOpen:!0})}),a.jsx(M,{path:"*",element:a.jsx(se,{})})]}):a.jsx(te,{children:a.jsx(M,{path:"*",element:a.jsx(se,{})})})}export{wa as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-DIKy4lot.js";import E from"./NotFoundScreen-B314Xa6t.js";import{a as r}from"./sentry-Dy6CjI9o.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as z,o as O,p as b}from"./core-DXwLSsqn.js";import{eW as B,SZ as h,bq as F,bn as N,id as V,fy as q}from"./zeni-epic-state-Cehmp_zm.js";import{w as W,z as I,a0 as Y,cY as Z}from"./index-BxpV0MpM.js";import"./mui-BPWJk-fl.js";import{u as $}from"./useAskAiCfoHostNavButtonProps-CaQ8KV1j.js";import{M as G}from"./MobileAppDrawer-DUA8Lay7.js";import"./recharts-BKU02zoL.js";import"./analytics-Ci054ctJ.js";import"./plaid-CgXOv8Rh.js";import"./dnd-BFL9IlQe.js";import"./stripe-DMRn4zHo.js";import"./lottie-DAe41SWX.js";import"./lexical-t8hl9adA.js";import"./pdf-CG1NUThf.js";import"./utils-BfVxqb_k.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]="8024dfd7-6b80-4315-b5aa-c75b2bcb1134",e._sentryDebugIdIdentifier="sentry-dbid-8024dfd7-6b80-4315-b5aa-c75b2bcb1134")}catch{}})();const H=z(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(Z),J=()=>{const e=_(),t=v(),c=W(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>h(a)),{tenantEmailDomain:f}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[S,w]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,y=N(l),x=C||k||y,d=r.useCallback((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=$({mobileExploreReferrer:"Performance"});return Y({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(G,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(H,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${f}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(b,{path:"*",element:s.jsx(J,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-CeqBlNHw.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-Dy6CjI9o.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};