@zeniai/web-app-ui 5.1.66-dev → 5.1.66-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/assets/{AddressRoutes-DEXYkqV1.js → AddressRoutes-CokxYMz7.js} +1 -1
  2. package/dist/assets/{AddressScreen-D8kv1hF_.js → AddressScreen-CUjGRrDO.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-BrNLceCE.js → AiCfoScreen-Bj3wXYWo.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-CvKgF8Ok.js → BillPayApprovalRoutes-sQQt1ym6.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DYswIHAT.js → BillPayRoutes-Cz4MhUrc.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-YVk91Fzz.js → BusinessVerificationPageScreen-DoJw9h9m.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-BO5V838O.js → CardsAiCfoScreen-1cCrf6uj.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-BZOF502-.js → ChargeCardRoutes-n-hcaove.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-CPKfXmmb.js → CompanyPassportScreen-CA3eoZ2w.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-Cv-HiaYb.js → ConnectionAuthScreen-FQS_lTfA.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingAuthScreen-DdX8BaLn.js → CustomerOnboardingAuthScreen-CZybU74A.js} +1 -1
  12. package/dist/assets/{CustomerOnboardingRoutes-CKdlHWlk.js → CustomerOnboardingRoutes-Dh2ji4Ib.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-CopaUmWi.js → DashboardRoutes-DYh34QWe.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-eT4t7R06.js → DefaultTenantHome-W15wNhHv.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-Cbmuyang.js → DomesticWireDetailScreen-DIHmD-T9.js} +1 -1
  16. package/dist/assets/{DrawerScreen-CCxq1yzF.js → DrawerScreen-l4bgWPF0.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-DK7l7FnA.js → EntityDetailRoutes-D_4M1i6-.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-C3RWrFV-.js → ExpenseAutomationRoutes-D_tUJVpQ.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-BuXd4W0P.js → FeaturePreviewScreen-bdq3UTfq.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-D1enkInm.js → HubSpotOAuthCallbackScreen-BiptMZ2v.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-BSRFSffK.js → MagicLinkRoutes-D9L5ixx1.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-BSh1nXKM.js → MagicLinkSignInScreen-COSHfZPw.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-BIP1MEKX.js → MobileAppDrawer-Dun-P89d.js} +1 -1
  24. package/dist/assets/{NotFoundScreen-DY1Wwus4.js → NotFoundScreen-CJOPcpwO.js} +1 -1
  25. package/dist/assets/{NotificationRoutes-6rN7RQjW.js → NotificationRoutes-BsMblVx4.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-BqL6PD1E.js → OAuthConsentScreen-ChMO7Sn2.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-AcF3aqCk.js → PandLWithForecastRoutes-DtUWky96.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-DPUTbQp_.js → PeopleRoutes-Bqk8AEBI.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-Cn4Ovnir.js → PerformanceRoutes-Yjr-NhGS.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-BEQPddK1.js → QBOConnectionScreen-CEsTlTj_.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-CQycV-0F.js → ReferralListScreen-DM7LN1h1.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-Ch3sYOOh.js → ReimbursementApprovalRoutes-CvztO8p6.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BJZRYRum.js → ReimbursementApprovalRuleDetailScreen-Buh9WwCp.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-CgQPRNMh.js → ReimbursementRoutes-CPQJS69Z.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-CQztdl9E.js → ReportsRoutes-ByQCq-V7.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-B0jOOo8W.js → RewardsRoutes-DcexvwE7.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-D7kpFxVk.js → ScreenRoutes-Hfrkc2Mi.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-CdvEgvyN.js → SettingsRoutes-Dwjn6yiJ.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-Dh6d6vu-.js → SetupPagesScreen-Dnm5sccr.js} +1 -1
  40. package/dist/assets/{SignInScreen-FuVo71JP.js → SignInScreen-Ed4IpkrH.js} +1 -1
  41. package/dist/assets/{SignOutScreen-DJh4f2Aj.js → SignOutScreen-DqyDFgZP.js} +1 -1
  42. package/dist/assets/{TaskListScreen-CnT3FhwB.js → TaskListScreen-CpyZd3qR.js} +1 -1
  43. package/dist/assets/{TaskRoutes-BlDolQ3c.js → TaskRoutes-Dp2ngbX6.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-C2XNyTUH.js → TransactionDetailRoutes-Ci_NeqmW.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-Ch_kEoMB.js → TransactionDetailScreen-CsoYHiYS.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-CAZZrQj-.js → TransactionListRoutes-BEUFTqmF.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-BQCtQUx_.js → TreasuryRoutes-Cdxg8mbK.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-BGB3F2EZ.js → VendorsRoutes-Cq-Iy0rX.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-BSryCvdh.js → WiseConfirmationScreen-DuXEdOHj.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-D-szpn5h.js → ZeniAccountRoutes-CY5eCxJd.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-BORtLhU4.js → ZeniAccountStatementScreen-0gnO9ODP.js} +1 -1
  52. package/dist/assets/{analyticsHelper-BsiU5y2K.js → analyticsHelper-CsGwj-FA.js} +1 -1
  53. package/dist/assets/{getLocaleForTenant-DiFaMSxg.js → getLocaleForTenant-e8sE0WQV.js} +1 -1
  54. package/dist/assets/{index-CJknvk0s.js → index-BLRtUSpL.js} +5 -5
  55. package/dist/assets/{routePaths-jWP9zfXs.js → routePaths-DPA1vVZP.js} +1 -1
  56. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CgykUI65.js → useAiCfoDashboardSuggestedQuestionsChips-YJwtjlAT.js} +1 -1
  57. package/dist/assets/{useAskAiCfoHostNavButtonProps-BAtYgUWq.js → useAskAiCfoHostNavButtonProps-Cpb6UCmb.js} +1 -1
  58. package/dist/assets/{useCashManagementBanner-CRbG3Xtj.js → useCashManagementBanner-C3EqNZA6.js} +1 -1
  59. package/dist/assets/{useChargeCardPusherEvents-Dq1SGHUY.js → useChargeCardPusherEvents-uB8sjNP3.js} +1 -1
  60. package/dist/assets/{useEmailConnectResultRefresh-CiGW-Jar.js → useEmailConnectResultRefresh-CgBbGn6X.js} +1 -1
  61. package/dist/assets/{useInitialThreadRequest-DZr1J4rc.js → useInitialThreadRequest-DVPS_iNz.js} +1 -1
  62. package/dist/assets/{withTransactionSidePanel-DKnep6Xn.js → withTransactionSidePanel-CPTD79Uy.js} +1 -1
  63. package/dist/index.html +1 -1
  64. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-B5ZW-VBI.js";import{a as u}from"./sentry-BxWyF9h9.js";import{u as y,j as b,n as w,g as A,N as L}from"./core-Crl6eqZl.js";import{LS as U,eW as _,g1 as N,LT as k,o9 as R,LU as z}from"./zeni-epic-state-DTyrT1Ga.js";import{u as j,z as f,L as T,t as I,F as O,b as $}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import{t as P}from"./getLocaleForTenant-DiFaMSxg.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="70d7077f-b89c-4442-a748-f0d6084f45c2",t._sentryDebugIdIdentifier="sentry-dbid-70d7077f-b89c-4442-a748-f0d6084f45c2")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,x)=>l||i.split("/").find(D=>D===x)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const F=$(c,p);return v.jsx(L,{to:F,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>U(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(N(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!k(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-B5ZW-VBI.js";import{a as u}from"./sentry-BxWyF9h9.js";import{u as y,j as b,n as w,g as A,N as L}from"./core-Crl6eqZl.js";import{LS as U,eW as _,g1 as N,LT as k,o9 as R,LU as z}from"./zeni-epic-state-DTyrT1Ga.js";import{u as j,z as f,L as T,t as I,F as O,b as $}from"./index-BLRtUSpL.js";import"./mui-U77PQnc2.js";import{t as P}from"./getLocaleForTenant-e8sE0WQV.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="70d7077f-b89c-4442-a748-f0d6084f45c2",t._sentryDebugIdIdentifier="sentry-dbid-70d7077f-b89c-4442-a748-f0d6084f45c2")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,x)=>l||i.split("/").find(D=>D===x)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const F=$(c,p);return v.jsx(L,{to:F,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>U(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(N(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!k(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-B5ZW-VBI.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-Crl6eqZl.js";import{P$ as k,Q6 as W,gh as _,gg as q,gf as J,ju as K,N7 as L,rt as M,eW as V,Px as D,js as T,Q0 as S,Q9 as j,jq as F,jN as G}from"./zeni-epic-state-DTyrT1Ga.js";import{bz as X,j as N,W as R,z as U,m as z,r as p,Q as v,B as O,bA as Y,o as Q,bB as ee,s as te}from"./index-CJknvk0s.js";import{n as Z}from"./mui-U77PQnc2.js";import"./sentry-BxWyF9h9.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]="f7ffcc93-ff6f-4b92-8273-e88932c19f3a",e._sentryDebugIdIdentifier="sentry-dbid-f7ffcc93-ff6f-4b92-8273-e88932c19f3a")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(K(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(M(n))},onGetOtp:n=>{e(J(n,"BillPayVendor"))},onResendOtp:n=>{e(q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(_(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(W(n,a,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Z.div`
1
+ import{j as l}from"./liveblocks-B5ZW-VBI.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-Crl6eqZl.js";import{P$ as k,Q6 as W,gh as _,gg as q,gf as J,ju as K,N7 as L,rt as M,eW as V,Px as D,js as T,Q0 as S,Q9 as j,jq as F,jN as G}from"./zeni-epic-state-DTyrT1Ga.js";import{bz as X,j as N,W as R,z as U,m as z,r as p,Q as v,B as O,bA as Y,o as Q,bB as ee,s as te}from"./index-BLRtUSpL.js";import{n as Z}from"./mui-U77PQnc2.js";import"./sentry-BxWyF9h9.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]="f7ffcc93-ff6f-4b92-8273-e88932c19f3a",e._sentryDebugIdIdentifier="sentry-dbid-f7ffcc93-ff6f-4b92-8273-e88932c19f3a")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(K(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(M(n))},onGetOtp:n=>{e(J(n,"BillPayVendor"))},onResendOtp:n=>{e(q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(_(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(W(n,a,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Z.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as d}from"./liveblocks-B5ZW-VBI.js";import{j as l,x as c,m as f}from"./index-CJknvk0s.js";import{D as b}from"./mui-U77PQnc2.js";import"./sentry-BxWyF9h9.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]="a4b374ee-b6a1-4fb5-95c8-5fb37a48c336",e._sentryDebugIdIdentifier="sentry-dbid-a4b374ee-b6a1-4fb5-95c8-5fb37a48c336")}catch{}})();const p={drawerLeftMargin:new c(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=l(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),i=f();return d.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{m as D};
1
+ import{j as d}from"./liveblocks-B5ZW-VBI.js";import{j as l,x as c,m as f}from"./index-BLRtUSpL.js";import{D as b}from"./mui-U77PQnc2.js";import"./sentry-BxWyF9h9.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]="a4b374ee-b6a1-4fb5-95c8-5fb37a48c336",e._sentryDebugIdIdentifier="sentry-dbid-a4b374ee-b6a1-4fb5-95c8-5fb37a48c336")}catch{}})();const p={drawerLeftMargin:new c(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=l(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),i=f();return d.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{m as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-B5ZW-VBI.js";import{a as c}from"./sentry-BxWyF9h9.js";import{h as A,u as B,g as G,i as O,j as d,N as q,n as F,o as W,p as _}from"./core-Crl6eqZl.js";import{Of as z,eW as K,ND as M,lx as R,K8 as k,Ok as V,N6 as Y,kx as $,K9 as S,NI as J,NJ as H,N8 as L,N7 as Q}from"./zeni-epic-state-DTyrT1Ga.js";import{aV as U,c as X,r as Z,s as tt}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import{d as b}from"./decodeURIComponentSafe-DwYiSzjo.js";import{w as et}from"./withTransactionSidePanel-DKnep6Xn.js";import{f as at,c as nt}from"./routePaths-jWP9zfXs.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";import"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import"./TransactionDetailScreen-Ch_kEoMB.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]="69b1f18a-a42f-4c2c-ad6b-69fbc93bce7f",a._sentryDebugIdIdentifier="sentry-dbid-69b1f18a-a42f-4c2c-ad6b-69fbc93bce7f")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=V(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:$(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(J()),a(H()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{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 o=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:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=G(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:w}=O(),r=b(x??""),f=b(w??""),p=rt(r,f),N=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=d(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),j=d(n=>K(n).company?.companyInfo.firstMonthOfFY??1),u=d(n=>M(n.trendWithTransactionsState,i,"EntityDetail"));c.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(R(i)))},[m,p,i]);const E=d(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 c.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:j,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{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 xt({entityType:a}){return s.jsx(W,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
1
+ import{j as s}from"./liveblocks-B5ZW-VBI.js";import{a as c}from"./sentry-BxWyF9h9.js";import{h as A,u as B,g as G,i as O,j as d,N as q,n as F,o as W,p as _}from"./core-Crl6eqZl.js";import{Of as z,eW as K,ND as M,lx as R,K8 as k,Ok as V,N6 as Y,kx as $,K9 as S,NI as J,NJ as H,N8 as L,N7 as Q}from"./zeni-epic-state-DTyrT1Ga.js";import{aV as U,c as X,r as Z,s as tt}from"./index-BLRtUSpL.js";import"./mui-U77PQnc2.js";import{d as b}from"./decodeURIComponentSafe-DwYiSzjo.js";import{w as et}from"./withTransactionSidePanel-CPTD79Uy.js";import{f as at,c as nt}from"./routePaths-DPA1vVZP.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";import"./useAskAiCfoHostNavButtonProps-Cpb6UCmb.js";import"./TransactionDetailScreen-CsoYHiYS.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]="69b1f18a-a42f-4c2c-ad6b-69fbc93bce7f",a._sentryDebugIdIdentifier="sentry-dbid-69b1f18a-a42f-4c2c-ad6b-69fbc93bce7f")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=V(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:$(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(J()),a(H()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{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 o=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:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=G(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:w}=O(),r=b(x??""),f=b(w??""),p=rt(r,f),N=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=d(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),j=d(n=>K(n).company?.companyInfo.firstMonthOfFY??1),u=d(n=>M(n.trendWithTransactionsState,i,"EntityDetail"));c.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(R(i)))},[m,p,i]);const E=d(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 c.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:j,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{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 xt({entityType:a}){return s.jsx(W,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-B5ZW-VBI.js";import oa from"./NotFoundScreen-DY1Wwus4.js";import{a as o,b as Nt}from"./sentry-BxWyF9h9.js";import{n as Ue,S as sa}from"./mui-U77PQnc2.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-Crl6eqZl.js";import{eW as Re,S_ as la,oj as Ee,fY as ra,s4 as da,oB as Kt,oW as Zt,S$ as Qt,p4 as ua,T0 as Ht,ou as ma,rC as pa,fI as Ie,T1 as De,ub as Wt,Et as Xt,T2 as en,T3 as ha,ra as Ze,Og as Pt,Oi as ga,kA as Ca,Oj as Sa,kH as fa,cZ as Ia,vn as Qe,oH as tn,p9 as Fe,oz as de,T4 as Ea,N8 as Rt,N7 as we,T5 as Dt,kY as ka,T6 as Ta,T7 as ya,T8 as ba,T9 as va,oO as Aa,pc as xe,Ta as wa,Tb as xa,Tc as Pa,pj as Ra,kL as Da,kC as Fa,Td as Ua,kK as Ft,Oq as Ba,Te as Oa,Tf as Va,r6 as _a,qK as za,pa as me,qJ as Je,Tg as Ma,Th as ja,Ti as La,mf as $a,bo as qa,ma as Ut,lY as Ga,Tj as Ja,fy as Bt,gx as Na,m7 as Ya,xg as Ka,Tk as Za,pK as Qa,pF as Ha,pJ as Wa,pu as Xa,Tl as eo,fL as nn,oZ as to,oK as no,fZ as Ot,pe as ao,Tm as oo,Tn as so,pb as an,To as co,Tp as io,Tq as lo,Tr as ro,Ts as Vt,ri as uo,qB as mo,N6 as po,Tt as ho,Tu as go,kJ as Co,Tv as So,J9 as fo,kI as Io,kx as Eo,fK as ko,q7 as on,qt as To,p8 as _t,pd as yo,bE as bo,m4 as vo,m1 as Ao,Tw as wo,pt as zt,qp as Mt,qn as xo,Tx as Po,qc as Ro,pU as Do,qq as Fo,Ty as Uo,Tz as Bo,pY as Oo,TA as Vo,pP as _o,pX as zo,pV as Mo,qw as jo}from"./zeni-epic-state-DTyrT1Ga.js";import{W as sn,Q as X,c as q,s as ae,X as cn,Z as ln,cY as Lo,z as Be,cZ as $o,at as Pe,c_ as qo,aX as jt,B as rn,c$ as Go,aq as Ne,F as Jo,a7 as No,d0 as Yo,a2 as Ko,d1 as Zo,U as Qo,d2 as Ho,d3 as Wo,$ as Xo,I as es,aQ as ts,d4 as ns,d5 as as,bc as os,x as ss,aT as cs}from"./index-CJknvk0s.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-Ch_kEoMB.js";import{w as us}from"./withTransactionSidePanel-DKnep6Xn.js";import{h as ms,v as ps}from"./routePaths-jWP9zfXs.js";import{g as Ye}from"./accountMappingHelper-SrHoNEDL.js";import{D as hs}from"./DrawerScreen-CCxq1yzF.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";import"./decodeURIComponentSafe-DwYiSzjo.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]="5cacc6d9-b40a-46b1-aa73-118b011ba4f0",t._sentryDebugIdIdentifier="sentry-dbid-5cacc6d9-b40a-46b1-aa73-118b011ba4f0")}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"}),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`
1
+ import{j as h}from"./liveblocks-B5ZW-VBI.js";import oa from"./NotFoundScreen-CJOPcpwO.js";import{a as o,b as Nt}from"./sentry-BxWyF9h9.js";import{n as Ue,S as sa}from"./mui-U77PQnc2.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-Crl6eqZl.js";import{eW as Re,S_ as la,oj as Ee,fY as ra,s4 as da,oB as Kt,oW as Zt,S$ as Qt,p4 as ua,T0 as Ht,ou as ma,rC as pa,fI as Ie,T1 as De,ub as Wt,Et as Xt,T2 as en,T3 as ha,ra as Ze,Og as Pt,Oi as ga,kA as Ca,Oj as Sa,kH as fa,cZ as Ia,vn as Qe,oH as tn,p9 as Fe,oz as de,T4 as Ea,N8 as Rt,N7 as we,T5 as Dt,kY as ka,T6 as Ta,T7 as ya,T8 as ba,T9 as va,oO as Aa,pc as xe,Ta as wa,Tb as xa,Tc as Pa,pj as Ra,kL as Da,kC as Fa,Td as Ua,kK as Ft,Oq as Ba,Te as Oa,Tf as Va,r6 as _a,qK as za,pa as me,qJ as Je,Tg as Ma,Th as ja,Ti as La,mf as $a,bo as qa,ma as Ut,lY as Ga,Tj as Ja,fy as Bt,gx as Na,m7 as Ya,xg as Ka,Tk as Za,pK as Qa,pF as Ha,pJ as Wa,pu as Xa,Tl as eo,fL as nn,oZ as to,oK as no,fZ as Ot,pe as ao,Tm as oo,Tn as so,pb as an,To as co,Tp as io,Tq as lo,Tr as ro,Ts as Vt,ri as uo,qB as mo,N6 as po,Tt as ho,Tu as go,kJ as Co,Tv as So,J9 as fo,kI as Io,kx as Eo,fK as ko,q7 as on,qt as To,p8 as _t,pd as yo,bE as bo,m4 as vo,m1 as Ao,Tw as wo,pt as zt,qp as Mt,qn as xo,Tx as Po,qc as Ro,pU as Do,qq as Fo,Ty as Uo,Tz as Bo,pY as Oo,TA as Vo,pP as _o,pX as zo,pV as Mo,qw as jo}from"./zeni-epic-state-DTyrT1Ga.js";import{W as sn,Q as X,c as q,s as ae,X as cn,Z as ln,cY as Lo,z as Be,cZ as $o,at as Pe,c_ as qo,aX as jt,B as rn,c$ as Go,aq as Ne,F as Jo,a7 as No,d0 as Yo,a2 as Ko,d1 as Zo,U as Qo,d2 as Ho,d3 as Wo,$ as Xo,I as es,aQ as ts,d4 as ns,d5 as as,bc as os,x as ss,aT as cs}from"./index-BLRtUSpL.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-Cpb6UCmb.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-CsoYHiYS.js";import{w as us}from"./withTransactionSidePanel-CPTD79Uy.js";import{h as ms,v as ps}from"./routePaths-DPA1vVZP.js";import{g as Ye}from"./accountMappingHelper-SrHoNEDL.js";import{D as hs}from"./DrawerScreen-l4bgWPF0.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";import"./decodeURIComponentSafe-DwYiSzjo.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]="5cacc6d9-b40a-46b1-aa73-118b011ba4f0",t._sentryDebugIdIdentifier="sentry-dbid-5cacc6d9-b40a-46b1-aa73-118b011ba4f0")}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"}),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%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-B5ZW-VBI.js";import{a as r}from"./sentry-BxWyF9h9.js";import{a3 as l,a4 as p,a5 as d,r as f}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import m from"./NotFoundScreen-DY1Wwus4.js";import{h as u,g as b}from"./core-Crl6eqZl.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]="5300824e-7c2e-424f-a4a9-b633eae03cb4",e._sentryDebugIdIdentifier="sentry-dbid-5300824e-7c2e-424f-a4a9-b633eae03cb4")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=f(a.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:d(o),onDemoClick:t,onGoBack:i}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
1
+ import{j as s}from"./liveblocks-B5ZW-VBI.js";import{a as r}from"./sentry-BxWyF9h9.js";import{a3 as l,a4 as p,a5 as d,r as f}from"./index-BLRtUSpL.js";import"./mui-U77PQnc2.js";import m from"./NotFoundScreen-CJOPcpwO.js";import{h as u,g as b}from"./core-Crl6eqZl.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]="5300824e-7c2e-424f-a4a9-b633eae03cb4",e._sentryDebugIdIdentifier="sentry-dbid-5300824e-7c2e-424f-a4a9-b633eae03cb4")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=f(a.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:d(o),onDemoClick:t,onGoBack:i}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-BxWyF9h9.js";import{u as c,h as l,g as m}from"./core-Crl6eqZl.js";import{ht as p,Me as g,Mf as _}from"./zeni-epic-state-DTyrT1Ga.js";import{u as b,L as h,z as y}from"./index-CJknvk0s.js";import"./liveblocks-B5ZW-VBI.js";import"./recharts-e5u-LCPv.js";import"./mui-U77PQnc2.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="45645fe0-00b5-4b9d-8a4e-310f92f6a693",e._sentryDebugIdIdentifier="sentry-dbid-45645fe0-00b5-4b9d-8a4e-310f92f6a693")}catch{}})();function R(){const e=c(),n=l(),o=m(),{setLoading:i,clearAllLoading:f}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}f();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};
1
+ import{a as r}from"./sentry-BxWyF9h9.js";import{u as c,h as l,g as m}from"./core-Crl6eqZl.js";import{ht as p,Me as g,Mf as _}from"./zeni-epic-state-DTyrT1Ga.js";import{u as b,L as h,z as y}from"./index-BLRtUSpL.js";import"./liveblocks-B5ZW-VBI.js";import"./recharts-e5u-LCPv.js";import"./mui-U77PQnc2.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="45645fe0-00b5-4b9d-8a4e-310f92f6a693",e._sentryDebugIdIdentifier="sentry-dbid-45645fe0-00b5-4b9d-8a4e-310f92f6a693")}catch{}})();function R(){const e=c(),n=l(),o=m(),{setLoading:i,clearAllLoading:f}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}f();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-B5ZW-VBI.js";import{i as S,n as f,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-Crl6eqZl.js";import{M7 as k,M8 as v,M9 as F,Bb as B,AZ as T,Ma as D,Mb as oe,Mc as se,B1 as ie,fz as $,B8 as le,B5 as re}from"./zeni-epic-state-DTyrT1Ga.js";import{j as x,o as r,k as de,c as j,f as G,n as ce,r as me,R as pe,s as H,W as ue,Q as he,M as fe,$ as xe,m as ge,v as be,B as we,V as Se,N as ye,S as ke,w as ve,x as je,D as $e}from"./index-CJknvk0s.js";import{n as m}from"./mui-U77PQnc2.js";import g from"./NotFoundScreen-DY1Wwus4.js";import{a as I}from"./sentry-BxWyF9h9.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="3fb24df0-f627-422b-a43d-0993f3c3ecfe",e._sentryDebugIdIdentifier="sentry-dbid-3fb24df0-f627-422b-a43d-0993f3c3ecfe")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-B5ZW-VBI.js";import{i as S,n as f,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-Crl6eqZl.js";import{M7 as k,M8 as v,M9 as F,Bb as B,AZ as T,Ma as D,Mb as oe,Mc as se,B1 as ie,fz as $,B8 as le,B5 as re}from"./zeni-epic-state-DTyrT1Ga.js";import{j as x,o as r,k as de,c as j,f as G,n as ce,r as me,R as pe,s as H,W as ue,Q as he,M as fe,$ as xe,m as ge,v as be,B as we,V as Se,N as ye,S as ke,w as ve,x as je,D as $e}from"./index-BLRtUSpL.js";import{n as m}from"./mui-U77PQnc2.js";import g from"./NotFoundScreen-CJOPcpwO.js";import{a as I}from"./sentry-BxWyF9h9.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="3fb24df0-f627-422b-a43d-0993f3c3ecfe",e._sentryDebugIdIdentifier="sentry-dbid-3fb24df0-f627-422b-a43d-0993f3c3ecfe")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-B5ZW-VBI.js";import{a as g}from"./sentry-BxWyF9h9.js";import{u as j,g as _,h as O,t as w,j as l,N as z}from"./core-Crl6eqZl.js";import{z as r,m as V,F as P,d as A,c as N,e as W,h as R,N as X,g as $}from"./index-CJknvk0s.js";import{eW as q,LU as B,M2 as G,LV as H,fz as J,g0 as K,L_ as Q,go as Y,cX as Z,M3 as ee,M4 as te}from"./zeni-epic-state-DTyrT1Ga.js";import{n as ne}from"./mui-U77PQnc2.js";import{u as se}from"./useDeviceId-BZa5m-bZ.js";import{f as ie}from"./analyticsHelper-BsiU5y2K.js";import{t as ae}from"./getLocaleForTenant-DiFaMSxg.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="d3c862c1-c50c-404b-bdce-20357049287b",t._sentryDebugIdIdentifier="sentry-dbid-d3c862c1-c50c-404b-bdce-20357049287b")}catch{}})();const T=(t,i)=>t!=null&&t.length>0&&i==="magic_links";function Te(){const t=j(),i=_(),f=O(),[k]=w(),n=k.get("token"),p=k.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),a=se(),{otpChallenge:c,twoFAPhoneNumber:x,magicLinkEmail:d,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),h=l(e=>e.tenantState.signInState),I=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>q(e)),b=l(e=>B(e)),E=r.getSignedInUser(),v=V().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&a!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(G(n,a,m)))},[n,p,t,a,m,s?.zeniSessionId]),g.useEffect(()=>{h!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(b.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),P.updateAppLocaleID(ae(o)),ie(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(W.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[h,S,y,s,o,b,v,i.state,t]);const F=g.useCallback(()=>{f("/signin/auth")},[f]),M=g.useCallback(()=>{a!=null&&c!=null&&d!=null&&t(ee(a,d,c))},[a,c,t,d]),U=g.useCallback(e=>{a!=null&&n!=null&&d!=null&&c!=null&&t(te(e,a,d,c))},[a,n,t,d,c]);if(I==="Completed"&&c!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:M,onVerifyOtp:U,onCancelVerifyDevice:F});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=i.state?.origin??"/";return u.jsx(z,{to:e,state:{...i.state,origin:""}})}if(!T(n,p)||m==null||I==="Error"){const e=i.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(z,{to:e,state:{...i.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(X,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-B5ZW-VBI.js";import{a as g}from"./sentry-BxWyF9h9.js";import{u as j,g as _,h as O,t as w,j as l,N as z}from"./core-Crl6eqZl.js";import{z as r,m as V,F as P,d as A,c as N,e as W,h as R,N as X,g as $}from"./index-BLRtUSpL.js";import{eW as q,LU as B,M2 as G,LV as H,fz as J,g0 as K,L_ as Q,go as Y,cX as Z,M3 as ee,M4 as te}from"./zeni-epic-state-DTyrT1Ga.js";import{n as ne}from"./mui-U77PQnc2.js";import{u as se}from"./useDeviceId-BZa5m-bZ.js";import{f as ie}from"./analyticsHelper-CsGwj-FA.js";import{t as ae}from"./getLocaleForTenant-e8sE0WQV.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="d3c862c1-c50c-404b-bdce-20357049287b",t._sentryDebugIdIdentifier="sentry-dbid-d3c862c1-c50c-404b-bdce-20357049287b")}catch{}})();const T=(t,i)=>t!=null&&t.length>0&&i==="magic_links";function Te(){const t=j(),i=_(),f=O(),[k]=w(),n=k.get("token"),p=k.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),a=se(),{otpChallenge:c,twoFAPhoneNumber:x,magicLinkEmail:d,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),h=l(e=>e.tenantState.signInState),I=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>q(e)),b=l(e=>B(e)),E=r.getSignedInUser(),v=V().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&a!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(G(n,a,m)))},[n,p,t,a,m,s?.zeniSessionId]),g.useEffect(()=>{h!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(b.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),P.updateAppLocaleID(ae(o)),ie(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(W.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[h,S,y,s,o,b,v,i.state,t]);const F=g.useCallback(()=>{f("/signin/auth")},[f]),M=g.useCallback(()=>{a!=null&&c!=null&&d!=null&&t(ee(a,d,c))},[a,c,t,d]),U=g.useCallback(e=>{a!=null&&n!=null&&d!=null&&c!=null&&t(te(e,a,d,c))},[a,n,t,d,c]);if(I==="Completed"&&c!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:M,onVerifyOtp:U,onCancelVerifyDevice:F});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=i.state?.origin??"/";return u.jsx(z,{to:e,state:{...i.state,origin:""}})}if(!T(n,p)||m==null||I==="Error"){const e=i.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(z,{to:e,state:{...i.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(X,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -1 +1 @@
1
- import{j as N}from"./liveblocks-B5ZW-VBI.js";import{a as c}from"./sentry-BxWyF9h9.js";import{u as me,j as n,i as Ze,g as qe,h as Je,l as P}from"./core-Crl6eqZl.js";import{eW as pe,fE as Xe,fF as be,fq as Ke,bn as ea,eV as aa,fG as ta,fH as na,fJ as sa,fM as oa,fV as ia,fN as g,fP as ra,fQ as le,fT as da,fR as la,fS as ca,fU as ua,cN as fa,fX as ma,cS as pa,fp as ba,g0 as ha,g1 as Sa,f$ as ga}from"./zeni-epic-state-DTyrT1Ga.js";import{a7 as Ea,a8 as ka,$ as Ca,W as ya,z as k,v as Ia,u as Ta,Q as r,a9 as wa,E as _a,aa as Aa,I as Fa,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ma,ae as ce,af as ue,L as Pa,ag as Ra,ah as fe,c as R,_ as xa,s as _,ai as x,aj as Na}from"./index-CJknvk0s.js";import{D as Va}from"./mui-U77PQnc2.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]="1834618f-2ad2-4694-98f9-59d2873ff72e",f._sentryDebugIdIdentifier="sentry-dbid-1834618f-2ad2-4694-98f9-59d2873ff72e")}catch{}})();const Ua=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ze(),a=qe(),C=Ca(),o=Je(),V=Ke(),m=me(),{useFeatureGate:i}=ya(),U=k.getSignedInUser(),G=ea(U),s=n(e=>pe(e)),he=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n(e=>aa(e)),j=O.uiState.currentChatSessionId,y=Ia(),{setLoading:Se}=Ta(),[A,L]=c.useState(void 0),F=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,I=P("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:H}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:W}=i(r.isDebitCardFeatureEnabled),Ee=wa(s,ge,W),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),Y=n(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n(e=>na(e));c.useEffect(()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(sa(!0))},[y,T,D.fetchState,I]);const h=k.getSignedInUser(),v=n(e=>e.tenantState),Ce=n(e=>v.fetchState==="Completed"?oa(e):[]),E=n(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:we}=i(r.isExpenseAutomationEnabledV2),Q=_a(),{isFeatureEnabled:_e}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=G||!G&&$e,Me=s.company!=null&&ia(s.company),w=ve&&Me,Pe=n(e=>g(e).totalUnreadCount),Re=n(e=>g(e).reducedFetchCountState),Z=n(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),q=n(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),xe=n(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),$=n(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:J,isLoading:X,isFetchingMore:K,hasFetchedAll:ee,fetchMore:Ne}=Aa();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(X===!1&&K===!1&&ee===!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)},[X,K,ee]),c.useEffect(()=>{y&&!I&&xe.fetchState==="Not-Started"&&V.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||$.fetchState!=="Not-Started"||m(le({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{A!=null&&$.fetchState==="In-Progress"&&(m(le({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(be({unreadCount:A},"comments")))},[A,$.fetchState]);const Ve={fetchStatus:Re,count:Pe},ae=t!=null?k.getSignedInUserTenant(t):null,te=n(e=>ae?.tenantId!=null?da(e,ae.tenantId):void 0),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),H===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const Ue=Fa(),ne=n(e=>la(e,S,h,we,Te,w).fetchState),se=n(e=>ca(e).fetchState),Ge=F&&(ne==="Completed"||ne==="Error")||z&&(se==="Completed"||se==="Error")||!F&&!z?void 0:"disabled",Oe=c.useMemo(()=>ua(s.userRole),[s.userRole]),je=fa(Oe),Le=s?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Y.fetchState==="Completed"&&ma(Y.notificationSettings,h.userEmail,W,s),oe=Da(),He=oe&&va(a),ie=pa(Ue?.loggedInUserRoleMap),re=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,B=c.useCallback(()=>w&&ie&&!k.getTreasuryPopupSeen(t??"")&&re===!1&&$a(a.pathname)!=="treasury",[w,ie,re,a.pathname,t]),[We,de]=c.useState(B);c.useEffect(()=>{de(B())},[B]);const Ye=n(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Qe=Ba(Ye);return N.jsx(Va,{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:N.jsx(Ma,{signedInUser:U,currentTenantId:v.currentTenantId??"",tenants:v.fetchState==="Completed"?Ce:te!=null?[te]:[],currentTenant:s,isTenantDropdownDisabled:Ge,isSettings:ue(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:je,isZeniAccountEnabled:H,isChargeCardEnabled:Ee,isTreasuryEnabled:w,treasuryYieldPercentage:Qe,isTreasuryPopupVisible:We,isNotificationsTabVisible:ze,notificationCountDetails:Ve,isExpenseAutomationEnabledForUser:Q,selectedMenu:ce(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:oe,onNotificationIconClick:()=>{d(!1);let e=Z===0&&q>0?"notifications/comments":"notifications/tasks";ue(a)&&(e=Z===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(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!he)return void xa({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=x(l)&&l!=="command_center";if(x(e.type)&&E[s.tenantId]!=null&&R.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 M=Na(e.type);fe(e.type)?(j!=null&&m(ga()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${M}`,{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=>{Se(Pa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=ce(a);let p=`/${encodeURIComponent(u)}/`;const M=x(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":Ra(l)?p+="settings/my_profile":fe(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(m(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const b=e;R.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),de(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:He,aiCfoView:O,isOnDashboard:F,updateCurrentChatSessionId:e=>{m(ba({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:_e,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),Wa=f=>{const d=me(),t=n(C=>pe(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Xe(o.mode)==="dashboard"&&d(be({unreadCount:o.data.unread},"tasks"))}};return N.jsx(Ua,{...f,...a})};export{Wa as M};
1
+ import{j as N}from"./liveblocks-B5ZW-VBI.js";import{a as c}from"./sentry-BxWyF9h9.js";import{u as me,j as n,i as Ze,g as qe,h as Je,l as P}from"./core-Crl6eqZl.js";import{eW as pe,fE as Xe,fF as be,fq as Ke,bn as ea,eV as aa,fG as ta,fH as na,fJ as sa,fM as oa,fV as ia,fN as g,fP as ra,fQ as le,fT as da,fR as la,fS as ca,fU as ua,cN as fa,fX as ma,cS as pa,fp as ba,g0 as ha,g1 as Sa,f$ as ga}from"./zeni-epic-state-DTyrT1Ga.js";import{a7 as Ea,a8 as ka,$ as Ca,W as ya,z as k,v as Ia,u as Ta,Q as r,a9 as wa,E as _a,aa as Aa,I as Fa,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ma,ae as ce,af as ue,L as Pa,ag as Ra,ah as fe,c as R,_ as xa,s as _,ai as x,aj as Na}from"./index-BLRtUSpL.js";import{D as Va}from"./mui-U77PQnc2.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]="1834618f-2ad2-4694-98f9-59d2873ff72e",f._sentryDebugIdIdentifier="sentry-dbid-1834618f-2ad2-4694-98f9-59d2873ff72e")}catch{}})();const Ua=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ze(),a=qe(),C=Ca(),o=Je(),V=Ke(),m=me(),{useFeatureGate:i}=ya(),U=k.getSignedInUser(),G=ea(U),s=n(e=>pe(e)),he=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n(e=>aa(e)),j=O.uiState.currentChatSessionId,y=Ia(),{setLoading:Se}=Ta(),[A,L]=c.useState(void 0),F=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,I=P("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:H}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:W}=i(r.isDebitCardFeatureEnabled),Ee=wa(s,ge,W),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),Y=n(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n(e=>na(e));c.useEffect(()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(sa(!0))},[y,T,D.fetchState,I]);const h=k.getSignedInUser(),v=n(e=>e.tenantState),Ce=n(e=>v.fetchState==="Completed"?oa(e):[]),E=n(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:we}=i(r.isExpenseAutomationEnabledV2),Q=_a(),{isFeatureEnabled:_e}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=G||!G&&$e,Me=s.company!=null&&ia(s.company),w=ve&&Me,Pe=n(e=>g(e).totalUnreadCount),Re=n(e=>g(e).reducedFetchCountState),Z=n(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),q=n(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),xe=n(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),$=n(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:J,isLoading:X,isFetchingMore:K,hasFetchedAll:ee,fetchMore:Ne}=Aa();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(X===!1&&K===!1&&ee===!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)},[X,K,ee]),c.useEffect(()=>{y&&!I&&xe.fetchState==="Not-Started"&&V.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||$.fetchState!=="Not-Started"||m(le({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{A!=null&&$.fetchState==="In-Progress"&&(m(le({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(be({unreadCount:A},"comments")))},[A,$.fetchState]);const Ve={fetchStatus:Re,count:Pe},ae=t!=null?k.getSignedInUserTenant(t):null,te=n(e=>ae?.tenantId!=null?da(e,ae.tenantId):void 0),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),H===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const Ue=Fa(),ne=n(e=>la(e,S,h,we,Te,w).fetchState),se=n(e=>ca(e).fetchState),Ge=F&&(ne==="Completed"||ne==="Error")||z&&(se==="Completed"||se==="Error")||!F&&!z?void 0:"disabled",Oe=c.useMemo(()=>ua(s.userRole),[s.userRole]),je=fa(Oe),Le=s?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Y.fetchState==="Completed"&&ma(Y.notificationSettings,h.userEmail,W,s),oe=Da(),He=oe&&va(a),ie=pa(Ue?.loggedInUserRoleMap),re=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,B=c.useCallback(()=>w&&ie&&!k.getTreasuryPopupSeen(t??"")&&re===!1&&$a(a.pathname)!=="treasury",[w,ie,re,a.pathname,t]),[We,de]=c.useState(B);c.useEffect(()=>{de(B())},[B]);const Ye=n(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Qe=Ba(Ye);return N.jsx(Va,{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:N.jsx(Ma,{signedInUser:U,currentTenantId:v.currentTenantId??"",tenants:v.fetchState==="Completed"?Ce:te!=null?[te]:[],currentTenant:s,isTenantDropdownDisabled:Ge,isSettings:ue(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:je,isZeniAccountEnabled:H,isChargeCardEnabled:Ee,isTreasuryEnabled:w,treasuryYieldPercentage:Qe,isTreasuryPopupVisible:We,isNotificationsTabVisible:ze,notificationCountDetails:Ve,isExpenseAutomationEnabledForUser:Q,selectedMenu:ce(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:oe,onNotificationIconClick:()=>{d(!1);let e=Z===0&&q>0?"notifications/comments":"notifications/tasks";ue(a)&&(e=Z===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(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!he)return void xa({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=x(l)&&l!=="command_center";if(x(e.type)&&E[s.tenantId]!=null&&R.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 M=Na(e.type);fe(e.type)?(j!=null&&m(ga()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${M}`,{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=>{Se(Pa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=ce(a);let p=`/${encodeURIComponent(u)}/`;const M=x(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":Ra(l)?p+="settings/my_profile":fe(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(m(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const b=e;R.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),de(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:He,aiCfoView:O,isOnDashboard:F,updateCurrentChatSessionId:e=>{m(ba({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:_e,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),Wa=f=>{const d=me(),t=n(C=>pe(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Xe(o.mode)==="dashboard"&&d(be({unreadCount:o.data.unread},"tasks"))}};return N.jsx(Ua,{...f,...a})};export{Wa as M};
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-B5ZW-VBI.js";import{h as r,n}from"./core-Crl6eqZl.js";import{J as i}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import"./sentry-BxWyF9h9.js";import"./zeni-epic-state-DTyrT1Ga.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="c14b3791-f16a-4778-9ced-7f24e565014e",o._sentryDebugIdIdentifier="sentry-dbid-c14b3791-f16a-4778-9ced-7f24e565014e")}catch{}})();const a=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
1
+ import{j as e}from"./liveblocks-B5ZW-VBI.js";import{h as r,n}from"./core-Crl6eqZl.js";import{J as i}from"./index-BLRtUSpL.js";import"./mui-U77PQnc2.js";import"./sentry-BxWyF9h9.js";import"./zeni-epic-state-DTyrT1Ga.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="c14b3791-f16a-4778-9ced-7f24e565014e",o._sentryDebugIdIdentifier="sentry-dbid-c14b3791-f16a-4778-9ced-7f24e565014e")}catch{}})();const a=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
@@ -1 +1 @@
1
- import{l as ct,a as mt,m as dt,j as A}from"./liveblocks-B5ZW-VBI.js";import lt from"./NotFoundScreen-DY1Wwus4.js";import{a as k}from"./sentry-BxWyF9h9.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 Q}from"./core-Crl6eqZl.js";import{cu as St,fG as Z,eW as H,fU as bt,fN as b,SV as J,fQ as d,fF as y,so as M,xT as It,SW as Ct,fE as Tt,fX as yt,st as Et,SX as F,bo as $,fy as w,sx as Y,SY as _t,cG as At,cz as Nt}from"./zeni-epic-state-DTyrT1Ga.js";import{X as xt,z as Bt,W as wt,Q as Gt,Z as Rt,cV as Ut,s as N,a7 as Dt,cW as vt,a8 as Pt,r as Ft}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="65212ffe-91bd-465e-95a1-9157839975f6",t._sentryDebugIdIdentifier="sentry-dbid-65212ffe-91bd-465e-95a1-9157839975f6")}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=Z(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(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:x,fetchMoreCommentsNotifications:G}=l;return{onNotificationClick:(a,o,m,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"}})}m==="unread"&&t(Y("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(x(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(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(J(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(_t(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else G?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Y("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(x(r),t(F([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(Et("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,x).then(()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({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}=xt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[x,G]=k.useState(!1),a=S(e=>Z(e)),o=S(e=>H(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(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:B,isLoading:E,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:W,isLoading:z,fetchMore:L,isFetchingMore:X,hasFetchedAll:q}=mt({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(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(E===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({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(d({fetchState:"In-Progress",error:void 0},"comments")):v||U!=="In-Progress"||s(d({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"&&x===!1&&(G(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(E===!1&&z===!1&&B!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=B.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}:(X||q===!0||L==null||L(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:_},"comments")),s(y({totalCount:_.length,unreadCount:T.length},"comments")),s(Ct(it))}},[E,D,X,C,q,z,B?.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=dt();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(Q,{path:"/:selectedTab",element:A.jsx(Vt,{})}),A.jsx(Q,{path:"*",element:A.jsx(lt,{})})]})}export{ne as default};
1
+ import{l as ct,a as mt,m as dt,j as A}from"./liveblocks-B5ZW-VBI.js";import lt from"./NotFoundScreen-CJOPcpwO.js";import{a as k}from"./sentry-BxWyF9h9.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 Q}from"./core-Crl6eqZl.js";import{cu as St,fG as Z,eW as H,fU as bt,fN as b,SV as J,fQ as d,fF as y,so as M,xT as It,SW as Ct,fE as Tt,fX as yt,st as Et,SX as F,bo as $,fy as w,sx as Y,SY as _t,cG as At,cz as Nt}from"./zeni-epic-state-DTyrT1Ga.js";import{X as xt,z as Bt,W as wt,Q as Gt,Z as Rt,cV as Ut,s as N,a7 as Dt,cW as vt,a8 as Pt,r as Ft}from"./index-BLRtUSpL.js";import"./mui-U77PQnc2.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-Cpb6UCmb.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="65212ffe-91bd-465e-95a1-9157839975f6",t._sentryDebugIdIdentifier="sentry-dbid-65212ffe-91bd-465e-95a1-9157839975f6")}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=Z(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(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:x,fetchMoreCommentsNotifications:G}=l;return{onNotificationClick:(a,o,m,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"}})}m==="unread"&&t(Y("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(x(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(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(J(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(_t(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else G?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Y("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(x(r),t(F([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(Et("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,x).then(()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({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}=xt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[x,G]=k.useState(!1),a=S(e=>Z(e)),o=S(e=>H(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(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:B,isLoading:E,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:W,isLoading:z,fetchMore:L,isFetchingMore:X,hasFetchedAll:q}=mt({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(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(E===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({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(d({fetchState:"In-Progress",error:void 0},"comments")):v||U!=="In-Progress"||s(d({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"&&x===!1&&(G(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(E===!1&&z===!1&&B!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=B.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}:(X||q===!0||L==null||L(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:_},"comments")),s(y({totalCount:_.length,unreadCount:T.length},"comments")),s(Ct(it))}},[E,D,X,C,q,z,B?.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=dt();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(Q,{path:"/:selectedTab",element:A.jsx(Vt,{})}),A.jsx(Q,{path:"*",element:A.jsx(lt,{})})]})}export{ne as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-B5ZW-VBI.js";import{a as r}from"./sentry-BxWyF9h9.js";import{u as T,g as j,j as o,N as A}from"./core-Crl6eqZl.js";import{Mh as C,eW as P,fM as x,Mi as z,Mj as D,Mk as L,Ml as R,o9 as k,Le as N}from"./zeni-epic-state-DTyrT1Ga.js";import{z as h,C as I}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="6a2869ca-4034-442c-a99d-dfd4edc4d9c2",n._sentryDebugIdIdentifier="sentry-dbid-6a2869ca-4034-442c-a99d-dfd4edc4d9c2")}catch{}})();function ee(){const n=T(),a=j(),{params:t,error:i}=r.useMemo(()=>C(a.search),[a.search]),w=r.useMemo(()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application",[a.search,t]),p=h.isSignedIn(),s=h.getSignedInUser(),f=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),v=o(D),c=o(L),[S,E]=r.useState(null),[b,M]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,a.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&s!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(s.userId,s.zeniSessionId??void 0))))},[p,s,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const _=r.useMemo(()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(U=>U.tenantId===e)?e:l.length===1?l[0].tenantId:null},[f?.tenantId,l]),u=S??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:E,approveError:b??v,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&s!=null&&u!=null&&n(N(s.userId,s.zeniSessionId??void 0,u,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(A,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
1
+ import{j as m}from"./liveblocks-B5ZW-VBI.js";import{a as r}from"./sentry-BxWyF9h9.js";import{u as T,g as j,j as o,N as A}from"./core-Crl6eqZl.js";import{Mh as C,eW as P,fM as x,Mi as z,Mj as D,Mk as L,Ml as R,o9 as k,Le as N}from"./zeni-epic-state-DTyrT1Ga.js";import{z as h,C as I}from"./index-BLRtUSpL.js";import"./mui-U77PQnc2.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="6a2869ca-4034-442c-a99d-dfd4edc4d9c2",n._sentryDebugIdIdentifier="sentry-dbid-6a2869ca-4034-442c-a99d-dfd4edc4d9c2")}catch{}})();function ee(){const n=T(),a=j(),{params:t,error:i}=r.useMemo(()=>C(a.search),[a.search]),w=r.useMemo(()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application",[a.search,t]),p=h.isSignedIn(),s=h.getSignedInUser(),f=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),v=o(D),c=o(L),[S,E]=r.useState(null),[b,M]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,a.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&s!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(s.userId,s.zeniSessionId??void 0))))},[p,s,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const _=r.useMemo(()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(U=>U.tenantId===e)?e:l.length===1?l[0].tenantId:null},[f?.tenantId,l]),u=S??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:E,approveError:b??v,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&s!=null&&u!=null&&n(N(s.userId,s.zeniSessionId??void 0,u,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(A,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-B5ZW-VBI.js";import{h as V,u as Z,g as z,i as H,j as d,n as J,o as X,p as I}from"./core-Crl6eqZl.js";import{eW as O,sc as R,rM as K,MO as U,rH as S,bs as ee,bn as ae,bY as te,rI as se,MP as oe,MB as C,dJ as re,vQ as ne,MQ as ie,wb as ce,fD as le,fB as de}from"./zeni-epic-state-DTyrT1Ga.js";import{z as me,X as fe,Z as pe,I as ue,W as v,Q as w,V as he,c as B,ao as ge,s as Fe}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import be from"./NotFoundScreen-DY1Wwus4.js";import{F as Ie}from"./FeaturePreviewScreen-BuXd4W0P.js";import{a as g}from"./sentry-BxWyF9h9.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import{u as Se}from"./useInitialThreadRequest-DZr1J4rc.js";import{t as Te}from"./routePaths-jWP9zfXs.js";import{M as ye}from"./MobileAppDrawer-BIP1MEKX.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="a413d13d-0080-4f7e-abad-fd481a68acb8",s._sentryDebugIdIdentifier="sentry-dbid-a413d13d-0080-4f7e-abad-fd481a68acb8")}catch{}})();const T=(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})}},ke=J(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:B}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(U(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(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=Te(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 M(){const s=V(),e=Z(),a=z(),{forecastId:o,tenantEmailDomain:r}=H(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>O(t)),$=y.company?.companyInfo.firstMonthOfFY??1,c=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:W,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!i&&F)p(!0),l||e(K());else if(l&&!m){u(!0);const t=((f,L,P)=>L!=null?f.forecasts.findIndex(b=>b.id===L):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(c,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(U(c.forecasts[t].id,t)),T(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!D(c.forecasts[t].id)&&F&&e(S(c.forecasts[t].id))}},[i,p,e,l,c,m,u,R,S,F]);const x=ue(),Y=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:_}=v(),{isFeatureEnabled:j}=_(w.isReportsCommentingEnabled),q=Se(j?y?.companyId:void 0,{clearParams:l&&m}),[G,Q]=g.useState(!1),E=t=>{Q(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:B,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:G,handleDrawerToggle:E}),n.jsx(ke,{firstMonthOfFY:$,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:Y,isAiCfoAccessEnabled:W,onAskAiCfoClick:N,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:q,onClickMenuIcon:()=>{E(!0)}})]})}function Qe(){const s=d(i=>O(i)),{useFeatureGate:e}=v(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(X,{children:[n.jsx(I,{path:"/",element:n.jsx(M,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(M,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Qe as PandLWithForecastRoutes,Qe as default};
1
+ import{j as n}from"./liveblocks-B5ZW-VBI.js";import{h as V,u as Z,g as z,i as H,j as d,n as J,o as X,p as I}from"./core-Crl6eqZl.js";import{eW as O,sc as R,rM as K,MO as U,rH as S,bs as ee,bn as ae,bY as te,rI as se,MP as oe,MB as C,dJ as re,vQ as ne,MQ as ie,wb as ce,fD as le,fB as de}from"./zeni-epic-state-DTyrT1Ga.js";import{z as me,X as fe,Z as pe,I as ue,W as v,Q as w,V as he,c as B,ao as ge,s as Fe}from"./index-BLRtUSpL.js";import"./mui-U77PQnc2.js";import be from"./NotFoundScreen-CJOPcpwO.js";import{F as Ie}from"./FeaturePreviewScreen-bdq3UTfq.js";import{a as g}from"./sentry-BxWyF9h9.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-Cpb6UCmb.js";import{u as Se}from"./useInitialThreadRequest-DVPS_iNz.js";import{t as Te}from"./routePaths-DPA1vVZP.js";import{M as ye}from"./MobileAppDrawer-Dun-P89d.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="a413d13d-0080-4f7e-abad-fd481a68acb8",s._sentryDebugIdIdentifier="sentry-dbid-a413d13d-0080-4f7e-abad-fd481a68acb8")}catch{}})();const T=(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})}},ke=J(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:B}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(U(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(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=Te(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 M(){const s=V(),e=Z(),a=z(),{forecastId:o,tenantEmailDomain:r}=H(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>O(t)),$=y.company?.companyInfo.firstMonthOfFY??1,c=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:W,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!i&&F)p(!0),l||e(K());else if(l&&!m){u(!0);const t=((f,L,P)=>L!=null?f.forecasts.findIndex(b=>b.id===L):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(c,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(U(c.forecasts[t].id,t)),T(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!D(c.forecasts[t].id)&&F&&e(S(c.forecasts[t].id))}},[i,p,e,l,c,m,u,R,S,F]);const x=ue(),Y=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:_}=v(),{isFeatureEnabled:j}=_(w.isReportsCommentingEnabled),q=Se(j?y?.companyId:void 0,{clearParams:l&&m}),[G,Q]=g.useState(!1),E=t=>{Q(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:B,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:G,handleDrawerToggle:E}),n.jsx(ke,{firstMonthOfFY:$,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:Y,isAiCfoAccessEnabled:W,onAskAiCfoClick:N,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:q,onClickMenuIcon:()=>{E(!0)}})]})}function Qe(){const s=d(i=>O(i)),{useFeatureGate:e}=v(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(X,{children:[n.jsx(I,{path:"/",element:n.jsx(M,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(M,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Qe as PandLWithForecastRoutes,Qe as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-B5ZW-VBI.js";import{MK as te,eW as J,kx as W,fD as Q,fB as ne,Kc as q,Mo as oe,uO as Ee,ML as N,uD as ke,uX as Ie,uR as ie,uH as re,uV as Pe,uS as je,MM as le,wC as Le,fn as Te,ge as ve,MN as M,uL as de,uK as ce,u_ as Fe,c6 as Ae}from"./zeni-epic-state-DTyrT1Ga.js";import{j as pe,W as Y,Q as E,z,a9 as ue,A as me,ak as ge,al as Re,x as he,o as R,y as fe,F as Ce,am as Oe,X as Ve,Z as Ue,V as Be,c as be,e as Ze,s as $e,an as Me,I as Ke}from"./index-CJknvk0s.js";import{D as ye,n as H,S as Se}from"./mui-U77PQnc2.js";import ae from"./NotFoundScreen-DY1Wwus4.js";import{a as r}from"./sentry-BxWyF9h9.js";import{u as ee,i as _e,j as m,h as We,g as ze,n as He,o as se,p as $}from"./core-Crl6eqZl.js";import{u as Ge}from"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import{M as Xe}from"./MobileAppDrawer-BIP1MEKX.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="bd02ce65-c8b2-4a43-ba86-15b73fb44a52",a._sentryDebugIdIdentifier="sentry-dbid-bd02ce65-c8b2-4a43-ba86-15b73fb44a52")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},K=Ce.getLocalizedStrings().peoplePage.invitePage,Je=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,S]=r.useState(!1),{userId:w}=_e(),d=m(e=>te(e)),u=m(e=>J(e)),D=m(e=>W(e)),{useFeatureGate:f}=Y(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=Q(k,u),T=ne(u),v=q(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(z.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?S(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return r.useEffect(()=>{x===!1&&w!=null&&p(Ee(w))},[x,w]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:K.discardTitle}),descriptionComponent:s.jsx(De,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},Qe=H(Se)`
1
+ import{j as s}from"./liveblocks-B5ZW-VBI.js";import{MK as te,eW as J,kx as W,fD as Q,fB as ne,Kc as q,Mo as oe,uO as Ee,ML as N,uD as ke,uX as Ie,uR as ie,uH as re,uV as Pe,uS as je,MM as le,wC as Le,fn as Te,ge as ve,MN as M,uL as de,uK as ce,u_ as Fe,c6 as Ae}from"./zeni-epic-state-DTyrT1Ga.js";import{j as pe,W as Y,Q as E,z,a9 as ue,A as me,ak as ge,al as Re,x as he,o as R,y as fe,F as Ce,am as Oe,X as Ve,Z as Ue,V as Be,c as be,e as Ze,s as $e,an as Me,I as Ke}from"./index-BLRtUSpL.js";import{D as ye,n as H,S as Se}from"./mui-U77PQnc2.js";import ae from"./NotFoundScreen-CJOPcpwO.js";import{a as r}from"./sentry-BxWyF9h9.js";import{u as ee,i as _e,j as m,h as We,g as ze,n as He,o as se,p as $}from"./core-Crl6eqZl.js";import{u as Ge}from"./useAskAiCfoHostNavButtonProps-Cpb6UCmb.js";import{M as Xe}from"./MobileAppDrawer-Dun-P89d.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="bd02ce65-c8b2-4a43-ba86-15b73fb44a52",a._sentryDebugIdIdentifier="sentry-dbid-bd02ce65-c8b2-4a43-ba86-15b73fb44a52")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},K=Ce.getLocalizedStrings().peoplePage.invitePage,Je=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,S]=r.useState(!1),{userId:w}=_e(),d=m(e=>te(e)),u=m(e=>J(e)),D=m(e=>W(e)),{useFeatureGate:f}=Y(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=Q(k,u),T=ne(u),v=q(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(z.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?S(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return r.useEffect(()=>{x===!1&&w!=null&&p(Ee(w))},[x,w]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:K.discardTitle}),descriptionComponent:s.jsx(De,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},Qe=H(Se)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-B5ZW-VBI.js";import E from"./NotFoundScreen-DY1Wwus4.js";import{a as r}from"./sentry-BxWyF9h9.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 h}from"./core-Crl6eqZl.js";import{eW as B,SZ as b,bq as F,bn as N,ie as V,fy as Z}from"./zeni-epic-state-DTyrT1Ga.js";import{$,z as I,Z as q,cX as W}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import{u as X}from"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import{M as G}from"./MobileAppDrawer-BIP1MEKX.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="f4c7e19a-e698-44f2-a58f-9a6e1244465b",e._sentryDebugIdIdentifier="sentry-dbid-f4c7e19a-e698-44f2-a58f-9a6e1244465b")}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}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(W),J=()=>{const e=_(),t=v(),c=$(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=M(),u=U(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[S,w]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,y=N(d),x=C||k||y,l=r.useCallback((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(Z({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=X({mobileExploreReferrer:"Performance"});return q({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:d,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(J,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
1
+ import{j as s}from"./liveblocks-B5ZW-VBI.js";import E from"./NotFoundScreen-CJOPcpwO.js";import{a as r}from"./sentry-BxWyF9h9.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 h}from"./core-Crl6eqZl.js";import{eW as B,SZ as b,bq as F,bn as N,ie as V,fy as Z}from"./zeni-epic-state-DTyrT1Ga.js";import{$,z as I,Z as q,cX as W}from"./index-BLRtUSpL.js";import"./mui-U77PQnc2.js";import{u as X}from"./useAskAiCfoHostNavButtonProps-Cpb6UCmb.js";import{M as G}from"./MobileAppDrawer-Dun-P89d.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="f4c7e19a-e698-44f2-a58f-9a6e1244465b",e._sentryDebugIdIdentifier="sentry-dbid-f4c7e19a-e698-44f2-a58f-9a6e1244465b")}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}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(W),J=()=>{const e=_(),t=v(),c=$(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=M(),u=U(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[S,w]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,y=N(d),x=C||k||y,l=r.useCallback((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(Z({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=X({mobileExploreReferrer:"Performance"});return q({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:d,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(J,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-B5ZW-VBI.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BxWyF9h9.js";import{L as dt,bY as Tc,eW as Ac,LU as Rc,Mm as kl,c6 as Tl,g0 as Al,g1 as Rl}from"./zeni-epic-state-DTyrT1Ga.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-BjvWDnmB.js";import{r as un}from"./empty-BpRPQOis.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-ImawEH2S.js";import{r as Gl}from"./index-D5ItYKRr.js";import{r as zl}from"./index-CZNTdKXM.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-Crl6eqZl.js";import{u as Kl,z as Pc,L as Wl,G as Jl,H as Xl,f as Ql,c as tf}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import{d as Pe}from"./decodeURIComponentSafe-DwYiSzjo.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="07e09f6c-3a01-484f-9db8-af0558dd1fef",t._sentryDebugIdIdentifier="sentry-dbid-07e09f6c-3a01-484f-9db8-af0558dd1fef")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-B5ZW-VBI.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BxWyF9h9.js";import{L as dt,bY as Tc,eW as Ac,LU as Rc,Mm as kl,c6 as Tl,g0 as Al,g1 as Rl}from"./zeni-epic-state-DTyrT1Ga.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-BjvWDnmB.js";import{r as un}from"./empty-BpRPQOis.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-ImawEH2S.js";import{r as Gl}from"./index-D5ItYKRr.js";import{r as zl}from"./index-CZNTdKXM.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-Crl6eqZl.js";import{u as Kl,z as Pc,L as Wl,G as Jl,H as Xl,f as Ql,c as tf}from"./index-BLRtUSpL.js";import"./mui-U77PQnc2.js";import{d as Pe}from"./decodeURIComponentSafe-DwYiSzjo.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="07e09f6c-3a01-484f-9db8-af0558dd1fef",t._sentryDebugIdIdentifier="sentry-dbid-07e09f6c-3a01-484f-9db8-af0558dd1fef")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-B5ZW-VBI.js";import{a as o}from"./sentry-BxWyF9h9.js";import{j as f,h as L,u as V,g as W,n as F}from"./core-Crl6eqZl.js";import{m as M,j as _,z as P,be as N,x as U,X as $,Z as z,V as G,c as l,e as J,a7 as X,bf as Z}from"./index-CJknvk0s.js";import{fH as q,eW as K,Pk as R,Pl as Q,vG as Y,vw as g,fJ as ee,bS as ae,vB as re,Pm as ne}from"./zeni-epic-state-DTyrT1Ga.js";import{D as te,e as se,n as oe,S as ie}from"./mui-U77PQnc2.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import{M as ce}from"./MobileAppDrawer-BIP1MEKX.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]="c0eb04e9-6128-4118-950f-b6aacb7bbcd9",e._sentryDebugIdIdentifier="sentry-dbid-c0eb04e9-6128-4118-950f-b6aacb7bbcd9")}catch{}})();const de={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=M(),n=_();if(P.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>q(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(N,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
1
+ import{j as s}from"./liveblocks-B5ZW-VBI.js";import{a as o}from"./sentry-BxWyF9h9.js";import{j as f,h as L,u as V,g as W,n as F}from"./core-Crl6eqZl.js";import{m as M,j as _,z as P,be as N,x as U,X as $,Z as z,V as G,c as l,e as J,a7 as X,bf as Z}from"./index-BLRtUSpL.js";import{fH as q,eW as K,Pk as R,Pl as Q,vG as Y,vw as g,fJ as ee,bS as ae,vB as re,Pm as ne}from"./zeni-epic-state-DTyrT1Ga.js";import{D as te,e as se,n as oe,S as ie}from"./mui-U77PQnc2.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-Cpb6UCmb.js";import{M as ce}from"./MobileAppDrawer-Dun-P89d.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]="c0eb04e9-6128-4118-950f-b6aacb7bbcd9",e._sentryDebugIdIdentifier="sentry-dbid-c0eb04e9-6128-4118-950f-b6aacb7bbcd9")}catch{}})();const de={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=M(),n=_();if(P.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>q(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(N,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as r}from"./liveblocks-B5ZW-VBI.js";import _ from"./NotFoundScreen-DY1Wwus4.js";import{a as p}from"./sentry-BxWyF9h9.js";import{h as E,g as x,u as C,j as u,N as D,n as k,o as F,p as b}from"./core-Crl6eqZl.js";import{eW as j,Qe as S,Qu as g,FB as V,EK as U,FA as c,Fr as B,QI as L,FD as O}from"./zeni-epic-state-DTyrT1Ga.js";import{z as N,a7 as T,bZ as Q,af as $,bC as K,b_ as z}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import{u as Z,R as A}from"./ReimbursementApprovalRuleDetailScreen-BJZRYRum.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="d607cb5d-9801-4458-8729-67da54eb8faa",e._sentryDebugIdIdentifier="sentry-dbid-d607cb5d-9801-4458-8729-67da54eb8faa")}catch{}})();const y="reimbursement-approval-rule-update",q=k(function(e){return{approvalView:S(e),remiSetupApproverViewUpdateData:g(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(L(!1))},onBackClick:()=>{$(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(c(t)),s(`./${t}/edit`)):(e(c()),s("./new"))}}})(T(Q)),G=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,h]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>j(a)),d=u(a=>S(a)),v=u(a=>g(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(m||(h(!0),n(c())),o("./new"))},[m,d,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,W,R)=>{a.endsWith(y)&&R.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(q,{currentTenant:l,location:s,navigate:o,...w})},I="reimbursement-approval-rule-update",H=k(function(e){const o=S(e),s=g(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(I)&&e(L(!1))},onBackClick:()=>{$(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(c(t)),s(`./${t}/edit`)):(e(c()),s("./new"))},onReorderRules:t=>{e(O(t,!0))}}})(T(z)),J=()=>{const e=u(n=>j(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=K(e?.tenantId);return o?r.jsx(M,{isLoading:s}):r.jsx(G,{isLoading:s})},M=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,h]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>j(a)),d=u(a=>S(a));Z();const v=u(a=>g(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(m||(h(!0),n(c())),o("./new"))},[m,d,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${I}`]:[],eventCallback:(a,W,R)=>{a.endsWith(I)&&R.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(H,{currentTenant:l,location:s,navigate:o,isLoading:e,...w})};function oe(){return r.jsxs(F,{children:[r.jsx(b,{path:"/",element:r.jsx(J,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
1
+ import{j as r}from"./liveblocks-B5ZW-VBI.js";import _ from"./NotFoundScreen-CJOPcpwO.js";import{a as p}from"./sentry-BxWyF9h9.js";import{h as E,g as x,u as C,j as u,N as D,n as k,o as F,p as b}from"./core-Crl6eqZl.js";import{eW as j,Qe as S,Qu as g,FB as V,EK as U,FA as c,Fr as B,QI as L,FD as O}from"./zeni-epic-state-DTyrT1Ga.js";import{z as N,a7 as T,bZ as Q,af as $,bC as K,b_ as z}from"./index-BLRtUSpL.js";import"./mui-U77PQnc2.js";import{u as Z,R as A}from"./ReimbursementApprovalRuleDetailScreen-Buh9WwCp.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="d607cb5d-9801-4458-8729-67da54eb8faa",e._sentryDebugIdIdentifier="sentry-dbid-d607cb5d-9801-4458-8729-67da54eb8faa")}catch{}})();const y="reimbursement-approval-rule-update",q=k(function(e){return{approvalView:S(e),remiSetupApproverViewUpdateData:g(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(L(!1))},onBackClick:()=>{$(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(c(t)),s(`./${t}/edit`)):(e(c()),s("./new"))}}})(T(Q)),G=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,h]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>j(a)),d=u(a=>S(a)),v=u(a=>g(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(m||(h(!0),n(c())),o("./new"))},[m,d,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,W,R)=>{a.endsWith(y)&&R.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(q,{currentTenant:l,location:s,navigate:o,...w})},I="reimbursement-approval-rule-update",H=k(function(e){const o=S(e),s=g(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(I)&&e(L(!1))},onBackClick:()=>{$(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(c(t)),s(`./${t}/edit`)):(e(c()),s("./new"))},onReorderRules:t=>{e(O(t,!0))}}})(T(z)),J=()=>{const e=u(n=>j(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=K(e?.tenantId);return o?r.jsx(M,{isLoading:s}):r.jsx(G,{isLoading:s})},M=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,h]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>j(a)),d=u(a=>S(a));Z();const v=u(a=>g(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(m||(h(!0),n(c())),o("./new"))},[m,d,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${I}`]:[],eventCallback:(a,W,R)=>{a.endsWith(I)&&R.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(H,{currentTenant:l,location:s,navigate:o,isLoading:e,...w})};function oe(){return r.jsxs(F,{children:[r.jsx(b,{path:"/",element:r.jsx(J,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
@@ -1 +1 @@
1
- import{j as b}from"./liveblocks-B5ZW-VBI.js";import{a as f}from"./sentry-BxWyF9h9.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-Crl6eqZl.js";import{kZ as L,Qu as w,Qe as C,Fu as V,FG as B,FB as A,FC as E,Qv as j,eW as W,FA as z}from"./zeni-epic-state-DTyrT1Ga.js";import{z as P,m as N,B as Q,bP as G,af as $,bC as K,bQ as Z}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="4229f5e7-10b5-4b17-9b34-10d864fffc7e",e._sentryDebugIdIdentifier="sentry-dbid-4229f5e7-10b5-4b17-9b34-10d864fffc7e")}catch{}})();function H(){const e=T(),s=f.useRef(!1),t=g(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=g(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))},[p,t,e])}const J=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=I.concat(R);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(G);function M(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const X=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];S==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const x=y.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=h?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(Z);function ne(){const e=g(t=>W(t)),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?b.jsx(Y,{}):b.jsx(M,{})}function Y(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
1
+ import{j as b}from"./liveblocks-B5ZW-VBI.js";import{a as f}from"./sentry-BxWyF9h9.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-Crl6eqZl.js";import{kZ as L,Qu as w,Qe as C,Fu as V,FG as B,FB as A,FC as E,Qv as j,eW as W,FA as z}from"./zeni-epic-state-DTyrT1Ga.js";import{z as P,m as N,B as Q,bP as G,af as $,bC as K,bQ as Z}from"./index-BLRtUSpL.js";import"./mui-U77PQnc2.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="4229f5e7-10b5-4b17-9b34-10d864fffc7e",e._sentryDebugIdIdentifier="sentry-dbid-4229f5e7-10b5-4b17-9b34-10d864fffc7e")}catch{}})();function H(){const e=T(),s=f.useRef(!1),t=g(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=g(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))},[p,t,e])}const J=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=I.concat(R);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(G);function M(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const X=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];S==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const x=y.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=h?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(Z);function ne(){const e=g(t=>W(t)),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?b.jsx(Y,{}):b.jsx(M,{})}function Y(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};