@zeniai/web-app-ui 5.3.47-dev → 5.3.48-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-DeHsC__B.js +9 -0
- package/dist/assets/AddressRoutes-Bh2vRJBa.js +1 -0
- package/dist/assets/AddressScreen-C9Fk_Z55.js +9 -0
- package/dist/assets/AiCfoScreen-DB41E0VN.js +22 -0
- package/dist/assets/{AppDrawer-D4O6tn5i.js → AppDrawer-XdZKck2N.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-BY4P9AKu.js → BillPayApprovalRoutes-Dyxgp6fW.js} +1 -1
- package/dist/assets/BillPayRoutes-Bp82WT-5.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-BT5PhS2R.js +9 -0
- package/dist/assets/CardsAiCfoScreen-CgeqAvem.js +14 -0
- package/dist/assets/ChargeCardRoutes-Ds9toMfJ.js +71 -0
- package/dist/assets/CompanyPassportScreen-B2k7aWUB.js +1 -0
- package/dist/assets/ConnectionAuthScreen-DrhuD992.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-CpbSTPlS.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DV3rYEiJ.js → CustomerOnboardingRoutes-RIeFd0Jj.js} +3 -3
- package/dist/assets/{DashboardRoutes-D5hdkebN.js → DashboardRoutes-DqcCIUfr.js} +4 -4
- package/dist/assets/{DefaultTenantHome-DCPi_wXC.js → DefaultTenantHome-DhG1xEfc.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-BKq5jjLx.js +18 -0
- package/dist/assets/{DrawerScreen-BihZ_PpN.js → DrawerScreen-DsFB_53j.js} +1 -1
- package/dist/assets/EntityDetailRoutes-mt1xcJ7j.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-lC_JLdAl.js +38 -0
- package/dist/assets/FeaturePreviewScreen-BFU7MG_7.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-sKmwa_VW.js +1 -0
- package/dist/assets/InboxNotificationsProvider-CLtB_fgp.js +1 -0
- package/dist/assets/InvoicingRoutes-9v2-NT7u.js +2 -0
- package/dist/assets/MagicLinkRoutes-CXFrKDZN.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-dmwIRx3p.js +12 -0
- package/dist/assets/MobileAppDrawer-cBt39NZW.js +1 -0
- package/dist/assets/NotFoundScreen-DFQDCCRn.js +1 -0
- package/dist/assets/NotificationRoutes-DBx2Hpze.js +1 -0
- package/dist/assets/OAuthConsentScreen-Y007Isid.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-C51wwulq.js +1 -0
- package/dist/assets/{PaymentLinkScreen-B8bPleIr.js → PaymentLinkScreen-DJghRBso.js} +7 -7
- package/dist/assets/PeopleRoutes-Bm7sOBGu.js +22 -0
- package/dist/assets/PerformanceRoutes-BqAferL2.js +1 -0
- package/dist/assets/{Preview-DMLQokX_.js → Preview-BTwrFAaN.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CWU6DFJl.js → QBOConnectionScreen-UblfZAiA.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-DEDn1IHB.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-QDei_Fzl.js +1 -0
- package/dist/assets/{ReimbursementRoutes-BdJ3oqBf.js → ReimbursementRoutes-BHG-L5Ik.js} +9 -9
- package/dist/assets/ReportsRoutes-1SHXwblc.js +1 -0
- package/dist/assets/RewardsRoutes-bKzfn6ay.js +1 -0
- package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-CdJ2LE-G.js +25 -0
- package/dist/assets/ScreenRoutes-Bz0Iu7E_.js +2 -0
- package/dist/assets/{SettingsRoutes-BGCz0_nd.js → SettingsRoutes-pgiyjQKt.js} +6 -6
- package/dist/assets/{SetupPagesScreen-DzNRL7Y-.js → SetupPagesScreen-Dzk7fHhk.js} +5 -5
- package/dist/assets/SignInScreen-Rmz1EJ3i.js +1 -0
- package/dist/assets/SignOutScreen-BgL1D0p9.js +9 -0
- package/dist/assets/{TaskListScreen-Br-mxkKM.js → TaskListScreen-BjJ59grh.js} +2 -2
- package/dist/assets/TaskRoutes-cixN3J6B.js +9 -0
- package/dist/assets/TransactionDetailRoutes-B_IKz98q.js +1 -0
- package/dist/assets/{TransactionDetailScreen-Bp7IFDK0.js → TransactionDetailScreen-BzVEfQec.js} +2 -2
- package/dist/assets/TransactionListRoutes-DiO8Bs9p.js +1 -0
- package/dist/assets/{TreasuryRoutes-BvvMozYl.js → TreasuryRoutes-DMo68xKo.js} +6 -6
- package/dist/assets/{VendorsRoutes-DsJ_lcDO.js → VendorsRoutes-DcubMsnX.js} +17 -17
- package/dist/assets/WiseConfirmationScreen-C40X1D6g.js +12 -0
- package/dist/assets/ZeniAccountRoutes-B2XcNL7K.js +57 -0
- package/dist/assets/ZeniAccountStatementScreen-B4EqmylS.js +9 -0
- package/dist/assets/{accountMappingHelper-DqBiQF6x.js → accountMappingHelper-C7mDOec7.js} +1 -1
- package/dist/assets/{analytics-D6GpUSOP.js → analytics-D1aMnBue.js} +1 -1
- package/dist/assets/{analyticsHelper-CwB3kQvw.js → analyticsHelper-BefphWIe.js} +1 -1
- package/dist/assets/{core-B5mDy9pu.js → core-DA_GbUVO.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DANuhXnG.js → decodeURIComponentSafe-BeWrvHuJ.js} +1 -1
- package/dist/assets/{dnd-CGWe1ZMP.js → dnd-BVDuXkBA.js} +1 -1
- package/dist/assets/{empty-D0y6rZ_X.js → empty-DkYQEFBR.js} +1 -1
- package/dist/assets/{empty-Dj4ZMRNZ.js → empty-kmkuoqGV.js} +1 -1
- package/dist/assets/{emptyVideoElement-BbYSqu6F.js → emptyVideoElement-Dr5ohcS7.js} +1 -1
- package/dist/assets/epic-DZfUNOLM.js +2 -0
- package/dist/assets/expenseAutomationHelper-4Qy8IF7o.js +1 -0
- package/dist/assets/{getLocaleForTenant-DH5Avx3x.js → getLocaleForTenant-BYa6QBcb.js} +1 -1
- package/dist/assets/{index-BQBXaLiB.js → index-B02Uvg0e.js} +1 -1
- package/dist/assets/{index-8s12XWuB.js → index-BVMI-pAw.js} +1 -1
- package/dist/assets/{index-k1-Pd2Ki.js → index-BqUvSiTi.js} +1 -1
- package/dist/assets/{index-fq0DUtem.js → index-BsYcIz8M.js} +1 -1
- package/dist/assets/{index-CI8tXM3D.js → index-C4n_QrNU.js} +1 -1
- package/dist/assets/{index-G6Wb7pfX.js → index-C5j9ulaE.js} +2 -2
- package/dist/assets/index-CY-CsK5V.js +1 -0
- package/dist/assets/{index-6nH5LMe4.js → index-CsnAk3jU.js} +30661 -31464
- package/dist/assets/{lexical-DW4lC8Zx.js → lexical-Czsku2z1.js} +1 -1
- package/dist/assets/{liveblocks-UOzcPsHa.js → liveblocks-DTaiayIC.js} +2 -2
- package/dist/assets/{lottie-C5eNvt0I.js → lottie-CkYI8upo.js} +1 -1
- package/dist/assets/{mui-Do6nLzGb.js → mui-yMDYeeMr.js} +1 -1
- package/dist/assets/{pathToGoBack-DP_bGWF-.js → pathToGoBack-nmNIndUw.js} +1 -1
- package/dist/assets/{pdf-DjwvAC2g.js → pdf-BIYA0Nfl.js} +3 -3
- package/dist/assets/{pdf-lib-CZXOqgb4.js → pdf-lib-DZGnWz6X.js} +1 -1
- package/dist/assets/{plaid-0g_vwjSd.js → plaid-BtwBxM-6.js} +1 -1
- package/dist/assets/{pusher-BwlPp2s7.js → pusher-8BUSKGPT.js} +1 -1
- package/dist/assets/{react-BsXfT48C.js → react-Bs3cqIIe.js} +1 -1
- package/dist/assets/{react-CU01hiuh.js → react-C6ZyRyfn.js} +1 -1
- package/dist/assets/{react-Bja4MeVO.js → react-CxBgzLVF.js} +1 -1
- package/dist/assets/{react-Dex3foBA.js → react-a48nQACt.js} +1 -1
- package/dist/assets/{react-RZilWHYG.js → react-bpjj59R_.js} +1 -1
- package/dist/assets/{react-DkYBVdJJ.js → react-uoYsSJ7d.js} +1 -1
- package/dist/assets/{recharts-uFX1dZS-.js → recharts-D3wE7yHJ.js} +1 -1
- package/dist/assets/{routePaths-uBvxqlLY.js → routePaths-DeWRBZpS.js} +1 -1
- package/dist/assets/{sentry-DHDsO12F.js → sentry-BRmieicQ.js} +1 -1
- package/dist/assets/{url-CLCy7GPP.js → url-BAbGMJa_.js} +1 -1
- package/dist/assets/{url-BxiN6LKq.js → url-DXDQoAPC.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D8KJqvT7.js → useAiCfoDashboardSuggestedQuestionsChips-SoHaFZ4W.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BOgWSkqa.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-BnH8_thb.js → useChargeCardPusherEvents-C1Fc6NgG.js} +1 -1
- package/dist/assets/{useDeviceId-Bi38IJl0.js → useDeviceId-CZzjV8tQ.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-Ba8t-BuL.js → useEmailConnectResultRefresh-DtruKk0s.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-7Q8HJAH2.js → useInitialThreadRequest-BJ6-q-Ev.js} +1 -1
- package/dist/assets/useTaskManagerAccess-Bm40mz18.js +1 -0
- package/dist/assets/{utils-BsODCDYR.js → utils-UMm0RYR6.js} +1 -1
- package/dist/assets/withTransactionSidePanel-aokrUwcT.js +25 -0
- package/dist/assets/{zeni-epic-state-7eY0g-Bc.js → zeni-epic-state-cafsD4rZ.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +6 -6
- package/dist/assets/AccountMappingScreen-Euit4Ttk.js +0 -9
- package/dist/assets/ActualMatchingMatchDetailScreen-BBYzjOqh.js +0 -1
- package/dist/assets/AddressRoutes-PvYGzHCA.js +0 -1
- package/dist/assets/AddressScreen-DsGvV3N8.js +0 -9
- package/dist/assets/AiCfoScreen-DAEPn0_B.js +0 -22
- package/dist/assets/BillPayRoutes-CWc4tAqm.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-CSruI1nV.js +0 -9
- package/dist/assets/CardsAiCfoScreen-COoYscKz.js +0 -14
- package/dist/assets/ChargeCardRoutes-BU6-pfJv.js +0 -71
- package/dist/assets/CompanyPassportScreen-BxoatMVb.js +0 -1
- package/dist/assets/ConnectionAuthScreen-zbcvhPbz.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-8IwDeKdF.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DgE28aJN.js +0 -18
- package/dist/assets/EntityDetailRoutes-BqX-J3vM.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-DK-U-YTd.js +0 -38
- package/dist/assets/FeaturePreviewScreen-5SleVFKv.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-2RxbRDTZ.js +0 -1
- package/dist/assets/InboxNotificationsProvider-BmF5-_KA.js +0 -1
- package/dist/assets/InvoicingRoutes-D0S6fDxY.js +0 -2
- package/dist/assets/MagicLinkRoutes-C22EnpRm.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-BVf-rLEH.js +0 -12
- package/dist/assets/MobileAppDrawer-0YtWXA3B.js +0 -1
- package/dist/assets/NotFoundScreen-BkYIKPgh.js +0 -1
- package/dist/assets/NotificationRoutes-CZQRvVbE.js +0 -1
- package/dist/assets/OAuthConsentScreen-Q7ZDvc1F.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BzO_OgSq.js +0 -1
- package/dist/assets/PeopleRoutes-D_nqmuPM.js +0 -22
- package/dist/assets/PerformanceRoutes-BW6dixVF.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-DAusugdf.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-phJuB98f.js +0 -1
- package/dist/assets/ReportsRoutes-CDSCG28G.js +0 -1
- package/dist/assets/RewardsRoutes-CHkOPz1g.js +0 -1
- package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-DnVEpQsK.js +0 -33
- package/dist/assets/ScreenRoutes-BYAPWka6.js +0 -2
- package/dist/assets/SignInScreen-BREpWd6T.js +0 -1
- package/dist/assets/SignOutScreen-BNCpbut8.js +0 -9
- package/dist/assets/TaskRoutes-CDuiJExM.js +0 -9
- package/dist/assets/TransactionDetailRoutes-CYb-4jKQ.js +0 -1
- package/dist/assets/TransactionListRoutes-B6NIJUWk.js +0 -1
- package/dist/assets/WiseConfirmationScreen-Bg5_g49N.js +0 -12
- package/dist/assets/ZeniAccountRoutes-C3fDjuMG.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-CbdRQI0p.js +0 -9
- package/dist/assets/epic-mSW644GG.js +0 -2
- package/dist/assets/expenseAutomationHelper-DBDpSggk.js +0 -1
- package/dist/assets/index-6yt3BfRL.js +0 -1
- package/dist/assets/stripSplatSuffix-CQQXAy0N.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-OCZsPxr6.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BsP5fVhq.js +0 -1
- package/dist/assets/useTaskManagerAccess-BG0Fkj9k.js +0 -1
- package/dist/assets/withTransactionSidePanel-DK-Ex27L.js +0 -25
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as U}from"./liveblocks-DTaiayIC.js";import{a as o}from"./sentry-BRmieicQ.js";import{h as Y,g as Z,u as H,j as m,s as $,l as K}from"./core-DA_GbUVO.js";import{ai as W,M as ee,y as q,z as te,n as G,aj as ne,h as ae,S as ce}from"./index-CsnAk3jU.js";import{bn as se,fE as oe,gU as ie,oA as Q,TX as re,i7 as J,gg as le,or as ue,TY as de,TZ as pe,tA as ge,l_ as me,op as be,ol as Ae,ow as ye,i9 as Ie,T_ as fe,T$ as Se}from"./zeni-epic-state-cafsD4rZ.js";import{n as he}from"./mui-yMDYeeMr.js";import{M as Ee}from"./MobileAppDrawer-cBt39NZW.js";import{q as R}from"./QBOConnectionScreen-UblfZAiA.js";import{g as h,a as E,m as ze}from"./accountMappingHelper-C7mDOec7.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="b9b3ab58-3665-4b5c-b349-7f8485b1741a",a._sentryDebugIdIdentifier="sentry-dbid-b9b3ab58-3665-4b5c-b349-7f8485b1741a")}catch{}})();const l="zeni_pending_projects_enable",u={pending:"pending",ready:"ready"},we=he.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: ${a=>a.theme.colors.grey4};
|
|
9
|
+
`,ve=K((function(a,e){return{accountMappingView:e.accountMappingView,isFiling1099FeatureEnabled:e.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:e.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:me(a),isAccountingClassesUpdateInProgress:a.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:ge(a),isAccountingProjectsUpdateInProgress:(()=>{const i=sessionStorage.getItem(l),c=i===u.pending||i===u.ready;return a.companyViewState.passportView?.accountingProjectsUpdateStatus?.fetchState==="In-Progress"||c})(),isCapitalizationFeatureEnabled:e.isCapitalizationFeatureEnabled,capitalizableAccounts:e.capitalizableAccounts,accountNamesById:e.accountNamesById,capitalizableAccountOverrides:e.capitalizableAccountOverrides,isCapitalizationThresholdSaving:e.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:e.onSaveCapitalizationAccountThreshold}}),(function(a,e){const{navigate:i,location:c,isFiling1099FeatureEnabled:b}=e;return{onAccountMappingChange:r=>{const{uncategorizedAccountSection:d,billsAccountSection:z,reimbursementsAccountSection:w,vendorsAccountSection:v,filing1099Section:C}=r,{incomeAccount:x,expenseAccount:T}=d,{billPayAccount:s}=z,{reimbursementsAccount:F}=w,{prepaidExpensesAccount:p,fixedAssetsAccount:V,accruedExpensesAccount:M}=v,{bankAccount:O,expenseCategory1099:_}=C,A=h(e.accountMappingView.incomeAccountList,x.selectedOption),j=h(e.accountMappingView.expenseAccountList,T.selectedOption),y=h(e.accountMappingView.billPayAccountList,s.selectedOption),P=h(e.accountMappingView.reimbursementsAccountList,F.selectedOption),k=E(e.accountMappingView.prepaidExpensesAccountList,p.selectedOptions),L=E(e.accountMappingView.fixedAssetsAccountList,V.selectedOptions),I=E(e.accountMappingView.accruedExpensesAccountList,M.selectedOptions),D=E(e.accountMappingView.bankAccounts1099FilingAccountList,O.selectedOptions),f=ze(e.accountMappingView.expenseAccounts1099FilingAccountList,_),t={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:j?.accountId,selectedBillPayAccountId:y?.accountId,selectedReimbursementsAccountId:P?.accountId,selectedPrepaidExpensesAccountIds:k.map((n=>n.accountId)),selectedFixedAssetsAccountIds:L.map((n=>n.accountId)),selectedAccruedExpensesAccountIds:I.map((n=>n.accountId)),selectedBankAccounts1099FilingAccountIds:D.map((n=>n.accountId)),selectedExpenseAccounts1099FilingAccountIds:f};a(Se({data:t}))},onBackClick:()=>{G(c)===!1?(i("../../dashboard"),a(fe())):a(J())},onSaveClick:()=>{a(Ie()),b&&ae.track(ce.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:r=>{a(ye(e.currentTenant.companyId,r))},onAccountingProjectsToggle:r=>{const d=sessionStorage.getItem(l);d===u.pending||d===u.ready||a(r?be(e.currentTenant.companyId):Ae(e.currentTenant.companyId))}}}))(ne),Pe=()=>{const a=W(),e=Y(),i=Z(),c=H(),{useFeatureGate:b,useDynamicConfig:r}=ee(),{isFeatureEnabled:d}=b(q.isFiling1099FeatureEnabled),{isFeatureEnabled:z}=b(q.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:w,isDynamicConfigLoading:v}=r("transaction_categorization_config"),C=!v&&w?.capitalization_enabled===!0,x=te.getSignedInUser(),T=se(x),s=m((t=>oe(t))),{capitalizableAccounts:F,capitalizableAccountOverrides:p,isCapitalizationThresholdSaving:V,currencySymbol:M}=m((t=>{const n=t.tenantState.currentTenantId,g=n!=null?t.tenantState.tenantsById[n]:void 0,S=ie(t.companyState,s.companyId);return{capitalizableAccounts:g?.capitalizableAccounts??null,capitalizableAccountOverrides:g?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:t.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:S?.company.companyLocaleInfo?.currencySymbol??"$"}}),$),O=o.useCallback(((t,n)=>{c(Q(s.companyId,t,n))}),[c,s.companyId]),_=o.useCallback((t=>{const n={...p??{}},g=Object.entries(t);for(const[B,N]of g)N===null?delete n[B]:n[B]=N;const[S,X]=g[0]??[];S!=null&&c(Q(s.companyId,S,X,void 0,Object.keys(n).length>0?n:null))}),[c,s.companyId,p]),A=m((t=>re(t.accountState)),$),j=o.useMemo((()=>{const t={};for(const n of A)n.accountId!=null&&n.accountName!=null&&(t[n.accountId]=n.accountName);return t}),[A]),[y,P]=o.useState(!1),[k,L]=o.useState(!1);o.useEffect((()=>{y===!1&&(c(J()),P(!0))}),[y]);const I=m((t=>t.companyViewState.passportView?.needsQboProjectsReconnect===!0));o.useEffect((()=>{sessionStorage.getItem(l)===u.pending&&(sessionStorage.removeItem(l),c(le({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})))}),[c]),o.useEffect((()=>{sessionStorage.getItem(l)===u.ready&&s?.companyId!=null&&(sessionStorage.removeItem(l),c(ue(s.companyId)))}),[s?.companyId,c]),o.useEffect((()=>{I&&s?.tenantEmailDomain!=null&&(sessionStorage.setItem(l,u.pending),c(de()),R.init("/connection/auth",s.tenantEmailDomain),R.handleClick())}),[I,s?.tenantEmailDomain,c]);const D=m((t=>pe(t))),f=t=>{L(t)};return U.jsxs(we,{children:[U.jsx(Ee,{isAppContentDrawerOpen:k,handleDrawerToggle:f}),U.jsx(ve,{currentTenant:s,navigate:e,meetingUrl:a("account_mapping"),accountMappingView:D,isFiling1099FeatureEnabled:d&&T,isAccruedExpensesFeatureEnabled:z,isCapitalizationFeatureEnabled:C,capitalizableAccounts:F,accountNamesById:j,capitalizableAccountOverrides:p,currencySymbol:M,isCapitalizationThresholdSaving:V,onSaveCapitalizationAccountThreshold:O,onSaveCapitalizationAccountThresholds:_,location:i,isSettings:G(i),onClickMenuIcon:()=>f(!0)})]})};export{l as P,Pe as U,u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-DTaiayIC.js";import{A as o}from"./AddressScreen-C9Fk_Z55.js";import i from"./NotFoundScreen-DFQDCCRn.js";import"./sentry-BRmieicQ.js";import{n as s,o as r}from"./core-DA_GbUVO.js";import"./zeni-epic-state-cafsD4rZ.js";import"./recharts-D3wE7yHJ.js";import"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="31d0e0e8-dcf1-419d-b2be-6dc359df28c9",t._sentryDebugIdIdentifier="sentry-dbid-31d0e0e8-dcf1-419d-b2be-6dc359df28c9")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(o,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(o,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-DTaiayIC.js";import{a as b}from"./sentry-BRmieicQ.js";import{h as T,u as P,g as E,i as j,j as B,l as D}from"./core-DA_GbUVO.js";import{a1 as M,E as U,z as $,V as L,a7 as K,a8 as z,h as C,S,a3 as F,Y as h,a4 as G}from"./index-CsnAk3jU.js";import{UC as _,io as R,fE as V,UD as N,c8 as O,UE as q,mG as H}from"./zeni-epic-state-cafsD4rZ.js";import{n as Y}from"./mui-yMDYeeMr.js";import J from"./NotFoundScreen-DFQDCCRn.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]="607a4d98-0bcb-4c82-ad1b-2d5264cac02d",e._sentryDebugIdIdentifier="sentry-dbid-607a4d98-0bcb-4c82-ad1b-2d5264cac02d")}catch{}})();const Q=Y.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
|
+
`,W=D((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=V(e),a=s.roleMap!=null&&N(s.roleMap),d=i||c==="user_address"||O(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=q(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const r=_(e,o);return{addressToEdit:r.address,loadingState:r.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d}}),(function(e,s){const{navigate:o,location:i,addressType:c}=s,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,r=G(d?.pathnameStackToGoBack);let t=r.poppedPathname??v();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(t=`${t}?${g}`)}o(t,{state:{pathnameStackToGoBack:r.newStack}})}};return{onSubmitHandler:a=>{const d=X(a);e(H({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(s.bankAccountContext)},onCancel:()=>{l(s.bankAccountContext)}}}))(F);function ne({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=P(),r=E(),{addressId:t,addressType:u}=j(),g=M(),I=U(),k=$.getSignedInUser(),[p,w]=b.useState(t==null),f=B((m=>t!=null?_(m,t).fetchState:"Not-Started")),x=L();if(k==null)throw Error("Can't access address page without signing in...");const A=m=>m.trackPageLoaded(t!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return b.useEffect((()=>{p||t==null||(w(!0),d(R(t,!1)))}),[p,t,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address|invoicing_customer_billing_address|invoicing_subscription_shipping_address|invoicing_business_address)$/g)?!p&&f==="Not-Started"||p&&f==="In-Progress"?n.jsx(K,{fetchState:f,style:{backgroundColor:I.colors.grey5}}):t!=null&&f==="Error"?(a(`${v(1)}/new`,{replace:!0}),n.jsx(n.Fragment,{})):n.jsxs(n.Fragment,{children:[n.jsx(z,{analytics:C,onLoad:A}),n.jsx(Q,{windowSize:g,children:n.jsx(W,{location:r,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:t,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):n.jsx(J,{})}const v=(e=2)=>{let s="../";for(let o=0;o<e;o++)s=`${s}../`;return s},X=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});export{ne as A,X as t};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as S}from"./liveblocks-DTaiayIC.js";import{a}from"./sentry-BRmieicQ.js";import{u as Tt,h as Rt,i as jt,g as Ot,j as b,l as At}from"./core-DA_GbUVO.js";import{a as Qt,g as Dt,e5 as Lt,z as Ut,a1 as _t,e6 as Ft,e7 as Bt,e8 as Mt,bo as Ae,e9 as Ne,ea as $t,bn as qe,a4 as me,a8 as re,h as F,eb as le,ec as Vt,ed as Nt,au as qt,S as Gt,w as Ht,ee as zt,ef as Wt,av as Jt,eg as Yt,eh as Kt,ei as Xt,ej as Zt,p as es,bk as Qe,ek as ts}from"./index-CsnAk3jU.js";import{fD as _,gs as y,Tl as ss,a1o as as,a1p as ns,jL as os,a1q as is,jI as rs,a1r as ue,jC as de,jS as z,jk as Se,jA as De,jy as ls,jP as us,jt as Ge,Tu as Le,gu as B,gJ as ds,Tt as cs,Te as Ue,fE as ms,j2 as Ss,a1s as hs,g7 as ps,jg as fs,jc as gs,fF as ce,ge as Cs,a1t as Is,a1u as ks,a1v as bs,gt as vs,gn as _e,k3 as Fe,gp as Be,gv as Es,a1w as Me,jU as Ps,j9 as ws,jn as ys,jQ as $e,jq as xs,gw as Ts,gx as Rs,gy as js,gz as Os}from"./zeni-epic-state-cafsD4rZ.js";import{D as As,n as M,S as Qs,P as Ds}from"./mui-yMDYeeMr.js";import{u as Ls}from"./useAiCfoDashboardSuggestedQuestionsChips-SoHaFZ4W.js";import{p as Us}from"./pathToGoBack-nmNIndUw.js";import{j as _s}from"./routePaths-DeWRBZpS.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="c987ed89-121e-4a25-95c9-2b6f489734bf",s._sentryDebugIdIdentifier="sentry-dbid-c987ed89-121e-4a25-95c9-2b6f489734bf")}catch{}})();const He="chat-response-generated";function Fs(s,r){if(r.kind!=="save")return;if(r.fetchState==="In-Progress")return{status:"saving"};if(r.fetchState==="Error")return{status:"failed"};if(r.fetchState!=="Completed")return;const t=y(s).skills.find((l=>l.macroId===r.savedMacroId));return t==null?void 0:{status:"saved",command:t.name}}const Bs=At((function(s,r){const t=_(s),l=r.isSubmitting,d=t.uiState?.currentChatSessionId,i=d!=null?Cs(s.aiCfoState,d):[],f=Wt(s,{allUsers:r.allUsers,onCardPolicyVendorSearchTextChange:r.onCardPolicyVendorSearchTextChange}),p=Is(s),m=ks(s),R=bs(s);return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:l,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Jt}/tableDownload`,exportDownloadEndPoint:Xt(),emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,skills:y(s).skills,skillSaveState:Fs(s,R),skillsEnabled:y(s).skillsEnabled,skillsList:y(s).skills,skillsListError:y(s).fetchState==="Error",skillsListLoading:y(s).fetchState==="In-Progress",skillsCanPublish:y(s).canPublish,skillSaving:R.fetchState==="In-Progress",skillSaveError:R.fetchState==="Error",skillVersionHistory:p.macroId!=null?{macroId:p.macroId,versions:p.versions,error:p.fetchState==="Error",loading:p.fetchState==="In-Progress"}:void 0,skillRestoreBody:m.macroId!=null&&m.version!=null?{macroId:m.macroId,version:m.version,instructions:m.instructions,error:m.fetchState==="Error",loading:m.fetchState==="In-Progress"}:void 0,skillDetail:z(s).detail,skillDetailError:z(s).fetchState==="Error",skillDetailLoading:z(s).fetchState==="In-Progress",syntheticAnswers:i,resolveSyntheticAnswerCardTile:Kt(s),resolveSyntheticAnswerPolicyTile:Yt(s),...f}}),(function(s,r){const{location:t,currentTenant:l,userId:d,navigate:i,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:p,isAiCardCreationEnabled:m,isCardPolicyEnabled:R,setIsAiCfoOpen:A}=r,Q=l.tenantEmailDomain;return{onEventReceived:(n,o)=>{if(n===He&&typeof o.text=="string"&&typeof o.metadata=="object"){const c=o,E=Ts(c.type),v=c.metadata.chat_session_id??null,{currentChatSession:W,currentQuestionAnswer:x,currentQuestionAnswerSummary:J}=qe(p,v);E!=="answer"?F.trackAICFOChatResponseGenerated(E,x?.question.questionText??"",c.text,v,ts(J,W),c.metadata.message_id??null):F.trackAICFOChatAnswerGenerated(c.text,x?.question.questionText??"",(c.follow_up_questions?.length??0)>0,!!c.assumptions,!!c.insights,c.visualization!=null,Rs(c.visualization?.type??"")??null,v,c.summarized_title,c.metadata.message_id??null),s(js({chatSessionId:c.metadata.chat_session_id,responseType:E,fetchState:{fetchState:"Completed",error:void 0}})),s(Os({chatSessionId:c.metadata.chat_session_id,answerPayload:c,userId:d}))}},onSubmit:(n,o,c,E,v)=>{n&&Qe(s,n,o,f,p,d,E,c,void 0,v)},onFetchSkills:()=>{s(Ge())},onOpenSkill:n=>{s(Se({macroId:n})),s(xs({macroId:n}))},onSaveSkill:(n,o)=>{s($e({draft:n,macroId:o}))},onSaveSkillDraft:n=>{const o=n.displayName?.trim()??"",c=n.name?.trim()??"";s($e({draft:{name:o.length>0?o:c,description:n.description?.trim()??null,instructions:n.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(n,o)=>{s(ys({macroId:n,version:o}))},onDeleteSkill:n=>{s(ws({macroId:n}))},onSetSkillVisibility:(n,o)=>{s(Ps({macroId:n,visibility:o}))},onCloseSkillDetail:()=>{s(Me())},onRunSkill:(n,o)=>{s(B()),s(_e()),Qe(s,o,"user_input",void 0,p,d,void 0,void 0,void 0,n),s(Me())},updateCurrentInput:n=>{s(Be(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{s(Es(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{i(-1)},onCloseClick:()=>{const n=me(t.state?.pathnameStackToGoBack),o=n.poppedPathname??Us(1);i(o,{state:{...t.state,pathnameStackToGoBack:n.newStack}}),s(Be(""))},togglePageView:()=>{const n=me(t.state?.pathnameStackToGoBack),o=n.poppedPathname??`/${l.tenantEmailDomain}/dashboard`;i(o,{state:{...Ne(t.state),pathnameStackToGoBack:n.newStack,message:"open_ai_cfo_drawer"}}),A(!0)},onCopy:()=>{},onThumbsUp:(n,o)=>{f!=null&&o?.messageId!=null&&s(Fe(f,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(n,o)=>{f!=null&&o?.messageId!=null&&s(Fe(f,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{i(-1)},onNewChatClick:()=>{s(B()),f!=null&&s(_e());const n=es(t.state?.pathnameStackToGoBack,t.pathname);i(`/${l.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:n.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(n,o)=>{s(vs({questionAnswerId:n,isCollapsed:o}))},onMenuClick:r.onMenuClick,...Zt(s,{isAiCardCreationEnabled:m,isCardPolicyEnabled:R,currentChatSessionId:f,onAfterCardsCreationSubmit:()=>{A(!0),i(`/${Q}/cards`,{state:{...t.state}})},onAfterCardPolicySubmit:()=>{A(!0),i(`/${Q}/cards/policy`,{state:{...t.state}})}})}}))(Ht(zt)),la=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Qt(),t=Tt(),l=Rt(),{session_id:d}=jt(),i=Ot(),f=new URLSearchParams(i.search).get("routine")??void 0,[p,m]=a.useState(!1),R=b((e=>_(e).uiState.isSkillsBrowserOpen===!0)),A=b((e=>y(e).skillsEnabled)),Q=b((e=>_(e).uiState.isRoutinesBrowserOpen===!0)),n=b((e=>ss(e))),o=b((e=>as(e))),c=b((e=>ns(e))),[E,v]=a.useState(void 0),[W,x]=a.useState(!1),[J,he]=a.useState(void 0),ze=a.useCallback((()=>{he(void 0),v(void 0),x(!0)}),[]),We=a.useCallback((e=>{v(e),x(!0)}),[]),Je=a.useCallback((()=>{v(void 0),x(!1)}),[]),Ye=a.useCallback((e=>{t(os({draft:e,...E!=null&&{scheduleId:E.scheduleId}})),v(void 0),x(!1)}),[t,E]),j=f,pe=n.routines.find((e=>e.scheduleId===j)),C=b((e=>is(e))),Ke=a.useCallback((e=>{t(rs({scheduleId:e.scheduleId}))}),[t]);a.useEffect((()=>{t(j!=null?de({scheduleId:j}):ue())}),[t,j]);const L=pe?.macroId,Xe=b((e=>z(e))),fe=L!=null&&L!==""&&Xe.fetchState==="Not-Started";a.useEffect((()=>{fe&&L!=null&&t(Se({macroId:L}))}),[t,fe,L]);const Ze=b((e=>_(e).uiState.currentChatSessionId))??d,I=n.routines.find((e=>e.scheduleId===f))??n.routines.find((e=>e.scheduleId===Dt(Ze))),U=I?.scheduleId??null,[ge,et]=a.useState(!0);a.useEffect((()=>{U!=null&&t(de({scheduleId:U}))}),[t,U]);const Ce=C.runs.some((e=>e.status==="claimed"||e.status==="running"))===!0;a.useEffect((()=>{if(j==null||Ce!==!0)return;const e=window.setInterval((()=>{t(de({scheduleId:j})),t(De())}),5e3);return()=>window.clearInterval(e)}),[t,Ce,j]);const tt=a.useCallback((e=>{he(e),v(void 0),x(!0)}),[]),st=a.useCallback((e=>{t(ls({scheduleId:e.scheduleId}))}),[t]),at=a.useCallback(((e,h)=>{t(us({enabled:h,scheduleId:e.scheduleId}))}),[t]);a.useEffect((()=>{Q&&t(De())}),[t,Q]);const Ie=b((e=>y(e).skills)),Y=a.useMemo((()=>Ie.map((e=>({macroId:e.macroId,name:e.displayName??e.name})))),[Ie]),nt=a.useCallback((e=>{t(Se({macroId:e}))}),[t]),K=a.useCallback((()=>{t(Ge()),t(Le())}),[t]),ot=a.useCallback((()=>{t(B())}),[t]),{allUsers:it,isAiCardCreationEnabled:rt,isCardPolicyEnabled:lt,onCardPolicyVendorSearchTextChange:ut}=Lt();a.useEffect((()=>{t(ds())}),[t]);const g=b((e=>_(e))),T=Ut.getSignedInUser();a.useEffect((()=>d==="routines"?(t(B()),void t(cs())):d==="skills"?(t(ue()),t(Ue()),void t(Le())):(U==null&&t(ue()),t(Ue()),void t(B()))),[t,U,f,d]);const dt=_t(),O=qt(dt),k=b((e=>ms(e))),u=g.uiState.currentChatSessionId,P=k.tenantEmailDomain,D=P!=null&&P!=="",X=a.useCallback((e=>{D&&l(`/${P}/ai-cfo/routines?routine=${encodeURIComponent(e.scheduleId)}`)}),[D,l,P]),Z=a.useCallback((()=>{D&&l(`/${P}/ai-cfo/routines`)}),[D,l,P]),ee=a.useCallback(((e,h)=>{const H=e.sessionId??C.sessionId;H!=null&&D&&l(`/${P}/ai-cfo/${H}?routine=${encodeURIComponent(h)}`)}),[D,l,C.sessionId,P]),ct=a.useMemo((()=>I==null?void 0:{error:C.fetchState==="Error",kind:"routineRuns",loading:C.fetchState==="In-Progress"||C.fetchState==="Not-Started",routineName:I.name,schedule:Ft(I),skillName:I.isAdHoc===!0?void 0:Y.find((e=>e.macroId===I.macroId))?.name,onOpenSkill:I.isAdHoc===!0?void 0:K,runs:C.runs,tzName:I.tzName,unreadCount:I.unreadRuns,open:ge,onToggle:()=>et((e=>!e)),onOpenRun:e=>ee(e,I.scheduleId),onOpenRoutine:()=>X(I),onOpenRoutines:Z}),[K,Z,X,ee,ge,I,C.fetchState,C.runs,Y]),{handleUploadPromoClose:mt,isUploadPromoVisible:St}=Bt({isFileUploadEnabled:s,tenantEmailDomain:P}),te=Mt({currentTenant:k,currentChatSessionId:u,aiCfoView:g,skillsEnabled:A,onCloseSkills:ot,onOpenSkills:K}),{isSuggestedQuestionsLoading:ht,suggestedPromptQuestions:pt}=Ls(),$=i.state,V=$?.aiCfoInitialQuestion,ke=!!$?.aiCfoShouldSubmit;a.useEffect((()=>{const e=i.state;if(e?.[Ae]!==!0)return;m(!0);const h={...e};delete h[Ae],l(i,{replace:!0,state:h})}),[i.pathname,i.search,i.state,l]);const[ft,se]=a.useState(null),[gt,ae]=a.useState(!1),[Ct,ne]=a.useState(void 0),[It,oe]=a.useState(void 0),be=a.useRef(!1);a.useEffect((()=>{if(!be.current&&V!=null&&V!==""){const e=i.state;se(V),ae(ke),ne(e?.aiCfoInitialSubmissionSource!=null?e.aiCfoInitialSubmissionSource:void 0);const h=e?.aiCfoSuggestionIndex;oe(typeof h=="number"?h:void 0),be.current=!0}}),[V,ke,i.state]);const kt=a.useCallback((()=>{se(null),ae(!1),ne(void 0),oe(void 0),l(i.pathname,{replace:!0,state:Ne(i.state)})}),[i.pathname,i.state,l]),ve=a.useMemo((()=>new URLSearchParams(i.search)),[i.search]),Ee=ve.get("ref")??$?.aiCfoRef,ie=ve.get("emailRefId")??$?.aiCfoEmailRefId,Pe=a.useRef(!1);a.useEffect((()=>{Pe.current||Ee!=="month-end-email"||ie==null||u!=null||T==null||(t(Ss("controller",T.userId,ie,"MONTH_END_EMAIL")),Pe.current=!0)}),[Ee,ie,u,t,T]);const N=g.uiState.lastContextMessage;a.useEffect((()=>{N!=null&&N!==""&&u!=null&&(se(N),ae(!0),ne(void 0),oe(void 0),t(hs()))}),[N,u,t]);const bt=k.masterTOSInfo,w=bt?.isMasterTOSAccepted??!1,{visitedSessions:we}=$t(u),q=g.fetchState,G=g.uiState.chatSessionsNextPageToken.hasMore||!g.uiState.chatSessionsFirstPageFetched,ye=u!=null?g.fetchChatSessionHistoryByChatSessionId?.[u]?.fetchState??"Not-Started":"Not-Started",xe=u==null||(g.uiState.chatHistoryNextPageToken[u]?.hasMore??!0),Te=g.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:vt}=qe(Te,u),Et=vt.length===0;a.useEffect((()=>{w||O||l("../dashboard",{state:{...i.state,message:"open_ai_cfo_drawer"}})}),[w,O,l,i.state]);const Pt=a.useCallback((()=>{const e=me(i.state?.pathnameStackToGoBack),h=k.tenantEmailDomain;l(e.poppedPathname??(h!=null?`/${h}/dashboard`:".."),{state:{...i.state,pathnameStackToGoBack:e.newStack}})}),[k.tenantEmailDomain,i.state,l]),Re=a.useRef(void 0),je=a.useRef(void 0);a.useEffect((()=>{const e=d!==Re.current,h=u!==je.current;Re.current=d,je.current=u,d!==u&&(!e||d==null||_s(d)?h&&u!=null&&l(`../ai-cfo/${u}`,{state:{...i.state}}):t(ps({sessionId:d,agentId:"controller"})))}),[u,d]);const wt=a.useMemo((()=>({events:we.map((e=>`private-encrypted-chat-${e}.${He}`)),eventCallback:(e,h,H)=>H.onEventReceived(e,h)})),[we]);a.useEffect((()=>{q!=="In-Progress"&&G&&t(fs())}),[q,G,t]),a.useEffect((()=>{u!=null&&ye!=="In-Progress"&&xe&&T!=null&&(d===u||q==="Completed"&&!G)&&t(gs(u,T.userId))}),[ye,q,xe,G,u,T,d,t]);const Oe=e=>e.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(T==null||d==null)throw Error("Can't access AI Controller page without signing in...");const yt=u!=null&&g.responseStateByChatSessionId?.[u]?.answer?.fetchState==="In-Progress";if(!w&&O)return S.jsxs($s,{children:[S.jsx(re,{analytics:F,onLoad:Oe}),te.drawerElement,S.jsx(Vs,{children:S.jsx(Ve,{children:S.jsx(le,{isTOSAccepted:!1,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:Pt,onCompleteClick:()=>{k.userRoleId!=null&&t(ce(k.userRoleId))}})})})]});const xt=S.jsxs(S.Fragment,{children:[p&&!w?S.jsx(re,{analytics:F,onLoad:Oe}):null,S.jsx(le,{isTOSAccepted:w,acceptMasterTOSState:g.masterTOSAcceptanceState,showHeader:!1,togglePageView:w?()=>m(!1):void 0,onCloseClick:()=>m(!1),onCompleteClick:()=>{w||k.userRoleId==null||t(ce(k.userRoleId)),m(!1)}})]});return S.jsxs(S.Fragment,{children:[S.jsxs(Ms,{children:[S.jsx(re,{analytics:F,onLoad:e=>e.trackPageLoaded(Gt.Event.aiCFOPage)}),O&&te.drawerElement,S.jsx(Bs,{...wt,currentChatSessionId:u,allSessionsWithOrderedQuestionAnswers:Te,allUsers:it,isAiCardCreationEnabled:rt,isCardPolicyEnabled:lt,openOnboardingPage:()=>m(!0),userId:T.userId,setIsAiCfoOpen:r,navigate:l,sessionFromUrl:d,location:i,isSubmitting:yt,isEmptyChatWithSession:Et,currentTenant:k,emailLinkQuestion:ft??void 0,autoSubmitEmailLinkQuestion:gt,onEmailLinkQuestionProcessed:kt,routedInitialQuestionSource:Ct,routedInitialQuestionSuggestionIndex:It,onCardPolicyVendorSearchTextChange:ut,onMenuClick:O?te.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:St,onUploadPromoClose:mt,exploreSuggestedPromptQuestions:pt,exploreSuggestedPromptQuestionsLoading:ht,isSkillsOpen:R,isRoutinesOpen:Q,routineCanCreate:c,routineEditing:E,routineEditorOpen:W,routineListError:n.fetchState==="Error",routineListLoading:n.fetchState==="In-Progress",routineMaxRoutines:n.maxRoutines,routineSaveError:o.fetchState==="Error",routineSaving:o.fetchState==="In-Progress",routineSchedulableSkills:Y,routines:n.routines,onRoutineCreate:ze,onRoutineDelete:st,routineHistoryError:C.fetchState==="Error",routineHistoryLoading:C.fetchState==="In-Progress",chatSidePanel:ct,routineDetail:pe,routineRunningScheduleId:o.runningScheduleId,routineRuns:C.runs,onRoutineEdit:We,onRoutineOpenRun:(e,h)=>ee(h,e.scheduleId),onRoutineRun:Ke,onRoutineCloseDetail:Z,onRoutineDraft:tt,routineDraftPrompt:J,onRoutineOpenDetail:X,onRoutineEditorCancel:Je,onRoutineLoadSkillInstructions:nt,onRoutineSave:Ye,onRoutineSetEnabled:at,isCreateSkillEnabled:A,promoDismissalScope:P}),p&&O?S.jsx(As,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:Ns,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>m(!1),children:S.jsx(Ve,{onClick:e=>e.stopPropagation(),children:S.jsx(le,{isTOSAccepted:w,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:()=>m(!1),onCompleteClick:()=>{w||k.userRoleId==null||t(ce(k.userRoleId)),m(!1)}})})}):null]}),p&&!O?S.jsx(Vt,{open:p,onClose:()=>m(!1),children:S.jsx(Nt,{children:xt})}):null]})},Ve=M(Qs)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,Ms=M.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,$s=M.div`
|
|
9
|
+
height: 100vh;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
`,Vs=M.div`
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
`,Ns=M(Ds)`
|
|
20
|
+
box-shadow: ${({theme:s})=>s.colors.elevation2};
|
|
21
|
+
color: ${({theme:s})=>s.colors.grey4};
|
|
22
|
+
`;export{la as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-UOzcPsHa.js";import{a as o,R as va}from"./sentry-DHDsO12F.js";import{u as Me,j as r,g as ya,h as $a,q as G}from"./core-B5mDy9pu.js";import{fF as Fe,TM as Ba,TN as Re,g9 as xa,gv as Q,TO as X,ju as Te,jB as Ie,TP as Aa,TQ as _a,gO as Da,p$ as Ma,TR as Fa,TS as ve,gm as Ra,TT as $,fE as Za,gt as Ga,TU as Va,TV as Pa,TW as ja,TX as ye,TY as Ha,TZ as $e,T_ as Na,E1 as La,gn as Ua,h1 as Oa,cV as za,T$ as qa,U0 as Ya,qC as Wa,g8 as Qa,j6 as Xa,U1 as Ja,U2 as Ka,wq as et,go as at}from"./zeni-epic-state-7eY0g-Bc.js";import{w as tt,i as nt,a as ot,M as st,E as rt,N as it,c as m,d as lt,u as dt,e as ct,q as ut,f as mt,g as Ct,R as pt,O as ht,h as ft,z as gt,j as V,p,m as Be,k as bt,V as St,l as xe,n as kt,o as Ae,r as Et,s as wt,v as K,x as J,y as Tt,A as It,B as vt,L as yt,C as $t,D as Bt,F as ee,H as xt,W as At}from"./index-6nH5LMe4.js";import{A as _t,b as Dt,I as Mt,a as _e,d as Ft,D as De}from"./mui-Do6nLzGb.js";import{u as Rt}from"./InboxNotificationsProvider-BmF5-_KA.js";import{u as Zt}from"./useTaskManagerAccess-BG0Fkj9k.js";import{u as Gt}from"./expenseAutomationHelper-DBDpSggk.js";import"./recharts-uFX1dZS-.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},C=new a.Error().stack;C&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[C]="03e46f3e-279d-4083-9cd1-cc74d7306712",a._sentryDebugIdIdentifier="sentry-dbid-03e46f3e-279d-4083-9cd1-cc74d7306712")}catch{}})();const B="AppDrawer",c={root:`${B}-root`,drawer:`${B}-drawer`,appBar:`${B}-appBar`,menuButton:`${B}-menuButton`,appBarZenilogo:`${B}-appBarZenilogo`,drawerZenilogo:`${B}-drawerZenilogo`},Vt=ee("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:K,flexShrink:0,backgroundColor:a.colors.background}},[`& .${c.appBar}`]:{color:a.colors.primary,backgroundColor:a.colors.background,boxShadow:"none"},"& .MuiToolbar-root":{backgroundColor:a.colors.background},[`& .${c.menuButton}`]:{marginRight:a.spacing(2),[a.breakpoints.up("md")]:{display:"none"}},[`& .${c.appBarZenilogo}`]:{fill:a.colors.primary,cursor:"pointer",width:"100%",marginLeft:a.spacing(-6)},[`& .${c.drawerZenilogo}`]:{margin:`${a.spacing(3)} ${a.spacing(3)} ${a.spacing(0)}`,fill:a.colors.primary,cursor:"pointer"}}))),Pt=tt((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:b}=ot(),[P,A]=va.useState(!1),[S,Ze]=o.useState(!1),t=ya(),s=$a(),ae=xa(),te=st(),n=Me(),[Ge,Ve]=o.useState(!1),j=rt(),ne=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{ne||(n(Q()),n(X()))}),[n,ne]),o.useEffect((()=>{n(Q()),n(X())}),[n,a]);const{useFeatureGate:u}=it(),{isFeatureEnabled:oe}=u(m.isDebitCardFeatureEnabled),k=lt(),i=r((e=>Fe(e))),H=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Pe}=dt(),E=ct(),{isTaskManagerAccessEnabled:_,isZeniUser:je}=Zt(k),se=ut(),w=mt();o.useEffect((()=>{w&&E&&(n(Te()),n(Ie()))}),[n,w,i.tenantId,E]);const[N,He]=o.useState(void 0),Ne=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Le}=u(m.isChargeCardFeatureEnabled),Ue=Ct(i,Le,oe),{isFeatureEnabled:Oe}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:D}=u(m.isReferralFeatureEnabled),ze=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",re=r((e=>Aa(e)));o.useEffect((()=>{const e=()=>{Ve(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const L=r((e=>_a(e))),h=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),f=r((e=>Da(e))),{monthEndCloseChecksView:T}=f,qe=G("/signout")!==null,M=G("/:tenantEmailDomain/dashboard")!==null,ie=G("/:tenantEmailDomain/reports")!==null,g=G("/:tenantEmailDomain/onboarding/*")!==null,le=Gt();o.useEffect((()=>{w&&D&&!g&&L.fetchState==="Not-Started"&&n(Ma(!0))}),[w,D,L.fetchState,g]),o.useEffect((()=>{if(le){const e=t.state?.origin;if(e!=null){const l=Fa(e);l!=null&&n(ve(l))}}}),[le,t.state]);const Ye=qe||g,U=r((e=>e.tenantState)),We=r((e=>U.fetchState==="Completed"?Ra(e):[])),{isFeatureEnabled:Qe}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:Xe}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:Je}=u(m.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ke}=u(m.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ea}=u(m.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:aa}=u(m.isDashboardSidebarNewYearAnimationEnabled),ta=r((e=>$(e).totalUnreadCount)),na=r((e=>$(e).notificationDetailsByTab.tasks.uiState.unreadCount)),oa=r((e=>$(e).notificationDetailsByTab.comments.uiState.unreadCount)),sa=r((e=>$(e).reducedFetchCountState)),de=r((e=>$(e).notificationDetailsByTab.tasks.fetchCountState)),O=r((e=>Za(e))),ra=r((e=>Ga(e).skillsEnabled)),ia=r((e=>Va(e))),ce=r((e=>Pa(e).routines)),la=o.useMemo((()=>ce.filter((e=>e.sessionId!=null)).map((e=>({cadence:pt(e),name:e.name,scheduleId:e.scheduleId,sessionId:e.sessionId,unreadRuns:e.unreadRuns})))),[ce]),da=new URLSearchParams(t.search).get("routine")??ht(t.pathname.split("/ai-cfo/")[1])??void 0,ca=o.useCallback(((e,l)=>{s(l!=null&&l!==""?`/${a}/ai-cfo/${encodeURIComponent(l)}`:`/${a}/ai-cfo/routines?routine=${encodeURIComponent(e)}`)}),[s,a]),{status:ue}=r(ja),[I,z]=o.useState(void 0),q=O.uiState.currentChatSessionId,F=I!=null?O.deleteChatSessionStateByChatSessionId[I]?.fetchState:void 0,me=ft(F),{inboxNotifications:Y,isLoading:Ce,isFetchingMore:pe,hasFetchedAll:he,fetchMore:ua}=Rt(),R=r((e=>$(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>ua?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(I!=null)return me==="In-Progress"&&F==="Completed"?(n(ye({chatSessionId:I})),z(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(F==="Error"&&(n(ye({chatSessionId:I})),z(void 0)))}),[n,t.state,s,F,I,me,a]),o.useEffect((()=>{if(Ce===!1&&pe===!1&&he===!0&&i?.companyId!=null&&Y!=null){const e=`dashboard_${i.companyId}`;He(Y.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[Ce,pe,he,i?.companyId,Y]),o.useEffect((()=>{w&&_&&!g&&de.fetchState==="Not-Started"&&ae.tenantId!=null&&n(Ha("task_manager","dashboard"))}),[w,_,g,de.fetchState,ae.tenantId,n]),o.useEffect((()=>{g||R.fetchState!=="Not-Started"||n($e({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[g,R.fetchState,n]),o.useEffect((()=>{if(N!=null){const{fetchState:e}=R;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n($e({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Re({unreadCount:N},"comments")))}}),[N,R.fetchState]);const ma={fetchStatus:sa,count:ta},v=[];Qe===!1&&v.push("accounts_payable_aging"),Xe===!1&&v.push("accounts_receivable_aging"),v.push("zeni_accounts_promo_card","treasury_promo_card"),D===!1&&v.push("rewards_card"),se===!1&&v.push("expense_automation_card");const fe=r((e=>Na(e,v).fetchState)),ge=r((e=>La(e).fetchState)),be=a!=null?gt.getSignedInUserTenant(a):null,Se=r((e=>be?.tenantId!=null?Ua(e,be.tenantId):void 0)),Ca=M&&(fe==="Completed"||fe==="Error")||ie&&(ge==="Completed"||ge==="Error")||!M&&!ie?void 0:"disabled",pa=o.useMemo((()=>Oa(i.userRole)),[i.userRole]),ha=za(pa),y=e=>{A(e)},fa=ze,ga=i?.rewardsLastViewedTime==null,ba=k?.userEmail!=null&&re.fetchState==="Completed"&&qa(re.notificationSettings,k.userEmail,oe,i,_),Sa=o.useCallback((e=>{const l=t.state?.referrer;if(T.monthEndCloseChecks?.auditSummary!=null&&V.trackMonthCloseAuditPage(e.month,e.year,T.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",T.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(Ya(i.tenantId,e)),h[i.tenantId]!=null){const x=p(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${f.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:x,referrer:f.currentSelectedView}})}n(ve(f.currentSelectedView)),f.reconciliation.selectedAccountId!=null&&n(Wa({selectedAccountId:void 0}))}),[f.reconciliation.selectedAccountId,f.currentSelectedView,i.tenantId,T.monthEndCloseChecks?.auditSummary,T.monthEndCloseChecks?.reportEmailSentDate,h,a,t.state,t.pathname]),ka=o.useMemo((()=>({zIndex:S?12:Be[2]})),[S]),Ea=E&&bt(t),ke=d.jsx(St,{signedInUser:k,currentTenantId:U.currentTenantId??"",tenants:U.fetchState==="Completed"?We:Se!=null?[Se]:[],rewardsConfiguration:{isRewardsTabVisible:D,isRewardsAnimated:ga,rewardsPlan:L.rewardsPlan},selectedMenu:C===!0?Ae("ai_cfo"):xe(t)&&ue!=="completed"?Ae("invoicing"):Et(t),isTenantDropdownDisabled:Ca,isSettings:kt(t),isInvoicing:xe(t)&&ue==="completed",isSettingsFeatureEnabled:Oe,currentTenant:i,isVendorsTabVisible:ha,isZeniAccountEnabled:Ne,isChargeCardEnabled:Ue,isTreasuryEnabled:fa,isNotificationsTabVisible:ba,notificationCountDetails:ma,isExpenseAutomationEnabledForUser:se,isAiCfoAccessEnabled:E,skillsEnabled:ra&&E,routinesEnabled:ia===!0&&E,routines:la,selectedRoutineId:da,onRoutineSelect:ca,onNotificationIconClick:()=>{y(!1);const e=je?na===0&&oa>0?"notifications/comments":"notifications/tasks":"notifications/comments",l=p(t.state?.pathnameStackToGoBack,t.pathname);s(`${a}/${e}`,{state:{pathnameStackToGoBack:l}})},onZeniLogoClick:()=>{te.toggle()},handleTenantSelect:e=>{Pe(yt.TENANT_SWITCHING),y(!1),$t({dispatch:n,navigate:s,pathToNavigate:Bt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,l)=>{if(k!=null&&V.trackSidePanelClicked(e.type,e.group),y(!1),a==null)return;if(e.type==="routines")return H?(n(Ie()),n(Ja()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void J({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return H?(n(Te()),n(Ka()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void J({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(Q()),n(X()),e.type==="invoicing")return C&&b(!1),n(et({cacheOverride:!1})),void s(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(C&&Tt(e.type)&&b(!1),e.type==="ai_cfo"){if(V.trackAICFOChatScreenStateChanged("viewed","left_menu",q??null,null),!H)return void J({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const Z=p(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:Z,referrer:"Sidebar"}})}const x=p(t.state?.pathnameStackToGoBack,t.pathname),W=e.type,we=At(W)&&W!=="command_center";if(W!=="command_center"&&!we||h[i.tenantId]==null||V.trackMonthEndCloseClicked(h[i.tenantId].month,h[i.tenantId].year,"Sidebar"),we&&h[i.tenantId]!=null){const Z=h[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${Z.month}-${Z.year}`,{state:{pathnameStackToGoBack:x,message:l,referrer:"Sidebar"}})}const Ia=It(e.type);vt(e.type)?(q!=null&&n(at()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:x.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${Ia}`,{state:{pathnameStackToGoBack:x,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Xa(e)),q===e&&z(e)},handleLogOutClick:()=>{y(!1);const e=p(t.state?.pathnameStackToGoBack,t.pathname);s("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{s(`${a}/settings/my_profile`)},handleReferralsClick:()=>{s(`${a}/rewards/refer`)},handleBackClick:()=>{s(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:T,onPeriodChange:Sa,onCalendarOpen:Ze,aiCfoView:O,isAiCfo:Ea,isOnDashboard:M,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{n(Qa({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Je,thanksGivingAnimationEnabled:Ke,christmasAnimationEnabled:ea,newYearAnimationEnabled:aa}),wa=d.jsx(_t,{position:"fixed",className:c.appBar,style:{borderBottom:Ge?`1px solid ${j.colors.grey2}`:""},children:d.jsxs(Dt,{style:{minHeight:wt},children:[d.jsx(Mt,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>y(!0),className:c.menuButton,size:"large",children:d.jsx(jt,{})}),d.jsx(Ht,{className:c.appBarZenilogo,onClick:()=>{te.toggle()}})]})}),Ee=_e((e=>e.breakpoints.up("md"))),Ta=_e((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(Vt,{className:c.root,children:[d.jsx(Ft,{}),Ye===!1?d.jsxs(d.Fragment,{children:[Ee||!M?null:wa,d.jsxs("nav",{className:c.drawer,children:[Ee?null:d.jsx(De,{container:window.document.body,variant:"temporary",open:P,onClose:()=>y(!1),PaperProps:{sx:{width:K,zIndex:Be[2],borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background}},ModalProps:{keepMounted:!0},children:ke}),Ta?null:d.jsx(De,{PaperProps:{sx:{width:K,borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background,...ka}},variant:"permanent",open:!0,children:ke})]})]}):null]})})),r1=({tenantEmailDomain:a})=>{const C=Me(),b=r((A=>Fe(A))),P={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(A,S)=>{nt(S)&&Ba(S.mode)==="dashboard"&&C(Re({unreadCount:S.data.unread},"tasks"))}};return d.jsx(Pt,{tenantEmailDomain:a,...P})},jt=ee((a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
|
|
1
|
+
import{j as d}from"./liveblocks-DTaiayIC.js";import{a as o,R as va}from"./sentry-BRmieicQ.js";import{u as Me,j as r,g as ya,h as $a,q as R}from"./core-DA_GbUVO.js";import{fE as Fe,Tc as Ba,Td as Ze,g8 as Aa,gu as K,Te as W,jt as Te,jA as Ie,Tf as xa,Tg as Da,gN as _a,p_ as Ma,Th as Fa,Ti as ve,gl as Za,Tj as $,fD as Ga,gs as Ra,Tk as ja,Tl as Ha,Tm as Va,Tn as ye,To as La,Tp as $e,Tq as Na,Dt as Pa,gm as Ua,h0 as Oa,cV as za,Tr as qa,Ts as Ya,qB as Ja,g7 as Ka,j5 as Wa,Tt as Qa,Tu as Xa,vU as et,gn as at}from"./zeni-epic-state-cafsD4rZ.js";import{w as tt,i as nt,a as ot,r as st,E as rt,M as it,y as m,c as lt,u as dt,d as ct,T as ut,e as mt,f as Ct,x as pt,g as ht,l as ft,z as gt,h as j,p,m as Be,j as bt,$ as St,k as Ae,n as kt,C as xe,o as Et,q as wt,s as X,v as Q,A as Tt,B as It,D as vt,L as yt,F as $t,H as Bt,I as ee,J as At,K as xt}from"./index-CsnAk3jU.js";import{A as Dt,b as _t,I as Mt,a as De,d as Ft,D as _e}from"./mui-yMDYeeMr.js";import{u as Zt}from"./InboxNotificationsProvider-CLtB_fgp.js";import{u as Gt}from"./useTaskManagerAccess-Bm40mz18.js";import{u as Rt}from"./expenseAutomationHelper-4Qy8IF7o.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},C=new a.Error().stack;C&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[C]="f6989c2c-9285-4a63-990c-27a3637388c9",a._sentryDebugIdIdentifier="sentry-dbid-f6989c2c-9285-4a63-990c-27a3637388c9")}catch{}})();const B="AppDrawer",c={root:`${B}-root`,drawer:`${B}-drawer`,appBar:`${B}-appBar`,menuButton:`${B}-menuButton`,appBarZenilogo:`${B}-appBarZenilogo`,drawerZenilogo:`${B}-drawerZenilogo`},jt=ee("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:X,flexShrink:0,backgroundColor:a.colors.background}},[`& .${c.appBar}`]:{color:a.colors.primary,backgroundColor:a.colors.background,boxShadow:"none"},"& .MuiToolbar-root":{backgroundColor:a.colors.background},[`& .${c.menuButton}`]:{marginRight:a.spacing(2),[a.breakpoints.up("md")]:{display:"none"}},[`& .${c.appBarZenilogo}`]:{fill:a.colors.primary,cursor:"pointer",width:"100%",marginLeft:a.spacing(-6)},[`& .${c.drawerZenilogo}`]:{margin:`${a.spacing(3)} ${a.spacing(3)} ${a.spacing(0)}`,fill:a.colors.primary,cursor:"pointer"}}))),Ht=tt((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:b}=ot(),[H,x]=va.useState(!1),[S,Ge]=o.useState(!1),t=ya(),s=$a(),ae=Aa(),te=st(),n=Me(),[Re,je]=o.useState(!1),V=rt(),ne=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{ne||(n(K()),n(W()))}),[n,ne]),o.useEffect((()=>{n(K()),n(W())}),[n,a]);const{useFeatureGate:u}=it(),{isFeatureEnabled:oe}=u(m.isDebitCardFeatureEnabled),k=lt(),i=r((e=>Fe(e))),L=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:He}=dt(),E=ct(),{isTaskManagerAccessEnabled:D,isZeniUser:Ve}=Gt(k),se=ut(),w=mt();o.useEffect((()=>{w&&E&&(n(Te()),n(Ie()))}),[n,w,i.tenantId,E]);const[N,Le]=o.useState(void 0),Ne=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Pe}=u(m.isChargeCardFeatureEnabled),Ue=Ct(i,Pe,oe),{isFeatureEnabled:Oe}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:_}=u(m.isReferralFeatureEnabled),ze=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",re=r((e=>xa(e)));o.useEffect((()=>{const e=()=>{je(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const P=r((e=>Da(e))),h=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),f=r((e=>_a(e))),{monthEndCloseChecksView:T}=f,qe=R("/signout")!==null,M=R("/:tenantEmailDomain/dashboard")!==null,ie=R("/:tenantEmailDomain/reports")!==null,g=R("/:tenantEmailDomain/onboarding/*")!==null,le=Rt();o.useEffect((()=>{w&&_&&!g&&P.fetchState==="Not-Started"&&n(Ma(!0))}),[w,_,P.fetchState,g]),o.useEffect((()=>{if(le){const e=t.state?.origin;if(e!=null){const l=Fa(e);l!=null&&n(ve(l))}}}),[le,t.state]);const Ye=qe||g,U=r((e=>e.tenantState)),Je=r((e=>U.fetchState==="Completed"?Za(e):[])),{isFeatureEnabled:Ke}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:We}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:Qe}=u(m.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Xe}=u(m.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ea}=u(m.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:aa}=u(m.isDashboardSidebarNewYearAnimationEnabled),ta=r((e=>$(e).totalUnreadCount)),na=r((e=>$(e).notificationDetailsByTab.tasks.uiState.unreadCount)),oa=r((e=>$(e).notificationDetailsByTab.comments.uiState.unreadCount)),sa=r((e=>$(e).reducedFetchCountState)),de=r((e=>$(e).notificationDetailsByTab.tasks.fetchCountState)),O=r((e=>Ga(e))),ra=r((e=>Ra(e).skillsEnabled)),ia=r((e=>ja(e))),ce=r((e=>Ha(e).routines)),la=o.useMemo((()=>ce.filter((e=>e.sessionId!=null)).map((e=>({cadence:pt(e),name:e.name,scheduleId:e.scheduleId,sessionId:e.sessionId,unreadRuns:e.unreadRuns})))),[ce]),da=new URLSearchParams(t.search).get("routine")??ht(t.pathname.split("/ai-cfo/")[1])??void 0,ca=o.useCallback(((e,l)=>{s(l!=null&&l!==""?`/${a}/ai-cfo/${encodeURIComponent(l)}`:`/${a}/ai-cfo/routines?routine=${encodeURIComponent(e)}`)}),[s,a]),{status:ue}=r(Va),[I,z]=o.useState(void 0),q=O.uiState.currentChatSessionId,F=I!=null?O.deleteChatSessionStateByChatSessionId[I]?.fetchState:void 0,me=ft(F),{inboxNotifications:Y,isLoading:Ce,isFetchingMore:pe,hasFetchedAll:he,fetchMore:ua}=Zt(),Z=r((e=>$(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>ua?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(I!=null)return me==="In-Progress"&&F==="Completed"?(n(ye({chatSessionId:I})),z(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(F==="Error"&&(n(ye({chatSessionId:I})),z(void 0)))}),[n,t.state,s,F,I,me,a]),o.useEffect((()=>{if(Ce===!1&&pe===!1&&he===!0&&i?.companyId!=null&&Y!=null){const e=`dashboard_${i.companyId}`;Le(Y.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[Ce,pe,he,i?.companyId,Y]),o.useEffect((()=>{w&&D&&!g&&de.fetchState==="Not-Started"&&ae.tenantId!=null&&n(La("task_manager","dashboard"))}),[w,D,g,de.fetchState,ae.tenantId,n]),o.useEffect((()=>{g||Z.fetchState!=="Not-Started"||n($e({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[g,Z.fetchState,n]),o.useEffect((()=>{if(N!=null){const{fetchState:e}=Z;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n($e({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Ze({unreadCount:N},"comments")))}}),[N,Z.fetchState]);const ma={fetchStatus:sa,count:ta},v=[];Ke===!1&&v.push("accounts_payable_aging"),We===!1&&v.push("accounts_receivable_aging"),v.push("zeni_accounts_promo_card","treasury_promo_card"),_===!1&&v.push("rewards_card"),se===!1&&v.push("expense_automation_card");const fe=r((e=>Na(e,v).fetchState)),ge=r((e=>Pa(e).fetchState)),be=a!=null?gt.getSignedInUserTenant(a):null,Se=r((e=>be?.tenantId!=null?Ua(e,be.tenantId):void 0)),Ca=M&&(fe==="Completed"||fe==="Error")||ie&&(ge==="Completed"||ge==="Error")||!M&&!ie?void 0:"disabled",pa=o.useMemo((()=>Oa(i.userRole)),[i.userRole]),ha=za(pa),y=e=>{x(e)},fa=ze,ga=i?.rewardsLastViewedTime==null,ba=k?.userEmail!=null&&re.fetchState==="Completed"&&qa(re.notificationSettings,k.userEmail,oe,i,D),Sa=o.useCallback((e=>{const l=t.state?.referrer;if(T.monthEndCloseChecks?.auditSummary!=null&&j.trackMonthCloseAuditPage(e.month,e.year,T.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",T.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(Ya(i.tenantId,e)),h[i.tenantId]!=null){const A=p(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${f.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:A,referrer:f.currentSelectedView}})}n(ve(f.currentSelectedView)),f.reconciliation.selectedAccountId!=null&&n(Ja({selectedAccountId:void 0}))}),[f.reconciliation.selectedAccountId,f.currentSelectedView,i.tenantId,T.monthEndCloseChecks?.auditSummary,T.monthEndCloseChecks?.reportEmailSentDate,h,a,t.state,t.pathname]),ka=o.useMemo((()=>({zIndex:S?12:Be[2]})),[S]),Ea=E&&bt(t),ke=d.jsx(St,{signedInUser:k,currentTenantId:U.currentTenantId??"",tenants:U.fetchState==="Completed"?Je:Se!=null?[Se]:[],rewardsConfiguration:{isRewardsTabVisible:_,isRewardsAnimated:ga,rewardsPlan:P.rewardsPlan},selectedMenu:C===!0?xe("ai_cfo"):Ae(t)&&ue!=="completed"?xe("invoicing"):Et(t),isTenantDropdownDisabled:Ca,isSettings:kt(t),isInvoicing:Ae(t)&&ue==="completed",isSettingsFeatureEnabled:Oe,currentTenant:i,isVendorsTabVisible:ha,isZeniAccountEnabled:Ne,isChargeCardEnabled:Ue,isTreasuryEnabled:fa,isNotificationsTabVisible:ba,notificationCountDetails:ma,isExpenseAutomationEnabledForUser:se,isAiCfoAccessEnabled:E,skillsEnabled:ra&&E,routinesEnabled:ia===!0&&E,routines:la,selectedRoutineId:da,onRoutineSelect:ca,onNotificationIconClick:()=>{y(!1);const e=Ve?na===0&&oa>0?"notifications/comments":"notifications/tasks":"notifications/comments",l=p(t.state?.pathnameStackToGoBack,t.pathname);s(`${a}/${e}`,{state:{pathnameStackToGoBack:l}})},onZeniLogoClick:()=>{te.toggle()},handleTenantSelect:e=>{He(yt.TENANT_SWITCHING),y(!1),$t({dispatch:n,navigate:s,pathToNavigate:Bt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,l)=>{if(k!=null&&j.trackSidePanelClicked(e.type,e.group),y(!1),a==null)return;if(e.type==="routines")return L?(n(Ie()),n(Qa()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void Q({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return L?(n(Te()),n(Xa()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void Q({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(K()),n(W()),e.type==="invoicing")return C&&b(!1),n(et({cacheOverride:!1})),void s(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(C&&Tt(e.type)&&b(!1),e.type==="ai_cfo"){if(j.trackAICFOChatScreenStateChanged("viewed","left_menu",q??null,null),!L)return void Q({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const G=p(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:G,referrer:"Sidebar"}})}const A=p(t.state?.pathnameStackToGoBack,t.pathname),J=e.type,we=xt(J)&&J!=="command_center";if(J!=="command_center"&&!we||h[i.tenantId]==null||j.trackMonthEndCloseClicked(h[i.tenantId].month,h[i.tenantId].year,"Sidebar"),we&&h[i.tenantId]!=null){const G=h[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${G.month}-${G.year}`,{state:{pathnameStackToGoBack:A,message:l,referrer:"Sidebar"}})}const Ia=It(e.type);vt(e.type)?(q!=null&&n(at()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:A.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${Ia}`,{state:{pathnameStackToGoBack:A,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Wa(e)),q===e&&z(e)},handleLogOutClick:()=>{y(!1);const e=p(t.state?.pathnameStackToGoBack,t.pathname);s("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{s(`${a}/settings/my_profile`)},handleReferralsClick:()=>{s(`${a}/rewards/refer`)},handleBackClick:()=>{s(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:T,onPeriodChange:Sa,onCalendarOpen:Ge,aiCfoView:O,isAiCfo:Ea,isOnDashboard:M,isTaskManagerAccessEnabled:D,updateCurrentChatSessionId:e=>{n(Ka({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Qe,thanksGivingAnimationEnabled:Xe,christmasAnimationEnabled:ea,newYearAnimationEnabled:aa}),wa=d.jsx(Dt,{position:"fixed",className:c.appBar,style:{borderBottom:Re?`1px solid ${V.colors.grey2}`:""},children:d.jsxs(_t,{style:{minHeight:wt},children:[d.jsx(Mt,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>y(!0),className:c.menuButton,size:"large",children:d.jsx(Vt,{})}),d.jsx(Lt,{className:c.appBarZenilogo,onClick:()=>{te.toggle()}})]})}),Ee=De((e=>e.breakpoints.up("md"))),Ta=De((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(jt,{className:c.root,children:[d.jsx(Ft,{}),Ye===!1?d.jsxs(d.Fragment,{children:[Ee||!M?null:wa,d.jsxs("nav",{className:c.drawer,children:[Ee?null:d.jsx(_e,{container:window.document.body,variant:"temporary",open:H,onClose:()=>y(!1),PaperProps:{sx:{width:X,zIndex:Be[2],borderRight:"none",backgroundImage:"none",backgroundColor:V.colors.background}},ModalProps:{keepMounted:!0},children:ke}),Ta?null:d.jsx(_e,{PaperProps:{sx:{width:X,borderRight:"none",backgroundImage:"none",backgroundColor:V.colors.background,...ka}},variant:"permanent",open:!0,children:ke})]})]}):null]})})),r1=({tenantEmailDomain:a})=>{const C=Me(),b=r((x=>Fe(x))),H={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(x,S)=>{nt(S)&&Ba(S.mode)==="dashboard"&&C(Ze({unreadCount:S.data.unread},"tasks"))}};return d.jsx(Ht,{tenantEmailDomain:a,...H})},Vt=ee((a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
|
|
2
2
|
height: 20px;
|
|
3
3
|
width: 20px;
|
|
4
4
|
color: ${a=>a.theme.colors.primary};
|
|
5
|
-
`,
|
|
6
|
-
height: ${
|
|
5
|
+
`,Lt=ee((a=>o.createElement("svg",{viewBox:"0 0 102 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{d:"M73.4046 13.2609H57.77C58.0392 15.0844 58.8324 16.5249 60.352 17.5133C61.5784 18.3113 62.9424 18.5733 64.3842 18.407C64.8867 18.3484 65.3952 18.2539 65.8738 18.0935C67.1433 17.6676 68.0945 16.8923 68.4559 15.5031H73.2777C73.1629 16.3885 72.8877 17.1866 72.4845 17.938C71.4734 19.8189 69.9228 21.1159 67.9414 21.8302C64.3076 23.138 60.7875 22.9178 57.5642 20.6588C55.1293 18.9526 53.7318 16.5465 53.3034 13.6055C52.9959 11.4973 53.2065 9.43809 54.1374 7.49857C55.6988 4.2453 58.2761 2.29381 61.8273 1.67642C64.048 1.28995 66.2124 1.54361 68.2202 2.60969C71.2784 4.23333 73.0085 6.79743 73.4405 10.2314C73.5649 11.2161 73.5374 12.202 73.407 13.2621L73.4046 13.2609ZM68.3554 9.72765C68.3278 9.51706 68.3159 9.334 68.2788 9.15692C68.0622 8.12913 67.4915 7.32388 66.6767 6.68735C65.7697 5.97902 64.7264 5.68349 63.5825 5.62486C61.0543 5.49444 58.8289 7.02356 58.0918 9.44408C58.0655 9.52903 58.0595 9.62116 58.0416 9.72765H68.3566H68.3554Z",fill:"currentColor"}),o.createElement("path",{d:"M52.7423 17.86V21.9162C52.7423 22.0478 52.6346 22.1555 52.503 22.1555H34.5854C34.5854 22.1555 34.595 19.9659 34.5783 19.1008C34.5723 18.7861 34.662 18.5528 34.8786 18.3183C38.3664 14.535 41.8458 10.7445 45.3276 6.95397C45.452 6.81877 45.744 6.49093 45.744 6.49093H35.6396C35.5079 6.49093 35.4003 6.38324 35.4003 6.25163V2.14645C35.4003 2.01483 35.5079 1.90715 35.6396 1.90715H52.6334C52.6334 1.90715 52.6274 4.18288 52.6418 5.17239C52.6454 5.41767 52.5341 5.57321 52.3833 5.73713C50.1543 8.15884 41.5048 17.6219 41.5048 17.6219H52.5042C52.6358 17.6219 52.7435 17.7296 52.7435 17.8612L52.7423 17.86Z",fill:"currentColor"}),o.createElement("path",{d:"M94.0631 22.0758H89.7353C89.6037 22.0758 89.496 21.9694 89.496 21.8377C89.4925 20.5539 89.4733 14.3919 89.4769 11.3696C89.4769 10.6397 89.4195 9.92064 89.2041 9.21829C88.6142 7.29553 87.0528 6.12056 85.0367 6.07151C83.7122 6.0392 82.5288 6.37542 81.58 7.34578C80.8406 8.10196 80.4386 9.02686 80.2998 10.0642C80.2388 10.5213 80.2148 10.9879 80.2136 11.4498C80.2076 14.429 80.2088 20.5539 80.21 21.8365C80.21 21.9682 80.1023 22.0758 79.9707 22.0758H75.6047C75.4731 22.0758 75.3654 21.9705 75.3654 21.8389C75.3606 20.512 75.3403 13.9576 75.387 10.6349C75.4205 8.27546 76.1838 6.1433 77.78 4.36411C79.2062 2.77516 80.9973 1.84189 83.1056 1.52243C84.8441 1.258 86.5658 1.3286 88.2254 1.93642C91.4727 3.12454 93.3954 5.47924 94.093 8.83302C94.2557 9.61314 94.3072 10.4268 94.3131 11.226C94.3335 14.3321 94.3083 20.5503 94.3036 21.8401C94.3036 21.9717 94.1959 22.077 94.0643 22.077L94.0631 22.0758Z",fill:"currentColor"}),o.createElement("path",{d:"M97.2196 1.90527H101.482C101.613 1.90527 101.721 2.01176 101.721 2.14338L101.772 21.9035C101.772 22.0363 101.666 22.144 101.533 22.144H97.2256C97.094 22.144 96.9863 22.0363 96.9863 21.9047L96.9803 2.14457C96.9803 2.01296 97.088 1.90527 97.2196 1.90527Z",fill:"currentColor"}),o.createElement("path",{d:"M17.1795 0.0270299C16.9776 -0.0551712 16.7491 0.057251 16.6911 0.267589C16.6706 0.342537 16.6476 0.417486 16.6234 0.491225C16.4022 1.1573 16.0299 1.76655 15.5197 2.27789C14.6566 3.14221 13.5082 3.61971 12.2861 3.62091H12.2825C11.0627 3.62091 9.91435 3.14584 9.05124 2.28394C8.54111 1.77381 8.16636 1.16455 7.94394 0.499687C7.91976 0.425947 7.89679 0.350999 7.87503 0.276051C7.81701 0.0657128 7.58854 -0.0455005 7.38666 0.0367007C6.20321 0.522655 5.108 1.17906 4.13125 1.97447C4.00795 2.07481 3.96806 2.24525 4.02729 2.39273C4.07686 2.51603 4.13004 2.63813 4.18565 2.7578C4.62204 3.70916 5.22888 4.58557 5.99166 5.34714C7.67316 7.02501 9.90589 7.94977 12.2813 7.94977H12.2897C14.6675 7.94736 16.9027 7.01897 18.5829 5.33626C19.3445 4.57348 19.9489 3.69586 20.3841 2.7445C20.4397 2.62362 20.4917 2.50153 20.5413 2.37823C20.6005 2.23075 20.5606 2.0603 20.4373 1.95997C19.4594 1.16576 18.3629 0.511775 17.1795 0.0270299Z",fill:"#97C3B9"}),o.createElement("path",{d:"M20.3984 21.2422C19.962 20.2933 19.3564 19.4193 18.596 18.6602C16.9133 16.9799 14.6733 16.0527 12.2979 16.0575C8.71131 16.0611 5.61789 18.196 4.2108 21.2604C4.1564 21.38 4.10321 21.5009 4.05244 21.623C3.992 21.7705 4.03189 21.9422 4.1564 22.0437C5.13435 22.8367 6.22956 23.4895 7.41181 23.973C7.61369 24.0552 7.84095 23.944 7.90018 23.7337C7.92073 23.6575 7.9437 23.5838 7.96908 23.5088C8.57713 21.698 10.2876 20.3888 12.3016 20.3864H12.3064C13.5261 20.3864 14.6745 20.8615 15.5376 21.7234C16.0466 22.2311 16.4189 22.8379 16.6413 23.5004C16.6667 23.5741 16.6897 23.649 16.7102 23.724C16.7694 23.9343 16.9967 24.0455 17.1986 23.9621C18.382 23.4762 19.476 22.821 20.4528 22.0256C20.5761 21.9252 20.616 21.7536 20.5567 21.6061C20.5072 21.4828 20.454 21.3619 20.3984 21.241V21.2422Z",fill:"#97C3B9"}),o.createElement("path",{d:"M0.494416 9.85376C0.31309 9.85376 0.161985 9.98795 0.13539 10.1669C0.045936 10.7676 0 11.3829 0 12.0091C0 12.6401 0.0483536 13.2603 0.141434 13.8659C0.169238 14.0448 0.320343 14.1778 0.501669 14.1778L24.0934 14.1427C24.2747 14.1427 24.4258 14.0086 24.4524 13.8296C24.5419 13.2288 24.589 12.6135 24.5878 11.9862C24.5878 11.3551 24.5395 10.735 24.4464 10.1294C24.4186 9.95047 24.2675 9.8175 24.0862 9.8175L0.494416 9.85256V9.85376Z",fill:"#97C3B9"}))))`
|
|
6
|
+
height: ${At.sp4};
|
|
7
7
|
width: 102px;
|
|
8
8
|
color: ${a=>a.theme.colors.primary};
|
|
9
9
|
cursor: pointer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-UOzcPsHa.js";import{a as d}from"./sentry-DHDsO12F.js";import{h as U,g as j,u as B,j as y,N as F,l as V,i as W,n as te,o as x}from"./core-B5mDy9pu.js";import{fF as P,YN as w,Yu as R,Hy as E,Hs as Y,Hw as A,Hl as q,Yw as z,Hp as ae,HA as oe,Ho as K,HD as Z,Hz as C}from"./zeni-epic-state-7eY0g-Bc.js";import{z as O,w as J,bY as pe,n as T,bS as G,bZ as le,E as M,a7 as Q,b_ as se,b$ as ne}from"./index-6nH5LMe4.js";import"./mui-Do6nLzGb.js";import{u as X,i as re}from"./ReimbursementApprovalRuleDetailScreen-phJuB98f.js";import ie from"./NotFoundScreen-BkYIKPgh.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="7a62acbe-9386-4c7f-92bb-ec7909345156",e._sentryDebugIdIdentifier="sentry-dbid-7a62acbe-9386-4c7f-92bb-ec7909345156")}catch{}})();const k="bill-approval-rule-update",ce=V((function(e){return{approvalView:w(e),billPaySetupApproverViewUpdateData:R(e).billPaySetupApproverViewUpdateData}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(k)&&e(z(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(J(pe)),ue=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(Y(!0,!0,!1)))}),[a,p,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const g={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${k}`]:[],eventCallback:(r,h,b)=>{r.endsWith(k)&&b.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...g})},N="bill-approval-rule-update",de=V((function(e){const l=w(e),t=R(e).billPaySetupApproverViewUpdateData,o={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(o[n.id]=n.name);const a={};for(const n of Object.values(e.classState.classesByKey))n?.classId!=null&&(a[n.classId]=n.className);return{approvalView:l,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(N)&&e(z(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(J(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=G(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),g=y((i=>P(i)));X();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),d.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(Y(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||S!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,S,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const b={events:g.companyId!=null?[`private-encrypted-${g.companyId}.${N}`]:[],eventCallback:(i,I,m)=>{i.endsWith(N)&&m.onApprovalRulesEventReceived(i)}};return g?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(de,{currentTenant:g,location:t,navigate:l,isLoading:e,...b})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=T(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const g=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((I=>({type:"user",userId:I.userId,isImplicitActor:!1}))),b=r.actors.selectedNonUsers.map((I=>{const m=!!re(I.value);return{type:m?"attribute":"role",subType:I.value,userId:void 0,idType:void 0,isImplicitActor:!m}})),i=h.concat(b);g.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),g},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(Z(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=M(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(K(!0)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const ge=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=T(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const I=[];return i.forEach((m=>{const L=m.actorKind?.selectedOption,ee=m.selectedRole?.selectedNonUsers??[];let D=[];L==="role"?D=ee.map((_=>({type:"attribute",subType:_.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):L==="specific_person"&&(D=(m.persons?.selectedUsers??[]).map((_=>({type:"user",userId:_.userId,isImplicitActor:!1}))));const $=m.action??"require_approval";I.push({action:$,actors:D,operator:D.length>1?$==="require_approval"?"or":"and":"is"})})),I},c=p.amountCriteria,S=p.vendorCriteria,g=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const b=g?.selection.selectedOptions??[];if(b.length>0&&(r.department={type:"department",operator:g?.operator.selectedOption??"is",departmentIds:b}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(Z(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function H(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=G(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=M(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(X(),d.useEffect((()=>{p||(f(!0),l(K(!1)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ge,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function xe(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx(H,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(H,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
|
|
1
|
+
import{j as u}from"./liveblocks-DTaiayIC.js";import{a as d}from"./sentry-BRmieicQ.js";import{h as U,g as j,u as B,j as y,N as G,l as V,i as W,n as te,o as x}from"./core-DA_GbUVO.js";import{fE as P,Yc as w,XV as R,G_ as E,GU as q,GY as A,GN as X,XX as Y,GR as ae,H0 as oe,GQ as H,H3 as K,G$ as C}from"./zeni-epic-state-cafsD4rZ.js";import{z as _,w as z,bY as pe,n as O,bS as Q,bZ as le,E as Z,a7 as J,b_ as se,b$ as ne}from"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.js";import{u as M,i as re}from"./ReimbursementApprovalRuleDetailScreen-QDei_Fzl.js";import ie from"./NotFoundScreen-DFQDCCRn.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="7a36e862-2f39-45ba-8da6-ef28cc5904e0",e._sentryDebugIdIdentifier="sentry-dbid-7a36e862-2f39-45ba-8da6-ef28cc5904e0")}catch{}})();const k="bill-approval-rule-update",ce=V((function(e){return{approvalView:w(e),billPaySetupApproverViewUpdateData:R(e).billPaySetupApproverViewUpdateData}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(k)&&e(Y(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(X(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(z(pe)),ue=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(q(!0,!0,!1)))}),[a,p,e,o]),_.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const g={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${k}`]:[],eventCallback:(r,h,b)=>{r.endsWith(k)&&b.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(G,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...g})},N="bill-approval-rule-update",de=V((function(e){const l=w(e),t=R(e).billPaySetupApproverViewUpdateData,o={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(o[n.id]=n.name);const a={};for(const n of Object.values(e.classState.classesByKey))n?.classId!=null&&(a[n.classId]=n.className);return{approvalView:l,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(N)&&e(Y(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(X(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(z(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=Q(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),g=y((i=>P(i)));M();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),d.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(q(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||S!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,S,e,o]),_.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const b={events:g.companyId!=null?[`private-encrypted-${g.companyId}.${N}`]:[],eventCallback:(i,I,m)=>{i.endsWith(N)&&m.onApprovalRulesEventReceived(i)}};return g?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(G,{to:"../../promo"}):u.jsx(de,{currentTenant:g,location:t,navigate:l,isLoading:e,...b})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const g=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((I=>({type:"user",userId:I.userId,isImplicitActor:!1}))),b=r.actors.selectedNonUsers.map((I=>{const m=!!re(I.value);return{type:m?"attribute":"role",subType:I.value,userId:void 0,idType:void 0,isImplicitActor:!m}})),i=h.concat(b);g.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),g},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(K(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=_.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(H(!0)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(J,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const ge=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const I=[];return i.forEach((m=>{const L=m.actorKind?.selectedOption,ee=m.selectedRole?.selectedNonUsers??[];let D=[];L==="role"?D=ee.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):L==="specific_person"&&(D=(m.persons?.selectedUsers??[]).map((T=>({type:"user",userId:T.userId,isImplicitActor:!1}))));const $=m.action??"require_approval";I.push({action:$,actors:D,operator:D.length>1?$==="require_approval"?"or":"and":"is"})})),I},c=p.amountCriteria,S=p.vendorCriteria,g=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const b=g?.selection.selectedOptions??[];if(b.length>0&&(r.department={type:"department",operator:g?.operator.selectedOption??"is",departmentIds:b}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(K(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function F(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=Q(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=_.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(M(),d.useEffect((()=>{p||(f(!0),l(H(!1)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(J,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ge,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function xe(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx(F,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(F,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-DTaiayIC.js";import{h as J,u as le,g as K,i as te,j as k,N as ee,l as Q,q as na,n as ia,o as y}from"./core-DA_GbUVO.js";import{fE as Z,Xv as _e,bq as kt,Rx as oa,bo as wt,bJ as de,Xw as Bt,Gi as xt,Hv as Ve,GR as la,bn as Ae,Xx as sa,Xy as ra,c8 as ca,Xz as da,l_ as Ct,XA as At,XB as Et,I4 as Ue,Gx as xe,XC as ua,G6 as at,XD as pa,LV as ma,Ga as ba,Gg as Dt,XE as Se,XF as Me,Hw as Oe,XG as ha,XH as ga,Hz as Ne,XI as Sa,HM as ya,XJ as Tt,Hg as nt,Hl as fa,XK as Ia,XL as ce,XM as jt,XN as Pt,XO as Ft,gU as va,GC as $e,cG as Rt,XP as ka,gg as wa,XQ as Ba,XR as xa,dY as Vt,dX as $t,XS as ze,XT as Ca,XU as Aa,W4 as Xe,XV as Ea,W5 as ie,W6 as He,XW as Da,XX as Ta,XY as ja,Hn as it,Hk as Pa,XZ as Fa,X_ as Ra,X$ as Va,H6 as $a,Y0 as La,Y1 as Ga,cu as Lt,d9 as Gt,m9 as _a,bO as Ua,br as _t,bP as Ut,Fl as Ma,Y2 as Oa,LI as Na,LO as za,Bx as Xa,Hx as Ha,Ib as Za,mm as ge,Y3 as Wa,Y4 as Mt,mQ as Ya,mg as Ot,mB as Nt,mA as ot,bE as pe,bN as qa,Y5 as Ja,Y6 as ye,kM as Ka,Y7 as lt,Y8 as Qa,kQ as en,l9 as tn,Ip as an,Y9 as nn,mJ as on,If as ln,Ya as st,Ij as sn,Io as rn,Im as cn,Id as dn,Yb as zt,Gr as un,Yc as pn,Yd as mn,gF as bn,gE as hn,gD as gn,mp as Sn,mH as rt,mS as yn,ul as fn,my as In,Ih as vn,kW as kn,mX as wn,Ye as Bn,kO as xn,uc as Cn,Yf as An,Hc as En,bK as Dn,bt as Tn,Tw as jn,dc as Pn,db as Fn,cF as Rn,cM as Vn}from"./zeni-epic-state-cafsD4rZ.js";import{E as ue,z as L,V as fe,as as Ze,M as oe,y as g,bi as We,a7 as se,J as A,a8 as Ee,h as j,bu as $n,a4 as H,av as Ye,p as T,a1 as Ie,bv as ct,bw as dt,bx as Ln,az as Gn,af as _n,aS as Un,ab as Xt,G as De,ag as qe,by as Mn,ae as Ht,bz as On,aq as Nn,S as Zt,w as zn,bA as Xn,bB as Hn,bC as Zn,bD as Wn,bE as Yn,bF as qn,bG as Jn,bH as Kn,bI as Qn,r as ei,bJ as ti,br as ai,bK as ni,ai as ii,bL as oi,f as li}from"./index-CsnAk3jU.js";import{n as _,S as si}from"./mui-yMDYeeMr.js";import{A as ut}from"./AddressScreen-C9Fk_Z55.js";import{g as ne,a as Te,i as Wt,V as Je,b as Ke,c as ri,v as ci,d as di,A as me,D as be}from"./DomesticWireDetailScreen-BKq5jjLx.js";import{a as f}from"./sentry-BRmieicQ.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-BOgWSkqa.js";import{u as Yt}from"./useInitialThreadRequest-BJ6-q-Ev.js";import{u as ui}from"./BusinessVerificationPageScreen-BT5PhS2R.js";import Ce from"./NotFoundScreen-DFQDCCRn.js";import{D as pi}from"./DrawerScreen-DsFB_53j.js";import{M as qt}from"./MobileAppDrawer-cBt39NZW.js";import{F as Jt}from"./FeaturePreviewScreen-BFU7MG_7.js";import{S as je}from"./SetupPagesScreen-Dzk7fHhk.js";import{B as mi}from"./BillPayApprovalRoutes-Dyxgp6fW.js";import{F as bi}from"./ScreenRoutes-Bz0Iu7E_.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";import"./routePaths-DeWRBZpS.js";import"./InboxNotificationsProvider-CLtB_fgp.js";import"./useTaskManagerAccess-Bm40mz18.js";import"./analyticsHelper-BefphWIe.js";import"./ReimbursementApprovalRuleDetailScreen-QDei_Fzl.js";import"./getLocaleForTenant-BYa6QBcb.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]="d1c9f551-8186-4fbb-aa4d-1305e92bbef6",e._sentryDebugIdIdentifier="sentry-dbid-d1c9f551-8186-4fbb-aa4d-1305e92bbef6")}catch{}})();const hi=Q((function(e,t){const l=_e(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=H(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;Ae(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:S,isMarkAsPaidBtnVisible:h}=sa(l.billActivities,ra(t.currentTenant),n);i=S,d=h}const p=ca(t.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&da(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ye}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:m}}),(function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=T(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=T(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(at(l,o.type,"")):e(at(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(xe(l,"retry")):e(xe(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Te(u,o,s),d=T(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=H(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=T(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(xe(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(Ue(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}}))($n);function gi(){const e=J(),t=le(),l=K(),{billId:n}=te(),c=ue(),r=L.getSignedInUser(),u=fe(),o=k((X=>Z(X))),s=k((X=>_e(X,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Qe({mobileExploreReferrer:"Bill Details"});Ze({isDataReady:s.fetchState==="Completed"});const S=o?.userRole!=null&&kt(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!S,[b,I]=f.useState(!1),[E,x]=f.useState(!1),[C,U]=f.useState(!1),{useFeatureGate:D,useDynamicConfig:B}=oe(),{isFeatureEnabled:O}=D(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:V}=D(g.isBillPayCommentingEnabled),{isFeatureEnabled:W}=D(g.isBillPayDetectInsufficientFundsEnabled),{configValue:N}=B(We.zeniAssistConfig),v=oa(o),z=wt(o.userRole),M=h&&de(u?.loggedInUserRoleMap),$=N.user_ids!=null&&r?.userId!=null&&N.user_ids.includes(r?.userId),{isFeatureEnabled:Y}=D(g.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:q}=D(g.billPaySetupShowInternationalPaymentByWise);if(f.useEffect((()=>{O&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&v===!1?U(!1):U(s.billActivities[0]?.isRealTimeApprovalEnabled&&(z||M||s.allApprovers.find((X=>X.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,z,M,o.isZeni,v,r]),f.useEffect((()=>{n!=null&&t(Bt(n))}),[n]),f.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(xt(n??"",O,$,!1)))}),[b,s,n,t]),f.useEffect((()=>{E||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,O,$,q,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))}),[E,s,n,t,O,$,q]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Ee,{analytics:j,onLoad:X=>(G=>{n!=null&&G.trackBillPayBillDetails(n,s.isRecurring)})(X)}),a.jsx(hi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:O,location:l,navigate:e,isBillPayCommentingEnabled:V,isRealTimeApprovalEnabled:C,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:Y,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:W,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const Le=De.getLocalizedStrings().spendManagement.billPay.billDetails,pt=De.getLocalizedStrings().common,Si={containerWidth:new Xt(100,58)},mt=Q((function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}}),(function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ya({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(Sa({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(Un);function w({appContent:e}){const t=le(),l=J(),{billId:n}=te(),c=K(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=d(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(g.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(g.billPaySetupShowInternationalPaymentByWise),{configValue:I}=p(We.zeniAssistConfig),E=I.user_ids!=null&&i?.userId!=null&&I.user_ids.includes(i?.userId),x=k((F=>Z(F)));ui();const[C,U]=f.useState(!1),[D,B]=f.useState(!1),[O,V]=f.useState(!1),[W,N]=f.useState(),v=k((F=>Me(F,m,h,n)));let z=v.fetchState,M=v.file,$=v.showAutofill;const Y=k((F=>_e(F,n??"")));u===!1&&(z=Y.fetchState,M=Y.transactionDetails?.attachments?.[0],$=!1);const q=v.billPayInfo!=null&&v.billPayInfo.stage.code==="pending_approval"?v.billPayInfo.billStatus.code:v.billStage;f.useEffect((()=>{n==null&&t(Oe(!0))}),[n,t]),f.useEffect((()=>{z==="Not-Started"&&(u&&D?B(!1):!u&&C&&U(!1))}),[n]),f.useEffect((()=>{C||n==null||u||(U(!0),t(xt(n,S,E,!1)),D||(B(!0),t(Ve(!1,S,E,b,n)))),u&&!D&&(B(!0),t(Ve(!1,S,E,b,n)))}),[C,D,u,n,t,S,E,b]);const X={onOkClick:()=>{if(V(!1),!W)return;const F=M!=null?"replace":"upload";j?.trackInvoiceActionClick(q??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(W,m,n))},onCancelClick:()=>{if(V(!1),!W)return;const F=M!=null?"replace":"upload";j?.trackInvoiceActionClick(q??"",F,i?.userEmail??"","no"),t(ha({file:W,billId:n}))}},G=f.useCallback((()=>{const F=H(c.state?.pathnameStackToGoBack),ve=F.poppedPathname??ne(x.tenantEmailDomain);t(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:F.newStack}})}),[c.state,x.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(z==="Error"||Y.fetchState==="Error")return a.jsx(Ce,{});if(z!="Completed")return n==null&&o!=="small"?a.jsx(ct,{fallback:G,children:a.jsxs(Pe,{windowSize:o,children:[a.jsx(ht,{}),a.jsx(Fe,{}),a.jsx(mt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:!0,uploadStatus:v.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:V,setPayload:N,showActionButtons:!1,isInitialEdit:!!v.isInitialEdit,billStage:q}),a.jsx(Re,{windowSize:o,children:a.jsx(dt,{isNewBill:!0})})]})}):a.jsxs(Pe,{windowSize:o,children:[o==="small"||$?null:a.jsx(bt,{children:a.jsx(Kt,{onClick:G,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Fe,{}):null,a.jsx(Ln,{}),a.jsx(Re,{windowSize:o,children:a.jsx(dt,{isNewBill:n==null})})]});{const F=v.billPayInfo!=null&&v.billPayInfo.stage.code==="pending_approval"?v.billPayInfo.billStatus.code:v.billStage;return a.jsx(ct,{fallback:G,children:a.jsxs(Pe,{windowSize:o,children:[$&&o!=="small"?a.jsx(ht,{}):null,O?a.jsx(Gn,{titleComponent:a.jsx(Bi,{children:Le.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:Le.overwriteDescription}),primaryButtonText:pt.yes,secondaryButtonText:pt.no,action:X,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(bt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Fe,{}):null,a.jsx(mt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:$,uploadStatus:v.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:fi(u,Y,v),setShowConfirmationPopup:V,setPayload:N,showActionButtons:Ii(u,v),isInitialEdit:!!v.isInitialEdit,billStage:F}),a.jsx(Re,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Mn();return a.jsx(Kt,{onClick:e,"data-testid":"nav-bar-back-click"})}function fi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(vi,{children:[a.jsx(ki,{children:`${Le.recurringBill.recurringCycle}
|
|
2
|
+
${n}/${c}`}),a.jsx(wi,{})]}):void 0}function Ii(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const bt=_.div`
|
|
3
|
+
margin-bottom: 20px;
|
|
4
|
+
margin-top: 20px;
|
|
5
|
+
margin-left: ${A.sp5};
|
|
6
|
+
position: absolute;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
`,vi=_.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
padding-top: 9px;
|
|
14
|
+
gap: ${A.sp2};
|
|
15
|
+
margin-bottom: -${A.sp2};
|
|
16
|
+
`,ki=_(qe.StandardMedium)``,wi=_((e=>f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M3.35001 15L3.35001 10.125C3.35001 6.81129 6.0363 4.125 9.35001 4.125H16.475M16.475 4.125L13.85 1.5M16.475 4.125L13.85 6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M20.6 9V13.875C20.6 17.1887 17.9137 19.875 14.6 19.875H7.47501M7.47501 19.875L10.1 22.5M7.47501 19.875L10.1 17.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))))`
|
|
17
|
+
color: ${e=>e.theme.colors.hero};
|
|
18
|
+
height: ${A.sp3};
|
|
19
|
+
width: ${A.sp3};
|
|
20
|
+
`,Kt=_((e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))))`
|
|
21
|
+
width: ${A.sp3};
|
|
22
|
+
height: ${A.sp3};
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
color: ${e=>e.theme.colors.champion};
|
|
25
|
+
&:hover {
|
|
26
|
+
color: ${e=>e.theme.colors.primary};
|
|
27
|
+
}
|
|
28
|
+
`,Pe=_.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
height: 100vh;
|
|
31
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
32
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
+
position: relative;
|
|
34
|
+
&::after {
|
|
35
|
+
content: "";
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 57px;
|
|
38
|
+
left: 42%;
|
|
39
|
+
width: 1px;
|
|
40
|
+
height: calc(100% - 57px);
|
|
41
|
+
background-color: ${e=>e.theme.colors.grey2};
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
z-index: 3;
|
|
44
|
+
display: ${e=>e.windowSize==="small"?"none":"block"};
|
|
45
|
+
}
|
|
46
|
+
`,Fe=_.div`
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 56px;
|
|
49
|
+
left: 0;
|
|
50
|
+
width: 42%;
|
|
51
|
+
height: 1px;
|
|
52
|
+
background-color: ${e=>e.theme.colors.grey2};
|
|
53
|
+
z-index: 3;
|
|
54
|
+
`,ht=_.div`
|
|
55
|
+
position: fixed;
|
|
56
|
+
top: 0;
|
|
57
|
+
left: 0;
|
|
58
|
+
right: 0;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
background-color: ${_n.overlayBackgroundBlack};
|
|
61
|
+
z-index: 5;
|
|
62
|
+
`,Re=_.div`
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
width: ${e=>`${Si.containerWidth.value(e.windowSize)}%`};
|
|
66
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
67
|
+
`,Bi=_(qe.H6Regular)`
|
|
68
|
+
margin-top: ${A.sp7};
|
|
69
|
+
padding-left: ${A.sp8};
|
|
70
|
+
padding-right: ${A.sp8};
|
|
71
|
+
color: ${e=>e.theme.colors.primary};
|
|
72
|
+
word-break: break-word;
|
|
73
|
+
`,xi=_(qe.LargeRegularSp)`
|
|
74
|
+
color: ${e=>e.theme.colors.hero};
|
|
75
|
+
padding-left: ${A.sp8};
|
|
76
|
+
padding-right: ${A.sp8};
|
|
77
|
+
margin-bottom: 30px;
|
|
78
|
+
margin-top: ${A.sp4};
|
|
79
|
+
white-space: pre-line;
|
|
80
|
+
`,Ci=Q((function(e,t){return{billsReviewView:Tt(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/bills`),e(ce())},onCloseReviewItem:l=>{e(Ia(l))},onProceedForBulkActionClick:(l,n)=>{switch(l){case"send_for_approval":e(fa());break;case"approve":case"review":e(nt("approved",n??""));break;case"reject":e(nt("rejected",n??""))}}}}))(On);function Ai({tenantEmailDomain:e}){const t=J(),l=k((c=>c.billsBulkActionViewState.bulkSubmissionFetchState.fetchState)),{billsForReview:n}=k((c=>Tt(c)));return f.useEffect((()=>{l!=="Completed"&&n.length!==0||t(`/${e}/bills`)}),[l,n.length,e]),a.jsx(Ci,{navigate:t,analytics:j,tenantEmailDomain:e})}const ae=Aa(),Qt="bulk-operation-update",Ge="bill-approval-rule-update",{common:we}=De.getLocalizedStrings(),Ei=_.div`
|
|
81
|
+
display: flex;
|
|
82
|
+
min-height: 100%;
|
|
83
|
+
width: 100%;
|
|
84
|
+
flex: 1 1 auto;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
align-items: center;
|
|
87
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
+
`,Di=Q((function(e,t){const l=L.getSignedInUser(),n=Ae(l),c=Ft(e,ae,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter((b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted")):t.roleMap.bill_pay_approver&&(r=r.filter((b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted")))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter((b=>b!=="deleted")));const u=e.entityAutoCompleteState.autoCompleteText.common,o=Xe(e,"common"),s=e.tenantState.currentTenantId,i=Z(e),d=i?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,S=c.fetchState,h=Ea(e);return{transactionList:t.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter((b=>b.isDeleted===!1)),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:S,analytics:j,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ae,spendManagementEndPoint:`${Ye}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:h.affectedEntityIds}}),(function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:u}=n;return{updateTabToState:o=>{e(ce()),e(jt(o))},onSubtabChange:o=>{e(ce()),e(Pt(o))},onTransactionClick:(o,s)=>{const i=Te(u,o,s),d=T(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=ji(u),s=T(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;j?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=T(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(La(o))},onReloadTransactions:()=>{e($e(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e($a(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Va({filters:o})),o.categories.every((s=>s.field!=null&&s.values?.length!==0))&&j.trackSpendManagmentFilterChange("bill_pay",o.categories.map((s=>`${s.field}-${JSON.stringify(s.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&j.trackSpendManagementDownloadClick("bill_pay"),e(Ra({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Fa(o))},removeAllTransactionsFromBulkActionList:()=>{e(ce())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Pa(o,s??""));break;case"send_for_approval":e(it("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(it("approve")),t.navigate("./bulk-review");break;case"review":e(ja()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Ge)&&e(Ta(!1))},onEventReceived:o=>{o===Qt&&e(Da())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(He({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}}}}))(zn(Xn));function Ti(){const e=J(),t=le(),l=K(),n=Ie(),c=l.state,r=fe(),[u,o]=f.useState(!1),[s,i]=f.useState(null),d=na("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect((()=>(c?.tab!=null&&c?.subTab!=null&&(t(jt(c?.tab)),t(Pt(c?.subTab))),()=>{t(ce())})),[]);const p=L.getSignedInUser(),m=k((P=>Z(P))),{areTenantIdsInSync:S}=Nn(),[h,b]=f.useState(!1),{useFeatureGate:I}=oe(),{isFeatureEnabled:E}=I(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:x}=I(g.isBillPayCommentingEnabled),{isFeatureEnabled:C}=I(g.isReimbursementCommentingEnabled),{isFeatureEnabled:U}=I(g.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:D}=I(g.isBillPayBulkActionEnabled),{isFeatureEnabled:B}=I(g.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:O}=I(g.isBillPayDetectInsufficientFundsEnabled),V=k((P=>Ft(P,ae,D,p?.userId))),{isFeatureEnabled:W}=I(g.isDebitCardFeatureEnabled),N=V.fetchState,{isAiCfoAccessEnabled:v,onAskAiCfoClick:z}=Qe({mobileExploreReferrer:"Bills List"});Ze({isDataReady:N==="Completed"});const M=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,$=!!m.companyBillPayInfo?.info?.isBillPayEnabled,Y=k((P=>va(P.companyState,m.companyId))),q=Y?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect((()=>{!h&&$&&S&&(b(!0),t($e(ae,!0,E,B)))}),[h,ae,S,t]),p==null)throw Error("Can't access address page without signing in...");const X=(P,re)=>{t(Ca({uiState:{sortKey:P,sortOrder:re},period:ae}))},G=Rt(r?.loggedInUserRoleMap),F=de(r?.loggedInUserRoleMap),ve=P=>{o(P)},{billsProcessed:ke,billsProcessing:et}=k((P=>ka(P)));f.useEffect((()=>{ke===et&&s!=null&&(t(wa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:ke>1?we.headers.bills:we.texts.bill2},{variableName:"_has_",variableValue:ke>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Ba(s)}]})),t(xa()),setTimeout((()=>{t($e(ae,!0,E,!0,B))}),3e3),i(null))}),[ke,et]);const ea={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${Qt}`,`private-encrypted-${m.companyId}.${Ge}`]:[],eventCallback:(P,re,tt)=>{P.endsWith(Ge)?tt.onBillPayApprovalRulesEventReceived?.(P):re?.entity_type==="bill"&&(i(re.operation_type),tt.onEventReceived(P))}},ta=Vt(W,m),aa=$t(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?ta===!0||aa===!0?a.jsx(Jt,{}):$?a.jsxs(a.Fragment,{children:[N==="Completed"?a.jsx(Ee,{analytics:j,onLoad:P=>(re=>re.trackPageLoaded(Zt.Event.billPayHome))(P)}):null,a.jsxs(Ei,{windowSize:n,children:[a.jsx(qt,{isAppContentDrawerOpen:u,handleDrawerToggle:ve}),a.jsx(pi,{isOpen:d,drawerLeftMargin:new Xt(0,0,300,600),onClose:()=>{e(`/${m.tenantEmailDomain}/bills`),t(ce())},children:a.jsx(Pi,{onClick:P=>P.stopPropagation(),children:a.jsx(Ai,{tenantEmailDomain:m.tenantEmailDomain})})}),a.jsx(Di,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:x,isReimbursementCommentingEnabled:C,period:ae,isAdmin:!1,uiState:V.uiState,onColumnSortConfigChanged:X,isUserHasOnlyBillpayAccess:G,isShowDeletedBillsEnabled:E,isShowDeletedReimbursementEnabled:U,isBulkActionEnabled:D,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ve(!0)},isDownloadEnabled:V.isDownloadEnabled,connectedAccountProvider:q,bulkSubmissionLimit:V.billBulkSubmissionLimit,bulkSubmissionFetchState:V.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:V.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:B,isDetectInsufficientFundsEnabled:O,isAiCfoAccessEnabled:v,onAskAiCfoClick:z,...ea})]})]}):M===!0&&F===!0?a.jsx(ee,{to:"../setup"}):r!=null&&ze(m,r.loggedInUserRoleMap)?a.jsx(ee,{to:"../promo"}):a.jsx(se,{fetchState:N}):a.jsx(Ce,{})}const ji=e=>`/${e}/bills/setup`,Pi=_(si)`
|
|
89
|
+
display: flex;
|
|
90
|
+
min-height: 100%;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
`,{common:{currency:he},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=De.getLocalizedStrings(),Vi=Q((function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=H(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Xe(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=Ae(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ua(t.billDetailsView.paymentDetailsSection?.paymentType?.method),S=t.currentTenant.createTime,h=_t(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,I=S.add(b,"month").isAfter(h),E=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Ut(p,t.billDetailsView.approvalRules.allApprovalRules,l,t.billDetailsView.vendor?.id,t.billDetailsView.classId),x=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Ct(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${Ye}/transaction_attachment`,analytics:j,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:x.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:E,isZeniUser:d,isNewUser:I,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}}),(function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(ot(i));const d=St(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Ot(d,!1)),e(Nt({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(ot());const p=St(s,void 0,l),m=T(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(Ne(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Oe(i))},onSaveChangesToLocalStore:(i,d,p,m,S)=>{const h=_i(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:S}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ya({billDetailLocalData:h,billId:l}))},saveBillDetails:()=>{e(Ue("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(Mt("draft"))},reviewBillDetails:()=>{const i=$i(s,l),d=T(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Se({billId:i}))},clearBillPayReviewLocalState:()=>e(Wa()),onClickDismiss:()=>{const i=ne(s),d=T(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=T(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(ge(!1,i));const d=Li(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(ge(!1,i));const d=Gi(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(ge(!1,i));const d=Wt(s,l,i),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ne(s),d=T(r.state?.pathnameStackToGoBack,r.pathname);e(Se({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(i,d)=>{const p=Te(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=H(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Za(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Yn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Ha(!0,i,l))},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Xa("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(za(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Na(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Ma("bill_pay","bill_pay_detail")),e(Oa({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}}))(Hn);function gt(){const e=J(),t=K(),l=le(),{billId:n,tenantEmailDomain:c}=te(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(g.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(g.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(g.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(g.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=r(g.isRecurringBillsFeatureEnabled),{isFeatureEnabled:h}=r(g.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(g.isShaDisabled),{isFeatureEnabled:I}=r(g.isOurDisabled),{isFeatureEnabled:E}=r(g.isBillPayDetectInsufficientFundsEnabled),{configValue:x}=u(We.sameDayAchDisablementConfig),C=Ga(x),U=L.getSignedInUser(),D=k((G=>Z(G))),B=k((G=>Me(G,m,h,n))),O=Yt(D?.companyId,{clearParams:B.fetchState==="Completed"}),{isAiCfoAccessEnabled:V,onAskAiCfoClick:W}=Qe({mobileExploreReferrer:"Bill Details"});Ze({isDataReady:B.fetchState==="Completed"});const N=D.companyId??L.getSignedInUserTenant(c)?.companyId,v=fe(),z=Lt(v?.loggedInUserRoleMap),M=Gt(v?.loggedInUserRoleMap),$=de(v?.loggedInUserRoleMap),Y=wt(D.userRole);if(f.useEffect((()=>{n!=null&&l(Bt(n))}),[n]),U==null)throw Error("Can't access address page without signing in...");const q=k((G=>_a(G.accountState,G.accountListState,"billPayAccountList"))),X={pathname:"../",search:t.search};return B.isDeleted===!0||B.billStage=="paid"||B.fetchState=="Not-Started"?a.jsx(ee,{to:X}):B.deleteStatus.fetchState==="In-Progress"||s?a.jsx(se,{fetchState:B.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Ee,{analytics:j,onLoad:G=>(F=>{n!=null&&B.deleteStatus.fetchState!=="Completed"&&F.trackBillPayEditBill(n,B.isRecurring)})(G)}),a.jsx(Vi,{initialOpenThreadRequest:O??void 0,location:t,navigate:e,currentTenant:D,billId:n,companyId:N,billDetailsView:B,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:q,isInternationalPaymentShaVsOurEnabled:i,vendor:B.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:I,isRecurringBillsFeatureEnabled:S,hasZeniAccountsAdminAccess:z,isZeniAccountsUser:M,isBillPayAdmin:$,isSuperAdmin:Y,isDetectInsufficientFundsEnabled:E,sameDayAchDisablementConfig:C,isAiCfoAccessEnabled:V,onAskAiCfoClick:W})]})}const St=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},$i=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},Li=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Gi=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},R="paymentDetails",_i=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?pe(t.whatFor.invoiceDate.toString()):_t(),billDueDate:t.whatFor.billDueDate?pe(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?pe(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find((b=>b.id===t[R]?.withdrawFrom?.selectedOption)),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(qa)&&u?.vendorCurrencyCode===he.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=t[R]?.recurringPaymentType?.selectedOption===Fi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Ja(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?pe(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?pe(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},S=Ui(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),h=Object.keys(S).length>0?Zn(S):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:h,recipientTotalAmount:h,file:e.file,updatesByLineId:S,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Ui=(e,t,l,n,c,r)=>{const u={};return n.forEach((o=>{let s,i;o.account.selectedOption!=null&&(s=e.find((p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption))),o.class?.selectedOption!=null&&(i=t.find((p=>p.classId===o.class.selectedOption)));const d=Wn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??he.currencyCode,currencySymbol:o.currency?.currencySymbol??he.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??he.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??he.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}})),u},Mi=_.div`
|
|
93
|
+
display: flex;
|
|
94
|
+
height: 100vh;
|
|
95
|
+
width: 100%;
|
|
96
|
+
flex: 1 1 auto;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
align-items: center;
|
|
99
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
100
|
+
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
+
`,Oi=Q((function(e,t){const{vendorId:l,billId:n}=t,c=ye(e,l),r=Me(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(tn(s))},onSaveHandler:()=>{e(en(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(Qa({data:i}))},onCancel:()=>{(()=>{const s=H(c.state?.pathnameStackToGoBack),i=s.poppedPathname??yt();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(lt())},onAddressClick:s=>{const i=Ke(o,s,l),d=T(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Ka({fetchState:"Not-Started"}));const s=H(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??yt(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(lt())}}}))(qn);function Ni(){const e=J(),t=K(),l=Ie(),{vendorId:n,billId:c}=te(),{useFeatureGate:r}=oe(),u=ue(),o=L.getSignedInUser(),s=k((h=>Z(h))),i=H(t.state?.pathnameStackToGoBack),d=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=k((h=>ye(h,n))),{isFeatureEnabled:m}=r(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=r(g.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Mi,{windowSize:l,children:[a.jsx(Je,{vendorId:n,billId:c}),a.jsx(Oi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:S})]})}const yt=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},zi=_.div`
|
|
102
|
+
display: flex;
|
|
103
|
+
height: 100vh;
|
|
104
|
+
width: 100%;
|
|
105
|
+
flex: 1 1 auto;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
align-items: center;
|
|
108
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
109
|
+
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
+
`,Xi=Q((function(e,t){const{vendorId:l}=t,n=ye(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=nn(e,c||"international_business",t.billId),u=n.editVendorState??n.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[on(t.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:n,bankAccountContext:t.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}}),(function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(dn(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,i,d,p)=>{e(rn(s)),p&&e(cn(i,d))},onCurrencyUpdated:(s,i,d)=>{e(sn(s,i,d,!1))},onCancel:()=>{(()=>{const s=H(c.state?.pathnameStackToGoBack),i=s.poppedPathname??ft();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(st())},onAddressClick:s=>{const i=Ke(o,s,l),d=T(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(ln({fetchState:"Not-Started"}));const s=H(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??ft(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(st())}}}))(Jn);function Hi(){const e=J(),t=K(),l=Ie(),{vendorId:n,billId:c}=te(),r=le(),u=ue(),o=L.getSignedInUser(),s=k((C=>Z(C))),i=H(t.state?.pathnameStackToGoBack),[d,p]=f.useState(!1),m=k((C=>C.vendorViewState.newVendorState.fetchStatus.fetchState)),S=k((C=>n!=null?C.vendorViewState.editVendorStateById[n]?.fetchStatus.fetchState??"Not-Started":"Not-Started")),h=n!==void 0?S:m;f.useEffect((()=>{d===!1&&h==="Not-Started"&&n!=null&&(r(ge(!1,n)),p(!0))}),[d,h,n]);const[b,I]=f.useState(!1);f.useEffect((()=>{b||h==="In-Progress"||(I(!0),r(an(c,n)))}),[b,h,r]);const E=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",x=k((C=>ye(C,n)));if(o==null)throw Error("Can't access international wire page without signing in...");return E==="billDetail"&&x.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:x.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(zi,{windowSize:l,children:[a.jsx(Je,{vendorId:n,billId:c}),a.jsx(Xi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:E})]})}const ft=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},It=_.div`
|
|
111
|
+
display: flex;
|
|
112
|
+
height: 100vh;
|
|
113
|
+
width: 100%;
|
|
114
|
+
flex: 1 1 auto;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
align-items: center;
|
|
117
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
118
|
+
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
+
`,Zi=Q((function(e,t){const l=L.getSignedInUser(),n=zt(e,t.billId),c=pn(e),r=Ae(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Ut(u,c.allApprovalRules,l,n.vendor?.id,n.classId);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:j,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}}),(function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=T(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:n,data:s})),e(Ue(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(At({billId:n}))},updateBillDetailSaveBillCode:()=>{e(Mt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Te(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(xe(t.billId,"retry"))}}}))(Qn);function vt(){const e=J(),t=le(),l=K(),{billId:n}=te(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(g.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(g.isBillPayDetectInsufficientFundsEnabled),o=Ie(),s=L.getSignedInUser(),{isFeatureEnabled:i}=c(g.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(g.isBillPayCommentingEnabled),m=H(l.state?.pathnameStackToGoBack),{poppedPathname:S}=m,{isFeatureEnabled:h}=c(g.isRecurringBillsFeatureEnabled),b=k((x=>Z(x))),I=k((x=>zt(x,n))),E=I.fetchState??"Not-Started";if(f.useEffect((()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null})),[e]),f.useEffect((()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)}),[]),f.useEffect((()=>{const x=I.vendor?.name,C=I.vendor?.id,U=I.totalAmount.amount,D=I.recipientTotalAmount.amount,B=I.invoiceNumber;x&&C&&t(un(x,C,U,D,B,n))}),[]),S==null)return a.jsx(ee,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return E==="In-Progress"?a.jsx(It,{windowSize:o,children:a.jsx(Kn,{})}):a.jsx(It,{windowSize:o,children:a.jsx(Zi,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:h,isDetectInsufficientFundsEnabled:u})})}const Wi=Q((function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=Xe(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=L.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:i,analytics:j,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}}),(function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(xn(u??void 0,t.billId)),i!=null&&e(Cn(i))},saveVendorDetailLocalData:i=>{e(Nt({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(Bn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(rt(u))},updateSelectedVendorForCreate:i=>{e(wn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?Wt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=T(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?vn(i,"vendor",u):kn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Ke(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(In({files:i}))},onEditFileName:(i,d)=>{e(fn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(rt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(yn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(Sn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=H(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ri(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(gn(i,"BillPayVendor"))},onResendOtp:i=>{e(hn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(bn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(mn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Ot(i,!1))}}}))(ni),Be=()=>{const e=J(),t=le(),l=ei(),n=K(),{billId:c,vendorId:r}=te(),u=k((b=>Z(b))),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(g.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),p=k((b=>b.vendorViewState.newVendorState.fetchStatus.fetchState)),m=k((b=>ye(b,r))),S=k((b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started")),h=r!==void 0?S:p;return f.useEffect((()=>{i===!1&&h==="Not-Started"&&r!=null&&(t(ge(!1,r)),d(!0))}),[i,h,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ti,{}):h==="Error"?a.jsx(ai,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Je,{vendorId:r,billId:c}),a.jsx(Wi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Yi=Q((function(e,t){const{companyId:l}=t;return{billPaySetupView:An(e,l),analytics:j,videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}}),(function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(En(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}}))(oi),qi=()=>{const e=ii(),t=J(),l=K(),{tenantEmailDomain:n}=te(),[c,r]=f.useState(!1),u=ue(),o=k((h=>Z(h))),s=o.companyId??L.getSignedInUserTenant(n)?.companyId,i=L.getSignedInUser(),d=fe(),p=!!o.companyBillPayInfo?.info?.isBillPayTOSAccepted,m=de(d?.loggedInUserRoleMap),S=h=>{r(h)};if(i==null)throw Error("Can't access bill pay promo page without signing in...");return o.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(ee,{to:"../../../bills"}):p===!0&&m===!0?a.jsx(ee,{to:"../../bills/setup"}):p===!1||d!=null&&ze(o,d.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Ee,{analytics:j,onLoad:h=>(b=>b.trackPageLoaded(Zt.Event.billPayPromoPage))(h)}),a.jsx(qt,{isAppContentDrawerOpen:c,handleDrawerToggle:S}),a.jsx(Yi,{companyId:s,navigate:t,location:l,meetingUrl:e("bill_pay_promo"),onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:u.colors.grey5}})};function jo(){const e=k(($=>Z($))),t=fe(),l=de(t?.loggedInUserRoleMap),n=ue(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(g.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Ni,{isFeatureEnabled:o}=c(g.isDebitCardFeatureEnabled),s=Vt(o,e),i=$t(e),d=K(),p=e?.userRole!=null&&kt(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&de(t?.loggedInUserRoleMap),S=Rt(t?.loggedInUserRoleMap),h=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Dn(t?.loggedInUserRoleMap),b=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,I=b&&Lt(t?.loggedInUserRoleMap),{isFeatureEnabled:E}=c(g.isChargeCardFeatureEnabled),x=li(e,E,o)&&!p,C=x&&Tn(t?.loggedInUserRoleMap),U=jn(t?.loggedInUserRoleMap),D=Gt(t?.loggedInUserRoleMap),B=Pn(t?.loggedInUserRoleMap),O=b&&D,V=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&B,W=Fn(t?.loggedInUserRoleMap),N=Rn(t?.loggedInUserRoleMap),v=Vn(t?.loggedInUserRoleMap),z=x&&W,{tenantEmailDomain:M}=te();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"setup",element:a.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:U,productType:"bill_pay",type:"setup"})}),a.jsx(y,{path:"verification",element:a.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:U,productType:"bill_pay",type:"verification"})}),a.jsx(y,{path:"promo",element:a.jsx(qi,{})}),a.jsx(y,{path:"approval-rules/*",element:m?a.jsx(mi,{}):a.jsx(bi,{showZeniAccountRoute:O,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:v,showTreasuryRoute:V,isTenantBankingOnly:s,showChargeCardRoute:z,tenantEmailDomain:M??""})}),a.jsx(y,{path:"international-wire",element:a.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:U,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(y,{path:"*",element:a.jsx(Ti,{})}),(s===!0||i===!0)&&a.jsx(y,{path:"/*",element:a.jsx(Jt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(y,{path:"*",element:a.jsx(ee,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(y,{path:"*",element:a.jsx(ee,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(y,{path:":billId",element:a.jsx(w,{appContent:a.jsx(gi,{})})}),a.jsx(y,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(y,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(y,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(y,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(ut,{isSubPage:!0})})}),a.jsx(y,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(ut,{isSubPage:!0})})}),a.jsx(y,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"*",element:a.jsx(Ce,{})})]}):a.jsx(y,{path:"*",element:a.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(y,{path:"*",element:a.jsx(Ce,{})})]})}export{jo as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as V}from"./sentry-BRmieicQ.js";import{u as Y,j as b,h as ne,g as se,i as oe,N as ie,l as re}from"./core-DA_GbUVO.js";import{fE as U,GU as ce,Yn as ue,AY as de,RA as pe,H6 as le,Kh as me,N4 as fe,NK as ye,Oz as Se,Yo as ge,Yp as Ie,Yq as he,Yr as be,Ys as Te,UD as De,Xt as Oe,US as Ce,Ll as ke,UT as Ve,Lp as Ae,mG as we,gF as Ne,gE as Fe,gD as _e,ul as ve,uc as Ee,u9 as xe,my as Be,B5 as Ue,B3 as z,bE as R,Bh as L,cE as ze}from"./zeni-epic-state-cafsD4rZ.js";import{bS as Re,V as Le,M as Pe,bi as Me,z as B,a8 as je,h as P,n as E,S as x,bU as Ge,ae as Ye,p as M,aG as j}from"./index-CsnAk3jU.js";import{n as qe}from"./mui-yMDYeeMr.js";import{j as k}from"./liveblocks-DTaiayIC.js";import{d as G}from"./routePaths-DeWRBZpS.js";import{M as Ke}from"./MobileAppDrawer-cBt39NZW.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new t.Error().stack;u&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[u]="79fbc3e1-fcdd-44c6-88f2-1c8efe719d45",t._sentryDebugIdIdentifier="sentry-dbid-79fbc3e1-fcdd-44c6-88f2-1c8efe719d45")}catch{}})();function nt(){const t=Y(),u=b((r=>U(r))),n=u?.tenantId,{isApprovalRulesV3Enabled:i,isLoading:d}=Re(n),p=b((r=>r.billPaySetupApproverViewState.fetchState));V.useEffect((()=>{n==null||d||p==="Not-Started"&&t(ce(!0,!0,i))}),[n,d,i,p,t])}const Ze=qe.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: ${t=>t.theme.colors.grey4};
|
|
9
|
+
`,$e=re((function(t,u){const{businessVerificationDetails:n}=u,i=U(t),d=B.getSignedInUser(),p=i.tenantId,r={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:p??""},T=De(u.roleMap)&&n.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Oe(t.companyConfigState),s=Ce(t.userRoleConfigState);return{businessVerificationDetails:n,verficationDetailsFetchState:n.fetchState,isRefreshingViewInBackground:n.isRefreshingViewInBackground,allNationalityCountries:n.allNationalityCountries,filesEndPoint:`${Ye.fileMicroServiceBaseUrl}`,authParams:r,isDisabled:T,allIndustries:e.companyIndustries??[],companyTitles:s.companyTitles}}),(function(t,u){const{companyId:n,productType:i,currentTenant:d,navigate:p,location:r}=u,{tenantEmailDomain:T}=d;return{onCompanyDetailsChanged:e=>{const{companyDescription:s,companyIndustry:m,companyIndustryType:O,companyLegalName:C,companyTaxId:g,companyWebsite:y,companyPhone:I,primaryContactEmail:c,primaryContactName:o,primaryContactUserId:l,primaryContactSyncToken:D,syncToken:S,fileIds:a,incDate:f,typeOfIncorporation:A,stateOfIncorporation:w,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:K,transactionVolume:Z,transactionVolumeDescription:$,purposeOfAccount:H,purposeOfAccountDescription:W,regulatedStatus:X,regulatedStatusDescription:J,usNexus:Q,usNexusTypes:ee}=e,_=O?.selectedOption,te={companyId:n,companyDescription:s,companyIndustry:m.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:C,taxIdOrEIN:g,website:y!=""&&y!=null?ze(y):void 0,phone:I,syncToken:S,fileIds:a,incDate:f!=null?R(f?.toString()):f,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map((v=>v.length===2?v:j(v)))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:K,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:H?.selectedOption??"",purposeOfAccountDescription:W,regulatedStatus:X??"",regulatedStatusDescription:J,usNexus:Q,usNexusTypes:ee?.selectedOptions??[]},ae={userId:l,firstName:o.firstName,lastName:o.lastName,email:c,syncToken:D};t(L({companyDetails:te,primaryContactDetails:ae}))},onCompanyOfficerUpdated:e=>{const s=e.map((m=>{const{officerType:O,userId:C,name:g,email:y,nationalityCountryCode:I,ssn:c,dob:o,phone:l,syncToken:D,selectDocument:S,role:a,ownership:f,isSelectedForVerification:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F}=m;let h;return S.selectDocumentType==="driverLicense"?h="driving_license":S.selectDocumentType==="passport"?h="passport":S.selectDocumentType==="stateId"?h="id_document":S.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:O,userId:C,firstName:g.firstName,lastName:g.lastName,email:y,ssn:c,nationalityCountryCode:I?.selectedOption!=null?j(I.selectedOption):void 0,phone:l,birthday:o!=null?R(o?.toString()):o,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:f,documentTypeSelectedForVerification:h,isSelectedForVerification:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));t(L({officers:s}))},onSaveDetailsClick:e=>{t(z(n,e,i))},onSendForVerificationClick:e=>{t(z(n,e,i,!0))},onAddressClick:e=>{const s=G(T,e),m=M(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onRegisteredAddressClick:e=>{const s=G(T,e),m=M(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onBackClick:()=>{t(Ue({companyId:n})),p("../setup")},updateFilesEntity:e=>{t(Be({files:e}))},onDeleteFile:e=>{t(xe(e))},onDeleteFileList:e=>{t(Ee(e))},onEditFileName:(e,s)=>{t(ve(e,s.split(".")[0]))},onGetOtp:e=>{t(_e(e,"SpendManagementSetup"))},onResendOtp:e=>{t(Fe(e,"SpendManagementSetup"))},onVerifyOtp:(e,s)=>{t(Ne(e,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(e,s)=>{t(we({addressType:e,addressToCreate:s}))},onIdentityDocumentUploadedForAutofill:e=>{if(n==null)return;const s=Ve(e.documentType);s!=null&&t(Ae({target:"setup",companyId:n,officerType:e.officerType,fileId:e.fileId,documentType:s}))},onCompanyDocumentUploadedForAutofill:e=>{n!=null&&t(ke({target:"setup",companyId:n,fileId:e.fileId,documentType:e.documentType}))}}}))(Ge),st=({productType:t})=>{const u=ne(),n=se(),i=Y(),[d,p]=V.useState(!1),[r,T]=V.useState(!1),{tenantEmailDomain:e}=oe(),s=Le(),{useDynamicConfig:m}=Pe(),{configValue:O}=m(Me.zeniAccountsConfig),C=ue(O),g=b((a=>{switch(t){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}})),y=b((a=>a.companyConfigState.fetchState)),I=b((a=>a.userRoleConfigState.fetchState)),c=b((a=>U(a))),o=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(V.useEffect((()=>{y==="Not-Started"&&i(de()),I==="Not-Started"&&i(pe(!0))}),[y,I,i]),V.useEffect((()=>{if(!d&&g==="Not-Started"&&o!=null)switch(p(!0),t){case"zeni_accounts":i(Se(o,!0));break;case"zeni_treasury":i(ye(o,!0));break;case"reimbursement":i(fe(o,!0));break;case"charge_cards":i(me(o,!0));break;default:i(le(o,!0))}}),[d,g,o,i]),B.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let l;switch(t){case"zeni_accounts":l=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":l=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":l=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":l=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:l=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{T(a)},S=b((a=>{switch(t){case"zeni_accounts":return Te(a,o);case"zeni_treasury":return be(a,o);case"charge_cards":return he(a,o);case"reimbursement":return Ie(a,o);default:return ge(a,o)}}));return l===!1?k.jsx(ie,{to:"../promo"}):k.jsxs(Ze,{children:[k.jsx(je,{analytics:P,onLoad:a=>(f=>{switch(t){case"zeni_accounts":return f.trackPageLoaded(x.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return f.trackPageLoaded(x.Event.reimbursementBusinessVerification);default:return f.trackPageLoaded(x.Event.billPayBusinessVerification,E(n)?"Settings":void 0)}})(a)}),E(n)?k.jsx(Ke,{isAppContentDrawerOpen:r,handleDrawerToggle:D}):null,k.jsx($e,{businessVerificationDetails:S,navigate:u,location:n,companyId:o,analytics:P,currentTenant:c,productType:t,isSettings:E(n),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:C.maxInsuredAmount})]})};export{st as B,nt as u};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{j as g}from"./liveblocks-DTaiayIC.js";import{a as l}from"./sentry-BRmieicQ.js";import{u as me,h as he,g as Ce,j as M,i as fe,l as Se}from"./core-DA_GbUVO.js";import{a as ge,e5 as be,z as ye,e7 as Pe,e9 as N,ea as Ie,bn as W,a8 as we,h as j,eb as H,el as Ee,G as ke,S as xe,w as Ae,ee as Te,ef as Ue,av as _e,ei as ve,ej as Oe,bk as Qe,ek as Fe}from"./index-CsnAk3jU.js";import{gJ as je,fD as G,fE as De,g7 as $e,jg as Le,jc as Ve,fF as z,gt as Re,gn as qe,gp as B,gv as Me,gw as He,gx as ze,gy as Be,gz as Ne}from"./zeni-epic-state-cafsD4rZ.js";import{D as We,n as $,P as Ge,S as Je}from"./mui-yMDYeeMr.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.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]="23e3a6c6-156a-4b9e-8a03-f513b76e497a",e._sentryDebugIdIdentifier="sentry-dbid-23e3a6c6-156a-4b9e-8a03-f513b76e497a")}catch{}})();const J="chat-response-generated",Y="cards/ask",K="card_policy_hero";function D(e){return`/${e}/cards`}function X(e){return`/${e}/cards/policy`}const Ye=Se((function(e,a){const o=G(e),d=a.isSubmitting,c=Ue(e,{allUsers:a.allUsers,onCardPolicyVendorSearchTextChange:a.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:a.sessionFromUrl==="new_chat"&&o.uiState.currentChatSessionId==null,aiCfoView:o,isSubmitting:d,isNewChatSession:a.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,exportDownloadEndPoint:ve(),emailLinkQuestion:a.emailLinkQuestion,autoSubmitEmailLinkQuestion:a.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:a.onEmailLinkQuestionProcessed,isFileUploadEnabled:a.isFileUploadEnabled,isUploadPromoVisible:a.isUploadPromoVisible,onUploadPromoClose:a.onUploadPromoClose,...c}}),(function(e,a){const{location:o,currentTenant:d,userId:c,navigate:p,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:E,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,cardPolicyPageContext:U}=a,i=d.tenantEmailDomain,C=o.state?.referrer,m=C===K?X(i):D(i);return{onEventReceived:(n,t)=>{if(n===J&&typeof t.text=="string"&&typeof t.metadata=="object"){const s=t,f=He(s.type),b=s.metadata.chat_session_id??null,{currentChatSession:y,currentQuestionAnswer:u,currentQuestionAnswerSummary:P}=W(E,b);f!=="answer"?j.trackAICFOChatResponseGenerated(f,u?.question.questionText??"",s.text,b,Fe(P,y),s.metadata.message_id??null):j.trackAICFOChatAnswerGenerated(s.text,u?.question.questionText??"",(s.follow_up_questions?.length??0)>0,!!s.assumptions,!!s.insights,s.visualization!=null,ze(s.visualization?.type??"")??null,b,s.summarized_title,s.metadata.message_id??null),e(Be({chatSessionId:s.metadata.chat_session_id,responseType:f,fetchState:{fetchState:"Completed",error:void 0}})),e(Ne({chatSessionId:s.metadata.chat_session_id,answerPayload:s,userId:c}))}},onSubmit:(n,t,s,f)=>{n&&Qe(e,n,t,h,E,c,f,s,U)},updateCurrentInput:n=>{e(B(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{e(Me(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{p(m,{state:{...o.state}}),e(B(""))},togglePageView:()=>{p(m,{state:N(o.state)}),a.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{h!=null&&e(qe()),p((function(n){return`/${n}/${Y}`})(i),{state:{...o.state}})},onToggleCotCollapsed:(n,t)=>{e(Re({questionAnswerId:n,isCollapsed:t}))},...Oe(e,{isAiCardCreationEnabled:A,isCardPolicyEnabled:T,currentChatSessionId:h,onAfterCardsCreationSubmit:()=>{a.setIsAiCfoOpen(!0),p(D(i),{state:{...o.state}})},onAfterCardPolicySubmit:()=>{a.setIsAiCfoOpen(!0),p(`/${i}/cards/policy`,{state:{...o.state}})}})}}))(Ae(Te)),{spendManagement:{chargeCard:{cardsAiCfoHero:Z,cardPolicyAiCfoHero:ee}}}=ke.getLocalizedStrings(),x=Z.pageTitle,Ke=ee.pageTitle,Xe=Z.chatHeaderSubtitle,Ze=ee.chatHeaderSubtitle,gt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:a}=ge(),o=me(),d=he(),c=Ce(),[p,h]=l.useState(!1),{allUsers:E,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,onCardPolicyVendorSearchTextChange:U}=be();l.useEffect((()=>{o(je())}),[o]);const i=M((r=>G(r))),C=ye.getSignedInUser(),{session_id:m}=fe(),n=M((r=>De(r))),t=i.uiState.currentChatSessionId,s=n.tenantEmailDomain,{handleUploadPromoClose:f,isUploadPromoVisible:b}=Pe({isFileUploadEnabled:e,tenantEmailDomain:s}),y=c.state,u=y?.aiCfoInitialQuestion??null,P=!!y?.aiCfoShouldSubmit,I=y?.referrer===K,te=I?"card_policy":void 0,se=l.useMemo((()=>({title:I?Ke:x,subtitle:I?Ze:Xe})),[I]),[ae,_]=l.useState(null),[oe,v]=l.useState(!1),O=l.useRef(!1);l.useEffect((()=>{O.current||u==null||u===""||(_(u),v(P),O.current=!0)}),[u,P]);const ne=l.useCallback((()=>{_(null),v(!1),d(c.pathname,{replace:!0,state:N(c.state)})}),[c.pathname,c.state,d]),ie=n.masterTOSInfo,S=ie?.isMasterTOSAccepted??!1,k=l.useRef(null);l.useEffect((()=>{if(S&&k.current!=null){const{question:r,shouldSubmit:w}=k.current;k.current=null,_(r),v(w),O.current=!1}}),[S]);const{visitedSessions:L}=Ie(t),Q=i.fetchState,F=i.uiState.chatSessionsNextPageToken.hasMore||!i.uiState.chatSessionsFirstPageFetched,V=t!=null?i.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(i.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),q=i.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:re}=W(q,t),le=re.length===0;l.useEffect((()=>{t!=null&&m!==t&&d((function(r,w){return`/${r}/${Y}/${w}`})(s,t),{state:{...c.state},replace:!0})}),[t,m,s,d,c.state]),l.useEffect((()=>{m!=null&&t==null&&m!=="new_chat"&&o($e({sessionId:m,agentId:"controller"}))}),[]);const ce=l.useMemo((()=>({events:L.map((r=>`private-encrypted-chat-${r}.${J}`)),eventCallback:(r,w,pe)=>pe.onEventReceived(r,w)})),[L]);if(l.useEffect((()=>{Q!=="In-Progress"&&F&&o(Le())}),[Q,F,o]),l.useEffect((()=>{t!=null&&V!=="In-Progress"&&R&&C!=null&&Q==="Completed"&&!F&&o(Ve(t,C.userId))}),[V,R,t,C,o]),C==null)throw Error("Can't access Cards AI CFO page without signing in...");const de=m??"new_chat",ue=t!=null&&i.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return g.jsxs(tt,{children:[g.jsx(we,{analytics:j,onLoad:r=>r.trackPageLoaded(xe.Event.aiCFOPage)}),S?g.jsx(Ye,{...ce,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:q,allUsers:E,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,openOnboardingPage:()=>h(!0),userId:C.userId,setIsAiCfoOpen:a,navigate:d,sessionFromUrl:de,location:c,isSubmitting:ue,isEmptyChatWithSession:le,customPageTitle:x,chatHeader:se,currentTenant:n,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:oe,onEmailLinkQuestionProcessed:ne,isFileUploadEnabled:e,isUploadPromoVisible:b,onUploadPromoClose:f,onCardPolicyVendorSearchTextChange:U,cardPolicyPageContext:te}):g.jsx(H,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:x,onCloseClick:()=>{d(I?X(s):D(s),{state:{...c.state}})},onCompleteClick:()=>{S||n.userRoleId==null||(u!=null&&u!==""&&(k.current={question:u,shouldSubmit:P}),o(z(n.userRoleId)))}}),g.jsx(We,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:st,style:{width:`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:g.jsx(et,{onClick:r=>r.stopPropagation(),children:g.jsx(H,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:x,onCloseClick:()=>h(!1),onCompleteClick:()=>{S||n.userRoleId==null||o(z(n.userRoleId)),h(!1)}})})})]})},et=$(Je)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,tt=$.div`
|
|
6
|
+
flex: 1 1 auto;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
min-height: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
`,st=$(Ge)`
|
|
12
|
+
box-shadow: ${({theme:e})=>e.colors.elevation2};
|
|
13
|
+
color: ${({theme:e})=>e.colors.grey4};
|
|
14
|
+
`;export{gt as default};
|