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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/assets/{AddressRoutes-BnLs6Thq.js → AddressRoutes-B9BoI8Fv.js} +1 -1
  2. package/dist/assets/{AddressScreen-Bpm1g3GJ.js → AddressScreen-BRdhnUB3.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-DvB52dzN.js → AiCfoScreen-CuCVJ-9z.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-7UEPLRsP.js → BillPayApprovalRoutes-BrRYqqLJ.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-CU7_1N_U.js → BillPayRoutes-C-57jjzC.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-UgGxnQyH.js → BusinessVerificationPageScreen-CoxJBcce.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-YZr7g5Lg.js → CardsAiCfoScreen-BXut6M7h.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-BrW_iL7i.js → ChargeCardRoutes-DAakvdza.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-9Rc5mH-z.js → CompanyPassportScreen-DUlm9sdh.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-ClYWnB0t.js → ConnectionAuthScreen-BOHdbzkN.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingAuthScreen-BQzgR-6K.js → CustomerOnboardingAuthScreen-BQyQByde.js} +1 -1
  12. package/dist/assets/{CustomerOnboardingRoutes-DwYU0l_J.js → CustomerOnboardingRoutes-Dh6ZowLh.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-BL2dWKop.js → DashboardRoutes-Cox4nEtE.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-BMiXfGQc.js → DefaultTenantHome-DsGlDo8q.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-s5k6zIAu.js → DomesticWireDetailScreen-Dwlu904z.js} +1 -1
  16. package/dist/assets/{DrawerScreen-CeOHT4ro.js → DrawerScreen-KqrF4Sq7.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-D87R9ysv.js → EntityDetailRoutes-COXR1SAJ.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-D8RvJ_ZB.js → ExpenseAutomationRoutes-CKsYpo_A.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-429nxvjk.js → FeaturePreviewScreen-CNGfajWs.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-Cp6uaYm8.js → HubSpotOAuthCallbackScreen-074s_I3B.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-DXD8ia4D.js → MagicLinkRoutes-Cu1l5Hae.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-u1nu2H0O.js → MagicLinkSignInScreen-iqOI3pqv.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-Ck77XJrw.js → MobileAppDrawer-BPYh3fz7.js} +1 -1
  24. package/dist/assets/{NotFoundScreen-DEN1HuyG.js → NotFoundScreen-ChEBjJeL.js} +1 -1
  25. package/dist/assets/{NotificationRoutes-CHUbnhGf.js → NotificationRoutes-CM26Uc2-.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-Dvc66gSg.js → OAuthConsentScreen-OutOQhzE.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-BHreu8Q_.js → PandLWithForecastRoutes-B0qogd0A.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-BDfMDBMJ.js → PeopleRoutes-CUTyVwx1.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-C-1wBoYH.js → PerformanceRoutes-12eFPdp_.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-DNFuV9_h.js → QBOConnectionScreen-D87ZntTL.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-ByjwQ5N-.js → ReferralListScreen-BsBo666O.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-D_BWGRLZ.js → ReimbursementApprovalRoutes-ClbZ-O2b.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Daig4IQ8.js → ReimbursementApprovalRuleDetailScreen-D_Tk1V_u.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-xcHd64qr.js → ReimbursementRoutes-DSyBtaLh.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-2ShpDZLA.js → ReportsRoutes-CrvdJeby.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-BZO-KWFq.js → RewardsRoutes-DYWFgTvw.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-Dti7-Ixh.js → ScreenRoutes-BE5zmBx7.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-BKVt-eGE.js → SettingsRoutes-D-CGv9n3.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-0zvJok5y.js → SetupPagesScreen-Bfb-yG5Q.js} +1 -1
  40. package/dist/assets/{SignInScreen-CW9vcCuq.js → SignInScreen-DKI-p16g.js} +1 -1
  41. package/dist/assets/{SignOutScreen-ChTjyX5W.js → SignOutScreen-C2_s3moc.js} +1 -1
  42. package/dist/assets/{TaskListScreen-DrRytX06.js → TaskListScreen-SFzbbBq2.js} +1 -1
  43. package/dist/assets/{TaskRoutes-DW3-LBMv.js → TaskRoutes-CgfIdOfE.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-DHUqssQz.js → TransactionDetailRoutes-BX1iNIyW.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-9-dxedcB.js → TransactionDetailScreen-bJ4okRq5.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-DeCDnr6v.js → TransactionListRoutes-C7_m6Yqx.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-lJD-IQKP.js → TreasuryRoutes-CueVe1jr.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-CpiscP-9.js → VendorsRoutes-DrErfdsR.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-CJZ2O9Rr.js → WiseConfirmationScreen-DrQXGVBy.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-BVG6Nofx.js → ZeniAccountRoutes-_K25ghKx.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-BVqdlmkT.js → ZeniAccountStatementScreen-Be29Xc0Q.js} +1 -1
  52. package/dist/assets/{analyticsHelper-BYRUUvaV.js → analyticsHelper-BsjRdUZX.js} +1 -1
  53. package/dist/assets/{getLocaleForTenant-CuwnZkK7.js → getLocaleForTenant-C_VQis3o.js} +1 -1
  54. package/dist/assets/{index-BeMQfmRp.js → index-D_hiFYsE.js} +5 -5
  55. package/dist/assets/{routePaths-2zRQFXqm.js → routePaths-XSngD1ow.js} +1 -1
  56. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-iiV0TqB-.js → useAiCfoDashboardSuggestedQuestionsChips-CmgL0oiB.js} +1 -1
  57. package/dist/assets/{useAskAiCfoHostNavButtonProps-k3dV_2QR.js → useAskAiCfoHostNavButtonProps-FETbJUjN.js} +1 -1
  58. package/dist/assets/{useCashManagementBanner-d2dskVed.js → useCashManagementBanner-Dy5XCSd3.js} +1 -1
  59. package/dist/assets/{useInitialThreadRequest-CrlDQYJc.js → useInitialThreadRequest-D1F5GLCG.js} +1 -1
  60. package/dist/assets/{withTransactionSidePanel-D1EjZ31L.js → withTransactionSidePanel-kr0tYyxP.js} +1 -1
  61. package/dist/index.html +1 -1
  62. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-B6jAIe9x.js";import{a as u}from"./sentry-95bdnR3R.js";import{u as y,j as b,n as w,g as A,N as L}from"./core-CLKYLs-8.js";import{Lw as N,eW as _,f$ as U,Lx as k,o4 as R,Ly as z}from"./zeni-epic-state-CjQblqOQ.js";import{u as $,z as f,L as T,t as I,D as j,b as O}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import{t as P}from"./getLocaleForTenant-CuwnZkK7.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="88cabf6f-cb71-49a7-80a8-42b2c8500748",t._sentryDebugIdIdentifier="sentry-dbid-88cabf6f-cb71-49a7-80a8-42b2c8500748")}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=O(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}=$(),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||(j.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-B6jAIe9x.js";import{a as u}from"./sentry-95bdnR3R.js";import{u as y,j as b,n as w,g as A,N as L}from"./core-CLKYLs-8.js";import{Lw as N,eW as _,f$ as U,Lx as k,o4 as R,Ly as z}from"./zeni-epic-state-CjQblqOQ.js";import{u as $,z as f,L as T,t as I,D as j,b as O}from"./index-D_hiFYsE.js";import"./mui-AZmtqUsi.js";import{t as P}from"./getLocaleForTenant-C_VQis3o.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="88cabf6f-cb71-49a7-80a8-42b2c8500748",t._sentryDebugIdIdentifier="sentry-dbid-88cabf6f-cb71-49a7-80a8-42b2c8500748")}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=O(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}=$(),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||(j.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-B6jAIe9x.js";import{h as w,g as C,j as h,n as P,i as B}from"./core-CLKYLs-8.js";import{Px as k,PE as W,gf as K,ge as M,gd as q,jo as J,MF as L,ro as Q,eW as V,P3 as D,jm as F,Py as S,PH as T,jk as j,jH as G}from"./zeni-epic-state-CjQblqOQ.js";import{bw as X,K as R,F as N,z as U,m as H,n as p,x as v,B as O,bx as Y,o as Z,by as ee,r as te}from"./index-BeMQfmRp.js";import{n as z}from"./mui-AZmtqUsi.js";import"./sentry-95bdnR3R.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]="9ec5cafc-2f0d-467d-9b97-0097c6369357",e._sentryDebugIdIdentifier="sentry-dbid-9ec5cafc-2f0d-467d-9b97-0097c6369357")}catch{}})();const ne=P(null,function(e,t){return{onSaveVendor:n=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(W(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=z.div`
1
+ import{j as l}from"./liveblocks-B6jAIe9x.js";import{h as w,g as C,j as h,n as P,i as B}from"./core-CLKYLs-8.js";import{Px as k,PE as W,gf as K,ge as M,gd as q,jo as J,MF as L,ro as Q,eW as V,P3 as D,jm as F,Py as S,PH as T,jk as j,jH as G}from"./zeni-epic-state-CjQblqOQ.js";import{bw as X,K as R,F as N,z as U,m as H,n as p,x as v,B as O,bx as Y,o as Z,by as ee,r as te}from"./index-D_hiFYsE.js";import{n as z}from"./mui-AZmtqUsi.js";import"./sentry-95bdnR3R.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]="9ec5cafc-2f0d-467d-9b97-0097c6369357",e._sentryDebugIdIdentifier="sentry-dbid-9ec5cafc-2f0d-467d-9b97-0097c6369357")}catch{}})();const ne=P(null,function(e,t){return{onSaveVendor:n=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(W(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=z.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-B6jAIe9x.js";import{K as c,E as l,m as f}from"./index-BeMQfmRp.js";import{D as b}from"./mui-AZmtqUsi.js";import"./sentry-95bdnR3R.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]="b4f83c93-6b8c-4125-b836-c9db747f101c",e._sentryDebugIdIdentifier="sentry-dbid-b4f83c93-6b8c-4125-b836-c9db747f101c")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=c(),a=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
1
+ import{j as i}from"./liveblocks-B6jAIe9x.js";import{K as c,E as l,m as f}from"./index-D_hiFYsE.js";import{D as b}from"./mui-AZmtqUsi.js";import"./sentry-95bdnR3R.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]="b4f83c93-6b8c-4125-b836-c9db747f101c",e._sentryDebugIdIdentifier="sentry-dbid-b4f83c93-6b8c-4125-b836-c9db747f101c")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=c(),a=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-B6jAIe9x.js";import{a as d}from"./sentry-95bdnR3R.js";import{h as A,u as B,g as G,i as q,j as c,N as F,n as M,o as O,p as W}from"./core-CLKYLs-8.js";import{NN as _,eW as J,N9 as R,lr as Y,JO as k,NS as $,ME as z,kr as V,JP as S,Ne as H,Nf as K,MG as L,MF as Q}from"./zeni-epic-state-CjQblqOQ.js";import{aS as U,c as X,n as Z,r as tt}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import{d as b}from"./decodeURIComponentSafe-Bm32N7cj.js";import{w as et}from"./withTransactionSidePanel-D1EjZ31L.js";import{f as nt,c as at}from"./routePaths-2zRQFXqm.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";import"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import"./TransactionDetailScreen-9-dxedcB.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="d9ec955e-0efb-4d98-bd14-8fc04f4bd9df",n._sentryDebugIdIdentifier="sentry-dbid-d9ec955e-0efb-4d98-bd14-8fc04f4bd9df")}catch{}})();const ot=M(function(n,t){const e=t.entity,o=$(n,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(n,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:V(n)}},function(n,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${at(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?n(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&n(Q("common"))},onAutoCompleteEntity:e=>{const o=nt(e,t.tenantEmailDomain);n(H()),n(K()),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&&n(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};n(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),n(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:n,...t}){const e=A(),o=B(),l=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:N}=q(),r=b(x??""),f=b(N??""),p=rt(r,f),j=[r,f].filter(a=>a!=null),i={name:f,id:r,type:n,zeniId:r,qboId:r},g=c(a=>_(a.customerIncomeState,a.vendorExpenseState,a.trendState,i,"quarter")),v=c(a=>J(a).company?.companyInfo.firstMonthOfFY??1),u=c(a=>R(a.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(Y(i)))},[m,p,i]);const E=c(a=>a.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(a,y){return a!=null&&y!=null?{startDate:a.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:I(j.length)})}),rt=(n,t)=>t!=null&&t.length>0&&n!=null&&n.length>0,I=(n=2)=>{let t="../";for(let e=0;e<n;e++)t=`${t}../`;return t};function xt({entityType:n}){return s.jsx(O,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:n})})})}export{xt as EntityDetailRoutes,xt as default};
1
+ import{j as s}from"./liveblocks-B6jAIe9x.js";import{a as d}from"./sentry-95bdnR3R.js";import{h as A,u as B,g as G,i as q,j as c,N as F,n as M,o as O,p as W}from"./core-CLKYLs-8.js";import{NN as _,eW as J,N9 as R,lr as Y,JO as k,NS as $,ME as z,kr as V,JP as S,Ne as H,Nf as K,MG as L,MF as Q}from"./zeni-epic-state-CjQblqOQ.js";import{aS as U,c as X,n as Z,r as tt}from"./index-D_hiFYsE.js";import"./mui-AZmtqUsi.js";import{d as b}from"./decodeURIComponentSafe-Bm32N7cj.js";import{w as et}from"./withTransactionSidePanel-kr0tYyxP.js";import{f as nt,c as at}from"./routePaths-XSngD1ow.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";import"./useAskAiCfoHostNavButtonProps-FETbJUjN.js";import"./TransactionDetailScreen-bJ4okRq5.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="d9ec955e-0efb-4d98-bd14-8fc04f4bd9df",n._sentryDebugIdIdentifier="sentry-dbid-d9ec955e-0efb-4d98-bd14-8fc04f4bd9df")}catch{}})();const ot=M(function(n,t){const e=t.entity,o=$(n,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(n,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:V(n)}},function(n,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${at(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?n(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&n(Q("common"))},onAutoCompleteEntity:e=>{const o=nt(e,t.tenantEmailDomain);n(H()),n(K()),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&&n(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};n(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),n(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:n,...t}){const e=A(),o=B(),l=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:N}=q(),r=b(x??""),f=b(N??""),p=rt(r,f),j=[r,f].filter(a=>a!=null),i={name:f,id:r,type:n,zeniId:r,qboId:r},g=c(a=>_(a.customerIncomeState,a.vendorExpenseState,a.trendState,i,"quarter")),v=c(a=>J(a).company?.companyInfo.firstMonthOfFY??1),u=c(a=>R(a.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(Y(i)))},[m,p,i]);const E=c(a=>a.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(a,y){return a!=null&&y!=null?{startDate:a.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:I(j.length)})}),rt=(n,t)=>t!=null&&t.length>0&&n!=null&&n.length>0,I=(n=2)=>{let t="../";for(let e=0;e<n;e++)t=`${t}../`;return t};function xt({entityType:n}){return s.jsx(O,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:n})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-B6jAIe9x.js";import oa from"./NotFoundScreen-DEN1HuyG.js";import{a as o,b as Jt}from"./sentry-95bdnR3R.js";import{n as Ue,S as sa}from"./mui-AZmtqUsi.js";import{u as pe,h as Yt,g as Ke,j as P,n as ca,i as Pt,o as ia,p as Ge}from"./core-CLKYLs-8.js";import{eW as Re,Sz as la,oe as Ee,fW as ra,r$ as da,ow as Kt,oR as Qt,SA as Wt,o$ as ua,SB as Zt,op as ma,rx as pa,fG as Ie,SC as De,tZ as Ht,E7 as Xt,SD as en,SE as ha,r5 as Qe,NO as xt,NQ as Sa,ku as ga,NR as Ca,kB as fa,c_ as Ia,v9 as We,oC as tn,p4 as Fe,ou as de,SF as Ea,MG as Rt,MF as we,SG as Dt,kS as ka,SH as ya,SI as ba,SJ as Ta,SK as va,oJ as Aa,p7 as Pe,SL as wa,SM as Pa,SN as xa,pe as Ra,kF as Da,kw as Fa,SO as Ua,kE as Ft,NY as Ba,SP as _a,SQ as Oa,r1 as Va,qF as za,p5 as me,qE as Ne,SR as Ma,SS as ja,ST as La,m9 as $a,bq as qa,m4 as Ut,lS as Ga,SU as Na,fw as Bt,gv as Ja,m1 as Ya,x2 as Ka,SV as Qa,pF as Wa,pA as Za,pE as Ha,pp as Xa,SW as eo,fJ as nn,oU as to,oF as no,fX as _t,p9 as ao,SX as oo,SY as so,p6 as an,SZ as co,S_ as io,S$ as lo,T0 as ro,T1 as Ot,rd as uo,qw as mo,ME as po,T2 as ho,T3 as So,kD as go,T4 as Co,IP as fo,kC as Io,kr as Eo,fI as ko,q2 as on,qo as yo,p3 as Vt,p8 as bo,bE as To,l_ as vo,lX as Ao,T5 as wo,po as zt,qk as Mt,qi as Po,T6 as xo,q7 as Ro,pP as Do,ql as Fo,T7 as Uo,T8 as Bo,pT as _o,T9 as Oo,pK as Vo,pS as zo,pQ as Mo,qr as jo}from"./zeni-epic-state-CjQblqOQ.js";import{F as sn,x as X,c as q,r as ae,X as cn,_ as ln,cX as Lo,z as Be,cY as $o,at as xe,cZ as qo,aU as jt,B as rn,c_ as Go,aq as Je,D as No,a7 as Jo,c$ as Yo,a2 as Ko,d0 as Qo,W as Wo,d1 as Zo,d2 as Ho,w as Xo,j as es,aN as ts,d3 as ns,d4 as as,b9 as os,E as ss,aQ as cs}from"./index-BeMQfmRp.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-9-dxedcB.js";import{w as us}from"./withTransactionSidePanel-D1EjZ31L.js";import{h as ms,v as ps}from"./routePaths-2zRQFXqm.js";import{g as Ye}from"./accountMappingHelper-BSLlTYQH.js";import{D as hs}from"./DrawerScreen-CeOHT4ro.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";import"./decodeURIComponentSafe-Bm32N7cj.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]="5399ad0d-1030-452c-95b8-46a4c43a5d73",t._sentryDebugIdIdentifier="sentry-dbid-5399ad0d-1030-452c-95b8-46a4c43a5d73")}catch{}})();const Ss=()=>{const t=pe(),l=Yt(),B=Ke(),f=P(d=>Re(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:C}=T(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(X.aiAuditScorePercentage),I=P(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=P(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),S=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(S.month,S.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(S,f.tenantId,!0)},[k,S,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),x=ae(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&S!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:x,message:"comingFromOverview"}});l(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:x,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,S]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{S!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(S,f.tenantId)},[k,S,s.fetchState,f.tenantId,y]),o.useEffect(()=>{S!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(da(S))},[S,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),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(gs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:C,onMonthEndCheckClick:d=>{l(`./${d}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:x,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Ue.div`
1
+ import{j as h}from"./liveblocks-B6jAIe9x.js";import oa from"./NotFoundScreen-ChEBjJeL.js";import{a as o,b as Jt}from"./sentry-95bdnR3R.js";import{n as Ue,S as sa}from"./mui-AZmtqUsi.js";import{u as pe,h as Yt,g as Ke,j as P,n as ca,i as Pt,o as ia,p as Ge}from"./core-CLKYLs-8.js";import{eW as Re,Sz as la,oe as Ee,fW as ra,r$ as da,ow as Kt,oR as Qt,SA as Wt,o$ as ua,SB as Zt,op as ma,rx as pa,fG as Ie,SC as De,tZ as Ht,E7 as Xt,SD as en,SE as ha,r5 as Qe,NO as xt,NQ as Sa,ku as ga,NR as Ca,kB as fa,c_ as Ia,v9 as We,oC as tn,p4 as Fe,ou as de,SF as Ea,MG as Rt,MF as we,SG as Dt,kS as ka,SH as ya,SI as ba,SJ as Ta,SK as va,oJ as Aa,p7 as Pe,SL as wa,SM as Pa,SN as xa,pe as Ra,kF as Da,kw as Fa,SO as Ua,kE as Ft,NY as Ba,SP as _a,SQ as Oa,r1 as Va,qF as za,p5 as me,qE as Ne,SR as Ma,SS as ja,ST as La,m9 as $a,bq as qa,m4 as Ut,lS as Ga,SU as Na,fw as Bt,gv as Ja,m1 as Ya,x2 as Ka,SV as Qa,pF as Wa,pA as Za,pE as Ha,pp as Xa,SW as eo,fJ as nn,oU as to,oF as no,fX as _t,p9 as ao,SX as oo,SY as so,p6 as an,SZ as co,S_ as io,S$ as lo,T0 as ro,T1 as Ot,rd as uo,qw as mo,ME as po,T2 as ho,T3 as So,kD as go,T4 as Co,IP as fo,kC as Io,kr as Eo,fI as ko,q2 as on,qo as yo,p3 as Vt,p8 as bo,bE as To,l_ as vo,lX as Ao,T5 as wo,po as zt,qk as Mt,qi as Po,T6 as xo,q7 as Ro,pP as Do,ql as Fo,T7 as Uo,T8 as Bo,pT as _o,T9 as Oo,pK as Vo,pS as zo,pQ as Mo,qr as jo}from"./zeni-epic-state-CjQblqOQ.js";import{F as sn,x as X,c as q,r as ae,X as cn,_ as ln,cX as Lo,z as Be,cY as $o,at as xe,cZ as qo,aU as jt,B as rn,c_ as Go,aq as Je,D as No,a7 as Jo,c$ as Yo,a2 as Ko,d0 as Qo,W as Wo,d1 as Zo,d2 as Ho,w as Xo,j as es,aN as ts,d3 as ns,d4 as as,b9 as os,E as ss,aQ as cs}from"./index-D_hiFYsE.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-FETbJUjN.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-bJ4okRq5.js";import{w as us}from"./withTransactionSidePanel-kr0tYyxP.js";import{h as ms,v as ps}from"./routePaths-XSngD1ow.js";import{g as Ye}from"./accountMappingHelper-BSLlTYQH.js";import{D as hs}from"./DrawerScreen-KqrF4Sq7.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";import"./decodeURIComponentSafe-Bm32N7cj.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]="5399ad0d-1030-452c-95b8-46a4c43a5d73",t._sentryDebugIdIdentifier="sentry-dbid-5399ad0d-1030-452c-95b8-46a4c43a5d73")}catch{}})();const Ss=()=>{const t=pe(),l=Yt(),B=Ke(),f=P(d=>Re(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:C}=T(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(X.aiAuditScorePercentage),I=P(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=P(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),S=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(S.month,S.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(S,f.tenantId,!0)},[k,S,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),x=ae(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&S!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:x,message:"comingFromOverview"}});l(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:x,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,S]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{S!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(S,f.tenantId)},[k,S,s.fetchState,f.tenantId,y]),o.useEffect(()=>{S!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(da(S))},[S,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),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(gs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:C,onMonthEndCheckClick:d=>{l(`./${d}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:x,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Ue.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-B6jAIe9x.js";import{a as r}from"./sentry-95bdnR3R.js";import{a3 as l,a4 as p,a5 as d,n as m}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import c from"./NotFoundScreen-DEN1HuyG.js";import{h as u,g as b}from"./core-CLKYLs-8.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]="e5992879-11fa-4121-8a97-eb0ecebef062",e._sentryDebugIdIdentifier="sentry-dbid-e5992879-11fa-4121-8a97-eb0ecebef062")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:d(o),onDemoClick:t,onGoBack:i}):s.jsx(c,{})},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-B6jAIe9x.js";import{a as r}from"./sentry-95bdnR3R.js";import{a3 as l,a4 as p,a5 as d,n as m}from"./index-D_hiFYsE.js";import"./mui-AZmtqUsi.js";import c from"./NotFoundScreen-ChEBjJeL.js";import{h as u,g as b}from"./core-CLKYLs-8.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]="e5992879-11fa-4121-8a97-eb0ecebef062",e._sentryDebugIdIdentifier="sentry-dbid-e5992879-11fa-4121-8a97-eb0ecebef062")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:d(o),onDemoClick:t,onGoBack:i}):s.jsx(c,{})},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-95bdnR3R.js";import{u as l,h as f,g as m}from"./core-CLKYLs-8.js";import{hn as p,LU as g,LV as _}from"./zeni-epic-state-CjQblqOQ.js";import{u as b,L as h,z as y}from"./index-BeMQfmRp.js";import"./liveblocks-B6jAIe9x.js";import"./recharts-CyaYjFwn.js";import"./mui-AZmtqUsi.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="9021c12e-8f7e-4581-8b2d-7f221029bc2e",e._sentryDebugIdIdentifier="sentry-dbid-9021c12e-8f7e-4581-8b2d-7f221029bc2e")}catch{}})();function j(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{j as default};
1
+ import{a as r}from"./sentry-95bdnR3R.js";import{u as l,h as f,g as m}from"./core-CLKYLs-8.js";import{hn as p,LU as g,LV as _}from"./zeni-epic-state-CjQblqOQ.js";import{u as b,L as h,z as y}from"./index-D_hiFYsE.js";import"./liveblocks-B6jAIe9x.js";import"./recharts-CyaYjFwn.js";import"./mui-AZmtqUsi.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="9021c12e-8f7e-4581-8b2d-7f221029bc2e",e._sentryDebugIdIdentifier="sentry-dbid-9021c12e-8f7e-4581-8b2d-7f221029bc2e")}catch{}})();function j(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{j as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-B6jAIe9x.js";import{i as S,n as x,h as C,g as y,u as ee,t as ae,j as E,N as te,o as ne,p}from"./core-CLKYLs-8.js";import{LN as k,LO as v,LP as T,AZ as A,AL as G,LQ as L,LR as oe,LS as ie,AP as se,fx as $,AW as le,AT as re}from"./zeni-epic-state-CjQblqOQ.js";import{K as g,o as r,p as de,c as j,h as M,k as ce,n as me,q as pe,r as H,F as ue,x as he,v as xe,w as ge,m as fe,y as we,B as be,A as Se,M as ye,S as ke,C as ve,E as je,H as $e}from"./index-BeMQfmRp.js";import{n as m}from"./mui-AZmtqUsi.js";import f from"./NotFoundScreen-DEN1HuyG.js";import{a as I}from"./sentry-95bdnR3R.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="c98ac92f-1279-4fc7-91ea-ab921651bfa6",e._sentryDebugIdIdentifier="sentry-dbid-c98ac92f-1279-4fc7-91ea-ab921651bfa6")}catch{}})();const Ie=m.div`
1
+ import{j as a}from"./liveblocks-B6jAIe9x.js";import{i as S,n as x,h as C,g as y,u as ee,t as ae,j as E,N as te,o as ne,p}from"./core-CLKYLs-8.js";import{LN as k,LO as v,LP as T,AZ as A,AL as G,LQ as L,LR as oe,LS as ie,AP as se,fx as $,AW as le,AT as re}from"./zeni-epic-state-CjQblqOQ.js";import{K as g,o as r,p as de,c as j,h as M,k as ce,n as me,q as pe,r as H,F as ue,x as he,v as xe,w as ge,m as fe,y as we,B as be,A as Se,M as ye,S as ke,C as ve,E as je,H as $e}from"./index-D_hiFYsE.js";import{n as m}from"./mui-AZmtqUsi.js";import f from"./NotFoundScreen-ChEBjJeL.js";import{a as I}from"./sentry-95bdnR3R.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="c98ac92f-1279-4fc7-91ea-ab921651bfa6",e._sentryDebugIdIdentifier="sentry-dbid-c98ac92f-1279-4fc7-91ea-ab921651bfa6")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-B6jAIe9x.js";import{a as f}from"./sentry-95bdnR3R.js";import{u as U,g as _,h as w,t as M,j as l,N as x}from"./core-CLKYLs-8.js";import{z as r,m as P,D as V,d as A,c as N,e as W,Y,M as J,g as K}from"./index-BeMQfmRp.js";import{eW as R,Ly as $,LI as q,Lz as B,fx as G,f_ as H,LE as Q,gm as X,cY as Z,LJ as ee,LK as te}from"./zeni-epic-state-CjQblqOQ.js";import{n as ne}from"./mui-AZmtqUsi.js";import{u as se}from"./useDeviceId-B5LKCqFY.js";import{f as ae}from"./analyticsHelper-BYRUUvaV.js";import{t as ie}from"./getLocaleForTenant-CuwnZkK7.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="5de3b975-e9fe-4ded-8a70-56e6a4f0f500",t._sentryDebugIdIdentifier="sentry-dbid-5de3b975-e9fe-4ded-8a70-56e6a4f0f500")}catch{}})();const z=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function ze(){const t=U(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:D,magicLinkEmail:c,verifyDeviceFetchState:T,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>R(e)),y=l(e=>$(e)),E=r.getSignedInUser(),L=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&z(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(q(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(B(y.tenantsInOrder),s.zeniSessionId),G(s.userId,s.zeniSessionId,o.tenantId),t(H(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,L,void 0,y.tenantsInOrder),X().then(()=>{const e=K();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(W.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,b,s,o,y,L,a.state,t]);const j=f.useCallback(()=>{m("/signin/auth")},[m]),F=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.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 u.jsx(Y,{phoneNumber:D,verifyOtpFetchState:T.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(x,{to:e,state:{...a.state,origin:""}})}if(!z(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",v=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(x,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:v,magicLinkExpired:!v&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(J,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-B6jAIe9x.js";import{a as f}from"./sentry-95bdnR3R.js";import{u as U,g as _,h as w,t as M,j as l,N as x}from"./core-CLKYLs-8.js";import{z as r,m as P,D as V,d as A,c as N,e as W,Y,M as J,g as K}from"./index-D_hiFYsE.js";import{eW as R,Ly as $,LI as q,Lz as B,fx as G,f_ as H,LE as Q,gm as X,cY as Z,LJ as ee,LK as te}from"./zeni-epic-state-CjQblqOQ.js";import{n as ne}from"./mui-AZmtqUsi.js";import{u as se}from"./useDeviceId-B5LKCqFY.js";import{f as ae}from"./analyticsHelper-BsjRdUZX.js";import{t as ie}from"./getLocaleForTenant-C_VQis3o.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="5de3b975-e9fe-4ded-8a70-56e6a4f0f500",t._sentryDebugIdIdentifier="sentry-dbid-5de3b975-e9fe-4ded-8a70-56e6a4f0f500")}catch{}})();const z=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function ze(){const t=U(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:D,magicLinkEmail:c,verifyDeviceFetchState:T,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>R(e)),y=l(e=>$(e)),E=r.getSignedInUser(),L=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&z(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(q(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(B(y.tenantsInOrder),s.zeniSessionId),G(s.userId,s.zeniSessionId,o.tenantId),t(H(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,L,void 0,y.tenantsInOrder),X().then(()=>{const e=K();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(W.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,b,s,o,y,L,a.state,t]);const j=f.useCallback(()=>{m("/signin/auth")},[m]),F=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.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 u.jsx(Y,{phoneNumber:D,verifyOtpFetchState:T.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(x,{to:e,state:{...a.state,origin:""}})}if(!z(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",v=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(x,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:v,magicLinkExpired:!v&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(J,{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-B6jAIe9x.js";import{a as c}from"./sentry-95bdnR3R.js";import{u as pe,j as s,i as Ke,g as Qe,h as qe,l as G}from"./core-CLKYLs-8.js";import{eW as he,fC as Je,fD as Se,fo as Xe,bn as ea,eV as aa,fE as ta,fF as na,fH as sa,fK as oa,fT as ia,fL as g,fN as ra,fO as ue,fR as da,fP as la,fQ as ca,fS as ua,cO as fa,fV as ma,cT as ba,bt as pa,fn as ha,f_ as Sa,f$ as ga,fZ as Ea}from"./zeni-epic-state-CjQblqOQ.js";import{a7 as Ca,a8 as ka,w as ya,F as Ia,z as C,y as Ta,u as wa,x as r,a9 as Fa,aa as _a,j as Aa,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ra,ae as fe,af as me,L as xa,ag as Ga,ah as be,c as M,$ as Ma,r as F,ai as N,aj as Na}from"./index-BeMQfmRp.js";import{D as Va}from"./mui-AZmtqUsi.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]="9c708970-a0f2-4abb-9c2d-6d7c5a88814d",f._sentryDebugIdIdentifier="sentry-dbid-9c708970-a0f2-4abb-9c2d-6d7c5a88814d")}catch{}})();const Ua=Ca(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ke(),a=Qe(),k=ya(),o=qe(),U=Xe(),m=pe(),{useFeatureGate:i}=Ia(),O=C.getSignedInUser(),_=ea(O),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,P=s(e=>aa(e)),j=P.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[A,L]=c.useState(void 0),D=G("/:tenantEmailDomain/dashboard")!==null,z=G("/:tenantEmailDomain/reports")!==null,I=G("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:H}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ce}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),ke=Fa(n,Ce,Y),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),Z=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=C.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:K}=i(r.isExpenseAutomationEnabledV2),Q=K||W&&_,{isFeatureEnabled:Fe}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=_||!_&&$e,Re=n.company!=null&&ia(n.company),w=ve&&Re,xe=s(e=>g(e).totalUnreadCount),Ge=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Me=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=_a();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Me.fetchState==="Not-Started"&&U.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{A!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:A},"comments")))},[A,B.fetchState]);const Ve={fetchStatus:Ge,count:xe},ne=t!=null?C.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),H===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const Ue=Aa(),oe=s(e=>la(e,S,h,K,W,w).fetchState),ie=s(e=>ca(e).fetchState),Oe=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Pe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(Pe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,Y,n),re=Da(),He=re&&va(a),de=ba(Ue?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,R=c.useCallback(()=>w&&de&&!C.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[Ye,ce]=c.useState(R);c.useEffect(()=>{ce(R())},[R]);const Ze=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,We=Ba(Ze);return V.jsx(Va,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(Ra,{signedInUser:O,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Oe,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:H,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:We,isTreasuryPopupVisible:Ye,isNotificationsTabVisible:ze,notificationCountDetails:Ve,isExpenseAutomationEnabledForUser:Q&&pa(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&J>0?"notifications/comments":"notifications/tasks";me(a)&&(e=q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=F(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=F(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(M.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void Ma({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=F(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=F(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&M.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Na(e.type);be(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${x}`,{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=>{Ee(xa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ga(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const p=e;M.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{C.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{k.toggle()},isAiCfo:He,aiCfoView:P,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Fe,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:_e,christmasAnimationEnabled:Ae,newYearAnimationEnabled:De})})}),Ya=f=>{const d=pe(),t=s(k=>he(k)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(k,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ua,{...f,...a})};export{Ya as M};
1
+ import{j as V}from"./liveblocks-B6jAIe9x.js";import{a as c}from"./sentry-95bdnR3R.js";import{u as pe,j as s,i as Ke,g as Qe,h as qe,l as G}from"./core-CLKYLs-8.js";import{eW as he,fC as Je,fD as Se,fo as Xe,bn as ea,eV as aa,fE as ta,fF as na,fH as sa,fK as oa,fT as ia,fL as g,fN as ra,fO as ue,fR as da,fP as la,fQ as ca,fS as ua,cO as fa,fV as ma,cT as ba,bt as pa,fn as ha,f_ as Sa,f$ as ga,fZ as Ea}from"./zeni-epic-state-CjQblqOQ.js";import{a7 as Ca,a8 as ka,w as ya,F as Ia,z as C,y as Ta,u as wa,x as r,a9 as Fa,aa as _a,j as Aa,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ra,ae as fe,af as me,L as xa,ag as Ga,ah as be,c as M,$ as Ma,r as F,ai as N,aj as Na}from"./index-D_hiFYsE.js";import{D as Va}from"./mui-AZmtqUsi.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]="9c708970-a0f2-4abb-9c2d-6d7c5a88814d",f._sentryDebugIdIdentifier="sentry-dbid-9c708970-a0f2-4abb-9c2d-6d7c5a88814d")}catch{}})();const Ua=Ca(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ke(),a=Qe(),k=ya(),o=qe(),U=Xe(),m=pe(),{useFeatureGate:i}=Ia(),O=C.getSignedInUser(),_=ea(O),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,P=s(e=>aa(e)),j=P.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[A,L]=c.useState(void 0),D=G("/:tenantEmailDomain/dashboard")!==null,z=G("/:tenantEmailDomain/reports")!==null,I=G("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:H}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ce}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),ke=Fa(n,Ce,Y),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),Z=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=C.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:K}=i(r.isExpenseAutomationEnabledV2),Q=K||W&&_,{isFeatureEnabled:Fe}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=_||!_&&$e,Re=n.company!=null&&ia(n.company),w=ve&&Re,xe=s(e=>g(e).totalUnreadCount),Ge=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Me=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=_a();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Me.fetchState==="Not-Started"&&U.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{A!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:A},"comments")))},[A,B.fetchState]);const Ve={fetchStatus:Ge,count:xe},ne=t!=null?C.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),H===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const Ue=Aa(),oe=s(e=>la(e,S,h,K,W,w).fetchState),ie=s(e=>ca(e).fetchState),Oe=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Pe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(Pe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,Y,n),re=Da(),He=re&&va(a),de=ba(Ue?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,R=c.useCallback(()=>w&&de&&!C.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[Ye,ce]=c.useState(R);c.useEffect(()=>{ce(R())},[R]);const Ze=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,We=Ba(Ze);return V.jsx(Va,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(Ra,{signedInUser:O,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Oe,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:H,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:We,isTreasuryPopupVisible:Ye,isNotificationsTabVisible:ze,notificationCountDetails:Ve,isExpenseAutomationEnabledForUser:Q&&pa(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&J>0?"notifications/comments":"notifications/tasks";me(a)&&(e=q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=F(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=F(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(M.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void Ma({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=F(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=F(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&M.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Na(e.type);be(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${x}`,{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=>{Ee(xa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ga(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const p=e;M.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{C.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{k.toggle()},isAiCfo:He,aiCfoView:P,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Fe,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:_e,christmasAnimationEnabled:Ae,newYearAnimationEnabled:De})})}),Ya=f=>{const d=pe(),t=s(k=>he(k)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(k,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ua,{...f,...a})};export{Ya as M};
@@ -1 +1 @@
1
- import{j as r}from"./liveblocks-B6jAIe9x.js";import{h as n,n as e}from"./core-CLKYLs-8.js";import{R as i}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import"./sentry-95bdnR3R.js";import"./zeni-epic-state-CjQblqOQ.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="9ceba748-25d5-4d32-9a3c-da4194015415",o._sentryDebugIdIdentifier="sentry-dbid-9ceba748-25d5-4d32-9a3c-da4194015415")}catch{}})();const a=e(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=n();return r.jsx(a,{navigate:o})}export{_ as default};
1
+ import{j as r}from"./liveblocks-B6jAIe9x.js";import{h as n,n as e}from"./core-CLKYLs-8.js";import{R as i}from"./index-D_hiFYsE.js";import"./mui-AZmtqUsi.js";import"./sentry-95bdnR3R.js";import"./zeni-epic-state-CjQblqOQ.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="9ceba748-25d5-4d32-9a3c-da4194015415",o._sentryDebugIdIdentifier="sentry-dbid-9ceba748-25d5-4d32-9a3c-da4194015415")}catch{}})();const a=e(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);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-B6jAIe9x.js";import lt from"./NotFoundScreen-DEN1HuyG.js";import{a as k}from"./sentry-95bdnR3R.js";import{h as ft,g as ut,i as ht,u as pt,j as g,n as kt,o as St,p as H}from"./core-CLKYLs-8.js";import{cv as gt,fE as K,eW as X,fS as bt,fL as b,Su as Q,fO as d,fD as y,sj as j,xF as It,Sv as Ct,fC as Tt,fV as yt,so as _t,Sw as F,bq as $,fw as B,ss as J,Sx as At,cH as Et,cA as xt}from"./zeni-epic-state-CjQblqOQ.js";import{X as Nt,z as wt,F as Bt,x as vt,_ as Dt,cU as Rt,r as x,a7 as Ut,cV as Gt,a8 as Pt,n as Ft}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="b1c6157f-5697-4620-8cbf-ac5f7108418e",t._sentryDebugIdIdentifier="sentry-dbid-b1c6157f-5697-4620-8cbf-ac5f7108418e")}catch{}})();const jt=(t,l)=>new Promise((n,u)=>{const S=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(S).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),Mt=kt(function(t,l){const n=K(t),{signedInUser:u,isDebitCardFeatureEnabled:S}=l,i=b(t),s=X(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,S,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:S,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:N,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=x(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=x(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(N(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=x(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(S)&&(r="not-found"),c[1].startsWith("bill")&&!xt(S)&&(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(Q(a,o));const m=`../${a}`,c=x(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(j("task_manager","dashboard",m))}else v?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(N(r),t(F([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(B({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")),jt(s,N).then(()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=x(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Ut(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:S}=Nt(),i=gt(u??""),s=pt(),h=wt.getSignedInUser(),[N,v]=k.useState(!1),a=g(e=>K(e)),o=g(e=>X(e)),{useFeatureGate:m}=Bt(),{isFeatureEnabled:c}=m(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const Y=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 M=g(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=g(e=>b(e).currentTab),D=g(e=>b(e).currentSubTab),Z=g(e=>b(e).notificationDetailsByTab.comments.fetchCountState),R=g(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=g(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=g(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Rt().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:C,isFetchingMore:U,fetchMore:ot}=ct(),{threads:L,isLoading:W,fetchMore:q,isFetchingMore:z,hasFetchedAll:O}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(Q(i)),i==null){const e=`../${V}`,p=x(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.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(()=>{M!=="In-Progress"&&S&&s(j("task_manager","dashboard",["read","unread"]))},[S]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=_||U===!0||C!==!0||_||U===!0||C!==!0;k.useEffect(()=>{G&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,R]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&N===!1&&(v(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&W===!1&&w!=null&&L!=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=L.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||O===!0||q==null||q(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,U,z,C,O,W,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")),M!=="In-Progress"){const A=[];D==="all"?A.push("read","unread"):D!=="mentions"&&A.push(D),s(j("task_manager",T,A,!0))}}}},nt=dt();return E.jsx(Mt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,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(St,{children:[E.jsx(H,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(H,{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-B6jAIe9x.js";import lt from"./NotFoundScreen-ChEBjJeL.js";import{a as k}from"./sentry-95bdnR3R.js";import{h as ft,g as ut,i as ht,u as pt,j as g,n as kt,o as St,p as H}from"./core-CLKYLs-8.js";import{cv as gt,fE as K,eW as X,fS as bt,fL as b,Su as Q,fO as d,fD as y,sj as j,xF as It,Sv as Ct,fC as Tt,fV as yt,so as _t,Sw as F,bq as $,fw as B,ss as J,Sx as At,cH as Et,cA as xt}from"./zeni-epic-state-CjQblqOQ.js";import{X as Nt,z as wt,F as Bt,x as vt,_ as Dt,cU as Rt,r as x,a7 as Ut,cV as Gt,a8 as Pt,n as Ft}from"./index-D_hiFYsE.js";import"./mui-AZmtqUsi.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-FETbJUjN.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="b1c6157f-5697-4620-8cbf-ac5f7108418e",t._sentryDebugIdIdentifier="sentry-dbid-b1c6157f-5697-4620-8cbf-ac5f7108418e")}catch{}})();const jt=(t,l)=>new Promise((n,u)=>{const S=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(S).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),Mt=kt(function(t,l){const n=K(t),{signedInUser:u,isDebitCardFeatureEnabled:S}=l,i=b(t),s=X(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,S,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:S,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:N,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=x(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=x(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(N(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=x(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(S)&&(r="not-found"),c[1].startsWith("bill")&&!xt(S)&&(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(Q(a,o));const m=`../${a}`,c=x(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(j("task_manager","dashboard",m))}else v?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(N(r),t(F([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(B({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")),jt(s,N).then(()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(B({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=x(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Ut(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:S}=Nt(),i=gt(u??""),s=pt(),h=wt.getSignedInUser(),[N,v]=k.useState(!1),a=g(e=>K(e)),o=g(e=>X(e)),{useFeatureGate:m}=Bt(),{isFeatureEnabled:c}=m(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const Y=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 M=g(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=g(e=>b(e).currentTab),D=g(e=>b(e).currentSubTab),Z=g(e=>b(e).notificationDetailsByTab.comments.fetchCountState),R=g(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=g(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=g(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Rt().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:C,isFetchingMore:U,fetchMore:ot}=ct(),{threads:L,isLoading:W,fetchMore:q,isFetchingMore:z,hasFetchedAll:O}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(Q(i)),i==null){const e=`../${V}`,p=x(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.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(()=>{M!=="In-Progress"&&S&&s(j("task_manager","dashboard",["read","unread"]))},[S]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=_||U===!0||C!==!0||_||U===!0||C!==!0;k.useEffect(()=>{G&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,R]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&N===!1&&(v(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&W===!1&&w!=null&&L!=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=L.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||O===!0||q==null||q(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,U,z,C,O,W,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")),M!=="In-Progress"){const A=[];D==="all"?A.push("read","unread"):D!=="mentions"&&A.push(D),s(j("task_manager",T,A,!0))}}}},nt=dt();return E.jsx(Mt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,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(St,{children:[E.jsx(H,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(H,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-B6jAIe9x.js";import{a as r}from"./sentry-95bdnR3R.js";import{u as T,g as A,j as o,N as j}from"./core-CLKYLs-8.js";import{LX as C,eW as P,fK as x,LY as z,LZ as D,L_ as M,L$ as R,o4 as k,KU as N}from"./zeni-epic-state-CjQblqOQ.js";import{z as h,J as I}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="7f7f5cbf-877d-4dd0-91e4-6c23ec15fbf1",n._sentryDebugIdIdentifier="sentry-dbid-7f7f5cbf-877d-4dd0-91e4-6c23ec15fbf1")}catch{}})();function ee(){const n=T(),s=A(),{params:t,error:i}=r.useMemo(()=>C(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),c=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[f,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(L=>L.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),u=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(N(a.userId,a.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{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
1
+ import{j as m}from"./liveblocks-B6jAIe9x.js";import{a as r}from"./sentry-95bdnR3R.js";import{u as T,g as A,j as o,N as j}from"./core-CLKYLs-8.js";import{LX as C,eW as P,fK as x,LY as z,LZ as D,L_ as M,L$ as R,o4 as k,KU as N}from"./zeni-epic-state-CjQblqOQ.js";import{z as h,J as I}from"./index-D_hiFYsE.js";import"./mui-AZmtqUsi.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="7f7f5cbf-877d-4dd0-91e4-6c23ec15fbf1",n._sentryDebugIdIdentifier="sentry-dbid-7f7f5cbf-877d-4dd0-91e4-6c23ec15fbf1")}catch{}})();function ee(){const n=T(),s=A(),{params:t,error:i}=r.useMemo(()=>C(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),c=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[f,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(L=>L.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),u=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(N(a.userId,a.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{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-B6jAIe9x.js";import{h as z,u as Z,g as H,i as J,j as d,n as X,o as K,p as I}from"./core-CLKYLs-8.js";import{eW as M,s7 as P,rH as Q,Ms as O,rC as S,bt as ee,bn as ae,bY as te,rD as se,Mt as oe,Mf as C,dJ as re,vC as ne,Mu as ce,vZ as ie,fB as le,fz as de}from"./zeni-epic-state-CjQblqOQ.js";import{z as fe,X as me,_ as pe,j as ue,F as U,x as $,A as he,c as w,ao as Fe,r as ge}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import be from"./NotFoundScreen-DEN1HuyG.js";import{F as Ie}from"./FeaturePreviewScreen-429nxvjk.js";import{a as F}from"./sentry-95bdnR3R.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import{u as Se}from"./useInitialThreadRequest-CrlDQYJc.js";import{t as Te}from"./routePaths-2zRQFXqm.js";import{M as ye}from"./MobileAppDrawer-Ck77XJrw.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="efbcd0ec-5d7f-4857-894a-e8a8a3779b2f",s._sentryDebugIdIdentifier="sentry-dbid-efbcd0ec-5d7f-4857-894a-e8a8a3779b2f")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=X(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(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(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,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(f,{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("../../")}}})(Fe);function v(){const s=z(),e=Z(),a=H(),{forecastId:o,tenantEmailDomain:r}=J(),[c,p]=F.useState(!1),[f,u]=F.useState(!1),h=fe.getSignedInUser(),y=d(t=>M(t)),B=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>P(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:g}=me();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});F.useEffect(()=>{if(!c&&g)p(!0),l||e(Q());else if(l&&!f){u(!0);const t=((m,L,R)=>L!=null?m.forecasts.findIndex(b=>b.id===L):R!=null?m.forecasts.findIndex(b=>b.id===R):m.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(O(i.forecasts[t].id,t)),T(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!D(i.forecasts[t].id)&&g&&e(S(i.forecasts[t].id))}},[c,p,e,l,i,f,u,P,S,g]);const k=ue(),W=k?.loggedInUserRole!=null&&ee(k.loggedInUserRole),{useFeatureGate:q}=U(),{isFeatureEnabled:j}=q($.isReportsCommentingEnabled),G=Se(j?y?.companyId:void 0,{clearParams:l&&f}),[V,Y]=F.useState(!1),E=t=>{Y(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:E}),n.jsx(xe,{firstMonthOfFY:B,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:W,isAiCfoAccessEnabled:_,onAskAiCfoClick:N,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function Ye(){const s=d(c=>M(c)),{useFeatureGate:e}=U(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(K,{children:[n.jsx(I,{path:"/",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
1
+ import{j as n}from"./liveblocks-B6jAIe9x.js";import{h as z,u as Z,g as H,i as J,j as d,n as X,o as K,p as I}from"./core-CLKYLs-8.js";import{eW as M,s7 as P,rH as Q,Ms as O,rC as S,bt as ee,bn as ae,bY as te,rD as se,Mt as oe,Mf as C,dJ as re,vC as ne,Mu as ce,vZ as ie,fB as le,fz as de}from"./zeni-epic-state-CjQblqOQ.js";import{z as fe,X as me,_ as pe,j as ue,F as U,x as $,A as he,c as w,ao as Fe,r as ge}from"./index-D_hiFYsE.js";import"./mui-AZmtqUsi.js";import be from"./NotFoundScreen-ChEBjJeL.js";import{F as Ie}from"./FeaturePreviewScreen-CNGfajWs.js";import{a as F}from"./sentry-95bdnR3R.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-FETbJUjN.js";import{u as Se}from"./useInitialThreadRequest-D1F5GLCG.js";import{t as Te}from"./routePaths-XSngD1ow.js";import{M as ye}from"./MobileAppDrawer-BPYh3fz7.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="efbcd0ec-5d7f-4857-894a-e8a8a3779b2f",s._sentryDebugIdIdentifier="sentry-dbid-efbcd0ec-5d7f-4857-894a-e8a8a3779b2f")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=X(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(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(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,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(f,{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("../../")}}})(Fe);function v(){const s=z(),e=Z(),a=H(),{forecastId:o,tenantEmailDomain:r}=J(),[c,p]=F.useState(!1),[f,u]=F.useState(!1),h=fe.getSignedInUser(),y=d(t=>M(t)),B=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>P(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:g}=me();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});F.useEffect(()=>{if(!c&&g)p(!0),l||e(Q());else if(l&&!f){u(!0);const t=((m,L,R)=>L!=null?m.forecasts.findIndex(b=>b.id===L):R!=null?m.forecasts.findIndex(b=>b.id===R):m.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(O(i.forecasts[t].id,t)),T(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!D(i.forecasts[t].id)&&g&&e(S(i.forecasts[t].id))}},[c,p,e,l,i,f,u,P,S,g]);const k=ue(),W=k?.loggedInUserRole!=null&&ee(k.loggedInUserRole),{useFeatureGate:q}=U(),{isFeatureEnabled:j}=q($.isReportsCommentingEnabled),G=Se(j?y?.companyId:void 0,{clearParams:l&&f}),[V,Y]=F.useState(!1),E=t=>{Y(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:E}),n.jsx(xe,{firstMonthOfFY:B,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:W,isAiCfoAccessEnabled:_,onAskAiCfoClick:N,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function Ye(){const s=d(c=>M(c)),{useFeatureGate:e}=U(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(K,{children:[n.jsx(I,{path:"/",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-B6jAIe9x.js";import{Mo as te,eW as Q,kr as G,fB as q,fz as ne,JS as X,M2 as oe,uA as Ee,Mp as N,up as ke,uJ as Ie,uD as ie,ut as re,uH as Pe,uE as je,Mq as le,wo as Te,fl as Le,gc as ve,Mr as M,ux as de,uw as ce,uM as Fe,c7 as Ae}from"./zeni-epic-state-CjQblqOQ.js";import{K as pe,F as Y,x as E,z as H,a9 as ue,I as me,ak as ge,al as Re,E as he,o as R,N as fe,D as Ce,am as Oe,X as Ve,_ as Ue,A as Be,c as be,e as Ze,r as $e,an as Me,j as _e}from"./index-BeMQfmRp.js";import{D as ye,n as W,S as we}from"./mui-AZmtqUsi.js";import ae from"./NotFoundScreen-DEN1HuyG.js";import{a as r}from"./sentry-95bdnR3R.js";import{u as ee,i as ze,j as m,h as Ge,g as He,n as We,o as se,p as $}from"./core-CLKYLs-8.js";import{u as Ke}from"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import{M as Je}from"./MobileAppDrawer-Ck77XJrw.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="77ce3a50-c009-4aa1-8337-90f982b57020",a._sentryDebugIdIdentifier="sentry-dbid-77ce3a50-c009-4aa1-8337-90f982b57020")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=ze(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>G(e)),{useFeatureGate:f}=Y(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),L=ne(u),v=X(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},qe=W(we)`
1
+ import{j as s}from"./liveblocks-B6jAIe9x.js";import{Mo as te,eW as Q,kr as G,fB as q,fz as ne,JS as X,M2 as oe,uA as Ee,Mp as N,up as ke,uJ as Ie,uD as ie,ut as re,uH as Pe,uE as je,Mq as le,wo as Te,fl as Le,gc as ve,Mr as M,ux as de,uw as ce,uM as Fe,c7 as Ae}from"./zeni-epic-state-CjQblqOQ.js";import{K as pe,F as Y,x as E,z as H,a9 as ue,I as me,ak as ge,al as Re,E as he,o as R,N as fe,D as Ce,am as Oe,X as Ve,_ as Ue,A as Be,c as be,e as Ze,r as $e,an as Me,j as _e}from"./index-D_hiFYsE.js";import{D as ye,n as W,S as we}from"./mui-AZmtqUsi.js";import ae from"./NotFoundScreen-ChEBjJeL.js";import{a as r}from"./sentry-95bdnR3R.js";import{u as ee,i as ze,j as m,h as Ge,g as He,n as We,o as se,p as $}from"./core-CLKYLs-8.js";import{u as Ke}from"./useAskAiCfoHostNavButtonProps-FETbJUjN.js";import{M as Je}from"./MobileAppDrawer-BPYh3fz7.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="77ce3a50-c009-4aa1-8337-90f982b57020",a._sentryDebugIdIdentifier="sentry-dbid-77ce3a50-c009-4aa1-8337-90f982b57020")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=ze(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>G(e)),{useFeatureGate:f}=Y(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),L=ne(u),v=X(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},qe=W(we)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-B6jAIe9x.js";import E from"./NotFoundScreen-DEN1HuyG.js";import{a as r}from"./sentry-95bdnR3R.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-CLKYLs-8.js";import{eW as B,Sy as b,bo as F,bn as N,i8 as V,fw as W}from"./zeni-epic-state-CjQblqOQ.js";import{w as $,z as I,_ as q,cW as G}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import{M as J}from"./MobileAppDrawer-Ck77XJrw.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="7cbda8dc-ce2c-46e5-9726-f9f58694341d",e._sentryDebugIdIdentifier="sentry-dbid-7cbda8dc-ce2c-46e5-9726-f9f58694341d")}catch{}})();const K=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)}}})(G),L=()=>{const e=_(),t=v(),c=$(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=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,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(W({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
1
+ import{j as s}from"./liveblocks-B6jAIe9x.js";import E from"./NotFoundScreen-ChEBjJeL.js";import{a as r}from"./sentry-95bdnR3R.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-CLKYLs-8.js";import{eW as B,Sy as b,bo as F,bn as N,i8 as V,fw as W}from"./zeni-epic-state-CjQblqOQ.js";import{w as $,z as I,_ as q,cW as G}from"./index-D_hiFYsE.js";import"./mui-AZmtqUsi.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-FETbJUjN.js";import{M as J}from"./MobileAppDrawer-BPYh3fz7.js";import"./recharts-CyaYjFwn.js";import"./analytics-BHHyMpuV.js";import"./plaid-2Q72y6JT.js";import"./dnd-BgEYAbRi.js";import"./stripe-DMRn4zHo.js";import"./lottie-C38Bn-X6.js";import"./lexical-DN4b_Twn.js";import"./pdf-BzNDzZ8_.js";import"./utils-CDpOkGne.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]="7cbda8dc-ce2c-46e5-9726-f9f58694341d",e._sentryDebugIdIdentifier="sentry-dbid-7cbda8dc-ce2c-46e5-9726-f9f58694341d")}catch{}})();const K=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)}}})(G),L=()=>{const e=_(),t=v(),c=$(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=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,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(W({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-B6jAIe9x.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-95bdnR3R.js";import{L as dt,bY as Tc,eW as Ac,Ly as Rc,M0 as kl,c7 as Tl,f_ as Al,f$ as Rl}from"./zeni-epic-state-CjQblqOQ.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-CDpOkGne.js";import{r as un}from"./empty-DdtYEopm.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-0dW_LSbG.js";import{r as Gl}from"./index-CtRgwYlG.js";import{r as zl}from"./index-UrW8im9e.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-CLKYLs-8.js";import{u as Kl,z as Pc,L as Wl,O as Jl,Q as Xl,h as Ql,c as tf}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import{d as Pe}from"./decodeURIComponentSafe-Bm32N7cj.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]="774ca33b-1e07-46ec-89f7-bd8c25822867",t._sentryDebugIdIdentifier="sentry-dbid-774ca33b-1e07-46ec-89f7-bd8c25822867")}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-B6jAIe9x.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-95bdnR3R.js";import{L as dt,bY as Tc,eW as Ac,Ly as Rc,M0 as kl,c7 as Tl,f_ as Al,f$ as Rl}from"./zeni-epic-state-CjQblqOQ.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-CDpOkGne.js";import{r as un}from"./empty-DdtYEopm.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-0dW_LSbG.js";import{r as Gl}from"./index-CtRgwYlG.js";import{r as zl}from"./index-UrW8im9e.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-CLKYLs-8.js";import{u as Kl,z as Pc,L as Wl,O as Jl,Q as Xl,h as Ql,c as tf}from"./index-D_hiFYsE.js";import"./mui-AZmtqUsi.js";import{d as Pe}from"./decodeURIComponentSafe-Bm32N7cj.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]="774ca33b-1e07-46ec-89f7-bd8c25822867",t._sentryDebugIdIdentifier="sentry-dbid-774ca33b-1e07-46ec-89f7-bd8c25822867")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-B6jAIe9x.js";import{a as o}from"./sentry-95bdnR3R.js";import{j as f,h as F,u as H,g as _,n as V}from"./core-CLKYLs-8.js";import{m as W,K as M,z as R,bb as U,E as N,X as $,_ as z,A as X,c as l,e as q,a7 as K,bc as G}from"./index-BeMQfmRp.js";import{fF as J,eW as Q,OS as P,OT as Y,vs as Z,vi as g,fH as ee,bS as ae,vn as re,OU as ne}from"./zeni-epic-state-CjQblqOQ.js";import{D as te,e as se,n as oe,S as ie}from"./mui-AZmtqUsi.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-k3dV_2QR.js";import{M as de}from"./MobileAppDrawer-Ck77XJrw.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]="05227a08-6b5f-4487-a8fd-da40c429eaa5",e._sentryDebugIdIdentifier="sentry-dbid-05227a08-6b5f-4487-a8fd-da40c429eaa5")}catch{}})();const ce={overlayWidth:new N(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=W(),n=M();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>J(d));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
1
+ import{j as s}from"./liveblocks-B6jAIe9x.js";import{a as o}from"./sentry-95bdnR3R.js";import{j as f,h as F,u as H,g as _,n as V}from"./core-CLKYLs-8.js";import{m as W,K as M,z as R,bb as U,E as N,X as $,_ as z,A as X,c as l,e as q,a7 as K,bc as G}from"./index-D_hiFYsE.js";import{fF as J,eW as Q,OS as P,OT as Y,vs as Z,vi as g,fH as ee,bS as ae,vn as re,OU as ne}from"./zeni-epic-state-CjQblqOQ.js";import{D as te,e as se,n as oe,S as ie}from"./mui-AZmtqUsi.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-FETbJUjN.js";import{M as de}from"./MobileAppDrawer-BPYh3fz7.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]="05227a08-6b5f-4487-a8fd-da40c429eaa5",e._sentryDebugIdIdentifier="sentry-dbid-05227a08-6b5f-4487-a8fd-da40c429eaa5")}catch{}})();const ce={overlayWidth:new N(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=W(),n=M();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>J(d));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-B6jAIe9x.js";import P from"./NotFoundScreen-DEN1HuyG.js";import{a as c}from"./sentry-95bdnR3R.js";import{h as E,g as x,u as C,j as u,N as k,n as D,o as z,p as v}from"./core-CLKYLs-8.js";import{eW as j,PM as b,Q0 as S,Ff as V,Eo as T,Fe as m,F5 as U,Qg as B,Fh as Q}from"./zeni-epic-state-CjQblqOQ.js";import{m as N,z as O,B as W,a7 as $,bW as K,af as F,bz as M,bX as X}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.js";import{R as A}from"./ReimbursementApprovalRuleDetailScreen-Daig4IQ8.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]="bf753263-9230-46f2-b3be-e6573b7f286c",e._sentryDebugIdIdentifier="sentry-dbid-bf753263-9230-46f2-b3be-e6573b7f286c")}catch{}})();const w="reimbursement-approval-rule-update",q=D(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:t,location:i}=r;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(B(!1))},onBackClick:()=>{F(i)?t("../../"):t("../../../reimbursements/setup")},onDeleteRuleClick:a=>{e(U(a,!1))},onEditRuleClick:a=>{a!=null?(e(m(a)),t(`./${a}/edit`)):(e(m()),t("./new"))}}})($(K)),G=()=>{const e=E(),r=x(),t=C(),[i,a]=c.useState(!1),[o,h]=c.useState(!1),d=u(n=>n.remiSetupApproverViewState.fetchState),p=u(n=>j(n)),g=N(),l=u(n=>b(n)),f=u(n=>S(n).remiSetupApproverViewUpdateData);if(c.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(V())},[f]),c.useEffect(()=>{i||d!=="Not-Started"||(a(!0),t(T(!0,!1,!1,!1)))},[i,d,t]),O.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");c.useEffect(()=>{l.allApprovalRules.length===0&&l.fetchState==="Completed"&&(o||(h(!0),t(m())),e("./new"))},[o,l,t]);const R={events:p.companyId!=null?[`private-encrypted-${p.companyId}.${w}`]:[],eventCallback:(n,_,y)=>{n.endsWith(w)&&y.onApprovalRulesEventReceived(n)}};return p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?s.jsx(k,{to:"../../promo"}):p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||l.fetchState!=="Completed"&&l.fetchState!=="Error"?s.jsx(W,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}}):s.jsx(q,{currentTenant:p,location:r,navigate:e,...R})},I="reimbursement-approval-rule-update",H=D(function(e){const r=b(e),t=S(e).remiSetupApproverViewUpdateData,i={};for(const o of Object.values(e.contactState.contactById))o?.id!=null&&(i[o.id]=o.fullName);const a={};for(const o of Object.values(e.classState.classesByKey))o?.classId!=null&&(a[o.classId]=o.className);return{approvalView:r,remiSetupApproverViewUpdateData:t,vendorNamesById:i,departmentNamesById:a}},function(e,r){const{navigate:t,location:i}=r;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(B(!1))},onBackClick:()=>{F(i)?t("../../"):t("../../../reimbursements/setup")},onDeleteRuleClick:a=>{e(U(a,!0))},onEditRuleClick:a=>{a!=null?(e(m(a)),t(`./${a}/edit`)):(e(m()),t("./new"))},onReorderRules:a=>{e(Q(a,!0))}}})($(X)),J=()=>{const e=u(t=>j(t)),{isApprovalRulesV3Enabled:r}=M(e?.tenantId);return r?s.jsx(L,{}):s.jsx(G,{})},L=()=>{const e=E(),r=x(),t=C(),[i,a]=c.useState(!1),[o,h]=c.useState(!1),d=u(n=>n.remiSetupApproverViewState.fetchState),p=u(n=>j(n)),g=N(),l=u(n=>b(n)),f=u(n=>S(n).remiSetupApproverViewUpdateData);if(c.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(V())},[f]),c.useEffect(()=>{i||d!=="Not-Started"||(a(!0),t(T(!0,!1,!1,!0)))},[i,d,t]),O.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");c.useEffect(()=>{l.allApprovalRules.length===0&&l.fetchState==="Completed"&&(o||(h(!0),t(m())),e("./new"))},[o,l,t]);const R={events:p.companyId!=null?[`private-encrypted-${p.companyId}.${I}`]:[],eventCallback:(n,_,y)=>{n.endsWith(I)&&y.onApprovalRulesEventReceived(n)}};return p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?s.jsx(k,{to:"../../promo"}):p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||l.fetchState!=="Completed"&&l.fetchState!=="Error"?s.jsx(W,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}}):s.jsx(H,{currentTenant:p,location:r,navigate:e,...R})};function oe(){return s.jsxs(z,{children:[s.jsx(v,{path:"/",element:s.jsx(J,{})}),s.jsx(v,{path:"/new",element:s.jsx(A,{})}),s.jsx(v,{path:"/:approvalRuleId/edit",element:s.jsx(A,{})}),s.jsx(v,{path:"*",element:s.jsx(P,{})})]})}export{oe as R};
1
+ import{j as s}from"./liveblocks-B6jAIe9x.js";import P from"./NotFoundScreen-ChEBjJeL.js";import{a as c}from"./sentry-95bdnR3R.js";import{h as E,g as x,u as C,j as u,N as k,n as D,o as z,p as v}from"./core-CLKYLs-8.js";import{eW as j,PM as b,Q0 as S,Ff as V,Eo as T,Fe as m,F5 as U,Qg as B,Fh as Q}from"./zeni-epic-state-CjQblqOQ.js";import{m as N,z as O,B as W,a7 as $,bW as K,af as F,bz as M,bX as X}from"./index-D_hiFYsE.js";import"./mui-AZmtqUsi.js";import{R as A}from"./ReimbursementApprovalRuleDetailScreen-D_Tk1V_u.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]="bf753263-9230-46f2-b3be-e6573b7f286c",e._sentryDebugIdIdentifier="sentry-dbid-bf753263-9230-46f2-b3be-e6573b7f286c")}catch{}})();const w="reimbursement-approval-rule-update",q=D(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:t,location:i}=r;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(B(!1))},onBackClick:()=>{F(i)?t("../../"):t("../../../reimbursements/setup")},onDeleteRuleClick:a=>{e(U(a,!1))},onEditRuleClick:a=>{a!=null?(e(m(a)),t(`./${a}/edit`)):(e(m()),t("./new"))}}})($(K)),G=()=>{const e=E(),r=x(),t=C(),[i,a]=c.useState(!1),[o,h]=c.useState(!1),d=u(n=>n.remiSetupApproverViewState.fetchState),p=u(n=>j(n)),g=N(),l=u(n=>b(n)),f=u(n=>S(n).remiSetupApproverViewUpdateData);if(c.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(V())},[f]),c.useEffect(()=>{i||d!=="Not-Started"||(a(!0),t(T(!0,!1,!1,!1)))},[i,d,t]),O.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");c.useEffect(()=>{l.allApprovalRules.length===0&&l.fetchState==="Completed"&&(o||(h(!0),t(m())),e("./new"))},[o,l,t]);const R={events:p.companyId!=null?[`private-encrypted-${p.companyId}.${w}`]:[],eventCallback:(n,_,y)=>{n.endsWith(w)&&y.onApprovalRulesEventReceived(n)}};return p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?s.jsx(k,{to:"../../promo"}):p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||l.fetchState!=="Completed"&&l.fetchState!=="Error"?s.jsx(W,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}}):s.jsx(q,{currentTenant:p,location:r,navigate:e,...R})},I="reimbursement-approval-rule-update",H=D(function(e){const r=b(e),t=S(e).remiSetupApproverViewUpdateData,i={};for(const o of Object.values(e.contactState.contactById))o?.id!=null&&(i[o.id]=o.fullName);const a={};for(const o of Object.values(e.classState.classesByKey))o?.classId!=null&&(a[o.classId]=o.className);return{approvalView:r,remiSetupApproverViewUpdateData:t,vendorNamesById:i,departmentNamesById:a}},function(e,r){const{navigate:t,location:i}=r;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(B(!1))},onBackClick:()=>{F(i)?t("../../"):t("../../../reimbursements/setup")},onDeleteRuleClick:a=>{e(U(a,!0))},onEditRuleClick:a=>{a!=null?(e(m(a)),t(`./${a}/edit`)):(e(m()),t("./new"))},onReorderRules:a=>{e(Q(a,!0))}}})($(X)),J=()=>{const e=u(t=>j(t)),{isApprovalRulesV3Enabled:r}=M(e?.tenantId);return r?s.jsx(L,{}):s.jsx(G,{})},L=()=>{const e=E(),r=x(),t=C(),[i,a]=c.useState(!1),[o,h]=c.useState(!1),d=u(n=>n.remiSetupApproverViewState.fetchState),p=u(n=>j(n)),g=N(),l=u(n=>b(n)),f=u(n=>S(n).remiSetupApproverViewUpdateData);if(c.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(V())},[f]),c.useEffect(()=>{i||d!=="Not-Started"||(a(!0),t(T(!0,!1,!1,!0)))},[i,d,t]),O.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");c.useEffect(()=>{l.allApprovalRules.length===0&&l.fetchState==="Completed"&&(o||(h(!0),t(m())),e("./new"))},[o,l,t]);const R={events:p.companyId!=null?[`private-encrypted-${p.companyId}.${I}`]:[],eventCallback:(n,_,y)=>{n.endsWith(I)&&y.onApprovalRulesEventReceived(n)}};return p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?s.jsx(k,{to:"../../promo"}):p.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||l.fetchState!=="Completed"&&l.fetchState!=="Error"?s.jsx(W,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}}):s.jsx(H,{currentTenant:p,location:r,navigate:e,...R})};function oe(){return s.jsxs(z,{children:[s.jsx(v,{path:"/",element:s.jsx(J,{})}),s.jsx(v,{path:"/new",element:s.jsx(A,{})}),s.jsx(v,{path:"/:approvalRuleId/edit",element:s.jsx(A,{})}),s.jsx(v,{path:"*",element:s.jsx(P,{})})]})}export{oe as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-B6jAIe9x.js";import{a as y}from"./sentry-95bdnR3R.js";import{h as _,u as C,g as O,i as k,j as R,n as F}from"./core-CLKYLs-8.js";import{Q0 as E,PM as T,F8 as V,Fk as j,Ff as A,Fg as w,Q1 as B,eW as M,Fe as Q}from"./zeni-epic-state-CjQblqOQ.js";import{z as N,m as P,B as $,bM as W,af as q,bz as K,bN as L}from"./index-BeMQfmRp.js";import"./mui-AZmtqUsi.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]="ab9d7f0f-6388-46ee-8d2b-023752825b72",e._sentryDebugIdIdentifier="sentry-dbid-ab9d7f0f-6388-46ee-8d2b-023752825b72")}catch{}})();const G=F(function(e,s){const t=E(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",r=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return s.approvalRuleId&&(n=t.allApprovalRules.findIndex(p=>p.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:r,isLowerBoundDisabled:n,approvalUpdateActionType:o}},function(e,s){const{navigate:t,approvalUpdateDataView:o,approverViewData:r,approvalRuleId:n}=s,p=o.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const b=[];return v.forEach(u=>{const S=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(m=>{const f=(h=m.value,B(h)==null);var h;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),c=S.concat(I);b.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),b},l={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(p==="approval_create"){const v={criteria:l,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}else{const v={approvalRuleId:n,criteria:l,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}},onResetClick:()=>{e(A()),p==="approval_update"||i?t("../"):r.allApprovalRules.length===0&&r.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),p==="approval_update"||i?t("../"):r.allApprovalRules.length===0&&r.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!1))},onSaveRuleSuccess:()=>{t("../")}}})(W);function H(){const e=_(),s=C(),t=O(),{approvalRuleId:o}=k(),r=N.getSignedInUser(),n=P(),p=R(l=>E(l)),i=R(l=>T(l)),[a,d]=y.useState(!1);if(y.useEffect(()=>{a||(d(!0),s(V(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(o!=null?"../../":"../")},[i,o]),r==null)throw Error("Can't access address page without signing in...");return p.approversDetailsFetchStatus.fetchState=="Not-Started"||p.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx($,{fetchState:p.approversDetailsFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):g.jsx(G,{navigate:e,approvalUpdateDataView:p,approvalRuleId:o,approverViewData:i,location:t})}function se(e){return B(e)==null}const J=F(function(e,s){const t=E(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",r=[],n={};for(const p of Object.values(e.contactState.contactById))p?.id!=null&&(r.push(p.id),n[p.id]=p.fullName);return{localData:t,approvalUpdateActionType:o,allVendorIds:r,vendorNamesById:n,editingRuleId:o==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:T(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:o,approverViewData:r,approvalRuleId:n}=s,p=o.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(f=>{const h=f.actorKind?.selectedOption,U=f.selectedRole?.selectedOption;let D=[];h==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:h==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map(z=>({type:"user",subType:void 0,userId:z.userId,idType:"user",isImplicitActor:!1})));const x=f.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})}),m},l=a.amountCriteria,v=a.vendorCriteria,b=a.departmentCriteria,u={};if(l!=null&&l.comparator.selectedOption!=null){const c=l.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:l.min,max:c==="greater_than"?void 0:l.max}}const S=v?.selection.selectedOptions??[];S.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:S});const I=b?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:b?.operator.selectedOption??"is",departmentIds:I}),p==="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(w(c))}else{const c={approvalRuleId:n,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}},onResetClick:()=>{e(A()),p==="approval_update"||i?t("../"):r.allApprovalRules.length===0&&r.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),p==="approval_update"||i?t("../"):r.allApprovalRules.length===0&&r.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(Q(a)),t(p==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(L);function oe(){const e=R(t=>M(t)),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?g.jsx(X,{}):g.jsx(H,{})}function X(){const e=_(),s=C(),t=O(),{approvalRuleId:o}=k(),r=N.getSignedInUser(),n=P(),p=R(l=>E(l)),i=R(l=>T(l)),[a,d]=y.useState(!1);if(y.useEffect(()=>{a||(d(!0),s(V(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(o!=null?"../../":"../")},[i,o]),r==null)throw Error("Can't access address page without signing in...");return p.approversDetailsFetchStatus.fetchState=="Not-Started"||p.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx($,{fetchState:p.approversDetailsFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):g.jsx(J,{navigate:e,approvalUpdateDataView:p,approvalRuleId:o,approverViewData:i,location:t},o??"new")}export{oe as R,se as i};
1
+ import{j as g}from"./liveblocks-B6jAIe9x.js";import{a as y}from"./sentry-95bdnR3R.js";import{h as _,u as C,g as O,i as k,j as R,n as F}from"./core-CLKYLs-8.js";import{Q0 as E,PM as T,F8 as V,Fk as j,Ff as A,Fg as w,Q1 as B,eW as M,Fe as Q}from"./zeni-epic-state-CjQblqOQ.js";import{z as N,m as P,B as $,bM as W,af as q,bz as K,bN as L}from"./index-D_hiFYsE.js";import"./mui-AZmtqUsi.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]="ab9d7f0f-6388-46ee-8d2b-023752825b72",e._sentryDebugIdIdentifier="sentry-dbid-ab9d7f0f-6388-46ee-8d2b-023752825b72")}catch{}})();const G=F(function(e,s){const t=E(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",r=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return s.approvalRuleId&&(n=t.allApprovalRules.findIndex(p=>p.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:r,isLowerBoundDisabled:n,approvalUpdateActionType:o}},function(e,s){const{navigate:t,approvalUpdateDataView:o,approverViewData:r,approvalRuleId:n}=s,p=o.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const b=[];return v.forEach(u=>{const S=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(m=>{const f=(h=m.value,B(h)==null);var h;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),c=S.concat(I);b.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),b},l={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(p==="approval_create"){const v={criteria:l,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}else{const v={approvalRuleId:n,criteria:l,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}},onResetClick:()=>{e(A()),p==="approval_update"||i?t("../"):r.allApprovalRules.length===0&&r.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),p==="approval_update"||i?t("../"):r.allApprovalRules.length===0&&r.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!1))},onSaveRuleSuccess:()=>{t("../")}}})(W);function H(){const e=_(),s=C(),t=O(),{approvalRuleId:o}=k(),r=N.getSignedInUser(),n=P(),p=R(l=>E(l)),i=R(l=>T(l)),[a,d]=y.useState(!1);if(y.useEffect(()=>{a||(d(!0),s(V(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(o!=null?"../../":"../")},[i,o]),r==null)throw Error("Can't access address page without signing in...");return p.approversDetailsFetchStatus.fetchState=="Not-Started"||p.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx($,{fetchState:p.approversDetailsFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):g.jsx(G,{navigate:e,approvalUpdateDataView:p,approvalRuleId:o,approverViewData:i,location:t})}function se(e){return B(e)==null}const J=F(function(e,s){const t=E(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",r=[],n={};for(const p of Object.values(e.contactState.contactById))p?.id!=null&&(r.push(p.id),n[p.id]=p.fullName);return{localData:t,approvalUpdateActionType:o,allVendorIds:r,vendorNamesById:n,editingRuleId:o==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:T(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:o,approverViewData:r,approvalRuleId:n}=s,p=o.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(f=>{const h=f.actorKind?.selectedOption,U=f.selectedRole?.selectedOption;let D=[];h==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:h==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map(z=>({type:"user",subType:void 0,userId:z.userId,idType:"user",isImplicitActor:!1})));const x=f.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})}),m},l=a.amountCriteria,v=a.vendorCriteria,b=a.departmentCriteria,u={};if(l!=null&&l.comparator.selectedOption!=null){const c=l.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:l.min,max:c==="greater_than"?void 0:l.max}}const S=v?.selection.selectedOptions??[];S.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:S});const I=b?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:b?.operator.selectedOption??"is",departmentIds:I}),p==="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(w(c))}else{const c={approvalRuleId:n,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}},onResetClick:()=>{e(A()),p==="approval_update"||i?t("../"):r.allApprovalRules.length===0&&r.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),p==="approval_update"||i?t("../"):r.allApprovalRules.length===0&&r.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(Q(a)),t(p==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(L);function oe(){const e=R(t=>M(t)),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?g.jsx(X,{}):g.jsx(H,{})}function X(){const e=_(),s=C(),t=O(),{approvalRuleId:o}=k(),r=N.getSignedInUser(),n=P(),p=R(l=>E(l)),i=R(l=>T(l)),[a,d]=y.useState(!1);if(y.useEffect(()=>{a||(d(!0),s(V(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(o!=null?"../../":"../")},[i,o]),r==null)throw Error("Can't access address page without signing in...");return p.approversDetailsFetchStatus.fetchState=="Not-Started"||p.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx($,{fetchState:p.approversDetailsFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):g.jsx(J,{navigate:e,approvalUpdateDataView:p,approvalRuleId:o,approverViewData:i,location:t},o??"new")}export{oe as R,se as i};