@zeniai/web-app-ui 5.0.73-qa → 5.0.74-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.
Files changed (112) hide show
  1. package/dist/assets/AddressRoutes-oYMlFQPx.js +1 -0
  2. package/dist/assets/AddressScreen-DuqDDwbX.js +9 -0
  3. package/dist/assets/{AiCfoScreen-BuWzYLYw.js → AiCfoScreen-DmlMKQ45.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-Bt8Z0pVh.js → BillPayApprovalRoutes-ZlmnVSSW.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D5KWvYEu.js → BillPayRoutes-CeziCNtw.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-B4Ydn5q-.js → BusinessVerificationPageScreen--aJrL6sY.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-ClxIUSvt.js → ChargeCardRoutes-Bseixdt5.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-C-PG6LRZ.js → CompanyPassportScreen-DZYGX7Ak.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-SPlAQ_Np.js → ConnectionAuthScreen-DYlxkvSU.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-CtksFbgx.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-DPukj_Rw.js → CustomerOnboardingRoutes-BmEKqRSj.js} +3 -3
  12. package/dist/assets/{DashboardRoutes-hwqRQl7V.js → DashboardRoutes-CogbIDn5.js} +4 -4
  13. package/dist/assets/{DefaultTenantHome-CJT8TR8y.js → DefaultTenantHome-BNhdpEJE.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-D0FJ0DFE.js → DomesticWireDetailScreen-DOvHZ_oC.js} +3 -3
  15. package/dist/assets/DrawerScreen-DwJwVhuI.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-OIVD1I9e.js → EntityDetailRoutes-B5Mz_0tK.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-Bddv7sbf.js → ExpenseAutomationRoutes-43io-wzv.js} +4 -4
  18. package/dist/assets/{FeaturePreviewScreen-BlSIKXFS.js → FeaturePreviewScreen-BCjtGP_L.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-CLjAH-ee.js → HubSpotOAuthCallbackScreen-DP_xp7gX.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-BQnKzZaB.js → MagicLinkRoutes-5gC2RMuC.js} +6 -6
  21. package/dist/assets/{MagicLinkSignInScreen-uHKvnjU8.js → MagicLinkSignInScreen-1TZssQ2L.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-Dm68rJiS.js → MobileAppDrawer-CKb5yG63.js} +1 -1
  23. package/dist/assets/NotFoundScreen-DuU91hRO.js +1 -0
  24. package/dist/assets/{NotificationRoutes-YFiOMG6k.js → NotificationRoutes-thxZPpjj.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-kpejh2UL.js → OAuthConsentScreen-COOk_lDh.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-DOPekVsK.js → PandLWithForecastRoutes-BHTypoFG.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-CHh9S1ES.js → PeopleRoutes-BKLG-Nkw.js} +4 -4
  28. package/dist/assets/PerformanceRoutes-DZWxI-5H.js +1 -0
  29. package/dist/assets/{Preview-63x8M4Zb.js → Preview-DzpWuMNc.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-CVxTOUos.js → QBOConnectionScreen-Bsxzkv43.js} +1 -1
  31. package/dist/assets/ReferralListScreen-Dg_jKXHY.js +5 -0
  32. package/dist/assets/{ReimbursementApprovalRoutes-BXvb2Znx.js → ReimbursementApprovalRoutes-UcfqpWRh.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-obTxBD8v.js → ReimbursementApprovalRuleDetailScreen-EaQ9JUjP.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-DzuMZgdz.js → ReimbursementRoutes-DxXqSY1z.js} +5 -5
  35. package/dist/assets/{ReportsRoutes-Du1FN7AL.js → ReportsRoutes-CzzokNSO.js} +1 -1
  36. package/dist/assets/RewardsRoutes-C7-632Cj.js +1 -0
  37. package/dist/assets/{ScreenRoutes-C1s0Nxp2.js → ScreenRoutes-scBYKN6D.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-CvzF47Mb.js → SettingsRoutes-C1mTTPPp.js} +7 -7
  39. package/dist/assets/{SetupPagesScreen-D9to9dY7.js → SetupPagesScreen-CMNbCjoJ.js} +1 -1
  40. package/dist/assets/{SignInScreen-C-T0IXf6.js → SignInScreen-Bw9YZhPQ.js} +1 -1
  41. package/dist/assets/{SignOutScreen-Czon70VP.js → SignOutScreen-CP-AKuF8.js} +1 -1
  42. package/dist/assets/{TaskListScreen-Xzvf8Hgp.js → TaskListScreen-B8MV3xma.js} +2 -2
  43. package/dist/assets/TaskRoutes-CC0KU-1O.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-BY0yRYBD.js +1 -0
  45. package/dist/assets/{TransactionDetailScreen-Cx4z6equ.js → TransactionDetailScreen-CrO7VjQP.js} +2 -2
  46. package/dist/assets/TransactionListRoutes-D1V74e9e.js +1 -0
  47. package/dist/assets/{TreasuryRoutes-Bsh24hmh.js → TreasuryRoutes-fdgElXNz.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-Dghnmhef.js → VendorsRoutes-D5J5iuOk.js} +1 -1
  49. package/dist/assets/WiseConfirmationScreen-CQWm6HGp.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-BwL43X6f.js → ZeniAccountRoutes-Dw3YCzKk.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-CXCXyV_O.js → ZeniAccountStatementScreen-YrMsUI59.js} +1 -1
  52. package/dist/assets/{accountMappingHelper-DEVWShIB.js → accountMappingHelper-CP3zTfM5.js} +1 -1
  53. package/dist/assets/{analytics-CLyVqw3m.js → analytics-TpOPKTBE.js} +1 -1
  54. package/dist/assets/{analyticsHelper-C6OV8Lji.js → analyticsHelper-C6rQwSxW.js} +1 -1
  55. package/dist/assets/{core-B8DAi0nh.js → core-DR8tDM_G.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-2RJaUBNT.js → decodeURIComponentSafe-BRa5aIWn.js} +1 -1
  57. package/dist/assets/{dnd-DNrenqEc.js → dnd-Tv7XXetM.js} +1 -1
  58. package/dist/assets/{empty-CMYkwe6B.js → empty-NmpZ4nNi.js} +1 -1
  59. package/dist/assets/{empty-D1H0TyYI.js → empty-oHPXgZDu.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-89AhO6II.js → emptyVideoElement-8zuBwn96.js} +1 -1
  61. package/dist/assets/{epic-occCJYrK.js → epic-BA-x1krm.js} +1 -1
  62. package/dist/assets/{getLocaleForTenant-CzzxyTLH.js → getLocaleForTenant-DmihGqyc.js} +1 -1
  63. package/dist/assets/{index-DXkdnQWz.js → index-B3GU_r7Y.js} +1 -1
  64. package/dist/assets/{index-CVyF-mcC.js → index-BUaPDlId.js} +1 -1
  65. package/dist/assets/{index-CrWxCSey.js → index-BXSudR0L.js} +1 -1
  66. package/dist/assets/{index-eEUBMv7A.js → index-B_HEzhpc.js} +1 -1
  67. package/dist/assets/{index-CrhTmqTp.js → index-CjFymAYP.js} +8920 -8911
  68. package/dist/assets/{index-orAkddId.js → index-DvDHGUrV.js} +1 -1
  69. package/dist/assets/{index-LbX_nh30.js → index-LDid1hRj.js} +2 -2
  70. package/dist/assets/{index-o5I9Rsf6.js → index-YEViLwBF.js} +1 -1
  71. package/dist/assets/{lexical-BbcB7U6u.js → lexical-XdnXYpvk.js} +1 -1
  72. package/dist/assets/{liveblocks-6nZkQHFl.js → liveblocks-DH0u65Kt.js} +1 -1
  73. package/dist/assets/{lottie-Cp94NU-O.js → lottie-DXjy-4kQ.js} +1 -1
  74. package/dist/assets/{mui-DOBONCVx.js → mui-EgTXI2De.js} +1 -1
  75. package/dist/assets/{pathToGoBack-CuzLi8kB.js → pathToGoBack-Dzbxi3-3.js} +1 -1
  76. package/dist/assets/{pdf-B9LwAnPJ.js → pdf-C1ZWoPlC.js} +4 -4
  77. package/dist/assets/{pdf-lib-B6W-Zb6c.js → pdf-lib-D_Q1qkRs.js} +1 -1
  78. package/dist/assets/{plaid-BJER8-rG.js → plaid-C9BN4j5u.js} +1 -1
  79. package/dist/assets/{pusher-BKAvW8Ej.js → pusher-CrhyJDIe.js} +1 -1
  80. package/dist/assets/{react-XdIGJaYE.js → react-AvYNnxbu.js} +1 -1
  81. package/dist/assets/{react-Ch8Qff_2.js → react-BvYpSoIW.js} +1 -1
  82. package/dist/assets/{react-DZuEKM1F.js → react-CUhJjbx2.js} +1 -1
  83. package/dist/assets/{react-BsAtiQ73.js → react-CnsEuq7i.js} +1 -1
  84. package/dist/assets/{react-m-TEyxm9.js → react-CqNkdHXi.js} +1 -1
  85. package/dist/assets/{react-Az4VFoYA.js → react-DLMbYpVK.js} +1 -1
  86. package/dist/assets/{recharts-CDgByeDS.js → recharts-BN9u8kqw.js} +1 -1
  87. package/dist/assets/{routePaths-9AUhVaii.js → routePaths-BSK2K3Sa.js} +1 -1
  88. package/dist/assets/{sentry-Dr5FPm4d.js → sentry-Z2EfLBjp.js} +1 -1
  89. package/dist/assets/{url-DhbS62gt.js → url-DYeBp6T3.js} +1 -1
  90. package/dist/assets/{url-CgpVackm.js → url-ce6M3nR5.js} +1 -1
  91. package/dist/assets/useAskAiCfoHostNavButtonProps-CT7gco_a.js +1 -0
  92. package/dist/assets/{useDeviceId-fW8BPEnA.js → useDeviceId-DAVwENt1.js} +1 -1
  93. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-Z1RjapDK.js → useFetchSuggestedQuestionsWhenReady-CQWT0XHy.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-D2GYlrz4.js → useInitialThreadRequest-XTK7FDn_.js} +1 -1
  95. package/dist/assets/{utils-XBrV3QeH.js → utils-CYYHm9mY.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-C0vsYVl3.js → withTransactionSidePanel-DlYx7LYJ.js} +1 -1
  97. package/dist/assets/{zeni-epic-state-DITtSXPQ.js → zeni-epic-state-TB4o69vJ.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +2 -2
  100. package/dist/assets/AddressRoutes-BNwO1euv.js +0 -1
  101. package/dist/assets/AddressScreen-CQqRda3s.js +0 -9
  102. package/dist/assets/CustomerOnboardingAuthScreen-BLm7f-pp.js +0 -1
  103. package/dist/assets/DrawerScreen-BJd9OmNB.js +0 -1
  104. package/dist/assets/NotFoundScreen-DsEEwwTx.js +0 -1
  105. package/dist/assets/PerformanceRoutes-BH98gSrX.js +0 -1
  106. package/dist/assets/ReferralListScreen-bP3lCOJY.js +0 -5
  107. package/dist/assets/RewardsRoutes-Be9Ge6Wf.js +0 -1
  108. package/dist/assets/TaskRoutes-DCXtf0K8.js +0 -9
  109. package/dist/assets/TransactionDetailRoutes-BTqPhOdT.js +0 -1
  110. package/dist/assets/TransactionListRoutes-DRiy7_ZT.js +0 -1
  111. package/dist/assets/WiseConfirmationScreen-D2hivvGc.js +0 -12
  112. package/dist/assets/useAskAiCfoHostNavButtonProps-DH6rjWyj.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-DH0u65Kt.js";import{A as i}from"./AddressScreen-DuqDDwbX.js";import s from"./NotFoundScreen-DuU91hRO.js";import"./sentry-Z2EfLBjp.js";import{n as d,o as r}from"./core-DR8tDM_G.js";import"./zeni-epic-state-TB4o69vJ.js";import"./recharts-BN9u8kqw.js";import"./index-CjFymAYP.js";import"./mui-EgTXI2De.js";import"./analytics-TpOPKTBE.js";import"./plaid-C9BN4j5u.js";import"./dnd-Tv7XXetM.js";import"./stripe-DMRn4zHo.js";import"./lottie-DXjy-4kQ.js";import"./lexical-XdnXYpvk.js";import"./pdf-C1ZWoPlC.js";import"./utils-CYYHm9mY.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};
@@ -0,0 +1,9 @@
1
+ import{j as r}from"./liveblocks-DH0u65Kt.js";import{a as S}from"./sentry-Z2EfLBjp.js";import{j as T,h as _,u as E,l as j,g as B,k as M}from"./core-DR8tDM_G.js";import{Z as $,m as D,z as L,k as K,B as F,s as G,c as C,e as m,i as J,f as h,p as z}from"./index-CjFymAYP.js";import{JE as k,gW as O,eO as R,JF as U,c1 as N,JG as V,kg as q}from"./zeni-epic-state-TB4o69vJ.js";import{n as H}from"./mui-EgTXI2De.js";import W from"./NotFoundScreen-DuU91hRO.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]="aa0ab6ad-6b24-43be-b4e4-0b79ccba5d03",e._sentryDebugIdIdentifier="sentry-dbid-aa0ab6ad-6b24-43be-b4e4-0b79ccba5d03")}catch{}})();const Z=H.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,Q=M(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=R(e),a=t.roleMap!=null&&U(t.roleMap),d=i||c==="user_address"||N(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=V(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=z(d?.pathnameStackToGoBack);let s=n.poppedPathname??w();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=X(a);e(q({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(m.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)}}})(J);function re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=_(),n=E(),{addressId:s,addressType:u}=j(),g=$(),I=D(),v=L.getSignedInUser(),[p,x]=S.useState(s==null),f=B(b=>s!=null?k(b,s).fetchState:"Not-Started"),A=K();if(v==null)throw Error("Can't access address page without signing in...");const P=b=>b.trackPageLoaded(s!=null?m.Event.editAddress:m.Event.addAddress),y=l??u;return S.useEffect(()=>{p||s==null||(x(!0),d(O(s,!1)))},[p,s,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!p&&f==="Not-Started"||p&&f==="In-Progress"?r.jsx(F,{fetchState:f,style:{backgroundColor:I.colors.grey5}}):s!=null&&f==="Error"?(a(`${w(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(G,{analytics:C,onLoad:P}),r.jsx(Z,{windowSize:g,children:r.jsx(Q,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):r.jsx(W,{})}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{re as A,X as t};
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-6nZkQHFl.js";import{a as l}from"./sentry-Dr5FPm4d.js";import{h as ue,j as me,u as pe,g as V,l as he,k as fe}from"./core-B8DAi0nh.js";import{Q as Se,cJ as ge,z as Ce,Z as ke,cK as be,cL as we,cM as $,cN as Ie,cO as Y,p as U,w as q,c as T,cP as z,cQ as Ee,V as Pe,e as Te,a3 as ye,cR as xe,W as _e,n as ve,aY as Oe,cS as Ae}from"./index-CrhTmqTp.js";import{fE as Qe,f3 as J,eO as Ue,hA as De,Qc as je,eN as Fe,hK as Be,hG as Le,fu as W,fo as Re,fh as Me,fl as H,fp as Ge,fq as Ne,fr as Ve,fs as $e,ft as qe}from"./zeni-epic-state-DITtSXPQ.js";import{D as ze,n as b,S as We,P as He}from"./mui-DOBONCVx.js";import{p as Ke}from"./pathToGoBack-CuzLi8kB.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.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]="34224ee8-794d-4999-98bd-a0a8149dccb4",s._sentryDebugIdIdentifier="sentry-dbid-34224ee8-794d-4999-98bd-a0a8149dccb4")}catch{}})();const Z="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===Z&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,p=Ne(n.type),u=n.metadata.chat_session_id??null,{currentChatSession:a,currentQuestionAnswer:w,currentQuestionAnswerSummary:y}=Y(C,u);p!=="answer"?T.trackAICFOChatResponseGenerated(p,w?.question.questionText??"",n.text,u,Ae(y,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,Ve(n.visualization?.type??"")??null,u,n.summarized_title,n.metadata.message_id??null),s($e({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(Re({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(ye(xe)),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=V(i=>J(i)),e=Ce.getSignedInUser(),{session_id:o}=he(),n=ke(),p=Pe(n),u=V(i=>Ue(i)),a=d.uiState.currentChatSessionId,w=u.tenantEmailDomain,{handleUploadPromoClose:y,isUploadPromoVisible:X}=be({isFileUploadEnabled:s,tenantEmailDomain:w}),x=we({currentTenant:u,currentChatSessionId:a,aiCfoView:d}),I=c.state,E=I?.aiCfoInitialQuestion,D=!!I?.aiCfoShouldSubmit;l.useEffect(()=>{const i=c.state;if(i?.[$]!==!0)return;f(!0);const g={...i};delete g[$],m(c,{replace:!0,state:g})},[c.pathname,c.search,c.state,m]);const[ee,_]=l.useState(null),[te,v]=l.useState(!1),j=l.useRef(!1);l.useEffect(()=>{j.current||E==null||E===""||(_(E),v(D),j.current=!0)},[E,D]);const ae=l.useCallback(()=>{_(null),v(!1)},[]),F=l.useMemo(()=>new URLSearchParams(c.search),[c.search]),B=F.get("ref")??I?.aiCfoRef,O=F.get("emailRefId")??I?.aiCfoEmailRefId,L=l.useRef(!1);l.useEffect(()=>{L.current||B!=="month-end-email"||O==null||a!=null||e==null||(t(De("controller",e.userId,O,"MONTH_END_EMAIL")),L.current=!0)},[B,O,a,t,e]);const P=d.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&a!=null&&(_(P),v(!0),t(je()))},[P,a,t]);const se=u.masterTOSInfo,k=se?.isMasterTOSAccepted??!1,{visitedSessions:R}=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),N=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:oe}=Y(N,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:R.map(i=>`private-encrypted-chat-${i}.${Z}`),eventCallback:(i,g,de)=>de.onEventReceived(i,g)}),[R]);l.useEffect(()=>{A!=="In-Progress"&&Q&&t(Be())},[A,Q,t]),l.useEffect(()=>{a!=null&&M!=="In-Progress"&&G&&e!=null&&A==="Completed"&&!Q&&t(Le(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(Ze,{children:[h.jsx(q,{analytics:T,onLoad:re}),x.drawerElement,h.jsx(Xe,{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&&x.drawerElement,h.jsx(Ye,{...le,currentChatSessionId:a,allSessionsWithOrderedQuestionAnswers:N,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?x.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:X,onUploadPromoClose:y}),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)`
1
+ import{j as h}from"./liveblocks-DH0u65Kt.js";import{a as l}from"./sentry-Z2EfLBjp.js";import{h as ue,j as me,u as pe,g as V,l as he,k as fe}from"./core-DR8tDM_G.js";import{Q as Se,cJ as ge,z as Ce,Z as ke,cK as be,cL as we,cM as $,cN as Ie,cO as Y,p as U,s as q,c as T,cP as z,cQ as Ee,V as Pe,e as Te,a3 as ye,cR as xe,W as _e,j as ve,aY as Oe,cS as Ae}from"./index-CjFymAYP.js";import{fE as Qe,f3 as J,eO as Ue,hA as De,Qc as je,eN as Fe,hK as Be,hG as Le,fu as W,fo as Re,fh as Me,fl as H,fp as Ge,fq as Ne,fr as Ve,fs as $e,ft as qe}from"./zeni-epic-state-TB4o69vJ.js";import{D as ze,n as b,S as We,P as He}from"./mui-EgTXI2De.js";import{p as Ke}from"./pathToGoBack-Dzbxi3-3.js";import"./recharts-BN9u8kqw.js";import"./analytics-TpOPKTBE.js";import"./plaid-C9BN4j5u.js";import"./dnd-Tv7XXetM.js";import"./stripe-DMRn4zHo.js";import"./lottie-DXjy-4kQ.js";import"./lexical-XdnXYpvk.js";import"./pdf-C1ZWoPlC.js";import"./utils-CYYHm9mY.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]="501ddadf-1de8-43ce-bc6a-37e616002144",s._sentryDebugIdIdentifier="sentry-dbid-501ddadf-1de8-43ce-bc6a-37e616002144")}catch{}})();const Z="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===Z&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,p=Ne(n.type),u=n.metadata.chat_session_id??null,{currentChatSession:a,currentQuestionAnswer:w,currentQuestionAnswerSummary:y}=Y(C,u);p!=="answer"?T.trackAICFOChatResponseGenerated(p,w?.question.questionText??"",n.text,u,Ae(y,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,Ve(n.visualization?.type??"")??null,u,n.summarized_title,n.metadata.message_id??null),s($e({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(Re({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(ye(xe)),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=V(i=>J(i)),e=Ce.getSignedInUser(),{session_id:o}=he(),n=ke(),p=Pe(n),u=V(i=>Ue(i)),a=d.uiState.currentChatSessionId,w=u.tenantEmailDomain,{handleUploadPromoClose:y,isUploadPromoVisible:X}=be({isFileUploadEnabled:s,tenantEmailDomain:w}),x=we({currentTenant:u,currentChatSessionId:a,aiCfoView:d}),I=c.state,E=I?.aiCfoInitialQuestion,D=!!I?.aiCfoShouldSubmit;l.useEffect(()=>{const i=c.state;if(i?.[$]!==!0)return;f(!0);const g={...i};delete g[$],m(c,{replace:!0,state:g})},[c.pathname,c.search,c.state,m]);const[ee,_]=l.useState(null),[te,v]=l.useState(!1),j=l.useRef(!1);l.useEffect(()=>{j.current||E==null||E===""||(_(E),v(D),j.current=!0)},[E,D]);const ae=l.useCallback(()=>{_(null),v(!1)},[]),F=l.useMemo(()=>new URLSearchParams(c.search),[c.search]),B=F.get("ref")??I?.aiCfoRef,O=F.get("emailRefId")??I?.aiCfoEmailRefId,L=l.useRef(!1);l.useEffect(()=>{L.current||B!=="month-end-email"||O==null||a!=null||e==null||(t(De("controller",e.userId,O,"MONTH_END_EMAIL")),L.current=!0)},[B,O,a,t,e]);const P=d.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&a!=null&&(_(P),v(!0),t(je()))},[P,a,t]);const se=u.masterTOSInfo,k=se?.isMasterTOSAccepted??!1,{visitedSessions:R}=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),N=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:oe}=Y(N,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:R.map(i=>`private-encrypted-chat-${i}.${Z}`),eventCallback:(i,g,de)=>de.onEventReceived(i,g)}),[R]);l.useEffect(()=>{A!=="In-Progress"&&Q&&t(Be())},[A,Q,t]),l.useEffect(()=>{a!=null&&M!=="In-Progress"&&G&&e!=null&&A==="Completed"&&!Q&&t(Le(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(Ze,{children:[h.jsx(q,{analytics:T,onLoad:re}),x.drawerElement,h.jsx(Xe,{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&&x.drawerElement,h.jsx(Ye,{...le,currentChatSessionId:a,allSessionsWithOrderedQuestionAnswers:N,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?x.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:X,onUploadPromoClose:y}),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
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-6nZkQHFl.js";import{a as y}from"./sentry-Dr5FPm4d.js";import{j as B,u as U,h as j,g as v,N as O,k as T,l as $,n as F,o as h}from"./core-B8DAi0nh.js";import{eO as N,MX as R,MD as b,xp as x,xj as L,xn as I,xc as M,MF as q,xf as z,xr as W,xq as E}from"./zeni-epic-state-DITtSXPQ.js";import{m as P,z as k,B as V,a3 as X,by as G,ac as _,bz as H}from"./index-CrhTmqTp.js";import"./mui-DOBONCVx.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-obTxBD8v.js";import K from"./NotFoundScreen-DsEEwwTx.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]="496507a6-e6f9-4345-aa2b-74fcd44e3c5b",e._sentryDebugIdIdentifier="sentry-dbid-496507a6-e6f9-4345-aa2b-74fcd44e3c5b")}catch{}})();const w="bill-approval-rule-update",Q=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:n}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(q(!1))},onBackClick:()=>{_(n)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(X(G)),Y=()=>{const e=B(),o=U(),t=j(),[n,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),p=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),y.useEffect(()=>{n||p!=="Not-Started"||(a(!0),t(L(!0)))},[n,p,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(O,{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(Q,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const t=b(e),n=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=n==="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:n}},function(e,o){const{navigate:t,approvalUpdateDataView:n,approverViewData:a,approvalRuleId:u}=o,s=n.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:p=>{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:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(E(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.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:n}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[p,c]=y.useState(!1);if(y.useEffect(()=>{p||(c(!0),o(z(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(n!=null?"../../":"../")},[d,n]),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:n,approverViewData:d,location:t})}function se(){return l.jsxs(F,{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(K,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-DH0u65Kt.js";import{a as y}from"./sentry-Z2EfLBjp.js";import{j as B,u as U,h as j,g as v,N as O,k as T,l as $,n as F,o as h}from"./core-DR8tDM_G.js";import{eO as N,MX as R,MD as b,xp as x,xj as L,xn as I,xc as M,MF as q,xf as z,xr as W,xq as E}from"./zeni-epic-state-TB4o69vJ.js";import{m as P,z as k,B as V,a3 as X,by as G,ac as _,bz as H}from"./index-CjFymAYP.js";import"./mui-EgTXI2De.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-EaQ9JUjP.js";import K from"./NotFoundScreen-DuU91hRO.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]="496507a6-e6f9-4345-aa2b-74fcd44e3c5b",e._sentryDebugIdIdentifier="sentry-dbid-496507a6-e6f9-4345-aa2b-74fcd44e3c5b")}catch{}})();const w="bill-approval-rule-update",Q=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:n}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(q(!1))},onBackClick:()=>{_(n)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(X(G)),Y=()=>{const e=B(),o=U(),t=j(),[n,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),p=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),y.useEffect(()=>{n||p!=="Not-Started"||(a(!0),t(L(!0)))},[n,p,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(O,{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(Q,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const t=b(e),n=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=n==="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:n}},function(e,o){const{navigate:t,approvalUpdateDataView:n,approverViewData:a,approvalRuleId:u}=o,s=n.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:p=>{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:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(E(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.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:n}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[p,c]=y.useState(!1);if(y.useEffect(()=>{p||(c(!0),o(z(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(n!=null?"../../":"../")},[d,n]),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:n,approverViewData:d,location:t})}function se(){return l.jsxs(F,{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(K,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-6nZkQHFl.js";import{j as K,h as se,u as Y,l as ae,g as v,N as te,k as X,i as na,n as ia,o as y}from"./core-B8DAi0nh.js";import{eO as Z,Md as Le,bv as It,H6 as oa,bo as wt,bE as pe,Me as xt,wJ as Bt,xT as Ve,xg as la,bn as De,Mf as sa,Mg as ra,c1 as ca,Mh as da,jA as Ct,Mi as At,Mj as Et,ys as _e,wY as Ce,Mk as ua,wx as tt,Ml as pa,BE as ma,wB as ba,wH as Dt,Mm as ke,Mn as Ge,xU as Oe,Mo as ha,Mp as ga,xX as Ne,Mq as Sa,y8 as ya,Mr as jt,xE as at,xJ as fa,Ms as ka,Mt as ue,Mu as Tt,Mv as Pt,Mw as Ft,fI as va,x1 as $e,cw as Rt,Mx as Ia,gM as wa,My as xa,Mz as Ba,eU as Mt,eS as Vt,MA as ze,MB as Ca,MC as Aa,JY as Ze,MD as Ea,JZ as oe,J_ as He,ME as Da,MF as ja,MG as Ta,xL as nt,xI as Pa,MH as Fa,MI as Ra,MJ as Ma,xu as Va,MK as $a,ML as Ua,MM as La,ck as $t,cM as Ut,jL as _a,bK as Ga,bq as Lt,bL as _t,vP as Oa,MN as Na,Br as za,Bx as Za,sm as Ha,xV as Wa,yz as qa,jY as fe,MO as Ja,MP as Gt,kq as Ka,jS as Ot,kb as Nt,ka as it,bD as be,bJ as Ya,MQ as Xa,MR as ve,iv as Qa,MS as ot,MT as en,iz as tn,iU as an,yN as nn,MU as on,kj as ln,yD as sn,MV as lt,yH as rn,yM as cn,yJ as dn,yB as un,MW as zt,wS as pn,MX as mn,MY as bn,fA as hn,fz as gn,fy as Sn,j$ as yn,kh as st,ks as fn,pO as kn,k8 as vn,yF as In,iF as wn,kx as xn,MZ as Bn,ix as Cn,pF as An,M_ as En,xA as Dn,bF as jn,bs as Tn,IS as Pn,cO as Fn,cN as Rn,cv as Mn,cB as Vn}from"./zeni-epic-state-DITtSXPQ.js";import{m as me,z as M,k as Ie,y as le,S,aK as Ae,B as re,o as A,w as je,c as D,b5 as $n,p as z,W as We,n as E,Z as we,b6 as rt,b7 as ct,b8 as Un,ah as Ln,G as _n,aE as Gn,E as Zt,D as qe,H as Je,b9 as On,aq as Ht,ba as Nn,R as zn,e as Wt,a3 as Zn,bb as Hn,bc as Wn,bd as qn,be as Jn,bf as Kn,bg as Yn,bh as Xn,bi as Qn,bj as ei,q as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a6 as li}from"./index-CrhTmqTp.js";import{n as U,S as si}from"./mui-DOBONCVx.js";import{A as dt}from"./AddressScreen-CQqRda3s.js";import{g as ie,a as Te,i as qt,V as Ke,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-D0FJ0DFE.js";import{a as f}from"./sentry-Dr5FPm4d.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-DH6rjWyj.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-Z1RjapDK.js";import{u as Jt}from"./useInitialThreadRequest-D2GYlrz4.js";import Ee from"./NotFoundScreen-DsEEwwTx.js";import{D as ui}from"./DrawerScreen-BJd9OmNB.js";import{M as Kt}from"./MobileAppDrawer-Dm68rJiS.js";import{F as Yt}from"./FeaturePreviewScreen-BlSIKXFS.js";import{S as Pe}from"./SetupPagesScreen-D9to9dY7.js";import{B as pi}from"./BillPayApprovalRoutes-Bt8Z0pVh.js";import{FallBackRoute as mi}from"./ScreenRoutes-C1s0Nxp2.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.js";import"./analyticsHelper-C6OV8Lji.js";import"./routePaths-9AUhVaii.js";import"./BusinessVerificationPageScreen-B4Ydn5q-.js";import"./ReimbursementApprovalRuleDetailScreen-obTxBD8v.js";import"./getLocaleForTenant-CzzxyTLH.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]="56b3f831-4ea7-4b34-87f2-d70d328f4733",e._sentryDebugIdIdentifier="sentry-dbid-56b3f831-4ea7-4b34-87f2-d70d328f4733")}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=K(),t=se(),l=Y(),{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=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});Qe({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(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(S.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(S.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:J}=T(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(S.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,$,Q,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:J,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const Se=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(ya({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(Sa({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=Y(),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(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.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 J=v(F=>Le(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Q=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(Q??"",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(Q??"",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"||J.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:Q}),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:Se.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(Si,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:yi(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Me,{windowSize:o,children:e})]})})}}function Si(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function yi(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:`${Se.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-DH0u65Kt.js";import{j as K,h as se,u as Y,l as ae,g as v,N as te,k as X,i as na,n as ia,o as y}from"./core-DR8tDM_G.js";import{eO as Z,Md as Le,bv as It,H6 as oa,bo as wt,bE as pe,Me as xt,wJ as Bt,xT as Ve,xg as la,bn as De,Mf as sa,Mg as ra,c1 as ca,Mh as da,jA as Ct,Mi as At,Mj as Et,ys as _e,wY as Ce,Mk as ua,wx as tt,Ml as pa,BE as ma,wB as ba,wH as Dt,Mm as ke,Mn as Ge,xU as Oe,Mo as ha,Mp as ga,xX as Ne,Mq as Sa,y8 as ya,Mr as jt,xE as at,xJ as fa,Ms as ka,Mt as ue,Mu as Tt,Mv as Pt,Mw as Ft,fI as va,x1 as $e,cw as Rt,Mx as Ia,gM as wa,My as xa,Mz as Ba,eU as Mt,eS as Vt,MA as ze,MB as Ca,MC as Aa,JY as Ze,MD as Ea,JZ as oe,J_ as He,ME as Da,MF as ja,MG as Ta,xL as nt,xI as Pa,MH as Fa,MI as Ra,MJ as Ma,xu as Va,MK as $a,ML as Ua,MM as La,ck as $t,cM as Ut,jL as _a,bK as Ga,bq as Lt,bL as _t,vP as Oa,MN as Na,Br as za,Bx as Za,sm as Ha,xV as Wa,yz as qa,jY as fe,MO as Ja,MP as Gt,kq as Ka,jS as Ot,kb as Nt,ka as it,bD as be,bJ as Ya,MQ as Xa,MR as ve,iv as Qa,MS as ot,MT as en,iz as tn,iU as an,yN as nn,MU as on,kj as ln,yD as sn,MV as lt,yH as rn,yM as cn,yJ as dn,yB as un,MW as zt,wS as pn,MX as mn,MY as bn,fA as hn,fz as gn,fy as Sn,j$ as yn,kh as st,ks as fn,pO as kn,k8 as vn,yF as In,iF as wn,kx as xn,MZ as Bn,ix as Cn,pF as An,M_ as En,xA as Dn,bF as jn,bs as Tn,IS as Pn,cO as Fn,cN as Rn,cv as Mn,cB as Vn}from"./zeni-epic-state-TB4o69vJ.js";import{m as me,z as M,k as Ie,y as le,S,aK as Ae,B as re,o as A,s as je,c as D,b5 as $n,p as z,W as We,j as E,Z as we,b6 as rt,b7 as ct,b8 as Un,ah as Ln,E as _n,aE as Gn,C as Zt,D as qe,G as Je,b9 as On,aq as Ht,ba as Nn,R as zn,e as Wt,a3 as Zn,bb as Hn,bc as Wn,bd as qn,be as Jn,bf as Kn,bg as Yn,bh as Xn,bi as Qn,bj as ei,n as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a6 as li}from"./index-CjFymAYP.js";import{n as U,S as si}from"./mui-EgTXI2De.js";import{A as dt}from"./AddressScreen-DuqDDwbX.js";import{g as ie,a as Te,i as qt,V as Ke,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-DOvHZ_oC.js";import{a as f}from"./sentry-Z2EfLBjp.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-CT7gco_a.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-CQWT0XHy.js";import{u as Jt}from"./useInitialThreadRequest-XTK7FDn_.js";import Ee from"./NotFoundScreen-DuU91hRO.js";import{D as ui}from"./DrawerScreen-DwJwVhuI.js";import{M as Kt}from"./MobileAppDrawer-CKb5yG63.js";import{F as Yt}from"./FeaturePreviewScreen-BCjtGP_L.js";import{S as Pe}from"./SetupPagesScreen-CMNbCjoJ.js";import{B as pi}from"./BillPayApprovalRoutes-ZlmnVSSW.js";import{FallBackRoute as mi}from"./ScreenRoutes-scBYKN6D.js";import"./recharts-BN9u8kqw.js";import"./analytics-TpOPKTBE.js";import"./plaid-C9BN4j5u.js";import"./dnd-Tv7XXetM.js";import"./stripe-DMRn4zHo.js";import"./lottie-DXjy-4kQ.js";import"./lexical-XdnXYpvk.js";import"./pdf-C1ZWoPlC.js";import"./utils-CYYHm9mY.js";import"./analyticsHelper-C6rQwSxW.js";import"./routePaths-BSK2K3Sa.js";import"./BusinessVerificationPageScreen--aJrL6sY.js";import"./ReimbursementApprovalRuleDetailScreen-EaQ9JUjP.js";import"./getLocaleForTenant-DmihGqyc.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]="aa7486b3-c592-449d-9b95-9e3238f14d3e",e._sentryDebugIdIdentifier="sentry-dbid-aa7486b3-c592-449d-9b95-9e3238f14d3e")}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=K(),t=se(),l=Y(),{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=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});Qe({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(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(S.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(S.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:J}=T(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(S.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,$,Q,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:J,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const Se=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(ya({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(Sa({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=Y(),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(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.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 J=v(F=>Le(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Q=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(Q??"",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(Q??"",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"||J.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:Q}),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:Se.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(Si,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:yi(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Me,{windowSize:o,children:e})]})})}}function Si(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function yi(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:`${Se.recurringBill.recurringCycle}
2
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=U.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as T}from"./liveblocks-6nZkQHFl.js";import{a as V}from"./sentry-Dr5FPm4d.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-B8DAi0nh.js";import{k as ce,y as ue,aK as de,z as E,w as pe,c as B,ac as x,e as z,bu as le,aq as me,n as R,ar as M}from"./index-CrhTmqTp.js";import{ML as fe,eO as G,rN as ye,Ha as Se,xu as ge,Ab as Ie,CK as be,Dn as he,Eg as Oe,N6 as De,N7 as ke,N8 as Te,N9 as Ce,Na as Ve,JF as Ne,M8 as we,JR as Ae,kg as Fe,fA as _e,fz as ve,fy as xe,pO as ze,pF as Ee,pC as Be,k8 as Re,rW as Me,rU as P,bD as L,s6 as U,cu as Pe}from"./zeni-epic-state-DITtSXPQ.js";import{n as Le}from"./mui-DOBONCVx.js";import{c as j}from"./routePaths-9AUhVaii.js";import{M as Ue}from"./MobileAppDrawer-Dm68rJiS.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]="733a0495-0689-453b-b3e3-b201862b50d6",e._sentryDebugIdIdentifier="sentry-dbid-733a0495-0689-453b-b3e3-b201862b50d6")}catch{}})();const je=Le.div`
1
+ import{j as T}from"./liveblocks-DH0u65Kt.js";import{a as V}from"./sentry-Z2EfLBjp.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-DR8tDM_G.js";import{k as ce,y as ue,aK as de,z as E,s as pe,c as B,ac as x,e as z,bu as le,aq as me,j as R,ar as M}from"./index-CjFymAYP.js";import{ML as fe,eO as G,rN as ye,Ha as Se,xu as ge,Ab as Ie,CK as he,Dn as be,Eg as Oe,N6 as De,N7 as ke,N8 as Te,N9 as Ce,Na as Ve,JF as Ne,M8 as we,JR as Ae,kg as Fe,fA as _e,fz as ve,fy as xe,pO as ze,pF as Ee,pC as Be,k8 as Re,rW as Me,rU as P,bD as L,s6 as U,cu as Pe}from"./zeni-epic-state-TB4o69vJ.js";import{n as Le}from"./mui-EgTXI2De.js";import{c as j}from"./routePaths-BSK2K3Sa.js";import{M as Ue}from"./MobileAppDrawer-CKb5yG63.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]="1747fe39-2a8f-453f-a804-0a492321ffe5",e._sentryDebugIdIdentifier="sentry-dbid-1747fe39-2a8f-453f-a804-0a492321ffe5")}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 T}from"./liveblocks-6nZkQHFl.js";import{a as V}from"./sentry-Dr5FPm4
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=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},h=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:h,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:h}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:D,companyLegalName:k,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:O,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:N,stateOfIncorporation:w,sourceOfFunds:A,companySubIndustry:F,countriesOfOperations:b,companySourceOfFunds:q,companySourceOfFundsDescription:J,transactionVolume:K,transactionVolumeDescription:W,purposeOfAccount:Z,purposeOfAccountDescription:$,regulatedStatus:H,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y}=t,_=D?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:k,taxIdOrEIN:g,website:m!=""&&m!=null?Pe(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:F?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(v=>v.length===2?v:M(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:J,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:W,purposeOfAccount:Z?.selectedOption??"",purposeOfAccountDescription:$,regulatedStatus:H??"",regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:O};e(U({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:D,userId:k,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:O,selectDocument:f,role:a,ownership:o,isSelectedForVerification:N,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:F}=p;let b;return f.selectDocumentType==="driverLicense"?b="driving_license":f.selectDocumentType==="passport"?b="passport":f.selectDocumentType==="stateId"?b="id_document":f.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:D,userId:k,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?M(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:O,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:b,isSelectedForVerification:N,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(P(i,t,r))},onSendForVerificationClick:t=>{e(P(i,t,r,!0))},onAddressClick:t=>{const s=j(h,t),p=R(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(h,t),p=R(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Me({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Re({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(Ee(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(_e(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(Fe({addressType:t,addressToCreate:s}))}}})(le),Xe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,h]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:D}=p(de.zeniAccountsConfig),k=fe(D),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(Oe(n,!0));break;case"zeni_treasury":r(he(n,!0));break;case"reimbursement":r(be(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 O=a=>{h(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=De(a,n)}return o});return u===!1?T.jsx(oe,{to:"../promo"}):T.jsxs(je,{children:[T.jsx(pe,{analytics:B,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?T.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:O}):null,T.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{O(!0)},maxInsuredAmount:k.maxInsuredAmount})]})};export{Xe as B};
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:D,companyLegalName:k,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:O,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:N,stateOfIncorporation:w,sourceOfFunds:A,companySubIndustry:F,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:J,transactionVolume:K,transactionVolumeDescription:W,purposeOfAccount:Z,purposeOfAccountDescription:$,regulatedStatus:H,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y}=t,_=D?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:k,taxIdOrEIN:g,website:m!=""&&m!=null?Pe(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:F?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:M(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:J,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:W,purposeOfAccount:Z?.selectedOption??"",purposeOfAccountDescription:$,regulatedStatus:H??"",regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:O};e(U({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:D,userId:k,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:O,selectDocument:f,role:a,ownership:o,isSelectedForVerification:N,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:F}=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:D,userId:k,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?M(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:O,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:N,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(P(i,t,r))},onSendForVerificationClick:t=>{e(P(i,t,r,!0))},onAddressClick:t=>{const s=j(b,t),p=R(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(b,t),p=R(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Me({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Re({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(Ee(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(_e(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(Fe({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:D}=p(de.zeniAccountsConfig),k=fe(D),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(Oe(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 O=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=De(a,n)}return o});return u===!1?T.jsx(oe,{to:"../promo"}):T.jsxs(je,{children:[T.jsx(pe,{analytics:B,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?T.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:O}):null,T.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{O(!0)},maxInsuredAmount:k.maxInsuredAmount})]})};export{Xe as B};