@zeniai/web-app-ui 5.3.32-dev → 5.3.32-prod
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.
- package/dist/assets/AccountMappingScreen-BXftSVn-.js +9 -0
- package/dist/assets/AddressRoutes-Dx1aQN-n.js +1 -0
- package/dist/assets/{AddressScreen-LFBV9KsX.js → AddressScreen-TLZdvXNy.js} +2 -2
- package/dist/assets/{AiCfoScreen-N1tWqaxl.js → AiCfoScreen-DmLnUFml.js} +1 -1
- package/dist/assets/{AppDrawer-DmTC2F7R.js → AppDrawer-BnHpD6dG.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-sbvXc3_Z.js → BillPayApprovalRoutes-DPALyyf2.js} +1 -1
- package/dist/assets/{BillPayRoutes-Cf4T_cOn.js → BillPayRoutes-qAhjjusa.js} +18 -18
- package/dist/assets/BusinessVerificationPageScreen-BYV8fDWH.js +9 -0
- package/dist/assets/{CardsAiCfoScreen-p_ZDfSVk.js → CardsAiCfoScreen-Cd63K_-0.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-DWtJK7tn.js → ChargeCardRoutes-BH9evnp_.js} +7 -7
- package/dist/assets/{CompanyPassportScreen-Cr55ZhHa.js → CompanyPassportScreen-D0g6Nmxq.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-CpG3pE-i.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-CXLOaLgp.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-CI_z4poM.js +30 -0
- package/dist/assets/{DashboardRoutes-DmGJojZS.js → DashboardRoutes-C_4oAXQg.js} +3 -3
- package/dist/assets/{DefaultTenantHome-CWi1XNJj.js → DefaultTenantHome-D3eb-jo9.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-i7JC-m7w.js +18 -0
- package/dist/assets/{DrawerScreen-DVJ1nhu5.js → DrawerScreen-DUO1Z5ow.js} +1 -1
- package/dist/assets/EntityDetailRoutes-B2ai8pR3.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-OyBtxM5J.js → ExpenseAutomationRoutes-DQA6yQ4O.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-CjFoHQHk.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-qemWA0jI.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-DBc6Mphu.js → InboxNotificationsProvider-7eYmgI1F.js} +1 -1
- package/dist/assets/{InvoicingRoutes-B1FBFxmX.js → InvoicingRoutes-DOUUybBE.js} +2 -2
- package/dist/assets/{MagicLinkRoutes-70CKQAmw.js → MagicLinkRoutes-CTs6OYkH.js} +7 -7
- package/dist/assets/MagicLinkSignInScreen-CDEl_Ic_.js +12 -0
- package/dist/assets/MobileAppDrawer-BMvh-RAa.js +1 -0
- package/dist/assets/NotFoundScreen-Wkt8x0Ja.js +1 -0
- package/dist/assets/NotificationRoutes-BF1aTPUh.js +1 -0
- package/dist/assets/OAuthConsentScreen-8oM_ijmg.js +1 -0
- package/dist/assets/{PandLWithForecastRoutes-DHCQWgYM.js → PandLWithForecastRoutes-DvwOSp2G.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-nMdnk521.js → PaymentLinkScreen-D0VzMTpF.js} +4 -4
- package/dist/assets/PeopleRoutes-CMx_k0hr.js +22 -0
- package/dist/assets/PerformanceRoutes-OuxZJbf_.js +1 -0
- package/dist/assets/{Preview-C_55fm97.js → Preview-Dkzm36JB.js} +1 -1
- package/dist/assets/QBOConnectionScreen-Cxvr0UGn.js +100 -0
- package/dist/assets/ReimbursementApprovalRoutes-ChPdj5ky.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-kIivYyt0.js +1 -0
- package/dist/assets/ReimbursementRoutes-DlTMcw_k.js +68 -0
- package/dist/assets/{ReportsRoutes-BMuQOI7M.js → ReportsRoutes-DUvTlB32.js} +1 -1
- package/dist/assets/RewardsRoutes-CANJzBfw.js +1 -0
- package/dist/assets/ScreenRoutes-B2jpCRd2.js +2 -0
- package/dist/assets/{SettingsRoutes-6XcFcNwI.js → SettingsRoutes-D405mYiE.js} +7 -7
- package/dist/assets/{SetupPagesScreen-BxDIT7Xu.js → SetupPagesScreen-o-PhLBXH.js} +5 -5
- package/dist/assets/SignInScreen-CsdAWM0a.js +1 -0
- package/dist/assets/SignOutScreen-DjO_hTaY.js +9 -0
- package/dist/assets/TaskListScreen-D5rs0HLr.js +9 -0
- package/dist/assets/TaskRoutes-IWzYaX-F.js +9 -0
- package/dist/assets/TransactionDetailRoutes-DExFe-03.js +1 -0
- package/dist/assets/{TransactionDetailScreen-2kUyCbFm.js → TransactionDetailScreen-7v-3l9dA.js} +2 -2
- package/dist/assets/TransactionListRoutes-hxVuwPcb.js +1 -0
- package/dist/assets/TreasuryRoutes-C4GA1Tde.js +37 -0
- package/dist/assets/{VendorsRoutes-zeljYW53.js → VendorsRoutes-DLC5o9yJ.js} +20 -20
- package/dist/assets/WiseConfirmationScreen-BJNaaQrG.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-Dl9FUScI.js → ZeniAccountRoutes-CPdfqL23.js} +9 -9
- package/dist/assets/ZeniAccountStatementScreen-Butd8DWu.js +9 -0
- package/dist/assets/{accountMappingHelper-ZLBxLrOl.js → accountMappingHelper-DsN6SM7a.js} +1 -1
- package/dist/assets/{analytics-DHBkdK00.js → analytics-NBT5BH2R.js} +1 -1
- package/dist/assets/{analyticsHelper-C8sM1z8L.js → analyticsHelper-Bw6Cjeqd.js} +1 -1
- package/dist/assets/{core-DuNHGHBC.js → core-Dlma5MIa.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CcNRl55W.js → decodeURIComponentSafe-MgEJs-XP.js} +1 -1
- package/dist/assets/{dnd-DKR3QBLX.js → dnd-BgBEAfSC.js} +1 -1
- package/dist/assets/{empty-DRiI770H.js → empty-BRn9rxGR.js} +1 -1
- package/dist/assets/{empty-BA0WbUFe.js → empty-DpC6uPKD.js} +1 -1
- package/dist/assets/{emptyVideoElement-h3Sv0Oh_.js → emptyVideoElement-BpruyOrt.js} +1 -1
- package/dist/assets/epic-TdjWG3DC.js +2 -0
- package/dist/assets/{expenseAutomationHelper-DGi7tuOw.js → expenseAutomationHelper-BpaM_jjL.js} +1 -1
- package/dist/assets/{getLocaleForTenant-D1jcEP43.js → getLocaleForTenant-B0nO-Z7L.js} +1 -1
- package/dist/assets/{index-CxkwDRG8.js → index-Blw4A66-.js} +30310 -31275
- package/dist/assets/{index-y1KlwLzp.js → index-BtQ2P-s4.js} +1 -1
- package/dist/assets/{index-DgXVMYGv.js → index-CYHgs6V3.js} +1 -1
- package/dist/assets/{index-CFb8siio.js → index-CexFEAIL.js} +1 -1
- package/dist/assets/{index-DplrRYRh.js → index-Cr8P80rT.js} +1 -1
- package/dist/assets/{index-DRythsNE.js → index-DHUOQOTf.js} +1 -1
- package/dist/assets/{index-bPK7WXlx.js → index-YntXYqu4.js} +2 -2
- package/dist/assets/{index-B21g9_qj.js → index-ui_UfE_7.js} +1 -1
- package/dist/assets/{lexical-CcqvVKiN.js → lexical-Cc-23sPJ.js} +1 -1
- package/dist/assets/{liveblocks-BkTNzfNi.js → liveblocks-BD1fi6wA.js} +1 -1
- package/dist/assets/{lottie-DACJJNY9.js → lottie-Dd5kLrRz.js} +1 -1
- package/dist/assets/{mui-DaLeH41l.js → mui-DPmPgDDD.js} +1 -1
- package/dist/assets/{pathToGoBack-CmznLvKE.js → pathToGoBack-C5NlBrdk.js} +1 -1
- package/dist/assets/{pdf-BjtwR-dW.js → pdf-BCsxh4ki.js} +3 -3
- package/dist/assets/{pdf-lib-oygBYinp.js → pdf-lib-BSghpPvP.js} +1 -1
- package/dist/assets/{plaid-BVNoSR_u.js → plaid-w5kSeMkL.js} +1 -1
- package/dist/assets/{pusher-Db4sFIYV.js → pusher-D_NnYp1B.js} +1 -1
- package/dist/assets/{react-CYKQo_kF.js → react-BRcmo_so.js} +1 -1
- package/dist/assets/{react-1oTTb5wo.js → react-BYFmdCmG.js} +1 -1
- package/dist/assets/{react-CEkBTHgm.js → react-BiCIC8nJ.js} +1 -1
- package/dist/assets/{react-CMoOPPDa.js → react-CKnkKWiv.js} +1 -1
- package/dist/assets/{react-CNf8hG5M.js → react-Co4WxHXe.js} +1 -1
- package/dist/assets/{react-eY-XTCmQ.js → react-wEOgqpw3.js} +1 -1
- package/dist/assets/{recharts-CkuQpH_L.js → recharts-WuCIKI4c.js} +1 -1
- package/dist/assets/{routePaths-CKTfFzY9.js → routePaths-1GgW-roh.js} +1 -1
- package/dist/assets/{sentry-CNLjKkQW.js → sentry-C6D8WJ15.js} +1 -1
- package/dist/assets/{url-C3nvEZls.js → url-7hMA9KrE.js} +1 -1
- package/dist/assets/url-BVCS53n5.js +6 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BnMQqj78.js → useAiCfoDashboardSuggestedQuestionsChips-Cox0FTmj.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-5qRN6gKs.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-B74EcXIV.js → useChargeCardPusherEvents-Cu201ke6.js} +1 -1
- package/dist/assets/{useDeviceId-J3kskmrp.js → useDeviceId-p2IpPhWq.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-pFVkjSX_.js +1 -0
- package/dist/assets/{useInitialThreadRequest-DANB6KeB.js → useInitialThreadRequest-Ddm4sao-.js} +1 -1
- package/dist/assets/useTaskManagerAccess-BKVtGCGL.js +1 -0
- package/dist/assets/utils-Bv9LDtmr.js +36 -0
- package/dist/assets/{withTransactionSidePanel-CbsHNOl9.js → withTransactionSidePanel-QyMR1bIP.js} +2 -2
- package/dist/assets/{zeni-epic-state-IKQP0lNP.js → zeni-epic-state-2zvjmkUL.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AccountMappingScreen-Dst-9gUw.js +0 -9
- package/dist/assets/AddressRoutes-O-cTW9EV.js +0 -1
- package/dist/assets/BusinessVerificationPageScreen--LjYD0BK.js +0 -9
- package/dist/assets/ConnectionAuthScreen-D-vDZGov.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-Cs_F35vo.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-deFe2P-n.js +0 -30
- package/dist/assets/DomesticWireDetailScreen-D5RLzOT3.js +0 -18
- package/dist/assets/EntityDetailRoutes-DJgrP2Nz.js +0 -1
- package/dist/assets/FeaturePreviewScreen-BhrA_knX.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-Dm5LF-fb.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-CC7wdqci.js +0 -12
- package/dist/assets/MobileAppDrawer-BtnNKdri.js +0 -1
- package/dist/assets/NotFoundScreen-DjDyDYWZ.js +0 -1
- package/dist/assets/NotificationRoutes-Jy_Q0gUN.js +0 -1
- package/dist/assets/OAuthConsentScreen-DB2EvPsq.js +0 -1
- package/dist/assets/PeopleRoutes-rPdm-Ydn.js +0 -22
- package/dist/assets/PerformanceRoutes-CF0jBH_I.js +0 -1
- package/dist/assets/QBOConnectionScreen-Dlky0ESM.js +0 -100
- package/dist/assets/ReimbursementApprovalRoutes-Bf9cBzdf.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-XQSOHGYn.js +0 -1
- package/dist/assets/ReimbursementRoutes-CgvBDllF.js +0 -68
- package/dist/assets/RewardsRoutes-CF7hyIJJ.js +0 -1
- package/dist/assets/ScreenRoutes-vV1s5761.js +0 -2
- package/dist/assets/SignInScreen-UcqpfzAX.js +0 -1
- package/dist/assets/SignOutScreen-14vW04Vy.js +0 -9
- package/dist/assets/TaskListScreen-CwNgkHwd.js +0 -9
- package/dist/assets/TaskRoutes-uBt2S29g.js +0 -9
- package/dist/assets/TransactionDetailRoutes-Burs226A.js +0 -1
- package/dist/assets/TransactionListRoutes-Dm5jOGqp.js +0 -1
- package/dist/assets/TreasuryRoutes-C3nO4w9n.js +0 -37
- package/dist/assets/WiseConfirmationScreen-BBqG7Bw5.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BjcRzB88.js +0 -9
- package/dist/assets/epic-leJAVePQ.js +0 -2
- package/dist/assets/url-CaYHIgYK.js +0 -6
- package/dist/assets/useAskAiCfoHostNavButtonProps-D-XiURTy.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-F2D_LM69.js +0 -1
- package/dist/assets/useTaskManagerAccess-CgZlooKP.js +0 -1
- package/dist/assets/utils-BN2UhEgk.js +0 -36
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-BD1fi6wA.js";import _ from"./NotFoundScreen-Wkt8x0Ja.js";import{a as p}from"./sentry-C6D8WJ15.js";import{h as C,g as D,u as V,j as c,N as k,l as B,n as Y,o as b}from"./core-Dlma5MIa.js";import{fB as E,Y1 as h,Yi as w,MI as U,ME as L,MH as f,Mx as N,YH as M,MB as H,MK as K}from"./zeni-epic-state-2zvjmkUL.js";import{z as T,w as $,c7 as z,r as O,bQ as Q,c8 as q}from"./index-Blw4A66-.js";import"./mui-DPmPgDDD.js";import{u as F,R as x}from"./ReimbursementApprovalRuleDetailScreen-kIivYyt0.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]="a58a2c68-16d0-405c-8c6f-c15b83a73caa",e._sentryDebugIdIdentifier="sentry-dbid-a58a2c68-16d0-405c-8c6f-c15b83a73caa")}catch{}})();const j="reimbursement-approval-rule-update",G=B((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(M(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))($(z)),J=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=c((o=>o.remiSetupApproverViewState.fetchState)),u=c((o=>E(o))),d=c((o=>h(o))),g=c((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{g?.updateStatus.fetchState==="Completed"&&a(U())}),[g]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${j}`]:[],eventCallback:(o,y,I)=>{o.endsWith(j)&&I.onApprovalRulesEventReceived(o)}};return u?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(G,{currentTenant:u,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",P=B((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(M(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(K(t,!0))}}}))($(q)),X=()=>{const e=c((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=Q(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(J,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,u]=p.useState(!1),d=c((i=>i.remiSetupApproverViewState.fetchState)),g=c((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=c((i=>E(i))),o=c((i=>h(i)));F();const y=c((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||g!=="Not-Started"||e||(R(!0),a(H(!1,!0)))}),[v,g,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(u(!0),a(f())),s("./new"))}),[S,o,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function le(){return r.jsxs(Y,{children:[r.jsx(b,{path:"/",element:r.jsx(X,{})}),r.jsx(b,{path:"/new",element:r.jsx(x,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{le as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as h}from"./liveblocks-BD1fi6wA.js";import{a as f}from"./sentry-C6D8WJ15.js";import{u as U,j as g,h as C,g as O,i as V,l as k}from"./core-Dlma5MIa.js";import{m5 as L,Yi as w,Y1 as _,MA as B,MN as j,MI as A,MJ as E,Yj as N,fB as Y,MH as z}from"./zeni-epic-state-2zvjmkUL.js";import{z as F,E as P,a5 as M,b_ as H,r as $,bQ as J,b$ as K}from"./index-Blw4A66-.js";import"./mui-DPmPgDDD.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]="c51caff7-73d7-472a-a903-5fe0afa4d7e2",e._sentryDebugIdIdentifier="sentry-dbid-c51caff7-73d7-472a-a903-5fe0afa4d7e2")}catch{}})();function Q(){const e=U(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))}),[p,t,e])}const W=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return s.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const y=(I=m.value,N(I)==null);var I;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(b);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(H);function G(){const e=C(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>_(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(B(!0)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,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(M,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(W,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function pe(e){return N(e)==null}const X=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:i,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:_(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const I=y.actorKind?.selectedOption,q=y.selectedRole?.selectedNonUsers??[];let D=[];I==="role"?D=q.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):I==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const x=y.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=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 R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const b=S?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(K);function ne(){const e=g((t=>Y(t))),{isApprovalRulesV3Enabled:s}=J(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(G,{})}function Z(){const e=C(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>_(n))),[a,d]=f.useState(!1);if(Q(),f.useEffect((()=>{a||(d(!0),s(B(!1)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,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(M,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,pe as i,Q as u};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-BD1fi6wA.js";import{u as ae,j as A,h as J,g as K,i as ie,N as M,l as ee,q as ct,n as dt,o as w}from"./core-Dlma5MIa.js";import{fB as V,ME as ut,ZO as ge,c7 as he,LK as Ue,lQ as pt,LZ as ce,LY as de,ZP as bt,bn as fe,gS as _e,ZQ as gt,UM as ht,lF as Pe,UN as Ce,UO as ft,kr as St,XP as It,kG as yt,Ly as Rt,Bf as At,ky as vt,Mj as Me,ZR as $e,ZS as Ee,ZT as kt,ZU as Ct,ZV as Et,M3 as we,kM as wt,XY as xt,LX as Bt,LI as Tt,ZW as Dt,LH as jt,ZX as Ft,LP as xe,M7 as Lt,M6 as Ut,M2 as _t,ZY as Ne,Rh as Pt,bo as Mt,LS as $t,MB as Nt,ZZ as Zt,Z_ as Ot,Mf as zt,Mc as Be,Xj as Gt,LF as Vt,Z$ as Ze,N2 as Te,Na as Ht,_0 as Wt,_1 as Y,_2 as Xt,_3 as Oe,_4 as Yt,_5 as ze,_6 as Ge,Mr as ue,bu as qt,bK as Se,cL as Ie,dV as Ve,dU as He,_7 as Kt,gd as Qt,Xw as Jt,_8 as en,_9 as We,XA as tn,Yi as nn,_a as an,YH as sn,N7 as De,N6 as on,_b as rn,_c as ln,_d as mn,_e as cn,_f as dn,Y2 as un,MZ as pn,N1 as bn,bq as gn,bJ as hn,cF as fn,ct as Sn,bt as In,Tc as yn,d6 as Rn,d9 as An,d8 as vn,cE as kn}from"./zeni-epic-state-2zvjmkUL.js";import{bQ as Cn,c as Xe,$ as Ye,I as oe,d as x,z as _,cP as qe,a6 as re,l as C,aW as je,K as F,ac as se,ad as En,G as Ke,cQ as wn,p as q,aq as Qe,cR as xn,U as le,cS as Bn,ao as Tn,a9 as Dn,a5 as ye,S as Je,w as jn,by as Fn,at as Ln,ag as Un,E as et,cT as _n,j as Pn}from"./index-Blw4A66-.js";import{n as $,S as Mn}from"./mui-DPmPgDDD.js";import pe from"./NotFoundScreen-Wkt8x0Ja.js";import{S as Fe}from"./SetupPagesScreen-o-PhLBXH.js";import{F as tt}from"./FeaturePreviewScreen-CjFoHQHk.js";import{a as h}from"./sentry-C6D8WJ15.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-5qRN6gKs.js";import{u as nt}from"./useInitialThreadRequest-Ddm4sao-.js";import{D as $n}from"./DrawerScreen-DUO1Z5ow.js";import{M as at}from"./MobileAppDrawer-BMvh-RAa.js";import{F as Nn}from"./ScreenRoutes-B2jpCRd2.js";import{R as Zn}from"./ReimbursementApprovalRoutes-ChPdj5ky.js";import"./recharts-WuCIKI4c.js";import"./analytics-NBT5BH2R.js";import"./plaid-w5kSeMkL.js";import"./dnd-BgBEAfSC.js";import"./stripe-cKAAJElX.js";import"./lottie-Dd5kLrRz.js";import"./lexical-Cc-23sPJ.js";import"./pdf-BCsxh4ki.js";import"./utils-Bv9LDtmr.js";import"./BusinessVerificationPageScreen-BYV8fDWH.js";import"./routePaths-1GgW-roh.js";import"./analyticsHelper-Bw6Cjeqd.js";import"./InboxNotificationsProvider-7eYmgI1F.js";import"./useTaskManagerAccess-BKVtGCGL.js";import"./getLocaleForTenant-B0nO-Z7L.js";import"./ReimbursementApprovalRuleDetailScreen-kIivYyt0.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]="2820b55f-8746-41c2-a35a-78eb7e0d82cb",e._sentryDebugIdIdentifier="sentry-dbid-2820b55f-8746-41c2-a35a-78eb7e0d82cb")}catch{}})();const st=e=>`/${e}/reimbursements`,On=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:X,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Ke.getLocalizedStrings(),zn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=_.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=_e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=_.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(_t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ut())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(Ee({}));const i=st(o),l=q(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Me(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(At("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Le(){const e=J(),t=ae(),n=K(),{reimbursementId:r}=ie(),c=Xe(),d=Ye(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=K().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[v,k]=h.useState(!1),E=_.getSignedInUser(),I=A((p=>V(p))),g=A((p=>ge(p,r))),L=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=he(I?.userRole??[]);(function(){const p=ae(),N=A((Q=>V(Q))),Z=N?.tenantId,{isApprovalRulesV3Enabled:O,isLoading:H}=Cn(Z),W=A((Q=>Q.remiSetupApproverViewState.fetchState));h.useEffect((()=>{Z==null||H||W==="Not-Started"&&p(ut(!0,!1,!1,O))}),[Z,H,O,W,p])})(),h.useEffect((()=>{(j&&!v||D&&!v&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t(Ue(!1,b,y,r)))}));const P=A((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(Gn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Hn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:X.upload,single:ne.dropReceipt.single,or:X.texts.or,multiple:ne.dropReceipt.multiple,receipts:X.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Wn,{children:[s.jsx(Xn,{onClick:()=>o(!1),children:s.jsx(On,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:X.upload,single:ne.dropReceipt.single,or:X.texts.or,multiple:ne.dropReceipt.multiple,receipts:X.texts.receipts2}})]}):null,s.jsx(Yn,{windowSize:d,children:s.jsx(zn,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:P,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const Gn=$.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
position: relative;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
6
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
7
|
+
`,Vn=$.div`
|
|
8
|
+
position: fixed;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
background-color: ${En.overlayBackgroundBlack};
|
|
14
|
+
z-index: 5;
|
|
15
|
+
`,Hn=$.div`
|
|
16
|
+
position: absolute;
|
|
17
|
+
top: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
width: 42%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
z-index: 6;
|
|
22
|
+
display: flex;
|
|
23
|
+
background-color: transparent;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
`,Wn=$.div`
|
|
26
|
+
position: fixed;
|
|
27
|
+
top: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
right: 0;
|
|
30
|
+
bottom: 0;
|
|
31
|
+
z-index: 11;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
overflow-y: auto;
|
|
35
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
+
`,Xn=$.button`
|
|
37
|
+
align-self: flex-end;
|
|
38
|
+
background: none;
|
|
39
|
+
border: none;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
padding: ${F.sp2} ${F.sp3};
|
|
42
|
+
line-height: 1;
|
|
43
|
+
color: ${e=>e.theme.colors.hero};
|
|
44
|
+
&:hover {
|
|
45
|
+
color: ${e=>e.theme.colors.primary};
|
|
46
|
+
}
|
|
47
|
+
svg {
|
|
48
|
+
width: ${F.sp4};
|
|
49
|
+
height: ${F.sp4};
|
|
50
|
+
}
|
|
51
|
+
`,Yn=$.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
width: 100%;
|
|
55
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
+
`,qn=ee((function(e,t){const n=Ne(e,t.reimbursementId),r=_.getSignedInUser(),c=fe(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Zt(n.remiActivities,Ot(t.currentTenant),r));const i=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e($e());const a=st(o),i=q(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Vt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Gt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Be(n,a.type,"")):e(Be(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=q(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(Me(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function Kn(){const e=J(),t=ae(),n=K(),r=n.hash.substring(1),c=Xe(),{reimbursementId:d}=ie(),m=_.getSignedInUser(),o=A((R=>V(R))),a=A((R=>Ne(R,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=nt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"});Qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:f}=oe(),{isFeatureEnabled:B}=f(x.isLimitedCategoryForReimbursement),[u,T]=h.useState(!1),[D,j]=h.useState(!1),[v,k]=h.useState(!1),{isFeatureEnabled:E}=f(x.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=f(x.isShowDeletedReimbursementsFeatureEnabled),g=A((R=>ge(R,d??""))),L=Pt(o),U=Mt(o.userRole),P=a.fetchState;if(h.useEffect((()=>{u||d==null?u==1&&P==="Error"&&e("page-not-found",{replace:!0}):(T(!0),t($t(d,!1,I)))}),[u,d,t,P]),h.useEffect((()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?k(!1):k(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find((R=>R.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,L,m]),h.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(j(!0),t(Ue(!1,B,I,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(M,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:R=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(R)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:E,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:v,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Qn=ee((function(e,t){return{remisReviewView:Ze(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(Y())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Ht());break;case"approve":e(Te("approved",r??""));break;case"reject":e(Te("rejected",r??""))}}}}))(Bn);function Jn({tenantEmailDomain:e}){const t=J(),n=A((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=A((m=>Ze(m))),c=le(),d=c?.loggedInUserRole?.includes("admin")===!0;return h.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Qn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const G=tn(),it="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:ea,common:me}=Ke.getLocalizedStrings(),ta=ea.reimbursement.bulkActions,na=$.div`
|
|
57
|
+
display: flex;
|
|
58
|
+
min-height: 100%;
|
|
59
|
+
width: 100%;
|
|
60
|
+
flex: 1 1 auto;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
align-items: center;
|
|
63
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
+
`,aa=ee((function(e,t){const n=Ge(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const c=_.getSignedInUser(),d=fe(c),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((f=>f!=="deleted")));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((f=>f.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:G,spendManagementEndPoint:`${Ln}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(Y()),e(Oe(o))},onSubtabChange:o=>{e(Y()),e(ze(o))},onTransactionClick:(o,a)=>{const i=oa(m,o,a),l=q(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=ia(m),a=q(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=q(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(ue(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(Y())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(De("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(De("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(be)&&e(sn(!1))},onEventReceived:o=>{o===it&&e(an())}}}))(jn(Fn));function sa(){const e=J(),t=ae(),n=K(),r=n.state,c=Ye(),[d,m]=h.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;h.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Xt(r.tab.toString());S!=null?t(Oe(S)):console.log("Warning:Not a valid remiListTab");const z=Yt(r.subTab.toString());z!=null?t(ze(z)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(Y())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:i}=a(x.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(x.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(x.isReimbursementCommentingEnabled),{isFeatureEnabled:f}=a(x.isReimbursementBulkActionEnabled),B=_.getSignedInUser(),u=A((S=>V(S))),[T,D]=h.useState(!1),[j,v]=h.useState(!1),k=le(),E=k?.loggedInUserRole?.includes("admin")===!0,I=A((S=>Ge(S,G,f))),{areTenantIdsInSync:g}=Tn(),L=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:P}=Re({mobileExploreReferrer:"Reimbursement List"});if(Qe({isDataReady:L==="Completed"}),h.useEffect((()=>{!j&&g&&(v(!0),t(ue(G,!0,l,!1,!0)))}),[j,G,t,g]),B==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&qt(u),p=Se(k?.loggedInUserRoleMap),N=Ie(k?.loggedInUserRoleMap),Z=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,O=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,H=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,W=A((S=>_e(S.companyState,u.companyId))),Q=W?.company.featuresActivationInfo.connectedAccountProvider,Ae=S=>{D(S)},{isFeatureEnabled:ot}=a(x.isDebitCardFeatureEnabled),rt=Ve(ot,u),lt=He(u),{remisProcessed:te,remisProcessing:ve}=A((S=>Kt(S)));h.useEffect((()=>{te===ve&&d!=null&&(t(Qt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:ta.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Jt(d)}]})),t(en()),setTimeout((()=>{t(ue(G,!0,l,!1,!0,!0))}),3e3),m(null))}),[te,ve]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${it}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(S,z,ke)=>{S.endsWith(be)?ke.onReimbursementApprovalRulesEventReceived?.(S):z.entity_type==="reimbursement"&&(m(z.operation_type),ke.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(tt,{}):O&&(!R||p)||N&&Z?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(re,{analytics:C,onLoad:S=>(z=>z.trackPageLoaded(Je.Event.reimbursementHome))(S)}):null,s.jsx(at,{isAppContentDrawerOpen:T,handleDrawerToggle:Ae}),s.jsxs(na,{windowSize:c,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Dn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(Y())},children:s.jsx(ra,{onClick:S=>S.stopPropagation(),children:s.jsx(Jn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(aa,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:G,isAdmin:E,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{Ae(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:Q,isBulkActionEnabled:f,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:P,...mt})]})]}):H&&p?s.jsx(M,{to:"../setup"}):k!=null&&We(u,k.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const ia=e=>`/${e}/reimbursements/setup`,oa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ra=$(Mn)`
|
|
65
|
+
display: flex;
|
|
66
|
+
min-height: 100%;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
`,la=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:C,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(_n),ma=()=>{const e=Un(),t=J(),n=K(),{tenantEmailDomain:r}=ie(),c=et(),[d,m]=h.useState(!1),o=A((v=>V(v))),a=_.getSignedInUserTenant(r)?.companyId??o.companyId,i=_.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=le(),f=Se(y?.loggedInUserRoleMap),B=Ie(y?.loggedInUserRoleMap),u=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,T=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=v=>{m(v)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return T&&B&&u?s.jsx(M,{to:"../../../reimbursements"}):D&&f?s.jsx(M,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!D||o.userReimbursementInfo&&B&&u===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:v=>(k=>k.trackPageLoaded(Je.Event.reimbursementPromoPage))(v)}),s.jsx(at,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(la,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Za(){const e=A((W=>V(W))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=et(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=oe(),{isFeatureEnabled:o}=m(x.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(x.isDebitCardFeatureEnabled),i=Ve(a,e),l=He(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),f=fn(t?.loggedInUserRoleMap),B=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=Se(t?.loggedInUserRoleMap),T=B&&u,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,j=D&&Sn(t?.loggedInUserRoleMap),v=Pn(e,o,a)&&!b,k=v&&In(t?.loggedInUserRoleMap),E=yn(t?.loggedInUserRoleMap),I=Rn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),L=D&&I,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,P=vn(t?.loggedInUserRoleMap),R=kn(t?.loggedInUserRoleMap),p=Ie(t?.loggedInUserRoleMap),N=v&&P,{tenantEmailDomain:Z}=ie(),O=K(),H=n===!0&&(u||p&&d);return s.jsxs(dt,{children:[O.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"verification",element:s.jsx(Fe,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"verification"})}),s.jsx(w,{path:"setup",element:s.jsx(Fe,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"setup"})}),s.jsx(w,{path:"promo",element:s.jsx(ma,{})}),s.jsx(w,{path:"approval-rules/*",element:T?s.jsx(Zn,{}):s.jsx(Nn,{showZeniAccountRoute:L,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:U,isTenantBankingOnly:i,showChargeCardRoute:N,tenantEmailDomain:Z??""})}),H&&s.jsx(w,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(w,{path:"/*",element:s.jsx(tt,{})}),t!=null&&We(e,t?.loggedInUserRoleMap)&&s.jsx(w,{path:"*",element:s.jsx(M,{to:"../promo"})}),c&&u&&s.jsx(w,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):O.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"new",element:s.jsx(Le,{})}),s.jsx(w,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(w,{path:":reimbursementId/edit",element:s.jsx(Le,{})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(w,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${F.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]})}export{Za as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-BkTNzfNi.js";import{g as W,h as De,u as Oe,i as Fe,j as d,l as Ae,n as Pe,o as ee}from"./core-DuNHGHBC.js";import{fB as $,Dr as R,TZ as Ee,lX as le,tx as ce,um as F,lC as Le,lL as A,lD as P,kG as E,kx as L,kw as Me,CB as ie,ur as Be,bq as ve,T_ as Ve,bn as xe,DO as ze,T$ as Ge,U0 as He,ch as S,Cu as Ye,U1 as ae,U2 as Ne,U3 as qe,U4 as $e,U5 as Ze,U6 as Qe,U7 as Xe,U8 as Je,U9 as Ke,Ua as We,Ub as ea,Uc as aa,Ud as sa,Ue as k,Uf as M,Ug as B,Uh as v,Ui as V,Uj as x,Uk as z,Ul as G,Um as H,Un as Y,e8 as ta,Ds as oa,Df as se,Dg as te,Dy as na,Dk as oe,DE as ra,Uo as la,Up as ca,Uq as ia,Ur as da,Us as pa,Ut as _a,Uu as fa,Uv as ma,Uw as ua,Ux as ba,dV as ha,dU as ya}from"./zeni-epic-state-IKQP0lNP.js";import{al as Ca,am as wa,an as ga,a as Sa,$ as Ia,O as de,y as N,z as pe,ao as Ra,V as Ta,d as ka,ap as ja,aq as Ua,a6 as Da,h as q,N as Oa,s as Fa,p as _e,ar as Aa,as as Pa,at as Ea}from"./index-CxkwDRG8.js";import"./mui-DaLeH41l.js";import La from"./NotFoundScreen-DjDyDYWZ.js";import{F as Ma}from"./FeaturePreviewScreen-BhrA_knX.js";import{a as u}from"./sentry-CNLjKkQW.js";import{u as Ba}from"./useInitialThreadRequest-DANB6KeB.js";import{t as ne,a as re,b as va}from"./routePaths-CKTfFzY9.js";import{M as Va}from"./MobileAppDrawer-BtnNKdri.js";import"./recharts-CkuQpH_L.js";import"./analytics-DHBkdK00.js";import"./plaid-BVNoSR_u.js";import"./dnd-DKR3QBLX.js";import"./stripe-cKAAJElX.js";import"./lottie-DACJJNY9.js";import"./lexical-CcqvVKiN.js";import"./pdf-BjtwR-dW.js";import"./utils-BN2UhEgk.js";import"./InboxNotificationsProvider-DBc6Mphu.js";import"./useTaskManagerAccess-CgZlooKP.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]="4b9f0dd5-2d90-47f8-a430-da6403553b3c",e._sentryDebugIdIdentifier="sentry-dbid-4b9f0dd5-2d90-47f8-a430-da6403553b3c")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(V({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua()),e(ba())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=$(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=Ve(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:q,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(I(a)||S(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?va(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(V({scrollPosition:s}));break;case"cash_flow_by_classes":e(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(V({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=S(t);l?(e(Je({viewMode:a})),e(Ke({viewMode:a}))):r?(e(We({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(k(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(k(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e(Ze({classesToFilterOut:a})):I(o.selectedReportID)?e(Qe({classesToFilterOut:a})):e(Xe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):I(o.selectedReportID)?e(qe({projectsToFilterOut:a})):e($e({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():Ye()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(He(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Aa);function Ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=Ia(),m=Pa(_),a=De(),s=Oe(),t=W(),{tenantEmailDomain:r}=Fe(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,C]=u.useState(!1),[Z,fe]=u.useState(!1),{isFeatureEnabled:Q}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const U=d((n=>$(n))),me=U.masterTOSInfo?.isMasterTOSAccepted??!1,ue=U.company?.companyInfo.firstMonthOfFY??1,be=Ba(Q?U?.companyId:void 0),w=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:b}=Ra(),D=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),g=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),Ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(C(!0),s(F(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!Z&&w==="Completed"&&b&&(s(F(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,w,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(D){case"profit_and_loss":case"profit_and_loss_by_classes":s(Be(h.timeframe));break;case"profit_and_loss_by_projects":g&&s(ie());break;case"balance_sheet":s(Me(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());break;case"balance_sheet_by_projects":g&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":g&&s(A());break;case"cash_flow":s(Le(h.timeframe))}}),[c,D,O,b,T,g]);const X=Ta(),we=X?.loggedInUserRole!=null&&ve(X?.loggedInUserRole)!==!0,[ge,Se]=u.useState(!1),J=n=>{Se(n)},Ie=ka(),Re=ja();return(function(n){const{isDataReady:Te}=n,{pathname:ke}=W(),K=Ca(ke??"")==="reports",je=wa(Te),Ue=u.useMemo((()=>K?xa:void 0),[K]);ga({canFetchSuggestedQuestions:je,pageContexts:Ue})})({isDataReady:w==="Completed"}),Ua({isDataReady:w==="Completed"}),p.jsxs(p.Fragment,{children:[w==="Completed"?p.jsx(Da,{analytics:q,onLoad:n=>n.trackPageLoaded(Oa.Event.reports)}):null,p.jsx(Va,{isAppContentDrawerOpen:ge,handleDrawerToggle:J}),p.jsx(Ga,{firstMonthOfFY:ue,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:Ce,selectedReportID:D,analytics:q,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:ye,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:J,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Fa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:Q,initialOpenThreadRequest:be})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>$(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(Ma,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ha,{})}),p.jsx(ee,{path:"*",element:p.jsx(La,{})})]})}export{_s as default};
|
|
1
|
+
import{j as p}from"./liveblocks-BD1fi6wA.js";import{g as X,h as De,u as Oe,i as Ae,j as d,l as Pe,n as Ue,o as ee}from"./core-Dlma5MIa.js";import{fB as q,Db as I,TJ as Ee,lF as le,tg as ce,u5 as A,lk as Le,lt as P,ll as U,ko as E,kf as L,ke as Me,Cl as ie,ua as Be,bq as Ve,TK as ve,bn as xe,Dy as ze,TL as Ge,TM as Ye,ch as g,Ce as He,TN as ae,TO as Ne,TP as $e,TQ as qe,TR as Ze,TS as Qe,TT as Je,TU as Ke,TV as We,TW as Xe,TX as ea,TY as aa,TZ as sa,T_ as k,T$ as M,U0 as B,U1 as V,U2 as v,U3 as x,U4 as z,U5 as G,U6 as Y,U7 as H,e8 as ta,Dc as oa,C$ as se,D0 as te,Di as na,D4 as oe,Do as ra,U8 as la,U9 as ca,Ua as ia,Ub as da,Uc as pa,Ud as _a,Ue as fa,Uf as ma,Ug as ba,Uh as ua,dV as ha,dU as ya}from"./zeni-epic-state-2zvjmkUL.js";import{al as Ca,am as wa,an as Ta,a as ga,$ as Sa,I as de,d as N,z as pe,ao as Ia,U as Ra,f as ka,ap as ja,aq as Fa,a6 as Da,l as $,S as Oa,A as Aa,p as _e,ar as Pa,as as Ua,at as Ea}from"./index-Blw4A66-.js";import"./mui-DPmPgDDD.js";import La from"./NotFoundScreen-Wkt8x0Ja.js";import{F as Ma}from"./FeaturePreviewScreen-CjFoHQHk.js";import{a as b}from"./sentry-C6D8WJ15.js";import{u as Ba}from"./useInitialThreadRequest-Ddm4sao-.js";import{t as ne,a as re,b as Va}from"./routePaths-1GgW-roh.js";import{M as va}from"./MobileAppDrawer-BMvh-RAa.js";import"./recharts-WuCIKI4c.js";import"./analytics-NBT5BH2R.js";import"./plaid-w5kSeMkL.js";import"./dnd-BgBEAfSC.js";import"./stripe-cKAAJElX.js";import"./lottie-Dd5kLrRz.js";import"./lexical-Cc-23sPJ.js";import"./pdf-BCsxh4ki.js";import"./utils-Bv9LDtmr.js";import"./InboxNotificationsProvider-7eYmgI1F.js";import"./useTaskManagerAccess-BKVtGCGL.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]="0027bf13-80e4-4c1b-899b-6a8b832a2e64",e._sentryDebugIdIdentifier="sentry-dbid-0027bf13-80e4-4c1b-899b-6a8b832a2e64")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],S=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(H({resetLeftScroll:!0})),e(Y({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(V({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ba()),e(ua())},Ga=Pe((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=I(e),r=ve(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:$,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(S(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Va(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(H({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(V({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(V({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=S(t),l=g(t);l?(e(Ke({viewMode:a})),e(We({viewMode:a}))):r?(e(Xe({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(k(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(k(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(Ze({classesToFilterOut:a})):S(o.selectedReportID)?e(Qe({classesToFilterOut:a})):e(Je({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):S(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=S(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?U():a?L():He()),o.isAccountingProjectsEnabled&&e(s?P():a?E():ie())},onUpdateDisplayOrder:a=>{e(Ye(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):P(!0):U(!0):E(!0):L(!0))}}}))(Pa);function Ya(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ga(),_=Sa(),m=Ua(_),a=De(),s=Oe(),t=X(),{tenantEmailDomain:r}=Ae(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,C]=b.useState(!1),[Z,fe]=b.useState(!1),{isFeatureEnabled:Q}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const F=d((n=>q(n))),me=F.masterTOSInfo?.isMasterTOSAccepted??!1,be=F.company?.companyInfo.firstMonthOfFY??1,ue=Ba(Q?F?.companyId:void 0),w=d((n=>I(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:u}=Ia(),D=d((n=>n.financeStatementState.selectedReportId)),R=d((n=>le(n))),T=d((n=>ce(n))),ye=d((n=>I(n).isCompareModeOn)),h=d((n=>I(n).filter)),O=d((n=>I(n).selectedReportAndTimeframeFetchState)),Ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));b.useEffect((()=>{!c&&u&&(C(!0),s(A(i.userId,!0,!0,!1)))}),[c,i,s,u]),b.useEffect((()=>{c&&!Z&&w==="Completed"&&u&&(s(A(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,w,u]),b.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&u)switch(D){case"profit_and_loss":case"profit_and_loss_by_classes":s(Be(h.timeframe));break;case"profit_and_loss_by_projects":T&&s(ie());break;case"balance_sheet":s(Me(h.timeframe));break;case"balance_sheet_by_classes":R&&s(L());break;case"balance_sheet_by_projects":T&&s(E());break;case"cash_flow_by_classes":R&&s(U());break;case"cash_flow_by_projects":T&&s(P());break;case"cash_flow":s(Le(h.timeframe))}}),[c,D,O,u,R,T]);const J=Ra(),we=J?.loggedInUserRole!=null&&Ve(J?.loggedInUserRole)!==!0,[Te,ge]=b.useState(!1),K=n=>{ge(n)},Se=ka(),Ie=ja();return(function(n){const{isDataReady:Re}=n,{pathname:ke}=X(),W=Ca(ke??"")==="reports",je=wa(Re),Fe=b.useMemo((()=>W?xa:void 0),[W]);Ta({canFetchSuggestedQuestions:je,pageContexts:Fe})})({isDataReady:w==="Completed"}),Fa({isDataReady:w==="Completed"}),p.jsxs(p.Fragment,{children:[w==="Completed"?p.jsx(Da,{analytics:$,onLoad:n=>n.trackPageLoaded(Oa.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Te,handleDrawerToggle:K}),p.jsx(Ga,{firstMonthOfFY:be,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:Ce,selectedReportID:D,analytics:$,filter:h,isAccountingClassesEnabled:R,isAccountingProjectsEnabled:T,isCompareModeOn:ye,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:K,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Ie&&Se&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Aa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:Q,initialOpenThreadRequest:ue})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(Ma,{}):p.jsxs(Ue,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ya,{})}),p.jsx(ee,{path:"*",element:p.jsx(La,{})})]})}export{_s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-BD1fi6wA.js";import{z as b,a6 as C,l as u,S as N,d_ as E,I,d as k}from"./index-Blw4A66-.js";import"./mui-DPmPgDDD.js";import g from"./NotFoundScreen-Wkt8x0Ja.js";import{a as c}from"./sentry-C6D8WJ15.js";import{u as D,j as h,h as F,g as L,l as _,n as P,o as d,N as y}from"./core-Dlma5MIa.js";import{fB as T,a0P as j,a0Q as p,CS as U,pF as V,a0R as Q,CQ as R}from"./zeni-epic-state-2zvjmkUL.js";import"./recharts-WuCIKI4c.js";import"./analytics-NBT5BH2R.js";import"./plaid-w5kSeMkL.js";import"./dnd-BgBEAfSC.js";import"./stripe-cKAAJElX.js";import"./lottie-Dd5kLrRz.js";import"./lexical-Cc-23sPJ.js";import"./pdf-BCsxh4ki.js";import"./utils-Bv9LDtmr.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]="3ee50173-0a16-4d96-8bab-221b70f08569",e._sentryDebugIdIdentifier="sentry-dbid-3ee50173-0a16-4d96-8bab-221b70f08569")}catch{}})();const z=_((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(R())},onUpdateInviteFormLocalData:s=>{e(Q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(E),B=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>T(o))),l=F(),w=L(),f=b.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),x=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(U()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(C,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(N.Event.inviteEmailViewed))(o)}):null,a.jsx(z,{navigate:l,location:w,currentTenant:r,companyName:S,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(k.isReferralFeatureEnabled);return a.jsxs(P,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-Wkt8x0Ja.js","assets/sentry-C6D8WJ15.js","assets/core-Dlma5MIa.js","assets/zeni-epic-state-2zvjmkUL.js","assets/index-Blw4A66-.js","assets/mui-DPmPgDDD.js","assets/analytics-NBT5BH2R.js","assets/utils-Bv9LDtmr.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-C_4oAXQg.js","assets/withTransactionSidePanel-QyMR1bIP.js","assets/useAskAiCfoHostNavButtonProps-5qRN6gKs.js","assets/TransactionDetailScreen-7v-3l9dA.js","assets/decodeURIComponentSafe-MgEJs-XP.js","assets/useInitialThreadRequest-Ddm4sao-.js","assets/routePaths-1GgW-roh.js","assets/expenseAutomationHelper-BpaM_jjL.js","assets/analyticsHelper-Bw6Cjeqd.js","assets/CompanyPassportScreen-D0g6Nmxq.js","assets/MobileAppDrawer-BMvh-RAa.js","assets/InboxNotificationsProvider-7eYmgI1F.js","assets/useTaskManagerAccess-BKVtGCGL.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Cox0FTmj.js","assets/FeaturePreviewScreen-CjFoHQHk.js","assets/BillPayRoutes-qAhjjusa.js","assets/AddressScreen-TLZdvXNy.js","assets/DomesticWireDetailScreen-i7JC-m7w.js","assets/BusinessVerificationPageScreen-BYV8fDWH.js","assets/DrawerScreen-DUO1Z5ow.js","assets/SetupPagesScreen-o-PhLBXH.js","assets/BillPayApprovalRoutes-DPALyyf2.js","assets/ReimbursementApprovalRuleDetailScreen-kIivYyt0.js","assets/getLocaleForTenant-B0nO-Z7L.js","assets/ReimbursementRoutes-DlTMcw_k.js","assets/ReimbursementApprovalRoutes-ChPdj5ky.js","assets/TransactionListRoutes-hxVuwPcb.js","assets/ZeniAccountStatementScreen-Butd8DWu.js","assets/SettingsRoutes-D405mYiE.js","assets/AccountMappingScreen-BXftSVn-.js","assets/QBOConnectionScreen-Cxvr0UGn.js","assets/empty-DpC6uPKD.js","assets/index-Cr8P80rT.js","assets/url-BVCS53n5.js","assets/index-CYHgs6V3.js","assets/accountMappingHelper-DsN6SM7a.js","assets/useEmailConnectResultRefresh-pFVkjSX_.js","assets/ReportsRoutes-DUvTlB32.js","assets/ChargeCardRoutes-BH9evnp_.js","assets/useChargeCardPusherEvents-Cu201ke6.js","assets/PeopleRoutes-CMx_k0hr.js","assets/ExpenseAutomationRoutes-DQA6yQ4O.js","assets/TreasuryRoutes-C4GA1Tde.js","assets/VendorsRoutes-DLC5o9yJ.js","assets/pathToGoBack-C5NlBrdk.js","assets/ZeniAccountRoutes-CPdfqL23.js","assets/AddressRoutes-Dx1aQN-n.js","assets/PandLWithForecastRoutes-DvwOSp2G.js","assets/CustomerOnboardingRoutes-CI_z4poM.js","assets/TransactionDetailRoutes-DExFe-03.js","assets/EntityDetailRoutes-B2ai8pR3.js","assets/InvoicingRoutes-DOUUybBE.js","assets/NotificationRoutes-BF1aTPUh.js","assets/PerformanceRoutes-OuxZJbf_.js","assets/RewardsRoutes-CANJzBfw.js","assets/TaskRoutes-IWzYaX-F.js","assets/TaskListScreen-D5rs0HLr.js","assets/AiCfoScreen-DmLnUFml.js","assets/CardsAiCfoScreen-Cd63K_-0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as s,bn as cs,fB as ms,dV as _s,dU as Es,A3 as hs,de as ps,gG as gs,g5 as xs,db as pe,cF as Rs,gj as Is,cx as js,bE as Ts,br as As,T9 as fs,v as Ds,Tb as ys,bq as bs,Tc as Cs,bK as vs,bJ as Os,bt as Us,ct as Ps,Td as ws,Te as Fs,d6 as Ls,d9 as Vs,d8 as ks,cE as Hs,cL as Bs,pw as ge,ge as xe,gV as Ss,gg as Re,gI as Ie,gJ as je,gh as Ns}from"./zeni-epic-state-2zvjmkUL.js";import{j as e}from"./liveblocks-BD1fi6wA.js";import{a as P}from"./sentry-C6D8WJ15.js";import{N as u,u as Ms,h as Zs,i as Gs,g as $s,j as $,q as Te,n as zs,o as t}from"./core-Dlma5MIa.js";import{N as l,E as qs,u as Ys,z as y,I as Ws,f as Js,g as Ks,d as M,j as Qs,O as Xs,U as en,L as F,G as Ae,t as _,P as sn,Q as nn,l as ne}from"./index-Blw4A66-.js";import"./mui-DPmPgDDD.js";import{f as fe}from"./analyticsHelper-Bw6Cjeqd.js";import{t as tn}from"./getLocaleForTenant-B0nO-Z7L.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},A=new a.Error().stack;A&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[A]="a296531a-ff24-491d-a86a-8f009275a0e0",a._sentryDebugIdIdentifier="sentry-dbid-a296531a-ff24-491d-a86a-8f009275a0e0")}catch{}})();const an=l((()=>s((()=>import("./NotFoundScreen-Wkt8x0Ja.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),on=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/reimbursements`}),rn=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/bills`}),De=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/treasury`}),ye=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/checking`}),be=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/cards`}),b=({showZeniAccountRoute:a,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(V===!0){if(a)return e.jsx(ye,{tenantEmailDomain:v});if(i)return e.jsx(De,{tenantEmailDomain:v});if(O)return e.jsx(be,{tenantEmailDomain:v})}return a?e.jsx(ye,{tenantEmailDomain:v}):i?e.jsx(De,{tenantEmailDomain:v}):O?e.jsx(be,{tenantEmailDomain:v}):A?e.jsx(rn,{tenantEmailDomain:v}):B?e.jsx(on,{tenantEmailDomain:v}):e.jsx(an,{})},ln={dashboard:()=>s((()=>import("./DashboardRoutes-C_4oAXQg.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])),bills:()=>s((()=>import("./BillPayRoutes-qAhjjusa.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-DlTMcw_k.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])),transactions:()=>s((()=>import("./TransactionListRoutes-hxVuwPcb.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])),settings:()=>s((()=>import("./SettingsRoutes-D405mYiE.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])),reports:()=>s((()=>import("./ReportsRoutes-DUvTlB32.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-BH9evnp_.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])),people:()=>s((()=>import("./PeopleRoutes-CMx_k0hr.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-DQA6yQ4O.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,10,44,28,8])),treasury:()=>s((()=>import("./TreasuryRoutes-C4GA1Tde.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])),vendors:()=>s((()=>import("./VendorsRoutes-DLC5o9yJ.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,25,0,23,53,15,11,19,20,21,28,44,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-CPdfqL23.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8]))},un=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],te=a=>{"requestIdleCallback"in window?requestIdleCallback(a):setTimeout(a,100)},dn=l((()=>s((()=>import("./ReportsRoutes-DUvTlB32.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])))),cn=l((()=>s((()=>import("./AddressRoutes-Dx1aQN-n.js")),__vite__mapDeps([55,1,2,3,25,4,5,6,7,0,8])))),mn=l((()=>s((()=>import("./PeopleRoutes-CMx_k0hr.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])))),_n=l((()=>s((()=>import("./PandLWithForecastRoutes-DvwOSp2G.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,0,23,11,14,15,19,20,21,8])))),En=l((()=>s((()=>import("./CustomerOnboardingRoutes-CI_z4poM.js")),__vite__mapDeps([57,1,2,3,25,4,5,6,7,0,39,40,41,42,43,13,45,48,8])))),hn=l((()=>s((()=>import("./VendorsRoutes-DLC5o9yJ.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,25,0,23,53,15,11,19,20,21,28,44,8])))),pn=l((()=>s((()=>import("./TransactionDetailRoutes-DExFe-03.js")),__vite__mapDeps([58,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-B2ai8pR3.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,10,11,12,14,15,16,8])))),gn=l((()=>s((()=>import("./DashboardRoutes-C_4oAXQg.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-qAhjjusa.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])))),xn=l((()=>s((()=>import("./SettingsRoutes-D405mYiE.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])))),Rn=l((()=>s((()=>import("./InvoicingRoutes-DOUUybBE.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,25,0,19,20,21,39,40,41,42,43,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-DlTMcw_k.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])))),In=l((()=>s((()=>import("./ZeniAccountRoutes-CPdfqL23.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8])))),jn=l((()=>s((()=>import("./TreasuryRoutes-C4GA1Tde.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])))),Tn=l((()=>s((()=>import("./TransactionListRoutes-hxVuwPcb.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])))),An=l((()=>s((()=>import("./ChargeCardRoutes-BH9evnp_.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])))),fn=l((()=>s((()=>import("./NotificationRoutes-BF1aTPUh.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,11,21,8])))),Dn=l((()=>s((()=>import("./PerformanceRoutes-OuxZJbf_.js")),__vite__mapDeps([62,1,2,3,0,4,5,6,7,11,19,20,21,8])))),yn=l((()=>s((()=>import("./ExpenseAutomationRoutes-DQA6yQ4O.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,10,44,28,8])))),bn=l((()=>s((()=>import("./RewardsRoutes-CANJzBfw.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,0,8])))),Cn=l((()=>s((()=>import("./TaskRoutes-IWzYaX-F.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,14,19,20,21,65,11,8])))),vn=l((()=>s((()=>import("./AiCfoScreen-DmLnUFml.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,22,53,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-Cd63K_-0.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,8])))),C=l((()=>s((()=>import("./NotFoundScreen-Wkt8x0Ja.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),On=l((()=>s((()=>import("./TaskListScreen-D5rs0HLr.js").then((a=>a.f))),__vite__mapDeps([65,1,2,3,4,5,6,7,11,19,20,21,8])))),Un=({isDashboardAccess:a,showZeniAccountRoute:A,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(O===!0){if(A)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):a?e.jsx(u,{to:"dashboard"}):A?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/dashboard`}),Sn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:a}){const A=Ms(),B=Zs(),{tenantEmailDomain:i}=Gs(),V=qs().mode,{setLoading:O,clearAllLoading:v,clearLoading:k}=Ys(),f=y.getSignedInUserTenant(i)?.tenantId,j=y.getSignedInUser(),J=cs(j),z=$s(),[L,we]=P.useState(!1),r=$((o=>ms(o))),{useFeatureGate:S}=Ws(),Z=Js(),ae=Ks(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=S(M.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=S(M.isDebitCardFeatureEnabled),T=$((o=>o.tenantState.fetchState)),p=$((o=>o.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?_s(oe,r):void 0,K=p==="Completed"||T==="Completed"?Es(r):void 0,re=p==="Completed"||T==="Completed"?hs(r)&&!ps(r):void 0,ke=Qs(r,Ve,oe),{isCardsHidden:He}=Xs(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Se}=S(M.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=S(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=S(M.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||nn==="DEV",q=$((o=>gs(o)));if(i!=null){const o=y.getSignedInUserTenant(i);j!=null&&o!=null&&fe(j,r,V)}const G={tenantId:f,userId:j?.userId,sessionId:j?.zeniSessionId},ie=xs(),h=en(),Ze=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),Ge=Rs(h?.loggedInUserRoleMap),X=Te("/:tenantEmailDomain/onboarding/*")!==null,ee=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),$e=$((o=>G.tenantId!=null?Is(o,G.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),a(i)}),[i]),P.useEffect((()=>{if(ee!=null&&f!=null){const o=ee.params.selectedPeriod;if(o!=null){const D=o.split("-");if(D.length===2){const d=js(Number(D[0])),n=Number(D[1]),c=Ts(`01-${d<10?`0${d}`:d}-${n}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),N=As();c.isAfter(N,"month")===!1?A(fs(f,{month:d,year:n})):B(`/${i}/month_end_close_checks/review`)}}}}),[ee,f]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,G,ie,j,A,y]),P.useLayoutEffect((()=>{!Ds(ie,G)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,D,d,n){if(xe(D?.userId,D?.zeniSessionId,o.tenantId),d(Ss(!0)),d(Re(o.tenantId)),o.tenantId!=null&&_.clearTenant(o.tenantId),o.tenantId!=null){const c=y.getSignedInUserTenantWithId(o.tenantId);n&&Ae.updateAppLocaleID(tn(n)),c?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}o.userId!=null?ne.identify(o.userId,{tenant_id:o.tenantId}):ne.resetUserIdentity()})(G,j,A,$e))}),[f]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,D,d,n,c,N,H){if(d==null&&n==null)return void console.warn("There is no current tenant selected!!");const Y=n!=null&&c?.zeniSessionId!=null,ls=d==null||d.tenantId!==n,us=d!=null&&d.excludedResources==null,ds=d!=null&&d.externalConnections==null;if(Y&&ls){H(Re(n));const W=y.getSignedInUserTenantWithId(n);W?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(W?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),H(Ie(c.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),H(je(c.userId,n)))}else Y&&us&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),H(Ie(c.userId,n))),Y&&ds&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),H(je(c.userId,n)));if(Y){ne.identify(c.userId,{tenant_id:n});const W=n==null||n!=null&&(D==="Completed"||D==="Error");o==="Completed"||D!=="Not-Started"&&D!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),N(F.TENANT_FETCHING),H(Ns(c.userId,n,c.zeniSessionId))),W&&(o==="Not-Started"||o==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(ge(c.userId,c.zeniSessionId)))}})(T,p,r,f,j,O,A))}),[f,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&q.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(ys(q.tenantsBaseInOrder)),j!=null&&fe(j,r,V,void 0,q.tenantsBaseInOrder))}),[q,T,r,j]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&f!=null?(v(),_.markActiveTenantFetchCompleted(f)):p==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,f,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(o=un,D=3e3){setTimeout((()=>{const d=n=>{if(n>=o.length)return;const c=o[n],N=ln[c];N!=null?N().then((()=>te((()=>d(n+1))))).catch((()=>te((()=>d(n+1))))):d(n+1)};te((()=>d(0)))}),D)})())}),[p,L]);const U=r?.userRole!=null&&bs(r?.userRole),{isFeatureEnabled:ze}=S(M.isReferralFeatureEnabled),qe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ye=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Be&&!U,We=Cs(h?.loggedInUserRoleMap),Je=r.externalConnections?.accounting[0]?.isValid,Ke=r.externalConnections?.fetchState==="Completed",se=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&vs(h?.loggedInUserRoleMap),_e=Fe&&!U,Qe=Le&&!U,Xe=ue&&Os(h?.loggedInUserRoleMap),es=de&&Us(h?.loggedInUserRoleMap),ss=_e&&Ps(h?.loggedInUserRoleMap),ns=ws(h?.loggedInUserRoleMap),ts=Fs(h?.loggedInUserRoleMap),as=Ls(h?.loggedInUserRoleMap),os=Vs(h?.loggedInUserRoleMap),rs=ks(h?.loggedInUserRoleMap),g=Hs(h?.loggedInUserRoleMap),x=Bs(h?.loggedInUserRoleMap),Ee=ue&&g,he=ce&&x,R=_e&&as,I=Qe&&os,m=de&&rs,is=r.excludedResources?.resources?.find((o=>o.resource==="/invites"))!=null||Ge===!0||We===!0||ns===!0||ts===!0;return y.isSignedIn()?f==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(j!=null&&T!=="In-Progress"&&A(ge(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(se===!0||J&&!X)&&Ke&&Je!==!0&&E===!1&&K===!1&&re===!1?(a(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||se!==!0||X||J?!L||se!==!1||X||J?L&&r?.userRole&&E!=null&&K!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(zs,{children:e.jsxs(t,{element:e.jsx(sn,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Un,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(t,{path:"dashboard/*",element:w?e.jsx(gn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reports/*",element:w?e.jsx(dn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"people/*",element:is||w?e.jsx(mn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"forecast/*",element:w?e.jsx(_n,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(En,{})}),e.jsx(t,{path:"transaction/*",element:w&&U===!1||qe||Ye?e.jsx(pn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"transactions/*",element:w&&U===!1?e.jsx(Tn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"customer/*",element:w&&U===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"vendor/*",element:w&&U===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"tasks",element:e.jsx(On,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(Cn,{})}),e.jsx(t,{path:"address/*",element:Xe||me||ss||es?e.jsx(cn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"checking/*",element:R?e.jsx(In,{}):e.jsx(C,{})}),e.jsx(t,{path:"treasury/*",element:I?e.jsx(jn,{}):e.jsx(C,{})}),e.jsx(t,{path:"performance",element:ae===!0?e.jsx(Dn,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ae===!0&&U===!1?e.jsx(yn,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"notifications/*",element:e.jsx(fn,{})}),e.jsx(t,{path:"vendors/*",element:Ze?e.jsx(hn,{}):e.jsx(C,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"settings/*",element:Se?e.jsx(xn,{hasAdminLevelAccess:me}):e.jsx(C,{})}),e.jsx(t,{path:"invoicing/*",element:Me?e.jsx(Rn,{}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask",element:m&&Z?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/*",element:m?e.jsx(An,{}):e.jsx(C,{})}),e.jsx(t,{path:"rewards/*",element:ze?e.jsx(bn,{}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Z?e.jsx(vn,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"*",element:e.jsx(C,{})})]})}):null:(a(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(a(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),a(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{b as F,Sn as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-BD1fi6wA.js";import{a as d}from"./sentry-C6D8WJ15.js";import{h as N,g as Z,u as T,i as V,j as C,l as K,n as Q,o as k}from"./core-Dlma5MIa.js";import{fB as w,Yk as ve,ME as Pe,XU as we,Y1 as Ae,c7 as J,cQ as De,cR as Ue,bq as Te,da as _e,E$ as Re,Yl as Me,O5 as Be,Lv as Fe,Lm as de,Lj as Le,F3 as ue,Lp as pe,Ls as ge,Ly as W,Bf as ee,F2 as Oe,l8 as G,lb as me,Ym as Ne,ml as Ve,Fl as Ye,UA as $e,UB as Ge,l6 as Ze,Yn as Ke,l9 as He,tK as ze,Uv as qe,Uw as Qe,tO as Xe,hS as Je,Tv as q,hK as ae,hH as We,hP as en,Tw as nn,Fi as tn,Yo as an,Yp as on,LM as sn,lF as rn,dU as fe,dV as he,Yq as ln,gz as cn,TK as dn,Fh as oe,gE as se,gD as un,Fg as pn,gC as gn,gB as mn,Yr as fn,S_ as Ce,Ys as hn,Yt as Cn,Yu as yn,Yv as Sn,Yw as bn,Yx as In,Fo as En,Yy as xn,Ff as ie,F9 as $,Yz as kn,YA as jn,YB as re,YC as vn,dN as Pn,YD as wn,YE as An,YF as Dn,T8 as Un,b$ as Tn,c6 as _n,c5 as Rn,c0 as Mn,YG as Bn,c3 as Fn,c2 as Ln,c4 as On,c1 as Nn}from"./zeni-epic-state-2zvjmkUL.js";import{bQ as Vn,z as P,U as Y,a5 as ne,c0 as Yn,l as H,I as te,d as L,j as ye,O as Se,c1 as $n,k as Gn,X as be,c2 as Zn,ag as Kn,c3 as Hn,c4 as zn,ao as qn,c5 as Qn,p as Xn,e as Ie,c6 as Jn}from"./index-Blw4A66-.js";import{n as B}from"./mui-DPmPgDDD.js";import{u as Ee}from"./useTaskManagerAccess-BKVtGCGL.js";import{U as Wn}from"./AccountMappingScreen-BXftSVn-.js";import{t as et,A as nt}from"./AddressScreen-TLZdvXNy.js";import O from"./NotFoundScreen-Wkt8x0Ja.js";import{g as tt}from"./analyticsHelper-Bw6Cjeqd.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-BYV8fDWH.js";import{C as st}from"./CompanyPassportScreen-D0g6Nmxq.js";import{M as R}from"./MobileAppDrawer-BMvh-RAa.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-pFVkjSX_.js";import{q as le}from"./QBOConnectionScreen-Cxvr0UGn.js";import{B as lt}from"./BillPayApprovalRoutes-DPALyyf2.js";import{R as ct}from"./ReimbursementApprovalRoutes-ChPdj5ky.js";import"./recharts-WuCIKI4c.js";import"./analytics-NBT5BH2R.js";import"./plaid-w5kSeMkL.js";import"./dnd-BgBEAfSC.js";import"./stripe-cKAAJElX.js";import"./lottie-Dd5kLrRz.js";import"./lexical-Cc-23sPJ.js";import"./pdf-BCsxh4ki.js";import"./utils-Bv9LDtmr.js";import"./accountMappingHelper-DsN6SM7a.js";import"./routePaths-1GgW-roh.js";import"./InboxNotificationsProvider-7eYmgI1F.js";import"./empty-DpC6uPKD.js";import"./pdf-lib-BSghpPvP.js";import"./index-Cr8P80rT.js";import"./url-BVCS53n5.js";import"./index-CYHgs6V3.js";import"./decodeURIComponentSafe-MgEJs-XP.js";import"./ReimbursementApprovalRuleDetailScreen-kIivYyt0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="95693c82-e8ea-48df-950a-34c1cf4cf0de",e._sentryDebugIdIdentifier="sentry-dbid-95693c82-e8ea-48df-950a-34c1cf4cf0de")}catch{}})();const dt=B.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-BkTNzfNi.js";import{a as d}from"./sentry-CNLjKkQ
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ut=
|
|
9
|
+
`,ut=K((function(e,l){const o=w(e),i=we(e),r=Ae(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(J(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Yn),pt=()=>{const e=N(),l=Z(),o=T(),{tenantEmailDomain:i}=V(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>w(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>ve(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Vn(c?.tenantId),p=c.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=Y();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(Pe(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const x=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:x}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{x(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-BkTNzfNi.js";import{a as d}from"./sentry-CNLjKkQ
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,mt=
|
|
17
|
+
`,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=w(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(W(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Le(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Fe(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))($n),ft=()=>{const e=N(),l=Z(),o=T(),{tenantEmailDomain:i}=V(),r=Y(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(L.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(L.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((A=>w(A))),p=C((A=>A.settingsViewState.bankConnection.fetchState)),b=De(m,r?.loggedInUserRoleMap),x=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Te(m.userRole),v=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,_=ye(m,t,s),D=_e(m,r?.loggedInUserRoleMap)&&_,{isCardsHidden:I}=Se(m?.tenantId),E=m.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Re(!1)))}),[h,o,p]);const M=A=>{u(A)};return b||v||x||D?a.jsxs(gt,{children:[a.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:E,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:x,isZeniAccountEnabled:v,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(O,{})},ht=B.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-BkTNzfNi.js";import{a as d}from"./sentry-CNLjKkQ
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,Ct=
|
|
25
|
+
`,Ct=K((function(e,l){const{companyId:o}=l,i=w(e),r=l.roleMap.bill_pay_admin,n=Ne(e,o),{uiState:t}=n,s=(J(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:H}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(W(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(He(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(Ze(n,t,s))},handleFetchPaymentSources:()=>{e(G())},resetCardPaymentViewState:()=>{e(Ge())},handleResetCardPaymentErrorStatuses:()=>{e($e())},onBillingAddressSave:n=>{e(Ye(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Ve({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Zn),yt=()=>{const e=N(),l=Z(),o=T(),{tenantEmailDomain:i}=V(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>w(j))),S=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=Gn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,x=h.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=Y();d.useEffect((()=>{x!=null&&o(Oe(x,!1))}),[x,o]),d.useEffect((()=>{t||(s(!0),o(G()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o(G())}),[p,b]);const v=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:v}),a.jsx(Ct,{navigate:e,location:l,companyId:x,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},X="external_integrations",St=K((function(e){const l=Qe(e,X);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(We(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Je(t,q("payments"),s))},onNotifyMe:s=>{H.trackIntegrationsNotifyMeClicked("Settings",s),e(Xe(X,s,r))}}}))(Hn),bt=()=>{const e=Kn(),l=N(),o=T(),{tenantEmailDomain:i}=V(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>w(I))),u=c.companyId??P.getSignedInUserTenant(i)?.companyId,h=P.getSignedInUser(),S=Y(),m=J(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(X))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o(G()))}),[p,o]);const x=I=>{t(I)},g=C((I=>qe(I,u))),v=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:_,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:x}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{x(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,E])=>[I,E?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:_,onReLoginPlaidAccount:D,plaidConnectionDetails:v})]}):a.jsx(ne,{fetchState:s})},It=B.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -30,7 +30,7 @@ import{j as a}from"./liveblocks-BkTNzfNi.js";import{a as d}from"./sentry-CNLjKkQ
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,
|
|
33
|
+
`,Et=B.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
height: 100%;
|
|
36
36
|
width: 100%;
|
|
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-BkTNzfNi.js";import{a as d}from"./sentry-CNLjKkQ
|
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
align-items: center;
|
|
40
40
|
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
-
`,
|
|
41
|
+
`,xt=()=>{const e=T(),{tenantEmailDomain:l}=V(),[o,i]=d.useState(!1),r=C((p=>w(p))).companyId??P.getSignedInUserTenant(l)?.companyId,n=P.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(W(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(Et,{children:[a.jsx(R,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
height: 100%;
|
|
44
44
|
width: 100%;
|
|
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-BkTNzfNi.js";import{a as d}from"./sentry-CNLjKkQ
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,ce=({appContent:e})=>{const l=T(),o=N(),i=Z(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??
|
|
49
|
+
`,ce=({appContent:e})=>{const l=T(),o=N(),i=Z(),[r,n]=d.useState(!1),t=C((y=>w(y))),{tenantEmailDomain:s}=t,c=t.companyId??P.getSignedInUserTenant(s)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(L.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(L.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),x=fe(t),g=he(m,t),v=!g&&b,j=ye(t,S,m),{isCardsHidden:_}=Se(t?.tenantId),D=!j||_,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,v))}),[c,l,v,I]);const E=C((y=>cn(y,v))),M=E.fetchState==="Not-Started"||E.fetchState==="In-Progress"||c==null,A=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Qn,{myProfileView:E,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:A===!1,onClickMenuIcon:()=>{U(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:x,onAddressClick:y=>{const F=(function(ke,je){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${je}`),z})(s,y),xe=Xn(i.state?.pathnameStackToGoBack,i.pathname);o(F,{state:{pathnameStackToGoBack:xe}})},onGetOtp:y=>{const F={...E.myProfileLocalData,phone:y};l(oe({localData:F})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},onVerifyOtp:(y,F)=>{l(un(y,F,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&P.saveZeniOtpToken(y),l(se("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function jt(){const e=T(),l=C((f=>w(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=Ee(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),x=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),v=d.useCallback((()=>{e(En()),c&&e(xn())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e($())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),_=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,y)=>{e(jn({eventId:f,channel:re(U),enabled:y}))}),[e]),I=d.useCallback(((f,U)=>{e(vn({groupId:f,frequency:Pn(U)}))}),[e]),E=d.useCallback(((f,U,y)=>{e(wn({groupId:f,channel:re(U),enabled:y}))}),[e]),M=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:E}}),[S,h,t,s,D,I,E]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e($())}),[e,i,n.fetchState]);const A=d.useRef(i);return d.useEffect((()=>{A.current!==i&&(e(An()),e(Dn()),e($()),A.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(R,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Jn,{notificationSettingsView:r,onFormDataChange:x,onCancel:g,onSave:v,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:_,taskNotifications:M,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>w(b))),n=Y(),t=Ie(),s=T(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(L.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=Ee(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s($()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Tn(r)?a.jsxs(Q,{children:[_n(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Wn,{})}),Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(vt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(xt,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Fn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),On(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Nn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]}):a.jsx(Q,{children:a.jsx(k,{path:"*",element:a.jsx(O,{})})}):null}function vt(e){return a.jsxs(Q,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(O,{})}),a.jsx(k,{path:"*",element:a.jsx(O,{})})]})}export{da as default};
|