@zeniai/web-app-ui 5.4.21-prod → 5.4.22-dev
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-o9UNAAN2.js → AccountMappingScreen-C5mOiJ2U.js} +2 -2
- package/dist/assets/ActualMatchingMatchDetailScreen-wHD8fSWU.js +1 -0
- package/dist/assets/AddressRoutes-CVWN9CJv.js +1 -0
- package/dist/assets/AddressScreen-DgUwrml_.js +9 -0
- package/dist/assets/AiCfoScreen-yDQ2sphg.js +22 -0
- package/dist/assets/{AppDrawer-BycMyj5M.js → AppDrawer-DzYZBC2G.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-FZbtoTk1.js → BillPayApprovalRoutes-BcCgse3-.js} +1 -1
- package/dist/assets/BillPayRoutes-HAS0-pNc.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-DM_jBIuD.js +9 -0
- package/dist/assets/CardsAiCfoScreen-yrI2CL7M.js +14 -0
- package/dist/assets/ChargeCardRoutes-DgtmFgR6.js +71 -0
- package/dist/assets/CompanyPassportScreen-BLtXgkEd.js +1 -0
- package/dist/assets/ConnectionAuthScreen-CuZmfRIp.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BjmJLllh.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-N9fmUi4M.js → CustomerOnboardingRoutes-C0b805o-.js} +7 -7
- package/dist/assets/CustomersRoutes-DD5Gx1mW.js +8 -0
- package/dist/assets/DashboardRoutes-C8RZkkYj.js +20 -0
- package/dist/assets/DefaultTenantHome-C6Ygdgwt.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-BxClNf2J.js +18 -0
- package/dist/assets/DrawerScreen-BHaectiO.js +1 -0
- package/dist/assets/EntityDetailRoutes-BJzuW7dq.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-BKrWZyYV.js +38 -0
- package/dist/assets/FallBackRoute-DuMHkNqk.js +2 -0
- package/dist/assets/FeaturePreviewScreen-DHt0WFS8.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-Di0pbhHE.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-Dp-eDJC-.js → InboxNotificationsProvider-CiKEEv6Q.js} +1 -1
- package/dist/assets/InvoicingRoutes-Bsq4ym98.js +3 -0
- package/dist/assets/MagicLinkRoutes-DJX5Nm1n.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-CD7Pya_j.js +12 -0
- package/dist/assets/MobileAppDrawer-BWNb5zLN.js +1 -0
- package/dist/assets/NotFoundScreen-DXy-BCit.js +1 -0
- package/dist/assets/NotificationRoutes-B2xHVaqf.js +1 -0
- package/dist/assets/OAuthConsentScreen-BA2eBLib.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-Dm5Vnr71.js +1 -0
- package/dist/assets/PaymentLinkScreen-CndVAq3p.js +21 -0
- package/dist/assets/PeopleRoutes-kralZgbz.js +22 -0
- package/dist/assets/PerformanceRoutes-DJhuo9qY.js +1 -0
- package/dist/assets/{Preview-C5WCMZ5q.js → Preview--c8D4GAG.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BwiFGkNK.js → QBOConnectionScreen-DroXrkno.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-B2ftFL0O.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CHTcY28V.js +1 -0
- package/dist/assets/{ReimbursementRoutes-IyEE77RL.js → ReimbursementRoutes-CI3m7PHD.js} +9 -9
- package/dist/assets/ReportsRoutes-C7A0Ycu_.js +1 -0
- package/dist/assets/RewardsRoutes-Dkg4zGB8.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-COClCOXU.js → ScheduleDetailsPrepaidExpensesScreen-ZwdXW6K5.js} +5 -5
- package/dist/assets/ScreenRoutes-B_WT7FAm.js +2 -0
- package/dist/assets/{SettingsRoutes-B8qt67Bj.js → SettingsRoutes-_XBnyBgG.js} +6 -6
- package/dist/assets/{SetupPagesScreen-UjK2D0Rv.js → SetupPagesScreen-D6ssIWb0.js} +5 -5
- package/dist/assets/SignInScreen-H_SOl_FQ.js +1 -0
- package/dist/assets/SignOutScreen-OFswrnt8.js +9 -0
- package/dist/assets/{TaskListScreen-2_ij-Yu1.js → TaskListScreen-Bmj5V_dR.js} +2 -2
- package/dist/assets/TaskRoutes-D6cEqDZN.js +9 -0
- package/dist/assets/TransactionDetailRoutes-D-b6zdg4.js +1 -0
- package/dist/assets/TransactionDetailScreen-JBKbtouq.js +5 -0
- package/dist/assets/TransactionListRoutes-THtfycHC.js +1 -0
- package/dist/assets/TreasuryRoutes-CgHwdyKd.js +37 -0
- package/dist/assets/{VendorsRoutes-uW7VJmDE.js → VendorsRoutes-jETcYESc.js} +18 -18
- package/dist/assets/WiseConfirmationScreen-BpRHCykr.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-DPX2T0Kt.js → ZeniAccountRoutes-C8cr5UMy.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-DAs1_LIC.js +9 -0
- package/dist/assets/{accountMappingHelper-FvEDI2O0.js → accountMappingHelper-DSd2V454.js} +1 -1
- package/dist/assets/{analytics-CzizEiux.js → analytics-Vgn85Ur_.js} +4 -4
- package/dist/assets/analyticsHelper-CWMk7_rd.js +1 -0
- package/dist/assets/{core-Bx5kG7oj.js → core-CbdTrw7T.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DMAtWdNT.js → decodeURIComponentSafe-D7APy95S.js} +1 -1
- package/dist/assets/{dnd-BT4GhSLO.js → dnd-DuiAlI7w.js} +1 -1
- package/dist/assets/empty-B1nH_ieU.js +1 -0
- package/dist/assets/{empty-Cn912Jag.js → empty-CjoB5KP4.js} +1 -1
- package/dist/assets/{emptyVideoElement-BTRIh8mw.js → emptyVideoElement-B6iUrc8S.js} +1 -1
- package/dist/assets/epic-CCMzkkv8.js +2 -0
- package/dist/assets/expenseAutomationHelper-CgTsmmCm.js +1 -0
- package/dist/assets/getLocaleForTenant-B8EqveGi.js +1 -0
- package/dist/assets/{index-CfvGavEm.js → index-BFdcFsSo.js} +1 -1
- package/dist/assets/index-BNFAuGus.js +1 -0
- package/dist/assets/{index-DkHntkmh.js → index-CnIO6_IQ.js} +14764 -14764
- package/dist/assets/{index-BphJBpvs.js → index-DjPsG1Xt.js} +1 -1
- package/dist/assets/{index-CtJA2cwC.js → index-LGKtWUy9.js} +1 -1
- package/dist/assets/{index-Did1JRAl.js → index-naWU0Itr.js} +2 -2
- package/dist/assets/{empty-BtyJHOUL.js → index-pWh5QyXZ.js} +1 -1
- package/dist/assets/{index-But38I3J.js → index-wSCaSCb5.js} +1 -1
- package/dist/assets/{lexical-BVHU6OCB.js → lexical-B-vxEaRQ.js} +1 -1
- package/dist/assets/{liveblocks-BD_ga8W6.js → liveblocks-BLpmr1Pv.js} +15 -15
- package/dist/assets/{lottie-EXw6nebq.js → lottie-Lb1ftKY1.js} +1 -1
- package/dist/assets/{mui-BaMyMAqO.js → mui-DNGY4bFU.js} +2 -2
- package/dist/assets/{pathToGoBack-BzRgSVEC.js → pathToGoBack-CJCquoqC.js} +1 -1
- package/dist/assets/{pdf-DnsysvFr.js → pdf-B1uD4Ovv.js} +3 -3
- package/dist/assets/{pdf-lib-DTKmmSz0.js → pdf-lib-BKN88Kre.js} +1 -1
- package/dist/assets/{plaid-BmyHDSR7.js → plaid-DhfTjhua.js} +1 -1
- package/dist/assets/{pusher-BADlF29B.js → pusher-BPtf_EL-.js} +1 -1
- package/dist/assets/{react-B-WPW2lk.js → react-B10NZVQI.js} +1 -1
- package/dist/assets/{react-B4hLpFdk.js → react-BAEKpD-r.js} +1 -1
- package/dist/assets/{react-Dz5IyPy2.js → react-Bhjp4pzB.js} +1 -1
- package/dist/assets/{react-tdpT-_R0.js → react-DEDzyvMl.js} +1 -1
- package/dist/assets/{react-B-SJqSpk.js → react-DGl2P4dK.js} +1 -1
- package/dist/assets/{react-DCWsxx3l.js → react-arX5WESX.js} +1 -1
- package/dist/assets/{recharts-Bcj70bk1.js → recharts-CTh_JhT_.js} +1 -1
- package/dist/assets/{reportTimeframe-CUcsFj60.js → reportTimeframe-DeLnONFM.js} +1 -1
- package/dist/assets/{routePaths-Cxh0_DtI.js → routePaths-CV12X_S-.js} +1 -1
- package/dist/assets/{sentry-DsaQHQmX.js → sentry-DWNq3t8E.js} +2 -2
- package/dist/assets/{stripSplatSuffix-B3Bc_avB.js → stripSplatSuffix-DP9nmQOu.js} +1 -1
- package/dist/assets/{url-DAJdS_e6.js → url-B2x9G6No.js} +4 -4
- package/dist/assets/{url-DjR0oJYL.js → url-BqlXUDAr.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-D-Ym3wTm.js +1 -0
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Dqg5VVaq.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-DXFswt7R.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-Cq6Y4mMW.js +1 -0
- package/dist/assets/{useDeviceId-BviPVfDF.js → useDeviceId-dj9QS4Ga.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-qgk6N8cm.js +1 -0
- package/dist/assets/useEnsureVendorListLoaded-CIShbpK4.js +1 -0
- package/dist/assets/useInitialThreadRequest-DAUsQlCl.js +1 -0
- package/dist/assets/useIsCustomersTabEnabled-C6mkabn2.js +1 -0
- package/dist/assets/useTaskManagerAccess-Cm5trA3i.js +1 -0
- package/dist/assets/useTaskManagerPusherEvents-C1gzc-aA.js +1 -0
- package/dist/assets/{utils-Rng1Um8N.js → utils-CrhrpmD8.js} +2 -2
- package/dist/assets/{withTransactionSidePanel-DTG3VL6U.js → withTransactionSidePanel-D-hDwbdr.js} +5 -5
- package/dist/assets/{zeni-epic-state-CP_8Me3V.js → zeni-epic-state-C5DO1jkr.js} +7 -7
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/ActualMatchingMatchDetailScreen-Bq4tInFn.js +0 -1
- package/dist/assets/AddressRoutes-CTXOzi6Q.js +0 -1
- package/dist/assets/AddressScreen-CpY6qzLi.js +0 -9
- package/dist/assets/AiCfoScreen-CeSkAjuX.js +0 -22
- package/dist/assets/BillPayRoutes-DR1qovIJ.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-Byhif9Ma.js +0 -9
- package/dist/assets/CardsAiCfoScreen-DuMDy2QA.js +0 -14
- package/dist/assets/ChargeCardRoutes-CkebfhOF.js +0 -71
- package/dist/assets/CompanyPassportScreen-B9QeqdTn.js +0 -1
- package/dist/assets/ConnectionAuthScreen-BxSdWxSi.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-LYqD1O_j.js +0 -1
- package/dist/assets/CustomersRoutes-BPgppFga.js +0 -8
- package/dist/assets/DashboardRoutes-BsicDORh.js +0 -20
- package/dist/assets/DefaultTenantHome-k44UkE7_.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-C3YIjUYE.js +0 -18
- package/dist/assets/DrawerScreen-C86vnRJz.js +0 -1
- package/dist/assets/EntityDetailRoutes-A4ws8Hyd.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-D5mOe8NQ.js +0 -38
- package/dist/assets/FeaturePreviewScreen-DUY6p3ge.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-DD_LJq4g.js +0 -1
- package/dist/assets/InvoicingRoutes-CN-eG_gg.js +0 -3
- package/dist/assets/MagicLinkRoutes-DugkbFub.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-AD90LU49.js +0 -12
- package/dist/assets/MobileAppDrawer-DDeilglm.js +0 -1
- package/dist/assets/NotFoundScreen-oYE2WlvI.js +0 -1
- package/dist/assets/NotificationRoutes-CebTwOdA.js +0 -1
- package/dist/assets/OAuthConsentScreen-DwCYB8ry.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-C8BIa_6t.js +0 -1
- package/dist/assets/PaymentLinkScreen-Brc4c_uL.js +0 -21
- package/dist/assets/PeopleRoutes-BadtTp85.js +0 -22
- package/dist/assets/PerformanceRoutes-CELeTcmt.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-DfYqyG3t.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-DE6y72u6.js +0 -1
- package/dist/assets/ReportsRoutes-CAjdNb2Z.js +0 -1
- package/dist/assets/RewardsRoutes-B5s3qeYK.js +0 -1
- package/dist/assets/ScreenRoutes-C9LqvM4m.js +0 -2
- package/dist/assets/SignInScreen-DyroBcKr.js +0 -1
- package/dist/assets/SignOutScreen-BvkzQcmU.js +0 -9
- package/dist/assets/TaskRoutes-YSc8SAKu.js +0 -9
- package/dist/assets/TransactionDetailRoutes-Brl4E-L9.js +0 -1
- package/dist/assets/TransactionDetailScreen-DPXvNf-7.js +0 -5
- package/dist/assets/TransactionListRoutes-CL-K7ix6.js +0 -1
- package/dist/assets/TreasuryRoutes-B7-wS8Oy.js +0 -37
- package/dist/assets/WiseConfirmationScreen-BLgEu5jI.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-B-69HKZM.js +0 -9
- package/dist/assets/analyticsHelper-jqkqthAa.js +0 -1
- package/dist/assets/epic-BVSwA_uf.js +0 -2
- package/dist/assets/expenseAutomationHelper-CAr9eXjQ.js +0 -1
- package/dist/assets/getLocaleForTenant-Cvq70l-z.js +0 -1
- package/dist/assets/index-Dc4mB2Op.js +0 -1
- package/dist/assets/index-bKm528DW.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-iGCUO44-.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-COa1RGwu.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-B0IAA2LU.js +0 -1
- package/dist/assets/useChargeCardPusherEvents-jDlyzqdm.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-df266Q2H.js +0 -1
- package/dist/assets/useEnsureVendorListLoaded-CCsBxqME.js +0 -1
- package/dist/assets/useInitialThreadRequest-Dspu5rPv.js +0 -1
- package/dist/assets/useIsCustomersTabEnabled-BiAWPXPy.js +0 -1
- package/dist/assets/useTaskManagerAccess-CW2xYz9y.js +0 -1
- package/dist/assets/useTaskManagerPusherEvents-UN1wlS1b.js +0 -1
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-BD_ga8W6.js";import{i as S,l as g,h as C,g as y,u as ee,t as ae,j as E,N as te,n as ne,o as p}from"./core-Bx5kG7oj.js";import{Vr as k,Vs as v,Vt as V,Kd as D,J$ as T,Vu as B,Vv as oe,Vw as se,K3 as ie,gm as $,Ka as le,K7 as de}from"./zeni-epic-state-CP_8Me3V.js";import{$ as x,E as d,a0 as re,h as j,W as G,a1 as ce,a2 as me,a3 as pe,j as K,p as ue,_ as he,a4 as ge,v as xe,e as fe,a5 as we,a6 as be,Y as Se,a7 as ye,a8 as ke,a9 as ve,aa as je}from"./index-DkHntkmh.js";import{n as m,u as $e}from"./mui-BaMyMAqO.js";import f from"./NotFoundScreen-oYE2WlvI.js";import{a as I}from"./sentry-DsaQHQmX.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.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]="cae6c09e-6d8f-4eb2-9e37-587dc9eafad8",e._sentryDebugIdIdentifier="sentry-dbid-cae6c09e-6d8f-4eb2-9e37-587dc9eafad8")}catch{}})();const Ie=m.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
10
|
-
`,Ce=g((function(e){const t=k(e),n=v(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}}),(function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(D(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(V({data:l}))}}}))(re);function F(){const e=x(),{vendorId:t,billId:n}=S();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(Ce,{vendorId:t,billId:n})})})}const De=m.div`
|
|
11
|
-
display: flex;
|
|
12
|
-
height: 100vh;
|
|
13
|
-
width: 100%;
|
|
14
|
-
flex: 1 1 auto;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
align-items: center;
|
|
17
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
18
|
-
box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
19
|
-
`,Be=g((function(e,t){const{isSubPage:n}=t;return{addressToEdit:B(e),googleAPIKey:G.googleMapsAPIKey,isSubPage:n}}),(function(e,t){const{navigate:n,location:o}=t,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Pe();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=ze(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}}))(ce);function Ae({isSubPage:e}){const t=C(),n=y(),o=x();return a.jsx(a.Fragment,{children:a.jsx(De,{windowSize:o,children:a.jsx(Be,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:G.googleMapsAPIKey})})})}const Pe=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},ze=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
|
|
20
|
-
display: flex;
|
|
21
|
-
height: 100%;
|
|
22
|
-
width: 100%;
|
|
23
|
-
flex: 1 1 auto;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
align-items: center;
|
|
26
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
27
|
-
box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
28
|
-
`,Ne=g((function(e){const t=k(e),n=v(e),o=B(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}}),(function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(D(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:r}=i;e(V({data:r}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),r=K(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:r}})}}}))(pe);function Ee(){const e=C(),t=y(),n=x(),{vendorId:o,billId:s}=S();return o==null||s==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Le,{windowSize:n,children:a.jsx(Ne,{location:t,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
|
|
29
|
-
display: flex;
|
|
30
|
-
height: 100%;
|
|
31
|
-
width: 100%;
|
|
32
|
-
flex: 1 1 auto;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
align-items: center;
|
|
35
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
-
box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
37
|
-
`,Ve=g((function(e){const t=k(e),n=v(e),o=B(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}}),(function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(D(i,"international",s,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:r}=i;e(se({data:r}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),r=K(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:r}})}}}))(ge);function Te(){const e=C(),t=y(),n=x(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?a.jsx(f,{}):a.jsx(Fe,{windowSize:n,children:a.jsx(Ve,{location:t,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Ge={containerWidth:new ve(100,58)},Ke=m(ye)`
|
|
38
|
-
width: ${d.sp4};
|
|
39
|
-
height: ${d.sp4};
|
|
40
|
-
margin-bottom: ${d.sp3};
|
|
41
|
-
margin-top: ${d.sp3};
|
|
42
|
-
margin-left: ${d.sp8};
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
position: absolute;
|
|
45
|
-
color: ${e=>e.theme.colors.brandColorJade};
|
|
46
|
-
`,Me=m.div`
|
|
47
|
-
display: flex;
|
|
48
|
-
height: 100vh;
|
|
49
|
-
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
50
|
-
width: 100vw;
|
|
51
|
-
overflow-y: scroll;
|
|
52
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
53
|
-
`,He=m.div`
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
56
|
-
flex-direction: column;
|
|
57
|
-
width: ${e=>`${Ge.containerWidth.value(e.windowSize)}%`};
|
|
58
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
59
|
-
box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
60
|
-
padding-top: ${e=>e.windowSize!=="small"?d.sp2:"0px"};
|
|
61
|
-
`,We=m.div`
|
|
62
|
-
display: flex;
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
align-items: center;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
padding: ${e=>e.windowSize==="small"?d.sp3:`62px ${d.sp6} ${d.sp9} ${d.sp8}`};
|
|
67
|
-
height: ${e=>e.windowSize==="small"?"490px":"auto"};
|
|
68
|
-
overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
|
|
69
|
-
width: ${e=>e.windowSize=="small"?"auto":"42%"};
|
|
70
|
-
background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
|
|
71
|
-
margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
|
|
72
|
-
`,_e=g((function(e,t){return{file:t.file,type:t.type}}))(ke);function h({appContent:e}){const t=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=ae(),r=i.get("token"),M=n.pathname.includes("address"),w=x(),H=xe(),A=$e(),b=fe(),W=()=>{H.toggle()},_=E((u=>k(u))),U=E((u=>v(u))),{authParams:J,fetchState:c,billAttachment:Y,billFetchState:P,companyName:q,currencySymbol:O,amount:Q}=_,{tenantId:z,userId:L,sessionId:N}=J,{fetchState:R,internationalBankAccountCreateStatus:X}=U;return I.useEffect((()=>{$()}),[]),I.useEffect((()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&r!=null&&t(le(s,o,r))}),[b,c,s,o,r,t]),I.useEffect((()=>{b&&c==="Completed"&&($(L,N,z),l!=null&&t(de(l)))}),[c,b,L,N,z,l,t]),c==="Error"?a.jsx(f,{}):R==="Completed"||X.fetchState==="Completed"?($(),a.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?a.jsx(we,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${d.sp1} ${A.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[c==="Completed"&&P==="Completed"&&a.jsx(be,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",s??"",q,l??"",Ue(n.pathname),O,Q))(u)}),a.jsxs(Me,{windowSize:w,children:[w!=="small"?a.jsx(Ke,{onClick:W}):null,a.jsx(We,{windowSize:w,isAddressPage:M,children:P==="In-Progress"?a.jsx(Se,{size:"ExtraLarge",start:!0}):a.jsx(_e,{file:Y,type:"bill"})}),a.jsx(He,{windowSize:w,children:e})]})]})}const Ue=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Je(){return a.jsx(je,{})}function ra(){return a.jsxs(ne,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(Je,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Ae,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ee,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Te,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{ra as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-BD_ga8W6.js";import{a as f}from"./sentry-DsaQHQmX.js";import{u as F,g as O,h as _,t as w,j as l,N as T}from"./core-Bx5kG7oj.js";import{z as r,G as M,O as P,h as A,Q as N,X as G,Y as J,T as Q}from"./index-DkHntkmh.js";import{fJ as R,UV as W,Vn as X,Vd as Y,gm as Z,go as $,Vj as q,gZ as B,dn as H,Vo as K,Vp as ee}from"./zeni-epic-state-CP_8Me3V.js";import{u as te,n as ne}from"./mui-BaMyMAqO.js";import{u as se}from"./useDeviceId-BviPVfDF.js";import{f as ae}from"./analyticsHelper-jqkqthAa.js";import{t as ie}from"./getLocaleForTenant-Cvq70l-z.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="2fb52b34-0260-49f2-a7bf-90c290fdb8ab",t._sentryDebugIdIdentifier="sentry-dbid-2fb52b34-0260-49f2-a7bf-90c290fdb8ab")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=F(),a=O(),m=_(),[k]=w(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:V,magicLinkEmail:c,verifyDeviceFetchState:x,resendVerifyDeviceOTPFetchState:z}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),y=l((e=>e.tenantState.activeTenantFetchState.fetchState)),b=l((e=>e.tenantState.signInState)),h=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>R(e))),I=l((e=>W(e))),C=r.getSignedInUser(),v=te().mode;f.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(X(n,i,g)))}),[n,p,t,i,g,s?.zeniSessionId]),f.useEffect((()=>{b!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(Y(I.tenantsInOrder),s.zeniSessionId),Z(s.userId,s.zeniSessionId,o.tenantId),t($(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(q("Completed")),M.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,I.tenantsInOrder),B().then((()=>{const e=Q();e!=null&&P(e)})),setTimeout((()=>{A.trackLogin(N.Event.loginSuccess,"email",H(o.productSettings))}),2e3))}),[b,S,y,s,o,I,v,a.state,t]);const E=f.useCallback((()=>{m("/signin/auth")}),[m]),j=f.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(K(i,c,d))}),[i,d,t,c]),U=f.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(ee(e,i,c,d))}),[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(G,{phoneNumber:V,verifyOtpFetchState:x.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:j,onVerifyOtp:U,onCancelVerifyDevice:E});if(b==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||C!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(J,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
right: 0;
|
|
6
|
-
bottom: 0;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
z-index: 9999;
|
|
11
|
-
background-color: ${t=>t.theme.colors.background};
|
|
12
|
-
`;export{De as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as B}from"./liveblocks-BD_ga8W6.js";import{a as m}from"./sentry-DsaQHQmX.js";import{u as te,j as t,i as Ge,g as Ve,h as Me,q as D}from"./core-Bx5kG7oj.js";import{fJ as ne,UW as xe,UX as se,gd as Ne,fI as Re,V4 as Pe,UZ as Ue,U_ as je,qi as Le,gq as Oe,V1 as h,V6 as Ze,V7 as X,gr as qe,V8 as ze,ER as He,h6 as We,cZ as Ye,V9 as Je,gc as Ke,gs as Xe}from"./zeni-epic-state-CP_8Me3V.js";import{w as Qe,i as ea,v as aa,p as ta,c as na,e as sa,u as oa,_ as c,f as ia,K as ra,z as da,d as ca,k as la,H as ua,o as ma,l as fa,n as Q,L as ba,A as ha,C as pa,j as S,h as ee,r as ga,I as ae,x as Sa,y as ka}from"./index-DkHntkmh.js";import{D as Ea}from"./mui-BaMyMAqO.js";import{u as Ca}from"./InboxNotificationsProvider-Dp-eDJC-.js";import{u as Ta}from"./useTaskManagerAccess-CW2xYz9y.js";import{u as Ia}from"./useIsCustomersTabEnabled-BiAWPXPy.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new l.Error().stack;i&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[i]="cbe564d6-1b24-405c-aeb0-d8f10b3c9b8f",l._sentryDebugIdIdentifier="sentry-dbid-cbe564d6-1b24-405c-aeb0-d8f10b3c9b8f")}catch{}})();const ya=Qe((({isAppContentDrawerOpen:l,handleDrawerToggle:i})=>{const{tenantEmailDomain:s}=Ge(),a=Ve(),k=aa(),n=Me(),F=Ne(),r=te(),{useFeatureGate:d}=ta(),p=na(),{isTaskManagerAccessEnabled:E}=Ta(p),o=t((e=>ne(e))),oe=o.masterTOSInfo?.isMasterTOSAccepted??!1,$=t((e=>Re(e))),{status:ie}=t(Pe),G=$.uiState.currentChatSessionId,C=sa(),{setLoading:re}=oa(),[w,V]=m.useState(void 0),A=D("/:tenantEmailDomain/dashboard")!==null,M=D("/:tenantEmailDomain/reports")!==null,f=D("/:tenantEmailDomain/onboarding/*")!==null,de=!!o.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ce}=d(c.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=d(c.isDebitCardFeatureEnabled),le=ia(o,ce,x),{isFeatureEnabled:ue}=d(c.isSettingsFeatureEnabled),N=t((e=>Ue(e))),{isFeatureEnabled:T}=d(c.isReferralFeatureEnabled),v=t((e=>je(e)));m.useEffect((()=>{C&&T&&!f&&v.fetchState==="Not-Started"&&r(Le(!0))}),[C,T,v.fetchState,f]);const _=t((e=>e.tenantState)),me=t((e=>_.fetchState==="Completed"?Oe(e):[])),g=t((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:fe}=d(c.isApAgingFeatureEnabled),{isFeatureEnabled:be}=d(c.isArAgingFeatureEnabled),R=ra(),{isFeatureEnabled:he}=d(c.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:pe}=d(c.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ge}=d(c.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Se}=d(c.isDashboardSidebarNewYearAnimationEnabled),ke=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",Ee=t((e=>h(e).totalUnreadCount)),Ce=t((e=>h(e).reducedFetchCountState)),P=t((e=>h(e).notificationDetailsByTab.tasks.uiState.unreadCount)),U=t((e=>h(e).notificationDetailsByTab.comments.uiState.unreadCount)),j=t((e=>h(e).notificationDetailsByTab.tasks.fetchCountState)),I=t((e=>h(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:L,isLoading:O,isFetchingMore:Z,hasFetchedAll:q,fetchMore:Te}=Ca();m.useEffect((()=>{const e=setTimeout((()=>Te?.()),0);return()=>clearTimeout(e)})),m.useEffect((()=>{if(O===!1&&Z===!1&&q===!0)if(o?.companyId!=null&&L!=null){const e=`dashboard_${o.companyId}`;V(L.filter((u=>u.roomId===e&&u.readAt==null)).length)}else V(0)}),[O,Z,q]),m.useEffect((()=>{C&&E&&!f&&j.fetchState==="Not-Started"&&F.tenantId!=null&&r(Ze("task_manager","dashboard"))}),[C,E,f,j.fetchState,F.tenantId,r]),m.useEffect((()=>{f||I.fetchState!=="Not-Started"||r(X({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[f,I.fetchState,r]),m.useEffect((()=>{w!=null&&I.fetchState==="In-Progress"&&(r(X({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),r(se({unreadCount:w},"comments")))}),[w,I.fetchState]);const Ie={fetchStatus:Ce,count:Ee},z=s!=null?da.getSignedInUserTenant(s):null,H=t((e=>z?.tenantId!=null?qe(e,z.tenantId):void 0)),b=[];fe===!1&&b.push("accounts_payable_aging"),be===!1&&b.push("accounts_receivable_aging"),b.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&b.push("rewards_card"),R===!1&&b.push("expense_automation_card");const W=t((e=>ze(e,b).fetchState)),Y=t((e=>He(e).fetchState)),ye=A&&(W==="Completed"||W==="Error")||M&&(Y==="Completed"||Y==="Error")||!A&&!M?void 0:"disabled",we=m.useMemo((()=>We(o.userRole)),[o.userRole]),Ae=Ye(we),ve=Ia(),_e=o?.rewardsLastViewedTime==null,De=p?.userEmail!=null&&N.fetchState==="Completed"&&Je(N.notificationSettings,p.userEmail,x,o,E),J=ca(),Be=J&&la(a);return B.jsx(Ea,{container:window.document.body,variant:"temporary",open:l,onClose:()=>i(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:B.jsx(ua,{signedInUser:p,currentTenantId:_.currentTenantId??"",tenants:_.fetchState==="Completed"?me:H!=null?[H]:[],currentTenant:o,isTenantDropdownDisabled:ye,isSettings:Q(a),isInvoicing:fa(a)&&ie==="completed",isSettingsFeatureEnabled:ue,isVendorsTabVisible:Ae,isCustomersTabVisible:ve,isZeniAccountEnabled:de,isChargeCardEnabled:le,isTreasuryEnabled:ke,isNotificationsTabVisible:De,notificationCountDetails:Ie,isExpenseAutomationEnabledForUser:R,selectedMenu:ma(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:_e,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:J,onNotificationIconClick:()=>{i(!1);let e=P===0&&U>0?"notifications/comments":"notifications/tasks";Q(a)&&(e=P===0&&U>0?"../../notifications/comments":"../../notifications/tasks");const u=S(a.state?.pathnameStackToGoBack,a.pathname);n(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{i(!1);const e=S(a.state?.pathnameStackToGoBack,a.pathname);n("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(i(!1),s==null)return;if(e.type==="invoicing")return void n(`../${s}/invoicing/overview`,{state:{pathnameStackToGoBack:S(a.state?.pathnameStackToGoBack,a.pathname),referrer:"Sidebar"}});if(e.type==="ai_cfo"){if(ee.trackAICFOChatScreenStateChanged("viewed","left_menu",G??null,null),!oe)return void ga({location:a,navigate:n,mergeState:{referrer:"Sidebar"}});const y=S(a.state?.pathnameStackToGoBack,a.pathname);return void n(`/${s}/ai-cfo/explore`,{state:{pathnameStackToGoBack:y,referrer:"Sidebar"}})}const u=S(a.state?.pathnameStackToGoBack,a.pathname),K=e.type,Fe=ae(K)&&K!=="command_center";if(ae(e.type)&&g[o.tenantId]!=null&&ee.trackMonthEndCloseClicked(g[o.tenantId].month,g[o.tenantId].year,"Sidebar"),Fe&&g[o.tenantId]!=null){const y=g[o.tenantId];return void n(`/${s}/month_end_close_checks/review/${e.type}/${y.month}-${y.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const $e=Sa(e.type);ka(e.type)?(G!=null&&r(Xe()),n(`/${s}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):n(`/${s}/${$e}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{i(!1),n(`/${s}/settings/my_profile`)},handleReferralsClick:()=>{i(!1),n(`/${s}/rewards`)},handleBackClick:()=>{n(`/${s}/dashboard`)},handleTenantSelect:e=>{re(ba.TENANT_SWITCHING),i(!1),ha({dispatch:r,navigate:n,pathToNavigate:pa(e.tenantEmailDomain,a),selectedTenant:e,signedInUser:p})},onZeniLogoClick:()=>{k.toggle()},isAiCfo:Be,aiCfoView:$,isOnDashboard:A,updateCurrentChatSessionId:e=>{r(Ke({sessionId:e,agentId:"controller"})),n(`/${s}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:he,isTaskManagerAccessEnabled:E,thanksGivingAnimationEnabled:pe,christmasAnimationEnabled:ge,newYearAnimationEnabled:Se})})})),Va=l=>{const i=te(),s=t((k=>ne(k))),a={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(k,n)=>{ea(n)&&xe(n.mode)==="dashboard"&&i(se({unreadCount:n.data.unread},"tasks"))}};return B.jsx(ya,{...l,...a})};export{Va as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-BD_ga8W6.js";import{h as r,l as i}from"./core-Bx5kG7oj.js";import{ak as n}from"./index-DkHntkmh.js";import"./mui-BaMyMAqO.js";import"./sentry-DsaQHQmX.js";import"./zeni-epic-state-CP_8Me3V.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="e1fe4b0b-a509-4443-892f-577d1dfd5036",o._sentryDebugIdIdentifier="sentry-dbid-e1fe4b0b-a509-4443-892f-577d1dfd5036")}catch{}})();const a=i(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(n);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as mt,b as lt,o as ft,j as N}from"./liveblocks-BD_ga8W6.js";import ut from"./NotFoundScreen-oYE2WlvI.js";import{a as k}from"./sentry-DsaQHQmX.js";import{h as ht,g as pt,i as kt,u as gt,j as b,l as bt,n as St,o as z}from"./core-Bx5kG7oj.js";import{cD as It,UZ as O,fJ as X,h6 as Tt,V1 as S,a2q as H,V7 as m,UX as A,B0 as F,GP as Ct,a2r as yt,UW as At,V9 as Et,B5 as _t,a2s as j,br as $,gl as x,B9 as K,a2t as Nt,cQ as Bt,cJ as wt}from"./zeni-epic-state-CP_8Me3V.js";import{ao as xt,c as Ut,p as vt,_ as Dt,aq as Pt,dN as Rt,j as B,dO as Gt,w as Mt,dP as jt,i as $t,a2 as Ft}from"./index-DkHntkmh.js";import"./mui-BaMyMAqO.js";import{u as Vt}from"./useAskAiCfoHostNavButtonProps-B0IAA2LU.js";import{u as Wt}from"./useTaskManagerAccess-CW2xYz9y.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="7a8451bb-871d-40c4-a004-fb1a97c4ea16",t._sentryDebugIdIdentifier="sentry-dbid-7a8451bb-871d-40c4-a004-fb1a97c4ea16")}catch{}})();const qt=(t,l)=>new Promise(((n,h)=>{const g=t.map((c=>new Promise((o=>{l(c),o()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((c=>{h(c)}))})),Jt=bt((function(t,l){const n=O(t),{signedInUser:h,isDebitCardFeatureEnabled:g,isTaskManagerAccessEnabled:c}=l,o=S(t),f=X(t),{currentTab:I}=o;return{notificationView:o,isNotificationSettingsVisible:h.userEmail!=null&&Et(n.notificationSettings,h.userEmail,g,f,c),isDisabled:o.notificationDetailsByTab[I].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:h,loggedInUserRoleMap:g,externalNotificationsUnreadCount:c,allUnreadCommentsNotificationIds:o,navigate:f,markInboxNotificationAsRead:I,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(e,s,d,r)=>{if(r==="task_deleted"){const i=`/${h}/tasks`,T=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}else{const i=`/${h}/tasks/${s}`,T=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}d==="unread"&&t(K("task_manager","read",[e],!1))},onCommentNotificationClick:(e,s,d)=>{const r=s.toString().split(`/${h}/`);if(r[1]!=null){d==="unread"&&(I(e),t(j([e],$())));let i=`/${h}/${r[1]}`;const T=B(n.state?.pathnameStackToGoBack,n.pathname);r[1].startsWith("reimbursement")&&!Bt(g)&&(i="not-found"),r[1].startsWith("bill")&&!wt(g)&&(i="not-found"),f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(e,s)=>{t(A(e,s))},onUpdateNotificationTabState:(e,s)=>{t(m(e,s))},onUpdateNotificationViewCurrentTabAndSubTab:(e,s)=>{t(H(e,s));const d=`../${e}`,r=B(n.state?.pathnameStackToGoBack,n.pathname);f(d,{state:{pathnameStackToGoBack:r}})},onUpdateNotificationViewSubTab:e=>{t(Nt(e))},onFetchMoreNotifications:(e,s)=>{if(e==="tasks"){const d=[];s==="all"?d.push("read","unread"):s!=="mentions"&&d.push(s),t(F("task_manager","dashboard",d))}else v?.()},onUpdateNotificationStatus:(e,s,d,r)=>{e==="tasks"?t(K("task_manager",d,r)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(r.map((i=>{d==="read"&&(I(i),t(j([i],$())))}))).then((()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(A({unreadCount:c-r.length>0?c-r.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:e=>{e==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),qt(o,I).then((()=>{t(j(o,$())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(A({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((s=>{t(m({markAsAllReadState:{fetchState:"Error",error:s}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const e=Ft(n.state?.pathnameStackToGoBack),s=e.poppedPathname??"../../dashboard";f(s,{state:{pathnameStackToGoBack:e.newStack}})},onSettingsClick:()=>{const e=B(n.state?.pathnameStackToGoBack,n.pathname);f("../../settings/notifications",{state:{pathnameStackToGoBack:e}})}}}))(Mt(jt)),Lt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:h}=kt(),{areTenantIdsInSync:g}=xt(),c=It(h??""),o=gt(),f=Ut(),[I,v]=k.useState(!1),e=b((a=>O(a))),s=b((a=>X(a))),{useFeatureGate:d}=vt(),{isFeatureEnabled:r}=d(Dt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:i,onAskAiCfoClick:T}=Vt({mobileExploreReferrer:"Notifications"});Pt({isDataReady:!0});const Y=Tt(s.userRole);if(s==null||n==null||s.companyId==null)throw Error("Can't access notifications page without current tenant...");if(f==null)throw Error("Can't access notifications page without signed in...");const V=b((a=>S(a).notificationDetailsByTab.tasks.fetchState)),W=b((a=>S(a).currentTab)),D=b((a=>S(a).currentSubTab)),tt=b((a=>S(a).notificationDetailsByTab.comments.fetchCountState)),P=b((a=>S(a).notificationDetailsByTab.comments.fetchState)),at=b((a=>S(a).notificationDetailsByTab.comments.uiState.unreadCount)),et=b((a=>S(a).allExternalNotifications)).filter((a=>a.inboxNotification.readAt==null)).map((a=>a.inboxNotification.id)),st=Rt().allUsers,{inboxNotifications:w,isLoading:E,hasFetchedAll:C,isFetchingMore:R,fetchMore:ot}=mt(),{threads:q,isLoading:J,fetchMore:L,isFetchingMore:Q,hasFetchedAll:Z}=lt({query:{metadata:{companyId:s.companyId,application:"dashboard"}}});k.useEffect((()=>{if(W!==c&&c!=null&&o(H(c)),c==null){const a=`../${W}`,p=B(l.state?.pathnameStackToGoBack,l.pathname);t(a,{state:{pathnameStackToGoBack:p}})}}),[c]),k.useEffect((()=>{tt.fetchState==="Not-Started"&&o(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(E===!1&&C===!0&&s?.companyId!=null&&w!=null){const a=`dashboard_${s.companyId}`,p=w.filter((y=>y.roomId===a&&y.readAt==null)).length;o(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(A({unreadCount:p},"comments"))}}),[E,C]),k.useEffect((()=>{V!=="In-Progress"&&g&&o(F("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const a=setTimeout((()=>ot?.()),0);return()=>clearTimeout(a)}));const G=E||R===!0||C!==!0||E||R===!0||C!==!0;k.useEffect((()=>{G&&P!=="In-Progress"?o(m({fetchState:"In-Progress",error:void 0},"comments")):G||P!=="In-Progress"||o(m({fetchState:"Completed",error:void 0},"comments"))}),[G,P]),k.useEffect((()=>{o(A({hasMore:C!==!0},"comments"))}),[C]),k.useEffect((()=>{e.fetchState!=="In-Progress"&&e.fetchState!=="Completed"&&I===!1&&(v(!0),o(Ct()))}),[e.fetchState]),k.useEffect((()=>{if(E===!1&&J===!1&&w!=null&&q!=null){const a=`dashboard_${s.companyId}`,p=w.filter((u=>u.roomId===a)).filter((u=>Gt(u.kind))),y=p.filter((u=>u.readAt==null)),_=p.map((u=>u.id)),ct=p.map((u=>{const M=q.find((dt=>{return dt.id===((U=u).kind==="thread"?U.threadId:"subjectId"in U?U.subjectId:void 0);var U}));return M!=null?{inboxNotification:{...u,threadId:M.id},thread:M}:(Q||Z===!0||L==null||L(),null)})).filter((u=>u!=null));o(m({allNotificationsIds:_},"comments")),o(A({totalCount:_.length,unreadCount:y.length},"comments")),o(yt(ct))}}),[E,R,Q,C,Z,J,w?.length]);const nt={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(a,p)=>{if($t(p)){const y=At(p.mode);if(y==="dashboard"&&o(A({unreadCount:p.data.unread},"tasks")),V!=="In-Progress"){const _=[];D==="all"?_.push("read","unread"):D!=="mentions"&&_.push(D),o(F("task_manager",y,_,!0))}}}},it=ft(),{isTaskManagerAccessEnabled:rt}=Wt(f);return N.jsx(Jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:f,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:r,isTaskManagerAccessEnabled:rt,users:st,markInboxNotificationAsRead:it,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:i,onAskAiCfoClick:T,...nt})};function ma(){return N.jsxs(St,{children:[N.jsx(z,{path:"/:selectedTab",element:N.jsx(Lt,{})}),N.jsx(z,{path:"*",element:N.jsx(ut,{})})]})}export{ma as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-BD_ga8W6.js";import{a as r}from"./sentry-DsaQHQmX.js";import{u as A,g as C,j as o,N as j}from"./core-Bx5kG7oj.js";import{VB as D,fJ as P,gq as V,VC as q,VD as x,VE as z,VF as M,q9 as R,Uf as L}from"./zeni-epic-state-CP_8Me3V.js";import{z as h,af as I}from"./index-DkHntkmh.js";import"./mui-BaMyMAqO.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="047cdbdf-00b5-4a32-9fc6-5d48c284529a",n._sentryDebugIdIdentifier="sentry-dbid-047cdbdf-00b5-4a32-9fc6-5d48c284529a")}catch{}})();function ee(){const n=A(),s=C(),{params:t,error:i}=r.useMemo((()=>D(s.search)),[s.search]),w=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o((e=>P(e))),l=o((e=>V(e))),d=o((e=>e.tenantState.fetchState)),y=o(q),b=o(x),c=o(z),[v,S]=r.useState(null),[E,U]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(M())}),[n,s.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(R(a.userId,a.zeniSessionId??void 0))))}),[f,a,d,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const _=r.useMemo((()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((T=>T.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[p?.tenantId,l]),u=v??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(L(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{U("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-BD_ga8W6.js";import{h as V,u as Y,g as z,i as J,j as d,l as H,n as K,o as S}from"./core-Bx5kG7oj.js";import{fJ as v,AN as R,vq as Q,Wv as w,vl as T,bq as X,c2 as Z,vm as ee,Ww as ae,Wc as C,el as te,EG as se,Wx as oe,F3 as re,e2 as ne,e1 as ce}from"./zeni-epic-state-CP_8Me3V.js";import{ag as ie,z as le,ao as de,aq as me,V as fe,a6 as pe,h as M,aB as ue,j as he,p as Fe,_ as ge}from"./index-DkHntkmh.js";import"./mui-BaMyMAqO.js";import Ie from"./NotFoundScreen-oYE2WlvI.js";import{F as be}from"./FeaturePreviewScreen-DUY6p3ge.js";import{a as F}from"./sentry-DsaQHQmX.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-B0IAA2LU.js";import{u as Ce}from"./useInitialThreadRequest-Dspu5rPv.js";import{t as Te}from"./routePaths-Cxh0_DtI.js";import{M as ye}from"./MobileAppDrawer-DDeilglm.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";import"./InboxNotificationsProvider-Dp-eDJC-.js";import"./useTaskManagerAccess-CW2xYz9y.js";import"./useIsCustomersTabEnabled-BiAWPXPy.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="32114e74-bd0c-4d89-b1c1-fa33f46bd1cd",s._sentryDebugIdIdentifier="sentry-dbid-32114e74-bd0c-4d89-b1c1-fa33f46bd1cd")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=H((function(s){const e=ae(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:M}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=te(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=V(),a=Y(),o=z(),{forecastId:r,tenantEmailDomain:c}=J(),[p,u]=F.useState(!1),[m,x]=F.useState(!1),g=le.getSignedInUser(),A=d((t=>v(t))),_=A.company?.companyInfo.firstMonthOfFY??1,i=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),D=d((t=>t.profitAndLossState)),j=d((t=>t.reportUIOptionsState.selectedForecast)),k=t=>D.pandLByForecastID[t]!=null&&ee(t,D).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=de();me({isDataReady:l});const{isAiCfoAccessEnabled:q,onAskAiCfoClick:N}=Se({mobileExploreReferrer:"Forecast"});F.useEffect((()=>{if(!p&&I)u(!0),l||a(Q());else if(l&&!m){x(!0);const t=((f,E,O)=>E!=null?f.forecasts.findIndex((b=>b.id===E)):O!=null?f.forecasts.findIndex((b=>b.id===O)):f.forecasts.length>0?0:-1)(i,r,j?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=j?.index?(a(w(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!k(i.forecasts[t].id)&&I&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,m,x,R,T,I]);const L=fe(),W=L?.loggedInUserRole!=null&&X(L.loggedInUserRole),B=Ce(A?.companyId,{clearParams:l&&m}),[$,G]=F.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",g?.firstName??""),h.searchParams.set("lastname",g?.lastName??""),h.searchParams.set("email",g?.userEmail??"");const P=t=>{G(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:$,handleDrawerToggle:P}),n.jsx(xe,{firstMonthOfFY:_,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:k,meetingUrl:Z(h.toString()),hasTransactionAccess:W,isAiCfoAccessEnabled:q,onAskAiCfoClick:N,initialOpenThreadRequest:B,onClickMenuIcon:()=>{P(!0)}})]})}function He(){const s=d((c=>v(c))),{useFeatureGate:e}=Fe(),{isFeatureEnabled:a}=e(ge.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(K,{children:[n.jsx(S,{path:"/",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId/*",element:n.jsx(Ie,{})})]})}export{He as default};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-BD_ga8W6.js";import{a as p}from"./sentry-DsaQHQmX.js";import{E as a,a7 as u,ab as f,ac as h}from"./index-DkHntkmh.js";import{s as d}from"./mui-BaMyMAqO.js";import{i as y}from"./core-Bx5kG7oj.js";import"./zeni-epic-state-CP_8Me3V.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.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]="8e7dd9f4-06b5-4f16-8d32-9e3d111e8904",e._sentryDebugIdIdentifier="sentry-dbid-8e7dd9f4-06b5-4f16-8d32-9e3d111e8904")}catch{}})();const g=d("div")`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
width: 100%;
|
|
5
|
-
min-height: 100vh;
|
|
6
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
7
|
-
`,k=d("header")`
|
|
8
|
-
flex-shrink: 0;
|
|
9
|
-
padding: ${a.sp3} ${a.sp4};
|
|
10
|
-
`,b=d(u)`
|
|
11
|
-
width: ${a.sp4};
|
|
12
|
-
height: ${a.sp4};
|
|
13
|
-
color: ${e=>e.theme.colors.brandColorJade};
|
|
14
|
-
`,x=d("main")`
|
|
15
|
-
display: flex;
|
|
16
|
-
flex: 1 1 auto;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
align-items: center;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
padding: ${a.sp4};
|
|
21
|
-
`;function j({children:e}){return r.jsxs(g,{"data-testid":"invoicing-collect-payment-layout",children:[r.jsx(k,{children:r.jsx(b,{"aria-label":"Zeni",role:"img"})}),r.jsx(x,{children:e})]})}class w extends Error{statusCode;constructor(t,o){super(t),this.name="PortalRequestError",this.statusCode=o}}function $(e,t){const o=(function(){const n=h?.invoicingMicroServiceBaseUrl;return`${n!=null&&n.length>0?n:""}/1.0`})(),s={namespace:e,token:t};async function i(n,m){const l=await fetch(`${o}${n}`,{body:JSON.stringify(m),headers:{"Content-Type":"application/json"},method:"POST"}),c=await l.json();if(!l.ok)throw new w(c.status?.message??`Request failed (${l.status}).`,l.status);return c.data}return{checkoutSession:()=>i("/portal/payment-link/checkout-session",s),plaidLinkToken:()=>i("/portal/payment-link/plaid-link-token",s),requestAccess:()=>i("/portal/payment-link/request-access",s),savePaymentMethod:n=>i("/portal/payment-link/payment-methods",{...s,...n}),session:()=>i("/portal/payment-link/session",s),setupIntent:()=>i("/portal/payment-link/setup-intent",s)}}function B(){const{namespace:e="",token:t=""}=y();p.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]);const o=p.useMemo((()=>$(e,t)),[e,t]);return r.jsx(j,{children:r.jsx(f,{portal:o})})}export{B as default};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-BD_ga8W6.js";import{Wr as re,fJ as Y,m4 as _,e2 as q,e1 as le,Te as N,VP as de,Dw as Pe,Ws as Q,Dl as je,DG as Le,DA as ce,Dp as pe,DE as Te,DB as ve,Wt as ue,sM as Ae,ga as Re,gH as Ve,Wu as H,Dt as me,Ds as ge,DJ as Fe,cb as Oe}from"./zeni-epic-state-CP_8Me3V.js";import{$ as fe,p as X,_ as W,z as G,f as he,R as Ce,ad as ye,ax as be,ay as Be,a9 as De,E as F,ae as Se,G as K,az as Ze,ao as Ue,aq as $e,a6 as ze,h as we,Q as He,j as We,aA as _e,V as Ge}from"./index-DkHntkmh.js";import{D as xe,n as M,S as Ie}from"./mui-BaMyMAqO.js";import ae from"./NotFoundScreen-oYE2WlvI.js";import{a as d}from"./sentry-DsaQHQmX.js";import{u as ee,i as Ke,j as g,h as Me,g as Je,l as Qe,n as se,o as z}from"./core-Bx5kG7oj.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-B0IAA2LU.js";import{M as qe}from"./MobileAppDrawer-DDeilglm.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";import"./InboxNotificationsProvider-Dp-eDJC-.js";import"./useTaskManagerAccess-CW2xYz9y.js";import"./useIsCustomersTabEnabled-BiAWPXPy.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]="43a1adfc-0bad-4f95-9660-98724eb9f71a",e._sentryDebugIdIdentifier="sentry-dbid-43a1adfc-0bad-4f95-9660-98724eb9f71a")}catch{}})();const Ne={overlayWidth:new De(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=fe(),m=ee(),[O,B]=d.useState(!1),[k,D]=d.useState(!1),{userId:S}=Ke(),r=g((l=>re(l))),p=g((l=>Y(l))),E=g((l=>_(l))),{useFeatureGate:x}=X(),{isFeatureEnabled:I}=x(W.isDebitCardFeatureEnabled),P=q(I,p),T=le(p),v=N(p),Z=de(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(Q()),b()},A=()=>{O===!0?D(!0):C()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(W.isChargeCardFeatureEnabled),L=he(p,j,I),{isCardsHidden:R}=Ce(p?.tenantId),y=!L||R,V=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:v,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:V===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(ce({peopleLocalData:l})),B(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(v))},onCloseClick:A,isLoading:w||r.person==null},o={onOkClick:()=>{D(!1),C()},onCancelClick:()=>{D(!1)}};return d.useEffect((()=>{w===!1&&S!=null&&m(Pe(S))}),[w,S]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Ee,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Be,{...s})]})})},ea=M(Ie)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,ke=M(Se.H6Regular)`
|
|
6
|
-
margin-top: ${F.sp7};
|
|
7
|
-
padding-left: ${F.sp8};
|
|
8
|
-
padding-right: ${F.sp8};
|
|
9
|
-
color: ${e=>e.theme.colors.primary};
|
|
10
|
-
word-break: break-word;
|
|
11
|
-
`,Ee=M(Se.LargeRegularSp)`
|
|
12
|
-
color: ${e=>e.theme.colors.hero};
|
|
13
|
-
padding-left: ${F.sp8};
|
|
14
|
-
padding-right: ${F.sp8};
|
|
15
|
-
margin-bottom: 30px;
|
|
16
|
-
margin-top: ${F.sp4};
|
|
17
|
-
white-space: pre-line;
|
|
18
|
-
`,aa={overlayWidth:new De(100,100,48)},oe=K.getLocalizedStrings().peoplePage.invitePage,ie=K.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=fe(),m=ee(),[O,B]=d.useState(!1),[k,D]=d.useState(!1),S=g((o=>re(o))),r=g((o=>Y(o))),p=g((o=>_(o))),{useFeatureGate:E}=X(),{isFeatureEnabled:x}=E(W.isDebitCardFeatureEnabled),I=q(x,r),P=le(r),T=N(r),v=de(r),Z=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const w=()=>{b(),m(Q())},C=()=>{O===!0?D(!0):w()},A={onOkClick:()=>{D(!1),w()},onCancelClick:()=>{D(!1)}},$=c.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(W.isChargeCardFeatureEnabled),L=he(r,j,x),{isCardsHidden:R}=Ce(r?.tenantId),y=!L||R,V=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,onPeopleLocalDataUpdated:o=>{m(ce({peopleLocalData:o})),B(!0)},onResetClick:w,onSaveClick:()=>{m(f==="zeni_only"?Te(e):ve())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:p,isReimbursementDisabled:Z===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:V===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:U};return d.useEffect((()=>{S.invitePersonState.fetchState==="Completed"&&(b(),m(Q()))}),[S.invitePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Ee,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:A}):null,a.jsx(Ze,{...s})]})})},ta=M(Ie)`
|
|
19
|
-
display: flex;
|
|
20
|
-
min-height: 100%;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
`,na=Qe((function(e,t){const c=ue(e),n=G.getSignedInUser();return{data:c,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:_(e),analytics:we}}),(function(e,t){const{navigate:c,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,b)=>{e(pe(i,b))},onResendInvite:i=>{e(Fe(i))},onReloadPeople:()=>{e(me()),e(ge(n,f))},onBackClick:()=>{c("../../")},onModeChange:i=>{e(H({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(H({searchText:i}))}}}}))(_e);function J({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const c=Me(),n=ee(),f=Je(),{areTenantIdsInSync:i}=Ue(),b=G.getSignedInUser(),h=g((s=>Y(s))),{useFeatureGate:m}=X(),{isFeatureEnabled:O}=m(W.isDebitCardFeatureEnabled),B=g((s=>_(s))),k=!q(O,h)&&B,D=N(h),S=h?.tenantId,{tenantEmailDomain:r}=h,[p,E]=d.useState(!1),[x,I]=d.useState(!1),[P,T]=d.useState(!1),[v,Z]=d.useState("off"),[U,w]=d.useState(!1),C=s=>{w(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=Ye({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ae(s.classState,s.classListState))),L=g((s=>Re(s.userState,s.userRoleState,s.userListViewState,"manager"))),R=g((s=>Ve(s))),y=h?.companyId;d.useEffect((()=>{p&&v===u.uiState.mode||!i||(n(H({searchText:"",sortKey:"name",sortOrder:"ascending"})),Z(u.uiState.mode),E(!0),n(me()))}),[p,b,S,n,u.uiState.mode,i]),d.useEffect((()=>{y!=null&&i&&n(ge(y,k))}),[y,k,i]),d.useEffect((()=>{I(e!=null&&e===!0),T(t!=null&&t===!0&&t)}),[e,t]),d.useEffect((()=>{n(H({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const V=()=>{I(!1),T(!1),c("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:we,onLoad:s=>s.trackPageLoaded(He.Event.members)}):null,x===!0?a.jsx(sa,{closeDrawerHandler:V,isInvitePeopleDrawerOpen:x,managersListView:L,companyPassportView:R,classListView:j,companyId:y,mode:u.uiState.mode}):null,P===!0?a.jsx(Xe,{closeDrawerHandler:V,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:R,classListView:j,companyId:y,mode:u.uiState.mode}):null,a.jsx(qe,{isAppContentDrawerOpen:U,handleDrawerToggle:C}),a.jsx(na,{navigate:c,signedInUser:b,isZeni:h.isZeni,isZeniTenant:D,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{c("./new")},onColumnSortConfigChanged:(s,o)=>{n(H({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=We(f.state?.pathnameStackToGoBack,f.pathname);c(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function Ea(){const e=Ge();return Oe(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(z,{path:"/",element:a.jsx(J,{})}),a.jsx(z,{path:"new",element:a.jsx(J,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(J,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(z,{path:"*",element:a.jsx(ae,{})})})}export{Ea as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-BD_ga8W6.js";import E from"./NotFoundScreen-oYE2WlvI.js";import{a as r}from"./sentry-DsaQHQmX.js";import{h as _,g as v,j as p,i as M,u as U,N as P,l as z,n as O,o as h}from"./core-Bx5kG7oj.js";import{fJ as Q,a2u as b,bo as B,bn as N,iQ as V,gl as q}from"./zeni-epic-state-CP_8Me3V.js";import{v as F,z as I,aq as J,dQ as $}from"./index-DkHntkmh.js";import"./mui-BaMyMAqO.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-B0IAA2LU.js";import{M as H}from"./MobileAppDrawer-DDeilglm.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";import"./InboxNotificationsProvider-Dp-eDJC-.js";import"./useTaskManagerAccess-CW2xYz9y.js";import"./useIsCustomersTabEnabled-BiAWPXPy.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]="b4515c84-85f5-41db-8331-3f0c22ad4cdc",e._sentryDebugIdIdentifier="sentry-dbid-b4515c84-85f5-41db-8331-3f0c22ad4cdc")}catch{}})();const K=z((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))($),L=()=>{const e=_(),t=v(),c=F(),o=p((a=>Q(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[S,w]=r.useState(!1),C=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return J({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${f}/dashboard`,replace:!0})};function be(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{be as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-BD_ga8W6.js";import z from"./NotFoundScreen-oYE2WlvI.js";import{a as p}from"./sentry-DsaQHQmX.js";import{h as C,g as D,u as V,j as u,N as k,l as O,n as J,o as h}from"./core-Bx5kG7oj.js";import{fJ as E,_y as b,_Q as w,Os as U,Oo as L,Or as f,Oh as N,$d as $,Ol as K,Ou as Q}from"./zeni-epic-state-CP_8Me3V.js";import{z as B,w as T,cd as q,n as _,bW as F,ce as G}from"./index-DkHntkmh.js";import"./mui-BaMyMAqO.js";import{u as H}from"./useEnsureVendorListLoaded-CCsBxqME.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-DE6y72u6.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]="cf5a8ddf-578e-4ecd-9c4e-5df8a36045f3",e._sentryDebugIdIdentifier="sentry-dbid-cf5a8ddf-578e-4ecd-9c4e-5df8a36045f3")}catch{}})();const A="reimbursement-approval-rule-update",M=O((function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e($(!1))},onBackClick:()=>{_(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"))}}}))(T(q)),P=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,y]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>b(o))),g=u((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]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(y(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${A}`]:[],eventCallback:(o,R,j)=>{o.endsWith(A)&&j.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(M,{currentTenant:c,location:n,navigate:s,...m})},I="reimbursement-approval-rule-update",X=O((function(e){const s=b(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(I)&&e($(!1))},onBackClick:()=>{_(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(Q(t,!0))}}}))(T(G)),Y=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=F(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(P,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,y]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),g=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>b(i)));H();const R=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{R?.updateStatus.fetchState==="Completed"&&a(U())}),[R]),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||(y(!0),a(K(!1,!0)))}),[v,g,e,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,o,a]);const j={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${I}`]:[],eventCallback:(i,ee,W)=>{i.endsWith(I)&&W.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(X,{currentTenant:m,location:n,navigate:s,isLoading:e,...j})};function ue(){return r.jsxs(J,{children:[r.jsx(h,{path:"/",element:r.jsx(Y,{})}),r.jsx(h,{path:"/new",element:r.jsx(x,{})}),r.jsx(h,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(h,{path:"*",element:r.jsx(z,{})})]})}export{ue as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as g}from"./liveblocks-BD_ga8W6.js";import{a as y}from"./sentry-DsaQHQmX.js";import{h as U,u as x,g as C,i as V,j as S,l as k}from"./core-Bx5kG7oj.js";import{_Q as _,_y as O,Ok as j,Ox as B,Os as A,Ot as E,_R as F,fJ as z,Or as J}from"./zeni-epic-state-CP_8Me3V.js";import{z as N,a5 as P,c4 as K,n as $,bW as L,c5 as Q}from"./index-DkHntkmh.js";import{u as q}from"./mui-BaMyMAqO.js";import{u as G}from"./useEnsureVendorListLoaded-CCsBxqME.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="631d9e5f-b8c7-4b21-906f-278be091656d",e._sentryDebugIdIdentifier="sentry-dbid-631d9e5f-b8c7-4b21-906f-278be091656d")}catch{}})();const H=k((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=o==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=$(p.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const b=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),I=u.actors.selectedNonUsers.map((m=>{const f=(R=m.value,F(R)==null);var R;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=b.concat(I);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function M(){const e=U(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=q(),r=S((n=>_(n))),l=S((n=>O(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),p(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=k((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:s,vendorNamesById:i,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:O(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=$(p.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const R=f.actorKind?.selectedOption,W=f.selectedRole?.selectedNonUsers??[];let D=[];R==="role"?D=W.map((w=>({type:"attribute",subType:w.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):R==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((w=>({type:"user",subType:void 0,userId:w.userId,idType:"user",isImplicitActor:!1}))));const T=f.action??"require_approval";m.push({action:T,actors:D,operator:D.length>1?T==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const b=v?.selection.selectedOptions??[];b.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:b});const I=h?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:I}),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("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(J(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(Q);function ne(){const e=S((t=>z(t))),{isApprovalRulesV3Enabled:p}=L(e?.tenantId);return p?g.jsx(Y,{}):g.jsx(M,{})}function Y(){const e=U(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=q(),r=S((n=>_(n))),l=S((n=>O(n))),[a,d]=y.useState(!1);if(G(),y.useEffect((()=>{a||(d(!0),p(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t},o??"new")}export{ne as R,se as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-BD_ga8W6.js";import{g as te,h as ve,u as We,i as Ue,j as _,l as Ye,n as xe,o as oe}from"./core-Bx5kG7oj.js";import{fJ as K,ER as S,VO as ze,m4 as ue,uv as he,vk as W,lL as O,lU as D,lM as P,kP as A,kG as E,kF as V,DU as U,vp as ye,bq as Ge,VP as He,bn as Ne,Fd as $e,VQ as qe,VR as Ze,cl as R,DN as ne,VS as re,VT as Qe,VU as Je,VV as Ke,VW as Xe,VX as ea,VY as aa,VZ as sa,V_ as ta,V$ as oa,W0 as na,W1 as ra,W2 as la,W3 as k,W4 as Y,W5 as x,W6 as z,W7 as G,W8 as H,W9 as N,Wa as $,Wb as q,Wc as Z,el as ca,ET as ia,EF as le,EG as ce,EZ as da,EK as ie,bH as j,Wd as de,dk as pe,EL as _e,F3 as pa,We as _a,Wf as fa,Wg as ba,Wh as ma,Wi as ua,Wj as ha,Wk as ya,Wl as Ca,Wm as wa,Wn as ga,e2 as Ra,e1 as Ia}from"./zeni-epic-state-CP_8Me3V.js";import{al as Sa,am as Ta,an as ka,a as ja,$ as Fa,p as Ce,_ as Q,z as we,ao as Oa,V as Da,d as Pa,ap as Aa,aq as Ea,a6 as Va,h as J,Q as Ma,r as La,j as ge,ar as Ba,as as va,at as Wa}from"./index-DkHntkmh.js";import"./mui-BaMyMAqO.js";import Ua from"./NotFoundScreen-oYE2WlvI.js";import{F as Ya}from"./FeaturePreviewScreen-DUY6p3ge.js";import{a as u}from"./sentry-DsaQHQmX.js";import{u as xa}from"./useInitialThreadRequest-Dspu5rPv.js";import{t as fe,a as be,b as za}from"./routePaths-Cxh0_DtI.js";import{t as me}from"./reportTimeframe-CUcsFj60.js";import{M as Ga}from"./MobileAppDrawer-DDeilglm.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";import"./InboxNotificationsProvider-Dp-eDJC-.js";import"./useTaskManagerAccess-CW2xYz9y.js";import"./useIsCustomersTabEnabled-BiAWPXPy.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]="eab7aa62-4650-47d2-9ca4-ec3bdcdaa902",e._sentryDebugIdIdentifier="sentry-dbid-eab7aa62-4650-47d2-9ca4-ec3bdcdaa902")}catch{}})();const Ha=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(Z({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(Y({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0}))},Na=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(wa()),e(ga())},$a=Ye((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=K(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(e),n=He(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:J,isZeniUser:Ne(o),showAccountGroups:n===!0,isAccountingClassesEnabled:ue(e),isAccountingProjectsEnabled:he(e),currentTenantCompanyName:a,statementEndPoint:`${Wa}/statement`,authParams:s,isZeniCOAUsed:n}}),(function(e,o){const{navigate:b,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(W(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(_a(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(pa(a)),s){const{isCompareModeOn:n,filter:r}=o,{additionalBalances:i,balancesRange:d}=r;let c=[...i];a==="year"&&(c=c.filter((p=>p!=="this_period_vs_same_period_last_year"&&p!=="this_period_vs_same_period_last_year_percent"&&p!=="same_period_last_year"))),e(le(o.firstMonthOfFY,n,d.numberOfPeriods<1?1:d.numberOfPeriods,c)),i.length>0&&e(ce(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",d.numberOfPeriods<1?1:d.numberOfPeriods,c))}t!==!0&&setTimeout((()=>h(e)),50)},onInitialDateRangeAvailable:(a,s)=>{const{filter:t}=o,n=me(t.timeframe),r=j(a),i=j(s),d=de(o.firstMonthOfFY,n,{startDate:r,endDate:i})??t.balancesRange.numberOfPeriods,{startOfTimeframeFY:c,endOfTimeframeFY:p}=pe(i,o.firstMonthOfFY,n);e(_e({numberOfPeriods:d,orderBy:t.balancesRange.orderBy,thisPeriod:{startDate:c,endDate:p}}))},onCustomDateRangeChanged:(a,s,t)=>{const{filter:n}=o,r=me(t??n.timeframe);switch(o.selectedReportID){case"profit_and_loss":case"profit_and_loss_by_classes":e(ye(r,void 0,!0,!1,a,s)),o.selectedReportID==="profit_and_loss_by_classes"&&o.isAccountingClassesEnabled&&e(ne());break;case"profit_and_loss_by_projects":o.isAccountingProjectsEnabled&&e(U());break;case"balance_sheet":e(V(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(V(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(E());break;case"balance_sheet_by_projects":e(V(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(A());break;case"cash_flow":e(O(r,!0,a,s));break;case"cash_flow_by_classes":e(O(r,!0,a,s)),o.isAccountingClassesEnabled&&e(P());break;case"cash_flow_by_projects":e(O(r,!0,a,s)),o.isAccountingProjectsEnabled&&e(D())}const i=j(a),d=j(s),c=de(o.firstMonthOfFY,r,{startDate:i,endDate:d})??n.balancesRange.numberOfPeriods,{startOfTimeframeFY:p,endOfTimeframeFY:M}=pe(d,o.firstMonthOfFY,r);e(_e({numberOfPeriods:c,orderBy:n.balancesRange.orderBy,thisPeriod:{startDate:p,endDate:M}})),h(e)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(I(a)||R(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ie({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(re({classViewLayout:"vertical"})),h(e)},onCOABalancesRangeChanged:(a,s)=>{e(ie(a,s)),h(e)},onThisPeriodChanged:(a,s,t)=>{e(da(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&h(e)},onAdditionalBalanceSelectionChanged:(a,s,t,n)=>{e(le(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ce(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),n!==!0&&o.isCompareModeOn===a||setTimeout((()=>h(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,n)=>{e(ia({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:n}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let n,r;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(n=s.balanceTimeFrame,r=ca(s)):s.balanceTimeFrame==="year"?(n="quarter",r={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),r!=null&&n!=null){const i=a.accountName===""?a.accountDescription:a.accountName,d=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return be(o.tenantEmailDomain,a.accountId,a.accountType,s.id,i,n,r)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?za(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,i,n,r):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?be(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],i,n,r):a.accountType!=null?fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r):void 0})();if(d!=null){const c=ge(o.location.state?.pathnameStackToGoBack,o.location.pathname);b(d,{state:{pathnameStackToGoBack:c,referrer:F(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Z({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(q({scrollPosition:s}));break;case"profit_and_loss_by_projects":e($({scrollPosition:s}));break;case"balance_sheet":e(N({scrollPosition:s}));break;case"balance_sheet_by_classes":e(H({scrollPosition:s}));break;case"balance_sheet_by_projects":e(G({scrollPosition:s}));break;case"cash_flow_by_classes":e(z({scrollPosition:s}));break;case"cash_flow_by_projects":e(x({scrollPosition:s}));break;case"cash_flow":e(Y({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(Z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{b("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,n=I(t),r=R(t);r?(e(sa({viewMode:a})),e(ta({viewMode:a}))):n?(e(oa({viewMode:a})),e(na({viewMode:a}))):(e(ra({viewMode:a})),e(la({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",F(t)),e(k(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",F(t)),e(k(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",F(t)),e(k(r?"cash_flow":n?"balance_sheet":"profit_and_loss"))),h(e)},onUpdateClassesToFilterOut:a=>{R(o.selectedReportID)?e(Xe({classesToFilterOut:a})):I(o.selectedReportID)?e(ea({classesToFilterOut:a})):e(aa({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{R(o.selectedReportID)?e(Qe({projectsToFilterOut:a})):I(o.selectedReportID)?e(Je({projectsToFilterOut:a})):e(Ke({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=R(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?E():ne()),o.isAccountingProjectsEnabled&&e(s?D():a?A():U())},onUpdateDisplayOrder:a=>{e(Ze(a))},onUpdateReportFormat:a=>{Na(e),e(qe(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"?$e(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):D(!0):P(!0):A(!0):E(!0))}}}))(Ba);function qa(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ja(),b=Fa(),m=va(b),a=ve(),s=We(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(Q.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(Q.isReportsCustomDateRangeEnabled),c=we.getSignedInUser(),[p,M]=u.useState(!1),[X,Re]=u.useState(!1);if(c==null)throw Error("Can't access reports page without signing in...");const L=_((l=>K(l))),Ie=L.masterTOSInfo?.isMasterTOSAccepted??!1,Se=L.company?.companyInfo.firstMonthOfFY??1,Te=xa(L?.companyId),w=_((l=>S(l).fetchState)),ke=_((l=>ze(l))),{areTenantIdsInSync:y}=Oa(),B=_((l=>l.financeStatementState.selectedReportId)),T=_((l=>ue(l))),g=_((l=>he(l))),je=_((l=>S(l).isCompareModeOn)),C=_((l=>S(l).filter)),v=_((l=>S(l).selectedReportAndTimeframeFetchState)),Fe=_((l=>l.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!p&&y&&(M(!0),s(W(c.userId,!0,!0,!1)))}),[p,c,s,y]),u.useEffect((()=>{p&&!X&&w==="Completed"&&y&&(s(W(c.userId,!1,!0,!1)),Re(!0))}),[p,X,w,y]),u.useEffect((()=>{if(p&&v.fetchState==="Not-Started"&&C.timeframe!=="free_range"&&C.timeframe!=="week"&&y)switch(B){case"profit_and_loss":case"profit_and_loss_by_classes":s(ye(C.timeframe));break;case"profit_and_loss_by_projects":g&&s(U());break;case"balance_sheet":s(V(C.timeframe));break;case"balance_sheet_by_classes":T&&s(E());break;case"balance_sheet_by_projects":g&&s(A());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":g&&s(D());break;case"cash_flow":s(O(C.timeframe))}}),[p,B,v,y,T,g]);const ee=Da(),Oe=ee?.loggedInUserRole!=null&&Ge(ee?.loggedInUserRole)!==!0,[De,Pe]=u.useState(!1),ae=l=>{Pe(l)},Ae=Pa(),Ee=Aa();return(function(l){const{isDataReady:Ve}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Le=Ta(Ve),Be=u.useMemo((()=>se?Ha:void 0),[se]);ka({canFetchSuggestedQuestions:Le,pageContexts:Be})})({isDataReady:w==="Completed"}),Ea({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Va,{analytics:J,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Ga,{isAppContentDrawerOpen:De,handleDrawerToggle:ae}),f.jsx($a,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:Fe,selectedReportID:B,analytics:J,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:je,hasTransactionAccess:Oe,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:ke.reportsResyncFetchState,isAiCfoAccessEnabled:Ee&&Ae&&!e,onAskAiCfoClick:()=>{if(Ie)if(m){const l=ge(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else La({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const F=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 Cs(){const e=_((s=>K(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(Q.isDebitCardFeatureEnabled),m=Ra(b,e),a=Ia(e);return m===!0||a===!0?f.jsx(Ya,{}):f.jsxs(xe,{children:[f.jsx(oe,{path:"/",element:f.jsx(qa,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{Cs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-BD_ga8W6.js";import{z as b,a6 as N,h as u,Q as S,e8 as k,p as C,_ as I}from"./index-DkHntkmh.js";import"./mui-BaMyMAqO.js";import g from"./NotFoundScreen-oYE2WlvI.js";import{a as c}from"./sentry-DsaQHQmX.js";import{u as D,j as h,h as F,g as L,l as _,n as T,o as f,N as y}from"./core-Bx5kG7oj.js";import{fJ as U,a3r as w,a3s as p,Ew as P,qi as V,a3t as q,Eu as z}from"./zeni-epic-state-CP_8Me3V.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.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]="117f432d-9c6d-47e3-89ef-d2b3c417f0bb",e._sentryDebugIdIdentifier="sentry-dbid-117f432d-9c6d-47e3-89ef-d2b3c417f0bb")}catch{}})();const G=_((function(e,t){const n=w(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(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),J=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>U(o))),l=F(),j=L(),d=b.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),x=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:l,location:j,currentTenant:r,companyName:E,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=C(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(J,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-oYE2WlvI.js","assets/sentry-DsaQHQmX.js","assets/core-Bx5kG7oj.js","assets/zeni-epic-state-CP_8Me3V.js","assets/index-DkHntkmh.js","assets/mui-BaMyMAqO.js","assets/analytics-CzizEiux.js","assets/utils-Rng1Um8N.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-BsicDORh.js","assets/withTransactionSidePanel-DTG3VL6U.js","assets/useAskAiCfoHostNavButtonProps-B0IAA2LU.js","assets/TransactionDetailScreen-DPXvNf-7.js","assets/decodeURIComponentSafe-DMAtWdNT.js","assets/useInitialThreadRequest-Dspu5rPv.js","assets/routePaths-Cxh0_DtI.js","assets/expenseAutomationHelper-CAr9eXjQ.js","assets/stripSplatSuffix-B3Bc_avB.js","assets/useIsCustomersTabEnabled-BiAWPXPy.js","assets/reportTimeframe-CUcsFj60.js","assets/analyticsHelper-jqkqthAa.js","assets/CompanyPassportScreen-B9QeqdTn.js","assets/MobileAppDrawer-DDeilglm.js","assets/InboxNotificationsProvider-Dp-eDJC-.js","assets/useTaskManagerAccess-CW2xYz9y.js","assets/useAiCfoDashboardSuggestedQuestionsChips-COa1RGwu.js","assets/FeaturePreviewScreen-DUY6p3ge.js","assets/BillPayRoutes-DR1qovIJ.js","assets/AddressScreen-CpY6qzLi.js","assets/DomesticWireDetailScreen-C3YIjUYE.js","assets/BusinessVerificationPageScreen-Byhif9Ma.js","assets/DrawerScreen-C86vnRJz.js","assets/SetupPagesScreen-UjK2D0Rv.js","assets/BillPayApprovalRoutes-FZbtoTk1.js","assets/useEnsureVendorListLoaded-CCsBxqME.js","assets/ReimbursementApprovalRuleDetailScreen-DE6y72u6.js","assets/getLocaleForTenant-Cvq70l-z.js","assets/ReimbursementRoutes-IyEE77RL.js","assets/ReimbursementApprovalRoutes-DfYqyG3t.js","assets/TransactionListRoutes-CL-K7ix6.js","assets/ZeniAccountStatementScreen-B-69HKZM.js","assets/SettingsRoutes-B8qt67Bj.js","assets/AccountMappingScreen-o9UNAAN2.js","assets/QBOConnectionScreen-BwiFGkNK.js","assets/empty-Cn912Jag.js","assets/index-CtJA2cwC.js","assets/url-DAJdS_e6.js","assets/index-bKm528DW.js","assets/accountMappingHelper-FvEDI2O0.js","assets/useEmailConnectResultRefresh-df266Q2H.js","assets/ReportsRoutes-CAjdNb2Z.js","assets/ChargeCardRoutes-CkebfhOF.js","assets/useChargeCardPusherEvents-jDlyzqdm.js","assets/PeopleRoutes-BadtTp85.js","assets/ExpenseAutomationRoutes-D5mOe8NQ.js","assets/useActualMatchingMatchDetail-iGCUO44-.js","assets/ScheduleDetailsPrepaidExpensesScreen-COClCOXU.js","assets/pathToGoBack-BzRgSVEC.js","assets/TreasuryRoutes-B7-wS8Oy.js","assets/VendorsRoutes-uW7VJmDE.js","assets/ZeniAccountRoutes-DPX2T0Kt.js","assets/AddressRoutes-CTXOzi6Q.js","assets/PandLWithForecastRoutes-C8BIa_6t.js","assets/CustomerOnboardingRoutes-N9fmUi4M.js","assets/CustomersRoutes-BPgppFga.js","assets/TransactionDetailRoutes-Brl4E-L9.js","assets/EntityDetailRoutes-A4ws8Hyd.js","assets/InvoicingRoutes-CN-eG_gg.js","assets/NotificationRoutes-CebTwOdA.js","assets/PerformanceRoutes-CELeTcmt.js","assets/ActualMatchingMatchDetailScreen-Bq4tInFn.js","assets/RewardsRoutes-B5s3qeYK.js","assets/TaskRoutes-YSc8SAKu.js","assets/TaskListScreen-2_ij-Yu1.js","assets/useTaskManagerPusherEvents-UN1wlS1b.js","assets/AiCfoScreen-CeSkAjuX.js","assets/CardsAiCfoScreen-DuMDy2QA.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as s,bn as Es,fJ as ps,e2 as xs,e1 as gs,BC as Rs,dm as js,cb as Is,gN as Ts,gd as As,dj as pe,cK as bs,gr as fs,cB as Ds,bH as ys,br as vs,Va as Cs,v as Os,Vd as Ps,bq as Us,Ve as ws,bN as Fs,bM as Vs,bv as Ls,cx as Hs,Vf as ks,Vg as Bs,de as Ss,dh as Ns,dg as Ms,cJ as Zs,cQ as $s,q9 as xe,gm as ge,h1 as zs,go as Re,gP as je,gQ as Ie,gp as Gs}from"./zeni-epic-state-CP_8Me3V.js";import{j as e}from"./liveblocks-BD_ga8W6.js";import{a as U}from"./sentry-DsaQHQmX.js";import{N as u,u as qs,h as Ys,i as Js,g as Ws,j as $,q as Te,n as Ks,o as n}from"./core-Bx5kG7oj.js";import{J as l,u as Qs,z as y,p as Xs,d as et,K as st,_ as S,f as tt,R as nt,V as at,L as F,G as Ae,t as _,P as ot,N as rt,h as ne}from"./index-DkHntkmh.js";import{u as it}from"./mui-BaMyMAqO.js";import{f as be}from"./analyticsHelper-jqkqthAa.js";import{t as lt}from"./getLocaleForTenant-Cvq70l-z.js";import{u as ut}from"./useIsCustomersTabEnabled-BiAWPXPy.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new o.Error().stack;f&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[f]="285861d0-3e63-45a2-8f7c-091b98382bb5",o._sentryDebugIdIdentifier="sentry-dbid-285861d0-3e63-45a2-8f7c-091b98382bb5")}catch{}})();const dt=l((()=>s((()=>import("./NotFoundScreen-oYE2WlvI.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ct=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),mt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:f,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(De,{tenantEmailDomain:C});if(i)return e.jsx(fe,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(De,{tenantEmailDomain:C}):i?e.jsx(fe,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):f?e.jsx(mt,{tenantEmailDomain:C}):N?e.jsx(ct,{tenantEmailDomain:C}):e.jsx(dt,{})},_t={dashboard:()=>s((()=>import("./DashboardRoutes-BsicDORh.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,18,0,19,20,21,22,23,24,25,26,8])),bills:()=>s((()=>import("./BillPayRoutes-DR1qovIJ.js")),__vite__mapDeps([27,1,2,3,4,5,6,7,28,0,29,11,14,30,15,22,23,24,18,31,26,32,20,33,34,35,36,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-IyEE77RL.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,0,32,30,15,22,23,24,18,20,26,11,14,31,38,34,35,36,8])),transactions:()=>s((()=>import("./TransactionListRoutes-CL-K7ix6.js")),__vite__mapDeps([39,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,40,8])),settings:()=>s((()=>import("./SettingsRoutes-B8qt67Bj.js")),__vite__mapDeps([41,1,2,3,4,5,6,7,24,42,22,23,18,43,44,45,46,47,13,48,28,0,20,30,15,21,49,33,34,35,38,8])),reports:()=>s((()=>import("./ReportsRoutes-CAjdNb2Z.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,26,14,15,19,22,23,24,18,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-CkebfhOF.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,11,22,23,24,18,32,30,15,0,20,14,52,28,8])),people:()=>s((()=>import("./PeopleRoutes-BadtTp85.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,0,11,22,23,24,18,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-D5mOe8NQ.js")),__vite__mapDeps([54,1,2,3,0,4,5,6,7,11,12,13,14,15,16,55,17,10,56,57,48,31,8])),treasury:()=>s((()=>import("./TreasuryRoutes-B7-wS8Oy.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,0,32,30,15,22,23,24,18,20,11,14,26,8])),vendors:()=>s((()=>import("./VendorsRoutes-uW7VJmDE.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,28,0,26,56,57,55,17,13,15,11,22,23,24,18,31,48,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-DPX2T0Kt.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,0,32,30,15,22,23,24,18,20,26,29,28,11,40,8]))},ht=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},Et=l((()=>s((()=>import("./ReportsRoutes-CAjdNb2Z.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,26,14,15,19,22,23,24,18,8])))),pt=l((()=>s((()=>import("./AddressRoutes-CTXOzi6Q.js")),__vite__mapDeps([61,1,2,3,28,4,5,6,7,0,8])))),xt=l((()=>s((()=>import("./PeopleRoutes-BadtTp85.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,0,11,22,23,24,18,8])))),gt=l((()=>s((()=>import("./PandLWithForecastRoutes-C8BIa_6t.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,0,26,11,14,15,22,23,24,18,8])))),Rt=l((()=>s((()=>import("./CustomerOnboardingRoutes-N9fmUi4M.js")),__vite__mapDeps([63,1,2,3,28,4,5,6,7,0,43,44,45,46,47,13,49,52,8])))),jt=l((()=>s((()=>import("./VendorsRoutes-uW7VJmDE.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,28,0,26,56,57,55,17,13,15,11,22,23,24,18,31,48,8])))),It=l((()=>s((()=>import("./CustomersRoutes-BPgppFga.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,15,0,11,22,23,24,18,8])))),Tt=l((()=>s((()=>import("./TransactionDetailRoutes-Brl4E-L9.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,13,34,12,11,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-A4ws8Hyd.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,18,8])))),At=l((()=>s((()=>import("./DashboardRoutes-BsicDORh.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,18,0,19,20,21,22,23,24,25,26,8])))),Ce=l((()=>s((()=>import("./BillPayRoutes-DR1qovIJ.js")),__vite__mapDeps([27,1,2,3,4,5,6,7,28,0,29,11,14,30,15,22,23,24,18,31,26,32,20,33,34,35,36,8])))),bt=l((()=>s((()=>import("./SettingsRoutes-B8qt67Bj.js")),__vite__mapDeps([41,1,2,3,4,5,6,7,24,42,22,23,18,43,44,45,46,47,13,48,28,0,20,30,15,21,49,33,34,35,38,8])))),ft=l((()=>s((()=>import("./InvoicingRoutes-CN-eG_gg.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,28,0,22,23,24,18,43,44,45,46,47,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-IyEE77RL.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,0,32,30,15,22,23,24,18,20,26,11,14,31,38,34,35,36,8])))),Dt=l((()=>s((()=>import("./ZeniAccountRoutes-DPX2T0Kt.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,0,32,30,15,22,23,24,18,20,26,29,28,11,40,8])))),yt=l((()=>s((()=>import("./TreasuryRoutes-B7-wS8Oy.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,0,32,30,15,22,23,24,18,20,11,14,26,8])))),vt=l((()=>s((()=>import("./TransactionListRoutes-CL-K7ix6.js")),__vite__mapDeps([39,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,40,8])))),Ct=l((()=>s((()=>import("./ChargeCardRoutes-CkebfhOF.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,11,22,23,24,18,32,30,15,0,20,14,52,28,8])))),Ot=l((()=>s((()=>import("./NotificationRoutes-CebTwOdA.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,11,24,8])))),Pt=l((()=>s((()=>import("./PerformanceRoutes-CELeTcmt.js")),__vite__mapDeps([69,1,2,3,0,4,5,6,7,11,22,23,24,18,8])))),Ut=l((()=>s((()=>import("./ExpenseAutomationRoutes-D5mOe8NQ.js")),__vite__mapDeps([54,1,2,3,0,4,5,6,7,11,12,13,14,15,16,55,17,10,56,57,48,31,8])))),wt=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-Bq4tInFn.js")),__vite__mapDeps([70,1,2,3,4,5,6,7,55,17,13,15,0,8])))),Ft=l((()=>s((()=>import("./RewardsRoutes-B5s3qeYK.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,0,8])))),Vt=l((()=>s((()=>import("./TaskRoutes-YSc8SAKu.js")),__vite__mapDeps([72,1,2,3,0,4,5,6,7,14,22,23,24,18,73,11,74,8])))),Lt=l((()=>s((()=>import("./AiCfoScreen-CeSkAjuX.js")),__vite__mapDeps([75,1,2,3,4,5,6,7,25,57,15,74,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-DuMDy2QA.js")),__vite__mapDeps([76,1,2,3,4,5,6,7,8])))),I=l((()=>s((()=>import("./NotFoundScreen-oYE2WlvI.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ht=l((()=>s((()=>import("./TaskListScreen-2_ij-Yu1.js").then((o=>o.f))),__vite__mapDeps([73,1,2,3,4,5,6,7,11,22,23,24,18,74,8])))),kt=({isDashboardAccess:o,showZeniAccountRoute:f,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:H})=>{if(O===!0){if(f)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return C===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):f?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),Yt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const f=qs(),N=Ys(),{tenantEmailDomain:i}=Js(),L=it().mode,{setLoading:O,clearAllLoading:C,clearLoading:H}=Qs(),D=y.getSignedInUserTenant(i)?.tenantId,T=y.getSignedInUser(),W=Es(T),z=Ws(),[V,we]=U.useState(!1),r=$((a=>ps(a))),{useFeatureGate:k}=Xs(),M=et(),K=st(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Ve=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Le}=k(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=k(S.isDebitCardFeatureEnabled),A=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||A==="Completed"?xs(oe,r):void 0,Q=p==="Completed"||A==="Completed"?gs(r):void 0,re=p==="Completed"||A==="Completed"?Rs(r)&&!js(r):void 0,He=tt(r,Le,oe),{isCardsHidden:ke}=nt(r?.tenantId),Be=!He||!!ke,{isFeatureEnabled:Se}=k(S.isSettingsFeatureEnabled),{isFeatureEnabled:X}=k(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=k(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||rt==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),G=$((a=>Ts(a)));if(i!=null){const a=y.getSignedInUserTenant(i);T!=null&&a!=null&&be(T,r,L)}const Z={tenantId:D,userId:T?.userId,sessionId:T?.zeniSessionId},ie=As(),E=at(),$e=ut(r.company==null),ze=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ge=bs(E?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,qe=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=qe?.params.selectedPeriod,Ye=$((a=>Z.tenantId!=null?fs(a,Z.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),U.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const b=Ds(Number(a[0])),c=Number(a[1]),t=ys(`01-${b<10?`0${b}`:b}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=vs();t.isAfter(d,"month")===!1?f(Cs(D,{month:b,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,D]),U.useEffect((()=>{V||(we(!0),O(F.TENANT_FETCHING))}),[V,Z,ie,T,f,y]),U.useLayoutEffect((()=>{!Os(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,b,c,t){if(ge(b?.userId,b?.zeniSessionId,a.tenantId),c(zs(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(lt(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,T,f,Ye))}),[D]),U.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,b,c,t,d,q,B){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const Y=t!=null&&d?.zeniSessionId!=null,ms=c==null||c.tenantId!==t,_s=c!=null&&c.excludedResources==null,hs=c!=null&&c.externalConnections==null;if(Y&&ms){B(Re(t));const J=y.getSignedInUserTenantWithId(t);J?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(Ie(d.userId,t)))}else Y&&_s&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(je(d.userId,t))),Y&&hs&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(Ie(d.userId,t)));if(Y){ne.identify(d.userId,{tenant_id:t});const J=t==null||t!=null&&(b==="Completed"||b==="Error");a==="Completed"||b!=="Not-Started"&&b!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),B(Gs(d.userId,t,d.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(A,p,r,D,T,O,f))}),[D,p]),U.useEffect((()=>{y.isSignedIn()&&A==="Completed"&&G.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),y.saveSignedInUserTenants(Ps(G.tenantsBaseInOrder)),T!=null&&be(T,r,L,void 0,G.tenantsBaseInOrder))}),[G,A,r,T]),U.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(C(),_.markActiveTenantFetchCompleted(D)):p==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[p,A,D,V]);const le=U.useRef(!1);U.useEffect((()=>{!le.current&&p==="Completed"&&V&&(le.current=!0,(function(a=ht,b=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=_t[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),b)})())}),[p,V]);const P=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:Je}=k(S.isReferralFeatureEnabled),{isFeatureEnabled:We}=k(S.isAccrualEnabled),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,de=!Be&&!P,Xe=ws(E?.loggedInUserRoleMap),es=r.externalConnections?.accounting[0]?.isValid,ss=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&Fs(E?.loggedInUserRoleMap),_e=Fe&&!P,ts=Ve&&!P,ns=ue&&Vs(E?.loggedInUserRoleMap),as=de&&Ls(E?.loggedInUserRoleMap),os=_e&&Hs(E?.loggedInUserRoleMap),rs=ks(E?.loggedInUserRoleMap),is=Bs(E?.loggedInUserRoleMap),ls=Ss(E?.loggedInUserRoleMap),us=Ns(E?.loggedInUserRoleMap),ds=Ms(E?.loggedInUserRoleMap),x=Zs(E?.loggedInUserRoleMap),g=$s(E?.loggedInUserRoleMap),he=ue&&x,Ee=ce&&g,R=_e&&ls,j=ts&&us,m=de&&ds,cs=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||Ge===!0||Xe===!0||rs===!0||is===!0;return y.isSignedIn()?D==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(T!=null&&A!=="In-Progress"&&f(xe(T.userId,T.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||A==="Completed"?(te===!0||W&&!ee)&&ss&&es!==!0&&h===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||re!==!0||te!==!0||ee||W?!V||te!==!1||ee||W?V&&r?.userRole&&h!=null&&Q!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(ot,{}),children:[e.jsx(n,{path:"/",element:e.jsx(kt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(At,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(Et,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:cs||w?e.jsx(xt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(gt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(Rt,{})}),e.jsx(n,{path:"transaction/*",element:w&&P===!1||Ke||Qe?e.jsx(Tt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&P===!1?e.jsx(vt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&P===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:h,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&P===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ht,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Vt,{})}),e.jsx(n,{path:"address/*",element:ns||me||os||as?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(Dt,{}):e.jsx(I,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(yt,{}):e.jsx(I,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Pt,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&P===!1?e.jsx(Ut,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&P===!1&&We===!0?e.jsx(wt,{}):e.jsx(I,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(Ot,{})}),e.jsx(n,{path:"vendors/*",element:ze?e.jsx(jt,{}):e.jsx(I,{})}),e.jsx(n,{path:"customers/*",element:$e?e.jsx(It,{}):e.jsx(I,{})}),e.jsx(n,{path:"bill/*",element:he?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:he?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(bt,{hasAdminLevelAccess:me}):e.jsx(I,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(ft,{}):e.jsx(I,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:X}):e.jsx(I,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:X}):e.jsx(I,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Ct,{}):e.jsx(I,{})}),e.jsx(n,{path:"rewards/*",element:Je?e.jsx(Ft,{}):e.jsx(I,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(I,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(I,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(Lt,{isFileUploadEnabled:X}):e.jsx(I,{})}),e.jsx(n,{path:"*",element:e.jsx(I,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,Yt as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-BD_ga8W6.js";import{a as f,R as T,t as A}from"./sentry-DsaQHQmX.js";import{u as z,h as D,j as l,g as V,N as j,l as M}from"./core-Bx5kG7oj.js";import{u as O,z as s,h as E,G as F,O as P,Q as _,S as B,T as N,U as J,W as v}from"./index-DkHntkmh.js";import{fJ as W,UV as $,Vd as Q,gm as R,go as Z,Vj as G,gZ as H,dn as q,Vk as y,Vl as K,Vm as X,c2 as b}from"./zeni-epic-state-CP_8Me3V.js";import{u as Y}from"./mui-BaMyMAqO.js";import{u as ee}from"./useDeviceId-BviPVfDF.js";import{f as te}from"./analyticsHelper-jqkqthAa.js";import{t as ne}from"./getLocaleForTenant-Cvq70l-z.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="9e4ce2cb-8042-4473-a4d5-ba5e4bad31b2",t._sentryDebugIdIdentifier="sentry-dbid-9e4ce2cb-8042-4473-a4d5-ba5e4bad31b2")}catch{}})();const ie=M((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(X({authCode:n,oauthProvider:a,appType:"web",redirectUri:b(c),sourceUri:b(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(K(n,a)))},clearSignInError:()=>{t(y())}}}))(J),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=O(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:U,accountUnlockTime:h}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>W(e))),I=l((e=>$(e))),m=V(),w=Y().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(Q(I.tenantsInOrder),o.zeniSessionId),R(o.userId,o.zeniSessionId,r.tenantId),i(Z(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),H().then((()=>{const e=N();e!=null&&P(e)})),setTimeout((()=>{E.trackLogin(_.Event.loginSuccess,o.authProvider??"google",q(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(j,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&h!=null?u.jsx(B,{onClose:()=>i(y()),unlockDate:h}):null]})}export{ve as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-BD_ga8W6.js";import{a as i}from"./sentry-DsaQHQmX.js";import{u as c,g as d,N as u}from"./core-Bx5kG7oj.js";import{z as n,h as a,Q as m,a5 as p}from"./index-DkHntkmh.js";import{h0 as g,VA as y}from"./zeni-epic-state-CP_8Me3V.js";import{n as b}from"./mui-BaMyMAqO.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.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]="125a3212-efea-40f7-b044-de983b5c0122",e._sentryDebugIdIdentifier="sentry-dbid-125a3212-efea-40f7-b044-de983b5c0122")}catch{}})();function P(){const e=c(),t=d(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`;export{P as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-BD_ga8W6.js";import fe from"./NotFoundScreen-oYE2WlvI.js";import{a as k}from"./sentry-DsaQHQmX.js";import{h as ee,u as ae,j as g,g as ge,i as he,N as be,l as Ee,n as De,o as h}from"./core-Bx5kG7oj.js";import{QN as se,QQ as Ie,QK as Ce,a3u as Re,fJ as te,a3v as ne,Rc as E,R2 as b,QH as _e,RH as ye,RA as Ae,a3w as oe,gl as ie,a3x as W,a3y as Ge,QD as ve,QA as Ue,vg as xe,v4 as we,mE as Be,R0 as je,a3z as Pe,RT as Fe,QY as Ke,Rm as Le,Rj as Ne,QT as $e,Rg as Qe,Rb as Ze}from"./zeni-epic-state-CP_8Me3V.js";import{z as D,e9 as ze,v as Oe,p as Ve,_,a2 as re,j as y,a6 as qe,h as Y,Q as Me,ea as He,W as J,ac as We}from"./index-DkHntkmh.js";import{n as Ye}from"./mui-BaMyMAqO.js";import{u as Je}from"./useInitialThreadRequest-Dspu5rPv.js";import{M as Xe}from"./MobileAppDrawer-DDeilglm.js";import{T as m,t as ea,b as aa,a as sa,c as ta,d as X,e as na}from"./TaskListScreen-2_ij-Yu1.js";import{u as oa}from"./useTaskManagerPusherEvents-UN1wlS1b.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";import"./InboxNotificationsProvider-Dp-eDJC-.js";import"./useTaskManagerAccess-CW2xYz9y.js";import"./useIsCustomersTabEnabled-BiAWPXPy.js";import"./useAskAiCfoHostNavButtonProps-B0IAA2LU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="3d74fb55-cb7d-4ba6-900d-539333596ba1",e._sentryDebugIdIdentifier="sentry-dbid-3d74fb55-cb7d-4ba6-900d-539333596ba1")}catch{}})();function ia(){const e=ee(),a=ae(),n=D.getSignedInUser(),{cannedResponses:c,fetchState:t,saveFetchState:l}=g((i=>i.cannedResponsesState)),d=k.useCallback((()=>{a(se())}),[a]),S=k.useCallback(((i,I,C)=>{a(Ie({name:i,content:I,cannedResponseId:C}))}),[a]),s=k.useCallback((i=>{a(Ce({cannedResponseId:i}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(ze,{cannedResponses:c,isLoading:t==="In-Progress"||t==="Not-Started",isSaving:l==="In-Progress",onBackClick:()=>e(-1),onDelete:s,onFetch:d,onSave:S})}const L=e=>e?.taskState?.taskByID,F=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},ra=Re([F,(e,a)=>{const n=F(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=F(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}})),ca=Ee((function(e,a){const{location:n,taskGroupId:c}=a,t=oe(e,a.taskId),l=te(e),d=ra(e,a.taskId),S=t.taskGroupId??c,s=S!=null?W(e.taskGroupState,S):void 0,i=D.getSignedInUser(),I=l.tenantId,C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:I??""},U=ne(e),{tenantEmailDomain:x}=l,A=t.recurringSourceTaskId,w=A!=null?`${J.appUrl}/${x}/tasks/${encodeURIComponent(A)}`:void 0;return{taskDetailSelectorView:t,authParams:C,isZeniUser:D.isZeniUser(),userGroupList:Ge(e),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:We.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${J.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:w,tagListView:U,taskGroupName:S!=null&&s!=null&&s.isDefault===!1?s.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((T=>W(e.taskGroupState,T))).filter((T=>T!=null&&!T.isDeleted)).map((T=>({id:T.id,name:T.name,isDefault:T.isDefault}))),subtasks:t.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:t,location:l,taskGroupId:d}=a,{tenantEmailDomain:S}=t;return{onSaveChangesToLocalStore:s=>{e(Ze({taskDetailLocalData:s,taskId:n}))},onSaveDetailClick:s=>{e(Qe(n,s??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e($e(a.taskId))},onSnoozeTask:(s,i)=>{e(Ne(s,i))},onUnsnoozeTask:s=>{e(Le(s))},onCreateSubtask:(s,i)=>{e(Ke({...i,parentTaskId:s}))},onSubtaskUpdate:(s,i)=>{e(Fe({task:s,updates:i}))},onShowToast:s=>{e(ie(s))},onSubtaskRowClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onParentBreadcrumbClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const s=re(l.state?.pathnameStackToGoBack),i=s.poppedPathname??"../../dashboard";c(i,{state:{pathnameStackToGoBack:s.newStack}})}else{const s=v(S),i=y(l.state?.pathnameStackToGoBack,l.pathname);c(s,{state:{pathnameStackToGoBack:i}})}e(Pe({taskId:n}))},onDeleteTaskClick:()=>{e(je(n))},updateFilesEntity:s=>{e(Be({files:s}))},onDeleteFile:s=>{e(we(s))},onEditFileName:(s,i)=>{e(xe(s,i.split(".")[0]))},onReloadTaskDetailPage:()=>{e(E(!1,n))},onCreateTagClick:s=>{e(Ue(s,n))},onDeleteTagClick:s=>{e(ve(s,n))},onFetchCannedResponses:()=>{e(se())},onManageTemplatesClick:()=>{c(`/${t.tenantEmailDomain}/tasks/quick-responses`)}}}))(He);function K(){const e=ee(),a=ae(),n=ge(),c=Oe(),{taskId:t,taskGroupId:l}=he(),d=g((o=>te(o))),S=Je(d?.companyId),{useFeatureGate:s}=Ve(),{isFeatureEnabled:i}=s(_.isTaskSnoozeEnabled),{isFeatureEnabled:I}=s(_.isTaskVisibilityEnabled),{isFeatureEnabled:C}=s(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:U}=s(_.isTaskRecurringParentEnabled),{isFeatureEnabled:x}=s(_.isTaskGroupAssigneesEnabled),[A,w]=k.useState(!1),[T,ce]=k.useState(!1),[N,le]=k.useState(!1),[$,B]=k.useState(!1),R=k.useRef(!1),G=g((o=>o.taskListState.updateTasksFetchState.fetchState)),Q=g((o=>ne(o))),Z=g((o=>o.taskGroupViewState.fetchState));k.useEffect((()=>{a(E(!1,t)),t!=null&&a(b(t))}),[a,t]);const z=D.getSignedInUser()?.userId,de=D.isZeniUser(),ue=g((o=>t!=null?o.taskState.taskByID[t]?.syncToken:void 0)),O=()=>{d?.tenantEmailDomain!=null&&e(v(d.tenantEmailDomain))},V=()=>{a(ie({messageSection:"delete_task",messageText:"success",type:"success"})),O()},ke=k.useMemo((()=>{const o=[m.TASK_CREATED,m.TASK_UPDATED,m.TASKS_BULK_UPDATED,m.TASKS_BULK_DELETED],u=[...o,m.TASK_SNOOZE_RESURFACED];return[...aa(d?.companyId,o),...sa(z,u)]}),[d?.companyId,z]);oa({events:ke,onSubscribed:()=>{t!=null&&(a(E(!0,t)),a(b(t)))},onEvent:(o,u)=>{if(t!=null)switch(o){case m.TASK_CREATED:case m.TASK_UPDATED:{const p=((P,me,{isZeniUser:Se,storedSyncToken:Te,taskId:H})=>{if(P!==m.TASK_CREATED&&P!==m.TASK_UPDATED)return"none";const f=ea(me);return f==null?"none":f.parent_task_id===H?"refreshSubtasks":P!==m.TASK_UPDATED||f.task_id!==H?"none":f.is_deleted===!0?"leaveDeleted":f.is_private!==!0||Se?f.sync_token!=null&&f.sync_token===Te?"none":"refreshTask":"leaveNoAccess"})(o,u,{isZeniUser:de,storedSyncToken:ue,taskId:t});p==="refreshTask"?(a(E(!0,t)),a(b(t))):p==="refreshSubtasks"?a(b(t)):p==="leaveDeleted"?V():p==="leaveNoAccess"&&O();break}case m.TASKS_BULK_UPDATED:{const p=X(u);if(p==null)break;p.task_ids.includes(t)&&a(E(!0,t)),a(b(t));break}case m.TASKS_BULK_DELETED:{const p=X(u);if(p==null)break;if(p.task_ids.includes(t)){V();break}a(b(t));break}case m.TASK_SNOOZE_RESURFACED:{ta(u)?.task_id===t&&a(E(!0,t));break}}}}),k.useEffect((()=>{T||Q.fetchState==="Completed"||(ce(!0),a(_e()))}),[T,a,Q.fetchState]),k.useEffect((()=>{N||Z==="Completed"||(le(!0),a(ye()))}),[N,a,Z]);const pe=k.useCallback((()=>{t!=null&&(R.current=!1,a(Ae([t],null,{isArchived:!1})),B(!0))}),[a,t]);k.useEffect((()=>{if($)if(G!=="In-Progress"){if(R.current){if(G==="Error")return B(!1),void(R.current=!1);if(G==="Completed"){B(!1),R.current=!1;const{tenantEmailDomain:o}=d;if(n.state?.message==="triggerBackClick"){const u=re(n.state?.pathnameStackToGoBack);e(u.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:u.newStack}})}else{const u=v(o);e(u,{state:{pathnameStackToGoBack:y(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else R.current=!0}),[$,G,d,n,e]);const q=g((o=>oe(o,t))),j=q.fetchState,M=D.getSignedInUser();if(M==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&q.error?.code===400){const{tenantEmailDomain:o}=d,u=v(o),p=y(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(be,{to:u,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[j==="Completed"?r.jsx(qe,{analytics:Y,onLoad:o=>(u=>u.trackPageLoaded(Me.Event.taskDetailPage))(o)}):null,r.jsxs(la,{children:[r.jsx(Xe,{isAppContentDrawerOpen:A,handleDrawerToggle:o=>{w(o)}}),r.jsx(ca,{analytics:Y,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:S,location:n,loggedInUser:M,navigate:e,taskGroupId:l,taskId:t,taskDetailFetchState:j,onUnarchiveTaskClick:pe,isTaskSnoozeEnabled:i,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:C,isTaskRecurringParentEnabled:U,isTaskGroupAssigneesEnabled:x})]})]})}const la=Ye.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,v=e=>`/${e}/tasks`;function Ba(){return r.jsxs(De,{children:[r.jsx(h,{path:"/new",element:r.jsx(K,{})}),r.jsx(h,{path:"/new/:taskGroupId",element:r.jsx(K,{})}),r.jsx(h,{path:"/group/:taskGroupId",element:r.jsx(na,{})}),r.jsx(h,{path:"/quick-responses",element:r.jsx(ia,{})}),r.jsx(h,{path:"/:taskId",element:r.jsx(K,{})}),r.jsx(h,{path:"*",element:r.jsx(fe,{})})]})}export{Ba as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-BD_ga8W6.js";import G from"./NotFoundScreen-oYE2WlvI.js";import{a as n}from"./sentry-DsaQHQmX.js";import{u as ft,h as yt,g as bt,i as St,j as o,n as ht,o as f}from"./core-Bx5kG7oj.js";import{fJ as It,g_ as Lt,m4 as Tt,uv as jt,Yf as Ct,XS as Et,Yg as gt,Sc as At,Sd as kt,i4 as L,m2 as vt,uw as xt,S2 as Dt,SD as _t,Yh as Nt,Yi as wt,S9 as Ft,S6 as Mt,Yj as Rt,Yk as Yt,Yl as Ht}from"./zeni-epic-state-CP_8Me3V.js";import{p as Pt,V as Ut,_ as U,b2 as qt,z as zt,e as Bt,b3 as Gt,h as q,b4 as Vt,ac as $t,G as Ot}from"./index-DkHntkmh.js";import"./mui-BaMyMAqO.js";import{d as Jt}from"./decodeURIComponentSafe-DMAtWdNT.js";import{u as Kt}from"./useEnsureVendorListLoaded-CCsBxqME.js";import{u as Qt,T}from"./TransactionDetailScreen-DPXvNf-7.js";import{c as Xt}from"./routePaths-Cxh0_DtI.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";import"./useAskAiCfoHostNavButtonProps-B0IAA2LU.js";import"./useInitialThreadRequest-Dspu5rPv.js";import"./expenseAutomationHelper-CAr9eXjQ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="47b5b77c-74c1-4c3d-b0dd-636f93c4f7ab",e._sentryDebugIdIdentifier="sentry-dbid-47b5b77c-74c1-4c3d-b0dd-636f93c4f7ab")}catch{}})();const Wt=["bank","credit_card","other_current_assets"],z=e=>`/${e}/month_end_close_checks/review/transaction_categorization`,{common:{currency:B}}=Ot.getLocalizedStrings();function Zt(){const e=ft(),d=yt(),m=bt(),{tenantEmailDomain:u,transactionTypeEncoded:V}=St(),{useFeatureGate:j}=Pt(),$=Ut(),{isFeatureEnabled:O}=j(U.isCreateTransactionEnabled),{isFeatureEnabled:C}=j(U.isProjectsTransactionsEnabled),J=Jt(V??""),a=Ht.find((t=>t===J)),S=o((t=>It(t))),E=qt(S.companyId,a),g=o((t=>Lt(t.companyState,S.companyId)?.company.companyLocaleInfo)),K=g?.currencyCode??B.currencyCode,Q=g?.currencySymbol??B.currencySymbol,A=o((t=>t.tenantState.currentTenantId)),k=zt.getSignedInUser(),v=k?.userId??"",x=k?.zeniSessionId??"",X=n.useMemo((()=>({userId:v,sessionId:x,tenantId:A??""})),[v,x,A]),W=o((t=>Tt(t))),D=o((t=>jt(t))),_=D&&C===!0,h=o((t=>t.projectListState)),N=o((t=>t.projectState)),Z=n.useMemo((()=>Ct(N,h).projects),[N,h]),I=o((t=>Et(t,"common"))),w=o((t=>t.accountListState.byReportId.accountList.fetchState)),F=o((t=>t.accountListState.byReportId.createTransactionLineAccountList.fetchState)),M=o((t=>t.accountListState.byReportId.createTransactionPaymentAccountList.fetchState)),R=o((t=>t.classListState.fetchState)),s=o((t=>a!=null?gt(t,a):void 0));n.useEffect((()=>{if(a!=null)return e(At(a)),()=>{e(kt(a))}}),[e,a]);const tt=Bt(),et=o((t=>{const{activeTenantFetchState:i,currentTenantId:b,fetchState:mt,tenantsById:pt}=t.tenantState;return b!=null&&pt[b]!=null&&(i.fetchState==="Completed"||mt==="Completed")})),r=tt&&et;n.useEffect((()=>{r&&a==="transfer"&&w==="Not-Started"&&e(L("accountList"))}),[e,r,a,w]),n.useEffect((()=>{r&&F==="Not-Started"&&e(L("createTransactionLineAccountList"))}),[e,r,F]),n.useEffect((()=>{r&&M==="Not-Started"&&e(L("createTransactionPaymentAccountList",!1,!1,!1,!1,Wt))}),[e,r,M]),n.useEffect((()=>{r&&R==="Not-Started"&&e(vt())}),[e,r,R]);const Y=h.fetchState;n.useEffect((()=>{r&&_&&Y==="Not-Started"&&e(xt())}),[e,r,_,Y]),Kt(r),Qt(r&&a==="transfer",!1);const at=n.useCallback(((t,i=[])=>{if(i.length>0&&e(Dt(i)),u==null)return;const b=Gt(m.state)??[z(u)];d(Xt(t,u),{replace:!0,state:{pathnameStackToGoBack:b}})}),[e,u,d,m.state]),nt=n.useCallback((()=>{m.key==="default"?u!=null&&d(z(u)):d(-1)}),[m.key,d,u]),ot=n.useCallback((t=>{e(_t(t))}),[e]),H=n.useRef(void 0),p=s?.createStatus.error;n.useEffect((()=>{if(a==null||p==null)return;const t=`${p.code??""}-${p.message??""}`;H.current!==t&&(H.current=t,q.trackCreateTransactionFailed({transactionType:a,errorCode:p.code}))}),[p,a]);const y=n.useCallback((t=>t),[]),l=n.useMemo((()=>(s?.vendorList??[]).filter((t=>!t.isDeleted)).sort(((t,i)=>t.name.localeCompare(i.name)))),[s?.vendorList]),P=s?.localData.vendorId,st=n.useMemo((()=>{const t=l.find((i=>i.id===P));if(t!=null)return t.qboId!==""&&t.qboId!==t.name?t.qboId:t.name}),[l,P]),ct=o((t=>Nt(t,st))),rt=n.useMemo((()=>y(l.map((t=>({id:t.id,label:t.name}))))),[l,y]),it=n.useMemo((()=>({...I,vendor:[...l.map((t=>({id:t.id,name:t.name,qboId:t.qboId,type:"vendor",zeniId:t.id}))),...I.vendor]})),[I,l]),dt=n.useMemo((()=>y((s?.transferAccountsList??[]).map((t=>({id:t.accountId,label:t.accountName}))))),[s?.transferAccountsList,y]),ut=n.useCallback((t=>{a!=null&&e(wt(a,t))}),[e,a]),lt=n.useCallback(((t,i)=>{a!=null&&e(Ft(a,i,t))}),[e,a]);return E==null?null:a!=null&&s!=null&&O===!0&&E&&$?.connectionName!=="netsuite"?c.jsx(Vt,{analytics:q,attachmentUploadEndpoint:$t.accountMicroServiceBaseUrl,authParams:X,createdTransactionId:s.createdTransactionId,transactionType:a,localData:s.localData,createStatus:s.createStatus,accountsHierarchyList:s.accountListNestedAccountHierarchy,paymentAccountsHierarchyList:s.paymentAccountListNestedAccountHierarchy,classHierarchyList:s.classListNestedAccountHierarchy,vendorOptions:rt,transferAccountOptions:dt,isAccountingClassesEnabled:W,isAccountingProjectsEnabled:D,isProjectsTransactionsEnabled:C===!0,projects:Z,currencyCode:K,currencySymbol:Q,bookCloseDate:S.bookCloseDate?.toDate(),entityAutoCompleteView:it,vendorRecommendationFetchState:ct.fetchState,onUpdateLocalData:ut,onAddLine:()=>e(Yt(a)),onRemoveLine:t=>e(Rt(a,t)),onSubmit:()=>e(Mt(a)),onCancel:nt,onCreateTransactionComplete:at,onUploadAttachmentAttachment:ot,onFetchRecommendationsForVendor:lt}):c.jsx(G,{})}function Ce(){return c.jsxs(ht,{children:[c.jsx(f,{path:"/new/:transactionTypeEncoded",element:c.jsx(Zt,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId",element:c.jsx(T,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:c.jsx(G,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:c.jsx(T,{})}),c.jsx(f,{path:"/*",element:c.jsx(T,{})})]})}export{Ce as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as _}from"./liveblocks-BD_ga8W6.js";import{a as i}from"./sentry-DsaQHQmX.js";import{u as j,k as ot,j as g,s as ge,g as De,h as Ce,i as Ae,N as st,l as ct}from"./core-Bx5kG7oj.js";import{pE as Ie,fJ as Z,g_ as it,VH as rt,oK as lt,og as dt,Ee as se,Ym as ut,gl as mt,bn as pt,dj as _e,bq as we,tc as W,WP as H,Yn as Re,Yo as le,Xd as Pe,mf as Fe,Yp as Ue,Xi as de,Xj as ue,n4 as xe,Ta as me,XT as G,m9 as Le,m7 as Ve,mj as ft,pr as ht,Yq as St,Yr as yt,E5 as K,me as Be,Su as Oe,cp as Tt,dq as bt,Y4 as gt,XS as It,Ys as vt,Yt as Et,Yu as kt,Yv as Dt,E1 as Ct,Yw as At,Yx as _t,Yy as wt,Yz as Rt,YA as Pt,mi as Ft,YB as Ut,YC as xt,XU as Lt,YD as Vt,YE as Bt,YF as Ot,So as Nt,Se as zt,SD as Yt,mk as jt,Tb as ve,pw as Mt}from"./zeni-epic-state-CP_8Me3V.js";import{p as X,_ as R,h as $,b5 as Gt,z as Ne,$ as $t,b6 as qt,a9 as Wt,a2 as ce,V as Ht,b7 as Xt,j as ie,aq as Jt,b8 as Kt,b9 as Qt,ba as Zt,ac as en,at as oe}from"./index-DkHntkmh.js";import{n as tn,S as nn,u as an,D as on}from"./mui-BaMyMAqO.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-B0IAA2LU.js";import{d as ze}from"./decodeURIComponentSafe-DMAtWdNT.js";import{u as cn}from"./useInitialThreadRequest-Dspu5rPv.js";import{h as Ye,c as je,g as rn,f as ln}from"./routePaths-Cxh0_DtI.js";import{u as dn}from"./expenseAutomationHelper-CAr9eXjQ.js";import{A as un}from"./utils-Rng1Um8N.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="6efd9747-d5b5-47ae-8c83-9bfd8fd6a7ec",t._sentryDebugIdIdentifier="sentry-dbid-6efd9747-d5b5-47ae-8c83-9bfd8fd6a7ec")}catch{}})();function mn(t=!0,e=!0){const o=j(),n=ot(),{useFeatureGate:a}=X(),{isFeatureEnabled:s}=a(R.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||e&&s!==!0)return;const c=d=>{const h=n.getState().createTransferEntryState.transferAccountsByType[d].fetchState;return h!=="In-Progress"&&h!=="Completed"};c("transferEntryEligible")&&o(Ie({kind:"transferEntryEligible"})),c("creditCardOnlyEligible")&&o(Ie({kind:"creditCardOnlyEligible"}))}),[t,e,s,o,n])}function pn(t,e){const o=(function(){const d=j(),[h,S]=i.useState(!1),[D,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:y}=X(),{configValue:v,isDynamicConfigLoading:f}=y("transaction_categorization_config"),T=!f&&v?.capitalization_enabled===!0,k=g((I=>Z(I))),C=k.companyId,P=g((I=>it(I.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:F,dismissedAccounts:U}=g((I=>{const b=I.tenantState.currentTenantId,w=b!=null?I.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:w?.capitalizableAccounts??null,capitalizableAccountOverrides:w?.capitalizableAccountOverrides??null,dismissedAccounts:w?.capitalizationOnboardingDismissedAccounts??null}}),ge),V=i.useRef(A);V.current=A;const x=i.useRef(F);x.current=F;const B=i.useRef(U);B.current=U;const O=g((I=>rt(I.accountState)),ge),M=i.useMemo((()=>{const I={};for(const b of O)b.accountId!=null&&b.accountName!=null&&(I[b.accountId]=b.accountName);return I}),[O]),q=l!=null?M[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=V.current;if(b==null)return;const w=b.accounts??[],J=new Set(I),ee=x.current??{},te=B.current;for(const z of w)if(J.has(z.accountId)&&ee[z.accountId]==null&&te?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void S(!0)}),[T]),E=i.useCallback(((I,b)=>{d(lt(C,I,b,!0)),S(!1),p(null),u(null)}),[d,C]),r=i.useCallback((()=>{l!=null&&(d(dt(C,l)),S(!1),p(null),u(null))}),[d,C,l]);return{showPopup:h&&T,popupType:D,popupAccountId:l,popupAccountName:q,currencySymbol:P,checkAndShowPopup:N,handleSubmit:E,handleDismiss:r}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const Y=new Map,Ee=(t,e,o)=>`${t}|${e??""}|${o}`,Q=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Me=(t,e,o)=>{$.trackRecommendationFeedbackRetracted(Q(e,o)),t(se(re(e,o,{outcome:"retracted"})))},Vn=(t,e)=>{const o=new Set(e.map(String));Y.forEach(((n,a)=>{o.has(n.transactionId)&&(Y.delete(a),Me(t,n.feedback,n.transactionId))}))},Bn=t=>{const e=new Set(t.map(String));Y.forEach(((o,n)=>{e.has(o.transactionId)&&Y.delete(n)}))};function fn(t){const e=j(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=g(ut),{isEnabled:d,fallbackTransactionId:h}=t,S=i.useCallback((u=>u.transactionId??h??""),[h]),D=i.useCallback((u=>{if(!d)return;const y=S(u);if(y==="")return;if(u.outcome!=="accepted")return void n(u);((f,T,k,C)=>{const P=Ee(T,k,C),A=Y.get(P);return A!=null&&(Y.delete(P),Me(f,A.feedback,A.transactionId),!0)})(e,y,u.lineId,u.dimension)||(((f,T)=>{$.trackRecommendationAccepted(Q(f,T))})(u,y),e(se(re(u,y,{}))))}),[d,S,e]),p=i.useCallback((u=>{if(o==null)return;const y=S(o);((v,f,T)=>{$.trackRecommendationFeedbackSubmitted({...Q(v,f),feedbackReason:T})})(o,y,u),e(se(re(o,y,{reasonText:u,skipped:!1}))),((v,f)=>{Y.set(Ee(f,v.lineId,v.dimension),{feedback:v,transactionId:f})})(o,y),s(!0)}),[o,S,e]),l=i.useCallback((()=>{var u,y;o!=null&&(u=o,y=S(o),$.trackRecommendationFeedbackSkipped(Q(u,y)),s(!1),n(null))}),[o,S]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(mt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:D,popup:o!=null?_.jsx(Gt,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=X(),{isFeatureEnabled:o}=e(R.isChainOfThoughtEnabled);return i.useMemo((()=>pt(t)&&o),[t,o])};function Ge(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function On(t,e){const o=j(),{useFeatureGate:n}=X(),a=g((r=>Z(r))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&_e(a.userRole),d=a.userRole!=null&&we(a.userRole),{isFeatureEnabled:h}=n(R.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:S}=n(R.isExpenseAutomationEnabled),D=pe(),p=i.useMemo((()=>({id:t,type:W(e)})),[t,e]),l=g((r=>H(r,p))),u=l?.transactionDetailUpdateStatus?.fetchState,y=l?.transactionDetailLocalData?.lineItemById,v=g((r=>{const I=H(r,p)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":r.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),f=i.useMemo((()=>l?.fetchState==="Completed"?Ge(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=g((r=>{if(f!=null)return Re(r.customerIncomeState,r.vendorExpenseState,r.trendState,f,"month")})),k=g((r=>le(r))),C=g((r=>{if(f!=null)return Pe(r.trendWithTransactionsState,f,"TransactionDetail")})),P=a.company?.companyInfo.firstMonthOfFY??1,A=g((r=>Fe(r.accountState,r.accountListState,"accountList"))),[F,U]=i.useState(!1),[V,x]=i.useState(!1),[B,O]=i.useState(!1);i.useEffect((()=>{U(!1),x(!1),O(!1)}),[t,e]);const M=i.useCallback((()=>{U(!1),x(!1)}),[]),[q,N]=i.useState(!1),E=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{B||l==null||l.transaction==null||(o(Ue({id:l.transaction.id,type:l.transaction.type})),O(!0)),f!=null&&(!s||c&&d===!1)&&(F?V||T==null||(x(!0),o(me(f,"TransactionDetail",{timeframe:"month",timePeriod:E??T}))):(o(de()),o(ue()),U(!0),o(xe(f))))}),[o,B,l?.fetchState,l?.transaction,f,s,c,d,F,V,T,E]),i.useEffect((()=>{k.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[k.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:S,isChainOfThoughtEnabled:D,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:y,vendorSaveStatus:v,tranEntity:f,defaultTrendTransactionTimePeriod:T,vendorViewDetails:k,uiState:C,firstMonthOfFY:P,uncategorizedAccounts:A,resetTrendIsFetchedStates:M,isCreateVendorDrawerOpen:q,setIsCreateVendorDrawerOpen:N}}const hn={overlayWidth:new Wt(100,100,58)},Sn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=an(),c=$t(),d=j(),h=g((p=>le(p))),S=()=>{n()},D={vendorDetailView:a??h,onSaveSuccess:()=>{d(Ve()),d(ft("Not-Started")),o()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:p=>{d(Le({vendorId:void 0,localData:p}))}};return _.jsx(on,{anchor:"right",open:t,PaperProps:{style:{width:hn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:S,children:_.jsx(yn,{onClick:p=>p.stopPropagation(),children:_.jsx(qt,{...D})})})},yn=tn(nn)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`;function Tn(t,e){t(ht({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:W(e.transactionType),sourceTransactionType:W(e.sourceTransactionType)}))}function bn({currentTransactionId:t,enabled:e=!0,buildPath:o,beforeNavigate:n,navigate:a,navigateState:s}){const c=g((h=>h.createTransferEntryState.lastTransferEntryReplacement)),d=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||d.current===c)return;const{previousTransactionId:h,newTransactionId:S}=c;t.id===h.id&&t.type===h.type&&(d.current=c,n?.(),a(o(S),{replace:!0,state:s}))}),[e,c,t,o,n,a,s])}const gn=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:o})=>{const n=De(),a=Ce(),s=j(),c=pe(),{transactionTypeEncoded:d,transactionId:h}=Ae(),S=e??h,D=o??ze(d??"");let p;Ye(S,D)&&(p={id:S,type:W(D)});const l=p!=null?g((y=>H(y,p))):void 0,u=()=>{const y=ce(n.state?.pathnameStackToGoBack),v=y.poppedPathname??((f=2)=>{let T="../";for(let k=0;k<f;k++)T=`${T}../`;return T})(1);a(v,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:p,onSaveVendor:()=>{s(Be(p,void 0))},onSaveSuccess:()=>{if(l!=null&&l?.transaction&&l?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&l?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=l?.transactionDetailLocalData.vendorUpdates,v={id:l?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:l?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:l?.transactionDetailLocalData.vendorUpdates?.qboId??""},f={transactionId:{id:l?.transaction?.id,type:l?.transaction?.type},transaction:l?.transaction,lineIds:l?.transaction?.lines?.map((T=>T.id))??[]};s(K({entity:v,amount:l?.transaction?.amount.amount,transactionDetails:f,flowType:"detail",isFetchCOT:c}))}u()},onCancel:()=>{p!=null&&s(St({transactionId:p})),s(Ve()),s(yt()),t(!0),u()}}},In=ct((function(t,e){const o=H(t,e.selectedTransaction);let n;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=t.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(n=gt(t,e.entity,"TransactionDetail"));const d=t.entityAutoCompleteState.autoCompleteText.common,h=It(t,"common"),S=Z(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:S.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${en.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:n,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:d,entityAutoCompleteView:h},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(t(G("common")),e.onBackClick!=null)return void e.onBackClick();const n=ce(e.location.state?.pathnameStackToGoBack),a=n.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:n.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(n,a)=>{e.transaction!=null&&t(Mt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:n,customerId:a}))},onTransactionClick:n=>{e.resetTrendIsFetchedStates(),t(de()),t(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(je(n,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:n=>{if(n==null)e.defaultTrendTransactionTimePeriod!=null&&t(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=n.currentTimePeriod==null?n.addTimePeriod:{startDate:n.addTimePeriod.startDate,endDate:n.currentTimePeriod.endDate};t(me(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:n.addTimePeriod})),t(ve(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:a}))}},onSaveUpdates:(n,a,s,c)=>{t(c===!0&&s!=null?Be(n,s,!0,e.isExpenseAutomationEnabled):jt({transactionId:n,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),t(G("common"))},onUploadAttachmentAttachment:n=>{t(Yt(n))},onDeleteAttachment:n=>{e.transaction!=null&&t(zt(n,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(n,a)=>{t(Nt({transactionId:n,transactionLocalData:a}))},onUpdateAllChecked:(n,a,s,c)=>{e.transaction!=null&&t(Ot(e.selectedTransaction,e.transaction,n,a,s,c))},onResetLineItemsCategoryClassInLocalData:(n,a,s,c,d,h)=>{t(Bt(n,a,s,c,d,h))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Vt({id:e.transaction.id,type:e.transaction.type},e.transaction,n,a))},onSaveSuccess:()=>{const n=ce(e.location.state?.pathnameStackToGoBack);if(n.poppedPathname!=null){const a=un(n.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${rn(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${ln(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(Oe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(n,a)=>{n.trim().length>=2?t(Lt({searchString:n,entityType:a,searchOrigin:"common"})):n.trim().length===0&&t(G("common"))},onCancelAutoComplete:()=>{t(G("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(K({entity:n,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:n=>{const{transactionId:a,transaction:s,lineId:c}=n;t(xt(a,s,c))},resetUpdateErrorState:()=>{const n={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Ut(n))},onSaveVendorInLocalData:(n,a,s,c,d)=>{if(t(Ft({transactionId:n,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(K({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o})),t(Le({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const h=e.transaction,S=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(h.type??"")}/${h.id}/vendor/create`,{state:{pathnameStackToGoBack:S}})}},onSaveCustomerInLocalData:(n,a,s,c,d)=>{t(Pt({transactionId:n,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(K({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:n=>{t(Rt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:n}))},onClickUpdateVendorToAllLineItems:(n,a,s)=>{t(wt(n,a,s))},onResetVendorToAllLineItems:(n,a,s)=>{t(_t(n,a,s))},saveLatestSelectedEntity:(n,a,s)=>{t(At({transactionId:n,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(n,a)=>{t(Ct(n,a))},setIsVendorUpdateAllChecked:(n,a,s)=>{t(Dt(n,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?n=>Tn(t,n):void 0,onLineAdd:()=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",d=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};t(kt(n,d))},onLineDelete:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(Et(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(vt(a,n))}}}))(Zt);function Nn(){const t=Ce(),e=j(),o=De(),{useFeatureGate:n}=X(),a=Ht(),s=g((m=>Z(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),d=s.userRole!=null&&_e(s.userRole),h=s.userRole!=null&&we(s.userRole),{isFeatureEnabled:S}=n(R.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:D}=n(R.isExpenseAutomationEnabled),{tenantEmailDomain:p,transactionTypeEncoded:l,transactionId:u}=Ae(),[y,v]=i.useState(!1),f=ze(l??""),T=Ye(u,f),k=g((m=>m.transactionVendorViewState)),C=pe(),{isFeatureEnabled:P}=n(R.isRecommendationFeedbackEnabled),A=Xt(),{onRecommendationSelection:F,popup:U}=fn({isEnabled:P,fallbackTransactionId:u}),V=i.useMemo((()=>({...A,onRecommendationSelection:F})),[A,F]),{isFeatureEnabled:x}=n(R.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=n(R.isProjectsTransactionsEnabled),{isFeatureEnabled:O}=n(R.isTransactionSplitEnabled),M=a?.currentTenant?.companyId,q=a?.currentTenant?.companyName,N=cn(M),E=i.useMemo((()=>{if(T)return{id:u,type:W(f)}}),[T,u,f]),r=E!=null?g((m=>H(m,E))):void 0,I=r?.transactionDetailLocalData.vendorUpdates?.id!=null?k.editVendorStateById[r?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",b=r?.fetchState==="Completed"?Ge(r?.transaction):void 0,w=g((m=>b!=null?Re(m.customerIncomeState,m.vendorExpenseState,m.trendState,b,"month"):void 0)),J=g((m=>le(m))),ee=g((m=>b!=null?Pe(m.trendWithTransactionsState,b,"TransactionDetail"):void 0)),te=s.company?.companyInfo.firstMonthOfFY??1,z=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[qe,fe]=i.useState(!1),[We,he]=i.useState(!1),[He,Se]=i.useState(!1),Xe=i.useCallback((m=>je(m,p??"")+o.search),[p,o.search]),Je=i.useCallback((()=>{Se(!1)}),[]);bn({currentTransactionId:E,enabled:p!=null&&p!=="",buildPath:Xe,beforeNavigate:Je,navigate:t,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=dn();mn();const ne=i.useRef(r?.transaction);ne.current=r?.transaction;const Ke=r?.transactionDetailUpdateStatus?.fetchState,L=pn(Ke,(()=>{const m=[];if(ne.current!=null)for(const ae of ne.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{E!=null&&r!=null&&r.fetchState==="Not-Started"&&(e(Oe(E,!1)),ye())}),[e,E,r?.fetchState]),i.useEffect((()=>{if(E!=null&&r?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);t("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[E,r?.fetchState,t,o.state,o.pathname,Te]),i.useEffect((()=>{He||r==null||r.transaction==null||(e(Ue({id:r.transaction.id,type:r.transaction.type})),Se(!0));const m=o.state?.searchContext;b==null&&r?.fetchState==="Completed"&&ke(r?.transaction,m),b!=null&&(!c||d&&h===!1)&&(qe?We||w==null||(he(!0),e(me(b,"TransactionDetail",{timeframe:"month",timePeriod:ee?.selectedPeriod?.timePeriod??w}))):(e(de()),e(ue()),ke(r?.transaction,m),fe(!0),e(xe(b))))}),[r?.fetchState,r?.transaction,w,c]),i.useEffect((()=>{J.newVendorState?.vendorDetailLocalData?.vendorName!=null?v(!0):v(!1)}),[J.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Qe=[l,u].filter((m=>m!=null)),{transactionId:be,onSaveVendor:Ze,onSaveSuccess:et,onCancel:tt}=gn({closeDrawerHandler:m=>{v(!1),t(m?"../":"../..")}}),{isAiCfoAccessEnabled:nt,onAskAiCfoClick:at}=sn({mobileExploreReferrer:"Transaction Details"});return Jt({isDataReady:r?.fetchState==="Completed"}),T?_.jsxs(_.Fragment,{children:[be!=null&&y&&_.jsx(Sn,{isOpen:y,transactionId:be,onSaveVendor:Ze,onSaveSuccess:et,onCancel:tt}),_.jsx(Kt,{toolkit:V,children:_.jsx(In,{hideDeleteAttachment:!0,firstMonthOfFY:te,isDisabled:r?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:p,location:o,navigate:t,selectedTransaction:E,entity:b,isCOTEnabled:C,defaultTrendTransactionTimePeriod:w,resetTrendIsFetchedStates:ye,transaction:r?.transaction,uncategorizedAccounts:z,vendorSaveStatus:I,isVendorBulkUpdateOnTransactionEnabled:S,isCreateTransferEntryFromExpenseEnabled:x,isExpenseAutomationEnabled:D,isAiCfoAccessEnabled:nt,onAskAiCfoClick:at,isProjectsTransactionsEnabled:B,isTransactionSplitEnabled:O,companyId:M,companyName:q,initialOpenThreadRequest:N})}),U,L.showPopup&&L.popupType!=null&&_.jsx(Qt,{popupType:L.popupType,currencySymbol:L.currencySymbol,accountId:L.popupAccountId??"",accountName:L.popupAccountName??"",onSubmit:L.handleSubmit,onDismiss:L.handleDismiss})]}):_.jsx(st,{to:$e(Qe.length)})}const $e=(t=2)=>{let e="../";for(let o=0;o<t;o++)e=`${e}../`;return e},ke=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=vn(t),a=En(t);$.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,o.length>0?o:void 0,n.length>0?n:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},vn=t=>{const e=[],o=[];return t.lines?.forEach((n=>{switch(n.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const a=n;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},En=t=>Tt(t)===!0?t.customer?.name??"":bt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Sn as C,Nn as T,On as a,fn as b,pn as c,gn as d,In as e,bn as f,pe as g,Tn as h,Bn as i,ke as l,Vn as r,mn as u};
|