@zeniai/web-app-ui 5.3.46-qa → 5.3.47-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-BT617fFT.js → AccountMappingScreen-BPRZHuGA.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-B8f2yDaP.js → ActualMatchingMatchDetailScreen-CoU3K4PM.js} +1 -1
- package/dist/assets/AddressRoutes-3x6JmFfR.js +1 -0
- package/dist/assets/AddressScreen-DhOzuvLT.js +9 -0
- package/dist/assets/{AiCfoScreen-CW5K1JhC.js → AiCfoScreen-Blx6lCnY.js} +1 -1
- package/dist/assets/{AppDrawer-D5UtqVeE.js → AppDrawer-C7L5LQYC.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-DwyJret-.js → BillPayApprovalRoutes-Bu8vaB46.js} +1 -1
- package/dist/assets/BillPayRoutes-T-Lct0sH.js +119 -0
- package/dist/assets/{BusinessVerificationPageScreen-BL6H7JF-.js → BusinessVerificationPageScreen-CPnmoF6z.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-CIq15Z-M.js +14 -0
- package/dist/assets/{ChargeCardRoutes-Brg8E0b9.js → ChargeCardRoutes-BKDstMtL.js} +1 -1
- package/dist/assets/CompanyPassportScreen-D3aXSi-v.js +1 -0
- package/dist/assets/ConnectionAuthScreen-1A7_ld_X.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-7T0XvKs6.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BffNdH_l.js → CustomerOnboardingRoutes-BivxymAu.js} +3 -3
- package/dist/assets/{DashboardRoutes-CdQzvjb3.js → DashboardRoutes-CZNxS99K.js} +1 -1
- package/dist/assets/{DefaultTenantHome-Bve2xDaJ.js → DefaultTenantHome-BWCll08J.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-Dj3JCDGh.js → DomesticWireDetailScreen-DGMYJzFE.js} +4 -4
- package/dist/assets/{DrawerScreen-CxKP-6Rf.js → DrawerScreen-0c_ealW2.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-CRL6OrqO.js → EntityDetailRoutes-Db8C6L2J.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-BYSJ88to.js → ExpenseAutomationRoutes-Cjko15u2.js} +1 -1
- package/dist/assets/FeaturePreviewScreen-B5Hq_fA2.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-DAHGdPOy.js → HubSpotOAuthCallbackScreen-B6Nn-XMl.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-gj6fT2eX.js → InboxNotificationsProvider-BmF5-_KA.js} +1 -1
- package/dist/assets/InvoicingRoutes-0xj-PlaS.js +2 -0
- package/dist/assets/{MagicLinkRoutes-CC75kCuL.js → MagicLinkRoutes-B9y3UF8M.js} +8 -8
- package/dist/assets/MagicLinkSignInScreen-vHrJm7dw.js +12 -0
- package/dist/assets/MobileAppDrawer-CjKRvtSN.js +1 -0
- package/dist/assets/NotFoundScreen-MJal1hew.js +1 -0
- package/dist/assets/{NotificationRoutes-njgUFBoj.js → NotificationRoutes-CT24D8Uv.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-BCgV9bma.js → OAuthConsentScreen-CFMLbvn8.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-CZ27RjQE.js → PandLWithForecastRoutes-ByUQV7tm.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-BrTP8y76.js → PaymentLinkScreen-B2QO2fQL.js} +4 -4
- package/dist/assets/{PeopleRoutes-CulbMsz3.js → PeopleRoutes-DOJEhG7S.js} +9 -9
- package/dist/assets/PerformanceRoutes-CdWAF5sI.js +1 -0
- package/dist/assets/{Preview-j2_daqeV.js → Preview-DMLQokX_.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CbxnK800.js → QBOConnectionScreen-CvbLmaBz.js} +23 -23
- package/dist/assets/{ReimbursementApprovalRoutes-DeN7vJtz.js → ReimbursementApprovalRoutes-CEEFZS8r.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DTKS2oJ9.js → ReimbursementApprovalRuleDetailScreen-5MNnVAqy.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-_NvdZWfU.js → ReimbursementRoutes-G7JKpwJT.js} +1 -1
- package/dist/assets/{ReportsRoutes-BAGPRsE0.js → ReportsRoutes-Bgz_pVpt.js} +1 -1
- package/dist/assets/RewardsRoutes-Bcb3M70b.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-B5q5sAGy.js → ScheduleDetailsPrepaidExpensesScreen-luC81eat.js} +5 -5
- package/dist/assets/{ScreenRoutes-BHHy1uXx.js → ScreenRoutes-DA06Fnfd.js} +2 -2
- package/dist/assets/{SettingsRoutes-BtUbt9zq.js → SettingsRoutes-BrsZS6Xg.js} +3 -3
- package/dist/assets/{SetupPagesScreen-D0fdMGb4.js → SetupPagesScreen-DL_o3Z3i.js} +1 -1
- package/dist/assets/SignInScreen-NP6vHITl.js +1 -0
- package/dist/assets/SignOutScreen-D28SfRtf.js +9 -0
- package/dist/assets/TaskListScreen-W52vNP7m.js +9 -0
- package/dist/assets/{TaskRoutes-DpYRDMWP.js → TaskRoutes-DLlKeXMA.js} +1 -1
- package/dist/assets/TransactionDetailRoutes-BszvDFhJ.js +1 -0
- package/dist/assets/{TransactionDetailScreen-CjwF3ORf.js → TransactionDetailScreen-CcO0FUjf.js} +2 -2
- package/dist/assets/{TransactionListRoutes-2fGCqEq5.js → TransactionListRoutes-C1dcOuNI.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CuPpvoic.js → TreasuryRoutes-D_yTnBTc.js} +5 -5
- package/dist/assets/{VendorsRoutes-B_Yg40bd.js → VendorsRoutes-BVvoooN6.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-ChaM_jYJ.js → WiseConfirmationScreen-l0eeo939.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-CfMUrMqe.js → ZeniAccountRoutes-DImTioOs.js} +7 -7
- package/dist/assets/{ZeniAccountStatementScreen-BgdXcTdx.js → ZeniAccountStatementScreen-wUD7vElb.js} +1 -1
- package/dist/assets/{accountMappingHelper-DWzrp9Pr.js → accountMappingHelper-DqBiQF6x.js} +1 -1
- package/dist/assets/{analytics-wktvfErl.js → analytics-D6GpUSOP.js} +1 -1
- package/dist/assets/{analyticsHelper-DcvdGte-.js → analyticsHelper-H1Xp9Uyk.js} +1 -1
- package/dist/assets/{core-D6EV-11Y.js → core-B5mDy9pu.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-MQV5aj_5.js → decodeURIComponentSafe-DANuhXnG.js} +1 -1
- package/dist/assets/{dnd-CkchuQYc.js → dnd-CGWe1ZMP.js} +1 -1
- package/dist/assets/{empty-PZV8n_Ql.js → empty-D0y6rZ_X.js} +1 -1
- package/dist/assets/{empty-DQLKD1Hp.js → empty-Dj4ZMRNZ.js} +1 -1
- package/dist/assets/{emptyVideoElement-CnlqukSR.js → emptyVideoElement-BbYSqu6F.js} +1 -1
- package/dist/assets/epic-mSW644GG.js +2 -0
- package/dist/assets/{expenseAutomationHelper-DEOPVtcg.js → expenseAutomationHelper-DBDpSggk.js} +1 -1
- package/dist/assets/{getLocaleForTenant-C3wVeXiS.js → getLocaleForTenant-xZFgPOZu.js} +1 -1
- package/dist/assets/{index-EnAqWoDC.js → index-6yt3BfRL.js} +1 -1
- package/dist/assets/{index-BlnK23AJ.js → index-8s12XWuB.js} +1 -1
- package/dist/assets/{index-CBlRXIxp.js → index-BQBXaLiB.js} +1 -1
- package/dist/assets/{index-B5kf_qFj.js → index-CI8tXM3D.js} +1 -1
- package/dist/assets/{index-DvW7BRlL.js → index-CrBk11WI.js} +27459 -27459
- package/dist/assets/{index-CKDPlCKN.js → index-G6Wb7pfX.js} +2 -2
- package/dist/assets/{index-qI_nnuux.js → index-fq0DUtem.js} +1 -1
- package/dist/assets/{index-8ioAZPP6.js → index-k1-Pd2Ki.js} +1 -1
- package/dist/assets/{lexical-C6tQwGBF.js → lexical-DW4lC8Zx.js} +1 -1
- package/dist/assets/{liveblocks-DKqwsBQp.js → liveblocks-UOzcPsHa.js} +1 -1
- package/dist/assets/{lottie-BwhdO6jl.js → lottie-C5eNvt0I.js} +1 -1
- package/dist/assets/{mui-qouWiIWk.js → mui-Do6nLzGb.js} +1 -1
- package/dist/assets/{pathToGoBack-DMRqTTJ7.js → pathToGoBack-DP_bGWF-.js} +1 -1
- package/dist/assets/{pdf-DcGn_mX8.js → pdf-DjwvAC2g.js} +4 -4
- package/dist/assets/{pdf-lib-DndwkHl6.js → pdf-lib-CZXOqgb4.js} +1 -1
- package/dist/assets/{plaid-deRHM6gT.js → plaid-0g_vwjSd.js} +1 -1
- package/dist/assets/{pusher-BmM2v3Ys.js → pusher-BwlPp2s7.js} +1 -1
- package/dist/assets/{react-DZ82GBCj.js → react-Bja4MeVO.js} +1 -1
- package/dist/assets/{react-DFunsRdI.js → react-BsXfT48C.js} +1 -1
- package/dist/assets/{react-1c5WrJsc.js → react-CU01hiuh.js} +1 -1
- package/dist/assets/{react-D6U1M1pt.js → react-Dex3foBA.js} +1 -1
- package/dist/assets/{react-DiQLb4cq.js → react-DkYBVdJJ.js} +1 -1
- package/dist/assets/{react-QkGRtVkE.js → react-RZilWHYG.js} +1 -1
- package/dist/assets/{recharts-C9zWmt1W.js → recharts-uFX1dZS-.js} +1 -1
- package/dist/assets/{routePaths-GYFjoelZ.js → routePaths-CeCPwkIf.js} +1 -1
- package/dist/assets/{sentry-CxSdF_rC.js → sentry-DHDsO12F.js} +1 -1
- package/dist/assets/{stripSplatSuffix-CYVrHv_0.js → stripSplatSuffix-CQQXAy0N.js} +1 -1
- package/dist/assets/{url-Ej5v3O6d.js → url-BxiN6LKq.js} +1 -1
- package/dist/assets/{url-BSgCM0lM.js → url-CLCy7GPP.js} +1 -1
- package/dist/assets/{useActualMatchingMatchDetail-BkDnJbPg.js → useActualMatchingMatchDetail-CAkhwxRr.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D_Ro-9Tt.js → useAiCfoDashboardSuggestedQuestionsChips-CSs_vZyp.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BamKKcjy.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-1X1JYShz.js → useChargeCardPusherEvents--oeBBRmO.js} +1 -1
- package/dist/assets/{useDeviceId-RToKfM0O.js → useDeviceId-Bi38IJl0.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-dVylO6qh.js → useEmailConnectResultRefresh-C-cGd7Tb.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-BwX5Js6P.js → useInitialThreadRequest-Bwvu8W79.js} +1 -1
- package/dist/assets/useTaskManagerAccess-CdPkYUw1.js +1 -0
- package/dist/assets/{utils-D8aAQJhF.js → utils-BsODCDYR.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-CPG02lKM.js → withTransactionSidePanel-Co9xwJi4.js} +2 -2
- package/dist/assets/{zeni-epic-state-CZbm731W.js → zeni-epic-state-7eY0g-Bc.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-kiur36N3.js +0 -1
- package/dist/assets/AddressScreen-5ZLJ7_Lf.js +0 -9
- package/dist/assets/BillPayRoutes-DFm7lkFc.js +0 -119
- package/dist/assets/CardsAiCfoScreen-C-_PDYQc.js +0 -14
- package/dist/assets/CompanyPassportScreen-CEuR94fF.js +0 -1
- package/dist/assets/ConnectionAuthScreen-uvgGU2za.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-C-d3MNce.js +0 -1
- package/dist/assets/FeaturePreviewScreen-LeLfD5pA.js +0 -1
- package/dist/assets/InvoicingRoutes-CvkWcLdT.js +0 -2
- package/dist/assets/MagicLinkSignInScreen-CWvMyhrQ.js +0 -12
- package/dist/assets/MobileAppDrawer-DExJFFmi.js +0 -1
- package/dist/assets/NotFoundScreen-sryCVGSu.js +0 -1
- package/dist/assets/PerformanceRoutes-BYcI02aB.js +0 -1
- package/dist/assets/RewardsRoutes-BUOCW-CT.js +0 -1
- package/dist/assets/SignInScreen-5_sPhLr0.js +0 -1
- package/dist/assets/SignOutScreen-DrcdcbqC.js +0 -9
- package/dist/assets/TaskListScreen-OEgAVE9M.js +0 -9
- package/dist/assets/TransactionDetailRoutes-eA90CTkf.js +0 -1
- package/dist/assets/epic-CVdAQuh9.js +0 -2
- package/dist/assets/useAskAiCfoHostNavButtonProps-DV4bjx-y.js +0 -1
- package/dist/assets/useTaskManagerAccess-daSMnBbA.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as k}from"./sentry-
|
|
1
|
+
import{a as k}from"./sentry-DHDsO12F.js";import{u as Y,j as h,h as ne,g as se,i as oe,N as ie,l as re}from"./core-B5mDy9pu.js";import{fF as z,Hs as ce,YY as ue,Bw as de,S8 as pe,HG as le,KR as me,NE as fe,Oi as ye,P7 as Se,YZ as ge,Y_ as Ie,Y$ as be,Z0 as he,Z1 as Te,Vc as De,Y2 as Oe,Vr as Ce,LV as Ve,Vs as ke,LZ as we,mH as Ae,gG as Ne,gF as Fe,gE as _e,uT as ve,uK as Ee,uH as xe,mz as Be,BF as ze,BD as R,bE as P,BR as U,cE as Re}from"./zeni-epic-state-7eY0g-Bc.js";import{bS as Pe,U as Ue,N as Le,bi as je,z as B,a8 as Me,j as L,n as E,S as x,bU as Ge,ae as Ye,p as j,aG as M}from"./index-CrBk11WI.js";import{n as Ze}from"./mui-Do6nLzGb.js";import{j as V}from"./liveblocks-UOzcPsHa.js";import{d as G}from"./routePaths-CeCPwkIf.js";import{M as He}from"./MobileAppDrawer-CjKRvtSN.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]="cc3fb49f-bc67-4a02-b83d-4c2cc061af0f",t._sentryDebugIdIdentifier="sentry-dbid-cc3fb49f-bc67-4a02-b83d-4c2cc061af0f")}catch{}})();function nt(){const t=Y(),u=h((r=>z(r))),n=u?.tenantId,{isApprovalRulesV3Enabled:i,isLoading:d}=Pe(n),p=h((r=>r.billPaySetupApproverViewState.fetchState));k.useEffect((()=>{n==null||d||p==="Not-Started"&&t(ce(!0,!0,i))}),[n,d,i,p,t])}const $e=Ze.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{a as k}from"./sentry-CxSdF_rC.js";import{u as Y,j as h,h as ne,g as se,i
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
-
|
|
9
|
+
`,qe=re((function(t,u){const{businessVerificationDetails:n}=u,i=z(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:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:b,companySourceOfFunds:Z,companySourceOfFundsDescription:H,transactionVolume:$,transactionVolumeDescription:q,purposeOfAccount:K,purposeOfAccountDescription:W,regulatedStatus:J,regulatedStatusDescription:Q,usNexus:X,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?Re(y):void 0,phone:I,syncToken:S,fileIds:a,incDate:f!=null?P(f?.toString()):f,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map((v=>v.length===2?v:M(v)))??[],companySourceOfFunds:Z?.selectedOption??"",companySourceOfFundsDescription:H,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:q,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:W,regulatedStatus:J??"",regulatedStatusDescription:Q,usNexus:X,usNexusTypes:ee?.selectedOptions??[]},ae={userId:l,firstName:o.firstName,lastName:o.lastName,email:c,syncToken:D};t(U({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:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:F}=m;let b;return S.selectDocumentType==="driverLicense"?b="driving_license":S.selectDocumentType==="passport"?b="passport":S.selectDocumentType==="stateId"?b="id_document":S.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:O,userId:C,firstName:g.firstName,lastName:g.lastName,email:y,ssn:c,nationalityCountryCode:I?.selectedOption!=null?M(I.selectedOption):void 0,phone:l,birthday:o!=null?P(o?.toString()):o,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:f,documentTypeSelectedForVerification:b,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));t(U({officers:s}))},onSaveDetailsClick:e=>{t(R(n,e,i))},onSendForVerificationClick:e=>{t(R(n,e,i,!0))},onAddressClick:e=>{const s=G(T,e),m=j(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onRegisteredAddressClick:e=>{const s=G(T,e),m=j(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onBackClick:()=>{t(ze({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(Ae({addressType:e,addressToCreate:s}))},onIdentityDocumentUploadedForAutofill:e=>{if(n==null)return;const s=ke(e.documentType);s!=null&&t(we({target:"setup",companyId:n,officerType:e.officerType,fileId:e.fileId,documentType:s}))},onCompanyDocumentUploadedForAutofill:e=>{n!=null&&t(Ve({target:"setup",companyId:n,fileId:e.fileId,documentType:e.documentType}))}}}))(Ge),st=({productType:t})=>{const u=ne(),n=se(),i=Y(),[d,p]=k.useState(!1),[r,T]=k.useState(!1),{tenantEmailDomain:e}=oe(),s=Ue(),{useDynamicConfig:m}=Le(),{configValue:O}=m(je.zeniAccountsConfig),C=ue(O),g=h((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=h((a=>a.companyConfigState.fetchState)),I=h((a=>a.userRoleConfigState.fetchState)),c=h((a=>z(a))),o=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(k.useEffect((()=>{y==="Not-Started"&&i(de()),I==="Not-Started"&&i(pe(!0))}),[y,I,i]),k.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=h((a=>{switch(t){case"zeni_accounts":return Te(a,o);case"zeni_treasury":return he(a,o);case"charge_cards":return be(a,o);case"reimbursement":return Ie(a,o);default:return ge(a,o)}}));return l===!1?V.jsx(ie,{to:"../promo"}):V.jsxs($e,{children:[V.jsx(Me,{analytics:L,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)?V.jsx(He,{isAppContentDrawerOpen:r,handleDrawerToggle:D}):null,V.jsx(qe,{businessVerificationDetails:S,navigate:u,location:n,companyId:o,analytics:L,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-UOzcPsHa.js";import{a as l}from"./sentry-DHDsO12F.js";import{u as pe,h as he,g as Ce,j as M,i as fe,l as Se}from"./core-B5mDy9pu.js";import{a as ge,e8 as be,z as ye,ea as Pe,ec as N,ed as Ie,bn as W,a8 as we,j,ee as H,eo as Ee,G as ke,S as Ae,w as xe,eh as Te,ei as Ue,av as _e,el as Oe,em as ve,bk as Qe,en as Fe}from"./index-CrBk11WI.js";import{gK as je,fE as G,fF as $e,g8 as De,jh as Le,jd as Ve,fG as z,gu as qe,go as Re,gq as B,gw as Me,gx as He,gy as ze,gz as Be,gA as Ne}from"./zeni-epic-state-7eY0g-Bc.js";import{D as We,n as D,P as Ge,S as Ke}from"./mui-Do6nLzGb.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 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]="22a97be8-13f0-44f6-9e8e-9a5d8782d8f3",e._sentryDebugIdIdentifier="sentry-dbid-22a97be8-13f0-44f6-9e8e-9a5d8782d8f3")}catch{}})();const K="chat-response-generated",Y="cards/ask",J="card_policy_hero";function $(e){return`/${e}/cards`}function X(e){return`/${e}/cards/policy`}const Ye=Se((function(e,a){const o=G(e),c=a.isSubmitting,d=Ue(e,{allUsers:a.allUsers,onCardPolicyVendorSearchTextChange:a.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:a.sessionFromUrl==="new_chat"&&o.uiState.currentChatSessionId==null,aiCfoView:o,isSubmitting:c,isNewChatSession:a.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,exportDownloadEndPoint:Oe(),emailLinkQuestion:a.emailLinkQuestion,autoSubmitEmailLinkQuestion:a.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:a.onEmailLinkQuestionProcessed,isFileUploadEnabled:a.isFileUploadEnabled,isUploadPromoVisible:a.isUploadPromoVisible,onUploadPromoClose:a.onUploadPromoClose,...d}}),(function(e,a){const{location:o,currentTenant:c,userId:d,navigate:m,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:E,isAiCardCreationEnabled:x,isCardPolicyEnabled:T,cardPolicyPageContext:U}=a,i=c.tenantEmailDomain,C=o.state?.referrer,p=C===J?X(i):$(i);return{onEventReceived:(n,t)=>{if(n===K&&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:d}))}},onSubmit:(n,t,s,f)=>{n&&Qe(e,n,t,h,E,d,f,s,U)},updateCurrentInput:n=>{e(B(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{e(Me(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(p,{state:{...o.state}}),e(B(""))},togglePageView:()=>{m(p,{state:N(o.state)}),a.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{h!=null&&e(Re()),m((function(n){return`/${n}/${Y}`})(i),{state:{...o.state}})},onToggleCotCollapsed:(n,t)=>{e(qe({questionAnswerId:n,isCollapsed:t}))},...ve(e,{isAiCardCreationEnabled:x,isCardPolicyEnabled:T,currentChatSessionId:h,onAfterCardsCreationSubmit:()=>{a.setIsAiCfoOpen(!0),m($(i),{state:{...o.state}})},onAfterCardPolicySubmit:()=>{a.setIsAiCfoOpen(!0),m(`/${i}/cards/policy`,{state:{...o.state}})}})}}))(xe(Te)),{spendManagement:{chargeCard:{cardsAiCfoHero:Z,cardPolicyAiCfoHero:ee}}}=ke.getLocalizedStrings(),A=Z.pageTitle,Je=ee.pageTitle,Xe=Z.chatHeaderSubtitle,Ze=ee.chatHeaderSubtitle,gt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:a}=ge(),o=pe(),c=he(),d=Ce(),[m,h]=l.useState(!1),{allUsers:E,isAiCardCreationEnabled:x,isCardPolicyEnabled:T,onCardPolicyVendorSearchTextChange:U}=be();l.useEffect((()=>{o(je())}),[o]);const i=M((r=>G(r))),C=ye.getSignedInUser(),{session_id:p}=fe(),n=M((r=>$e(r))),t=i.uiState.currentChatSessionId,s=n.tenantEmailDomain,{handleUploadPromoClose:f,isUploadPromoVisible:b}=Pe({isFileUploadEnabled:e,tenantEmailDomain:s}),y=d.state,u=y?.aiCfoInitialQuestion??null,P=!!y?.aiCfoShouldSubmit,I=y?.referrer===J,te=I?"card_policy":void 0,se=l.useMemo((()=>({title:I?Je:A,subtitle:I?Ze:Xe})),[I]),[ae,_]=l.useState(null),[oe,O]=l.useState(!1),v=l.useRef(!1);l.useEffect((()=>{v.current||u==null||u===""||(_(u),O(P),v.current=!0)}),[u,P]);const ne=l.useCallback((()=>{_(null),O(!1),c(d.pathname,{replace:!0,state:N(d.state)})}),[d.pathname,d.state,c]),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),O(w),v.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",q=t==null||(i.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),R=i.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:re}=W(R,t),le=re.length===0;l.useEffect((()=>{t!=null&&p!==t&&c((function(r,w){return`/${r}/${Y}/${w}`})(s,t),{state:{...d.state},replace:!0})}),[t,p,s,c,d.state]),l.useEffect((()=>{p!=null&&t==null&&p!=="new_chat"&&o(De({sessionId:p,agentId:"controller"}))}),[]);const de=l.useMemo((()=>({events:L.map((r=>`private-encrypted-chat-${r}.${K}`)),eventCallback:(r,w,me)=>me.onEventReceived(r,w)})),[L]);if(l.useEffect((()=>{Q!=="In-Progress"&&F&&o(Le())}),[Q,F,o]),l.useEffect((()=>{t!=null&&V!=="In-Progress"&&q&&C!=null&&Q==="Completed"&&!F&&o(Ve(t,C.userId))}),[V,q,t,C,o]),C==null)throw Error("Can't access Cards AI CFO page without signing in...");const ce=p??"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(Ae.Event.aiCFOPage)}),S?g.jsx(Ye,{...de,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:R,allUsers:E,isAiCardCreationEnabled:x,isCardPolicyEnabled:T,openOnboardingPage:()=>h(!0),userId:C.userId,setIsAiCfoOpen:a,navigate:c,sessionFromUrl:ce,location:d,isSubmitting:ue,isEmptyChatWithSession:le,customPageTitle:A,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:A,onCloseClick:()=>{c(I?X(s):$(s),{state:{...d.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:m,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:A,onCloseClick:()=>h(!1),onCompleteClick:()=>{S||n.userRoleId==null||o(z(n.userRoleId)),h(!1)}})})})]})},et=D(Ke)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,tt=D.div`
|
|
6
|
+
flex: 1 1 auto;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
min-height: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
`,st=D(Ge)`
|
|
12
|
+
box-shadow: ${({theme:e})=>e.colors.elevation2};
|
|
13
|
+
color: ${({theme:e})=>e.colors.grey4};
|
|
14
|
+
`;export{gt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-DKqwsBQp.js";import{u as me,j as d,h as de,g as he,i as Ne,N as Je,s as _t,l as Pe,t as _n,n as cs,o as ne}from"./core-D6EV-11Y.js";import{fS as Pt,$J as is,g2 as wt,bt as Te,$K as ds,$L as ls,fH as fn,$M as Pn,fQ as wn,$N as vn,$O as Tn,$P as Fn,$Q as xn,fR as Ln,g1 as Bn,$R as Rn,$S as us,fX as ms,fW as Cs,$T as ps,JW as On,g4 as ia,$U as hs,$V as fs,fJ as gs,fI as bs,gh as ze,fZ as Un,fY as jn,$W as Ss,f_ as ys,Js as Is,Jr as ks,Jv as Es,Jx as As,ga as Ds,fE as Mn,$X as _s,$Y as Ps,gf as Nn,$Z as ws,gg as yt,JD as vs,JA as Ts,fF as fe,$_ as qa,dZ as Fe,di as xe,d_ as Le,g_ as da,cB as la,$$ as ua,a00 as vt,CR as Ga,m7 as Ka,a01 as za,Ka as ka,g5 as qe,Kc as Tt,lZ as Vn,a02 as ma,J_ as _a,a03 as Fs,a04 as xs,K1 as Ja,a05 as Ls,YV as Qa,g0 as Hn,K7 as ba,iq as Bs,a06 as $n,fT as Ca,br as Rs,a07 as Os,gG as Xa,gF as et,KG as Us,gE as at,a08 as Gn,cu as Kn,da as js,YU as wa,Lf as zn,a09 as gn,KR as Pa,a0a as Yn,Lg as Ms,Zi as Ns,Lh as Vs,Mm as Hs,C5 as $s,Mg as Gs,a0b as Ks,Kb as oa,a0c as zs,a0d as Ys,a0e as Zs,a0f as Ws,a0g as qs,a0h as Ft,a0i as Js,Kr as Zn,Kk as Qs,a0j as Xs,h0 as eo,a0k as Wn,KA as qn,KE as Jn,g$ as ao,a0l as to,L1 as Qn,a0m as no,a0n as ro,a0o as so,KC as Xn,Kn as er,K4 as ar,Kw as tr,Ku as nr,Ky as oo,a0p as rr,a0q as co,gc as io,gd as lo,ge as uo,a0r as tt,g6 as sr,dc as xt,a0s as mo,a0t as Co,a0u as po,a0v as ho,KM as It,L8 as fo,L4 as go,KI as bo,L6 as So,KY as yo,K_ as Io,a0w as or,Le as $a,S5 as ko,a0x as Eo,a0y as Ao,a0z as Do,a0A as cr,a0B as _o,LB as Po,KQ as ir,KL as Me,KP as wo,a0C as vo,a0D as To,JX as Fo,a0E as dr,f$ as lr,a0F as xo,JZ as Lo,JY as bn,a0G as Bo,a0H as Ro,a0I as Oo,Vd as Uo,a0J as Lt,a0K as jo,FY as ur,mH as Mo,ie as No,LG as Vo,a0L as mr,fN as Ho,fO as $o,a0M as Go,dO as Ko,g3 as zo,Lw as Yo,Lq as We,bq as Zo,bJ as Wo,cG as qo,bK as Jo,U4 as Qo}from"./zeni-epic-state-CZbm731W.js";import{U as Be,df as Cr,a4 as we,dg as pr,dh as hr,di as Xo,G as ea,as as Bt,dj as ec,dk as ac,a as fr,f as gr,ar as br,p as ke,N as le,d as Z,k as ya,dl as Sr,dm as tc,dn as nc,z as te,a7 as va,d4 as nt,dp as rc,dq as sc,dr as oc,a1 as Ta,bi as Qe,bE as Rt,ds as cc,ab as Fa,Z as rt,E as Ot,l as ae,w as st,dt as ic,bQ as Sa,du as kt,dv as dc,a8 as Ut,dw as lc,ae as yr,av as Et,dx as uc,aq as Ir,O as kr,T as Er,dy as mc,dz as Cc,dA as pc,dB as hc,dC as fc,dD as gc,dE as bc,I as Ya,dF as Sc,dG as yc,m as ht,c as Ic,dH as kc,dI as Ec,dJ as Ac,ai as Dc,dK as _c,dL as Pc,j as wc}from"./index-DvW7BRlL.js";import{n as Ve,D as Ar,S as vc}from"./mui-qouWiIWk.js";import{a as r}from"./sentry-CxSdF_rC.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-DV4bjx-y.js";import{M as Ee}from"./MobileAppDrawer-DExJFFmi.js";import{d as jt}from"./recharts-C9zWmt1W.js";import{g as _e,a as La,b as Dr,c as Re,d as Oe,e as Xe,f as aa,h as ta,A as Tc,i as Mt,P as Fc,j as Nt,s as Ia,k as _r,l as ca,m as Pr,n as xc,o as wr,p as Lc,S as Sn}from"./SetupPagesScreen-D0fdMGb4.js";import{u as vr}from"./useInitialThreadRequest-BwX5Js6P.js";import ot from"./NotFoundScreen-sryCVGSu.js";import{u as Vt}from"./useChargeCardPusherEvents-1X1JYShz.js";import{n as yn}from"./utils-D8aAQJhF.js";import{t as Bc}from"./AddressScreen-5ZLJ7_Lf.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./InboxNotificationsProvider-gj6fT2eX.js";import"./useTaskManagerAccess-daSMnBbA.js";import"./BusinessVerificationPageScreen-BL6H7JF-.js";import"./routePaths-GYFjoelZ.js";import"./analyticsHelper-DcvdGte-.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]="89989add-4603-4796-92d8-3fb835681f3e",e._sentryDebugIdIdentifier="sentry-dbid-89989add-4603-4796-92d8-3fb835681f3e")}catch{}})();const Rc=e=>{const a=e.cardHolderUser,n=`${a.firstName??""} ${a.lastName??""}`.trim()||a.email||a.userId;return{userId:a.userId,displayName:n,roleLabel:e.cardHolderRoles?.titleAtCompany}},Tr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:Rc(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function Fr(){const e=me(),a=d((t=>Pt(t.cardPolicyState))),n=d((t=>is(t.cardPolicyState)));r.useEffect((()=>{n!==""||a==="Completed"&&n===""||a==="In-Progress"||e(wt())}),[e,a,n])}const{spendManagement:{chargeCard:{cardPolicyPage:In}}}=ea.getLocalizedStrings(),Oc=e=>Un(e,!1),Uc=e=>jn(e.name,!1);function jc(){const e=de(),a=he(),{tenantEmailDomain:n}=Ne(),t=me(),s=Be(),g=Te(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((O=>{h(O)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:F}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect((()=>()=>{t(ds()),t(ls()),t(fn())}),[t]);const w=d((O=>Pn(O.cardPolicyState))),p=d((O=>wn(O.cardPolicyState))),T=d((O=>vn(O.cardPolicyState))),B=d((O=>Tn(O.cardPolicyState))),S=d((O=>Fn(O.cardPolicyState))),l=d((O=>xn(O.cardPolicyState))),C=d((O=>Ln(O.cardPolicyState))),L=d((O=>Pt(O.cardPolicyState))),k=d((O=>O.chargeCardConfigState.receiptRequiredAboveAmount.amount)),_=d((O=>O.chargeCardConfigState.fetchState));r.useEffect((()=>{w!=="Completed"&&w!=="In-Progress"&&t(Bn())}),[t,w]),Fr();const D=d((O=>Rn(O.createCardPolicyState))),M=d((O=>us(O.createCardPolicyState))),E=d((O=>ms(O.cardPolicyState))),y=d((O=>Cs(O.cardPolicyState))),R=d((O=>ps(O.createCardPolicyState))),i=d((O=>On(O)));r.useEffect((()=>{i.fetchState==="Not-Started"&&t(ia(!1,!1,!1))}),[i.fetchState,t]);const f=r.useMemo((()=>p.map(Oc)),[p]),j=r.useMemo((()=>C.map(Uc)),[C]),G=r.useMemo((()=>i.cards.filter((O=>!Cr(O.status.code))).map(Tr)),[i.cards]),U=w==="Completed"&&i.fetchState==="Completed"&&_==="Completed";r.useEffect((()=>{U&&R==null&&t(hs({cardsMasterList:G,defaultRequireReceiptAmount:k,suggestedAllowMerchants:T,suggestedBlockMerchants:B,suggestedAllowCategories:S,suggestedBlockCategories:l}))}),[_,t,U,R,G,k,T,B,S,l]);const x=r.useMemo((()=>jt((O=>{t(wt(O))}),250)),[t]);r.useEffect((()=>()=>{x.cancel()}),[x]);const z=r.useCallback((O=>{x(O)}),[x]),H=D.fetchState,v=n!=null?`/${n}/cards/policy`:"..",P=r.useCallback((()=>{const O=we(a.state?.pathnameStackToGoBack),q=O.poppedPathname??v;e(q,{state:{pathnameStackToGoBack:O.newStack}})}),[a.state,e,v]),K=r.useCallback((()=>{e(v)}),[e,v]),W=r.useCallback((O=>{t(fs(O))}),[t]),I=r.useCallback((O=>{const q=pr(O);t(gs({templates:[q]}))}),[t]),N=r.useCallback((O=>{O.length!==0&&t(bs(O))}),[t]),V=r.useCallback((()=>{t(fn())}),[t]),Q=r.useRef(H);r.useEffect((()=>{const O=Q.current;Q.current=H,H==="Completed"&&O!=="Completed"&&M!=null&&(t(ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(v))}),[t,H,M,e,v]);const c=H==="Error"?D.error?.message??In.createPolicyGenericErrorMessage:void 0;return g&&n!=null?R==null?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(hr,{showUploadDocumentSection:!0,navBarTitle:In.createPageTitle,onBackClick:P,onClickMenuIcon:u,isAiCfoAccessEnabled:m,onAskAiCfoClick:F})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(Xo,{formDraft:R,vendorSearchOptions:j,categorySearchOptions:f,isVendorSearchLoading:L==="In-Progress",onVendorSearchTextChange:z,submitState:H,submitErrorMessage:c,documentUploadState:E,uploadedFileName:y,isAiCfoAccessEnabled:m,onAskAiCfoClick:F,onBackClick:P,onCancelClick:K,onClickMenuIcon:u,onFormChange:W,onSubmit:I,onUploadDocument:N,onRemoveDocument:V})]}):o.jsx(Je,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:Mc}}}=ea.getLocalizedStrings(),Nc=e=>Un(e,!1),Vc=e=>jn(e.name,!1);function Hc(){const e=de(),a=he(),{tenantEmailDomain:n,templateId:t}=Ne(),s=me(),g=Be(),b=Te(g?.loggedInUserRoleMap),[h,A]=r.useState(!1),u=r.useCallback((c=>{A(c)}),[]),m=r.useCallback((()=>{u(!0)}),[u]),{isAiCfoAccessEnabled:F,onAskAiCfoClick:w}=xa({mobileExploreReferrer:"Card Policy"}),p=d((c=>Ss(c))),T=d((c=>Pn(c.cardPolicyState))),B=d((c=>wn(c.cardPolicyState))),S=d((c=>vn(c.cardPolicyState))),l=d((c=>Tn(c.cardPolicyState))),C=d((c=>Fn(c.cardPolicyState))),L=d((c=>xn(c.cardPolicyState))),k=d((c=>Ln(c.cardPolicyState))),_=d((c=>Pt(c.cardPolicyState))),D=d((c=>On(c))),M=d((c=>t!=null?ys(c.cardPolicyState,t):void 0)),E=r.useMemo((()=>p.templateId===t&&p.formDraft!=null?p.formDraft:M!=null?Is(M):void 0),[p.templateId,p.formDraft,M,t]);r.useEffect((()=>{if(t==null)return;const c=p.detailFetchState.fetchState;p.templateId===t&&(c==="Completed"||c==="In-Progress")||M!=null||s(ks(t))}),[s,t,p.templateId,p.detailFetchState.fetchState,M]),r.useEffect((()=>{T!=="Completed"&&T!=="In-Progress"&&s(Bn())}),[s,T]),Fr();const y=d((c=>c.chargeCardConfigState.receiptRequiredAboveAmount.amount));r.useEffect((()=>{D.fetchState==="Not-Started"&&s(ia(!1,!1,!1))}),[D.fetchState,s]);const R=r.useMemo((()=>B.map(Nc)),[B]),i=r.useMemo((()=>k.map(Vc)),[k]),f=r.useMemo((()=>D.cards.filter((c=>!Cr(c.status.code))).map(Tr)),[D.cards]);Bt({isDataReady:E!=null});const j=r.useMemo((()=>{if(E!=null)return ec({draft:E,cardRows:f,categorySearchOptions:R,vendorSearchOptions:i,defaultRequireReceiptAmount:y,suggestedAllowMerchants:S,suggestedBlockMerchants:l,suggestedAllowCategories:C,suggestedBlockCategories:L})}),[E,f,R,i,y,S,l,C,L]),[G,U]=r.useState(void 0),x=r.useRef(!1);r.useEffect((()=>{x.current||G!=null||j==null||(x.current=!0,U(j))}),[G,j]);const z=r.useCallback((c=>{U(c)}),[]),H=r.useMemo((()=>jt((c=>{s(wt(c))}),250)),[s]);r.useEffect((()=>()=>{H.cancel()}),[H]);const v=r.useCallback((c=>{H(c)}),[H]),P=p.updateFetchState.fetchState,K=n!=null?`/${n}/cards/policy`:"..",W=r.useCallback((()=>{const c=we(a.state?.pathnameStackToGoBack),O=c.poppedPathname??K;e(O,{state:{pathnameStackToGoBack:c.newStack}})}),[a.state,e,K]),I=r.useCallback((()=>{e(K)}),[e,K]),N=r.useCallback((c=>{if(t==null)return;const O=pr(c);s(Es(O)),s(As(t))}),[s,t]),V=r.useRef(P);r.useEffect((()=>{const c=V.current;V.current=P,P==="Completed"&&c!=="Completed"&&(s(ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(K))}),[s,P,e,K]);const Q=P==="Error"?p.updateFetchState.error?.message??Mc.updatePolicyGenericErrorMessage:void 0;return!b||n==null||t==null?o.jsx(Je,{to:"..",replace:!0}):G!=null&&T==="Completed"&&D.fetchState==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(ac,{templateName:p.template?.name??"",formDraft:G,vendorSearchOptions:i,categorySearchOptions:R,isVendorSearchLoading:_==="In-Progress",onVendorSearchTextChange:v,submitState:P,submitErrorMessage:Q,isAiCfoAccessEnabled:F,onAskAiCfoClick:w,onBackClick:W,onCancelClick:I,onClickMenuIcon:m,onFormChange:z,onSubmit:N})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(hr,{showUploadDocumentSection:!1,navBarTitle:p.template?.name,onBackClick:W,onClickMenuIcon:m,isAiCfoAccessEnabled:F,onAskAiCfoClick:w})]})}function xr(e,a,n){return a?e.filter((t=>t!=null&&t.trim().length>0)).slice(0,n):[]}function Lr(e){return d((a=>e==null||e===""?{chips:ft,isResolved:!1}:(function(n){const t=n?.fetchState,s=t==="Completed"||t==="Error";return{chips:t==="Completed"?n?.suggestedQuestions??ft:ft,isResolved:s}})(Ds(a,e))),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:$c,subheadline:Gc,pageTitle:Kc}}}}=ea.getLocalizedStrings(),zc=e=>{const a=e.cardsCount>0?e.cardsCount:e.appliedCards.length,n=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,t=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:a,vendorRestrictionsCount:n,categoryRestrictionsCount:t}};function Yc(){const e=de(),a=he(),{tenantEmailDomain:n}=Ne(),t=me(),s=Be(),g=Te(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((v=>{h(v)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{useFeatureGate:m}=le(),{isFeatureEnabled:F}=m(Z.isAiCfoFileUploadEnabled),{isFeatureEnabled:w}=m(Z.isCardPolicyEnabled),{isAiCfoAccessEnabled:p,onAskAiCfoClick:T}=xa({mobileExploreReferrer:"Card Policy"}),B=d((v=>_s(v))),S=d((v=>Rn(v.createCardPolicyState))),l=d((v=>Ps(v.createCardPolicyState))),C=d((v=>l==null?[]:Nn(v.aiCfoState,l).filter((P=>P.kind==="creating_policy"))),_t),L=S.fetchState==="In-Progress"?Math.max(C.length,1):0,k=d((v=>ws(v.createCardPolicyState))),_=ya(S.fetchState);r.useEffect((()=>{if(_==="In-Progress"&&S.fetchState==="Completed"&&l!=null)C.forEach((v=>{t(yt({chatSessionId:l,id:v.id,entityIds:k,kind:"created_policy"}))}));else if(_==="In-Progress"&&S.fetchState==="Error"&&l!=null){C.forEach((P=>{t(yt({chatSessionId:l,id:P.id,kind:"errored_policy"}))}));const v=S.error?.message!=null&&S.error.message.length>0?S.error.message:ea.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;t(ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:v}]}))}}),[S.error?.message,S.fetchState,t,l,k,C,_]);const D=B.fetchState.fetchState;r.useEffect((()=>{D!=="Not-Started"&&D!=="Error"||t(vs())}),[t,D]);const M=B.archiveFetchState.fetchState,E=ya(M);r.useEffect((()=>{E==="In-Progress"&&M==="Completed"&&t(ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))}),[M,t,E]);const y=r.useMemo((()=>B.templates.map(zc)),[B.templates]);Bt({isDataReady:B.fetchState.fetchState==="Completed"});const R=y.length>0||L>0,i=(function(v){const{hasAnyPolicies:P,isChargeCardAdmin:K,isFileUploadEnabled:W}=v,I=de(),N=he(),{tenantEmailDomain:V}=Ne(),{isAiCfoOpen:Q,setIsAiCfoOpen:c}=fr(),O=gr(),q=br(),se=d((J=>Mn(J))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:X,isResolved:He}=Lr("card_policy"),Ae=r.useMemo((()=>xr(X,He,3)),[X,He]),[ge,re]=r.useState(""),be=q&&O&&V!=null&&!Q,ue=r.useCallback((J=>{if(V==null)return;const fa=ke(N.state?.pathnameStackToGoBack,N.pathname);I(`/${V}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:J,aiCfoShouldSubmit:J!=null&&J.trim().length>0}})}),[N.pathname,N.state,I,V]),oe=r.useCallback((J=>{J.trim().length!==0&&(re(""),ue(J))}),[ue]),Se=r.useCallback((()=>{const J=ge.trim();J.length!==0&&(re(""),ue(J))}),[ge,ue]),ee=r.useCallback((()=>{}),[]),De=r.useCallback((J=>{re(J)}),[]),ve=r.useCallback((()=>{c(!0)}),[c]),Ce=r.useCallback((()=>{ue(void 0)}),[ue]);return r.useMemo((()=>{if(be&&!P&&K)return{aiAgentName:Kc,headline:$c,subheadline:Gc,promptChips:Ae,composer:{currentInput:ge,isSubmitting:se,isFileUploadEnabled:W,onInputChange:De,onSubmit:Se,onStopSubmit:ee},onPromptClick:oe,onOpenSidePanel:ve,onOpenFullView:Ce,dataTestIdPrefix:"card-policy-ai-cfo-hero"}}),[ge,P,be,K,W,se,De,Ce,ve,oe,ee,Se,Ae])})({hasAnyPolicies:R,isChargeCardAdmin:g,isFileUploadEnabled:F}),f=w&&i!=null?o.jsx(Sr,{...i}):null,j=p&&f==null,G=r.useCallback((()=>{const v=we(a.state?.pathnameStackToGoBack),P=v.poppedPathname??"..";e(P,{state:{pathnameStackToGoBack:v.newStack}})}),[a.state,e]),U=r.useCallback((()=>{n!=null&&e(`/${n}/cards/policy/new`)}),[e,n]),x=r.useCallback((v=>{n!=null&&e(`/${n}/cards/policy/${v}/edit`)}),[e,n]),z=r.useCallback((v=>{t(Ts(v))}),[t]),H=B.fetchState.fetchState;return!R&&H!=="Completed"&&H!=="Error"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(tc,{onBackClick:G,onNewPolicyClick:U,onClickMenuIcon:u,isAiCfoAccessEnabled:p,onAskAiCfoClick:T})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(nc,{policies:y,archivingTemplateId:B.archiveTargetTemplateId,pendingCreationCount:L,onBackClick:G,onNewPolicyClick:U,onEditPolicyClick:x,onArchivePolicyClick:z,onClickMenuIcon:u,policyAiCfoHero:f,isAiCfoAccessEnabled:j,onAskAiCfoClick:T})]})}function Zc(){const e=de(),{cardId:a}=Ne(),n=me(),t=te.getSignedInUser(),s=d((X=>fe(X))),g=Be(),b=Te(g?.loggedInUserRoleMap),{useFeatureGate:h}=le();if(t==null)throw Error("Can't access Add To Wallet Page without signing in...");const[A,u]=r.useState(!1),m=d((X=>qa(X).firstViewAfterActivation));if(a==null)throw Error("Empty card id is not valid...");const F=s.userRole.includes("charge_card_user"),{isFeatureEnabled:w}=h(Z.isChargeCardFeatureEnabled),p=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:T}=h(Z.isDebitCardFeatureEnabled),B=Fe(s),S=xe(s),l=Le(T,s),C=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Re({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:l}),k=Oe({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:w,isBookKeepingTenant:S,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:C}),_=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,D=d((X=>da(X,s.companyId))),M=la(D.controllers),{creditAccount:E,creditAccountRepayment:y}=d((X=>ua(X))),R=d((X=>X.classListState.fetchState)),i=!F&&k&&p,f=d((X=>vt(X,a,i,k))),[j,G]=r.useState(!1),U=f.chargeCard,x=U?.cardCreatedByUser?.userId,z=d((X=>x!=null?Ga(X.userRoleState,x):void 0)),H=z?.accountingClassIDs[0],v=d((X=>H!=null?Ka(X.classState,{classId:H,reportId:"class_list"}):void 0)),P=U?.cardHolderUser?.userId,K=d((X=>P!=null?Ga(X.userRoleState,P):void 0)),W=K?.accountingClassIDs[0],I=d((X=>W!=null?Ka(X.classState,{classId:W,reportId:"class_list"}):void 0)),N=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",V=U?.type.code==="business_physical_debit_card";r.useEffect((()=>{m&&A===!1&&N&&(u(!0),setTimeout((()=>{n(za()),V&&n(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[m,A,N,V]),r.useEffect((()=>{j||f.fetchState==="Completed"||f.fetchState==="In-Progress"||a==null||(G(!0),n(ka(a,i,!1)))}),[j,f,a,n]),r.useEffect((()=>{if(f.fetchState==="Completed"&&(N===!1||N&&U?.status?.code!=="active"||U?.cardHolderUserId!==t.userId||m===!1&&A===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=_e(s.tenantEmailDomain,a,t,U,m);e(X)}}),[f.fetchState,m,N]),r.useEffect((()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&k&&p&&b&&n(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&k&&p&&b&&n(Tt()),R!=="Completed"&&R!=="In-Progress"&&n(Vn())}),[E.fetchState,y.fetchState,n,k,p,b,R]);const Q=()=>{if(t!=null&&a!=null){n(za());const X=_e(s.tenantEmailDomain,a,t);e(X)}},c=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",O=Xe(k,L,_,p),q=La(k,p,b,E,y),se=Dr(c,f);return f.fetchState!=="Completed"?o.jsx(va,{fetchState:"In-Progress"}):o.jsxs(o.Fragment,{children:[o.jsx(nt,{showConfetti:m}),o.jsx(rc,{onGotItClick:Q,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:M,isChargeCardFeatureEnabled:k,isDebitCardFeatureEnabled:L,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:p,productInformation:O,creditAccountInformation:q,debitAccountInformation:se,chargeCardDetailView:f,creditAccount:E,classListFetchState:R,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:v?.className,cardHolderRoles:K?.userRoles,cardHolderDepartmentName:I?.className})]})}const Br="charge-card-transaction-update",Rr="charge-card-transaction-created",Or="charge-card-transaction-declined",Ur="charge-card-transaction-updated",jr="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Ht="charge-card-spending-updated",ct="credit-account-balance-updated",it="charge-card-created",$t="charge-card-limit-updated",Gt="charge-card-limit-reset",Kt="charge-card-renamed",Wc="charge-card-department-updated",Mr="charge-card-repayment-completed",Nr="charge-card-payment-date-updated",Ba="charge-card-cashback-redeemed",Ra="charge-card-cashback-earned",ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),qc=[Ra,Ba],Jc=Pe((function(e){const a=ma(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}}),(function(e){return{onColumnSortConfigChanged:(a,n)=>{e(Fs({uiState:{sortKey:a,sortOrder:n}}))}}}))(oc);function Qc(){const e=de(),a=me(),n=he(),t=te.getSignedInUser(),s=d((T=>fe(T))),{useFeatureGate:g}=le(),{isFeatureEnabled:b}=g(Z.isCardsCommentingEnabled),[h,A]=r.useState(!1),u=d((T=>ma(T))),m=vr(s.companyId,{clearParams:u.fetchState==="Completed"}),F=r.useCallback((()=>{const T=we(n.state?.pathnameStackToGoBack),B=T.poppedPathname??Xc(s.tenantEmailDomain);e(B,{state:{pathnameStackToGoBack:T.newStack}})}),[e,n,s.tenantEmailDomain]),w=aa(s);if(Vt({events:ha(w,qc),onEvent:T=>{switch(T){case Ra:case Ba:return void a(_a(!0))}},onSubscribed:()=>{a(_a(!0))}}),r.useEffect((()=>{h||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(A(!0),a(_a()))}),[h,u,a]),t==null)throw Error("Can't access cashback detail page without signing in...");const p=u.cashbackSummary?.cashbackEarned?.amount!=null&&u.fetchState!=="Not-Started";return u.fetchState!=="In-Progress"||p?(u.cashbackSummary?.cashbackEarned?.amount??0)===0&&u.fetchState==="Completed"?o.jsx(ot,{}):o.jsx(Jc,{onBackClick:F,isCardsCommentingEnabled:b,initialOpenThreadRequest:m}):o.jsx(sc,{onBackClick:F})}const Xc=e=>`/${e}/cards`,ei={containerWidth:new Fa(100,58)},ai=({appContent:e})=>{const a=Ta(),n=me(),t=de(),{cardId:s}=Ne(),g=he(),{useDynamicConfig:b}=le(),[h,A]=r.useState(!1),[u,m]=r.useState(!1),[F,w]=r.useState(!1),[p,T]=r.useState(!1),B=te.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const S=d((I=>fe(I)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:l}=b(Qe.zeniCardsConfig),C=l.max_charge_card_activation_attempts_by_card_id,L=d((I=>xs(I,s))),k=L.chargeCard,_=d((I=>I.chargeCardConfigState.fetchState)),{useFeatureGate:D}=le(),{isFeatureEnabled:M}=D(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=D(Z.isDebitCardFeatureEnabled),y=Le(E,S),R=Re({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:y}),i=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,f=S.userRole.includes("charge_card_user"),j=Fe(S),G=xe(S),U=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=Oe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:M,isBookKeepingTenant:G,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:U}),z=!f&&x&&i;r.useEffect((()=>{h===!1&&_!=="In-Progress"&&_!=="Completed"&&(n(Ja()),A(!0)),u===!1&&L.fetchState==="Not-Started"&&(m(!0),n(ka(s,z,x)))}),[u,L.fetchState,h,_]);const H=k?.type.code==="business_physical_credit_card"||k?.type.code==="business_physical_debit_card";r.useEffect((()=>{if(L.fetchState==="Completed"){if(F===!1&&(H===!1||H&&k?.status?.code!=="inactive"||k?.cardHolderUserId!==B.userId)){const I=_e(S.tenantEmailDomain,s,B,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);t(I,{state:{pathnameStackToGoBack:N}})}else if(F&&L.isRefreshingViewInBackground===!1&&k?.status?.code==="active"){n(Ls({chargeCardId:s}));const I=_e(S.tenantEmailDomain,s,B,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(I,{state:{pathnameStackToGoBack:N}})}}}),[L.fetchState,k?.type.code,F,L.isRefreshingViewInBackground]);const v=te.getZeniOtpTokenForCardHolder(s),P=d((I=>Hn(I.userState,B.userId))),K=()=>{k?.status?.code!=="active"&&n(ba(s,!0))};r.useEffect((()=>{L.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&k?.cardActivationAttemptHistory.some((I=>I.statusCode==="success"))===!0&&F===!1&&(setTimeout(K,3e3),w(!0))}),[L.updatePhysicalChargeCardAttemptFetchState.fetchState,k?.cardActivationAttemptHistory]);const W=I=>{T(I)};if(_!=="Completed"||k==null)return o.jsx(va,{fetchState:"In-Progress"});if(k.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return o.jsxs(ri,{children:[o.jsx(Ee,{isAppContentDrawerOpen:p,handleDrawerToggle:W}),o.jsx(ti,{cardId:s,card:k,shippingAddressId:k.shippingAddressId,phone:P.phone,signedInUser:B,isSandboxEnv:Rt(),chargeCardDetailState:L,signedInUserToken:v,navigate:t,currentTenant:S,location:g,maxChargeCardActivationAttempts:C[s]!=null?C[s]:l.default_max_charge_card_activation_attempts!=null?l.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:l.charge_card_cashback_rate_per_transaction!=null?l.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?o.jsx(ni,{windowSize:a,children:e}):null]})},ti=Pe((function(e,{chargeCardDetailState:a,shippingAddressId:n,location:t,cardId:s}){const g=Bs(e.addressState,n);if(g==null)throw Error("Can't access shippingAddress.");const b=$n(e,s),h=a.updateStatus,A=Ca(e,!1,!1,!1);let u=!1;A.fetchState==="Completed"&&A.cards.length<=1&&(u=!0);const m=t.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Rs())||m,showMenuIcon:u,shippingAddress:g,vgsVaultId:rt.cardVaultId,twoFAView:b,activationWaitStatus:h,isRefreshingViewInBackground:a.isRefreshingViewInBackground}}),(function(e,a){const{navigate:n,cardId:t,location:s,currentTenant:g,chargeCardDetailState:b}=a,h=b.chargeCard?.cardProviderID,{tenantEmailDomain:A}=g;return{onGetOtp:u=>{h!=null&&e(at(u,"ChargeCardHolder",t))},onUpdatePhysicalChargeCardAttempt:u=>{e(Us(t,u))},onResendOtp:u=>{h!=null&&e(et(u,"ChargeCardHolder",t))},onVerifyOtp:(u,m)=>{h!=null&&e(Xa(u,m,"ChargeCardHolder",t))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,t)},onCVVActivateSuccess:()=>{e(Os({chargeCardId:t}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),m=u.poppedPathname==null||u.poppedPathname.includes("onboard")===!0?ta(A):u.poppedPathname;n(m,{state:{pathnameStackToGoBack:u.newStack}})}}}))(cc),ni=Ve.div`
|
|
1
|
+
import{j as o}from"./liveblocks-UOzcPsHa.js";import{u as me,j as d,h as de,g as he,i as Ne,N as Je,s as _t,l as Pe,t as _n,n as cs,o as ne}from"./core-B5mDy9pu.js";import{fS as Pt,$J as is,g2 as wt,bt as Te,$K as ds,$L as ls,fH as fn,$M as Pn,fQ as wn,$N as vn,$O as Tn,$P as Fn,$Q as xn,fR as Ln,g1 as Bn,$R as Rn,$S as us,fX as ms,fW as Cs,$T as ps,JW as On,g4 as ia,$U as hs,$V as fs,fJ as gs,fI as bs,gh as ze,fZ as Un,fY as jn,$W as Ss,f_ as ys,Js as Is,Jr as ks,Jv as Es,Jx as As,ga as Ds,fE as Mn,$X as _s,$Y as Ps,gf as Nn,$Z as ws,gg as yt,JD as vs,JA as Ts,fF as fe,$_ as qa,dZ as Fe,di as xe,d_ as Le,g_ as da,cB as la,$$ as ua,a00 as vt,CR as Ga,m7 as Ka,a01 as za,Ka as ka,g5 as qe,Kc as Tt,lZ as Vn,a02 as ma,J_ as _a,a03 as Fs,a04 as xs,K1 as Ja,a05 as Ls,YV as Qa,g0 as Hn,K7 as ba,iq as Bs,a06 as $n,fT as Ca,br as Rs,a07 as Os,gG as Xa,gF as et,KG as Us,gE as at,a08 as Gn,cu as Kn,da as js,YU as wa,Lf as zn,a09 as gn,KR as Pa,a0a as Yn,Lg as Ms,Zi as Ns,Lh as Vs,Mm as Hs,C5 as $s,Mg as Gs,a0b as Ks,Kb as oa,a0c as zs,a0d as Ys,a0e as Zs,a0f as Ws,a0g as qs,a0h as Ft,a0i as Js,Kr as Zn,Kk as Qs,a0j as Xs,h0 as eo,a0k as Wn,KA as qn,KE as Jn,g$ as ao,a0l as to,L1 as Qn,a0m as no,a0n as ro,a0o as so,KC as Xn,Kn as er,K4 as ar,Kw as tr,Ku as nr,Ky as oo,a0p as rr,a0q as co,gc as io,gd as lo,ge as uo,a0r as tt,g6 as sr,dc as xt,a0s as mo,a0t as Co,a0u as po,a0v as ho,KM as It,L8 as fo,L4 as go,KI as bo,L6 as So,KY as yo,K_ as Io,a0w as or,Le as $a,S5 as ko,a0x as Eo,a0y as Ao,a0z as Do,a0A as cr,a0B as _o,LB as Po,KQ as ir,KL as Me,KP as wo,a0C as vo,a0D as To,JX as Fo,a0E as dr,f$ as lr,a0F as xo,JZ as Lo,JY as bn,a0G as Bo,a0H as Ro,a0I as Oo,Vd as Uo,a0J as Lt,a0K as jo,FY as ur,mH as Mo,ie as No,LG as Vo,a0L as mr,fN as Ho,fO as $o,a0M as Go,dO as Ko,g3 as zo,Lw as Yo,Lq as We,bq as Zo,bJ as Wo,cG as qo,bK as Jo,U4 as Qo}from"./zeni-epic-state-7eY0g-Bc.js";import{U as Be,df as Cr,a4 as we,dg as pr,dh as hr,di as Xo,G as ea,as as Bt,dj as ec,dk as ac,a as fr,e as gr,ar as br,p as ke,N as le,c as Z,h as ya,dl as Sr,dm as tc,dn as nc,z as te,a7 as va,d4 as nt,dp as rc,dq as sc,dr as oc,a1 as Ta,bi as Qe,bE as Rt,ds as cc,ab as Fa,Z as rt,E as Ot,j as ae,w as st,dt as ic,bQ as Sa,du as kt,dv as dc,a8 as Ut,dw as lc,ae as yr,av as Et,dx as uc,aq as Ir,J as kr,S as Er,dy as mc,dz as Cc,dA as pc,dB as hc,dC as fc,dD as gc,dE as bc,H as Ya,dF as Sc,dG as yc,m as ht,M as Ic,dH as kc,dI as Ec,dJ as Ac,ai as Dc,dK as _c,dL as Pc,g as wc}from"./index-CrBk11WI.js";import{n as Ve,D as Ar,S as vc}from"./mui-Do6nLzGb.js";import{a as r}from"./sentry-DHDsO12F.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-BamKKcjy.js";import{M as Ee}from"./MobileAppDrawer-CjKRvtSN.js";import{d as jt}from"./recharts-uFX1dZS-.js";import{g as _e,a as La,b as Dr,c as Re,d as Oe,e as Xe,f as aa,h as ta,A as Tc,i as Mt,P as Fc,j as Nt,s as Ia,k as _r,l as ca,m as Pr,n as xc,o as wr,p as Lc,S as Sn}from"./SetupPagesScreen-DL_o3Z3i.js";import{u as vr}from"./useInitialThreadRequest-Bwvu8W79.js";import ot from"./NotFoundScreen-MJal1hew.js";import{u as Vt}from"./useChargeCardPusherEvents--oeBBRmO.js";import{n as yn}from"./utils-BsODCDYR.js";import{t as Bc}from"./AddressScreen-DhOzuvLT.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"./InboxNotificationsProvider-BmF5-_KA.js";import"./useTaskManagerAccess-CdPkYUw1.js";import"./BusinessVerificationPageScreen-CPnmoF6z.js";import"./routePaths-CeCPwkIf.js";import"./analyticsHelper-H1Xp9Uyk.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]="f61df82b-0f1e-4708-a008-89321c65e70d",e._sentryDebugIdIdentifier="sentry-dbid-f61df82b-0f1e-4708-a008-89321c65e70d")}catch{}})();const Rc=e=>{const a=e.cardHolderUser,n=`${a.firstName??""} ${a.lastName??""}`.trim()||a.email||a.userId;return{userId:a.userId,displayName:n,roleLabel:e.cardHolderRoles?.titleAtCompany}},Tr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:Rc(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function Fr(){const e=me(),a=d((t=>Pt(t.cardPolicyState))),n=d((t=>is(t.cardPolicyState)));r.useEffect((()=>{n!==""||a==="Completed"&&n===""||a==="In-Progress"||e(wt())}),[e,a,n])}const{spendManagement:{chargeCard:{cardPolicyPage:In}}}=ea.getLocalizedStrings(),Oc=e=>Un(e,!1),Uc=e=>jn(e.name,!1);function jc(){const e=de(),a=he(),{tenantEmailDomain:n}=Ne(),t=me(),s=Be(),g=Te(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((O=>{h(O)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:F}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect((()=>()=>{t(ds()),t(ls()),t(fn())}),[t]);const w=d((O=>Pn(O.cardPolicyState))),p=d((O=>wn(O.cardPolicyState))),T=d((O=>vn(O.cardPolicyState))),B=d((O=>Tn(O.cardPolicyState))),S=d((O=>Fn(O.cardPolicyState))),l=d((O=>xn(O.cardPolicyState))),C=d((O=>Ln(O.cardPolicyState))),L=d((O=>Pt(O.cardPolicyState))),k=d((O=>O.chargeCardConfigState.receiptRequiredAboveAmount.amount)),_=d((O=>O.chargeCardConfigState.fetchState));r.useEffect((()=>{w!=="Completed"&&w!=="In-Progress"&&t(Bn())}),[t,w]),Fr();const D=d((O=>Rn(O.createCardPolicyState))),M=d((O=>us(O.createCardPolicyState))),E=d((O=>ms(O.cardPolicyState))),y=d((O=>Cs(O.cardPolicyState))),R=d((O=>ps(O.createCardPolicyState))),i=d((O=>On(O)));r.useEffect((()=>{i.fetchState==="Not-Started"&&t(ia(!1,!1,!1))}),[i.fetchState,t]);const f=r.useMemo((()=>p.map(Oc)),[p]),j=r.useMemo((()=>C.map(Uc)),[C]),G=r.useMemo((()=>i.cards.filter((O=>!Cr(O.status.code))).map(Tr)),[i.cards]),U=w==="Completed"&&i.fetchState==="Completed"&&_==="Completed";r.useEffect((()=>{U&&R==null&&t(hs({cardsMasterList:G,defaultRequireReceiptAmount:k,suggestedAllowMerchants:T,suggestedBlockMerchants:B,suggestedAllowCategories:S,suggestedBlockCategories:l}))}),[_,t,U,R,G,k,T,B,S,l]);const x=r.useMemo((()=>jt((O=>{t(wt(O))}),250)),[t]);r.useEffect((()=>()=>{x.cancel()}),[x]);const z=r.useCallback((O=>{x(O)}),[x]),H=D.fetchState,v=n!=null?`/${n}/cards/policy`:"..",P=r.useCallback((()=>{const O=we(a.state?.pathnameStackToGoBack),q=O.poppedPathname??v;e(q,{state:{pathnameStackToGoBack:O.newStack}})}),[a.state,e,v]),K=r.useCallback((()=>{e(v)}),[e,v]),W=r.useCallback((O=>{t(fs(O))}),[t]),I=r.useCallback((O=>{const q=pr(O);t(gs({templates:[q]}))}),[t]),N=r.useCallback((O=>{O.length!==0&&t(bs(O))}),[t]),V=r.useCallback((()=>{t(fn())}),[t]),Q=r.useRef(H);r.useEffect((()=>{const O=Q.current;Q.current=H,H==="Completed"&&O!=="Completed"&&M!=null&&(t(ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(v))}),[t,H,M,e,v]);const c=H==="Error"?D.error?.message??In.createPolicyGenericErrorMessage:void 0;return g&&n!=null?R==null?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(hr,{showUploadDocumentSection:!0,navBarTitle:In.createPageTitle,onBackClick:P,onClickMenuIcon:u,isAiCfoAccessEnabled:m,onAskAiCfoClick:F})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(Xo,{formDraft:R,vendorSearchOptions:j,categorySearchOptions:f,isVendorSearchLoading:L==="In-Progress",onVendorSearchTextChange:z,submitState:H,submitErrorMessage:c,documentUploadState:E,uploadedFileName:y,isAiCfoAccessEnabled:m,onAskAiCfoClick:F,onBackClick:P,onCancelClick:K,onClickMenuIcon:u,onFormChange:W,onSubmit:I,onUploadDocument:N,onRemoveDocument:V})]}):o.jsx(Je,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:Mc}}}=ea.getLocalizedStrings(),Nc=e=>Un(e,!1),Vc=e=>jn(e.name,!1);function Hc(){const e=de(),a=he(),{tenantEmailDomain:n,templateId:t}=Ne(),s=me(),g=Be(),b=Te(g?.loggedInUserRoleMap),[h,A]=r.useState(!1),u=r.useCallback((c=>{A(c)}),[]),m=r.useCallback((()=>{u(!0)}),[u]),{isAiCfoAccessEnabled:F,onAskAiCfoClick:w}=xa({mobileExploreReferrer:"Card Policy"}),p=d((c=>Ss(c))),T=d((c=>Pn(c.cardPolicyState))),B=d((c=>wn(c.cardPolicyState))),S=d((c=>vn(c.cardPolicyState))),l=d((c=>Tn(c.cardPolicyState))),C=d((c=>Fn(c.cardPolicyState))),L=d((c=>xn(c.cardPolicyState))),k=d((c=>Ln(c.cardPolicyState))),_=d((c=>Pt(c.cardPolicyState))),D=d((c=>On(c))),M=d((c=>t!=null?ys(c.cardPolicyState,t):void 0)),E=r.useMemo((()=>p.templateId===t&&p.formDraft!=null?p.formDraft:M!=null?Is(M):void 0),[p.templateId,p.formDraft,M,t]);r.useEffect((()=>{if(t==null)return;const c=p.detailFetchState.fetchState;p.templateId===t&&(c==="Completed"||c==="In-Progress")||M!=null||s(ks(t))}),[s,t,p.templateId,p.detailFetchState.fetchState,M]),r.useEffect((()=>{T!=="Completed"&&T!=="In-Progress"&&s(Bn())}),[s,T]),Fr();const y=d((c=>c.chargeCardConfigState.receiptRequiredAboveAmount.amount));r.useEffect((()=>{D.fetchState==="Not-Started"&&s(ia(!1,!1,!1))}),[D.fetchState,s]);const R=r.useMemo((()=>B.map(Nc)),[B]),i=r.useMemo((()=>k.map(Vc)),[k]),f=r.useMemo((()=>D.cards.filter((c=>!Cr(c.status.code))).map(Tr)),[D.cards]);Bt({isDataReady:E!=null});const j=r.useMemo((()=>{if(E!=null)return ec({draft:E,cardRows:f,categorySearchOptions:R,vendorSearchOptions:i,defaultRequireReceiptAmount:y,suggestedAllowMerchants:S,suggestedBlockMerchants:l,suggestedAllowCategories:C,suggestedBlockCategories:L})}),[E,f,R,i,y,S,l,C,L]),[G,U]=r.useState(void 0),x=r.useRef(!1);r.useEffect((()=>{x.current||G!=null||j==null||(x.current=!0,U(j))}),[G,j]);const z=r.useCallback((c=>{U(c)}),[]),H=r.useMemo((()=>jt((c=>{s(wt(c))}),250)),[s]);r.useEffect((()=>()=>{H.cancel()}),[H]);const v=r.useCallback((c=>{H(c)}),[H]),P=p.updateFetchState.fetchState,K=n!=null?`/${n}/cards/policy`:"..",W=r.useCallback((()=>{const c=we(a.state?.pathnameStackToGoBack),O=c.poppedPathname??K;e(O,{state:{pathnameStackToGoBack:c.newStack}})}),[a.state,e,K]),I=r.useCallback((()=>{e(K)}),[e,K]),N=r.useCallback((c=>{if(t==null)return;const O=pr(c);s(Es(O)),s(As(t))}),[s,t]),V=r.useRef(P);r.useEffect((()=>{const c=V.current;V.current=P,P==="Completed"&&c!=="Completed"&&(s(ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(K))}),[s,P,e,K]);const Q=P==="Error"?p.updateFetchState.error?.message??Mc.updatePolicyGenericErrorMessage:void 0;return!b||n==null||t==null?o.jsx(Je,{to:"..",replace:!0}):G!=null&&T==="Completed"&&D.fetchState==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(ac,{templateName:p.template?.name??"",formDraft:G,vendorSearchOptions:i,categorySearchOptions:R,isVendorSearchLoading:_==="In-Progress",onVendorSearchTextChange:v,submitState:P,submitErrorMessage:Q,isAiCfoAccessEnabled:F,onAskAiCfoClick:w,onBackClick:W,onCancelClick:I,onClickMenuIcon:m,onFormChange:z,onSubmit:N})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(hr,{showUploadDocumentSection:!1,navBarTitle:p.template?.name,onBackClick:W,onClickMenuIcon:m,isAiCfoAccessEnabled:F,onAskAiCfoClick:w})]})}function xr(e,a,n){return a?e.filter((t=>t!=null&&t.trim().length>0)).slice(0,n):[]}function Lr(e){return d((a=>e==null||e===""?{chips:ft,isResolved:!1}:(function(n){const t=n?.fetchState,s=t==="Completed"||t==="Error";return{chips:t==="Completed"?n?.suggestedQuestions??ft:ft,isResolved:s}})(Ds(a,e))),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:$c,subheadline:Gc,pageTitle:Kc}}}}=ea.getLocalizedStrings(),zc=e=>{const a=e.cardsCount>0?e.cardsCount:e.appliedCards.length,n=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,t=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:a,vendorRestrictionsCount:n,categoryRestrictionsCount:t}};function Yc(){const e=de(),a=he(),{tenantEmailDomain:n}=Ne(),t=me(),s=Be(),g=Te(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((v=>{h(v)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{useFeatureGate:m}=le(),{isFeatureEnabled:F}=m(Z.isAiCfoFileUploadEnabled),{isFeatureEnabled:w}=m(Z.isCardPolicyEnabled),{isAiCfoAccessEnabled:p,onAskAiCfoClick:T}=xa({mobileExploreReferrer:"Card Policy"}),B=d((v=>_s(v))),S=d((v=>Rn(v.createCardPolicyState))),l=d((v=>Ps(v.createCardPolicyState))),C=d((v=>l==null?[]:Nn(v.aiCfoState,l).filter((P=>P.kind==="creating_policy"))),_t),L=S.fetchState==="In-Progress"?Math.max(C.length,1):0,k=d((v=>ws(v.createCardPolicyState))),_=ya(S.fetchState);r.useEffect((()=>{if(_==="In-Progress"&&S.fetchState==="Completed"&&l!=null)C.forEach((v=>{t(yt({chatSessionId:l,id:v.id,entityIds:k,kind:"created_policy"}))}));else if(_==="In-Progress"&&S.fetchState==="Error"&&l!=null){C.forEach((P=>{t(yt({chatSessionId:l,id:P.id,kind:"errored_policy"}))}));const v=S.error?.message!=null&&S.error.message.length>0?S.error.message:ea.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;t(ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:v}]}))}}),[S.error?.message,S.fetchState,t,l,k,C,_]);const D=B.fetchState.fetchState;r.useEffect((()=>{D!=="Not-Started"&&D!=="Error"||t(vs())}),[t,D]);const M=B.archiveFetchState.fetchState,E=ya(M);r.useEffect((()=>{E==="In-Progress"&&M==="Completed"&&t(ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))}),[M,t,E]);const y=r.useMemo((()=>B.templates.map(zc)),[B.templates]);Bt({isDataReady:B.fetchState.fetchState==="Completed"});const R=y.length>0||L>0,i=(function(v){const{hasAnyPolicies:P,isChargeCardAdmin:K,isFileUploadEnabled:W}=v,I=de(),N=he(),{tenantEmailDomain:V}=Ne(),{isAiCfoOpen:Q,setIsAiCfoOpen:c}=fr(),O=gr(),q=br(),se=d((J=>Mn(J))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:X,isResolved:He}=Lr("card_policy"),Ae=r.useMemo((()=>xr(X,He,3)),[X,He]),[ge,re]=r.useState(""),be=q&&O&&V!=null&&!Q,ue=r.useCallback((J=>{if(V==null)return;const fa=ke(N.state?.pathnameStackToGoBack,N.pathname);I(`/${V}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:J,aiCfoShouldSubmit:J!=null&&J.trim().length>0}})}),[N.pathname,N.state,I,V]),oe=r.useCallback((J=>{J.trim().length!==0&&(re(""),ue(J))}),[ue]),Se=r.useCallback((()=>{const J=ge.trim();J.length!==0&&(re(""),ue(J))}),[ge,ue]),ee=r.useCallback((()=>{}),[]),De=r.useCallback((J=>{re(J)}),[]),ve=r.useCallback((()=>{c(!0)}),[c]),Ce=r.useCallback((()=>{ue(void 0)}),[ue]);return r.useMemo((()=>{if(be&&!P&&K)return{aiAgentName:Kc,headline:$c,subheadline:Gc,promptChips:Ae,composer:{currentInput:ge,isSubmitting:se,isFileUploadEnabled:W,onInputChange:De,onSubmit:Se,onStopSubmit:ee},onPromptClick:oe,onOpenSidePanel:ve,onOpenFullView:Ce,dataTestIdPrefix:"card-policy-ai-cfo-hero"}}),[ge,P,be,K,W,se,De,Ce,ve,oe,ee,Se,Ae])})({hasAnyPolicies:R,isChargeCardAdmin:g,isFileUploadEnabled:F}),f=w&&i!=null?o.jsx(Sr,{...i}):null,j=p&&f==null,G=r.useCallback((()=>{const v=we(a.state?.pathnameStackToGoBack),P=v.poppedPathname??"..";e(P,{state:{pathnameStackToGoBack:v.newStack}})}),[a.state,e]),U=r.useCallback((()=>{n!=null&&e(`/${n}/cards/policy/new`)}),[e,n]),x=r.useCallback((v=>{n!=null&&e(`/${n}/cards/policy/${v}/edit`)}),[e,n]),z=r.useCallback((v=>{t(Ts(v))}),[t]),H=B.fetchState.fetchState;return!R&&H!=="Completed"&&H!=="Error"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(tc,{onBackClick:G,onNewPolicyClick:U,onClickMenuIcon:u,isAiCfoAccessEnabled:p,onAskAiCfoClick:T})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(nc,{policies:y,archivingTemplateId:B.archiveTargetTemplateId,pendingCreationCount:L,onBackClick:G,onNewPolicyClick:U,onEditPolicyClick:x,onArchivePolicyClick:z,onClickMenuIcon:u,policyAiCfoHero:f,isAiCfoAccessEnabled:j,onAskAiCfoClick:T})]})}function Zc(){const e=de(),{cardId:a}=Ne(),n=me(),t=te.getSignedInUser(),s=d((X=>fe(X))),g=Be(),b=Te(g?.loggedInUserRoleMap),{useFeatureGate:h}=le();if(t==null)throw Error("Can't access Add To Wallet Page without signing in...");const[A,u]=r.useState(!1),m=d((X=>qa(X).firstViewAfterActivation));if(a==null)throw Error("Empty card id is not valid...");const F=s.userRole.includes("charge_card_user"),{isFeatureEnabled:w}=h(Z.isChargeCardFeatureEnabled),p=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:T}=h(Z.isDebitCardFeatureEnabled),B=Fe(s),S=xe(s),l=Le(T,s),C=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Re({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:l}),k=Oe({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:w,isBookKeepingTenant:S,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:C}),_=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,D=d((X=>da(X,s.companyId))),M=la(D.controllers),{creditAccount:E,creditAccountRepayment:y}=d((X=>ua(X))),R=d((X=>X.classListState.fetchState)),i=!F&&k&&p,f=d((X=>vt(X,a,i,k))),[j,G]=r.useState(!1),U=f.chargeCard,x=U?.cardCreatedByUser?.userId,z=d((X=>x!=null?Ga(X.userRoleState,x):void 0)),H=z?.accountingClassIDs[0],v=d((X=>H!=null?Ka(X.classState,{classId:H,reportId:"class_list"}):void 0)),P=U?.cardHolderUser?.userId,K=d((X=>P!=null?Ga(X.userRoleState,P):void 0)),W=K?.accountingClassIDs[0],I=d((X=>W!=null?Ka(X.classState,{classId:W,reportId:"class_list"}):void 0)),N=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",V=U?.type.code==="business_physical_debit_card";r.useEffect((()=>{m&&A===!1&&N&&(u(!0),setTimeout((()=>{n(za()),V&&n(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[m,A,N,V]),r.useEffect((()=>{j||f.fetchState==="Completed"||f.fetchState==="In-Progress"||a==null||(G(!0),n(ka(a,i,!1)))}),[j,f,a,n]),r.useEffect((()=>{if(f.fetchState==="Completed"&&(N===!1||N&&U?.status?.code!=="active"||U?.cardHolderUserId!==t.userId||m===!1&&A===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=_e(s.tenantEmailDomain,a,t,U,m);e(X)}}),[f.fetchState,m,N]),r.useEffect((()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&k&&p&&b&&n(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&k&&p&&b&&n(Tt()),R!=="Completed"&&R!=="In-Progress"&&n(Vn())}),[E.fetchState,y.fetchState,n,k,p,b,R]);const Q=()=>{if(t!=null&&a!=null){n(za());const X=_e(s.tenantEmailDomain,a,t);e(X)}},c=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",O=Xe(k,L,_,p),q=La(k,p,b,E,y),se=Dr(c,f);return f.fetchState!=="Completed"?o.jsx(va,{fetchState:"In-Progress"}):o.jsxs(o.Fragment,{children:[o.jsx(nt,{showConfetti:m}),o.jsx(rc,{onGotItClick:Q,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:M,isChargeCardFeatureEnabled:k,isDebitCardFeatureEnabled:L,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:p,productInformation:O,creditAccountInformation:q,debitAccountInformation:se,chargeCardDetailView:f,creditAccount:E,classListFetchState:R,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:v?.className,cardHolderRoles:K?.userRoles,cardHolderDepartmentName:I?.className})]})}const Br="charge-card-transaction-update",Rr="charge-card-transaction-created",Or="charge-card-transaction-declined",Ur="charge-card-transaction-updated",jr="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Ht="charge-card-spending-updated",ct="credit-account-balance-updated",it="charge-card-created",$t="charge-card-limit-updated",Gt="charge-card-limit-reset",Kt="charge-card-renamed",Wc="charge-card-department-updated",Mr="charge-card-repayment-completed",Nr="charge-card-payment-date-updated",Ba="charge-card-cashback-redeemed",Ra="charge-card-cashback-earned",ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),qc=[Ra,Ba],Jc=Pe((function(e){const a=ma(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}}),(function(e){return{onColumnSortConfigChanged:(a,n)=>{e(Fs({uiState:{sortKey:a,sortOrder:n}}))}}}))(oc);function Qc(){const e=de(),a=me(),n=he(),t=te.getSignedInUser(),s=d((T=>fe(T))),{useFeatureGate:g}=le(),{isFeatureEnabled:b}=g(Z.isCardsCommentingEnabled),[h,A]=r.useState(!1),u=d((T=>ma(T))),m=vr(s.companyId,{clearParams:u.fetchState==="Completed"}),F=r.useCallback((()=>{const T=we(n.state?.pathnameStackToGoBack),B=T.poppedPathname??Xc(s.tenantEmailDomain);e(B,{state:{pathnameStackToGoBack:T.newStack}})}),[e,n,s.tenantEmailDomain]),w=aa(s);if(Vt({events:ha(w,qc),onEvent:T=>{switch(T){case Ra:case Ba:return void a(_a(!0))}},onSubscribed:()=>{a(_a(!0))}}),r.useEffect((()=>{h||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(A(!0),a(_a()))}),[h,u,a]),t==null)throw Error("Can't access cashback detail page without signing in...");const p=u.cashbackSummary?.cashbackEarned?.amount!=null&&u.fetchState!=="Not-Started";return u.fetchState!=="In-Progress"||p?(u.cashbackSummary?.cashbackEarned?.amount??0)===0&&u.fetchState==="Completed"?o.jsx(ot,{}):o.jsx(Jc,{onBackClick:F,isCardsCommentingEnabled:b,initialOpenThreadRequest:m}):o.jsx(sc,{onBackClick:F})}const Xc=e=>`/${e}/cards`,ei={containerWidth:new Fa(100,58)},ai=({appContent:e})=>{const a=Ta(),n=me(),t=de(),{cardId:s}=Ne(),g=he(),{useDynamicConfig:b}=le(),[h,A]=r.useState(!1),[u,m]=r.useState(!1),[F,w]=r.useState(!1),[p,T]=r.useState(!1),B=te.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const S=d((I=>fe(I)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:l}=b(Qe.zeniCardsConfig),C=l.max_charge_card_activation_attempts_by_card_id,L=d((I=>xs(I,s))),k=L.chargeCard,_=d((I=>I.chargeCardConfigState.fetchState)),{useFeatureGate:D}=le(),{isFeatureEnabled:M}=D(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=D(Z.isDebitCardFeatureEnabled),y=Le(E,S),R=Re({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:y}),i=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,f=S.userRole.includes("charge_card_user"),j=Fe(S),G=xe(S),U=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=Oe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:M,isBookKeepingTenant:G,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:U}),z=!f&&x&&i;r.useEffect((()=>{h===!1&&_!=="In-Progress"&&_!=="Completed"&&(n(Ja()),A(!0)),u===!1&&L.fetchState==="Not-Started"&&(m(!0),n(ka(s,z,x)))}),[u,L.fetchState,h,_]);const H=k?.type.code==="business_physical_credit_card"||k?.type.code==="business_physical_debit_card";r.useEffect((()=>{if(L.fetchState==="Completed"){if(F===!1&&(H===!1||H&&k?.status?.code!=="inactive"||k?.cardHolderUserId!==B.userId)){const I=_e(S.tenantEmailDomain,s,B,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);t(I,{state:{pathnameStackToGoBack:N}})}else if(F&&L.isRefreshingViewInBackground===!1&&k?.status?.code==="active"){n(Ls({chargeCardId:s}));const I=_e(S.tenantEmailDomain,s,B,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(I,{state:{pathnameStackToGoBack:N}})}}}),[L.fetchState,k?.type.code,F,L.isRefreshingViewInBackground]);const v=te.getZeniOtpTokenForCardHolder(s),P=d((I=>Hn(I.userState,B.userId))),K=()=>{k?.status?.code!=="active"&&n(ba(s,!0))};r.useEffect((()=>{L.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&k?.cardActivationAttemptHistory.some((I=>I.statusCode==="success"))===!0&&F===!1&&(setTimeout(K,3e3),w(!0))}),[L.updatePhysicalChargeCardAttemptFetchState.fetchState,k?.cardActivationAttemptHistory]);const W=I=>{T(I)};if(_!=="Completed"||k==null)return o.jsx(va,{fetchState:"In-Progress"});if(k.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return o.jsxs(ri,{children:[o.jsx(Ee,{isAppContentDrawerOpen:p,handleDrawerToggle:W}),o.jsx(ti,{cardId:s,card:k,shippingAddressId:k.shippingAddressId,phone:P.phone,signedInUser:B,isSandboxEnv:Rt(),chargeCardDetailState:L,signedInUserToken:v,navigate:t,currentTenant:S,location:g,maxChargeCardActivationAttempts:C[s]!=null?C[s]:l.default_max_charge_card_activation_attempts!=null?l.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:l.charge_card_cashback_rate_per_transaction!=null?l.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?o.jsx(ni,{windowSize:a,children:e}):null]})},ti=Pe((function(e,{chargeCardDetailState:a,shippingAddressId:n,location:t,cardId:s}){const g=Bs(e.addressState,n);if(g==null)throw Error("Can't access shippingAddress.");const b=$n(e,s),h=a.updateStatus,A=Ca(e,!1,!1,!1);let u=!1;A.fetchState==="Completed"&&A.cards.length<=1&&(u=!0);const m=t.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Rs())||m,showMenuIcon:u,shippingAddress:g,vgsVaultId:rt.cardVaultId,twoFAView:b,activationWaitStatus:h,isRefreshingViewInBackground:a.isRefreshingViewInBackground}}),(function(e,a){const{navigate:n,cardId:t,location:s,currentTenant:g,chargeCardDetailState:b}=a,h=b.chargeCard?.cardProviderID,{tenantEmailDomain:A}=g;return{onGetOtp:u=>{h!=null&&e(at(u,"ChargeCardHolder",t))},onUpdatePhysicalChargeCardAttempt:u=>{e(Us(t,u))},onResendOtp:u=>{h!=null&&e(et(u,"ChargeCardHolder",t))},onVerifyOtp:(u,m)=>{h!=null&&e(Xa(u,m,"ChargeCardHolder",t))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,t)},onCVVActivateSuccess:()=>{e(Os({chargeCardId:t}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),m=u.poppedPathname==null||u.poppedPathname.includes("onboard")===!0?ta(A):u.poppedPathname;n(m,{state:{pathnameStackToGoBack:u.newStack}})}}}))(cc),ni=Ve.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: ${e=>`${ei.containerWidth.value(e.windowSize)}%`};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as m}from"./liveblocks-UOzcPsHa.js";import{a as g}from"./sentry-DHDsO12F.js";import{h as w,u as T,g as x,i as k,j as O,l as E}from"./core-B5mDy9pu.js";import{z as D,br as F,a8 as P,j,S as V,n as C,bs as A,ae as L,aG as U,p as B}from"./index-CrBk11WI.js";import{fF as b,gI as M,Bw as _,gD as z,c8 as G,Y2 as R,bn as Y,uT as H,uH as Z,mz as $,o8 as S,Y3 as q,bE as J,cE as N,oj as K,ot as Q}from"./zeni-epic-state-7eY0g-Bc.js";import"./mui-Do6nLzGb.js";import{d as W}from"./routePaths-CeCPwkIf.js";import{M as X}from"./MobileAppDrawer-CjKRvtSN.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="ecde6560-97cb-4d6c-9923-dedc9e847859",t._sentryDebugIdIdentifier="sentry-dbid-ecde6560-97cb-4d6c-9923-dedc9e847859")}catch{}})();const ee=E((function(t){const a=z(t),i=D.getSignedInUser(),p=b(t),c=p.tenantId,l={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=G(p?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=R(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:l,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}}),(function(t,a){const{companyId:i,currentTenant:p,navigate:c,location:l}=a,{tenantEmailDomain:f}=p;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const n=W(f,e),o=B(l.state?.pathnameStackToGoBack,l.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map((I=>I.length===2?I:U(I)))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map((I=>parseInt(I))),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(q(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t($({files:e}))},onDeleteFile:e=>{t(Z(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}}))(A);function de(){const t=w(),a=T(),i=x(),{tenantEmailDomain:p}=k(),[c,l]=g.useState(!1),[f,e]=g.useState(!1),n=O((s=>s.companyViewState.passportView.fetchState)),o=O((s=>s.companyConfigState.fetchState)),r=O((s=>b(s))),d=r.companyId??D.getSignedInUserTenant(p)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect((()=>{c||n!=="Not-Started"||d==null||(l(!0),a(M(d)))}),[c,n,d,a]),g.useEffect((()=>{o==="Not-Started"&&a(_())}),[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:j,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{j as I}from"./liveblocks-UOzcPsHa.js";import{a as o}from"./sentry-DHDsO12F.js";import{u as H,h as P,g as R,j as C,N as w}from"./core-B5mDy9pu.js";import{TJ as q,fF as z,gl as G,pS as J,gM as A,gk as M,gi as Q,U7 as V,gh as O}from"./zeni-epic-state-7eY0g-Bc.js";import{u as B,z as E,L as D,G as K,H as W}from"./index-CrBk11WI.js";import{n as X}from"./mui-Do6nLzGb.js";import{P as b,a as _}from"./AccountMappingScreen-BPRZHuGA.js";import{t as Y}from"./getLocaleForTenant-xZFgPOZu.js";import{g as Z,Q as ee}from"./QBOConnectionScreen-CvbLmaBz.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";import"./MobileAppDrawer-CjKRvtSN.js";import"./InboxNotificationsProvider-BmF5-_KA.js";import"./useTaskManagerAccess-CdPkYUw1.js";import"./accountMappingHelper-DqBiQF6x.js";import"./empty-Dj4ZMRNZ.js";import"./pdf-lib-CZXOqgb4.js";import"./index-k1-Pd2Ki.js";import"./url-BxiN6LKq.js";import"./index-6yt3BfRL.js";import"./decodeURIComponentSafe-DANuhXnG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="c6bf3300-3d69-4bea-8a7b-ec8fb6fd63cc",t._sentryDebugIdIdentifier="sentry-dbid-c6bf3300-3d69-4bea-8a7b-ec8fb6fd63cc")}catch{}})();const te=X.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex: 1 1 auto;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100vh;
|
|
9
|
+
background-color: ${t=>t.theme.colors.background};
|
|
10
|
+
box-shadow: ${t=>`0px 2px ${W.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
+
`;function we(){const t=H(),i=P(),v=R(),{setLoading:d,clearAllLoading:m}=B(),h=o.useRef(!1),S=o.useRef(!1),N=o.useRef(!1),f=o.useRef(!1),{code:U,realmId:$,state:F}=Z(v.search),p=U!==""&&$!==""&&F!=="";p&&(N.current=!0);const j=sessionStorage.getItem(b),u=j===_.pending,L=j===_.ready,x=C((s=>q(s))),e=C((s=>z(s))),n=C((s=>s.tenantState.fetchState)),r=C((s=>s.tenantState.activeTenantFetchState.fetchState)),a=E.getSignedInUser(),g=E.getActiveTenantForUser()?.tenantId,l=e?.externalConnections?.fetchState,c=e?.externalConnections?.saveConnectionState,y=e.externalConnections?.accounting[0]?.isValid;o.useLayoutEffect((()=>{d(D.CONNECTION_AUTH)}),[d]),o.useEffect((()=>{h.current||a==null||g==null||(h.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(D.TENANT_FETCHING),t(G(a.userId,g))))}),[h,n,d]),o.useEffect((()=>{e.tenantId==null&&!S.current&&a!=null&&(S.current=!0,!(g==null||g!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(J(a.userId)))}),[S,n,r]),o.useEffect((()=>{a==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||c!=="Error"||(d(D.CONNECTION_AUTH),t(A(a.userId,e.tenantId)))}),[c]),o.useEffect((()=>{n!=="Completed"&&r!=="Completed"||a==null||e?.tenantId==null||(t(M(e.tenantId)),E.saveActiveTenantDomainForUser(e.tenantEmailDomain),Q(a?.userId,a?.zeniSessionId,e.tenantId),K.updateAppLocaleID(Y(V(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||a==null||e==null||t(A(a.userId,e.tenantId)))}),[n,r,l]),o.useEffect((()=>{x.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&E.saveSignedInUserTenants(x.tenantsCoreDetailsInOrder)}),[x.tenantsCoreDetailsInOrder.length,n]);const T=e==null||n!=="Completed"&&r!=="Completed"||l!=="Completed";if(o.useEffect((()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||l!=="Completed"&&l!=="Error"||m()}),[n,r,l]),o.useEffect((()=>{u&&c==="In-Progress"&&(f.current=!0)}),[u,c]),o.useEffect((()=>{if(!u||T)return;const s=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return f.current&&c==="Completed"?(sessionStorage.setItem(b,_.ready),m(),void i(s,{replace:!0})):f.current&&c==="Error"?(sessionStorage.removeItem(b),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),void i(s,{replace:!0})):void(p||N.current||f.current||y!==!0||(sessionStorage.removeItem(b),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),i(s,{replace:!0})))}),[u,T,c,p,y,e.tenantEmailDomain,m,t,i]),T)return null;if(p||y!==!0)return I.jsx(te,{children:I.jsx(ee,{})});if(u)return null;const k=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return L?I.jsx(w,{to:k,replace:!0}):I.jsx(w,{to:"/",replace:!0})}export{we as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-UOzcPsHa.js";import{z as m}from"./index-CrBk11WI.js";import{g as n}from"./QBOConnectionScreen-CvbLmaBz.js";import"./sentry-DHDsO12F.js";import{g as p,N as a}from"./core-B5mDy9pu.js";import"./zeni-epic-state-7eY0g-Bc.js";import"./recharts-uFX1dZS-.js";import"./mui-Do6nLzGb.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";import"./empty-Dj4ZMRNZ.js";import"./pdf-lib-CZXOqgb4.js";import"./index-k1-Pd2Ki.js";import"./url-BxiN6LKq.js";import"./index-6yt3BfRL.js";import"./decodeURIComponentSafe-DANuhXnG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="a1205b81-d106-415b-bd92-85aeae53ace3",t._sentryDebugIdIdentifier="sentry-dbid-a1205b81-d106-415b-bd92-85aeae53ace3")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-BffNdH_l.js → CustomerOnboardingRoutes-BivxymAu.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-UOzcPsHa.js";import{t as wn,A as $e}from"./AddressScreen-DhOzuvLT.js";import An from"./NotFoundScreen-MJal1hew.js";import{a as d,t as Me}from"./sentry-DHDsO12F.js";import{h as _e,g as Ee,u as se,i as xe,j as T,N as Q,q as Pn,l as cn,n as Dn,o as H}from"./core-B5mDy9pu.js";import{fF as Y,d_ as Te,dZ as we,bq as Bn,T_ as jn,bR as Fn,pQ as Vn,Bg as Un,Bj as Ln,Vl as Rn,Vm as Nn,lu as Oe,lx as dn,UB as Gn,b$ as $n,c8 as fe,BK as Ae,Bv as Mn,Vn as me,BL as un,S8 as Qn,mH as ln,di as pn,Vo as Kn,Vp as zn,uA as qn,Uo as Ce,hV as Hn,Un as be,hS as Zn,G8 as Jn,uE as Wn,hK as Xn,hN as Qe,Vq as mn,Vr as Yn,LV as et,Vs as nt,LZ as tt,Bm as at,Vt as ot,Vu as st,ls as rt,lv as it,BX as ct,Bx as gn,BJ as dt,bE as Ke,cE as ut,BW as ze,uT as lt,uH as pt,mz as mt,gG as gt,gF as ft,gE as yt,Vv as ht,Bp as Ct,BY as bt,B$ as St,C2 as It,C8 as kt,dj as Ot}from"./zeni-epic-state-7eY0g-Bc.js";import{z,N as Pe,c as W,q as vt,p as q,a8 as re,j as g,aE as _t,ai as fn,a1 as Et,M as yn,U as hn,h as X,Z as ge,S as ve,aF as xt,H as qe,v as He,ae as Tt,aG as Ze,aH as wt,aI as At}from"./index-CrBk11WI.js";import{n as De}from"./mui-Do6nLzGb.js";import{g as Pt,h as Dt,q as ie}from"./QBOConnectionScreen-CvbLmaBz.js";import{u as Bt,a as jt}from"./useEmailConnectResultRefresh-C-cGd7Tb.js";import{u as Ft}from"./useChargeCardPusherEvents--oeBBRmO.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";import"./empty-Dj4ZMRNZ.js";import"./pdf-lib-CZXOqgb4.js";import"./index-k1-Pd2Ki.js";import"./url-BxiN6LKq.js";import"./index-6yt3BfRL.js";import"./decodeURIComponentSafe-DANuhXnG.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]="6bc0045b-fd5c-4076-afff-8dff924d1555",e._sentryDebugIdIdentifier="sentry-dbid-6bc0045b-fd5c-4076-afff-8dff924d1555")}catch{}})();const Je=e=>{switch(e){case"Complete":return"yes";case"Pending Review":case"Incomplete":return"partially";default:return"no"}},Vt=()=>{const e=_e(),l=Ee(),i=se(),[a,p]=d.useState(!1),[u,c]=d.useState(!1),{tenantEmailDomain:v}=xe(),n=z.getSignedInUser(),{useFeatureGate:t}=Pe(),{isFeatureEnabled:C}=t(W.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(W.isArAgingFeatureEnabled),{isFeatureEnabled:A}=t(W.isReferralFeatureEnabled),{isFeatureEnabled:w}=t(W.isDebitCardFeatureEnabled),k=vt(),O=T((S=>Y(S))),P=T((S=>S.onboardingCustomerViewState.fetchState)),_=O.excludedResources,F=O.companyId??z.getSignedInUserTenant(v)?.companyId;if(n==null)throw Error("Can't access onboarding flow without signing in...");const m=Te(w,O),b=we(O),D=[],U=_?.resources?.find((S=>S.resource==="/reports/top_expenses"))==null,h=_?.resources?.find((S=>S.resource==="/reports/task_card"))==null,r=O?.userRole!=null&&Bn(O?.userRole),E=_?.resources?.find((S=>S.resource==="/bills"))==null&&!r,x=_?.resources?.find((S=>S.resource==="/reimbursements"))==null;U===!1&&D.push("top_expenses"),h===!1&&D.push("task_card"),E===!1&&D.push("bill_pay_card","bill_pay_promo_card"),x===!1&&D.push("reimbursement_card","reimbursement_promo_card"),D.push("zeni_accounts_promo_card","treasury_promo_card"),A===!1&&D.push("rewards_card");const f=T((S=>{const V=[];C===!1&&V.push("accounts_payable_aging"),o===!1&&V.push("accounts_receivable_aging"),V.push("zeni_accounts_promo_card","treasury_promo_card"),A===!1&&V.push("rewards_card"),k===!1&&V.push("expense_automation_card");const Z=jn(S,V);return Fn(Z.reportsInOrder.map(($=>({fetchState:$.fetchState,error:$.error})))).fetchState}));d.useEffect((()=>{P!=="Completed"||a||m||b||(p(!0),i(Vn(n.userId,F,O.tenantId,!0,!1,D)))}),[a,P,m,b,n,O.tenantId,i]);const B=d.useRef(!1),N=d.useCallback((()=>{const S={pathnameStackToGoBack:q(l.state?.pathnameStackToGoBack,l.pathname),message:"activation"};e(m?"../../checking":b?"../../cards":"../../dashboard",{state:S})}),[e,l,m,b]),G=d.useCallback((()=>{B.current||(B.current=!0,N())}),[N]);if(d.useEffect((()=>{const S=setTimeout((()=>c(!0)),3e3);return()=>clearTimeout(S)}),[]),d.useEffect((()=>{const S=setTimeout(G,6e3);return()=>clearTimeout(S)}),[G]),d.useEffect((()=>{m||b||!u||f!=="Completed"&&f!=="Error"||G()}),[u,f,m,b,G]),P!=="Completed")return s.jsx(Q,{to:"../"});const R=O.company?.companyOnboardingInfo?.onboardingInfo,ee={timeSinceQuoteSign:R?.onboardingTimeSinceQuoteSigned??"",timeSinceQuoteSignInMinutes:R?.onboardingToQuoteSignMinutes??0,isKybDone:Je(R?.businessVerified?.status),isKycDone:Je(R?.identityVerified?.status),paymentType:"",paymentSource:"",qboConnectionSource:R?.accountingConnectionCreationMode??""};return s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:g,onLoad:S=>S.trackOnboardingDashboardActivation(ee)}),s.jsx(_t,{show:!0,onComplete:G})]})},Se=["reading_books","finance_graph","reconciliation","cfo_foundation"],Ie=["llm_fine_tuning","rag_knowledge_graph","personalized_context"],We=(e,l)=>{const i=new Map(e.map((a=>[a.key,a])));return l.map((a=>{return p=i.get(a)?.status,p==="starting"||p==="building"?p:"idle";var p}))},Xe=(e,l)=>{if(e.length===0)return!1;const i=new Map(e.map((a=>[a.key,a])));return l.every((a=>i.get(a)?.status==="ready"))},Ye=De.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -23,8 +23,8 @@ import{j as s}from"./liveblocks-DKqwsBQp.js";import{t as wn,A as $e}from"./Addre
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
26
|
-
`,nn=cn((function(e,l){const{companyId:i,isAdmin:a,currentTenant:p,isOnAddressPage:u}=l,c=z.getSignedInUser(),v=p.tenantId,n={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:v??""},t=Y(e),C=Ae(e,i),o=mn(e),A=fe(p?.userRole??[])&&C.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",w=Yn(e.userRoleConfigState);return{onboardingCustomerView:C,analytics:g,isRefreshingViewInBackground:!1,isDisabled:A,companyTitles:w.companyTitles,connectedAccountProvider:t.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Tt.fileMicroServiceBaseUrl,authParams:n},signedInUser:z.getSignedInUser(),currentTenant:t,isAdmin:a,isOnAddressPage:u,cardPaymentView:o,isCardPaymentPopupOpen:!1,stripeKey:ge.stripeKey}}),(function(e,l){const{companyId:i,currentTenant:a,themeState:p,navigate:u,location:c}=l,{tenantEmailDomain:v}=a;return{onFetchLinkTokenClick:(n,t)=>{e(kt(n,t))},onEstablishConnectionClick:(n,t)=>{e(It(n,t))},onUpdatePaymentAccountStatus:(n,t,C)=>{e(St(n,t,C))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(bt(!1,n,t))},onEstablishConnectionSuccess:()=>{e(Ct(i,!0,!1))},handleOnConnectClick:()=>{g.trackOnboardingConnectQBO(),ie.handleClick()},updateQBOPopupState:n=>{e(me({isQBOPopupOpen:n}))},onCompanyOfficerUpdated:n=>{const t=n.map((C=>{const{officerType:o,userId:A,name:w,email:k,ssn:O,nationalityCountryCode:P,dob:_,phone:F,syncToken:m,selectDocument:b,role:D,ownership:U,isSelectedForVerification:h,userVerificationStatus:r,fileIds:x,isPhoneVerified:E}=C;let f;return b.selectDocumentType==="driverLicense"?f="driving_license":b.selectDocumentType==="passport"?f="passport":b.selectDocumentType==="stateId"?f="id_document":b.selectDocumentType==="ssnCard"&&(f="social_security_card"),{officerType:o,userId:A,firstName:w.firstName,lastName:w.lastName,email:k,ssn:O,nationalityCountryCode:P?.selectedOption!=null?Ze(P.selectedOption):void 0,phone:F,birthday:_!=null?Ke(_?.toString()):_,syncToken:m,titleAtCompany:D.selectedOption,ownershipInCompany:U,documentTypeSelectedForVerification:f,isSelectedForVerification:h,userVerificationStatus:r,fileIds:x,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:E}}));e(ze({officers:t}))},onGetOtp:(n,t)=>{e(yt(n,"CustomerOnboarding")),t!=null&&e(ht({officerType:t,phone:n}))},onResendOtp:n=>{e(ft(n,"CustomerOnboarding"))},onVerifyOtp:(n,t)=>{g.trackOnboardingPhoneVerified(),e(gt(n,t,"CustomerOnboarding"))},updateFilesEntity:n=>{e(mt({files:n}))},onDeleteFile:n=>{e(pt(n))},onEditFileName:(n,t)=>{e(lt(n,t.split(".")[0]))},onCompanyDetailsChanged:n=>{const{companyDescription:t,companyIndustry:C,companyIndustryType:o,companyLegalName:A,companyTaxId:w,companyWebsite:k,companyPhone:O,primaryContactEmail:P,primaryContactName:_,primaryContactUserId:F,primaryContactSyncToken:m,syncToken:b,fileIds:D,typeOfIncorporation:U,stateOfIncorporation:h,incDate:r,companySourceOfFunds:x,companySourceOfFundsDescription:E,companySubIndustry:f,countriesOfOperations:B,purposeOfAccount:N,purposeOfAccountDescription:G,regulatedStatus:R,regulatedStatusDescription:ee,transactionVolume:S,transactionVolumeDescription:V,usNexus:Z,usNexusTypes:$}=n,M={companyId:i,companyDescription:t,companyIndustry:C.selectedOption,companyIndustryType:o?.selectedOption??"",companyLegalName:A,taxIdOrEIN:w,website:k!=""&&k!=null?ut(k):void 0,phone:O,syncToken:b,fileIds:D,incDate:r!=null?Ke(r?.toString()):r,typeOfIncorporation:U?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",companySourceOfFunds:x?.selectedOption??"",companySourceOfFundsDescription:E,companySubIndustry:f?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((L=>L.length===2?L:Ze(L)))??[],purposeOfAccount:N?.selectedOption??"",purposeOfAccountDescription:G,regulatedStatus:R??"",regulatedStatusDescription:ee,transactionVolume:S?.selectedOption??"",transactionVolumeDescription:V,usNexus:Z,usNexusTypes:$?.selectedOptions??[]},ce={userId:F,firstName:_.firstName,lastName:_.lastName,email:P,syncToken:m};e(ze({companyDetails:M,primaryContactDetails:ce}))},onAddressClick:(n,t)=>{const C=an(v,n,t),o=q(c.state?.pathnameStackToGoBack,c.pathname);u(C,{state:{pathnameStackToGoBack:o}})},onRegisteredAddressClick:(n,t)=>{const C=an(v,n,t),o=q(c.state?.pathnameStackToGoBack,c.pathname);u(C,{state:{pathnameStackToGoBack:o}})},onUpdateCustomerView:(n,t,C)=>{e(dt(i,!1,t,C,n))},onAddressEditHandler:n=>{if(n!=null){const t=wn(n);e(ln({addressType:"subscription_billing_address",addressToCreate:t}))}},onSkipSetupClick:()=>{const n=q(c.state?.pathnameStackToGoBack,c.pathname);e(gn(i,!1,!1)),u("./activation",{state:{pathnameStackToGoBack:n}})},onUpdateStep:n=>{e(un({step:n}))},onUpdateSubStep:n=>{e(ct({subStep:n}))},onZeniLogoClick:()=>{p.toggle()},handleLogOutClick:()=>{const n=q(c.state?.pathnameStackToGoBack,c.pathname);u("/signout",{replace:!0,state:{pathnameStackToGoBack:n,message:"logout"}})},handleCockpitClick:()=>{g.trackOnboardingFlowExited("cockpit"),window.open("/cockpit")},handleReferralsClick:()=>{u(`/${v}/rewards`)},handleCreateCardSetupIntent:n=>{e(dn(n))},handleConfirmCardSetupIntent:n=>{e(it(n))},updateCardPaymentModalState:n=>{e(me({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,C)=>{e(rt(n,t,C))},handleFetchPaymentSources:()=>{e(Oe())},resetCardPaymentViewState:()=>{e(st())},handleResetCardPaymentErrorStatuses:()=>{e(ot())},redirectToProductSuitePage:()=>{g.trackOnboardingFlowExited("product_suite");const n=q(c.state?.pathnameStackToGoBack,c.pathname);u(`/${v}/onboarding/thankyou`,{state:{pathnameStackToGoBack:n,message:"OnboardingThankyou"},replace:!0})},onAcknowledgeAiFinanceTeam:()=>{i!=null&&(g.trackOnboardingAiFinanceTeamAcknowledged(),e(at(i)))},onIdentityDocumentUploadedForAutofill:n=>{if(i==null)return;const t=nt(n.documentType);t!=null&&(g.trackOnboardingDocumentUploaded("kyc",t),e(tt({target:"onboarding",companyId:i,officerType:n.officerType,fileId:n.fileId,documentType:t})))},onCompanyDocumentUploadedForAutofill:n=>{i!=null&&(g.trackOnboardingDocumentUploaded("kyb",n.documentType),e(et({target:"onboarding",companyId:i,fileId:n.fileId,documentType:n.documentType})))}}}))(Et),le=({taxCFOCustomer:e=!1,isOnAddressPage:l=!1,appContent:i})=>{const a=fn(),p=_e(),u=xe(),c=se(),v=xt(),n=yn(),[t,C]=d.useState(!1),[o,A]=d.useState(!1),[w,k]=d.useState(!1),{tenantEmailDomain:O}=Ee(),P=hn(),{useFeatureGate:_}=Pe(),{isFeatureEnabled:F}=_(W.isDebitCardFeatureEnabled),m=Pn("/:tenantEmailDomain/onboarding")!==null&&u.search?.includes("code"),b=T((y=>y.onboardingCustomerViewState.fetchState)),D=T((y=>y.onboardingCustomerViewState.currentStep)),U=T((y=>y.onboardingCustomerViewState.uiState)),h=T((y=>Y(y))),r=T((y=>y.userRoleConfigState.fetchState)),x=T((y=>y.cardPaymentViewState)),E=X(x.addCardPaymentSourceStatus.fetchState),f=x.addCardPaymentSourceStatus.fetchState,{code:B,realmId:N,state:G}=Pt(u.search),R=h.externalConnections?.accounting[0],ee=R?.connectionType,S=R?.connectionName,V=R?.connectionId??"",Z=z.getSignedInUser()?.userId??"",$=d.useRef({realmId:"",connectionId:""});d.useEffect((()=>{o||(A(!0),c(Oe()))}),[o,c]),d.useEffect((()=>{w||(dn(["card"]),k(!0))}),[w]),d.useEffect((()=>{E==="In-Progress"&&f==="Completed"&&c(Oe())}),[E,f]),d.useEffect((()=>{Dt(B,N,G,V,Z)===!0&&h.externalConnections?.saveConnectionState!=="In-Progress"&&b==="Completed"&&(c(Gn(h.tenantId,{connection_type:ee??"accounting",connection_name:S??"quickbooks_online",authorization_code:B,realm_id:N,connection_id:V,user_id:Z},$n(window.location.origin+"/onboarding/auth"))),$.current={realmId:N,connectionId:V},g.trackOnboardingSaveQBOConnection(N,V),p(u.pathname))}),[B,N,G,u.pathname,b]),d.useEffect((()=>{ie.isInitiated===!1&&b==="Completed"&&ie.init("/onboarding/auth",h.tenantEmailDomain)}),[b]);const M=h.companyId??z.getSignedInUserTenant(O)?.companyId,ce=fe(h?.userRole??[]),L=T((y=>Ae(y,M)));d.useEffect((()=>{t||b!=="Not-Started"||M==null||(C(!0),c(Mn(M,!0,!m)))}),[t,b,M]);const ne=h.externalConnections?.saveConnectionState,Be=X(ne);d.useEffect((()=>{Be==="In-Progress"&&(ne==="Completed"||ne==="Error")&&U.isQBOPopupOpen&&D==="connect_ledger"&&(ne==="Completed"?g.trackOnboardingQBOConnectionSuccess($.current.realmId,$.current.connectionId):g.trackOnboardingQBOConnectionFailed($.current.realmId,$.current.connectionId,h.externalConnections?.saveOAuthConnectionError?.message??""),c(me({isQBOPopupOpen:!1})))}),[ne,Be,U.isQBOPopupOpen,D,g,c]),d.useEffect((()=>{b==="Completed"&&m&&(c(un({step:"connect_ledger"})),c(me({isQBOPopupOpen:!0})))}),[m,b]),d.useEffect((()=>{r==="Not-Started"&&c(Qn(!0))}),[r,c]);const Cn=X(L.companyDetailsLocalData?.addressStatus);d.useEffect((()=>{L.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&L.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Cn==null&&c(ln({addressType:"company_registered_address",addressToCreate:L.companyDetailsLocalData?.addressStatus?.addressToCreate}))}),[L.companyDetailsLocalData?.addressStatus?.addressToCreate,L.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const bn=L.isInterimEmailSent,je=z.getSignedInUser();if(je==null)throw Error("Can't access onboarding flow without signing in...");const Sn=Te(F,h),In=we(h),Fe=h.company?.companyOnboardingInfo.isOnboardingCompleted,Ve=y=>y.trackPageLoaded(ve.Event.onboardingPage),ye=h.productSettings.isOtherProductsEnabled,kn=ye===!0&&!pn(h),On=h.productSettings.isTreasuryEnabled,Ue=Ut({tenantEmailDomain:O??"",signedInUserEmail:je.userEmail??"",companyId:M}),Le=(({companyId:y})=>{const K=se(),de=T((j=>j.onboardingCustomerViewState?.aiAgentsActivation)),te=T((j=>Y(j).company?.companyOnboardingInfo?.onboardingInfo?.onboardingAiActivationInfo?.isOnboardingAiActivationViewed??!1)),he=d.useCallback((()=>{K(Un())}),[K]);d.useEffect((()=>{he()}),[he]);const Re=d.useCallback((()=>{y==null||y===""||te||K(Ln(y))}),[y,te,K]),vn=d.useMemo((()=>{if(y==null||y==="")return[];const j=`private-encrypted-${y}`;return[`${j}.ledger-ingestion.counts-updated`,`${j}.ai-agents-activation.phase-changed`]}),[y]),_n=d.useCallback(((j,ae)=>{if(ae==null||typeof ae!="object")return;const I=ae;if(j!=="ledger-ingestion.counts-updated"){if(j==="ai-agents-activation.phase-changed"){const ue=typeof I.phase_key=="string"?I.phase_key:typeof I.key=="string"?I.key:"",J=typeof I.status=="string"?I.status:"idle";if(ue==="")return;K(Nn({key:ue,status:J==="starting"||J==="building"||J==="ready"?J:"idle",startedAt:typeof I.started_at=="string"?I.started_at:void 0,completedAt:typeof I.completed_at=="string"?I.completed_at:void 0}))}}else K(Rn({customerCount:typeof I.customer_count=="number"?I.customer_count:void 0,glAccountCount:typeof I.gl_account_count=="number"?I.gl_account_count:void 0,targetTransactionCount:typeof I.target_transaction_count=="number"?I.target_transaction_count:void 0,transactionCount:typeof I.transaction_count=="number"?I.transaction_count:void 0,vendorCount:typeof I.vendor_count=="number"?I.vendor_count:void 0}))}),[K]);return Ft({events:vn,onEvent:_n,onSubscribed:he}),d.useMemo((()=>{const j=de?.phases??[],ae=We(j,Se),I=We(j,Ie),ue=Xe(j,Se),J=Xe(j,Ie),Ne=j.some((Tn=>Tn.status!=="idle")),oe=!te&&!Ne,Ge=te&&!Ne,xn=Ge?Se.map((()=>"building")):ae,En=Ge?Ie.map((()=>"building")):I;return{ledgerRowStatuses:oe?void 0:xn,backgroundRowStatuses:oe?void 0:En,showLedgerReadyInLabel:oe?void 0:ue,showBackgroundReadyInLabel:oe?void 0:J,forceContinueEnabled:!oe||void 0,counts:de?.counts,onContinueClicked:Re}}),[de?.phases,de?.counts,te,Re])})({companyId:M});if(Fe===!0){if(!ye)return On?s.jsx(Q,{to:"../../treasury"}):Sn?s.jsx(Q,{to:"../../checking"}):In?s.jsx(Q,{to:"../../cards"}):s.jsx(Q,{to:"../../dashboard"});const y=L.updateStatus.fetchState==="In-Progress";if(ye&&!y)return e?s.jsxs(Ye,{children:[s.jsx(re,{analytics:g,onLoad:K=>Ve(K)}),s.jsx(nn,{navigate:p,location:u,companyId:M,currentTenant:h,isAdmin:ce,isOnAddressPage:l,themeState:n,googleAPIKey:ge.googleMapsAPIKey,integrationsSectionProps:Ue,aiAgentsActivationProps:Le,meetingUrl:a("onboarding_overview")}),i!=null?s.jsx(en,{windowSize:v,skipLegacyDrawerOffset:l&&h.productSettings.isOtherProductsEnabled!==!0,children:i}):null]}):s.jsx(Q,{to:"../../onboarding/thankyou"})}else if(Fe===!1&&P?.loggedInUserRoleMap!=null)return bn===!0&&kn?s.jsx(Q,{to:"../../onboarding/thankyou"}):s.jsxs(Ye,{children:[s.jsx(re,{analytics:g,onLoad:y=>Ve(y)}),s.jsx(nn,{navigate:p,location:u,companyId:M,currentTenant:h,isAdmin:ce,isOnAddressPage:l,themeState:n,googleAPIKey:ge.googleMapsAPIKey,integrationsSectionProps:Ue,aiAgentsActivationProps:Le,meetingUrl:a("onboarding_overview")}),i!=null?s.jsx(en,{windowSize:v,skipLegacyDrawerOffset:l&&h.productSettings.isOtherProductsEnabled!==!0,children:i}):null]});return null},ke="external_integrations",Ut=({tenantEmailDomain:e,signedInUserEmail:l,companyId:i})=>{const a=se(),{pendingAutoFocusTabId:p}=Bt(),{plaidAccounts:u,onAddPlaidAccount:c,onReLoginPlaidAccount:v}=jt({companyId:i}),n=T((r=>r.plaidAccountViewState.external_account.plaidConnectionDetails)),t=T((r=>Y(r))),C=T((r=>r.tenantState.fetchState)),o=T((r=>Kn(r,i))),A=T((r=>zn(r,ke))),w=d.useMemo((()=>new Set(A.map((r=>r.additionalInfo)).filter((r=>r!=null)))),[A]),k=t.tenantId,O=fe(t.userRole??[]);d.useEffect((()=>{a(qn(ke))}),[a]);const P=o.externalConnections?.saveAPIKeyConnectionState,_=o.externalConnections?.saveAPIKeyConnectionError?.message,F=X(P);d.useEffect((()=>{F==="In-Progress"&&(P==="Completed"?g.trackIntegrationConnected("chargebee","Onboarding","revenue"):P==="Error"&&g.trackIntegrationConnectFailed("chargebee","Onboarding","revenue",_??""))}),[P,F,_]);const m=o.externalConnections?.saveOAuthConnectionState,b=o.externalConnections?.saveOAuthConnectionError?.message,D=X(m);d.useEffect((()=>{D==="In-Progress"&&(m==="Completed"?g.trackIntegrationConnected("hubspot","Onboarding","revenue"):m==="Error"&&g.trackIntegrationConnectFailed("hubspot","Onboarding","revenue",b??""))}),[m,D,b]);const U=o.externalConnections?.saveConnectorCredentialsStateBySlug,h=X(U);return d.useEffect((()=>{const r=U??{},x=h??{},E=o.externalConnections?.saveConnectorCredentialsErrorBySlug??{};Object.keys(r).forEach((f=>{if(x[f]!=="In-Progress")return;let B;try{B=Ce(f)}catch{return}r[f]==="Completed"?g.trackIntegrationConnected(B,"Onboarding","payments"):r[f]==="Error"&&g.trackIntegrationConnectFailed(B,"Onboarding","payments",E[f]?.message??"")}))}),[U,h,o]),d.useMemo((()=>({isAdmin:O,analytics:g,referrer:"Onboarding",integrationsView:o,isLoading:C==="In-Progress",notifyMeRegisteredSlugs:w,autoFocusTabId:p??void 0,saveChargeBeeState:o.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:o.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:o.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:o.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:o.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(o.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([r,x])=>[r,x?.message]))),deleteConnectionState:o.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:o.externalConnections?.deleteConnectionError?.message,onConnectGmail:()=>{g.trackIntegrationConnectClicked("gmail","Onboarding","email"),a(Qe(k,"gmail",tn()))},onConnectOutlook:()=>{g.trackIntegrationConnectClicked("outlook","Onboarding","email"),a(Qe(k,"outlook",tn()))},onConnectHubSpot:(r,x)=>{const E=o.externalConnections?.revenue?.find((B=>B.connectionName==="hubspot"))?.connectionId;if(E==null)return;g.trackIntegrationCredentialsSubmitted("hubspot","Onboarding","revenue");const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:x,connection_id:E,redirect_uri:f,tenant_id:k})),window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent("oauth crm.objects.deals.read crm.objects.owners.read")}&redirect_uri=${encodeURIComponent(f)}`},onDisconnect:(r,x)=>{const E=[...o.externalConnections?.accounting??[],...o.externalConnections?.payments??[],...o.externalConnections?.revenue??[]].find((B=>B.connectionId===r))?.connectionName;let f;try{f=E!=null?Ce(E):void 0}catch{f=void 0}f!=null&&g.trackIntegrationDisconnected(f,"Onboarding",x),a(Xn(k,r,be(x)))},onNotifyMe:r=>{g.trackIntegrationsNotifyMeClicked("Onboarding",r),a(Wn(ke,r,l))},onReconnectQBO:()=>{ie.init("/onboarding/auth",e),ie.handleClick()},onRefreshClick:()=>{o.integrations.refreshQBO.fetchState!=="In-Progress"&&a(Jn())},onSaveChargeBeeCredentials:(r,x)=>{const E=o.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;E!=null&&(g.trackIntegrationCredentialsSubmitted("chargebee","Onboarding","revenue"),a(Zn(k,E,be("revenue"),Ce("chargebee"),{api_key:r,site:x})))},onSaveConnectorCredentials:r=>{g.trackIntegrationCredentialsSubmitted(r.connectionName,"Onboarding","payments"),a(Hn(k,be("payments"),r))},plaidAccounts:u,onAddPlaidAccount:c,onReLoginPlaidAccount:v,plaidConnectionDetails:n})),[O,o,C,w,p,k,l,e,a,u,c,v,n])};function tn(){const e=new URL(window.location.href);return e.searchParams.set("onboarding_step","connect_data_source"),e.toString()}function an(e,l,i){let a=`/${e}/onboarding/address`;return a=i!=null?a.concat(`/edit/${l}/${encodeURIComponent(i)}`):a.concat(`/new/${l}`),a}const on=De.div`
|
|
26
|
+
`,nn=cn((function(e,l){const{companyId:i,isAdmin:a,currentTenant:p,isOnAddressPage:u}=l,c=z.getSignedInUser(),v=p.tenantId,n={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:v??""},t=Y(e),C=Ae(e,i),o=mn(e),A=fe(p?.userRole??[])&&C.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",w=Yn(e.userRoleConfigState);return{onboardingCustomerView:C,analytics:g,isRefreshingViewInBackground:!1,isDisabled:A,companyTitles:w.companyTitles,connectedAccountProvider:t.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Tt.fileMicroServiceBaseUrl,authParams:n},signedInUser:z.getSignedInUser(),currentTenant:t,isAdmin:a,isOnAddressPage:u,cardPaymentView:o,isCardPaymentPopupOpen:!1,stripeKey:ge.stripeKey}}),(function(e,l){const{companyId:i,currentTenant:a,themeState:p,navigate:u,location:c}=l,{tenantEmailDomain:v}=a;return{onFetchLinkTokenClick:(n,t)=>{e(kt(n,t))},onEstablishConnectionClick:(n,t)=>{e(It(n,t))},onUpdatePaymentAccountStatus:(n,t,C)=>{e(St(n,t,C))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(bt(!1,n,t))},onEstablishConnectionSuccess:()=>{e(Ct(i,!0,!1))},handleOnConnectClick:()=>{g.trackOnboardingConnectQBO(),ie.handleClick()},updateQBOPopupState:n=>{e(me({isQBOPopupOpen:n}))},onCompanyOfficerUpdated:n=>{const t=n.map((C=>{const{officerType:o,userId:A,name:w,email:k,ssn:O,nationalityCountryCode:P,dob:_,phone:F,syncToken:m,selectDocument:b,role:D,ownership:U,isSelectedForVerification:h,userVerificationStatus:r,fileIds:E,isPhoneVerified:x}=C;let f;return b.selectDocumentType==="driverLicense"?f="driving_license":b.selectDocumentType==="passport"?f="passport":b.selectDocumentType==="stateId"?f="id_document":b.selectDocumentType==="ssnCard"&&(f="social_security_card"),{officerType:o,userId:A,firstName:w.firstName,lastName:w.lastName,email:k,ssn:O,nationalityCountryCode:P?.selectedOption!=null?Ze(P.selectedOption):void 0,phone:F,birthday:_!=null?Ke(_?.toString()):_,syncToken:m,titleAtCompany:D.selectedOption,ownershipInCompany:U,documentTypeSelectedForVerification:f,isSelectedForVerification:h,userVerificationStatus:r,fileIds:E,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:x}}));e(ze({officers:t}))},onGetOtp:(n,t)=>{e(yt(n,"CustomerOnboarding")),t!=null&&e(ht({officerType:t,phone:n}))},onResendOtp:n=>{e(ft(n,"CustomerOnboarding"))},onVerifyOtp:(n,t)=>{g.trackOnboardingPhoneVerified(),e(gt(n,t,"CustomerOnboarding"))},updateFilesEntity:n=>{e(mt({files:n}))},onDeleteFile:n=>{e(pt(n))},onEditFileName:(n,t)=>{e(lt(n,t.split(".")[0]))},onCompanyDetailsChanged:n=>{const{companyDescription:t,companyIndustry:C,companyIndustryType:o,companyLegalName:A,companyTaxId:w,companyWebsite:k,companyPhone:O,primaryContactEmail:P,primaryContactName:_,primaryContactUserId:F,primaryContactSyncToken:m,syncToken:b,fileIds:D,typeOfIncorporation:U,stateOfIncorporation:h,incDate:r,companySourceOfFunds:E,companySourceOfFundsDescription:x,companySubIndustry:f,countriesOfOperations:B,purposeOfAccount:N,purposeOfAccountDescription:G,regulatedStatus:R,regulatedStatusDescription:ee,transactionVolume:S,transactionVolumeDescription:V,usNexus:Z,usNexusTypes:$}=n,M={companyId:i,companyDescription:t,companyIndustry:C.selectedOption,companyIndustryType:o?.selectedOption??"",companyLegalName:A,taxIdOrEIN:w,website:k!=""&&k!=null?ut(k):void 0,phone:O,syncToken:b,fileIds:D,incDate:r!=null?Ke(r?.toString()):r,typeOfIncorporation:U?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",companySourceOfFunds:E?.selectedOption??"",companySourceOfFundsDescription:x,companySubIndustry:f?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((L=>L.length===2?L:Ze(L)))??[],purposeOfAccount:N?.selectedOption??"",purposeOfAccountDescription:G,regulatedStatus:R??"",regulatedStatusDescription:ee,transactionVolume:S?.selectedOption??"",transactionVolumeDescription:V,usNexus:Z,usNexusTypes:$?.selectedOptions??[]},ce={userId:F,firstName:_.firstName,lastName:_.lastName,email:P,syncToken:m};e(ze({companyDetails:M,primaryContactDetails:ce}))},onAddressClick:(n,t)=>{const C=an(v,n,t),o=q(c.state?.pathnameStackToGoBack,c.pathname);u(C,{state:{pathnameStackToGoBack:o}})},onRegisteredAddressClick:(n,t)=>{const C=an(v,n,t),o=q(c.state?.pathnameStackToGoBack,c.pathname);u(C,{state:{pathnameStackToGoBack:o}})},onUpdateCustomerView:(n,t,C)=>{e(dt(i,!1,t,C,n))},onAddressEditHandler:n=>{if(n!=null){const t=wn(n);e(ln({addressType:"subscription_billing_address",addressToCreate:t}))}},onSkipSetupClick:()=>{const n=q(c.state?.pathnameStackToGoBack,c.pathname);e(gn(i,!1,!1)),u("./activation",{state:{pathnameStackToGoBack:n}})},onUpdateStep:n=>{e(un({step:n}))},onUpdateSubStep:n=>{e(ct({subStep:n}))},onZeniLogoClick:()=>{p.toggle()},handleLogOutClick:()=>{const n=q(c.state?.pathnameStackToGoBack,c.pathname);u("/signout",{replace:!0,state:{pathnameStackToGoBack:n,message:"logout"}})},handleCockpitClick:()=>{g.trackOnboardingFlowExited("cockpit"),window.open("/cockpit")},handleReferralsClick:()=>{u(`/${v}/rewards`)},handleCreateCardSetupIntent:n=>{e(dn(n))},handleConfirmCardSetupIntent:n=>{e(it(n))},updateCardPaymentModalState:n=>{e(me({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,C)=>{e(rt(n,t,C))},handleFetchPaymentSources:()=>{e(Oe())},resetCardPaymentViewState:()=>{e(st())},handleResetCardPaymentErrorStatuses:()=>{e(ot())},redirectToProductSuitePage:()=>{g.trackOnboardingFlowExited("product_suite");const n=q(c.state?.pathnameStackToGoBack,c.pathname);u(`/${v}/onboarding/thankyou`,{state:{pathnameStackToGoBack:n,message:"OnboardingThankyou"},replace:!0})},onAcknowledgeAiFinanceTeam:()=>{i!=null&&(g.trackOnboardingAiFinanceTeamAcknowledged(),e(at(i)))},onIdentityDocumentUploadedForAutofill:n=>{if(i==null)return;const t=nt(n.documentType);t!=null&&(g.trackOnboardingDocumentUploaded("kyc",t),e(tt({target:"onboarding",companyId:i,officerType:n.officerType,fileId:n.fileId,documentType:t})))},onCompanyDocumentUploadedForAutofill:n=>{i!=null&&(g.trackOnboardingDocumentUploaded("kyb",n.documentType),e(et({target:"onboarding",companyId:i,fileId:n.fileId,documentType:n.documentType})))}}}))(xt),le=({taxCFOCustomer:e=!1,isOnAddressPage:l=!1,appContent:i})=>{const a=fn(),p=_e(),u=Ee(),c=se(),v=Et(),n=yn(),[t,C]=d.useState(!1),[o,A]=d.useState(!1),[w,k]=d.useState(!1),{tenantEmailDomain:O}=xe(),P=hn(),{useFeatureGate:_}=Pe(),{isFeatureEnabled:F}=_(W.isDebitCardFeatureEnabled),m=Pn("/:tenantEmailDomain/onboarding")!==null&&u.search?.includes("code"),b=T((y=>y.onboardingCustomerViewState.fetchState)),D=T((y=>y.onboardingCustomerViewState.currentStep)),U=T((y=>y.onboardingCustomerViewState.uiState)),h=T((y=>Y(y))),r=T((y=>y.userRoleConfigState.fetchState)),E=T((y=>y.cardPaymentViewState)),x=X(E.addCardPaymentSourceStatus.fetchState),f=E.addCardPaymentSourceStatus.fetchState,{code:B,realmId:N,state:G}=Pt(u.search),R=h.externalConnections?.accounting[0],ee=R?.connectionType,S=R?.connectionName,V=R?.connectionId??"",Z=z.getSignedInUser()?.userId??"",$=d.useRef({realmId:"",connectionId:""});d.useEffect((()=>{o||(A(!0),c(Oe()))}),[o,c]),d.useEffect((()=>{w||(dn(["card"]),k(!0))}),[w]),d.useEffect((()=>{x==="In-Progress"&&f==="Completed"&&c(Oe())}),[x,f]),d.useEffect((()=>{Dt(B,N,G,V,Z)===!0&&h.externalConnections?.saveConnectionState!=="In-Progress"&&b==="Completed"&&(c(Gn(h.tenantId,{connection_type:ee??"accounting",connection_name:S??"quickbooks_online",authorization_code:B,realm_id:N,connection_id:V,user_id:Z},$n(window.location.origin+"/onboarding/auth"))),$.current={realmId:N,connectionId:V},g.trackOnboardingSaveQBOConnection(N,V),p(u.pathname))}),[B,N,G,u.pathname,b]),d.useEffect((()=>{ie.isInitiated===!1&&b==="Completed"&&ie.init("/onboarding/auth",h.tenantEmailDomain)}),[b]);const M=h.companyId??z.getSignedInUserTenant(O)?.companyId,ce=fe(h?.userRole??[]),L=T((y=>Ae(y,M)));d.useEffect((()=>{t||b!=="Not-Started"||M==null||(C(!0),c(Mn(M,!0,!m)))}),[t,b,M]);const ne=h.externalConnections?.saveConnectionState,Be=X(ne);d.useEffect((()=>{Be==="In-Progress"&&(ne==="Completed"||ne==="Error")&&U.isQBOPopupOpen&&D==="connect_ledger"&&(ne==="Completed"?g.trackOnboardingQBOConnectionSuccess($.current.realmId,$.current.connectionId):g.trackOnboardingQBOConnectionFailed($.current.realmId,$.current.connectionId,h.externalConnections?.saveOAuthConnectionError?.message??""),c(me({isQBOPopupOpen:!1})))}),[ne,Be,U.isQBOPopupOpen,D,g,c]),d.useEffect((()=>{b==="Completed"&&m&&(c(un({step:"connect_ledger"})),c(me({isQBOPopupOpen:!0})))}),[m,b]),d.useEffect((()=>{r==="Not-Started"&&c(Qn(!0))}),[r,c]);const Cn=X(L.companyDetailsLocalData?.addressStatus);d.useEffect((()=>{L.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&L.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Cn==null&&c(ln({addressType:"company_registered_address",addressToCreate:L.companyDetailsLocalData?.addressStatus?.addressToCreate}))}),[L.companyDetailsLocalData?.addressStatus?.addressToCreate,L.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const bn=L.isInterimEmailSent,je=z.getSignedInUser();if(je==null)throw Error("Can't access onboarding flow without signing in...");const Sn=Te(F,h),In=we(h),Fe=h.company?.companyOnboardingInfo.isOnboardingCompleted,Ve=y=>y.trackPageLoaded(ve.Event.onboardingPage),ye=h.productSettings.isOtherProductsEnabled,kn=ye===!0&&!pn(h),On=h.productSettings.isTreasuryEnabled,Ue=Ut({tenantEmailDomain:O??"",signedInUserEmail:je.userEmail??"",companyId:M}),Le=(({companyId:y})=>{const K=se(),de=T((j=>j.onboardingCustomerViewState?.aiAgentsActivation)),te=T((j=>Y(j).company?.companyOnboardingInfo?.onboardingInfo?.onboardingAiActivationInfo?.isOnboardingAiActivationViewed??!1)),he=d.useCallback((()=>{K(Un())}),[K]);d.useEffect((()=>{he()}),[he]);const Re=d.useCallback((()=>{y==null||y===""||te||K(Ln(y))}),[y,te,K]),vn=d.useMemo((()=>{if(y==null||y==="")return[];const j=`private-encrypted-${y}`;return[`${j}.ledger-ingestion.counts-updated`,`${j}.ai-agents-activation.phase-changed`]}),[y]),_n=d.useCallback(((j,ae)=>{if(ae==null||typeof ae!="object")return;const I=ae;if(j!=="ledger-ingestion.counts-updated"){if(j==="ai-agents-activation.phase-changed"){const ue=typeof I.phase_key=="string"?I.phase_key:typeof I.key=="string"?I.key:"",J=typeof I.status=="string"?I.status:"idle";if(ue==="")return;K(Nn({key:ue,status:J==="starting"||J==="building"||J==="ready"?J:"idle",startedAt:typeof I.started_at=="string"?I.started_at:void 0,completedAt:typeof I.completed_at=="string"?I.completed_at:void 0}))}}else K(Rn({customerCount:typeof I.customer_count=="number"?I.customer_count:void 0,glAccountCount:typeof I.gl_account_count=="number"?I.gl_account_count:void 0,targetTransactionCount:typeof I.target_transaction_count=="number"?I.target_transaction_count:void 0,transactionCount:typeof I.transaction_count=="number"?I.transaction_count:void 0,vendorCount:typeof I.vendor_count=="number"?I.vendor_count:void 0}))}),[K]);return Ft({events:vn,onEvent:_n,onSubscribed:he}),d.useMemo((()=>{const j=de?.phases??[],ae=We(j,Se),I=We(j,Ie),ue=Xe(j,Se),J=Xe(j,Ie),Ne=j.some((Tn=>Tn.status!=="idle")),oe=!te&&!Ne,Ge=te&&!Ne,En=Ge?Se.map((()=>"building")):ae,xn=Ge?Ie.map((()=>"building")):I;return{ledgerRowStatuses:oe?void 0:En,backgroundRowStatuses:oe?void 0:xn,showLedgerReadyInLabel:oe?void 0:ue,showBackgroundReadyInLabel:oe?void 0:J,forceContinueEnabled:!oe||void 0,counts:de?.counts,onContinueClicked:Re}}),[de?.phases,de?.counts,te,Re])})({companyId:M});if(Fe===!0){if(!ye)return On?s.jsx(Q,{to:"../../treasury"}):Sn?s.jsx(Q,{to:"../../checking"}):In?s.jsx(Q,{to:"../../cards"}):s.jsx(Q,{to:"../../dashboard"});const y=L.updateStatus.fetchState==="In-Progress";if(ye&&!y)return e?s.jsxs(Ye,{children:[s.jsx(re,{analytics:g,onLoad:K=>Ve(K)}),s.jsx(nn,{navigate:p,location:u,companyId:M,currentTenant:h,isAdmin:ce,isOnAddressPage:l,themeState:n,googleAPIKey:ge.googleMapsAPIKey,integrationsSectionProps:Ue,aiAgentsActivationProps:Le,meetingUrl:a("onboarding_overview")}),i!=null?s.jsx(en,{windowSize:v,skipLegacyDrawerOffset:l&&h.productSettings.isOtherProductsEnabled!==!0,children:i}):null]}):s.jsx(Q,{to:"../../onboarding/thankyou"})}else if(Fe===!1&&P?.loggedInUserRoleMap!=null)return bn===!0&&kn?s.jsx(Q,{to:"../../onboarding/thankyou"}):s.jsxs(Ye,{children:[s.jsx(re,{analytics:g,onLoad:y=>Ve(y)}),s.jsx(nn,{navigate:p,location:u,companyId:M,currentTenant:h,isAdmin:ce,isOnAddressPage:l,themeState:n,googleAPIKey:ge.googleMapsAPIKey,integrationsSectionProps:Ue,aiAgentsActivationProps:Le,meetingUrl:a("onboarding_overview")}),i!=null?s.jsx(en,{windowSize:v,skipLegacyDrawerOffset:l&&h.productSettings.isOtherProductsEnabled!==!0,children:i}):null]});return null},ke="external_integrations",Ut=({tenantEmailDomain:e,signedInUserEmail:l,companyId:i})=>{const a=se(),{pendingAutoFocusTabId:p}=Bt(),{plaidAccounts:u,onAddPlaidAccount:c,onReLoginPlaidAccount:v}=jt({companyId:i}),n=T((r=>r.plaidAccountViewState.external_account.plaidConnectionDetails)),t=T((r=>Y(r))),C=T((r=>r.tenantState.fetchState)),o=T((r=>Kn(r,i))),A=T((r=>zn(r,ke))),w=d.useMemo((()=>new Set(A.map((r=>r.additionalInfo)).filter((r=>r!=null)))),[A]),k=t.tenantId,O=fe(t.userRole??[]);d.useEffect((()=>{a(qn(ke))}),[a]);const P=o.externalConnections?.saveAPIKeyConnectionState,_=o.externalConnections?.saveAPIKeyConnectionError?.message,F=X(P);d.useEffect((()=>{F==="In-Progress"&&(P==="Completed"?g.trackIntegrationConnected("chargebee","Onboarding","revenue"):P==="Error"&&g.trackIntegrationConnectFailed("chargebee","Onboarding","revenue",_??""))}),[P,F,_]);const m=o.externalConnections?.saveOAuthConnectionState,b=o.externalConnections?.saveOAuthConnectionError?.message,D=X(m);d.useEffect((()=>{D==="In-Progress"&&(m==="Completed"?g.trackIntegrationConnected("hubspot","Onboarding","revenue"):m==="Error"&&g.trackIntegrationConnectFailed("hubspot","Onboarding","revenue",b??""))}),[m,D,b]);const U=o.externalConnections?.saveConnectorCredentialsStateBySlug,h=X(U);return d.useEffect((()=>{const r=U??{},E=h??{},x=o.externalConnections?.saveConnectorCredentialsErrorBySlug??{};Object.keys(r).forEach((f=>{if(E[f]!=="In-Progress")return;let B;try{B=Ce(f)}catch{return}r[f]==="Completed"?g.trackIntegrationConnected(B,"Onboarding","payments"):r[f]==="Error"&&g.trackIntegrationConnectFailed(B,"Onboarding","payments",x[f]?.message??"")}))}),[U,h,o]),d.useMemo((()=>({isAdmin:O,analytics:g,referrer:"Onboarding",integrationsView:o,isLoading:C==="In-Progress",notifyMeRegisteredSlugs:w,autoFocusTabId:p??void 0,saveChargeBeeState:o.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:o.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:o.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:o.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:o.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(o.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([r,E])=>[r,E?.message]))),deleteConnectionState:o.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:o.externalConnections?.deleteConnectionError?.message,onConnectGmail:()=>{g.trackIntegrationConnectClicked("gmail","Onboarding","email"),a(Qe(k,"gmail",tn()))},onConnectOutlook:()=>{g.trackIntegrationConnectClicked("outlook","Onboarding","email"),a(Qe(k,"outlook",tn()))},onConnectHubSpot:(r,E)=>{const x=o.externalConnections?.revenue?.find((B=>B.connectionName==="hubspot"))?.connectionId;if(x==null)return;g.trackIntegrationCredentialsSubmitted("hubspot","Onboarding","revenue");const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:E,connection_id:x,redirect_uri:f,tenant_id:k})),window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent("oauth crm.objects.deals.read crm.objects.owners.read")}&redirect_uri=${encodeURIComponent(f)}`},onDisconnect:(r,E)=>{const x=[...o.externalConnections?.accounting??[],...o.externalConnections?.payments??[],...o.externalConnections?.revenue??[]].find((B=>B.connectionId===r))?.connectionName;let f;try{f=x!=null?Ce(x):void 0}catch{f=void 0}f!=null&&g.trackIntegrationDisconnected(f,"Onboarding",E),a(Xn(k,r,be(E)))},onNotifyMe:r=>{g.trackIntegrationsNotifyMeClicked("Onboarding",r),a(Wn(ke,r,l))},onReconnectQBO:()=>{ie.init("/onboarding/auth",e),ie.handleClick()},onRefreshClick:()=>{o.integrations.refreshQBO.fetchState!=="In-Progress"&&a(Jn())},onSaveChargeBeeCredentials:(r,E)=>{const x=o.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;x!=null&&(g.trackIntegrationCredentialsSubmitted("chargebee","Onboarding","revenue"),a(Zn(k,x,be("revenue"),Ce("chargebee"),{api_key:r,site:E})))},onSaveConnectorCredentials:r=>{g.trackIntegrationCredentialsSubmitted(r.connectionName,"Onboarding","payments"),a(Hn(k,be("payments"),r))},plaidAccounts:u,onAddPlaidAccount:c,onReLoginPlaidAccount:v,plaidConnectionDetails:n})),[O,o,C,w,p,k,l,e,a,u,c,v,n])};function tn(){const e=new URL(window.location.href);return e.searchParams.set("onboarding_step","connect_data_source"),e.toString()}function an(e,l,i){let a=`/${e}/onboarding/address`;return a=i!=null?a.concat(`/edit/${l}/${encodeURIComponent(i)}`):a.concat(`/new/${l}`),a}const on=De.div`
|
|
27
27
|
display: flex;
|
|
28
28
|
height: 100vh;
|
|
29
29
|
background-color: ${e=>e.theme.colors.grey4};
|
|
30
|
-
`,sn=cn((function(e,l){const{companyId:i,currentTenant:a}=l,p=Ae(e,i),u=mn(e);return{hasVerifiedBankAccount:(p.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(u.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:fe(a?.userRole??[])&&p.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:z.getSignedInUser(),currentTenant:a}}),(function(e,l){const{currentTenant:i,themeState:a,navigate:p,location:u}=l,{tenantEmailDomain:c}=i;return{onZeniLogoClick:()=>{a.toggle()},handleLogOutClick:()=>{const v=q(u.state?.pathnameStackToGoBack,u.pathname);p("/signout",{replace:!0,state:{pathnameStackToGoBack:v,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{p(`/${c}/rewards`)},handleUpdatePaymentAddressDetailClick:()=>{const v=q(u.state?.pathnameStackToGoBack,u.pathname);p(`/${c}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:v,message:"UpdatePaymentAddressDetail"}})}}}))(At),Lt=()=>{const e=fn(),l=_e(),i=se(),a=
|
|
30
|
+
`,sn=cn((function(e,l){const{companyId:i,currentTenant:a}=l,p=Ae(e,i),u=mn(e);return{hasVerifiedBankAccount:(p.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(u.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:fe(a?.userRole??[])&&p.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:z.getSignedInUser(),currentTenant:a}}),(function(e,l){const{currentTenant:i,themeState:a,navigate:p,location:u}=l,{tenantEmailDomain:c}=i;return{onZeniLogoClick:()=>{a.toggle()},handleLogOutClick:()=>{const v=q(u.state?.pathnameStackToGoBack,u.pathname);p("/signout",{replace:!0,state:{pathnameStackToGoBack:v,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleReferralsClick:()=>{p(`/${c}/rewards`)},handleUpdatePaymentAddressDetailClick:()=>{const v=q(u.state?.pathnameStackToGoBack,u.pathname);p(`/${c}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:v,message:"UpdatePaymentAddressDetail"}})}}}))(At),Lt=()=>{const e=fn(),l=_e(),i=se(),a=Ee(),p=yn(),{useFeatureGate:u}=Pe(),{isFeatureEnabled:c}=u(W.isDebitCardFeatureEnabled),{tenantEmailDomain:v}=xe(),n=hn(),[t,C]=d.useState(!1);d.useEffect((()=>{t===!1&&a.state?.message==="OnboardingThankyou"&&C(!0)}),[a.state]);const o=T((m=>Y(m))),A=o.productSettings.isOtherProductsEnabled,w=A===!0&&!pn(o);d.useEffect((()=>{i(gn(k,!1,!w))}),[]);const k=o.companyId??z.getSignedInUserTenant(v)?.companyId;if(n.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const O=Te(c,o),P=we(o),_=T((m=>m.onboardingCustomerViewState.updateStatus.fetchState)),F=o.company?.companyOnboardingInfo.isOnboardingCompleted;if(F!==!0||w)return _==="Completed"&&F===!0&&w&&n?.loggedInUserRoleMap!=null?s.jsxs(on,{children:[s.jsx(re,{analytics:g,onLoad:m=>{m.trackPageLoaded(ve.Event.onboardingLandingPage,"Onboarding",Ot(o.productSettings))}}),s.jsx(sn,{navigate:l,showUpdatePaymentDetailButton:A,location:a,companyId:k,currentTenant:o,themeState:p,isVisitingFirstTime:t,meetingUrl:e("onboarding_overview")})]}):_==="Completed"&&F===!1&&n?.loggedInUserRoleMap!=null?s.jsxs(on,{children:[s.jsx(re,{analytics:g,onLoad:m=>{m.trackPageLoaded(ve.Event.onboardingInterimPage)}}),s.jsx(sn,{navigate:l,showUpdatePaymentDetailButton:A,location:a,companyId:k,currentTenant:o,themeState:p,isVisitingFirstTime:t,meetingUrl:e("onboarding_overview")})]}):s.jsx(wt,{});{const m={pathnameStackToGoBack:a.state?.pathnameStackToGoBack,message:"activation"};return O?s.jsx(Q,{to:"../../checking",state:m,replace:!0}):P?s.jsx(Q,{to:"../../cards",state:m,replace:!0}):s.jsx(Q,{to:"../../dashboard",state:m,replace:!0})}};function rn(){return typeof Me=="function"?Me():void 0}let pe=0;function Rt(){d.useEffect((()=>{if(!ge.sentryDsn?.trim())return;let e,l=!1,i=0;const a=()=>{e!==void 0&&(clearInterval(e),e=void 0)},p=()=>{const u=rn();return u!==void 0&&(u.flush(),!0)};return pe+=1,p()||(e=setInterval((()=>{i+=1,(l||p()||i>=10)&&a()}),1e3)),()=>{l=!0,a(),pe-=1,queueMicrotask((()=>{pe===0&&(function(){const u=rn();if(u===void 0)return;const c=()=>{if(pe===0)try{u.startBuffering()}catch{}};u.stop().then(c,c)})()}))}}),[])}function pa(){return Rt(),s.jsxs(Dn,{children:[s.jsx(H,{path:"/",element:s.jsx(le,{})}),s.jsx(H,{path:"/billing/edit",element:s.jsx(le,{taxCFOCustomer:!0})}),s.jsx(H,{path:"/thankyou",element:s.jsx(Lt,{})}),s.jsx(H,{path:"/activation",element:s.jsx(Vt,{})}),s.jsx(H,{path:"/address/edit/:addressType/:addressId",element:s.jsx(le,{isOnAddressPage:!0,appContent:s.jsx($e,{})})}),s.jsx(H,{path:"/address/new/:addressType",element:s.jsx(le,{isOnAddressPage:!0,appContent:s.jsx($e,{})})}),s.jsx(H,{path:"*",element:s.jsx(An,{})})]})}export{pa as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-DKqwsBQp.js";import{i as q,j as _,g as Z,u as z,h as J,l as ne,k as oa,n as ft,o as F,N as yn}from"./core-D6EV-11Y.js";import{fF as L,VH as Ze,bE as sa,br as Ee,X2 as An,ka as vn,X3 as Xt,X4 as In,kd as gt,X5 as Qe,X6 as En,ki as Tn,X7 as Yt,X8 as xn,km as bt,X9 as He,Xa as Dn,Xb as wn,V$ as Pn,lo as On,Xc as Fn,bn as Je,Xd as ra,WF as ue,bc as ia,lC as ca,ll as la,WH as me,WG as ae,fE as da,ga as jn,gq as Ct,Xe as Rn,Xf as Bn,Xg as ua,Xh as Oe,DR as Me,DS as Ue,Ee as Te,E8 as pe,DW as Le,Xi as Mn,b$ as Ve,Xj as Un,Xk as Ln,Xl as ma,Xm as Fe,Xn as Vn,ei as et,A2 as pa,Xo as Xn,Xp as ha,Xq as Yn,Xr as Gn,Xs as Nn,Xt as St,UD as kt,u6 as xe,l$ as De,Eo as yt,A9 as $n,Ag as zn,Xu as Kn,Xv as qn,DT as Gt,Xw as Qn,A5 as ve,A0 as fa,Xx as be,Xy as Nt,Xz as Hn,XA as At,UC as vt,Cd as ga,XB as Wn,XC as ba,XD as Zn,XE as Jn,XF as eo,XG as It,Cs as to,Cz as ao,XH as no,XI as oo,DV as $t,XJ as so,Cb as Ca,XK as Ce,XL as zt,XM as ro,bq as _a,Et as Sa,XN as io,XO as ka,XP as co,XQ as lo,XR as uo,XS as Et,El as mo,En as po,XT as ho,XU as fo,DU as Kt,XV as go,Er as ya,XW as _e,XX as qt,XY as bo,XZ as Co,X_ as Aa,lQ as va,pX as Ia,lV as Ea,pV as Ta,pU as xa,pT as Da,BA as _o,dc as So,pQ as ko,T_ as yo,q5 as Ao,X$ as vo,Y0 as Io,Y1 as Eo,b5 as Tt,p$ as To,ic as xo,gI as Do,p_ as wo,le as Po,pY as Oo,pW as Fo,d_ as jo,dZ as Ro}from"./zeni-epic-state-CZbm731W.js";import{z as V,av as oe,p as j,l as T,G as Q,bb as Bo,as as Xe,a8 as Ye,bc as wa,T as N,bd as Mo,be as Pa,E as Uo,bf as Lo,bg as Vo,a as Oa,a1 as Fa,f as ja,ar as Xo,bh as Yo,ao as Go,N as we,bi as Ra,y as ce,bj as Ba,bk as Ma,au as Ua,bl as No,ai as Ge,U as Ne,d as X,bm as $o,g as zo,k as Ko,a4 as qo,aq as Qo,bn as Ho,bo as Wo,bp as Zo,bq as Ie}from"./index-DvW7BRlL.js";import{n as xt}from"./mui-qouWiIWk.js";import{a as b}from"./sentry-CxSdF_rC.js";import{w as La}from"./withTransactionSidePanel-CPG02lKM.js";import{c as Va,t as Pe,f as he,b as Dt,a as wt,v as Jo}from"./routePaths-GYFjoelZ.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-DV4bjx-y.js";import Be from"./NotFoundScreen-sryCVGSu.js";import{u as Pt}from"./useInitialThreadRequest-BwX5Js6P.js";import{t as Xa}from"./analyticsHelper-DcvdGte-.js";import{C as es}from"./CompanyPassportScreen-CEuR94fF.js";import{u as ts}from"./useAiCfoDashboardSuggestedQuestionsChips-D_Ro-9Tt.js";import{F as as}from"./FeaturePreviewScreen-LeLfD5pA.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./TransactionDetailScreen-CjwF3ORf.js";import"./decodeURIComponentSafe-MQV5aj_5.js";import"./expenseAutomationHelper-DEOPVtcg.js";import"./stripSplatSuffix-CYVrHv_0.js";import"./MobileAppDrawer-DExJFFmi.js";import"./InboxNotificationsProvider-gj6fT2eX.js";import"./useTaskManagerAccess-daSMnBbA.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]="22582b0d-f1a3-475e-8203-e8304bef176a",e._sentryDebugIdIdentifier="sentry-dbid-22582b0d-f1a3-475e-8203-e8304bef176a")}catch{}})();const ns=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((E=>E.tenantState.currentTenantId)),l=_((E=>L(E))),{tenantEmailDomain:m}=q(),p=Z(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=z(),g=J(),k=_((E=>An(E,u,o))),I=b.useCallback((()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&C(vn(o,u))}),[u]),A=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),S=b.useCallback(((E,B)=>{C(Xt({sortKey:E,sortOrder:B}))}),[]),x=b.useCallback((E=>{C(Xt({downloadState:E}))}),[]),P=b.useCallback((E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const B=Va({id:E.transactionId,type:E.transactionType},m);g(B);const y=j(p.state?.pathnameStackToGoBack,p.pathname);g(B,{state:{pathnameStackToGoBack:y}})}}),[m,e]),D=b.useCallback((()=>{k.vendor!=null&&T.trackApAgingDetail("AP Aging",u.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)}),[k.vendor,u]);return b.useEffect((()=>{I()}),[]),b.useEffect((()=>{k.fetchState==="Completed"&&D()}),[D,k.fetchState]),d.jsx(Bo,{apAgingDetail:k,downloadParams:c,reportDate:u,analytics:T,onTransactionClick:P,onReload:I,onBackClick:A,onColumnSortConfigChanged:S,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),os=()=>{const e=z(),a=J(),t=_((S=>In(S))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((S=>S.tenantState.currentTenantId)),i=_((S=>L(S))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((S=>{e(Qe({searchString:S}))}),[]),C=b.useCallback(((S,x)=>{e(Qe({sortKey:x,sortOrder:S}))}),[]),g=b.useCallback((S=>{a(`./${S}/${h.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),k=b.useCallback((S=>{e(Qe({downloadState:S}))}),[]),I=b.useCallback(((S,x)=>{}),[]),A=b.useCallback(((S,x)=>{e(Qe({selectedDate:S,agingDateSelectionType:x})),e(gt(S))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(wa,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:T,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:k,onSelectedDateChanged:A,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ss=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((D=>L(D))),{tenantEmailDomain:l}=q(),m=Z(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=z(),C=J(),g=_((D=>En(D,c,o))),k=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Tn(o,c))}),[c]),I=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),A=b.useCallback(((D,E)=>{u(Yt({sortKey:D,sortOrder:E}))}),[]),S=b.useCallback((D=>{u(Yt({downloadState:D}))}),[]),x=b.useCallback((D=>{if(e)e(D.transactionId,D.transactionType);else if(l!=null){const E=Va({id:D.transactionId,type:D.transactionType},l);C(E);const B=j(m.state?.pathnameStackToGoBack,m.pathname);C(E,{state:{pathnameStackToGoBack:B}})}}),[l,e]),P=b.useCallback((()=>{g.customer!=null&&T.trackArAgingDetail("AR Aging",c.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{k()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&P()}),[g.fetchState,P]),d.jsx(Mo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:T,onTransactionClick:x,onReload:k,onBackClick:I,onColumnSortConfigChanged:A,updateDownloadStateHandler:S,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),rs=()=>{const e=z(),a=J(),t=_((A=>xn(A))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((A=>L(A))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((A=>{e(He({searchString:A}))}),[]),u=b.useCallback(((A,S)=>{e(He({sortKey:S,sortOrder:A}))}),[]),C=b.useCallback((A=>{a(`./${A}/${p.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((A=>{e(He({downloadState:A}))}),[]),k=b.useCallback(((A,S)=>{e(He({selectedDate:A,agingDateSelectionType:S})),e(bt(A))}),[]),I=b.useCallback(((A,S)=>{e(Dn({nodeId:A,isCollapsed:S}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:A=>A.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(wa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ya=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ga(e,a){const t=Pn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(On(n,o))}}}const is=ne((function(e){const a=wn(e).accountsInOrder.map(((t,n)=>Ya(t,n)));return{sectionTitle:Q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:T}}),Ga)(Pa),cs=ne((function(e){const a=Fn(e).accountsInOrder.map(((o,r)=>Ya(o,r))),t=V.getSignedInUser(),n=Je(t);return{sectionTitle:Q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}}),Ga)(Pa);function ls(){const e=J(),a=Z(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(is,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function ds(){const e=J(),a=Z(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(cs,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const us=xt.div`
|
|
1
|
+
import{j as d}from"./liveblocks-UOzcPsHa.js";import{i as q,j as _,g as Z,u as z,h as J,l as ne,k as oa,n as ft,o as F,N as yn}from"./core-B5mDy9pu.js";import{fF as L,VH as Ze,bE as sa,br as Ee,X2 as An,ka as vn,X3 as Xt,X4 as In,kd as gt,X5 as Qe,X6 as En,ki as Tn,X7 as Yt,X8 as xn,km as bt,X9 as He,Xa as Dn,Xb as wn,V$ as Pn,lo as On,Xc as Fn,bn as Je,Xd as ra,WF as ue,bc as ia,lC as ca,ll as la,WH as me,WG as ae,fE as da,ga as jn,gq as Ct,Xe as Rn,Xf as Bn,Xg as ua,Xh as Oe,DR as Me,DS as Ue,Ee as Te,E8 as pe,DW as Le,Xi as Mn,b$ as Ve,Xj as Un,Xk as Ln,Xl as ma,Xm as Fe,Xn as Vn,ei as et,A2 as pa,Xo as Xn,Xp as ha,Xq as Yn,Xr as Gn,Xs as Nn,Xt as St,UD as kt,u6 as xe,l$ as De,Eo as yt,A9 as $n,Ag as zn,Xu as Kn,Xv as qn,DT as Gt,Xw as Qn,A5 as ve,A0 as fa,Xx as be,Xy as Nt,Xz as Hn,XA as At,UC as vt,Cd as ga,XB as Wn,XC as ba,XD as Zn,XE as Jn,XF as eo,XG as It,Cs as to,Cz as ao,XH as no,XI as oo,DV as $t,XJ as so,Cb as Ca,XK as Ce,XL as zt,XM as ro,bq as _a,Et as Sa,XN as io,XO as ka,XP as co,XQ as lo,XR as uo,XS as Et,El as mo,En as po,XT as ho,XU as fo,DU as Kt,XV as go,Er as ya,XW as _e,XX as qt,XY as bo,XZ as Co,X_ as Aa,lQ as va,pX as Ia,lV as Ea,pV as Ta,pU as xa,pT as Da,BA as _o,dc as So,pQ as ko,T_ as yo,q5 as Ao,X$ as vo,Y0 as Io,Y1 as Eo,b5 as Tt,p$ as To,ic as xo,gI as Do,p_ as wo,le as Po,pY as Oo,pW as Fo,d_ as jo,dZ as Ro}from"./zeni-epic-state-7eY0g-Bc.js";import{z as V,av as oe,p as j,j as T,G as Q,bb as Bo,as as Xe,a8 as Ye,bc as wa,S as N,bd as Mo,be as Pa,E as Uo,bf as Lo,bg as Vo,a as Oa,a1 as Fa,e as ja,ar as Xo,bh as Yo,ao as Go,N as we,bi as Ra,x as ce,bj as Ba,bk as Ma,au as Ua,bl as No,ai as Ge,U as Ne,c as X,bm as $o,q as zo,h as Ko,a4 as qo,aq as Qo,bn as Ho,bo as Wo,bp as Zo,bq as Ie}from"./index-CrBk11WI.js";import{n as xt}from"./mui-Do6nLzGb.js";import{a as b}from"./sentry-DHDsO12F.js";import{w as La}from"./withTransactionSidePanel-Co9xwJi4.js";import{c as Va,t as Pe,f as he,b as Dt,a as wt,v as Jo}from"./routePaths-CeCPwkIf.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-BamKKcjy.js";import Be from"./NotFoundScreen-MJal1hew.js";import{u as Pt}from"./useInitialThreadRequest-Bwvu8W79.js";import{t as Xa}from"./analyticsHelper-H1Xp9Uyk.js";import{C as es}from"./CompanyPassportScreen-D3aXSi-v.js";import{u as ts}from"./useAiCfoDashboardSuggestedQuestionsChips-CSs_vZyp.js";import{F as as}from"./FeaturePreviewScreen-B5Hq_fA2.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";import"./TransactionDetailScreen-CcO0FUjf.js";import"./decodeURIComponentSafe-DANuhXnG.js";import"./expenseAutomationHelper-DBDpSggk.js";import"./stripSplatSuffix-CQQXAy0N.js";import"./MobileAppDrawer-CjKRvtSN.js";import"./InboxNotificationsProvider-BmF5-_KA.js";import"./useTaskManagerAccess-CdPkYUw1.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]="7167053a-ef5f-44b9-b986-ca78fcdff90a",e._sentryDebugIdIdentifier="sentry-dbid-7167053a-ef5f-44b9-b986-ca78fcdff90a")}catch{}})();const ns=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((E=>E.tenantState.currentTenantId)),l=_((E=>L(E))),{tenantEmailDomain:m}=q(),p=Z(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=z(),g=J(),k=_((E=>An(E,u,o))),I=b.useCallback((()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&C(vn(o,u))}),[u]),A=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),S=b.useCallback(((E,B)=>{C(Xt({sortKey:E,sortOrder:B}))}),[]),x=b.useCallback((E=>{C(Xt({downloadState:E}))}),[]),P=b.useCallback((E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const B=Va({id:E.transactionId,type:E.transactionType},m);g(B);const y=j(p.state?.pathnameStackToGoBack,p.pathname);g(B,{state:{pathnameStackToGoBack:y}})}}),[m,e]),D=b.useCallback((()=>{k.vendor!=null&&T.trackApAgingDetail("AP Aging",u.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)}),[k.vendor,u]);return b.useEffect((()=>{I()}),[]),b.useEffect((()=>{k.fetchState==="Completed"&&D()}),[D,k.fetchState]),d.jsx(Bo,{apAgingDetail:k,downloadParams:c,reportDate:u,analytics:T,onTransactionClick:P,onReload:I,onBackClick:A,onColumnSortConfigChanged:S,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),os=()=>{const e=z(),a=J(),t=_((S=>In(S))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((S=>S.tenantState.currentTenantId)),i=_((S=>L(S))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((S=>{e(Qe({searchString:S}))}),[]),C=b.useCallback(((S,x)=>{e(Qe({sortKey:x,sortOrder:S}))}),[]),g=b.useCallback((S=>{a(`./${S}/${h.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),k=b.useCallback((S=>{e(Qe({downloadState:S}))}),[]),I=b.useCallback(((S,x)=>{}),[]),A=b.useCallback(((S,x)=>{e(Qe({selectedDate:S,agingDateSelectionType:x})),e(gt(S))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(wa,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:T,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:k,onSelectedDateChanged:A,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ss=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((D=>L(D))),{tenantEmailDomain:l}=q(),m=Z(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=z(),C=J(),g=_((D=>En(D,c,o))),k=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Tn(o,c))}),[c]),I=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),A=b.useCallback(((D,E)=>{u(Yt({sortKey:D,sortOrder:E}))}),[]),S=b.useCallback((D=>{u(Yt({downloadState:D}))}),[]),x=b.useCallback((D=>{if(e)e(D.transactionId,D.transactionType);else if(l!=null){const E=Va({id:D.transactionId,type:D.transactionType},l);C(E);const B=j(m.state?.pathnameStackToGoBack,m.pathname);C(E,{state:{pathnameStackToGoBack:B}})}}),[l,e]),P=b.useCallback((()=>{g.customer!=null&&T.trackArAgingDetail("AR Aging",c.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{k()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&P()}),[g.fetchState,P]),d.jsx(Mo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:T,onTransactionClick:x,onReload:k,onBackClick:I,onColumnSortConfigChanged:A,updateDownloadStateHandler:S,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),rs=()=>{const e=z(),a=J(),t=_((A=>xn(A))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((A=>L(A))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((A=>{e(He({searchString:A}))}),[]),u=b.useCallback(((A,S)=>{e(He({sortKey:S,sortOrder:A}))}),[]),C=b.useCallback((A=>{a(`./${A}/${p.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((A=>{e(He({downloadState:A}))}),[]),k=b.useCallback(((A,S)=>{e(He({selectedDate:A,agingDateSelectionType:S})),e(bt(A))}),[]),I=b.useCallback(((A,S)=>{e(Dn({nodeId:A,isCollapsed:S}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:A=>A.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(wa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ya=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ga(e,a){const t=Pn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(On(n,o))}}}const is=ne((function(e){const a=wn(e).accountsInOrder.map(((t,n)=>Ya(t,n)));return{sectionTitle:Q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:T}}),Ga)(Pa),cs=ne((function(e){const a=Fn(e).accountsInOrder.map(((o,r)=>Ya(o,r))),t=V.getSignedInUser(),n=Je(t);return{sectionTitle:Q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}}),Ga)(Pa);function ls(){const e=J(),a=Z(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(is,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function ds(){const e=J(),a=Z(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(cs,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const us=xt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-UOzcPsHa.js";import{a as u}from"./sentry-DHDsO12F.js";import{u as y,j as p,l as w,g as A,N as L}from"./core-B5mDy9pu.js";import{TJ as N,fF as _,gl as U,TK as k,pS as R,TL as z}from"./zeni-epic-state-7eY0g-Bc.js";import{u as j,z as f,L as C,t as I,G as O,b as $}from"./index-CrBk11WI.js";import"./mui-Do6nLzGb.js";import{t as P}from"./getLocaleForTenant-xZFgPOZu.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 t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="93b3b57e-ba53-412d-b9e0-47eb1fb35df7",t._sentryDebugIdIdentifier="sentry-dbid-93b3b57e-ba53-412d-b9e0-47eb1fb35df7")}catch{}})();const G=w((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),m=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let b="";const n=h.map((l=>l.tenantEmailDomain)),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const T=E(r.pathname);if(T!=null)c=`../${o.tenantEmailDomain}/${T}`,b="comingFromV2UrlPath",T==="ai-cfo/explore"&&(d=m.get("question")?.replace(/^["']|["']$/g,"")??null,e=m.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,x)=>l||i.split("/").find((D=>D===x))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,b="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const F=$(c,m);return v.jsx(L,{to:F,replace:!0,state:{...r.state,origin:"",message:b,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),m=u.useRef(null),b=p((e=>N(e))),n=p((e=>e.tenantState.fetchState)),i=p((e=>e.tenantState.error)),a=p((e=>e.tenantState.activeTenantFetchState.fetchState)),c=p((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;m.current!==e&&(m.current=e,h.current=!1,r.current=!1,s(C.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(C.TENANT_FETCHING),t(U(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!k(i))&&t(R(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&b.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(b.tenantsCoreDetailsInOrder),o())}),[b.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(G,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
|
package/dist/assets/{DomesticWireDetailScreen-Dj3JCDGh.js → DomesticWireDetailScreen-DGMYJzFE.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-UOzcPsHa.js";import{h as w,g as C,j as h,l as E,i as V}from"./core-B5mDy9pu.js";import{YH as k,YO as _,gG as W,gF as K,gE as L,kP as M,WG as q,uK as J,fF as B,Ye as D,kN as F,YI as S,YR as G,kL as T,l6 as j}from"./zeni-epic-state-7eY0g-Bc.js";import{bM as Q,a1 as N,N as R,z as O,E as U,a4 as b,c as v,a7 as H,bN as X,H as Y,bO as ee,p as te}from"./index-CrBk11WI.js";import{n as Z}from"./mui-Do6nLzGb.js";import"./sentry-DHDsO12F.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]="aa3e6d38-a4d4-4493-80f3-0e7691066cd6",e._sentryDebugIdIdentifier="sentry-dbid-aa3e6d38-a4d4-4493-80f3-0e7691066cd6")}catch{}})();const ae=E(null,(function(e,t){return{onSaveVendor:a=>{e(M(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),a!=null&&e(J(a))},onGetOtp:a=>{e(L(a,"BillPayVendor"))},onResendOtp:a=>{e(K(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(W(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(_(a,n,o))}}}))(Q);function z({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h((r=>k(r,e)));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=Z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-DKqwsBQp.js";import{h as w,g as C,j as h,l as E,
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,oe=E((function(e,t){const{vendorId:a,billId:n}=t,o=k(e,a),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:a,location:n,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(T(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=
|
|
9
|
+
`,oe=E((function(e,t){const{vendorId:a,billId:n}=t,o=k(e,a),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:a,location:n,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(T(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=b(n.state?.pathnameStackToGoBack),r=s.poppedPathname??P();a(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(G({data:r}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const s=b(t.location.state?.pathnameStackToGoBack),r=s.poppedPathname??P(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}}))(X);function fe({vendorIdParam:e,accountContext:t}){const a=w(),n=C(),o=N(),{vendorId:s,billId:r}=V(),i=e??s,{useFeatureGate:d}=R(),c=O.getSignedInUser(),p=h((u=>B(u))),g=U(),I=b(n.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:x}=d(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(H,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ne,{windowSize:o,children:[l.jsx(z,{vendorId:i,billId:r}),l.jsx(oe,{location:n,navigate:a,billId:r,vendorId:i,currentTenant:p,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t},me=(e,t,a)=>{let n=`/${e}/bill/${encodeURIComponent(t)}`;return a=="draft"&&(n+="/edit"),n},he=e=>`/${e}/bills`,ke=(e,t)=>{let a=`/${e}/bill`;return a=t!=null?a.concat(`/${t}/edit`):a.concat("/new"),a},A=(e,t,a,n)=>{let o=`/${e}/bill`;return o+=a!=null?`/${a}/edit/vendor`:"/new/vendor",o+=n!=null?`/${n}/edit/${t}`:`/create/${t}`,o};function Se(e,t,a){return A(e,"ach",t,a)}function ve(e,t,a){return A(e,"domestic",t,a)}function ge(e,t,a){return A(e,"international",t,a)}const se=(e,t,a)=>{let n=`/${e}/bill/`;return n=a!=null?n.concat(`${encodeURIComponent(a)}/${t}/`):n.concat(`new/${t}/`),n},de=Z.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100vh;
|
|
12
12
|
width: 100%;
|
|
@@ -14,5 +14,5 @@ import{j as l}from"./liveblocks-DKqwsBQp.js";import{h as w,g as C,j as h,l as E,
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
box-shadow: ${e=>`0px 2px ${
|
|
18
|
-
`,re=E((function(e,t){const{vendorId:a,billId:n}=t,o=k(e,a),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:a,navigate:n,location:o,vendorId:s,currentTenant:r}=t,{tenantEmailDomain:
|
|
17
|
+
box-shadow: ${e=>`0px 2px ${Y.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
+
`,re=E((function(e,t){const{vendorId:a,billId:n}=t,o=k(e,a),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:a,navigate:n,location:o,vendorId:s,currentTenant:r}=t,{tenantEmailDomain:i}=r;return{onFetchBankName:d=>{e(j(d))},onSaveHandler:d=>{e(T(t.bankAccountContext,d,"us-domestic",s))},onWireDetailsUpdated:d=>{const{bankAccountSection:c}=d;e(G({data:c}))},onCancel:()=>{(()=>{const d=b(o.state?.pathnameStackToGoBack),c=d.poppedPathname??$();n(c,{state:{pathnameStackToGoBack:d.newStack}})})(),e(S())},onAddressClick:d=>{if(t.bankAccountContext==="express-pay")n("./add-address");else{const c=se(i,d,a),p=te(o.state?.pathnameStackToGoBack,o.pathname);n(c,{state:{pathnameStackToGoBack:p}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const d=b(t.location.state?.pathnameStackToGoBack),c=d.poppedPathname??$(0);t.navigate(c,{state:{pathnameStackToGoBack:d.newStack}})}e(S())}}}))(ee);function Ie({vendorIdParam:e,accountContext:t}){const a=w(),n=C(),o=N(),{vendorId:s,billId:r}=V(),i=e??s,d=O.getSignedInUser(),{useFeatureGate:c}=R(),p=U(),g=h((u=>B(u))),I=b(n.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:x}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(d==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(H,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:p.colors.grey5,boxShadow:`0px 2px ${Y.sp1} ${p.colors.dropShadowNormal}`}}):l.jsxs(de,{windowSize:o,children:[l.jsx(z,{vendorId:i,billId:r}),l.jsx(re,{location:n,navigate:a,billId:r,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{fe as A,Ie as D,z as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
|