@zeniai/web-app-ui 5.0.85-prod → 5.0.86-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-CGo30rdJ.js +1 -0
- package/dist/assets/{AddressScreen-C1X9W71J.js → AddressScreen-DqNplF9n.js} +2 -2
- package/dist/assets/AiCfoScreen-DY2bTh5X.js +22 -0
- package/dist/assets/BillPayApprovalRoutes-BcGyYnYz.js +1 -0
- package/dist/assets/{BillPayRoutes-REyUIXZc.js → BillPayRoutes-Dksq93Nt.js} +18 -18
- package/dist/assets/{BusinessVerificationPageScreen-6S_he82a.js → BusinessVerificationPageScreen-YDSaAbpW.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-BzQ9RZyE.js → ChargeCardRoutes-o064oMRW.js} +9 -9
- package/dist/assets/CompanyPassportScreen-BLW99zDL.js +1 -0
- package/dist/assets/ConnectionAuthScreen-Bd0F-_VJ.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-Cb43qCFz.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-D8glvcbX.js → CustomerOnboardingRoutes-DJIij8xf.js} +4 -4
- package/dist/assets/DashboardRoutes-CS6nJI2P.js +20 -0
- package/dist/assets/{DefaultTenantHome-DKor79UJ.js → DefaultTenantHome-Bl9eDQpG.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-CQO9Kbrv.js +18 -0
- package/dist/assets/DrawerScreen-E9PcStEO.js +1 -0
- package/dist/assets/EntityDetailRoutes-zw7M1lwQ.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-BHuRnA1t.js +25 -0
- package/dist/assets/FeaturePreviewScreen-DtxT93sy.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-DvdLNXNC.js +1 -0
- package/dist/assets/{MagicLinkRoutes-DGjZZywf.js → MagicLinkRoutes-BszO-d0K.js} +21 -21
- package/dist/assets/MagicLinkSignInScreen-C_x0l97F.js +12 -0
- package/dist/assets/{MobileAppDrawer-e7vFdsZl.js → MobileAppDrawer-D8M7VXe9.js} +1 -1
- package/dist/assets/NotFoundScreen-BHqd2QHQ.js +1 -0
- package/dist/assets/{NotificationRoutes-iaZ8tHwP.js → NotificationRoutes-BF1vgjUU.js} +1 -1
- package/dist/assets/OAuthConsentScreen-BR0rJGBP.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DY76dKM1.js +1 -0
- package/dist/assets/PeopleRoutes-BtQrBjKV.js +22 -0
- package/dist/assets/PerformanceRoutes-DMpi0fOi.js +1 -0
- package/dist/assets/{Preview-CG8KGDxi.js → Preview-C8bsUUOu.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-B1ByBjAM.js → QBOConnectionScreen-vJXVqwWm.js} +1 -1
- package/dist/assets/{ReferralListScreen-CalwcRRw.js → ReferralListScreen-DMiRiZiL.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-CkwYBtEW.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BiJ5gYT6.js → ReimbursementApprovalRuleDetailScreen-CmXeAJ2V.js} +1 -1
- package/dist/assets/ReimbursementRoutes-C8zQyJK2.js +68 -0
- package/dist/assets/ReportsRoutes-BexYmhra.js +1 -0
- package/dist/assets/RewardsRoutes-DjXjgRiO.js +1 -0
- package/dist/assets/ScreenRoutes-BoNP2LIP.js +2 -0
- package/dist/assets/{SettingsRoutes-BY0Jw8iu.js → SettingsRoutes-DNp9Aol7.js} +7 -7
- package/dist/assets/{SetupPagesScreen-D2SgzhSy.js → SetupPagesScreen-D1bk7eBP.js} +5 -5
- package/dist/assets/SignInScreen-Cgfdytgb.js +1 -0
- package/dist/assets/SignOutScreen-kKi84Hfg.js +9 -0
- package/dist/assets/TaskListScreen-BVNYZTXx.js +9 -0
- package/dist/assets/TaskRoutes-BrThx6o_.js +9 -0
- package/dist/assets/TransactionDetailRoutes-6MCXCmqq.js +1 -0
- package/dist/assets/TransactionDetailScreen-DWs7y2E7.js +5 -0
- package/dist/assets/TransactionListRoutes-Y2-dK5Nn.js +1 -0
- package/dist/assets/TreasuryRoutes-DlQvHZ4w.js +37 -0
- package/dist/assets/{VendorsRoutes-B3LqHFQe.js → VendorsRoutes-HIQQTQSi.js} +28 -28
- package/dist/assets/WiseConfirmationScreen-C646Mco3.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-BOuLb5XT.js → ZeniAccountRoutes-Kwn8sr_a.js} +12 -12
- package/dist/assets/ZeniAccountStatementScreen-BmEJTL09.js +9 -0
- package/dist/assets/{accountMappingHelper-BMO3_Hcn.js → accountMappingHelper-5LvFlOj7.js} +1 -1
- package/dist/assets/{analytics-KTpmzBLZ.js → analytics-BE9oUBzD.js} +1 -1
- package/dist/assets/{analyticsHelper-BMXAUA8L.js → analyticsHelper-BEEOw1D6.js} +1 -1
- package/dist/assets/{core-DSm5EncT.js → core-D1cXuJMi.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-B2XNfwZK.js → decodeURIComponentSafe-Did0aZyt.js} +1 -1
- package/dist/assets/{dnd-WfwuNh-I.js → dnd-DbPPTppj.js} +1 -1
- package/dist/assets/{empty-D4skTnQ7.js → empty-BHW5kDnt.js} +1 -1
- package/dist/assets/{empty-BLM9j6_P.js → empty-CfqAKA3M.js} +1 -1
- package/dist/assets/{emptyVideoElement-Cumej5oa.js → emptyVideoElement-BofOruLs.js} +1 -1
- package/dist/assets/epic-CUqueK5i.js +2 -0
- package/dist/assets/getLocaleForTenant-Dc-_DzRm.js +1 -0
- package/dist/assets/{index-BRuJhj8k.js → index-3aBFjHPN.js} +1 -1
- package/dist/assets/{index-CFp7xmpI.js → index-B4eiJr7Z.js} +1 -1
- package/dist/assets/{index-CJtuHmND.js → index-BSfz3Hzd.js} +1 -1
- package/dist/assets/{index-DxfNPg3T.js → index-CRe2wmI_.js} +1 -1
- package/dist/assets/{index-CFeaKA_G.js → index-DF3os92T.js} +2 -2
- package/dist/assets/{index-DqKAAek5.js → index-DjDfMTxy.js} +1 -1
- package/dist/assets/{index-Cu6TX6T-.js → index-Dr8ZNfvJ.js} +15411 -15406
- package/dist/assets/{index-D-ASMD0k.js → index-n6IrYjfy.js} +1 -1
- package/dist/assets/{lexical-uPMgP-4-.js → lexical-Du70nM1B.js} +1 -1
- package/dist/assets/{liveblocks-D5IOuNv9.js → liveblocks-Hyy2O23M.js} +1 -1
- package/dist/assets/{lottie-Bw23hVB7.js → lottie-qu8VyEpw.js} +1 -1
- package/dist/assets/{mui-aAb3ZK4t.js → mui-B2prtfNk.js} +1 -1
- package/dist/assets/{pathToGoBack-CjnK-RPC.js → pathToGoBack-C7gPpVBh.js} +1 -1
- package/dist/assets/{pdf-BLq3oklQ.js → pdf-Cvwxd6W6.js} +4 -4
- package/dist/assets/{pdf-lib-BW6r_g8A.js → pdf-lib-D1w2Ub95.js} +1 -1
- package/dist/assets/{plaid-Bq2q69xW.js → plaid-4w70Yh4I.js} +1 -1
- package/dist/assets/{pusher-KRJGbkWv.js → pusher-Bvm9V4qD.js} +1 -1
- package/dist/assets/{react-x0L0dyO0.js → react-B4GuIedn.js} +1 -1
- package/dist/assets/{react-4vFcWFvy.js → react-BCjBqrrm.js} +1 -1
- package/dist/assets/{react-D06hoWUG.js → react-BZq53fCf.js} +1 -1
- package/dist/assets/{react-CVr5kbJf.js → react-BfNTrsTo.js} +1 -1
- package/dist/assets/{react-BwM_qM5v.js → react-CBBEPwWt.js} +1 -1
- package/dist/assets/{react-CZ6W6ySb.js → react-CUSCkthZ.js} +1 -1
- package/dist/assets/{recharts-sq8NMPEu.js → recharts-CrZf7bKF.js} +1 -1
- package/dist/assets/routePaths-Dx_nnKk7.js +1 -0
- package/dist/assets/{sentry-Ctx5hlxQ.js → sentry-BTyPPF0t.js} +1 -1
- package/dist/assets/{url-C8YmYc76.js → url-CsQlFR2d.js} +1 -1
- package/dist/assets/{url-BdIiWJEz.js → url-Dq7O3gKi.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BxShjiqA.js +1 -0
- package/dist/assets/{useDeviceId-M1Q9D8TL.js → useDeviceId-D81NtSvK.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-DWTRn_Lu.js +1 -0
- package/dist/assets/{useInitialThreadRequest-C9HocV07.js → useInitialThreadRequest-WHG7gHcH.js} +1 -1
- package/dist/assets/{utils-5dQGsDcn.js → utils-C_-saZ2j.js} +1 -1
- package/dist/assets/withTransactionSidePanel-DcRhIgzv.js +21 -0
- package/dist/assets/{zeni-epic-state-RX9kBvT9.js → zeni-epic-state-CbUjX_b3.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-C_SrcHIw.js +0 -1
- package/dist/assets/AiCfoScreen-WhA4JkLd.js +0 -22
- package/dist/assets/BillPayApprovalRoutes-CxQX2aBa.js +0 -1
- package/dist/assets/CompanyPassportScreen-CUo32gRA.js +0 -1
- package/dist/assets/ConnectionAuthScreen-BdePBTwE.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-CllFwfVW.js +0 -1
- package/dist/assets/DashboardRoutes-C7apISiX.js +0 -20
- package/dist/assets/DomesticWireDetailScreen-BjJiJDq1.js +0 -18
- package/dist/assets/DrawerScreen-D2pv5LV4.js +0 -1
- package/dist/assets/EntityDetailRoutes-DLg9gkZ_.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-D6ucvolb.js +0 -25
- package/dist/assets/FeaturePreviewScreen-DW0dk17I.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-Z-Z5PVam.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-DXENsbqj.js +0 -12
- package/dist/assets/NotFoundScreen-BT06WKNU.js +0 -1
- package/dist/assets/OAuthConsentScreen-vGSNLv7Y.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BD5usFzC.js +0 -1
- package/dist/assets/PeopleRoutes-BbfuviKv.js +0 -22
- package/dist/assets/PerformanceRoutes-CSVKByC4.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-XiJZ8vd5.js +0 -1
- package/dist/assets/ReimbursementRoutes-DZGe7EIH.js +0 -68
- package/dist/assets/ReportsRoutes-C_To5MtR.js +0 -1
- package/dist/assets/RewardsRoutes-BK1T5N_P.js +0 -1
- package/dist/assets/ScreenRoutes-C-POyJhR.js +0 -2
- package/dist/assets/SignInScreen-DnG3RNpe.js +0 -1
- package/dist/assets/SignOutScreen-CvdI8gEw.js +0 -9
- package/dist/assets/TaskListScreen-Dic2Sptj.js +0 -9
- package/dist/assets/TaskRoutes-DEZA7NFE.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BUTf6YOV.js +0 -1
- package/dist/assets/TransactionDetailScreen-DRU44gV_.js +0 -5
- package/dist/assets/TransactionListRoutes-CRtqvb4u.js +0 -1
- package/dist/assets/TreasuryRoutes-XLugkaXo.js +0 -37
- package/dist/assets/WiseConfirmationScreen-BaKWf4dW.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-CsADtZkI.js +0 -9
- package/dist/assets/epic-BjxrHn7-.js +0 -2
- package/dist/assets/getLocaleForTenant-Dks1F-do.js +0 -1
- package/dist/assets/routePaths-CTVn-kRm.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Cwg-MURp.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-CmADrtlH.js +0 -1
- package/dist/assets/withTransactionSidePanel-gQ2IORZA.js +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-Hyy2O23M.js";import{A as i}from"./AddressScreen-DqNplF9n.js";import s from"./NotFoundScreen-BHqd2QHQ.js";import"./sentry-BTyPPF0t.js";import{n as d,o as r}from"./core-D1cXuJMi.js";import"./zeni-epic-state-CbUjX_b3.js";import"./recharts-CrZf7bKF.js";import"./index-Dr8ZNfvJ.js";import"./mui-B2prtfNk.js";import"./analytics-BE9oUBzD.js";import"./plaid-4w70Yh4I.js";import"./dnd-DbPPTppj.js";import"./stripe-DMRn4zHo.js";import"./lottie-qu8VyEpw.js";import"./lexical-Du70nM1B.js";import"./pdf-Cvwxd6W6.js";import"./utils-C_-saZ2j.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]="624154e3-3694-4a3c-b645-a66b8e12404c",t._sentryDebugIdIdentifier="sentry-dbid-624154e3-3694-4a3c-b645-a66b8e12404c")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-
|
|
1
|
+
import{j as d}from"./liveblocks-Hyy2O23M.js";import{a as h}from"./sentry-BTyPPF0t.js";import{j as T,h as _,u as j,l as E,g as B,k as K}from"./core-D1cXuJMi.js";import{K as M,m as $,z as D,c as L,B as R,x as z,d as C,f as S,v as F,h as b,p as N}from"./index-Dr8ZNfvJ.js";import{K7 as k,gY as U,eQ as G,K8 as O,c2 as V,K9 as q,ki as H}from"./zeni-epic-state-CbUjX_b3.js";import{n as Q}from"./mui-B2prtfNk.js";import Y from"./NotFoundScreen-BHqd2QHQ.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]="9bce04c9-cccc-42bc-9422-29963470bf98",e._sentryDebugIdIdentifier="sentry-dbid-9bce04c9-cccc-42bc-9422-29963470bf98")}catch{}})();const J=Q.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as d}from"./liveblocks-D5IOuNv9.js";import{a as h}from"./sentry-Ctx5hlx
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,W=K(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&O(t.roleMap),r=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:b.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,n=N(r?.pathnameStackToGoBack);let s=n.poppedPathname??w();const u=r?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const r=X(a);e(H({addressType:c,addressToCreate:r})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(F);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),r=_(),n=j(),{addressId:s,addressType:u}=E(),g=M(),x=$(),I=D.getSignedInUser(),[f,v]=h.useState(s==null),p=B(m=>s!=null?k(m,s).fetchState:"Not-Started"),A=L();if(I==null)throw Error("Can't access address page without signing in...");const P=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect(()=>{f||s==null||(v(!0),r(U(s,!1)))},[f,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?d.jsx(R,{fetchState:p,style:{backgroundColor:x.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(z,{analytics:C,onLoad:P}),d.jsx(J,{windowSize:g,children:d.jsx(W,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):d.jsx(Y,{})}const w=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},X=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{de as A,X as t};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as h}from"./liveblocks-Hyy2O23M.js";import{a as l}from"./sentry-BTyPPF0t.js";import{h as ue,j as me,u as pe,g as N,l as he,k as fe}from"./core-D1cXuJMi.js";import{R as Se,cJ as ge,z as Ce,K as ke,cK as be,cL as we,cM as V,cN as Ie,cO as Y,p as U,x as q,d as T,cP as z,cQ as Ee,W as Pe,f as Te,a3 as xe,cR as ye,X as _e,j as ve,aY as Oe,cS as Ae}from"./index-Dr8ZNfvJ.js";import{fG as Qe,f5 as J,eQ as Ue,hC as je,QK as De,eP as Fe,hM as Re,hI as Be,fw as W,fq as Le,fj as Me,fn as H,fr as Ge,fs as $e,ft as Ne,fu as Ve,fv as qe}from"./zeni-epic-state-CbUjX_b3.js";import{D as ze,n as b,S as We,P as He}from"./mui-B2prtfNk.js";import{p as Ke}from"./pathToGoBack-C7gPpVBh.js";import"./recharts-CrZf7bKF.js";import"./analytics-BE9oUBzD.js";import"./plaid-4w70Yh4I.js";import"./dnd-DbPPTppj.js";import"./stripe-DMRn4zHo.js";import"./lottie-qu8VyEpw.js";import"./lexical-Du70nM1B.js";import"./pdf-Cvwxd6W6.js";import"./utils-C_-saZ2j.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="85bd0272-d7a8-41fb-bfd6-35ec508f1600",s._sentryDebugIdIdentifier="sentry-dbid-85bd0272-d7a8-41fb-bfd6-35ec508f1600")}catch{}})();const X="chat-response-generated",Ye=fe(function(s,r){const t=J(s),m=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose}},function(s,r){const{location:t,currentTenant:m,userId:c,navigate:S,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:d}=r;return{onEventReceived:(e,o)=>{if(e===X&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,p=$e(n.type),u=n.metadata.chat_session_id??null,{currentChatSession:a,currentQuestionAnswer:w,currentQuestionAnswerSummary:x}=Y(C,u);p!=="answer"?T.trackAICFOChatResponseGenerated(p,w?.question.questionText??"",n.text,u,Ae(x,a),n.metadata.message_id??null):T.trackAICFOChatAnswerGenerated(n.text,w?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Ne(n.visualization?.type??"")??null,u,n.summarized_title,n.metadata.message_id??null),s(Ve({chatSessionId:n.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),s(qe({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:c}))}},onSubmit:(e,o,n,p)=>{e&&Oe(s,e,o,f,C,c,p,n)},updateCurrentInput:e=>{s(H(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Ge(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??Ke(1);S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),s(H(""))},togglePageView:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),d(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{f!=null&&s(Me());const e=ve(t.state?.pathnameStackToGoBack,t.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Le({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(xe(ye)),gt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Se(),t=ue(),m=me(),c=pe(),[S,f]=l.useState(!1);l.useEffect(()=>{t(Qe())},[t]);const{customPageTitle:C}=ge(),d=N(i=>J(i)),e=Ce.getSignedInUser(),{session_id:o}=he(),n=ke(),p=Pe(n),u=N(i=>Ue(i)),a=d.uiState.currentChatSessionId,w=u.tenantEmailDomain,{handleUploadPromoClose:x,isUploadPromoVisible:Z}=be({isFileUploadEnabled:s,tenantEmailDomain:w}),y=we({currentTenant:u,currentChatSessionId:a,aiCfoView:d}),I=c.state,E=I?.aiCfoInitialQuestion,j=!!I?.aiCfoShouldSubmit;l.useEffect(()=>{const i=c.state;if(i?.[V]!==!0)return;f(!0);const g={...i};delete g[V],m(c,{replace:!0,state:g})},[c.pathname,c.search,c.state,m]);const[ee,_]=l.useState(null),[te,v]=l.useState(!1),D=l.useRef(!1);l.useEffect(()=>{D.current||E==null||E===""||(_(E),v(j),D.current=!0)},[E,j]);const ae=l.useCallback(()=>{_(null),v(!1)},[]),F=l.useMemo(()=>new URLSearchParams(c.search),[c.search]),R=F.get("ref")??I?.aiCfoRef,O=F.get("emailRefId")??I?.aiCfoEmailRefId,B=l.useRef(!1);l.useEffect(()=>{B.current||R!=="month-end-email"||O==null||a!=null||e==null||(t(je("controller",e.userId,O,"MONTH_END_EMAIL")),B.current=!0)},[R,O,a,t,e]);const P=d.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&a!=null&&(_(P),v(!0),t(De()))},[P,a,t]);const se=u.masterTOSInfo,k=se?.isMasterTOSAccepted??!1,{visitedSessions:L}=Ie(a),A=d.fetchState,Q=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,M=a!=null?d.fetchChatSessionHistoryByChatSessionId?.[a]?.fetchState??"Not-Started":"Not-Started",G=a==null||(d.uiState.chatHistoryNextPageToken[a]?.hasMore??!0),$=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:oe}=Y($,a),ne=oe.length===0;l.useEffect(()=>{k||p||m("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[k,p,m,c.state]);const ie=l.useCallback(()=>{const i=U(c.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...c.state,pathnameStackToGoBack:i.newStack}})},[u.tenantEmailDomain,c.state,m]);l.useEffect(()=>{a!=null&&o!==a&&m(`../ai-cfo/${a}`,{state:{...c.state}})},[a,o]),l.useEffect(()=>{o!=null&&a==null&&o!=="new_chat"&&o!=="explore"&&t(Fe({sessionId:o,agentId:"controller"}))},[]);const le=l.useMemo(()=>({events:L.map(i=>`private-encrypted-chat-${i}.${X}`),eventCallback:(i,g,de)=>de.onEventReceived(i,g)}),[L]);l.useEffect(()=>{A!=="In-Progress"&&Q&&t(Re())},[A,Q,t]),l.useEffect(()=>{a!=null&&M!=="In-Progress"&&G&&e!=null&&A==="Completed"&&!Q&&t(Be(a,e.userId))},[M,G,a,e,t]);const re=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const ce=a!=null&&d.responseStateByChatSessionId?.[a]?.answer?.fetchState==="In-Progress";return!k&&p?h.jsxs(Xe,{children:[h.jsx(q,{analytics:T,onLoad:re}),y.drawerElement,h.jsx(Ze,{children:h.jsx(K,{children:h.jsx(z,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:ie,onCompleteClick:()=>{u.userRoleId!=null&&t(W(u.userRoleId))}})})})]}):h.jsxs(Je,{children:[h.jsx(q,{analytics:T,onLoad:i=>i.trackPageLoaded(Te.Event.aiCFOPage)}),p&&y.drawerElement,h.jsx(Ye,{...le,currentChatSessionId:a,allSessionsWithOrderedQuestionAnswers:$,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:o,location:c,isSubmitting:ce,isEmptyChatWithSession:ne,customPageTitle:C,currentTenant:u,emailLinkQuestion:ee??void 0,autoSubmitEmailLinkQuestion:te,onEmailLinkQuestionProcessed:ae,onMenuClick:p?y.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:Z,onUploadPromoClose:x}),h.jsx(ze,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:et,style:{width:p?"100%":`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(K,{onClick:i=>i.stopPropagation(),children:h.jsx(z,{isTOSAccepted:k,acceptMasterTOSState:d.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>f(!1),onCompleteClick:()=>{k||u.userRoleId==null||t(W(u.userRoleId)),f(!1)}})})})]})},K=b(We)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,Je=b.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,Xe=b.div`
|
|
9
|
+
height: 100vh;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
`,Ze=b.div`
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
`,et=b(He)`
|
|
20
|
+
box-shadow: ${({theme:s})=>s.colors.elevation2};
|
|
21
|
+
color: ${({theme:s})=>s.colors.grey4};
|
|
22
|
+
`;export{gt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-Hyy2O23M.js";import{a as y}from"./sentry-BTyPPF0t.js";import{j as B,u as U,h as j,g as v,N,k as T,l as O,n as $,o as h}from"./core-D1cXuJMi.js";import{eQ as F,Nq as R,N6 as b,xQ as x,xK as L,xO as I,xD as q,N8 as z,xG as Q,xS as W,xR as E}from"./zeni-epic-state-CbUjX_b3.js";import{m as P,z as k,B as V,a3 as G,by as K,ac as _,bz as H}from"./index-Dr8ZNfvJ.js";import"./mui-B2prtfNk.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-CmXeAJ2V.js";import M from"./NotFoundScreen-BHqd2QHQ.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]="de21b83e-88da-4db5-9623-eceee54dfdf4",e._sentryDebugIdIdentifier="sentry-dbid-de21b83e-88da-4db5-9623-eceee54dfdf4")}catch{}})();const w="bill-approval-rule-update",X=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(z(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(G(K)),Y=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),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),t(I())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{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(X,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,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 D=!!J(S.value);return{type:D?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!D}}),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(E(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(E(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(W())},onSaveRuleSuccess:()=>{t("../")}}})(H);function C(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=O(),a=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]),a==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(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs($,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(C,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(C,{})}),l.jsx(h,{path:"*",element:l.jsx(M,{})})]})}export{se as B};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-D5IOuNv9.js";import{j as J,h as se,u as Q,l as ae,g as v,N as te,k as X,i as na,n as ia,o as S}from"./core-DSm5EncT.js";import{eQ as Z,Mf as Le,bv as It,H8 as oa,bo as wt,bF as pe,Mg as xt,wL as Bt,xV as Ve,xi as la,bn as De,Mh as sa,Mi as ra,c2 as ca,Mj as da,jC as Ct,Mk as At,Ml as Et,yu as _e,w_ as Ce,Mm as ua,wz as tt,Mn as pa,BG as ma,wD as ba,wJ as Dt,Mo as ke,Mp as Ge,xW as Oe,Mq as ha,Mr as ga,xZ as Ne,Ms as ya,ya as Sa,Mt as jt,xG as at,xL as fa,Mu as ka,Mv as ue,Mw as Tt,Mx as Pt,My as Ft,fK as va,x3 as $e,cx as Rt,Mz as Ia,gO as wa,MA as xa,MB as Ba,eW as Mt,eU as Vt,MC as ze,MD as Ca,ME as Aa,J_ as Ze,MF as Ea,J$ as oe,K0 as He,MG as Da,MH as ja,MI as Ta,xN as nt,xK as Pa,MJ as Fa,MK as Ra,ML as Ma,xw as Va,MM as $a,MN as Ua,MO as La,cl as $t,cN as Ut,jN as _a,bL as Ga,bq as Lt,bM as _t,vR as Oa,MP as Na,Bt as za,Bz as Za,so as Ha,xX as Wa,yB as qa,j_ as fe,MQ as Ka,MR as Gt,ks as Ja,jU as Ot,kd as Nt,kc as it,bE as be,bK as Qa,MS as Xa,MT as ve,ix as Ya,MU as ot,MV as en,iB as tn,iW as an,yP as nn,MW as on,kl as ln,yF as sn,MX as lt,yJ as rn,yO as cn,yL as dn,yD as un,MY as zt,wU as pn,MZ as mn,M_ as bn,fC as hn,fB as gn,fA as yn,k1 as Sn,kj as st,ku as fn,pQ as kn,ka as vn,yH as In,iH as wn,kz as xn,M$ as Bn,iz as Cn,pH as An,N0 as En,xC as Dn,bG as jn,bs as Tn,IU as Pn,cP as Fn,cO as Rn,cw as Mn,cC as Vn}from"./zeni-epic-state-RX9kBvT9.js";import{m as me,z as M,d as Ie,y as le,S as y,aK as Ae,x as re,o as A,A as je,e as D,b5 as $n,k as z,X as We,r as E,Z as we,b6 as rt,b7 as ct,b8 as Un,ah as Ln,I as _n,aE as Gn,F as Zt,D as qe,O as Ke,b9 as On,aq as Ht,ba as Nn,U as zn,g as Wt,a3 as Zn,bb as Hn,bc as Wn,bd as qn,be as Kn,bf as Jn,bg as Qn,bh as Xn,bi as Yn,bj as ei,v as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a6 as li}from"./index-Cu6TX6T-.js";import{n as U,S as si}from"./mui-aAb3ZK4t.js";import{A as dt}from"./AddressScreen-C1X9W71J.js";import{g as ie,a as Te,i as qt,V as Je,b as Qe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-BjJiJDq1.js";import{a as f}from"./sentry-Ctx5hlxQ.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-Cwg-MURp.js";import{c as Ye}from"./useFetchSuggestedQuestionsWhenReady-CmADrtlH.js";import{u as Kt}from"./useInitialThreadRequest-C9HocV07.js";import Ee from"./NotFoundScreen-BT06WKNU.js";import{D as ui}from"./DrawerScreen-D2pv5LV4.js";import{M as Jt}from"./MobileAppDrawer-e7vFdsZl.js";import{F as Qt}from"./FeaturePreviewScreen-DW0dk17I.js";import{S as Pe}from"./SetupPagesScreen-D2SgzhSy.js";import{B as pi}from"./BillPayApprovalRoutes-CxQX2aBa.js";import{FallBackRoute as mi}from"./ScreenRoutes-C-POyJhR.js";import"./recharts-sq8NMPEu.js";import"./analytics-KTpmzBLZ.js";import"./plaid-Bq2q69xW.js";import"./dnd-WfwuNh-I.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bw23hVB7.js";import"./lexical-uPMgP-4-.js";import"./pdf-BLq3oklQ.js";import"./utils-5dQGsDcn.js";import"./analyticsHelper-BMXAUA8L.js";import"./routePaths-CTVn-kRm.js";import"./BusinessVerificationPageScreen-6S_he82a.js";import"./ReimbursementApprovalRuleDetailScreen-BiJ5gYT6.js";import"./getLocaleForTenant-Dks1F-do.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]="77949c54-e777-49a5-bce4-16872cf9084c",e._sentryDebugIdIdentifier="sentry-dbid-77949c54-e777-49a5-bce4-16872cf9084c")}catch{}})();const bi=X(function(e,t){const l=Le(e,t.billId),i=M.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.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 n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})($n);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=M.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Le(O,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});Ye({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:L}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=L(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,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(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=M.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=M.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Ne(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=M.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,L]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const K=v(F=>Le(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],$=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Oe(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?L(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(L(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(L(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Ne(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Me,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
2
|
-
${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=
|
|
1
|
+
import{j as a}from"./liveblocks-Hyy2O23M.js";import{j as J,h as se,u as Y,l as ae,g as v,N as te,k as Q,i as na,n as ia,o as S}from"./core-D1cXuJMi.js";import{eQ as Z,MI as _e,bv as It,HC as oa,bo as wt,bF as pe,MJ as Ct,x8 as xt,yi as $e,xH as la,bn as De,MK as sa,ML as ra,c2 as ca,MM as da,jC as Bt,MN as At,MO as Et,yT as Me,xn as Be,MP as ua,wY as tt,MQ as pa,C3 as ma,x0 as ba,x6 as Dt,MR as ke,MS as Ne,yj as Ge,MT as ha,MU as ga,ym as Oe,MV as ya,yz as Sa,MW as jt,y3 as at,y8 as fa,MX as ka,MY as ue,MZ as Tt,M_ as Pt,M$ as Ft,fK as va,xs as Ue,cx as Rt,N0 as Ia,gO as wa,N1 as Ca,N2 as xa,eW as Vt,eU as $t,N3 as ze,N4 as Ba,N5 as Aa,Kr as Ze,N6 as Ea,Ks as oe,Kt as He,N7 as Da,N8 as ja,N9 as Ta,ya as nt,y7 as Pa,Na as Fa,Nb as Ra,Nc as Va,xV as $a,Nd as Ua,Ne as La,Nf as _a,cl as Ut,cN as Lt,jN as Ma,bL as Na,bq as _t,bM as Mt,we as Ga,Ng as Oa,BS as za,BY as Za,sJ as Ha,yk as Wa,y_ as qa,j_ as fe,Nh as Ka,Ni as Nt,ks as Ja,jU as Gt,kd as Ot,kc as it,bE as be,bK as Ya,Nj as Qa,Nk as ve,ix as Xa,Nl as ot,Nm as en,iB as tn,iW as an,zc as nn,Nn as on,kl as ln,z2 as sn,No as lt,z6 as rn,zb as cn,z8 as dn,z0 as un,Np as zt,xh as pn,Nq as mn,Nr as bn,fC as hn,fB as gn,fA as yn,k1 as Sn,kj as st,ku as fn,q9 as kn,ka as vn,z4 as In,iH as wn,kz as Cn,Ns as xn,iz as Bn,q0 as An,Nt as En,x$ as Dn,bG as jn,bs as Tn,Jm as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-CbUjX_b3.js";import{m as me,z as V,c as Ie,C as le,A as y,aK as Ae,B as re,o as A,x as je,d as D,b5 as Un,p as z,X as We,j as E,K as we,b6 as rt,b7 as ct,b8 as Ln,ah as _n,I as Mn,aE as Nn,E as Zt,D as qe,J as Ke,b9 as Gn,aq as Ht,ba as On,U as zn,f as Wt,a3 as Zn,bb as Hn,bc as Wn,bd as qn,be as Kn,bf as Jn,bg as Yn,bh as Qn,bi as Xn,bj as ei,n as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a6 as li}from"./index-Dr8ZNfvJ.js";import{n as L,S as si}from"./mui-B2prtfNk.js";import{A as dt}from"./AddressScreen-DqNplF9n.js";import{g as ie,a as Te,i as qt,V as Je,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-CQO9Kbrv.js";import{a as f}from"./sentry-BTyPPF0t.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-BxShjiqA.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-DWTRn_Lu.js";import{u as Kt}from"./useInitialThreadRequest-WHG7gHcH.js";import Ee from"./NotFoundScreen-BHqd2QHQ.js";import{D as ui}from"./DrawerScreen-E9PcStEO.js";import{M as Jt}from"./MobileAppDrawer-D8M7VXe9.js";import{F as Yt}from"./FeaturePreviewScreen-DtxT93sy.js";import{S as Pe}from"./SetupPagesScreen-D1bk7eBP.js";import{B as pi}from"./BillPayApprovalRoutes-BcGyYnYz.js";import{FallBackRoute as mi}from"./ScreenRoutes-BoNP2LIP.js";import"./recharts-CrZf7bKF.js";import"./analytics-BE9oUBzD.js";import"./plaid-4w70Yh4I.js";import"./dnd-DbPPTppj.js";import"./stripe-DMRn4zHo.js";import"./lottie-qu8VyEpw.js";import"./lexical-Du70nM1B.js";import"./pdf-Cvwxd6W6.js";import"./utils-C_-saZ2j.js";import"./analyticsHelper-BEEOw1D6.js";import"./routePaths-Dx_nnKk7.js";import"./BusinessVerificationPageScreen-YDSaAbpW.js";import"./ReimbursementApprovalRuleDetailScreen-CmXeAJ2V.js";import"./getLocaleForTenant-Dc-_DzRm.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]="4ad2fd87-6534-4d3b-afb7-8c0663fd5563",e._sentryDebugIdIdentifier="sentry-dbid-4ad2fd87-6534-4d3b-afb7-8c0663fd5563")}catch{}})();const bi=Q(function(e,t){const l=_e(e,t.billId),i=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.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 n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Bt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(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 n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Me(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Un);function hi(){const e=J(),t=se(),l=Y(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>_e(G,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Qe({mobileExploreReferrer:"Bill Details"});Xe({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,C]=f.useState(!1),[x,M]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:_}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:N}=_(Ae.zeniAssistConfig),B=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),U=N.user_ids!=null&&r?.userId!=null&&N.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&B===!1?M(!1):M(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,B,r]),f.useEffect(()=>{i!=null&&t(Ct(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(xt(i??"",$,U,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!0),t($e(!1,$,U,X,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,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(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:x,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:U,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Q(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Nn);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Y(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),C=v(F=>Z(F)),[x,M]=f.useState(!1),[T,_]=f.useState(!1),[$,I]=f.useState(!1),[H,N]=f.useState(),B=v(F=>Ne(F,m,g,i));let q=B.fetchState,W=B.file,U=B.showAutofill;const K=v(F=>_e(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],U=!1);const X=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?_(!1):!u&&x&&M(!1))},[i]),f.useEffect(()=>{x||i==null||u||(M(!0),t(xt(i,h,j,!1)),T||(_(!0),t($e(!1,h,j,b,i)))),u&&!T&&(_(!0),t($e(!1,h,j,b,i)))},[x,T,u,i,t]);const G={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(C.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,C.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:N,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||U?null:a.jsx(pt,{children:a.jsx(Qt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Ln,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[U&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(_n,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ci,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:G,isEditPopup:!0}):null,o==="small"||U?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:U,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,B),setShowConfirmationPopup:I,setPayload:N,showActionButtons:fi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();return a.jsx(Qt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
2
|
+
${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=L.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
5
5
|
margin-left: ${A.sp5};
|
|
6
6
|
position: absolute;
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
9
|
-
`,ki=
|
|
9
|
+
`,ki=L.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
justify-content: center;
|
|
12
12
|
align-items: center;
|
|
13
13
|
padding-top: 9px;
|
|
14
14
|
gap: ${A.sp2};
|
|
15
15
|
margin-bottom: -${A.sp2};
|
|
16
|
-
`,vi=
|
|
16
|
+
`,vi=L(Ke.StandardMedium)``,Ii=L(e=>f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M3.35001 15L3.35001 10.125C3.35001 6.81129 6.0363 4.125 9.35001 4.125H16.475M16.475 4.125L13.85 1.5M16.475 4.125L13.85 6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M20.6 9V13.875C20.6 17.1887 17.9137 19.875 14.6 19.875H7.47501M7.47501 19.875L10.1 22.5M7.47501 19.875L10.1 17.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))`
|
|
17
17
|
color: ${e=>e.theme.colors.hero};
|
|
18
18
|
height: ${A.sp3};
|
|
19
19
|
width: ${A.sp3};
|
|
20
|
-
`,
|
|
20
|
+
`,Qt=L(e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})))`
|
|
21
21
|
width: ${A.sp3};
|
|
22
22
|
height: ${A.sp3};
|
|
23
23
|
cursor: pointer;
|
|
@@ -25,7 +25,7 @@ import{j as a}from"./liveblocks-D5IOuNv9.js";import{j as J,h as se,u as Q,l as a
|
|
|
25
25
|
&:hover {
|
|
26
26
|
color: ${e=>e.theme.colors.primary};
|
|
27
27
|
}
|
|
28
|
-
`,Fe=
|
|
28
|
+
`,Fe=L.div`
|
|
29
29
|
display: flex;
|
|
30
30
|
height: 100vh;
|
|
31
31
|
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
@@ -43,7 +43,7 @@ import{j as a}from"./liveblocks-D5IOuNv9.js";import{j as J,h as se,u as Q,l as a
|
|
|
43
43
|
z-index: 3;
|
|
44
44
|
display: ${e=>e.windowSize==="small"?"none":"block"};
|
|
45
45
|
}
|
|
46
|
-
`,Re=
|
|
46
|
+
`,Re=L.div`
|
|
47
47
|
position: absolute;
|
|
48
48
|
top: 56px;
|
|
49
49
|
left: 0;
|
|
@@ -51,33 +51,33 @@ import{j as a}from"./liveblocks-D5IOuNv9.js";import{j as J,h as se,u as Q,l as a
|
|
|
51
51
|
height: 1px;
|
|
52
52
|
background-color: ${e=>e.theme.colors.grey2};
|
|
53
53
|
z-index: 3;
|
|
54
|
-
`,mt=
|
|
54
|
+
`,mt=L.div`
|
|
55
55
|
position: fixed;
|
|
56
56
|
top: 0;
|
|
57
57
|
left: 0;
|
|
58
58
|
right: 0;
|
|
59
59
|
bottom: 0;
|
|
60
|
-
background-color: ${
|
|
60
|
+
background-color: ${Mn.overlayBackgroundBlack};
|
|
61
61
|
z-index: 5;
|
|
62
|
-
`,
|
|
62
|
+
`,Ve=L.div`
|
|
63
63
|
display: flex;
|
|
64
64
|
flex-direction: column;
|
|
65
65
|
width: ${e=>`${gi.containerWidth.value(e.windowSize)}%`};
|
|
66
66
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
67
|
-
`,wi=
|
|
67
|
+
`,wi=L(Ke.H6Regular)`
|
|
68
68
|
margin-top: ${A.sp7};
|
|
69
69
|
padding-left: ${A.sp8};
|
|
70
70
|
padding-right: ${A.sp8};
|
|
71
71
|
color: ${e=>e.theme.colors.primary};
|
|
72
72
|
word-break: break-word;
|
|
73
|
-
`,
|
|
73
|
+
`,Ci=L(Ke.LargeRegularSp)`
|
|
74
74
|
color: ${e=>e.theme.colors.hero};
|
|
75
75
|
padding-left: ${A.sp8};
|
|
76
76
|
padding-right: ${A.sp8};
|
|
77
77
|
margin-bottom: 30px;
|
|
78
78
|
margin-top: ${A.sp4};
|
|
79
79
|
white-space: pre-line;
|
|
80
|
-
`,
|
|
80
|
+
`,xi=Q(function(e,t){return{billsReviewView:jt(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(ue())},onCloseReviewItem:l=>{e(ka(l))},onProceedForBulkActionClick:(l,i)=>{switch(l){case"send_for_approval":e(fa());break;case"approve":case"review":e(at("approved",i??""));break;case"reject":e(at("rejected",i??""))}}}})(On);function Bi(){const e=J(),t=v(i=>i.billsBulkActionViewState.bulkSubmissionFetchState.fetchState),{billsForReview:l}=v(i=>jt(i));return f.useEffect(()=>{t!=="Completed"&&l.length!==0||e("./")},[t,l.length]),a.jsx(xi,{navigate:e,analytics:D})}const ne=Aa(),Xt="bulk-operation-update",Le="bill-approval-rule-update",{spendManagement:Ai,common:bt}=qe.getLocalizedStrings(),ht=Ai.billPay.bulkActions,Ei=L.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
min-height: 100%;
|
|
83
83
|
width: 100%;
|
|
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-D5IOuNv9.js";import{j as J,h as se,u as Q,l as a
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,Di=
|
|
88
|
+
`,Di=Q(function(e,t){const l=V.getSignedInUser(),i=De(l),c=Ft(e,ne,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter(b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted"):t.roleMap.bill_pay_approver&&(r=r.filter(b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted"))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter(b=>b!=="deleted"));const u=e.entityAutoCompleteState.autoCompleteText.common,o=Ze(e,"common"),s=e.tenantState.currentTenantId,n=Z(e),d=n?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,h=c.fetchState,g=Ea(e);return{transactionList:t.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter(b=>b.isDeleted===!1),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:h,analytics:D,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ne,spendManagementEndPoint:`${We}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:i,billPayApprovalRulesAffectedEntityIds:g.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:i,location:c,period:r}=t,{tenantEmailDomain:u}=i;return{updateTabToState:o=>{e(ue()),e(Tt(o))},onSubtabChange:o=>{e(ue()),e(Pt(o))},onTransactionClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);l(n,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ti(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;D?.trackBillPayNewBill();const s=`/${o}/bill/new`,n=E(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:n}})},onSearchTextChanged:o=>{e(Ua(o))},onReloadTransactions:()=>{e(Ue(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e($a(i.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Va({filters:o})),o.categories.every(s=>s.field!=null&&s.values?.length!==0)&&D.trackSpendManagmentFilterChange("bill_pay",o.categories.map(s=>`${s.field}-${JSON.stringify(s.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&D.trackSpendManagementDownloadClick("bill_pay"),e(Ra({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Fa(o))},removeAllTransactionsFromBulkActionList:()=>{e(ue())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Pa(o,s??""));break;case"send_for_approval":e(nt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(nt("approve")),t.navigate("./bulk-review");break;case"review":e(Ta()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Le)&&e(ja(!1))},onEventReceived:o=>{o===Xt&&e(Da())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(He({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}}}})(Zn(Hn));function ji(){const e=J(),t=se(),l=Y(),i=we(),c=l.state,r=Ie(),[u,o]=f.useState(!1),[s,n]=f.useState(null),d=na("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(c?.tab!=null&&c?.subTab!=null&&(t(Tt(c?.tab)),t(Pt(c?.subTab))),()=>{t(ue())}),[]);const p=V.getSignedInUser(),m=v(P=>Z(P)),{areTenantIdsInSync:h}=zn(),[g,b]=f.useState(!1),{useFeatureGate:k}=le(),{isFeatureEnabled:j}=k(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:C}=k(y.isBillPayCommentingEnabled),{isFeatureEnabled:x}=k(y.isReimbursementCommentingEnabled),{isFeatureEnabled:M}=k(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:T}=k(y.isBillPayBulkActionEnabled),{isFeatureEnabled:_}=k(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:$}=k(y.isBillPayDetectInsufficientFundsEnabled),I=v(P=>Ft(P,ne,T,p?.userId)),{isFeatureEnabled:H}=k(y.isDebitCardFeatureEnabled),N=I.fetchState,{isAiCfoAccessEnabled:B,onAskAiCfoClick:q}=Qe({mobileExploreReferrer:"Bills List"});Xe({isDataReady:N==="Completed"});const W=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,U=!!m.companyBillPayInfo?.info?.isBillPayEnabled,K=v(P=>va(P.companyState,m.companyId)),X=K?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!g&&U&&h&&(b(!0),t(Ue(ne,!0,j,_)))},[g,ne,h,t]),p==null)throw Error("Can't access address page without signing in...");const G=(P,de)=>{t(Ba({uiState:{sortKey:P,sortOrder:de},period:ne}))},ee=Rt(r?.loggedInUserRoleMap),F=pe(r?.loggedInUserRoleMap),ce=P=>{o(P)},{billsProcessed:O,billsProcessing:Ce}=v(P=>Ia(P));f.useEffect(()=>{O===Ce&&s!=null&&(t(wa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:O>1?ht.bills:ht.bill},{variableName:"_has_",variableValue:O>1?bt.texts.have:bt.texts.has},{variableName:"_action_",variableValue:Ca(s)}]})),t(xa()),setTimeout(()=>{t(Ue(ne,!0,j,!0,_))},3e3),n(null))},[O,Ce]);const ea={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${Xt}`,`private-encrypted-${m.companyId}.${Le}`]:[],eventCallback:(P,de,et)=>{P.endsWith(Le)?et.onBillPayApprovalRulesEventReceived?.(P):de?.entity_type==="bill"&&(n(de.operation_type),et.onEventReceived(P))}},ta=Vt(H,m),aa=$t(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?ta===!0||aa===!0?a.jsx(Yt,{}):U?a.jsxs(a.Fragment,{children:[N==="Completed"?a.jsx(je,{analytics:D,onLoad:P=>(de=>de.trackPageLoaded(Wt.Event.billPayHome))(P)}):null,a.jsxs(Ei,{windowSize:i,children:[a.jsx(Jt,{isAppContentDrawerOpen:u,handleDrawerToggle:ce}),a.jsx(ui,{isOpen:d,drawerLeftMargin:new Zt(0,0,300,600),onClose:()=>{e("./"),t(ue())},children:a.jsx(Pi,{onClick:P=>P.stopPropagation(),children:a.jsx(Bi,{})})}),a.jsx(Di,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:C,isReimbursementCommentingEnabled:x,period:ne,isAdmin:!1,uiState:I.uiState,onColumnSortConfigChanged:G,isUserHasOnlyBillpayAccess:ee,isShowDeletedBillsEnabled:j,isShowDeletedReimbursementEnabled:M,isBulkActionEnabled:T,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ce(!0)},isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:X,bulkSubmissionLimit:I.billBulkSubmissionLimit,bulkSubmissionFetchState:I.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:I.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:_,isDetectInsufficientFundsEnabled:$,isAiCfoAccessEnabled:B,onAskAiCfoClick:q,...ea})]})]}):W===!0&&F===!0?a.jsx(te,{to:"../setup"}):r!=null&&ze(m,r.loggedInUserRoleMap)?a.jsx(te,{to:"../promo"}):a.jsx(re,{fetchState:N}):a.jsx(Ee,{})}const Ti=e=>`/${e}/bills/setup`,Pi=L(si)`
|
|
89
89
|
display: flex;
|
|
90
90
|
min-height: 100%;
|
|
91
91
|
flex-direction: column;
|
|
92
|
-
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=qe.getLocalizedStrings(),Mi=X(function(e,t){const l=M.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let n=`${l?.firstName} ${l?.lastName}`;const d=De(l);t.billId!=null&&t.billDetailsView!=null&&(n=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(n="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ga(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=Lt(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,k=h.add(b,"month").isAfter(g),j=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!_t(p,t.billDetailsView.approvalRules.allApprovalRules,l),x=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Ct(e),billId:t.billId,createdBy:n,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${We}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:x.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:j,isZeniUser:d,isNewUser:k,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:i,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:n=>{e(it(n));const d=yt(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:n=>{const d=n??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Ot(d,!1)),e(Nt({localData:{vendorName:n??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(it());const p=yt(s,void 0,l),m=E(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:n=>{n!=null&&e(Ne(n,t.isVendorRecommendationEnabled))},updateShowAutofill:n=>{e(Oe(n))},onSaveChangesToLocalStore:(n,d,p,m,h)=>{const g=Li(t.billDetailsView,{...n,paymentDetails:{...n?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ja({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(_e("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Gt("draft"))},reviewBillDetails:()=>{const n=Vi(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:n})=>{e(ke({billId:n}))},clearBillPayReviewLocalState:()=>e(Ka()),onClickDismiss:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:n=>{if(n==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:n=>{e(fe(!1,n));const d=$i(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:n=>{e(fe(!1,n));const d=Ui(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:n=>{e(fe(!1,n));const d=qt(s,l,n),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(n,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(n,d)=>{const p=Te(s,n,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:n.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(n,d){e(qa(n,d,l))},onWiseVerifyClick:()=>{let n="";n=Jn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${n}/login`;window.open(d,"_blank")},onVendorSelected:n=>{e(Wa(!0,n,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(n,d)=>{e(Ha("bill_pay_detail",n,d))},onEstablishConnectionClick:n=>{e(Za(n,i,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(n,d,p)=>{e(za(n,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Oa("bill_pay","bill_pay_detail")),e(Na({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Wn);function gt(){const e=J(),t=Q(),l=se(),{billId:i,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:n}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:k}=r(y.isOurDisabled),{isFeatureEnabled:j}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:x}=u(Ae.zeniAccountsConfig),B=Ua(x),{configValue:_}=u(Ae.sameDayAchDisablementConfig),T=La(_),L=M.getSignedInUser(),V=v(N=>Z(N)),I=v(N=>Ge(N,m,g,i)),H=Kt(V?.companyId,{clearParams:I.fetchState==="Completed"}),{isAiCfoAccessEnabled:G,onAskAiCfoClick:C}=Xe({mobileExploreReferrer:"Bill Details"});Ye({isDataReady:I.fetchState==="Completed"});const q=V.companyId??M.getSignedInUserTenant(c)?.companyId,W=!!V.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=Ie(),K=$t($?.loggedInUserRoleMap),Y=Ut($?.loggedInUserRoleMap),O=pe($?.loggedInUserRoleMap),ee=wt(V.userRole);if(f.useEffect(()=>{i!=null&&l(xt(i))},[i]),L==null)throw Error("Can't access address page without signing in...");const F=v(N=>_a(N.accountState,N.accountListState,"billPayAccountList")),ce={pathname:"../",search:t.search};return I.isDeleted===!0||I.billStage=="paid"||I.fetchState=="Not-Started"?a.jsx(te,{to:ce}):I.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:I.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:N=>(xe=>{i!=null&&I.deleteStatus.fetchState!=="Completed"&&xe.trackBillPayEditBill(i,I.isRecurring)})(N)}),a.jsx(Mi,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:V,billId:i,companyId:q,billDetailsView:I,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:F,isInternationalPaymentShaVsOurEnabled:n,vendor:I.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:k,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:W,hasZeniAccountsAdminAccess:K,isZeniAccountsUser:Y,isBillPayAdmin:O,isSuperAdmin:ee,accountsPromoConfig:B,isDetectInsufficientFundsEnabled:j,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:G,onAskAiCfoClick:C})]})}const yt=(e,t,l)=>{let i=`/${e}/bill/`;return l==null?i=t!=null?i.concat(`new/vendor/${encodeURIComponent(t)}/edit`):i.concat("new/vendor/create"):(i=i.concat(`${encodeURIComponent(l)}/edit/vendor/`),i=t!=null?i.concat(`${encodeURIComponent(t)}/edit`):i.concat("create")),i},Vi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},$i=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),i},Ui=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),i},R="paymentDetails",Li=(e,t,l,i,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Lt(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?be(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[R]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(Qa)&&u?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},n=r?.type==="Contact"?r?.email:void 0,d=!!n,p=t[R]?.recurringPaymentType?.selectedOption===Fi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Xa(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},h=_i(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,i,l),g=Object.keys(h).length>0?qn(h):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:g,recipientTotalAmount:g,file:e.file,updatesByLineId:h,toAccountVendorEmail:n,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},_i=(e,t,l,i,c,r)=>{const u={};return i.forEach(o=>{let s,n;o.account.selectedOption!=null&&(s=e.find(p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(n=t.find(p=>p.classId===o.class.selectedOption));const d=Kn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??Se.currencyCode,currencySymbol:o.currency?.currencySymbol??Se.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??Se.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??Se.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:n,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}}),u},Gi=U.div`
|
|
92
|
+
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=qe.getLocalizedStrings(),Vi=Q(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let n=`${l?.firstName} ${l?.lastName}`;const d=De(l);t.billId!=null&&t.billDetailsView!=null&&(n=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(n="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Na(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=_t(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,k=h.add(b,"month").isAfter(g),j=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Mt(p,t.billDetailsView.approvalRules.allApprovalRules,l),C=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Bt(e),billId:t.billId,createdBy:n,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${We}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:C.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:j,isZeniUser:d,isNewUser:k,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:i,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:n=>{e(it(n));const d=yt(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:n=>{const d=n??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Gt(d,!1)),e(Ot({localData:{vendorName:n??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(it());const p=yt(s,void 0,l),m=E(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:n=>{n!=null&&e(Oe(n,t.isVendorRecommendationEnabled))},updateShowAutofill:n=>{e(Ge(n))},onSaveChangesToLocalStore:(n,d,p,m,h)=>{const g=_i(t.billDetailsView,{...n,paymentDetails:{...n?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ja({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(Me("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Nt("draft"))},reviewBillDetails:()=>{const n=$i(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:n})=>{e(ke({billId:n}))},clearBillPayReviewLocalState:()=>e(Ka()),onClickDismiss:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:n=>{if(n==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:n=>{e(fe(!1,n));const d=Ui(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:n=>{e(fe(!1,n));const d=Li(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:n=>{e(fe(!1,n));const d=qt(s,l,n),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(n,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(n,d)=>{const p=Te(s,n,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:n.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(n,d){e(qa(n,d,l))},onWiseVerifyClick:()=>{let n="";n=Jn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${n}/login`;window.open(d,"_blank")},onVendorSelected:n=>{e(Wa(!0,n,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(n,d)=>{e(Ha("bill_pay_detail",n,d))},onEstablishConnectionClick:n=>{e(Za(n,i,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(n,d,p)=>{e(za(n,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Ga("bill_pay","bill_pay_detail")),e(Oa({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Wn);function gt(){const e=J(),t=Y(),l=se(),{billId:i,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:n}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:k}=r(y.isOurDisabled),{isFeatureEnabled:j}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:C}=u(Ae.zeniAccountsConfig),x=La(C),{configValue:M}=u(Ae.sameDayAchDisablementConfig),T=_a(M),_=V.getSignedInUser(),$=v(O=>Z(O)),I=v(O=>Ne(O,m,g,i)),H=Kt($?.companyId,{clearParams:I.fetchState==="Completed"}),{isAiCfoAccessEnabled:N,onAskAiCfoClick:B}=Qe({mobileExploreReferrer:"Bill Details"});Xe({isDataReady:I.fetchState==="Completed"});const q=$.companyId??V.getSignedInUserTenant(c)?.companyId,W=!!$.companyZeniAccountInfo?.info?.isZeniAccountEnabled,U=Ie(),K=Ut(U?.loggedInUserRoleMap),X=Lt(U?.loggedInUserRoleMap),G=pe(U?.loggedInUserRoleMap),ee=wt($.userRole);if(f.useEffect(()=>{i!=null&&l(Ct(i))},[i]),_==null)throw Error("Can't access address page without signing in...");const F=v(O=>Ma(O.accountState,O.accountListState,"billPayAccountList")),ce={pathname:"../",search:t.search};return I.isDeleted===!0||I.billStage=="paid"||I.fetchState=="Not-Started"?a.jsx(te,{to:ce}):I.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:I.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(Ce=>{i!=null&&I.deleteStatus.fetchState!=="Completed"&&Ce.trackBillPayEditBill(i,I.isRecurring)})(O)}),a.jsx(Vi,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:$,billId:i,companyId:q,billDetailsView:I,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:F,isInternationalPaymentShaVsOurEnabled:n,vendor:I.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:k,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:W,hasZeniAccountsAdminAccess:K,isZeniAccountsUser:X,isBillPayAdmin:G,isSuperAdmin:ee,accountsPromoConfig:x,isDetectInsufficientFundsEnabled:j,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:N,onAskAiCfoClick:B})]})}const yt=(e,t,l)=>{let i=`/${e}/bill/`;return l==null?i=t!=null?i.concat(`new/vendor/${encodeURIComponent(t)}/edit`):i.concat("new/vendor/create"):(i=i.concat(`${encodeURIComponent(l)}/edit/vendor/`),i=t!=null?i.concat(`${encodeURIComponent(t)}/edit`):i.concat("create")),i},$i=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},Ui=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),i},Li=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),i},R="paymentDetails",_i=(e,t,l,i,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):_t(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?be(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[R]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(Ya)&&u?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},n=r?.type==="Contact"?r?.email:void 0,d=!!n,p=t[R]?.recurringPaymentType?.selectedOption===Fi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Qa(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},h=Mi(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,i,l),g=Object.keys(h).length>0?qn(h):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:g,recipientTotalAmount:g,file:e.file,updatesByLineId:h,toAccountVendorEmail:n,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Mi=(e,t,l,i,c,r)=>{const u={};return i.forEach(o=>{let s,n;o.account.selectedOption!=null&&(s=e.find(p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(n=t.find(p=>p.classId===o.class.selectedOption));const d=Kn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??Se.currencyCode,currencySymbol:o.currency?.currencySymbol??Se.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??Se.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??Se.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:n,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}}),u},Ni=L.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
height: 100vh;
|
|
95
95
|
width: 100%;
|
|
@@ -98,7 +98,7 @@ import{j as a}from"./liveblocks-D5IOuNv9.js";import{j as J,h as se,u as Q,l as a
|
|
|
98
98
|
align-items: center;
|
|
99
99
|
background-color: ${e=>e.theme.colors.grey4};
|
|
100
100
|
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
-
`,
|
|
101
|
+
`,Gi=Q(function(e,t){const{vendorId:l,billId:i}=t,c=ve(e,l),r=Ne(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,i);return{billId:i,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:l,navigate:i,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(an(s))},onSaveHandler:()=>{e(tn(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:n}=s;e(en({data:n}))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),n=s.poppedPathname??St();i(n,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ot())},onAddressClick:s=>{const n=Ye(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);i(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Xa({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),n=s.poppedPathname??St(0);t.navigate(n,{state:{pathnameStackToGoBack:s.newStack}}),e(ot())}}})(Yn);function Oi(){const e=J(),t=Y(),l=we(),{vendorId:i,billId:c}=ae(),{useFeatureGate:r}=le(),u=me(),o=V.getSignedInUser(),s=v(g=>Z(g)),n=z(t.state?.pathnameStackToGoBack),d=n.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=v(g=>ve(g,i)),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Ni,{windowSize:l,children:[a.jsx(Je,{vendorId:i,billId:c}),a.jsx(Gi,{location:t,navigate:e,billId:c,vendorId:i,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:h})]})}const St=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},zi=L.div`
|
|
102
102
|
display: flex;
|
|
103
103
|
height: 100vh;
|
|
104
104
|
width: 100%;
|
|
@@ -107,7 +107,7 @@ import{j as a}from"./liveblocks-D5IOuNv9.js";import{j as J,h as se,u as Q,l as a
|
|
|
107
107
|
align-items: center;
|
|
108
108
|
background-color: ${e=>e.theme.colors.grey4};
|
|
109
109
|
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
-
`,Zi=
|
|
110
|
+
`,Zi=Q(function(e,t){const{vendorId:l}=t,i=ve(e,l),c=l!=null?i.editVendorState?.vendorDetailLocalData?.vendorType:i.newVendorState?.vendorDetailLocalData?.vendorType,r=on(e,c||"international_business",t.billId),u=i.editVendorState??i.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[ln(t.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:i,bankAccountContext:t.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}},function(e,t){const{billId:l,navigate:i,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(un(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,n,d,p)=>{e(cn(s)),p&&e(dn(n,d))},onCurrencyUpdated:(s,n,d)=>{e(rn(s,n,d,!1))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),n=s.poppedPathname??ft();i(n,{state:{pathnameStackToGoBack:s.newStack}})})(),e(lt())},onAddressClick:s=>{const n=Ye(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);i(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(sn({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),n=s.poppedPathname??ft(0);t.navigate(n,{state:{pathnameStackToGoBack:s.newStack}}),e(lt())}}})(Qn);function Hi(){const e=J(),t=Y(),l=we(),{vendorId:i,billId:c}=ae(),r=se(),u=me(),o=V.getSignedInUser(),s=v(x=>Z(x)),n=z(t.state?.pathnameStackToGoBack),[d,p]=f.useState(!1),m=v(x=>x.vendorViewState.newVendorState.fetchStatus.fetchState),h=v(x=>i!=null?x.vendorViewState.editVendorStateById[i]?.fetchStatus.fetchState??"Not-Started":"Not-Started"),g=i!==void 0?h:m;f.useEffect(()=>{d===!1&&g==="Not-Started"&&i!=null&&(r(fe(!1,i)),p(!0))},[d,g,i]);const[b,k]=f.useState(!1);f.useEffect(()=>{b||g==="In-Progress"||(k(!0),r(nn(c,i)))},[b,g,r]);const j=n.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",C=v(x=>ve(x,i));if(o==null)throw Error("Can't access international wire page without signing in...");return j==="billDetail"&&C.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:C.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(zi,{windowSize:l,children:[a.jsx(Je,{vendorId:i,billId:c}),a.jsx(Zi,{location:t,navigate:e,billId:c,vendorId:i,currentTenant:s,bankAccountContext:j})]})}const ft=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},kt=L.div`
|
|
111
111
|
display: flex;
|
|
112
112
|
height: 100vh;
|
|
113
113
|
width: 100%;
|
|
@@ -116,4 +116,4 @@ import{j as a}from"./liveblocks-D5IOuNv9.js";import{j as J,h as se,u as Q,l as a
|
|
|
116
116
|
align-items: center;
|
|
117
117
|
background-color: ${e=>e.theme.colors.grey4};
|
|
118
118
|
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
-
`,Wi=X(function(e,t){const l=M.getSignedInUser(),i=zt(e,t.billId),c=mn(e),r=De(l),u=i.totalAmount.amount,o=i.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!_t(u,c.allApprovalRules,l);return{billDetails:i,billId:t.billId,billpayApprovalView:c,analytics:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:i,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ie(c.tenantEmailDomain),s=E(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:i,data:s})),e(_e(o?"paid":"pending_approval",o,!1,i))},discardOutsideZeniPaymentData:()=>{e(At({billId:i}))},updateBillDetailSaveBillCode:()=>{e(Gt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const n=Te(u,o,s);window.open(`${n}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Ce(t.billId,"retry"))}}})(ei);function vt(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=M.getSignedInUser(),{isFeatureEnabled:n}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),m=z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(y.isRecurringBillsFeatureEnabled),b=v(x=>Z(x)),k=v(x=>zt(x,i)),j=k.fetchState??"Not-Started";if(f.useEffect(()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null}),[e]),f.useEffect(()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${i}`)},[]),f.useEffect(()=>{const x=k.vendor?.name,B=k.vendor?.id,_=k.totalAmount.amount,T=k.recipientTotalAmount.amount,L=k.invoiceNumber;x&&B&&t(pn(x,B,_,T,L,i))},[]),h==null)return a.jsx(te,{to:`../${i}`});if(s==null)throw Error("Can't access address page without signing in...");return j==="In-Progress"?a.jsx(kt,{windowSize:o,children:a.jsx(Yn,{})}):a.jsx(kt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:i,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:n,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=X(function(e,t){const{vendorId:l}=t,i=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=M.getSignedInUser(),s=u.tenantId,n={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:n,analytics:D,vendorSearchAutoCompleteData:{autoCompleteText:i,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:i,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=i;return{onSaveVendor:n=>{e(Cn(u??void 0,t.billId)),n!=null&&e(An(n))},saveVendorDetailLocalData:n=>{e(Nt({vendorId:u,localData:n}))},saveContactsInVendorDetailLocalData:n=>{e(Bn({vendorId:u,contacts:n}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:n=>{e(xn(n))},navigateToBankDetailPage:(n,d)=>{let p;n==="wire"?p=d==="international"?qt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(n,d)=>{e(d===!0?In(n,"vendor",u):wn(n,"vendor",u))},navigateToMailingAddressPage:n=>{const d=Qe(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:n=>{e(vn({files:n}))},onEditFileName:(n,d)=>{e(kn(n,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:n=>{n!=null&&e(Sn(n,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ri(i.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:n.newStack}})},onGetOtp:n=>{e(yn(n,"BillPayVendor"))},onResendOtp:n=>{e(gn(n,"BillPayVendor"))},onVerifyOtp:(n,d)=>{e(hn(n,d,"BillPayVendor"))},onVerifyOtpSuccess:(n,d,p)=>{e(bn(n,d,p))},onFetchAndUpdateVendorRecommendations:n=>{e(Ot(n,!1))}}})(ii),Be=()=>{const e=J(),t=se(),l=ti(),i=Q(),{billId:c,vendorId:r}=ae(),u=v(b=>Z(b)),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[n,d]=f.useState(!1),p=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),m=v(b=>ve(b,r)),h=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),g=r!==void 0?h:p;return f.useEffect(()=>{n===!1&&g==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[n,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ai,{}):g==="Error"?a.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Je,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:i,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ki=X(function(e,t){const{companyId:l}=t;return{billPaySetupView:En(e,l),analytics:D,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}},function(e,t){const{companyId:l,navigate:i}=t;return{onButtonClick:()=>{e(Dn(l))},onBackClick:()=>{i("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{i("../bills/setup",{relative:"path"})}}})(oi),Ji=()=>{const e=J(),t=Q(),{tenantEmailDomain:l}=ae(),[i,c]=f.useState(!1),r=me(),u=v(h=>Z(h)),o=u.companyId??M.getSignedInUserTenant(l)?.companyId,s=M.getSignedInUser(),n=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(n?.loggedInUserRoleMap),m=h=>{c(h)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(te,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(te,{to:"../../bills/setup"}):d===!1||n!=null&&ze(u,n.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Jt,{isAppContentDrawerOpen:i,handleDrawerToggle:m}),a.jsx(Ki,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{m(!0)}})]}):a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function jo(){const e=v(G=>Z(G)),t=Ie(),l=pe(t?.loggedInUserRoleMap),i=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Ni,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Mt(o,e),n=Vt(e),d=Q(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Rt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&jn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),k=b&&!p&&$t(t?.loggedInUserRoleMap),{isFeatureEnabled:j}=c(y.isChargeCardFeatureEnabled),x=li(e,j,o)&&!p&&Tn(t?.loggedInUserRoleMap),B=Pn(t?.loggedInUserRoleMap),_=Ut(t?.loggedInUserRoleMap),T=Fn(t?.loggedInUserRoleMap),L=Rn(t?.loggedInUserRoleMap),V=Mn(t?.loggedInUserRoleMap),I=Vn(t?.loggedInUserRoleMap),{tenantEmailDomain:H}=ae();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Ji,{})}),a.jsx(S,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{isUserHasZeniAccountsAccess:_,isUserHasChargeCardAccess:L,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:T,isTenantBankingOnly:s,tenantEmailDomain:H??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(ji,{})}),(s===!0||n===!0)&&a.jsx(S,{path:"/*",element:a.jsx(Qt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:":billId",element:a.jsx(w,{appContent:a.jsx(hi,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]}):a.jsx(S,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${i.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]})}export{jo as default};
|
|
119
|
+
`,Wi=Q(function(e,t){const l=V.getSignedInUser(),i=zt(e,t.billId),c=mn(e),r=De(l),u=i.totalAmount.amount,o=i.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Mt(u,c.allApprovalRules,l);return{billDetails:i,billId:t.billId,billpayApprovalView:c,analytics:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:i,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ie(c.tenantEmailDomain),s=E(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:i,data:s})),e(Me(o?"paid":"pending_approval",o,!1,i))},discardOutsideZeniPaymentData:()=>{e(At({billId:i}))},updateBillDetailSaveBillCode:()=>{e(Nt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const n=Te(u,o,s);window.open(`${n}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Be(t.billId,"retry"))}}})(ei);function vt(){const e=J(),t=se(),l=Y(),{billId:i}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=V.getSignedInUser(),{isFeatureEnabled:n}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),m=z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(y.isRecurringBillsFeatureEnabled),b=v(C=>Z(C)),k=v(C=>zt(C,i)),j=k.fetchState??"Not-Started";if(f.useEffect(()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null}),[e]),f.useEffect(()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${i}`)},[]),f.useEffect(()=>{const C=k.vendor?.name,x=k.vendor?.id,M=k.totalAmount.amount,T=k.recipientTotalAmount.amount,_=k.invoiceNumber;C&&x&&t(pn(C,x,M,T,_,i))},[]),h==null)return a.jsx(te,{to:`../${i}`});if(s==null)throw Error("Can't access address page without signing in...");return j==="In-Progress"?a.jsx(kt,{windowSize:o,children:a.jsx(Xn,{})}):a.jsx(kt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:i,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:n,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=Q(function(e,t){const{vendorId:l}=t,i=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=V.getSignedInUser(),s=u.tenantId,n={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:n,analytics:D,vendorSearchAutoCompleteData:{autoCompleteText:i,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:i,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=i;return{onSaveVendor:n=>{e(Bn(u??void 0,t.billId)),n!=null&&e(An(n))},saveVendorDetailLocalData:n=>{e(Ot({vendorId:u,localData:n}))},saveContactsInVendorDetailLocalData:n=>{e(xn({vendorId:u,contacts:n}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:n=>{e(Cn(n))},navigateToBankDetailPage:(n,d)=>{let p;n==="wire"?p=d==="international"?qt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(n,d)=>{e(d===!0?In(n,"vendor",u):wn(n,"vendor",u))},navigateToMailingAddressPage:n=>{const d=Ye(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:n=>{e(vn({files:n}))},onEditFileName:(n,d)=>{e(kn(n,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:n=>{n!=null&&e(Sn(n,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ri(i.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:n.newStack}})},onGetOtp:n=>{e(yn(n,"BillPayVendor"))},onResendOtp:n=>{e(gn(n,"BillPayVendor"))},onVerifyOtp:(n,d)=>{e(hn(n,d,"BillPayVendor"))},onVerifyOtpSuccess:(n,d,p)=>{e(bn(n,d,p))},onFetchAndUpdateVendorRecommendations:n=>{e(Gt(n,!1))}}})(ii),xe=()=>{const e=J(),t=se(),l=ti(),i=Y(),{billId:c,vendorId:r}=ae(),u=v(b=>Z(b)),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[n,d]=f.useState(!1),p=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),m=v(b=>ve(b,r)),h=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),g=r!==void 0?h:p;return f.useEffect(()=>{n===!1&&g==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[n,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ai,{}):g==="Error"?a.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Je,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:i,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ki=Q(function(e,t){const{companyId:l}=t;return{billPaySetupView:En(e,l),analytics:D,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}},function(e,t){const{companyId:l,navigate:i}=t;return{onButtonClick:()=>{e(Dn(l))},onBackClick:()=>{i("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{i("../bills/setup",{relative:"path"})}}})(oi),Ji=()=>{const e=J(),t=Y(),{tenantEmailDomain:l}=ae(),[i,c]=f.useState(!1),r=me(),u=v(h=>Z(h)),o=u.companyId??V.getSignedInUserTenant(l)?.companyId,s=V.getSignedInUser(),n=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(n?.loggedInUserRoleMap),m=h=>{c(h)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(te,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(te,{to:"../../bills/setup"}):d===!1||n!=null&&ze(u,n.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Jt,{isAppContentDrawerOpen:i,handleDrawerToggle:m}),a.jsx(Ki,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{m(!0)}})]}):a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function jo(){const e=v(N=>Z(N)),t=Ie(),l=pe(t?.loggedInUserRoleMap),i=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Oi,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Vt(o,e),n=$t(e),d=Y(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Rt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&jn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),k=b&&!p&&Ut(t?.loggedInUserRoleMap),{isFeatureEnabled:j}=c(y.isChargeCardFeatureEnabled),C=li(e,j,o)&&!p&&Tn(t?.loggedInUserRoleMap),x=Pn(t?.loggedInUserRoleMap),M=Lt(t?.loggedInUserRoleMap),T=Fn(t?.loggedInUserRoleMap),_=Rn(t?.loggedInUserRoleMap),$=Vn(t?.loggedInUserRoleMap),I=$n(t?.loggedInUserRoleMap),{tenantEmailDomain:H}=ae();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:x,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:x,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Ji,{})}),a.jsx(S,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{isUserHasZeniAccountsAccess:M,isUserHasChargeCardAccess:_,isUserHasBillPayAccess:$,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:T,isTenantBankingOnly:s,tenantEmailDomain:H??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:x,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(ji,{})}),(s===!0||n===!0)&&a.jsx(S,{path:"/*",element:a.jsx(Yt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:":billId",element:a.jsx(w,{appContent:a.jsx(hi,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]}):a.jsx(S,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${i.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]})}export{jo as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as T}from"./liveblocks-Hyy2O23M.js";import{a as V}from"./sentry-BTyPPF0t.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-D1cXuJMi.js";import{c as ce,C as ue,aK as de,z as E,x as pe,d as z,ac as x,f as B,bu as le,aq as me,j as P,ar as R}from"./index-Dr8ZNfvJ.js";import{Ne as fe,eQ as G,s8 as ye,HG as Se,xV as ge,AC as Ie,D9 as he,DO as be,EH as De,NB as Oe,NC as ke,ND as Te,NE as Ce,NF as Ve,K8 as Ne,MD as we,Kk as Ae,ki as _e,fC as Fe,fB as ve,fA as xe,q9 as Be,q0 as Ee,pZ as ze,ka as Pe,sh as Re,sf as M,bE as L,st as U,cv as Me}from"./zeni-epic-state-CbUjX_b3.js";import{n as Le}from"./mui-B2prtfNk.js";import{d as j}from"./routePaths-Dx_nnKk7.js";import{M as Ue}from"./MobileAppDrawer-D8M7VXe9.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]="c689f406-449a-432a-b9cc-8e70f3114388",e._sentryDebugIdIdentifier="sentry-dbid-c689f406-449a-432a-b9cc-8e70f3114388")}catch{}})();const je=Le.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-D5IOuNv9.js";import{a as V}from"./sentry-Ctx5hlx
|
|
|
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=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=Ne(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=we(e.companyConfigState),s=Ae(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:k,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:N,stateOfIncorporation:w,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:K,transactionVolume:Z,transactionVolumeDescription:H,purposeOfAccount:$,purposeOfAccountDescription:Q,regulatedStatus:W,regulatedStatusDescription:J,usNexus:X,usNexusTypes:Y}=t,F=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:k,taxIdOrEIN:g,website:m!=""&&m!=null?Me(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:N?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:K,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:$?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:W??"",regulatedStatusDescription:J,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(U({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:k,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:N,userVerificationStatus:w,treasuryUserVerificationStatus:A,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:k,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:N,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(M(i,t,r))},onSendForVerificationClick:t=>{e(M(i,t,r,!0))},onAddressClick:t=>{const s=j(b,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(b,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(ze(t))},onDeleteFileList:t=>{e(Ee(t))},onEditFileName:(t,s)=>{e(Be(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),Xe=({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),k=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??E.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]),E.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=Te(a,n);break;case"reimbursement":o=ke(a,n);break;default:o=Oe(a,n)}return o});return u===!1?T.jsx(oe,{to:"../promo"}):T.jsxs(je,{children:[T.jsx(pe,{analytics:z,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(B.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(B.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(B.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?T.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,T.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:z,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:k.maxInsuredAmount})]})};export{Xe as B};
|