@zeniai/web-app-ui 5.0.48-qa → 5.0.49-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 (111) hide show
  1. package/dist/assets/AddressRoutes-DVn12XDr.js +1 -0
  2. package/dist/assets/{AddressScreen-Cyw6I8Nr.js → AddressScreen-CR6VYfc-.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-5-x3Mhix.js → AiCfoScreen-D0PxyTAw.js} +2 -2
  4. package/dist/assets/{BillPayApprovalRoutes--Y5us0IE.js → BillPayApprovalRoutes-knuXJOtT.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-B-Wm0NYC.js → BillPayRoutes-B2cUMyrS.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DN6Q07Oe.js → BusinessVerificationPageScreen-iv0LsvpT.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-CFgj4t6I.js → ChargeCardRoutes-C9EHLqno.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-uOWxHPw3.js → CompanyPassportScreen-BohXKD8w.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-C9cw2P3k.js → ConnectionAuthScreen-CAfemlav.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-C9M6ZBKD.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-DGABONfq.js → CustomerOnboardingRoutes-CiBeuzZL.js} +6 -6
  12. package/dist/assets/{DashboardRoutes--NW4yM3f.js → DashboardRoutes-DpEKOOgI.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-CB__zkd_.js → DefaultTenantHome-crksvZew.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BkY9tugE.js → DomesticWireDetailScreen-Ck-VEef3.js} +1 -1
  15. package/dist/assets/{DrawerScreen-DArImdlf.js → DrawerScreen-DW4fqUQY.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-D8_FQssM.js → EntityDetailRoutes-MKrp9qEm.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-D0WUT74c.js → ExpenseAutomationRoutes-CCfRZRpP.js} +1 -1
  18. package/dist/assets/FeaturePreviewScreen-CyYFlgNr.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-D4Leoe-h.js → MagicLinkRoutes-Cwp-7eJL.js} +21 -21
  20. package/dist/assets/MagicLinkSignInScreen-BfnJfGbQ.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-_jQrJKA4.js → MobileAppDrawer-CrCMrvam.js} +1 -1
  22. package/dist/assets/NotFoundScreen-DyE8IG1F.js +1 -0
  23. package/dist/assets/{NotificationRoutes-CokYcFPF.js → NotificationRoutes-BsSd7oB1.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-kXVp7zaA.js +1 -0
  25. package/dist/assets/{PeopleRoutes-Cgbrc5Bd.js → PeopleRoutes-DXy4Bpl-.js} +3 -3
  26. package/dist/assets/PerformanceRoutes-CvZ9ftVq.js +1 -0
  27. package/dist/assets/{Preview-D8VIafBI.js → Preview-DgE5RaQx.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-BGFG3hnm.js → QBOConnectionScreen-dFyaTh--.js} +1 -1
  29. package/dist/assets/ReferralListScreen-DZOFg47R.js +5 -0
  30. package/dist/assets/{ReimbursementApprovalRoutes-D2s2q6Pv.js → ReimbursementApprovalRoutes-wxMyQf-w.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CT7T39Bg.js → ReimbursementApprovalRuleDetailScreen-BQ59o3Dv.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-ClmT4xbF.js → ReimbursementRoutes-52pvbCgq.js} +1 -1
  33. package/dist/assets/{ReportsRoutes-BD7q5ace.js → ReportsRoutes-Bwa2BN-2.js} +1 -1
  34. package/dist/assets/{RewardsRoutes-Cw377Hvt.js → RewardsRoutes-BsFw6qcQ.js} +1 -1
  35. package/dist/assets/{ScreenRoutes-C_TacpXf.js → ScreenRoutes-BChBi1xI.js} +2 -2
  36. package/dist/assets/{SettingsRoutes-DBt3q5Qe.js → SettingsRoutes-BUkjKcJM.js} +7 -7
  37. package/dist/assets/{SetupPagesScreen-BZI5O61v.js → SetupPagesScreen-BcVPObGq.js} +1 -1
  38. package/dist/assets/SignInScreen-cLG6QYjE.js +1 -0
  39. package/dist/assets/{SignOutScreen-CSrGovIN.js → SignOutScreen-BEqpDD8b.js} +1 -1
  40. package/dist/assets/{TaskListScreen-Dhs2rr4P.js → TaskListScreen-ziEibE6n.js} +2 -2
  41. package/dist/assets/TaskRoutes-5ipLHZCr.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-Btw0hex1.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-ConnzJQc.js → TransactionDetailScreen-DnhiztFg.js} +1 -1
  44. package/dist/assets/{TransactionListRoutes-Cb-Yce4o.js → TransactionListRoutes-DKFuTijV.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-D6BpLAWI.js → TreasuryRoutes-C6U2LpC5.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-DB59_Rjd.js → VendorsRoutes-DmmYfhxj.js} +1 -1
  47. package/dist/assets/WiseConfirmationScreen-CMuzvJwW.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-CuJ10Vzu.js → ZeniAccountRoutes-XC1IRSdd.js} +10 -10
  49. package/dist/assets/{ZeniAccountStatementScreen-CHwVtlaO.js → ZeniAccountStatementScreen-Ctw-IM53.js} +1 -1
  50. package/dist/assets/{accountMappingHelper-IRENDD-V.js → accountMappingHelper-d9bI5aJe.js} +1 -1
  51. package/dist/assets/{analytics-qxJxpRMv.js → analytics-DlMpWLtY.js} +1 -1
  52. package/dist/assets/{analyticsHelper-v98PhG00.js → analyticsHelper-CUi1_ubR.js} +1 -1
  53. package/dist/assets/{core-m4XGmWiT.js → core-DK_vDmT8.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-C8T3gy_G.js → decodeURIComponentSafe-D_yxDRpD.js} +1 -1
  55. package/dist/assets/{dnd-Cti5FOfO.js → dnd-CI1Bz-yv.js} +1 -1
  56. package/dist/assets/{empty-mCxx6jzQ.js → empty-Cq9cCg0f.js} +1 -1
  57. package/dist/assets/{empty-yK5JPtMo.js → empty-DSG43sav.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-Dmi49vy2.js → emptyVideoElement-CnwvQS3j.js} +1 -1
  59. package/dist/assets/{epic-BQ_hPw2P.js → epic-Culj-FsH.js} +1 -1
  60. package/dist/assets/getLocaleForTenant-B8la2oRW.js +1 -0
  61. package/dist/assets/{index-Dy5pScEc.js → index-BXVvK5HN.js} +1 -1
  62. package/dist/assets/{index-C6AQ1lse.js → index-C_rnV1Gn.js} +1 -1
  63. package/dist/assets/{index-BaK2kQ9F.js → index-CvaLt6TZ.js} +1 -1
  64. package/dist/assets/{index-BZdik4nv.js → index-DPdMJbdm.js} +13524 -13520
  65. package/dist/assets/{index-Cwpc2Z2d.js → index-DUVkAqoc.js} +1 -1
  66. package/dist/assets/{index-BB63eJGr.js → index-l9tW4qcS.js} +1 -1
  67. package/dist/assets/{index-vv_WZvDg.js → index-tcR_mP46.js} +2 -2
  68. package/dist/assets/{lexical-Th9XxYyj.js → lexical-2V5hcKhY.js} +1 -1
  69. package/dist/assets/{liveblocks-BKv5MOZO.js → liveblocks-CFneZw8x.js} +1 -1
  70. package/dist/assets/{lottie-D5SKDqvx.js → lottie-DTY7lPgA.js} +1 -1
  71. package/dist/assets/{mui-DAxzkQdy.js → mui-Cf9-_L5d.js} +1 -1
  72. package/dist/assets/{pathToGoBack-LnueLB7C.js → pathToGoBack-DiGM4suv.js} +1 -1
  73. package/dist/assets/{pdf-CO0-X1gn.js → pdf-DO37o4P_.js} +3 -3
  74. package/dist/assets/{pdf-lib-BjJKENqb.js → pdf-lib-CtLCB8Ws.js} +1 -1
  75. package/dist/assets/{plaid-C22HydUi.js → plaid-COLZDQ-K.js} +1 -1
  76. package/dist/assets/{pusher-DwmaZmhK.js → pusher-1IRbjHv-.js} +1 -1
  77. package/dist/assets/{react-6wee1iyR.js → react-056z8_dj.js} +1 -1
  78. package/dist/assets/{react-CvzGxomL.js → react-BP8YOYb-.js} +1 -1
  79. package/dist/assets/{react-EtXoU21h.js → react-CTinTxki.js} +1 -1
  80. package/dist/assets/{react-Do6_TXf6.js → react-DNcD4xIo.js} +1 -1
  81. package/dist/assets/{react-Cpa0ki7D.js → react-Dl0848Wb.js} +1 -1
  82. package/dist/assets/{react-B3PUq9Jv.js → react-DzYgOa8M.js} +1 -1
  83. package/dist/assets/{recharts-PrS_AG6G.js → recharts-DGCFoGqb.js} +1 -1
  84. package/dist/assets/{routePaths-BFjkYUJ-.js → routePaths-C9gqQCUu.js} +1 -1
  85. package/dist/assets/{sentry-CFyyxsOr.js → sentry-Dhi05Xar.js} +1 -1
  86. package/dist/assets/{url-C9oWR66D.js → url-A8mMNIgc.js} +1 -1
  87. package/dist/assets/{url-BTz2cCHO.js → url-Cvest_if.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-Z_9iU3fL.js +1 -0
  89. package/dist/assets/{useDeviceId-Bp_S2z9u.js → useDeviceId-BMcpyfup.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-ChiWRlVf.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-CcW8cq0g.js → useInitialThreadRequest-R2S3HO_0.js} +1 -1
  92. package/dist/assets/{utils-C0kl6VPG.js → utils-DkqKuJOX.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-Dbm2AKy2.js → withTransactionSidePanel-CUobUupW.js} +2 -2
  94. package/dist/assets/{zeni-epic-state-BuHrGGbR.js → zeni-epic-state-BL_LeZIj.js} +6 -6
  95. package/dist/index.html +1 -1
  96. package/package.json +4 -4
  97. package/dist/assets/AddressRoutes-BR4EscE3.js +0 -1
  98. package/dist/assets/CustomerOnboardingAuthScreen-DC28tptW.js +0 -1
  99. package/dist/assets/FeaturePreviewScreen-hLhLof6O.js +0 -1
  100. package/dist/assets/MagicLinkSignInScreen-DZwNjC7q.js +0 -12
  101. package/dist/assets/NotFoundScreen-CVsKzFAu.js +0 -1
  102. package/dist/assets/PandLWithForecastRoutes-CDEhB0UN.js +0 -1
  103. package/dist/assets/PerformanceRoutes--QqGOZk4.js +0 -1
  104. package/dist/assets/ReferralListScreen-ByOFKYMD.js +0 -5
  105. package/dist/assets/SignInScreen-D1-cuN9g.js +0 -1
  106. package/dist/assets/TaskRoutes-BgE_7y-D.js +0 -9
  107. package/dist/assets/TransactionDetailRoutes-BJWP_ZZy.js +0 -1
  108. package/dist/assets/WiseConfirmationScreen-uYgIPd9U.js +0 -12
  109. package/dist/assets/getLocaleForTenant-DmculB1-.js +0 -1
  110. package/dist/assets/useAskAiCfoHostNavButtonProps-ZY9x_rC7.js +0 -1
  111. package/dist/assets/useFetchSuggestedQuestionsWhenReady-B6JWGD0I.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-CFneZw8x.js";import{A as d}from"./AddressScreen-CR6VYfc-.js";import i from"./NotFoundScreen-DyE8IG1F.js";import"./sentry-Dhi05Xar.js";import{n as s,o as r}from"./core-DK_vDmT8.js";import"./zeni-epic-state-BL_LeZIj.js";import"./recharts-DGCFoGqb.js";import"./index-DPdMJbdm.js";import"./mui-Cf9-_L5d.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./utils-DkqKuJOX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-BKv5MOZO.js";import{a as h}from"./sentry-CFyyxsOr.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-m4XGmWiT.js";import{q as $,h as D,z as L,A as K,B as N,x as J,e as C,g as m,n as z,k as b,p as F}from"./index-BZdik4nv.js";import{J0 as k,gN as R,eN as U,J1 as q,c0 as G,J2 as O,k7 as V}from"./zeni-epic-state-BuHrGGbR.js";import{n as H}from"./mui-DAxzkQdy.js";import Q from"./NotFoundScreen-CVsKzFAu.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]="c1fa4f97-aa98-4831-929c-ac2927df04fb",e._sentryDebugIdIdentifier="sentry-dbid-c1fa4f97-aa98-4831-929c-ac2927df04fb")}catch{}})();const W=H.div`
1
+ import{j as d}from"./liveblocks-CFneZw8x.js";import{a as h}from"./sentry-Dhi05Xar.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-DK_vDmT8.js";import{q as $,h as D,z as L,A as K,B as N,x as J,e as C,g as m,n as z,j as b,p as F}from"./index-DPdMJbdm.js";import{J0 as k,gN as R,eN as U,J1 as q,c0 as G,J2 as O,k7 as V}from"./zeni-epic-state-BL_LeZIj.js";import{n as H}from"./mui-Cf9-_L5d.js";import Q from"./NotFoundScreen-DyE8IG1F.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]="f1a224be-f659-4cc3-8b4d-f6bcc704c692",e._sentryDebugIdIdentifier="sentry-dbid-f1a224be-f659-4cc3-8b4d-f6bcc704c692")}catch{}})();const W=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as d}from"./liveblocks-BKv5MOZO.js";import{a as h}from"./sentry-CFyyxsO
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,X=M(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=U(e),a=t.roleMap!=null&&q(t.roleMap),r=i||c==="user_address"||G(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=O(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,n=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=Y(a);e(V({addressType:c,addressToCreate:r})),C?.trackSaveAddressClicked(m.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(z);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),r=_(),n=j(),{addressId:s,addressType:u}=E(),f=$(),x=D(),I=L.getSignedInUser(),[g,v]=h.useState(s==null),p=B(S=>s!=null?k(S,s).fetchState:"Not-Started"),A=K();if(I==null)throw Error("Can't access address page without signing in...");const P=S=>S.trackPageLoaded(s!=null?m.Event.editAddress:m.Event.addAddress),y=l??u;return h.useEffect(()=>{g||s==null||(v(!0),r(R(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:x.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(J,{analytics:C,onLoad:P}),d.jsx(W,{windowSize:f,children:d.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):d.jsx(Q,{})}const w=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Y=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{de as A,Y as t};
9
+ `,X=M(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=U(e),a=t.roleMap!=null&&q(t.roleMap),r=i||c==="user_address"||G(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=O(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,n=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=Y(a);e(V({addressType:c,addressToCreate:r})),C?.trackSaveAddressClicked(m.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(z);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),r=_(),n=j(),{addressId:s,addressType:u}=E(),f=$(),x=D(),A=L.getSignedInUser(),[g,I]=h.useState(s==null),p=B(S=>s!=null?k(S,s).fetchState:"Not-Started"),v=K();if(A==null)throw Error("Can't access address page without signing in...");const P=S=>S.trackPageLoaded(s!=null?m.Event.editAddress:m.Event.addAddress),y=l??u;return h.useEffect(()=>{g||s==null||(I(!0),r(R(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:x.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(J,{analytics:C,onLoad:P}),d.jsx(W,{windowSize:f,children:d.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:v?.loggedInUserRoleMap})})]}):d.jsx(Q,{})}const w=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Y=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{de as A,Y as t};
@@ -1,11 +1,11 @@
1
- import{j as h}from"./liveblocks-BKv5MOZO.js";import{a as r}from"./sentry-CFyyxsOr.js";import{h as oe,j as ne,u as ie,g as j,l as re,k as le}from"./core-m4XGmWiT.js";import{I as ce,cF as ue,z as de,q as me,cG as pe,cH as fe,cI as he,cJ as q,x as Se,e as v,M as G,cK as ge,cL as Ce,g as be,a1 as ke,cM as we,N as Ie,s as Ee,p as V,aX as Pe,cN as Te}from"./index-BZdik4nv.js";import{fE as ye,f3 as H,eN as _e,hr as xe,Py as ve,eM as Ue,hB as Ae,hx as Qe,fu as Oe,fo as Fe,fh as De,fl as $,fp as Le,fq as Me,fr as Be,fs as Ne,ft as Re}from"./zeni-epic-state-BuHrGGbR.js";import{D as je,n as U,P as Ge,S as Ve}from"./mui-DAxzkQdy.js";import{p as $e}from"./pathToGoBack-LnueLB7C.js";import"./recharts-PrS_AG6G.js";import"./analytics-qxJxpRMv.js";import"./plaid-C22HydUi.js";import"./dnd-Cti5FOfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-D5SKDqvx.js";import"./lexical-Th9XxYyj.js";import"./pdf-CO0-X1gn.js";import"./utils-C0kl6VPG.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="e74f6a35-5dce-48a0-b6b6-24ba6eb877ea",s._sentryDebugIdIdentifier="sentry-dbid-e74f6a35-5dce-48a0-b6b6-24ba6eb877ea")}catch{}})();const W="chat-response-generated",qe=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Me(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:E}=q(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(E,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Ne({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Re({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Pe(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s($(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Le(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??$e(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s($(""))},togglePageView:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(De());const e=Ee(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Fe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=j(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=j(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,Q=!!C?.aiCfoShouldSubmit,[z,P]=r.useState(null),[J,T]=r.useState(!1),O=r.useRef(!1);r.useEffect(()=>{O.current||b==null||b===""||(P(b),T(Q),O.current=!0)},[b,Q]);const K=r.useCallback(()=>{P(null),T(!1)},[]),F=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),D=F.get("ref")??C?.aiCfoRef,y=F.get("emailRefId")??C?.aiCfoEmailRefId,L=r.useRef(!1);r.useEffect(()=>{L.current||D!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),L.current=!0)},[D,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(P(k),T(!0),a(ve()))},[k,t,a]);const X=c.masterTOSInfo,w=X?.isMasterTOSAccepted??!1,{visitedSessions:M}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",N=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),R=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Y}=q(R,t),Z=Y.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:M.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[M]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&N&&e!=null&&_==="Completed"&&!x&&a(Qe(t,e.userId))},[B,N,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),G(n)&&A.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:R,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:Z,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:J,onEmailLinkQuestionProcessed:K,onMenuClick:G(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,onUploadPromoClose:g}),h.jsx(je,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Oe(c.userRoleId)),f(!1)}})})})]})},He=U(Ve)`
1
+ import{j as h}from"./liveblocks-CFneZw8x.js";import{a as r}from"./sentry-Dhi05Xar.js";import{h as oe,j as ne,u as ie,g as G,l as re,k as le}from"./core-DK_vDmT8.js";import{G as ce,cF as ue,z as de,q as me,cG as pe,cH as fe,cI as he,cJ as q,x as Se,e as v,J as j,cK as ge,cL as Ce,g as be,a1 as ke,cM as we,N as Ie,s as Ee,p as V,aX as Pe,cN as Te}from"./index-DPdMJbdm.js";import{fE as ye,f3 as H,eN as _e,hr as xe,Py as ve,eM as Ue,hB as Ae,hx as Qe,fu as Oe,fo as Fe,fh as De,fl as $,fp as Me,fq as Be,fr as Le,fs as Ne,ft as Re}from"./zeni-epic-state-BL_LeZIj.js";import{D as Ge,n as U,P as je,S as Ve}from"./mui-Cf9-_L5d.js";import{p as $e}from"./pathToGoBack-DiGM4suv.js";import"./recharts-DGCFoGqb.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./utils-DkqKuJOX.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="f3f4b260-693e-470f-b062-0a677cf21e0d",s._sentryDebugIdIdentifier="sentry-dbid-f3f4b260-693e-470f-b062-0a677cf21e0d")}catch{}})();const W="chat-response-generated",qe=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Be(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:E}=q(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(E,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Le(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Ne({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Re({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Pe(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s($(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Me(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??$e(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s($(""))},togglePageView:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(De());const e=Ee(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Fe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=G(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=G(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,Q=!!C?.aiCfoShouldSubmit,[z,P]=r.useState(null),[J,T]=r.useState(!1),O=r.useRef(!1);r.useEffect(()=>{O.current||b==null||b===""||(P(b),T(Q),O.current=!0)},[b,Q]);const K=r.useCallback(()=>{P(null),T(!1)},[]),F=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),D=F.get("ref")??C?.aiCfoRef,y=F.get("emailRefId")??C?.aiCfoEmailRefId,M=r.useRef(!1);r.useEffect(()=>{M.current||D!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),M.current=!0)},[D,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(P(k),T(!0),a(ve()))},[k,t,a]);const X=c.masterTOSInfo,w=X?.isMasterTOSAccepted??!1,{visitedSessions:B}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,L=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",N=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),R=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Y}=q(R,t),Z=Y.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:B.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[B]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&L!=="In-Progress"&&N&&e!=null&&_==="Completed"&&!x&&a(Qe(t,e.userId))},[L,N,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),j(n)&&A.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:R,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:Z,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:J,onEmailLinkQuestionProcessed:K,onMenuClick:j(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,onUploadPromoClose:g}),h.jsx(Ge,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Oe(c.userRoleId)),f(!1)}})})})]})},He=U(Ve)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
5
  `,We=U.div`
6
6
  height: 100vh;
7
7
  width: 100%;
8
- `,ze=U(Ge)`
8
+ `,ze=U(je)`
9
9
  box-shadow: ${({theme:s})=>s.colors.elevation2};
10
10
  color: ${({theme:s})=>s.colors.grey4};
11
11
  `;export{dt as default};
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-BKv5MOZO.js";import{a as y}from"./sentry-CFyyxsOr.js";import{j as B,u as U,h as j,g as v,N as $,k as T,l as N,n as O,o as h}from"./core-m4XGmWiT.js";import{eN as L,Mj as A,L$ as b,x9 as w,x3 as F,x7 as x,wY as M,M1 as W,w$ as q,xb as z,xa as C}from"./zeni-epic-state-BuHrGGbR.js";import{h as P,z as k,B as V,a1 as Y,bx as G,aa as _,by as H}from"./index-BZdik4nv.js";import"./mui-DAxzkQdy.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-CT7T39Bg.js";import K from"./NotFoundScreen-CVsKzFAu.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]="da225e2a-cb3c-4443-84b7-ce29c94436cf",e._sentryDebugIdIdentifier="sentry-dbid-da225e2a-cb3c-4443-84b7-ce29c94436cf")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(Y(G)),X=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.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...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-${c.companyId}.${I}`]:[],eventCallback:(i,R,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=f.actors.selectedNonUsers.map(S=>{const E=!!J(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(R);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?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("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=N(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(q(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(X,{})}),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(K,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-CFneZw8x.js";import{a as y}from"./sentry-Dhi05Xar.js";import{j as B,u as U,h as j,g as v,N as $,k as T,l as N,n as O,o as h}from"./core-DK_vDmT8.js";import{eN as L,Mj as A,L$ as b,x9 as w,x3 as F,x7 as x,wY as M,M1 as W,w$ as q,xb as z,xa as C}from"./zeni-epic-state-BL_LeZIj.js";import{h as P,z as k,B as V,a1 as Y,bx as G,aa as _,by as H}from"./index-DPdMJbdm.js";import"./mui-Cf9-_L5d.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-BQ59o3Dv.js";import K from"./NotFoundScreen-DyE8IG1F.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]="da225e2a-cb3c-4443-84b7-ce29c94436cf",e._sentryDebugIdIdentifier="sentry-dbid-da225e2a-cb3c-4443-84b7-ce29c94436cf")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(Y(G)),X=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.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...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-${c.companyId}.${I}`]:[],eventCallback:(i,R,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=f.actors.selectedNonUsers.map(S=>{const E=!!J(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(R);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?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("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=N(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(q(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(X,{})}),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(K,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BKv5MOZO.js";import{j as K,h as re,u as Q,l as te,g as k,N as ee,k as X,i as la,n as sa,o as y}from"./core-m4XGmWiT.js";import{eN as Z,LB as Ge,bv as At,GE as ra,bo as xt,bD as pe,LC as Bt,wt as Et,xD as Ue,x0 as ca,bn as je,LD as da,LE as ua,c0 as pa,LF as ma,jr as Dt,LG as jt,LH as Tt,yc as Oe,wI as Be,LI as ba,wh as it,LJ as ha,Bo as ga,wl as Sa,wr as Pt,LK as Ie,LL as Ne,xE as ze,LM as ya,LN as fa,xH as Ze,LO as Ia,xU as ka,LP as Ft,xo as ot,xt as va,LQ as wa,LR as ue,LS as Rt,LT as Lt,LU as Vt,fI as Ca,wN as Me,cv as $t,LV as Aa,gD as xa,LW as Ba,LX as Ea,eT as Ut,eR as Mt,LY as He,LZ as Da,L_ as ja,Jk as We,L$ as Ta,Jl as ie,Jm as qe,M0 as Pa,M1 as Fa,M2 as Ra,xv as lt,xs as La,M3 as Va,M4 as $a,M5 as Ua,xe as Ma,M6 as _a,M7 as Ga,M8 as Oa,cj as _t,cL as Gt,jC as Na,bJ as za,bq as Ot,bK as Nt,vz as Za,M9 as Ha,Bb as Wa,Bh as qa,s6 as Ja,xF as Ka,yj as Qa,jP as fe,Ma as Xa,Mb as zt,kh as Ya,jJ as Zt,k2 as Ht,k1 as st,bC as be,bI as en,Mc as tn,Md as ke,il as an,Me as rt,Mf as nn,iq as on,iL as ln,yx as sn,Mg as rn,ka as cn,yn as dn,Mh as ct,yr as un,yw as pn,yt as mn,yl as bn,Mi as Wt,wC as hn,Mj as gn,Mk as Sn,fA as yn,fz as fn,fy as In,jS as kn,k8 as dt,kj as vn,pF as wn,j$ as Cn,yp as An,iw as xn,ko as Bn,Ml as En,io as Dn,pw as jn,Mm as Tn,xk as Pn,bE as Fn,bs as Rn,Il as Ln,cN as Vn,cM as $n,cu as Un,cA as Mn}from"./zeni-epic-state-BuHrGGbR.js";import{h as me,z as L,A as ve,I as Je,a as oe,d as S,aI as Ee,B as ce,o as E,x as Te,e as j,b4 as _n,p as z,N as Ke,s as D,q as we,b5 as ut,b6 as pt,b7 as Gn,af as On,F as Nn,aC as zn,y as qt,D as Qe,G as Xe,b8 as Zn,ao as Jt,b9 as Hn,J as Wn,g as Kt,a1 as qn,ba as Jn,bb as Kn,bc as Qn,bd as Xn,be as Yn,bf as ei,bg as ti,bh as ai,bi as ni,w as ii,bj as oi,b0 as li,bk as si,bl as ri,a4 as ci}from"./index-BZdik4nv.js";import{n as V,S as di}from"./mui-DAxzkQdy.js";import{A as mt}from"./AddressScreen-Cyw6I8Nr.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-BkY9tugE.js";import{a as f}from"./sentry-CFyyxsOr.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-ZY9x_rC7.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-B6JWGD0I.js";import{u as Xt}from"./useInitialThreadRequest-CcW8cq0g.js";import De from"./NotFoundScreen-CVsKzFAu.js";import{D as bi}from"./DrawerScreen-DArImdlf.js";import{M as Yt}from"./MobileAppDrawer-_jQrJKA4.js";import{F as ea}from"./FeaturePreviewScreen-hLhLof6O.js";import{S as Re}from"./SetupPagesScreen-BZI5O61v.js";import{B as hi}from"./BillPayApprovalRoutes--Y5us0IE.js";import{FallBackRoute as gi}from"./ScreenRoutes-C_TacpXf.js";import"./recharts-PrS_AG6G.js";import"./analytics-qxJxpRMv.js";import"./plaid-C22HydUi.js";import"./dnd-Cti5FOfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-D5SKDqvx.js";import"./lexical-Th9XxYyj.js";import"./pdf-CO0-X1gn.js";import"./utils-C0kl6VPG.js";import"./analyticsHelper-v98PhG00.js";import"./routePaths-BFjkYUJ-.js";import"./BusinessVerificationPageScreen-DN6Q07Oe.js";import"./ReimbursementApprovalRuleDetailScreen-CT7T39Bg.js";import"./getLocaleForTenant-DmculB1-.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]="e3debf8b-fd46-4655-9ada-7f79b1e17f17",e._sentryDebugIdIdentifier="sentry-dbid-e3debf8b-fd46-4655-9ada-7f79b1e17f17")}catch{}})();const Si=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(Sa(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function yi(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(S.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(S.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(Si,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const Se=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&M?_(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),u&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(ya({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:Se.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${Se.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-CFneZw8x.js";import{j as K,h as re,u as Q,l as te,g as k,N as ee,k as X,i as la,n as sa,o as y}from"./core-DK_vDmT8.js";import{eN as Z,LB as Ge,bv as At,GE as ra,bo as xt,bD as pe,LC as Bt,wt as Et,xD as Ue,x0 as ca,bn as je,LD as da,LE as ua,c0 as pa,LF as ma,jr as Dt,LG as jt,LH as Tt,yc as Oe,wI as Be,LI as ba,wh as it,LJ as ha,Bo as ga,wl as Sa,wr as Pt,LK as Ie,LL as Ne,xE as ze,LM as ya,LN as fa,xH as Ze,LO as Ia,xU as ka,LP as Ft,xo as ot,xt as va,LQ as wa,LR as ue,LS as Rt,LT as Lt,LU as Vt,fI as Ca,wN as Me,cv as $t,LV as Aa,gD as xa,LW as Ba,LX as Ea,eT as Ut,eR as Mt,LY as He,LZ as Da,L_ as ja,Jk as We,L$ as Ta,Jl as ie,Jm as qe,M0 as Pa,M1 as Fa,M2 as Ra,xv as lt,xs as La,M3 as Va,M4 as $a,M5 as Ua,xe as Ma,M6 as _a,M7 as Ga,M8 as Oa,cj as _t,cL as Gt,jC as Na,bJ as za,bq as Ot,bK as Nt,vz as Za,M9 as Ha,Bb as Wa,Bh as qa,s6 as Ja,xF as Ka,yj as Qa,jP as fe,Ma as Xa,Mb as zt,kh as Ya,jJ as Zt,k2 as Ht,k1 as st,bC as be,bI as en,Mc as tn,Md as ke,il as an,Me as rt,Mf as nn,iq as on,iL as ln,yx as sn,Mg as rn,ka as cn,yn as dn,Mh as ct,yr as un,yw as pn,yt as mn,yl as bn,Mi as Wt,wC as hn,Mj as gn,Mk as Sn,fA as yn,fz as fn,fy as In,jS as kn,k8 as dt,kj as vn,pF as wn,j$ as Cn,yp as An,iw as xn,ko as Bn,Ml as En,io as Dn,pw as jn,Mm as Tn,xk as Pn,bE as Fn,bs as Rn,Il as Ln,cN as Vn,cM as $n,cu as Un,cA as Mn}from"./zeni-epic-state-BL_LeZIj.js";import{h as me,z as L,A as ve,G as Je,a as oe,d as S,aI as Ee,B as ce,o as E,x as Te,e as j,b4 as _n,p as z,N as Ke,s as D,q as we,b5 as ut,b6 as pt,b7 as Gn,af as On,E as Nn,aC as zn,y as qt,D as Qe,Z as Xe,b8 as Zn,ao as Jt,b9 as Hn,I as Wn,g as Kt,a1 as qn,ba as Jn,bb as Kn,bc as Qn,bd as Xn,be as Yn,bf as ei,bg as ti,bh as ai,bi as ni,w as ii,bj as oi,b0 as li,bk as si,bl as ri,a4 as ci}from"./index-DPdMJbdm.js";import{n as V,S as di}from"./mui-Cf9-_L5d.js";import{A as mt}from"./AddressScreen-CR6VYfc-.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-Ck-VEef3.js";import{a as f}from"./sentry-Dhi05Xar.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-Z_9iU3fL.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-ChiWRlVf.js";import{u as Xt}from"./useInitialThreadRequest-R2S3HO_0.js";import De from"./NotFoundScreen-DyE8IG1F.js";import{D as bi}from"./DrawerScreen-DW4fqUQY.js";import{M as Yt}from"./MobileAppDrawer-CrCMrvam.js";import{F as ea}from"./FeaturePreviewScreen-CyYFlgNr.js";import{S as Re}from"./SetupPagesScreen-BcVPObGq.js";import{B as hi}from"./BillPayApprovalRoutes-knuXJOtT.js";import{FallBackRoute as gi}from"./ScreenRoutes-BChBi1xI.js";import"./recharts-DGCFoGqb.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./utils-DkqKuJOX.js";import"./analyticsHelper-CUi1_ubR.js";import"./routePaths-C9gqQCUu.js";import"./BusinessVerificationPageScreen-iv0LsvpT.js";import"./ReimbursementApprovalRuleDetailScreen-BQ59o3Dv.js";import"./getLocaleForTenant-B8la2oRW.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]="35bd5a64-d402-43bf-902d-f39ae031941c",e._sentryDebugIdIdentifier="sentry-dbid-35bd5a64-d402-43bf-902d-f39ae031941c")}catch{}})();const Si=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(Sa(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function yi(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(S.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(S.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(Si,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const Se=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&M?_(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),u&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(ya({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:Se.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${Se.recurringBill.recurringCycle}
2
2
  ${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function vi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-BKv5MOZO.js";import{a as V}from"./sentry-CFyyxsOr.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-m4XGmWiT.js";import{A as ce,a as ue,aI as de,z as E,x as pe,e as M,aa as v,g as z,bt as le,ao as me,s as B,ap as P}from"./index-BZdik4nv.js";import{M7 as fe,eN as G,rx as ye,GI as Se,xe as ge,zX as Ie,Cu as he,D7 as be,E0 as De,Mu as Oe,Mv as Te,Mw as ke,Mx as Ce,My as Ve,J1 as we,Lw as Ae,Jd as Ne,k7 as _e,fA as xe,fz as Fe,fy as ve,pF as ze,pw as Ee,pt as Me,j$ as Be,rG as Pe,rE as R,bC as L,rS as j,ct as Re}from"./zeni-epic-state-BuHrGGbR.js";import{n as Le}from"./mui-DAxzkQdy.js";import{c as U}from"./routePaths-BFjkYUJ-.js";import{M as je}from"./MobileAppDrawer-_jQrJKA4.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]="9bc905d4-1682-4f25-ad4d-1d4917c78697",e._sentryDebugIdIdentifier="sentry-dbid-9bc905d4-1682-4f25-ad4d-1d4917c78697")}catch{}})();const Ue=Le.div`
1
+ import{j as k}from"./liveblocks-CFneZw8x.js";import{a as V}from"./sentry-Dhi05Xar.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-DK_vDmT8.js";import{A as ce,a as ue,aI as de,z as E,x as pe,e as M,aa as v,g as z,bt as le,ao as me,s as B,ap as P}from"./index-DPdMJbdm.js";import{M7 as fe,eN as G,rx as ye,GI as Se,xe as ge,zX as Ie,Cu as he,D7 as be,E0 as De,Mu as Oe,Mv as Te,Mw as ke,Mx as Ce,My as Ve,J1 as we,Lw as Ae,Jd as Ne,k7 as _e,fA as xe,fz as Fe,fy as ve,pF as ze,pw as Ee,pt as Me,j$ as Be,rG as Pe,rE as R,bC as L,rS as j,ct as Re}from"./zeni-epic-state-BL_LeZIj.js";import{n as Le}from"./mui-Cf9-_L5d.js";import{c as U}from"./routePaths-C9gqQCUu.js";import{M as je}from"./MobileAppDrawer-CrCMrvam.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]="9bc905d4-1682-4f25-ad4d-1d4917c78697",e._sentryDebugIdIdentifier="sentry-dbid-9bc905d4-1682-4f25-ad4d-1d4917c78697")}catch{}})();const Ue=Le.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BKv5MOZO.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 Qt,o as te}from"./core-m4XGmWiT.js";import{eN as ie,bs as Be,N_ as _a,eR as Se,eS as Ie,eT as Ae,fP as Me,cq as ze,N$ as $e,O0 as $a,sM as Sa,jz as Ia,O1 as Aa,gD as ca,ze as aa,zg as Ga,zh as Ya,jp as Ct,O2 as Ge,z2 as pt,O3 as Xt,O4 as Jt,z5 as wa,O5 as en,Mr as Pa,qY as ht,zb as Za,gO as an,O6 as ft,O7 as Ye,bq as tn,O8 as nn,fA as Ta,fz as Fa,zL as rn,fy as va,M7 as sn,O9 as gt,cj as bt,cL as on,Mq as ua,Al as cn,Oa as rt,zX as Oa,Ob as yt,Am as dn,MR as ln,An as un,Bh as mn,s6 as Cn,Bb as pn,zw as St,zp as hn,Oc as fn,fR as gn,zF as It,zJ as At,fQ as bn,Od as yn,A7 as Et,Oe as Sn,Of as In,Og as An,zH as kt,zs as Dt,z8 as _t,zB as wt,zz as Pt,zD as En,zf as st,Oh as Tt,Oi as xa,zU as Ea,J6 as Ft,cM as Ka,Oj as kn,Ok as Dn,Ol as _n,Om as wn,zR as Ha,Ae as Pn,Aa as Tn,zN as Fn,Ac as vn,A2 as On,A4 as xn,On as vt,Ak as Ot,GE as Bn,Oo as Ln,Op as Rn,Oq as Un,Or as xt,Os as jn,AH as Nn,zW as Bt,zQ as da,zV as Vn,Ot as Hn,Ou as Mn,y$ as zn,Ov as Lt,Ow as Rt,Ox as $n,z1 as Gn,z0 as ot,Oy as Yn,Oz as Zn,OA as Kn,J2 as Wn,OB as Wa,OC as qn,vC as Ut,k7 as Qn,gE as Xn,AM as Jn,OD as jt,OE as er,AN as ar,OF as tr,dc as nr,sG as rr,AC as sr,Aw as xe,bv as or,bD as ir,cv as cr,bE as dr,Il as lr}from"./zeni-epic-state-BuHrGGbR.js";import{z as J,A as Re,a as oe,d as Z,B as Ze,bX as Ba,c6 as ur,p as ve,c7 as mr,c8 as Cr,q as ma,aI as Fe,s as be,be as qa,c9 as pr,y as Ca,k as La,h as Qa,e as Q,D as Xa,ca as hr,I as Nt,al as Ja,bq as Je,cb as Ma,cc as fr,x as et,a1 as gr,cd as br,ao as Vt,N as za,J as Ht,g as Mt,ce as yr,cf as Sr,cg as Ir,ch as Ar,ci as Er,o as ka,cj as kr,ck as Dr,cl as ja,w as _r,cm as wr,cn as Pr,co as Tr,cp as Fr,a4 as vr}from"./index-BZdik4nv.js";import{n as _e,D as zt,S as Or}from"./mui-DAxzkQdy.js";import{a as c}from"./sentry-CFyyxsOr.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Ue,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-BZI5O61v.js";import Ra from"./NotFoundScreen-CVsKzFAu.js";import{M as ha}from"./MobileAppDrawer-_jQrJKA4.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-ZY9x_rC7.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-B6JWGD0I.js";import{v as ct}from"./utils-C0kl6VPG.js";import{t as Ur}from"./AddressScreen-Cyw6I8Nr.js";import"./recharts-PrS_AG6G.js";import"./analytics-qxJxpRMv.js";import"./plaid-C22HydUi.js";import"./dnd-Cti5FOfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-D5SKDqvx.js";import"./lexical-Th9XxYyj.js";import"./pdf-CO0-X1gn.js";import"./analyticsHelper-v98PhG00.js";import"./routePaths-BFjkYUJ-.js";import"./BusinessVerificationPageScreen-DN6Q07Oe.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]="aa1227db-fb55-49f4-8027-c492ad276f5d",e._sentryDebugIdIdentifier="sentry-dbid-aa1227db-fb55-49f4-8027-c492ad276f5d")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=J.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,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=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],O=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()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);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=Le(l,g,w,f),x=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:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=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(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=J.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(Nr,{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=J.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=>Jt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=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:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,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 O=J.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:O,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:La.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&&J.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-CFneZw8x.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 Qt,o as te}from"./core-DK_vDmT8.js";import{eN as ie,bs as Be,N_ as _a,eR as Se,eS as Ie,eT as Ae,fP as Me,cq as ze,N$ as $e,O0 as $a,sM as Sa,jz as Ia,O1 as Aa,gD as ca,ze as aa,zg as Ga,zh as Ya,jp as Ct,O2 as Ge,z2 as pt,O3 as Xt,O4 as Jt,z5 as wa,O5 as en,Mr as Pa,qY as ht,zb as Za,gO as an,O6 as ft,O7 as Ye,bq as tn,O8 as nn,fA as Ta,fz as Fa,zL as rn,fy as va,M7 as sn,O9 as gt,cj as bt,cL as on,Mq as ua,Al as cn,Oa as rt,zX as Oa,Ob as yt,Am as dn,MR as ln,An as un,Bh as mn,s6 as Cn,Bb as pn,zw as St,zp as hn,Oc as fn,fR as gn,zF as It,zJ as At,fQ as bn,Od as yn,A7 as Et,Oe as Sn,Of as In,Og as An,zH as kt,zs as Dt,z8 as _t,zB as wt,zz as Pt,zD as En,zf as st,Oh as Tt,Oi as xa,zU as Ea,J6 as Ft,cM as Ka,Oj as kn,Ok as Dn,Ol as _n,Om as wn,zR as Ha,Ae as Pn,Aa as Tn,zN as Fn,Ac as vn,A2 as On,A4 as xn,On as vt,Ak as Ot,GE as Bn,Oo as Ln,Op as Rn,Oq as Un,Or as xt,Os as jn,AH as Nn,zW as Bt,zQ as da,zV as Vn,Ot as Hn,Ou as Mn,y$ as zn,Ov as Lt,Ow as Rt,Ox as $n,z1 as Gn,z0 as ot,Oy as Yn,Oz as Zn,OA as Kn,J2 as Wn,OB as Wa,OC as qn,vC as Ut,k7 as Qn,gE as Xn,AM as Jn,OD as jt,OE as er,AN as ar,OF as tr,dc as nr,sG as rr,AC as sr,Aw as xe,bv as or,bD as ir,cv as cr,bE as dr,Il as lr}from"./zeni-epic-state-BL_LeZIj.js";import{z as J,A as Re,a as oe,d as Z,B as Ze,bX as Ba,c6 as ur,p as ve,c7 as mr,c8 as Cr,q as ma,aI as Fe,s as be,be as qa,c9 as pr,y as Ca,j as La,h as Qa,e as Q,D as Xa,ca as hr,G as Nt,al as Ja,bq as Je,cb as Ma,cc as fr,x as et,a1 as gr,cd as br,ao as Vt,N as za,I as Ht,g as Mt,ce as yr,cf as Sr,cg as Ir,ch as Ar,ci as Er,o as ka,cj as kr,ck as Dr,cl as ja,w as _r,cm as wr,cn as Pr,co as Tr,cp as Fr,a4 as vr}from"./index-DPdMJbdm.js";import{n as _e,D as zt,S as Or}from"./mui-Cf9-_L5d.js";import{a as c}from"./sentry-Dhi05Xar.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Ue,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-BcVPObGq.js";import Ra from"./NotFoundScreen-DyE8IG1F.js";import{M as ha}from"./MobileAppDrawer-CrCMrvam.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-Z_9iU3fL.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-ChiWRlVf.js";import{v as ct}from"./utils-DkqKuJOX.js";import{t as Ur}from"./AddressScreen-CR6VYfc-.js";import"./recharts-DGCFoGqb.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./analyticsHelper-CUi1_ubR.js";import"./routePaths-C9gqQCUu.js";import"./BusinessVerificationPageScreen-iv0LsvpT.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]="58960be4-856d-43b2-b69f-112306999739",e._sentryDebugIdIdentifier="sentry-dbid-58960be4-856d-43b2-b69f-112306999739")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=J.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,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=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],O=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()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);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=Le(l,g,w,f),x=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:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=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(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=J.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(Nr,{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=J.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=>Jt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=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:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,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 O=J.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:O,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:La.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&&J.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-BKv5MOZO.js";import{a as g}from"./sentry-CFyyxsOr.js";import{j as w,h as x,u as k,l as T,g as O,k as E}from"./core-m4XGmWiT.js";import{z as N,b0 as F,x as P,e as L,g as V,aa as b,b1 as j,ao as A,ap as U,s as B}from"./index-BZdik4nv.js";import{eN as D,fC as M,rx as _,fx as G,c0 as R,Lw as z,bn as Y,pF as $,pt as H,j$ as Z,lv as S,Lx as q,bC as J,ct as C,lD as K,lG as Q}from"./zeni-epic-state-BuHrGGbR.js";import"./mui-DAxzkQdy.js";import{c as W}from"./routePaths-BFjkYUJ-.js";import{M as X}from"./MobileAppDrawer-_jQrJKA4.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="53157521-5121-43df-bfc5-faf36f7a6bbb",n._sentryDebugIdIdentifier="sentry-dbid-53157521-5121-43df-bfc5-faf36f7a6bbb")}catch{}})();const ee=E(function(n){const a=G(n),i=N.getSignedInUser(),l=D(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(n.companyConfigState),t=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:t,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let t=e.href;t.includes("http")||(t="https://".concat(t)),window.open(t,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const t=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(t,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:t,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=t,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...t,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:t.industry.selectedOption,companyIndustryType:t.companyIndustryType?.selectedOption??void 0,companySubIndustry:t.companySubIndustry?.selectedOption??void 0,businessModel:t.businessModel.selectedOption??"",companySourceOfFunds:t.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:t.companySourceOfFundsDescription??void 0,countriesOfOperations:t.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:t.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:t.transactionVolumeDescription??void 0,regulatedStatus:t.regulatedStatus??void 0,regulatedStatusDescription:t.regulatedStatusDescription??void 0,usNexus:t.usNexus??void 0,usNexusTypes:t.usNexusTypes?.selectedOptions??[],purposeOfAccount:t.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:t.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(Z({files:e}))},onDeleteFile:e=>{n(H(e))},onEditFileName:(e,t)=>{n($(e,t.split(".")[0]))}}})(j);function de(){const n=w(),a=x(),i=k(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),t=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||t!=="Not-Started"||d==null||(p(!0),a(M(d)))},[c,t,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[o,a]);const u=s=>{e(s)},y=t==="Not-Started"||t==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&t==="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-CFneZw8x.js";import{a as g}from"./sentry-Dhi05Xar.js";import{j as w,h as x,u as k,l as T,g as O,k as E}from"./core-DK_vDmT8.js";import{z as N,b0 as F,x as P,e as L,g as V,aa as b,b1 as j,ao as A,ap as U,s as B}from"./index-DPdMJbdm.js";import{eN as D,fC as M,rx as _,fx as G,c0 as R,Lw as z,bn as Y,pF as $,pt as H,j$ as Z,lv as S,Lx as q,bC as J,ct as C,lD as K,lG as Q}from"./zeni-epic-state-BL_LeZIj.js";import"./mui-Cf9-_L5d.js";import{c as W}from"./routePaths-C9gqQCUu.js";import{M as X}from"./MobileAppDrawer-CrCMrvam.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="53157521-5121-43df-bfc5-faf36f7a6bbb",n._sentryDebugIdIdentifier="sentry-dbid-53157521-5121-43df-bfc5-faf36f7a6bbb")}catch{}})();const ee=E(function(n){const a=G(n),i=N.getSignedInUser(),l=D(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(n.companyConfigState),t=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:t,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let t=e.href;t.includes("http")||(t="https://".concat(t)),window.open(t,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const t=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(t,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:t,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=t,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...t,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:t.industry.selectedOption,companyIndustryType:t.companyIndustryType?.selectedOption??void 0,companySubIndustry:t.companySubIndustry?.selectedOption??void 0,businessModel:t.businessModel.selectedOption??"",companySourceOfFunds:t.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:t.companySourceOfFundsDescription??void 0,countriesOfOperations:t.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:t.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:t.transactionVolumeDescription??void 0,regulatedStatus:t.regulatedStatus??void 0,regulatedStatusDescription:t.regulatedStatusDescription??void 0,usNexus:t.usNexus??void 0,usNexusTypes:t.usNexusTypes?.selectedOptions??[],purposeOfAccount:t.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:t.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(Z({files:e}))},onDeleteFile:e=>{n(H(e))},onEditFileName:(e,t)=>{n($(e,t.split(".")[0]))}}})(j);function de(){const n=w(),a=x(),i=k(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),t=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||t!=="Not-Started"||d==null||(p(!0),a(M(d)))},[c,t,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[o,a]);const u=s=>{e(s)},y=t==="Not-Started"||t==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&t==="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-BKv5MOZO.js";import{a}from"./sentry-CFyyxsOr.js";import{h as D,u as v,g as u,N as w}from"./core-m4XGmWiT.js";import{Ih as O,eN as A,fj as _,mm as j,fL as E,fi as L,eO as U,Io as F}from"./zeni-epic-state-BuHrGGbR.js";import{u as $,z as c,L as g,D as k,o as H}from"./index-BZdik4nv.js";import{n as z}from"./mui-DAxzkQdy.js";import{t as R}from"./getLocaleForTenant-DmculB1-.js";import{g as P,Q as G}from"./QBOConnectionScreen-BGFG3hnm.js";import"./recharts-PrS_AG6G.js";import"./analytics-qxJxpRMv.js";import"./plaid-C22HydUi.js";import"./dnd-Cti5FOfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-D5SKDqvx.js";import"./lexical-Th9XxYyj.js";import"./pdf-CO0-X1gn.js";import"./utils-C0kl6VPG.js";import"./empty-yK5JPtMo.js";import"./pdf-lib-BjJKENqb.js";import"./index-C6AQ1lse.js";import"./url-C9oWR66D.js";import"./index-Dy5pScEc.js";import"./decodeURIComponentSafe-C8T3gy_G.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]="6675bced-3101-4937-bc7b-af33a8cfa4e2",t._sentryDebugIdIdentifier="sentry-dbid-6675bced-3101-4937-bc7b-af33a8cfa4e2")}catch{}})();const Q=z.div`
1
+ import{j as C}from"./liveblocks-CFneZw8x.js";import{a}from"./sentry-Dhi05Xar.js";import{h as D,u as v,g as u,N as w}from"./core-DK_vDmT8.js";import{Ih as O,eN as A,fj as _,mm as j,fL as E,fi as L,eO as U,Io as F}from"./zeni-epic-state-BL_LeZIj.js";import{u as $,z as c,L as g,D as k,o as H}from"./index-DPdMJbdm.js";import{n as z}from"./mui-Cf9-_L5d.js";import{t as R}from"./getLocaleForTenant-B8la2oRW.js";import{g as P,Q as G}from"./QBOConnectionScreen-dFyaTh--.js";import"./recharts-DGCFoGqb.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./utils-DkqKuJOX.js";import"./empty-DSG43sav.js";import"./pdf-lib-CtLCB8Ws.js";import"./index-C_rnV1Gn.js";import"./url-A8mMNIgc.js";import"./index-BXVvK5HN.js";import"./decodeURIComponentSafe-D_yxDRpD.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]="6675bced-3101-4937-bc7b-af33a8cfa4e2",t._sentryDebugIdIdentifier="sentry-dbid-6675bced-3101-4937-bc7b-af33a8cfa4e2")}catch{}})();const Q=z.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -0,0 +1 @@
1
+ import{j as d}from"./liveblocks-CFneZw8x.js";import{z as n}from"./index-DPdMJbdm.js";import{g as p}from"./QBOConnectionScreen-dFyaTh--.js";import"./sentry-Dhi05Xar.js";import{u as a,N as i}from"./core-DK_vDmT8.js";import"./zeni-epic-state-BL_LeZIj.js";import"./recharts-DGCFoGqb.js";import"./mui-Cf9-_L5d.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./utils-DkqKuJOX.js";import"./empty-DSG43sav.js";import"./pdf-lib-CtLCB8Ws.js";import"./index-C_rnV1Gn.js";import"./url-A8mMNIgc.js";import"./index-BXVvK5HN.js";import"./decodeURIComponentSafe-D_yxDRpD.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]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,13 +1,13 @@
1
- import{j as a}from"./liveblocks-BKv5MOZO.js";import{t as $e,A as Ce}from"./AddressScreen-Cyw6I8Nr.js";import Me from"./NotFoundScreen-CVsKzFAu.js";import{a as g}from"./sentry-CFyyxsOr.js";import{j as oe,u as se,h as ie,l as re,g as D,N as T,k as ce,i as ze,n as qe,o as z}from"./core-m4XGmWiT.js";import{w as de,A as le,z as B,a as ue,h as Ke,d as _,s as V,x as H,e as N,B as je,g as Y,ak as Qe,q as Je,al as ke,k as te,am as Ze,an as Ie,o as He,ao as We,ap as Te,aq as Ye}from"./index-BZdik4nv.js";import{bn as Xe,eN as ee,fb as et,eT as pe,eR as me,bv as tt,mk as at,f7 as nt,bM as ot,j3 as ae,j6 as ve,I$ as st,bR as it,c0 as ge,rL as fe,rw as rt,Jb as X,rM as _e,GI as ct,k7 as Ue,Jc as Ve,Jd as dt,Je as lt,Jf as ut,j1 as pt,j4 as mt,ry as Be,rK as gt,bC as xe,ct as ft,rY as Ee,pF as ht,pt as yt,j$ as bt,fA as St,fz as Ct,fy as kt,Jg as It,rq as Tt,rZ as xt,s0 as Et,s3 as Ot,s9 as At,cS as Pt}from"./zeni-epic-state-BuHrGGbR.js";import{n as he}from"./mui-DAxzkQdy.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-BGFG3hnm.js";import"./recharts-PrS_AG6G.js";import"./analytics-qxJxpRMv.js";import"./plaid-C22HydUi.js";import"./dnd-Cti5FOfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-D5SKDqvx.js";import"./lexical-Th9XxYyj.js";import"./pdf-CO0-X1gn.js";import"./utils-C0kl6VPG.js";import"./empty-yK5JPtMo.js";import"./pdf-lib-BjJKENqb.js";import"./index-C6AQ1lse.js";import"./url-C9oWR66D.js";import"./index-Dy5pScEc.js";import"./decodeURIComponentSafe-C8T3gy_G.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]="c69f8fd5-ce47-4f3b-aa7b-a6ca9e4a0f78",t._sentryDebugIdIdentifier="sentry-dbid-c69f8fd5-ce47-4f3b-aa7b-a6ca9e4a0f78")}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,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),I=Ke(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:E}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=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),S=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),A=me(c),P=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,M=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!q,K=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&P.push("top_expenses"),M===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),K===!1&&P.push("reimbursement_card","reimbursement_promo_card"),k===!1&&P.push("zeni_accounts_promo_card"),h===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||A||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,P)))},[d,O,j,A,i,c.tenantId,s]),g.useEffect(()=>{(j||A)&&setTimeout(()=>{b(!0)},5e3)},[j,A]),O!=="Completed")return a.jsx(T,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(T,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(T,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(J=>J.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:E,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-CFneZw8x.js";import{t as $e,A as Ce}from"./AddressScreen-CR6VYfc-.js";import Me from"./NotFoundScreen-DyE8IG1F.js";import{a as g}from"./sentry-Dhi05Xar.js";import{j as oe,u as se,h as ie,l as re,g as D,N as T,k as ce,i as ze,n as qe,o as z}from"./core-DK_vDmT8.js";import{w as de,A as le,z as B,a as ue,h as Ke,d as _,s as V,x as H,e as N,B as je,g as Y,ak as Qe,q as Je,al as Ie,j as te,am as Ze,an as ke,o as He,ao as We,ap as Te,aq as Ye}from"./index-DPdMJbdm.js";import{bn as Xe,eN as ee,fb as et,eT as pe,eR as me,bv as tt,mk as at,f7 as nt,bM as ot,j3 as ae,j6 as ve,I$ as st,bR as it,c0 as ge,rL as he,rw as rt,Jb as X,rM as _e,GI as ct,k7 as Ue,Jc as Ve,Jd as dt,Je as lt,Jf as ut,j1 as pt,j4 as mt,ry as Be,rK as gt,bC as xe,ct as ht,rY as Ee,pF as ft,pt as yt,j$ as St,fA as bt,fz as Ct,fy as It,Jg as kt,rq as Tt,rZ as xt,s0 as Et,s3 as Ot,s9 as At,cS as Pt}from"./zeni-epic-state-BL_LeZIj.js";import{n as fe}from"./mui-Cf9-_L5d.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-dFyaTh--.js";import"./recharts-DGCFoGqb.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./utils-DkqKuJOX.js";import"./empty-DSG43sav.js";import"./pdf-lib-CtLCB8Ws.js";import"./index-C_rnV1Gn.js";import"./url-A8mMNIgc.js";import"./index-BXVvK5HN.js";import"./decodeURIComponentSafe-D_yxDRpD.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]="841a3c0d-72bc-45e9-9955-dc268d7ade07",t._sentryDebugIdIdentifier="sentry-dbid-841a3c0d-72bc-45e9-9955-dc268d7ade07")}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=Xe(i),{useFeatureGate:m}=ue(),k=Ke(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:E}=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),A=me(c),P=[],Q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,M=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!q,K=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&P.push("top_expenses"),M===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),K===!1&&P.push("reimbursement_card","reimbursement_promo_card"),I===!1&&P.push("zeni_accounts_promo_card"),f===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||A||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,P)))},[d,O,j,A,i,c.tenantId,s]),g.useEffect(()=>{(j||A)&&setTimeout(()=>{S(!0)},5e3)},[j,A]),O!=="Completed")return a.jsx(T,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(T,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(T,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(J=>J.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:E,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`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
5
- `,Ae=he.div`
5
+ `,Ae=fe.div`
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  align-items: center;
9
- min-width: calc(100% - ${Ie}px);
10
- padding-left: ${Ie}px;
9
+ min-width: calc(100% - ${ke}px);
10
+ padding-left: ${ke}px;
11
11
  flex: 1;
12
12
 
13
13
  ${t=>t.theme.breakpoints.down("md")} {
@@ -16,8 +16,8 @@ import{j as a}from"./liveblocks-BKv5MOZO.js";import{t as $e,A as Ce}from"./Addre
16
16
  }
17
17
 
18
18
  ${t=>t.windowSize!=="small"?"overflow: auto;":""}
19
- `,Pe=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),b=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:b??""},n=ee(t),i=fe(t,s),f=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.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:b}=u;return{onFetchLinkTokenClick:(e,n)=>{t(At(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(Et(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(xt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Tt(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:f,userId:m,name:I,email:x,ssn:E,nationalityCountryCode:k,dob:h,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,isPhoneVerified:O}=i;let S;return F.selectDocumentType==="driverLicense"?S="driving_license":F.selectDocumentType==="passport"?S="passport":F.selectDocumentType==="stateId"?S="id_document":F.selectDocumentType==="ssnCard"&&(S="social_security_card"),{officerType:f,userId:m,firstName:I.firstName,lastName:I.lastName,email:x,ssn:E,nationalityCountryCode:k?.selectedOption!=null?Te(k.selectedOption):void 0,phone:U,birthday:h!=null?xe(h?.toString()):h,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:S,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(Ee({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(St(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(bt({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:I,companyWebsite:x,companyPhone:E,primaryContactEmail:k,primaryContactName:h,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:w,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:S,countriesOfOperations:G,purposeOfAccount:j,purposeOfAccountDescription:A,regulatedStatus:P,regulatedStatusDescription:Q,transactionVolume:M,transactionVolumeDescription:q,usNexus:v,usNexusTypes:K}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:f?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:x!=""&&x!=null?ft(x):void 0,phone:E,syncToken:F,fileIds:$,incDate:w!=null?xe(w?.toString()):w,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:S?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(Z=>Z.length===2?Z:Te(Z))??[],purposeOfAccount:j?.selectedOption??"",purposeOfAccountDescription:A,regulatedStatus:P??"",regulatedStatusDescription:Q,transactionVolume:M?.selectedOption??"",transactionVolumeDescription:q,usNexus:v,usNexusTypes:K?.selectedOptions??[]},J={userId:U,firstName:h.firstName,lastName:h.lastName,email:k,syncToken:C};t(Ee({companyDetails:l,primaryContactDetails:J}))},onAddressClick:(e,n)=>{const i=De(b,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onRegisteredAddressClick:(e,n)=>{const i=De(b,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(X({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(`/${b}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(Ze),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Je(),b=de(),[e,n]=g.useState(!1),[i,f]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:x}=re(),E=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:h}=k(_.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=ke(w.addCardPaymentSourceStatus.fetchState),O=w.addCardPaymentSourceStatus.fetchState,{code:S,realmId:G,state:j}=Dt(d.search),A=c.externalConnections?.accounting[0],P=A?.connectionType,Q=A?.connectionName,M=A?.connectionId??"",q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(f(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(S,G,j,M,q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:P??"accounting",connection_name:Q??"quickbooks_online",authorization_code:S,realm_id:G,connection_id:M,user_id:q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,M),u(d.pathname))},[S,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(x)?.companyId,K=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(X({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(X({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const J=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&J==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const Z=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,be=y=>y.trackPageLoaded(Y.Event.onboardingPage),Se=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!Se)return Ge?a.jsx(T,{to:"../../treasury"}):Le?a.jsx(T,{to:"../../checking"}):Re?a.jsx(T,{to:"../../cards"}):a.jsx(T,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(Se&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>be(Ne)}),a.jsx(Pe,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:K,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{windowSize:p,children:s}):null]}):a.jsx(T,{to:"../../onboarding/thankyou"})}else if(ye===!1&&E?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(T,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>be(y)}),a.jsx(Pe,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:K,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{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`
19
+ `,Pe=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:We.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(At(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(Et(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(xt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Tt(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:k,email:x,ssn:E,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:x,ssn:E,nationalityCountryCode:I?.selectedOption!=null?Te(I.selectedOption):void 0,phone:U,birthday:f!=null?xe(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(Ee({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:x,companyPhone:E,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:A,regulatedStatus:P,regulatedStatusDescription:Q,transactionVolume:M,transactionVolumeDescription:q,usNexus:v,usNexusTypes:K}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:k,website:x!=""&&x!=null?ht(x):void 0,phone:E,syncToken:F,fileIds:$,incDate:w!=null?xe(w?.toString()):w,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(Z=>Z.length===2?Z:Te(Z))??[],purposeOfAccount:j?.selectedOption??"",purposeOfAccountDescription:A,regulatedStatus:P??"",regulatedStatusDescription:Q,transactionVolume:M?.selectedOption??"",transactionVolumeDescription:q,usNexus:v,usNexusTypes:K?.selectedOptions??[]},J={userId:U,firstName:f.firstName,lastName:f.lastName,email:I,syncToken:C};t(Ee({companyDetails:l,primaryContactDetails:J}))},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(X({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})}}})(Ze),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Je(),S=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,k]=g.useState(!1),{tenantEmailDomain:x}=re(),E=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),A=c.externalConnections?.accounting[0],P=A?.connectionType,Q=A?.connectionName,M=A?.connectionId??"",q=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,q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:P??"accounting",connection_name:Q??"quickbooks_online",authorization_code:b,realm_id:G,connection_id:M,user_id:q},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(x)?.companyId,K=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(X({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(X({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const J=Ie(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&J==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const Z=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(T,{to:"../../treasury"}):Le?a.jsx(T,{to:"../../checking"}):Re?a.jsx(T,{to:"../../cards"}):a.jsx(T,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(Pe,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:K,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{windowSize:p,children:s}):null]}):a.jsx(T,{to:"../../onboarding/thankyou"})}else if(ye===!1&&E?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(T,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>Se(y)}),a.jsx(Pe,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:K,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{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`
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=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 b=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:b,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:b,message:"UpdatePaymentAddressDetail"}})}}})(Ye),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),b=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(b.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),x=me(i),E=D(h=>h.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||f?E==="Completed"&&k===!0&&f&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:h=>{h.trackPageLoaded(Y.Event.onboardingLandingPage,"Onboarding",Pt(i.productSettings))}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):E==="Completed"&&k===!1&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{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:E}):I?a.jsx(T,{to:"../../checking"}):x?a.jsx(T,{to:"../../cards"}):a.jsx(T,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{children:[a.jsx(z,{path:"/",element:a.jsx(W,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(W,{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(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(W,{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=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),x=me(i),E=D(f=>f.onboardingCustomerViewState.updateStatus.fetchState),I=i.company?.companyOnboardingInfo.isOnboardingCompleted;return I!==!0||h?E==="Completed"&&I===!0&&h&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingLandingPage,"Onboarding",Pt(i.productSettings))}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):E==="Completed"&&I===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{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:E}):k?a.jsx(T,{to:"../../checking"}):x?a.jsx(T,{to:"../../cards"}):a.jsx(T,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{children:[a.jsx(z,{path:"/",element:a.jsx(W,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(W,{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(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx(Me,{})})]})}export{oa as default};