@zeniai/web-app-ui 5.2.10-qa → 5.2.11-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 (135) hide show
  1. package/dist/assets/AddressRoutes-Dd5BLPNk.js +1 -0
  2. package/dist/assets/AddressScreen-B9qIDuai.js +9 -0
  3. package/dist/assets/AiCfoScreen-vunuko6i.js +22 -0
  4. package/dist/assets/{BillPayApprovalRoutes-B4banQ09.js → BillPayApprovalRoutes-pStG307K.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D3T-lEVk.js → BillPayRoutes-DbYnaX3_.js} +11 -11
  6. package/dist/assets/{BusinessVerificationPageScreen-Bsm9CkGv.js → BusinessVerificationPageScreen-C7ez20uI.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-wMkZzZ_n.js → CardsAiCfoScreen-gbRXVqr8.js} +3 -3
  8. package/dist/assets/{ChargeCardRoutes-DS6GEFEI.js → ChargeCardRoutes--zXOSegl.js} +10 -10
  9. package/dist/assets/CompanyPassportScreen-BFAkEtYn.js +1 -0
  10. package/dist/assets/ConnectionAuthScreen-DHpBzuhF.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-Dt45S7Zn.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-DdGAOHoB.js → CustomerOnboardingRoutes-DXqGvG-i.js} +6 -6
  13. package/dist/assets/{DashboardRoutes-D8tbohO7.js → DashboardRoutes-V58yuU0O.js} +4 -4
  14. package/dist/assets/{DefaultTenantHome-DqbO_FPa.js → DefaultTenantHome-DFUBuSUw.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-DV-LDQl5.js +18 -0
  16. package/dist/assets/DrawerScreen-CLmFnWBR.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-D-VExL9R.js +1 -0
  18. package/dist/assets/ExpenseAutomationRoutes-DxTIqyhg.js +25 -0
  19. package/dist/assets/{FeaturePreviewScreen-Bf8p9qA6.js → FeaturePreviewScreen-DQZK8Tkd.js} +1 -1
  20. package/dist/assets/HubSpotOAuthCallbackScreen-DD2ALtLX.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-0xFiI_gt.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-CAbcD9gJ.js +12 -0
  23. package/dist/assets/MobileAppDrawer-BSqYxsX2.js +1 -0
  24. package/dist/assets/NotFoundScreen-B35T6J3X.js +1 -0
  25. package/dist/assets/NotificationRoutes-BSEbFYc7.js +1 -0
  26. package/dist/assets/OAuthConsentScreen-DDzTn8ex.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-DL85XT-N.js +1 -0
  28. package/dist/assets/{PeopleRoutes-Bn-EuJ4v.js → PeopleRoutes-tvVCUcKN.js} +3 -3
  29. package/dist/assets/PerformanceRoutes-CRPowUNZ.js +1 -0
  30. package/dist/assets/{Preview-BH9guJVl.js → Preview-BFORWhGg.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-BePcKt2I.js → QBOConnectionScreen-BY-ET0xU.js} +1 -1
  32. package/dist/assets/ReimbursementApprovalRoutes-xDcJz-Qa.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BFSR8IP5.js → ReimbursementApprovalRuleDetailScreen-Dds_onx1.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-CMRAQDmN.js → ReimbursementRoutes-Br35P7Ex.js} +6 -6
  35. package/dist/assets/{ReportsRoutes-DX1a3KYi.js → ReportsRoutes-DlFjy5j4.js} +1 -1
  36. package/dist/assets/RewardsRoutes-ybfqamBR.js +1 -0
  37. package/dist/assets/ScreenRoutes-ZHVecYPB.js +2 -0
  38. package/dist/assets/{SettingsRoutes-CeP6shWo.js → SettingsRoutes-BTJJZw7w.js} +7 -7
  39. package/dist/assets/{SetupPagesScreen-DGqDTbQK.js → SetupPagesScreen-BoNxDLXk.js} +5 -5
  40. package/dist/assets/{SignInScreen-gRUMEEH6.js → SignInScreen-DSHzSt42.js} +1 -1
  41. package/dist/assets/SignOutScreen-C0pSERkC.js +9 -0
  42. package/dist/assets/TaskListScreen-eY2qEexK.js +9 -0
  43. package/dist/assets/TaskRoutes-DK4tCNck.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-BPpf7f9E.js → TransactionDetailRoutes-C2A6Ai04.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-BTy4CO79.js → TransactionDetailScreen-Y2A-PdMn.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-z_hNGDnV.js → TransactionListRoutes-DV5L4e1G.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-foYlsfsF.js +37 -0
  48. package/dist/assets/{VendorsRoutes-CVd0Zx8K.js → VendorsRoutes-B1TOelcz.js} +21 -21
  49. package/dist/assets/WiseConfirmationScreen-CI_HPhh8.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-Cx0DNwci.js → ZeniAccountRoutes-Cs3s5yj2.js} +11 -11
  51. package/dist/assets/ZeniAccountStatementScreen-COiOGQqB.js +9 -0
  52. package/dist/assets/{accountMappingHelper-BWbl_Mr6.js → accountMappingHelper-Bc02_HWR.js} +1 -1
  53. package/dist/assets/{analytics-BVZAGmSf.js → analytics-B6nQWxMm.js} +1 -1
  54. package/dist/assets/{analyticsHelper-DZApVryU.js → analyticsHelper-Og8Rmx5y.js} +1 -1
  55. package/dist/assets/{core-lpqyfl_C.js → core-D-w0syUt.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-miEPY4cs.js → decodeURIComponentSafe-C7k2Nrj_.js} +1 -1
  57. package/dist/assets/{dnd-xbSIuUzo.js → dnd-Dt7EosAi.js} +1 -1
  58. package/dist/assets/{empty-s6mdVY5S.js → empty-B7Efn92X.js} +1 -1
  59. package/dist/assets/{empty-Dcg7CF8X.js → empty-DF-g8Byo.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-rePyiZcH.js → emptyVideoElement-CBdlopDC.js} +1 -1
  61. package/dist/assets/epic-DUSro8MZ.js +2 -0
  62. package/dist/assets/getLocaleForTenant-DXpgdwm2.js +1 -0
  63. package/dist/assets/{index-uOMVm9H-.js → index-B3J9WxT7.js} +2 -2
  64. package/dist/assets/{index-CPjWwtCH.js → index-BNrt1EOu.js} +1 -1
  65. package/dist/assets/{index-gZhpjgMs.js → index-BZ0hEAE3.js} +1 -1
  66. package/dist/assets/{index-DDmCCF1m.js → index-BrvX8Bq4.js} +1 -1
  67. package/dist/assets/{index-Dqe0xDu6.js → index-Cf0JRE_u.js} +1 -1
  68. package/dist/assets/{index-CFknKb_z.js → index-CnDcHHGX.js} +1 -1
  69. package/dist/assets/{index-CXwNHESf.js → index-DbHK73QC.js} +1 -1
  70. package/dist/assets/{index-CuLyKa_Q.js → index-DtTeUJqK.js} +13970 -13965
  71. package/dist/assets/{lexical-BzDpQEY5.js → lexical-BvIUj_Gq.js} +1 -1
  72. package/dist/assets/{liveblocks-DxMhjnNF.js → liveblocks-B6veqs_8.js} +1 -1
  73. package/dist/assets/{lottie-_pZcYgWm.js → lottie-HMB6u1mD.js} +1 -1
  74. package/dist/assets/{mui-AVGOiy8R.js → mui-CvZ4Namd.js} +1 -1
  75. package/dist/assets/{pathToGoBack-WoDZmsPZ.js → pathToGoBack-BAEsrU0U.js} +1 -1
  76. package/dist/assets/{pdf--GzjqSbO.js → pdf-DTyc8UuT.js} +4 -4
  77. package/dist/assets/{pdf-lib-BWfnoXie.js → pdf-lib-HRxxOoqR.js} +1 -1
  78. package/dist/assets/{plaid-4b1bk5sk.js → plaid-DOxsEQPt.js} +1 -1
  79. package/dist/assets/{pusher-CQ2CZwKk.js → pusher-NGpa4s20.js} +1 -1
  80. package/dist/assets/{react-WLXYAyOc.js → react-B0Ke89Rd.js} +1 -1
  81. package/dist/assets/{react-AjeIz02D.js → react-BlxcdXL2.js} +1 -1
  82. package/dist/assets/{react-B15Vuz5r.js → react-CH6MMJtW.js} +1 -1
  83. package/dist/assets/{react-BjQnbjRz.js → react-CiknC4Jf.js} +1 -1
  84. package/dist/assets/{react-CMNl5tFI.js → react-RglhJ9zO.js} +1 -1
  85. package/dist/assets/{react-D0m8D_2j.js → react-S6dZMq1W.js} +1 -1
  86. package/dist/assets/{recharts-BBgS6uq0.js → recharts-CCZTRBr_.js} +1 -1
  87. package/dist/assets/{routePaths-Cu5maDQS.js → routePaths-BXH8zPZv.js} +1 -1
  88. package/dist/assets/{sentry-Dg7lI3nb.js → sentry-BW637Fua.js} +1 -1
  89. package/dist/assets/{url-CpEGpwjz.js → url-CCU74SLo.js} +1 -1
  90. package/dist/assets/{url-CtDlmImG.js → url-CQ6e4A8i.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CGRLsc4l.js → useAiCfoDashboardSuggestedQuestionsChips-C2yPn_Vp.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-aY04YP0S.js +1 -0
  93. package/dist/assets/useCashManagementBanner-mgRwIUZG.js +1 -0
  94. package/dist/assets/{useChargeCardPusherEvents-Drg4ddme.js → useChargeCardPusherEvents-D2Li6UoT.js} +1 -1
  95. package/dist/assets/{useDeviceId-CntVV2j2.js → useDeviceId-BEnHMBJt.js} +1 -1
  96. package/dist/assets/useEmailConnectResultRefresh-D1no2UPa.js +1 -0
  97. package/dist/assets/{useInitialThreadRequest-Q2ekueW0.js → useInitialThreadRequest-BMYYqer4.js} +1 -1
  98. package/dist/assets/{utils-CXbpoo9S.js → utils-BAwT1yty.js} +1 -1
  99. package/dist/assets/{withTransactionSidePanel-LIW64rRE.js → withTransactionSidePanel-CRqIqwQF.js} +3 -3
  100. package/dist/assets/{zeni-epic-state-D-kJk6oz.js → zeni-epic-state-DyOMcw4f.js} +7 -7
  101. package/dist/index.html +1 -1
  102. package/package.json +4 -4
  103. package/dist/assets/AddressRoutes-DCUsc3KF.js +0 -1
  104. package/dist/assets/AddressScreen-Bwb2AT1P.js +0 -9
  105. package/dist/assets/AiCfoScreen-CpThag2f.js +0 -22
  106. package/dist/assets/CompanyPassportScreen-BHfvnSz2.js +0 -1
  107. package/dist/assets/ConnectionAuthScreen-7rbaCMEB.js +0 -11
  108. package/dist/assets/CustomerOnboardingAuthScreen-B94Uv_Zm.js +0 -1
  109. package/dist/assets/DomesticWireDetailScreen-CqRrfvdB.js +0 -18
  110. package/dist/assets/DrawerScreen-Bilbbpvv.js +0 -1
  111. package/dist/assets/EntityDetailRoutes-DdlrWmJC.js +0 -1
  112. package/dist/assets/ExpenseAutomationRoutes-BA62t3yd.js +0 -25
  113. package/dist/assets/HubSpotOAuthCallbackScreen-vkwq6Ud6.js +0 -1
  114. package/dist/assets/MagicLinkRoutes-Cw9n9GKd.js +0 -72
  115. package/dist/assets/MagicLinkSignInScreen-ClvrxnEy.js +0 -12
  116. package/dist/assets/MobileAppDrawer-DqPaZqu1.js +0 -1
  117. package/dist/assets/NotFoundScreen-ByEXcHxY.js +0 -1
  118. package/dist/assets/NotificationRoutes-DLMlcNHg.js +0 -1
  119. package/dist/assets/OAuthConsentScreen-DldzTmZH.js +0 -1
  120. package/dist/assets/PandLWithForecastRoutes-Qj_06fIE.js +0 -1
  121. package/dist/assets/PerformanceRoutes-C6bkps9k.js +0 -1
  122. package/dist/assets/ReimbursementApprovalRoutes-BbtlGccW.js +0 -1
  123. package/dist/assets/RewardsRoutes-C2tRacuM.js +0 -1
  124. package/dist/assets/ScreenRoutes-Bn1XDy7H.js +0 -2
  125. package/dist/assets/SignOutScreen-CP3gVj5D.js +0 -9
  126. package/dist/assets/TaskListScreen-BbAwvgct.js +0 -9
  127. package/dist/assets/TaskRoutes-VDJ42Di4.js +0 -9
  128. package/dist/assets/TreasuryRoutes-DaqzfOKU.js +0 -37
  129. package/dist/assets/WiseConfirmationScreen-B18w4PVg.js +0 -12
  130. package/dist/assets/ZeniAccountStatementScreen-DX37lKuf.js +0 -9
  131. package/dist/assets/epic-BOukt2t4.js +0 -2
  132. package/dist/assets/getLocaleForTenant-BCxMcs6_.js +0 -1
  133. package/dist/assets/useAskAiCfoHostNavButtonProps-Bk_He0fB.js +0 -1
  134. package/dist/assets/useCashManagementBanner-DnJJ_3dp.js +0 -1
  135. package/dist/assets/useEmailConnectResultRefresh-C6v7HzT7.js +0 -1
@@ -1 +1 @@
1
- import{j as h}from"./liveblocks-DxMhjnNF.js";import{a as f}from"./sentry-Dg7lI3nb.js";import{u as w,j as g,h as _,g as O,i as F,n as k}from"./core-lpqyfl_C.js";import{l0 as q,QJ as T,Qt as C,FL as V,FX as B,FS as A,FT as E,QK as j,eW as K,FR as W}from"./zeni-epic-state-D-kJk6oz.js";import{z as P,y as N,B as L,bP as z,ag as Q,bC as J,bQ as X}from"./index-CuLyKa_Q.js";import"./mui-AVGOiy8R.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="2ae3d963-5796-48f2-b238-911e87c48c85",e._sentryDebugIdIdentifier="sentry-dbid-2ae3d963-5796-48f2-b238-911e87c48c85")}catch{}})();function G(){const e=w(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(q({})))}),[p,t,e])}const H=k((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),I=u.actors.selectedNonUsers.map((m=>{const y=(b=m.value,j(b)==null);var b;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(I);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(z);function M(){const e=_(),s=w(),t=O(),{approvalRuleId:p}=F(),o=P.getSignedInUser(),l=N(),r=g((n=>T(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(L,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=k((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const b=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];b==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:b==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(($=>({type:"user",subType:void 0,userId:$.userId,idType:"user",isImplicitActor:!1}))));const x=y.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=S?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(W(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(X);function ne(){const e=g((t=>K(t))),{isApprovalRulesV3Enabled:s}=J(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(M,{})}function Z(){const e=_(),s=w(),t=O(),{approvalRuleId:p}=F(),o=P.getSignedInUser(),l=N(),r=g((n=>T(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(G(),f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(L,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,G as u};
1
+ import{j as h}from"./liveblocks-B6veqs_8.js";import{a as f}from"./sentry-BW637Fua.js";import{u as w,j as g,h as x,g as O,i as k,n as F}from"./core-D-w0syUt.js";import{l6 as L,QR as T,QB as C,FT as V,G3 as B,F_ as A,F$ as E,QS as j,eZ as Z,FZ as z}from"./zeni-epic-state-DyOMcw4f.js";import{z as P,y as N,E as $,bP as G,ag as Q,bC as K,bQ as W}from"./index-DtTeUJqK.js";import"./mui-CvZ4Namd.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="1149f0a9-1918-4d94-80f8-25d871ffc2cf",e._sentryDebugIdIdentifier="sentry-dbid-1149f0a9-1918-4d94-80f8-25d871ffc2cf")}catch{}})();function H(){const e=w(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))}),[p,t,e])}const J=F((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),I=u.actors.selectedNonUsers.map((m=>{const y=(b=m.value,j(b)==null);var b;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(I);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(G);function M(){const e=x(),s=w(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g((n=>T(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const X=F((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const b=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];b==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:b==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1}))));const _=y.action??"require_approval";m.push({action:_,actors:D,operator:D.length>1?_==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=S?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(W);function ne(){const e=g((t=>Z(t))),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?h.jsx(Y,{}):h.jsx(M,{})}function Y(){const e=x(),s=w(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g((n=>T(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(H(),f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-DxMhjnNF.js";import{h as H,u as de,g as Q,i as Y,j as w,N as _,n as q,l as ct,o as dt,p as C}from"./core-lpqyfl_C.js";import{eW as V,QX as ue,c7 as pe,EW as Ue,kL as ut,F7 as oe,F6 as re,QY as pt,bn as be,gq as Le,QZ as bt,Nn as gt,kA as Pe,No as ke,Np as ht,jv as ft,Qf as St,jK as It,EK as Rt,uo as yt,jC as kt,Fu as $e,Q_ as Me,Q$ as At,R0 as vt,R1 as Ct,R2 as Et,R3 as wt,Fe as Ae,jQ as xt,Qo as Bt,F8 as Tt,EU as Ft,R4 as jt,ET as Dt,R5 as Ut,F0 as ve,Fi as Lt,Fh as Pt,Fd as $t,R6 as _e,Kt as Mt,bq as _t,F3 as Nt,FM as Ot,R7 as Gt,R8 as zt,Fq as Zt,Fn as Ce,PK as Qt,ER as Vt,R9 as Ne,Gc as Ee,Gk as Wt,Ra as Ht,Rb as z,Rc as qt,Rd as Oe,Re as Kt,Rf as Ge,Rg as ze,FC as le,bu as Jt,bK as ge,cI as he,fD as Ze,fB as Qe,Rh as Xt,fy as Yt,PX as en,Ri as tn,Rj as Ve,P$ as nn,QJ as an,Rk as sn,QW as on,Gh as we,Gg as rn,Rl as ln,Rm as mn,Rn as cn,Ro as dn,Rp as un,Qu as pn,G7 as bn,Gb as gn,bs as hn,bJ as fn,cC as Sn,cq as In,bt as Rn,Mb as yn,cS as kn,cV as An,cU as vn,cB as Cn}from"./zeni-epic-state-D-kJk6oz.js";import{w as We,J as He,A as ee,X as E,z as P,b$ as qe,_ as te,c as A,aM as xe,o as j,au as X,F as En,O as Ke,c0 as wn,s as Z,a0 as Je,c1 as xn,T as ne,c2 as Bn,Z as Tn,C as Fn,B as fe,f as Xe,a9 as jn,bn as Dn,a4 as Un,y as Ye,c3 as Ln,i as Pn}from"./index-CuLyKa_Q.js";import{n as N,S as $n}from"./mui-AVGOiy8R.js";import me from"./NotFoundScreen-ByEXcHxY.js";import{S as Be}from"./SetupPagesScreen-DGqDTbQK.js";import{F as et}from"./FeaturePreviewScreen-Bf8p9qA6.js";import{a as f}from"./sentry-Dg7lI3nb.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-Bk_He0fB.js";import{u as tt}from"./useInitialThreadRequest-Q2ekueW0.js";import{D as Mn}from"./DrawerScreen-Bilbbpvv.js";import{M as nt}from"./MobileAppDrawer-DqPaZqu1.js";import{R as _n}from"./ReimbursementApprovalRoutes-BbtlGccW.js";import{FallBackRoute as Nn}from"./ScreenRoutes-Bn1XDy7H.js";import"./recharts-BBgS6uq0.js";import"./analytics-BVZAGmSf.js";import"./plaid-4b1bk5sk.js";import"./dnd-xbSIuUzo.js";import"./stripe-cKAAJElX.js";import"./lottie-_pZcYgWm.js";import"./lexical-BzDpQEY5.js";import"./pdf--GzjqSbO.js";import"./utils-CXbpoo9S.js";import"./analyticsHelper-DZApVryU.js";import"./routePaths-Cu5maDQS.js";import"./BusinessVerificationPageScreen-Bsm9CkGv.js";import"./ReimbursementApprovalRuleDetailScreen-BFSR8IP5.js";import"./getLocaleForTenant-BCxMcs6_.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]="f8a551c8-7b2c-4fb8-a736-2615f5fba3ba",e._sentryDebugIdIdentifier="sentry-dbid-f8a551c8-7b2c-4fb8-a736-2615f5fba3ba")}catch{}})();const at=e=>`/${e}/reimbursements`,On=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"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=Ke.getLocalizedStrings(),Gn=q((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=gt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.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:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:A,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(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(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ve(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({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(Ft({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ae(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(Ae("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(At());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(A.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(kt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(It(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(wn);function Fe(){const e=H(),t=de(),n=Q(),{reimbursementId:r}=Y(),d=We(),c=He(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Q().pathname,F=x.includes("edit"),k=x.includes("reimbursement/new"),[D,B]=f.useState(!1),v=P.getSignedInUser(),I=w((p=>V(p))),g=w((p=>ue(p,r))),U=tt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(I?.userRole??[]);f.useEffect((()=>{(k&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(v==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:A,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(Qn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(On,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(Hn,{windowSize:c,children:s.jsx(Gn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
1
+ import{j as s}from"./liveblocks-B6veqs_8.js";import{h as Q,u as de,g as H,i as Y,j as w,N as _,n as q,l as ct,o as dt,p as C}from"./core-D-w0syUt.js";import{eZ as V,R3 as ue,c7 as pe,F2 as Ue,kR as ut,Ff as oe,Fe as re,R4 as pt,bn as be,gt as Le,R5 as bt,Nv as gt,kG as Pe,Nw as ve,Nx as ht,jB as ft,Qn as St,jQ as Rt,ES as It,uw as yt,jI as vt,FC as $e,R6 as Me,R7 as kt,R8 as At,R9 as Ct,Ra as Et,Rb as wt,Fm as ke,jW as xt,Qw as Bt,Fg as Tt,F0 as Ft,Rc as jt,E$ as Dt,Rd as Ut,F8 as Ae,Fq as Lt,Fp as Pt,Fl as $t,Re as _e,KB as Mt,bq as _t,Fb as Nt,FU as Gt,Rf as Ot,Rg as zt,Fy as Zt,Fv as Ce,PS as Ht,EZ as Vt,Rh as Ne,Gk as Ee,Gs as Wt,Ri as Qt,Rj as z,Rk as qt,Rl as Ge,Rm as Kt,Rn as Oe,Ro as ze,FK as le,bu as Jt,bK as ge,cI as he,fG as Ze,fE as He,Rp as Xt,fB as Yt,Q3 as en,Rq as tn,Rr as Ve,Q7 as nn,QR as an,Rs as sn,R2 as on,Gp as we,Go as rn,Rt as ln,Ru as mn,Rv as cn,Rw as dn,Rx as un,QC as pn,Gf as bn,Gj as gn,bs as hn,bJ as fn,cC as Sn,cq as Rn,bt as In,Mj as yn,cS as vn,cV as kn,cU as An,cB as Cn}from"./zeni-epic-state-DyOMcw4f.js";import{B as We,J as Qe,A as ee,c as E,z as P,b$ as qe,F as te,f as k,aM as xe,o as j,au as X,K as En,O as Ke,c0 as wn,v as Z,a0 as Je,c1 as xn,e as ne,c2 as Bn,_ as Tn,H as Fn,E as fe,h as Xe,a9 as jn,bn as Dn,a4 as Un,y as Ye,c3 as Ln,i as Pn}from"./index-DtTeUJqK.js";import{n as N,S as $n}from"./mui-CvZ4Namd.js";import me from"./NotFoundScreen-B35T6J3X.js";import{S as Be}from"./SetupPagesScreen-BoNxDLXk.js";import{F as et}from"./FeaturePreviewScreen-DQZK8Tkd.js";import{a as f}from"./sentry-BW637Fua.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-aY04YP0S.js";import{u as tt}from"./useInitialThreadRequest-BMYYqer4.js";import{D as Mn}from"./DrawerScreen-CLmFnWBR.js";import{M as nt}from"./MobileAppDrawer-BSqYxsX2.js";import{R as _n}from"./ReimbursementApprovalRoutes-xDcJz-Qa.js";import{FallBackRoute as Nn}from"./ScreenRoutes-ZHVecYPB.js";import"./recharts-CCZTRBr_.js";import"./analytics-B6nQWxMm.js";import"./plaid-DOxsEQPt.js";import"./dnd-Dt7EosAi.js";import"./stripe-cKAAJElX.js";import"./lottie-HMB6u1mD.js";import"./lexical-BvIUj_Gq.js";import"./pdf-DTyc8UuT.js";import"./utils-BAwT1yty.js";import"./analyticsHelper-Og8Rmx5y.js";import"./routePaths-BXH8zPZv.js";import"./BusinessVerificationPageScreen-C7ez20uI.js";import"./ReimbursementApprovalRuleDetailScreen-Dds_onx1.js";import"./getLocaleForTenant-DXpgdwm2.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]="318a6512-ba52-46b3-90d9-45ebd2be5ce7",e._sentryDebugIdIdentifier="sentry-dbid-318a6512-ba52-46b3-90d9-45ebd2be5ce7")}catch{}})();const at=e=>`/${e}/reimbursements`,Gn=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"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=Ke.getLocalizedStrings(),On=q((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=gt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.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:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(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(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({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(Ft({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(kt());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(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(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(ve("common"))},onCancelAutoComplete:()=>{e(ve("common"))}}}}))(wn);function Fe(){const e=Q(),t=de(),n=H(),{reimbursementId:r}=Y(),d=We(),c=Qe(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=H().pathname,F=x.includes("edit"),v=x.includes("reimbursement/new"),[D,B]=f.useState(!1),A=P.getSignedInUser(),R=w((p=>V(p))),g=w((p=>ue(p,r))),U=tt(R?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(R?.userRole??[]);f.useEffect((()=>{(v&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(A==null)throw Error("Can't access address page without signing in...");const I={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:I}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:k,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(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(Qn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:R,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -12,7 +12,7 @@ import{j as s}from"./liveblocks-DxMhjnNF.js";import{h as H,u as de,g as Q,i as Y
12
12
  bottom: 0;
13
13
  background-color: ${En.overlayBackgroundBlack};
14
14
  z-index: 5;
15
- `,Qn=N.div`
15
+ `,Hn=N.div`
16
16
  position: absolute;
17
17
  top: 0;
18
18
  left: 0;
@@ -48,12 +48,12 @@ import{j as s}from"./liveblocks-DxMhjnNF.js";import{h as H,u as de,g as Q,i as Y
48
48
  width: ${j.sp4};
49
49
  height: ${j.sp4};
50
50
  }
51
- `,Hn=N.div`
51
+ `,Qn=N.div`
52
52
  display: flex;
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,qn=q((function(e,t){const n=_e(e,t.reimbursementId),r=P.getSignedInUser(),d=be(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=Gt(n.remiActivities,zt(t.currentTenant),r));const i=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Pe(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(Me());const a=at(o),i=Z(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Vt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Qt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{A.trackReimbursementDeleteReimbursement(n),e($e(n))},cancelAndDeleteReport:a=>{a===!0?A.trackReimbursementCancelAndDeleteReimbursement(n):A.trackReimbursementCancelReimbursement(n),e(Zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function Kn(){const e=H(),t=de(),n=Q(),r=n.hash.substring(1),d=We(),{reimbursementId:c}=Y(),m=P.getSignedInUser(),o=w((R=>V(R))),a=w((R=>_e(R,c??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});Je({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[F,k]=f.useState(!1),[D,B]=f.useState(!1),{isFeatureEnabled:v}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w((R=>ue(R,c??""))),U=Mt(o),L=_t(o.userRole),$=a.fetchState;if(f.useEffect((()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(Nt(c,!1,I)))}),[u,c,t,$]),f.useEffect((()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&U===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find((R=>R.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,o.isZeni,U,m]),f.useEffect((()=>{F||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(k(!0),t(Ue(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Ot(!1,!0,!0,a.lastUpdatedByUserId)))}),[F,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(qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:A,onLoad:R=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(R)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:v,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:D,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Jn=q((function(e,t){return{remisReviewView:Ne(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Ht(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Wt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(Bn);function Xn(){const e=H(),t=w((c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:n}=w((c=>Ne(c))),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{t!=="Completed"&&n.length!==0||e("./")}),[t,n.length]),s.jsx(Jn,{navigate:e,analytics:A,isAdmin:d})}const G=nn(),st="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Yn,common:je}=Ke.getLocalizedStrings(),De=Yn.reimbursement.bulkActions,ea=N.div`
56
+ `,qn=q((function(e,t){const n=_e(e,t.reimbursementId),r=P.getSignedInUser(),d=be(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=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Pe(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(Me());const a=at(o),i=Z(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Vt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{k.trackReimbursementDeleteReimbursement(n),e($e(n))},cancelAndDeleteReport:a=>{a===!0?k.trackReimbursementCancelAndDeleteReimbursement(n):k.trackReimbursementCancelReimbursement(n),e(Zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function Kn(){const e=Q(),t=de(),n=H(),r=n.hash.substring(1),d=We(),{reimbursementId:c}=Y(),m=P.getSignedInUser(),o=w((I=>V(I))),a=w((I=>_e(I,c??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});Je({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[F,v]=f.useState(!1),[D,B]=f.useState(!1),{isFeatureEnabled:A}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w((I=>ue(I,c??""))),U=Mt(o),L=_t(o.userRole),$=a.fetchState;if(f.useEffect((()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(Nt(c,!1,R)))}),[u,c,t,$]),f.useEffect((()=>{R&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&U===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find((I=>I.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,o.isZeni,U,m]),f.useEffect((()=>{F||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(v(!0),t(Ue(!1,T,R,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Gt(!1,!0,!0,a.lastUpdatedByUserId)))}),[F,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(qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:I=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(I)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:A,isShowDeletedReimbursementEnabled:R,location:n,navigate:e,isRealTimeApprovalEnabled:D,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Jn=q((function(e,t){return{remisReviewView:Ne(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Qt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Wt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(Bn);function Xn(){const e=Q(),t=w((c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:n}=w((c=>Ne(c))),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{t!=="Completed"&&n.length!==0||e("./")}),[t,n.length]),s.jsx(Jn,{navigate:e,analytics:k,isAdmin:d})}const O=nn(),st="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Yn,common:je}=Ke.getLocalizedStrings(),De=Yn.reimbursement.bulkActions,ea=N.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-DxMhjnNF.js";import{h as H,u as de,g as Q,i as Y
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ta=q((function(e,t){const n=ze(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=be(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,y=an(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:A,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:G,spendManagementEndPoint:`${Un}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Oe(o))},onSubtabChange:o=>{e(z()),e(Ge(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=Z(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=Z(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;A?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Z(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(un({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(dn(o))},onFiltersChange:o=>{e(cn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&A.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&A.trackSpendManagementDownloadClick("reimbursement"),e(mn({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(ln(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(rn(o,a??""));break;case"send_for_approval":e(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(on(!1))},onEventReceived:o=>{o===st&&e(sn())}}}))(jn(Dn));function na(){const e=H(),t=de(),n=Q(),r=n.state,d=He(),[c,m]=f.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=qt(r.tab.toString());S!=null?t(Oe(S)):console.log("Warning:Not a valid remiListTab");const O=Kt(r.subTab.toString());O!=null?t(Ge(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}}),[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=w((S=>V(S))),[x,F]=f.useState(!1),[k,D]=f.useState(!1),B=ne(),v=B?.loggedInUserRole?.includes("admin")===!0,I=w((S=>ze(S,G,h))),{areTenantIdsInSync:g}=Tn(),U=I.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=Se({mobileExploreReferrer:"Reimbursement List"});if(Je({isDataReady:U==="Completed"}),f.useEffect((()=>{!k&&g&&(D(!0),t(le(G,!0,l,!1,!0)))}),[k,G,t,g]),T==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&Jt(u),p=ge(B?.loggedInUserRoleMap),W=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,K=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w((S=>Le(S.companyState,u.companyId))),it=ie?.company.featuresActivationInfo.connectedAccountProvider,Ie=S=>{F(S)},{isFeatureEnabled:ot}=a(E.isDebitCardFeatureEnabled),rt=Ze(ot,u),lt=Qe(u),{remisProcessed:J,remisProcessing:Re}=w((S=>Xt(S)));f.useEffect((()=>{J===Re&&c!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:J>1?De.reports:De.report},{variableName:"_has_",variableValue:J>1?je.texts.have:je.texts.has},{variableName:"_action_",variableValue:en(c)}]})),t(tn()),setTimeout((()=>{t(le(G,!0,l,!1,!0,!0))}),3e3),m(null))}),[J,Re]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,O,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(et,{}):K&&(!R||p)||W&&ae?s.jsxs(s.Fragment,{children:[U==="Completed"?s.jsx(te,{analytics:A,onLoad:S=>(O=>O.trackPageLoaded(Xe.Event.reimbursementHome))(S)}):null,s.jsx(nt,{isAppContentDrawerOpen:x,handleDrawerToggle:Ie}),s.jsxs(ea,{windowSize:d,children:[s.jsx(Mn,{isOpen:o,drawerLeftMargin:new Fn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Xn,{})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:G,isAdmin:v,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{Ie(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:it,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...mt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&Ve(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=N($n)`
64
+ `,ta=q((function(e,t){const n=ze(e,O,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=be(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,y=an(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:k,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:O,spendManagementEndPoint:`${Un}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Ge(o))},onSubtabChange:o=>{e(z()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=Z(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=Z(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;k?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Z(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(un({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(dn(o))},onFiltersChange:o=>{e(cn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&k.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&k.trackSpendManagementDownloadClick("reimbursement"),e(mn({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(ln(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(rn(o,a??""));break;case"send_for_approval":e(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(on(!1))},onEventReceived:o=>{o===st&&e(sn())}}}))(jn(Dn));function na(){const e=Q(),t=de(),n=H(),r=n.state,d=Qe(),[c,m]=f.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=qt(r.tab.toString());S!=null?t(Ge(S)):console.log("Warning:Not a valid remiListTab");const G=Kt(r.subTab.toString());G!=null?t(Oe(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}}),[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=w((S=>V(S))),[x,F]=f.useState(!1),[v,D]=f.useState(!1),B=ne(),A=B?.loggedInUserRole?.includes("admin")===!0,R=w((S=>ze(S,O,h))),{areTenantIdsInSync:g}=Tn(),U=R.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=Se({mobileExploreReferrer:"Reimbursement List"});if(Je({isDataReady:U==="Completed"}),f.useEffect((()=>{!v&&g&&(D(!0),t(le(O,!0,l,!1,!0)))}),[v,O,t,g]),T==null)throw Error("Can't access address page without signing in...");const I=!!u?.userRole&&Jt(u),p=ge(B?.loggedInUserRoleMap),W=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,K=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w((S=>Le(S.companyState,u.companyId))),it=ie?.company.featuresActivationInfo.connectedAccountProvider,Re=S=>{F(S)},{isFeatureEnabled:ot}=a(E.isDebitCardFeatureEnabled),rt=Ze(ot,u),lt=He(u),{remisProcessed:J,remisProcessing:Ie}=w((S=>Xt(S)));f.useEffect((()=>{J===Ie&&c!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:J>1?De.reports:De.report},{variableName:"_has_",variableValue:J>1?je.texts.have:je.texts.has},{variableName:"_action_",variableValue:en(c)}]})),t(tn()),setTimeout((()=>{t(le(O,!0,l,!1,!0,!0))}),3e3),m(null))}),[J,Ie]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,G,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):G.entity_type==="reimbursement"&&(m(G.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(et,{}):K&&(!I||p)||W&&ae?s.jsxs(s.Fragment,{children:[U==="Completed"?s.jsx(te,{analytics:k,onLoad:S=>(G=>G.trackPageLoaded(Xe.Event.reimbursementHome))(S)}):null,s.jsx(nt,{isAppContentDrawerOpen:x,handleDrawerToggle:Re}),s.jsxs(ea,{windowSize:d,children:[s.jsx(Mn,{isOpen:o,drawerLeftMargin:new Fn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Xn,{})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:O,isAdmin:A,isEmployee:I,entity:"reimbursement",onClickMenuIcon:()=>{Re(!0)},createdByUserList:R.createdByUserList,createdByUserListFetchState:R.createdByUserListFetchState,isDownloadEnabled:R.isDownloadEnabled,connectedAccountProvider:it,isBulkActionEnabled:h,bulkSubmissionLimit:R.remiBulkSubmissionLimit,bulkSubmissionFetchState:R.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...mt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&Ve(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=N($n)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,oa=q((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:pn(e,n),analytics:A,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(gn(n))},onCreateNewRemiButtonClick:()=>{e(bn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Ln),ra=()=>{const e=H(),t=Q(),{tenantEmailDomain:n}=Y(),r=Ye(),[d,c]=f.useState(!1),m=w((k=>V(k))),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,F=k=>{c(k)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:A,onLoad:k=>(D=>D.trackPageLoaded(Xe.Event.reimbursementPromoPage))(k)}),s.jsx(nt,{isAppContentDrawerOpen:d,handleDrawerToggle:F}),s.jsx(oa,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{F(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function $a(){const e=w((ie=>V(ie))),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ye(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=Ze(a,e),l=Qe(e),b=e?.userRole!=null&&hn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&fn(t?.loggedInUserRoleMap),h=Sn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=ge(t?.loggedInUserRoleMap),x=T&&u,F=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,k=F&&In(t?.loggedInUserRoleMap),D=Pn(e,o,a)&&!b,B=D&&Rn(t?.loggedInUserRoleMap),v=yn(t?.loggedInUserRoleMap),I=kn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),U=F&&I,L=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,$=vn(t?.loggedInUserRoleMap),R=Cn(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),W=D&&$,{tenantEmailDomain:ae}=Y(),K=Q(),se=n===!0&&(u||p&&c);return s.jsxs(dt,{children:[K.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(ra,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(_n,{}):s.jsx(Nn,{showZeniAccountRoute:U,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:L,isTenantBankingOnly:i,showChargeCardRoute:W,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(et,{})}),t!=null&&Ve(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):K.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Fe,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Fe,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{$a as default};
68
+ `,oa=q((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:pn(e,n),analytics:k,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(gn(n))},onCreateNewRemiButtonClick:()=>{e(bn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Ln),ra=()=>{const e=Q(),t=H(),{tenantEmailDomain:n}=Y(),r=Ye(),[d,c]=f.useState(!1),m=w((v=>V(v))),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,F=v=>{c(v)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:v=>(D=>D.trackPageLoaded(Xe.Event.reimbursementPromoPage))(v)}),s.jsx(nt,{isAppContentDrawerOpen:d,handleDrawerToggle:F}),s.jsx(oa,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{F(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function $a(){const e=w((ie=>V(ie))),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ye(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=Ze(a,e),l=He(e),b=e?.userRole!=null&&hn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&fn(t?.loggedInUserRoleMap),h=Sn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=ge(t?.loggedInUserRoleMap),x=T&&u,F=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,v=F&&Rn(t?.loggedInUserRoleMap),D=Pn(e,o,a)&&!b,B=D&&In(t?.loggedInUserRoleMap),A=yn(t?.loggedInUserRoleMap),R=vn(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),U=F&&R,L=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,$=An(t?.loggedInUserRoleMap),I=Cn(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),W=D&&$,{tenantEmailDomain:ae}=Y(),K=H(),se=n===!0&&(u||p&&c);return s.jsxs(dt,{children:[K.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:A,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:A,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(ra,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(_n,{}):s.jsx(Nn,{showZeniAccountRoute:U,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:p,showTreasuryRoute:L,isTenantBankingOnly:i,showChargeCardRoute:W,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(et,{})}),t!=null&&Ve(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):K.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Fe,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Fe,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{$a as default};
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-DxMhjnNF.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as H}from"./core-lpqyfl_C.js";import{eW as L,fS as w,ME as Te,kA as J,r3 as X,rU as O,ko as Re,js as Me,vr as K,rZ as Ae,bs as Oe,MF as Fe,bn as ke,wA as De,MG as je,MH as Ee,vj as Pe,MI as Y,MJ as Le,MK as Be,ML as ve,MM as Ue,MN as I,MO as F,MP as k,MQ as N,MR as D,MS as j,dI as Ve,wg as xe,w4 as $,w5 as q,wm as ze,w9 as Z,ws as Ge,MT as He,MU as Ye,MV as Ne,MW as $e,MX as qe,fD as Ze,fB as Qe}from"./zeni-epic-state-D-kJk6oz.js";import{Q as We,U as Je,W as Xe,Y as Ke,J as ea,A as ee,X as E,z as ae,Z as aa,T as sa,a as ta,$ as oa,a0 as na,_ as ra,c as P,f as ia,a1 as la,s as se,a2 as ca,a3 as da,a4 as pa}from"./index-CuLyKa_Q.js";import"./mui-AVGOiy8R.js";import fa from"./NotFoundScreen-ByEXcHxY.js";import{F as ma}from"./FeaturePreviewScreen-Bf8p9qA6.js";import{a as _}from"./sentry-Dg7lI3nb.js";import{u as ua}from"./useInitialThreadRequest-Q2ekueW0.js";import{t as Q,a as W,b as _a}from"./routePaths-Cu5maDQS.js";import{M as ha}from"./MobileAppDrawer-DqPaZqu1.js";import"./recharts-BBgS6uq0.js";import"./analytics-BVZAGmSf.js";import"./plaid-4b1bk5sk.js";import"./dnd-xbSIuUzo.js";import"./stripe-cKAAJElX.js";import"./lottie-_pZcYgWm.js";import"./lexical-BzDpQEY5.js";import"./pdf--GzjqSbO.js";import"./utils-CXbpoo9S.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]="29077c3a-c1e5-4943-a86e-45bf09ca6130",e._sentryDebugIdIdentifier="sentry-dbid-29077c3a-c1e5-4943-a86e-45bf09ca6130")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e($e()),e(qe())},ga=Ie((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=w(e),r=Fe(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:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(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(xe({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,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(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(k({scrollPosition:s}));break;case"cash_flow":e(F({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(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(ve({viewMode:a})),e(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:v}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(v?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),U=d((n=>J(n))),M=d((n=>X(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),A=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(O(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!B&&C==="Completed"&&h&&(s(O(c.userId,!1,!0,!1)),te(!0))}),[i,B,C,h]),_.useEffect((()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,A,h,U,M]);const V=sa(),de=V?.loggedInUserRole!=null&&Oe(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=We(he??"")==="reports",be=Je(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);Xe({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:v,initialOpenThreadRequest:re})]})}const S=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 za(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(Ca,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-B6veqs_8.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as N}from"./core-D-w0syUt.js";import{eZ as L,fV as w,MM as Te,kG as X,rb as J,s0 as A,ku as Re,jy as Me,vz as K,s5 as Oe,bs as Ae,MN as Fe,bn as ke,wI as De,MO as je,MP as Ee,vr as Pe,MQ as Y,MR as Le,MS as ve,MT as Be,MU as Ve,MV as I,MW as F,MX as k,MY as H,MZ as D,M_ as j,dI as Ue,wo as xe,wc as $,wd as Z,wu as ze,wh as q,wA as Ge,M$ as Ne,N0 as Ye,N1 as He,N2 as $e,N3 as Ze,fG as qe,fE as Qe}from"./zeni-epic-state-DyOMcw4f.js";import{U as We,W as Xe,X as Je,Z as Ke,J as ea,A as ee,c as E,z as ae,_ as aa,e as sa,a as ta,$ as oa,a0 as na,F as ra,f as P,h as ia,a1 as la,v as se,a2 as ca,a3 as da,a4 as pa}from"./index-DtTeUJqK.js";import"./mui-CvZ4Namd.js";import fa from"./NotFoundScreen-B35T6J3X.js";import{F as ma}from"./FeaturePreviewScreen-DQZK8Tkd.js";import{a as _}from"./sentry-BW637Fua.js";import{u as ua}from"./useInitialThreadRequest-BMYYqer4.js";import{t as Q,a as W,b as _a}from"./routePaths-BXH8zPZv.js";import{M as ha}from"./MobileAppDrawer-BSqYxsX2.js";import"./recharts-CCZTRBr_.js";import"./analytics-B6nQWxMm.js";import"./plaid-DOxsEQPt.js";import"./dnd-Dt7EosAi.js";import"./stripe-cKAAJElX.js";import"./lottie-HMB6u1mD.js";import"./lexical-BvIUj_Gq.js";import"./pdf-DTyc8UuT.js";import"./utils-BAwT1yty.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]="e47ee269-4a54-48ef-a02e-4f61d8418710",e._sentryDebugIdIdentifier="sentry-dbid-e47ee269-4a54-48ef-a02e-4f61d8418710")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(He()),e($e()),e(Ze())},ga=Ie((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=w(e),r=Fe(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:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:X(e),isAccountingProjectsEnabled:J(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ne(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(Z(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(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(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(Z(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(xe({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,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(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(H({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({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(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({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(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>X(n))),M=d((n=>J(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),O=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!v&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))}),[i,v,C,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":M&&s(K());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=We(he??"")==="reports",be=Xe(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);Je({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=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 za(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=qe(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(N,{path:"/",element:p.jsx(Ca,{})}),p.jsx(N,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-B6veqs_8.js";import{z as w,F as S,f as u,h as E,da as k,A as I,c as C}from"./index-DtTeUJqK.js";import"./mui-CvZ4Namd.js";import g from"./NotFoundScreen-B35T6J3X.js";import{a as l}from"./sentry-BW637Fua.js";import{u as D,j as h,h as F,g as U,n as L,o as T,p as d,N as y}from"./core-D-w0syUt.js";import{eZ as _,U1 as j,U2 as p,w3 as P,fM as V,U3 as z,w1 as A}from"./zeni-epic-state-DyOMcw4f.js";import"./recharts-CCZTRBr_.js";import"./analytics-B6nQWxMm.js";import"./plaid-DOxsEQPt.js";import"./dnd-Dt7EosAi.js";import"./stripe-cKAAJElX.js";import"./lottie-HMB6u1mD.js";import"./lexical-BvIUj_Gq.js";import"./pdf-DTyc8UuT.js";import"./utils-BAwT1yty.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]="6764d1ab-dda2-4a22-adc7-cecf6d352906",e._sentryDebugIdIdentifier="sentry-dbid-6764d1ab-dda2-4a22-adc7-cecf6d352906")}catch{}})();const G=L((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=w.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(A())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),M=()=>{const e=D(),[t,n]=l.useState(!1),[i,s]=l.useState(!1),r=h((o=>_(o))),c=F(),x=U(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),b=f?.firstName!=null?f.firstName:"User";l.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),l.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(S,{analytics:u,onLoad:o=>(N=>N.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:c,location:x,currentTenant:r,companyName:v,userName:b,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(M,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-V58yuU0O.js","assets/sentry-BW637Fua.js","assets/core-D-w0syUt.js","assets/zeni-epic-state-DyOMcw4f.js","assets/index-DtTeUJqK.js","assets/mui-CvZ4Namd.js","assets/analytics-B6nQWxMm.js","assets/utils-BAwT1yty.js","assets/withTransactionSidePanel-CRqIqwQF.js","assets/useAskAiCfoHostNavButtonProps-aY04YP0S.js","assets/TransactionDetailScreen-Y2A-PdMn.js","assets/decodeURIComponentSafe-C7k2Nrj_.js","assets/routePaths-BXH8zPZv.js","assets/NotFoundScreen-B35T6J3X.js","assets/useInitialThreadRequest-BMYYqer4.js","assets/analyticsHelper-Og8Rmx5y.js","assets/CompanyPassportScreen-BFAkEtYn.js","assets/MobileAppDrawer-BSqYxsX2.js","assets/useAiCfoDashboardSuggestedQuestionsChips-C2yPn_Vp.js","assets/FeaturePreviewScreen-DQZK8Tkd.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-DbYnaX3_.js","assets/AddressScreen-B9qIDuai.js","assets/DomesticWireDetailScreen-DV-LDQl5.js","assets/DrawerScreen-CLmFnWBR.js","assets/SetupPagesScreen-BoNxDLXk.js","assets/BusinessVerificationPageScreen-C7ez20uI.js","assets/BillPayApprovalRoutes-pStG307K.js","assets/ReimbursementApprovalRuleDetailScreen-Dds_onx1.js","assets/getLocaleForTenant-DXpgdwm2.js","assets/ReimbursementRoutes-Br35P7Ex.js","assets/ReimbursementApprovalRoutes-xDcJz-Qa.js","assets/TransactionListRoutes-DV5L4e1G.js","assets/ZeniAccountStatementScreen-COiOGQqB.js","assets/SettingsRoutes-BTJJZw7w.js","assets/accountMappingHelper-Bc02_HWR.js","assets/useEmailConnectResultRefresh-D1no2UPa.js","assets/QBOConnectionScreen-BY-ET0xU.js","assets/empty-DF-g8Byo.js","assets/index-Cf0JRE_u.js","assets/url-CCU74SLo.js","assets/index-CnDcHHGX.js","assets/ReportsRoutes-DlFjy5j4.js","assets/ChargeCardRoutes--zXOSegl.js","assets/useChargeCardPusherEvents-D2Li6UoT.js","assets/PeopleRoutes-tvVCUcKN.js","assets/ExpenseAutomationRoutes-DxTIqyhg.js","assets/TreasuryRoutes-foYlsfsF.js","assets/useCashManagementBanner-mgRwIUZG.js","assets/VendorsRoutes-B1TOelcz.js","assets/pathToGoBack-BAEsrU0U.js","assets/ZeniAccountRoutes-Cs3s5yj2.js","assets/AddressRoutes-Dd5BLPNk.js","assets/PandLWithForecastRoutes-DL85XT-N.js","assets/CustomerOnboardingRoutes-DXqGvG-i.js","assets/TransactionDetailRoutes-C2A6Ai04.js","assets/EntityDetailRoutes-D-VExL9R.js","assets/NotificationRoutes-BSEbFYc7.js","assets/PerformanceRoutes-CRPowUNZ.js","assets/RewardsRoutes-ybfqamBR.js","assets/TaskRoutes-DK4tCNck.js","assets/TaskListScreen-eY2qEexK.js","assets/AiCfoScreen-vunuko6i.js","assets/CardsAiCfoScreen-gbRXVqr8.js"])))=>i.map(i=>d[i]);
2
+ import{_ as t,bn as us,eZ as ds,fG as cs,fE as ms,go as _s,ft as hs,cW as pe,cC as Es,fW as ps,cu as Rs,bE as xs,bo as gs,f_ as Is,v as js,Mi as Ts,bs as As,Mj as fs,bK as ys,bJ as Ds,bt as bs,cq as Cs,Mk as vs,Ml as Us,cS as ws,cV as Os,cU as Ps,cB as Fs,cI as Ls,oi as Re,fC as xe,gy as ks,g2 as ge,gv as Ie,gw as je,g3 as Bs}from"./zeni-epic-state-DyOMcw4f.js";import{j as e}from"./liveblocks-B6veqs_8.js";import{a as O}from"./sentry-BW637Fua.js";import{u as Hs,h as Vs,i as Ss,g as Ns,j as G,l as Te,N as u,o as Ms,p as a}from"./core-D-w0syUt.js";import{y as Zs,u as Gs,z as y,A as zs,a as $s,n as Ws,c as z,i as Ys,d as qs,e as Js,L as F,O as Ae,t as _,P as Ks,f as X,l}from"./index-DtTeUJqK.js";import"./mui-CvZ4Namd.js";import{f as fe}from"./analyticsHelper-Og8Rmx5y.js";import{t as Qs}from"./getLocaleForTenant-DXpgdwm2.js";import"./recharts-CCZTRBr_.js";import"./analytics-B6nQWxMm.js";import"./plaid-DOxsEQPt.js";import"./dnd-Dt7EosAi.js";import"./stripe-cKAAJElX.js";import"./lottie-HMB6u1mD.js";import"./lexical-BvIUj_Gq.js";import"./pdf-DTyc8UuT.js";import"./utils-BAwT1yty.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},T=new o.Error().stack;T&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[T]="9c5dc939-e50e-4d82-adf7-2c14b3fce4da",o._sentryDebugIdIdentifier="sentry-dbid-9c5dc939-e50e-4d82-adf7-2c14b3fce4da")}catch{}})();const Xs={dashboard:()=>t((()=>import("./DashboardRoutes-V58yuU0O.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:()=>t((()=>import("./BillPayRoutes-DbYnaX3_.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-Br35P7Ex.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-DV5L4e1G.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-BTJJZw7w.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-DlFjy5j4.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes--zXOSegl.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-tvVCUcKN.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-DxTIqyhg.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-foYlsfsF.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-B1TOelcz.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-Cs3s5yj2.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},st=l((()=>t((()=>import("./ReportsRoutes-DlFjy5j4.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),tt=l((()=>t((()=>import("./AddressRoutes-Dd5BLPNk.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),nt=l((()=>t((()=>import("./PeopleRoutes-tvVCUcKN.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),at=l((()=>t((()=>import("./PandLWithForecastRoutes-DL85XT-N.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),ot=l((()=>t((()=>import("./CustomerOnboardingRoutes-DXqGvG-i.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),rt=l((()=>t((()=>import("./VendorsRoutes-B1TOelcz.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),it=l((()=>t((()=>import("./TransactionDetailRoutes-C2A6Ai04.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),ye=l((()=>t((()=>import("./EntityDetailRoutes-D-VExL9R.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),lt=l((()=>t((()=>import("./DashboardRoutes-V58yuU0O.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),De=l((()=>t((()=>import("./BillPayRoutes-DbYnaX3_.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),ut=l((()=>t((()=>import("./SettingsRoutes-BTJJZw7w.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),be=l((()=>t((()=>import("./ReimbursementRoutes-Br35P7Ex.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),dt=l((()=>t((()=>import("./ZeniAccountRoutes-Cs3s5yj2.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),ct=l((()=>t((()=>import("./TreasuryRoutes-foYlsfsF.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),mt=l((()=>t((()=>import("./TransactionListRoutes-DV5L4e1G.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),_t=l((()=>t((()=>import("./ChargeCardRoutes--zXOSegl.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),ht=l((()=>t((()=>import("./NotificationRoutes-BSEbFYc7.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),Et=l((()=>t((()=>import("./PerformanceRoutes-CRPowUNZ.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),pt=l((()=>t((()=>import("./ExpenseAutomationRoutes-DxTIqyhg.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),Rt=l((()=>t((()=>import("./RewardsRoutes-ybfqamBR.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-DK4tCNck.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),gt=l((()=>t((()=>import("./AiCfoScreen-vunuko6i.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-gbRXVqr8.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),b=l((()=>t((()=>import("./NotFoundScreen-B35T6J3X.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),It=l((()=>t((()=>import("./TaskListScreen-eY2qEexK.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function Nt({setTenantEmailDomain:o}){const T=Hs(),H=Vs(),{tenantEmailDomain:i}=Ss(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Gs(),v=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),se=us(I),$=Ns(),[V,Pe]=O.useState(!1),r=G((n=>ds(n))),{useFeatureGate:N}=zs(),M=$s(),te=Ws(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G((n=>n.tenantState.fetchState)),j=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||A==="Completed"?cs(ne,r):void 0,J=j==="Completed"||A==="Completed"?ms(r):void 0,Be=Ys(r,ke,ne),{isCardsHidden:He}=qs(r?.tenantId),Ve=!Be||!!He,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),W=G((n=>_s(n)));if(i!=null){const n=y.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const Z={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=hs(),E=Js(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Me=Es(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=G((n=>Z.tenantId!=null?ps(n,Z.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=Rs(Number(f[0])),s=Number(f[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=gs();c.isAfter(S,"month")===!1?T(Is(v,{month:d,year:s})):H("./month_end_close_checks/review")}}}}),[Q,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!js(ae,Z)&&y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(ks(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=y.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Qs(s)),c?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(Z,I,T,Ze))}),[Z,ae,I,T,y]),O.useEffect((()=>{y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s,c,S,B){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&c?.zeniSessionId!=null,rs=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,ls=d!=null&&d.externalConnections==null;if(Y&&rs){B(ge(s));const q=y.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(je(c.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),B(Ie(c.userId,s))),Y&&ls&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),B(je(c.userId,s)));if(Y){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),B(Bs(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(Re(c.userId,c.zeniSessionId)))}})(A,j,r,v,I,U,T))}),[v,j]),O.useEffect((()=>{y.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Ts(W.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,W.tenantsBaseInOrder))}),[W,A,r,I]),O.useEffect((()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[j,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,(function(n=et,f=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Xs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),f)})())}),[j,V]);const w=r?.userRole!=null&&As(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,We=fs(E?.loggedInUserRoleMap),Ye=r.externalConnections?.accounting[0]?.isValid,qe=r.externalConnections?.fetchState==="Completed",de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&ys(E?.loggedInUserRoleMap),_e=Fe&&!w,Je=Le&&!w,Ke=le&&Ds(E?.loggedInUserRoleMap),Qe=ue&&bs(E?.loggedInUserRoleMap),Xe=_e&&Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),as=Ps(E?.loggedInUserRoleMap),p=Fs(E?.loggedInUserRoleMap),R=Ls(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ts,g=Je&&ns,m=ue&&as,os=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||We===!0||es===!0||ss===!0;return y.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&T(Re(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&qe&&Ye!==!0&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ms,{children:e.jsxs(a,{element:e.jsx(Ks,{}),children:[e.jsx(a,{path:"/",element:e.jsx(jt,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(lt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(st,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:os||P?e.jsx(nt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(at,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(ot,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(it,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(mt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(ye,{entityType:"customer"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(ye,{entityType:"vendor"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(It,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Ke||me||Xe||Qe?e.jsx(tt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(ct,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(pt,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(ht,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(ut,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(_t,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(gt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const jt=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:H,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):H?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},D=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:H,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(At,{tenantEmailDomain:C}):H?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(b,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),At=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{D as FallBackRoute,Nt as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-DxMhjnNF.js";import{a as u}from"./sentry-Dg7lI3nb.js";import{h as L,g as $,u as U,j as y,s as re,n as G,i as H,o as ne,p as v}from"./core-lpqyfl_C.js";import{bn as De,eW as P,gq as Te,n2 as le,Ov as Me,hG as he,Om as Ue,r3 as _e,kA as be,m_ as Be,hI as Re,Oo as Fe,On as Oe,QL as Ve,zy as ze,E$ as Le,Qk as Ne,Qt as Qe,c7 as ae,cN as $e,cO as Ge,bs as He,Mn as Ze,x_ as Ke,QM as qe,Hq as We,EH as Je,Ey as ye,Ev as Xe,y2 as Se,EB as Ce,EE as Ie,EK as oe,uo as se,y1 as Ye,kc as J,kf as Ae,QN as en,lg as nn,yh as tn,Ne as an,Nf as on,ka as sn,QO as cn,kd as rn,rx as ln,N9 as dn,Na as un,rB as pn,hr as gn,Mv as ee,hj as de,hg as mn,ho as fn,Mw as hn,ye as bn,QP as yn,QQ as Sn,EY as Cn,fB as Ee,fD as xe,QR as In,ge as An,MF as En,yd as ue,gj as pe,gi as xn,yc as vn,gh as kn,gg as wn,QS as jn,fG as ve,QT as Pn,QU as Dn,yk as Tn,yb as ge,QV as Mn,fW as Un,y8 as _n,b_ as Bn,c6 as Rn,c5 as Fn,b$ as On,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as Qn}from"./zeni-epic-state-D-kJk6oz.js";import{A as X,X as O,z as w,ag as ke,bR as $n,c as Z,f as Gn,bC as Hn,T as K,B as ie,bS as Zn,i as we,l as je,bT as Kn,ar as qn,j as Pe,bU as Wn,bV as Jn,bW as Xn,Z as Yn,bX as et,s as nt,bY as tt}from"./index-CuLyKa_Q.js";import{n as V}from"./mui-AVGOiy8R.js";import{M as R}from"./MobileAppDrawer-DqPaZqu1.js";import{a as q,g as W,m as at}from"./accountMappingHelper-BWbl_Mr6.js";import{t as ot,A as st}from"./AddressScreen-Bwb2AT1P.js";import Q from"./NotFoundScreen-ByEXcHxY.js";import{g as it}from"./analyticsHelper-DZApVryU.js";import{B as ct}from"./BusinessVerificationPageScreen-Bsm9CkGv.js";import{C as rt}from"./CompanyPassportScreen-BHfvnSz2.js";import{u as lt,a as dt}from"./useEmailConnectResultRefresh-C6v7HzT7.js";import{q as me}from"./QBOConnectionScreen-BePcKt2I.js";import{B as ut}from"./BillPayApprovalRoutes-B4banQ09.js";import{R as pt}from"./ReimbursementApprovalRoutes-BbtlGccW.js";import"./recharts-BBgS6uq0.js";import"./analytics-BVZAGmSf.js";import"./plaid-4b1bk5sk.js";import"./dnd-xbSIuUzo.js";import"./stripe-cKAAJElX.js";import"./lottie-_pZcYgWm.js";import"./lexical-BzDpQEY5.js";import"./pdf--GzjqSbO.js";import"./utils-CXbpoo9S.js";import"./routePaths-Cu5maDQS.js";import"./empty-Dcg7CF8X.js";import"./pdf-lib-BWfnoXie.js";import"./index-Dqe0xDu6.js";import"./url-CpEGpwjz.js";import"./index-CFknKb_z.js";import"./decodeURIComponentSafe-miEPY4cs.js";import"./ReimbursementApprovalRuleDetailScreen-BFSR8IP5.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]="8264165b-e17d-4d05-a32a-20f42e6120c6",e._sentryDebugIdIdentifier="sentry-dbid-8264165b-e17d-4d05-a32a-20f42e6120c6")}catch{}})();const gt=V.div`
1
+ import{j as o}from"./liveblocks-B6veqs_8.js";import{a as u}from"./sentry-BW637Fua.js";import{h as L,g as Q,u as U,j as y,s as le,n as G,i as Z,o as ne,p as v}from"./core-D-w0syUt.js";import{bn as De,eZ as P,gt as Te,n8 as re,OD as Me,hJ as he,Ou as Ue,rb as _e,kG as be,n4 as Fe,hL as Re,Ow as Be,Ov as Oe,QT as Ve,zG as ze,F7 as Le,Qs as Ne,QB as $e,c7 as ae,cN as Qe,cO as Ge,bs as Ze,Mv as He,y6 as Je,QU as Ke,Hy as We,EP as Xe,EG as ye,ED as Ye,ya as Se,EJ as Ce,EM as Ie,ES as oe,uw as se,y9 as qe,ki as X,kl as Ae,QV as en,lm as nn,yp as tn,Nm as an,Nn as on,kg as sn,QW as cn,kj as ln,rF as rn,Nh as dn,Ni as un,rJ as pn,hu as gn,MD as ee,hm as de,hj as mn,hr as fn,ME as hn,ym as bn,QX as yn,QY as Sn,F4 as Cn,fE as Ee,fG as xe,QZ as In,gh as An,MN as En,yl as ue,gm as pe,gl as xn,yk as vn,gk as wn,gj as kn,Q_ as jn,fJ as ve,Q$ as Pn,R0 as Dn,ys as Tn,yj as ge,R1 as Mn,fZ as Un,yg as _n,b_ as Fn,c6 as Rn,c5 as Bn,b$ as On,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as $n}from"./zeni-epic-state-DyOMcw4f.js";import{A as Y,c as O,z as k,ag as we,bR as Qn,f as H,h as Gn,bC as Zn,e as J,E as ie,bS as Hn,i as ke,d as je,bT as Jn,ar as Kn,m as Pe,bU as Wn,bV as Xn,bW as Yn,_ as qn,bX as et,v as nt,bY as tt}from"./index-DtTeUJqK.js";import{n as V}from"./mui-CvZ4Namd.js";import{M as R}from"./MobileAppDrawer-BSqYxsX2.js";import{a as K,g as W,m as at}from"./accountMappingHelper-Bc02_HWR.js";import{t as ot,A as st}from"./AddressScreen-B9qIDuai.js";import $ from"./NotFoundScreen-B35T6J3X.js";import{g as it}from"./analyticsHelper-Og8Rmx5y.js";import{B as ct}from"./BusinessVerificationPageScreen-C7ez20uI.js";import{C as lt}from"./CompanyPassportScreen-BFAkEtYn.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-D1no2UPa.js";import{q as me}from"./QBOConnectionScreen-BY-ET0xU.js";import{B as ut}from"./BillPayApprovalRoutes-pStG307K.js";import{R as pt}from"./ReimbursementApprovalRoutes-xDcJz-Qa.js";import"./recharts-CCZTRBr_.js";import"./analytics-B6nQWxMm.js";import"./plaid-DOxsEQPt.js";import"./dnd-Dt7EosAi.js";import"./stripe-cKAAJElX.js";import"./lottie-HMB6u1mD.js";import"./lexical-BvIUj_Gq.js";import"./pdf-DTyc8UuT.js";import"./utils-BAwT1yty.js";import"./routePaths-BXH8zPZv.js";import"./empty-DF-g8Byo.js";import"./pdf-lib-HRxxOoqR.js";import"./index-Cf0JRE_u.js";import"./url-CCU74SLo.js";import"./index-CnDcHHGX.js";import"./decodeURIComponentSafe-C7k2Nrj_.js";import"./ReimbursementApprovalRuleDetailScreen-Dds_onx1.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]="0c77b21e-dd9d-4d6f-a499-056a1240d09c",e._sentryDebugIdIdentifier="sentry-dbid-0c77b21e-dd9d-4d6f-a499-056a1240d09c")}catch{}})();const gt=V.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as o}from"./liveblocks-DxMhjnNF.js";import{a as u}from"./sentry-Dg7lI3n
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,mt=G((function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:_e(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}}),(function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:r}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:S,expenseAccount:g}=t,{billPayAccount:l}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:k,accruedExpensesAccount:E}=m,{bankAccount:h,expenseCategory1099:A}=f,_=q(a.accountMappingView.incomeAccountList,S.selectedOption),T=q(a.accountMappingView.expenseAccountList,g.selectedOption),x=q(a.accountMappingView.billPayAccountList,l.selectedOption),B=q(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=W(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=W(a.accountMappingView.fixedAssetsAccountList,k.selectedOptions),F=W(a.accountMappingView.accruedExpensesAccountList,E.selectedOptions),d=W(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,A),M={selectedIncomeAccountId:_?.accountId,selectedExpenseAccountId:T?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:B?.accountId,selectedPrepaidExpensesAccountIds:D.map((j=>j.accountId)),selectedFixedAssetsAccountIds:N.map((j=>j.accountId)),selectedAccruedExpensesAccountIds:F.map((j=>j.accountId)),selectedBankAccounts1099FilingAccountIds:d.map((j=>j.accountId)),selectedExpenseAccounts1099FilingAccountIds:C};e(Oe({data:M}))},onBackClick:()=>{ke(c)===!1?(s("../../dashboard"),e(Fe())):e(he())},onSaveClick:()=>{e(Re()),r&&Z.track(Gn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Be(a.currentTenant.companyId,n))}}}))($n),ft=()=>{const e=L(),a=$(),s=U(),{useFeatureGate:c,useDynamicConfig:r}=X(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=r("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=w.getSignedInUser(),S=De(f),g=y((d=>P(d))),{capitalizableAccounts:l,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:k}=y((d=>{const C=d.tenantState.currentTenantId,M=C!=null?d.tenantState.tenantsById[C]:void 0,j=Te(d.companyState,g.companyId);return{capitalizableAccounts:M?.capitalizableAccounts??null,capitalizableAccountOverrides:M?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}}),re),E=u.useCallback(((d,C)=>{s(le(g.companyId,d,C))}),[s,g.companyId]),h=u.useCallback((d=>{const C={...b??{}},M=Object.entries(d);for(const[z,ce]of M)ce===null?delete C[z]:C[z]=ce;const[j,Y]=M[0]??[];j!=null&&s(le(g.companyId,j,Y,void 0,Object.keys(C).length>0?C:null))}),[s,g.companyId,b]),A=y((d=>Me(d.accountState)),re),_=u.useMemo((()=>{const d={};for(const C of A)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d}),[A]),[T,x]=u.useState(!1),[B,D]=u.useState(!1);u.useEffect((()=>{T===!1&&(s(he()),x(!0))}),[T]);const N=y((d=>Ue(d))),F=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(R,{isAppContentDrawerOpen:B,handleDrawerToggle:F}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&S,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:l,accountNamesById:_,capitalizableAccountOverrides:b,currencySymbol:k,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:E,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:ke(a),onClickMenuIcon:()=>F(!0)})]})},ht=V.div`
9
+ `,mt=G((function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:_e(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}}),(function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:S,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:E}=m,{bankAccount:h,expenseCategory1099:A}=f,_=K(a.accountMappingView.incomeAccountList,S.selectedOption),T=K(a.accountMappingView.expenseAccountList,g.selectedOption),x=K(a.accountMappingView.billPayAccountList,r.selectedOption),F=K(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=W(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=W(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),B=W(a.accountMappingView.accruedExpensesAccountList,E.selectedOptions),d=W(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,A),M={selectedIncomeAccountId:_?.accountId,selectedExpenseAccountId:T?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:F?.accountId,selectedPrepaidExpensesAccountIds:D.map((j=>j.accountId)),selectedFixedAssetsAccountIds:N.map((j=>j.accountId)),selectedAccruedExpensesAccountIds:B.map((j=>j.accountId)),selectedBankAccounts1099FilingAccountIds:d.map((j=>j.accountId)),selectedExpenseAccounts1099FilingAccountIds:C};e(Oe({data:M}))},onBackClick:()=>{we(c)===!1?(s("../../dashboard"),e(Be())):e(he())},onSaveClick:()=>{e(Re()),l&&H.track(Gn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Fe(a.currentTenant.companyId,n))}}}))(Qn),ft=()=>{const e=L(),a=Q(),s=U(),{useFeatureGate:c,useDynamicConfig:l}=Y(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=l("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=k.getSignedInUser(),S=De(f),g=y((d=>P(d))),{capitalizableAccounts:r,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:w}=y((d=>{const C=d.tenantState.currentTenantId,M=C!=null?d.tenantState.tenantsById[C]:void 0,j=Te(d.companyState,g.companyId);return{capitalizableAccounts:M?.capitalizableAccounts??null,capitalizableAccountOverrides:M?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}}),le),E=u.useCallback(((d,C)=>{s(re(g.companyId,d,C))}),[s,g.companyId]),h=u.useCallback((d=>{const C={...b??{}},M=Object.entries(d);for(const[z,ce]of M)ce===null?delete C[z]:C[z]=ce;const[j,q]=M[0]??[];j!=null&&s(re(g.companyId,j,q,void 0,Object.keys(C).length>0?C:null))}),[s,g.companyId,b]),A=y((d=>Me(d.accountState)),le),_=u.useMemo((()=>{const d={};for(const C of A)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d}),[A]),[T,x]=u.useState(!1),[F,D]=u.useState(!1);u.useEffect((()=>{T===!1&&(s(he()),x(!0))}),[T]);const N=y((d=>Ue(d))),B=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(R,{isAppContentDrawerOpen:F,handleDrawerToggle:B}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&S,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:r,accountNamesById:_,capitalizableAccountOverrides:b,currencySymbol:w,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:E,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:we(a),onClickMenuIcon:()=>B(!0)})]})},ht=V.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as o}from"./liveblocks-DxMhjnNF.js";import{a as u}from"./sentry-Dg7lI3n
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,bt=G((function(e,a){const s=P(e),c=Ne(e),r=Qe(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:r,analytics:Z}}),(function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Zn),yt=()=>{const e=L(),a=$(),s=U(),{tenantEmailDomain:c}=H(),[r,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((A=>P(A))),S=y((A=>A.billPaySetupApproverViewState.fetchState)),g=y((A=>A.remiSetupApproverViewState.fetchState)),l=y((A=>Ve(A))),{isApprovalRulesV3Enabled:b,isLoading:I}=Hn(f?.tenantId),k=f.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const E=K();u.useEffect((()=>{p||S!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))}),[p,S,I,b,s]),u.useEffect((()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))}),[t,g,I,b,s]);const h=A=>{n(A)};return E?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:k,currentTenant:f,roleMap:E.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:l.fetchState})},St=V.div`
17
+ `,bt=G((function(e,a){const s=P(e),c=Ne(e),l=$e(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:l,analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Hn),yt=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((A=>P(A))),S=y((A=>A.billPaySetupApproverViewState.fetchState)),g=y((A=>A.remiSetupApproverViewState.fetchState)),r=y((A=>Ve(A))),{isApprovalRulesV3Enabled:b,isLoading:I}=Zn(f?.tenantId),w=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const E=J();u.useEffect((()=>{p||S!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))}),[p,S,I,b,s]),u.useEffect((()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))}),[t,g,I,b,s]);const h=A=>{n(A)};return E?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:w,currentTenant:f,roleMap:E.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:r.fetchState})},St=V.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as o}from"./liveblocks-DxMhjnNF.js";import{a as u}from"./sentry-Dg7lI3n
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ct=G((function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=P(e);return{bankSetupView:qe(e,s,n,t,c,r,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:Z}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:r}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,r,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(Se(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?ye(n,t,i,p):Xe(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Je(r,t,n,i))},onRemoveConnection:n=>{e(We(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Kn),It=()=>{const e=L(),a=$(),s=U(),{tenantEmailDomain:c}=H(),r=K(),{useFeatureGate:n}=X(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,S]=u.useState(!1),g=y((D=>P(D))),l=y((D=>D.settingsViewState.bankConnection.fetchState)),b=$e(g,r?.loggedInUserRoleMap),I=Ge(g,r?.loggedInUserRoleMap),k=g?.userRole!=null&&He(g.userRole),E=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!k,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!k,A=we(g,t,i),_=Ze(g,r?.loggedInUserRoleMap)&&A,{isCardsHidden:T}=je(g?.tenantId),x=g.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect((()=>{f||l==="Completed"||(S(!0),s(Ke(!1)))}),[f,s,l]);const B=D=>{m(D)};return b||E||I||_?o.jsxs(St,{children:[o.jsx(R,{isAppContentDrawerOpen:p,handleDrawerToggle:B}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:E,isChargeCardEnabled:_,isChargeCardsHidden:T,isTreasuryEnabled:h,onClickMenuIcon:()=>{B(!0)}})]}):o.jsx(Q,{})},At=V.div`
25
+ `,Ct=G((function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=P(e);return{bankSetupView:Ke(e,s,n,t,c,l,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,l,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(Se(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?ye(n,t,i,p):Ye(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Xe(l,t,n,i))},onRemoveConnection:n=>{e(We(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Jn),It=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=Z(),l=J(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,S]=u.useState(!1),g=y((D=>P(D))),r=y((D=>D.settingsViewState.bankConnection.fetchState)),b=Qe(g,l?.loggedInUserRoleMap),I=Ge(g,l?.loggedInUserRoleMap),w=g?.userRole!=null&&Ze(g.userRole),E=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!w,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!w,A=ke(g,t,i),_=He(g,l?.loggedInUserRoleMap)&&A,{isCardsHidden:T}=je(g?.tenantId),x=g.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect((()=>{f||r==="Completed"||(S(!0),s(Je(!1)))}),[f,s,r]);const F=D=>{m(D)};return b||E||I||_?o.jsxs(St,{children:[o.jsx(R,{isAppContentDrawerOpen:p,handleDrawerToggle:F}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:l.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:E,isChargeCardEnabled:_,isChargeCardsHidden:T,isTreasuryEnabled:h,onClickMenuIcon:()=>{F(!0)}})]}):o.jsx($,{})},At=V.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as o}from"./liveblocks-DxMhjnNF.js";import{a as u}from"./sentry-Dg7lI3n
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,Et=G((function(e,a){const{companyId:s}=a,c=P(e),r=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||r)&&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:t,stripeKey:Pe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:Z}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:r}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(ye(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ae(n))},handleConfirmCardSetupIntent:n=>{e(rn(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(J())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Wn),xt=()=>{const e=L(),a=$(),s=U(),{tenantEmailDomain:c}=H(),[r,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((h=>P(h))),S=y((h=>h.cardPaymentViewState)),g=y((h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),l=qn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,I=f.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const k=K();u.useEffect((()=>{I!=null&&s(Ye(I,!1))}),[I,s]),u.useEffect((()=>{t||(i(!0),s(J()))}),[t,s]),u.useEffect((()=>{p||(Ae(["card"]),m(!0))}),[p]),u.useEffect((()=>{l==="In-Progress"&&b==="Completed"&&s(J())}),[l,b]);const E=h=>{n(h)};return k?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),o.jsx(Et,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)},googleAPIKey:Pe.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=G((function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map((s=>s.additionalInfo)).filter((s=>s!=null)))}}),(function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="hubspot"))?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{Z.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,r))}}}))(Jn),kt=()=>{const e=L(),a=U(),{tenantEmailDomain:s}=H();lt();const[c,r]=u.useState(!1),n=y((h=>h.tenantState.fetchState)),t=y((h=>P(h))),i=t.companyId??w.getSignedInUserTenant(s)?.companyId,p=w.getSignedInUser(),m=K(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect((()=>{a(ln(te))}),[a]);const[S,g]=u.useState(!1);u.useEffect((()=>{S||(g(!0),a(J()))}),[S,a]);const l=h=>{r(h)},b=y((h=>dn(h,i))),I=y((h=>h.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:k,onAddPlaidAccount:E}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(wt,{children:[o.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:l}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{l(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([h,A])=>[h,A?.message]))),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:k,onAddPlaidAccount:E,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},wt=V.div`
33
+ `,Et=G((function(e,a){const{companyId:s}=a,c=P(e),l=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||l)&&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:t,stripeKey:Pe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,l,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(ye(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ae(n))},handleConfirmCardSetupIntent:n=>{e(ln(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(X())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Wn),xt=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((h=>P(h))),S=y((h=>h.cardPaymentViewState)),g=y((h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),r=Kn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,I=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=J();u.useEffect((()=>{I!=null&&s(qe(I,!1))}),[I,s]),u.useEffect((()=>{t||(i(!0),s(X()))}),[t,s]),u.useEffect((()=>{p||(Ae(["card"]),m(!0))}),[p]),u.useEffect((()=>{r==="In-Progress"&&b==="Completed"&&s(X())}),[r,b]);const E=h=>{n(h)};return w?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:E}),o.jsx(Et,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)},googleAPIKey:Pe.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=G((function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map((s=>s.additionalInfo)).filter((s=>s!=null)))}}),(function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:l,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="hubspot"))?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{H.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,l))}}}))(Xn),wt=()=>{const e=L(),a=U(),{tenantEmailDomain:s}=Z();rt();const[c,l]=u.useState(!1),n=y((h=>h.tenantState.fetchState)),t=y((h=>P(h))),i=t.companyId??k.getSignedInUserTenant(s)?.companyId,p=k.getSignedInUser(),m=J(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect((()=>{a(rn(te))}),[a]);const[S,g]=u.useState(!1);u.useEffect((()=>{S||(g(!0),a(X()))}),[S,a]);const r=h=>{l(h)},b=y((h=>dn(h,i))),I=y((h=>h.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:w,onAddPlaidAccount:E}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(kt,{children:[o.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:r}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([h,A])=>[h,A?.message]))),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:w,onAddPlaidAccount:E,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},kt=V.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -46,7 +46,7 @@ import{j as o}from"./liveblocks-DxMhjnNF.js";import{a as u}from"./sentry-Dg7lI3n
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,Pt=()=>{const e=U(),{tenantEmailDomain:a}=H(),[s,c]=u.useState(!1),r=y((l=>P(l))).companyId??w.getSignedInUserTenant(a)?.companyId,n=w.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=y((l=>yn(l,n.userId))),i=y((l=>Sn(l,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:p}=i,m=l=>{c(l)},f=u.useCallback((l=>{e(se("user_reimbursement_account",l))}),[]),S=u.useCallback((l=>{e(oe(l,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);u.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))}),[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(jt,{children:[o.jsx(R,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Xn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:S,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.div`
49
+ `,Pt=()=>{const e=U(),{tenantEmailDomain:a}=Z(),[s,c]=u.useState(!1),l=y((r=>P(r))).companyId??k.getSignedInUserTenant(a)?.companyId,n=k.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=y((r=>yn(r,n.userId))),i=y((r=>Sn(r,l,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:p}=i,m=r=>{c(r)},f=u.useCallback((r=>{e(se("user_reimbursement_account",r))}),[]),S=u.useCallback((r=>{e(oe(r,l,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);u.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))}),[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(jt,{children:[o.jsx(R,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Yn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:S,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as o}from"./liveblocks-DxMhjnNF.js";import{a as u}from"./sentry-Dg7lI3n
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,fe=({appContent:e})=>{const a=U(),s=L(),c=$(),[r,n]=u.useState(!1),t=y((d=>P(d))),{tenantEmailDomain:i}=t,p=t.companyId??w.getSignedInUserTenant(i)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=X(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=m(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(O.isDebitCardFeatureEnabled),l=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=y((d=>be(d))),I=Ee(t),k=xe(g,t),E=!k&&b,h=we(t,S,g),{isCardsHidden:A}=je(t?.tenantId),_=!h||A,{areTenantIdsInSync:T}=Yn();u.useEffect((()=>{T&&a(In(p,E))}),[p,a,E,T]);const x=y((d=>An(d,E))),B=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=En(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,F=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:F}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:_,isTreasuryDisabled:l===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{F(!0)},isLoading:B,isBankingOnlyTenant:k,isCardsOnlyTenant:I,onAddressClick:d=>{const C=(function(j,Y){let z=`/${j}/settings/my_profile`;return z=z.concat(`/new/${Y}`),z})(i,d),M=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:M}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(wn(d,"MyProfile"))},onResendOtp:d=>{a(kn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&w.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Tt(){const e=U(),a=y((l=>P(l))).companyId,s=y((l=>jn(l))),c=y((l=>ve(l))),r=w.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback((l=>{t(l)}),[]),p=u.useCallback((l=>{e(Pn(l))}),[]),m=u.useCallback((()=>{r?.userEmail!=null&&e(Dn({loggedInUserEmail:r.userEmail}))}),[r?.userEmail]),f=u.useCallback((()=>{e(Tn())}),[]);if(r==null)throw Error("Can't access Notification Settings page without signing in...");const S=u.useCallback((()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(l,a))}),[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback((()=>{e(Mn())}),[]);return u.useEffect((()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(l,a))}}),[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:r,onRefresh:S,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=y((l=>ve(l))),r=y((l=>P(l))),n=K(),t=w.getSignedInUser(),i=U(),{useFeatureGate:p}=X(),{isFeatureEnabled:m}=p(O.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||Un(c.notificationSettings,t.userEmail,m,r);u.useEffect((()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(_n()))}),[c.fetchState,a]);const S=xe(m,r),g=Ee(r);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?Bn(r)?o.jsxs(ne,{children:[Rn(n?.loggedInUserRole??[],m,r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),Fn(n?.loggedInUserRole??[],m,r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Mt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(Pt,{})}),Vn(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:S?"zeni_accounts":g?"charge_cards":it(r,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(rt,{})}),Nn(n?.loggedInUserRole??[],r)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),Qn(n?.loggedInUserRole??[],m,r)&&o.jsx(v,{path:"integrations",element:o.jsx(kt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Tt,{})}),o.jsx(v,{path:"*",element:o.jsx(Q,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx(Q,{})})}):null}function Mt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(yt,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx(Q,{})}),o.jsx(v,{path:"*",element:o.jsx(Q,{})})]})}export{ga as default};
57
+ `,fe=({appContent:e})=>{const a=U(),s=L(),c=Q(),[l,n]=u.useState(!1),t=y((d=>P(d))),{tenantEmailDomain:i}=t,p=t.companyId??k.getSignedInUserTenant(i)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=Y(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=m(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(O.isDebitCardFeatureEnabled),r=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=y((d=>be(d))),I=Ee(t),w=xe(g,t),E=!w&&b,h=ke(t,S,g),{isCardsHidden:A}=je(t?.tenantId),_=!h||A,{areTenantIdsInSync:T}=qn();u.useEffect((()=>{T&&a(In(p,E))}),[p,a,E,T]);const x=y((d=>An(d,E))),F=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=En(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:B}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:_,isTreasuryDisabled:r===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{B(!0)},isLoading:F,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:d=>{const C=(function(j,q){let z=`/${j}/settings/my_profile`;return z=z.concat(`/new/${q}`),z})(i,d),M=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:M}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(kn(d,"MyProfile"))},onResendOtp:d=>{a(wn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&k.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Tt(){const e=U(),a=y((r=>P(r))).companyId,s=y((r=>jn(r))),c=y((r=>ve(r))),l=k.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback((r=>{t(r)}),[]),p=u.useCallback((r=>{e(Pn(r))}),[]),m=u.useCallback((()=>{l?.userEmail!=null&&e(Dn({loggedInUserEmail:l.userEmail}))}),[l?.userEmail]),f=u.useCallback((()=>{e(Tn())}),[]);if(l==null)throw Error("Can't access Notification Settings page without signing in...");const S=u.useCallback((()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}),[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback((()=>{e(Mn())}),[]);return u.useEffect((()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}}),[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:l,onRefresh:S,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=y((r=>ve(r))),l=y((r=>P(r))),n=J(),t=k.getSignedInUser(),i=U(),{useFeatureGate:p}=Y(),{isFeatureEnabled:m}=p(O.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||Un(c.notificationSettings,t.userEmail,m,l);u.useEffect((()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(_n()))}),[c.fetchState,a]);const S=xe(m,l),g=Ee(l);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?Fn(l)?o.jsxs(ne,{children:[Rn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),Bn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Mt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(Pt,{})}),Vn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:S?"zeni_accounts":g?"charge_cards":it(l,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(lt,{})}),Nn(n?.loggedInUserRole??[],l)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),$n(n?.loggedInUserRole??[],m,l)&&o.jsx(v,{path:"integrations",element:o.jsx(wt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Tt,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx($,{})})}):null}function Mt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(yt,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx($,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]})}export{ga as default};