@zeniai/web-app-ui 5.0.66-qa → 5.0.67-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 (115) hide show
  1. package/dist/assets/AddressRoutes-cN2hvu5k.js +1 -0
  2. package/dist/assets/{AddressScreen-BAjnEp-X.js → AddressScreen-Cdrj5W4-.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-BHXlYJhk.js → AiCfoScreen-B-1grS8G.js} +3 -3
  4. package/dist/assets/{BillPayApprovalRoutes-CzGAg-RT.js → BillPayApprovalRoutes-CYVk-fEO.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BrT44OKb.js → BillPayRoutes-DDC6qHPH.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DxAzWOOG.js → BusinessVerificationPageScreen-Cc1IIWeU.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-Bz9nItR4.js → ChargeCardRoutes-WudejbU5.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-QZ_mGMd4.js → CompanyPassportScreen-BKSfyJ-l.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-CpuUuu-_.js → ConnectionAuthScreen-_imXUbd-.js} +2 -2
  10. package/dist/assets/CustomerOnboardingAuthScreen-CEMPHR45.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-BfehFPND.js → CustomerOnboardingRoutes-F1vVB2Sv.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-eN0rJLLD.js → DashboardRoutes-BRu36Tfy.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-CcXzOxRp.js → DefaultTenantHome-DfbzoS5K.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BcnlrXA2.js → DomesticWireDetailScreen-ZGxx9s_z.js} +3 -3
  15. package/dist/assets/DrawerScreen-CNcA0NWW.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-BmYxwbUk.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes--daJtdEl.js → ExpenseAutomationRoutes-BlEicy7A.js} +3 -3
  18. package/dist/assets/FeaturePreviewScreen-Ck2p6Gja.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-RaFYANW2.js → MagicLinkRoutes-DWwHzbiU.js} +1 -1
  20. package/dist/assets/MagicLinkSignInScreen-BSZMqjA8.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-DeylJyoS.js → MobileAppDrawer-DlNmDt_G.js} +1 -1
  22. package/dist/assets/NotFoundScreen-Bn00COMT.js +1 -0
  23. package/dist/assets/{NotificationRoutes-BRIAt45r.js → NotificationRoutes-DKQO1vhK.js} +1 -1
  24. package/dist/assets/{OAuthConsentScreen-SSJxi6bW.js → OAuthConsentScreen-DgYck1Vm.js} +1 -1
  25. package/dist/assets/PandLWithForecastRoutes-CBeCFkpZ.js +1 -0
  26. package/dist/assets/{PeopleRoutes-CdSAFFKy.js → PeopleRoutes-Bx6vvHyi.js} +1 -1
  27. package/dist/assets/PerformanceRoutes-Dzf_Gbv_.js +1 -0
  28. package/dist/assets/{Preview-BHNHm504.js → Preview-CX-Kq6YO.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-CxOACLF0.js → QBOConnectionScreen-Ik56pHVf.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-C4TUE7u-.js → ReferralListScreen-CQbl2UNi.js} +2 -2
  31. package/dist/assets/ReimbursementApprovalRoutes-DODnS_H8.js +1 -0
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DHJfikzO.js → ReimbursementApprovalRuleDetailScreen-D47IilTw.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-CEvVhZii.js → ReimbursementRoutes-CPirKpDw.js} +4 -4
  34. package/dist/assets/{ReportsRoutes-BfvsU1EY.js → ReportsRoutes-Bt0cxiUC.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-Cio16rVo.js → RewardsRoutes-DPjrSm5w.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-Bdf3ftuj.js → ScreenRoutes-BzreoX2P.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-B0yuOT8Q.js → SettingsRoutes-BUAI7US9.js} +8 -8
  38. package/dist/assets/{SetupPagesScreen-Cescu0d2.js → SetupPagesScreen-CIwH3ZZF.js} +1 -1
  39. package/dist/assets/{SignInScreen-CsSIJ__Q.js → SignInScreen-Bt9puaku.js} +1 -1
  40. package/dist/assets/SignOutScreen-CM2ECVcQ.js +9 -0
  41. package/dist/assets/{TaskListScreen-CxNhJaSH.js → TaskListScreen-ByuOJ-7H.js} +2 -2
  42. package/dist/assets/{TaskRoutes-BSrgrKDO.js → TaskRoutes-QKzr6xVQ.js} +1 -1
  43. package/dist/assets/TransactionDetailRoutes-DMctD9qf.js +1 -0
  44. package/dist/assets/{TransactionDetailScreen-BS1m1uHz.js → TransactionDetailScreen-nBKG_H4f.js} +2 -2
  45. package/dist/assets/{TransactionListRoutes-Dt5XVEa1.js → TransactionListRoutes-BB1zFFVN.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-66dAv4dI.js → TreasuryRoutes-dG47aDHP.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-C_EbMO1S.js → VendorsRoutes-CvbRdyyA.js} +1 -1
  48. package/dist/assets/WiseConfirmationScreen-Df9zLzqA.js +12 -0
  49. package/dist/assets/{ZeniAccountRoutes-CTB93z0S.js → ZeniAccountRoutes-BhBRZUQz.js} +11 -11
  50. package/dist/assets/{ZeniAccountStatementScreen-DmzWGfwC.js → ZeniAccountStatementScreen-BbT_F5EY.js} +2 -2
  51. package/dist/assets/{accountMappingHelper-BHhQdza1.js → accountMappingHelper-l5KQkq0O.js} +1 -1
  52. package/dist/assets/{analytics-DQCQhWLc.js → analytics-DwbKC7qV.js} +1 -1
  53. package/dist/assets/{analyticsHelper-DUWn4fSe.js → analyticsHelper-tcwBG-lH.js} +1 -1
  54. package/dist/assets/{core-j0LqCeu3.js → core-DxYppZiZ.js} +1 -1
  55. package/dist/assets/{decodeURIComponentSafe-DFYfbcv3.js → decodeURIComponentSafe-B26owMY4.js} +1 -1
  56. package/dist/assets/{dnd-DAo38rm8.js → dnd-rWx_BA4U.js} +1 -1
  57. package/dist/assets/{index-4NAZbGj1.js → empty-DNik0LMv.js} +1 -1
  58. package/dist/assets/{empty-CK9odIeO.js → empty-DULS5Nrn.js} +1 -1
  59. package/dist/assets/{emptyVideoElement-C-uPKIxs.js → emptyVideoElement-mPx-9nkL.js} +1 -1
  60. package/dist/assets/{epic-DSNvXFJG.js → epic-S-I_KsoV.js} +1 -1
  61. package/dist/assets/{getLocaleForTenant-BLNl-Ho3.js → getLocaleForTenant-ClNmnFx1.js} +1 -1
  62. package/dist/assets/{index-cC6roLBs.js → index-BL-5UCyS.js} +1 -1
  63. package/dist/assets/{empty-Ca3lmO0X.js → index-Bwjy1Btm.js} +1 -1
  64. package/dist/assets/{index-71d39Q7D.js → index-C8TMxWTj.js} +2 -2
  65. package/dist/assets/{index-CZgerGBH.js → index-CVOKCo3k.js} +1 -1
  66. package/dist/assets/{index-CFtYCyfm.js → index-DPw038da.js} +7 -7
  67. package/dist/assets/index-DYHaARhd.js +2 -0
  68. package/dist/assets/{index-BX6ANtNh.js → index-GW-ogFZi.js} +1 -1
  69. package/dist/assets/index-dNGgc_CZ.js +1 -0
  70. package/dist/assets/{lexical-D-QBA09y.js → lexical-DPitEa2C.js} +1 -1
  71. package/dist/assets/{liveblocks-C3aHR2ug.js → liveblocks-BqO7Df-p.js} +1 -1
  72. package/dist/assets/{lottie-CAFVLjo0.js → lottie-B5P7nQ0g.js} +1 -1
  73. package/dist/assets/{mui-D78cc8iD.js → mui-DdrzQvkp.js} +1 -1
  74. package/dist/assets/{pathToGoBack-Dzva26FJ.js → pathToGoBack-D8OnmrBJ.js} +1 -1
  75. package/dist/assets/{pdf-C20YOa73.js → pdf-BeAAQRBu.js} +3 -3
  76. package/dist/assets/{pdf-lib-bl9YSMz9.js → pdf-lib-CHquFnr8.js} +1 -1
  77. package/dist/assets/{plaid-DsDYZOgp.js → plaid-DOFGuYBC.js} +1 -1
  78. package/dist/assets/{pusher-l3ERSdYl.js → pusher-BNXqMhSN.js} +1 -1
  79. package/dist/assets/{react-YfQWR1Yb.js → react--drtz5zi.js} +1 -1
  80. package/dist/assets/{react-oAtqdYpb.js → react-BaDxvM18.js} +1 -1
  81. package/dist/assets/{react-9NHYx8CN.js → react-BpFOakYv.js} +1 -1
  82. package/dist/assets/{react-DJWA5bIH.js → react-C840tf_D.js} +1 -1
  83. package/dist/assets/{react-Cf73dofS.js → react-CRUVsP_a.js} +1 -1
  84. package/dist/assets/{react-CslKeU46.js → react-CYhWGyVz.js} +1 -1
  85. package/dist/assets/{recharts-B0MOj05b.js → recharts-BucGjD65.js} +1 -1
  86. package/dist/assets/{routePaths-D7CLql-E.js → routePaths-CgcmkaKJ.js} +1 -1
  87. package/dist/assets/{sentry-cQZrhfVh.js → sentry-DS2EspaF.js} +1 -1
  88. package/dist/assets/{url-Oh4YprMm.js → url--J2koNP1.js} +1 -1
  89. package/dist/assets/url-C9We36rv.js +1 -0
  90. package/dist/assets/useAskAiCfoHostNavButtonProps-DpRKl1_2.js +1 -0
  91. package/dist/assets/{useDeviceId-CE3ipTvl.js → useDeviceId-CsxMPdAN.js} +1 -1
  92. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js → useFetchSuggestedQuestionsWhenReady-k6PyaabR.js} +1 -1
  93. package/dist/assets/useInitialThreadRequest-Wi13xyTC.js +1 -0
  94. package/dist/assets/{utils-BBuNXoTI.js → utils-B6prU8As.js} +1 -1
  95. package/dist/assets/{withTransactionSidePanel-BbFtF7db.js → withTransactionSidePanel-jaVwinxd.js} +1 -1
  96. package/dist/assets/{zeni-epic-state-DiQZjsue.js → zeni-epic-state-CXLj5Oko.js} +6 -6
  97. package/dist/index.html +1 -1
  98. package/package.json +2 -2
  99. package/dist/assets/AddressRoutes-ZBiq4EJc.js +0 -1
  100. package/dist/assets/CustomerOnboardingAuthScreen-CfmQ932p.js +0 -1
  101. package/dist/assets/DrawerScreen-I-2xB5eA.js +0 -1
  102. package/dist/assets/EntityDetailRoutes-BhPGNOQf.js +0 -1
  103. package/dist/assets/FeaturePreviewScreen-BD0F_lti.js +0 -1
  104. package/dist/assets/MagicLinkSignInScreen-B-f7LLOR.js +0 -12
  105. package/dist/assets/NotFoundScreen-BeCKiN3K.js +0 -1
  106. package/dist/assets/PandLWithForecastRoutes-D5ZL-4Av.js +0 -1
  107. package/dist/assets/PerformanceRoutes-CH31J9F9.js +0 -1
  108. package/dist/assets/ReimbursementApprovalRoutes-BsXJVvJR.js +0 -1
  109. package/dist/assets/SignOutScreen-B9jFNEAZ.js +0 -9
  110. package/dist/assets/TransactionDetailRoutes-Cd8hk8fd.js +0 -1
  111. package/dist/assets/WiseConfirmationScreen-B1r4FA9z.js +0 -12
  112. package/dist/assets/index-B2tWZgTJ.js +0 -1
  113. package/dist/assets/url-BbfnqyeH.js +0 -1
  114. package/dist/assets/useAskAiCfoHostNavButtonProps-CLV01Vra.js +0 -1
  115. package/dist/assets/useInitialThreadRequest-kL3BFKKo.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-BqO7Df-p.js";import{A as i}from"./AddressScreen-Cdrj5W4-.js";import s from"./NotFoundScreen-Bn00COMT.js";import"./sentry-DS2EspaF.js";import{n as d,o as r}from"./core-DxYppZiZ.js";import"./zeni-epic-state-CXLj5Oko.js";import"./recharts-BucGjD65.js";import"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.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]="7f1b944a-9a7d-4e6b-b1ef-dc3a07ec71ea",t._sentryDebugIdIdentifier="sentry-dbid-7f1b944a-9a7d-4e6b-b1ef-dc3a07ec71ea")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-C3aHR2ug.js";import{a as h}from"./sentry-cQZrhfVh.js";import{j as T,h as _,u as E,l as j,g as B,k as M}from"./core-j0LqCeu3.js";import{Z as $,m as D,z as L,I as K,B as J,x as N,c as C,f as S,E as z,i as b,p as F}from"./index-CFtYCyfm.js";import{Jm as k,gN as O,eO as R,Jn as U,c1 as G,Jo as V,k7 as q}from"./zeni-epic-state-DiQZjsue.js";import{n as H}from"./mui-D78cc8iD.js";import Z from"./NotFoundScreen-BeCKiN3K.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]="84619cc3-bf04-40ab-8098-013604d28277",e._sentryDebugIdIdentifier="sentry-dbid-84619cc3-bf04-40ab-8098-013604d28277")}catch{}})();const Q=H.div`
1
+ import{j as d}from"./liveblocks-BqO7Df-p.js";import{a as S}from"./sentry-DS2EspaF.js";import{j as T,h as _,u as E,l as j,g as B,k as M}from"./core-DxYppZiZ.js";import{Z as $,m as D,z as L,I as K,B as J,x as N,c as C,f as m,E as z,i as h,p as F}from"./index-DPw038da.js";import{Jm as k,gN as O,eO as R,Jn as U,c1 as G,Jo as V,k7 as q}from"./zeni-epic-state-CXLj5Oko.js";import{n as H}from"./mui-DdrzQvkp.js";import Z from"./NotFoundScreen-Bn00COMT.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]="0bc5a643-44bb-4e12-bf8d-91b0bb8e6ee0",e._sentryDebugIdIdentifier="sentry-dbid-0bc5a643-44bb-4e12-bf8d-91b0bb8e6ee0")}catch{}})();const Q=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as d}from"./liveblocks-C3aHR2ug.js";import{a as h}from"./sentry-cQZrhfV
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,W=M(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=R(e),a=t.roleMap!=null&&U(t.roleMap),r=i||c==="user_address"||G(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=V(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled: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??I();const u=r?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const r=X(a);e(q({addressType:c,addressToCreate:r})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(z);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),r=_(),n=E(),{addressId:s,addressType:u}=j(),g=$(),w=D(),x=L.getSignedInUser(),[f,v]=h.useState(s==null),p=B(m=>s!=null?k(m,s).fetchState:"Not-Started"),A=K();if(x==null)throw Error("Can't access address page without signing in...");const P=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect(()=>{f||s==null||(v(!0),r(O(s,!1)))},[f,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?d.jsx(J,{fetchState:p,style:{backgroundColor:w.colors.grey5}}):s!=null&&p==="Error"?(a(`${I(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(N,{analytics:C,onLoad:P}),d.jsx(Q,{windowSize:g,children:d.jsx(W,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):d.jsx(Z,{})}const I=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},X=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{de as A,X as t};
9
+ `,W=M(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=R(e),a=t.roleMap!=null&&U(t.roleMap),r=i||c==="user_address"||G(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=V(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,n=F(r?.pathnameStackToGoBack);let s=n.poppedPathname??I();const u=r?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const r=X(a);e(q({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=E(),{addressId:s,addressType:u}=j(),g=$(),w=D(),x=L.getSignedInUser(),[f,v]=S.useState(s==null),p=B(b=>s!=null?k(b,s).fetchState:"Not-Started"),A=K();if(x==null)throw Error("Can't access address page without signing in...");const P=b=>b.trackPageLoaded(s!=null?m.Event.editAddress:m.Event.addAddress),y=l??u;return S.useEffect(()=>{f||s==null||(v(!0),r(O(s,!1)))},[f,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?d.jsx(J,{fetchState:p,style:{backgroundColor:w.colors.grey5}}):s!=null&&p==="Error"?(a(`${I(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(N,{analytics:C,onLoad:P}),d.jsx(Q,{windowSize:g,children:d.jsx(W,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):d.jsx(Z,{})}const I=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},X=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{de as A,X as t};
@@ -1,11 +1,11 @@
1
- import{j as h}from"./liveblocks-C3aHR2ug.js";import{a as r}from"./sentry-cQZrhfVh.js";import{h as oe,j as ne,u as ie,g as V,l as re,k as le}from"./core-j0LqCeu3.js";import{N as ce,cK as ue,z as de,Z as me,cL as pe,cM as fe,cN as he,cO as q,x as Se,c as U,R as j,cP as ge,cQ as Ce,f as be,a3 as ke,cR as we,U as Ie,s as Ee,p as $,aZ as Pe,cS as Te}from"./index-CFtYCyfm.js";import{fE as ye,f3 as W,eO as _e,hr as xe,PV as Ue,eN as ve,hB as Oe,hx as Qe,fu as Ae,fo as De,fh as Fe,fl as G,fp as Be,fq as Le,fr as Me,fs as Re,ft as Ne}from"./zeni-epic-state-DiQZjsue.js";import{D as Ve,n as v,P as je,S as $e}from"./mui-D78cc8iD.js";import{p as Ge}from"./pathToGoBack-Dzva26FJ.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.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]="b52d7bf4-b4fc-44cd-bcf6-6f37ea6ffbd4",s._sentryDebugIdIdentifier="sentry-dbid-b52d7bf4-b4fc-44cd-bcf6-6f37ea6ffbd4")}catch{}})();const z="chat-response-generated",qe=le(function(s,i){const a=W(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===z&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:E}=q(S,t);c!=="answer"?U.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(E,I),n.metadata.message_id??null):U.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Me(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Ne({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(G(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Be(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ge(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(G(""))},togglePageView:()=>{const e=$(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(Fe());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(De({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=V(u=>W(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=V(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),O=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,Q=!!C?.aiCfoShouldSubmit,[H,P]=r.useState(null),[K,T]=r.useState(!1),A=r.useRef(!1);r.useEffect(()=>{A.current||b==null||b===""||(P(b),T(Q),A.current=!0)},[b,Q]);const Y=r.useCallback(()=>{P(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,B=r.useRef(!1);r.useEffect(()=>{B.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),B.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(P(k),T(!0),a(Ue()))},[k,t,a]);const Z=c.masterTOSInfo,w=Z?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,M=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),N=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:X}=q(N,t),J=X.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(ve({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-encrypted-chat-${u}.${z}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Oe())},[_,x,a]),r.useEffect(()=>{t!=null&&M!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Qe(t,e.userId))},[M,R,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(ze,{children:[h.jsx(Se,{analytics:U,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),j(n)&&O.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:J,customPageTitle:S,currentTenant:c,emailLinkQuestion:H??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:Y,onMenuClick:j(n)?O.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,onUploadPromoClose:g}),h.jsx(Ve,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:He,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(We,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Ae(c.userRoleId)),f(!1)}})})})]})},We=v($e)`
1
+ import{j as h}from"./liveblocks-BqO7Df-p.js";import{a as r}from"./sentry-DS2EspaF.js";import{h as oe,j as ne,u as ie,g as V,l as re,k as le}from"./core-DxYppZiZ.js";import{R as ce,cK as ue,z as de,Z as me,cL as pe,cM as fe,cN as he,cO as q,x as Se,c as v,W as j,cP as ge,cQ as Ce,f as be,a3 as ke,cR as we,X as Ie,s as Ee,p as $,aZ as Pe,cS as Te}from"./index-DPw038da.js";import{fE as ye,f3 as W,eO as _e,hr as xe,PV as ve,eN as Ue,hB as Oe,hx as Qe,fu as Ae,fo as De,fh as Fe,fl as G,fp as Be,fq as Le,fr as Me,fs as Re,ft as Ne}from"./zeni-epic-state-CXLj5Oko.js";import{D as Ve,n as U,P as je,S as $e}from"./mui-DdrzQvkp.js";import{p as Ge}from"./pathToGoBack-D8OnmrBJ.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.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]="4cb0415c-a30d-4a9a-9fb8-aa3e3b64edd5",s._sentryDebugIdIdentifier="sentry-dbid-4cb0415c-a30d-4a9a-9fb8-aa3e3b64edd5")}catch{}})();const z="chat-response-generated",qe=le(function(s,i){const a=W(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===z&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(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,Me(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Ne({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(G(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Be(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ge(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(G(""))},togglePageView:()=>{const e=$(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(Fe());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(De({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=V(u=>W(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=V(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),O=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,Q=!!C?.aiCfoShouldSubmit,[H,P]=r.useState(null),[K,T]=r.useState(!1),A=r.useRef(!1);r.useEffect(()=>{A.current||b==null||b===""||(P(b),T(Q),A.current=!0)},[b,Q]);const X=r.useCallback(()=>{P(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,B=r.useRef(!1);r.useEffect(()=>{B.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),B.current=!0)},[F,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 Z=c.masterTOSInfo,w=Z?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,M=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),N=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:J}=q(N,t),Y=J.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:L.map(u=>`private-encrypted-chat-${u}.${z}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Oe())},[_,x,a]),r.useEffect(()=>{t!=null&&M!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Qe(t,e.userId))},[M,R,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(ze,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),j(n)&&O.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:Y,customPageTitle:S,currentTenant:c,emailLinkQuestion:H??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:X,onMenuClick:j(n)?O.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,onUploadPromoClose:g}),h.jsx(Ve,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:He,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(We,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Ae(c.userRoleId)),f(!1)}})})})]})},We=U($e)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,ze=v.div`
5
+ `,ze=U.div`
6
6
  height: 100vh;
7
7
  width: 100%;
8
- `,He=v(je)`
8
+ `,He=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-C3aHR2ug.js";import{a as f}from"./sentry-cQZrhfVh.js";import{j as B,u as U,h as j,g as v,N as $,k as T,l as O,n as F,o as h}from"./core-j0LqCeu3.js";import{eO as N,MF as A,Ml as b,x9 as w,x3 as L,x7 as x,wY as M,Mn as z,w$ as W,xb as q,xa as C}from"./zeni-epic-state-DiQZjsue.js";import{m as P,z as k,B as V,a3 as Y,bz as G,ac as _,bA as H}from"./index-CFtYCyfm.js";import"./mui-D78cc8iD.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-DHJfikzO.js";import K from"./NotFoundScreen-BeCKiN3K.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]="1cd09744-2523-4219-bff2-cc90f21ee651",e._sentryDebugIdIdentifier="sentry-dbid-1cd09744-2523-4219-bff2-cc90f21ee651")}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:n}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(z(!1))},onBackClick:()=>{_(n)?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(),[n,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),p=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),f.useEffect(()=>{n||p!=="Not-Started"||(a(!0),t(L(!0)))},[n,p,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${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,...y})},Z=T(function(e,o){const t=b(e),n=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=n==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:n}},function(e,o){const{navigate:t,approvalUpdateDataView:n,approverViewData:a,approvalRuleId:u}=o,s=n.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:p=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=y.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:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(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(q())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:n}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[p,c]=f.useState(!1);if(f.useEffect(()=>{p||(c(!0),o(W(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(n!=null?"../../":"../")},[d,n]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:n,approverViewData:d,location:t})}function se(){return l.jsxs(F,{children:[l.jsx(h,{path:"/",element:l.jsx(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-BqO7Df-p.js";import{a as y}from"./sentry-DS2EspaF.js";import{j as B,u as U,h as j,g as f,N as $,k as T,l as O,n as F,o as h}from"./core-DxYppZiZ.js";import{eO as N,MF as A,Ml as b,x9 as w,x3 as L,x7 as x,wY as M,Mn as z,w$ as W,xb as q,xa as C}from"./zeni-epic-state-CXLj5Oko.js";import{m as P,z as k,B as V,a3 as Y,bz as G,ac as _,bA as H}from"./index-DPw038da.js";import"./mui-DdrzQvkp.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-D47IilTw.js";import K from"./NotFoundScreen-Bn00COMT.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]="938536ab-ccac-4424-be12-7857793b062a",e._sentryDebugIdIdentifier="sentry-dbid-938536ab-ccac-4424-be12-7857793b062a")}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:n}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(z(!1))},onBackClick:()=>{_(n)?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(),[n,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),p=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>N(i)),r=f(i=>A(i)),g=f(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{n||p!=="Not-Started"||(a(!0),t(L(!0)))},[n,p,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const v={events:c.companyId!=null?[`private-encrypted-${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,...v})},Z=T(function(e,o){const t=b(e),n=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=n==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:n}},function(e,o){const{navigate:t,approvalUpdateDataView:n,approverViewData:a,approvalRuleId:u}=o,s=n.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:p=>{const c=r=>{const g=[];return r.forEach(v=>{const i=v.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=v.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:v.stepType.selectedOption,actors:m,operator:m.length>1?v.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(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(q())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:n}=O(),a=k.getSignedInUser(),u=P(),s=f(r=>b(r)),d=f(r=>A(r)),[p,c]=y.useState(!1);if(y.useEffect(()=>{p||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(n!=null?"../../":"../")},[d,n]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:n,approverViewData:d,location:t})}function se(){return l.jsxs(F,{children:[l.jsx(h,{path:"/",element:l.jsx(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-C3aHR2ug.js";import{j as K,h as se,u as X,l as ae,g as v,N as te,k as Y,i as na,n as ia,o as S}from"./core-j0LqCeu3.js";import{eO as Z,LX as Ue,bv as It,GS as oa,bo as wt,bE as pe,LY as xt,wt as Bt,xD as Ve,x0 as la,bn as De,LZ as sa,L_ as ra,c1 as ca,L$ as da,jr as Ct,M0 as At,M1 as Et,yc as _e,wI as Ce,M2 as ua,wh as tt,M3 as pa,Bo as ma,wl as ba,wr as Dt,M4 as ke,M5 as Ge,xE as Oe,M6 as ha,M7 as ga,xH as Ne,M8 as ya,xU as Sa,M9 as jt,xo as at,xt as fa,Ma as ka,Mb as ue,Mc as Tt,Md as Pt,Me as Ft,fI as va,wN as $e,cw as Rt,Mf as Ia,gD as wa,Mg as xa,Mh as Ba,eU as Mt,eS as Vt,Mi as ze,Mj as Ca,Mk as Aa,JG as Ze,Ml as Ea,JH as oe,JI as He,Mm as Da,Mn as ja,Mo as Ta,xv as nt,xs as Pa,Mp as Fa,Mq as Ra,Mr as Ma,xe as Va,Ms as $a,Mt as La,Mu as Ua,ck as $t,cM as Lt,jC as _a,bK as Ga,bq as Ut,bL as _t,vz as Oa,Mv as Na,Bb as za,Bh as Za,s6 as Ha,xF as Wa,yj as qa,jP as fe,Mw as Ja,Mx as Gt,kh as Ka,jJ as Ot,k2 as Nt,k1 as it,bD as be,bJ as Xa,My as Ya,Mz as ve,il as Qa,MA as ot,MB as en,iq as tn,iL as an,yx as nn,MC as on,ka as ln,yn as sn,MD as lt,yr as rn,yw as cn,yt as dn,yl as un,ME as zt,wC as pn,MF as mn,MG as bn,fA as hn,fz as gn,fy as yn,jS as Sn,k8 as st,kj as fn,pF as kn,j$ as vn,yp as In,iw as wn,ko as xn,MH as Bn,io as Cn,pw as An,MI as En,xk as Dn,bF as jn,bs as Tn,IC as Pn,cO as Fn,cN as Rn,cv as Mn,cB as Vn}from"./zeni-epic-state-DiQZjsue.js";import{m as me,z as M,I as Ie,C as le,$ as y,aK as Ae,B as re,d as A,x as je,c as D,b6 as $n,p as z,U as We,s as E,Z as we,b7 as rt,b8 as ct,b9 as Ln,ah as Un,F as _n,aE as Gn,A as Zt,D as qe,J as Je,ba as On,aq as Ht,bb as Nn,O as zn,f as Wt,a3 as Zn,bc as Hn,bd as Wn,be as qn,bf as Jn,bg as Kn,bh as Xn,bi as Yn,bj as Qn,bk as ei,H as ti,bl as ai,b2 as ni,bm as ii,bn as oi,a6 as li}from"./index-CFtYCyfm.js";import{n as L,S as si}from"./mui-D78cc8iD.js";import{A as dt}from"./AddressScreen-BAjnEp-X.js";import{g as ie,a as Te,i as qt,V as Ke,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-BcnlrXA2.js";import{a as f}from"./sentry-cQZrhfVh.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js";import{u as Jt}from"./useInitialThreadRequest-kL3BFKKo.js";import Ee from"./NotFoundScreen-BeCKiN3K.js";import{D as ui}from"./DrawerScreen-I-2xB5eA.js";import{M as Kt}from"./MobileAppDrawer-DeylJyoS.js";import{F as Xt}from"./FeaturePreviewScreen-BD0F_lti.js";import{S as Pe}from"./SetupPagesScreen-Cescu0d2.js";import{B as pi}from"./BillPayApprovalRoutes-CzGAg-RT.js";import{FallBackRoute as mi}from"./ScreenRoutes-Bdf3ftuj.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";import"./analyticsHelper-DUWn4fSe.js";import"./routePaths-D7CLql-E.js";import"./BusinessVerificationPageScreen-DxAzWOOG.js";import"./ReimbursementApprovalRuleDetailScreen-DHJfikzO.js";import"./getLocaleForTenant-BLNl-Ho3.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]="15341c26-429c-4f13-ab93-5cebd986d153",e._sentryDebugIdIdentifier="sentry-dbid-15341c26-429c-4f13-ab93-5cebd986d153")}catch{}})();const bi=Y(function(e,t){const l=Ue(e,t.billId),i=M.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})($n);function hi(){const e=K(),t=se(),l=X(),{billId:i}=ae(),c=me(),r=M.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});Qe({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:U}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=U(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:J}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,Q,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=M.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=M.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Ne(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=M.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,U]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const J=v(F=>Ue(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Q=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Oe(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(U(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(U(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Ne(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Q}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Ln,{}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Me,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-BqO7Df-p.js";import{j as K,h as se,u as X,l as ae,g as v,N as te,k as Y,i as na,n as ia,o as S}from"./core-DxYppZiZ.js";import{eO as Z,LX as Ue,bv as It,GS as oa,bo as wt,bE as pe,LY as xt,wt as Bt,xD as Ve,x0 as la,bn as De,LZ as sa,L_ as ra,c1 as ca,L$ as da,jr as Ct,M0 as At,M1 as Et,yc as _e,wI as Ce,M2 as ua,wh as tt,M3 as pa,Bo as ma,wl as ba,wr as Dt,M4 as ke,M5 as Ge,xE as Oe,M6 as ha,M7 as ga,xH as Ne,M8 as ya,xU as Sa,M9 as jt,xo as at,xt as fa,Ma as ka,Mb as ue,Mc as Tt,Md as Pt,Me as Ft,fI as va,wN as $e,cw as Rt,Mf as Ia,gD as wa,Mg as xa,Mh as Ba,eU as Mt,eS as Vt,Mi as ze,Mj as Ca,Mk as Aa,JG as Ze,Ml as Ea,JH as oe,JI as He,Mm as Da,Mn as ja,Mo as Ta,xv as nt,xs as Pa,Mp as Fa,Mq as Ra,Mr as Ma,xe as Va,Ms as $a,Mt as La,Mu as Ua,ck as $t,cM as Lt,jC as _a,bK as Ga,bq as Ut,bL as _t,vz as Oa,Mv as Na,Bb as za,Bh as Za,s6 as Ha,xF as Wa,yj as qa,jP as fe,Mw as Ja,Mx as Gt,kh as Ka,jJ as Ot,k2 as Nt,k1 as it,bD as be,bJ as Xa,My as Ya,Mz as ve,il as Qa,MA as ot,MB as en,iq as tn,iL as an,yx as nn,MC as on,ka as ln,yn as sn,MD as lt,yr as rn,yw as cn,yt as dn,yl as un,ME as zt,wC as pn,MF as mn,MG as bn,fA as hn,fz as gn,fy as yn,jS as Sn,k8 as st,kj as fn,pF as kn,j$ as vn,yp as In,iw as wn,ko as xn,MH as Bn,io as Cn,pw as An,MI as En,xk as Dn,bF as jn,bs as Tn,IC as Pn,cO as Fn,cN as Rn,cv as Mn,cB as Vn}from"./zeni-epic-state-CXLj5Oko.js";import{m as me,z as M,I as Ie,C as le,$ as y,aK as Ae,B as re,d as A,x as je,c as D,b6 as $n,p as z,X as We,s as E,Z as we,b7 as rt,b8 as ct,b9 as Ln,ah as Un,F as _n,aE as Gn,A as Zt,D as qe,J as Je,ba as On,aq as Ht,bb as Nn,U as zn,f as Wt,a3 as Zn,bc as Hn,bd as Wn,be as qn,bf as Jn,bg as Kn,bh as Xn,bi as Yn,bj as Qn,bk as ei,H as ti,bl as ai,b2 as ni,bm as ii,bn as oi,a6 as li}from"./index-DPw038da.js";import{n as L,S as si}from"./mui-DdrzQvkp.js";import{A as dt}from"./AddressScreen-Cdrj5W4-.js";import{g as ie,a as Te,i as qt,V as Ke,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-ZGxx9s_z.js";import{a as f}from"./sentry-DS2EspaF.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import{u as Jt}from"./useInitialThreadRequest-Wi13xyTC.js";import Ee from"./NotFoundScreen-Bn00COMT.js";import{D as ui}from"./DrawerScreen-CNcA0NWW.js";import{M as Kt}from"./MobileAppDrawer-DlNmDt_G.js";import{F as Xt}from"./FeaturePreviewScreen-Ck2p6Gja.js";import{S as Pe}from"./SetupPagesScreen-CIwH3ZZF.js";import{B as pi}from"./BillPayApprovalRoutes-CYVk-fEO.js";import{FallBackRoute as mi}from"./ScreenRoutes-BzreoX2P.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";import"./analyticsHelper-tcwBG-lH.js";import"./routePaths-CgcmkaKJ.js";import"./BusinessVerificationPageScreen-Cc1IIWeU.js";import"./ReimbursementApprovalRuleDetailScreen-D47IilTw.js";import"./getLocaleForTenant-ClNmnFx1.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]="90ac5f16-65c7-4555-bcd0-c7e6a06af480",e._sentryDebugIdIdentifier="sentry-dbid-90ac5f16-65c7-4555-bcd0-c7e6a06af480")}catch{}})();const bi=Y(function(e,t){const l=Ue(e,t.billId),i=M.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})($n);function hi(){const e=K(),t=se(),l=X(),{billId:i}=ae(),c=me(),r=M.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});Qe({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:U}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=U(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:J}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,Q,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=M.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=M.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Ne(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=M.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,U]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const J=v(F=>Ue(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Q=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Oe(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(U(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(U(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Ne(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Q}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Ln,{}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Me,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=L.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-C3aHR2ug.js";import{a as V}from"./sentry-cQZrhfVh.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-j0LqCeu3.js";import{I as ce,C as ue,aK as de,z as E,x as pe,c as M,ac as x,f as z,bv as le,aq as me,s as B,ar as R}from"./index-CFtYCyfm.js";import{Mt as fe,eO as G,rx as ye,GW as Se,xe as ge,zX as Ie,Cu as he,D7 as be,E0 as De,MQ as Oe,MR as Te,MS as ke,MT as Ce,MU as Ve,Jn as we,LS as Ae,Jz as Ne,k7 as _e,fA as Fe,fz as ve,fy as xe,pF as ze,pw as Ee,pt as Me,j$ as Be,rG as Re,rE as P,bD as L,rS as U,cu as Pe}from"./zeni-epic-state-DiQZjsue.js";import{n as Le}from"./mui-D78cc8iD.js";import{c as j}from"./routePaths-D7CLql-E.js";import{M as Ue}from"./MobileAppDrawer-DeylJyoS.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]="ca51904c-c2bd-4866-ba22-4d1763277930",e._sentryDebugIdIdentifier="sentry-dbid-ca51904c-c2bd-4866-ba22-4d1763277930")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-BqO7Df-p.js";import{a as V}from"./sentry-DS2EspaF.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-DxYppZiZ.js";import{I as ce,C as ue,aK as de,z as E,x as pe,c as M,ac as x,f as z,bv as le,aq as me,s as B,ar as R}from"./index-DPw038da.js";import{Mt as fe,eO as G,rx as ye,GW as Se,xe as ge,zX as Ie,Cu as be,D7 as he,E0 as De,MQ as Oe,MR as Te,MS as ke,MT as Ce,MU as Ve,Jn as we,LS as Ae,Jz as Ne,k7 as _e,fA as Fe,fz as ve,fy as xe,pF as ze,pw as Ee,pt as Me,j$ as Be,rG as Re,rE as P,bD as L,rS as U,cu as Pe}from"./zeni-epic-state-CXLj5Oko.js";import{n as Le}from"./mui-DdrzQvkp.js";import{c as j}from"./routePaths-CgcmkaKJ.js";import{M as Ue}from"./MobileAppDrawer-DlNmDt_G.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]="ee93df97-1eb4-41cc-99d1-69355cbfb0d8",e._sentryDebugIdIdentifier="sentry-dbid-ee93df97-1eb4-41cc-99d1-69355cbfb0d8")}catch{}})();const je=Le.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-C3aHR2ug.js";import{a as V}from"./sentry-cQZrhfV
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ae(e.companyConfigState),s=Ne(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:$,transactionVolume:J,transactionVolumeDescription:W,purposeOfAccount:Z,purposeOfAccountDescription:K,regulatedStatus:Q,regulatedStatusDescription:X,usNexus:H,usNexusTypes:Y}=t,F=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Pe(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:$,transactionVolume:J?.selectedOption??"",transactionVolumeDescription:W,purposeOfAccount:Z?.selectedOption??"",purposeOfAccountDescription:K,regulatedStatus:Q??"",regulatedStatusDescription:X,usNexus:H,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(U({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_}=p;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:O,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(P(i,t,r))},onSendForVerificationClick:t=>{e(P(i,t,r,!0))},onAddressClick:t=>{const s=j(b,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(b,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Be({files:t}))},onDeleteFile:t=>{e(Me(t))},onDeleteFileList:t=>{e(Ee(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(Fe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),He=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,b]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:O}=p(de.zeniAccountsConfig),T=fe(O),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??E.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(De(n,!0));break;case"zeni_treasury":r(be(n,!0));break;case"reimbursement":r(he(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{b(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=Oe(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(je,{children:[k.jsx(pe,{analytics:M,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:M,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{He as B};
9
+ `,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},h=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ae(e.companyConfigState),s=Ne(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:h,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:h}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:_,countriesOfOperations:b,companySourceOfFunds:q,companySourceOfFundsDescription:$,transactionVolume:J,transactionVolumeDescription:W,purposeOfAccount:Z,purposeOfAccountDescription:K,regulatedStatus:Q,regulatedStatusDescription:X,usNexus:H,usNexusTypes:Y}=t,F=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Pe(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:$,transactionVolume:J?.selectedOption??"",transactionVolumeDescription:W,purposeOfAccount:Z?.selectedOption??"",purposeOfAccountDescription:K,regulatedStatus:Q??"",regulatedStatusDescription:X,usNexus:H,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(U({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_}=p;let b;return f.selectDocumentType==="driverLicense"?b="driving_license":f.selectDocumentType==="passport"?b="passport":f.selectDocumentType==="stateId"?b="id_document":f.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:O,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:b,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(P(i,t,r))},onSendForVerificationClick:t=>{e(P(i,t,r,!0))},onAddressClick:t=>{const s=j(h,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(h,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Be({files:t}))},onDeleteFile:t=>{e(Me(t))},onDeleteFileList:t=>{e(Ee(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(Fe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),He=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,h]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:O}=p(de.zeniAccountsConfig),T=fe(O),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??E.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(De(n,!0));break;case"zeni_treasury":r(he(n,!0));break;case"reimbursement":r(be(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{h(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=Oe(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(je,{children:[k.jsx(pe,{analytics:M,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:M,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{He as B};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-C3aHR2ug.js";import{j as le,l as ia,h as ue,g as y,u as fe,k as pe,N as fa,q as ut,n as Wt,o as te}from"./core-j0LqCeu3.js";import{eO as ie,bs as Ue,Ok as ka,eS as be,eT as ye,eU as Se,fP as $e,cr as Ge,Ol as Ye,Om as Ma,sM as ba,jz as ya,On as Sa,gD as oa,ze as Je,zg as za,zh as $a,jp as mt,Oo as Ze,z2 as Ct,Op as qt,Oq as Qt,z5 as Da,Or as Xt,MN as _a,qY as pt,zb as Ga,gO as Jt,Os as ht,Ot as Ke,bq as en,Ou as an,fA as wa,fz as Pa,zL as tn,fy as Ta,Mt as nn,Ov as gt,ck as ft,cM as rn,MM as da,Al as sn,Ow as tt,zX as Fa,Ox as bt,Am as on,Nb as cn,An as dn,Bh as ln,s6 as un,Bb as mn,zw as yt,zp as Cn,Oy as pn,fR as hn,zF as St,zJ as It,fQ as gn,Oz as fn,A7 as At,OA as bn,OB as yn,OC as Sn,zH as Et,zs as kt,z8 as Dt,zB as _t,zz as wt,zD as In,zf as nt,OD as Pt,OE as va,zU as Ia,Js as Tt,cN as Ya,OF as An,OG as En,OH as kn,OI as Dn,zR as Na,Ae as _n,Aa as wn,zN as Pn,Ac as Tn,A2 as Fn,A4 as vn,OJ as Ft,Ak as vt,GS as xn,OK as On,OL as Bn,OM as Ln,ON as xt,OO as Un,AH as Rn,zW as Ot,zQ as ca,zV as jn,OP as Nn,OQ as Vn,y$ as Hn,OR as Bt,OS as Lt,OT as Mn,z1 as zn,z0 as rt,OU as $n,OV as Gn,OW as Yn,Jo as Zn,OX as Za,OY as Kn,vC as Ut,k7 as Wn,gE as qn,AM as Qn,OZ as Rt,O_ as Xn,AN as Jn,O$ as er,dd as ar,sG as tr,AC as nr,Aw as Le,bv as rr,bE as sr,cw as or,bF as cr,IC as ir}from"./zeni-epic-state-DiQZjsue.js";import{z as J,I as je,C as ce,$ as Y,B as la,bZ as xa,c8 as dr,p as ve,c9 as lr,ca as ur,Z as ua,aK as Fe,s as ge,bg as Ka,cb as mr,A as ma,i as Oa,m as Wa,c as Q,D as qa,cc as Cr,an as Qa,bs as Qe,cd as Va,ce as pr,x as Xa,a3 as hr,cf as gr,aq as jt,U as Ha,O as Nt,f as Vt,cg as fr,ch as br,ci as yr,cj as Sr,ck as Ir,cl as Ar,d as Aa,cm as Er,cn as kr,co as Ua,H as Dr,cp as _r,cq as wr,cr as Pr,cs as Tr,ct as Fr,a6 as vr}from"./index-CFtYCyfm.js";import{n as _e,D as Ht,S as xr}from"./mui-D78cc8iD.js";import{a as i}from"./sentry-cQZrhfVh.js";import{g as Ce,a as Ca,b as Mt,c as Ie,d as Ae,e as Re,f as Ne,A as Or,h as Ja,P as Br,i as et,s as Xe,j as zt,k as Me,l as $t,m as Lr,n as Gt,p as Ur,S as st}from"./SetupPagesScreen-Cescu0d2.js";import Ba from"./NotFoundScreen-BeCKiN3K.js";import{M as ze}from"./MobileAppDrawer-DeylJyoS.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import{c as Zt}from"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js";import{v as ot}from"./utils-BBuNXoTI.js";import{t as Rr}from"./AddressScreen-BAjnEp-X.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./analyticsHelper-DUWn4fSe.js";import"./routePaths-D7CLql-E.js";import"./BusinessVerificationPageScreen-DxAzWOOG.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]="b146e223-cc2b-4aad-87af-831ba60236cb",e._sentryDebugIdIdentifier="sentry-dbid-b146e223-cc2b-4aad-87af-831ba60236cb")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=J.getSignedInUser(),n=y(X=>ie(X)),C=je(),p=Ue(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Y.isChargeCardFeatureEnabled),g=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=u(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,f=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>$e(X,n.companyId)),N=Ge(v.controllers),{creditAccount:B,creditAccountRepayment:P}=y(X=>Ye(X)),V=y(X=>X.classListState.fetchState),m=!_&&d&&g,l=y(X=>Ma(X,t,m,d)),[w,T]=i.useState(!1),H=l.chargeCard,L=H?.cardCreatedByUser?.userId,K=y(X=>L!=null?ba(X.userRoleState,L):void 0),I=K?.accountingClassIDs[0],O=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,R=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=R?.accountingClassIDs[0],E=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),G=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&G&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,G,q]),i.useEffect(()=>{w||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,m,!1)))},[w,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(G===!1||G&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,c);e(X)}},[l.fetchState,c,G]),i.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&d&&g&&p&&a(za()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&d&&g&&p&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[B.fetchState,P.fetchState,a,d,g,p,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Re(d,f,D,g),ae=Ca(d,g,p,B,P),ne=Mt(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:f,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:g,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:B,classListFetchState:V,creditAccountRepayment:P,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ze(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=fe(),r=J.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ze(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(Ba,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},zr=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=fe(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[g,U]=i.useState(!1),F=J.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,f=y(E=>Qt(E,n)),d=f.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=v(Y.isDebitCardFeatureEnabled),P=Se(B,k),V=Ie({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:P}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),w=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Ae({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&L&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&f.fetchState==="Not-Started"&&(c(!0),a(Je(n,K,L)))},[o,f.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(f.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=ge(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:G}})}else if(_&&f.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=ge(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:G}})}}},[f.fetchState,d?.type.code,_,f.isRefreshingViewInBackground]);const O=J.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),R=()=>{d?.status?.code!=="active"&&a(Ga(n,!0))};i.useEffect(()=>{f.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(R,3e3),A(!0))},[f.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{U(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ze,{isAppContentDrawerOpen:g,handleDrawerToggle:W}),s.jsx($r,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:f,signedInUserToken:O,navigate:r,currentTenant:k,location:C,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:()=>{W(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Jt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ke(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:Oa.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(Pa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(wa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),Gr=_e.div`
1
+ import{j as s}from"./liveblocks-BqO7Df-p.js";import{j as le,l as ia,h as ue,g as y,u as fe,k as pe,N as fa,q as ut,n as Wt,o as te}from"./core-DxYppZiZ.js";import{eO as ie,bs as Ue,Ok as ka,eS as be,eT as ye,eU as Se,fP as $e,cr as Ge,Ol as Ye,Om as Ma,sM as ba,jz as ya,On as Sa,gD as oa,ze as Je,zg as za,zh as $a,jp as mt,Oo as Ze,z2 as Ct,Op as qt,Oq as Qt,z5 as Da,Or as Xt,MN as _a,qY as pt,zb as Ga,gO as Jt,Os as ht,Ot as Ke,bq as en,Ou as an,fA as wa,fz as Pa,zL as tn,fy as Ta,Mt as nn,Ov as gt,ck as ft,cM as rn,MM as da,Al as sn,Ow as tt,zX as Fa,Ox as bt,Am as on,Nb as cn,An as dn,Bh as ln,s6 as un,Bb as mn,zw as yt,zp as Cn,Oy as pn,fR as hn,zF as St,zJ as It,fQ as gn,Oz as fn,A7 as At,OA as bn,OB as yn,OC as Sn,zH as Et,zs as kt,z8 as Dt,zB as _t,zz as wt,zD as In,zf as nt,OD as Pt,OE as va,zU as Ia,Js as Tt,cN as Ya,OF as An,OG as En,OH as kn,OI as Dn,zR as Na,Ae as _n,Aa as wn,zN as Pn,Ac as Tn,A2 as Fn,A4 as vn,OJ as Ft,Ak as vt,GS as xn,OK as On,OL as Bn,OM as Ln,ON as xt,OO as Un,AH as Rn,zW as Ot,zQ as ca,zV as jn,OP as Nn,OQ as Vn,y$ as Hn,OR as Bt,OS as Lt,OT as Mn,z1 as zn,z0 as rt,OU as $n,OV as Gn,OW as Yn,Jo as Zn,OX as Za,OY as Kn,vC as Ut,k7 as Wn,gE as qn,AM as Qn,OZ as Rt,O_ as Xn,AN as Jn,O$ as er,dd as ar,sG as tr,AC as nr,Aw as Le,bv as rr,bE as sr,cw as or,bF as cr,IC as ir}from"./zeni-epic-state-CXLj5Oko.js";import{z as J,I as je,C as ce,$ as Y,B as la,bZ as xa,c8 as dr,p as ve,c9 as lr,ca as ur,Z as ua,aK as Fe,s as ge,bg as Ka,cb as mr,A as ma,i as Oa,m as Wa,c as Q,D as qa,cc as Cr,an as Qa,bs as Qe,cd as Va,ce as pr,x as Xa,a3 as hr,cf as gr,aq as jt,X as Ha,U as Nt,f as Vt,cg as fr,ch as br,ci as yr,cj as Sr,ck as Ir,cl as Ar,d as Aa,cm as Er,cn as kr,co as Ua,H as Dr,cp as _r,cq as wr,cr as Pr,cs as Tr,ct as Fr,a6 as vr}from"./index-DPw038da.js";import{n as _e,D as Ht,S as xr}from"./mui-DdrzQvkp.js";import{a as i}from"./sentry-DS2EspaF.js";import{g as Ce,a as Ca,b as Mt,c as Ie,d as Ae,e as Re,f as Ne,A as Or,h as Ja,P as Br,i as et,s as Xe,j as zt,k as Me,l as $t,m as Lr,n as Gt,p as Ur,S as st}from"./SetupPagesScreen-CIwH3ZZF.js";import Ba from"./NotFoundScreen-Bn00COMT.js";import{M as ze}from"./MobileAppDrawer-DlNmDt_G.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as Zt}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import{v as ot}from"./utils-B6prU8As.js";import{t as Rr}from"./AddressScreen-Cdrj5W4-.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./analyticsHelper-tcwBG-lH.js";import"./routePaths-CgcmkaKJ.js";import"./BusinessVerificationPageScreen-Cc1IIWeU.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]="5ea8b2d5-b2fd-4968-ae31-e35f1c7d3798",e._sentryDebugIdIdentifier="sentry-dbid-5ea8b2d5-b2fd-4968-ae31-e35f1c7d3798")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=J.getSignedInUser(),n=y(X=>ie(X)),C=je(),p=Ue(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Y.isChargeCardFeatureEnabled),g=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=u(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,f=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>$e(X,n.companyId)),N=Ge(v.controllers),{creditAccount:B,creditAccountRepayment:P}=y(X=>Ye(X)),V=y(X=>X.classListState.fetchState),m=!_&&d&&g,l=y(X=>Ma(X,t,m,d)),[w,T]=i.useState(!1),H=l.chargeCard,L=H?.cardCreatedByUser?.userId,K=y(X=>L!=null?ba(X.userRoleState,L):void 0),I=K?.accountingClassIDs[0],O=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,R=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=R?.accountingClassIDs[0],E=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),G=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&G&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,G,q]),i.useEffect(()=>{w||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,m,!1)))},[w,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(G===!1||G&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,c);e(X)}},[l.fetchState,c,G]),i.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&d&&g&&p&&a(za()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&d&&g&&p&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[B.fetchState,P.fetchState,a,d,g,p,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Re(d,f,D,g),ae=Ca(d,g,p,B,P),ne=Mt(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:f,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:g,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:B,classListFetchState:V,creditAccountRepayment:P,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ze(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=fe(),r=J.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ze(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(Ba,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},zr=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=fe(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[g,U]=i.useState(!1),F=J.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,f=y(E=>Qt(E,n)),d=f.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=v(Y.isDebitCardFeatureEnabled),P=Se(B,k),V=Ie({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:P}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),w=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Ae({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&L&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&f.fetchState==="Not-Started"&&(c(!0),a(Je(n,K,L)))},[o,f.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(f.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=ge(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:G}})}else if(_&&f.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=ge(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:G}})}}},[f.fetchState,d?.type.code,_,f.isRefreshingViewInBackground]);const O=J.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),R=()=>{d?.status?.code!=="active"&&a(Ga(n,!0))};i.useEffect(()=>{f.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(R,3e3),A(!0))},[f.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{U(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ze,{isAppContentDrawerOpen:g,handleDrawerToggle:W}),s.jsx($r,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:f,signedInUserToken:O,navigate:r,currentTenant:k,location:C,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:()=>{W(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Jt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ke(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:Oa.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(Pa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(wa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),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-C3aHR2ug.js";import{a as g}from"./sentry-cQZrhfVh.js";import{j as w,h as x,u as T,l as k,g as O,k as E}from"./core-j0LqCeu3.js";import{z as D,b2 as F,x as P,c as L,f as V,ac as b,b3 as j,aq as A,ar as U,s as B}from"./index-CFtYCyfm.js";import{eO as C,fC as M,rx as _,fx as G,c1 as R,LS as z,bn as Y,pF as $,pt as q,j$ as H,lv as S,LT as Z,bD as J,cu as N,lD as K,lG as Q}from"./zeni-epic-state-DiQZjsue.js";import"./mui-D78cc8iD.js";import{c as W}from"./routePaths-D7CLql-E.js";import{M as X}from"./MobileAppDrawer-DeylJyoS.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="34454882-b7a0-4b2d-9dd0-db12a1a94d2a",n._sentryDebugIdIdentifier="sentry-dbid-34454882-b7a0-4b2d-9dd0-db12a1a94d2a")}catch{}})();const ee=E(function(n){const t=G(n),i=D.getSignedInUser(),l=C(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const a=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.companySubIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(Z(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n(H({files:e}))},onDeleteFile:e=>{n(q(e))},onEditFileName:(e,a)=>{n($(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=x(),i=T(),{tenantEmailDomain:l}=k(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>C(s)),d=r.companyId??D.getSignedInUserTenant(l)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(M(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(F,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-BqO7Df-p.js";import{a as g}from"./sentry-DS2EspaF.js";import{j as w,h as x,u as T,l as k,g as O,k as E}from"./core-DxYppZiZ.js";import{z as D,b2 as F,x as P,c as L,f as V,ac as b,b3 as j,aq as A,ar as U,s as B}from"./index-DPw038da.js";import{eO as C,fC as M,rx as _,fx as G,c1 as R,LS as z,bn as Y,pF as $,pt as q,j$ as H,lv as S,LT as Z,bD as J,cu as N,lD as K,lG as Q}from"./zeni-epic-state-CXLj5Oko.js";import"./mui-DdrzQvkp.js";import{c as W}from"./routePaths-CgcmkaKJ.js";import{M as X}from"./MobileAppDrawer-DlNmDt_G.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="ed7754fb-0071-416b-aa0a-2183e77631c6",n._sentryDebugIdIdentifier="sentry-dbid-ed7754fb-0071-416b-aa0a-2183e77631c6")}catch{}})();const ee=E(function(n){const t=G(n),i=D.getSignedInUser(),l=C(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const a=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.companySubIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(Z(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n(H({files:e}))},onDeleteFile:e=>{n(q(e))},onEditFileName:(e,a)=>{n($(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=x(),i=T(),{tenantEmailDomain:l}=k(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>C(s)),d=r.companyId??D.getSignedInUserTenant(l)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(M(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(F,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-C3aHR2ug.js";import{a}from"./sentry-cQZrhfVh.js";import{h as D,u as v,g as u,N as w}from"./core-j0LqCeu3.js";import{Iy as O,eO as A,fj as j,mm as L,fL as h,fi as U,eP as _,IF as F}from"./zeni-epic-state-DiQZjsue.js";import{u as $,z as c,L as g,D as k,d as H}from"./index-CFtYCyfm.js";import{n as P}from"./mui-D78cc8iD.js";import{t as z}from"./getLocaleForTenant-BLNl-Ho3.js";import{g as R,Q as G}from"./QBOConnectionScreen-CxOACLF0.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";import"./empty-CK9odIeO.js";import"./pdf-lib-bl9YSMz9.js";import"./index-BX6ANtNh.js";import"./url-Oh4YprMm.js";import"./index-B2tWZgTJ.js";import"./decodeURIComponentSafe-DFYfbcv3.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]="0018c586-b933-41f9-89d3-cb8f563044bc",t._sentryDebugIdIdentifier="sentry-dbid-0018c586-b933-41f9-89d3-cb8f563044bc")}catch{}})();const Q=P.div`
1
+ import{j as C}from"./liveblocks-BqO7Df-p.js";import{a}from"./sentry-DS2EspaF.js";import{h as D,u as v,g as u,N as w}from"./core-DxYppZiZ.js";import{Iy as O,eO as A,fj as j,mm as L,fL as h,fi as U,eP as _,IF as F}from"./zeni-epic-state-CXLj5Oko.js";import{u as $,z as p,L as g,D as k,d as H}from"./index-DPw038da.js";import{n as P}from"./mui-DdrzQvkp.js";import{t as z}from"./getLocaleForTenant-ClNmnFx1.js";import{g as R,Q as G}from"./QBOConnectionScreen-Ik56pHVf.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";import"./empty-DULS5Nrn.js";import"./pdf-lib-CHquFnr8.js";import"./index-GW-ogFZi.js";import"./url--J2koNP1.js";import"./index-dNGgc_CZ.js";import"./decodeURIComponentSafe-B26owMY4.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]="564ddb9a-be40-4663-bd95-1f7215e73359",t._sentryDebugIdIdentifier="sentry-dbid-564ddb9a-be40-4663-bd95-1f7215e73359")}catch{}})();const Q=P.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -8,4 +8,4 @@ import{j as C}from"./liveblocks-C3aHR2ug.js";import{a}from"./sentry-cQZrhfVh.js"
8
8
  height: 100vh;
9
9
  background-color: ${t=>t.theme.colors.background};
10
10
  box-shadow: ${t=>`0px 2px ${H.sp1} ${t.theme.colors.dropShadowNormal}`};
11
- `;function fe(){const t=D(),i=v(),{setLoading:d,clearAllLoading:b}=$(),f=a.useRef(!1),p=a.useRef(!1),{code:x,realmId:y,state:T}=R(i.search),N=x!==""&&y!==""&&T!=="",I=u(l=>O(l)),e=u(l=>A(l)),n=u(l=>l.tenantState.fetchState),r=u(l=>l.tenantState.activeTenantFetchState.fetchState),o=c.getSignedInUser(),m=c.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{d(g.CONNECTION_AUTH)},[d]),a.useEffect(()=>{f.current||o==null||m==null||(f.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(g.TENANT_FETCHING),t(j(o.userId,m))))},[f,n,d]),a.useEffect(()=>{e.tenantId==null&&!p.current&&o!=null&&(p.current=!0,!(m==null||m!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(L(o.userId)))},[p,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(d(g.CONNECTION_AUTH),t(h(o.userId,e.tenantId)))},[E]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(U(e.tenantId)),c.saveActiveTenantDomainForUser(e.tenantEmailDomain),_(o?.userId,o?.zeniSessionId,e.tenantId),k.updateAppLocaleID(z(F(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(h(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&c.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||b()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:N||S===!1?C.jsx(Q,{children:C.jsx(G,{})}):C.jsx(w,{to:"/",replace:!0})}export{fe as default};
11
+ `;function fe(){const t=D(),i=v(),{setLoading:d,clearAllLoading:b}=$(),f=a.useRef(!1),c=a.useRef(!1),{code:x,realmId:y,state:T}=R(i.search),N=x!==""&&y!==""&&T!=="",I=u(l=>O(l)),e=u(l=>A(l)),n=u(l=>l.tenantState.fetchState),r=u(l=>l.tenantState.activeTenantFetchState.fetchState),o=p.getSignedInUser(),m=p.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{d(g.CONNECTION_AUTH)},[d]),a.useEffect(()=>{f.current||o==null||m==null||(f.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(g.TENANT_FETCHING),t(j(o.userId,m))))},[f,n,d]),a.useEffect(()=>{e.tenantId==null&&!c.current&&o!=null&&(c.current=!0,!(m==null||m!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(L(o.userId)))},[c,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(d(g.CONNECTION_AUTH),t(h(o.userId,e.tenantId)))},[E]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(U(e.tenantId)),p.saveActiveTenantDomainForUser(e.tenantEmailDomain),_(o?.userId,o?.zeniSessionId,e.tenantId),k.updateAppLocaleID(z(F(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(h(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&p.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||b()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:N||S===!1?C.jsx(Q,{children:C.jsx(G,{})}):C.jsx(w,{to:"/",replace:!0})}export{fe as default};
@@ -0,0 +1 @@
1
+ import{j as i}from"./liveblocks-BqO7Df-p.js";import{z as m}from"./index-DPw038da.js";import{g as n}from"./QBOConnectionScreen-Ik56pHVf.js";import"./sentry-DS2EspaF.js";import{u as p,N as s}from"./core-DxYppZiZ.js";import"./zeni-epic-state-CXLj5Oko.js";import"./recharts-BucGjD65.js";import"./mui-DdrzQvkp.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";import"./empty-DULS5Nrn.js";import"./pdf-lib-CHquFnr8.js";import"./index-GW-ogFZi.js";import"./url--J2koNP1.js";import"./index-dNGgc_CZ.js";import"./decodeURIComponentSafe-B26owMY4.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]="9b06c105-de24-4a38-a62b-e92ff6d04824",t._sentryDebugIdIdentifier="sentry-dbid-9b06c105-de24-4a38-a62b-e92ff6d04824")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),a=m.getSignedInUser()?.userId??"";if(f(o,r,e,a)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:d})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,8 +1,8 @@
1
- import{j as a}from"./liveblocks-C3aHR2ug.js";import{t as $e,A as Ce}from"./AddressScreen-BAjnEp-X.js";import ze from"./NotFoundScreen-BeCKiN3K.js";import{a as g}from"./sentry-cQZrhfVh.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as qe,o as M}from"./core-j0LqCeu3.js";import{H as de,I as le,z as B,C as ue,m as Je,$ as _,s as V,x as H,c as N,B as we,f as Y,am as Ke,Z as Qe,an as Ie,i as te,ao as Ze,ap as ke,d as He,aq as We,ar as xe,as as Ye}from"./index-CFtYCyfm.js";import{bn as Xe,eO as ee,fb as et,eU as pe,eS as me,bv as tt,mk as at,f7 as nt,bN as ot,j3 as ae,j6 as ve,Jl as st,bS as it,c1 as ge,rL as fe,rw as rt,Jx as X,rM as _e,GW as ct,k7 as Ue,Jy as Ve,Jz as dt,JA as lt,JB as ut,j1 as pt,j4 as mt,ry as Be,rK as gt,bD as Te,cu as ft,rY as Ee,pF as ht,pt as yt,j$ as St,fA as bt,fz as Ct,fy as It,JC as kt,rq as xt,rZ as Tt,s0 as Et,s3 as Ot,s9 as At,cT as Pt}from"./zeni-epic-state-DiQZjsue.js";import{n as he}from"./mui-D78cc8iD.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-CxOACLF0.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";import"./empty-CK9odIeO.js";import"./pdf-lib-bl9YSMz9.js";import"./index-BX6ANtNh.js";import"./url-Oh4YprMm.js";import"./index-B2tWZgTJ.js";import"./decodeURIComponentSafe-DFYfbcv3.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]="2e33eff7-37ad-481b-a2bd-63e4df06ae49",t._sentryDebugIdIdentifier="sentry-dbid-2e33eff7-37ad-481b-a2bd-63e4df06ae49")}catch{}})();const jt=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"}})}}})(Ke),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),k=Je(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:E}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),G=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),A=me(c),P=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=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,J=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&P.push("top_expenses"),z===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),J===!1&&P.push("reimbursement_card","reimbursement_promo_card"),I===!1&&P.push("zeni_accounts_promo_card"),h===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||A||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,P)))},[d,O,w,A,i,c.tenantId,s]),g.useEffect(()=>{(w||A)&&setTimeout(()=>{S(!0)},5e3)},[w,A]),O!=="Completed")return a.jsx(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(x,{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=>(Q=>Q.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:E,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-BqO7Df-p.js";import{t as $e,A as Ce}from"./AddressScreen-Cdrj5W4-.js";import ze from"./NotFoundScreen-Bn00COMT.js";import{a as g}from"./sentry-DS2EspaF.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as qe,o as M}from"./core-DxYppZiZ.js";import{H as de,I as le,z as B,C as ue,m as Je,$ as _,s as V,x as H,c as N,B as we,f as Y,am as Ke,Z as Qe,an as Ie,i as te,ao as Ze,ap as ke,d as He,aq as We,ar as xe,as as Ye}from"./index-DPw038da.js";import{bn as Xe,eO as ee,fb as et,eU as pe,eS as me,bv as tt,mk as at,f7 as nt,bN as ot,j3 as ae,j6 as ve,J0 as st,bS as it,c1 as ge,rL as he,rw as rt,Jx as X,rM as _e,GW as ct,k7 as Ue,Jy as Ve,Jz as dt,JA as lt,JB as ut,j1 as pt,j4 as mt,ry as Be,rK as gt,bD as Te,cu as ht,rY as Ee,pF as ft,pt as yt,j$ as bt,fA as St,fz as Ct,fy as It,JC as kt,rq as xt,rZ as Tt,s0 as Et,s3 as Ot,s9 as At,cT as Pt}from"./zeni-epic-state-CXLj5Oko.js";import{n as fe}from"./mui-DdrzQvkp.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-Ik56pHVf.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";import"./empty-DULS5Nrn.js";import"./pdf-lib-CHquFnr8.js";import"./index-GW-ogFZi.js";import"./url--J2koNP1.js";import"./index-dNGgc_CZ.js";import"./decodeURIComponentSafe-B26owMY4.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]="5443579e-7737-4ec9-a9ae-89b61f18aabb",t._sentryDebugIdIdentifier="sentry-dbid-5443579e-7737-4ec9-a9ae-89b61f18aabb")}catch{}})();const jt=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"}})}}})(Ke),wt=()=>{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(),h=Xe(i),{useFeatureGate:m}=ue(),k=Je(),{isFeatureEnabled:T}=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),j=c.company!=null&&et(c.company),G=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),A=me(c),P=[],K=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=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,J=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&P.push("top_expenses"),z===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),J===!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||w||A||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,P)))},[d,O,w,A,i,c.tenantId,s]),g.useEffect(()=>{(w||A)&&setTimeout(()=>{b(!0)},5e3)},[w,A]),O!=="Completed")return a.jsx(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(x,{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=>(Q=>Q.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:E,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{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;
@@ -16,8 +16,8 @@ import{j as a}from"./liveblocks-C3aHR2ug.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(),S=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:S??""},n=ee(t),i=fe(t,s),f=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",k=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:k.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint: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: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(Tt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(xt(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:k,email:T,ssn:E,nationalityCountryCode:I,dob:h,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,isPhoneVerified:O}=i;let b;return F.selectDocumentType==="driverLicense"?b="driving_license":F.selectDocumentType==="passport"?b="passport":F.selectDocumentType==="stateId"?b="id_document":F.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:f,userId:m,firstName:k.firstName,lastName:k.lastName,email:T,ssn:E,nationalityCountryCode:I?.selectedOption!=null?xe(I.selectedOption):void 0,phone:U,birthday:h!=null?Te(h?.toString()):h,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,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(ht(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:f,companyLegalName:m,companyTaxId:k,companyWebsite:T,companyPhone:E,primaryContactEmail:I,primaryContactName:h,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:G,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:R,purposeOfAccount:w,purposeOfAccountDescription:A,regulatedStatus:P,regulatedStatusDescription:K,transactionVolume:z,transactionVolumeDescription:q,usNexus:v,usNexusTypes:J}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:f?.selectedOption??"",companyLegalName:m,taxIdOrEIN:k,website:T!=""&&T!=null?ft(T):void 0,phone:E,syncToken:F,fileIds:$,incDate:j!=null?Te(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:R?.selectedOptions.map(Z=>Z.length===2?Z:xe(Z))??[],purposeOfAccount:w?.selectedOption??"",purposeOfAccountDescription:A,regulatedStatus:P??"",regulatedStatusDescription:K,transactionVolume:z?.selectedOption??"",transactionVolumeDescription:q,usNexus:v,usNexusTypes:J?.selectedOptions??[]},Q={userId:U,firstName:h.firstName,lastName:h.lastName,email:I,syncToken:C};t(Ee({companyDetails:l,primaryContactDetails:Q}))},onAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onRegisteredAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(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=Qe(),S=de(),[e,n]=g.useState(!1),[i,f]=g.useState(!1),[m,k]=g.useState(!1),{tenantEmailDomain:T}=re(),E=le(),{useFeatureGate:I}=ue(),{isFeatureEnabled:h}=I(_.isDebitCardFeatureEnabled),U=Me("/: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),j=D(y=>y.cardPaymentViewState),G=Ie(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:b,realmId:R,state:w}=Dt(d.search),A=c.externalConnections?.accounting[0],P=A?.connectionType,K=A?.connectionName,z=A?.connectionId??"",q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(f(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),k(!0))},[m]),g.useEffect(()=>{G==="In-Progress"&&O==="Completed"&&r(ae())},[G,O]),g.useEffect(()=>{Ft(b,R,w,z,q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:P??"accounting",connection_name:K??"quickbooks_online",authorization_code:b,realm_id:R,connection_id:z,user_id:q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(R,z),u(d.pathname))},[b,R,w,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(T)?.companyId,J=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 Q=Ie(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Q==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),Ge=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,Se=y=>y.trackPageLoaded(Y.Event.onboardingPage),be=c.productSettings.isOtherProductsEnabled,Re=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Re?a.jsx(x,{to:"../../treasury"}):Le?a.jsx(x,{to:"../../checking"}):Ge?a.jsx(x,{to:"../../cards"}):a.jsx(x,{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:J,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{windowSize:p,children:s}):null]}):a.jsx(x,{to:"../../onboarding/thankyou"})}else if(ye===!1&&E?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(x,{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:J,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=he.div`
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=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: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(Tt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(xt(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:T,ssn:E,nationalityCountryCode:I,dob:f,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,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:h,userId:m,firstName:k.firstName,lastName:k.lastName,email:T,ssn:E,nationalityCountryCode:I?.selectedOption!=null?xe(I.selectedOption):void 0,phone:U,birthday:f!=null?Te(f?.toString()):f,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:S,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,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(St(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(bt({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:k,companyWebsite:T,companyPhone:E,primaryContactEmail:I,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:G,companySourceOfFundsDescription:O,companySubIndustry:S,countriesOfOperations:R,purposeOfAccount:w,purposeOfAccountDescription:A,regulatedStatus:P,regulatedStatusDescription:K,transactionVolume:z,transactionVolumeDescription:q,usNexus:v,usNexusTypes:J}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:k,website:T!=""&&T!=null?ht(T):void 0,phone:E,syncToken:F,fileIds:$,incDate:j!=null?Te(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:S?.selectedOption??"",countriesOfOperations:R?.selectedOptions.map(Z=>Z.length===2?Z:xe(Z))??[],purposeOfAccount:w?.selectedOption??"",purposeOfAccountDescription:A,regulatedStatus:P??"",regulatedStatusDescription:K,transactionVolume:z?.selectedOption??"",transactionVolumeDescription:q,usNexus:v,usNexusTypes:J?.selectedOptions??[]},Q={userId:U,firstName:f.firstName,lastName:f.lastName,email:I,syncToken:C};t(Ee({companyDetails:l,primaryContactDetails:Q}))},onAddressClick:(e,n)=>{const i=De(b,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=De(b,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(`/${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=Qe(),b=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,k]=g.useState(!1),{tenantEmailDomain:T}=re(),E=le(),{useFeatureGate:I}=ue(),{isFeatureEnabled:f}=I(_.isDebitCardFeatureEnabled),U=Me("/: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),j=D(y=>y.cardPaymentViewState),G=Ie(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:S,realmId:R,state:w}=Dt(d.search),A=c.externalConnections?.accounting[0],P=A?.connectionType,K=A?.connectionName,z=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(()=>{G==="In-Progress"&&O==="Completed"&&r(ae())},[G,O]),g.useEffect(()=>{Ft(S,R,w,z,q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:P??"accounting",connection_name:K??"quickbooks_online",authorization_code:S,realm_id:R,connection_id:z,user_id:q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(R,z),u(d.pathname))},[S,R,w,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(T)?.companyId,J=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 Q=Ie(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Q==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),Ge=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,be=y=>y.trackPageLoaded(Y.Event.onboardingPage),Se=c.productSettings.isOtherProductsEnabled,Re=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!Se)return Re?a.jsx(x,{to:"../../treasury"}):Le?a.jsx(x,{to:"../../checking"}):Ge?a.jsx(x,{to:"../../cards"}):a.jsx(x,{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:J,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{windowSize:p,children:s}):null]}):a.jsx(x,{to:"../../onboarding/thankyou"})}else if(ye===!1&&E?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(x,{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:J,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=fe.div`
20
20
  display: flex;
21
21
  height: 100vh;
22
22
  background-color: ${t=>t.theme.colors.grey4};
23
- `,je=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=fe(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(Ye),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),S=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(h=>ee(h)),f=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!f))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const k=pe(r,i),T=me(i),E=D(h=>h.onboardingCustomerViewState.updateStatus.fetchState),I=i.company?.companyOnboardingInfo.isOnboardingCompleted;return I!==!0||f?E==="Completed"&&I===!0&&f&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:h=>{h.trackPageLoaded(Y.Event.onboardingLandingPage,"Onboarding",Pt(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:f,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:h=>{h.trackPageLoaded(Y.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:E}):k?a.jsx(x,{to:"../../checking"}):T?a.jsx(x,{to:"../../cards"}):a.jsx(x,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{children:[a.jsx(M,{path:"/",element:a.jsx(W,{})}),a.jsx(M,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(M,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(M,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(M,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"*",element:a.jsx(ze,{})})]})}export{oa as default};
23
+ `,je=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 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(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(b.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const k=pe(r,i),T=me(i),E=D(f=>f.onboardingCustomerViewState.updateStatus.fetchState),I=i.company?.companyOnboardingInfo.isOnboardingCompleted;return I!==!0||h?E==="Completed"&&I===!0&&h&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingLandingPage,"Onboarding",Pt(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):E==="Completed"&&I===!1&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:E}):k?a.jsx(x,{to:"../../checking"}):T?a.jsx(x,{to:"../../cards"}):a.jsx(x,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{children:[a.jsx(M,{path:"/",element:a.jsx(W,{})}),a.jsx(M,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(M,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(M,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(M,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"*",element:a.jsx(ze,{})})]})}export{oa as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-C3aHR2ug.js";import{l as $,g as S,u as K,h as V,j as q,k as H,s as Ka,n as at,o as w}from"./core-j0LqCeu3.js";import{eO as L,JS as Me,bD as Yt,bq as ue,L3 as qa,hT as Za,L4 as xt,L5 as Ha,hW as nt,L6 as Re,L7 as Ja,h$ as Qa,L8 as Tt,L9 as Wa,i3 as ot,La as Le,Lb as Xa,ck as rt,Lc as en,Ld as tn,Ka as an,iZ as nn,Le as on,bn as Ae,Lf as Gt,JG as ee,bc as Nt,jb as Vt,mu as $t,iW as zt,JI as te,JH as Z,f3 as sn,fl as rn,Lg as cn,Lh as ln,Li as Kt,Lj as be,tB as ve,tC as Ie,tZ as me,tT as ae,tG as Ee,Lk as dn,Ll as un,Lm as mn,Ln as qt,Lo as Ce,Lp as pn,dC as Ue,qd as Zt,Lq as hn,Lr as fn,Ls as gn,Lt as it,J2 as ct,jr as pe,u5 as lt,ql as bn,Lu as Cn,tD as wt,qg as le,qc as Ht,Lv as se,Lw as _n,Lx as dt,J0 as ut,sd as Jt,Ly as kn,Lz as Sn,LA as yn,LB as mt,sq as An,LC as vn,tF as Dt,sc as Qt,LD as re,LE as In,bv as Wt,u9 as Xt,LF as En,LG as xn,LH as Tn,LI as pt,u4 as wn,LJ as Dn,tE as Ft,u8 as ea,LK as ie,LL as Fn,LM as On,LN as ta,jg as aa,mr as na,jl as oa,mp as sa,mo as ra,mn as ia,rB as Pn,fb as Bn,cN as Rn,cO as Ln,mk as jn,f7 as Mn,mB as Un,Dd as Ot,LO as Yn,LP as Gn,LQ as Nn,LR as Vn,b5 as ht,e_ as $n,gB as zn,fC as Kn,mv as qn,iP as Zn,ms as Hn,mq as Jn,eU as Qn,eS as Wn}from"./zeni-epic-state-DiQZjsue.js";import{z as R,U as J,s as D,c as I,D as z,aR as Xn,x as xe,aS as ca,f as G,aT as eo,I as Te,aU as la,C as Ye,$ as j,m as to,aV as ao,aW as no,N as da,Z as oo,a as ua,a1 as so,aX as ro,aK as ma,aY as io,aZ as co,R as lo,a_ as uo,a$ as mo,an as po,p as ho,O as fo,b0 as go,b1 as ke}from"./index-CFtYCyfm.js";import{n as ft}from"./mui-D78cc8iD.js";import{a as b}from"./sentry-cQZrhfVh.js";import{w as pa}from"./withTransactionSidePanel-BbFtF7db.js";import{b as ha,t as he,e as ne,a as gt,v as bo}from"./routePaths-D7CLql-E.js";import{u as Q}from"./useAskAiCfoHostNavButtonProps-CLV01Vra.js";import{c as we,b as Co}from"./useFetchSuggestedQuestionsWhenReady-DhRQQ_dO.js";import ye from"./NotFoundScreen-BeCKiN3K.js";import{t as fa}from"./analyticsHelper-DUWn4fSe.js";import{C as _o}from"./CompanyPassportScreen-QZ_mGMd4.js";import{F as ko}from"./FeaturePreviewScreen-BD0F_lti.js";import{R as So}from"./ReferralListScreen-C4TUE7u-.js";import"./recharts-B0MOj05b.js";import"./analytics-DQCQhWLc.js";import"./plaid-DsDYZOgp.js";import"./dnd-DAo38rm8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CAFVLjo0.js";import"./lexical-D-QBA09y.js";import"./pdf-C20YOa73.js";import"./utils-BBuNXoTI.js";import"./TransactionDetailScreen-BS1m1uHz.js";import"./decodeURIComponentSafe-DFYfbcv3.js";import"./MobileAppDrawer-DeylJyoS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="4cea964b-2eb3-4a45-84b9-548437e072e1",e._sentryDebugIdIdentifier="sentry-dbid-4cea964b-2eb3-4a45-84b9-548437e072e1")}catch{}})();const yo=pa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(x=>x.tenantState.currentTenantId),d=S(x=>L(x)),{tenantEmailDomain:p}=$(),C=K(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=b.useMemo(()=>r!=null?Yt(r):ue(),[r]),h=V(),f=q(),k=S(x=>qa(x,m,o)),y=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),A=b.useCallback((x,P)=>{h(xt({sortKey:x,sortOrder:P}))},[]),E=b.useCallback(x=>{h(xt({downloadState:x}))},[]),M=b.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(p!=null){const P=ha({id:x.transactionId,type:x.transactionType},p);f(P);const fe=D(C.state?.pathnameStackToGoBack,C.pathname);f(P,{state:{pathnameStackToGoBack:fe}})}},[p,e]),F=b.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(Xn,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:M,onReload:y,onBackClick:_,onColumnSortConfigChanged:A,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ao=()=>{const e=V(),a=q(),t=S(A=>Ha(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AP Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>L(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},C=b.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),g=t.apAgingUIState.selectedDate??ue(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(nt(g))},[]);b.useEffect(()=>{u()},[]);const c=b.useCallback(()=>{a("../",{relative:"path"})},[]),m=b.useCallback(A=>{e(Re({searchString:A}))},[]),h=b.useCallback((A,E)=>{e(Re({sortKey:E,sortOrder:A}))},[]),f=b.useCallback(A=>{a(`./${A}/${g.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=b.useCallback(A=>{e(Re({downloadState:A}))},[]),y=b.useCallback((A,E)=>{},[]),_=b.useCallback((A,E)=>{e(Re({selectedDate:A,agingDateSelectionType:E})),e(nt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:A=>A.trackPageLoaded(G.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:t.apAgingUIState,report:t,downloadParams:C,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:_,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},vo=pa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(F=>L(F)),{tenantEmailDomain:d}=$(),p=K(),C=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:g,companyName:C,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=b.useMemo(()=>r!=null?Yt(r):ue(),[r]),m=V(),h=q(),f=S(F=>Ja(F,c,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Qa(o,c))},[c]),y=b.useCallback(()=>{h("../../",{relative:"path"})},[]),_=b.useCallback((F,x)=>{m(Tt({sortKey:F,sortOrder:x}))},[]),A=b.useCallback(F=>{m(Tt({downloadState:F}))},[]),E=b.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const x=ha({id:F.transactionId,type:F.transactionType},d);h(x);const P=D(p.state?.pathnameStackToGoBack,p.pathname);h(x,{state:{pathnameStackToGoBack:P}})}},[d,e]),M=b.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(eo,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:E,onReload:k,onBackClick:y,onColumnSortConfigChanged:_,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=V(),a=q(),t=S(_=>Wa(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AR Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(_=>L(_)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=b.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),C=t.arAgingUIState.selectedDate??ue(),g=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(ot(C))},[]);b.useEffect(()=>{g()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),c=b.useCallback(_=>{e(Le({searchString:_}))},[]),m=b.useCallback((_,A)=>{e(Le({sortKey:A,sortOrder:_}))},[]),h=b.useCallback(_=>{a(`./${_}/${C.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),f=b.useCallback(_=>{e(Le({downloadState:_}))},[]),k=b.useCallback((_,A)=>{e(Le({selectedDate:_,agingDateSelectionType:A})),e(ot(_))},[]),y=b.useCallback((_,A)=>{e(Xa({nodeId:_,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:_=>_.trackPageLoaded(G.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ba(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=he(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Eo=H(function(e){const a=en(e).accountsInOrder.map((n,o)=>ga(n,o)),t=tn(e);return{sectionTitle:z.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ba)(la),xo=H(function(e){const a=on(e).accountsInOrder.map((o,r)=>ga(o,r)),t=R.getSignedInUser(),n=Ae(t);return{sectionTitle:z.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ba)(la);function To(){const e=q(),a=K(),{tenantEmailDomain:t}=$(),n=Te(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=rt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=K(),{tenantEmailDomain:t}=$(),n=Te(),o=rt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Do=ft.div`
1
+ import{j as l}from"./liveblocks-BqO7Df-p.js";import{l as $,g as S,u as K,h as V,j as q,k as H,s as Ka,n as at,o as w}from"./core-DxYppZiZ.js";import{eO as L,JS as Me,bD as Yt,bq as ue,L3 as qa,hT as Za,L4 as xt,L5 as Ha,hW as nt,L6 as Re,L7 as Ja,h$ as Qa,L8 as Tt,L9 as Wa,i3 as ot,La as Le,Lb as Xa,ck as rt,Lc as en,Ld as tn,Ka as an,iZ as nn,Le as on,bn as Ae,Lf as Gt,JG as ee,bc as Nt,jb as Vt,mu as $t,iW as zt,JI as te,JH as Z,f3 as sn,fl as rn,Lg as cn,Lh as ln,Li as Kt,Lj as be,tB as ve,tC as Ie,tZ as me,tT as ae,tG as Ee,Lk as dn,Ll as un,Lm as mn,Ln as qt,Lo as Ce,Lp as pn,dC as Ue,qd as Zt,Lq as hn,Lr as fn,Ls as gn,Lt as it,J3 as ct,jr as pe,u5 as lt,ql as bn,Lu as Cn,tD as wt,qg as le,qc as Ht,Lv as se,Lw as _n,Lx as dt,J1 as ut,sd as Jt,Ly as kn,Lz as Sn,LA as yn,LB as mt,sq as An,LC as vn,tF as Dt,sc as Qt,LD as re,LE as In,bv as Wt,u9 as Xt,LF as En,LG as xn,LH as Tn,LI as pt,u4 as wn,LJ as Dn,tE as Ft,u8 as ea,LK as ie,LL as Fn,LM as On,LN as ta,jg as aa,mr as na,jl as oa,mp as sa,mo as ra,mn as ia,rB as Pn,fb as Bn,cN as Rn,cO as Ln,mk as jn,f7 as Mn,mB as Un,Dd as Ot,LO as Yn,LP as Gn,LQ as Nn,LR as Vn,b5 as ht,e_ as $n,gB as zn,fC as Kn,mv as qn,iP as Zn,ms as Hn,mq as Jn,eU as Qn,eS as Wn}from"./zeni-epic-state-CXLj5Oko.js";import{z as R,X as J,s as D,c as I,D as z,aR as Xn,x as xe,aS as ca,f as G,aT as eo,I as Te,aU as la,C as Ye,$ as j,m as to,aV as ao,aW as no,R as da,Z as oo,a as ua,a1 as so,aX as ro,aK as ma,aY as io,aZ as co,W as lo,a_ as uo,a$ as mo,an as po,p as ho,U as fo,b0 as go,b1 as ke}from"./index-DPw038da.js";import{n as ft}from"./mui-DdrzQvkp.js";import{a as b}from"./sentry-DS2EspaF.js";import{w as pa}from"./withTransactionSidePanel-jaVwinxd.js";import{b as ha,t as he,e as ne,a as gt,v as bo}from"./routePaths-CgcmkaKJ.js";import{u as Q}from"./useAskAiCfoHostNavButtonProps-DpRKl1_2.js";import{c as we,b as Co}from"./useFetchSuggestedQuestionsWhenReady-k6PyaabR.js";import ye from"./NotFoundScreen-Bn00COMT.js";import{t as fa}from"./analyticsHelper-tcwBG-lH.js";import{C as _o}from"./CompanyPassportScreen-BKSfyJ-l.js";import{F as ko}from"./FeaturePreviewScreen-Ck2p6Gja.js";import{R as So}from"./ReferralListScreen-CQbl2UNi.js";import"./recharts-BucGjD65.js";import"./analytics-DwbKC7qV.js";import"./plaid-DOFGuYBC.js";import"./dnd-rWx_BA4U.js";import"./stripe-DMRn4zHo.js";import"./lottie-B5P7nQ0g.js";import"./lexical-DPitEa2C.js";import"./pdf-BeAAQRBu.js";import"./utils-B6prU8As.js";import"./TransactionDetailScreen-nBKG_H4f.js";import"./decodeURIComponentSafe-B26owMY4.js";import"./MobileAppDrawer-DlNmDt_G.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="cd2e0533-bea8-4b78-ab7a-d154fbc48e02",e._sentryDebugIdIdentifier="sentry-dbid-cd2e0533-bea8-4b78-ab7a-d154fbc48e02")}catch{}})();const yo=pa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(x=>x.tenantState.currentTenantId),d=S(x=>L(x)),{tenantEmailDomain:p}=$(),C=K(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=b.useMemo(()=>r!=null?Yt(r):ue(),[r]),h=V(),f=q(),k=S(x=>qa(x,m,o)),y=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),A=b.useCallback((x,P)=>{h(xt({sortKey:x,sortOrder:P}))},[]),E=b.useCallback(x=>{h(xt({downloadState:x}))},[]),M=b.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(p!=null){const P=ha({id:x.transactionId,type:x.transactionType},p);f(P);const fe=D(C.state?.pathnameStackToGoBack,C.pathname);f(P,{state:{pathnameStackToGoBack:fe}})}},[p,e]),F=b.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(Xn,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:M,onReload:y,onBackClick:_,onColumnSortConfigChanged:A,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ao=()=>{const e=V(),a=q(),t=S(A=>Ha(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AP Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>L(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},C=b.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),g=t.apAgingUIState.selectedDate??ue(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(nt(g))},[]);b.useEffect(()=>{u()},[]);const c=b.useCallback(()=>{a("../",{relative:"path"})},[]),m=b.useCallback(A=>{e(Re({searchString:A}))},[]),h=b.useCallback((A,E)=>{e(Re({sortKey:E,sortOrder:A}))},[]),f=b.useCallback(A=>{a(`./${A}/${g.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=b.useCallback(A=>{e(Re({downloadState:A}))},[]),y=b.useCallback((A,E)=>{},[]),_=b.useCallback((A,E)=>{e(Re({selectedDate:A,agingDateSelectionType:E})),e(nt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:A=>A.trackPageLoaded(G.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:t.apAgingUIState,report:t,downloadParams:C,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:_,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},vo=pa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=$(),s=R.getSignedInUser(),i=S(F=>L(F)),{tenantEmailDomain:d}=$(),p=K(),C=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:g,companyName:C,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=b.useMemo(()=>r!=null?Yt(r):ue(),[r]),m=V(),h=q(),f=S(F=>Ja(F,c,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Qa(o,c))},[c]),y=b.useCallback(()=>{h("../../",{relative:"path"})},[]),_=b.useCallback((F,x)=>{m(Tt({sortKey:F,sortOrder:x}))},[]),A=b.useCallback(F=>{m(Tt({downloadState:F}))},[]),E=b.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const x=ha({id:F.transactionId,type:F.transactionType},d);h(x);const P=D(p.state?.pathnameStackToGoBack,p.pathname);h(x,{state:{pathnameStackToGoBack:P}})}},[d,e]),M=b.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(eo,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:E,onReload:k,onBackClick:y,onColumnSortConfigChanged:_,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=V(),a=q(),t=S(_=>Wa(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AR Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(_=>L(_)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=b.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),C=t.arAgingUIState.selectedDate??ue(),g=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(ot(C))},[]);b.useEffect(()=>{g()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),c=b.useCallback(_=>{e(Le({searchString:_}))},[]),m=b.useCallback((_,A)=>{e(Le({sortKey:A,sortOrder:_}))},[]),h=b.useCallback(_=>{a(`./${_}/${C.format(z.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),f=b.useCallback(_=>{e(Le({downloadState:_}))},[]),k=b.useCallback((_,A)=>{e(Le({selectedDate:_,agingDateSelectionType:A})),e(ot(_))},[]),y=b.useCallback((_,A)=>{e(Xa({nodeId:_,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:_=>_.trackPageLoaded(G.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ba(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=he(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Eo=H(function(e){const a=en(e).accountsInOrder.map((n,o)=>ga(n,o)),t=tn(e);return{sectionTitle:z.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ba)(la),xo=H(function(e){const a=on(e).accountsInOrder.map((o,r)=>ga(o,r)),t=R.getSignedInUser(),n=Ae(t);return{sectionTitle:z.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ba)(la);function To(){const e=q(),a=K(),{tenantEmailDomain:t}=$(),n=Te(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=rt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=K(),{tenantEmailDomain:t}=$(),n=Te(),o=rt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Do=ft.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;