@zeniai/web-app-ui 5.0.0-qa → 5.0.1-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 (115) hide show
  1. package/dist/assets/AddressRoutes-BQP-CfGZ.js +1 -0
  2. package/dist/assets/AddressScreen-wF2P11Cc.js +9 -0
  3. package/dist/assets/{AiCfoScreen-BR8PoUmU.js → AiCfoScreen-CILB5bBS.js} +2 -2
  4. package/dist/assets/{BillPayApprovalRoutes-BeaWY9ga.js → BillPayApprovalRoutes-Bm6O9E1C.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-CWbI-3lu.js → BillPayRoutes-DvR3hqif.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-B8mXcNLy.js → BusinessVerificationPageScreen-Db_j23ph.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-Bgdfn44a.js → ChargeCardRoutes-B2KJAodB.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-BCPm2c8T.js → CompanyPassportScreen-C20zLwxY.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-DJ5wyIja.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-BSF1us15.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-D-_60rGa.js → CustomerOnboardingRoutes-CnVH8vUK.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-B9_-_tPb.js → DashboardRoutes-6WcO8n0u.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-Cl8vcsiM.js → DefaultTenantHome-CrXP_cR1.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-DCV6HQRp.js → DomesticWireDetailScreen-C51IXDOd.js} +3 -3
  15. package/dist/assets/DrawerScreen-CV5-68Vp.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-CINCnbfR.js → EntityDetailRoutes-CWP-yEzD.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-D8G_zp8f.js → ExpenseAutomationRoutes-BCVBp8qi.js} +5 -5
  18. package/dist/assets/FeaturePreviewScreen-C9zUUTCh.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-q1juhq3J.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-D3tHYM0l.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-eCdBXSxf.js → MobileAppDrawer-Czhowgsf.js} +1 -1
  22. package/dist/assets/NotFoundScreen-D0cCxE_g.js +1 -0
  23. package/dist/assets/{NotificationRoutes-CxWKZNsp.js → NotificationRoutes-C37yYJm9.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-LRtjQJx_.js +1 -0
  25. package/dist/assets/{PeopleRoutes-5oajZHVV.js → PeopleRoutes-nhSxQuOd.js} +5 -5
  26. package/dist/assets/PerformanceRoutes-BU2_koAY.js +1 -0
  27. package/dist/assets/{Preview-CitTL1Hn.js → Preview--bb5p9Hr.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-B4Rcl2XA.js → QBOConnectionScreen-ChkHB_5w.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-DHtLnulq.js → ReferralListScreen-DRhEWofN.js} +2 -2
  30. package/dist/assets/{ReimbursementApprovalRoutes-DdJz0p5l.js → ReimbursementApprovalRoutes-BaUI0RrG.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BVKZCEAO.js → ReimbursementApprovalRuleDetailScreen-Doqr5IfY.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes--zV8t9-V.js → ReimbursementRoutes-B52nhenO.js} +9 -9
  33. package/dist/assets/{ReportsRoutes-CRufLdv_.js → ReportsRoutes-CNqyQ8jz.js} +1 -1
  34. package/dist/assets/RewardsRoutes-CqIupqR0.js +1 -0
  35. package/dist/assets/ScreenRoutes-CDdkS4QP.js +2 -0
  36. package/dist/assets/{SettingsRoutes-BZwjpejF.js → SettingsRoutes-CbTsbTLb.js} +7 -7
  37. package/dist/assets/{SetupPagesScreen-BJy2d6s1.js → SetupPagesScreen-DeB97TrS.js} +1 -1
  38. package/dist/assets/{SignInScreen-Cr0sIFcm.js → SignInScreen-CEzGCpsn.js} +1 -1
  39. package/dist/assets/{SignOutScreen-sgTWJDGb.js → SignOutScreen-CETwZ0Jp.js} +1 -1
  40. package/dist/assets/{TaskListScreen-BpK-8QnW.js → TaskListScreen-b7SlqOLh.js} +2 -2
  41. package/dist/assets/TaskRoutes-BMFJJPYD.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-CdhRrWAk.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-BCiX38jP.js → TransactionDetailScreen-Bh4hnUTb.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-yuwwha-7.js → TransactionListRoutes-DLq7cUVK.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-CY_-R9A0.js → TreasuryRoutes-u5hb_BqK.js} +5 -5
  46. package/dist/assets/{VendorsRoutes-k37ZPcgY.js → VendorsRoutes-DG-CUygJ.js} +1 -1
  47. package/dist/assets/WiseConfirmationScreen-uk0X1R83.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-BYcGG-cX.js → ZeniAccountRoutes-CN91LxEE.js} +9 -9
  49. package/dist/assets/{ZeniAccountStatementScreen-DOb1513X.js → ZeniAccountStatementScreen-Da1Wlwqe.js} +1 -1
  50. package/dist/assets/{accountMappingHelper-GgTLtZGv.js → accountMappingHelper-CEUIWp7O.js} +1 -1
  51. package/dist/assets/{analytics-BL0geQNn.js → analytics-BkhHPaQ4.js} +1 -1
  52. package/dist/assets/{analyticsHelper-B-IDLpaZ.js → analyticsHelper-DZ0CUT0b.js} +1 -1
  53. package/dist/assets/{core-B4ZvHvvY.js → core-C_NeXleM.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-CC7b77eX.js → decodeURIComponentSafe-Drd7YS9D.js} +1 -1
  55. package/dist/assets/{dnd-B2_m6pRT.js → dnd-C0SdDgY2.js} +1 -1
  56. package/dist/assets/{empty-B5RM5mjs.js → empty-5JhUjXJf.js} +1 -1
  57. package/dist/assets/{empty-u93aQEuK.js → empty-CDZc49VR.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-BX5sv6Zg.js → emptyVideoElement-SE9UwlDX.js} +1 -1
  59. package/dist/assets/{epic-h4oM0Sz-.js → epic-CBKcA32L.js} +1 -1
  60. package/dist/assets/getLocaleForTenant-C75hRciY.js +1 -0
  61. package/dist/assets/{index-DZ-RvKDF.js → index-3wKQcxVk.js} +2 -2
  62. package/dist/assets/{index-fkmKbMt9.js → index-COcEChnY.js} +1 -1
  63. package/dist/assets/{index-CWllm9J4.js → index-DEiuB93P.js} +1 -1
  64. package/dist/assets/{index-bl3TgQLh.js → index-DYUyEm6J.js} +1 -1
  65. package/dist/assets/{index-ChCWQQ_0.js → index-Dmixh63m.js} +1 -1
  66. package/dist/assets/{index-DgzG0i4n.js → index-TZBFPhBM.js} +10363 -10346
  67. package/dist/assets/{index-CAShaDN8.js → index-Y_8J-EV-.js} +1 -1
  68. package/dist/assets/{lexical-DA5yMmPj.js → lexical-B1vtLf4F.js} +1 -1
  69. package/dist/assets/{liveblocks-CVGPqYnR.js → liveblocks-BCZSgQbG.js} +1 -1
  70. package/dist/assets/{lottie-B5aSI3Li.js → lottie-BdeQlKTG.js} +1 -1
  71. package/dist/assets/{mui-DoY7WfR_.js → mui-CgjVMn8C.js} +1 -1
  72. package/dist/assets/{pathToGoBack-BDUkHX_e.js → pathToGoBack-BDpRzqvH.js} +1 -1
  73. package/dist/assets/{pdf-ChIJqwGf.js → pdf-CQPNphc4.js} +4 -4
  74. package/dist/assets/{pdf-lib-DK80DJM9.js → pdf-lib-DznUmqID.js} +1 -1
  75. package/dist/assets/{plaid-C1RHGEem.js → plaid-B3UNGbGB.js} +1 -1
  76. package/dist/assets/{pusher-ChL35Yn7.js → pusher-SrZYiYid.js} +1 -1
  77. package/dist/assets/{react-4HMKyBDf.js → react-B1LuGLWv.js} +1 -1
  78. package/dist/assets/{react-BSF23jTj.js → react-BLym8SqS.js} +1 -1
  79. package/dist/assets/{react-CJCh-4ns.js → react-BR-uiB3M.js} +1 -1
  80. package/dist/assets/{react-CbMg7X0f.js → react-BUr4gNxK.js} +1 -1
  81. package/dist/assets/{react-xvaCLOMn.js → react-CUvZ-QKI.js} +1 -1
  82. package/dist/assets/{react-CTsulPb9.js → react-CkJUroZo.js} +1 -1
  83. package/dist/assets/{recharts-DNFnaP_v.js → recharts-NCr2Pwd1.js} +1 -1
  84. package/dist/assets/{routePaths-WhbiYSxu.js → routePaths-fq-ods6n.js} +1 -1
  85. package/dist/assets/{sentry-vrLJXbkU.js → sentry-CGkVgbup.js} +1 -1
  86. package/dist/assets/{url-Cw65WvOG.js → url-D7JZ1pkZ.js} +1 -1
  87. package/dist/assets/{url-CcUoq1OV.js → url-ax2xfQkc.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-BmhiW9nY.js +1 -0
  89. package/dist/assets/{useDeviceId-BMtoTIZs.js → useDeviceId-DxDe1m2N.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-CJ1dU4ni.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-C88MW4km.js → useInitialThreadRequest-DYY0nYQq.js} +1 -1
  92. package/dist/assets/{utils-QMlevttK.js → utils-CTLGOmjC.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-D3gZnvfm.js → withTransactionSidePanel-CsJoitfl.js} +3 -3
  94. package/dist/assets/{zeni-epic-state-Da4VO2lv.js → zeni-epic-state-Dp14ovRw.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +2 -2
  97. package/dist/assets/AddressRoutes-D2Yn8dXr.js +0 -1
  98. package/dist/assets/AddressScreen-B-90Ns9M.js +0 -9
  99. package/dist/assets/ConnectionAuthScreen-BYziEpOR.js +0 -11
  100. package/dist/assets/CustomerOnboardingAuthScreen-Dduw6GDH.js +0 -1
  101. package/dist/assets/DrawerScreen-dt2KgJzx.js +0 -1
  102. package/dist/assets/FeaturePreviewScreen-C2dbroTQ.js +0 -1
  103. package/dist/assets/MagicLinkRoutes-CytIPPYS.js +0 -72
  104. package/dist/assets/MagicLinkSignInScreen-BxPvHLB5.js +0 -12
  105. package/dist/assets/NotFoundScreen-jPpbDlQd.js +0 -1
  106. package/dist/assets/PandLWithForecastRoutes-BeER1eMP.js +0 -1
  107. package/dist/assets/PerformanceRoutes-D2L3CFvV.js +0 -1
  108. package/dist/assets/RewardsRoutes-CJ6LAavD.js +0 -1
  109. package/dist/assets/ScreenRoutes-C36ZBPGp.js +0 -2
  110. package/dist/assets/TaskRoutes-DfQABQLR.js +0 -9
  111. package/dist/assets/TransactionDetailRoutes-CM3RR8SH.js +0 -1
  112. package/dist/assets/WiseConfirmationScreen-D_U8eXIb.js +0 -12
  113. package/dist/assets/getLocaleForTenant-C50EFRQ8.js +0 -1
  114. package/dist/assets/useAskAiCfoHostNavButtonProps-DQFYXydp.js +0 -1
  115. package/dist/assets/useFetchSuggestedQuestionsWhenReady-BMFUNkte.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-BCZSgQbG.js";import{A as i}from"./AddressScreen-wF2P11Cc.js";import s from"./NotFoundScreen-D0cCxE_g.js";import"./sentry-CGkVgbup.js";import{n as d,o as r}from"./core-C_NeXleM.js";import"./zeni-epic-state-Dp14ovRw.js";import"./recharts-NCr2Pwd1.js";import"./index-TZBFPhBM.js";import"./mui-CgjVMn8C.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.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]="339d6624-b51b-426b-a0cc-e8e8bd837ae0",t._sentryDebugIdIdentifier="sentry-dbid-339d6624-b51b-426b-a0cc-e8e8bd837ae0")}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-BCZSgQbG.js";import{a as h}from"./sentry-CGkVgbup.js";import{j as P,h as _,u as j,l as B,g as E,k as $}from"./core-C_NeXleM.js";import{K as L,m as M,z as D,S as K,B as G,q as z,c as C,e as m,j as F,h as b,p as N}from"./index-TZBFPhBM.js";import{IA as I,gG as O,eL as R,IB as U,b$ as q,IC as V,jO as H}from"./zeni-epic-state-Dp14ovRw.js";import{n as J}from"./mui-CgjVMn8C.js";import Q from"./NotFoundScreen-D0cCxE_g.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]="079074c8-d43d-4780-ab7c-56372e180ddc",e._sentryDebugIdIdentifier="sentry-dbid-079074c8-d43d-4780-ab7c-56372e180ddc")}catch{}})();const W=J.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
+ `,X=$(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"||q(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=V(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=I(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=N(d?.pathnameStackToGoBack);let s=n.poppedPathname??k();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=Y(a);e(H({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)}}})(F);function re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=P(),d=_(),n=j(),{addressId:s,addressType:u}=B(),g=L(),w=M(),A=D.getSignedInUser(),[p,v]=h.useState(s==null),f=E(S=>s!=null?I(S,s).fetchState:"Not-Started"),x=K();if(A==null)throw Error("Can't access address page without signing in...");const T=S=>S.trackPageLoaded(s!=null?m.Event.editAddress:m.Event.addAddress),y=l??u;return h.useEffect(()=>{p||s==null||(v(!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(G,{fetchState:f,style:{backgroundColor:w.colors.grey5}}):s!=null&&f==="Error"?(a(`${k(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(z,{analytics:C,onLoad:T}),r.jsx(W,{windowSize:g,children:r.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):r.jsx(Q,{})}const k=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Y=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,Y as t};
@@ -1,11 +1,11 @@
1
- import{j as S}from"./liveblocks-CVGPqYnR.js";import{a as i}from"./sentry-vrLJXbkU.js";import{h as ee,j as te,u as se,g as U,l as ae,k as ne}from"./core-B4ZvHvvY.js";import{J as oe,cB as ie,z as re,K as le,cC as ce,cD as ue,cE as $,s as de,c as _,Q as B,cF as me,cG as fe,e as pe,a1 as he,cH as Se,R as ge,q as Ce,p as be,cI as we,cJ as Ie}from"./index-DgzG0i4n.js";import{fD as ke,f2 as q,eL as Ee,h6 as ye,P6 as Pe,eK as Te,hg as _e,hc as xe,ft as ve,fn as Qe,fg as Ae,fk as j,fo as Oe,fp as De,fq as Fe,fr as Le,fs as Me}from"./zeni-epic-state-Da4VO2lv.js";import{D as Re,n as x,P as Ue,S as Be}from"./mui-DoY7WfR_.js";import{p as je}from"./pathToGoBack-BDUkHX_e.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="17c3d4d5-d710-476b-a694-9abfc0bbcf97",a._sentryDebugIdIdentifier="sentry-dbid-17c3d4d5-d710-476b-a694-9abfc0bbcf97")}catch{}})();const N="chat-response-generated",$e=ne(function(a,r){const n=q(a),d=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&n.uiState.currentChatSessionId==null,aiCfoView:n,isSubmitting:d,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ge}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled}},function(a,r){const{location:n,currentTenant:d,userId:c,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===N&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=De(t.type),u=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,u);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,u,Ie(h,s),t.metadata.message_id??null):_.trackAICFOChatAnswerGenerated(t.text,C?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,Fe(t.visualization?.type??"")??null,u,t.summarized_title,t.metadata.message_id??null),a(Le({chatSessionId:t.metadata.chat_session_id,responseType:m,fetchState:{fetchState:"Completed",error:void 0}})),a(Me({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(e,o,t,m)=>{e&&we(a,e,o,p,g,c,m,t)},updateCurrentInput:e=>{a(j(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(Oe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=be(n.state?.pathnameStackToGoBack),o=e.poppedPathname??je(1);f(o,{state:{...n.state,pathnameStackToGoBack:e.newStack}}),a(j(""))},togglePageView:()=>{f(`/${d.tenantEmailDomain}/dashboard`,{state:{...n.state,message:"open_ai_cfo_drawer"}})},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{f(-1)},onNewChatClick:()=>{p!=null&&a(Ae());const e=Ce(n.state?.pathnameStackToGoBack,n.pathname);f(`/${d.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{a(Qe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(he(Se)),rt=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:r}=oe(),n=ee(),d=te(),c=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(ke())},[n]);const{customPageTitle:g}=ie(),e=U(l=>q(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),u=U(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ce({currentTenant:u,currentChatSessionId:s,aiCfoView:e}),h=c.state,b=h?.aiCfoInitialQuestion,v=!!h?.aiCfoShouldSubmit,[G,k]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||b==null||b===""||(k(b),E(v),Q.current=!0)},[b,v]);const H=i.useCallback(()=>{k(null),E(!1)},[]),A=i.useMemo(()=>new URLSearchParams(c.search),[c.search]),O=A.get("ref")??h?.aiCfoRef,y=A.get("emailRefId")??h?.aiCfoEmailRefId,D=i.useRef(!1);i.useEffect(()=>{D.current||O!=="month-end-email"||y==null||s!=null||o==null||(n(ye("controller",o.userId,y,"MONTH_END_EMAIL")),D.current=!0)},[O,y,s,n,o]);const w=e.uiState.lastContextMessage;i.useEffect(()=>{w!=null&&w!==""&&s!=null&&(k(w),E(!0),n(Pe()))},[w,s,n]);const W=u.masterTOSInfo,I=W?.isMasterTOSAccepted??!1,{visitedSessions:F}=ue(s),P=e.fetchState,T=e.uiState.chatSessionsNextPageToken.hasMore||!e.uiState.chatSessionsFirstPageFetched,L=s!=null?e.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",M=s==null||(e.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),R=e.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:z}=$(R,s),J=z.length===0;i.useEffect(()=>{I||d("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[I]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...c.state}})},[s,t]),i.useEffect(()=>{t!=null&&s==null&&t!=="new_chat"&&t!=="explore"&&n(Te({sessionId:t,agentId:"controller"}))},[]);const K=i.useMemo(()=>({events:F.map(l=>`private-chat-${l}.${N}`),eventCallback:(l,Y,Z)=>Z.onEventReceived(l,Y)}),[F]);if(i.useEffect(()=>{P!=="In-Progress"&&T&&n(_e())},[P,T,n]),i.useEffect(()=>{s!=null&&L!=="In-Progress"&&M&&o!=null&&P==="Completed"&&!T&&n(xe(s,o.userId))},[L,M,s,o,n]),o==null||t==null)throw Error("Can't access AI Controller page without signing in...");const X=s!=null&&e.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return S.jsxs(Ne,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),B(m)&&C.drawerElement,S.jsx($e,{...K,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:R,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:c,isSubmitting:X,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:u,emailLinkQuestion:G??void 0,autoSubmitEmailLinkQuestion:V,onEmailLinkQuestionProcessed:H,onMenuClick:B(m)?C.open:void 0,isFileUploadEnabled:a}),S.jsx(Re,{anchor:"right",open:f,transitionDuration:250,PaperProps:{component:Ge,style:{width:`${me}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>p(!1),children:S.jsx(qe,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:I,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{I||u.userRoleId==null||n(ve(u.userRoleId)),p(!1)}})})})]})},qe=x(Be)`
1
+ import{j as S}from"./liveblocks-BCZSgQbG.js";import{a as i}from"./sentry-CGkVgbup.js";import{h as ee,j as te,u as se,g as B,l as ae,k as ne}from"./core-C_NeXleM.js";import{D as oe,cB as ie,z as re,K as le,cC as ce,cD as ue,cE as $,q as de,c as _,J as R,cF as me,cG as fe,e as pe,a1 as he,cH as Se,M as ge,k as Ce,p as be,cI as we,cJ as Ie}from"./index-TZBFPhBM.js";import{fD as ke,f2 as q,eL as Ee,h6 as ye,P6 as Pe,eK as Te,hg as _e,hc as xe,ft as ve,fn as Qe,fg as Ae,fk as j,fo as De,fp as Oe,fq as Fe,fr as Le,fs as Me}from"./zeni-epic-state-Dp14ovRw.js";import{D as Ue,n as x,P as Be,S as Re}from"./mui-CgjVMn8C.js";import{p as je}from"./pathToGoBack-BDpRzqvH.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="c3f7f9b9-6b54-4b7c-af40-24127f1a0843",a._sentryDebugIdIdentifier="sentry-dbid-c3f7f9b9-6b54-4b7c-af40-24127f1a0843")}catch{}})();const N="chat-response-generated",$e=ne(function(a,r){const n=q(a),d=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&n.uiState.currentChatSessionId==null,aiCfoView:n,isSubmitting:d,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ge}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled}},function(a,r){const{location:n,currentTenant:d,userId:c,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===N&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=Oe(t.type),u=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,u);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,u,Ie(h,s),t.metadata.message_id??null):_.trackAICFOChatAnswerGenerated(t.text,C?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,Fe(t.visualization?.type??"")??null,u,t.summarized_title,t.metadata.message_id??null),a(Le({chatSessionId:t.metadata.chat_session_id,responseType:m,fetchState:{fetchState:"Completed",error:void 0}})),a(Me({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(e,o,t,m)=>{e&&we(a,e,o,p,g,c,m,t)},updateCurrentInput:e=>{a(j(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(De(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=be(n.state?.pathnameStackToGoBack),o=e.poppedPathname??je(1);f(o,{state:{...n.state,pathnameStackToGoBack:e.newStack}}),a(j(""))},togglePageView:()=>{f(`/${d.tenantEmailDomain}/dashboard`,{state:{...n.state,message:"open_ai_cfo_drawer"}})},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{f(-1)},onNewChatClick:()=>{p!=null&&a(Ae());const e=Ce(n.state?.pathnameStackToGoBack,n.pathname);f(`/${d.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{a(Qe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(he(Se)),rt=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:r}=oe(),n=ee(),d=te(),c=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(ke())},[n]);const{customPageTitle:g}=ie(),e=B(l=>q(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),u=B(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ce({currentTenant:u,currentChatSessionId:s,aiCfoView:e}),h=c.state,b=h?.aiCfoInitialQuestion,v=!!h?.aiCfoShouldSubmit,[G,k]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||b==null||b===""||(k(b),E(v),Q.current=!0)},[b,v]);const H=i.useCallback(()=>{k(null),E(!1)},[]),A=i.useMemo(()=>new URLSearchParams(c.search),[c.search]),D=A.get("ref")??h?.aiCfoRef,y=A.get("emailRefId")??h?.aiCfoEmailRefId,O=i.useRef(!1);i.useEffect(()=>{O.current||D!=="month-end-email"||y==null||s!=null||o==null||(n(ye("controller",o.userId,y,"MONTH_END_EMAIL")),O.current=!0)},[D,y,s,n,o]);const w=e.uiState.lastContextMessage;i.useEffect(()=>{w!=null&&w!==""&&s!=null&&(k(w),E(!0),n(Pe()))},[w,s,n]);const W=u.masterTOSInfo,I=W?.isMasterTOSAccepted??!1,{visitedSessions:F}=ue(s),P=e.fetchState,T=e.uiState.chatSessionsNextPageToken.hasMore||!e.uiState.chatSessionsFirstPageFetched,L=s!=null?e.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",M=s==null||(e.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),U=e.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:z}=$(U,s),J=z.length===0;i.useEffect(()=>{I||d("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[I]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...c.state}})},[s,t]),i.useEffect(()=>{t!=null&&s==null&&t!=="new_chat"&&t!=="explore"&&n(Te({sessionId:t,agentId:"controller"}))},[]);const K=i.useMemo(()=>({events:F.map(l=>`private-chat-${l}.${N}`),eventCallback:(l,Y,Z)=>Z.onEventReceived(l,Y)}),[F]);if(i.useEffect(()=>{P!=="In-Progress"&&T&&n(_e())},[P,T,n]),i.useEffect(()=>{s!=null&&L!=="In-Progress"&&M&&o!=null&&P==="Completed"&&!T&&n(xe(s,o.userId))},[L,M,s,o,n]),o==null||t==null)throw Error("Can't access AI Controller page without signing in...");const X=s!=null&&e.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return S.jsxs(Ne,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),R(m)&&C.drawerElement,S.jsx($e,{...K,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:U,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:c,isSubmitting:X,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:u,emailLinkQuestion:G??void 0,autoSubmitEmailLinkQuestion:V,onEmailLinkQuestionProcessed:H,onMenuClick:R(m)?C.open:void 0,isFileUploadEnabled:a}),S.jsx(Ue,{anchor:"right",open:f,transitionDuration:250,PaperProps:{component:Ge,style:{width:`${me}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>p(!1),children:S.jsx(qe,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:I,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{I||u.userRoleId==null||n(ve(u.userRoleId)),p(!1)}})})})]})},qe=x(Re)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
5
  `,Ne=x.div`
6
6
  height: 100vh;
7
7
  width: 100%;
8
- `,Ge=x(Ue)`
8
+ `,Ge=x(Be)`
9
9
  box-shadow: ${({theme:a})=>a.colors.elevation2};
10
10
  color: ${({theme:a})=>a.colors.grey4};
11
11
  `;export{rt as default};
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-CVGPqYnR.js";import{a as f}from"./sentry-vrLJXbkU.js";import{j as B,u as U,h as T,g as v,N as L,k as j,l as O,n as $,o as h}from"./core-B4ZvHvvY.js";import{eL as N,LT as A,Lz as b,wM as w,wG as F,wK as I,wz as z,LB as W,wC as q,wO as G,wN as E}from"./zeni-epic-state-Da4VO2lv.js";import{m as P,z as k,B as V,a1 as K,bu as M,aa as _,bv as H}from"./index-DgzG0i4n.js";import"./mui-DoY7WfR_.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-BVKZCEAO.js";import Q from"./NotFoundScreen-jPpbDlQd.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]="b2ac5595-dd75-41ef-92ad-9be7d3fe5495",e._sentryDebugIdIdentifier="sentry-dbid-b2ac5595-dd75-41ef-92ad-9be7d3fe5495")}catch{}})();const R="bill-approval-rule-update",X=j(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(R)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(K(M)),Y=()=>{const e=B(),o=U(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-${c.companyId}.${R}`]:[],eventCallback:(i,x,m)=>{i.endsWith(R)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(L,{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,...y})},Z=j(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(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),x=y.actors.selectedNonUsers.map(S=>{const C=!!J(S.value);return{type:C?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!C}}),m=i.concat(x);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.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(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=T(),t=U(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(q(!0)))}),f.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(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Q,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-BCZSgQbG.js";import{a as f}from"./sentry-CGkVgbup.js";import{j as B,u as U,h as T,g as v,N as L,k as j,l as O,n as $,o as h}from"./core-C_NeXleM.js";import{eL as N,LT as A,Lz as b,wM as w,wG as F,wK as I,wz as z,LB as W,wC as q,wO as G,wN as E}from"./zeni-epic-state-Dp14ovRw.js";import{m as P,z as k,B as V,a1 as K,bu as M,aa as _,bv as H}from"./index-TZBFPhBM.js";import"./mui-CgjVMn8C.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-Doqr5IfY.js";import Q from"./NotFoundScreen-D0cCxE_g.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]="b2ac5595-dd75-41ef-92ad-9be7d3fe5495",e._sentryDebugIdIdentifier="sentry-dbid-b2ac5595-dd75-41ef-92ad-9be7d3fe5495")}catch{}})();const R="bill-approval-rule-update",X=j(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(R)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(K(M)),Y=()=>{const e=B(),o=U(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-${c.companyId}.${R}`]:[],eventCallback:(i,x,m)=>{i.endsWith(R)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(L,{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,...y})},Z=j(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(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),x=y.actors.selectedNonUsers.map(S=>{const C=!!J(S.value);return{type:C?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!C}}),m=i.concat(x);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.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(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=T(),t=U(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(q(!0)))}),f.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(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Q,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-CVGPqYnR.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as y}from"./core-B4ZvHvvY.js";import{eL as Z,L9 as Oe,bu as At,Gf as ra,bn as xt,bC as pe,La as Bt,w4 as Et,xe as Ue,wD as ca,bm as je,Lb as da,Lc as ua,b$ as pa,Ld as ma,j6 as Dt,Le as jt,Lf as Tt,xP as Me,wj as Be,Lg as ba,vU as it,Lh as ha,A$ as ga,vY as Sa,w2 as Pt,Li as Ie,Lj as Ne,xf as ze,Lk as ya,Ll as fa,xi as Ze,Lm as Ia,xv as va,Ln as Ft,w$ as ot,x4 as ka,Lo as wa,Lp as ue,Lq as Lt,Lr as Rt,Ls as Vt,fF as Ca,wo as _e,ct as $t,Lt as Aa,gw as xa,Lu as Ba,Lv as Ea,eS as Ut,eQ as _t,Lw as He,Lx as Da,Ly as ja,IU as We,Lz as Ta,IV as ie,IW as qe,LA as Pa,LB as Fa,LC as La,x6 as lt,x3 as Ra,LD as Va,LE as $a,LF as Ua,wR as _a,LG as Ga,LH as Oa,LI as Ma,cN as Gt,cJ as Ot,jh as Na,bI as za,bp as Mt,bJ as Nt,va as Za,LJ as Ha,AO as Wa,AU as qa,rO as Ja,xg as Ka,xW as Qa,ju as fe,LK as Ya,LL as zt,jY as Xa,jo as Zt,jJ as Ht,jI as st,bB as be,bH as en,LM as tn,LN as ve,h$ as an,LO as rt,LP as nn,i3 as on,iq as ln,y8 as sn,LQ as rn,jR as cn,x_ as dn,LR as ct,y2 as un,y7 as pn,y4 as mn,xY as bn,LS as Wt,wd as hn,LT as gn,LU as Sn,fz as yn,fy as fn,fx as In,jx as vn,jP as dt,j_ as kn,pl as wn,jG as Cn,y0 as An,i9 as xn,k3 as Bn,LV as En,i1 as Dn,pc as jn,LW as Tn,wX as Pn,bD as Fn,br as Ln,HX as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-Da4VO2lv.js";import{m as me,z as R,S as ke,J as Je,Z as oe,i as S,aI as Ee,B as ce,o as E,s as Te,c as j,b1 as Gn,p as z,R as Ke,q as D,K as we,b2 as ut,b3 as pt,b4 as On,af as Mn,C as Nn,aC as zn,x as qt,D as Qe,E as Ye,b5 as Zn,ao as Jt,b6 as Hn,M as Wn,e as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,F as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-DgzG0i4n.js";import{n as V,S as di}from"./mui-DoY7WfR_.js";import{A as mt}from"./AddressScreen-B-90Ns9M.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-DCV6HQRp.js";import{a as f}from"./sentry-vrLJXbkU.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-DQFYXydp.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-BMFUNkte.js";import{u as Yt}from"./useInitialThreadRequest-C88MW4km.js";import De from"./NotFoundScreen-jPpbDlQd.js";import{D as bi}from"./DrawerScreen-dt2KgJzx.js";import{M as Xt}from"./MobileAppDrawer-eCdBXSxf.js";import{F as ea}from"./FeaturePreviewScreen-C2dbroTQ.js";import{S as Le}from"./SetupPagesScreen-BJy2d6s1.js";import{B as hi}from"./BillPayApprovalRoutes-BeaWY9ga.js";import{FallBackRoute as gi}from"./ScreenRoutes-C36ZBPGp.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./analyticsHelper-B-IDLpaZ.js";import"./routePaths-WhbiYSxu.js";import"./BusinessVerificationPageScreen-B8mXcNLy.js";import"./ReimbursementApprovalRuleDetailScreen-BVKZCEAO.js";import"./getLocaleForTenant-C50EFRQ8.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]="744a57ef-8785-4ce0-b336-4126c2e60fa9",e._sentryDebugIdIdentifier="sentry-dbid-744a57ef-8785-4ce0-b336-4126c2e60fa9")}catch{}})();const Si=Y(function(e,t){const l=Oe(e,t.billId),n=R.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(Sa(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Me(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Gn);function yi(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),u=ke(),o=v(w=>Z(w)),s=v(w=>Oe(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[_,G]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(S.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(S.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),O=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,O,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,O,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(Si,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:O,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const Se=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=R.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=R.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[_,G]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let M=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Oe(w,n??""));u===!1&&(M=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const O=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{M==="Not-Started"&&(u&&_?G(!1):!u&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||u||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),u&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(O??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(O??"",w,i?.userEmail??"","no"),t(ya({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(M==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(M!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:O}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{})})]})}):a.jsxs(Re,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(On,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(Mn,{titleComponent:a.jsx(xi,{children:Se.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${Se.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-BCZSgQbG.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as y}from"./core-C_NeXleM.js";import{eL as Z,L9 as Oe,bu as At,Gf as ra,bn as xt,bC as pe,La as Bt,w4 as Et,xe as Ue,wD as ca,bm as je,Lb as da,Lc as ua,b$ as pa,Ld as ma,j6 as Dt,Le as jt,Lf as Tt,xP as Me,wj as Be,Lg as ba,vU as it,Lh as ha,A$ as ga,vY as Sa,w2 as Pt,Li as Ie,Lj as Ne,xf as ze,Lk as ya,Ll as fa,xi as Ze,Lm as Ia,xv as va,Ln as Ft,w$ as ot,x4 as ka,Lo as wa,Lp as ue,Lq as Lt,Lr as Rt,Ls as Vt,fF as Ca,wo as _e,ct as $t,Lt as Aa,gw as xa,Lu as Ba,Lv as Ea,eS as Ut,eQ as _t,Lw as He,Lx as Da,Ly as ja,IU as We,Lz as Ta,IV as ie,IW as qe,LA as Pa,LB as Fa,LC as La,x6 as lt,x3 as Ra,LD as Va,LE as $a,LF as Ua,wR as _a,LG as Ga,LH as Oa,LI as Ma,cN as Gt,cJ as Ot,jh as Na,bI as za,bp as Mt,bJ as Nt,va as Za,LJ as Ha,AO as Wa,AU as qa,rO as Ja,xg as Ka,xW as Qa,ju as fe,LK as Ya,LL as zt,jY as Xa,jo as Zt,jJ as Ht,jI as st,bB as be,bH as en,LM as tn,LN as ve,h$ as an,LO as rt,LP as nn,i3 as on,iq as ln,y8 as sn,LQ as rn,jR as cn,x_ as dn,LR as ct,y2 as un,y7 as pn,y4 as mn,xY as bn,LS as Wt,wd as hn,LT as gn,LU as Sn,fz as yn,fy as fn,fx as In,jx as vn,jP as dt,j_ as kn,pl as wn,jG as Cn,y0 as An,i9 as xn,k3 as Bn,LV as En,i1 as Dn,pc as jn,LW as Tn,wX as Pn,bD as Fn,br as Ln,HX as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-Dp14ovRw.js";import{m as me,z as R,S as ke,D as Je,Z as oe,i as S,aI as Ee,B as ce,o as E,q as Te,c as j,b1 as Gn,p as z,M as Ke,k as D,K as we,b2 as ut,b3 as pt,b4 as On,af as Mn,y as Nn,aC as zn,w as qt,O as Qe,A as Ye,b5 as Zn,ao as Jt,b6 as Hn,E as Wn,e as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,n as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-TZBFPhBM.js";import{n as V,S as di}from"./mui-CgjVMn8C.js";import{A as mt}from"./AddressScreen-wF2P11Cc.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-C51IXDOd.js";import{a as f}from"./sentry-CGkVgbup.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-BmhiW9nY.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-CJ1dU4ni.js";import{u as Yt}from"./useInitialThreadRequest-DYY0nYQq.js";import De from"./NotFoundScreen-D0cCxE_g.js";import{D as bi}from"./DrawerScreen-CV5-68Vp.js";import{M as Xt}from"./MobileAppDrawer-Czhowgsf.js";import{F as ea}from"./FeaturePreviewScreen-C9zUUTCh.js";import{S as Le}from"./SetupPagesScreen-DeB97TrS.js";import{B as hi}from"./BillPayApprovalRoutes-Bm6O9E1C.js";import{FallBackRoute as gi}from"./ScreenRoutes-CDdkS4QP.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.js";import"./analyticsHelper-DZ0CUT0b.js";import"./routePaths-fq-ods6n.js";import"./BusinessVerificationPageScreen-Db_j23ph.js";import"./ReimbursementApprovalRuleDetailScreen-Doqr5IfY.js";import"./getLocaleForTenant-C75hRciY.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]="4aac759c-7e40-46c8-ad2d-a99939a9e8d9",e._sentryDebugIdIdentifier="sentry-dbid-4aac759c-7e40-46c8-ad2d-a99939a9e8d9")}catch{}})();const Si=Y(function(e,t){const l=Oe(e,t.billId),n=R.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(Sa(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Me(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Gn);function yi(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),u=ke(),o=v(w=>Z(w)),s=v(w=>Oe(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[_,G]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(S.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(S.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),O=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,O,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,O,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(Si,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:O,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const Se=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=R.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=R.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[_,G]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let M=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Oe(w,n??""));u===!1&&(M=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const O=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{M==="Not-Started"&&(u&&_?G(!1):!u&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||u||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),u&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(O??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(O??"",w,i?.userEmail??"","no"),t(ya({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(M==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(M!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:O}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{})})]})}):a.jsxs(Re,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(On,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(Mn,{titleComponent:a.jsx(xi,{children:Se.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${Se.recurringBill.recurringCycle}
2
2
  ${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function ki(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-CVGPqYnR.js";import{a as V}from"./sentry-vrLJXbkU.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-B4ZvHvvY.js";import{S as ce,Z as ue,aI as de,z as B,s as pe,c as E,aa as x,e as z,bq as le,ao as me,q as M,ap as L}from"./index-DgzG0i4n.js";import{LH as fe,eL as G,rd as ye,Gj as Se,wR as ge,zy as Ie,C5 as be,CK as he,DD as De,M2 as Oe,M3 as Te,M4 as ke,M5 as Ce,M6 as Ve,IB as we,L4 as Ne,IN as Ae,jO as _e,fz as Fe,fy as ve,fx as xe,pl as ze,pc as Be,p9 as Ee,jG as Me,rm as Le,rk as R,bB as P,ry as j,cr as Re}from"./zeni-epic-state-Da4VO2lv.js";import{n as Pe}from"./mui-DoY7WfR_.js";import{c as U}from"./routePaths-WhbiYSxu.js";import{M as je}from"./MobileAppDrawer-eCdBXSxf.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]="b8e17b85-b13e-4532-abd8-96861eb94dd3",e._sentryDebugIdIdentifier="sentry-dbid-b8e17b85-b13e-4532-abd8-96861eb94dd3")}catch{}})();const Ue=Pe.div`
1
+ import{j as k}from"./liveblocks-BCZSgQbG.js";import{a as V}from"./sentry-CGkVgbup.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-C_NeXleM.js";import{S as ce,Z as ue,aI as de,z as B,q as pe,c as E,aa as x,e as z,bq as le,ao as me,k as M,ap as L}from"./index-TZBFPhBM.js";import{LH as fe,eL as G,rd as ye,Gj as Se,wR as ge,zy as Ie,C5 as he,CK as be,DD as De,M2 as Oe,M3 as Te,M4 as ke,M5 as Ce,M6 as Ve,IB as we,L4 as Ne,IN as Ae,jO as _e,fz as Fe,fy as ve,fx as xe,pl as ze,pc as Be,p9 as Ee,jG as Me,rm as Le,rk as R,bB as P,ry as j,cr as Re}from"./zeni-epic-state-Dp14ovRw.js";import{n as Pe}from"./mui-CgjVMn8C.js";import{c as U}from"./routePaths-fq-ods6n.js";import{M as je}from"./MobileAppDrawer-Czhowgsf.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]="cc67ed32-0c51-4733-a0a7-b5983fd5e67c",e._sentryDebugIdIdentifier="sentry-dbid-cc67ed32-0c51-4733-a0a7-b5983fd5e67c")}catch{}})();const Ue=Pe.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-CVGPqYnR.js";import{a as V}from"./sentry-vrLJXbk
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=B.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},h=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ne(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:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:N,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:b,companySourceOfFunds:q,companySourceOfFundsDescription:Z,transactionVolume:$,transactionVolumeDescription:H,purposeOfAccount:K,purposeOfAccountDescription:W,regulatedStatus:J,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y}=t,F=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Re(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?P(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:N?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(v=>v.length===2?v:L(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:Z,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:W,regulatedStatus:J??"",regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(j({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:_}=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:O,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?L(I.selectedOption):void 0,phone:u,birthday:n!=null?P(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:b,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(R(i,t,r))},onSendForVerificationClick:t=>{e(R(i,t,r,!0))},onAddressClick:t=>{const s=U(h,t),p=M(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(h,t),p=M(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Le({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Me({files:t}))},onDeleteFile:t=>{e(Ee(t))},onDeleteFileList:t=>{e(Be(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(Fe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),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:O}=p(de.zeniAccountsConfig),T=fe(O),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??B.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(De(n,!0));break;case"zeni_treasury":r(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]),B.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{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=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=Oe(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(Ue,{children:[k.jsx(pe,{analytics:E,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:E,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Xe as B};
9
+ `,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=B.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ne(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:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:N,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:Z,transactionVolume:$,transactionVolumeDescription:H,purposeOfAccount:K,purposeOfAccountDescription:W,regulatedStatus:J,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y}=t,F=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Re(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?P(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:N?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:L(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:Z,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:W,regulatedStatus:J??"",regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(j({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:N,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:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?L(I.selectedOption):void 0,phone:u,birthday:n!=null?P(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(R(i,t,r))},onSendForVerificationClick:t=>{e(R(i,t,r,!0))},onAddressClick:t=>{const s=U(b,t),p=M(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(b,t),p=M(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Le({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Me({files:t}))},onDeleteFile:t=>{e(Ee(t))},onDeleteFileList:t=>{e(Be(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(Fe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),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),T=fe(O),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??B.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(De(n,!0));break;case"zeni_treasury":r(be(n,!0));break;case"reimbursement":r(he(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),B.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{b(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=Oe(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(Ue,{children:[k.jsx(pe,{analytics:E,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:E,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Xe as B};