@zeniai/web-app-ui 5.2.4-dev → 5.2.4-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 (63) hide show
  1. package/dist/assets/{AddressRoutes-BXnlTnkY.js → AddressRoutes-Bin_-K_m.js} +1 -1
  2. package/dist/assets/{AddressScreen-CB9yyUzu.js → AddressScreen-DPky5m5p.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-CKqIopzI.js → AiCfoScreen-CZ7ChzrU.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-BmW8MwVg.js → BillPayApprovalRoutes-DxZ6VlCA.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DyoJo0OV.js → BillPayRoutes-DgKQh94m.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-ZC7zpCv9.js → BusinessVerificationPageScreen-KgJTV7Is.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-BUjO4McZ.js → CardsAiCfoScreen-id-ok7dm.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-BDv3hLUk.js → ChargeCardRoutes-CUM1XRJC.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-K4hqR_Of.js → CompanyPassportScreen-H0QfpM1f.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-DAezivTp.js → ConnectionAuthScreen-r4ARxp1N.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingAuthScreen-C_cijkIN.js → CustomerOnboardingAuthScreen-DcXY4hVl.js} +1 -1
  12. package/dist/assets/{CustomerOnboardingRoutes-DCxx1Kil.js → CustomerOnboardingRoutes-BJ-pDPua.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-Btf5qopD.js → DashboardRoutes-BjEybUEO.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-B_OJQApA.js → DefaultTenantHome-DXe7duY4.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-CQ4WVqeB.js → DomesticWireDetailScreen-BHH-3Zfz.js} +1 -1
  16. package/dist/assets/{DrawerScreen-CKbiBlQ7.js → DrawerScreen-CbHABUlJ.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-CXOFU7L0.js → EntityDetailRoutes-Bw3yJXeA.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-CBWPXFBc.js → ExpenseAutomationRoutes-CZg6wwTP.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-BpeRjZY3.js → FeaturePreviewScreen-BtXMKquo.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-DlYkrIqG.js → HubSpotOAuthCallbackScreen-BsXYwpqT.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-CaXk_v56.js → MagicLinkRoutes-BU76CdTB.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-vuzJ-6hl.js → MagicLinkSignInScreen-C9-ykp4a.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-mJR72DtA.js → MobileAppDrawer-RaFZojI2.js} +1 -1
  24. package/dist/assets/{NotFoundScreen-pjqYHD4T.js → NotFoundScreen-BfdMMfOd.js} +1 -1
  25. package/dist/assets/{NotificationRoutes-ByaUuLZp.js → NotificationRoutes-B6Fho7CZ.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-BS4pnhQZ.js → OAuthConsentScreen-DIQpmOn6.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-BuWtsXet.js → PandLWithForecastRoutes-uEOcxynq.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-D5NuJRM4.js → PeopleRoutes-CTZ5Ab9z.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-C-yfLnvY.js → PerformanceRoutes-DI6Gk7ru.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-jkZ_cdH1.js → QBOConnectionScreen-BzHolJYM.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-CqCLBt6r.js → ReimbursementApprovalRoutes-DqsLGNjl.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CKegjQI1.js → ReimbursementApprovalRuleDetailScreen-DTbwLilz.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-B-igsw0G.js → ReimbursementRoutes-BOOguVf8.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-BycueTT3.js → ReportsRoutes-Xr75d9QG.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-Ch6pfaDA.js → RewardsRoutes-B5t90hW9.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-xFFl0XFK.js → ScreenRoutes-s_Chyeso.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-DRVdoSec.js → SettingsRoutes-oYnSHuDu.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-DAr5O2oq.js → SetupPagesScreen-CsxRnYId.js} +1 -1
  39. package/dist/assets/{SignInScreen-Ba-ThhTj.js → SignInScreen-C1h66mzA.js} +1 -1
  40. package/dist/assets/{SignOutScreen-CeSek43w.js → SignOutScreen-CwtEJnaE.js} +1 -1
  41. package/dist/assets/{TaskListScreen-DVm-Drto.js → TaskListScreen-I-OxNnjm.js} +1 -1
  42. package/dist/assets/{TaskRoutes-D3gd8Kav.js → TaskRoutes-BP3wb_Xk.js} +1 -1
  43. package/dist/assets/{TransactionDetailRoutes-DcF4U6JF.js → TransactionDetailRoutes-Bou9_9v6.js} +1 -1
  44. package/dist/assets/{TransactionDetailScreen-DEAM6N6x.js → TransactionDetailScreen-Dnm1o3gy.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-DE5hGaE1.js → TransactionListRoutes-DgbRRWdV.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-DF39pPb4.js → TreasuryRoutes-DMeTx-NL.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-CaSeST5s.js → VendorsRoutes-CHJQpOtj.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-B7lAVdPL.js → WiseConfirmationScreen-Cg5IVzZr.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-CZD4gpA3.js → ZeniAccountRoutes-DJOehvVf.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-BThXS9vz.js → ZeniAccountStatementScreen-Bh1xYJTJ.js} +1 -1
  51. package/dist/assets/{analyticsHelper-CI2hKrei.js → analyticsHelper-u_wRIr-A.js} +1 -1
  52. package/dist/assets/{getLocaleForTenant-C8WDJQ34.js → getLocaleForTenant-C9HoG54f.js} +1 -1
  53. package/dist/assets/{index-DSrpVU5Y.js → index-slT6Cmx8.js} +5 -5
  54. package/dist/assets/{routePaths-c5aFJU-F.js → routePaths-C58Oct92.js} +1 -1
  55. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BvBKI7vl.js → useAiCfoDashboardSuggestedQuestionsChips-COhzCx2s.js} +1 -1
  56. package/dist/assets/{useAskAiCfoHostNavButtonProps-DndeBqh3.js → useAskAiCfoHostNavButtonProps-EdOjchhB.js} +1 -1
  57. package/dist/assets/{useCashManagementBanner-gscfpQYY.js → useCashManagementBanner-BrwTPpdL.js} +1 -1
  58. package/dist/assets/{useChargeCardPusherEvents-BZ0crBRh.js → useChargeCardPusherEvents-BBew6xbf.js} +1 -1
  59. package/dist/assets/{useEmailConnectResultRefresh-DHdvN73b.js → useEmailConnectResultRefresh-CYew-P-Z.js} +1 -1
  60. package/dist/assets/{useInitialThreadRequest-CvusWtwP.js → useInitialThreadRequest-Dcty95yd.js} +1 -1
  61. package/dist/assets/{withTransactionSidePanel-B9Gn_Jtc.js → withTransactionSidePanel-C_PdEYzg.js} +1 -1
  62. package/dist/index.html +1 -1
  63. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-C01HsTej.js";import{a as u}from"./sentry-B-4V3RdH.js";import{u as y,j as b,n as w,g as A,N as L}from"./core-DI1Smcxr.js";import{LY as N,eW as _,g0 as U,LZ as k,oc as R,L_ as z}from"./zeni-epic-state-CGEUbbPd.js";import{u as j,z as f,L as T,t as I,a as O,b as $}from"./index-DSrpVU5Y.js";import"./mui-DZ-Vvmtg.js";import{t as P}from"./getLocaleForTenant-C8WDJQ34.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="e36900ff-2df6-45d0-81a4-e2a79a847204",t._sentryDebugIdIdentifier="sentry-dbid-e36900ff-2df6-45d0-81a4-e2a79a847204")}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,F)=>l||i.split("/").find((D=>D===F))!=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 x=$(c,p);return v.jsx(L,{to:x,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=>N(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(U(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-C01HsTej.js";import{a as u}from"./sentry-B-4V3RdH.js";import{u as y,j as b,n as w,g as A,N as L}from"./core-DI1Smcxr.js";import{LY as N,eW as _,g0 as U,LZ as k,oc as R,L_ as z}from"./zeni-epic-state-CGEUbbPd.js";import{u as j,z as f,L as T,t as I,a as O,b as $}from"./index-slT6Cmx8.js";import"./mui-DZ-Vvmtg.js";import{t as P}from"./getLocaleForTenant-C9HoG54f.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="e36900ff-2df6-45d0-81a4-e2a79a847204",t._sentryDebugIdIdentifier="sentry-dbid-e36900ff-2df6-45d0-81a4-e2a79a847204")}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,F)=>l||i.split("/").find((D=>D===F))!=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 x=$(c,p);return v.jsx(L,{to:x,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=>N(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(U(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-C01HsTej.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-DI1Smcxr.js";import{Q3 as k,Qa as _,gi as W,gh as J,gg as q,jx as K,Nd as L,rw as M,eW as V,PB as D,jv as T,Q4 as v,Qd as j,jt as F,jQ as G}from"./zeni-epic-state-CGEUbbPd.js";import{bz as X,J as N,C as R,z as U,y as Q,r as p,G as S,B as z,bA as Y,o as O,bB as ee,s as te}from"./index-DSrpVU5Y.js";import{n as Z}from"./mui-DZ-Vvmtg.js";import"./sentry-B-4V3RdH.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]="743ef39e-94fe-42a4-9a4e-e22b533fe125",e._sentryDebugIdIdentifier="sentry-dbid-743ef39e-94fe-42a4-9a4e-e22b533fe125")}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(q(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}}))(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((i=>k(i,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-C01HsTej.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-DI1Smcxr.js";import{Q3 as k,Qa as _,gi as W,gh as J,gg as q,jx as K,Nd as L,rw as M,eW as V,PB as D,jv as T,Q4 as v,Qd as j,jt as F,jQ as G}from"./zeni-epic-state-CGEUbbPd.js";import{bz as X,J as N,C as R,z as U,y as Q,r as p,G as S,B as z,bA as Y,o as O,bB as ee,s as te}from"./index-slT6Cmx8.js";import{n as Z}from"./mui-DZ-Vvmtg.js";import"./sentry-B-4V3RdH.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]="743ef39e-94fe-42a4-9a4e-e22b533fe125",e._sentryDebugIdIdentifier="sentry-dbid-743ef39e-94fe-42a4-9a4e-e22b533fe125")}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(q(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}}))(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((i=>k(i,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 i}from"./liveblocks-C01HsTej.js";import{J as c,A as l,y as f}from"./index-DSrpVU5Y.js";import{D as b}from"./mui-DZ-Vvmtg.js";import"./sentry-B-4V3RdH.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]="e0a3d41e-b633-4b37-83ac-35c42a771bc4",e._sentryDebugIdIdentifier="sentry-dbid-e0a3d41e-b633-4b37-83ac-35c42a771bc4")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=c(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
1
+ import{j as i}from"./liveblocks-C01HsTej.js";import{J as c,A as l,y as f}from"./index-slT6Cmx8.js";import{D as b}from"./mui-DZ-Vvmtg.js";import"./sentry-B-4V3RdH.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]="e0a3d41e-b633-4b37-83ac-35c42a771bc4",e._sentryDebugIdIdentifier="sentry-dbid-e0a3d41e-b633-4b37-83ac-35c42a771bc4")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=c(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-C01HsTej.js";import{a as c}from"./sentry-B-4V3RdH.js";import{h as A,u as B,g as O,i as G,j as d,N as q,n as F,o as W,p as _}from"./core-DI1Smcxr.js";import{Ol as z,eW as K,NJ as M,lA as R,Ke as k,Oq as Y,Nc as $,kA as J,Kf as S,NO as V,NP as X,Ne as H,Nd as L}from"./zeni-epic-state-CGEUbbPd.js";import{aX as Q,e as U,r as Z,s as tt}from"./index-DSrpVU5Y.js";import"./mui-DZ-Vvmtg.js";import{d as b}from"./decodeURIComponentSafe-C0NEXntv.js";import{w as et}from"./withTransactionSidePanel-B9Gn_Jtc.js";import{f as at,c as nt}from"./routePaths-c5aFJU-F.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.js";import"./useAskAiCfoHostNavButtonProps-DndeBqh3.js";import"./TransactionDetailScreen-DEAM6N6x.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]="9eb03cd3-6c04-4b1f-9180-c0bb2fc0ca19",a._sentryDebugIdIdentifier="sentry-dbid-9eb03cd3-6c04-4b1f-9180-c0bb2fc0ca19")}catch{}})();const ot=F((function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:J(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(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(X()),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}))}}}}))(Q),it=et((function({entityType:a,...t}){const e=A(),o=B(),l=O(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:C,entityIdEncoded:N,entityNameEncoded:w}=G(),r=b(N??""),p=b(w??""),f=rt(r,p),x=[r,p].filter((n=>n!=null)),i={name:p,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&&f===!0&&(T(!0),o(R(i)))}),[m,f,i]);const P=d((n=>n.trendState.fetchState)),E=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&&P==="Completed"&&(D(!0),E!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))}),[m,h,P]),f?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(x.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 Nt({entityType:a}){return s.jsx(W,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{Nt as EntityDetailRoutes,Nt as default};
1
+ import{j as s}from"./liveblocks-C01HsTej.js";import{a as c}from"./sentry-B-4V3RdH.js";import{h as A,u as B,g as O,i as G,j as d,N as q,n as F,o as W,p as _}from"./core-DI1Smcxr.js";import{Ol as z,eW as K,NJ as M,lA as R,Ke as k,Oq as Y,Nc as $,kA as J,Kf as S,NO as V,NP as X,Ne as H,Nd as L}from"./zeni-epic-state-CGEUbbPd.js";import{aX as Q,e as U,r as Z,s as tt}from"./index-slT6Cmx8.js";import"./mui-DZ-Vvmtg.js";import{d as b}from"./decodeURIComponentSafe-C0NEXntv.js";import{w as et}from"./withTransactionSidePanel-C_PdEYzg.js";import{f as at,c as nt}from"./routePaths-C58Oct92.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.js";import"./useAskAiCfoHostNavButtonProps-EdOjchhB.js";import"./TransactionDetailScreen-Dnm1o3gy.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]="9eb03cd3-6c04-4b1f-9180-c0bb2fc0ca19",a._sentryDebugIdIdentifier="sentry-dbid-9eb03cd3-6c04-4b1f-9180-c0bb2fc0ca19")}catch{}})();const ot=F((function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:J(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(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(X()),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}))}}}}))(Q),it=et((function({entityType:a,...t}){const e=A(),o=B(),l=O(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:C,entityIdEncoded:N,entityNameEncoded:w}=G(),r=b(N??""),p=b(w??""),f=rt(r,p),x=[r,p].filter((n=>n!=null)),i={name:p,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&&f===!0&&(T(!0),o(R(i)))}),[m,f,i]);const P=d((n=>n.trendState.fetchState)),E=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&&P==="Completed"&&(D(!0),E!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))}),[m,h,P]),f?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(x.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 Nt({entityType:a}){return s.jsx(W,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{Nt as EntityDetailRoutes,Nt as default};
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-C01HsTej.js";import oa from"./NotFoundScreen-pjqYHD4T.js";import{a as o,b as Jt}from"./sentry-B-4V3RdH.js";import{n as Ue,S as sa}from"./mui-DZ-Vvmtg.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-DI1Smcxr.js";import{eW as Re,T1 as la,om as Ee,fX as ra,s7 as da,oE as Kt,oZ as Zt,T2 as Qt,p7 as ua,T3 as Ht,ox as ma,rF as pa,fI as Ie,T4 as De,ud as Wt,Ez as Xt,T5 as en,T6 as ha,rd as Ze,Om as Pt,Oo as ga,kD as Ca,Op as Sa,kK as fa,c_ as Ia,vt as Qe,oK as tn,pc as Fe,oC as de,T7 as Ea,Ne as Rt,Nd as we,T8 as Dt,k$ as Ta,T9 as ka,Ta as ya,Tb as ba,Tc as va,oR as Aa,pf as xe,Td as wa,Te as xa,Tf as Pa,pm as Ra,kO as Da,kF as Fa,Tg as Ua,kN as Ft,Ow as Ba,Th as Oa,Ti as _a,r9 as Va,qN as za,pd as me,qM as Ne,Tj as Ma,Tk as La,Tl as ja,mi as $a,bo as qa,md as Ut,l$ as Ga,Tm as Na,fy as Bt,gy as Ja,ma as Ya,xm as Ka,Tn as Za,pN as Qa,pI as Ha,pM as Wa,px as Xa,To as eo,fL as nn,p0 as to,oN as no,fY as Ot,ph as ao,Tp as oo,Tq as so,pe as an,Tr as co,Ts as io,Tt as lo,Tu as ro,Tv as _t,rl as uo,qE as mo,Nc as po,Tw as ho,Tx as go,kM as Co,Ty as So,Jf as fo,kL as Io,kA as Eo,fK as To,qa as on,qw as ko,pb as Vt,pg as yo,bE as bo,m7 as vo,m4 as Ao,Tz as wo,pw as zt,qs as Mt,qq as xo,TA as Po,qf as Ro,pX as Do,qt as Fo,TB as Uo,TC as Bo,p$ as Oo,TD as _o,pS as Vo,p_ as zo,pY as Mo,qz as Lo}from"./zeni-epic-state-CGEUbbPd.js";import{C as sn,G as X,e as q,s as ae,_ as cn,a0 as ln,cZ as jo,z as Be,c_ as $o,au as Pe,c$ as qo,aZ as Lt,B as rn,d0 as Go,ar as Je,a as No,a9 as Jo,d1 as Yo,a4 as Ko,d2 as Zo,Z as Qo,d3 as Ho,d4 as Wo,Q as Xo,T as es,aS as ts,d5 as ns,d6 as as,be as os,A as ss,aV as cs}from"./index-DSrpVU5Y.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-DndeBqh3.js";import{f as jt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-DEAM6N6x.js";import{w as us}from"./withTransactionSidePanel-B9Gn_Jtc.js";import{h as ms,v as ps}from"./routePaths-c5aFJU-F.js";import{g as Ye}from"./accountMappingHelper-apHEXO4i.js";import{D as hs}from"./DrawerScreen-CKbiBlQ7.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.js";import"./decodeURIComponentSafe-C0NEXntv.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]="26c8a05b-3483-4bfb-a05a-f5191eb69dee",t._sentryDebugIdIdentifier="sentry-dbid-26c8a05b-3483-4bfb-a05a-f5191eb69dee")}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"}),T=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),T(g,f.tenantId,!0)}),[T,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:k}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect((()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&k&&T(g,f.tenantId)}),[T,g,s.fetchState,f.tenantId,k]),o.useEffect((()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&k&&t(da(g))}),[g,s.monthClosePerformanceTrendFetchStatus.fetchState,k]),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(jo,{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-C01HsTej.js";import oa from"./NotFoundScreen-BfdMMfOd.js";import{a as o,b as Jt}from"./sentry-B-4V3RdH.js";import{n as Ue,S as sa}from"./mui-DZ-Vvmtg.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-DI1Smcxr.js";import{eW as Re,T1 as la,om as Ee,fX as ra,s7 as da,oE as Kt,oZ as Zt,T2 as Qt,p7 as ua,T3 as Ht,ox as ma,rF as pa,fI as Ie,T4 as De,ud as Wt,Ez as Xt,T5 as en,T6 as ha,rd as Ze,Om as Pt,Oo as ga,kD as Ca,Op as Sa,kK as fa,c_ as Ia,vt as Qe,oK as tn,pc as Fe,oC as de,T7 as Ea,Ne as Rt,Nd as we,T8 as Dt,k$ as Ta,T9 as ka,Ta as ya,Tb as ba,Tc as va,oR as Aa,pf as xe,Td as wa,Te as xa,Tf as Pa,pm as Ra,kO as Da,kF as Fa,Tg as Ua,kN as Ft,Ow as Ba,Th as Oa,Ti as _a,r9 as Va,qN as za,pd as me,qM as Ne,Tj as Ma,Tk as La,Tl as ja,mi as $a,bo as qa,md as Ut,l$ as Ga,Tm as Na,fy as Bt,gy as Ja,ma as Ya,xm as Ka,Tn as Za,pN as Qa,pI as Ha,pM as Wa,px as Xa,To as eo,fL as nn,p0 as to,oN as no,fY as Ot,ph as ao,Tp as oo,Tq as so,pe as an,Tr as co,Ts as io,Tt as lo,Tu as ro,Tv as _t,rl as uo,qE as mo,Nc as po,Tw as ho,Tx as go,kM as Co,Ty as So,Jf as fo,kL as Io,kA as Eo,fK as To,qa as on,qw as ko,pb as Vt,pg as yo,bE as bo,m7 as vo,m4 as Ao,Tz as wo,pw as zt,qs as Mt,qq as xo,TA as Po,qf as Ro,pX as Do,qt as Fo,TB as Uo,TC as Bo,p$ as Oo,TD as _o,pS as Vo,p_ as zo,pY as Mo,qz as Lo}from"./zeni-epic-state-CGEUbbPd.js";import{C as sn,G as X,e as q,s as ae,_ as cn,a0 as ln,cZ as jo,z as Be,c_ as $o,au as Pe,c$ as qo,aZ as Lt,B as rn,d0 as Go,ar as Je,a as No,a9 as Jo,d1 as Yo,a4 as Ko,d2 as Zo,Z as Qo,d3 as Ho,d4 as Wo,Q as Xo,T as es,aS as ts,d5 as ns,d6 as as,be as os,A as ss,aV as cs}from"./index-slT6Cmx8.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-EdOjchhB.js";import{f as jt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-Dnm1o3gy.js";import{w as us}from"./withTransactionSidePanel-C_PdEYzg.js";import{h as ms,v as ps}from"./routePaths-C58Oct92.js";import{g as Ye}from"./accountMappingHelper-apHEXO4i.js";import{D as hs}from"./DrawerScreen-CbHABUlJ.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.js";import"./decodeURIComponentSafe-C0NEXntv.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]="26c8a05b-3483-4bfb-a05a-f5191eb69dee",t._sentryDebugIdIdentifier="sentry-dbid-26c8a05b-3483-4bfb-a05a-f5191eb69dee")}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"}),T=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),T(g,f.tenantId,!0)}),[T,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:k}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect((()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&k&&T(g,f.tenantId)}),[T,g,s.fetchState,f.tenantId,k]),o.useEffect((()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&k&&t(da(g))}),[g,s.monthClosePerformanceTrendFetchStatus.fetchState,k]),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(jo,{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-C01HsTej.js";import{a as r}from"./sentry-B-4V3RdH.js";import{a5 as l,a6 as p,a7 as m,r as c}from"./index-DSrpVU5Y.js";import"./mui-DZ-Vvmtg.js";import f from"./NotFoundScreen-pjqYHD4T.js";import{h as u,g as b}from"./core-DI1Smcxr.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="5a21547d-8d37-447e-91de-3190153d226c",e._sentryDebugIdIdentifier="sentry-dbid-5a21547d-8d37-447e-91de-3190153d226c")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),d=r.useCallback((()=>{(()=>{const n=c(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:m(o),onDemoClick:t,onGoBack:d}):s.jsx(f,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
1
+ import{j as s}from"./liveblocks-C01HsTej.js";import{a as r}from"./sentry-B-4V3RdH.js";import{a5 as l,a6 as p,a7 as m,r as c}from"./index-slT6Cmx8.js";import"./mui-DZ-Vvmtg.js";import f from"./NotFoundScreen-BfdMMfOd.js";import{h as u,g as b}from"./core-DI1Smcxr.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="5a21547d-8d37-447e-91de-3190153d226c",e._sentryDebugIdIdentifier="sentry-dbid-5a21547d-8d37-447e-91de-3190153d226c")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),d=r.useCallback((()=>{(()=>{const n=c(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:m(o),onDemoClick:t,onGoBack:d}):s.jsx(f,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-B-4V3RdH.js";import{u as l,h as m,g as f}from"./core-DI1Smcxr.js";import{hu as p,Mk as b,Ml as g}from"./zeni-epic-state-CGEUbbPd.js";import{u as _,L as h,z as y}from"./index-DSrpVU5Y.js";import"./liveblocks-C01HsTej.js";import"./recharts-Qx4ifl34.js";import"./mui-DZ-Vvmtg.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="35f18300-b25a-44d9-b7e8-d882d45b8b74",e._sentryDebugIdIdentifier="sentry-dbid-35f18300-b25a-44d9-b7e8-d882d45b8b74")}catch{}})();function M(){const e=l(),n=m(),o=f(),{setLoading:i,clearAllLoading:c}=_(),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"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(p(t.tenant_id,t.connection_id,b("revenue"),g("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{M as default};
1
+ import{a as r}from"./sentry-B-4V3RdH.js";import{u as l,h as m,g as f}from"./core-DI1Smcxr.js";import{hu as p,Mk as b,Ml as g}from"./zeni-epic-state-CGEUbbPd.js";import{u as _,L as h,z as y}from"./index-slT6Cmx8.js";import"./liveblocks-C01HsTej.js";import"./recharts-Qx4ifl34.js";import"./mui-DZ-Vvmtg.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="35f18300-b25a-44d9-b7e8-d882d45b8b74",e._sentryDebugIdIdentifier="sentry-dbid-35f18300-b25a-44d9-b7e8-d882d45b8b74")}catch{}})();function M(){const e=l(),n=m(),o=f(),{setLoading:i,clearAllLoading:c}=_(),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"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(p(t.tenant_id,t.connection_id,b("revenue"),g("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{M as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-C01HsTej.js";import{i as S,n as g,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-DI1Smcxr.js";import{Md as k,Me as v,Mf as F,Bh as B,B3 as T,Mg as D,Mh as oe,Mi as ie,B7 as se,fz as $,Be as le,Bb as re}from"./zeni-epic-state-CGEUbbPd.js";import{J as x,o as r,k as de,e as j,j as G,w as ce,r as me,D as pe,s as V,C as ue,G as he,M as ge,Q as xe,y as be,v as fe,B as we,x as Se,H as ye,S as ke,W as ve,A as je,R as $e}from"./index-DSrpVU5Y.js";import{n as m}from"./mui-DZ-Vvmtg.js";import b from"./NotFoundScreen-pjqYHD4T.js";import{a as I}from"./sentry-B-4V3RdH.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="8141a75e-0e6d-4e4d-b87e-965bab24b197",e._sentryDebugIdIdentifier="sentry-dbid-8141a75e-0e6d-4e4d-b87e-965bab24b197")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-C01HsTej.js";import{i as S,n as g,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-DI1Smcxr.js";import{Md as k,Me as v,Mf as F,Bh as B,B3 as T,Mg as D,Mh as oe,Mi as ie,B7 as se,fz as $,Be as le,Bb as re}from"./zeni-epic-state-CGEUbbPd.js";import{J as x,o as r,k as de,e as j,j as G,w as ce,r as me,D as pe,s as V,C as ue,G as he,M as ge,Q as xe,y as be,v as fe,B as we,x as Se,H as ye,S as ke,W as ve,A as je,R as $e}from"./index-slT6Cmx8.js";import{n as m}from"./mui-DZ-Vvmtg.js";import b from"./NotFoundScreen-BfdMMfOd.js";import{a as I}from"./sentry-B-4V3RdH.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="8141a75e-0e6d-4e4d-b87e-965bab24b197",e._sentryDebugIdIdentifier="sentry-dbid-8141a75e-0e6d-4e4d-b87e-965bab24b197")}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 f}from"./liveblocks-C01HsTej.js";import{a as u}from"./sentry-B-4V3RdH.js";import{u as F,g as _,h as O,t as w,j as l,N as z}from"./core-DI1Smcxr.js";import{z as r,y as P,a as V,f as A,e as N,g as $,m as W,H,h as R}from"./index-DSrpVU5Y.js";import{eW as Z,L_ as q,M8 as B,L$ as G,fz as J,f$ as K,M4 as Q,gp as X,cZ as Y,M9 as ee,Ma as te}from"./zeni-epic-state-CGEUbbPd.js";import{n as ne}from"./mui-DZ-Vvmtg.js";import{u as se}from"./useDeviceId-C-gS-i4X.js";import{f as ae}from"./analyticsHelper-CI2hKrei.js";import{t as ie}from"./getLocaleForTenant-C8WDJQ34.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="61cab0bc-be81-4f8f-9bf4-942f38b22cd8",t._sentryDebugIdIdentifier="sentry-dbid-61cab0bc-be81-4f8f-9bf4-942f38b22cd8")}catch{}})();const T=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Te(){const t=F(),a=_(),m=O(),[y]=w(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),k=l((e=>e.tenantState.activeTenantFetchState.fetchState)),b=l((e=>e.tenantState.signInState)),h=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>Z(e))),I=l((e=>q(e))),E=r.getSignedInUser(),v=P().mode;u.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(B(n,i,g)))}),[n,p,t,i,g,s?.zeniSessionId]),u.useEffect((()=>{b!=="In-Progress"||S!=="Completed"&&k!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(G(I.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,I.tenantsInOrder),X().then((()=>{const e=R();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin($.Event.loginSuccess,"email",Y(o.productSettings))}),2e3))}),[b,S,k,s,o,I,v,a.state,t]);const M=u.useCallback((()=>{m("/signin/auth")}),[m]),U=u.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),j=u.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(h==="Completed"&&d!=null)return f.jsx(W,{phoneNumber:x,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:U,onVerifyOtp:j,onCancelVerifyDevice:M});if(b==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return f.jsx(z,{to:e,state:{...a.state,origin:""}})}if(!T(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return f.jsx(z,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return f.jsx(oe,{"data-testid":"smooth-loader",children:f.jsx(H,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as f}from"./liveblocks-C01HsTej.js";import{a as u}from"./sentry-B-4V3RdH.js";import{u as F,g as _,h as O,t as w,j as l,N as z}from"./core-DI1Smcxr.js";import{z as r,y as P,a as V,f as A,e as N,g as $,m as W,H,h as R}from"./index-slT6Cmx8.js";import{eW as Z,L_ as q,M8 as B,L$ as G,fz as J,f$ as K,M4 as Q,gp as X,cZ as Y,M9 as ee,Ma as te}from"./zeni-epic-state-CGEUbbPd.js";import{n as ne}from"./mui-DZ-Vvmtg.js";import{u as se}from"./useDeviceId-C-gS-i4X.js";import{f as ae}from"./analyticsHelper-u_wRIr-A.js";import{t as ie}from"./getLocaleForTenant-C9HoG54f.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="61cab0bc-be81-4f8f-9bf4-942f38b22cd8",t._sentryDebugIdIdentifier="sentry-dbid-61cab0bc-be81-4f8f-9bf4-942f38b22cd8")}catch{}})();const T=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Te(){const t=F(),a=_(),m=O(),[y]=w(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),k=l((e=>e.tenantState.activeTenantFetchState.fetchState)),b=l((e=>e.tenantState.signInState)),h=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>Z(e))),I=l((e=>q(e))),E=r.getSignedInUser(),v=P().mode;u.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(B(n,i,g)))}),[n,p,t,i,g,s?.zeniSessionId]),u.useEffect((()=>{b!=="In-Progress"||S!=="Completed"&&k!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(G(I.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,I.tenantsInOrder),X().then((()=>{const e=R();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin($.Event.loginSuccess,"email",Y(o.productSettings))}),2e3))}),[b,S,k,s,o,I,v,a.state,t]);const M=u.useCallback((()=>{m("/signin/auth")}),[m]),U=u.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),j=u.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(h==="Completed"&&d!=null)return f.jsx(W,{phoneNumber:x,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:U,onVerifyOtp:j,onCancelVerifyDevice:M});if(b==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return f.jsx(z,{to:e,state:{...a.state,origin:""}})}if(!T(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return f.jsx(z,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return f.jsx(oe,{"data-testid":"smooth-loader",children:f.jsx(H,{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 V}from"./liveblocks-C01HsTej.js";import{a as l}from"./sentry-B-4V3RdH.js";import{u as fe,j as n,i as We,g as Ye,h as Qe,l as M}from"./core-DI1Smcxr.js";import{eW as me,fE as qe,fF as pe,fq as Je,bn as Ke,eV as Xe,fG as ea,fH as aa,fJ as ta,fM as na,fN as g,fP as sa,fQ as de,fT as oa,fR as ia,fS as ra,fU as da,cP as ca,fW as la,cV as ua,fp as fa,f$ as ma,g0 as pa,f_ as ba}from"./zeni-epic-state-CGEUbbPd.js";import{a9 as ha,aa as Sa,Q as ga,C as Ea,z as k,v as ka,u as Ca,G as r,i as ya,P as Ia,ab as Ta,T as _a,c as wa,ac as Aa,a5 as Fa,ad as Da,ae as va,af as ce,ag as le,L as $a,ah as Pa,ai as ue,e as R,a1 as Ga,s as _,aj as x,ak as Ma}from"./index-DSrpVU5Y.js";import{D as Ra}from"./mui-DZ-Vvmtg.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]="cf8cd69f-1b93-41e4-af03-7f0d83ef2c8e",f._sentryDebugIdIdentifier="sentry-dbid-cf8cd69f-1b93-41e4-af03-7f0d83ef2c8e")}catch{}})();const xa=ha((({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=Ye(),C=ga(),o=Qe(),N=Je(),m=fe(),{useFeatureGate:i}=Ea(),B=k.getSignedInUser(),U=Ke(B),s=n((e=>me(e))),be=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n((e=>Xe(e))),j=O.uiState.currentChatSessionId,y=ka(),{setLoading:he}=Ca(),[w,L]=l.useState(void 0),A=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,Se=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Ee=ya(s,ge,Z),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),H=n((e=>ea(e))),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),F=n((e=>aa(e)));l.useEffect((()=>{y&&T&&!I&&F.fetchState==="Not-Started"&&m(ta(!0))}),[y,T,F.fetchState,I]);const h=k.getSignedInUser(),D=n((e=>e.tenantState)),Ce=n((e=>D.fetchState==="Completed"?na(e):[])),E=n((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:_e}=i(r.isExpenseAutomationEnabledV2),W=Ia(),{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),v=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=U||!U&&ve,Pe=n((e=>g(e).totalUnreadCount)),Ge=n((e=>g(e).reducedFetchCountState)),Y=n((e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount)),Q=n((e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount)),Me=n((e=>g(e).notificationDetailsByTab.tasks.fetchCountState)),$=n((e=>g(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:q,isLoading:J,isFetchingMore:K,hasFetchedAll:X,fetchMore:Re}=Ta();l.useEffect((()=>{const e=setTimeout((()=>Re?.()),0);return()=>clearTimeout(e)})),l.useEffect((()=>{if(J===!1&&K===!1&&X===!0)if(s?.companyId!=null&&q!=null){const e=`dashboard_${s.companyId}`;L(q.filter((u=>u.roomId===e&&u.readAt==null)).length)}else L(0)}),[J,K,X]),l.useEffect((()=>{y&&!I&&Me.fetchState==="Not-Started"&&N.tenantId!=null&&m(sa("task_manager","dashboard"))}),[y,N.tenantId]),l.useEffect((()=>{I||$.fetchState!=="Not-Started"||m(de({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),l.useEffect((()=>{w!=null&&$.fetchState==="In-Progress"&&(m(de({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:w},"comments")))}),[w,$.fetchState]);const xe={fetchStatus:Ge,count:Pe},ee=t!=null?k.getSignedInUserTenant(t):null,ae=n((e=>ee?.tenantId!=null?oa(e,ee.tenantId):void 0)),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),S.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&S.push("rewards_card"),W===!1&&S.push("expense_automation_card");const Ve=_a(),te=n((e=>ia(e,S,h,_e,Te).fetchState)),ne=n((e=>ra(e).fetchState)),Ne=A&&(te==="Completed"||te==="Error")||z&&(ne==="Completed"||ne==="Error")||!A&&!z?void 0:"disabled",Be=l.useMemo((()=>da(s.userRole)),[s.userRole]),Ue=ca(Be),Oe=s?.rewardsLastViewedTime==null,je=h?.userEmail!=null&&H.fetchState==="Completed"&&la(H.notificationSettings,h.userEmail,Z,s),se=wa(),Le=se&&Aa(a),oe=ua(Ve?.loggedInUserRoleMap),ie=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,P=l.useCallback((()=>v&&oe&&!k.getTreasuryPopupSeen(t??"")&&ie===!1&&Fa(a.pathname)!=="treasury"),[v,oe,ie,a.pathname,t]),[ze,re]=l.useState(P);l.useEffect((()=>{re(P())}),[P]);const Ze=n((e=>e.treasurySetupViewState.treasuryFundsDetails)).fundsDetails,He=Da(Ze);return V.jsx(Ra,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(va,{signedInUser:B,currentTenantId:D.currentTenantId??"",tenants:D.fetchState==="Completed"?Ce:ae!=null?[ae]:[],currentTenant:s,isTenantDropdownDisabled:Ne,isSettings:le(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Ue,isZeniAccountEnabled:Se,isChargeCardEnabled:Ee,isTreasuryEnabled:v,treasuryYieldPercentage:He,isTreasuryPopupVisible:ze,isNotificationsTabVisible:je,notificationCountDetails:xe,isExpenseAutomationEnabledForUser:W,selectedMenu:ce(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:F.rewardsPlan},isAiCfoAccessEnabled:se,onNotificationIconClick:()=>{d(!1);let e=Y===0&&Q>0?"notifications/comments":"notifications/tasks";le(a)&&(e=Y===0&&Q>0?"../../notifications/comments":"../../notifications/tasks");const u=_(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!be)return void Ga({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),c=e.type,p=x(c)&&c!=="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 G=Ma(e.type);ue(e.type)?(j!=null&&m(ba()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${G}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{he($a.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,c=ce(a);let p=`/${encodeURIComponent(u)}/`;const G=x(c);c==="home"?p+="dashboard":c==="users_and_roles"?p+="people":Pa(c)?p+="settings/my_profile":ue(c)?p+=`ai-cfo/${c}`:p+=c==="task_checklist"?"tasks":G?"month_end_close_checks/review":encodeURIComponent(c),o(p,{replace:!0}),h!=null&&(m(ma(e.tenantId)),m(pa(h.userId,e.tenantId,h.zeniSessionId)));const b=e;R.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),re(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Le,aiCfoView:O,isOnDashboard:A,updateCurrentChatSessionId:e=>{m(fa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})})),La=f=>{const d=fe(),t=n((C=>me(C))),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Sa(o)&&qe(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return V.jsx(xa,{...f,...a})};export{La as M};
1
+ import{j as V}from"./liveblocks-C01HsTej.js";import{a as l}from"./sentry-B-4V3RdH.js";import{u as fe,j as n,i as We,g as Ye,h as Qe,l as M}from"./core-DI1Smcxr.js";import{eW as me,fE as qe,fF as pe,fq as Je,bn as Ke,eV as Xe,fG as ea,fH as aa,fJ as ta,fM as na,fN as g,fP as sa,fQ as de,fT as oa,fR as ia,fS as ra,fU as da,cP as ca,fW as la,cV as ua,fp as fa,f$ as ma,g0 as pa,f_ as ba}from"./zeni-epic-state-CGEUbbPd.js";import{a9 as ha,aa as Sa,Q as ga,C as Ea,z as k,v as ka,u as Ca,G as r,i as ya,P as Ia,ab as Ta,T as _a,c as wa,ac as Aa,a5 as Fa,ad as Da,ae as va,af as ce,ag as le,L as $a,ah as Pa,ai as ue,e as R,a1 as Ga,s as _,aj as x,ak as Ma}from"./index-slT6Cmx8.js";import{D as Ra}from"./mui-DZ-Vvmtg.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]="cf8cd69f-1b93-41e4-af03-7f0d83ef2c8e",f._sentryDebugIdIdentifier="sentry-dbid-cf8cd69f-1b93-41e4-af03-7f0d83ef2c8e")}catch{}})();const xa=ha((({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=Ye(),C=ga(),o=Qe(),N=Je(),m=fe(),{useFeatureGate:i}=Ea(),B=k.getSignedInUser(),U=Ke(B),s=n((e=>me(e))),be=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n((e=>Xe(e))),j=O.uiState.currentChatSessionId,y=ka(),{setLoading:he}=Ca(),[w,L]=l.useState(void 0),A=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,Se=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Ee=ya(s,ge,Z),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),H=n((e=>ea(e))),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),F=n((e=>aa(e)));l.useEffect((()=>{y&&T&&!I&&F.fetchState==="Not-Started"&&m(ta(!0))}),[y,T,F.fetchState,I]);const h=k.getSignedInUser(),D=n((e=>e.tenantState)),Ce=n((e=>D.fetchState==="Completed"?na(e):[])),E=n((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:_e}=i(r.isExpenseAutomationEnabledV2),W=Ia(),{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),v=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=U||!U&&ve,Pe=n((e=>g(e).totalUnreadCount)),Ge=n((e=>g(e).reducedFetchCountState)),Y=n((e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount)),Q=n((e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount)),Me=n((e=>g(e).notificationDetailsByTab.tasks.fetchCountState)),$=n((e=>g(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:q,isLoading:J,isFetchingMore:K,hasFetchedAll:X,fetchMore:Re}=Ta();l.useEffect((()=>{const e=setTimeout((()=>Re?.()),0);return()=>clearTimeout(e)})),l.useEffect((()=>{if(J===!1&&K===!1&&X===!0)if(s?.companyId!=null&&q!=null){const e=`dashboard_${s.companyId}`;L(q.filter((u=>u.roomId===e&&u.readAt==null)).length)}else L(0)}),[J,K,X]),l.useEffect((()=>{y&&!I&&Me.fetchState==="Not-Started"&&N.tenantId!=null&&m(sa("task_manager","dashboard"))}),[y,N.tenantId]),l.useEffect((()=>{I||$.fetchState!=="Not-Started"||m(de({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),l.useEffect((()=>{w!=null&&$.fetchState==="In-Progress"&&(m(de({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:w},"comments")))}),[w,$.fetchState]);const xe={fetchStatus:Ge,count:Pe},ee=t!=null?k.getSignedInUserTenant(t):null,ae=n((e=>ee?.tenantId!=null?oa(e,ee.tenantId):void 0)),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),S.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&S.push("rewards_card"),W===!1&&S.push("expense_automation_card");const Ve=_a(),te=n((e=>ia(e,S,h,_e,Te).fetchState)),ne=n((e=>ra(e).fetchState)),Ne=A&&(te==="Completed"||te==="Error")||z&&(ne==="Completed"||ne==="Error")||!A&&!z?void 0:"disabled",Be=l.useMemo((()=>da(s.userRole)),[s.userRole]),Ue=ca(Be),Oe=s?.rewardsLastViewedTime==null,je=h?.userEmail!=null&&H.fetchState==="Completed"&&la(H.notificationSettings,h.userEmail,Z,s),se=wa(),Le=se&&Aa(a),oe=ua(Ve?.loggedInUserRoleMap),ie=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,P=l.useCallback((()=>v&&oe&&!k.getTreasuryPopupSeen(t??"")&&ie===!1&&Fa(a.pathname)!=="treasury"),[v,oe,ie,a.pathname,t]),[ze,re]=l.useState(P);l.useEffect((()=>{re(P())}),[P]);const Ze=n((e=>e.treasurySetupViewState.treasuryFundsDetails)).fundsDetails,He=Da(Ze);return V.jsx(Ra,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(va,{signedInUser:B,currentTenantId:D.currentTenantId??"",tenants:D.fetchState==="Completed"?Ce:ae!=null?[ae]:[],currentTenant:s,isTenantDropdownDisabled:Ne,isSettings:le(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Ue,isZeniAccountEnabled:Se,isChargeCardEnabled:Ee,isTreasuryEnabled:v,treasuryYieldPercentage:He,isTreasuryPopupVisible:ze,isNotificationsTabVisible:je,notificationCountDetails:xe,isExpenseAutomationEnabledForUser:W,selectedMenu:ce(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:F.rewardsPlan},isAiCfoAccessEnabled:se,onNotificationIconClick:()=>{d(!1);let e=Y===0&&Q>0?"notifications/comments":"notifications/tasks";le(a)&&(e=Y===0&&Q>0?"../../notifications/comments":"../../notifications/tasks");const u=_(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!be)return void Ga({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),c=e.type,p=x(c)&&c!=="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 G=Ma(e.type);ue(e.type)?(j!=null&&m(ba()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${G}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{he($a.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,c=ce(a);let p=`/${encodeURIComponent(u)}/`;const G=x(c);c==="home"?p+="dashboard":c==="users_and_roles"?p+="people":Pa(c)?p+="settings/my_profile":ue(c)?p+=`ai-cfo/${c}`:p+=c==="task_checklist"?"tasks":G?"month_end_close_checks/review":encodeURIComponent(c),o(p,{replace:!0}),h!=null&&(m(ma(e.tenantId)),m(pa(h.userId,e.tenantId,h.zeniSessionId)));const b=e;R.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),re(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Le,aiCfoView:O,isOnDashboard:A,updateCurrentChatSessionId:e=>{m(fa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})})),La=f=>{const d=fe(),t=n((C=>me(C))),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Sa(o)&&qe(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return V.jsx(xa,{...f,...a})};export{La as M};
@@ -1 +1 @@
1
- import{j as r}from"./liveblocks-C01HsTej.js";import{h as n,n as i}from"./core-DI1Smcxr.js";import{O as e}from"./index-DSrpVU5Y.js";import"./mui-DZ-Vvmtg.js";import"./sentry-B-4V3RdH.js";import"./zeni-epic-state-CGEUbbPd.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="d7666c0b-2a75-4baf-97d7-b828025403bf",o._sentryDebugIdIdentifier="sentry-dbid-d7666c0b-2a75-4baf-97d7-b828025403bf")}catch{}})();const a=i(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(e);function _(){const o=n();return r.jsx(a,{navigate:o})}export{_ as default};
1
+ import{j as r}from"./liveblocks-C01HsTej.js";import{h as n,n as i}from"./core-DI1Smcxr.js";import{O as e}from"./index-slT6Cmx8.js";import"./mui-DZ-Vvmtg.js";import"./sentry-B-4V3RdH.js";import"./zeni-epic-state-CGEUbbPd.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="d7666c0b-2a75-4baf-97d7-b828025403bf",o._sentryDebugIdIdentifier="sentry-dbid-d7666c0b-2a75-4baf-97d7-b828025403bf")}catch{}})();const a=i(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(e);function _(){const o=n();return r.jsx(a,{navigate:o})}export{_ as default};
@@ -1 +1 @@
1
- import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-C01HsTej.js";import lt from"./NotFoundScreen-pjqYHD4T.js";import{a as k}from"./sentry-B-4V3RdH.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 Y}from"./core-DI1Smcxr.js";import{cw as St,fG as H,eW as Q,fU as bt,fN as b,SY as J,fQ as d,fF as y,sr as M,xZ as It,SZ as Ct,fE as Tt,fW as yt,sw as _t,S_ as $,bo as F,fy as x,sA as q,S$ as At,cI as Et,cB as Nt}from"./zeni-epic-state-CGEUbbPd.js";import{_ as Bt,z as wt,C as xt,G as Gt,a0 as Rt,cW as Ut,s as N,a9 as Dt,cX as vt,aa as Pt,r as $t}from"./index-DSrpVU5Y.js";import"./mui-DZ-Vvmtg.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-DndeBqh3.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="2886bc82-2066-4d45-acbd-358bf8ef6b88",t._sentryDebugIdIdentifier="sentry-dbid-2886bc82-2066-4d45-acbd-358bf8ef6b88")}catch{}})();const Mt=(t,l)=>new Promise(((n,u)=>{const g=t.map((i=>new Promise((s=>{l(i),s()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((i=>{u(i)}))})),jt=kt((function(t,l){const n=H(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Q(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:G}=l;return{onNotificationClick:(a,o,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(q("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(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(At(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(q("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map((r=>{m==="read"&&(B(r),t($([r],F())))}))).then((()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then((()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=$t(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)),Wt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,G]=k.useState(!1),a=S((e=>H(e))),o=S((e=>Q(e))),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Gt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({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)),W=S((e=>b(e).currentTab)),R=S((e=>b(e).currentSubTab)),O=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),U=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),tt=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),et=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),at=Ut().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:V,isLoading:Z,fetchMore:z,isFetchingMore:L,hasFetchedAll:X}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect((()=>{if(W!==i&&i!=null&&s(J(i)),i==null){const e=`../${W}`,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(_===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter((T=>T.roomId===e&&T.readAt==null)).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}}),[_,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=_||D===!0||C!==!0||_||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"&&B===!1&&(G(!0),s(It()))}),[a.fetchState]),k.useEffect((()=>{if(_===!1&&Z===!1&&w!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=w.filter((f=>f.roomId===e)).filter((f=>f.kind==="thread")),T=p.filter((f=>f.readAt==null)),A=p.map((f=>f.id)),it=p.map((f=>{const P=V.find((rt=>rt.id===f.threadId));return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(L||X===!0||z==null||z(),null)})).filter((f=>f!=null));s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}}),[_,D,L,C,X,Z,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];R==="all"?A.push("read","unread"):R!=="mentions"&&A.push(R),s(M("task_manager",T,A,!0))}}}},nt=dt();return E.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 E.jsxs(gt,{children:[E.jsx(Y,{path:"/:selectedTab",element:E.jsx(Wt,{})}),E.jsx(Y,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
1
+ import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-C01HsTej.js";import lt from"./NotFoundScreen-BfdMMfOd.js";import{a as k}from"./sentry-B-4V3RdH.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 Y}from"./core-DI1Smcxr.js";import{cw as St,fG as H,eW as Q,fU as bt,fN as b,SY as J,fQ as d,fF as y,sr as M,xZ as It,SZ as Ct,fE as Tt,fW as yt,sw as _t,S_ as $,bo as F,fy as x,sA as q,S$ as At,cI as Et,cB as Nt}from"./zeni-epic-state-CGEUbbPd.js";import{_ as Bt,z as wt,C as xt,G as Gt,a0 as Rt,cW as Ut,s as N,a9 as Dt,cX as vt,aa as Pt,r as $t}from"./index-slT6Cmx8.js";import"./mui-DZ-Vvmtg.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-EdOjchhB.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="2886bc82-2066-4d45-acbd-358bf8ef6b88",t._sentryDebugIdIdentifier="sentry-dbid-2886bc82-2066-4d45-acbd-358bf8ef6b88")}catch{}})();const Mt=(t,l)=>new Promise(((n,u)=>{const g=t.map((i=>new Promise((s=>{l(i),s()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((i=>{u(i)}))})),jt=kt((function(t,l){const n=H(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Q(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:G}=l;return{onNotificationClick:(a,o,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(q("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(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(At(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(q("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map((r=>{m==="read"&&(B(r),t($([r],F())))}))).then((()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then((()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=$t(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)),Wt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,G]=k.useState(!1),a=S((e=>H(e))),o=S((e=>Q(e))),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Gt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({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)),W=S((e=>b(e).currentTab)),R=S((e=>b(e).currentSubTab)),O=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),U=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),tt=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),et=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),at=Ut().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:V,isLoading:Z,fetchMore:z,isFetchingMore:L,hasFetchedAll:X}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect((()=>{if(W!==i&&i!=null&&s(J(i)),i==null){const e=`../${W}`,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(_===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter((T=>T.roomId===e&&T.readAt==null)).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}}),[_,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=_||D===!0||C!==!0||_||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"&&B===!1&&(G(!0),s(It()))}),[a.fetchState]),k.useEffect((()=>{if(_===!1&&Z===!1&&w!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=w.filter((f=>f.roomId===e)).filter((f=>f.kind==="thread")),T=p.filter((f=>f.readAt==null)),A=p.map((f=>f.id)),it=p.map((f=>{const P=V.find((rt=>rt.id===f.threadId));return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(L||X===!0||z==null||z(),null)})).filter((f=>f!=null));s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}}),[_,D,L,C,X,Z,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];R==="all"?A.push("read","unread"):R!=="mentions"&&A.push(R),s(M("task_manager",T,A,!0))}}}},nt=dt();return E.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 E.jsxs(gt,{children:[E.jsx(Y,{path:"/:selectedTab",element:E.jsx(Wt,{})}),E.jsx(Y,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-C01HsTej.js";import{a as r}from"./sentry-B-4V3RdH.js";import{u as T,g as A,j as o,N as j}from"./core-DI1Smcxr.js";import{Mn as C,eW as P,fM as x,Mo as z,Mp as D,Mq as L,Mr as R,oc as k,Lk as q}from"./zeni-epic-state-CGEUbbPd.js";import{z as h,I}from"./index-DSrpVU5Y.js";import"./mui-DZ-Vvmtg.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="a197aefb-6aeb-461d-b6fa-749ec72dc861",n._sentryDebugIdIdentifier="sentry-dbid-a197aefb-6aeb-461d-b6fa-749ec72dc861")}catch{}})();function ee(){const n=T(),a=A(),{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)),b=o(z),y=o(D),c=o(L),[v,S]=r.useState(null),[E,M]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(R())}),[n,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=v??_;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:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&s!=null&&u!=null&&n(q(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(j,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
1
+ import{j as m}from"./liveblocks-C01HsTej.js";import{a as r}from"./sentry-B-4V3RdH.js";import{u as T,g as A,j as o,N as j}from"./core-DI1Smcxr.js";import{Mn as C,eW as P,fM as x,Mo as z,Mp as D,Mq as L,Mr as R,oc as k,Lk as q}from"./zeni-epic-state-CGEUbbPd.js";import{z as h,I}from"./index-slT6Cmx8.js";import"./mui-DZ-Vvmtg.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="a197aefb-6aeb-461d-b6fa-749ec72dc861",n._sentryDebugIdIdentifier="sentry-dbid-a197aefb-6aeb-461d-b6fa-749ec72dc861")}catch{}})();function ee(){const n=T(),a=A(),{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)),b=o(z),y=o(D),c=o(L),[v,S]=r.useState(null),[E,M]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(R())}),[n,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=v??_;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:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&s!=null&&u!=null&&n(q(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(j,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-C01HsTej.js";import{h as z,u as Z,g as H,i as K,j as d,n as J,o as Q,p as I}from"./core-DI1Smcxr.js";import{eW as M,sf as R,rP as X,MU as O,rK as T,bs as ee,bn as ae,bZ as te,rL as se,MV as oe,MH as C,dI as re,vW as ne,MW as ie,wh as ce,fD as le,fB as de}from"./zeni-epic-state-CGEUbbPd.js";import{z as me,_ as fe,a0 as pe,T as ue,C as v,G as $,x as he,e as w,ap as ge,s as Fe}from"./index-DSrpVU5Y.js";import"./mui-DZ-Vvmtg.js";import be from"./NotFoundScreen-pjqYHD4T.js";import{F as Ie}from"./FeaturePreviewScreen-BpeRjZY3.js";import{a as g}from"./sentry-B-4V3RdH.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-DndeBqh3.js";import{u as Te}from"./useInitialThreadRequest-CvusWtwP.js";import{t as Se}from"./routePaths-c5aFJU-F.js";import{M as ye}from"./MobileAppDrawer-mJR72DtA.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="1ea47f82-1640-4d88-a400-8ddb2439f8ba",s._sentryDebugIdIdentifier="sentry-dbid-1ea47f82-1640-4d88-a400-8ddb2439f8ba")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=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:w}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ge);function U(){const s=z(),e=Z(),a=H(),{forecastId:o,tenantEmailDomain:r}=K(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d((t=>M(t))),W=y.company?.companyInfo.firstMonthOfFY??1,c=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),x=d((t=>t.profitAndLossState)),A=d((t=>t.reportUIOptionsState.selectedForecast)),D=t=>x.pandLByForecastID[t]!=null&&se(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:_}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,E,P)=>E!=null?f.forecasts.findIndex((b=>b.id===E)):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(O(c.forecasts[t].id,t)),S(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!D(c.forecasts[t].id)&&F&&e(T(c.forecasts[t].id))}}),[i,p,e,l,c,m,u,R,T,F]);const k=ue(),q=k?.loggedInUserRole!=null&&ee(k.loggedInUserRole),{useFeatureGate:G}=v(),{isFeatureEnabled:L}=G($.isReportsCommentingEnabled),N=Te(L?y?.companyId:void 0,{clearParams:l&&m}),[V,Y]=g.useState(!1),j=t=>{Y(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:j}),n.jsx(xe,{firstMonthOfFY:W,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:q,isAiCfoAccessEnabled:B,onAskAiCfoClick:_,isReportsCommentingEnabled:L,isZeniUser:ae(h),initialOpenThreadRequest:N,onClickMenuIcon:()=>{j(!0)}})]})}function Ye(){const s=d((i=>M(i))),{useFeatureGate:e}=v(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
1
+ import{j as n}from"./liveblocks-C01HsTej.js";import{h as z,u as Z,g as H,i as K,j as d,n as J,o as Q,p as I}from"./core-DI1Smcxr.js";import{eW as M,sf as R,rP as X,MU as O,rK as T,bs as ee,bn as ae,bZ as te,rL as se,MV as oe,MH as C,dI as re,vW as ne,MW as ie,wh as ce,fD as le,fB as de}from"./zeni-epic-state-CGEUbbPd.js";import{z as me,_ as fe,a0 as pe,T as ue,C as v,G as $,x as he,e as w,ap as ge,s as Fe}from"./index-slT6Cmx8.js";import"./mui-DZ-Vvmtg.js";import be from"./NotFoundScreen-BfdMMfOd.js";import{F as Ie}from"./FeaturePreviewScreen-BtXMKquo.js";import{a as g}from"./sentry-B-4V3RdH.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-EdOjchhB.js";import{u as Te}from"./useInitialThreadRequest-Dcty95yd.js";import{t as Se}from"./routePaths-C58Oct92.js";import{M as ye}from"./MobileAppDrawer-RaFZojI2.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="1ea47f82-1640-4d88-a400-8ddb2439f8ba",s._sentryDebugIdIdentifier="sentry-dbid-1ea47f82-1640-4d88-a400-8ddb2439f8ba")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=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:w}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ge);function U(){const s=z(),e=Z(),a=H(),{forecastId:o,tenantEmailDomain:r}=K(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d((t=>M(t))),W=y.company?.companyInfo.firstMonthOfFY??1,c=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),x=d((t=>t.profitAndLossState)),A=d((t=>t.reportUIOptionsState.selectedForecast)),D=t=>x.pandLByForecastID[t]!=null&&se(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:_}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,E,P)=>E!=null?f.forecasts.findIndex((b=>b.id===E)):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(O(c.forecasts[t].id,t)),S(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!D(c.forecasts[t].id)&&F&&e(T(c.forecasts[t].id))}}),[i,p,e,l,c,m,u,R,T,F]);const k=ue(),q=k?.loggedInUserRole!=null&&ee(k.loggedInUserRole),{useFeatureGate:G}=v(),{isFeatureEnabled:L}=G($.isReportsCommentingEnabled),N=Te(L?y?.companyId:void 0,{clearParams:l&&m}),[V,Y]=g.useState(!1),j=t=>{Y(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:j}),n.jsx(xe,{firstMonthOfFY:W,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:q,isAiCfoAccessEnabled:B,onAskAiCfoClick:_,isReportsCommentingEnabled:L,isZeniUser:ae(h),initialOpenThreadRequest:N,onClickMenuIcon:()=>{j(!0)}})]})}function Ye(){const s=d((i=>M(i))),{useFeatureGate:e}=v(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-C01HsTej.js";import{MQ as ne,eW as N,kA as W,fD as Y,fB as oe,Ki as q,Mu as ie,uT as ke,MR as J,uI as Ee,v1 as Pe,uX as re,uM as le,u$ as je,uY as Te,MS as de,wI as ve,fn as Le,gf as Ae,MT as H,uQ as ce,uP as pe,v4 as Re,c7 as Fe}from"./zeni-epic-state-CGEUbbPd.js";import{J as ue,C as ee,G as z,z as _,i as me,X as fe,E as ge,al as he,am as Oe,A as Ce,o as O,F as ye,a as be,an as Ve,_ as Be,a0 as Ze,x as Ue,e as Se,g as $e,s as Me,ao as He,T as ze}from"./index-DSrpVU5Y.js";import{D as we,n as Q,S as xe}from"./mui-DZ-Vvmtg.js";import se from"./NotFoundScreen-pjqYHD4T.js";import{a as d}from"./sentry-B-4V3RdH.js";import{u as ae,i as Ge,j as f,h as Ke,g as We,n as _e,o as te,p as M}from"./core-DI1Smcxr.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-DndeBqh3.js";import{M as Xe}from"./MobileAppDrawer-mJR72DtA.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="a00271bc-f1f8-40f6-9a62-4a33ba9364f6",e._sentryDebugIdIdentifier="sentry-dbid-a00271bc-f1f8-40f6-9a62-4a33ba9364f6")}catch{}})();const Je={overlayWidth:new Ce(100,100,48)},G=be.getLocalizedStrings().peoplePage.invitePage,Ne=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:g,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=ue(),m=ae(),[V,B]=d.useState(!1),[k,S]=d.useState(!1),{userId:w}=Ge(),r=f((l=>ne(l))),p=f((l=>N(l))),E=f((l=>W(l))),{useFeatureGate:D}=ee(),{isFeatureEnabled:I}=D(z.isDebitCardFeatureEnabled),P=Y(I,p),v=oe(p),L=q(p),Z=ie(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(_.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(J()),b()},A=()=>{V===!0?S(!0):C()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=D(z.isChargeCardFeatureEnabled),T=me(p,j,I),{isCardsHidden:R}=fe(p?.tenantId),y=!T||R,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:g,isZeniTenant:L,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(le(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(re({peopleLocalData:l})),B(!0)},onSaveClick:()=>{m(g==="zeni_only"?Ee(e):Pe(L))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return d.useEffect((()=>{x===!1&&w!=null&&m(ke(w))}),[x,w]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:Je.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ge.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(Ye,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(he,{titleComponent:a.jsx(De,{children:G.discardTitle}),descriptionComponent:a.jsx(Ie,{children:G.discardDescription}),primaryButtonText:G.discard,secondaryButtonText:G.no,action:o,isEditPopup:!0}):null,a.jsx(Oe,{...s})]})})},Ye=Q(xe)`
1
+ import{j as a}from"./liveblocks-C01HsTej.js";import{MQ as ne,eW as N,kA as W,fD as Y,fB as oe,Ki as q,Mu as ie,uT as ke,MR as J,uI as Ee,v1 as Pe,uX as re,uM as le,u$ as je,uY as Te,MS as de,wI as ve,fn as Le,gf as Ae,MT as H,uQ as ce,uP as pe,v4 as Re,c7 as Fe}from"./zeni-epic-state-CGEUbbPd.js";import{J as ue,C as ee,G as z,z as _,i as me,X as fe,E as ge,al as he,am as Oe,A as Ce,o as O,F as ye,a as be,an as Ve,_ as Be,a0 as Ze,x as Ue,e as Se,g as $e,s as Me,ao as He,T as ze}from"./index-slT6Cmx8.js";import{D as we,n as Q,S as xe}from"./mui-DZ-Vvmtg.js";import se from"./NotFoundScreen-BfdMMfOd.js";import{a as d}from"./sentry-B-4V3RdH.js";import{u as ae,i as Ge,j as f,h as Ke,g as We,n as _e,o as te,p as M}from"./core-DI1Smcxr.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-EdOjchhB.js";import{M as Xe}from"./MobileAppDrawer-RaFZojI2.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="a00271bc-f1f8-40f6-9a62-4a33ba9364f6",e._sentryDebugIdIdentifier="sentry-dbid-a00271bc-f1f8-40f6-9a62-4a33ba9364f6")}catch{}})();const Je={overlayWidth:new Ce(100,100,48)},G=be.getLocalizedStrings().peoplePage.invitePage,Ne=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:g,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=ue(),m=ae(),[V,B]=d.useState(!1),[k,S]=d.useState(!1),{userId:w}=Ge(),r=f((l=>ne(l))),p=f((l=>N(l))),E=f((l=>W(l))),{useFeatureGate:D}=ee(),{isFeatureEnabled:I}=D(z.isDebitCardFeatureEnabled),P=Y(I,p),v=oe(p),L=q(p),Z=ie(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(_.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(J()),b()},A=()=>{V===!0?S(!0):C()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=D(z.isChargeCardFeatureEnabled),T=me(p,j,I),{isCardsHidden:R}=fe(p?.tenantId),y=!T||R,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:g,isZeniTenant:L,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:C,onDeleteUser:l=>{m(le(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(re({peopleLocalData:l})),B(!0)},onSaveClick:()=>{m(g==="zeni_only"?Ee(e):Pe(L))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return d.useEffect((()=>{x===!1&&w!=null&&m(ke(w))}),[x,w]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:Je.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ge.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(Ye,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(he,{titleComponent:a.jsx(De,{children:G.discardTitle}),descriptionComponent:a.jsx(Ie,{children:G.discardDescription}),primaryButtonText:G.discard,secondaryButtonText:G.no,action:o,isEditPopup:!0}):null,a.jsx(Oe,{...s})]})})},Ye=Q(xe)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-C01HsTej.js";import E from"./NotFoundScreen-pjqYHD4T.js";import{a as r}from"./sentry-B-4V3RdH.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-DI1Smcxr.js";import{eW as B,T0 as b,bq as F,bn as N,ig as V,fy as q}from"./zeni-epic-state-CGEUbbPd.js";import{Q,z as I,a0 as W,cY as Y}from"./index-DSrpVU5Y.js";import"./mui-DZ-Vvmtg.js";import{u as $}from"./useAskAiCfoHostNavButtonProps-DndeBqh3.js";import{M as G}from"./MobileAppDrawer-mJR72DtA.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="f5465260-1482-4ded-86ea-5dc0e98b9398",e._sentryDebugIdIdentifier="sentry-dbid-f5465260-1482-4ded-86ea-5dc0e98b9398")}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)}}}))(Y),J=()=>{const e=_(),t=v(),c=Q(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,y=N(l),x=C||k||y,d=r.useCallback(((a,i,A)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:A}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:T}=$({mobileExploreReferrer:"Performance"});return W({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(G,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(H,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:T})]}):s.jsx(P,{to:`/${f}/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-C01HsTej.js";import E from"./NotFoundScreen-BfdMMfOd.js";import{a as r}from"./sentry-B-4V3RdH.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-DI1Smcxr.js";import{eW as B,T0 as b,bq as F,bn as N,ig as V,fy as q}from"./zeni-epic-state-CGEUbbPd.js";import{Q,z as I,a0 as W,cY as Y}from"./index-slT6Cmx8.js";import"./mui-DZ-Vvmtg.js";import{u as $}from"./useAskAiCfoHostNavButtonProps-EdOjchhB.js";import{M as G}from"./MobileAppDrawer-RaFZojI2.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.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]="f5465260-1482-4ded-86ea-5dc0e98b9398",e._sentryDebugIdIdentifier="sentry-dbid-f5465260-1482-4ded-86ea-5dc0e98b9398")}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)}}}))(Y),J=()=>{const e=_(),t=v(),c=Q(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,y=N(l),x=C||k||y,d=r.useCallback(((a,i,A)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:A}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:T}=$({mobileExploreReferrer:"Performance"});return W({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(G,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(H,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:T})]}):s.jsx(P,{to:`/${f}/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-C01HsTej.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-B-4V3RdH.js";import{L as dt,bZ as Tc,eW as Ac,L_ as Rc,Ms as kl,c7 as Tl,f$ as Al,g0 as Rl}from"./zeni-epic-state-CGEUbbPd.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-BOGrYMhV.js";import{r as un}from"./empty-C6aToBsY.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-B0_dT7At.js";import{r as Gl}from"./index-cOvc-dm-.js";import{r as zl}from"./index-M61CzUcb.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-DI1Smcxr.js";import{u as Kl,z as Pc,L as Wl,K as Jl,N as Xl,j as Ql,e as tf}from"./index-DSrpVU5Y.js";import"./mui-DZ-Vvmtg.js";import{d as Pe}from"./decodeURIComponentSafe-C0NEXntv.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]="8bdfd2d5-40e0-41c3-b4cc-17b85bc858e5",t._sentryDebugIdIdentifier="sentry-dbid-8bdfd2d5-40e0-41c3-b4cc-17b85bc858e5")}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-C01HsTej.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-B-4V3RdH.js";import{L as dt,bZ as Tc,eW as Ac,L_ as Rc,Ms as kl,c7 as Tl,f$ as Al,g0 as Rl}from"./zeni-epic-state-CGEUbbPd.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-BOGrYMhV.js";import{r as un}from"./empty-C6aToBsY.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-B0_dT7At.js";import{r as Gl}from"./index-cOvc-dm-.js";import{r as zl}from"./index-M61CzUcb.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-DI1Smcxr.js";import{u as Kl,z as Pc,L as Wl,K as Jl,N as Xl,j as Ql,e as tf}from"./index-slT6Cmx8.js";import"./mui-DZ-Vvmtg.js";import{d as Pe}from"./decodeURIComponentSafe-C0NEXntv.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]="8bdfd2d5-40e0-41c3-b4cc-17b85bc858e5",t._sentryDebugIdIdentifier="sentry-dbid-8bdfd2d5-40e0-41c3-b4cc-17b85bc858e5")}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 +1 @@
1
- import{j as r}from"./liveblocks-C01HsTej.js";import _ from"./NotFoundScreen-pjqYHD4T.js";import{a as p}from"./sentry-B-4V3RdH.js";import{h as A,g as E,u as C,j as u,N as D,n as k,o as F,p as g}from"./core-DI1Smcxr.js";import{eW as I,Qi as b,Qy as S,FH as V,EQ as U,FG as d,Fx as L,QL as B,FJ as O}from"./zeni-epic-state-CGEUbbPd.js";import{z as N,a9 as T,bZ as Q,ag as $,bC as z,b_ as G}from"./index-DSrpVU5Y.js";import"./mui-DZ-Vvmtg.js";import{u as H,R as x}from"./ReimbursementApprovalRuleDetailScreen-CKegjQI1.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]="1cd23994-992a-4869-9996-c8b5f6837ee6",e._sentryDebugIdIdentifier="sentry-dbid-1cd23994-992a-4869-9996-c8b5f6837ee6")}catch{}})();const y="reimbursement-approval-rule-update",J=k((function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(B(!1))},onBackClick:()=>{$(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}}))(T(Q)),K=({isLoading:e})=>{const o=A(),s=E(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),c=u((a=>b(a))),v=u((a=>S(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((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))}),[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,W,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(J,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",Z=k((function(e){const o=b(e),s=S(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(j)&&e(B(!1))},onBackClick:()=>{$(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(O(t,!0))}}}))(T(G)),q=()=>{const e=u((n=>I(n))),{isApprovalRulesV3Enabled:o,isLoading:s}=z(e?.tenantId);return o?r.jsx(M,{isLoading:s}):r.jsx(K,{isLoading:s})},M=({isLoading:e})=>{const o=A(),s=E(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),c=u((a=>b(a)));H();const v=u((a=>S(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((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))}),[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,W,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(Z,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(F,{children:[r.jsx(g,{path:"/",element:r.jsx(q,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
1
+ import{j as r}from"./liveblocks-C01HsTej.js";import _ from"./NotFoundScreen-BfdMMfOd.js";import{a as p}from"./sentry-B-4V3RdH.js";import{h as A,g as E,u as C,j as u,N as D,n as k,o as F,p as g}from"./core-DI1Smcxr.js";import{eW as I,Qi as b,Qy as S,FH as V,EQ as U,FG as d,Fx as L,QL as B,FJ as O}from"./zeni-epic-state-CGEUbbPd.js";import{z as N,a9 as T,bZ as Q,ag as $,bC as z,b_ as G}from"./index-slT6Cmx8.js";import"./mui-DZ-Vvmtg.js";import{u as H,R as x}from"./ReimbursementApprovalRuleDetailScreen-DTbwLilz.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]="1cd23994-992a-4869-9996-c8b5f6837ee6",e._sentryDebugIdIdentifier="sentry-dbid-1cd23994-992a-4869-9996-c8b5f6837ee6")}catch{}})();const y="reimbursement-approval-rule-update",J=k((function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(B(!1))},onBackClick:()=>{$(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}}))(T(Q)),K=({isLoading:e})=>{const o=A(),s=E(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),c=u((a=>b(a))),v=u((a=>S(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((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))}),[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,W,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(J,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",Z=k((function(e){const o=b(e),s=S(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(j)&&e(B(!1))},onBackClick:()=>{$(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(O(t,!0))}}}))(T(G)),q=()=>{const e=u((n=>I(n))),{isApprovalRulesV3Enabled:o,isLoading:s}=z(e?.tenantId);return o?r.jsx(M,{isLoading:s}):r.jsx(K,{isLoading:s})},M=({isLoading:e})=>{const o=A(),s=E(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),c=u((a=>b(a)));H();const v=u((a=>S(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((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))}),[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,W,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(Z,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(F,{children:[r.jsx(g,{path:"/",element:r.jsx(q,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
@@ -1 +1 @@
1
- import{j as h}from"./liveblocks-C01HsTej.js";import{a as f}from"./sentry-B-4V3RdH.js";import{u as T,j as g,h as _,g as O,i as F,n as k}from"./core-DI1Smcxr.js";import{l0 as L,Qy as w,Qi as C,FA as V,FM as B,FH as A,FI as E,Qz as j,eW as z,FG as W}from"./zeni-epic-state-CGEUbbPd.js";import{z as P,y as N,B as Q,bP as G,ag as $,bC as H,bQ as K}from"./index-DSrpVU5Y.js";import"./mui-DZ-Vvmtg.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]="e1ef8cd6-9fd8-4a4e-a2fb-af63a76b8525",e._sentryDebugIdIdentifier="sentry-dbid-e1ef8cd6-9fd8-4a4e-a2fb-af63a76b8525")}catch{}})();function M(){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=k((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 b=[];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);b.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),b},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 X(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),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"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=k((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,b=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=b?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:b?.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(W(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(K);function ne(){const e=g((t=>z(t))),{isApprovalRulesV3Enabled:s}=H(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(X,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=P.getSignedInUser(),l=N(),r=g((n=>w(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(M(),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"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,M as u};
1
+ import{j as h}from"./liveblocks-C01HsTej.js";import{a as f}from"./sentry-B-4V3RdH.js";import{u as T,j as g,h as _,g as O,i as F,n as k}from"./core-DI1Smcxr.js";import{l0 as L,Qy as w,Qi as C,FA as V,FM as B,FH as A,FI as E,Qz as j,eW as z,FG as W}from"./zeni-epic-state-CGEUbbPd.js";import{z as P,y as N,B as Q,bP as G,ag as $,bC as H,bQ as K}from"./index-slT6Cmx8.js";import"./mui-DZ-Vvmtg.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]="e1ef8cd6-9fd8-4a4e-a2fb-af63a76b8525",e._sentryDebugIdIdentifier="sentry-dbid-e1ef8cd6-9fd8-4a4e-a2fb-af63a76b8525")}catch{}})();function M(){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=k((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 b=[];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);b.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),b},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 X(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),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"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=k((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,b=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=b?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:b?.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(W(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(K);function ne(){const e=g((t=>z(t))),{isApprovalRulesV3Enabled:s}=H(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(X,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=P.getSignedInUser(),l=N(),r=g((n=>w(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(M(),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"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,M as u};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-C01HsTej.js";import{h as W,u as de,g as Z,i as X,j as w,N as _,n as q,l as mt,o as ct,p as C}from"./core-DI1Smcxr.js";import{eW as V,QM as ue,c7 as pe,EL as Fe,kL as dt,EY as oe,EX as re,QN as ut,bn as be,gq as Ue,QO as pt,Nc as bt,kA as Le,Nd as Ae,Ne as gt,jv as ht,Q4 as ft,jK as St,Ez as It,ud as Rt,jC as yt,Fj as Pe,QP as $e,QQ as At,QR as vt,QS as kt,QT as Ct,QU as Et,F3 as ve,jQ as wt,Qd as xt,EZ as Bt,EJ as Tt,QV as jt,EI as Dt,QW as Ft,ER as ke,F7 as Ut,F6 as Lt,F2 as Pt,QX as Me,Ki as $t,bq as Mt,EU as _t,FB as Nt,QY as Ot,QZ as Qt,Ff as Gt,Fc as Ce,Pz as zt,EG as Zt,Q_ as _e,G1 as Ee,G9 as Vt,Q$ as Ht,R0 as G,R1 as Wt,R2 as Ne,R3 as qt,R4 as Oe,R5 as Qe,Fr as le,bu as Kt,bK as ge,cI as he,fD as Ge,fB as ze,R6 as Jt,fy as Yt,PM as Xt,R7 as en,R8 as Ze,PQ as tn,Qy as nn,R9 as an,QL as sn,G6 as we,G5 as on,Ra as rn,Rb as ln,Rc as mn,Rd as cn,Re as dn,Qj as un,FY as pn,G0 as bn,bs as gn,bJ as hn,cC as fn,cq as Sn,bt as In,M0 as Rn,cS as yn,cV as An,cU as vn,cB as kn}from"./zeni-epic-state-CGEUbbPd.js";import{Q as Ve,J as He,C as ee,G as E,z as $,b$ as We,x as te,e as v,aM as xe,o as D,au as Y,E as Cn,a as qe,c0 as En,s as z,a0 as Ke,c1 as wn,T as ne,c2 as xn,_ as Bn,A as Tn,B as fe,g as Je,a9 as jn,bn as Dn,a4 as Fn,y as Ye,c3 as Un,i as Ln}from"./index-DSrpVU5Y.js";import{n as N,S as Pn}from"./mui-DZ-Vvmtg.js";import me from"./NotFoundScreen-pjqYHD4T.js";import{S as Be}from"./SetupPagesScreen-DAr5O2oq.js";import{F as Xe}from"./FeaturePreviewScreen-BpeRjZY3.js";import{a as f}from"./sentry-B-4V3RdH.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-DndeBqh3.js";import{u as et}from"./useInitialThreadRequest-CvusWtwP.js";import{D as $n}from"./DrawerScreen-CKbiBlQ7.js";import{M as tt}from"./MobileAppDrawer-mJR72DtA.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CqCLBt6r.js";import{FallBackRoute as _n}from"./ScreenRoutes-xFFl0XFK.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.js";import"./analyticsHelper-CI2hKrei.js";import"./routePaths-c5aFJU-F.js";import"./BusinessVerificationPageScreen-ZC7zpCv9.js";import"./ReimbursementApprovalRuleDetailScreen-CKegjQI1.js";import"./getLocaleForTenant-C8WDJQ34.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]="5d40115c-81b1-43f6-b068-72b3c3c3e644",e._sentryDebugIdIdentifier="sentry-dbid-5d40115c-81b1-43f6-b068-72b3c3c3e644")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=qe.getLocalizedStrings(),On=q((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ke(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ke(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ve(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ve("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=X(),d=Ve(),c=He(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[F,B]=f.useState(!1),k=$.getSignedInUser(),I=w((p=>V(p))),g=w((p=>ue(p,r))),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect((()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))}));const M=w((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(k==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(te,{analytics:v,onLoad:p=>(H=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&H.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Hn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
1
+ import{j as s}from"./liveblocks-C01HsTej.js";import{h as W,u as de,g as Z,i as X,j as w,N as _,n as q,l as mt,o as ct,p as C}from"./core-DI1Smcxr.js";import{eW as V,QM as ue,c7 as pe,EL as Fe,kL as dt,EY as oe,EX as re,QN as ut,bn as be,gq as Ue,QO as pt,Nc as bt,kA as Le,Nd as Ae,Ne as gt,jv as ht,Q4 as ft,jK as St,Ez as It,ud as Rt,jC as yt,Fj as Pe,QP as $e,QQ as At,QR as vt,QS as kt,QT as Ct,QU as Et,F3 as ve,jQ as wt,Qd as xt,EZ as Bt,EJ as Tt,QV as jt,EI as Dt,QW as Ft,ER as ke,F7 as Ut,F6 as Lt,F2 as Pt,QX as Me,Ki as $t,bq as Mt,EU as _t,FB as Nt,QY as Ot,QZ as Qt,Ff as Gt,Fc as Ce,Pz as zt,EG as Zt,Q_ as _e,G1 as Ee,G9 as Vt,Q$ as Ht,R0 as G,R1 as Wt,R2 as Ne,R3 as qt,R4 as Oe,R5 as Qe,Fr as le,bu as Kt,bK as ge,cI as he,fD as Ge,fB as ze,R6 as Jt,fy as Yt,PM as Xt,R7 as en,R8 as Ze,PQ as tn,Qy as nn,R9 as an,QL as sn,G6 as we,G5 as on,Ra as rn,Rb as ln,Rc as mn,Rd as cn,Re as dn,Qj as un,FY as pn,G0 as bn,bs as gn,bJ as hn,cC as fn,cq as Sn,bt as In,M0 as Rn,cS as yn,cV as An,cU as vn,cB as kn}from"./zeni-epic-state-CGEUbbPd.js";import{Q as Ve,J as He,C as ee,G as E,z as $,b$ as We,x as te,e as v,aM as xe,o as D,au as Y,E as Cn,a as qe,c0 as En,s as z,a0 as Ke,c1 as wn,T as ne,c2 as xn,_ as Bn,A as Tn,B as fe,g as Je,a9 as jn,bn as Dn,a4 as Fn,y as Ye,c3 as Un,i as Ln}from"./index-slT6Cmx8.js";import{n as N,S as Pn}from"./mui-DZ-Vvmtg.js";import me from"./NotFoundScreen-BfdMMfOd.js";import{S as Be}from"./SetupPagesScreen-CsxRnYId.js";import{F as Xe}from"./FeaturePreviewScreen-BtXMKquo.js";import{a as f}from"./sentry-B-4V3RdH.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-EdOjchhB.js";import{u as et}from"./useInitialThreadRequest-Dcty95yd.js";import{D as $n}from"./DrawerScreen-CbHABUlJ.js";import{M as tt}from"./MobileAppDrawer-RaFZojI2.js";import{R as Mn}from"./ReimbursementApprovalRoutes-DqsLGNjl.js";import{FallBackRoute as _n}from"./ScreenRoutes-s_Chyeso.js";import"./recharts-Qx4ifl34.js";import"./analytics-CcXSo3IR.js";import"./plaid-qc1oAYdM.js";import"./dnd-B-Vr2ZPo.js";import"./stripe-cKAAJElX.js";import"./lottie-CizKqEXu.js";import"./lexical-DXoIaDj4.js";import"./pdf-Baibwqlo.js";import"./utils-BOGrYMhV.js";import"./analyticsHelper-u_wRIr-A.js";import"./routePaths-C58Oct92.js";import"./BusinessVerificationPageScreen-KgJTV7Is.js";import"./ReimbursementApprovalRuleDetailScreen-DTbwLilz.js";import"./getLocaleForTenant-C9HoG54f.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]="5d40115c-81b1-43f6-b068-72b3c3c3e644",e._sentryDebugIdIdentifier="sentry-dbid-5d40115c-81b1-43f6-b068-72b3c3c3e644")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=qe.getLocalizedStrings(),On=q((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ke(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ke(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ve(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ve("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=X(),d=Ve(),c=He(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[F,B]=f.useState(!1),k=$.getSignedInUser(),I=w((p=>V(p))),g=w((p=>ue(p,r))),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect((()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))}));const M=w((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(k==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(te,{analytics:v,onLoad:p=>(H=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&H.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Hn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;