@zeniai/web-app-ui 5.3.46-qa → 5.3.47-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 (133) hide show
  1. package/dist/assets/{AccountMappingScreen-BT617fFT.js → AccountMappingScreen-Euit4Ttk.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-B8f2yDaP.js → ActualMatchingMatchDetailScreen-BBYzjOqh.js} +1 -1
  3. package/dist/assets/AddressRoutes-PvYGzHCA.js +1 -0
  4. package/dist/assets/AddressScreen-DsGvV3N8.js +9 -0
  5. package/dist/assets/{AiCfoScreen-CW5K1JhC.js → AiCfoScreen-DAEPn0_B.js} +1 -1
  6. package/dist/assets/{AppDrawer-D5UtqVeE.js → AppDrawer-D4O6tn5i.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-DwyJret-.js → BillPayApprovalRoutes-BY4P9AKu.js} +1 -1
  8. package/dist/assets/BillPayRoutes-CWc4tAqm.js +119 -0
  9. package/dist/assets/{BusinessVerificationPageScreen-BL6H7JF-.js → BusinessVerificationPageScreen-CSruI1nV.js} +2 -2
  10. package/dist/assets/CardsAiCfoScreen-COoYscKz.js +14 -0
  11. package/dist/assets/{ChargeCardRoutes-Brg8E0b9.js → ChargeCardRoutes-BU6-pfJv.js} +1 -1
  12. package/dist/assets/CompanyPassportScreen-BxoatMVb.js +1 -0
  13. package/dist/assets/ConnectionAuthScreen-zbcvhPbz.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-8IwDeKdF.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-BffNdH_l.js → CustomerOnboardingRoutes-DV3rYEiJ.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-CdQzvjb3.js → DashboardRoutes-D5hdkebN.js} +1 -1
  17. package/dist/assets/{DefaultTenantHome-Bve2xDaJ.js → DefaultTenantHome-DCPi_wXC.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-Dj3JCDGh.js → DomesticWireDetailScreen-DgE28aJN.js} +4 -4
  19. package/dist/assets/{DrawerScreen-CxKP-6Rf.js → DrawerScreen-BihZ_PpN.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-CRL6OrqO.js → EntityDetailRoutes-BqX-J3vM.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-BYSJ88to.js → ExpenseAutomationRoutes-DK-U-YTd.js} +1 -1
  22. package/dist/assets/FeaturePreviewScreen-5SleVFKv.js +1 -0
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-DAHGdPOy.js → HubSpotOAuthCallbackScreen-2RxbRDTZ.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-gj6fT2eX.js → InboxNotificationsProvider-BmF5-_KA.js} +1 -1
  25. package/dist/assets/InvoicingRoutes-D0S6fDxY.js +2 -0
  26. package/dist/assets/{MagicLinkRoutes-CC75kCuL.js → MagicLinkRoutes-C22EnpRm.js} +8 -8
  27. package/dist/assets/MagicLinkSignInScreen-BVf-rLEH.js +12 -0
  28. package/dist/assets/MobileAppDrawer-0YtWXA3B.js +1 -0
  29. package/dist/assets/NotFoundScreen-BkYIKPgh.js +1 -0
  30. package/dist/assets/{NotificationRoutes-njgUFBoj.js → NotificationRoutes-CZQRvVbE.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-BCgV9bma.js → OAuthConsentScreen-Q7ZDvc1F.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-CZ27RjQE.js → PandLWithForecastRoutes-BzO_OgSq.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-BrTP8y76.js → PaymentLinkScreen-B8bPleIr.js} +4 -4
  34. package/dist/assets/{PeopleRoutes-CulbMsz3.js → PeopleRoutes-D_nqmuPM.js} +9 -9
  35. package/dist/assets/PerformanceRoutes-BW6dixVF.js +1 -0
  36. package/dist/assets/{Preview-j2_daqeV.js → Preview-DMLQokX_.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-CbxnK800.js → QBOConnectionScreen-CWU6DFJl.js} +23 -23
  38. package/dist/assets/{ReimbursementApprovalRoutes-DeN7vJtz.js → ReimbursementApprovalRoutes-DAusugdf.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DTKS2oJ9.js → ReimbursementApprovalRuleDetailScreen-phJuB98f.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-_NvdZWfU.js → ReimbursementRoutes-BdJ3oqBf.js} +1 -1
  41. package/dist/assets/{ReportsRoutes-BAGPRsE0.js → ReportsRoutes-CDSCG28G.js} +1 -1
  42. package/dist/assets/RewardsRoutes-CHkOPz1g.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-B5q5sAGy.js → ScheduleDetailsPrepaidExpensesScreen-DnVEpQsK.js} +5 -5
  44. package/dist/assets/{ScreenRoutes-BHHy1uXx.js → ScreenRoutes-BYAPWka6.js} +2 -2
  45. package/dist/assets/{SettingsRoutes-BtUbt9zq.js → SettingsRoutes-BGCz0_nd.js} +3 -3
  46. package/dist/assets/{SetupPagesScreen-D0fdMGb4.js → SetupPagesScreen-DzNRL7Y-.js} +1 -1
  47. package/dist/assets/SignInScreen-BREpWd6T.js +1 -0
  48. package/dist/assets/SignOutScreen-BNCpbut8.js +9 -0
  49. package/dist/assets/TaskListScreen-Br-mxkKM.js +9 -0
  50. package/dist/assets/{TaskRoutes-DpYRDMWP.js → TaskRoutes-CDuiJExM.js} +1 -1
  51. package/dist/assets/TransactionDetailRoutes-CYb-4jKQ.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-CjwF3ORf.js → TransactionDetailScreen-Bp7IFDK0.js} +2 -2
  53. package/dist/assets/{TransactionListRoutes-2fGCqEq5.js → TransactionListRoutes-B6NIJUWk.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-CuPpvoic.js → TreasuryRoutes-BvvMozYl.js} +5 -5
  55. package/dist/assets/{VendorsRoutes-B_Yg40bd.js → VendorsRoutes-DsJ_lcDO.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-ChaM_jYJ.js → WiseConfirmationScreen-Bg5_g49N.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-CfMUrMqe.js → ZeniAccountRoutes-C3fDjuMG.js} +7 -7
  58. package/dist/assets/{ZeniAccountStatementScreen-BgdXcTdx.js → ZeniAccountStatementScreen-CbdRQI0p.js} +1 -1
  59. package/dist/assets/{accountMappingHelper-DWzrp9Pr.js → accountMappingHelper-DqBiQF6x.js} +1 -1
  60. package/dist/assets/{analytics-wktvfErl.js → analytics-D6GpUSOP.js} +1 -1
  61. package/dist/assets/{analyticsHelper-DcvdGte-.js → analyticsHelper-CwB3kQvw.js} +1 -1
  62. package/dist/assets/{core-D6EV-11Y.js → core-B5mDy9pu.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-MQV5aj_5.js → decodeURIComponentSafe-DANuhXnG.js} +1 -1
  64. package/dist/assets/{dnd-CkchuQYc.js → dnd-CGWe1ZMP.js} +1 -1
  65. package/dist/assets/{empty-PZV8n_Ql.js → empty-D0y6rZ_X.js} +1 -1
  66. package/dist/assets/{empty-DQLKD1Hp.js → empty-Dj4ZMRNZ.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-CnlqukSR.js → emptyVideoElement-BbYSqu6F.js} +1 -1
  68. package/dist/assets/epic-mSW644GG.js +2 -0
  69. package/dist/assets/{expenseAutomationHelper-DEOPVtcg.js → expenseAutomationHelper-DBDpSggk.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-C3wVeXiS.js → getLocaleForTenant-DH5Avx3x.js} +1 -1
  71. package/dist/assets/{index-DvW7BRlL.js → index-6nH5LMe4.js} +27459 -27459
  72. package/dist/assets/{index-EnAqWoDC.js → index-6yt3BfRL.js} +1 -1
  73. package/dist/assets/{index-BlnK23AJ.js → index-8s12XWuB.js} +1 -1
  74. package/dist/assets/{index-CBlRXIxp.js → index-BQBXaLiB.js} +1 -1
  75. package/dist/assets/{index-B5kf_qFj.js → index-CI8tXM3D.js} +1 -1
  76. package/dist/assets/{index-CKDPlCKN.js → index-G6Wb7pfX.js} +2 -2
  77. package/dist/assets/{index-qI_nnuux.js → index-fq0DUtem.js} +1 -1
  78. package/dist/assets/{index-8ioAZPP6.js → index-k1-Pd2Ki.js} +1 -1
  79. package/dist/assets/{lexical-C6tQwGBF.js → lexical-DW4lC8Zx.js} +1 -1
  80. package/dist/assets/{liveblocks-DKqwsBQp.js → liveblocks-UOzcPsHa.js} +1 -1
  81. package/dist/assets/{lottie-BwhdO6jl.js → lottie-C5eNvt0I.js} +1 -1
  82. package/dist/assets/{mui-qouWiIWk.js → mui-Do6nLzGb.js} +1 -1
  83. package/dist/assets/{pathToGoBack-DMRqTTJ7.js → pathToGoBack-DP_bGWF-.js} +1 -1
  84. package/dist/assets/{pdf-DcGn_mX8.js → pdf-DjwvAC2g.js} +4 -4
  85. package/dist/assets/{pdf-lib-DndwkHl6.js → pdf-lib-CZXOqgb4.js} +1 -1
  86. package/dist/assets/{plaid-deRHM6gT.js → plaid-0g_vwjSd.js} +1 -1
  87. package/dist/assets/{pusher-BmM2v3Ys.js → pusher-BwlPp2s7.js} +1 -1
  88. package/dist/assets/{react-DZ82GBCj.js → react-Bja4MeVO.js} +1 -1
  89. package/dist/assets/{react-DFunsRdI.js → react-BsXfT48C.js} +1 -1
  90. package/dist/assets/{react-1c5WrJsc.js → react-CU01hiuh.js} +1 -1
  91. package/dist/assets/{react-D6U1M1pt.js → react-Dex3foBA.js} +1 -1
  92. package/dist/assets/{react-DiQLb4cq.js → react-DkYBVdJJ.js} +1 -1
  93. package/dist/assets/{react-QkGRtVkE.js → react-RZilWHYG.js} +1 -1
  94. package/dist/assets/{recharts-C9zWmt1W.js → recharts-uFX1dZS-.js} +1 -1
  95. package/dist/assets/{routePaths-GYFjoelZ.js → routePaths-uBvxqlLY.js} +1 -1
  96. package/dist/assets/{sentry-CxSdF_rC.js → sentry-DHDsO12F.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-CYVrHv_0.js → stripSplatSuffix-CQQXAy0N.js} +1 -1
  98. package/dist/assets/{url-Ej5v3O6d.js → url-BxiN6LKq.js} +1 -1
  99. package/dist/assets/{url-BSgCM0lM.js → url-CLCy7GPP.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-BkDnJbPg.js → useActualMatchingMatchDetail-OCZsPxr6.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D_Ro-9Tt.js → useAiCfoDashboardSuggestedQuestionsChips-D8KJqvT7.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-BsP5fVhq.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-1X1JYShz.js → useChargeCardPusherEvents-BnH8_thb.js} +1 -1
  104. package/dist/assets/{useDeviceId-RToKfM0O.js → useDeviceId-Bi38IJl0.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-dVylO6qh.js → useEmailConnectResultRefresh-Ba8t-BuL.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-BwX5Js6P.js → useInitialThreadRequest-7Q8HJAH2.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-BG0Fkj9k.js +1 -0
  108. package/dist/assets/{utils-D8aAQJhF.js → utils-BsODCDYR.js} +1 -1
  109. package/dist/assets/{withTransactionSidePanel-CPG02lKM.js → withTransactionSidePanel-DK-Ex27L.js} +2 -2
  110. package/dist/assets/{zeni-epic-state-CZbm731W.js → zeni-epic-state-7eY0g-Bc.js} +6 -6
  111. package/dist/index.html +1 -1
  112. package/package.json +3 -3
  113. package/dist/assets/AddressRoutes-kiur36N3.js +0 -1
  114. package/dist/assets/AddressScreen-5ZLJ7_Lf.js +0 -9
  115. package/dist/assets/BillPayRoutes-DFm7lkFc.js +0 -119
  116. package/dist/assets/CardsAiCfoScreen-C-_PDYQc.js +0 -14
  117. package/dist/assets/CompanyPassportScreen-CEuR94fF.js +0 -1
  118. package/dist/assets/ConnectionAuthScreen-uvgGU2za.js +0 -11
  119. package/dist/assets/CustomerOnboardingAuthScreen-C-d3MNce.js +0 -1
  120. package/dist/assets/FeaturePreviewScreen-LeLfD5pA.js +0 -1
  121. package/dist/assets/InvoicingRoutes-CvkWcLdT.js +0 -2
  122. package/dist/assets/MagicLinkSignInScreen-CWvMyhrQ.js +0 -12
  123. package/dist/assets/MobileAppDrawer-DExJFFmi.js +0 -1
  124. package/dist/assets/NotFoundScreen-sryCVGSu.js +0 -1
  125. package/dist/assets/PerformanceRoutes-BYcI02aB.js +0 -1
  126. package/dist/assets/RewardsRoutes-BUOCW-CT.js +0 -1
  127. package/dist/assets/SignInScreen-5_sPhLr0.js +0 -1
  128. package/dist/assets/SignOutScreen-DrcdcbqC.js +0 -9
  129. package/dist/assets/TaskListScreen-OEgAVE9M.js +0 -9
  130. package/dist/assets/TransactionDetailRoutes-eA90CTkf.js +0 -1
  131. package/dist/assets/epic-CVdAQuh9.js +0 -2
  132. package/dist/assets/useAskAiCfoHostNavButtonProps-DV4bjx-y.js +0 -1
  133. package/dist/assets/useTaskManagerAccess-daSMnBbA.js +0 -1
@@ -1 +1 @@
1
- import{j as r}from"./liveblocks-DKqwsBQp.js";import Z from"./NotFoundScreen-sryCVGSu.js";import{a as p}from"./sentry-CxSdF_rC.js";import{h as C,g as N,u as D,j as u,N as V,l as k,n as q,o as g}from"./core-D6EV-11Y.js";import{fF as E,YW as w,Zb as h,Nw as U,Ns as L,Nv as f,Nl as B,ZA as $,Np as z,Ny as F}from"./zeni-epic-state-CZbm731W.js";import{z as T,w as W,c9 as K,q as O,bS as Y,ca as G}from"./index-DvW7BRlL.js";import"./mui-qouWiIWk.js";import{u as H,R as x}from"./ReimbursementApprovalRuleDetailScreen-DTKS2oJ9.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]="06c52fe2-41e2-4e75-8a82-c7cd5fba14f4",e._sentryDebugIdIdentifier="sentry-dbid-06c52fe2-41e2-4e75-8a82-c7cd5fba14f4")}catch{}})();const A="reimbursement-approval-rule-update",J=k((function(e){return{approvalView:w(e),remiSetupApproverViewUpdateData:h(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e($(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(W(K)),M=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,y]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>w(o))),b=u((o=>h(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(y(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${A}`]:[],eventCallback:(o,R,j)=>{o.endsWith(A)&&j.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(V,{to:"../../promo"}):r.jsx(J,{currentTenant:c,location:n,navigate:s,...m})},I="reimbursement-approval-rule-update",P=k((function(e){const s=w(e),n=h(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(I)&&e($(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(F(t,!0))}}}))(W(G)),Q=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=Y(e?.tenantId);return s?r.jsx(X,{isLoading:n}):r.jsx(M,{isLoading:n})},X=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,y]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>w(i)));H();const R=u((i=>h(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{R?.updateStatus.fetchState==="Completed"&&a(U())}),[R]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(y(!0),a(z(!1,!0)))}),[v,b,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,o,a]);const j={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${I}`]:[],eventCallback:(i,ee,_)=>{i.endsWith(I)&&_.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(V,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...j})};function le(){return r.jsxs(q,{children:[r.jsx(g,{path:"/",element:r.jsx(Q,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(Z,{})})]})}export{le as R};
1
+ import{j as r}from"./liveblocks-UOzcPsHa.js";import Z from"./NotFoundScreen-BkYIKPgh.js";import{a as p}from"./sentry-DHDsO12F.js";import{h as C,g as N,u as D,j as u,N as V,l as k,n as z,o as g}from"./core-B5mDy9pu.js";import{fF as E,YW as w,Zb as h,Nw as U,Ns as L,Nv as f,Nl as B,ZA as $,Np as F,Ny as K}from"./zeni-epic-state-7eY0g-Bc.js";import{z as T,w as W,c9 as Y,n as O,bS as q,ca as G}from"./index-6nH5LMe4.js";import"./mui-Do6nLzGb.js";import{u as H,R as x}from"./ReimbursementApprovalRuleDetailScreen-phJuB98f.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]="ab90c930-1b70-42d7-afe3-19de305f8c6f",e._sentryDebugIdIdentifier="sentry-dbid-ab90c930-1b70-42d7-afe3-19de305f8c6f")}catch{}})();const A="reimbursement-approval-rule-update",J=k((function(e){return{approvalView:w(e),remiSetupApproverViewUpdateData:h(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e($(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(W(Y)),M=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,y]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>w(o))),b=u((o=>h(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(y(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${A}`]:[],eventCallback:(o,R,j)=>{o.endsWith(A)&&j.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(V,{to:"../../promo"}):r.jsx(J,{currentTenant:c,location:n,navigate:s,...m})},I="reimbursement-approval-rule-update",P=k((function(e){const s=w(e),n=h(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(I)&&e($(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(K(t,!0))}}}))(W(G)),Q=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=q(e?.tenantId);return s?r.jsx(X,{isLoading:n}):r.jsx(M,{isLoading:n})},X=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,y]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>w(i)));H();const R=u((i=>h(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{R?.updateStatus.fetchState==="Completed"&&a(U())}),[R]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(y(!0),a(F(!1,!0)))}),[v,b,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,o,a]);const j={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${I}`]:[],eventCallback:(i,ee,_)=>{i.endsWith(I)&&_.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(V,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...j})};function le(){return r.jsxs(z,{children:[r.jsx(g,{path:"/",element:r.jsx(Q,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(Z,{})})]})}export{le as R};
@@ -1 +1 @@
1
- import{j as h}from"./liveblocks-DKqwsBQp.js";import{a as f}from"./sentry-CxSdF_rC.js";import{u as U,j as g,h as _,g as O,i as V,l as N}from"./core-D6EV-11Y.js";import{mr as W,Zb as w,YW as x,No as k,NB as B,Nw as A,Nx as E,Zc as j,fF as Z,Nv as z}from"./zeni-epic-state-CZbm731W.js";import{z as F,E as P,a7 as q,c0 as K,q as $,bS as Y,c1 as G}from"./index-DvW7BRlL.js";import"./mui-qouWiIWk.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]="35f50e1f-4700-4bf2-ae76-5f385dde811a",e._sentryDebugIdIdentifier="sentry-dbid-35f50e1f-4700-4bf2-ae76-5f385dde811a")}catch{}})();function H(){const e=U(),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(W({})))}),[p,t,e])}const J=N((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return s.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(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}))),b=u.actors.selectedNonUsers.map((m=>{const y=(I=m.value,j(I)==null);var I;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(b);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:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function M(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>x(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(k(!0)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,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(q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function pe(e){return j(e)==null}const Q=N((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:i,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const I=y.actorKind?.selectedOption,L=y.selectedRole?.selectedNonUsers??[];let D=[];I==="role"?D=L.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):I==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const C=y.action??"require_approval";m.push({action:C,actors:D,operator:D.length>1?C==="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 b=S?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?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`)}}}))(G);function ne(){const e=g((t=>Z(t))),{isApprovalRulesV3Enabled:s}=Y(e?.tenantId);return s?h.jsx(X,{}):h.jsx(M,{})}function X(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>x(n))),[a,d]=f.useState(!1);if(H(),f.useEffect((()=>{a||(d(!0),s(k(!1)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,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(q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(Q,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,pe as i,H as u};
1
+ import{j as h}from"./liveblocks-UOzcPsHa.js";import{a as f}from"./sentry-DHDsO12F.js";import{u as U,j as g,h as _,g as O,i as V,l as N}from"./core-B5mDy9pu.js";import{mr as W,Zb as w,YW as x,No as k,NB as B,Nw as A,Nx as E,Zc as j,fF as Z,Nv as z}from"./zeni-epic-state-7eY0g-Bc.js";import{z as F,E as P,a7 as $,c0 as K,n as q,bS as Y,c1 as G}from"./index-6nH5LMe4.js";import"./mui-Do6nLzGb.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]="b7c91cbd-8473-417f-bb17-e82f919e82a3",e._sentryDebugIdIdentifier="sentry-dbid-b7c91cbd-8473-417f-bb17-e82f919e82a3")}catch{}})();function H(){const e=U(),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(W({})))}),[p,t,e])}const J=N((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return s.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),R=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=I.concat(R);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:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function M(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>x(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(k(!0)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,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:i.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function pe(e){return j(e)==null}const Q=N((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:i,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const b=y.actorKind?.selectedOption,L=y.selectedRole?.selectedNonUsers??[];let D=[];b==="role"?D=L.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):b==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const C=y.action??"require_approval";m.push({action:C,actors:D,operator:D.length>1?C==="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 I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=S?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?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`)}}}))(G);function ne(){const e=g((t=>Z(t))),{isApprovalRulesV3Enabled:s}=Y(e?.tenantId);return s?h.jsx(X,{}):h.jsx(M,{})}function X(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>x(n))),[a,d]=f.useState(!1);if(H(),f.useEffect((()=>{a||(d(!0),s(k(!1)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,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:i.colors.grey5}}):h.jsx(Q,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,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-DKqwsBQp.js";import{u as ae,j as v,h as Q,g as J,i as ie,N as M,l as ee,q as ct,n as dt,o as w}from"./core-D6EV-11Y.js";import{fF as V,Ns as ut,_G as ge,c8 as he,My as Le,ma as pt,MN as ce,MM as de,_H as bt,bn as fe,gV as _e,_I as gt,WF as ht,l$ as $e,WG as Ce,WH as ft,kN as St,YI as It,l0 as yt,Mm as Rt,C5 as vt,kU as At,N7 as Me,_J as Pe,_K as Ee,_L as kt,_M as Ct,_N as Et,MT as we,l6 as wt,YR as xt,ML as Bt,Mw as Tt,_O as Dt,Mv as jt,_P as Ft,MD as xe,MX as Ut,MW as Lt,MS as _t,_Q as Ne,S5 as $t,bo as Mt,MG as Pt,Np as Nt,_R as Ot,_S as Gt,N3 as zt,N0 as Be,Yc as Zt,Mt as Vt,_T as Oe,NS as Te,N_ as Wt,_U as Ht,_V as q,_W as Yt,_X as Ge,_Y as qt,_Z as ze,__ as Ze,Nf as ue,bu as Xt,bK as Se,cM as Ie,d_ as Ve,dZ as We,_$ as Jt,gh as Kt,Yp as Qt,$0 as en,$1 as He,Yt as tn,Zb as nn,$2 as an,ZA as sn,NX as De,NW as on,$3 as rn,$4 as ln,$5 as mn,$6 as cn,$7 as dn,YX as un,NN as pn,NR as bn,bq as gn,bJ as hn,cG as fn,cu as Sn,bt as In,U4 as yn,da as Rn,dd as vn,dc as An,cF as kn}from"./zeni-epic-state-CZbm731W.js";import{bS as Cn,c as Ye,a1 as qe,N as oe,d as x,z as _,cT as Xe,a8 as re,l as C,aS as je,I as F,ae as se,af as En,G as Je,cU as wn,p as X,as as Ke,cV as xn,U as le,cW as Bn,aq as Tn,ab as Dn,a7 as ye,T as Qe,w as jn,bA as Fn,av as Un,ai as Ln,E as et,cX as _n,j as $n}from"./index-DvW7BRlL.js";import{n as P,S as Mn}from"./mui-qouWiIWk.js";import pe from"./NotFoundScreen-sryCVGSu.js";import{S as Fe}from"./SetupPagesScreen-D0fdMGb4.js";import{F as tt}from"./FeaturePreviewScreen-LeLfD5pA.js";import{a as h}from"./sentry-CxSdF_rC.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-DV4bjx-y.js";import{u as nt}from"./useInitialThreadRequest-BwX5Js6P.js";import{D as Pn}from"./DrawerScreen-CxKP-6Rf.js";import{M as at}from"./MobileAppDrawer-DExJFFmi.js";import{F as Nn}from"./ScreenRoutes-BHHy1uXx.js";import{R as On}from"./ReimbursementApprovalRoutes-DeN7vJtz.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./BusinessVerificationPageScreen-BL6H7JF-.js";import"./routePaths-GYFjoelZ.js";import"./analyticsHelper-DcvdGte-.js";import"./InboxNotificationsProvider-gj6fT2eX.js";import"./useTaskManagerAccess-daSMnBbA.js";import"./getLocaleForTenant-C3wVeXiS.js";import"./ReimbursementApprovalRuleDetailScreen-DTKS2oJ9.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]="5c75e5fc-3fda-4ee1-9a1b-d34e2516f67b",e._sentryDebugIdIdentifier="sentry-dbid-5c75e5fc-3fda-4ee1-9a1b-d34e2516f67b")}catch{}})();const st=e=>`/${e}/reimbursements`,Gn=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Y,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Je.getLocalizedStrings(),zn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=_.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=_e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=_.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(_t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ee({}));const i=st(o),l=X(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Me(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Ue(){const e=Q(),t=ae(),n=J(),{reimbursementId:r}=ie(),c=Ye(),d=qe(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=J().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[A,k]=h.useState(!1),E=_.getSignedInUser(),I=v((p=>V(p))),g=v((p=>ge(p,r))),U=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=he(I?.userRole??[]);(function(){const p=ae(),N=v((K=>V(K))),O=N?.tenantId,{isApprovalRulesV3Enabled:G,isLoading:W}=Cn(O),H=v((K=>K.remiSetupApproverViewState.fetchState));h.useEffect((()=>{O==null||W||H==="Not-Started"&&p(ut(!0,!1,!1,G))}),[O,W,G,H,p])})(),h.useEffect((()=>{(j&&!A||D&&!A&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t(Le(!1,b,y,r)))}));const $=v((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==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(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Xe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Hn,{children:[s.jsx(Yn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(zn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const Zn=P.div`
1
+ import{j as s}from"./liveblocks-UOzcPsHa.js";import{u as ae,j as v,h as Q,g as J,i as ie,N as M,l as ee,q as ct,n as dt,o as w}from"./core-B5mDy9pu.js";import{fF as V,Ns as ut,_G as ge,c8 as he,My as Le,ma as pt,MN as ce,MM as de,_H as bt,bn as fe,gV as _e,_I as gt,WF as ht,l$ as $e,WG as Ce,WH as ft,kN as St,YI as It,l0 as yt,Mm as Rt,C5 as vt,kU as At,N7 as Me,_J as Pe,_K as Ee,_L as kt,_M as Ct,_N as Et,MT as we,l6 as wt,YR as xt,ML as Bt,Mw as Tt,_O as Dt,Mv as jt,_P as Ft,MD as xe,MX as Ut,MW as Lt,MS as _t,_Q as Ne,S5 as $t,bo as Mt,MG as Pt,Np as Nt,_R as Ot,_S as Gt,N3 as zt,N0 as Be,Yc as Zt,Mt as Vt,_T as Oe,NS as Te,N_ as Wt,_U as Ht,_V as q,_W as Yt,_X as Ge,_Y as qt,_Z as ze,__ as Ze,Nf as ue,bu as Xt,bK as Se,cM as Ie,d_ as Ve,dZ as We,_$ as Jt,gh as Kt,Yp as Qt,$0 as en,$1 as He,Yt as tn,Zb as nn,$2 as an,ZA as sn,NX as De,NW as on,$3 as rn,$4 as ln,$5 as mn,$6 as cn,$7 as dn,YX as un,NN as pn,NR as bn,bq as gn,bJ as hn,cG as fn,cu as Sn,bt as In,U4 as yn,da as Rn,dd as vn,dc as An,cF as kn}from"./zeni-epic-state-7eY0g-Bc.js";import{bS as Cn,M as Ye,a1 as qe,N as oe,c as x,z as _,cT as Xe,a8 as re,j as C,aS as je,H as F,ae as se,af as En,G as Je,cU as wn,p as X,as as Ke,cV as xn,U as le,cW as Bn,aq as Tn,ab as Dn,a7 as ye,S as Qe,w as jn,bA as Fn,av as Un,ai as Ln,E as et,cX as _n,g as $n}from"./index-6nH5LMe4.js";import{n as P,S as Mn}from"./mui-Do6nLzGb.js";import pe from"./NotFoundScreen-BkYIKPgh.js";import{S as Fe}from"./SetupPagesScreen-DzNRL7Y-.js";import{F as tt}from"./FeaturePreviewScreen-5SleVFKv.js";import{a as h}from"./sentry-DHDsO12F.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-BsP5fVhq.js";import{u as nt}from"./useInitialThreadRequest-7Q8HJAH2.js";import{D as Pn}from"./DrawerScreen-BihZ_PpN.js";import{M as at}from"./MobileAppDrawer-0YtWXA3B.js";import{F as Nn}from"./ScreenRoutes-BYAPWka6.js";import{R as On}from"./ReimbursementApprovalRoutes-DAusugdf.js";import"./recharts-uFX1dZS-.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.js";import"./BusinessVerificationPageScreen-CSruI1nV.js";import"./routePaths-uBvxqlLY.js";import"./analyticsHelper-CwB3kQvw.js";import"./InboxNotificationsProvider-BmF5-_KA.js";import"./useTaskManagerAccess-BG0Fkj9k.js";import"./getLocaleForTenant-DH5Avx3x.js";import"./ReimbursementApprovalRuleDetailScreen-phJuB98f.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]="3634aea4-5d67-4fd4-9b75-f911f85a6bc7",e._sentryDebugIdIdentifier="sentry-dbid-3634aea4-5d67-4fd4-9b75-f911f85a6bc7")}catch{}})();const st=e=>`/${e}/reimbursements`,Gn=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Y,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Je.getLocalizedStrings(),zn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=_.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=_e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=_.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(_t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ee({}));const i=st(o),l=X(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Me(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Ue(){const e=Q(),t=ae(),n=J(),{reimbursementId:r}=ie(),c=Ye(),d=qe(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=J().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[A,k]=h.useState(!1),E=_.getSignedInUser(),I=v((p=>V(p))),g=v((p=>ge(p,r))),U=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=he(I?.userRole??[]);(function(){const p=ae(),N=v((K=>V(K))),O=N?.tenantId,{isApprovalRulesV3Enabled:G,isLoading:W}=Cn(O),H=v((K=>K.remiSetupApproverViewState.fetchState));h.useEffect((()=>{O==null||W||H==="Not-Started"&&p(ut(!0,!1,!1,G))}),[O,W,G,H,p])})(),h.useEffect((()=>{(j&&!A||D&&!A&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t(Le(!1,b,y,r)))}));const $=v((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==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(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Xe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Hn,{children:[s.jsx(Yn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(zn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const Zn=P.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-DKqwsBQp.js";import{g as J,h as Oe,u as De,i as Ue,j as d,l as Ae,n as Pe,o as ee}from"./core-D6EV-11Y.js";import{fF as q,E1 as R,UC as Ee,l$ as le,u6 as ce,uX as U,lG as Ve,lP as A,lH as P,kK as E,kB as V,kA as Le,Db as ie,v0 as Me,bq as Be,UD as ve,bn as xe,Eo as ze,UE as Ge,UF as He,ci as g,D4 as Ye,UG as ae,UH as Ne,UI as $e,UJ as qe,UK as Ze,UL as Ke,UM as Qe,UN as We,UO as Xe,UP as Je,UQ as ea,UR as aa,US as sa,UT as j,UU as L,UV as M,UW as B,UX as v,UY as x,UZ as z,U_ as G,U$ as H,V0 as Y,ei as ta,E2 as oa,DR as se,DS as te,E8 as na,DW as oe,Ee as ra,V1 as la,V2 as ca,V3 as ia,V4 as da,V5 as pa,V6 as _a,V7 as fa,V8 as ma,V9 as ua,Va as ba,d_ as ha,dZ as ya}from"./zeni-epic-state-CZbm731W.js";import{an as Ca,ao as wa,ap as Sa,a as ga,a1 as Ia,N as de,d as N,z as pe,aq as Ra,U as Ta,f as ja,ar as ka,as as Fa,a8 as Oa,l as $,T as Da,y as Ua,p as _e,at as Aa,au as Pa,av as Ea}from"./index-DvW7BRlL.js";import"./mui-qouWiIWk.js";import Va from"./NotFoundScreen-sryCVGSu.js";import{F as La}from"./FeaturePreviewScreen-LeLfD5pA.js";import{a as u}from"./sentry-CxSdF_rC.js";import{u as Ma}from"./useInitialThreadRequest-BwX5Js6P.js";import{t as ne,a as re,b as Ba}from"./routePaths-GYFjoelZ.js";import{M as va}from"./MobileAppDrawer-DExJFFmi.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./InboxNotificationsProvider-gj6fT2eX.js";import"./useTaskManagerAccess-daSMnBbA.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]="566440e7-2ef9-431a-9d47-066e7ec35f5e",e._sentryDebugIdIdentifier="sentry-dbid-566440e7-2ef9-431a-9d47-066e7ec35f5e")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(L({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua()),e(ba())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(m);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,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:$,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(U(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(j(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(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(oa({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=ta(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 f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:k(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(M({scrollPosition:s}));break;case"cash_flow":e(L({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(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(L({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=g(t);l?(e(We({viewMode:a})),e(Xe({viewMode:a}))):r?(e(Je({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",k(t)),e(j(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(j(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(j(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(Ze({classesToFilterOut:a})):I(o.selectedReportID)?e(Ke({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?V():Ye()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(He(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):V(!0))}}}))(Aa);function Ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ga(),_=Ia(),m=Pa(_),a=Oe(),s=De(),t=J(),{tenantEmailDomain:r}=Ue(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,C]=u.useState(!1),[Z,fe]=u.useState(!1),{isFeatureEnabled:K}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const F=d((n=>q(n))),me=F.masterTOSInfo?.isMasterTOSAccepted??!1,ue=F.company?.companyInfo.firstMonthOfFY??1,be=Ma(K?F?.companyId:void 0),w=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:b}=Ra(),O=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),S=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),D=d((n=>R(n).selectedReportAndTimeframeFetchState)),Ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(C(!0),s(U(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!Z&&w==="Completed"&&b&&(s(U(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,w,b]),u.useEffect((()=>{if(c&&D.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(O){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(ie());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(V());break;case"balance_sheet_by_projects":S&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":S&&s(A());break;case"cash_flow":s(Ve(h.timeframe))}}),[c,O,D,b,T,S]);const Q=Ta(),we=Q?.loggedInUserRole!=null&&Be(Q?.loggedInUserRole)!==!0,[Se,ge]=u.useState(!1),W=n=>{ge(n)},Ie=ja(),Re=ka();return(function(n){const{isDataReady:Te}=n,{pathname:je}=J(),X=Ca(je??"")==="reports",ke=wa(Te),Fe=u.useMemo((()=>X?xa:void 0),[X]);Sa({canFetchSuggestedQuestions:ke,pageContexts:Fe})})({isDataReady:w==="Completed"}),Fa({isDataReady:w==="Completed"}),p.jsxs(p.Fragment,{children:[w==="Completed"?p.jsx(Oa,{analytics:$,onLoad:n=>n.trackPageLoaded(Da.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Se,handleDrawerToggle:W}),p.jsx(Ga,{firstMonthOfFY:ue,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:Ce,selectedReportID:O,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:ye,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:D,handleDrawerToggle:W,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Ua({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:K,initialOpenThreadRequest:be})]})}const k=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ha,{})}),p.jsx(ee,{path:"*",element:p.jsx(Va,{})})]})}export{_s as default};
1
+ import{j as p}from"./liveblocks-UOzcPsHa.js";import{g as J,h as Oe,u as De,i as Ue,j as d,l as Ae,n as Pe,o as ee}from"./core-B5mDy9pu.js";import{fF as q,E1 as R,UC as Ee,l$ as le,u6 as ce,uX as U,lG as Ve,lP as A,lH as P,kK as E,kB as V,kA as Le,Db as ie,v0 as Me,bq as Be,UD as ve,bn as xe,Eo as ze,UE as Ge,UF as He,ci as g,D4 as Ye,UG as ae,UH as Ne,UI as $e,UJ as qe,UK as Ze,UL as Ke,UM as Qe,UN as We,UO as Xe,UP as Je,UQ as ea,UR as aa,US as sa,UT as j,UU as L,UV as M,UW as B,UX as v,UY as x,UZ as z,U_ as G,U$ as H,V0 as Y,ei as ta,E2 as oa,DR as se,DS as te,E8 as na,DW as oe,Ee as ra,V1 as la,V2 as ca,V3 as ia,V4 as da,V5 as pa,V6 as _a,V7 as fa,V8 as ma,V9 as ba,Va as ua,d_ as ha,dZ as ya}from"./zeni-epic-state-7eY0g-Bc.js";import{an as Ca,ao as wa,ap as Sa,a as ga,a1 as Ia,N as de,c as N,z as pe,aq as Ra,U as Ta,e as ja,ar as ka,as as Fa,a8 as Oa,j as $,S as Da,x as Ua,p as _e,at as Aa,au as Pa,av as Ea}from"./index-6nH5LMe4.js";import"./mui-Do6nLzGb.js";import Va from"./NotFoundScreen-BkYIKPgh.js";import{F as La}from"./FeaturePreviewScreen-5SleVFKv.js";import{a as b}from"./sentry-DHDsO12F.js";import{u as Ma}from"./useInitialThreadRequest-7Q8HJAH2.js";import{t as ne,a as re,b as Ba}from"./routePaths-uBvxqlLY.js";import{M as va}from"./MobileAppDrawer-0YtWXA3B.js";import"./recharts-uFX1dZS-.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.js";import"./InboxNotificationsProvider-BmF5-_KA.js";import"./useTaskManagerAccess-BG0Fkj9k.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]="fe07b0ad-0eec-4694-9267-4bba7c91e3eb",e._sentryDebugIdIdentifier="sentry-dbid-fe07b0ad-0eec-4694-9267-4bba7c91e3eb")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(L({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ba()),e(ua())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(m);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,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:$,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(U(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(j(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(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(oa({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=ta(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 f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:k(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(M({scrollPosition:s}));break;case"cash_flow":e(L({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(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(L({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=g(t);l?(e(We({viewMode:a})),e(Xe({viewMode:a}))):r?(e(Je({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",k(t)),e(j(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(j(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(j(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(Ze({classesToFilterOut:a})):I(o.selectedReportID)?e(Ke({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?V():Ye()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(He(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):V(!0))}}}))(Aa);function Ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ga(),_=Ia(),m=Pa(_),a=Oe(),s=De(),t=J(),{tenantEmailDomain:r}=Ue(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,C]=b.useState(!1),[Z,fe]=b.useState(!1),{isFeatureEnabled:K}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const F=d((n=>q(n))),me=F.masterTOSInfo?.isMasterTOSAccepted??!1,be=F.company?.companyInfo.firstMonthOfFY??1,ue=Ma(K?F?.companyId:void 0),w=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:u}=Ra(),O=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),S=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),D=d((n=>R(n).selectedReportAndTimeframeFetchState)),Ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));b.useEffect((()=>{!c&&u&&(C(!0),s(U(i.userId,!0,!0,!1)))}),[c,i,s,u]),b.useEffect((()=>{c&&!Z&&w==="Completed"&&u&&(s(U(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,w,u]),b.useEffect((()=>{if(c&&D.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&u)switch(O){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(ie());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(V());break;case"balance_sheet_by_projects":S&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":S&&s(A());break;case"cash_flow":s(Ve(h.timeframe))}}),[c,O,D,u,T,S]);const Q=Ta(),we=Q?.loggedInUserRole!=null&&Be(Q?.loggedInUserRole)!==!0,[Se,ge]=b.useState(!1),W=n=>{ge(n)},Ie=ja(),Re=ka();return(function(n){const{isDataReady:Te}=n,{pathname:je}=J(),X=Ca(je??"")==="reports",ke=wa(Te),Fe=b.useMemo((()=>X?xa:void 0),[X]);Sa({canFetchSuggestedQuestions:ke,pageContexts:Fe})})({isDataReady:w==="Completed"}),Fa({isDataReady:w==="Completed"}),p.jsxs(p.Fragment,{children:[w==="Completed"?p.jsx(Oa,{analytics:$,onLoad:n=>n.trackPageLoaded(Da.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Se,handleDrawerToggle:W}),p.jsx(Ga,{firstMonthOfFY:be,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:Ce,selectedReportID:O,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:ye,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:D,handleDrawerToggle:W,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Ua({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:K,initialOpenThreadRequest:ue})]})}const k=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ha,{})}),p.jsx(ee,{path:"*",element:p.jsx(Va,{})})]})}export{_s as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-UOzcPsHa.js";import{z as b,a8 as v,j as d,S as D,e4 as E,N as I,c as k}from"./index-6nH5LMe4.js";import"./mui-Do6nLzGb.js";import g from"./NotFoundScreen-BkYIKPgh.js";import{a as m}from"./sentry-DHDsO12F.js";import{u as C,j as h,h as F,g as L,l as T,n as U,o as f,N as y}from"./core-B5mDy9pu.js";import{fF as _,a1M as j,a1N as p,DI as P,p$ as V,a1O as G,DG as z}from"./zeni-epic-state-7eY0g-Bc.js";import"./recharts-uFX1dZS-.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.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]="21a32a39-9741-48cf-9d99-1c63b5ba6c2b",e._sentryDebugIdIdentifier="sentry-dbid-21a32a39-9741-48cf-9d99-1c63b5ba6c2b")}catch{}})();const M=T((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=b.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])})),d.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(G({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&d.trackInviteEmailClicked("cancel")}}}))(E),O=()=>{const e=C(),[t,n]=m.useState(!1),[i,s]=m.useState(!1),r=h((o=>_(o))),c=F(),w=L(),u=b.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>j(o))),x=u?.firstName!=null?u.firstName:"User";m.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),m.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(v,{analytics:d,onLoad:o=>(S=>S.trackPageLoaded(D.Event.inviteEmailViewed))(o)}):null,a.jsx(M,{navigate:c,location:w,currentTenant:r,companyName:N,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(k.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(O,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-DKqwsBQp.js";import{a as A}from"./sentry-CxSdF_rC.js";import{i as G,u as H,h as Q,g as ee,j as h,l as te}from"./core-D6EV-11Y.js";import{WA as Fe,WB as Ve,l$ as ae,sr as Me,sD as Ge,sT as Re,sR as $e,sU as Ke,sW as Ue,WC as Ye,fF as K,Vz as pe,WD as Se,g_ as ne,cB as se,cC as le,F6 as ve,WE as Ce,Fa as We,gO as ce,su as ze,t2 as qe,dD as Ze,dC as Xe,SX as fe,F4 as He,E_ as Qe,WF as De,ES as et,ER as tt,EM as at,EX as nt,Fb as st,WG as Y,WH as ge,ET as lt,VA as oe,Fr as Ae,Fk as Ie,WI as xe,sx as Te,Fe as Be,Fc as be,WJ as Le,Fy as Je,Fv as we,Ff as je,Fx as _e}from"./zeni-epic-state-CZbm731W.js";import{a4 as de,aY as ie,aZ as ct,z as ot,k as dt,a7 as it,a8 as ue,l as N,av as ut,a_ as rt,p as V,G as Ee,c as ke,a$ as ht,b0 as mt,b1 as pt}from"./index-DvW7BRlL.js";import{n as re}from"./mui-qouWiIWk.js";import{p as St}from"./pathToGoBack-DMRqTTJ7.js";import X from"./NotFoundScreen-sryCVGSu.js";import{c as M}from"./routePaths-GYFjoelZ.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]="b5681a82-e4ad-41d0-83be-bda8101de5b3",e._sentryDebugIdIdentifier="sentry-dbid-b5681a82-e4ad-41d0-83be-bda8101de5b3")}catch{}})();function $t({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ve(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?k.jsx(X,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?k.jsx(ie,{}):k.jsx(X,{}):k.jsx(ft,{children:k.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n($e(l,u,r))},onSkip:(u,r)=>{n(Re(l,u,r))}})})}const ft=re.div`
1
+ import{j as y}from"./liveblocks-UOzcPsHa.js";import{a as A}from"./sentry-DHDsO12F.js";import{i as G,u as H,h as Q,g as ee,j as h,l as te}from"./core-B5mDy9pu.js";import{WA as Fe,WB as Ve,l$ as ae,sr as Me,sD as Ge,sT as Re,sR as $e,sU as Ke,sW as Ue,WC as Ye,fF as K,Vz as pe,WD as Se,g_ as ne,cB as se,cC as le,F6 as ve,WE as Ce,Fa as We,gO as ce,su as ze,t2 as qe,dD as Ze,dC as Xe,SX as fe,F4 as He,E_ as Qe,WF as De,ES as et,ER as tt,EM as at,EX as nt,Fb as st,WG as Y,WH as ge,ET as lt,VA as oe,Fr as Ae,Fk as Ie,WI as xe,sx as Te,Fe as Be,Fc as Le,WJ as Je,Fy as we,Fv as be,Ff as je,Fx as _e}from"./zeni-epic-state-7eY0g-Bc.js";import{a4 as de,aY as ie,aZ as ct,z as ot,h as dt,a7 as it,a8 as ue,j as N,av as ut,a_ as rt,p as V,G as Ee,M as ye,a$ as ht,b0 as mt,b1 as pt}from"./index-6nH5LMe4.js";import{n as re}from"./mui-Do6nLzGb.js";import{p as St}from"./pathToGoBack-DP_bGWF-.js";import X from"./NotFoundScreen-BkYIKPgh.js";import{c as M}from"./routePaths-uBvxqlLY.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]="33cc0e6f-16f2-40af-a22a-0d69479b3272",e._sentryDebugIdIdentifier="sentry-dbid-33cc0e6f-16f2-40af-a22a-0d69479b3272")}catch{}})();function $t({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ve(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?y.jsx(X,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?y.jsx(ie,{}):y.jsx(X,{}):y.jsx(ft,{children:y.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n($e(l,u,r))},onSkip:(u,r)=>{n(Re(l,u,r))}})})}const ft=re.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as k}from"./liveblocks-DKqwsBQp.js";import{a as A}from"./sentry-CxSdF_r
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Dt=Ee.getLocalizedStrings(),gt=te((function(e,t){const c=Se(e,t.scheduleTab),s=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:s??""},linkBillExpenseView:c.linkBillExpenseView,transactions:c.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:c,location:s}=t;return{onTransactionSelect(l){e(Ce({selectedTransaction:l}))},onBackClick:()=>{c("..",{relative:"path"})},onCancel(){e(Ce({selectedTransaction:void 0})),e(We()),c("..",{relative:"path"})},onTransactionClick:l=>{const n=`${M(l,t.tenantEmailDomain)}`,i=V(s.state?.pathnameStackToGoBack,s.pathname);c(n,{state:{pathnameStackToGoBack:i}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ve(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(rt),Kt=({setShouldNavigateBack:e})=>{const t=Q(),c=ee(),{scheduleDetailId:s,tenantEmailDomain:l}=G(),{scheduleType:n}=G();if(l==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const i=h((g=>K(g))),a=pe(n)??"accrued_expenses",d=ot.getSignedInUser();if(d==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(s==null)throw Error("Invalid Schedule Detail Id");const o=h((g=>Se(g,a))),m=o.selectedJELinkRowIndex,I=h((g=>ne(g,i.companyId))),p=dt(o.updateStatus.fetchState);A.useEffect((()=>{p==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[p,o.updateStatus.fetchState]),A.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),A.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const C=o.linkBillExpenseView.fetchState==="Completed";return k.jsx(k.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?k.jsx(it,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&m!=null?k.jsxs(k.Fragment,{children:[C===!0?k.jsx(ue,{analytics:N,onLoad:()=>{Et(o,a,I)}}):null,k.jsx(gt,{signedInUser:d,attachmentEndPoint:`${ut}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:c,tenantEmailDomain:l,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:N,controllerUserDetails:I,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},Ne=e=>{const t=Dt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},Et=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=e.selectedJELinkRowIndex;let n;l!=null&&s!=null&&(n=s.scheduledJournalEntry[l]);const{transactions:i}=e.linkBillExpenseView,a=i.some((m=>m.isRecommendedTransaction===!0)),d=se(c.controllers),o=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{...Ne(s)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:s.vendor.name??null,controllerEmails:d,controllerUserIds:o})};function ye({jeScheduleId:e,scheduleKey:t,scheduleType:c,onDecided:s}){const l=H(),{ignoreStatusById:n,revertStatusById:i}=h((I=>ce(I).jeSchedules)),a=A.useRef(void 0),d=t==null||a.current==null?void 0:a.current==="ignore"?n[t]?.fetchState:i[t]?.fetchState,o=A.useRef(!1),m=A.useRef(s);return m.current=s,A.useEffect((()=>{o.current&&d==="Completed"&&(o.current=!1,m.current())}),[d]),{onScheduleDecision:A.useCallback(((I,p,C)=>{if(t!=null){if(I==="ignore")return(function(g){return Ze.includes(g)})(p)?(o.current=!0,a.current="ignore",void l(ze(t,c,p,C))):void 0;e!=null&&(function(g){return Xe.includes(g)})(p)&&(o.current=!0,a.current="revert",l(qe(e,t,c,p,C)))}}),[l,e,t,c]),scheduleDecisionStatus:d}}const kt=re.div`
9
+ `,Dt=Ee.getLocalizedStrings(),gt=te((function(e,t){const c=Se(e,t.scheduleTab),s=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:s??""},linkBillExpenseView:c.linkBillExpenseView,transactions:c.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:c,location:s}=t;return{onTransactionSelect(l){e(Ce({selectedTransaction:l}))},onBackClick:()=>{c("..",{relative:"path"})},onCancel(){e(Ce({selectedTransaction:void 0})),e(We()),c("..",{relative:"path"})},onTransactionClick:l=>{const n=`${M(l,t.tenantEmailDomain)}`,i=V(s.state?.pathnameStackToGoBack,s.pathname);c(n,{state:{pathnameStackToGoBack:i}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ve(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(rt),Kt=({setShouldNavigateBack:e})=>{const t=Q(),c=ee(),{scheduleDetailId:s,tenantEmailDomain:l}=G(),{scheduleType:n}=G();if(l==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const i=h((g=>K(g))),a=pe(n)??"accrued_expenses",d=ot.getSignedInUser();if(d==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(s==null)throw Error("Invalid Schedule Detail Id");const o=h((g=>Se(g,a))),m=o.selectedJELinkRowIndex,I=h((g=>ne(g,i.companyId))),p=dt(o.updateStatus.fetchState);A.useEffect((()=>{p==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[p,o.updateStatus.fetchState]),A.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),A.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const C=o.linkBillExpenseView.fetchState==="Completed";return y.jsx(y.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?y.jsx(it,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&m!=null?y.jsxs(y.Fragment,{children:[C===!0?y.jsx(ue,{analytics:N,onLoad:()=>{Et(o,a,I)}}):null,y.jsx(gt,{signedInUser:d,attachmentEndPoint:`${ut}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:c,tenantEmailDomain:l,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:N,controllerUserDetails:I,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},Ne=e=>{const t=Dt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},Et=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=e.selectedJELinkRowIndex;let n;l!=null&&s!=null&&(n=s.scheduledJournalEntry[l]);const{transactions:i}=e.linkBillExpenseView,a=i.some((m=>m.isRecommendedTransaction===!0)),d=se(c.controllers),o=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{...Ne(s)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:s.vendor.name??null,controllerEmails:d,controllerUserIds:o})};function ke({jeScheduleId:e,scheduleKey:t,scheduleType:c,onDecided:s}){const l=H(),{ignoreStatusById:n,revertStatusById:i}=h((I=>ce(I).jeSchedules)),a=A.useRef(void 0),d=t==null||a.current==null?void 0:a.current==="ignore"?n[t]?.fetchState:i[t]?.fetchState,o=A.useRef(!1),m=A.useRef(s);return m.current=s,A.useEffect((()=>{o.current&&d==="Completed"&&(o.current=!1,m.current())}),[d]),{onScheduleDecision:A.useCallback(((I,p,C)=>{if(t!=null){if(I==="ignore")return(function(g){return Ze.includes(g)})(p)?(o.current=!0,a.current="ignore",void l(ze(t,c,p,C))):void 0;e!=null&&(function(g){return Xe.includes(g)})(p)&&(o.current=!0,a.current="revert",l(qe(e,t,c,p,C)))}}),[l,e,t,c]),scheduleDecisionStatus:d}}const yt=re.div`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as k}from"./liveblocks-DKqwsBQp.js";import{a as A}from"./sentry-CxSdF_r
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,yt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,L=I?.selectedOption;e(et({scheduleType:l,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||L==null||e(tt({scheduleType:l}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=H(),C=ke(),{tenantEmailDomain:g}=G(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=G(),v=s??r;let D;v!=="new"&&(D=v);const L=Ct(v),B=h((b=>b.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),J="accrued_expenses",y=h((b=>Se(b,"accrued_expenses"))),w=h((b=>fe(b))),j=h((b=>b.classListState.fetchState)),x=h((b=>ae(b))),_=w!=="Completed"||j!=="Completed";A.useEffect((()=>{f===!1&&_?(p(He(J,D)),u(!0)):_===!1&&f===!1&&v!=="new"&&(p(Qe(J,v)),u(!0))}),[f]);const P=h((b=>K(b))),T=h((b=>ne(b,P.companyId))),O=I.state?.message==="expenseAutomation",W=h((b=>ce(b).selectedPeriod)),U=c||O,{onScheduleDecision:z,scheduleDecisionStatus:q}=ye({jeScheduleId:y.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:y.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:J,onDecided:()=>{if(l==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:b,year:Pe}=W;m(`../../month_end_close_checks/review/je_schedules/${b}-${Pe}`)}else l()}}),F=y.fetchState,R=y.allAccountList,Z=y.allClassList,E=y.allAccruedAccountList,S=y.scheduleAccruedDetailsLocalData;if(L!==!0||y.fetchState==="Error")return k.jsx(X,{});const $=F==="Completed"&&f===!0,Oe=y.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?k.jsxs(kt,{children:[$===!0?k.jsx(ue,{analytics:N,onLoad:()=>{vt(y,J,T)}}):null,k.jsx(yt,{onScheduleDecision:U?z:void 0,scheduleDecisionStatus:q,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:y,location:I,navigate:m,classList:Z,accountList:R,shouldNavigateBack:d,accruedAccountList:E,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:y.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:y.selectedJEAccruedSchedule?.status.code})]}):k.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{...Ne(s)},vendorName:s.vendor.name??null,controllerEmails:l,controllerUserIds:n})},At=re.div`
17
+ `,kt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,J=I?.selectedOption;e(et({scheduleType:l,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||J==null||e(tt({scheduleType:l}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=H(),C=ye(),{tenantEmailDomain:g}=G(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=G(),v=s??r;let D;v!=="new"&&(D=v);const J=Ct(v),B=h((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),w="accrued_expenses",k=h((L=>Se(L,"accrued_expenses"))),b=h((L=>fe(L))),j=h((L=>L.classListState.fetchState)),x=h((L=>ae(L))),_=b!=="Completed"||j!=="Completed";A.useEffect((()=>{f===!1&&_?(p(He(w,D)),u(!0)):_===!1&&f===!1&&v!=="new"&&(p(Qe(w,v)),u(!0))}),[f]);const P=h((L=>K(L))),T=h((L=>ne(L,P.companyId))),O=I.state?.message==="expenseAutomation",W=h((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:z,scheduleDecisionStatus:q}=ke({jeScheduleId:k.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:k.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:w,onDecided:()=>{if(l==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:L,year:Pe}=W;m(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else l()}}),F=k.fetchState,R=k.allAccountList,Z=k.allClassList,E=k.allAccruedAccountList,S=k.scheduleAccruedDetailsLocalData;if(J!==!0||k.fetchState==="Error")return y.jsx(X,{});const $=F==="Completed"&&f===!0,Oe=k.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?y.jsxs(yt,{children:[$===!0?y.jsx(ue,{analytics:N,onLoad:()=>{vt(k,w,T)}}):null,y.jsx(kt,{onScheduleDecision:U?z:void 0,scheduleDecisionStatus:q,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:k,location:I,navigate:m,classList:Z,accountList:R,shouldNavigateBack:d,accruedAccountList:E,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):y.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{...Ne(s)},vendorName:s.vendor.name??null,controllerEmails:l,controllerUserIds:n})},At=re.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as k}from"./liveblocks-DKqwsBQp.js";import{a as A}from"./sentry-CxSdF_r
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,he=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(_e(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(Je(i,d,o))},onJELinkClick:d=>{e(Le({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,L=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:L?.zeniId??D?.selectedOption??"",name:L?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:L?.logo},J=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,y=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,w=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,j=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),_=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:y?.accountId,selectedClass:J?.classId,selectedAccumulatedDepreciationCategory:w?.accountId,selectedDate:r,selectedMonths:j,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||w?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||y?.accountId==null||t.isAccountingClassesEnabled!==!1&&J?.classId==null||r==null||j==null||P!==!0&&_==null||e(be({scheduleType:i}))}}}))(mt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=Q(),n=ee(),i=H(),a=ke(),{tenantEmailDomain:d}=G(),[o,m]=A.useState(!1),{scheduleDetailId:I}=G(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((E=>E.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||l("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((E=>oe(E,u))),v=h((E=>E.entityAutoCompleteState.autoCompleteText.common)),D=h((E=>De(E,"common"))),L=h((E=>fe(E))),B=h((E=>E.classListState.fetchState)),J=h((E=>ae(E))),y=h((E=>ce(E).selectedPeriod)),w=L!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&w?(i(Ae(u,F,!0)),m(!0)):w===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:E,year:S}=y;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else l("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const j=h((E=>K(E))),x=h((E=>ne(E,j.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ye({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:E,year:S}=y;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else c()}}),O=r.fetchState,W=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,q=r.scheduleDetailsLocalData.fixed_assets;let F;if(p!=="new"&&(F=p),g!==!0||r.fetchState==="Error")return k.jsx(X,{});const R=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?k.jsxs(At,{children:[R===!0?k.jsx(ue,{analytics:N,onLoad:()=>{Bt(r,u,x)}}):null,k.jsx(It,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:y,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(E,S)=>{i(Te(E,S))},accountList:W,depAccountList:z,scheduleLocalData:q,selectedJEScheduleKey:f,scheduleDetailId:F,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:J,status:r.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},bt=re.div`
25
+ `,he=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(_e(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(be(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(we(i,d,o))},onJELinkClick:d=>{e(Je({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,J=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:J?.zeniId??D?.selectedOption??"",name:J?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:J?.logo},w=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,k=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,b=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,j=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),_=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:k?.accountId,selectedClass:w?.classId,selectedAccumulatedDepreciationCategory:b?.accountId,selectedDate:r,selectedMonths:j,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||b?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||k?.accountId==null||t.isAccountingClassesEnabled!==!1&&w?.classId==null||r==null||j==null||P!==!0&&_==null||e(Le({scheduleType:i}))}}}))(mt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=Q(),n=ee(),i=H(),a=ye(),{tenantEmailDomain:d}=G(),[o,m]=A.useState(!1),{scheduleDetailId:I}=G(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((E=>E.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||l("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((E=>oe(E,u))),v=h((E=>E.entityAutoCompleteState.autoCompleteText.common)),D=h((E=>De(E,"common"))),J=h((E=>fe(E))),B=h((E=>E.classListState.fetchState)),w=h((E=>ae(E))),k=h((E=>ce(E).selectedPeriod)),b=J!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&b?(i(Ae(u,F,!0)),m(!0)):b===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:E,year:S}=k;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else l("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const j=h((E=>K(E))),x=h((E=>ne(E,j.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:E,year:S}=k;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else c()}}),O=r.fetchState,W=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,q=r.scheduleDetailsLocalData.fixed_assets;let F;if(p!=="new"&&(F=p),g!==!0||r.fetchState==="Error")return y.jsx(X,{});const R=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?y.jsxs(At,{children:[R===!0?y.jsx(ue,{analytics:N,onLoad:()=>{Bt(r,u,x)}}):null,y.jsx(It,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(E,S)=>{i(Te(E,S))},accountList:W,depAccountList:z,scheduleLocalData:q,selectedJEScheduleKey:f,scheduleDetailId:F,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:w,status:r.selectedJEScheduleTransaction?.status.code})]}):y.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Lt=re.div`
26
26
  display: flex;
27
27
  min-height: 100%;
28
28
  width: 100%;
@@ -30,4 +30,4 @@ import{j as k}from"./liveblocks-DKqwsBQp.js";import{a as A}from"./sentry-CxSdF_r
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,me=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Lt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(Je(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Le({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,L=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,J=m.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),y=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,w=f.type==="lastDayOfMonth"||void 0,j={selectedAccount:L?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:J,lastDayOfMonth:w,selectedVendor:v,selectedDayOfMonth:y};e(Be({scheduleType:t.scheduleTab,localData:j,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||L?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||w!==!0&&y==null||e(be({scheduleType:t.scheduleTab}))}}}))(pt),Wt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=Q(),i=ee(),a=H(),d=ke(),{tenantEmailDomain:o}=G(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=G(),f=t??g,u=Jt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),L=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),J=h((S=>fe(S))),y=h((S=>S.classListState.fetchState)),w=h((S=>ae(S))),j=h((S=>ce(S).selectedPeriod)),x=J!=="Completed"||y!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,R,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:$}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${$}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const _=h((S=>K(S))),P=h((S=>ne(S,_.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:W}=ye({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(s==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:$}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${$}`)}else s()}}),U=D.fetchState,z=D.allAccountList,q=D.allClassList,F=D.scheduleDetailsLocalData;let R;if(f!=="new"&&(R=f),u!==!0||D.fetchState==="Error")return k.jsx(X,{});const Z=U==="Completed"&&m===!0,E=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&E?k.jsxs(bt,{children:[Z===!0?k.jsx(ue,{analytics:N,onLoad:()=>{jt(D,v,P)}}):null,k.jsx(Lt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:W,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:L,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,$)=>{a(Te(S,$))},expenseAutomationSelectedPeriod:j,navigate:n,classList:q,accountList:z,scheduleLocalData:F[v],selectedJEScheduleKey:r,scheduleDetailId:R,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:w,status:D.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},Jt=(e,t)=>pe(e)!=null&&t!=null,wt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),jt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...wt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{$t as J,Yt as S,Ut as a,Wt as b,Kt as c};
33
+ `,me=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Jt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(be(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(we(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Je({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,J=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,w=m.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),k=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,b=f.type==="lastDayOfMonth"||void 0,j={selectedAccount:J?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:w,lastDayOfMonth:b,selectedVendor:v,selectedDayOfMonth:k};e(Be({scheduleType:t.scheduleTab,localData:j,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||J?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||b!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Wt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=Q(),i=ee(),a=H(),d=ye(),{tenantEmailDomain:o}=G(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=G(),f=t??g,u=wt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),J=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),w=h((S=>fe(S))),k=h((S=>S.classListState.fetchState)),b=h((S=>ae(S))),j=h((S=>ce(S).selectedPeriod)),x=w!=="Completed"||k!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,R,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:$}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${$}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const _=h((S=>K(S))),P=h((S=>ne(S,_.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:W}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(s==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:$}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${$}`)}else s()}}),U=D.fetchState,z=D.allAccountList,q=D.allClassList,F=D.scheduleDetailsLocalData;let R;if(f!=="new"&&(R=f),u!==!0||D.fetchState==="Error")return y.jsx(X,{});const Z=U==="Completed"&&m===!0,E=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&E?y.jsxs(Lt,{children:[Z===!0?y.jsx(ue,{analytics:N,onLoad:()=>{jt(D,v,P)}}):null,y.jsx(Jt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:W,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:J,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,$)=>{a(Te(S,$))},expenseAutomationSelectedPeriod:j,navigate:n,classList:q,accountList:z,scheduleLocalData:F[v],selectedJEScheduleKey:r,scheduleDetailId:R,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:b,status:D.selectedJEScheduleTransaction?.status.code})]}):y.jsx(ie,{})},wt=(e,t)=>pe(e)!=null&&t!=null,bt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),jt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...bt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{$t as J,Yt as S,Ut as a,Wt as b,Kt as c};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-sryCVGSu.js","assets/sentry-CxSdF_rC.js","assets/core-D6EV-11Y.js","assets/zeni-epic-state-CZbm731W.js","assets/index-DvW7BRlL.js","assets/mui-qouWiIWk.js","assets/analytics-wktvfErl.js","assets/utils-D8aAQJhF.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-CdQzvjb3.js","assets/withTransactionSidePanel-CPG02lKM.js","assets/useAskAiCfoHostNavButtonProps-DV4bjx-y.js","assets/TransactionDetailScreen-CjwF3ORf.js","assets/decodeURIComponentSafe-MQV5aj_5.js","assets/useInitialThreadRequest-BwX5Js6P.js","assets/routePaths-GYFjoelZ.js","assets/expenseAutomationHelper-DEOPVtcg.js","assets/stripSplatSuffix-CYVrHv_0.js","assets/analyticsHelper-DcvdGte-.js","assets/CompanyPassportScreen-CEuR94fF.js","assets/MobileAppDrawer-DExJFFmi.js","assets/InboxNotificationsProvider-gj6fT2eX.js","assets/useTaskManagerAccess-daSMnBbA.js","assets/useAiCfoDashboardSuggestedQuestionsChips-D_Ro-9Tt.js","assets/FeaturePreviewScreen-LeLfD5pA.js","assets/BillPayRoutes-DFm7lkFc.js","assets/AddressScreen-5ZLJ7_Lf.js","assets/DomesticWireDetailScreen-Dj3JCDGh.js","assets/BusinessVerificationPageScreen-BL6H7JF-.js","assets/DrawerScreen-CxKP-6Rf.js","assets/SetupPagesScreen-D0fdMGb4.js","assets/BillPayApprovalRoutes-DwyJret-.js","assets/ReimbursementApprovalRuleDetailScreen-DTKS2oJ9.js","assets/getLocaleForTenant-C3wVeXiS.js","assets/ReimbursementRoutes-_NvdZWfU.js","assets/ReimbursementApprovalRoutes-DeN7vJtz.js","assets/TransactionListRoutes-2fGCqEq5.js","assets/ZeniAccountStatementScreen-BgdXcTdx.js","assets/SettingsRoutes-BtUbt9zq.js","assets/AccountMappingScreen-BT617fFT.js","assets/QBOConnectionScreen-CbxnK800.js","assets/empty-DQLKD1Hp.js","assets/index-8ioAZPP6.js","assets/url-Ej5v3O6d.js","assets/index-EnAqWoDC.js","assets/accountMappingHelper-DWzrp9Pr.js","assets/useEmailConnectResultRefresh-dVylO6qh.js","assets/ReportsRoutes-BAGPRsE0.js","assets/ChargeCardRoutes-Brg8E0b9.js","assets/useChargeCardPusherEvents-1X1JYShz.js","assets/PeopleRoutes-CulbMsz3.js","assets/ExpenseAutomationRoutes-BYSJ88to.js","assets/useActualMatchingMatchDetail-BkDnJbPg.js","assets/ScheduleDetailsPrepaidExpensesScreen-B5q5sAGy.js","assets/pathToGoBack-DMRqTTJ7.js","assets/TreasuryRoutes-CuPpvoic.js","assets/VendorsRoutes-B_Yg40bd.js","assets/ZeniAccountRoutes-CfMUrMqe.js","assets/AddressRoutes-kiur36N3.js","assets/PandLWithForecastRoutes-CZ27RjQE.js","assets/CustomerOnboardingRoutes-BffNdH_l.js","assets/TransactionDetailRoutes-eA90CTkf.js","assets/EntityDetailRoutes-CRL6OrqO.js","assets/InvoicingRoutes-CvkWcLdT.js","assets/NotificationRoutes-njgUFBoj.js","assets/PerformanceRoutes-BYcI02aB.js","assets/ActualMatchingMatchDetailScreen-B8f2yDaP.js","assets/RewardsRoutes-BUOCW-CT.js","assets/TaskRoutes-DpYRDMWP.js","assets/TaskListScreen-OEgAVE9M.js","assets/AiCfoScreen-CW5K1JhC.js","assets/CardsAiCfoScreen-C-_PDYQc.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as Es,fF as hs,d_ as ps,dZ as xs,AV as gs,di as Rs,c8 as js,gJ as Is,g9 as Ts,df as pe,cG as As,gn as fs,cy as Ds,bE as bs,br as ys,U0 as Cs,v as vs,U3 as Us,bq as Os,U4 as Ps,bK as ws,bJ as Fs,bt as Ls,cu as Vs,U5 as ks,U6 as Hs,da as Ss,dd as Bs,dc as Ns,cF as Ms,cM as Zs,pS as xe,gi as ge,gY as Gs,gk as Re,gL as je,gM as Ie,gl as $s}from"./zeni-epic-state-CZbm731W.js";import{j as e}from"./liveblocks-DKqwsBQp.js";import{a as P}from"./sentry-CxSdF_rC.js";import{N as u,u as zs,h as Ys,i as qs,g as Js,j as G,q as Te,n as Ws,o as n}from"./core-D6EV-11Y.js";import{K as l,E as Ks,u as Qs,z as y,N as Xs,f as et,g as st,d as B,j as tt,O as nt,U as at,L as F,G as Ae,t as _,P as ot,Q as rt,l as ne}from"./index-DvW7BRlL.js";import"./mui-qouWiIWk.js";import{f as fe}from"./analyticsHelper-DcvdGte-.js";import{t as it}from"./getLocaleForTenant-C3wVeXiS.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="d4fefd11-cef4-4699-9866-d314a3170b3a",o._sentryDebugIdIdentifier="sentry-dbid-d4fefd11-cef4-4699-9866-d314a3170b3a")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-sryCVGSu.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),be=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:U,tenantEmailDomain:v})=>{if(V===!0){if(o)return e.jsx(be,{tenantEmailDomain:v});if(i)return e.jsx(De,{tenantEmailDomain:v});if(U)return e.jsx(ye,{tenantEmailDomain:v})}return o?e.jsx(be,{tenantEmailDomain:v}):i?e.jsx(De,{tenantEmailDomain:v}):U?e.jsx(ye,{tenantEmailDomain:v}):D?e.jsx(dt,{tenantEmailDomain:v}):N?e.jsx(ut,{tenantEmailDomain:v}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-CdQzvjb3.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-DFm7lkFc.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-_NvdZWfU.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-2fGCqEq5.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-BtUbt9zq.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-BAGPRsE0.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-Brg8E0b9.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-CulbMsz3.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-BYSJ88to.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-CuPpvoic.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-B_Yg40bd.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-CfMUrMqe.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-BAGPRsE0.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),Et=l((()=>s((()=>import("./AddressRoutes-kiur36N3.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),ht=l((()=>s((()=>import("./PeopleRoutes-CulbMsz3.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-CZ27RjQE.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-BffNdH_l.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),gt=l((()=>s((()=>import("./VendorsRoutes-B_Yg40bd.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),Rt=l((()=>s((()=>import("./TransactionDetailRoutes-eA90CTkf.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-CRL6OrqO.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),jt=l((()=>s((()=>import("./DashboardRoutes-CdQzvjb3.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-DFm7lkFc.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),It=l((()=>s((()=>import("./SettingsRoutes-BtUbt9zq.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-CvkWcLdT.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Ue=l((()=>s((()=>import("./ReimbursementRoutes-_NvdZWfU.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-CfMUrMqe.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),ft=l((()=>s((()=>import("./TreasuryRoutes-CuPpvoic.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),Dt=l((()=>s((()=>import("./TransactionListRoutes-2fGCqEq5.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),bt=l((()=>s((()=>import("./ChargeCardRoutes-Brg8E0b9.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-njgUFBoj.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Ct=l((()=>s((()=>import("./PerformanceRoutes-BYcI02aB.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),vt=l((()=>s((()=>import("./ExpenseAutomationRoutes-BYSJ88to.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Ut=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-B8f2yDaP.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ot=l((()=>s((()=>import("./RewardsRoutes-BUOCW-CT.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-DpYRDMWP.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-CW5K1JhC.js")),__vite__mapDeps([70,1,2,3,4,5,6,7,23,54,15,8])))),Oe=l((()=>s((()=>import("./CardsAiCfoScreen-C-_PDYQc.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,8])))),f=l((()=>s((()=>import("./NotFoundScreen-sryCVGSu.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-OEgAVE9M.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:U,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(U===!0){if(D)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),Gt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=zs(),N=Ys(),{tenantEmailDomain:i}=qs(),V=Ks().mode,{setLoading:U,clearAllLoading:v,clearLoading:k}=Qs(),b=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),W=Es(I),$=Js(),[L,we]=P.useState(!1),r=G((a=>hs(a))),{useFeatureGate:H}=Xs(),M=et(),K=st(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=H(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(B.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?ps(oe,r):void 0,Q=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?gs(r)&&!Rs(r):void 0,ke=tt(r,Ve,oe),{isCardsHidden:He}=nt(r?.tenantId),Se=!ke||!!He,{isFeatureEnabled:Be}=H(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=H(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||rt==="DEV",Ze=r?.userRole!=null&&js(r.userRole),z=G((a=>Is(a)));if(i!=null){const a=y.getSignedInUserTenant(i);I!=null&&a!=null&&fe(I,r,V)}const Z={tenantId:b,userId:I?.userId,sessionId:I?.zeniSessionId},ie=Ts(),h=at(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=As(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,Ye=G((a=>Z.tenantId!=null?fs(a,Z.tenantId):void 0));P.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&b!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=bs(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?D(Cs(b,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,b]),P.useEffect((()=>{L||(we(!0),U(F.TENANT_FETCHING))}),[L,Z,ie,I,D,y]),P.useLayoutEffect((()=>{!vs(ie,Z)&&y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c(Gs(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,D,Ye))}),[b]),P.useEffect((()=>{y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t,d,Y,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const q=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(q&&cs){S(Re(t));const J=y.getSignedInUserTenantWithId(t);J?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else q&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),q&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(q){ne.identify(d.userId,{tenant_id:t});const J=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),Y(F.TENANT_FETCHING),S($s(d.userId,t,d.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,b,I,U,D))}),[b,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Us(z.tenantsBaseInOrder)),I!=null&&fe(I,r,V,void 0,z.tenantsBaseInOrder))}),[z,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&U(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&b!=null?(v(),_.markActiveTenantFetchCompleted(b)):p==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,b,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],Y=ct[d];Y!=null?Y().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const O=r?.userRole!=null&&Os(r?.userRole),{isFeatureEnabled:qe}=H(B.isReferralFeatureEnabled),{isFeatureEnabled:Je}=H(B.isAccrualEnabled),We=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,de=!Se&&!O,Qe=Ps(h?.loggedInUserRoleMap),Xe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=ce&&ws(h?.loggedInUserRoleMap),_e=Fe&&!O,ss=Le&&!O,ts=ue&&Fs(h?.loggedInUserRoleMap),ns=de&&Ls(h?.loggedInUserRoleMap),as=_e&&Vs(h?.loggedInUserRoleMap),os=ks(h?.loggedInUserRoleMap),rs=Hs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),x=Ms(h?.loggedInUserRoleMap),g=Zs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&is,j=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Qe===!0||os===!0||rs===!0;return y.isSignedIn()?b==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&T!=="In-Progress"&&D(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||W&&!ee)&&es&&Xe!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||W?!L||te!==!1||ee||W?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ws,{children:e.jsxs(n,{element:e.jsx(ot,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(jt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&O===!1||We||Ke?e.jsx(Rt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&O===!1?e.jsx(Dt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&O===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&O===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Pt,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(Et,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(At,{}):e.jsx(f,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(ft,{}):e.jsx(f,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&O===!1?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&O===!1&&Je===!0?e.jsx(Ut,{}):e.jsx(f,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(gt,{}):e.jsx(f,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(It,{hasAdminLevelAccess:me}):e.jsx(f,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(bt,{}):e.jsx(f,{})}),e.jsx(n,{path:"rewards/*",element:qe?e.jsx(Ot,{}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"*",element:e.jsx(f,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,Gt as S};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-BkYIKPgh.js","assets/sentry-DHDsO12F.js","assets/core-B5mDy9pu.js","assets/zeni-epic-state-7eY0g-Bc.js","assets/index-6nH5LMe4.js","assets/mui-Do6nLzGb.js","assets/analytics-D6GpUSOP.js","assets/utils-BsODCDYR.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-D5hdkebN.js","assets/withTransactionSidePanel-DK-Ex27L.js","assets/useAskAiCfoHostNavButtonProps-BsP5fVhq.js","assets/TransactionDetailScreen-Bp7IFDK0.js","assets/decodeURIComponentSafe-DANuhXnG.js","assets/useInitialThreadRequest-7Q8HJAH2.js","assets/routePaths-uBvxqlLY.js","assets/expenseAutomationHelper-DBDpSggk.js","assets/stripSplatSuffix-CQQXAy0N.js","assets/analyticsHelper-CwB3kQvw.js","assets/CompanyPassportScreen-BxoatMVb.js","assets/MobileAppDrawer-0YtWXA3B.js","assets/InboxNotificationsProvider-BmF5-_KA.js","assets/useTaskManagerAccess-BG0Fkj9k.js","assets/useAiCfoDashboardSuggestedQuestionsChips-D8KJqvT7.js","assets/FeaturePreviewScreen-5SleVFKv.js","assets/BillPayRoutes-CWc4tAqm.js","assets/AddressScreen-DsGvV3N8.js","assets/DomesticWireDetailScreen-DgE28aJN.js","assets/BusinessVerificationPageScreen-CSruI1nV.js","assets/DrawerScreen-BihZ_PpN.js","assets/SetupPagesScreen-DzNRL7Y-.js","assets/BillPayApprovalRoutes-BY4P9AKu.js","assets/ReimbursementApprovalRuleDetailScreen-phJuB98f.js","assets/getLocaleForTenant-DH5Avx3x.js","assets/ReimbursementRoutes-BdJ3oqBf.js","assets/ReimbursementApprovalRoutes-DAusugdf.js","assets/TransactionListRoutes-B6NIJUWk.js","assets/ZeniAccountStatementScreen-CbdRQI0p.js","assets/SettingsRoutes-BGCz0_nd.js","assets/AccountMappingScreen-Euit4Ttk.js","assets/QBOConnectionScreen-CWU6DFJl.js","assets/empty-Dj4ZMRNZ.js","assets/index-k1-Pd2Ki.js","assets/url-BxiN6LKq.js","assets/index-6yt3BfRL.js","assets/accountMappingHelper-DqBiQF6x.js","assets/useEmailConnectResultRefresh-Ba8t-BuL.js","assets/ReportsRoutes-CDSCG28G.js","assets/ChargeCardRoutes-BU6-pfJv.js","assets/useChargeCardPusherEvents-BnH8_thb.js","assets/PeopleRoutes-D_nqmuPM.js","assets/ExpenseAutomationRoutes-DK-U-YTd.js","assets/useActualMatchingMatchDetail-OCZsPxr6.js","assets/ScheduleDetailsPrepaidExpensesScreen-DnVEpQsK.js","assets/pathToGoBack-DP_bGWF-.js","assets/TreasuryRoutes-BvvMozYl.js","assets/VendorsRoutes-DsJ_lcDO.js","assets/ZeniAccountRoutes-C3fDjuMG.js","assets/AddressRoutes-PvYGzHCA.js","assets/PandLWithForecastRoutes-BzO_OgSq.js","assets/CustomerOnboardingRoutes-DV3rYEiJ.js","assets/TransactionDetailRoutes-CYb-4jKQ.js","assets/EntityDetailRoutes-BqX-J3vM.js","assets/InvoicingRoutes-D0S6fDxY.js","assets/NotificationRoutes-CZQRvVbE.js","assets/PerformanceRoutes-BW6dixVF.js","assets/ActualMatchingMatchDetailScreen-BBYzjOqh.js","assets/RewardsRoutes-CHkOPz1g.js","assets/TaskRoutes-CDuiJExM.js","assets/TaskListScreen-Br-mxkKM.js","assets/AiCfoScreen-DAEPn0_B.js","assets/CardsAiCfoScreen-COoYscKz.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as Es,fF as hs,d_ as ps,dZ as xs,AV as gs,di as Rs,c8 as js,gJ as Is,g9 as Ts,df as pe,cG as As,gn as bs,cy as Ds,bE as ys,br as fs,U0 as Cs,v as vs,U3 as Us,bq as Os,U4 as Ps,bK as ws,bJ as Fs,bt as Ls,cu as Vs,U5 as ks,U6 as Hs,da as Ss,dd as Bs,dc as Ns,cF as Ms,cM as Zs,pS as xe,gi as ge,gY as Gs,gk as Re,gL as je,gM as Ie,gl as $s}from"./zeni-epic-state-7eY0g-Bc.js";import{j as e}from"./liveblocks-UOzcPsHa.js";import{a as P}from"./sentry-DHDsO12F.js";import{N as u,u as zs,h as qs,i as Ys,g as Js,j as G,q as Te,n as Ws,o as n}from"./core-B5mDy9pu.js";import{I as l,E as Ks,u as Qs,z as f,N as Xs,e as et,q as st,c as B,g as tt,J as nt,U as at,L as F,G as Ae,t as _,P as ot,K as rt,j as ne}from"./index-6nH5LMe4.js";import"./mui-Do6nLzGb.js";import{f as be}from"./analyticsHelper-CwB3kQvw.js";import{t as it}from"./getLocaleForTenant-DH5Avx3x.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="615b58f0-28b6-4759-abe9-e7aa53486bdb",o._sentryDebugIdIdentifier="sentry-dbid-615b58f0-28b6-4759-abe9-e7aa53486bdb")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-BkYIKPgh.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:U,tenantEmailDomain:v})=>{if(V===!0){if(o)return e.jsx(ye,{tenantEmailDomain:v});if(i)return e.jsx(De,{tenantEmailDomain:v});if(U)return e.jsx(fe,{tenantEmailDomain:v})}return o?e.jsx(ye,{tenantEmailDomain:v}):i?e.jsx(De,{tenantEmailDomain:v}):U?e.jsx(fe,{tenantEmailDomain:v}):D?e.jsx(dt,{tenantEmailDomain:v}):N?e.jsx(ut,{tenantEmailDomain:v}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-D5hdkebN.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-CWc4tAqm.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-BdJ3oqBf.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-B6NIJUWk.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-BGCz0_nd.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-CDSCG28G.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-BU6-pfJv.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-D_nqmuPM.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-DK-U-YTd.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-BvvMozYl.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-DsJ_lcDO.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-C3fDjuMG.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-CDSCG28G.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),Et=l((()=>s((()=>import("./AddressRoutes-PvYGzHCA.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),ht=l((()=>s((()=>import("./PeopleRoutes-D_nqmuPM.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-BzO_OgSq.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-DV3rYEiJ.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),gt=l((()=>s((()=>import("./VendorsRoutes-DsJ_lcDO.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),Rt=l((()=>s((()=>import("./TransactionDetailRoutes-CYb-4jKQ.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-BqX-J3vM.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),jt=l((()=>s((()=>import("./DashboardRoutes-D5hdkebN.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-CWc4tAqm.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),It=l((()=>s((()=>import("./SettingsRoutes-BGCz0_nd.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-D0S6fDxY.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Ue=l((()=>s((()=>import("./ReimbursementRoutes-BdJ3oqBf.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-C3fDjuMG.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),bt=l((()=>s((()=>import("./TreasuryRoutes-BvvMozYl.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),Dt=l((()=>s((()=>import("./TransactionListRoutes-B6NIJUWk.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),yt=l((()=>s((()=>import("./ChargeCardRoutes-BU6-pfJv.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),ft=l((()=>s((()=>import("./NotificationRoutes-CZQRvVbE.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Ct=l((()=>s((()=>import("./PerformanceRoutes-BW6dixVF.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),vt=l((()=>s((()=>import("./ExpenseAutomationRoutes-DK-U-YTd.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Ut=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-BBYzjOqh.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ot=l((()=>s((()=>import("./RewardsRoutes-CHkOPz1g.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-CDuiJExM.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-DAEPn0_B.js")),__vite__mapDeps([70,1,2,3,4,5,6,7,23,54,15,8])))),Oe=l((()=>s((()=>import("./CardsAiCfoScreen-COoYscKz.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-BkYIKPgh.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-Br-mxkKM.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:U,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(U===!0){if(D)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),Gt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=zs(),N=qs(),{tenantEmailDomain:i}=Ys(),V=Ks().mode,{setLoading:U,clearAllLoading:v,clearLoading:k}=Qs(),y=f.getSignedInUserTenant(i)?.tenantId,I=f.getSignedInUser(),W=Es(I),$=Js(),[L,we]=P.useState(!1),r=G((a=>hs(a))),{useFeatureGate:H}=Xs(),M=et(),K=st(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=H(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(B.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?ps(oe,r):void 0,Q=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?gs(r)&&!Rs(r):void 0,ke=tt(r,Ve,oe),{isCardsHidden:He}=nt(r?.tenantId),Se=!ke||!!He,{isFeatureEnabled:Be}=H(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=H(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||rt==="DEV",Ze=r?.userRole!=null&&js(r.userRole),z=G((a=>Is(a)));if(i!=null){const a=f.getSignedInUserTenant(i);I!=null&&a!=null&&be(I,r,V)}const Z={tenantId:y,userId:I?.userId,sessionId:I?.zeniSessionId},ie=Ts(),h=at(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=As(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,qe=G((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&y!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=ys(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=fs();t.isAfter(d,"month")===!1?D(Cs(y,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,y]),P.useEffect((()=>{L||(we(!0),U(F.TENANT_FETCHING))}),[L,Z,ie,I,D,f]),P.useLayoutEffect((()=>{!vs(ie,Z)&&f.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c(Gs(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=f.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,D,qe))}),[y]),P.useEffect((()=>{f.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t,d,q,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const Y=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(Y&&cs){S(Re(t));const J=f.getSignedInUserTenantWithId(t);J?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else Y&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),Y&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(Y){ne.identify(d.userId,{tenant_id:t});const J=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),S($s(d.userId,t,d.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,y,I,U,D))}),[y,p]),P.useEffect((()=>{f.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),f.saveSignedInUserTenants(Us(z.tenantsBaseInOrder)),I!=null&&be(I,r,V,void 0,z.tenantsBaseInOrder))}),[z,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&U(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(v(),_.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,y,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const O=r?.userRole!=null&&Os(r?.userRole),{isFeatureEnabled:Ye}=H(B.isReferralFeatureEnabled),{isFeatureEnabled:Je}=H(B.isAccrualEnabled),We=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,de=!Se&&!O,Qe=Ps(h?.loggedInUserRoleMap),Xe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=ce&&ws(h?.loggedInUserRoleMap),_e=Fe&&!O,ss=Le&&!O,ts=ue&&Fs(h?.loggedInUserRoleMap),ns=de&&Ls(h?.loggedInUserRoleMap),as=_e&&Vs(h?.loggedInUserRoleMap),os=ks(h?.loggedInUserRoleMap),rs=Hs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),x=Ms(h?.loggedInUserRoleMap),g=Zs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&is,j=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Qe===!0||os===!0||rs===!0;return f.isSignedIn()?y==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&T!=="In-Progress"&&D(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||W&&!ee)&&es&&Xe!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||W?!L||te!==!1||ee||W?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ws,{children:e.jsxs(n,{element:e.jsx(ot,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(jt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&O===!1||We||Ke?e.jsx(Rt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&O===!1?e.jsx(Dt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&O===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&O===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Pt,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(Et,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&O===!1?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&O===!1&&Je===!0?e.jsx(Ut,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(ft,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(gt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(It,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(yt,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:Ye?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:X}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,Gt as S};