@zeniai/web-app-ui 5.0.65-qa → 5.0.66-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/dist/assets/AddressRoutes-Z_0xwUva.js +1 -0
  2. package/dist/assets/AddressScreen-CA-Gsfg_.js +9 -0
  3. package/dist/assets/AiCfoScreen-B8tKz6im.js +11 -0
  4. package/dist/assets/BillPayApprovalRoutes-cZrxmRVi.js +1 -0
  5. package/dist/assets/{BillPayRoutes-BrOZ07Ei.js → BillPayRoutes-BSv85mj1.js} +17 -17
  6. package/dist/assets/{BusinessVerificationPageScreen-CQpVjRjR.js → BusinessVerificationPageScreen-b1DUtUq7.js} +2 -2
  7. package/dist/assets/ChargeCardRoutes-CSo3zEv0.js +71 -0
  8. package/dist/assets/CompanyPassportScreen-CMvD2Pw-.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-DHWnLfNi.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-DFMRKVPC.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-BVZy4r84.js → CustomerOnboardingRoutes-xYLCb5gp.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-BvkAL8st.js → DashboardRoutes-DLxXDELv.js} +3 -3
  13. package/dist/assets/DefaultTenantHome-5g8KZ_Nm.js +1 -0
  14. package/dist/assets/DomesticWireDetailScreen-eVqaxWwu.js +18 -0
  15. package/dist/assets/DrawerScreen-CZb8Zr0k.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-Cp-nQ4Gv.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-BoCxhH8a.js → ExpenseAutomationRoutes-CK25nqkn.js} +5 -5
  18. package/dist/assets/FeaturePreviewScreen-D-HbB8OC.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-CUlFd0Ed.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-Bk5PiU9H.js +12 -0
  21. package/dist/assets/MobileAppDrawer-DMlFiXXu.js +1 -0
  22. package/dist/assets/NotFoundScreen-CQ9leNp5.js +1 -0
  23. package/dist/assets/{NotificationRoutes-CHXW3ip6.js → NotificationRoutes-B90jTW-r.js} +1 -1
  24. package/dist/assets/OAuthConsentScreen-BtQW7Crl.js +1 -0
  25. package/dist/assets/PandLWithForecastRoutes-WGkhgInY.js +1 -0
  26. package/dist/assets/PeopleRoutes-D-KAkFFb.js +22 -0
  27. package/dist/assets/PerformanceRoutes-Cx0t3myq.js +1 -0
  28. package/dist/assets/{Preview-EpKFa1SZ.js → Preview-BHNHm504.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-CmOBvomD.js → QBOConnectionScreen-p-5BgC1y.js} +1 -1
  30. package/dist/assets/ReferralListScreen-Bo4wGu3u.js +5 -0
  31. package/dist/assets/ReimbursementApprovalRoutes-CdN2A2XN.js +1 -0
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-bJbzuz6k.js → ReimbursementApprovalRuleDetailScreen-wD16rnKd.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-DHAEN3ZY.js → ReimbursementRoutes-0obNps4e.js} +8 -8
  34. package/dist/assets/ReportsRoutes-D2BVmCDE.js +1 -0
  35. package/dist/assets/RewardsRoutes-Bx3Xfjaz.js +1 -0
  36. package/dist/assets/ScreenRoutes-CKzlkFrS.js +2 -0
  37. package/dist/assets/{SettingsRoutes-75OP1ywb.js → SettingsRoutes-Bz-bKZSZ.js} +7 -7
  38. package/dist/assets/{SetupPagesScreen-BvABA4oV.js → SetupPagesScreen-DyblnAl0.js} +5 -5
  39. package/dist/assets/SignInScreen-B-scNyIK.js +1 -0
  40. package/dist/assets/SignOutScreen-DRQi0OiJ.js +9 -0
  41. package/dist/assets/TaskListScreen-AF6TN3N3.js +9 -0
  42. package/dist/assets/TaskRoutes-DNn1AHcK.js +9 -0
  43. package/dist/assets/TransactionDetailRoutes-C73ERZEQ.js +1 -0
  44. package/dist/assets/{TransactionDetailScreen-DTxQe0TM.js → TransactionDetailScreen-CxhtGb5H.js} +2 -2
  45. package/dist/assets/TransactionListRoutes-RJF1A64K.js +1 -0
  46. package/dist/assets/{TreasuryRoutes-DVDGcuUq.js → TreasuryRoutes-CSVwgxJf.js} +6 -6
  47. package/dist/assets/{VendorsRoutes-fs1ql-9B.js → VendorsRoutes-DshL1tkX.js} +15 -15
  48. package/dist/assets/WiseConfirmationScreen-12t_C7S5.js +12 -0
  49. package/dist/assets/{ZeniAccountRoutes-BgtpOsMK.js → ZeniAccountRoutes-CXtuIR5k.js} +12 -12
  50. package/dist/assets/ZeniAccountStatementScreen-Dby_CD6R.js +9 -0
  51. package/dist/assets/{accountMappingHelper-C61p9k0R.js → accountMappingHelper-BHhQdza1.js} +1 -1
  52. package/dist/assets/{analytics-87aUO2A0.js → analytics-DQCQhWLc.js} +1 -1
  53. package/dist/assets/{analyticsHelper-CwroxLVU.js → analyticsHelper-CFqteM8q.js} +1 -1
  54. package/dist/assets/{core-C1D_J1Tm.js → core-j0LqCeu3.js} +1 -1
  55. package/dist/assets/{decodeURIComponentSafe-DU65qRFr.js → decodeURIComponentSafe-DFYfbcv3.js} +1 -1
  56. package/dist/assets/{dnd-D2GUyFnB.js → dnd-DAo38rm8.js} +1 -1
  57. package/dist/assets/{empty-sYgfsPuY.js → empty-CK9odIeO.js} +1 -1
  58. package/dist/assets/empty-Ca3lmO0X.js +1 -0
  59. package/dist/assets/{emptyVideoElement-DEPvT3eg.js → emptyVideoElement-C-uPKIxs.js} +1 -1
  60. package/dist/assets/epic-DSNvXFJG.js +2 -0
  61. package/dist/assets/getLocaleForTenant-z7__8okF.js +1 -0
  62. package/dist/assets/{index-CIYliqOt.js → index-4NAZbGj1.js} +1 -1
  63. package/dist/assets/{index-CQro8vC7.js → index-71d39Q7D.js} +2 -2
  64. package/dist/assets/index-B2tWZgTJ.js +1 -0
  65. package/dist/assets/{index-DMaAvz9E.js → index-BX6ANtNh.js} +1 -1
  66. package/dist/assets/{index-DivBM1Ub.js → index-CW5fjsxv.js} +17310 -15834
  67. package/dist/assets/{index-D_etFzmU.js → index-CZgerGBH.js} +1 -1
  68. package/dist/assets/index-cC6roLBs.js +1 -0
  69. package/dist/assets/{lexical-D0EV8wLh.js → lexical-D-QBA09y.js} +1 -1
  70. package/dist/assets/{liveblocks-uNyEitSP.js → liveblocks-C3aHR2ug.js} +1 -1
  71. package/dist/assets/{lottie-D71IK4aH.js → lottie-CAFVLjo0.js} +1 -1
  72. package/dist/assets/{mui-Bl9HwrRv.js → mui-D78cc8iD.js} +1 -1
  73. package/dist/assets/{pathToGoBack-BS6hc56i.js → pathToGoBack-Dzva26FJ.js} +1 -1
  74. package/dist/assets/{pdf-Bp6Iehm8.js → pdf-C20YOa73.js} +3 -3
  75. package/dist/assets/{pdf-lib-Bs8DTePl.js → pdf-lib-bl9YSMz9.js} +1 -1
  76. package/dist/assets/{plaid-qfPCSwi4.js → plaid-DsDYZOgp.js} +1 -1
  77. package/dist/assets/{pusher-BdK3-yK7.js → pusher-l3ERSdYl.js} +1 -1
  78. package/dist/assets/{react-DkuuBLqG.js → react-9NHYx8CN.js} +1 -1
  79. package/dist/assets/{react-43KZmiL8.js → react-Cf73dofS.js} +1 -1
  80. package/dist/assets/{react-ChNrFDUd.js → react-CslKeU46.js} +1 -1
  81. package/dist/assets/{react-DSsk8Q4w.js → react-DJWA5bIH.js} +1 -1
  82. package/dist/assets/{react-Q_rYRpC6.js → react-YfQWR1Yb.js} +1 -1
  83. package/dist/assets/{react-BkOMTSid.js → react-oAtqdYpb.js} +1 -1
  84. package/dist/assets/{recharts-B3ReBiRu.js → recharts-B0MOj05b.js} +1 -1
  85. package/dist/assets/{routePaths-BLYSnXgw.js → routePaths-rtKSzfbn.js} +1 -1
  86. package/dist/assets/{sentry-DkoJdbiW.js → sentry-cQZrhfVh.js} +1 -1
  87. package/dist/assets/url-BbfnqyeH.js +1 -0
  88. package/dist/assets/{url-BsgtzK-J.js → url-Oh4YprMm.js} +1 -1
  89. package/dist/assets/useAskAiCfoHostNavButtonProps-_kNwa3Tv.js +1 -0
  90. package/dist/assets/{useDeviceId-BDI3hZsc.js → useDeviceId-CE3ipTvl.js} +1 -1
  91. package/dist/assets/useFetchSuggestedQuestionsWhenReady-qhAGi-cw.js +1 -0
  92. package/dist/assets/useInitialThreadRequest-CDFp11ui.js +1 -0
  93. package/dist/assets/{utils-Dw--aDPP.js → utils-BBuNXoTI.js} +1 -1
  94. package/dist/assets/{withTransactionSidePanel-CaH_VfNh.js → withTransactionSidePanel-BWfGFazD.js} +2 -2
  95. package/dist/assets/zeni-epic-state-DiQZjsue.js +13 -0
  96. package/dist/index.html +1 -1
  97. package/package.json +4 -4
  98. package/dist/assets/AddressRoutes-Dr1v_Sud.js +0 -1
  99. package/dist/assets/AddressScreen-CKtYRww-.js +0 -9
  100. package/dist/assets/AiCfoScreen-Cebz6UA6.js +0 -11
  101. package/dist/assets/BillPayApprovalRoutes-C5AoMYfc.js +0 -1
  102. package/dist/assets/ChargeCardRoutes-Pd2uN0ew.js +0 -71
  103. package/dist/assets/CompanyPassportScreen-DgkCpaOl.js +0 -1
  104. package/dist/assets/ConnectionAuthScreen-ik8aK8sR.js +0 -11
  105. package/dist/assets/CustomerOnboardingAuthScreen-Bj2KB9KI.js +0 -1
  106. package/dist/assets/DefaultTenantHome-BgYjFEW-.js +0 -1
  107. package/dist/assets/DomesticWireDetailScreen-B1OUbADT.js +0 -18
  108. package/dist/assets/DrawerScreen-Bfr6DJZF.js +0 -1
  109. package/dist/assets/EntityDetailRoutes-XANY_96Q.js +0 -1
  110. package/dist/assets/FeaturePreviewScreen-CVAJ3dJp.js +0 -1
  111. package/dist/assets/MagicLinkRoutes-CC0hFgvb.js +0 -72
  112. package/dist/assets/MagicLinkSignInScreen-BIAYZ7Gn.js +0 -12
  113. package/dist/assets/MobileAppDrawer-D4h5JdAm.js +0 -1
  114. package/dist/assets/NotFoundScreen-DtzClrNV.js +0 -1
  115. package/dist/assets/PandLWithForecastRoutes-v9qf6MIV.js +0 -1
  116. package/dist/assets/PeopleRoutes-CA00gwvb.js +0 -22
  117. package/dist/assets/PerformanceRoutes-Dxl37sCI.js +0 -1
  118. package/dist/assets/ReferralListScreen-Cbl9-QoF.js +0 -5
  119. package/dist/assets/ReimbursementApprovalRoutes-8QNxXWIW.js +0 -1
  120. package/dist/assets/ReportsRoutes-Bc3ZiSZw.js +0 -1
  121. package/dist/assets/RewardsRoutes-0nvz_85Q.js +0 -1
  122. package/dist/assets/ScreenRoutes-BsyQBGdD.js +0 -2
  123. package/dist/assets/SignInScreen-DZdqwtK-.js +0 -1
  124. package/dist/assets/SignOutScreen-3VvJNA3b.js +0 -9
  125. package/dist/assets/TaskListScreen-749ZfOYL.js +0 -9
  126. package/dist/assets/TaskRoutes-77nF0njj.js +0 -9
  127. package/dist/assets/TransactionDetailRoutes-CFGf3-Do.js +0 -1
  128. package/dist/assets/TransactionListRoutes-BO9rH2Kv.js +0 -1
  129. package/dist/assets/WiseConfirmationScreen-Dc08Ngp8.js +0 -12
  130. package/dist/assets/ZeniAccountStatementScreen-CiOqII9w.js +0 -9
  131. package/dist/assets/empty-B6sVHl7p.js +0 -1
  132. package/dist/assets/epic-99vwOB_L.js +0 -2
  133. package/dist/assets/getLocaleForTenant-M6IdYirk.js +0 -1
  134. package/dist/assets/index-Co5VS1MD.js +0 -1
  135. package/dist/assets/index-D2qnbHpC.js +0 -1
  136. package/dist/assets/url-B8Y4m-q-.js +0 -1
  137. package/dist/assets/useAskAiCfoHostNavButtonProps-BiomgfPI.js +0 -1
  138. package/dist/assets/useFetchSuggestedQuestionsWhenReady-CoFb7qD6.js +0 -1
  139. package/dist/assets/useInitialThreadRequest-CUi5RNDv.js +0 -1
  140. package/dist/assets/zeni-epic-state-B_OPwxNR.js +0 -14
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-uNyEitSP.js";import{a as y}from"./sentry-DkoJdbiW.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-C1D_J1Tm.js";import{MH as R,Mr as E,Ch as x,Cq as _,Co as h,Cp as S,MI as B}from"./zeni-epic-state-B_OPwxNR.js";import{z as k,h as V,B as j,bA as F,ab as O}from"./index-DivBM1Ub.js";import"./mui-Bl9HwrRv.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]="45689b19-8831-4b3e-a594-55a3d94fe9fb",e._sentryDebugIdIdentifier="sentry-dbid-45689b19-8831-4b3e-a594-55a3d94fe9fb")}catch{}})();function $(e){return B(e)==null}const M=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!$(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),f=D.concat(I);v.push({action:c.stepType.selectedOption,actors:f,operator:f.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(S(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(S(p))}},onResetClick:()=>{e(h()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(h()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function G(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(j,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,$ as i};
1
+ import{j as f}from"./liveblocks-C3aHR2ug.js";import{a as y}from"./sentry-cQZrhfVh.js";import{j as w,h as A,u as C,l as T,g as b,k as U}from"./core-j0LqCeu3.js";import{N2 as R,MO as E,Ci as x,Cr as _,Cp as S,Cq as h,N3 as B}from"./zeni-epic-state-DiQZjsue.js";import{z as k,m as V,B as N,bB as O,ac as j}from"./index-CW5fjsxv.js";import"./mui-D78cc8iD.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]="d76543a0-868e-4620-a3b6-bdb6eb63dd5b",e._sentryDebugIdIdentifier="sentry-dbid-d76543a0-868e-4620-a3b6-bdb6eb63dd5b")}catch{}})();function F(e){return B(e)==null}const $=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=j(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const g=!!F(d.value);return{type:g?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!g}}),m=D.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(O);function H(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?f.jsx(N,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):f.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,F as i};
@@ -1,10 +1,10 @@
1
- import{j as s}from"./liveblocks-uNyEitSP.js";import{j as q,h as re,u as Z,l as Q,g as E,N as $,k as J,i as mt,n as ct,o as C}from"./core-C1D_J1Tm.js";import{eN as V,MX as le,c0 as me,Bs as xe,jB as dt,BF as ne,BE as ae,MY as ut,bn as ce,fH as Te,MZ as pt,Jj as bt,jq as je,Jk as Se,Jl as gt,ik as ht,Md as ft,iA as St,Bg as It,s5 as yt,is as Rt,C0 as De,M_ as Fe,M$ as At,N0 as kt,N1 as vt,N2 as Ct,N3 as Et,BM as Ie,iG as Bt,Mm as wt,BG as xt,Bq as Tt,N4 as jt,Bp as Dt,N5 as Ft,By as ye,BQ as Ut,BP as Lt,BL as Nt,N6 as Ue,GD as Mt,bo as Pt,BB as $t,Ci as _t,N7 as Ot,N8 as Gt,BY as zt,BV as Re,LI as Ht,Bn as Zt,N9 as Le,CH as Ae,CP as Vt,Na as Wt,Nb as z,Nc as qt,Nd as Ne,Ne as Jt,Nf as Me,Ng as Pe,C8 as se,bt as Kt,bE as de,cA as ue,eT as $e,eR as _e,Nh as Yt,gC as Qt,LV as Xt,Ni as en,Nj as Oe,LZ as tn,MH as nn,Nk as an,MW as sn,CM as ke,CL as on,Nl as rn,Nm as ln,Nn as mn,No as cn,Np as dn,Ms as un,CC as pn,CG as bn,bv as gn,bD as hn,cv as fn,cj as Sn,bs as In,Ik as yn,cL as Rn,cN as An,cM as kn,cu as vn}from"./zeni-epic-state-B_OPwxNR.js";import{A as Ge,r as ze,p as X,m as k,z as M,bK as He,C as ee,c as v,aD as ve,o as D,ap as Y,H as Cn,D as Ze,bL as En,y as H,bM as Bn,j as te,bN as wn,N as xn,F as Tn,B as pe,e as Ve,a1 as jn,bb as Dn,U as Fn,h as We,bO as Un,a5 as Ln}from"./index-DivBM1Ub.js";import{n as _,S as Nn}from"./mui-Bl9HwrRv.js";import ie from"./NotFoundScreen-DtzClrNV.js";import{S as Ce}from"./SetupPagesScreen-BvABA4oV.js";import{F as qe}from"./FeaturePreviewScreen-CVAJ3dJp.js";import{a as f}from"./sentry-DkoJdbiW.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-BiomgfPI.js";import{u as Je}from"./useInitialThreadRequest-CUi5RNDv.js";import{c as Ke}from"./useFetchSuggestedQuestionsWhenReady-CoFb7qD6.js";import{D as Mn}from"./DrawerScreen-Bfr6DJZF.js";import{M as Ye}from"./MobileAppDrawer-D4h5JdAm.js";import{R as Pn}from"./ReimbursementApprovalRoutes-8QNxXWIW.js";import{FallBackRoute as $n}from"./ScreenRoutes-BsyQBGdD.js";import"./recharts-B3ReBiRu.js";import"./analytics-87aUO2A0.js";import"./plaid-qfPCSwi4.js";import"./dnd-D2GUyFnB.js";import"./stripe-DMRn4zHo.js";import"./lottie-D71IK4aH.js";import"./lexical-D0EV8wLh.js";import"./pdf-Bp6Iehm8.js";import"./utils-Dw--aDPP.js";import"./analyticsHelper-CwroxLVU.js";import"./routePaths-BLYSnXgw.js";import"./BusinessVerificationPageScreen-CQpVjRjR.js";import"./ReimbursementApprovalRuleDetailScreen-bJbzuz6k.js";import"./getLocaleForTenant-M6IdYirk.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]="6c413e75-dd0b-4bb7-b11d-96d8e96d8d27",e._sentryDebugIdIdentifier="sentry-dbid-6c413e75-dd0b-4bb7-b11d-96d8e96d8d27")}catch{}})();const Qe=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),On=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=M.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Nt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Bt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Qe(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=q(),t=re(),n=Z(),{reimbursementId:r}=Q(),d=Ge(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),B=Z().pathname,j=B.includes("edit"),A=B.includes("reimbursement/new"),[F,w]=f.useState(!1),x=M.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),N=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t(xe(!1,b,R,r)))});const P=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(Gn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:N??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:P,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Gn=_.div`
1
+ import{j as s}from"./liveblocks-C3aHR2ug.js";import{j as J,h as re,u as Z,l as X,g as E,N as $,k as q,i as mt,n as ct,o as C}from"./core-j0LqCeu3.js";import{eO as V,Ni as le,c1 as me,Bt as xe,jC as dt,BG as ne,BF as ae,Nj as ut,bn as ce,fI as Te,Nk as pt,JG as bt,jr as De,JH as Se,JI as gt,il as ht,MA as ft,iB as St,Bh as It,s6 as yt,it as Rt,C1 as je,Nl as Fe,Nm as At,Nn as kt,No as vt,Np as Ct,Nq as Et,BN as Ie,iH as Bt,MJ as wt,BH as xt,Br as Tt,Nr as Dt,Bq as jt,Ns as Ft,Bz as ye,BR as Ut,BQ as Nt,BM as Lt,Nt as Ue,GS as Pt,bo as Mt,BC as $t,Cj as _t,Nu as Ot,Nv as zt,BZ as Gt,BW as Re,M3 as Ht,Bo as Zt,Nw as Ne,CI as Ae,CQ as Vt,Nx as Wt,Ny as G,Nz as Jt,NA as Le,NB as qt,NC as Pe,ND as Me,C9 as se,bt as Qt,bF as de,cB as ue,eU as $e,eS as _e,NE as Kt,gD as Xt,Mg as Yt,NF as en,NG as Oe,Mk as tn,N2 as nn,NH as an,Nh as sn,CN as ke,CM as on,NI as rn,NJ as ln,NK as mn,NL as cn,NM as dn,MP as un,CD as pn,CH as bn,bv as gn,bE as hn,cw as fn,ck as Sn,bs as In,IC as yn,cM as Rn,cO as An,cN as kn,cv as vn}from"./zeni-epic-state-DiQZjsue.js";import{H as ze,Z as Ge,C as Y,$ as k,z as P,bL as He,x as ee,c as v,aE as ve,d as j,aq as K,F as Cn,D as Ze,bM as En,s as H,bN as Bn,I as te,bO as wn,O as xn,A as Tn,B as pe,f as Ve,a3 as Dn,bc as jn,U as Fn,m as We,bP as Un,a6 as Nn}from"./index-CW5fjsxv.js";import{n as _,S as Ln}from"./mui-D78cc8iD.js";import ie from"./NotFoundScreen-CQ9leNp5.js";import{S as Ce}from"./SetupPagesScreen-DyblnAl0.js";import{F as Je}from"./FeaturePreviewScreen-D-HbB8OC.js";import{a as f}from"./sentry-cQZrhfVh.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-_kNwa3Tv.js";import{u as qe}from"./useInitialThreadRequest-CDFp11ui.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-qhAGi-cw.js";import{D as Pn}from"./DrawerScreen-CZb8Zr0k.js";import{M as Ke}from"./MobileAppDrawer-DMlFiXXu.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CdN2A2XN.js";import{FallBackRoute as $n}from"./ScreenRoutes-CKzlkFrS.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-CFqteM8q.js";import"./routePaths-rtKSzfbn.js";import"./BusinessVerificationPageScreen-b1DUtUq7.js";import"./ReimbursementApprovalRuleDetailScreen-wD16rnKd.js";import"./getLocaleForTenant-z7__8okF.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]="65e6d4d0-a770-4c57-9587-3dbb63801b84",e._sentryDebugIdIdentifier="sentry-dbid-65e6d4d0-a770-4c57-9587-3dbb63801b84")}catch{}})();const Xe=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:N}}}=Ze.getLocalizedStrings(),On=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Lt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Nt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Bt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Xe(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=J(),t=re(),n=Z(),{reimbursementId:r}=X(),d=ze(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),B=Z().pathname,D=B.includes("edit"),A=B.includes("reimbursement/new"),[F,w]=f.useState(!1),x=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),L=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t(xe(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:N.dropReceipt.upload,single:N.dropReceipt.single,or:N.dropReceipt.or,multiple:N.dropReceipt.multiple,receipts:N.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:N.dropReceipt.upload,single:N.dropReceipt.single,or:N.dropReceipt.or,multiple:N.dropReceipt.multiple,receipts:N.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=_.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
5
5
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
6
  background-color: ${e=>e.theme.colors.grey4};
7
- `,zn=_.div`
7
+ `,Gn=_.div`
8
8
  position: fixed;
9
9
  top: 0;
10
10
  left: 0;
@@ -38,22 +38,22 @@ import{j as s}from"./liveblocks-uNyEitSP.js";import{j as q,h as re,u as Z,l as Q
38
38
  background: none;
39
39
  border: none;
40
40
  cursor: pointer;
41
- padding: ${D.sp2} ${D.sp3};
41
+ padding: ${j.sp2} ${j.sp3};
42
42
  line-height: 1;
43
43
  color: ${e=>e.theme.colors.hero};
44
44
  &:hover {
45
45
  color: ${e=>e.theme.colors.primary};
46
46
  }
47
47
  svg {
48
- width: ${D.sp4};
49
- height: ${D.sp4};
48
+ width: ${j.sp4};
49
+ height: ${j.sp4};
50
50
  }
51
51
  `,Wn=_.div`
52
52
  display: flex;
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,qn=J(function(e,t){const n=Ue(e,t.reimbursementId),r=M.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,Gt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=Qe(o),i=H(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=H(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(De(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(Bn);function Jn(){const e=q(),t=re(),n=Z(),r=n.hash.substring(1),d=Ge(),{reimbursementId:c}=Q(),m=M.getSignedInUser(),o=E(y=>V(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Je(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});Ke({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=X(),{isFeatureEnabled:T}=h(k.isLimitedCategoryForReimbursement),[u,B]=f.useState(!1),[j,A]=f.useState(!1),[F,w]=f.useState(!1),{isFeatureEnabled:x}=h(k.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(k.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),N=Mt(o),U=Pt(o.userRole),P=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&P==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t($t(c,!1,I)))},[u,c,t,P]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&N===!1?w(!1):w(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,N,m]),f.useEffect(()=>{j||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(xe(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))},[j,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx($,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:x,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const Kn=J(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(wn);function Yn(){const e=q(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Kn,{navigate:e,analytics:v,isAdmin:d})}const G=tn(),Xe="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Qn,common:Be}=Ze.getLocalizedStrings(),we=Qn.reimbursement.bulkActions,Xn=_.div`
56
+ `,Jn=q(function(e,t){const n=Ue(e,t.reimbursementId),r=P.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=Xe(o),i=H(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=H(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(Bn);function qn(){const e=J(),t=re(),n=Z(),r=n.hash.substring(1),d=ze(),{reimbursementId:c}=X(),m=P.getSignedInUser(),o=E(y=>V(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=qe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});Qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Y(),{isFeatureEnabled:T}=h(k.isLimitedCategoryForReimbursement),[u,B]=f.useState(!1),[D,A]=f.useState(!1),[F,w]=f.useState(!1),{isFeatureEnabled:x}=h(k.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(k.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),L=Pt(o),U=Mt(o.userRole),M=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t($t(c,!1,I)))},[u,c,t,M]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?w(!1):w(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,L,m]),f.useEffect(()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(xe(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))},[D,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx($,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(Jn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:x,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const Qn=q(function(e,t){return{remisReviewView:Ne(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(wn);function Kn(){const e=J(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Ne(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Qn,{navigate:e,analytics:v,isAdmin:d})}const z=tn(),Ye="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Xn,common:Be}=Ze.getLocalizedStrings(),we=Xn.reimbursement.bulkActions,Yn=_.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-uNyEitSP.js";import{j as q,h as re,u as Z,l as Q
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ea=J(function(e,t){const n=Pe(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const d=M.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,R=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:G,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Ne(o))},onSubtabChange:o=>{e(z()),e(Me(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=H(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=H(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=H(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ke("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ke("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Xe&&e(an())}}})(jn(Dn));function ta(){const e=q(),t=re(),n=Z(),r=n.state,d=ze(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=qt(r.tab.toString());S!=null?t(Ne(S)):console.log("Warning:Not a valid remiListTab");const O=Jt(r.subTab.toString());O!=null?t(Me(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}},[]);const{useFeatureGate:a}=X(),{isFeatureEnabled:i}=a(k.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(k.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(k.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(k.isReimbursementBulkActionEnabled),T=M.getSignedInUser(),u=E(S=>V(S)),[B,j]=f.useState(!1),[A,F]=f.useState(!1),w=te(),x=w?.loggedInUserRole?.includes("admin")===!0,I=E(S=>Pe(S,G,h)),{areTenantIdsInSync:g}=xn(),N=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:P}=be({mobileExploreReferrer:"Reimbursement List"});if(Ke({isDataReady:N==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(se(G,!0,l,!1,!0)))},[A,G,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&Kt(u),p=de(w?.loggedInUserRoleMap),W=ue(w?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>Te(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{j(S)},{isFeatureEnabled:it}=a(k.isDebitCardFeatureEnabled),ot=$e(it,u),rt=_e(u),{remisProcessed:K,remisProcessing:he}=E(S=>Yt(S));f.useEffect(()=>{K===he&&c!=null&&(t(Qt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:K>1?we.reports:we.report},{variableName:"_has_",variableValue:K>1?Be.texts.have:Be.texts.has},{variableName:"_action_",variableValue:Xt(c)}]})),t(en()),setTimeout(()=>{t(se(G,!0,l,!1,!0,!0))},3e3),m(null))},[K,he]);const lt={events:u.companyId!=null?[`private-${u.companyId}.${Xe}`,`private-${u.companyId}.${oe}`]:[],eventCallback:(S,O,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(qe,{}):tt&&(!y||p)||W&&et?s.jsxs(s.Fragment,{children:[N==="Completed"?s.jsx(ee,{analytics:v,onLoad:S=>(O=>O.trackPageLoaded(Ve.Event.reimbursementHome))(S)}):null,s.jsx(Ye,{isAppContentDrawerOpen:B,handleDrawerToggle:ge}),s.jsxs(Xn,{windowSize:d,children:[s.jsx(Mn,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Yn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:G,isAdmin:x,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:P,...lt})]})]}):nt&&p?s.jsx($,{to:"../setup"}):w!=null&&Oe(u,w.loggedInUserRoleMap)?s.jsx($,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=_(Nn)`
64
+ `,ea=q(function(e,t){const n=Me(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,R=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Le(o))},onSubtabChange:o=>{e(G()),e(Pe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=H(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=H(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=H(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(G())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ke("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ke("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Ye&&e(an())}}})(Dn(jn));function ta(){const e=J(),t=re(),n=Z(),r=n.state,d=Ge(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Jt(r.tab.toString());S!=null?t(Le(S)):console.log("Warning:Not a valid remiListTab");const O=qt(r.subTab.toString());O!=null?t(Pe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=Y(),{isFeatureEnabled:i}=a(k.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(k.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(k.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(k.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=E(S=>V(S)),[B,D]=f.useState(!1),[A,F]=f.useState(!1),w=te(),x=w?.loggedInUserRole?.includes("admin")===!0,I=E(S=>Me(S,z,h)),{areTenantIdsInSync:g}=xn(),L=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:M}=be({mobileExploreReferrer:"Reimbursement List"});if(Qe({isDataReady:L==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(se(z,!0,l,!1,!0)))},[A,z,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&Qt(u),p=de(w?.loggedInUserRoleMap),W=ue(w?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>Te(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{D(S)},{isFeatureEnabled:it}=a(k.isDebitCardFeatureEnabled),ot=$e(it,u),rt=_e(u),{remisProcessed:Q,remisProcessing:he}=E(S=>Kt(S));f.useEffect(()=>{Q===he&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:Q>1?we.reports:we.report},{variableName:"_has_",variableValue:Q>1?Be.texts.have:Be.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(se(z,!0,l,!1,!0,!0))},3e3),m(null))},[Q,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Ye}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,O,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Je,{}):tt&&(!y||p)||W&&et?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(ee,{analytics:v,onLoad:S=>(O=>O.trackPageLoaded(Ve.Event.reimbursementHome))(S)}):null,s.jsx(Ke,{isAppContentDrawerOpen:B,handleDrawerToggle:ge}),s.jsxs(Yn,{windowSize:d,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Kn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:z,isAdmin:x,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:M,...lt})]})]}):nt&&p?s.jsx($,{to:"../setup"}):w!=null&&Oe(u,w.loggedInUserRoleMap)?s.jsx($,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=_(Ln)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,ia=J(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=q(),t=Z(),{tenantEmailDomain:n}=Q(),r=We(),[d,c]=f.useState(!1),m=E(A=>V(A)),o=M.getSignedInUserTenant(n)?.companyId??m.companyId,a=M.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,B=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx($,{to:"../../../reimbursements"}):B&&R?s.jsx($,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!B||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:A=>(F=>F.trackPageLoaded(Ve.Event.reimbursementPromoPage))(A)}),s.jsx(Ye,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Ma(){const e=E(W=>V(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=X(),{isFeatureEnabled:o}=m(k.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(k.isDebitCardFeatureEnabled),i=$e(a,e),l=_e(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),B=T&&u,{isFeatureEnabled:j}=m(k.isDepositAccountsFeatureEnabled),A=j&&!b&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),w=yn(t?.loggedInUserRoleMap),x=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),N=vn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:P}=Q(),y=Z(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:w,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:w,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:B?s.jsx(Pn,{}):s.jsx($n,{isUserHasZeniAccountsAccess:x,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:P??""})}),p&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(qe,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx($,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx($,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Ee,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Jn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(C,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]})}export{Ma as default};
68
+ `,ia=q(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=J(),t=Z(),{tenantEmailDomain:n}=X(),r=We(),[d,c]=f.useState(!1),m=E(A=>V(A)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,B=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,D=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx($,{to:"../../../reimbursements"}):B&&R?s.jsx($,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!B||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:A=>(F=>F.trackPageLoaded(Ve.Event.reimbursementPromoPage))(A)}),s.jsx(Ke,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{D(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(W=>V(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Y(),{isFeatureEnabled:o}=m(k.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(k.isDebitCardFeatureEnabled),i=$e(a,e),l=_e(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),B=T&&u,{isFeatureEnabled:D}=m(k.isDepositAccountsFeatureEnabled),A=D&&!b&&Sn(t?.loggedInUserRoleMap),F=Nn(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),w=yn(t?.loggedInUserRoleMap),x=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),L=vn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:M}=X(),y=Z(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:w,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:w,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:B?s.jsx(Mn,{}):s.jsx($n,{isUserHasZeniAccountsAccess:x,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:L,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:M??""})}),p&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Je,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx($,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx($,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Ee,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(qn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(C,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
@@ -0,0 +1 @@
1
+ import{j as p}from"./liveblocks-C3aHR2ug.js";import{u as z,j as ye,h as Ce,l as ge,g as d,k as Se,n as we,o as G}from"./core-j0LqCeu3.js";import{eO as L,f8 as S,J0 as Ie,jr as K,J1 as W,pJ as k,jf as Re,ii as Te,t6 as X,pO as Oe,bv as ke,J2 as Ae,bn as Fe,u5 as De,J3 as je,J4 as Ee,s_ as Pe,J5 as H,J6 as Le,J7 as Me,J8 as Be,J9 as Je,Ja as w,Jb as A,Jc as F,Jd as N,Je as D,Jf as j,dC as ve,tN as Ue,tB as Y,tC as $,tT as xe,tG as q,tZ as Ve,Jg as ze,Jh as Ge,Ji as He,Jj as Ne,Jk as Ye,eU as $e,eS as qe}from"./zeni-epic-state-DiQZjsue.js";import{M as Ze,N as Qe,Z as Ke,C as ee,$ as E,z as ae,O as We,I as Xe,a as ea,x as aa,c as P,f as sa,s as se,Q as ta,R as oa,U as na}from"./index-CW5fjsxv.js";import"./mui-D78cc8iD.js";import ra from"./NotFoundScreen-CQ9leNp5.js";import{F as ia}from"./FeaturePreviewScreen-D-HbB8OC.js";import{a as _}from"./sentry-cQZrhfVh.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-qhAGi-cw.js";import{u as fa}from"./useInitialThreadRequest-CDFp11ui.js";import{t as Z,a as Q}from"./routePaths-rtKSzfbn.js";import{M as ma}from"./MobileAppDrawer-DMlFiXXu.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 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]="747bbc4b-f07f-4be2-a30c-358411415ab6",e._sentryDebugIdIdentifier="sentry-dbid-747bbc4b-f07f-4be2-a30c-358411415ab6")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(A({resetLeftScroll:!0}))},_a=e=>{e(Ge()),e(He()),e(Ne()),e(Ye())},ha=Se(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=S(e),r=Ae(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ve(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:m,balancesRange:l}=c;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(Y(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(Y(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,c):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c):void 0})();if(l!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(l,{state:{pathnameStackToGoBack:i,referrer:I(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(A({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Je({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",I(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",I(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",I(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{_a(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Qe(),f=Ke(),u=oa(f),a=ye(),s=Ce(),t=z(),{tenantEmailDomain:r}=ge(),{useFeatureGate:c}=ee(),{isFeatureEnabled:m}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,C]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const J=d(n=>L(n)),oe=J.company?.companyInfo.firstMonthOfFY??1,ne=fa(B?J?.companyId:void 0),g=d(n=>S(n).fetchState),re=d(n=>Ie(n)),{areTenantIdsInSync:h}=We(),R=d(n=>n.financeStatementState.selectedReportId),v=d(n=>K(n)),T=d(n=>W(n)),ie=d(n=>S(n).isCompareModeOn),b=d(n=>S(n).filter),O=d(n=>S(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(k(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!M&&g==="Completed"&&h&&(s(k(l.userId,!1,!0,!1)),te(!0))},[i,M,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":T&&s(X());break;case"balance_sheet":s(Te(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,v,T]);const U=Xe(),ce=U?.loggedInUserRole!=null&&ke(U?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),x=n=>{pe(n)},fe=ea(),me=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=z(),V=Ze(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>V?ua:void 0,[V]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:g==="Completed"}),pa({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(ma,{isAppContentDrawerOpen:de,handleDrawerToggle:x}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:le,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:T,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:me&&fe&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:ne})]})}const I=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Ua(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=$e(f,e),a=qe(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(we,{children:[p.jsx(G,{path:"/",element:p.jsx(ba,{})}),p.jsx(G,{path:"*",element:p.jsx(ra,{})})]})}export{Ua as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-C3aHR2ug.js";import{C as w,z as C,aK as y,x as I,c as p,f as F,cG as P,$ as L}from"./index-CW5fjsxv.js";import"./mui-D78cc8iD.js";import l from"./NotFoundScreen-CQ9leNp5.js";import{a as u}from"./sentry-cQZrhfVh.js";import{h as T,g as b,j as V,u as A,k as R,n as U,o as f}from"./core-j0LqCeu3.js";import{eO as z,PD as j,Mt as G,PE as _,ts as O,e_ as Y,PF as q,tq as K}from"./zeni-epic-state-DiQZjsue.js";import{R as x}from"./ReferralListScreen-Bo4wGu3u.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"./useAskAiCfoHostNavButtonProps-_kNwa3Tv.js";import"./useFetchSuggestedQuestionsWhenReady-qhAGi-cw.js";import"./MobileAppDrawer-DMlFiXXu.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]="a6d38aa0-3628-442b-9e4b-af65759c1477",e._sentryDebugIdIdentifier="sentry-dbid-a6d38aa0-3628-442b-9e4b-af65759c1477")}catch{}})();const M=R(function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=C.getSignedInUser();return{onDismissClick:()=>{e(_()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(K())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),$=()=>{const e=T(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>z(o)),c=V(),D=A(),{useDynamicConfig:g}=w(),d=C.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>j(o)),k=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:v}=g(y.zeniAccountsConfig),N=G(v);u.useEffect(()=>{e(_()),r?.rewardsLastViewedTime==null&&i===!1&&(e(O()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(Y(!0)))},[m.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(M,{navigate:c,location:D,currentTenant:r,companyName:S,userName:k,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=w(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx($,{}):a.jsx(l,{})}),a.jsx(f,{path:"*",element:a.jsx(l,{})})]})}export{de as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DLxXDELv.js","assets/sentry-cQZrhfVh.js","assets/core-j0LqCeu3.js","assets/zeni-epic-state-DiQZjsue.js","assets/index-CW5fjsxv.js","assets/mui-D78cc8iD.js","assets/analytics-DQCQhWLc.js","assets/utils-BBuNXoTI.js","assets/withTransactionSidePanel-BWfGFazD.js","assets/useAskAiCfoHostNavButtonProps-_kNwa3Tv.js","assets/useFetchSuggestedQuestionsWhenReady-qhAGi-cw.js","assets/TransactionDetailScreen-CxhtGb5H.js","assets/decodeURIComponentSafe-DFYfbcv3.js","assets/routePaths-rtKSzfbn.js","assets/NotFoundScreen-CQ9leNp5.js","assets/analyticsHelper-CFqteM8q.js","assets/CompanyPassportScreen-CMvD2Pw-.js","assets/MobileAppDrawer-DMlFiXXu.js","assets/FeaturePreviewScreen-D-HbB8OC.js","assets/ReferralListScreen-Bo4wGu3u.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-BSv85mj1.js","assets/AddressScreen-CA-Gsfg_.js","assets/DomesticWireDetailScreen-eVqaxWwu.js","assets/useInitialThreadRequest-CDFp11ui.js","assets/DrawerScreen-CZb8Zr0k.js","assets/SetupPagesScreen-DyblnAl0.js","assets/BusinessVerificationPageScreen-b1DUtUq7.js","assets/BillPayApprovalRoutes-cZrxmRVi.js","assets/ReimbursementApprovalRuleDetailScreen-wD16rnKd.js","assets/getLocaleForTenant-z7__8okF.js","assets/ReimbursementRoutes-0obNps4e.js","assets/ReimbursementApprovalRoutes-CdN2A2XN.js","assets/TransactionListRoutes-RJF1A64K.js","assets/ZeniAccountStatementScreen-Dby_CD6R.js","assets/SettingsRoutes-Bz-bKZSZ.js","assets/accountMappingHelper-BHhQdza1.js","assets/QBOConnectionScreen-p-5BgC1y.js","assets/empty-CK9odIeO.js","assets/index-BX6ANtNh.js","assets/url-Oh4YprMm.js","assets/index-B2tWZgTJ.js","assets/ReportsRoutes-D2BVmCDE.js","assets/ChargeCardRoutes-CSo3zEv0.js","assets/PeopleRoutes-D-KAkFFb.js","assets/ExpenseAutomationRoutes-CK25nqkn.js","assets/TreasuryRoutes-CSVwgxJf.js","assets/VendorsRoutes-DshL1tkX.js","assets/pathToGoBack-Dzva26FJ.js","assets/ZeniAccountRoutes-CXtuIR5k.js","assets/AddressRoutes-Z_0xwUva.js","assets/PandLWithForecastRoutes-WGkhgInY.js","assets/CustomerOnboardingRoutes-xYLCb5gp.js","assets/TransactionDetailRoutes-C73ERZEQ.js","assets/EntityDetailRoutes-Cp-nQ4Gv.js","assets/NotificationRoutes-B90jTW-r.js","assets/PerformanceRoutes-Cx0t3myq.js","assets/RewardsRoutes-Bx3Xfjaz.js","assets/TaskRoutes-DNn1AHcK.js","assets/TaskListScreen-AF6TN3N3.js","assets/AiCfoScreen-B8tKz6im.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as os,eO as ls,eU as cs,eS as ds,eT as ms,fD as us,eQ as _s,cP as Ee,cw as Es,f9 as As,co as ps,bD as Is,bq as gs,fe as xs,v as Ts,IB as hs,bv as js,IC as Us,bF as bs,fb as Ds,bE as Hs,bs as Rs,ck as ys,ID as fs,IE as Cs,cM as vs,cO as Os,cN as Ps,cv as Fs,cB as Ls,mm as Ae,eP as pe,fN as Bs,fi as Ie,fK as ge,fL as xe,fj as ks}from"./zeni-epic-state-DiQZjsue.js";import{j as e}from"./liveblocks-C3aHR2ug.js";import{a as v}from"./sentry-cQZrhfVh.js";import{h as Vs,j as Ss,l as Ns,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-j0LqCeu3.js";import{m as ws,u as zs,z as D,C as $s,a as Gs,o as Ys,$ as L,I as qs,L as B,D as he,t as _,P as Ws,c as X,l}from"./index-CW5fjsxv.js";import"./mui-D78cc8iD.js";import{f as je}from"./analyticsHelper-CFqteM8q.js";import{t as Ks}from"./getLocaleForTenant-z7__8okF.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 i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="0f66f0c9-45a2-41b8-8ab5-6cda82da2c04",i._sentryDebugIdIdentifier="sentry-dbid-0f66f0c9-45a2-41b8-8ab5-6cda82da2c04")}catch{}})();const Qs={dashboard:()=>n(()=>import("./DashboardRoutes-DLxXDELv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>n(()=>import("./BillPayRoutes-BSv85mj1.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-0obNps4e.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20])),transactions:()=>n(()=>import("./TransactionListRoutes-RJF1A64K.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>n(()=>import("./SettingsRoutes-Bz-bKZSZ.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>n(()=>import("./ReportsRoutes-D2BVmCDE.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-CSo3zEv0.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>n(()=>import("./PeopleRoutes-D-KAkFFb.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-CK25nqkn.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>n(()=>import("./TreasuryRoutes-CSVwgxJf.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>n(()=>import("./VendorsRoutes-DshL1tkX.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-CXtuIR5k.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Js=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-D2BVmCDE.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),en=l(()=>n(()=>import("./AddressRoutes-Z_0xwUva.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sn=l(()=>n(()=>import("./PeopleRoutes-D-KAkFFb.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-WGkhgInY.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-xYLCb5gp.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),tn=l(()=>n(()=>import("./VendorsRoutes-DshL1tkX.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-C73ERZEQ.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-Cp-nQ4Gv.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),on=l(()=>n(()=>import("./DashboardRoutes-DLxXDELv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),be=l(()=>n(()=>import("./BillPayRoutes-BSv85mj1.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),ln=l(()=>n(()=>import("./SettingsRoutes-Bz-bKZSZ.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),De=l(()=>n(()=>import("./ReimbursementRoutes-0obNps4e.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-CXtuIR5k.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),dn=l(()=>n(()=>import("./TreasuryRoutes-CSVwgxJf.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),mn=l(()=>n(()=>import("./TransactionListRoutes-RJF1A64K.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),un=l(()=>n(()=>import("./ChargeCardRoutes-CSo3zEv0.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),_n=l(()=>n(()=>import("./NotificationRoutes-B90jTW-r.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),En=l(()=>n(()=>import("./PerformanceRoutes-Cx0t3myq.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-CK25nqkn.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),pn=l(()=>n(()=>import("./RewardsRoutes-Bx3Xfjaz.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),In=l(()=>n(()=>import("./TaskRoutes-DNn1AHcK.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),gn=l(()=>n(()=>import("./AiCfoScreen-B8tKz6im.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>n(()=>import("./NotFoundScreen-CQ9leNp5.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),xn=l(()=>n(()=>import("./TaskListScreen-AF6TN3N3.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=zs(),R=D.getSignedInUserTenant(o)?.tenantId,h=D.getSignedInUser(),K=os(h),$=Ms(),[N,Re]=v.useState(!1),r=z(a=>ls(a)),{useFeatureGate:P}=$s(),Q=Gs(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&K,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(a=>a.tenantState.fetchState),A=z(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,G=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!G||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=z(a=>us(a));if(o!=null){const a=D.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:R,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=qs(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,J=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(J!=null&&R!=null){const a=J.params.selectedPeriod;if(a!=null){const b=a.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(R,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[J,R]),v.useEffect(()=>{N||(Re(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&D.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s){if(pe(b?.userId,b?.zeniSessionId,a.tenantId),d(Bs(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=D.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ks(s)),m?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,D]),v.useEffect(()=>{D.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(q&&ts){k(Ie(s));const W=D.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(W?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),q&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(q){X.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(b==="Completed"||b==="Error");a==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,R,h,f,U))},[R,A]),v.useEffect(()=>{D.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),D.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&R!=null?(O(),_.markActiveTenantFetchCompleted(R)):A==="Error"&&R!=null&&(_.markActiveTenantFetchFailed(R),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,R,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Js,b=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Qs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},b)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,$e=Us(E?.loggedInUserRoleMap),Ge=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&bs(E?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Ds(r.company),qe=Pe&&Ye===!0&&!C,We=re&&Hs(E?.loggedInUserRoleMap),Ke=oe&&Rs(E?.loggedInUserRoleMap),Qe=me&&ys(E?.loggedInUserRoleMap),Je=fs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),I=Os(E?.loggedInUserRoleMap),g=Ps(E?.loggedInUserRoleMap),x=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=qe&&I,ns=oe&&g,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||$e===!0||Je===!0||Xe===!0;return D.isSignedIn()?R==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||K&&!te)&&Ge===!1&&u===!1&&G===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||K?N&&r?.userRole&&u!=null&&G!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:G})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(rn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(xn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(In,{})}),e.jsx(t,{path:"address/*",element:We||de||Qe||Ke?e.jsx(en,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Q?e.jsx(gn,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),H=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(bn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Dn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Dn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),He=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{H as FallBackRoute,wn as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-uNyEitSP.js";import{a as u}from"./sentry-DkoJdbiW.js";import{j as T,u as R,h as P,g as m,k as B,l as _,n as q,o as x}from"./core-C1D_J1Tm.js";import{bn as Ie,eN as k,gv as ce,Ki as xe,IG as Ce,jq as le,lJ as Ee,gx as Ae,Kk as je,Kj as ke,MJ as we,x2 as Pe,Bx as ve,Mi as Me,Mr as De,c0 as re,cF as Ue,cG as Te,Iv as Fe,MK as Re,Iw as Be,vu as _e,ML as Ve,DN as Le,Bd as Oe,B4 as de,B1 as Ne,vy as ue,B7 as pe,Ba as ge,Bg as X,s5 as Y,vx as $e,j2 as W,j5 as me,MM as Ge,k6 as Ke,vN as ze,Jd as Je,Je as Ze,j0 as He,MN as Qe,j3 as qe,MO as We,vK as Xe,MP as Ye,MQ as en,Bu as nn,eR as fe,eT as he,MR as tn,fv as an,IH as sn,vJ as te,fA as ae,fz as on,vI as cn,fy as ln,fx as rn,MS as dn,eW as be,MT as un,MU as pn,vQ as gn,vH as se,MV as mn,fc as fn,vE as hn,bT as bn,b$ as Sn,b_ as yn,bU as In,bY as xn,bX as Cn,bW as En,bZ as An,bV as jn}from"./zeni-epic-state-B_OPwxNR.js";import{p as ee,m as D,z as C,ab as Se,bB as kn,c as G,e as wn,j as V,B as ne,bC as Pn,bD as vn,am as Mn,i as ye,bE as Dn,bF as Un,bG as Tn,a5 as Fn,N as Rn,bH as Bn,y as _n,bI as Vn}from"./index-DivBM1Ub.js";import{n as U}from"./mui-Bl9HwrRv.js";import{M as v}from"./MobileAppDrawer-D4h5JdAm.js";import{a as N,g as $,m as Ln}from"./accountMappingHelper-C61p9k0R.js";import{t as On,A as Nn}from"./AddressScreen-CKtYRww-.js";import F from"./NotFoundScreen-DtzClrNV.js";import{g as $n}from"./analyticsHelper-CwroxLVU.js";import{B as Gn}from"./BusinessVerificationPageScreen-CQpVjRjR.js";import{C as Kn}from"./CompanyPassportScreen-DgkCpaOl.js";import{q as oe}from"./QBOConnectionScreen-CmOBvomD.js";import{B as zn}from"./BillPayApprovalRoutes-C5AoMYfc.js";import{R as Jn}from"./ReimbursementApprovalRoutes-8QNxXWIW.js";import"./recharts-B3ReBiRu.js";import"./analytics-87aUO2A0.js";import"./plaid-qfPCSwi4.js";import"./dnd-D2GUyFnB.js";import"./stripe-DMRn4zHo.js";import"./lottie-D71IK4aH.js";import"./lexical-D0EV8wLh.js";import"./pdf-Bp6Iehm8.js";import"./utils-Dw--aDPP.js";import"./routePaths-BLYSnXgw.js";import"./empty-sYgfsPuY.js";import"./pdf-lib-Bs8DTePl.js";import"./index-DMaAvz9E.js";import"./url-BsgtzK-J.js";import"./index-D2qnbHpC.js";import"./decodeURIComponentSafe-DU65qRFr.js";import"./ReimbursementApprovalRuleDetailScreen-bJbzuz6k.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]="ad067973-1fc8-41e6-9227-c05c1c367a60",e._sentryDebugIdIdentifier="sentry-dbid-ad067973-1fc8-41e6-9227-c05c1c367a60")}catch{}})();const Zn=U.div`
1
+ import{j as t}from"./liveblocks-C3aHR2ug.js";import{a as u}from"./sentry-cQZrhfVh.js";import{j as T,u as B,h as P,g as m,k as R,l as _,n as X,o as C}from"./core-j0LqCeu3.js";import{bn as Ie,eO as w,gw as ce,KF as Ce,J1 as xe,jr as le,lK as Ee,gy as Ae,KH as je,KG as we,N4 as ke,x3 as Pe,By as ve,MF as De,MO as Me,c1 as re,cG as Ue,cH as Te,IN as Fe,N5 as Be,IO as Re,vv as _e,N6 as Ve,DO as Oe,Be as Le,B5 as de,B2 as Ne,vz as ue,B8 as pe,Bb as ge,Bh as W,s6 as Y,vy as $e,j3 as q,j6 as me,N7 as Ge,k7 as Ke,vO as ze,JA as Je,JB as Ze,j1 as He,N8 as Qe,j4 as Xe,N9 as qe,vL as We,Na as Ye,Nb as en,Bv as nn,eS as fe,eU as he,Nc as tn,fw as an,J2 as sn,vK as te,fB as ae,fA as on,vJ as cn,fz as ln,fy as rn,Nd as dn,eX as be,Ne as un,Nf as pn,vR as gn,vI as se,Ng as mn,fd as fn,vF as hn,bU as bn,c0 as Sn,b$ as yn,bV as In,bZ as Cn,bY as xn,bX as En,b_ as An,bW as jn}from"./zeni-epic-state-DiQZjsue.js";import{C as ee,$ as M,z as x,ac as Se,bC as wn,c as G,f as kn,I as V,B as ne,bD as Pn,bE as vn,an as Dn,i as ye,bF as Mn,bG as Un,bH as Tn,a6 as Fn,O as Bn,bI as Rn,s as _n,bJ as Vn}from"./index-CW5fjsxv.js";import{n as U}from"./mui-D78cc8iD.js";import{M as v}from"./MobileAppDrawer-DMlFiXXu.js";import{a as N,g as $,m as On}from"./accountMappingHelper-BHhQdza1.js";import{t as Ln,A as Nn}from"./AddressScreen-CA-Gsfg_.js";import F from"./NotFoundScreen-CQ9leNp5.js";import{g as $n}from"./analyticsHelper-CFqteM8q.js";import{B as Gn}from"./BusinessVerificationPageScreen-b1DUtUq7.js";import{C as Kn}from"./CompanyPassportScreen-CMvD2Pw-.js";import{q as oe}from"./QBOConnectionScreen-p-5BgC1y.js";import{B as zn}from"./BillPayApprovalRoutes-cZrxmRVi.js";import{R as Jn}from"./ReimbursementApprovalRoutes-CdN2A2XN.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"./routePaths-rtKSzfbn.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";import"./ReimbursementApprovalRuleDetailScreen-wD16rnKd.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]="222842c4-45af-4be1-b878-c2f76a613c69",e._sentryDebugIdIdentifier="sentry-dbid-222842c4-45af-4be1-b878-c2f76a613c69")}catch{}})();const Zn=U.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as t}from"./liveblocks-uNyEitSP.js";import{a as u}from"./sentry-DkoJdbi
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Hn=B(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ce(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:E}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:j,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:L}=f,A=N(a.accountMappingView.incomeAccountList,b.selectedOption),K=N(a.accountMappingView.expenseAccountList,g.selectedOption),z=N(a.accountMappingView.billPayAccountList,l.selectedOption),J=N(a.accountMappingView.reimbursementsAccountList,E.selectedOption),O=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,j.selectedOptions),M=$(a.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),H=Ln(a.accountMappingView.expenseAccounts1099FilingAccountList,L),Q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:K?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:J?.accountId,selectedPrepaidExpensesAccountIds:O.map(w=>w.accountId),selectedFixedAssetsAccountIds:h.map(w=>w.accountId),selectedAccruedExpensesAccountIds:M.map(w=>w.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(w=>w.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(ke({data:Q}))},onBackClick:()=>{Se(c)===!1?(i("../../dashboard"),e(je())):e(ce())},onSaveClick:()=>{e(Ae()),o&&G.track(wn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ee(a.currentTenant.companyId,n))}}})(kn),Qn=()=>{const e=T(),a=R(),i=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(D.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(D.isScheduledJEAccruedExpensesFeatureEnabled),s=C.getSignedInUser(),r=Ie(s),p=m(y=>k(y)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(y=>xe(y)),E=y=>{g(y)};return t.jsxs(Zn,{children:[t.jsx(v,{isAppContentDrawerOpen:b,handleDrawerToggle:E}),t.jsx(Hn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:Se(a),onClickMenuIcon:()=>E(!0)})]})},qn=U.div`
9
+ `,Hn=R(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:xe(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:E}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:j,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:O}=f,A=N(a.accountMappingView.incomeAccountList,b.selectedOption),K=N(a.accountMappingView.expenseAccountList,g.selectedOption),z=N(a.accountMappingView.billPayAccountList,l.selectedOption),J=N(a.accountMappingView.reimbursementsAccountList,E.selectedOption),L=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,j.selectedOptions),D=$(a.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),H=On(a.accountMappingView.expenseAccounts1099FilingAccountList,O),Q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:K?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:J?.accountId,selectedPrepaidExpensesAccountIds:L.map(k=>k.accountId),selectedFixedAssetsAccountIds:h.map(k=>k.accountId),selectedAccruedExpensesAccountIds:D.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(we({data:Q}))},onBackClick:()=>{Se(c)===!1?(i("../../dashboard"),e(je())):e(ce())},onSaveClick:()=>{e(Ae()),o&&G.track(kn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ee(a.currentTenant.companyId,n))}}})(wn),Qn=()=>{const e=T(),a=B(),i=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(M.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(M.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),r=Ie(s),p=m(y=>w(y)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(y=>Ce(y)),E=y=>{g(y)};return t.jsxs(Zn,{children:[t.jsx(v,{isAppContentDrawerOpen:b,handleDrawerToggle:E}),t.jsx(Hn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:Se(a),onClickMenuIcon:()=>E(!0)})]})},Xn=U.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as t}from"./liveblocks-uNyEitSP.js";import{a as u}from"./sentry-DkoJdbi
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,Wn=B(function(e,a){const i=k(e),c=Me(e),o=De(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(re(i?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:o,analytics:G}},function(e,a){const{navigate:i,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{i("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{i("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(Pn),Xn=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(S=>k(S)),b=m(S=>S.billPaySetupApproverViewState.fetchState),g=m(S=>S.remiSetupApproverViewState.fetchState),l=m(S=>we(S)),E=f.companyId??C.getSignedInUserTenant(c)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();u.useEffect(()=>{p||b!=="Not-Started"||(d(!0),i(Pe(!0)))},[p,b,i]),u.useEffect(()=>{s||g!=="Not-Started"||(r(!0),i(ve(!0)))},[s,g,i]);const j=S=>{n(S)};return y?.loggedInUserRoleMap!=null?t.jsxs(qn,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:j}),t.jsx(Wn,{navigate:e,location:a,companyId:E,currentTenant:f,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)}})]}):t.jsx(ne,{fetchState:l.fetchState})},Yn=U.div`
17
+ `,qn=R(function(e,a){const i=w(e),c=De(e),o=Me(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(re(i?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:o,analytics:G}},function(e,a){const{navigate:i,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{i("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{i("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(Pn),Wn=()=>{const e=T(),a=B(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(S=>w(S)),b=m(S=>S.billPaySetupApproverViewState.fetchState),g=m(S=>S.remiSetupApproverViewState.fetchState),l=m(S=>ke(S)),E=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();u.useEffect(()=>{p||b!=="Not-Started"||(d(!0),i(Pe(!0)))},[p,b,i]),u.useEffect(()=>{s||g!=="Not-Started"||(r(!0),i(ve(!0)))},[s,g,i]);const j=S=>{n(S)};return y?.loggedInUserRoleMap!=null?t.jsxs(Xn,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:j}),t.jsx(qn,{navigate:e,location:a,companyId:E,currentTenant:f,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)}})]}):t.jsx(ne,{fetchState:l.fetchState})},Yn=U.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as t}from"./liveblocks-uNyEitSP.js";import{a as u}from"./sentry-DkoJdbi
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,et=B(function(e,a){const{companyId:i,isZeniAccountEnabled:c,isChargeCardEnabled:o,isBillPayEnabled:n,isRemiEnabled:s,isTreasuryEnabled:r}=a,p=k(e);return{bankSetupView:Ve(e,i,n,s,c,o,r),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s,r)=>{e(Y(s,n,r))},onEstablishConnectionClick:(n,s,r)=>{e(X(n,o,s,r))},onUpdatePaymentAccountStatus:(n,s,r,p,d)=>{e(ge(n,s,d,p,r))},onUpdatePaymentAccountLoginStatus:(n,s,r,p)=>{e(pe(!1,n,p,r,s))},onEstablishConnectionSuccess:(n,s)=>{e(ue(s,n))},onUpdateAccountClick:(n,s,r,p,d)=>{e(d==="paymentAccount"?de(n,s,r,p):Ne(p,n,s))},onUpdatePrimaryFundingAccount:(n,s,r)=>{e(Oe(o,s,n,r))},onRemoveConnection:n=>{e(Le(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(vn),nt=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),o=V(),[n,s]=u.useState(!1),[r,p]=u.useState(!1),d=m(I=>k(I)),f=m(I=>I.settingsViewState.bankConnection.fetchState),b=Ue(d,o?.loggedInUserRoleMap),g=Te(d,o?.loggedInUserRoleMap),l=Fe(d,o?.loggedInUserRoleMap),E=Re(d,o?.loggedInUserRoleMap),y=Be(d,o?.loggedInUserRoleMap),j=d.companyId??C.getSignedInUserTenant(c)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{r||f==="Completed"||(p(!0),i(_e(!1)))},[r,i,f]);const S=I=>{s(I)};return b||l||g||y?t.jsxs(Yn,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),t.jsx(et,{navigate:e,location:a,companyId:j,currentTenant:d,roleMap:o.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):t.jsx(F,{})},tt=U.div`
25
+ `,et=R(function(e,a){const{companyId:i,isZeniAccountEnabled:c,isChargeCardEnabled:o,isBillPayEnabled:n,isRemiEnabled:s,isTreasuryEnabled:r}=a,p=w(e);return{bankSetupView:Ve(e,i,n,s,c,o,r),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s,r)=>{e(Y(s,n,r))},onEstablishConnectionClick:(n,s,r)=>{e(W(n,o,s,r))},onUpdatePaymentAccountStatus:(n,s,r,p,d)=>{e(ge(n,s,d,p,r))},onUpdatePaymentAccountLoginStatus:(n,s,r,p)=>{e(pe(!1,n,p,r,s))},onEstablishConnectionSuccess:(n,s)=>{e(ue(s,n))},onUpdateAccountClick:(n,s,r,p,d)=>{e(d==="paymentAccount"?de(n,s,r,p):Ne(p,n,s))},onUpdatePrimaryFundingAccount:(n,s,r)=>{e(Le(o,s,n,r))},onRemoveConnection:n=>{e(Oe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(vn),nt=()=>{const e=T(),a=B(),i=P(),{tenantEmailDomain:c}=_(),o=V(),[n,s]=u.useState(!1),[r,p]=u.useState(!1),d=m(I=>w(I)),f=m(I=>I.settingsViewState.bankConnection.fetchState),b=Ue(d,o?.loggedInUserRoleMap),g=Te(d,o?.loggedInUserRoleMap),l=Fe(d,o?.loggedInUserRoleMap),E=Be(d,o?.loggedInUserRoleMap),y=Re(d,o?.loggedInUserRoleMap),j=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{r||f==="Completed"||(p(!0),i(_e(!1)))},[r,i,f]);const S=I=>{s(I)};return b||l||g||y?t.jsxs(Yn,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),t.jsx(et,{navigate:e,location:a,companyId:j,currentTenant:d,roleMap:o.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):t.jsx(F,{})},tt=U.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as t}from"./liveblocks-uNyEitSP.js";import{a as u}from"./sentry-DkoJdbi
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,at=B(function(e,a){const{companyId:i}=a,c=k(e),o=a.roleMap.bill_pay_admin,n=Ge(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(Y("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(X(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(qe(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(He(n,s,r))},handleFetchPaymentSources:()=>{e(W())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e(Je())},onBillingAddressSave:n=>{e(ze(n))},onAddressEditHandler:n=>{if(n!=null){const s=On(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Dn),st=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>k(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Mn(b.addCardPaymentSourceStatus.fetchState),E=b.addCardPaymentSourceStatus.fetchState,y=f.companyId??C.getSignedInUserTenant(c)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const j=V();u.useEffect(()=>{y!=null&&i($e(y,!1))},[y,i]),u.useEffect(()=>{s||(r(!0),i(W()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&i(W())},[l,E]);const S=I=>{n(I)};return j?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:S}),t.jsx(at,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:j.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=B(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(Xe())}}})(Un),it=()=>{const e=T(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>k(g)),s=n.companyId??C.getSignedInUserTenant(a)?.companyId,r=C.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>We(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=U.div`
33
+ `,at=R(function(e,a){const{companyId:i}=a,c=w(e),o=a.roleMap.bill_pay_admin,n=Ge(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(Y("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(W(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(Xe(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(He(n,s,r))},handleFetchPaymentSources:()=>{e(q())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e(Je())},onBillingAddressSave:n=>{e(ze(n))},onAddressEditHandler:n=>{if(n!=null){const s=Ln(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Mn),st=()=>{const e=T(),a=B(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>w(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Dn(b.addCardPaymentSourceStatus.fetchState),E=b.addCardPaymentSourceStatus.fetchState,y=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const j=V();u.useEffect(()=>{y!=null&&i($e(y,!1))},[y,i]),u.useEffect(()=>{s||(r(!0),i(q()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&i(q())},[l,E]);const S=I=>{n(I)};return j?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:S}),t.jsx(at,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:j.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=R(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(We())}}})(Un),it=()=>{const e=T(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>w(g)),s=n.companyId??x.getSignedInUserTenant(a)?.companyId,r=x.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>qe(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=U.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -46,7 +46,7 @@ import{j as t}from"./liveblocks-uNyEitSP.js";import{a as u}from"./sentry-DkoJdbi
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,rt=()=>{const e=P(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(l=>k(l)).companyId??C.getSignedInUserTenant(a)?.companyId,n=C.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const s=m(l=>Ye(l,n.userId)),r=m(l=>en(l,o,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=r,d=l=>{c(l)},f=u.useCallback(l=>{e(Y("user_reimbursement_account",l))},[]),b=u.useCallback(l=>{e(X(l,o,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&e(nn(n.userId))},[n.userId,s.fetchState]);const g=s.fetchState==="Not-Started"||s.fetchState==="In-Progress";return t.jsxs(lt,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:d}),t.jsx(Tn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:s,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onClickMenuIcon:()=>{d(!0)}})]})},dt=U.div`
49
+ `,rt=()=>{const e=P(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(l=>w(l)).companyId??x.getSignedInUserTenant(a)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const s=m(l=>Ye(l,n.userId)),r=m(l=>en(l,o,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=r,d=l=>{c(l)},f=u.useCallback(l=>{e(Y("user_reimbursement_account",l))},[]),b=u.useCallback(l=>{e(W(l,o,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&e(nn(n.userId))},[n.userId,s.fetchState]);const g=s.fetchState==="Not-Started"||s.fetchState==="In-Progress";return t.jsxs(lt,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:d}),t.jsx(Tn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:s,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onClickMenuIcon:()=>{d(!0)}})]})},dt=U.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as t}from"./liveblocks-uNyEitSP.js";import{a as u}from"./sentry-DkoJdbi
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,ie=({appContent:e})=>{const a=P(),i=T(),c=R(),[o,n]=u.useState(!1),s=m(h=>k(h)),{tenantEmailDomain:r}=s,p=s.companyId??C.getSignedInUserTenant(r)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(D.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(D.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(D.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(D.isTreasuryEnabled),E=m(h=>le(h)),y=fe(s),j=he(g,s),S=!j&&E,I=Fn(s,b,g),{areTenantIdsInSync:L}=Rn();u.useEffect(()=>{L&&a(tn(p,S))},[p,a,S,L]);const A=m(h=>an(h,S)),K=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,z=sn(s),J=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:O}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Bn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:J===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{O(!0)},isLoading:K,isBankingOnlyTenant:j,isCardsOnlyTenant:y,onAddressClick:h=>{const M=function(H,Q){let w=`/${H}/settings/my_profile`;return w=w.concat(`/new/${Q}`),w}(r,h),Z=_n(c.state?.pathnameStackToGoBack,c.pathname);i(M,{state:{pathnameStackToGoBack:Z}})},onGetOtp:h=>{const M={...A.myProfileLocalData,phone:h};a(te({localData:M})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(h,M)=>{a(on(h,M,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&C.saveZeniOtpToken(h),a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=P(),a=m(l=>k(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=C.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function Jt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>k(l)),n=V(),s=C.getSignedInUser(),r=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(D.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(q,{children:[Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"accounting/*",element:t.jsx(Qn,{})}),yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"my_bank_connections",element:t.jsx(rt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"bank_connections",element:t.jsx(nt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"business_verification",element:t.jsx(Gn,{productType:b?"zeni_accounts":g?"charge_cards":$n(o,n?.loggedInUserRoleMap)})}),En(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"company_details",element:t.jsx(Kn,{})}),An(n?.loggedInUserRole??[],o)&&t.jsx(x,{path:"billing",element:t.jsx(st,{})}),jn(n?.loggedInUserRole??[],d,o)&&t.jsx(x,{path:"integrations",element:t.jsx(it,{})}),t.jsx(x,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(x,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(x,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(x,{path:"*",element:t.jsx(F,{})})]}):t.jsx(q,{children:t.jsx(x,{path:"*",element:t.jsx(F,{})})}):null}function pt(e){return t.jsxs(q,{children:[t.jsx(x,{path:"/",element:t.jsx(Xn,{})}),t.jsx(x,{path:"bills/approval-rules/*",element:t.jsx(zn,{})}),t.jsx(x,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Jn,{}):t.jsx(F,{})}),t.jsx(x,{path:"*",element:t.jsx(F,{})})]})}export{Jt as default};
57
+ `,ie=({appContent:e})=>{const a=P(),i=T(),c=B(),[o,n]=u.useState(!1),s=m(h=>w(h)),{tenantEmailDomain:r}=s,p=s.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(M.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(M.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(M.isTreasuryEnabled),E=m(h=>le(h)),y=fe(s),j=he(g,s),S=!j&&E,I=Fn(s,b,g),{areTenantIdsInSync:O}=Bn();u.useEffect(()=>{O&&a(tn(p,S))},[p,a,S,O]);const A=m(h=>an(h,S)),K=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,z=sn(s),J=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,L=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:L}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Rn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:J===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{L(!0)},isLoading:K,isBankingOnlyTenant:j,isCardsOnlyTenant:y,onAddressClick:h=>{const D=function(H,Q){let k=`/${H}/settings/my_profile`;return k=k.concat(`/new/${Q}`),k}(r,h),Z=_n(c.state?.pathnameStackToGoBack,c.pathname);i(D,{state:{pathnameStackToGoBack:Z}})},onGetOtp:h=>{const D={...A.myProfileLocalData,phone:h};a(te({localData:D})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(h,D)=>{a(on(h,D,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=P(),a=m(l=>w(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=x.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function Jt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>w(l)),n=V(),s=x.getSignedInUser(),r=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(M.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(X,{children:[Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(Qn,{})}),yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(rt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(nt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx(Gn,{productType:b?"zeni_accounts":g?"charge_cards":$n(o,n?.loggedInUserRoleMap)})}),En(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx(Kn,{})}),An(n?.loggedInUserRole??[],o)&&t.jsx(C,{path:"billing",element:t.jsx(st,{})}),jn(n?.loggedInUserRole??[],d,o)&&t.jsx(C,{path:"integrations",element:t.jsx(it,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]}):t.jsx(X,{children:t.jsx(C,{path:"*",element:t.jsx(F,{})})}):null}function pt(e){return t.jsxs(X,{children:[t.jsx(C,{path:"/",element:t.jsx(Wn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(zn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Jn,{}):t.jsx(F,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]})}export{Jt as default};