@zeniai/web-app-ui 5.0.25-qa → 5.0.26-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-CV8Sw8CP.js +1 -0
- package/dist/assets/AddressScreen-CG-B80_4.js +9 -0
- package/dist/assets/{AiCfoScreen-c3WmsM7S.js → AiCfoScreen-CyTokZKd.js} +1 -1
- package/dist/assets/BillPayApprovalRoutes-BwSUlLgD.js +1 -0
- package/dist/assets/{BillPayRoutes-DBqyHQ7X.js → BillPayRoutes-CSpnmpVl.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-DlerSwqe.js → BusinessVerificationPageScreen-XAQKreuQ.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-DWhHYo21.js → ChargeCardRoutes-C39jkt7F.js} +8 -8
- package/dist/assets/CompanyPassportScreen-BbokQ4hH.js +1 -0
- package/dist/assets/ConnectionAuthScreen-eyPxOj3X.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DwO0_vwT.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DkC_d2sZ.js → CustomerOnboardingRoutes-C6xc2c4j.js} +6 -6
- package/dist/assets/DashboardRoutes-BeeURxU7.js +20 -0
- package/dist/assets/{DefaultTenantHome-CjzSnp03.js → DefaultTenantHome-xvMFl-dC.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-LY2LbfiX.js → DomesticWireDetailScreen-rVUtw5dn.js} +3 -3
- package/dist/assets/DrawerScreen-D2sVaWmT.js +1 -0
- package/dist/assets/{EntityDetailRoutes-lzOy1ccj.js → EntityDetailRoutes-CvQH6iMQ.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-D_77OTBs.js → ExpenseAutomationRoutes-Dnhz3G0Y.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-DsVyovAJ.js +1 -0
- package/dist/assets/{MagicLinkRoutes-Nmy2VUN5.js → MagicLinkRoutes-DSYzYj69.js} +2 -2
- package/dist/assets/MagicLinkSignInScreen-CYT_mA9u.js +12 -0
- package/dist/assets/MobileAppDrawer-CPQuEteC.js +1 -0
- package/dist/assets/NotFoundScreen-D5gX25SL.js +1 -0
- package/dist/assets/{NotificationRoutes-z8dQlPoa.js → NotificationRoutes-By1RzVqo.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-zIKfcrxm.js +1 -0
- package/dist/assets/{PeopleRoutes-CllKrbwi.js → PeopleRoutes-H0bbY-ET.js} +5 -5
- package/dist/assets/PerformanceRoutes-LsTpAH12.js +1 -0
- package/dist/assets/{Preview-DMyRJ2f0.js → Preview-BAKw3AAf.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-B_jPbhuP.js → QBOConnectionScreen-8whb3Hsr.js} +1 -1
- package/dist/assets/{ReferralListScreen-DIWnUNDR.js → ReferralListScreen-CyEKJZYn.js} +2 -2
- package/dist/assets/{ReimbursementApprovalRoutes-D-DKJaF1.js → ReimbursementApprovalRoutes-Cu9gxM3S.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BGFNyRVm.js → ReimbursementApprovalRuleDetailScreen-CMXdWUhi.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-jGUb1Fcu.js → ReimbursementRoutes-XZANwX-H.js} +4 -4
- package/dist/assets/{ReportsRoutes-MfNsO04v.js → ReportsRoutes-B2iWUWYi.js} +1 -1
- package/dist/assets/RewardsRoutes-CcpZZ0yW.js +1 -0
- package/dist/assets/ScreenRoutes-DMJirfOH.js +2 -0
- package/dist/assets/{SettingsRoutes-CYwSFGK7.js → SettingsRoutes-Bjw3TffC.js} +4 -4
- package/dist/assets/{SetupPagesScreen-Cilkcy82.js → SetupPagesScreen-DxIIsva3.js} +1 -1
- package/dist/assets/SignInScreen-x6v4P1q0.js +1 -0
- package/dist/assets/SignOutScreen-DYYqM-_R.js +9 -0
- package/dist/assets/TaskListScreen-BW-oMerA.js +9 -0
- package/dist/assets/TaskRoutes-NyhjOGv3.js +9 -0
- package/dist/assets/TransactionDetailRoutes-CPn7atS_.js +1 -0
- package/dist/assets/{TransactionDetailScreen---9iPrdg.js → TransactionDetailScreen-lxeDv5DJ.js} +2 -2
- package/dist/assets/{TransactionListRoutes-DmewD5lB.js → TransactionListRoutes-C-9Rmaut.js} +1 -1
- package/dist/assets/{TreasuryRoutes-DPo2M-9-.js → TreasuryRoutes-GImokxmZ.js} +6 -6
- package/dist/assets/{VendorsRoutes-B2HVwxpf.js → VendorsRoutes-DWeQQswE.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-Crwiq_l2.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-N6UjlYyq.js → ZeniAccountRoutes-CEoa3jip.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-DI0ZEKQp.js +9 -0
- package/dist/assets/{accountMappingHelper-CEjaDvi1.js → accountMappingHelper-DdMTXagH.js} +1 -1
- package/dist/assets/{analytics-B3Q4UmLh.js → analytics-BsMspvaD.js} +1 -1
- package/dist/assets/{analyticsHelper-B4uZydFl.js → analyticsHelper-DqgMIH9d.js} +1 -1
- package/dist/assets/{core-CBFn_Yo_.js → core-PVb_PTOa.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CqMC__af.js → decodeURIComponentSafe-mU8LeJGH.js} +1 -1
- package/dist/assets/{dnd-1A4kYEBz.js → dnd-DhtyOCgF.js} +1 -1
- package/dist/assets/{empty-C0ZlcUMX.js → empty-HlfDqjBl.js} +1 -1
- package/dist/assets/{empty-CuHDeEGA.js → empty-wep5Q-1y.js} +1 -1
- package/dist/assets/{emptyVideoElement-L6eqPJfK.js → emptyVideoElement-DpJB9lfW.js} +1 -1
- package/dist/assets/{epic-BNVHfQUa.js → epic-CMMVrD8V.js} +1 -1
- package/dist/assets/getLocaleForTenant-yD-xTTtK.js +1 -0
- package/dist/assets/{index-CpBFmiLM.js → index-BCcxTJng.js} +1 -1
- package/dist/assets/{index-CAO2_lCc.js → index-BWo_N8M7.js} +1 -1
- package/dist/assets/{index-DFEZoheE.js → index-CsPK-ZcF.js} +2 -2
- package/dist/assets/{index-BKmj_VFp.js → index-Dn-dGYDp.js} +1 -1
- package/dist/assets/{index-CDftMuwg.js → index-DnBq3nCg.js} +1 -1
- package/dist/assets/{index-ChMtRDkl.js → index-P5rhD5Na.js} +14700 -14610
- package/dist/assets/{index-D5HjsaAE.js → index-yb_kldBQ.js} +1 -1
- package/dist/assets/{lexical-Blenvqjv.js → lexical-CVfRQHxx.js} +1 -1
- package/dist/assets/{liveblocks-ypyKWtbM.js → liveblocks-DiLJJ0-W.js} +1 -1
- package/dist/assets/{lottie-xwOlCP2t.js → lottie-DGoffhx5.js} +1 -1
- package/dist/assets/{mui-D35VurIR.js → mui-Bs_Wx3U8.js} +1 -1
- package/dist/assets/{pathToGoBack-DEbgHxxX.js → pathToGoBack-BrzgfZOY.js} +1 -1
- package/dist/assets/{pdf-B5d6xxqf.js → pdf-Cq31LyOe.js} +4 -4
- package/dist/assets/{pdf-lib-CUHgD73m.js → pdf-lib-CKEHYQuo.js} +1 -1
- package/dist/assets/{plaid-O0aD-5ib.js → plaid-CT0unNLB.js} +1 -1
- package/dist/assets/{pusher-C48G4Qny.js → pusher-BDivubpF.js} +1 -1
- package/dist/assets/{react-DBFLdS1u.js → react-AIza423u.js} +1 -1
- package/dist/assets/{react-BHZphYxv.js → react-B22DUlFC.js} +1 -1
- package/dist/assets/{react-DDnuJ4gm.js → react-CQHBdAiW.js} +1 -1
- package/dist/assets/{react-BaFEg--9.js → react-D12Thgxw.js} +1 -1
- package/dist/assets/{react-DlX6KwOM.js → react-D3IfLVtg.js} +1 -1
- package/dist/assets/{react-DOxDWALt.js → react-x856Ci_R.js} +1 -1
- package/dist/assets/{recharts-CSEhqlTE.js → recharts-CreyyBLx.js} +1 -1
- package/dist/assets/{routePaths-nlWWZ4ZI.js → routePaths-C6cVlXoV.js} +1 -1
- package/dist/assets/{sentry-ylIvhyeZ.js → sentry-CRXtNjzG.js} +1 -1
- package/dist/assets/{url-D6aOj1HL.js → url-DraJKqO-.js} +1 -1
- package/dist/assets/{url-BUH-dUKP.js → url-arGh5ZAs.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BqWqtj0f.js +1 -0
- package/dist/assets/{useDeviceId-BJs7B5gi.js → useDeviceId-B5nwTsrh.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-BJfLdWEG.js +1 -0
- package/dist/assets/{useInitialThreadRequest-BFAN9HG0.js → useInitialThreadRequest-DNzJLWO_.js} +1 -1
- package/dist/assets/{utils-0qzBiEB0.js → utils-CfmtJLRd.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-Bon_8p_2.js → withTransactionSidePanel-9be4np7g.js} +2 -2
- package/dist/assets/{zeni-epic-state-DQMIbKEE.js → zeni-epic-state-4sJL0-hG.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-edSf0Hzf.js +0 -1
- package/dist/assets/AddressScreen-DXP1i7x7.js +0 -9
- package/dist/assets/BillPayApprovalRoutes-DHaXtrYO.js +0 -1
- package/dist/assets/CompanyPassportScreen-CuARsPx2.js +0 -1
- package/dist/assets/ConnectionAuthScreen-D7jj-mBL.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-DXLFxrq4.js +0 -1
- package/dist/assets/DashboardRoutes-e4wGQnEi.js +0 -20
- package/dist/assets/DrawerScreen-CdRI1pWE.js +0 -1
- package/dist/assets/FeaturePreviewScreen-pIQ4X1aP.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-BVyspHCV.js +0 -12
- package/dist/assets/MobileAppDrawer-D23D-DVK.js +0 -1
- package/dist/assets/NotFoundScreen-BU5ZWYfy.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CA3r2X18.js +0 -1
- package/dist/assets/PerformanceRoutes-jV3YHfcW.js +0 -1
- package/dist/assets/RewardsRoutes-91uVLC96.js +0 -1
- package/dist/assets/ScreenRoutes-CqLlqtvw.js +0 -2
- package/dist/assets/SignInScreen-DUy4fwRG.js +0 -1
- package/dist/assets/SignOutScreen-DvIN_1Oz.js +0 -9
- package/dist/assets/TaskListScreen-DyrjcDli.js +0 -9
- package/dist/assets/TaskRoutes-BW1P-Ij8.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BmJCEPNE.js +0 -1
- package/dist/assets/WiseConfirmationScreen-Dv2If-yw.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BhyQMG6S.js +0 -9
- package/dist/assets/getLocaleForTenant-CpmXipgh.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-IrvXJbyC.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-kulIc847.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-DiLJJ0-W.js";import{A as d}from"./AddressScreen-CG-B80_4.js";import i from"./NotFoundScreen-D5gX25SL.js";import"./sentry-CRXtNjzG.js";import{n as s,o as r}from"./core-PVb_PTOa.js";import"./zeni-epic-state-4sJL0-hG.js";import"./recharts-CreyyBLx.js";import"./index-P5rhD5Na.js";import"./mui-Bs_Wx3U8.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.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]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-DiLJJ0-W.js";import{a as b}from"./sentry-CRXtNjzG.js";import{j as P,h as _,u as j,l as E,g as B,k as M}from"./core-PVb_PTOa.js";import{K as $,h as D,z as K,j as L,B as R,y as z,d as I,g as S,m as F,k as h,p as N}from"./index-P5rhD5Na.js";import{IY as C,gI as U,eM as G,IZ as O,b$ as V,I_ as q,k2 as H}from"./zeni-epic-state-4sJL0-hG.js";import{n as Y}from"./mui-Bs_Wx3U8.js";import Z from"./NotFoundScreen-D5gX25SL.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]="06a8f2bd-15f8-4a72-95dd-bf50420c0ab6",e._sentryDebugIdIdentifier="sentry-dbid-06a8f2bd-15f8-4a72-95dd-bf50420c0ab6")}catch{}})();const J=Y.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,Q=M(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&O(t.roleMap),d=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=q(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=C(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=N(d?.pathnameStackToGoBack);let s=n.poppedPathname??k();const u=d?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(s=`${s}?${f}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=W(a);e(H({addressType:c,addressToCreate:d})),I?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(F);function re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=P(),d=_(),n=j(),{addressId:s,addressType:u}=E(),f=$(),w=D(),v=K.getSignedInUser(),[g,x]=b.useState(s==null),p=B(m=>s!=null?C(m,s).fetchState:"Not-Started"),A=L();if(v==null)throw Error("Can't access address page without signing in...");const T=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return b.useEffect(()=>{g||s==null||(x(!0),d(U(s,!1)))},[g,s,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!g&&p==="Not-Started"||g&&p==="In-Progress"?r.jsx(R,{fetchState:p,style:{backgroundColor:w.colors.grey5}}):s!=null&&p==="Error"?(a(`${k(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(z,{analytics:I,onLoad:T}),r.jsx(J,{windowSize:f,children:r.jsx(Q,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):r.jsx(Z,{})}const k=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},W=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{re as A,W as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-
|
|
1
|
+
import{j as h}from"./liveblocks-DiLJJ0-W.js";import{a as r}from"./sentry-CRXtNjzG.js";import{h as oe,j as ne,u as ie,g as G,l as re,k as le}from"./core-PVb_PTOa.js";import{I as ce,cF as ue,z as de,K as me,cG as pe,cH as fe,cI as he,cJ as q,y as Se,d as v,M as N,cK as ge,cL as Ce,g as be,a1 as ke,cM as we,O as Ie,r as Pe,p as V,aX as Ee,cN as Te}from"./index-P5rhD5Na.js";import{fD as ye,f2 as H,eM as _e,hm as xe,Pu as ve,eL as Ue,hw as Ae,hs as Oe,ft as Qe,fn as De,fg as Fe,fk as $,fo as Le,fp as Me,fq as Be,fr as Re,fs as je}from"./zeni-epic-state-4sJL0-hG.js";import{D as Ge,n as U,P as Ne,S as Ve}from"./mui-Bs_Wx3U8.js";import{p as $e}from"./pathToGoBack-BrzgfZOY.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="9533601e-fdfa-4c8e-9b64-16a9a93b535d",s._sentryDebugIdIdentifier="sentry-dbid-9533601e-fdfa-4c8e-9b64-16a9a93b535d")}catch{}})();const W="chat-response-generated",qe=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Me(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:P}=q(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(P,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(je({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Ee(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s($(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Le(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??$e(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s($(""))},togglePageView:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Pe(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=G(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=G(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:P}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,O=!!C?.aiCfoShouldSubmit,[z,E]=r.useState(null),[K,T]=r.useState(!1),Q=r.useRef(!1);r.useEffect(()=>{Q.current||b==null||b===""||(E(b),T(O),Q.current=!0)},[b,O]);const J=r.useCallback(()=>{E(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,L=r.useRef(!1);r.useEffect(()=>{L.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),L.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(E(k),T(!0),a(ve()))},[k,t,a]);const X=c.masterTOSInfo,w=X?.isMasterTOSAccepted??!1,{visitedSessions:M}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),j=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Y}=q(j,t),Z=Y.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:M.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[M]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Oe(t,e.userId))},[B,R,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),N(n)&&A.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:j,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:Z,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:J,onMenuClick:N(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:P,onUploadPromoClose:g}),h.jsx(Ge,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Qe(c.userRoleId)),f(!1)}})})})]})},He=U(Ve)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-DiLJJ0-W.js";import{a as y}from"./sentry-CRXtNjzG.js";import{j as B,u as U,h as T,g as v,N as $,k as j,l as L,n as O,o as h}from"./core-PVb_PTOa.js";import{eM as N,Mf as R,LX as b,x4 as w,w_ as F,x2 as x,wT as W,LZ as M,wW as q,x6 as z,x5 as C}from"./zeni-epic-state-4sJL0-hG.js";import{h as P,z as k,B as V,a1 as X,bx as Z,aa as _,by as G}from"./index-P5rhD5Na.js";import"./mui-Bs_Wx3U8.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-CMXdWUhi.js";import J from"./NotFoundScreen-D5gX25SL.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="92281e79-a87f-42ed-ac4e-d1702ac2dc82",e._sentryDebugIdIdentifier="sentry-dbid-92281e79-a87f-42ed-ac4e-d1702ac2dc82")}catch{}})();const I="bill-approval-rule-update",K=j(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(I)&&e(M(!1))},onBackClick:()=>{_(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(W(t))},onEditRuleClick:t=>{t!=null?(e(x(t)),a(`./${t}/edit`)):(e(x()),a("./new"))}}})(X(Z)),Q=()=>{const e=B(),o=U(),a=T(),[p,t]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(F(!0)))},[p,n,a]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),a(x())),e("./new"))},[u,r,a]);const f={events:c.companyId!=null?[`private-${c.companyId}.${I}`]:[],eventCallback:(i,A,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...f})},Y=j(function(e,o){const a=b(e),p=a.billPaySetupApproverViewUpdateData?.type??"approval_create",t=p==="approval_create"&&a.allApprovalRules.length!==0;let u=a.allApprovalRules.length===0;return o.approvalRuleId&&(u=a.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:a,hideUpperBoundField:t,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:a,approvalUpdateDataView:p,approverViewData:t,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(S=>{const E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{a("../")}}})(G);function D(){const e=B(),o=T(),a=U(),{approvalRuleId:p}=L(),t=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(q(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),t==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Y,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:a})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Q,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-ypyKWtbM.js";import{j as K,h as re,u as Q,l as te,g as k,N as ee,k as X,i as la,n as sa,o as S}from"./core-CBFn_Yo_.js";import{eM as Z,Lx as Ge,bu as At,Gz as ra,bn as xt,bC as pe,Ly as Bt,wo as Et,xy as Ue,wX as ca,bm as je,Lz as da,LA as ua,b$ as pa,LB as ma,jm as Dt,LC as jt,LD as Tt,y7 as Oe,wD as Be,LE as ba,wc as it,LF as ha,Bj as ga,wg as ya,wm as Pt,LG as Ie,LH as Ne,xz as ze,LI as Sa,LJ as fa,xC as Ze,LK as Ia,xP as ka,LL as Ft,xj as ot,xo as va,LM as wa,LN as ue,LO as Rt,LP as Lt,LQ as Vt,fG as Ca,wI as _e,ct as $t,LR as Aa,gy as xa,LS as Ba,LT as Ea,eS as Ut,eQ as _t,LU as He,LV as Da,LW as ja,Jg as We,LX as Ta,Jh as ie,Ji as qe,LY as Pa,LZ as Fa,L_ as Ra,xq as lt,xn as La,L$ as Va,M0 as $a,M1 as Ua,x9 as _a,M2 as Ma,M3 as Ga,M4 as Oa,cN as Mt,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vu as Za,M5 as Ha,B6 as Wa,Bc as qa,s1 as Ja,xA as Ka,ye as Qa,jK as fe,M6 as Xa,M7 as zt,kc as Ya,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M8 as tn,M9 as ke,ig as an,Ma as rt,Mb as nn,ik as on,iG as ln,ys as sn,Mc as rn,k5 as cn,yi as dn,Md as ct,ym as un,yr as pn,yo as mn,yg as bn,Me as Wt,wx as hn,Mf as gn,Mg as yn,fz as Sn,fy as fn,fx as In,jN as kn,k3 as dt,ke as vn,pA as wn,jW as Cn,yk as An,ir as xn,kj as Bn,Mh as En,ii as Dn,pr as jn,Mi as Tn,xf as Pn,bD as Fn,br as Rn,If as Ln,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-DQMIbKEE.js";import{h as me,z as L,A as ve,F as Je,r as oe,d as y,aI as Ee,v as ce,o as E,w as Te,c as j,b4 as Mn,p as z,J as Ke,m as D,K as we,b5 as ut,b6 as pt,b7 as Gn,af as On,C as Nn,aC as zn,x as qt,O as Qe,Q as Xe,b8 as Zn,ao as Jt,b9 as Hn,G as Wn,f as Kt,a1 as qn,ba as Jn,bb as Kn,bc as Qn,bd as Xn,be as Yn,bf as ei,bg as ti,bh as ai,bi as ni,I as ii,bj as oi,b0 as li,bk as si,bl as ri,a4 as ci}from"./index-ChMtRDkl.js";import{n as V,S as di}from"./mui-D35VurIR.js";import{A as mt}from"./AddressScreen-DXP1i7x7.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-LY2LbfiX.js";import{a as f}from"./sentry-ylIvhyeZ.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-IrvXJbyC.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-kulIc847.js";import{u as Xt}from"./useInitialThreadRequest-BFAN9HG0.js";import De from"./NotFoundScreen-BU5ZWYfy.js";import{D as bi}from"./DrawerScreen-CdRI1pWE.js";import{M as Yt}from"./MobileAppDrawer-D23D-DVK.js";import{F as ea}from"./FeaturePreviewScreen-pIQ4X1aP.js";import{S as Re}from"./SetupPagesScreen-Cilkcy82.js";import{B as hi}from"./BillPayApprovalRoutes-DHaXtrYO.js";import{FallBackRoute as gi}from"./ScreenRoutes-CqLlqtvw.js";import"./recharts-CSEhqlTE.js";import"./analytics-B3Q4UmLh.js";import"./plaid-O0aD-5ib.js";import"./dnd-1A4kYEBz.js";import"./stripe-DMRn4zHo.js";import"./lottie-xwOlCP2t.js";import"./lexical-Blenvqjv.js";import"./pdf-B5d6xxqf.js";import"./utils-0qzBiEB0.js";import"./analyticsHelper-B4uZydFl.js";import"./routePaths-nlWWZ4ZI.js";import"./BusinessVerificationPageScreen-DlerSwqe.js";import"./ReimbursementApprovalRuleDetailScreen-BGFNyRVm.js";import"./getLocaleForTenant-CpmXipgh.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]="4e9da5ff-839f-4b00-9a39-87dcbc19645d",e._sentryDebugIdIdentifier="sentry-dbid-4e9da5ff-839f-4b00-9a39-87dcbc19645d")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Mn);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[_,M]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?M(!1):M(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[_,M]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&_?M(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),_||(M(!0),t(Ue(!1,g,T,b,n)))),u&&!_&&(M(!0),t(Ue(!1,g,T,b,n)))},[v,_,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-DiLJJ0-W.js";import{j as K,h as re,u as Q,l as te,g as k,N as ee,k as X,i as la,n as sa,o as S}from"./core-PVb_PTOa.js";import{eM as Z,Lx as Ge,bu as At,Gz as ra,bn as xt,bC as pe,Ly as Bt,wo as Et,xy as Ue,wX as ca,bm as je,Lz as da,LA as ua,b$ as pa,LB as ma,jm as Dt,LC as jt,LD as Tt,y7 as Oe,wD as Be,LE as ba,wc as it,LF as ha,Bj as ga,wg as ya,wm as Pt,LG as Ie,LH as Ne,xz as ze,LI as Sa,LJ as fa,xC as Ze,LK as Ia,xP as ka,LL as Ft,xj as ot,xo as va,LM as wa,LN as ue,LO as Rt,LP as Lt,LQ as Vt,fG as Ca,wI as _e,ct as $t,LR as Aa,gy as xa,LS as Ba,LT as Ea,eS as Ut,eQ as _t,LU as He,LV as Da,LW as ja,Jg as We,LX as Ta,Jh as ie,Ji as qe,LY as Pa,LZ as Fa,L_ as Ra,xq as lt,xn as La,L$ as Va,M0 as $a,M1 as Ua,x9 as _a,M2 as Ma,M3 as Ga,M4 as Oa,cN as Mt,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vu as Za,M5 as Ha,B6 as Wa,Bc as qa,s1 as Ja,xA as Ka,ye as Qa,jK as fe,M6 as Xa,M7 as zt,kc as Ya,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M8 as tn,M9 as ke,ig as an,Ma as rt,Mb as nn,ik as on,iG as ln,ys as sn,Mc as rn,k5 as cn,yi as dn,Md as ct,ym as un,yr as pn,yo as mn,yg as bn,Me as Wt,wx as hn,Mf as gn,Mg as yn,fz as Sn,fy as fn,fx as In,jN as kn,k3 as dt,ke as vn,pA as wn,jW as Cn,yk as An,ir as xn,kj as Bn,Mh as En,ii as Dn,pr as jn,Mi as Tn,xf as Pn,bD as Fn,br as Rn,If as Ln,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-4sJL0-hG.js";import{h as me,z as L,j as ve,I as Je,n as oe,l as y,aI as Ee,B as ce,o as E,y as Te,d as j,b4 as Mn,p as z,O as Ke,r as D,K as we,b5 as ut,b6 as pt,b7 as Gn,af as On,F as Nn,aC as zn,C as qt,D as Qe,W as Xe,b8 as Zn,ao as Jt,b9 as Hn,J as Wn,g as Kt,a1 as qn,ba as Jn,bb as Kn,bc as Qn,bd as Xn,be as Yn,bf as ei,bg as ti,bh as ai,bi as ni,x as ii,bj as oi,b0 as li,bk as si,bl as ri,a4 as ci}from"./index-P5rhD5Na.js";import{n as V,S as di}from"./mui-Bs_Wx3U8.js";import{A as mt}from"./AddressScreen-CG-B80_4.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-rVUtw5dn.js";import{a as f}from"./sentry-CRXtNjzG.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-BqWqtj0f.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-BJfLdWEG.js";import{u as Xt}from"./useInitialThreadRequest-DNzJLWO_.js";import De from"./NotFoundScreen-D5gX25SL.js";import{D as bi}from"./DrawerScreen-D2sVaWmT.js";import{M as Yt}from"./MobileAppDrawer-CPQuEteC.js";import{F as ea}from"./FeaturePreviewScreen-DsVyovAJ.js";import{S as Re}from"./SetupPagesScreen-DxIIsva3.js";import{B as hi}from"./BillPayApprovalRoutes-BwSUlLgD.js";import{FallBackRoute as gi}from"./ScreenRoutes-DMJirfOH.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";import"./analyticsHelper-DqgMIH9d.js";import"./routePaths-C6cVlXoV.js";import"./BusinessVerificationPageScreen-XAQKreuQ.js";import"./ReimbursementApprovalRuleDetailScreen-CMXdWUhi.js";import"./getLocaleForTenant-yD-xTTtK.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]="8e9f82ad-86df-4d9a-aa8c-1eb827d6c1e8",e._sentryDebugIdIdentifier="sentry-dbid-8e9f82ad-86df-4d9a-aa8c-1eb827d6c1e8")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Mn);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[_,M]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?M(!1):M(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[_,M]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&_?M(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),_||(M(!0),t(Ue(!1,g,T,b,n)))),u&&!_&&(M(!0),t(Ue(!1,g,T,b,n)))},[v,_,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function vi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-DiLJJ0-W.js";import{a as V}from"./sentry-CRXtNjzG.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-PVb_PTOa.js";import{j as ce,n as ue,aI as de,z as B,y as pe,d as M,aa as x,g as z,bt as le,ao as me,r as E,ap as P}from"./index-P5rhD5Na.js";import{M3 as fe,eM as G,rs as ye,GD as Se,x9 as ge,zS as Ie,Cp as he,D2 as be,DX as De,Mq as Oe,Mr as Te,Ms as ke,Mt as Ce,Mu as Ve,IZ as we,Ls as Ae,J9 as Ne,k2 as _e,fz as Fe,fy as ve,fx as xe,pA as ze,pr as Be,po as Me,jW as Ee,rB as Pe,rz as R,bB as j,rN as L,cr as Re}from"./zeni-epic-state-4sJL0-hG.js";import{n as je}from"./mui-Bs_Wx3U8.js";import{c as U}from"./routePaths-C6cVlXoV.js";import{M as Le}from"./MobileAppDrawer-CPQuEteC.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="220142f4-5c32-468f-91f0-262101cb6af1",e._sentryDebugIdIdentifier="sentry-dbid-220142f4-5c32-468f-91f0-262101cb6af1")}catch{}})();const Ue=je.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-ypyKWtbM.js";import{a as V}from"./sentry-ylIvhye
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=
|
|
9
|
+
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=B.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ae(e.companyConfigState),s=Ne(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:Z,transactionVolume:W,transactionVolumeDescription:$,purposeOfAccount:J,purposeOfAccountDescription:X,regulatedStatus:H,regulatedStatusDescription:K,usNexus:Q,usNexusTypes:Y}=t,F=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Re(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?j(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:P(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:Z,transactionVolume:W?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:X,regulatedStatus:H??"",regulatedStatusDescription:K,usNexus:Q,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(L({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_}=p;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:O,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?P(I.selectedOption):void 0,phone:u,birthday:n!=null?j(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(L({officers:s}))},onSaveDetailsClick:t=>{e(R(i,t,r))},onSendForVerificationClick:t=>{e(R(i,t,r,!0))},onAddressClick:t=>{const s=U(b,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(b,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Pe({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Ee({files:t}))},onDeleteFile:t=>{e(Me(t))},onDeleteFileList:t=>{e(Be(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(Fe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Qe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,b]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:O}=p(de.zeniAccountsConfig),T=fe(O),g=C(a=>{switch(e){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}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??B.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(De(n,!0));break;case"zeni_treasury":r(be(n,!0));break;case"reimbursement":r(he(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),B.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{b(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=Oe(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(Ue,{children:[k.jsx(pe,{analytics:M,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(Le,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:M,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Qe as B};
|