@zeniai/web-app-ui 5.0.2-qa → 5.0.3-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/assets/AddressRoutes-TpKhNc53.js +1 -0
  2. package/dist/assets/AddressScreen-BzNR9PgQ.js +9 -0
  3. package/dist/assets/{AiCfoScreen-C3DNvQlj.js → AiCfoScreen-CxaXxkIm.js} +2 -2
  4. package/dist/assets/{BillPayApprovalRoutes-BVBiJezP.js → BillPayApprovalRoutes-C3wS_qNP.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-C68APJ0s.js → BillPayRoutes-OPwDa_8R.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-uevt4KH_.js → BusinessVerificationPageScreen-BtM5fUcw.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-BDWNHmvV.js → ChargeCardRoutes-DqTI1vwk.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-BsQAk6DO.js → CompanyPassportScreen-DJKhJL7t.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-CH-I2hu3.js → ConnectionAuthScreen-CevZLjw3.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-CnEeEOGm.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-4bfKX61e.js → CustomerOnboardingRoutes-Ew5wjRzs.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-KTtbdLF8.js → DashboardRoutes-B2CH7nsJ.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-DGySCaNj.js → DefaultTenantHome-Bzm-q9xk.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-BQCaRz-2.js +18 -0
  15. package/dist/assets/DrawerScreen-Dz54oQdA.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-B4XF7gyV.js → EntityDetailRoutes-BfBNic02.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-CKPTMKMk.js → ExpenseAutomationRoutes-Bzdvnk7t.js} +4 -4
  18. package/dist/assets/FeaturePreviewScreen-BsHiFyOu.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-DSHxCj-r.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-CYuNWDBT.js +12 -0
  21. package/dist/assets/MobileAppDrawer-BFl1Y_qR.js +1 -0
  22. package/dist/assets/NotFoundScreen-CnfhDP4M.js +1 -0
  23. package/dist/assets/{NotificationRoutes-CLWgbDXX.js → NotificationRoutes-x5lrQ7CC.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-XoBK7btv.js → PandLWithForecastRoutes-CHItYpuL.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-Cb2v_H4M.js → PeopleRoutes-DY9PD71E.js} +11 -11
  26. package/dist/assets/PerformanceRoutes-D1ErJI-A.js +1 -0
  27. package/dist/assets/{Preview-hp5oXBDl.js → Preview-B_pB49hk.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-DdYGgWWD.js → QBOConnectionScreen-D0vt2FBb.js} +1 -1
  29. package/dist/assets/ReferralListScreen-hfIN-UkI.js +5 -0
  30. package/dist/assets/{ReimbursementApprovalRoutes-D0b-XGea.js → ReimbursementApprovalRoutes-D7APr64t.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Cjc2t-Dv.js → ReimbursementApprovalRuleDetailScreen-DPJyNcSj.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-hOmxiTvW.js → ReimbursementRoutes-DjJ7QvEU.js} +1 -1
  33. package/dist/assets/{ReportsRoutes-BYHcHW75.js → ReportsRoutes-BgFOWkwY.js} +1 -1
  34. package/dist/assets/RewardsRoutes-DcjeiwbY.js +1 -0
  35. package/dist/assets/{ScreenRoutes-CzaM-ErL.js → ScreenRoutes-B4o9jljw.js} +2 -2
  36. package/dist/assets/{SettingsRoutes-CyoLt7JH.js → SettingsRoutes-BvG8gznS.js} +7 -7
  37. package/dist/assets/{SetupPagesScreen-BaHRYy46.js → SetupPagesScreen-Ccl8_CS0.js} +1 -1
  38. package/dist/assets/SignInScreen-C4br_Jkp.js +1 -0
  39. package/dist/assets/SignOutScreen-B4ZZrpdl.js +9 -0
  40. package/dist/assets/{TaskListScreen-DqV1jPp4.js → TaskListScreen-D9TnNNrE.js} +2 -2
  41. package/dist/assets/TaskRoutes-CGQDmZnH.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-DlKQYzWG.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-RnHkkAvY.js → TransactionDetailScreen-AiCOKNuK.js} +2 -2
  44. package/dist/assets/TransactionListRoutes-CUTtMwl4.js +1 -0
  45. package/dist/assets/{TreasuryRoutes-DxNNpbkP.js → TreasuryRoutes-Cw8axJIn.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-CXNQHyD0.js → VendorsRoutes-j59CLOjh.js} +12 -12
  47. package/dist/assets/WiseConfirmationScreen-KpDDjTwp.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-CLx-Q3l6.js → ZeniAccountRoutes-CVAgJr8b.js} +12 -12
  49. package/dist/assets/{ZeniAccountStatementScreen-QylI0M1l.js → ZeniAccountStatementScreen-ILlsQ6-n.js} +2 -2
  50. package/dist/assets/{accountMappingHelper-B_vdVXJd.js → accountMappingHelper-DVEV1WRI.js} +1 -1
  51. package/dist/assets/{analytics-B_kykzhy.js → analytics-BAQwJULS.js} +1 -1
  52. package/dist/assets/{analyticsHelper-Dp05MDBJ.js → analyticsHelper-CjA_jHsA.js} +1 -1
  53. package/dist/assets/{core-C7cnuUop.js → core-D85lL_9t.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-rDkCEJpn.js → decodeURIComponentSafe-ByB9WhLS.js} +1 -1
  55. package/dist/assets/{dnd-TzLeX35A.js → dnd-P1ekKsf6.js} +1 -1
  56. package/dist/assets/{empty-7vbmHAL6.js → empty-CYNEYtaG.js} +1 -1
  57. package/dist/assets/{empty-B375B_HA.js → empty-vrCkOfCr.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-BGxjtXTu.js → emptyVideoElement-dzCxtvYW.js} +1 -1
  59. package/dist/assets/{epic-DefpUSD4.js → epic-DD3uTQrs.js} +1 -1
  60. package/dist/assets/getLocaleForTenant-i0RHCLcV.js +1 -0
  61. package/dist/assets/{index-Qmma5Ck1.js → index-BEEelBYS.js} +1 -1
  62. package/dist/assets/{index-CcLDrNJO.js → index-BPbXNCzw.js} +1 -1
  63. package/dist/assets/{index-DrxEgkQ-.js → index-BUCtSz30.js} +1 -1
  64. package/dist/assets/{index-BAxpczYf.js → index-Cn65SF8r.js} +2 -2
  65. package/dist/assets/{index-_vh22_qX.js → index-Dmo9xgqA.js} +1 -1
  66. package/dist/assets/{index-B2lD3Jim.js → index-DzzIwd_P.js} +11444 -11452
  67. package/dist/assets/{index-m-Adf2ll.js → index-lPBYjZLr.js} +1 -1
  68. package/dist/assets/{lexical-Dp9Fvoo6.js → lexical-C7vBKQl2.js} +1 -1
  69. package/dist/assets/{liveblocks-jLbycGCP.js → liveblocks-dlvb-ucF.js} +1 -1
  70. package/dist/assets/{lottie-SbVYeXJk.js → lottie-DGXsyyYr.js} +1 -1
  71. package/dist/assets/{mui-BkznVaFh.js → mui-C9WBrZQt.js} +1 -1
  72. package/dist/assets/{pathToGoBack-DXgc_G9d.js → pathToGoBack-Bl_9p4QB.js} +1 -1
  73. package/dist/assets/{pdf-DQg4OfsP.js → pdf-DebxFbW1.js} +3 -3
  74. package/dist/assets/{pdf-lib-CDsnDRGG.js → pdf-lib-VVDJ8cIK.js} +1 -1
  75. package/dist/assets/{plaid-DfnoQTVm.js → plaid-BveLUCs7.js} +1 -1
  76. package/dist/assets/{pusher-CQHA__kt.js → pusher-DUCiEwkw.js} +1 -1
  77. package/dist/assets/{react-tE35hRos.js → react-1c4ID8s0.js} +1 -1
  78. package/dist/assets/{react-BfsHsZ2B.js → react-5tQG_cKG.js} +1 -1
  79. package/dist/assets/{react-CCO8orgk.js → react-BKO9NKrm.js} +1 -1
  80. package/dist/assets/{react-pHyk9OpQ.js → react-BdgNO3-u.js} +1 -1
  81. package/dist/assets/{react-CJwzWgLi.js → react-Cj6aZ7ln.js} +1 -1
  82. package/dist/assets/{react-DPNnFJXW.js → react-D5d1k6ry.js} +1 -1
  83. package/dist/assets/{recharts-Dt8COHEP.js → recharts-BYSqK3LX.js} +1 -1
  84. package/dist/assets/{routePaths-DBCGZwBw.js → routePaths-CfgcdnOO.js} +1 -1
  85. package/dist/assets/{sentry-CflaePyQ.js → sentry-DGJ961LO.js} +1 -1
  86. package/dist/assets/{url-CMgR7Whs.js → url-CLAf8TQN.js} +1 -1
  87. package/dist/assets/{url-DZF6CZ5y.js → url-DoymNVR-.js} +1 -1
  88. package/dist/assets/{useAskAiCfoHostNavButtonProps-BopsQ8w-.js → useAskAiCfoHostNavButtonProps-CO9-0Ull.js} +1 -1
  89. package/dist/assets/{useDeviceId-aTbWtPu7.js → useDeviceId-cXBRwcUd.js} +1 -1
  90. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-4mjujgB-.js → useFetchSuggestedQuestionsWhenReady-Yook-sE0.js} +1 -1
  91. package/dist/assets/{useInitialThreadRequest-C_8EtcOe.js → useInitialThreadRequest-j_3WBhMo.js} +1 -1
  92. package/dist/assets/{utils-t3ltqqZ0.js → utils-4E0JE-n2.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-m0PuYIs6.js → withTransactionSidePanel-dV1DlPXH.js} +2 -2
  94. package/dist/assets/{zeni-epic-state-DPGmsT0c.js → zeni-epic-state-De57_V18.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +2 -2
  97. package/dist/assets/AddressRoutes-cGHfwdAO.js +0 -1
  98. package/dist/assets/AddressScreen-BnTNp61r.js +0 -9
  99. package/dist/assets/CustomerOnboardingAuthScreen-Dm-6AV-k.js +0 -1
  100. package/dist/assets/DomesticWireDetailScreen-DcjlQFtk.js +0 -18
  101. package/dist/assets/DrawerScreen-3KqQh33-.js +0 -1
  102. package/dist/assets/FeaturePreviewScreen-CEV6r8QS.js +0 -1
  103. package/dist/assets/MagicLinkRoutes-D8VOzSDZ.js +0 -72
  104. package/dist/assets/MagicLinkSignInScreen-DGyXdYGH.js +0 -12
  105. package/dist/assets/MobileAppDrawer-YMrlHv7B.js +0 -1
  106. package/dist/assets/NotFoundScreen-CPtlb4xk.js +0 -1
  107. package/dist/assets/PerformanceRoutes-DWvTIqMy.js +0 -1
  108. package/dist/assets/ReferralListScreen-t3nG_-Jq.js +0 -5
  109. package/dist/assets/RewardsRoutes-BAINUSVd.js +0 -1
  110. package/dist/assets/SignInScreen-D7GXAtAP.js +0 -1
  111. package/dist/assets/SignOutScreen-Bhfa71yJ.js +0 -9
  112. package/dist/assets/TaskRoutes-b0082ks-.js +0 -9
  113. package/dist/assets/TransactionDetailRoutes-72pTxmoR.js +0 -1
  114. package/dist/assets/TransactionListRoutes-0LJWWSY0.js +0 -1
  115. package/dist/assets/WiseConfirmationScreen-Dz9Nm2cC.js +0 -12
  116. package/dist/assets/getLocaleForTenant-DHk9xDoK.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-dlvb-ucF.js";import{A as i}from"./AddressScreen-BzNR9PgQ.js";import s from"./NotFoundScreen-CnfhDP4M.js";import"./sentry-DGJ961LO.js";import{n as d,o as r}from"./core-D85lL_9t.js";import"./zeni-epic-state-De57_V18.js";import"./recharts-BYSqK3LX.js";import"./index-DzzIwd_P.js";import"./mui-C9WBrZQt.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.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 d}from"./liveblocks-dlvb-ucF.js";import{a as b}from"./sentry-DGJ961LO.js";import{j as P,h as _,u as j,l as E,g as M,k as B}from"./core-D85lL_9t.js";import{Z as $,m as L,z as D,j as K,B as N,w as R,d as I,f as S,n as z,h,p as F}from"./index-DzzIwd_P.js";import{IL as C,gI as U,eM as G,IM as O,b$ as V,IN as q,jQ as H}from"./zeni-epic-state-De57_V18.js";import{n as Q}from"./mui-C9WBrZQt.js";import Z from"./NotFoundScreen-CnfhDP4M.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]="0b3e6fd4-98ba-4104-a219-aacbf92f3799",e._sentryDebugIdIdentifier="sentry-dbid-0b3e6fd4-98ba-4104-a219-aacbf92f3799")}catch{}})();const J=Q.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
+ `,W=B(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&O(t.roleMap),r=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=q(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=C(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,n=F(r?.pathnameStackToGoBack);let s=n.poppedPathname??w();const u=r?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(s=`${s}?${f}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const r=X(a);e(H({addressType:c,addressToCreate:r})),I?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(z);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=P(),r=_(),n=j(),{addressId:s,addressType:u}=E(),f=$(),k=L(),v=D.getSignedInUser(),[g,x]=b.useState(s==null),p=M(m=>s!=null?C(m,s).fetchState:"Not-Started"),A=K();if(v==null)throw Error("Can't access address page without signing in...");const T=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return b.useEffect(()=>{g||s==null||(x(!0),r(U(s,!1)))},[g,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!g&&p==="Not-Started"||g&&p==="In-Progress"?d.jsx(N,{fetchState:p,style:{backgroundColor:k.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(R,{analytics:I,onLoad:T}),d.jsx(J,{windowSize:f,children:d.jsx(W,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):d.jsx(Z,{})}const w=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},X=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{de as A,X as t};
@@ -1,11 +1,11 @@
1
- import{j as S}from"./liveblocks-jLbycGCP.js";import{a as i}from"./sentry-CflaePyQ.js";import{h as ee,j as te,u as se,g as U,l as ae,k as ne}from"./core-C7cnuUop.js";import{K as oe,cB as ie,z as re,Z as le,cC as ue,cD as ce,cE as $,R as de,d as _,O as B,cF as me,cG as fe,g as pe,a1 as he,cH as Se,Q as ge,w as Ce,s as be,cI as we,cJ as Ie}from"./index-B2lD3Jim.js";import{fE as ke,f3 as N,eM as Ee,h8 as ye,Ph as Pe,eL as Te,hi as _e,he as xe,fu as ve,fo as Qe,fh as Ae,fl as j,fp as Oe,fq as Fe,fr as De,fs as Le,ft as Me}from"./zeni-epic-state-DPGmsT0c.js";import{D as Re,n as x,P as Ue,S as Be}from"./mui-BkznVaFh.js";import{p as je}from"./pathToGoBack-DXgc_G9d.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.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]="fd1f3c8b-bd24-49e1-b0a4-032069b494fe",a._sentryDebugIdIdentifier="sentry-dbid-fd1f3c8b-bd24-49e1-b0a4-032069b494fe")}catch{}})();const q="chat-response-generated",$e=ne(function(a,r){const n=N(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:u,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===q&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=Fe(t.type),c=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,c);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,c,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,De(t.visualization?.type??"")??null,c,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:u}))}},onSubmit:(e,o,t,m)=>{e&&we(a,e,o,p,g,u,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(),u=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(ke())},[n]);const{customPageTitle:g}=ie(),e=U(l=>N(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),c=U(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ue({currentTenant:c,currentChatSessionId:s,aiCfoView:e}),h=u.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(u.search),[u.search]),O=A.get("ref")??h?.aiCfoRef,y=A.get("emailRefId")??h?.aiCfoEmailRefId,F=i.useRef(!1);i.useEffect(()=>{F.current||O!=="month-end-email"||y==null||s!=null||o==null||(n(ye("controller",o.userId,y,"MONTH_END_EMAIL")),F.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=c.masterTOSInfo,I=W?.isMasterTOSAccepted??!1,{visitedSessions:D}=ce(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:{...u.state,message:"open_ai_cfo_drawer"}})},[I]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...u.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:D.map(l=>`private-chat-${l}.${q}`),eventCallback:(l,Y,Z)=>Z.onEventReceived(l,Y)}),[D]);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(qe,{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:u,isSubmitting:X,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:c,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(Ne,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:I,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{I||c.userRoleId==null||n(ve(c.userRoleId)),p(!1)}})})})]})},Ne=x(Be)`
1
+ import{j as S}from"./liveblocks-dlvb-ucF.js";import{a as i}from"./sentry-DGJ961LO.js";import{h as ee,j as te,u as se,g as B,l as ae,k as ne}from"./core-D85lL_9t.js";import{F as oe,cB as ie,z as re,Z as le,cC as ue,cD as ce,cE as $,w as de,d as _,O as R,cF as me,cG as fe,f as pe,a1 as he,cH as Se,Q as ge,r as Ce,p as we,cI as be,cJ as Ie}from"./index-DzzIwd_P.js";import{fE as ke,f3 as N,eM as Ee,h8 as ye,Ph as Pe,eL as Te,hi as _e,he as xe,fu as ve,fo as Qe,fh as Ae,fl as j,fp as Oe,fq as Fe,fr as De,fs as Le,ft as Me}from"./zeni-epic-state-De57_V18.js";import{D as Ue,n as x,P as Be,S as Re}from"./mui-C9WBrZQt.js";import{p as je}from"./pathToGoBack-Bl_9p4QB.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.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]="836582a3-c6b8-4799-9f52-98db0ba0e97f",a._sentryDebugIdIdentifier="sentry-dbid-836582a3-c6b8-4799-9f52-98db0ba0e97f")}catch{}})();const q="chat-response-generated",$e=ne(function(a,r){const n=N(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:u,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===q&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=Fe(t.type),c=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,c);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,c,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,De(t.visualization?.type??"")??null,c,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:u}))}},onSubmit:(e,o,t,m)=>{e&&be(a,e,o,p,g,u,m,t)},updateCurrentInput:e=>{a(j(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(Oe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=we(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(),u=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(ke())},[n]);const{customPageTitle:g}=ie(),e=B(l=>N(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),c=B(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ue({currentTenant:c,currentChatSessionId:s,aiCfoView:e}),h=u.state,w=h?.aiCfoInitialQuestion,v=!!h?.aiCfoShouldSubmit,[G,k]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||w==null||w===""||(k(w),E(v),Q.current=!0)},[w,v]);const H=i.useCallback(()=>{k(null),E(!1)},[]),A=i.useMemo(()=>new URLSearchParams(u.search),[u.search]),O=A.get("ref")??h?.aiCfoRef,y=A.get("emailRefId")??h?.aiCfoEmailRefId,F=i.useRef(!1);i.useEffect(()=>{F.current||O!=="month-end-email"||y==null||s!=null||o==null||(n(ye("controller",o.userId,y,"MONTH_END_EMAIL")),F.current=!0)},[O,y,s,n,o]);const b=e.uiState.lastContextMessage;i.useEffect(()=>{b!=null&&b!==""&&s!=null&&(k(b),E(!0),n(Pe()))},[b,s,n]);const W=c.masterTOSInfo,I=W?.isMasterTOSAccepted??!1,{visitedSessions:D}=ce(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:{...u.state,message:"open_ai_cfo_drawer"}})},[I]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...u.state}})},[s,t]),i.useEffect(()=>{t!=null&&s==null&&t!=="new_chat"&&t!=="explore"&&n(Te({sessionId:t,agentId:"controller"}))},[]);const X=i.useMemo(()=>({events:D.map(l=>`private-chat-${l}.${q}`),eventCallback:(l,Z,K)=>K.onEventReceived(l,Z)}),[D]);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 Y=s!=null&&e.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return S.jsxs(qe,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),R(m)&&C.drawerElement,S.jsx($e,{...X,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:U,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:u,isSubmitting:Y,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:c,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(Ne,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:I,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{I||c.userRoleId==null||n(ve(c.userRoleId)),p(!1)}})})})]})},Ne=x(Re)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
5
  `,qe=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-jLbycGCP.js";import{a as f}from"./sentry-CflaePyQ.js";import{j as U,u as B,h as T,g as v,N,k as j,l as $,n as L,o as h}from"./core-C7cnuUop.js";import{eM as O,M2 as A,LK as b,wT as w,wN as F,wR as I,wG as M,LM as W,wJ as q,wV as z,wU as C}from"./zeni-epic-state-DPGmsT0c.js";import{m as P,z as k,B as V,a1 as G,bu as J,aa as _,bv as K}from"./index-B2lD3Jim.js";import"./mui-BkznVaFh.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-Cjc2t-Dv.js";import Q from"./NotFoundScreen-CPtlb4xk.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]="92c86552-2b18-4ae4-97bb-c2f2cfdc1d67",e._sentryDebugIdIdentifier="sentry-dbid-92c86552-2b18-4ae4-97bb-c2f2cfdc1d67")}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(M(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(G(J)),Y=()=>{const e=U(),o=B(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>O(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(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...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 E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),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(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?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(z())},onSaveRuleSuccess:()=>{t("../")}}})(K);function D(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=$(),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(L,{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-dlvb-ucF.js";import{a as f}from"./sentry-DGJ961LO.js";import{j as U,u as B,h as T,g as v,N,k as j,l as $,n as L,o as h}from"./core-D85lL_9t.js";import{eM as O,M2 as A,LK as b,wT as w,wN as F,wR as I,wG as M,LM as W,wJ as q,wV as z,wU as C}from"./zeni-epic-state-De57_V18.js";import{m as P,z as k,B as V,a1 as G,bu as J,aa as _,bv as K}from"./index-DzzIwd_P.js";import"./mui-C9WBrZQt.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-DPJyNcSj.js";import Q from"./NotFoundScreen-CnfhDP4M.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]="92c86552-2b18-4ae4-97bb-c2f2cfdc1d67",e._sentryDebugIdIdentifier="sentry-dbid-92c86552-2b18-4ae4-97bb-c2f2cfdc1d67")}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(M(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(G(J)),Y=()=>{const e=U(),o=B(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>O(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(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...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 E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),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(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?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(z())},onSaveRuleSuccess:()=>{t("../")}}})(K);function D(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=$(),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(L,{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-jLbycGCP.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 S}from"./core-C7cnuUop.js";import{eM as Z,Lk as Me,bu as At,Gm as ra,bn as xt,bC as ue,Ll as Bt,wb as Et,xl as Ue,wK as ca,bm as je,Lm as da,Ln as pa,b$ as ua,Lo as ma,j8 as Dt,Lp as jt,Lq as Tt,xW as Oe,wq as Be,Lr as ba,v$ as it,Ls as ha,B6 as ga,w3 as ya,w9 as Pt,Lt as Ie,Lu as Ne,xm as ze,Lv as Sa,Lw as fa,xp as Ze,Lx as Ia,xC as va,Ly as Ft,x6 as ot,xb as ka,Lz as wa,LA as pe,LB as Lt,LC as Rt,LD as Vt,fG as Ca,wv as _e,ct as $t,LE as Aa,gy as xa,LF as Ba,LG as Ea,eT as Ut,eR as _t,LH as He,LI as Da,LJ as ja,J3 as We,LK as Ta,J4 as ie,J5 as qe,LL as Pa,LM as Fa,LN as La,xd as lt,xa as Ra,LO as Va,LP as $a,LQ as Ua,wY as _a,LR as Ga,LS as Ma,LT as Oa,cN as Gt,cJ as Mt,jj as Na,bI as za,bp as Ot,bJ as Nt,vh as Za,LU as Ha,AV as Wa,A$ as qa,rQ as Ja,xn as Ka,y1 as Qa,jw as fe,LV as Ya,LW as zt,j_ as Xa,jq as Zt,jL as Ht,jK as st,bB as be,bH as en,LX as tn,LY as ve,i1 as an,LZ as rt,L_ as nn,i5 as on,is as ln,yf as sn,L$ as rn,jT as cn,y5 as dn,M0 as ct,y9 as pn,ye as un,yb as mn,y3 as bn,M1 as Wt,wk as hn,M2 as gn,M3 as yn,fA as Sn,fz as fn,fy as In,jz as vn,jR as dt,k0 as kn,pn as wn,jI as Cn,y7 as An,ib as xn,k5 as Bn,M4 as En,i3 as Dn,pe as jn,M5 as Tn,x2 as Pn,bD as Fn,br as Ln,I2 as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-DPGmsT0c.js";import{m as me,z as R,j as ke,K as Je,a as oe,r as y,aI as Ee,B as ce,o as E,R as Te,d as j,b1 as Gn,s as z,Q as Ke,w as D,Z as we,b2 as pt,b3 as ut,b4 as Mn,af as On,G as Nn,aC as zn,C as qt,D as Qe,H as Ye,b5 as Zn,ao as Jt,b6 as Hn,M as Wn,g 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,y as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-B2lD3Jim.js";import{n as V,S as di}from"./mui-BkznVaFh.js";import{A as mt}from"./AddressScreen-BnTNp61r.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-DcjlQFtk.js";import{a as f}from"./sentry-CflaePyQ.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-BopsQ8w-.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-4mjujgB-.js";import{u as Yt}from"./useInitialThreadRequest-C_8EtcOe.js";import De from"./NotFoundScreen-CPtlb4xk.js";import{D as bi}from"./DrawerScreen-3KqQh33-.js";import{M as Xt}from"./MobileAppDrawer-YMrlHv7B.js";import{F as ea}from"./FeaturePreviewScreen-CEV6r8QS.js";import{S as Le}from"./SetupPagesScreen-BaHRYy46.js";import{B as hi}from"./BillPayApprovalRoutes-BVBiJezP.js";import{FallBackRoute as gi}from"./ScreenRoutes-CzaM-ErL.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";import"./analyticsHelper-Dp05MDBJ.js";import"./routePaths-DBCGZwBw.js";import"./BusinessVerificationPageScreen-uevt4KH_.js";import"./ReimbursementApprovalRuleDetailScreen-Cjc2t-Dv.js";import"./getLocaleForTenant-DHk9xDoK.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]="bc5daeb2-6396-43ac-9f76-4d33e27d8eb2",e._sentryDebugIdIdentifier="sentry-dbid-bc5daeb2-6396-43ac-9f76-4d33e27d8eb2")}catch{}})();const yi=Y(function(e,t){const l=Me(e,t.billId),n=R.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.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,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(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:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,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(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Gn);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),p=ke(),o=v(w=>Z(w)),s=v(w=>Me(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,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(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),M=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.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??"",$,M,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,M,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(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:M,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=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,p=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:p,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,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(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 O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Me(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const M=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&_?G(!1):!p&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||p||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),p&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(M??"",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(M??"",w,i?.userEmail??"","no"),t(Sa({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(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{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:M}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]})}):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(Mn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(p,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:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-dlvb-ucF.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 S}from"./core-D85lL_9t.js";import{eM as Z,Lk as Me,bu as At,Gm as ra,bn as xt,bC as ue,Ll as Bt,wb as Et,xl as Ue,wK as ca,bm as je,Lm as da,Ln as pa,b$ as ua,Lo as ma,j8 as Dt,Lp as jt,Lq as Tt,xW as Oe,wq as Be,Lr as ba,v$ as it,Ls as ha,B6 as ga,w3 as ya,w9 as Pt,Lt as Ie,Lu as Ne,xm as ze,Lv as Sa,Lw as fa,xp as Ze,Lx as Ia,xC as va,Ly as Ft,x6 as ot,xb as ka,Lz as wa,LA as pe,LB as Lt,LC as Rt,LD as Vt,fG as Ca,wv as _e,ct as $t,LE as Aa,gy as xa,LF as Ba,LG as Ea,eT as Ut,eR as _t,LH as He,LI as Da,LJ as ja,J3 as We,LK as Ta,J4 as ie,J5 as qe,LL as Pa,LM as Fa,LN as La,xd as lt,xa as Ra,LO as Va,LP as $a,LQ as Ua,wY as _a,LR as Ga,LS as Ma,LT as Oa,cN as Gt,cJ as Mt,jj as Na,bI as za,bp as Ot,bJ as Nt,vh as Za,LU as Ha,AV as Wa,A$ as qa,rQ as Ja,xn as Ka,y1 as Qa,jw as fe,LV as Ya,LW as zt,j_ as Xa,jq as Zt,jL as Ht,jK as st,bB as be,bH as en,LX as tn,LY as ve,i1 as an,LZ as rt,L_ as nn,i5 as on,is as ln,yf as sn,L$ as rn,jT as cn,y5 as dn,M0 as ct,y9 as pn,ye as un,yb as mn,y3 as bn,M1 as Wt,wk as hn,M2 as gn,M3 as yn,fA as Sn,fz as fn,fy as In,jz as vn,jR as dt,k0 as kn,pn as wn,jI as Cn,y7 as An,ib as xn,k5 as Bn,M4 as En,i3 as Dn,pe as jn,M5 as Tn,x2 as Pn,bD as Fn,br as Ln,I2 as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-De57_V18.js";import{m as me,z as R,j as ke,F as Je,a as oe,i as y,aI as Ee,B as ce,o as E,w as Te,d as j,b1 as Gn,p as z,Q as Ke,r as D,Z as we,b2 as pt,b3 as ut,b4 as Mn,af as On,A as Nn,aC as zn,x as qt,D as Qe,C as Ye,b5 as Zn,ao as Jt,b6 as Hn,H as Wn,f 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,v as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-DzzIwd_P.js";import{n as V,S as di}from"./mui-C9WBrZQt.js";import{A as mt}from"./AddressScreen-BzNR9PgQ.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-BQCaRz-2.js";import{a as f}from"./sentry-DGJ961LO.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-CO9-0Ull.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-Yook-sE0.js";import{u as Yt}from"./useInitialThreadRequest-j_3WBhMo.js";import De from"./NotFoundScreen-CnfhDP4M.js";import{D as bi}from"./DrawerScreen-Dz54oQdA.js";import{M as Xt}from"./MobileAppDrawer-BFl1Y_qR.js";import{F as ea}from"./FeaturePreviewScreen-BsHiFyOu.js";import{S as Le}from"./SetupPagesScreen-Ccl8_CS0.js";import{B as hi}from"./BillPayApprovalRoutes-C3wS_qNP.js";import{FallBackRoute as gi}from"./ScreenRoutes-B4o9jljw.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./analyticsHelper-CjA_jHsA.js";import"./routePaths-CfgcdnOO.js";import"./BusinessVerificationPageScreen-BtM5fUcw.js";import"./ReimbursementApprovalRuleDetailScreen-DPJyNcSj.js";import"./getLocaleForTenant-i0RHCLcV.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]="9c55a84f-b8d5-4059-81e4-207b66e32b5f",e._sentryDebugIdIdentifier="sentry-dbid-9c55a84f-b8d5-4059-81e4-207b66e32b5f")}catch{}})();const yi=Y(function(e,t){const l=Me(e,t.billId),n=R.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.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,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(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:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,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(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Gn);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),p=ke(),o=v(w=>Z(w)),s=v(w=>Me(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,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(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),M=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.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??"",$,M,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,M,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(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:M,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=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,p=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:p,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,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(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 O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Me(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const M=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&_?G(!1):!p&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||p||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),p&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(M??"",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(M??"",w,i?.userEmail??"","no"),t(Sa({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(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{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:M}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]})}):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(Mn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(p,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:`${ye.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-jLbycGCP.js";import{a as V}from"./sentry-CflaePyQ.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-C7cnuUop.js";import{j as ce,a as ue,aI as de,z as M,R as pe,d as B,aa as x,g as z,bq as le,ao as me,w as E,ap as R}from"./index-B2lD3Jim.js";import{LS as fe,eM as G,rf as ye,Gq as Se,wY as ge,zF as Ie,Cc as he,CR as be,DK as De,Md as Oe,Me as Te,Mf as ke,Mg as Ce,Mh as Ve,IM as we,Lf as Ae,IY as Ne,jQ as _e,fA as Fe,fz as ve,fy as xe,pn as ze,pe as Me,pb as Be,jI as Ee,ro as Re,rm as L,bB as P,rA as j,cr as Le}from"./zeni-epic-state-DPGmsT0c.js";import{n as Pe}from"./mui-BkznVaFh.js";import{c as U}from"./routePaths-DBCGZwBw.js";import{M as je}from"./MobileAppDrawer-YMrlHv7B.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]="526b1212-7750-41dd-90db-e2937a103e68",e._sentryDebugIdIdentifier="sentry-dbid-526b1212-7750-41dd-90db-e2937a103e68")}catch{}})();const Ue=Pe.div`
1
+ import{j as k}from"./liveblocks-dlvb-ucF.js";import{a as V}from"./sentry-DGJ961LO.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-D85lL_9t.js";import{j as ce,a as ue,aI as de,z as M,w as pe,d as B,aa as x,f as z,bq as le,ao as me,r as E,ap as R}from"./index-DzzIwd_P.js";import{LS as fe,eM as G,rf as ye,Gq as Se,wY as ge,zF as Ie,Cc as be,CR as he,DK as De,Md as Oe,Me as Te,Mf as ke,Mg as Ce,Mh as Ve,IM as we,Lf as Ae,IY as Ne,jQ as _e,fA as Fe,fz as ve,fy as xe,pn as ze,pe as Me,pb as Be,jI as Ee,ro as Re,rm as L,bB as P,rA as j,cr as Le}from"./zeni-epic-state-De57_V18.js";import{n as Pe}from"./mui-C9WBrZQt.js";import{c as U}from"./routePaths-CfgcdnOO.js";import{M as je}from"./MobileAppDrawer-BFl1Y_qR.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]="e9cb93e5-b5e0-43ad-b222-ae0b7b073672",e._sentryDebugIdIdentifier="sentry-dbid-e9cb93e5-b5e0-43ad-b222-ae0b7b073672")}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-jLbycGCP.js";import{a as V}from"./sentry-CflaePy
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=M.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ae(e.companyConfigState),s=Ne(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:Y,transactionVolume:Z,transactionVolumeDescription:$,purposeOfAccount:K,purposeOfAccountDescription:Q,regulatedStatus:W,regulatedStatusDescription:H,usNexus:J,usNexusTypes:X}=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?Le(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?P(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:Y,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:W??"",regulatedStatusDescription:H,usNexus:J,usNexusTypes:X?.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:A,treasuryUserVerificationStatus:N,fileIds:_}=p;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:O,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(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:A,treasuryUserVerificationStatus:N,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(L(i,t,r))},onSendForVerificationClick:t=>{e(L(i,t,r,!0))},onAddressClick:t=>{const s=U(b,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(b,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Ee({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(Me(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),Je=({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??M.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]),M.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: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)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Je as B};
9
+ `,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=M.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=Ae(e.companyConfigState),s=Ne(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled: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:A,sourceOfFunds:N,companySubIndustry:_,countriesOfOperations:b,companySourceOfFunds:q,companySourceOfFundsDescription:Y,transactionVolume:Z,transactionVolumeDescription:$,purposeOfAccount:K,purposeOfAccountDescription:Q,regulatedStatus:W,regulatedStatusDescription:H,usNexus:J,usNexusTypes:X}=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?Le(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?P(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:Y,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:W??"",regulatedStatusDescription:H,usNexus:J,usNexusTypes:X?.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:A,treasuryUserVerificationStatus:N,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?R(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:A,treasuryUserVerificationStatus:N,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(L(i,t,r))},onSendForVerificationClick:t=>{e(L(i,t,r,!0))},onAddressClick:t=>{const s=U(h,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(h,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Ee({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(Me(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),Je=({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??M.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]),M.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: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)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Je as B};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-jLbycGCP.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Jt,o as te}from"./core-C7cnuUop.js";import{eM as ie,br as Be,NJ as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NK as $e,NL as $a,su as Sa,jg as Ia,NM as Aa,gy as ca,yY as aa,y_ as Ga,y$ as Ya,j6 as Ct,NN as Ge,yM as pt,NO as Qt,NP as Xt,yP as wa,NQ as en,Ma as Pa,qG as ht,yV as Za,gJ as an,NR as ft,NS as Ye,bp as tn,NT as nn,fA as Ta,fz as Fa,zt as rn,fy as va,LS as sn,NU as gt,cN as bt,cJ as on,M9 as ua,A3 as cn,NV as rt,zF as xa,NW as yt,A4 as dn,MA as ln,A5 as un,A$ as mn,rQ as Cn,AV as pn,ze as St,z7 as hn,NX as fn,fM as gn,zn as It,zr as At,fL as bn,NY as yn,zR as Et,NZ as Sn,N_ as In,N$ as An,zp as kt,za as Dt,yS as _t,zj as wt,zh as Pt,zl as En,yZ as st,O0 as Tt,O1 as La,zC as Ea,IR as Ft,cK as Ka,O2 as kn,O3 as Dn,O4 as _n,O5 as wn,zz as Ha,zY as Pn,zU as Tn,zv as Fn,zW as vn,zM as xn,zO as Ln,O6 as vt,A2 as xt,Gm as Bn,O7 as On,O8 as Rn,O9 as Un,Oa as Lt,Ob as Nn,Ap as jn,zE as Bt,zy as da,zD as Vn,Oc as Hn,Od as Mn,yJ as zn,Oe as Ot,Of as Rt,Og as $n,yL as Gn,yK as ot,Oh as Yn,Oi as Zn,Oj as Kn,IN as Wn,Ok as Wa,Ol as qn,vk as Ut,jQ as Jn,gz as Qn,Au as Xn,Om as Nt,On as er,Av as ar,Oo as tr,db as nr,so as rr,Ak as sr,Ae as Le,bu as or,bC as ir,ct as cr,bD as dr,I2 as lr}from"./zeni-epic-state-DPGmsT0c.js";import{z as X,j as Re,a as oe,r as Z,B as Ze,bU as Ba,c3 as ur,s as ve,c4 as mr,c5 as Cr,Z as ma,aI as Fe,w as be,bb as qa,c6 as pr,C as Ca,i as Oa,m as Ja,d as J,D as Qa,c7 as hr,K as jt,al as Xa,bn as Xe,c8 as Ma,c9 as fr,R as et,a1 as gr,ca as br,ao as Vt,Q as za,M as Ht,g as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as Na,y as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-B2lD3Jim.js";import{n as _e,D as zt,S as xr}from"./mui-BkznVaFh.js";import{a as c}from"./sentry-CflaePyQ.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Oe,f as Ue,A as Lr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Or,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-BaHRYy46.js";import Ra from"./NotFoundScreen-CPtlb4xk.js";import{M as ha}from"./MobileAppDrawer-YMrlHv7B.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-BopsQ8w-.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-4mjujgB-.js";import{v as ct}from"./utils-t3ltqqZ0.js";import{t as Ur}from"./AddressScreen-BnTNp61r.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./analyticsHelper-Dp05MDBJ.js";import"./routePaths-DBCGZwBw.js";import"./BusinessVerificationPageScreen-uevt4KH_.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]="6e331af8-52ef-4e8c-9a29-3ca81c5b4a2d",e._sentryDebugIdIdentifier="sentry-dbid-6e331af8-52ef-4e8c-9a29-3ca81c5b4a2d")}catch{}})();function Nr(){const e=ue(),{cardId:t}=la(),a=me(),r=X.getSignedInUser(),n=S(G=>ie(G)),u=Re(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,O=S(G=>Me(G,n.companyId)),N=ze(O.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),j=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],x=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=R?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),j!=="Completed"&&j!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,j]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Oe(l,g,w,f),L=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:L,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:j,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:x?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const jr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Qt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=X.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ra,{}):s.jsx(jr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=X.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Xt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:O}=oe(),{isFeatureEnabled:N}=O(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=O(Z.isDebitCardFeatureEnabled),P=Ae(T,k),j=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:N,isBookKeepingTenant:F,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:U}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const x=X.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:x,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:Oa.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
1
+ import{j as s}from"./liveblocks-dlvb-ucF.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Jt,o as te}from"./core-D85lL_9t.js";import{eM as ie,br as Be,NJ as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NK as $e,NL as $a,su as Sa,jg as Ia,NM as Aa,gy as ca,yY as aa,y_ as Ga,y$ as Ya,j6 as Ct,NN as Ge,yM as pt,NO as Qt,NP as Xt,yP as wa,NQ as en,Ma as Pa,qG as ht,yV as Za,gJ as an,NR as ft,NS as Ye,bp as tn,NT as nn,fA as Ta,fz as Fa,zt as rn,fy as va,LS as sn,NU as gt,cN as bt,cJ as on,M9 as ua,A3 as cn,NV as rt,zF as xa,NW as yt,A4 as dn,MA as ln,A5 as un,A$ as mn,rQ as Cn,AV as pn,ze as St,z7 as hn,NX as fn,fM as gn,zn as It,zr as At,fL as bn,NY as yn,zR as Et,NZ as Sn,N_ as In,N$ as An,zp as kt,za as Dt,yS as _t,zj as wt,zh as Pt,zl as En,yZ as st,O0 as Tt,O1 as La,zC as Ea,IR as Ft,cK as Ka,O2 as kn,O3 as Dn,O4 as _n,O5 as wn,zz as Ha,zY as Pn,zU as Tn,zv as Fn,zW as vn,zM as xn,zO as Ln,O6 as vt,A2 as xt,Gm as Bn,O7 as On,O8 as Rn,O9 as Un,Oa as Lt,Ob as Nn,Ap as jn,zE as Bt,zy as da,zD as Vn,Oc as Hn,Od as Mn,yJ as zn,Oe as Ot,Of as Rt,Og as $n,yL as Gn,yK as ot,Oh as Yn,Oi as Zn,Oj as Kn,IN as Wn,Ok as Wa,Ol as qn,vk as Ut,jQ as Jn,gz as Qn,Au as Xn,Om as Nt,On as er,Av as ar,Oo as tr,db as nr,so as rr,Ak as sr,Ae as Le,bu as or,bC as ir,ct as cr,bD as dr,I2 as lr}from"./zeni-epic-state-De57_V18.js";import{z as X,j as Re,a as oe,i as Z,B as Ze,bU as Ba,c3 as ur,p as ve,c4 as mr,c5 as Cr,Z as ma,aI as Fe,r as be,bb as qa,c6 as pr,x as Ca,h as Oa,m as Ja,d as J,D as Qa,c7 as hr,F as jt,al as Xa,bn as Xe,c8 as Ma,c9 as fr,w as et,a1 as gr,ca as br,ao as Vt,Q as za,H as Ht,f as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as Na,v as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-DzzIwd_P.js";import{n as _e,D as zt,S as xr}from"./mui-C9WBrZQt.js";import{a as c}from"./sentry-DGJ961LO.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Oe,f as Ue,A as Lr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Or,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-Ccl8_CS0.js";import Ra from"./NotFoundScreen-CnfhDP4M.js";import{M as ha}from"./MobileAppDrawer-BFl1Y_qR.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-CO9-0Ull.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-Yook-sE0.js";import{v as ct}from"./utils-4E0JE-n2.js";import{t as Ur}from"./AddressScreen-BzNR9PgQ.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./analyticsHelper-CjA_jHsA.js";import"./routePaths-CfgcdnOO.js";import"./BusinessVerificationPageScreen-BtM5fUcw.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]="307a5ef7-480f-4804-8dac-be84621aca39",e._sentryDebugIdIdentifier="sentry-dbid-307a5ef7-480f-4804-8dac-be84621aca39")}catch{}})();function Nr(){const e=ue(),{cardId:t}=la(),a=me(),r=X.getSignedInUser(),n=S(G=>ie(G)),u=Re(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,O=S(G=>Me(G,n.companyId)),N=ze(O.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),j=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],x=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=R?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),j!=="Completed"&&j!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,j]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Oe(l,g,w,f),L=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:L,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:j,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:x?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const jr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Qt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=X.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ra,{}):s.jsx(jr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=X.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Xt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:O}=oe(),{isFeatureEnabled:N}=O(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=O(Z.isDebitCardFeatureEnabled),P=Ae(T,k),j=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:N,isBookKeepingTenant:F,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:U}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const x=X.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:x,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:Oa.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-jLbycGCP.js";import{a as g}from"./sentry-CflaePyQ.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-C7cnuUop.js";import{z as N,aZ as F,R as P,d as L,g as V,aa as b,a_ as j,ao as A,ap as M,w as U}from"./index-B2lD3Jim.js";import{eM as D,fC as B,rf as _,fx as R,b$ as z,Lf as G,bm as Y,pn as Z,pb as $,jI as H,lc as S,Lg as q,bB as J,cr as C,lk as K,ln as Q}from"./zeni-epic-state-DPGmsT0c.js";import"./mui-BkznVaFh.js";import{c as W}from"./routePaths-DBCGZwBw.js";import{M as X}from"./MobileAppDrawer-YMrlHv7B.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="2c94989e-670e-4ff6-afa1-acbb1a11adeb",n._sentryDebugIdIdentifier="sentry-dbid-2c94989e-670e-4ff6-afa1-acbb1a11adeb")}catch{}})();const ee=E(function(n){const t=R(n),i=N.getSignedInUser(),l=D(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.subIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(q(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n(H({files:e}))},onDeleteFile:e=>{n($(e))},onEditFileName:(e,a)=>{n(Z(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(F,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-dlvb-ucF.js";import{a as g}from"./sentry-DGJ961LO.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-D85lL_9t.js";import{z as N,aZ as F,w as P,d as L,f as V,aa as b,a_ as j,ao as A,ap as M,r as U}from"./index-DzzIwd_P.js";import{eM as D,fC as B,rf as _,fx as R,b$ as z,Lf as G,bm as Y,pn as Z,pb as $,jI as H,lc as S,Lg as q,bB as J,cr as C,lk as K,ln as Q}from"./zeni-epic-state-De57_V18.js";import"./mui-C9WBrZQt.js";import{c as W}from"./routePaths-CfgcdnOO.js";import{M as X}from"./MobileAppDrawer-BFl1Y_qR.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="f4151a35-7fc0-4b31-8b41-efd11a691b9b",n._sentryDebugIdIdentifier="sentry-dbid-f4151a35-7fc0-4b31-8b41-efd11a691b9b")}catch{}})();const ee=E(function(n){const t=R(n),i=N.getSignedInUser(),l=D(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.subIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(q(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n(H({files:e}))},onDeleteFile:e=>{n($(e))},onEditFileName:(e,a)=>{n(Z(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(F,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-jLbycGCP.js";import{a}from"./sentry-CflaePyQ.js";import{h as D,u as v,g as u,N as w}from"./core-C7cnuUop.js";import{H_ as _,eM as A,fj as O,m3 as j,fJ as h,fi as U,eN as L,I6 as F}from"./zeni-epic-state-DPGmsT0c.js";import{u as H,z as p,L as g,D as $,o as k}from"./index-B2lD3Jim.js";import{n as z}from"./mui-BkznVaFh.js";import{t as R}from"./getLocaleForTenant-DHk9xDoK.js";import{g as P,Q as G}from"./QBOConnectionScreen-DdYGgWWD.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";import"./empty-B375B_HA.js";import"./pdf-lib-CDsnDRGG.js";import"./index-DrxEgkQ-.js";import"./url-DZF6CZ5y.js";import"./index-CcLDrNJO.js";import"./decodeURIComponentSafe-rDkCEJpn.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="90c8535a-7421-4913-8938-db06dfde49a0",t._sentryDebugIdIdentifier="sentry-dbid-90c8535a-7421-4913-8938-db06dfde49a0")}catch{}})();const J=z.div`
1
+ import{j as C}from"./liveblocks-dlvb-ucF.js";import{a}from"./sentry-DGJ961LO.js";import{h as D,u as v,g as u,N as w}from"./core-D85lL_9t.js";import{H_ as _,eM as A,fj as O,m3 as j,fJ as h,fi as U,eN as L,I6 as F}from"./zeni-epic-state-De57_V18.js";import{u as H,z as p,L as g,D as $,o as k}from"./index-DzzIwd_P.js";import{n as z}from"./mui-C9WBrZQt.js";import{t as R}from"./getLocaleForTenant-i0RHCLcV.js";import{g as P,Q as G}from"./QBOConnectionScreen-D0vt2FBb.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./empty-vrCkOfCr.js";import"./pdf-lib-VVDJ8cIK.js";import"./index-BUCtSz30.js";import"./url-DoymNVR-.js";import"./index-BPbXNCzw.js";import"./decodeURIComponentSafe-ByB9WhLS.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="90c8535a-7421-4913-8938-db06dfde49a0",t._sentryDebugIdIdentifier="sentry-dbid-90c8535a-7421-4913-8938-db06dfde49a0")}catch{}})();const J=z.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -0,0 +1 @@
1
+ import{j as i}from"./liveblocks-dlvb-ucF.js";import{z as m}from"./index-DzzIwd_P.js";import{g as n}from"./QBOConnectionScreen-D0vt2FBb.js";import"./sentry-DGJ961LO.js";import{u as p,N as a}from"./core-D85lL_9t.js";import"./zeni-epic-state-De57_V18.js";import"./recharts-BYSqK3LX.js";import"./mui-C9WBrZQt.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./empty-vrCkOfCr.js";import"./pdf-lib-VVDJ8cIK.js";import"./index-BUCtSz30.js";import"./url-DoymNVR-.js";import"./index-BPbXNCzw.js";import"./decodeURIComponentSafe-ByB9WhLS.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]="34360189-ad08-40f6-93e1-76035a2c6a6d",t._sentryDebugIdIdentifier="sentry-dbid-34360189-ad08-40f6-93e1-76035a2c6a6d")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,8 +1,8 @@
1
- import{j as a}from"./liveblocks-jLbycGCP.js";import{t as $e,A as Ce}from"./AddressScreen-BnTNp61r.js";import Me from"./NotFoundScreen-CPtlb4xk.js";import{a as g}from"./sentry-CflaePyQ.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as ze,n as Ke,o as z}from"./core-C7cnuUop.js";import{y as de,j as le,z as B,a as ue,m as Qe,r as _,w as V,R as W,d as N,B as je,g as Y,ak as qe,Z as Ze,al as Ie,i as te,am as He,an as ke,o as We,ao as Xe,ap as Ee,aq as Ye}from"./index-B2lD3Jim.js";import{bm as Je,eM as ee,fb as et,eT as pe,eR as me,bu as tt,m1 as at,f7 as nt,bL as ot,iM as ae,iP as ve,IK as st,bQ as it,b$ as ge,rt as he,re as rt,IW as J,ru as _e,Gq as ct,jQ as Ue,IX as Ve,IY as dt,IZ as lt,I_ as ut,iK as pt,iN as mt,rg as Be,rs as gt,bB as Te,cr as ht,rG as xe,pn as ft,pb as yt,jI as St,fA as bt,fz as Ct,fy as It,I$ as kt,r8 as Et,rH as Tt,rK as xt,rN as Ot,rT as Pt,cR as At}from"./zeni-epic-state-DPGmsT0c.js";import{n as fe}from"./mui-BkznVaFh.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-DdYGgWWD.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";import"./empty-B375B_HA.js";import"./pdf-lib-CDsnDRGG.js";import"./index-DrxEgkQ-.js";import"./url-DZF6CZ5y.js";import"./index-CcLDrNJO.js";import"./decodeURIComponentSafe-rDkCEJpn.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]="0d07e977-7da7-453e-9e65-7a601fc1a143",t._sentryDebugIdIdentifier="sentry-dbid-0d07e977-7da7-453e-9e65-7a601fc1a143")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(qe),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Je(i),{useFeatureGate:m}=ue(),k=Qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),P=me(c),A=[],q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,M=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,K=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!K,Q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(q===!1&&A.push("top_expenses"),M===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),Q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{S(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-dlvb-ucF.js";import{t as $e,A as Ce}from"./AddressScreen-BzNR9PgQ.js";import Me from"./NotFoundScreen-CnfhDP4M.js";import{a as g}from"./sentry-DGJ961LO.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as ze,n as Ke,o as z}from"./core-D85lL_9t.js";import{v as de,j as le,z as B,a as ue,m as Qe,i as _,r as V,w as W,d as N,B as je,f as Y,ak as qe,Z as Ze,al as Ie,h as te,am as He,an as ke,o as We,ao as Xe,ap as Ee,aq as Ye}from"./index-DzzIwd_P.js";import{bm as Je,eM as ee,fb as et,eT as pe,eR as me,bu as tt,m1 as at,f7 as nt,bL as ot,iM as ae,iP as ve,IK as st,bQ as it,b$ as ge,rt as fe,re as rt,IW as J,ru as _e,Gq as ct,jQ as Ue,IX as Ve,IY as dt,IZ as lt,I_ as ut,iK as pt,iN as mt,rg as Be,rs as gt,bB as Te,cr as ft,rG as xe,pn as ht,pb as yt,jI as St,fA as bt,fz as Ct,fy as It,I$ as kt,r8 as Et,rH as Tt,rK as xt,rN as Ot,rT as Pt,cR as At}from"./zeni-epic-state-De57_V18.js";import{n as he}from"./mui-C9WBrZQt.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-D0vt2FBb.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./empty-vrCkOfCr.js";import"./pdf-lib-VVDJ8cIK.js";import"./index-BUCtSz30.js";import"./url-DoymNVR-.js";import"./index-BPbXNCzw.js";import"./decodeURIComponentSafe-ByB9WhLS.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]="18425397-fc50-4e96-9ef5-a69f049877cd",t._sentryDebugIdIdentifier="sentry-dbid-18425397-fc50-4e96-9ef5-a69f049877cd")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(qe),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Je(i),{useFeatureGate:m}=ue(),k=Qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),P=me(c),A=[],q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,M=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,K=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!K,Q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(q===!1&&A.push("top_expenses"),M===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),Q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),h===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{S(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=he.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
5
- `,Pe=fe.div`
5
+ `,Pe=he.div`
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  align-items: center;
@@ -16,8 +16,8 @@ import{j as a}from"./liveblocks-jLbycGCP.js";import{t as $e,A as Ce}from"./Addre
16
16
  }
17
17
 
18
18
  ${t=>t.windowSize!=="small"?"overflow: auto;":""}
19
- `,Ae=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),S=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:S??""},n=ee(t),i=he(t,s),h=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",k=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:k.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Xe.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:h,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:S}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(xt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Tt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(J({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:k,email:T,ssn:x,nationalityCountryCode:I,dob:f,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,isPhoneVerified:O}=i;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:h,userId:m,firstName:k.firstName,lastName:k.lastName,email:T,ssn:x,nationalityCountryCode:I?.selectedOption!=null?Ee(I.selectedOption):void 0,phone:U,birthday:f!=null?Te(f?.toString()):f,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(xe({officers:n}))},onGetOtp:(e,n)=>{t(It(e,"CustomerOnboarding")),n!=null&&t(kt({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(bt(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(St({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:k,companyWebsite:T,companyPhone:x,primaryContactEmail:I,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:w,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:G,purposeOfAccount:j,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:q,transactionVolume:M,transactionVolumeDescription:K,usNexus:v,usNexusTypes:Q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:k,website:T!=""&&T!=null?ht(T):void 0,phone:x,syncToken:F,fileIds:$,incDate:w!=null?Te(w?.toString()):w,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(H=>H.length===2?H:Ee(H))??[],purposeOfAccount:j?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:q,transactionVolume:M?.selectedOption??"",transactionVolumeDescription:K,usNexus:v,usNexusTypes:Q?.selectedOptions??[]},Z={userId:U,firstName:f.firstName,lastName:f.lastName,email:I,syncToken:C};t(xe({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=De(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=De(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(J({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(He),X=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Ze(),S=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,k]=g.useState(!1),{tenantEmailDomain:T}=re(),x=le(),{useFeatureGate:I}=ue(),{isFeatureEnabled:f}=I(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),$=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),w=D(y=>y.cardPaymentViewState),R=Ie(w.addCardPaymentSourceStatus.fetchState),O=w.addCardPaymentSourceStatus.fetchState,{code:b,realmId:G,state:j}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,q=P?.connectionName,M=P?.connectionId??"",K=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),k(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(b,G,j,M,K)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:A??"accounting",connection_name:q??"quickbooks_online",authorization_code:b,realm_id:G,connection_id:M,user_id:K},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,M),u(d.pathname))},[b,G,j,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(T)?.companyId,Q=ge(c?.userRole??[]),l=D(y=>he(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!$.isQBOPopupOpen||F!=="qbo_connection"||r(J({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(J({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Z=Ie(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Z==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const H=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(f,c),Re=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,Se=y=>y.trackPageLoaded(Y.Event.onboardingPage),be=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Ge?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Re?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(W,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:Q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&x?.loggedInUserRoleMap!=null)return H===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(W,{analytics:N,onLoad:y=>Se(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:Q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function De(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=fe.div`
19
+ `,Ae=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),S=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:S??""},n=ee(t),i=fe(t,s),f=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",k=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:k.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:Xe.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:f,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:S}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(xt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Tt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(J({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:f,userId:m,name:k,email:T,ssn:x,nationalityCountryCode:I,dob:h,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,isPhoneVerified:O}=i;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:f,userId:m,firstName:k.firstName,lastName:k.lastName,email:T,ssn:x,nationalityCountryCode:I?.selectedOption!=null?Ee(I.selectedOption):void 0,phone:U,birthday:h!=null?Te(h?.toString()):h,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(xe({officers:n}))},onGetOtp:(e,n)=>{t(It(e,"CustomerOnboarding")),n!=null&&t(kt({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(bt(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(St({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ht(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:f,companyLegalName:m,companyTaxId:k,companyWebsite:T,companyPhone:x,primaryContactEmail:I,primaryContactName:h,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:w,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:G,purposeOfAccount:j,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:q,transactionVolume:M,transactionVolumeDescription:K,usNexus:v,usNexusTypes:Q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:f?.selectedOption??"",companyLegalName:m,taxIdOrEIN:k,website:T!=""&&T!=null?ft(T):void 0,phone:x,syncToken:F,fileIds:$,incDate:w!=null?Te(w?.toString()):w,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(H=>H.length===2?H:Ee(H))??[],purposeOfAccount:j?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:q,transactionVolume:M?.selectedOption??"",transactionVolumeDescription:K,usNexus:v,usNexusTypes:Q?.selectedOptions??[]},Z={userId:U,firstName:h.firstName,lastName:h.lastName,email:I,syncToken:C};t(xe({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onRegisteredAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(J({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(He),X=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Ze(),S=de(),[e,n]=g.useState(!1),[i,f]=g.useState(!1),[m,k]=g.useState(!1),{tenantEmailDomain:T}=re(),x=le(),{useFeatureGate:I}=ue(),{isFeatureEnabled:h}=I(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),$=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),w=D(y=>y.cardPaymentViewState),R=Ie(w.addCardPaymentSourceStatus.fetchState),O=w.addCardPaymentSourceStatus.fetchState,{code:b,realmId:G,state:j}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,q=P?.connectionName,M=P?.connectionId??"",K=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(f(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),k(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(b,G,j,M,K)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:A??"accounting",connection_name:q??"quickbooks_online",authorization_code:b,realm_id:G,connection_id:M,user_id:K},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,M),u(d.pathname))},[b,G,j,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(T)?.companyId,Q=ge(c?.userRole??[]),l=D(y=>fe(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!$.isQBOPopupOpen||F!=="qbo_connection"||r(J({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(J({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Z=Ie(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Z==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const H=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(h,c),Re=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,Se=y=>y.trackPageLoaded(Y.Event.onboardingPage),be=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Ge?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Re?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(W,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:Q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&x?.loggedInUserRoleMap!=null)return H===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(W,{analytics:N,onLoad:y=>Se(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:Q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function De(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=he.div`
20
20
  display: flex;
21
21
  height: 100vh;
22
22
  background-color: ${t=>t.theme.colors.grey4};
23
- `,we=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(Ye),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),S=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const k=pe(r,i),T=me(i),x=D(f=>f.onboardingCustomerViewState.updateStatus.fetchState),I=i.company?.companyOnboardingInfo.isOnboardingCompleted;return I!==!0||h?x==="Completed"&&I===!0&&h&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(W,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingLandingPage,"Onboarding",At(i.productSettings))}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):x==="Completed"&&I===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(W,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingInterimPage)}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(je,{fetchState:x}):k?a.jsx(E,{to:"../../checking"}):T?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function oa(){return a.jsxs(Ke,{children:[a.jsx(z,{path:"/",element:a.jsx(X,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(X,{taxCFOCustomer:!0})}),a.jsx(z,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(jt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(X,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(X,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx(Me,{})})]})}export{oa as default};
23
+ `,we=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=fe(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(Ye),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),S=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(h=>ee(h)),f=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!f))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const k=pe(r,i),T=me(i),x=D(h=>h.onboardingCustomerViewState.updateStatus.fetchState),I=i.company?.companyOnboardingInfo.isOnboardingCompleted;return I!==!0||f?x==="Completed"&&I===!0&&f&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(W,{analytics:N,onLoad:h=>{h.trackPageLoaded(Y.Event.onboardingLandingPage,"Onboarding",At(i.productSettings))}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):x==="Completed"&&I===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(W,{analytics:N,onLoad:h=>{h.trackPageLoaded(Y.Event.onboardingInterimPage)}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(je,{fetchState:x}):k?a.jsx(E,{to:"../../checking"}):T?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function oa(){return a.jsxs(Ke,{children:[a.jsx(z,{path:"/",element:a.jsx(X,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(X,{taxCFOCustomer:!0})}),a.jsx(z,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(jt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(X,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(X,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx(Me,{})})]})}export{oa as default};
@@ -1,4 +1,4 @@
1
- import{j as i}from"./liveblocks-jLbycGCP.js";import{l as N,g as k,u as $,h as V,j as Z,k as q,n as Je,o as D}from"./core-C7cnuUop.js";import{eM as j,Jf as Fe,bB as Ut,bp as de,Ks as Va,hA as Ga,Kt as Et,Ku as Na,hD as Qe,Kv as Te,Kw as za,hI as $a,Kx as Tt,Ky as Za,hM as et,Kz as xe,KA as qa,cN as at,KB as Ha,KC as Xa,Jz as Wa,iG as Ja,KD as Qa,bm as _e,KE as Kt,J3 as Q,bc as Yt,iU as Vt,mb as Gt,iD as Nt,J5 as ee,J4 as z,KF as en,KG as tn,KH as zt,KI as pe,tj as ke,tk as ye,tH as ue,tB as te,to as Se,KJ as an,KK as nn,KL as on,KM as $t,KN as he,KO as sn,dF as Oe,pX as Zt,KP as rn,KQ as cn,KR as ln,KS as nt,Iq as ot,j8 as st,tP as rt,q3 as dn,KT as un,tl as xt,p_ as ie,pW as qt,KU as oe,KV as mn,KW as ct,Ip as it,rX as Ht,KX as pn,KY as hn,KZ as fn,K_ as lt,s8 as gn,K$ as bn,tn as Dt,rW as Xt,L0 as se,L1 as Cn,bu as Wt,tT as Jt,L2 as _n,L3 as kn,L4 as yn,L5 as dt,tO as Sn,L6 as vn,tm as Ft,tS as Qt,L7 as re,L8 as In,L9 as An,La as ea,iZ as ta,m8 as aa,j2 as na,m6 as oa,m5 as sa,m4 as ra,rj as wn,fb as En,cK as Tn,cL as xn,m1 as Dn,f7 as Fn,mh as On,Lb as Pn,CX as Bn,Lc as Rn,Ld as jn,Le as Mn,b5 as ut,eZ as Ln,gw as Un,fC as Kn,mc as Yn,iw as Vn,m9 as Gn,m7 as Nn,eT as zn,eR as $n}from"./zeni-epic-state-DPGmsT0c.js";import{z as B,Q as H,w as F,d as S,D as G,aP as Zn,K as Pe,R as ve,aQ as ca,g as K,aR as qn,j as Ie,aS as ia,a as mt,r as M,m as Hn,aT as Xn,aU as Wn,aV as Ae,aW as Jn,c as Qn,al as eo,aI as to,s as ao,M as no,aX as oo,aY as ge}from"./index-B2lD3Jim.js";import{n as pt}from"./mui-BkznVaFh.js";import{a as _}from"./sentry-CflaePyQ.js";import{w as la}from"./withTransactionSidePanel-m0PuYIs6.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-DBCGZwBw.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-BopsQ8w-.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-4mjujgB-.js";import Ce from"./NotFoundScreen-CPtlb4xk.js";import{t as ua}from"./analyticsHelper-Dp05MDBJ.js";import{C as ro}from"./CompanyPassportScreen-BsQAk6DO.js";import{F as co}from"./FeaturePreviewScreen-CEV6r8QS.js";import{R as io}from"./ReferralListScreen-t3nG_-Jq.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";import"./TransactionDetailScreen-RnHkkAvY.js";import"./decodeURIComponentSafe-rDkCEJpn.js";import"./MobileAppDrawer-YMrlHv7B.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="dd47a95b-9f0f-4161-80cf-26ca188d77fa",e._sentryDebugIdIdentifier="sentry-dbid-dd47a95b-9f0f-4161-80cf-26ca188d77fa")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(E=>E.tenantState.currentTenantId),u=k(E=>j(E)),{tenantEmailDomain:m}=N(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=V(),g=Z(),f=k(E=>Va(E,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Ga(o,d))},[d]),w=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((E,X)=>{p(Et({sortKey:E,sortOrder:X}))},[]),A=_.useCallback(E=>{p(Et({downloadState:E}))},[]),I=_.useCallback(E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const X=da({id:E.transactionId,type:E.transactionType},m);g(X);const Me=F(C.state?.pathnameStackToGoBack,C.pathname);g(X,{state:{pathnameStackToGoBack:Me}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(Zn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:w,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=Z(),o=k(I=>Na(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(Te({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(Te({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),w=_.useCallback(I=>{t(Te({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(Te({selectedDate:I,agingDateSelectionType:x})),t(Qe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(K.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:w,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=N(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=V(),p=Z(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),w=_.useCallback((x,E)=>{d(Tt({sortKey:x,sortOrder:E}))},[]),R=_.useCallback(x=>{d(Tt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const E=da({id:x.transactionId,type:x.transactionType},u);p(E);const X=F(m.state?.pathnameStackToGoBack,m.pathname);p(E,{state:{pathnameStackToGoBack:X}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(qn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:w,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=Z(),o=k(A=>Za(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),w=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(qa({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(K.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:w,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Wa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Ja(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=q(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Xa(e);return{sectionTitle:G.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=q(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:G.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=Z(),a=$(),{tenantEmailDomain:t}=N(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=Z(),a=$(),{tenantEmailDomain:t}=N(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
1
+ import{j as i}from"./liveblocks-dlvb-ucF.js";import{l as N,g as k,u as $,h as V,j as Z,k as q,n as Je,o as D}from"./core-D85lL_9t.js";import{eM as j,Jf as Fe,bB as Ut,bp as de,Ks as Va,hA as Ga,Kt as Et,Ku as Na,hD as Qe,Kv as Te,Kw as za,hI as $a,Kx as Tt,Ky as Za,hM as et,Kz as xe,KA as qa,cN as at,KB as Ha,KC as Xa,Jz as Wa,iG as Ja,KD as Qa,bm as _e,KE as Kt,J3 as Q,bc as Yt,iU as Vt,mb as Gt,iD as Nt,J5 as ee,J4 as z,KF as en,KG as tn,KH as zt,KI as pe,tj as ke,tk as ye,tH as ue,tB as te,to as Se,KJ as an,KK as nn,KL as on,KM as $t,KN as he,KO as sn,dF as Oe,pX as Zt,KP as rn,KQ as cn,KR as ln,KS as nt,Iq as ot,j8 as st,tP as rt,q3 as dn,KT as un,tl as xt,p_ as ie,pW as qt,KU as oe,KV as mn,KW as ct,Ip as it,rX as Ht,KX as pn,KY as hn,KZ as fn,K_ as lt,s8 as gn,K$ as bn,tn as Dt,rW as Xt,L0 as se,L1 as Cn,bu as Wt,tT as Jt,L2 as _n,L3 as kn,L4 as yn,L5 as dt,tO as Sn,L6 as vn,tm as Ft,tS as Qt,L7 as re,L8 as In,L9 as An,La as ea,iZ as ta,m8 as aa,j2 as na,m6 as oa,m5 as sa,m4 as ra,rj as wn,fb as En,cK as Tn,cL as xn,m1 as Dn,f7 as Fn,mh as On,Lb as Pn,CX as Bn,Lc as Rn,Ld as jn,Le as Mn,b5 as ut,eZ as Ln,gw as Un,fC as Kn,mc as Yn,iw as Vn,m9 as Gn,m7 as Nn,eT as zn,eR as $n}from"./zeni-epic-state-De57_V18.js";import{z as B,Q as H,r as F,d as S,D as G,aP as Zn,F as Pe,w as ve,aQ as ca,f as K,aR as qn,j as Ie,aS as ia,a as mt,i as M,m as Hn,aT as Xn,aU as Wn,aV as Ae,aW as Jn,c as Qn,al as eo,aI as to,p as ao,H as no,aX as oo,aY as ge}from"./index-DzzIwd_P.js";import{n as pt}from"./mui-C9WBrZQt.js";import{a as _}from"./sentry-DGJ961LO.js";import{w as la}from"./withTransactionSidePanel-dV1DlPXH.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-CfgcdnOO.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-CO9-0Ull.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-Yook-sE0.js";import Ce from"./NotFoundScreen-CnfhDP4M.js";import{t as ua}from"./analyticsHelper-CjA_jHsA.js";import{C as ro}from"./CompanyPassportScreen-DJKhJL7t.js";import{F as co}from"./FeaturePreviewScreen-BsHiFyOu.js";import{R as io}from"./ReferralListScreen-hfIN-UkI.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./TransactionDetailScreen-AiCOKNuK.js";import"./decodeURIComponentSafe-ByB9WhLS.js";import"./MobileAppDrawer-BFl1Y_qR.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="578d36b0-d557-4a10-93b6-ad7bdde7d8e7",e._sentryDebugIdIdentifier="sentry-dbid-578d36b0-d557-4a10-93b6-ad7bdde7d8e7")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(E=>E.tenantState.currentTenantId),u=k(E=>j(E)),{tenantEmailDomain:m}=N(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=V(),g=Z(),f=k(E=>Va(E,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Ga(o,d))},[d]),w=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((E,X)=>{p(Et({sortKey:E,sortOrder:X}))},[]),A=_.useCallback(E=>{p(Et({downloadState:E}))},[]),I=_.useCallback(E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const X=da({id:E.transactionId,type:E.transactionType},m);g(X);const Me=F(C.state?.pathnameStackToGoBack,C.pathname);g(X,{state:{pathnameStackToGoBack:Me}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(Zn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:w,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=Z(),o=k(I=>Na(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(Te({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(Te({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),w=_.useCallback(I=>{t(Te({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(Te({selectedDate:I,agingDateSelectionType:x})),t(Qe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(K.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:w,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=N(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=V(),p=Z(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),w=_.useCallback((x,E)=>{d(Tt({sortKey:x,sortOrder:E}))},[]),R=_.useCallback(x=>{d(Tt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const E=da({id:x.transactionId,type:x.transactionType},u);p(E);const X=F(m.state?.pathnameStackToGoBack,m.pathname);p(E,{state:{pathnameStackToGoBack:X}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(qn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:w,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=Z(),o=k(A=>Za(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),w=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(qa({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(K.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:w,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Wa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Ja(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=q(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Xa(e);return{sectionTitle:G.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=q(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:G.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=Z(),a=$(),{tenantEmailDomain:t}=N(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=Z(),a=$(),{tenantEmailDomain:t}=N(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-jLbycGCP.js";import{a as u}from"./sentry-CflaePyQ.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-C7cnuUop.js";import{H_ as N,eM as _,fj as U,H$ as L,m3 as R,I0 as z}from"./zeni-epic-state-DPGmsT0c.js";import{u as $,z as f,L as T,t as I,D as j,b as O}from"./index-B2lD3Jim.js";import"./mui-BkznVaFh.js";import{t as H}from"./getLocaleForTenant-DHk9xDoK.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="1e44250a-223f-4355-961d-2d4b3bbff7b1",t._sentryDebugIdIdentifier="sentry-dbid-1e44250a-223f-4355-961d-2d4b3bbff7b1")}catch{}})();const P=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=O(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=$(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(H(c)),o())},[n,a,c]),v.jsx(P,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-dlvb-ucF.js";import{a as u}from"./sentry-DGJ961LO.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-D85lL_9t.js";import{H_ as N,eM as _,fj as U,H$ as L,m3 as R,I0 as z}from"./zeni-epic-state-De57_V18.js";import{u as $,z as f,L as T,t as I,D as j,b as O}from"./index-DzzIwd_P.js";import"./mui-C9WBrZQt.js";import{t as H}from"./getLocaleForTenant-i0RHCLcV.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="1e44250a-223f-4355-961d-2d4b3bbff7b1",t._sentryDebugIdIdentifier="sentry-dbid-1e44250a-223f-4355-961d-2d4b3bbff7b1")}catch{}})();const P=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=O(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=$(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(H(c)),o())},[n,a,c]),v.jsx(P,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};