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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/assets/{AddressRoutes-BqX5wkCR.js → AddressRoutes-C8E4I-UT.js} +1 -1
  2. package/dist/assets/{AddressScreen-ScWWmTbP.js → AddressScreen-DV4gK_4i.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-quWQqhzX.js → AiCfoScreen-CJQFw07R.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-CQmYX8YN.js → BillPayApprovalRoutes-Dz2xD1tC.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-jZS0wJcj.js → BillPayRoutes-Os14xiVD.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DFgVqXvI.js → BusinessVerificationPageScreen-BKvR8fKs.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-BbBCL2AM.js → CardsAiCfoScreen-DTFvzHIL.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-BPGek5pB.js → ChargeCardRoutes-DDxAQjwA.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-DavSJynu.js → CompanyPassportScreen-DetGWMZx.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-BbANlW5J.js → ConnectionAuthScreen-BC2sFUmX.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingAuthScreen-kiJ2IeW7.js → CustomerOnboardingAuthScreen-Bq-Ubv4b.js} +1 -1
  12. package/dist/assets/{CustomerOnboardingRoutes-6ipmFo_1.js → CustomerOnboardingRoutes-CXBEVGX4.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-Brg8B8gk.js → DashboardRoutes-eNF287fs.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-B6se2qjz.js → DefaultTenantHome-bOMFA9uq.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-jS6brB2p.js → DomesticWireDetailScreen-BMyfqSTi.js} +1 -1
  16. package/dist/assets/{DrawerScreen-D0g6PABS.js → DrawerScreen--Suq3tvT.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-qim0q068.js → EntityDetailRoutes-BGhUBNO_.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-D3rXxAM_.js → ExpenseAutomationRoutes-ByFBxCiw.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-Y7t6ABdh.js → FeaturePreviewScreen-heeivM6W.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-BUpxwCNc.js → HubSpotOAuthCallbackScreen-0saA8ZXr.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-5wgvqx65.js → MagicLinkRoutes-CMAONj1z.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-CelaLjKf.js → MagicLinkSignInScreen-Dg99P6Pw.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-Sx7ydj7A.js → MobileAppDrawer-BI_hKtLW.js} +1 -1
  24. package/dist/assets/{NotFoundScreen-BDl5tn8o.js → NotFoundScreen-DUKrEDOk.js} +1 -1
  25. package/dist/assets/{NotificationRoutes-Cdcu8PTz.js → NotificationRoutes-D64xsn7f.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-C5pyboC-.js → OAuthConsentScreen-Mj5Bje1l.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-DjwWiUAb.js → PandLWithForecastRoutes-Dt90QdCw.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-x62_g_WP.js → PeopleRoutes-2kLgkUle.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-DQciMsYC.js → PerformanceRoutes-CKlQ6rou.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-DXq_HXCX.js → QBOConnectionScreen-BaZwNX6H.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-DNdLnut4.js → ReferralListScreen-DyC1Khln.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-BazeprVG.js → ReimbursementApprovalRoutes-Bks_7P4u.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js → ReimbursementApprovalRuleDetailScreen-ClRq5kCS.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-Bb9JPi0m.js → ReimbursementRoutes-4pQ7nHpz.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-DB2v4EPm.js → ReportsRoutes-BOrBSfD8.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-ChJyJSHY.js → RewardsRoutes-kDqXZQmp.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-8R8Dd2d9.js → ScreenRoutes-BddXHfq8.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-oK_kou4I.js → SettingsRoutes-CN__-GS9.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-CVKPKeC9.js → SetupPagesScreen-Duc28IO6.js} +1 -1
  40. package/dist/assets/{SignInScreen-C7vB3Bra.js → SignInScreen-WsALbw6J.js} +1 -1
  41. package/dist/assets/{SignOutScreen-CQYa9Dvp.js → SignOutScreen-DBYHyG26.js} +1 -1
  42. package/dist/assets/{TaskListScreen-WRcn05lO.js → TaskListScreen-gPJk_aPE.js} +1 -1
  43. package/dist/assets/{TaskRoutes-DoWinBID.js → TaskRoutes-D7b5hUHG.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-B4ryZwp2.js → TransactionDetailRoutes-DMGvj5pX.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-DB5lxQrk.js → TransactionDetailScreen-L3SyvDDw.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-6SM8gNlu.js → TransactionListRoutes-yd5cXXN9.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-DHuVCY9q.js → TreasuryRoutes-idT6t3yc.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-CwYVQ8VQ.js → VendorsRoutes-Cv1guWUA.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-DLnf9dkP.js → WiseConfirmationScreen-B9z9Ex9l.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-u96OM2YN.js → ZeniAccountRoutes-Bmxg5Hu_.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-D9UEHLLF.js → ZeniAccountStatementScreen-B1x9Ll2M.js} +1 -1
  52. package/dist/assets/{analyticsHelper-Cq2pq-lr.js → analyticsHelper-F9bkDfUR.js} +1 -1
  53. package/dist/assets/{getLocaleForTenant-O3Y2pcaQ.js → getLocaleForTenant-YNgm3b7A.js} +1 -1
  54. package/dist/assets/{index-ilZtTEZn.js → index-BGtgXdBV.js} +5 -5
  55. package/dist/assets/{routePaths-C1rKvS5o.js → routePaths-DZDk8gbY.js} +1 -1
  56. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BDn05q_k.js → useAiCfoDashboardSuggestedQuestionsChips-D6zsFuCp.js} +1 -1
  57. package/dist/assets/{useAskAiCfoHostNavButtonProps-33WX5dhg.js → useAskAiCfoHostNavButtonProps-re9SKSxV.js} +1 -1
  58. package/dist/assets/{useCashManagementBanner-CBJfpbK7.js → useCashManagementBanner-DoVCCRms.js} +1 -1
  59. package/dist/assets/{useChargeCardPusherEvents-Cvnaf2Z-.js → useChargeCardPusherEvents-DxT609il.js} +1 -1
  60. package/dist/assets/{useEmailConnectResultRefresh-BzWsu8a4.js → useEmailConnectResultRefresh-CdPAtb7K.js} +1 -1
  61. package/dist/assets/{useInitialThreadRequest-Bx57kb_d.js → useInitialThreadRequest-CmTGqSIj.js} +1 -1
  62. package/dist/assets/{withTransactionSidePanel-DeW-W6do.js → withTransactionSidePanel-R0O15XnS.js} +1 -1
  63. package/dist/index.html +1 -1
  64. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-CS0rfBBF.js";import{a as u}from"./sentry-CEfOando.js";import{u as y,j as b,n as w,g as A,N as L}from"./core-D6ttr5iw.js";import{LU as U,eX as _,g2 as N,LV as k,oa as R,LW as z}from"./zeni-epic-state-Cl3jFj7z.js";import{u as j,z as f,L as T,t as I,a as O,b as $}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{t as P}from"./getLocaleForTenant-O3Y2pcaQ.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="d8287f04-58d7-42de-8b3b-f108d052d52f",t._sentryDebugIdIdentifier="sentry-dbid-d8287f04-58d7-42de-8b3b-f108d052d52f")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(L,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>U(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(N(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!k(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const V=["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"],q={"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 V)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-CS0rfBBF.js";import{a as u}from"./sentry-CEfOando.js";import{u as y,j as b,n as w,g as A,N as L}from"./core-D6ttr5iw.js";import{LU as U,eX as _,g2 as N,LV as k,oa as R,LW as z}from"./zeni-epic-state-Cl3jFj7z.js";import{u as j,z as f,L as T,t as I,a as O,b as $}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import{t as P}from"./getLocaleForTenant-YNgm3b7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="d8287f04-58d7-42de-8b3b-f108d052d52f",t._sentryDebugIdIdentifier="sentry-dbid-d8287f04-58d7-42de-8b3b-f108d052d52f")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(L,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>U(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(N(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!k(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const V=["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"],q={"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 V)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-CS0rfBBF.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-D6ttr5iw.js";import{Q1 as k,Q8 as _,gi as W,gh as X,gg as q,jv as J,N9 as K,ru as L,eX as V,Pz as D,jt as T,Q2 as v,Qb as j,jr as F,jO as G}from"./zeni-epic-state-Cl3jFj7z.js";import{bA as M,Z as N,Q as R,z as U,m as O,r as p,d as S,w as Q,bB as Y,o as Z,bC as ee,s as te}from"./index-ilZtTEZn.js";import{n as z}from"./mui-vLo47rlo.js";import"./sentry-CEfOando.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]="8719a0d9-f060-44cf-b296-a406927b51bb",e._sentryDebugIdIdentifier="sentry-dbid-8719a0d9-f060-44cf-b296-a406927b51bb")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(K("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(X(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(M);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=z.div`
1
+ import{j as l}from"./liveblocks-CS0rfBBF.js";import{h as w,g as C,j as h,n as A,i as B}from"./core-D6ttr5iw.js";import{Q1 as k,Q8 as _,gi as W,gh as X,gg as q,jv as J,N9 as K,ru as L,eX as V,Pz as D,jt as T,Q2 as v,Qb as j,jr as F,jO as G}from"./zeni-epic-state-Cl3jFj7z.js";import{bA as M,Z as N,Q as R,z as U,m as O,r as p,d as S,w as Q,bB as Y,o as Z,bC as ee,s as te}from"./index-BGtgXdBV.js";import{n as z}from"./mui-vLo47rlo.js";import"./sentry-CEfOando.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]="8719a0d9-f060-44cf-b296-a406927b51bb",e._sentryDebugIdIdentifier="sentry-dbid-8719a0d9-f060-44cf-b296-a406927b51bb")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(K("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(X(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(M);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=z.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-CS0rfBBF.js";import{Z as c,A as l,m as f}from"./index-ilZtTEZn.js";import{D as p}from"./mui-vLo47rlo.js";import"./sentry-CEfOando.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]="6c7fcb16-2846-45a2-9de2-7f28416bec9e",e._sentryDebugIdIdentifier="sentry-dbid-6c7fcb16-2846-45a2-9de2-7f28416bec9e")}catch{}})();const b={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)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{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-CS0rfBBF.js";import{Z as c,A as l,m as f}from"./index-BGtgXdBV.js";import{D as p}from"./mui-vLo47rlo.js";import"./sentry-CEfOando.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]="6c7fcb16-2846-45a2-9de2-7f28416bec9e",e._sentryDebugIdIdentifier="sentry-dbid-6c7fcb16-2846-45a2-9de2-7f28416bec9e")}catch{}})();const b={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)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{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-CS0rfBBF.js";import{a as d}from"./sentry-CEfOando.js";import{h as A,u as B,g as G,i as q,j as l,N as F,n as O,o as K,p as W}from"./core-D6ttr5iw.js";import{Oh as _,eX as M,NF as R,ly as Y,Ka as k,Om as $,N8 as z,ky as L,Kb as S,NK as V,NL as X,Na as H,N9 as J}from"./zeni-epic-state-Cl3jFj7z.js";import{aW as Q,e as U,r as Z,s as tt}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{d as b}from"./decodeURIComponentSafe-D0vQ4d1Q.js";import{w as et}from"./withTransactionSidePanel-DeW-W6do.js";import{f as at,c as nt}from"./routePaths-C1rKvS5o.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import"./TransactionDetailScreen-DB5lxQrk.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]="97bb22cb-ca01-423d-a889-734442f8f09f",a._sentryDebugIdIdentifier="sentry-dbid-97bb22cb-ca01-423d-a889-734442f8f09f")}catch{}})();const ot=O(function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:L(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(X()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=G(),[m,h]=d.useState(!1),[T,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(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>M(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(h(!0),o(Y(i)))},[m,p,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&T===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,T,E]),p?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{h(!1),D(!1)},...t}):s.jsx(F,{to:I(j.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(K,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import{a as d}from"./sentry-CEfOando.js";import{h as A,u as B,g as G,i as q,j as l,N as F,n as O,o as K,p as W}from"./core-D6ttr5iw.js";import{Oh as _,eX as M,NF as R,ly as Y,Ka as k,Om as $,N8 as z,ky as L,Kb as S,NK as V,NL as X,Na as H,N9 as J}from"./zeni-epic-state-Cl3jFj7z.js";import{aW as Q,e as U,r as Z,s as tt}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import{d as b}from"./decodeURIComponentSafe-D0vQ4d1Q.js";import{w as et}from"./withTransactionSidePanel-R0O15XnS.js";import{f as at,c as nt}from"./routePaths-DZDk8gbY.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import"./TransactionDetailScreen-L3SyvDDw.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]="97bb22cb-ca01-423d-a889-734442f8f09f",a._sentryDebugIdIdentifier="sentry-dbid-97bb22cb-ca01-423d-a889-734442f8f09f")}catch{}})();const ot=O(function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:L(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(X()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=G(),[m,h]=d.useState(!1),[T,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(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>M(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(h(!0),o(Y(i)))},[m,p,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&T===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,T,E]),p?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{h(!1),D(!1)},...t}):s.jsx(F,{to:I(j.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(K,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-CS0rfBBF.js";import oa from"./NotFoundScreen-BDl5tn8o.js";import{a as o,b as Jt}from"./sentry-CEfOando.js";import{n as Ue,S as sa}from"./mui-vLo47rlo.js";import{u as pe,h as Yt,g as Ke,j as x,n as ca,i as xt,o as ia,p as Ge}from"./core-D6ttr5iw.js";import{eX as Re,T0 as la,ok as ke,fZ as ra,s5 as da,oC as Kt,oX as Zt,T1 as Qt,p5 as ua,T2 as Ht,ov as ma,rD as pa,fJ as Ie,T3 as De,uc as Wt,Ev as Xt,T4 as en,T5 as ha,rb as Ze,Oi as Pt,Ok as ga,kB as Ca,Ol as Sa,kI as fa,c_ as Ia,vp as Qe,oI as tn,pa as Fe,oA as de,T6 as ka,Na as Rt,N9 as we,T7 as Dt,kZ as Ea,T8 as Ta,T9 as ya,Ta as ba,Tb as va,oP as Aa,pd as xe,Tc as wa,Td as xa,Te as Pa,pk as Ra,kM as Da,kD as Fa,Tf as Ua,kL as Ft,Os as Ba,Tg as Oa,Th as _a,r7 as Va,qL as za,pb as me,qK as Ne,Ti as Ma,Tj as La,Tk as ja,mg as $a,bo as qa,mb as Ut,lZ as Ga,Tl as Na,fz as Bt,gy as Ja,m8 as Ya,xi as Ka,Tm as Za,pL as Qa,pG as Ha,pK as Wa,pv as Xa,Tn as eo,fM as nn,o_ as to,oL as no,f_ as Ot,pf as ao,To as oo,Tp as so,pc as an,Tq as co,Tr as io,Ts as lo,Tt as ro,Tu as _t,rj as uo,qC as mo,N8 as po,Tv as ho,Tw as go,kK as Co,Tx as So,Jb as fo,kJ as Io,ky as ko,fL as Eo,q8 as on,qu as To,p9 as Vt,pe as yo,bE as bo,m5 as vo,m2 as Ao,Ty as wo,pu as zt,qq as Mt,qo as xo,Tz as Po,qd as Ro,pV as Do,qr as Fo,TA as Uo,TB as Bo,pZ as Oo,TC as _o,pQ as Vo,pY as zo,pW as Mo,qx as Lo}from"./zeni-epic-state-Cl3jFj7z.js";import{Q as sn,d as X,e as q,s as ae,Y as cn,$ as ln,cZ as jo,z as Be,c_ as $o,at as Pe,c$ as qo,aY as Lt,w as rn,d0 as Go,aq as Je,a as No,a8 as Jo,d1 as Yo,a3 as Ko,d2 as Zo,X as Qo,d3 as Ho,d4 as Wo,S as Xo,I as es,aR as ts,d5 as ns,d6 as as,bd as os,A as ss,aU as cs}from"./index-ilZtTEZn.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{f as jt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-DB5lxQrk.js";import{w as us}from"./withTransactionSidePanel-DeW-W6do.js";import{h as ms,v as ps}from"./routePaths-C1rKvS5o.js";import{g as Ye}from"./accountMappingHelper-s2xO6MjH.js";import{D as hs}from"./DrawerScreen-D0g6PABS.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./decodeURIComponentSafe-D0vQ4d1Q.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]="2dc82eea-decd-4034-a2e3-59b9ebe8846d",t._sentryDebugIdIdentifier="sentry-dbid-2dc82eea-decd-4034-a2e3-59b9ebe8846d")}catch{}})();const gs=()=>{const t=pe(),l=Yt(),B=Ke(),f=x(d=>Re(d)),{useFeatureGate:b}=sn(),{isFeatureEnabled:S}=b(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=b(X.aiAuditScorePercentage),I=x(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=x(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),E=o.useCallback((d,G,ee=!1)=>{t(ke({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),g=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(g.month,g.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),E(g,f.tenantId,!0)},[E,g,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ae(B.state?.pathnameStackToGoBack,B.pathname),k=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&g!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,g]),{areTenantIdsInSync:T}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&T&&E(g,f.tenantId)},[E,g,s.fetchState,f.tenantId,T]),o.useEffect(()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&T&&t(da(g))},[g,s.monthClosePerformanceTrendFetchStatus.fetchState,T]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(Cs,{children:h.jsx(jo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:k,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},Cs=Ue.div`
1
+ import{j as h}from"./liveblocks-CS0rfBBF.js";import oa from"./NotFoundScreen-DUKrEDOk.js";import{a as o,b as Jt}from"./sentry-CEfOando.js";import{n as Ue,S as sa}from"./mui-vLo47rlo.js";import{u as pe,h as Yt,g as Ke,j as x,n as ca,i as xt,o as ia,p as Ge}from"./core-D6ttr5iw.js";import{eX as Re,T0 as la,ok as ke,fZ as ra,s5 as da,oC as Kt,oX as Zt,T1 as Qt,p5 as ua,T2 as Ht,ov as ma,rD as pa,fJ as Ie,T3 as De,uc as Wt,Ev as Xt,T4 as en,T5 as ha,rb as Ze,Oi as Pt,Ok as ga,kB as Ca,Ol as Sa,kI as fa,c_ as Ia,vp as Qe,oI as tn,pa as Fe,oA as de,T6 as ka,Na as Rt,N9 as we,T7 as Dt,kZ as Ea,T8 as Ta,T9 as ya,Ta as ba,Tb as va,oP as Aa,pd as xe,Tc as wa,Td as xa,Te as Pa,pk as Ra,kM as Da,kD as Fa,Tf as Ua,kL as Ft,Os as Ba,Tg as Oa,Th as _a,r7 as Va,qL as za,pb as me,qK as Ne,Ti as Ma,Tj as La,Tk as ja,mg as $a,bo as qa,mb as Ut,lZ as Ga,Tl as Na,fz as Bt,gy as Ja,m8 as Ya,xi as Ka,Tm as Za,pL as Qa,pG as Ha,pK as Wa,pv as Xa,Tn as eo,fM as nn,o_ as to,oL as no,f_ as Ot,pf as ao,To as oo,Tp as so,pc as an,Tq as co,Tr as io,Ts as lo,Tt as ro,Tu as _t,rj as uo,qC as mo,N8 as po,Tv as ho,Tw as go,kK as Co,Tx as So,Jb as fo,kJ as Io,ky as ko,fL as Eo,q8 as on,qu as To,p9 as Vt,pe as yo,bE as bo,m5 as vo,m2 as Ao,Ty as wo,pu as zt,qq as Mt,qo as xo,Tz as Po,qd as Ro,pV as Do,qr as Fo,TA as Uo,TB as Bo,pZ as Oo,TC as _o,pQ as Vo,pY as zo,pW as Mo,qx as Lo}from"./zeni-epic-state-Cl3jFj7z.js";import{Q as sn,d as X,e as q,s as ae,Y as cn,$ as ln,cZ as jo,z as Be,c_ as $o,at as Pe,c$ as qo,aY as Lt,w as rn,d0 as Go,aq as Je,a as No,a8 as Jo,d1 as Yo,a3 as Ko,d2 as Zo,X as Qo,d3 as Ho,d4 as Wo,S as Xo,I as es,aR as ts,d5 as ns,d6 as as,bd as os,A as ss,aU as cs}from"./index-BGtgXdBV.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import{f as jt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-L3SyvDDw.js";import{w as us}from"./withTransactionSidePanel-R0O15XnS.js";import{h as ms,v as ps}from"./routePaths-DZDk8gbY.js";import{g as Ye}from"./accountMappingHelper-s2xO6MjH.js";import{D as hs}from"./DrawerScreen--Suq3tvT.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";import"./decodeURIComponentSafe-D0vQ4d1Q.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]="2dc82eea-decd-4034-a2e3-59b9ebe8846d",t._sentryDebugIdIdentifier="sentry-dbid-2dc82eea-decd-4034-a2e3-59b9ebe8846d")}catch{}})();const gs=()=>{const t=pe(),l=Yt(),B=Ke(),f=x(d=>Re(d)),{useFeatureGate:b}=sn(),{isFeatureEnabled:S}=b(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=b(X.aiAuditScorePercentage),I=x(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=x(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),E=o.useCallback((d,G,ee=!1)=>{t(ke({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),g=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(g.month,g.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),E(g,f.tenantId,!0)},[E,g,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ae(B.state?.pathnameStackToGoBack,B.pathname),k=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&g!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,g]),{areTenantIdsInSync:T}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{g!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&T&&E(g,f.tenantId)},[E,g,s.fetchState,f.tenantId,T]),o.useEffect(()=>{g!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&T&&t(da(g))},[g,s.monthClosePerformanceTrendFetchStatus.fetchState,T]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(Cs,{children:h.jsx(jo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:k,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},Cs=Ue.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-CS0rfBBF.js";import{a as r}from"./sentry-CEfOando.js";import{a4 as f,a5 as c,a6 as l,r as p}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import m from"./NotFoundScreen-BDl5tn8o.js";import{h as b,g as u}from"./core-D6ttr5iw.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="0a21eb7e-92fc-4aae-b32a-082a8d04cb1f",a._sentryDebugIdIdentifier="sentry-dbid-0a21eb7e-92fc-4aae-b32a-082a8d04cb1f")}catch{}})();const _=()=>{const a=b(),e=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=p(e.state?.pathnameStackToGoBack),d=n.poppedPathname??k();a(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(e.pathname);return o!=null?s.jsx(c,{menuItem:l(o),onDemoClick:t,onGoBack:i}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{_ as F};
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import{a as r}from"./sentry-CEfOando.js";import{a4 as f,a5 as c,a6 as l,r as p}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import m from"./NotFoundScreen-DUKrEDOk.js";import{h as b,g as u}from"./core-D6ttr5iw.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="0a21eb7e-92fc-4aae-b32a-082a8d04cb1f",a._sentryDebugIdIdentifier="sentry-dbid-0a21eb7e-92fc-4aae-b32a-082a8d04cb1f")}catch{}})();const _=()=>{const a=b(),e=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=p(e.state?.pathnameStackToGoBack),d=n.poppedPathname??k();a(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(e.pathname);return o!=null?s.jsx(c,{menuItem:l(o),onDemoClick:t,onGoBack:i}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{_ as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-CEfOando.js";import{u as f,h as l,g as m}from"./core-D6ttr5iw.js";import{hu as p,Mg as b,Mh as g}from"./zeni-epic-state-Cl3jFj7z.js";import{u as _,L as h,z as y}from"./index-ilZtTEZn.js";import"./liveblocks-CS0rfBBF.js";import"./recharts-BDyAk4nR.js";import"./mui-vLo47rlo.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="439a9e01-1be9-4040-b4fd-6323bf2b5bd7",e._sentryDebugIdIdentifier="sentry-dbid-439a9e01-1be9-4040-b4fd-6323bf2b5bd7")}catch{}})();function R(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:c}=_(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,b("revenue"),g("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};
1
+ import{a as r}from"./sentry-CEfOando.js";import{u as f,h as l,g as m}from"./core-D6ttr5iw.js";import{hu as p,Mg as b,Mh as g}from"./zeni-epic-state-Cl3jFj7z.js";import{u as _,L as h,z as y}from"./index-BGtgXdBV.js";import"./liveblocks-CS0rfBBF.js";import"./recharts-BDyAk4nR.js";import"./mui-vLo47rlo.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="439a9e01-1be9-4040-b4fd-6323bf2b5bd7",e._sentryDebugIdIdentifier="sentry-dbid-439a9e01-1be9-4040-b4fd-6323bf2b5bd7")}catch{}})();function R(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:c}=_(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,b("revenue"),g("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-CS0rfBBF.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-D6ttr5iw.js";import{M9 as k,Ma as v,Mb as M,Bd as B,A$ as T,Mc as A,Md as oe,Me as se,B3 as ie,fA as $,Ba as le,B7 as re}from"./zeni-epic-state-Cl3jFj7z.js";import{Z as g,o as r,q as de,e as j,k as G,O as ce,r as me,B as pe,s as K,Q as ue,d as he,E as xe,S as ge,m as fe,v as be,w as we,K as Se,F as ye,x as ke,y as ve,A as je,C as $e}from"./index-ilZtTEZn.js";import{n as m}from"./mui-vLo47rlo.js";import f from"./NotFoundScreen-BDl5tn8o.js";import{a as I}from"./sentry-CEfOando.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="8c1e6b5d-b10a-46fb-a669-fa4e2c08c5a0",e._sentryDebugIdIdentifier="sentry-dbid-8c1e6b5d-b10a-46fb-a669-fa4e2c08c5a0")}catch{}})();const Ie=m.div`
1
+ import{j as a}from"./liveblocks-CS0rfBBF.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-D6ttr5iw.js";import{M9 as k,Ma as v,Mb as M,Bd as B,A$ as T,Mc as A,Md as oe,Me as se,B3 as ie,fA as $,Ba as le,B7 as re}from"./zeni-epic-state-Cl3jFj7z.js";import{Z as g,o as r,q as de,e as j,k as G,O as ce,r as me,B as pe,s as K,Q as ue,d as he,E as xe,S as ge,m as fe,v as be,w as we,K as Se,F as ye,x as ke,y as ve,A as je,C as $e}from"./index-BGtgXdBV.js";import{n as m}from"./mui-vLo47rlo.js";import f from"./NotFoundScreen-DUKrEDOk.js";import{a as I}from"./sentry-CEfOando.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="8c1e6b5d-b10a-46fb-a669-fa4e2c08c5a0",e._sentryDebugIdIdentifier="sentry-dbid-8c1e6b5d-b10a-46fb-a669-fa4e2c08c5a0")}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-CS0rfBBF.js";import{a as g}from"./sentry-CEfOando.js";import{u as U,g as O,h as _,t as w,j as l,N as T}from"./core-D6ttr5iw.js";import{z as r,m as A,a as P,f as V,e as N,g as W,n as X,F as R,j as Y}from"./index-ilZtTEZn.js";import{eX as $,LW as q,M4 as B,LX as G,fA as H,g1 as J,M0 as K,gp as Q,cY as Z,M5 as ee,M6 as te}from"./zeni-epic-state-Cl3jFj7z.js";import{n as ne}from"./mui-vLo47rlo.js";import{u as se}from"./useDeviceId-DISstVTH.js";import{f as ae}from"./analyticsHelper-Cq2pq-lr.js";import{t as ie}from"./getLocaleForTenant-O3Y2pcaQ.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="6c254972-d90e-494e-9ca3-ca5d500479c3",t._sentryDebugIdIdentifier="sentry-dbid-6c254972-d90e-494e-9ca3-ca5d500479c3")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=U(),a=O(),f=_(),[y]=w(),n=y.get("token"),p=y.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:z,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=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=>$(e)),k=l(e=>q(e)),E=r.getSignedInUser(),v=A().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(B(n,i,m)))},[n,p,t,i,m,s?.zeniSessionId]),g.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(G(k.tenantsInOrder),s.zeniSessionId),H(s.userId,s.zeniSessionId,o.tenantId),t(J(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(K("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Q().then(()=>{const e=Y();e!=null&&V(e)}),setTimeout(()=>{N.trackLogin(W.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,b,s,o,k,v,a.state,t]);const j=g.useCallback(()=>{f("/signin/auth")},[f]),F=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),M=g.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(X,{phoneNumber:z,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:F,onVerifyOtp:M,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||m==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-CS0rfBBF.js";import{a as g}from"./sentry-CEfOando.js";import{u as U,g as O,h as _,t as w,j as l,N as T}from"./core-D6ttr5iw.js";import{z as r,m as A,a as P,f as V,e as N,g as W,n as X,F as R,j as Y}from"./index-BGtgXdBV.js";import{eX as $,LW as q,M4 as B,LX as G,fA as H,g1 as J,M0 as K,gp as Q,cY as Z,M5 as ee,M6 as te}from"./zeni-epic-state-Cl3jFj7z.js";import{n as ne}from"./mui-vLo47rlo.js";import{u as se}from"./useDeviceId-DISstVTH.js";import{f as ae}from"./analyticsHelper-F9bkDfUR.js";import{t as ie}from"./getLocaleForTenant-YNgm3b7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="6c254972-d90e-494e-9ca3-ca5d500479c3",t._sentryDebugIdIdentifier="sentry-dbid-6c254972-d90e-494e-9ca3-ca5d500479c3")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=U(),a=O(),f=_(),[y]=w(),n=y.get("token"),p=y.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:z,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=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=>$(e)),k=l(e=>q(e)),E=r.getSignedInUser(),v=A().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(B(n,i,m)))},[n,p,t,i,m,s?.zeniSessionId]),g.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(G(k.tenantsInOrder),s.zeniSessionId),H(s.userId,s.zeniSessionId,o.tenantId),t(J(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(K("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Q().then(()=>{const e=Y();e!=null&&V(e)}),setTimeout(()=>{N.trackLogin(W.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,b,s,o,k,v,a.state,t]);const j=g.useCallback(()=>{f("/signin/auth")},[f]),F=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),M=g.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(X,{phoneNumber:z,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:F,onVerifyOtp:M,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||m==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -1 +1 @@
1
- import{j as N}from"./liveblocks-CS0rfBBF.js";import{a as c}from"./sentry-CEfOando.js";import{u as me,j as n,i as Ze,g as qe,h as Ke,l as M}from"./core-D6ttr5iw.js";import{eX as be,fF as Xe,fG as pe,fr as Je,bn as ea,eW as aa,fH as ta,fI as na,fK as sa,fN as oa,fW as ia,fO as g,fQ as ra,fR as le,fU as da,fS as la,fT as ca,fV as ua,cN as fa,fY as ma,cT as ba,fq as pa,g1 as ha,g2 as Sa,g0 as ga}from"./zeni-epic-state-Cl3jFj7z.js";import{a8 as Ea,a9 as ka,S as Ca,Q as ya,z as k,v as Ia,u as Ta,d as r,i as wa,T as Aa,aa as Fa,I as _a,c as Da,ab as va,a4 as $a,ac as Ba,ad as xa,ae as ce,af as ue,L as Ma,ag as Pa,ah as fe,e as P,a0 as Ra,s as A,ai as R,aj as Na}from"./index-ilZtTEZn.js";import{D as Ua}from"./mui-vLo47rlo.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]="462687dd-944b-44e3-96e7-1b8a0a6d73c4",f._sentryDebugIdIdentifier="sentry-dbid-462687dd-944b-44e3-96e7-1b8a0a6d73c4")}catch{}})();const Va=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ze(),a=qe(),C=Ca(),o=Ke(),U=Je(),m=me(),{useFeatureGate:i}=ya(),V=k.getSignedInUser(),G=ea(V),s=n(e=>be(e)),he=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n(e=>aa(e)),j=O.uiState.currentChatSessionId,y=Ia(),{setLoading:Se}=Ta(),[F,L]=c.useState(void 0),_=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ee=wa(s,ge,H),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),W=n(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n(e=>na(e));c.useEffect(()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(sa(!0))},[y,T,D.fetchState,I]);const h=k.getSignedInUser(),v=n(e=>e.tenantState),Ce=n(e=>v.fetchState==="Completed"?oa(e):[]),E=n(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:we}=i(r.isExpenseAutomationEnabledV2),Q=Aa(),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=G||!G&&$e,xe=s.company!=null&&ia(s.company),w=ve&&xe,Me=n(e=>g(e).totalUnreadCount),Pe=n(e=>g(e).reducedFetchCountState),Z=n(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),q=n(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=n(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),$=n(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:X,isFetchingMore:J,hasFetchedAll:ee,fetchMore:Ne}=Fa();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(X===!1&&J===!1&&ee===!0)if(s?.companyId!=null&&K!=null){const e=`dashboard_${s.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[X,J,ee]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||$.fetchState!=="Not-Started"||m(le({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&$.fetchState==="In-Progress"&&(m(le({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:F},"comments")))},[F,$.fetchState]);const Ue={fetchStatus:Pe,count:Me},ae=t!=null?k.getSignedInUserTenant(t):null,te=n(e=>ae?.tenantId!=null?da(e,ae.tenantId):void 0),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const Ve=_a(),ne=n(e=>la(e,S,h,we,Te,w).fetchState),se=n(e=>ca(e).fetchState),Ge=_&&(ne==="Completed"||ne==="Error")||z&&(se==="Completed"||se==="Error")||!_&&!z?void 0:"disabled",Oe=c.useMemo(()=>ua(s.userRole),[s.userRole]),je=fa(Oe),Le=s?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&W.fetchState==="Completed"&&ma(W.notificationSettings,h.userEmail,H,s),oe=Da(),Ye=oe&&va(a),ie=ba(Ve?.loggedInUserRoleMap),re=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,B=c.useCallback(()=>w&&ie&&!k.getTreasuryPopupSeen(t??"")&&re===!1&&$a(a.pathname)!=="treasury",[w,ie,re,a.pathname,t]),[He,de]=c.useState(B);c.useEffect(()=>{de(B())},[B]);const We=n(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Qe=Ba(We);return N.jsx(Ua,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:N.jsx(xa,{signedInUser:V,currentTenantId:v.currentTenantId??"",tenants:v.fetchState==="Completed"?Ce:te!=null?[te]:[],currentTenant:s,isTenantDropdownDisabled:Ge,isSettings:ue(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:Ee,isTreasuryEnabled:w,treasuryYieldPercentage:Qe,isTreasuryPopupVisible:He,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:Q,selectedMenu:ce(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:oe,onNotificationIconClick:()=>{d(!1);let e=Z===0&&q>0?"notifications/comments":"notifications/tasks";ue(a)&&(e=Z===0&&q>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(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(P.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!he)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=R(l)&&l!=="command_center";if(R(e.type)&&E[s.tenantId]!=null&&P.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.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);fe(e.type)?(j!=null&&m(ga()),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=>{Se(Ma.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=ce(a);let b=`/${encodeURIComponent(u)}/`;const x=R(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":fe(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(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;P.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),de(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:O,isOnDashboard:_,updateCurrentChatSessionId:e=>{m(pa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:_e,newYearAnimationEnabled:De})})}),Ha=f=>{const d=me(),t=n(C=>be(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Xe(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return N.jsx(Va,{...f,...a})};export{Ha as M};
1
+ import{j as N}from"./liveblocks-CS0rfBBF.js";import{a as c}from"./sentry-CEfOando.js";import{u as me,j as n,i as Ze,g as qe,h as Ke,l as M}from"./core-D6ttr5iw.js";import{eX as be,fF as Xe,fG as pe,fr as Je,bn as ea,eW as aa,fH as ta,fI as na,fK as sa,fN as oa,fW as ia,fO as g,fQ as ra,fR as le,fU as da,fS as la,fT as ca,fV as ua,cN as fa,fY as ma,cT as ba,fq as pa,g1 as ha,g2 as Sa,g0 as ga}from"./zeni-epic-state-Cl3jFj7z.js";import{a8 as Ea,a9 as ka,S as Ca,Q as ya,z as k,v as Ia,u as Ta,d as r,i as wa,T as Aa,aa as Fa,I as _a,c as Da,ab as va,a4 as $a,ac as Ba,ad as xa,ae as ce,af as ue,L as Ma,ag as Pa,ah as fe,e as P,a0 as Ra,s as A,ai as R,aj as Na}from"./index-BGtgXdBV.js";import{D as Ua}from"./mui-vLo47rlo.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]="462687dd-944b-44e3-96e7-1b8a0a6d73c4",f._sentryDebugIdIdentifier="sentry-dbid-462687dd-944b-44e3-96e7-1b8a0a6d73c4")}catch{}})();const Va=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ze(),a=qe(),C=Ca(),o=Ke(),U=Je(),m=me(),{useFeatureGate:i}=ya(),V=k.getSignedInUser(),G=ea(V),s=n(e=>be(e)),he=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n(e=>aa(e)),j=O.uiState.currentChatSessionId,y=Ia(),{setLoading:Se}=Ta(),[F,L]=c.useState(void 0),_=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ee=wa(s,ge,H),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),W=n(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n(e=>na(e));c.useEffect(()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(sa(!0))},[y,T,D.fetchState,I]);const h=k.getSignedInUser(),v=n(e=>e.tenantState),Ce=n(e=>v.fetchState==="Completed"?oa(e):[]),E=n(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:we}=i(r.isExpenseAutomationEnabledV2),Q=Aa(),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=G||!G&&$e,xe=s.company!=null&&ia(s.company),w=ve&&xe,Me=n(e=>g(e).totalUnreadCount),Pe=n(e=>g(e).reducedFetchCountState),Z=n(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),q=n(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=n(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),$=n(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:X,isFetchingMore:J,hasFetchedAll:ee,fetchMore:Ne}=Fa();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(X===!1&&J===!1&&ee===!0)if(s?.companyId!=null&&K!=null){const e=`dashboard_${s.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[X,J,ee]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||$.fetchState!=="Not-Started"||m(le({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&$.fetchState==="In-Progress"&&(m(le({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:F},"comments")))},[F,$.fetchState]);const Ue={fetchStatus:Pe,count:Me},ae=t!=null?k.getSignedInUserTenant(t):null,te=n(e=>ae?.tenantId!=null?da(e,ae.tenantId):void 0),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const Ve=_a(),ne=n(e=>la(e,S,h,we,Te,w).fetchState),se=n(e=>ca(e).fetchState),Ge=_&&(ne==="Completed"||ne==="Error")||z&&(se==="Completed"||se==="Error")||!_&&!z?void 0:"disabled",Oe=c.useMemo(()=>ua(s.userRole),[s.userRole]),je=fa(Oe),Le=s?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&W.fetchState==="Completed"&&ma(W.notificationSettings,h.userEmail,H,s),oe=Da(),Ye=oe&&va(a),ie=ba(Ve?.loggedInUserRoleMap),re=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,B=c.useCallback(()=>w&&ie&&!k.getTreasuryPopupSeen(t??"")&&re===!1&&$a(a.pathname)!=="treasury",[w,ie,re,a.pathname,t]),[He,de]=c.useState(B);c.useEffect(()=>{de(B())},[B]);const We=n(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Qe=Ba(We);return N.jsx(Ua,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:N.jsx(xa,{signedInUser:V,currentTenantId:v.currentTenantId??"",tenants:v.fetchState==="Completed"?Ce:te!=null?[te]:[],currentTenant:s,isTenantDropdownDisabled:Ge,isSettings:ue(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:Ee,isTreasuryEnabled:w,treasuryYieldPercentage:Qe,isTreasuryPopupVisible:He,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:Q,selectedMenu:ce(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:oe,onNotificationIconClick:()=>{d(!1);let e=Z===0&&q>0?"notifications/comments":"notifications/tasks";ue(a)&&(e=Z===0&&q>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(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(P.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!he)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=R(l)&&l!=="command_center";if(R(e.type)&&E[s.tenantId]!=null&&P.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.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);fe(e.type)?(j!=null&&m(ga()),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=>{Se(Ma.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=ce(a);let b=`/${encodeURIComponent(u)}/`;const x=R(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":fe(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(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;P.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),de(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:O,isOnDashboard:_,updateCurrentChatSessionId:e=>{m(pa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:_e,newYearAnimationEnabled:De})})}),Ha=f=>{const d=me(),t=n(C=>be(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Xe(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return N.jsx(Va,{...f,...a})};export{Ha as M};
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-CS0rfBBF.js";import{h as r,n}from"./core-D6ttr5iw.js";import{N as i}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import"./sentry-CEfOando.js";import"./zeni-epic-state-Cl3jFj7z.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="0d8bbeee-ef94-478e-b36a-0f30a9be8cda",e._sentryDebugIdIdentifier="sentry-dbid-0d8bbeee-ef94-478e-b36a-0f30a9be8cda")}catch{}})();const a=n(null,function(e,o){return{onGoBack:()=>{o.navigate(-1)},onGoHome:()=>{o.navigate("/")}}})(i);function _(){const e=r();return t.jsx(a,{navigate:e})}export{_ as default};
1
+ import{j as t}from"./liveblocks-CS0rfBBF.js";import{h as r,n}from"./core-D6ttr5iw.js";import{N as i}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import"./sentry-CEfOando.js";import"./zeni-epic-state-Cl3jFj7z.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="0d8bbeee-ef94-478e-b36a-0f30a9be8cda",e._sentryDebugIdIdentifier="sentry-dbid-0d8bbeee-ef94-478e-b36a-0f30a9be8cda")}catch{}})();const a=n(null,function(e,o){return{onGoBack:()=>{o.navigate(-1)},onGoHome:()=>{o.navigate("/")}}})(i);function _(){const e=r();return t.jsx(a,{navigate:e})}export{_ as default};
@@ -1 +1 @@
1
- import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-CS0rfBBF.js";import lt from"./NotFoundScreen-BDl5tn8o.js";import{a as k}from"./sentry-CEfOando.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as O}from"./core-D6ttr5iw.js";import{cu as St,fH as q,eX as H,fV as bt,fO as b,SX as Z,fR as d,fG as y,sp as M,xV as It,SY as Ct,fF as Tt,fY as yt,su as _t,SZ as F,bo as $,fz as w,sy as Q,S_ as At,cG as Et,cz as Nt}from"./zeni-epic-state-Cl3jFj7z.js";import{Y as xt,z as Bt,Q as wt,d as Rt,$ as Gt,cW as Dt,s as N,a8 as vt,cX as Ut,a9 as Pt,r as Ft}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="00663832-b3e9-4b2a-be9f-86c6029c2dc3",t._sentryDebugIdIdentifier="sentry-dbid-00663832-b3e9-4b2a-be9f-86c6029c2dc3")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:x,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(Q("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(x(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Z(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Q("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(x(r),t(F([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,x).then(()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(vt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=xt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[x,R]=k.useState(!1),a=S(e=>q(e)),o=S(e=>H(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Gt({isDataReady:!0});const J=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),G=S(e=>b(e).currentSubTab),K=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),D=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Dt().allUsers,{inboxNotifications:B,isLoading:_,hasFetchedAll:C,isFetchingMore:v,fetchMore:ot}=ct(),{threads:z,isLoading:W,fetchMore:Y,isFetchingMore:L,hasFetchedAll:X}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(Z(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{K.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=_||v===!0||C!==!0||_||v===!0||C!==!0;k.useEffect(()=>{U&&D!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||D!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,D]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&x===!1&&(R(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&W===!1&&B!=null&&z!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const P=z.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(L||X===!0||Y==null||Y(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,v,L,C,X,W,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];G==="all"?A.push("read","unread"):G!=="mentions"&&A.push(G),s(M("task_manager",T,A,!0))}}}},nt=dt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:J,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(O,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(O,{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-CS0rfBBF.js";import lt from"./NotFoundScreen-DUKrEDOk.js";import{a as k}from"./sentry-CEfOando.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as O}from"./core-D6ttr5iw.js";import{cu as St,fH as q,eX as H,fV as bt,fO as b,SX as Z,fR as d,fG as y,sp as M,xV as It,SY as Ct,fF as Tt,fY as yt,su as _t,SZ as F,bo as $,fz as w,sy as Q,S_ as At,cG as Et,cz as Nt}from"./zeni-epic-state-Cl3jFj7z.js";import{Y as xt,z as Bt,Q as wt,d as Rt,$ as Gt,cW as Dt,s as N,a8 as vt,cX as Ut,a9 as Pt,r as Ft}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="00663832-b3e9-4b2a-be9f-86c6029c2dc3",t._sentryDebugIdIdentifier="sentry-dbid-00663832-b3e9-4b2a-be9f-86c6029c2dc3")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:x,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(Q("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(x(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Z(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Q("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(x(r),t(F([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,x).then(()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(vt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=xt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[x,R]=k.useState(!1),a=S(e=>q(e)),o=S(e=>H(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Gt({isDataReady:!0});const J=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),G=S(e=>b(e).currentSubTab),K=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),D=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Dt().allUsers,{inboxNotifications:B,isLoading:_,hasFetchedAll:C,isFetchingMore:v,fetchMore:ot}=ct(),{threads:z,isLoading:W,fetchMore:Y,isFetchingMore:L,hasFetchedAll:X}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(Z(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{K.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=_||v===!0||C!==!0||_||v===!0||C!==!0;k.useEffect(()=>{U&&D!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||D!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,D]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&x===!1&&(R(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&W===!1&&B!=null&&z!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const P=z.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(L||X===!0||Y==null||Y(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,v,L,C,X,W,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];G==="all"?A.push("read","unread"):G!=="mentions"&&A.push(G),s(M("task_manager",T,A,!0))}}}},nt=dt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:J,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(O,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(O,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-CS0rfBBF.js";import{a as r}from"./sentry-CEfOando.js";import{u as T,g as j,j as o,N as A}from"./core-D6ttr5iw.js";import{Mj as C,eX as P,fN as x,Mk as z,Ml as D,Mm as L,Mn as N,oa as R,Lg as k}from"./zeni-epic-state-Cl3jFj7z.js";import{z as h,H as I}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="6e11cd88-9e81-4872-9d88-d2356ab615cb",n._sentryDebugIdIdentifier="sentry-dbid-6e11cd88-9e81-4872-9d88-d2356ab615cb")}catch{}})();function ee(){const n=T(),s=j(),{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]),p=h.isSignedIn(),a=h.getSignedInUser(),m=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),c=o(L),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(N())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(R(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const M=r.useMemo(()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(U=>U.tenantId===e)?e:l.length===1?l[0].tenantId:null},[m?.tenantId,l]),u=v??M;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.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(k(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.")}}}):f.jsx(A,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
1
+ import{j as f}from"./liveblocks-CS0rfBBF.js";import{a as r}from"./sentry-CEfOando.js";import{u as T,g as j,j as o,N as A}from"./core-D6ttr5iw.js";import{Mj as C,eX as P,fN as x,Mk as z,Ml as D,Mm as L,Mn as N,oa as R,Lg as k}from"./zeni-epic-state-Cl3jFj7z.js";import{z as h,H as I}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="6e11cd88-9e81-4872-9d88-d2356ab615cb",n._sentryDebugIdIdentifier="sentry-dbid-6e11cd88-9e81-4872-9d88-d2356ab615cb")}catch{}})();function ee(){const n=T(),s=j(),{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]),p=h.isSignedIn(),a=h.getSignedInUser(),m=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),c=o(L),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(N())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(R(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const M=r.useMemo(()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(U=>U.tenantId===e)?e:l.length===1?l[0].tenantId:null},[m?.tenantId,l]),u=v??M;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.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(k(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.")}}}):f.jsx(A,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-CS0rfBBF.js";import{h as z,u as K,g as Q,i as J,j as d,n as X,o as Z,p as I}from"./core-D6ttr5iw.js";import{eX as O,sd as M,rN as H,MQ as U,rI as S,bs as ee,bn as ae,bY as te,rJ as se,MR as oe,MD as C,dK as re,vS as ne,MS as ce,wd as ie,fE as le,fC as de}from"./zeni-epic-state-Cl3jFj7z.js";import{z as me,Y as fe,$ as pe,I as ue,Q as v,d as $,K as he,e as w,ao as be,s as ge}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import Fe from"./NotFoundScreen-BDl5tn8o.js";import{F as Ie}from"./FeaturePreviewScreen-Y7t6ABdh.js";import{a as b}from"./sentry-CEfOando.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{u as Se}from"./useInitialThreadRequest-Bx57kb_d.js";import{t as Te}from"./routePaths-C1rKvS5o.js";import{M as ye}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="0e9cab2b-bcbe-432d-9abe-edf2c5cf9d52",s._sentryDebugIdIdentifier="sentry-dbid-0e9cab2b-bcbe-432d-9abe-edf2c5cf9d52")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=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(U(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 m=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(be);function P(){const s=z(),e=K(),a=Q(),{forecastId:o,tenantEmailDomain:r}=J(),[c,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),y=d(t=>O(t)),N=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>M(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:W}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!c&&g)p(!0),l||e(H());else if(l&&!m){u(!0);const t=((f,L,R)=>L!=null?f.forecasts.findIndex(F=>F.id===L):R!=null?f.forecasts.findIndex(F=>F.id===R):f.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(U(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,m,u,M,S,g]);const x=ue(),Y=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:_}=v(),{isFeatureEnabled:E}=_($.isReportsCommentingEnabled),q=Se(E?y?.companyId:void 0,{clearParams:l&&m}),[G,V]=b.useState(!1),j=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:G,handleDrawerToggle:j}),n.jsx(ke,{firstMonthOfFY:N,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:Y,isAiCfoAccessEnabled:B,onAskAiCfoClick:W,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:q,onClickMenuIcon:()=>{j(!0)}})]})}function Ve(){const s=d(c=>O(c)),{useFeatureGate:e}=v(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Z,{children:[n.jsx(I,{path:"/",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
1
+ import{j as n}from"./liveblocks-CS0rfBBF.js";import{h as z,u as K,g as Q,i as J,j as d,n as X,o as Z,p as I}from"./core-D6ttr5iw.js";import{eX as O,sd as M,rN as H,MQ as U,rI as S,bs as ee,bn as ae,bY as te,rJ as se,MR as oe,MD as C,dK as re,vS as ne,MS as ce,wd as ie,fE as le,fC as de}from"./zeni-epic-state-Cl3jFj7z.js";import{z as me,Y as fe,$ as pe,I as ue,Q as v,d as $,K as he,e as w,ao as be,s as ge}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import Fe from"./NotFoundScreen-DUKrEDOk.js";import{F as Ie}from"./FeaturePreviewScreen-heeivM6W.js";import{a as b}from"./sentry-CEfOando.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import{u as Se}from"./useInitialThreadRequest-CmTGqSIj.js";import{t as Te}from"./routePaths-DZDk8gbY.js";import{M as ye}from"./MobileAppDrawer-BI_hKtLW.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="0e9cab2b-bcbe-432d-9abe-edf2c5cf9d52",s._sentryDebugIdIdentifier="sentry-dbid-0e9cab2b-bcbe-432d-9abe-edf2c5cf9d52")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=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(U(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 m=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(be);function P(){const s=z(),e=K(),a=Q(),{forecastId:o,tenantEmailDomain:r}=J(),[c,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),y=d(t=>O(t)),N=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>M(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:W}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!c&&g)p(!0),l||e(H());else if(l&&!m){u(!0);const t=((f,L,R)=>L!=null?f.forecasts.findIndex(F=>F.id===L):R!=null?f.forecasts.findIndex(F=>F.id===R):f.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(U(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,m,u,M,S,g]);const x=ue(),Y=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:_}=v(),{isFeatureEnabled:E}=_($.isReportsCommentingEnabled),q=Se(E?y?.companyId:void 0,{clearParams:l&&m}),[G,V]=b.useState(!1),j=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:G,handleDrawerToggle:j}),n.jsx(ke,{firstMonthOfFY:N,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:Y,isAiCfoAccessEnabled:B,onAskAiCfoClick:W,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:q,onClickMenuIcon:()=>{j(!0)}})]})}function Ve(){const s=d(c=>O(c)),{useFeatureGate:e}=v(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Z,{children:[n.jsx(I,{path:"/",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-CS0rfBBF.js";import{MM as te,eX as Y,ky as z,fE as q,fC as ne,Ke as Q,Mq as oe,uP as Ee,MN as N,uE as ke,uZ as Ie,uT as ie,uI as re,uX as Pe,uU as je,MO as le,wE as Le,fo as Te,gf as ve,MP as M,uM as de,uL as ce,v0 as Fe,c6 as Ae}from"./zeni-epic-state-Cl3jFj7z.js";import{Z as pe,Q as J,d as E,z as G,i as ue,D as me,ak as ge,al as Oe,A as he,o as O,G as fe,a as Ce,am as Re,Y as Ve,$ as Ue,K as Ze,e as be,g as Be,s as $e,an as Me,I as Ke}from"./index-ilZtTEZn.js";import{D as ye,n as H,S as we}from"./mui-vLo47rlo.js";import ae from"./NotFoundScreen-BDl5tn8o.js";import{a as r}from"./sentry-CEfOando.js";import{u as ee,i as _e,j as m,h as ze,g as Ge,n as He,o as se,p as $}from"./core-D6ttr5iw.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{M as Xe}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="d618ae18-9dec-4b80-8081-905200718551",a._sentryDebugIdIdentifier="sentry-dbid-d618ae18-9dec-4b80-8081-905200718551")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},K=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=_e(),d=m(e=>te(e)),u=m(e=>Y(e)),D=m(e=>z(e)),{useFeatureGate:f}=J(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),T=ne(u),v=Q(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{R===!0?w(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{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:K.discardTitle}),descriptionComponent:s.jsx(De,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:i,isEditPopup:!0}):null,s.jsx(Oe,{...b})]})})},qe=H(we)`
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import{MM as te,eX as Y,ky as z,fE as q,fC as ne,Ke as Q,Mq as oe,uP as Ee,MN as N,uE as ke,uZ as Ie,uT as ie,uI as re,uX as Pe,uU as je,MO as le,wE as Le,fo as Te,gf as ve,MP as M,uM as de,uL as ce,v0 as Fe,c6 as Ae}from"./zeni-epic-state-Cl3jFj7z.js";import{Z as pe,Q as J,d as E,z as G,i as ue,D as me,ak as ge,al as Oe,A as he,o as O,G as fe,a as Ce,am as Re,Y as Ve,$ as Ue,K as Ze,e as be,g as Be,s as $e,an as Me,I as Ke}from"./index-BGtgXdBV.js";import{D as ye,n as H,S as we}from"./mui-vLo47rlo.js";import ae from"./NotFoundScreen-DUKrEDOk.js";import{a as r}from"./sentry-CEfOando.js";import{u as ee,i as _e,j as m,h as ze,g as Ge,n as He,o as se,p as $}from"./core-D6ttr5iw.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import{M as Xe}from"./MobileAppDrawer-BI_hKtLW.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="d618ae18-9dec-4b80-8081-905200718551",a._sentryDebugIdIdentifier="sentry-dbid-d618ae18-9dec-4b80-8081-905200718551")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},K=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=_e(),d=m(e=>te(e)),u=m(e=>Y(e)),D=m(e=>z(e)),{useFeatureGate:f}=J(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),T=ne(u),v=Q(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{R===!0?w(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{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:K.discardTitle}),descriptionComponent:s.jsx(De,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:i,isEditPopup:!0}):null,s.jsx(Oe,{...b})]})})},qe=H(we)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-CS0rfBBF.js";import E from"./NotFoundScreen-BDl5tn8o.js";import{a as r}from"./sentry-CEfOando.js";import{h as _,g as v,j as p,i as M,u as U,N as z,n as P,o as $,p as h}from"./core-D6ttr5iw.js";import{eX as B,S$ as b,bq as F,bn as N,ig as O,fz as V}from"./zeni-epic-state-Cl3jFj7z.js";import{S as q,z as I,$ as X,cY as Y}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{M as H}from"./MobileAppDrawer-Sx7ydj7A.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="fe2800c8-046d-4d7e-9bcb-fe976171a445",e._sentryDebugIdIdentifier="sentry-dbid-fe2800c8-046d-4d7e-9bcb-fe976171a445")}catch{}})();const J=P(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(Y),K=()=>{const e=_(),t=v(),c=q(),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),[S,w]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback((a,i,T)=>{u(O({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(V({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=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return X({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs($,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import E from"./NotFoundScreen-DUKrEDOk.js";import{a as r}from"./sentry-CEfOando.js";import{h as _,g as v,j as p,i as M,u as U,N as z,n as P,o as $,p as h}from"./core-D6ttr5iw.js";import{eX as B,S$ as b,bq as F,bn as N,ig as O,fz as V}from"./zeni-epic-state-Cl3jFj7z.js";import{S as q,z as I,$ as X,cY as Y}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import{M as H}from"./MobileAppDrawer-BI_hKtLW.js";import"./recharts-BDyAk4nR.js";import"./analytics-Ba6zmRos.js";import"./plaid-IKw4XOsd.js";import"./dnd-C751Xq24.js";import"./stripe-DMRn4zHo.js";import"./lottie-CZmubsAo.js";import"./lexical-T2nlwAPk.js";import"./pdf-CdoB_huE.js";import"./utils-DKj7mVPA.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]="fe2800c8-046d-4d7e-9bcb-fe976171a445",e._sentryDebugIdIdentifier="sentry-dbid-fe2800c8-046d-4d7e-9bcb-fe976171a445")}catch{}})();const J=P(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(Y),K=()=>{const e=_(),t=v(),c=q(),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),[S,w]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback((a,i,T)=>{u(O({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(V({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=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return X({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs($,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-CS0rfBBF.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-CEfOando.js";import{L as dt,bY as Tc,eX as Ac,LW as Rc,Mo as kl,c6 as Tl,g1 as Al,g2 as Rl}from"./zeni-epic-state-Cl3jFj7z.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-DKj7mVPA.js";import{r as un}from"./empty-B81gHGCB.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-RRzqb1kw.js";import{r as Gl}from"./index-pFVjg2n3.js";import{r as zl}from"./index-lXh6fiHl.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-D6ttr5iw.js";import{u as Kl,z as Pc,L as Wl,J as Jl,M as Xl,k as Ql,e as tf}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{d as Pe}from"./decodeURIComponentSafe-D0vQ4d1Q.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]="e1c5219e-5947-41e6-9e5b-95361986cb11",t._sentryDebugIdIdentifier="sentry-dbid-e1c5219e-5947-41e6-9e5b-95361986cb11")}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-CS0rfBBF.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-CEfOando.js";import{L as dt,bY as Tc,eX as Ac,LW as Rc,Mo as kl,c6 as Tl,g1 as Al,g2 as Rl}from"./zeni-epic-state-Cl3jFj7z.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-DKj7mVPA.js";import{r as un}from"./empty-B81gHGCB.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-RRzqb1kw.js";import{r as Gl}from"./index-pFVjg2n3.js";import{r as zl}from"./index-lXh6fiHl.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-D6ttr5iw.js";import{u as Kl,z as Pc,L as Wl,J as Jl,M as Xl,k as Ql,e as tf}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import{d as Pe}from"./decodeURIComponentSafe-D0vQ4d1Q.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]="e1c5219e-5947-41e6-9e5b-95361986cb11",t._sentryDebugIdIdentifier="sentry-dbid-e1c5219e-5947-41e6-9e5b-95361986cb11")}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-CS0rfBBF.js";import{a as o}from"./sentry-CEfOando.js";import{j as f,h as V,u as H,g as F,n as N}from"./core-D6ttr5iw.js";import{m as W,Z as _,z as P,bf as $,A as K,Y as M,$ as U,K as z,e as l,g as X,a8 as Y,bg as Z}from"./index-ilZtTEZn.js";import{fI as q,eX as G,Pm as R,Pn as J,vI as Q,vy as g,fK as ee,bS as ae,vD as re,Po as ne}from"./zeni-epic-state-Cl3jFj7z.js";import{D as te,e as se,n as oe,S as ie}from"./mui-vLo47rlo.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-33WX5dhg.js";import{M as ce}from"./MobileAppDrawer-Sx7ydj7A.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]="a02f8d6e-5e83-4f22-a0f0-5bc54c95432c",e._sentryDebugIdIdentifier="sentry-dbid-a02f8d6e-5e83-4f22-a0f0-5bc54c95432c")}catch{}})();const de={overlayWidth:new K(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=W(),n=_();if(P.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>q(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx($,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
1
+ import{j as s}from"./liveblocks-CS0rfBBF.js";import{a as o}from"./sentry-CEfOando.js";import{j as f,h as V,u as H,g as F,n as N}from"./core-D6ttr5iw.js";import{m as W,Z as _,z as P,bf as $,A as K,Y as M,$ as U,K as z,e as l,g as X,a8 as Y,bg as Z}from"./index-BGtgXdBV.js";import{fI as q,eX as G,Pm as R,Pn as J,vI as Q,vy as g,fK as ee,bS as ae,vD as re,Po as ne}from"./zeni-epic-state-Cl3jFj7z.js";import{D as te,e as se,n as oe,S as ie}from"./mui-vLo47rlo.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-re9SKSxV.js";import{M as ce}from"./MobileAppDrawer-BI_hKtLW.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]="a02f8d6e-5e83-4f22-a0f0-5bc54c95432c",e._sentryDebugIdIdentifier="sentry-dbid-a02f8d6e-5e83-4f22-a0f0-5bc54c95432c")}catch{}})();const de={overlayWidth:new K(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=W(),n=_();if(P.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>q(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx($,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as r}from"./liveblocks-CS0rfBBF.js";import _ from"./NotFoundScreen-BDl5tn8o.js";import{a as p}from"./sentry-CEfOando.js";import{h as E,g as x,u as C,j as u,N as D,n as k,o as O,p as b}from"./core-D6ttr5iw.js";import{eX as I,Qg as g,Qw as S,FD as V,EM as U,FC as d,Ft as $,QK as B,FF as W}from"./zeni-epic-state-Cl3jFj7z.js";import{z as N,a8 as L,b_ as Q,af as T,bD as K,b$ as z}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.js";import{u as M,R as A}from"./ReimbursementApprovalRuleDetailScreen-CPr7Je_Q.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="f2e90a39-cb30-4858-8382-0bbe66f676d6",e._sentryDebugIdIdentifier="sentry-dbid-f2e90a39-cb30-4858-8382-0bbe66f676d6")}catch{}})();const y="reimbursement-approval-rule-update",X=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}})(L(Q)),q=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a)),v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,F,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(X,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",G=k(function(e){const o=g(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(W(t,!0))}}})(L(z)),H=()=>{const e=u(n=>I(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=K(e?.tenantId);return o?r.jsx(J,{isLoading:s}):r.jsx(q,{isLoading:s})},J=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a));M();const v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,F,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(G,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(O,{children:[r.jsx(b,{path:"/",element:r.jsx(H,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
1
+ import{j as r}from"./liveblocks-CS0rfBBF.js";import _ from"./NotFoundScreen-DUKrEDOk.js";import{a as p}from"./sentry-CEfOando.js";import{h as E,g as x,u as C,j as u,N as D,n as k,o as O,p as b}from"./core-D6ttr5iw.js";import{eX as I,Qg as g,Qw as S,FD as V,EM as U,FC as d,Ft as $,QK as B,FF as W}from"./zeni-epic-state-Cl3jFj7z.js";import{z as N,a8 as L,b_ as Q,af as T,bD as K,b$ as z}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.js";import{u as M,R as A}from"./ReimbursementApprovalRuleDetailScreen-ClRq5kCS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="f2e90a39-cb30-4858-8382-0bbe66f676d6",e._sentryDebugIdIdentifier="sentry-dbid-f2e90a39-cb30-4858-8382-0bbe66f676d6")}catch{}})();const y="reimbursement-approval-rule-update",X=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}})(L(Q)),q=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a)),v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,F,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(X,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",G=k(function(e){const o=g(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(W(t,!0))}}})(L(z)),H=()=>{const e=u(n=>I(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=K(e?.tenantId);return o?r.jsx(J,{isLoading:s}):r.jsx(q,{isLoading:s})},J=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>g(a));M();const v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,F,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(G,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(O,{children:[r.jsx(b,{path:"/",element:r.jsx(H,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
@@ -1 +1 @@
1
- import{j as h}from"./liveblocks-CS0rfBBF.js";import{a as f}from"./sentry-CEfOando.js";import{u as T,j as y,h as _,g as O,i as k,n as F}from"./core-D6ttr5iw.js";import{k_ as L,Qw as E,Qg as x,Fw as V,FI as B,FD as A,FE as w,Qx as j,eX as z,FC as K}from"./zeni-epic-state-Cl3jFj7z.js";import{z as N,m as P,w as Q,bQ as W,af as $,bD as X,bR as G}from"./index-ilZtTEZn.js";import"./mui-vLo47rlo.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]="7769a24f-1b33-4b45-a314-f08c889a339a",e._sentryDebugIdIdentifier="sentry-dbid-7769a24f-1b33-4b45-a314-f08c889a339a")}catch{}})();function H(){const e=T(),s=f.useRef(!1),t=y(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=y(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))},[p,t,e])}const J=F(function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const b=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const g=(S=m.value,j(S)==null);var S;return{type:g?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!g}}),c=I.concat(R);b.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),b},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(W);function M(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>E(n)),i=y(n=>x(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=F(function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(g=>{const S=g.actorKind?.selectedOption,C=g.selectedRole?.selectedOption;let D=[];S==="role"&&C!=null?D=[{type:"attribute",subType:C,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const U=g.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,b=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=b?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:b?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(K(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(G);function ne(){const e=y(t=>z(t)),{isApprovalRulesV3Enabled:s}=X(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(M,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>E(n)),i=y(n=>x(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
1
+ import{j as h}from"./liveblocks-CS0rfBBF.js";import{a as f}from"./sentry-CEfOando.js";import{u as T,j as y,h as _,g as O,i as k,n as F}from"./core-D6ttr5iw.js";import{k_ as L,Qw as E,Qg as x,Fw as V,FI as B,FD as A,FE as w,Qx as j,eX as z,FC as K}from"./zeni-epic-state-Cl3jFj7z.js";import{z as N,m as P,w as Q,bQ as W,af as $,bD as X,bR as G}from"./index-BGtgXdBV.js";import"./mui-vLo47rlo.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]="7769a24f-1b33-4b45-a314-f08c889a339a",e._sentryDebugIdIdentifier="sentry-dbid-7769a24f-1b33-4b45-a314-f08c889a339a")}catch{}})();function H(){const e=T(),s=f.useRef(!1),t=y(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=y(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))},[p,t,e])}const J=F(function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const b=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const g=(S=m.value,j(S)==null);var S;return{type:g?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!g}}),c=I.concat(R);b.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),b},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(W);function M(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>E(n)),i=y(n=>x(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=F(function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(g=>{const S=g.actorKind?.selectedOption,C=g.selectedRole?.selectedOption;let D=[];S==="role"&&C!=null?D=[{type:"attribute",subType:C,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const U=g.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,b=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=b?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:b?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(K(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(G);function ne(){const e=y(t=>z(t)),{isApprovalRulesV3Enabled:s}=X(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(M,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>E(n)),i=y(n=>x(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};