@zeniai/web-app-ui 5.3.65-dev → 5.3.66-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/dist/assets/AccountMappingScreen-qzaB7mmI.js +9 -0
  2. package/dist/assets/ActualMatchingMatchDetailScreen-DqHcloug.js +1 -0
  3. package/dist/assets/AddressRoutes-CSHbftqG.js +1 -0
  4. package/dist/assets/AddressScreen-C6LJsN0I.js +9 -0
  5. package/dist/assets/{AiCfoScreen-HIFRX9qy.js → AiCfoScreen-69iCdaWe.js} +5 -5
  6. package/dist/assets/AppDrawer-BetwU_4-.js +10 -0
  7. package/dist/assets/{BillPayApprovalRoutes-CJFVAxhN.js → BillPayApprovalRoutes-DzANWOc3.js} +1 -1
  8. package/dist/assets/BillPayRoutes-D2aY2x5B.js +119 -0
  9. package/dist/assets/{BusinessVerificationPageScreen-ClHDLcIn.js → BusinessVerificationPageScreen-BgP8jWXu.js} +2 -2
  10. package/dist/assets/CardsAiCfoScreen-B0vefglp.js +14 -0
  11. package/dist/assets/ChargeCardRoutes-giQdoPks.js +71 -0
  12. package/dist/assets/CompanyPassportScreen-B-V7cvQm.js +1 -0
  13. package/dist/assets/ConnectionAuthScreen-BXN_6nzp.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-DU6fAlNg.js +1 -0
  15. package/dist/assets/CustomerOnboardingRoutes-BxjXFm9y.js +30 -0
  16. package/dist/assets/DashboardRoutes-B8Is8VU8.js +20 -0
  17. package/dist/assets/DefaultTenantHome-DeP5rQNd.js +1 -0
  18. package/dist/assets/DomesticWireDetailScreen-BQJTKZiM.js +18 -0
  19. package/dist/assets/DrawerScreen-BUdO6BQE.js +1 -0
  20. package/dist/assets/EntityDetailRoutes-DUH9-vmY.js +1 -0
  21. package/dist/assets/ExpenseAutomationRoutes-CoKP5vlI.js +38 -0
  22. package/dist/assets/FeaturePreviewScreen-DLzs5A8g.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-Zi2fxuEj.js +1 -0
  24. package/dist/assets/InboxNotificationsProvider-C8gkRzEM.js +1 -0
  25. package/dist/assets/InvoicingRoutes-Bl5-2g9q.js +2 -0
  26. package/dist/assets/MagicLinkRoutes-BkB3vELP.js +72 -0
  27. package/dist/assets/MagicLinkSignInScreen-BQa7bOA3.js +12 -0
  28. package/dist/assets/MobileAppDrawer-BdOhYCo5.js +1 -0
  29. package/dist/assets/NotFoundScreen-D_hX2Dzv.js +1 -0
  30. package/dist/assets/NotificationRoutes-BlXrAcVL.js +1 -0
  31. package/dist/assets/OAuthConsentScreen-DV9AMjuQ.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-DQr_dvG9.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-CAg7Uc1V.js → PaymentLinkScreen-BU0e_SRM.js} +5 -5
  34. package/dist/assets/PeopleRoutes-BGMNmycG.js +22 -0
  35. package/dist/assets/PerformanceRoutes-Bx4cQFIn.js +1 -0
  36. package/dist/assets/{Preview-DB5CbRio.js → Preview-CdZ2j2v9.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-CRdIfjOg.js → QBOConnectionScreen-DPCQAZIh.js} +1 -1
  38. package/dist/assets/ReimbursementApprovalRoutes-BNnc3IUS.js +1 -0
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-ChXGgpkg.js → ReimbursementApprovalRuleDetailScreen-DZMnuINe.js} +1 -1
  40. package/dist/assets/ReimbursementRoutes-CzK-ajwk.js +68 -0
  41. package/dist/assets/ReportsRoutes-FipSeC9E.js +1 -0
  42. package/dist/assets/RewardsRoutes-BXICRfw-.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CuQHddsr.js → ScheduleDetailsPrepaidExpensesScreen-BF-khYnD.js} +5 -5
  44. package/dist/assets/ScreenRoutes-6gUtsuNq.js +2 -0
  45. package/dist/assets/{SettingsRoutes-B7gRIVJU.js → SettingsRoutes-ZSOCIcz1.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-CabDNVlS.js → SetupPagesScreen-DLgnlxEs.js} +5 -5
  47. package/dist/assets/SignInScreen-C1w5fnGW.js +1 -0
  48. package/dist/assets/SignOutScreen-DCUrMwdu.js +9 -0
  49. package/dist/assets/{TaskListScreen-d8rT1QCC.js → TaskListScreen-DJlJsvJO.js} +2 -2
  50. package/dist/assets/TaskRoutes-Bwnv9rhn.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-Dw-xx0H2.js +1 -0
  52. package/dist/assets/TransactionDetailScreen-BH-OIB8S.js +5 -0
  53. package/dist/assets/TransactionListRoutes-DcrtQayK.js +1 -0
  54. package/dist/assets/TreasuryRoutes-BNsP_RFF.js +37 -0
  55. package/dist/assets/{VendorsRoutes-Dd9qfBZi.js → VendorsRoutes-Bzdw0VNh.js} +10 -10
  56. package/dist/assets/WiseConfirmationScreen-Cs6ZZr7W.js +12 -0
  57. package/dist/assets/ZeniAccountRoutes-CbW2U8iU.js +57 -0
  58. package/dist/assets/ZeniAccountStatementScreen-Dbn9Qd0C.js +9 -0
  59. package/dist/assets/{accountMappingHelper-mjWJVrZb.js → accountMappingHelper-BBlKWvqF.js} +1 -1
  60. package/dist/assets/analytics-Cd5J-GpX.js +68 -0
  61. package/dist/assets/{analyticsHelper-DoCIxX19.js → analyticsHelper-1gGrcOYN.js} +1 -1
  62. package/dist/assets/{core-BBG4mxvC.js → core-vR5k5yHJ.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-DgKmvHaP.js → decodeURIComponentSafe-dlx9EsSm.js} +1 -1
  64. package/dist/assets/{dnd-oIrpOltC.js → dnd-CNeE6eVY.js} +1 -1
  65. package/dist/assets/{empty-zUa_Ywzm.js → empty-BCyx7s6I.js} +1 -1
  66. package/dist/assets/{empty-BVUnugO_.js → empty-BaVMrwvd.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-WG4m8gNp.js → emptyVideoElement-BsSkwvra.js} +1 -1
  68. package/dist/assets/epic-BY4nSR9p.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-DhbRqzrb.js +1 -0
  70. package/dist/assets/getLocaleForTenant-DlNsSiyY.js +1 -0
  71. package/dist/assets/{index-De2R2YuA.js → index-1ujiYIu0.js} +29082 -29221
  72. package/dist/assets/{index-CD8RychW.js → index-B8gT7z4T.js} +1 -1
  73. package/dist/assets/{index-lbu92FYh.js → index-BNIWZiV_.js} +1 -1
  74. package/dist/assets/{index-BlZF-J3g.js → index-C-u59Z-A.js} +1 -1
  75. package/dist/assets/{index-DlbH0-p0.js → index-DC9buFXh.js} +1 -1
  76. package/dist/assets/{index-Bgwcwudg.js → index-DT7mcNKS.js} +1 -1
  77. package/dist/assets/{index-B9QH_oKn.js → index-DglCggLh.js} +2 -2
  78. package/dist/assets/{index-CyCQjJen.js → index-bBDyOWrB.js} +1 -1
  79. package/dist/assets/{lexical-BRrdO5Cu.js → lexical-DgMW3HzT.js} +1 -1
  80. package/dist/assets/{liveblocks-CzCs-qU3.js → liveblocks-DVkNRe2z.js} +1 -1
  81. package/dist/assets/{lottie-ULJlrwjP.js → lottie-w9LOAwHI.js} +1 -1
  82. package/dist/assets/{mui-B2F_PvWe.js → mui-Bf4yQzNc.js} +1 -1
  83. package/dist/assets/{pathToGoBack-e0pJACvC.js → pathToGoBack-C6FxxwA3.js} +1 -1
  84. package/dist/assets/{pdf-CeVn9A9c.js → pdf-HKvehc9b.js} +4 -4
  85. package/dist/assets/{pdf-lib-DiMa7ymi.js → pdf-lib-1kn73-Ho.js} +1 -1
  86. package/dist/assets/{plaid-BWZxX3Bn.js → plaid-TFLEc35h.js} +1 -1
  87. package/dist/assets/{pusher-wcP4-1ih.js → pusher-tJC8UB03.js} +1 -1
  88. package/dist/assets/{react-D7hd8riP.js → react-BKyIT5tt.js} +1 -1
  89. package/dist/assets/{react-CGMaXwI-.js → react-BtmyM_-m.js} +1 -1
  90. package/dist/assets/{react-Chuw6ptT.js → react-CiN9hWuS.js} +1 -1
  91. package/dist/assets/{react-3Jh1nOTX.js → react-DLVu_DIJ.js} +1 -1
  92. package/dist/assets/{react-Dv-IwMT5.js → react-DrY897mF.js} +1 -1
  93. package/dist/assets/{react-BrDYknqm.js → react-YQhQ1aSJ.js} +1 -1
  94. package/dist/assets/{recharts-CzGMTm3v.js → recharts-BajLe7QJ.js} +1 -1
  95. package/dist/assets/{routePaths-BRju88LA.js → routePaths-Du4I9ue1.js} +1 -1
  96. package/dist/assets/{sentry-CWp8Ph3h.js → sentry-BcU4ynZK.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-BWJSV6oD.js → stripSplatSuffix-CGuqfZ54.js} +1 -1
  98. package/dist/assets/{url-CnTmKJO0.js → url-ee1pOdF5.js} +1 -1
  99. package/dist/assets/{url-DV6CtKQ5.js → url-l4mUxam0.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-CNkjnN75.js +1 -0
  101. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CB15Xjw5.js +1 -0
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-Daw0Xdbp.js +1 -0
  103. package/dist/assets/useChargeCardPusherEvents-B1XaK23y.js +1 -0
  104. package/dist/assets/{useDeviceId-Bzw6IkAe.js → useDeviceId-D80AOehv.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-DxMN-FLO.js +1 -0
  106. package/dist/assets/useInitialThreadRequest-CujqTgMw.js +1 -0
  107. package/dist/assets/useTaskManagerAccess-DmtbEonm.js +1 -0
  108. package/dist/assets/useTaskManagerPusherEvents-Cieei3Tg.js +1 -0
  109. package/dist/assets/{utils-u0mlLj2I.js → utils-BJrHoU4M.js} +1 -1
  110. package/dist/assets/withTransactionSidePanel-D7CS7WiP.js +25 -0
  111. package/dist/assets/{zeni-epic-state-FRanwwFO.js → zeni-epic-state-BmF1nplD.js} +6 -6
  112. package/dist/index.html +1 -1
  113. package/package.json +4 -4
  114. package/dist/assets/AccountMappingScreen-6_GKC9vx.js +0 -9
  115. package/dist/assets/ActualMatchingMatchDetailScreen-BtJ1PRf_.js +0 -1
  116. package/dist/assets/AddressRoutes-BGo6E_l0.js +0 -1
  117. package/dist/assets/AddressScreen-BYfgTsTg.js +0 -9
  118. package/dist/assets/AppDrawer-HGV6a9mb.js +0 -10
  119. package/dist/assets/BillPayRoutes-9qxDDuw-.js +0 -119
  120. package/dist/assets/CardsAiCfoScreen-HQpPf571.js +0 -14
  121. package/dist/assets/ChargeCardRoutes-D5HxBR-m.js +0 -71
  122. package/dist/assets/CompanyPassportScreen-NKCcjvTx.js +0 -1
  123. package/dist/assets/ConnectionAuthScreen-5_efBSJK.js +0 -11
  124. package/dist/assets/CustomerOnboardingAuthScreen-LnGpx7c7.js +0 -1
  125. package/dist/assets/CustomerOnboardingRoutes-DvA4xflo.js +0 -30
  126. package/dist/assets/DashboardRoutes-BrD8wr4t.js +0 -20
  127. package/dist/assets/DefaultTenantHome-UgTfgsWU.js +0 -1
  128. package/dist/assets/DomesticWireDetailScreen-CnA3RoGS.js +0 -18
  129. package/dist/assets/DrawerScreen-Uxjfm6D_.js +0 -1
  130. package/dist/assets/EntityDetailRoutes-DtNSByJA.js +0 -1
  131. package/dist/assets/ExpenseAutomationRoutes-CyGyQy2q.js +0 -38
  132. package/dist/assets/FeaturePreviewScreen-C1hVuos1.js +0 -1
  133. package/dist/assets/HubSpotOAuthCallbackScreen-BZRaCcdu.js +0 -1
  134. package/dist/assets/InboxNotificationsProvider-J2K-16R3.js +0 -1
  135. package/dist/assets/InvoicingRoutes-BER5-vbp.js +0 -2
  136. package/dist/assets/MagicLinkRoutes-BGZcWo6O.js +0 -72
  137. package/dist/assets/MagicLinkSignInScreen-BclRPUfZ.js +0 -12
  138. package/dist/assets/MobileAppDrawer-B_zpLZqx.js +0 -1
  139. package/dist/assets/NotFoundScreen-BXryZNID.js +0 -1
  140. package/dist/assets/NotificationRoutes-CQasJ3IU.js +0 -1
  141. package/dist/assets/OAuthConsentScreen-Bo-ewMPc.js +0 -1
  142. package/dist/assets/PandLWithForecastRoutes-DdmupK5y.js +0 -1
  143. package/dist/assets/PeopleRoutes-CYUsZeQt.js +0 -22
  144. package/dist/assets/PerformanceRoutes-DqTbj0rB.js +0 -1
  145. package/dist/assets/ReimbursementApprovalRoutes-CgCsp1OP.js +0 -1
  146. package/dist/assets/ReimbursementRoutes-DKUCzczr.js +0 -68
  147. package/dist/assets/ReportsRoutes-CSUm6Emn.js +0 -1
  148. package/dist/assets/RewardsRoutes-DWpcmti-.js +0 -1
  149. package/dist/assets/ScreenRoutes-evald5rF.js +0 -2
  150. package/dist/assets/SignInScreen-DfTwbUKW.js +0 -1
  151. package/dist/assets/SignOutScreen-CH6sLo8r.js +0 -9
  152. package/dist/assets/TaskRoutes-DVZrk18e.js +0 -9
  153. package/dist/assets/TransactionDetailRoutes-CkeAEzHU.js +0 -1
  154. package/dist/assets/TransactionDetailScreen-hIkUAVjY.js +0 -5
  155. package/dist/assets/TransactionListRoutes-BVLahxTu.js +0 -1
  156. package/dist/assets/TreasuryRoutes-D4vqz1Fs.js +0 -37
  157. package/dist/assets/WiseConfirmationScreen-B9ReE25J.js +0 -12
  158. package/dist/assets/ZeniAccountRoutes-BtAMcoNj.js +0 -57
  159. package/dist/assets/ZeniAccountStatementScreen-B3egvFmp.js +0 -9
  160. package/dist/assets/analytics-cC2XJoxx.js +0 -68
  161. package/dist/assets/epic-Du6qCFYI.js +0 -2
  162. package/dist/assets/expenseAutomationHelper-BkZxz0F-.js +0 -1
  163. package/dist/assets/getLocaleForTenant-BYuz_wJa.js +0 -1
  164. package/dist/assets/useActualMatchingMatchDetail-lnPRleqr.js +0 -1
  165. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-DuZAl-a1.js +0 -1
  166. package/dist/assets/useAskAiCfoHostNavButtonProps-Bq-fQXG8.js +0 -1
  167. package/dist/assets/useChargeCardPusherEvents-CrB7Excu.js +0 -1
  168. package/dist/assets/useEmailConnectResultRefresh-x1GFiNhw.js +0 -1
  169. package/dist/assets/useInitialThreadRequest-C1rKRZSH.js +0 -1
  170. package/dist/assets/useTaskManagerAccess-CoE1FF6T.js +0 -1
  171. package/dist/assets/useTaskManagerPusherEvents-CgOrop-a.js +0 -1
  172. package/dist/assets/withTransactionSidePanel-CbnU34fe.js +0 -25
@@ -1,2 +0,0 @@
1
- import{j as c}from"./liveblocks-CzCs-qU3.js";import{a as r}from"./sentry-CWp8Ph3h.js";import{u as L,h as _,i as F,j as k,t as Z,l as O,s as H,g as X,N as B,n as ae,o as x}from"./core-BBG4mxvC.js";import{a8 as et,j as g,aq as R,T as l,cc as nt,cd as tt,ce as it,cf as ot,cg as at,ch as ct,ci as st,cj as rt,ck as lt,cl as dt,cm as ut,cn as gt,p as Y,co as vt,cp as mt,z as W,ae as re,cq as pt,cr as St,cs as ft,ct as It,cu as ht,cv as Ct,cw as kt,cx as Et,cy as yt,cz as bt,_ as xt,ai as ln,cA as At,cB as Dt,cC as jt,cD as Lt,cE as _t,cF as Pt,cG as wt,cH as $t,cI as Ft,cJ as Rt,cK as Tt,t as qe,l as Pe,cL as Ot,cM as Mt,cN as Nt,cO as Ut,cP as Bt,cQ as Vt,cR as Ht}from"./index-De2R2YuA.js";import"./mui-B2F_PvWe.js";import{A as K}from"./AddressScreen-BYfgTsTg.js";import M from"./NotFoundScreen-BXryZNID.js";import{ZW as qt,ZX as Qt,vv as Qe,ZY as G,vY as le,ZZ as we,Z_ as de,wz as xe,wG as zt,wL as dn,Z$ as $e,wD as un,yd as ze,vX as Ke,_0 as Kt,_1 as gn,wW as Ae,_2 as ue,w_ as Gt,_3 as Wt,_4 as vn,x1 as mn,z8 as Zt,_5 as fe,_6 as Ge,_7 as pn,vV as Xt,_8 as Yt,vP as Jt,_9 as ei,yq as ni,_a as Sn,yz as We,_b as ti,yw as ii,_c as Fe,gk as Re,_d as ie,_e as oe,xg as oi,w1 as Ze,w6 as fn,w4 as ai,v_ as ci,x9 as si,w8 as ri,xi as li,_f as De,xr as In,xp as J,xn as ge,xm as di,_g as hn,yF as Xe,_h as ui,vW as Cn,_i as Te,fI as Ie,wh as je,we as Le,wr as kn,wq as Oe,wb as gi,wk as En,wt as ce,VI as yn,vZ as Me,wo as vi,wp as mi,wn as pi,_j as Si,w$ as fi,wX as bn,_k as xn,vJ as Ye,_l as Ii,vF as hi,_m as Ci,yL as ki,yP as Q,yK as Ei,xT as he,_n as yi,_o as An,yY as Je,_p as bi,yV as xi,_q as Dn,xW as Ai,xX as V,x_ as Di,_r as jn,y8 as Ee,_s as ji,xh as Ln,Ue as _n,_t as Li,yi as _i,_u as Pn,_v as Pi,_w as wi,_x as $i,zN as Fi,_y as Ri,_z as wn,z3 as $n,_A as Fn,zL as ye,_B as Ti,zI as Oi,_C as Mi,_D as Ni,_E as Ui,_F as Bi,_G as Vi,_H as en,_I as Hi,ei as qi,zR as Qi,_J as Ne,xB as zi,xw as Ki,_K as ve,xM as Rn,xE as me,xD as Gi,xH as Tn,_L as Wi,xC as Zi,_M as On,z9 as Mn,zA as nn,zv as Xi,_N as Yi,za as Ji,_O as eo,zB as no,zF as to,_P as Ue,wB as Nn,zm as io,wC as oo,_Q as ao,_R as Un,c9 as co,mv as so,mw as ro,_S as tn,wA as pe,go as lo,mC as uo,zs as Bn,A1 as go,zp as Vn,v1 as vo,uR as mo,hV as po,UH as on,UI as So,Gn as Hn,z_ as fo,hN as Io,zX as ho,_T as Co,Vx as ko,_U as Eo,A6 as be,A7 as yo,_V as bo,_W as qn,A4 as xo,_X as Ao,_Y as Do,ym as jo,_Z as Lo}from"./zeni-epic-state-FRanwwFO.js";import{M as _o}from"./MobileAppDrawer-B_zpLZqx.js";import{q as Se}from"./QBOConnectionScreen-CRdIfjOg.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";import"./InboxNotificationsProvider-J2K-16R3.js";import"./useTaskManagerAccess-CoE1FF6T.js";import"./empty-zUa_Ywzm.js";import"./pdf-lib-DiMa7ymi.js";import"./index-lbu92FYh.js";import"./url-DV6CtKQ5.js";import"./index-CD8RychW.js";import"./decodeURIComponentSafe-DgKmvHaP.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="cd761501-48e7-478b-9cbf-bc58dc919697",t._sentryDebugIdIdentifier="sentry-dbid-cd761501-48e7-478b-9cbf-bc58dc919697")}catch{}})();const w=({event:t,isReady:e=!0})=>e?c.jsx(et,{analytics:g,onLoad:n=>n.trackPageLoaded(t)}):null;function N(...t){return t.some((e=>e==="Error"))}function Po(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[d,p]=r.useState(null),v=r.useMemo((()=>d!=null?{dir:d.direction,field:d.columnKey}:void 0),[d]),{fetchState:m,hasMore:S,items:f,nextCursor:I,auditLogEntityRouteOptions:E,auditLogListSortFieldOptions:h}=k(qt),y=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),D=`/${n??""}/invoicing`,b=r.useCallback(((P,U)=>{const T=Qt(D,P,U,E);T!=null&&(g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{entity:P,entityId:U,fromScreen:"audit_log",toScreen:P}),e(T))}),[E,e,D]);r.useEffect((()=>{const P=setTimeout((()=>u(a)),300);return()=>clearTimeout(P)}),[a]),r.useEffect((()=>{i&&t(Qe({filters:y,keepExistingListItems:!1,sort:v}))}),[i,y,v,t]);const A=m==="Not-Started"||m==="In-Progress"&&f.length===0,C=m==="In-Progress"&&f.length>0,j=m==="Completed";return N(m)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingAuditLogPage,isReady:j}),c.jsx(nt,{auditLogEntityRouteOptions:E,auditLogListSortFieldOptions:h,entries:f,hasMore:S,isLoading:A,isLoadingMore:C,searchValue:a,sortState:d,onEntityLinkClick:b,onLoadMore:()=>{S&&I!=null&&t(Qe({cursor:I,filters:y,keepExistingListItems:!0,sort:v}))},onSearchChange:o,onSortChange:p})]})}function Ce(t,e=!1){const n=L(),i=k((s=>G(s).productNextCursor!=null)),a=k((s=>G(s).productNextCursor)),o=k((s=>G(s).productFetchState.fetchState));r.useEffect((()=>{t&&(e&&o!=="Not-Started"||n(le({filters:{type:"addon|charge"},keepExistingListItems:!1})))}),[t,n,e]),r.useEffect((()=>{t&&o!=="In-Progress"&&i&&a!=null&&n(le({cursor:a,filters:{type:"addon|charge"},keepExistingListItems:!0}))}),[t,n,o,i,a])}function ee(t,e,n,i){const[a,o]=r.useState(0),[s,u]=r.useState(!1),d=r.useRef(t);return r.useEffect((()=>{const p=d.current==="In-Progress";d.current=t,t==="Completed"&&p&&n!=null&&(u(!0),i(n))}),[t,n,i]),r.useEffect((()=>{s&&!e&&(u(!1),o((p=>p+1)))}),[s,e]),a}const wo=new Set(["plan"]),$o=O((function(t,e){const{view:n}=e;return{applicableItemOptions:n.applicableItemOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboClassHierarchy:n.qboClassHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,catalogItemLifecycleActionOptions:n.catalogItemLifecycleActionOptions,catalogProductLifecycleActionOptions:n.catalogProductLifecycleActionOptions,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,isLoading:e.isLoading,isRunningLifecycleAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",itemId:e.itemId,localData:n.localData,plan:n.plan}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{itemId:i}=e;return{onBack:()=>e.navigate(`${n}/catalog`),onLifecycleAction:i!==""?a=>{i!==""&&(g.trackInvoicingActionClick(l.Event.invoicingCatalogItemLifecycleAction,{action:a,fromScreen:"catalog_item_detail",itemId:i}),t(un({action:a,id:i})))}:void 0,onEditChange:a=>{i!==""&&t($e({id:i,localData:a}))},onSaveEdit:()=>{g.trackInvoicingActionClick(l.Event.invoicingCatalogItemEdited,{itemId:i}),t(dn({id:i}))},onSubFamilyLifecycleAction:(a,o)=>{i!==""&&t(zt({action:o,id:a,parentItemId:i}))}}}))(tt);function Fo(){const t=L(),e=_(),{item_id:n,tenantEmailDomain:i}=F(),[a]=Z(),{areTenantIdsInSync:o}=R(),s=(u=a.get("kind"))!=null&&wo.has(u)?u:"plan";var u;const d=k((y=>we(y,n))),{pageFetchState:p}=d,v=p.fetchState;r.useEffect((()=>(t(de({id:n})),()=>{t(de({id:n}))})),[t,n]),r.useEffect((()=>{o&&t(xe({id:n,kind:s}))}),[o,n,s,t]);const m=r.useCallback((y=>t(xe({cacheOverride:!0,id:y,kind:s}))),[t,s]),S=ee(d.fetchState,d.isFormLoading,n,m),f=v==="Completed"&&!d.isFormLoading;Ce(o,!0);const[I,E]=r.useState(f?n:void 0);r.useEffect((()=>{n!=null&&f&&E(n)}),[n,f]);const h=I!==n&&(v==="Not-Started"||v==="In-Progress"||d.isFormLoading);return N(v)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingCatalogItemDetailPage,isReady:f}),c.jsx($o,{navigate:e,tenantEmailDomain:i,itemId:n??"",kind:s,isLoading:h,view:d},S)]})}const Ro=new Set(["addon","charge","plan"]),To=new Set(["plan"]),Oo=O((function(t,e){const n=we(t,e.itemId);return{fieldHelp:n.fieldHelp,qboClassHierarchy:n.qboClassHierarchy,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,applicabilityValues:n.applicabilityValues,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,applicableItemOptions:n.applicableItemOptions,defaultType:e.isEdit?void 0:e.defaultType,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save catalog item.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,pricingModelValues:n.pricingModelValues,prorationValues:n.prorationValues,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,tierTypeValues:n.tierTypeValues}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.isEdit?"edit":"create",{itemId:a}=e,o=a!=null?`${n}/catalog/${encodeURIComponent(a)}`:`${n}/catalog`;return{onBack:()=>e.navigate(o),onCancel:()=>{g.trackInvoicingActionClick(l.Event.invoicingCatalogItemFormCancelled),t(de({id:a})),e.navigate(`${n}/catalog`)},onChange:s=>{t($e({id:a,localData:s}))},onSubmit:()=>{g.trackInvoicingActionClick(l.Event.invoicingCatalogItemSaved,{mode:i}),t(dn({id:a}))}}}))(it);function Mo(){const t=L(),e=_(),{item_id:n,tenantEmailDomain:i}=F(),[a]=Z(),{areTenantIdsInSync:o}=R(),s=n!=null,u=a.get("type"),d=u!=null&&Ro.has(u)?u:void 0,p=(v=a.get("kind"))!=null&&To.has(v)?v:"plan";var v;const m=k((S=>we(S,n)));return Ce(o,!0),r.useEffect((()=>{o&&t(xe({id:n,kind:p}))}),[o,n,p,t]),r.useEffect((()=>{s||d==null||m.localData.catalogType===d||t($e({localData:{...m.localData,catalogType:d}}))}),[s,d,m.localData?.catalogType,t]),r.useEffect((()=>{if(m.fetchState==="Completed"){const S=m.savedItemId??n,f=S!=null?`/${i}/invoicing/catalog/${encodeURIComponent(S)}`:`/${i}/invoicing/catalog`;e(f),t(de({id:n}))}}),[m.fetchState,m.savedItemId,n,t,e,i]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingCatalogItemFormPage}),c.jsx(Oo,{navigate:e,tenantEmailDomain:i,defaultType:d,isEdit:s,itemId:n})]})}const No={addons:"addon",all:"item",charges:"charge",plans:"plan"},Uo=O((function(t,e){const n=G(t),i=e.activeTab==="plans",a=e.activeTab==="all",o=i?n.plans:a?[...n.plans,...n.products]:n.products,s=i||a&&n.fetchState==="In-Progress"?n.fetchState:n.productFetchState.fetchState;return{catalogItemLifecycleActionOptions:n.catalogItemLifecycleActionOptions,counts:n.count,countsLoading:n.countsFetchState.fetchState==="Not-Started"||n.countsFetchState.fetchState==="In-Progress",hasMore:i?n.planNextCursor!=null:a&&n.planNextCursor!=null||n.productNextCursor!=null,isLoading:s==="Not-Started"||s==="In-Progress"&&o.length===0,isLoadingMore:s==="In-Progress"&&o.length>0,plans:n.plans,productColumns:n.productColumns,products:n.products}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.activeTab==="plans",a=e.activeTab==="all",o=i?e.planNextCursor:e.productNextCursor;return{activeTab:e.activeTab,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTabChange:e.onTabChange,onImportCsv:()=>{g.trackInvoicingActionClick(l.Event.invoicingImportCsvClicked,{entity:"catalog"}),e.navigate(`${n}/data_import`)},onAddItem:()=>{const s=No[e.activeTab];g.trackInvoicingActionClick(l.Event.invoicingAddCatalogItemClicked,{itemType:s}),e.navigate(`${n}/catalog/new?type=${s}`)},onItemClick:(s,u)=>{g.trackInvoicingActionClick(l.Event.invoicingCatalogItemRowClicked,{itemId:u}),e.navigate(`${n}/catalog/${encodeURIComponent(u)}`)},onCatalogItemLifecycleAction:(s,u)=>{g.trackInvoicingActionClick(l.Event.invoicingCatalogItemLifecycleAction,{action:u,fromScreen:"catalog_list",itemId:s}),t(un({action:Kt(u),id:s}))},onLoadMore:()=>{if(g.trackInvoicingActionClick(l.Event.invoicingListLoadMore,{entity:"catalog",tab:e.activeTab}),a)return e.planNextCursor!=null&&t(Ke({cursor:e.planNextCursor,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort})),void(e.productNextCursor!=null&&t(le({cursor:e.productNextCursor,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort})));o!=null&&t(i?Ke({cursor:o,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort}):le({cursor:o,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort}))}}}))(ot);function Bo(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState("plans"),[d,p]=r.useState(""),[v,m]=r.useState(null),S=r.useMemo((()=>v!=null?{dir:v.direction,field:v.columnKey}:void 0),[v]),f=d.trim()!==""?d.trim():void 0,I=r.useMemo((()=>({search:f,type:"plan"})),[f]),E=r.useMemo((()=>({search:f,type:"addon|charge"})),[f]),h=k((P=>G(P))),y=h.planFilters.search,D=h.planSort,b=h.planNextCursor,A=h.productNextCursor,C=h.fetchState==="Completed",j=h.runningActionId??null;return r.useEffect((()=>{const P=setTimeout((()=>p(a)),300);return()=>clearTimeout(P)}),[a]),r.useEffect((()=>{i&&t(ze({cacheOverride:!1,planFilters:I,productFilters:E,planSort:S,productSort:S}))}),[i,t,I,E,S]),r.useEffect((()=>{i&&(f!==y||S?.field!==D?.field||S?.dir!==D?.dir)&&t(ze({cacheOverride:!0,planFilters:I,productFilters:E,planSort:S,productSort:S}))}),[y,D,i,t,I,E,f,S]),N(h.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingCatalogPage,isReady:C}),c.jsx(Uo,{navigate:e,tenantEmailDomain:n,activeTab:s,searchValue:a,sortState:v,planFilters:I,productFilters:E,sort:S,planNextCursor:b,productNextCursor:A,runningCatalogItemActionId:j,onSearchChange:o,onTabChange:u,onSortChange:m})]})}const Vo=O((function(t,e){const n=gn(t,e.couponId);return{fieldHelp:n.fieldHelp,applyOnOptions:n.applyOnOptions,discountTypeOptions:n.discountTypeOptions,durationTypeOptions:n.durationTypeOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save coupon.":void 0,isQboConnected:n.isQboConnected,isQboPickerDataLoading:n.isQboPickerDataLoading,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,periodUnitOptions:n.periodUnitOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e,a=i!=null?"edit":"create",o=i!=null?`${n}/discounts/${encodeURIComponent(i)}`:`${n}/discounts`;return{onBack:()=>e.navigate(o),onCancel:()=>{g.trackInvoicingActionClick(l.Event.invoicingCouponFormCancelled),t(ue({id:i})),e.navigate(`${n}/discounts`)},onChange:s=>{t(Wt({id:i,localData:s}))},onSubmit:()=>{g.trackInvoicingActionClick(l.Event.invoicingCouponSaved,{mode:a}),t(Gt({id:i}))}}}))(at);function Ho(){const t=L(),e=_(),{coupon_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),{fetchState:o,savedCouponId:s}=k((u=>gn(u,n)));return r.useEffect((()=>{a&&t(Ae({id:n}))}),[a,n,t]),r.useEffect((()=>{if(o==="Completed"){const u=s??n,d=u!=null?`/${i}/invoicing/discounts/${encodeURIComponent(u)}`:`/${i}/invoicing/discounts`;e(d),t(ue({id:n}))}}),[o,s,n,t,e,i]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingCouponFormPage}),c.jsx(Vo,{couponId:n,navigate:e,tenantEmailDomain:i})]})}const qo=O((function(t){const e=vn(t);return{fieldHelp:e.fieldHelp,customers:e.customers,planNames:e.planNames,errorMessage:e.fetchState==="Error"?e.error?.message??"Failed to create invoice. Please try again.":void 0,isSubmitting:e.fetchState==="In-Progress",localData:e.localData,settings:e.settings}}),(function(t){return{dispatch:t}}),(function(t,{dispatch:e},n){const i=`/${n.tenantEmailDomain}/invoicing`;return{...t,onCancel:()=>{g.trackInvoicingActionClick(l.Event.invoicingCreateInvoiceCancelled),n.navigate(`${i}/invoices`)},onChange:a=>{e(pn(a))},onSubmit:()=>{const a=Yt(t.localData);g.trackInvoicingActionClick(l.Event.invoicingInvoiceCreated,{customerId:a.customer_id,lineItemCount:a.line_items?.length}),e(Jt(a))}}}))(st);function Qo(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),[i]=Z(),{areTenantIdsInSync:a}=R(),o=i.get("customerId"),s=k((b=>vn(b))),u=s.fetchState,d=s.localData,p=s.savedInvoiceId,v=k(mn),m=k((b=>Zt(b))),S=k(fe),f=m.fetchState==="Not-Started"||m.fetchState==="In-Progress"&&v==null,I=S.fetchState==="Not-Started"||S.fetchState==="In-Progress"&&S.customers.length===0,E=f||I,h=m.fetchState==="Completed"&&S.fetchState==="Completed";r.useEffect((()=>(t(Ge()),()=>{t(Ge())})),[t]);const y=r.useRef(!1);r.useEffect((()=>{y.current||o==null||o===""||d.customerId!==""||(y.current=!0,t(pn({...d,customerId:o})))}),[o,d,t]),r.useEffect((()=>{a&&t(Xt({cacheOverride:!1}))}),[a,t]);const D=r.useRef(u);return r.useEffect((()=>{const b=D.current;if(D.current=u,b!=="Completed"&&u==="Completed"){const A=p!=null?`/${n}/invoicing/invoices/${encodeURIComponent(p)}`:`/${n}/invoicing/invoices`;e(A)}}),[u,p,e,n]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingCreateInvoicePage,isReady:h}),E?c.jsx(ct,{}):c.jsx(qo,{navigate:e,tenantEmailDomain:n})]})}const zo=O((function(t,e){const{detailView:n}=e;return{fieldHelp:e.detailView.fieldHelp,creditNote:n.creditNote,creditNoteId:e.creditNoteId,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onBack:()=>e.navigate(`${n}/credits`),onCustomerClick:i=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{customerId:i,fromScreen:"credit_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onInvoiceClick:i=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",invoiceId:i,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onSubscriptionClick:i=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",subscriptionId:i,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)}}}))(rt);function Ko(){const t=L(),e=_(),{credit_note_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),o=k((u=>ei(u,n??""))),s=o.fetchState==="Completed";return r.useEffect((()=>{a&&n!=null&&t(ni({id:n}))}),[a,n,t]),N(o.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingCreditDetailPage,isReady:s}),c.jsx(zo,{navigate:e,tenantEmailDomain:i,creditNoteId:n??"",detailView:o})]})}const Go=O((function(t){const e=Sn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",creditNotes:e.creditNotes,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.creditNotes.length===0,isLoadingMore:n==="In-Progress"&&e.creditNotes.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>{g.trackInvoicingActionClick(l.Event.invoicingImportCsvClicked,{entity:"credits"}),e.navigate(`${n}/data_import`)},onCreditNoteClick:i=>{g.trackInvoicingActionClick(l.Event.invoicingCreditNoteRowClicked,{creditNoteId:i}),e.navigate(`${n}/credits/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(l.Event.invoicingListLoadMore,{entity:"credits",status:e.activeStatus}),t(ii({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(lt);function Wo(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[d,p]=r.useState(null),v=r.useMemo((()=>d!=null?{dir:d.direction,field:d.columnKey}:void 0),[d]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:S,appliedSearch:f,appliedSort:I,nextCursor:E,creditNoteListFetchState:h}=k((D=>{const b=Sn(D);return{activeStatus:b.activeTab,appliedSearch:b.filters.search,appliedSort:b.sort,nextCursor:b.nextCursor,creditNoteListFetchState:b.fetchState}}),H),y=h==="Completed";return r.useEffect((()=>{const D=setTimeout((()=>u(a)),300);return()=>clearTimeout(D)}),[a]),r.useEffect((()=>{i&&t(We({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(We({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingCreditsListPage,isReady:y}),c.jsx(Go,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:d,filters:m,sort:v,nextCursor:E,onSearchChange:o,onStatusChange:D=>t(ti(D)),onSortChange:p})]})}const Qn=(t,e,n)=>{const i=`/${t}/invoicing/customers/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Zo=O((function(t,e){const{editView:n,hasLoadedRecord:i}=e;return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,hasUnsavedBillingAddress:n.hasUnsavedBillingAddress,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,customer:n.record.invoicingCustomer,invoices:n.record.invoices.slice(0,5),isLoading:!i&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),hasPaymentLinkEmailPreviewFailed:n.emailPreviewFetchState.fetchState==="Error",isPaymentLinkEmailPreviewLoading:n.emailPreviewFetchState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",paymentLinkEmailPreview:n.emailPreview,isSendingPaymentLink:n.record.sendLinkState.fetchState==="In-Progress",localData:n.localData,paymentMethods:n.record.paymentMethods,sendPaymentLinkErrorMessage:n.record.sendLinkState.fetchState==="Error"?n.record.sendLinkState.error?.message??"Failed to send payment link.":void 0,sentPaymentLinkEmail:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkEmail:void 0,sentPaymentLinkMagicUrl:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkMagicUrl:void 0,stripeConnected:n.record.stripeConnected}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e;return{onBack:()=>e.navigate(`${n}/customers`),onChange:a=>{t(De({id:i,localData:a}))},onCreateInvoice:()=>{g.trackInvoicingActionClick(l.Event.invoicingCreateInvoiceClicked,{customerId:i,fromScreen:"customer_detail"}),e.navigate(`${n}/invoices/create`)},onInvoiceClick:a=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onCreatePromotionalCredits:()=>{g.trackInvoicingActionClick(l.Event.invoicingPromotionalCreditsClicked,{customerId:i,fromScreen:"customer_detail"}),e.onCreatePromotionalCredits()},onNewSubscription:()=>{g.trackInvoicingActionClick(l.Event.invoicingAddSubscriptionClicked,{customerId:i,fromScreen:"customer_detail"}),e.navigate(`${n}/subscriptions/new`)},onDiscardEdit:()=>{t(J(ge)),t(di({id:i}))},onOpenAddress:()=>{const a=Qn(e.tenantEmailDomain??"",ge,i),o=Y(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(a,{state:{pathnameStackToGoBack:o}})},onOpenPaymentSettings:()=>e.navigate(`${n}/settings/payment-destination`),onSaveEdit:a=>{g.trackInvoicingActionClick(l.Event.invoicingCustomerEdited,{customerId:i}),t(De({id:i,localData:a})),t(In({id:i}))},onFetchPaymentLinkEmailPreview:a=>t(li({cacheOverride:a,customerId:i})),onSendPaymentLink:(a,o,s)=>{g.trackInvoicingActionClick(l.Event.invoicingPaymentLinkSent,{customerId:i,fromScreen:"customer_detail"}),t(ri({body:s,customerId:i,email:a,subject:o}))},onSubscriptionClick:a=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)}}}))(gt);function Xo(){const t=L(),e=_(),n=X(),{customer_id:i,tenantEmailDomain:a}=F(),{areTenantIdsInSync:o}=R(),s=k((T=>Fe(T,i))),u=s.pageFetchState.fetchState,d=u==="Completed"&&!s.isFormLoading,[p,v]=r.useState(!1),[m,S]=r.useState(!1),[f,I]=r.useState(d?i:void 0);r.useEffect((()=>{i!=null&&d&&I(i)}),[i,d]);const E=f===i,{plaidTokenFetchState:h,promotionalCreditSubmitState:y}=s,{paymentMethodSaveState:D,setupIntentFetchState:b,stripeConnected:A}=s.record,C=r.useRef(s.record.sendLinkState.fetchState);r.useEffect((()=>{const T=s.record.sendLinkState.fetchState;C.current!=="Error"&&T==="Error"&&t(Re({messageSection:"common",messageText:"failed",showStatusIcon:!0,type:"error"})),C.current=T}),[t,s.record.sendLinkState.fetchState]);const j=b.fetchState==="Error"?b.error?.message??"Failed to start card setup.":D.fetchState==="Error"?D.error?.message??"Failed to save payment method.":h.fetchState==="Error"?h.error?.message??"Failed to connect bank account.":void 0;r.useEffect((()=>(t(ie()),t(oe()),()=>{t(ie()),t(oe())})),[t]),r.useEffect((()=>{n.state?.openPromotionalCreditsDialog===!0&&(S(!0),e(n.pathname,{replace:!0,state:null}))}),[n.pathname,n.state,e]),r.useEffect((()=>{o&&i!=null&&t(oi({id:i}))}),[o,i,t]),r.useEffect((()=>{o&&i!=null&&A&&t(Ze({customerId:i}))}),[o,i,t,A]);const P=r.useCallback((T=>t(fn({id:T}))),[t]),U=ee(s.fetchState,s.isFormLoading,i,P);return N(u)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingCustomerDetailPage,isReady:d}),c.jsx(Zo,{customerId:i??"",editView:s,hasLoadedRecord:E,location:n,navigate:e,tenantEmailDomain:a,onAddPaymentMethod:()=>{g.trackInvoicingActionClick(l.Event.invoicingPaymentMethodAddClicked,{customerId:i??"",fromScreen:"customer_detail"}),t(ie()),i!=null&&A&&t(Ze({customerId:i})),v(!0)},onCreatePromotionalCredits:()=>{t(oe()),S(!0)}},U),c.jsx(dt,{errorMessage:j,isCreatingSetupIntent:b.fetchState==="In-Progress",isSaving:D.fetchState==="In-Progress",open:p,plaidLinkToken:s.record.plaidLinkToken,saveSucceeded:D.fetchState==="Completed",setupIntent:s.record.setupIntent,stripeConnected:A,onChooseCard:()=>{i!=null&&t(ci({customerId:i}))},onClose:()=>{v(!1),t(ie())},onSavePaymentMethod:T=>{i!=null&&(g.trackInvoicingActionClick(l.Event.invoicingPaymentMethodSaved,{customerId:i,fromScreen:"customer_detail"}),t(ai({customerId:i,data:T})))}}),c.jsx(ut,{currentBalance:s.record.invoicingCustomer?.promotionalCredits,currencyCode:s.record.invoicingCustomer?.preferredCurrencyCode,errorMessage:y.fetchState==="Error"?y.error?.message??"Failed to add promotional credits.":void 0,isSubmitting:y.fetchState==="In-Progress",open:m,submitSucceeded:y.fetchState==="Completed",onClose:()=>{S(!1),t(oe())},onSubmit:({amount:T,description:te})=>{i!=null&&(g.trackInvoicingActionClick(l.Event.invoicingPromotionalCreditsAdded,{amount:T,customerId:i,fromScreen:"customer_detail"}),t(si({amount:T,customerId:i,currencyCode:s.record.invoicingCustomer?.preferredCurrencyCode,description:te})))}})]})}const Yo=O((function(t,e){const n=Fe(t,e.customerId);return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save customer.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e,a=i!=null?"edit":"create",o=i!=null?`${n}/customers/${encodeURIComponent(i)}`:`${n}/customers`;return{onBack:()=>e.navigate(o),onCancel:()=>{g.trackInvoicingActionClick(l.Event.invoicingCustomerFormCancelled),t(hn({id:i})),t(J(ge)),e.navigate(`${n}/customers`)},onChange:s=>{t(De({id:i,localData:s}))},onOpenAddress:()=>{g.trackInvoicingActionClick(l.Event.invoicingAddressOpened,{entity:"customer",fromScreen:"customer_form"});const s=Qn(e.tenantEmailDomain??"",ge,i),u=Y(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(s,{state:{pathnameStackToGoBack:u}})},onSubmit:()=>{g.trackInvoicingActionClick(l.Event.invoicingCustomerSaved,{mode:a}),t(In({id:i}))}}}))(vt);function Jo(){const t=L(),e=_(),n=X(),{customer_id:i,tenantEmailDomain:a}=F(),{areTenantIdsInSync:o}=R(),{fetchState:s,savedCustomerId:u}=k((d=>Fe(d,i)));return r.useEffect((()=>{o&&i!=null&&t(fn({id:i}))}),[o,i,t]),r.useEffect((()=>{if(s==="Completed"){const d=u??i,p=d!=null?`/${a}/invoicing/customers/${encodeURIComponent(d)}`:`/${a}/invoicing/customers`;e(p),t(hn({id:i}))}}),[s,u,i,t,e,a]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingCustomerFormPage}),c.jsx(Yo,{customerId:i,location:n,navigate:e,tenantEmailDomain:a})]})}const ea=O((function(t){const e=fe(t),{fetchState:n}=e;return{addressesById:t.addressState.addressesById,columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",customers:e.customers,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.customers.length===0,isLoadingMore:n==="In-Progress"&&e.customers.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onAddCustomer:()=>{g.trackInvoicingActionClick(l.Event.invoicingAddCustomerClicked),e.navigate(`${n}/customers/new`)},onCustomerClick:i=>{g.trackInvoicingActionClick(l.Event.invoicingCustomerRowClicked,{customerId:i}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onImportCsv:()=>{g.trackInvoicingActionClick(l.Event.invoicingImportCsvClicked,{entity:"customers"}),e.navigate(`${n}/data_import`)},onRowAction:(i,a)=>{switch(a){case"createInvoice":g.trackInvoicingActionClick(l.Event.invoicingCreateInvoiceClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/invoices/create?customerId=${encodeURIComponent(i)}`);break;case"newSubscription":g.trackInvoicingActionClick(l.Event.invoicingAddSubscriptionClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/subscriptions/new?customerId=${encodeURIComponent(i)}`);break;case"createPromotionalCredits":g.trackInvoicingActionClick(l.Event.invoicingPromotionalCreditsClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`,{state:{openPromotionalCreditsDialog:!0}})}},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(l.Event.invoicingListLoadMore,{entity:"customers",status:e.activeStatus}),t(Cn({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(mt);function na(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[d,p]=r.useState(null),v=r.useMemo((()=>d!=null?{dir:d.direction,field:d.columnKey}:void 0),[d]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:S,appliedSearch:f,appliedSort:I,nextCursor:E,customerListFetchState:h}=k((D=>{const b=fe(D);return{activeStatus:b.activeTab,appliedSearch:b.filters.search,appliedSort:b.sort,nextCursor:b.nextCursor,customerListFetchState:b.fetchState}}),H),y=h==="Completed";return r.useEffect((()=>{const D=setTimeout((()=>u(a)),300);return()=>clearTimeout(D)}),[a]),r.useEffect((()=>{i&&t(Xe({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Xe({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingCustomersListPage,isReady:y}),c.jsx(ea,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:d,filters:m,sort:v,nextCursor:E,onSearchChange:o,onStatusChange:D=>t(ui(D)),onSortChange:p})]})}const _e=(t,e)=>e==null?void 0:t.sessionDetail[e]??t.sessions.find((n=>n.id===e)),ta=O((function(t,e){const{authParams:n,csvDownloadUrl:i,filters:a,sessionId:o,view:s}=e,u=o==null?void 0:s.diagnosticsBySession[o],d=u?.fetch.fetchState??"Not-Started";return{authParams:n,csvDownloadUrl:i,diagnostics:u?.items??[],errorMessage:d==="Error"?u?.fetch.error?.message:void 0,expired:u?.expired??!1,filters:a,hasMore:u?.nextCursor!=null,isLoading:d==="Not-Started"||d==="In-Progress",isLoadingMore:d==="In-Progress"&&(u?.items.length??0)>0,session:_e(s,o)}}),(function(t,e){const{filters:n,navigate:i,sessionId:a,tenantEmailDomain:o,view:s}=e,u=a==null?void 0:s.diagnosticsBySession[a],d=_e(s,a),p=s.actionStateByKind.retry?.fetchState==="In-Progress",v=s.actionStateByKind.rollback?.fetchState==="In-Progress",m=d?.status==="done"&&d.rollback_available_until!=null&&new Date(d.rollback_available_until).getTime()>Date.now()&&!v;return{onBack:()=>i(`/${o}/invoicing/data_import`),onDownloadCsv:()=>{g.trackInvoicingActionClick(l.Event.invoicingImportSessionAction,{action:"download_csv",fromScreen:"data_import_detail",sessionId:a})},onDownloadError:()=>{t(Re({messageSection:"invoicing_data_import_download",messageText:"failed",showStatusIcon:!0,type:"error"}))},onFiltersChange:e.onFiltersChange,onLoadMore:()=>{a!=null&&u?.nextCursor!=null&&t(Le({...n,cursor:u.nextCursor,sessionId:a}))},onRetry:d?.status!=="failed"||p?void 0:()=>{a!=null&&(g.trackInvoicingActionClick(l.Event.invoicingImportSessionAction,{action:"retry",fromScreen:"data_import_detail",sessionId:a}),t(Oe(a)))},onRollback:m?()=>{a!=null&&(g.trackInvoicingActionClick(l.Event.invoicingImportSessionAction,{action:"rollback",fromScreen:"data_import_detail",sessionId:a}),t(kn(a)))}:void 0}}))(pt);function ia(){const t=L(),e=_(),{sessionId:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),[o,s]=r.useState({}),u=k(Te),d=k(Ie),p=r.useMemo((()=>{const E=W.getSignedInUser();return{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:d.tenantId}}),[d.tenantId]),v=_e(u,n),m=n==null?void 0:u.diagnosticsBySession[n];r.useEffect((()=>{a&&n!=null&&t(je(n))}),[a,t,n]),r.useEffect((()=>{if(!a||n==null)return;const E=setTimeout((()=>{t(Le({...o,sessionId:n}))}),300);return()=>clearTimeout(E)}),[a,t,o,n]);const S=v?.status==="scanning"||v?.status==="importing";r.useEffect((()=>{if(!a||n==null||!S)return;const E=setInterval((()=>{t(je(n)),t(Le({...o,sessionId:n}))}),3e3);return()=>clearInterval(E)}),[a,t,o,S,n]);const f=r.useMemo((()=>{if(n==null)return"";const E=new URLSearchParams;o.moduleId!=null&&E.set("module_id",o.moduleId),o.level!=null&&E.set("level",o.level),o.outcome!=null&&E.set("outcome",o.outcome),o.search!=null&&o.search.trim()!==""&&E.set("search",o.search.trim());const h=E.toString();return`${re?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/${encodeURIComponent(n)}/issues.csv${h===""?"":`?${h}`}`}),[o,n]),I=m?.fetch.fetchState??"Not-Started";return N(I)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingDataImportDetailPage,isReady:v!=null&&I!=="Not-Started"}),c.jsx(ta,{authParams:p,csvDownloadUrl:f,filters:o,navigate:e,sessionId:n,tenantEmailDomain:i,view:u,onFiltersChange:s})]})}const zn=t=>`invoicing_active_migration:${t}`,se=(t,e)=>{if(t!=null&&t!=="")try{const n=zn(t);e==null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},oa=O((function(t,e){const{sessions:n,sessionsFetch:i,statusFetch:a,statusRows:o}=e.view;return{isLoading:!(a.fetchState!=="Not-Started"&&a.fetchState!=="In-Progress"||o.length!==0||i.fetchState!=="Not-Started"&&i.fetchState!=="In-Progress"),sessions:n,statusRows:o}}),(function(t,e){const{navigate:n,tenantEmailDomain:i}=e,a=o=>{const s=o??null;t(ce(s)),se(i,s),n(`/${i}/invoicing/data_import/migrate`)};return{onContinueSession:o=>{g.trackInvoicingActionClick(l.Event.invoicingImportSessionAction,{action:"continue",sessionId:o}),a(o)},onNewImport:()=>{g.trackInvoicingActionClick(l.Event.invoicingNewImportClicked),a()},onRetrySession:o=>{g.trackInvoicingActionClick(l.Event.invoicingImportSessionAction,{action:"retry",sessionId:o}),t(Oe(o)),a(o)},onRollbackSession:o=>{g.trackInvoicingActionClick(l.Event.invoicingImportSessionAction,{action:"rollback",sessionId:o}),t(kn(o))},onViewSession:o=>{g.trackInvoicingActionClick(l.Event.invoicingImportSessionAction,{action:"view_details",sessionId:o}),n(`/${i}/invoicing/data_import/${encodeURIComponent(o)}`)}}}))(St);function aa(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),a=k(Te);r.useEffect((()=>{i&&(t(gi()),t(En()))}),[i,t]);const o=a.statusFetch.fetchState==="Completed"&&a.sessionsFetch.fetchState==="Completed";return c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingDataImportHubPage,isReady:o}),c.jsx(oa,{navigate:e,tenantEmailDomain:n,view:a})]})}const ca=O((function(t,e){const{activeId:n,authParams:i,integrationsView:a,settings:o,templatesDownloadUrl:s,view:u}=e,{actionStateByKind:d,sessionDetail:p,sessions:v}=u,m=a.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee")),S=n!=null?p[n]:void 0;return{authParams:i,templatesDownloadUrl:s,chargebeeConnected:o?.chargebee_connected===!0||(m?.isValid??!1),chargebeeConnectorAvailable:m!=null,chargebeeSite:o?.chargebee_site,connectError:d.connect?.error?.message,connecting:d.connect?.fetchState==="In-Progress",retrying:d.retry?.fetchState==="In-Progress",session:S??v.find((f=>f.id===n)),starting:d.start?.fetchState==="In-Progress",uploading:d.upload?.fetchState==="In-Progress"}}),(function(t,e){const{activeId:n,navigate:i,tenantEmailDomain:a}=e;return{onBack:e.onBack,onDownloadError:()=>{t(Re({messageSection:"invoicing_data_import_download",messageText:"failed",showStatusIcon:!0,type:"error"}))},onDownloadTemplates:()=>{g.trackInvoicingActionClick(l.Event.invoicingImportTemplatesDownloaded)},onFetchFromChargebee:()=>{g.trackInvoicingActionClick(l.Event.invoicingChargebeeConnectClicked),t(pi())},onGoToIntegrations:()=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{fromScreen:"data_import_migrate",toScreen:"settings_integrations"}),i(`/${a}/invoicing/settings`)},onGoToOverview:()=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{fromScreen:"data_import_migrate",toScreen:"overview"}),i(`/${a}/invoicing/overview`)},onRetry:()=>{n!=null&&(g.trackInvoicingActionClick(l.Event.invoicingImportSessionAction,{action:"retry",fromScreen:"data_import_migrate",sessionId:n}),t(Oe(n)))},onSaveLater:()=>{g.trackInvoicingActionClick(l.Event.invoicingImportSavedForLater),e.onBack()},onStartImport:()=>{g.trackInvoicingActionClick(l.Event.invoicingImportStarted),n!=null&&t(mi(n))},onUpload:o=>{g.trackInvoicingActionClick(l.Event.invoicingImportFileUploaded),t(vi({files:o}))},onViewDetails:n==null?void 0:()=>i(`/${a}/invoicing/data_import/${encodeURIComponent(n)}`)}}))(ft);function sa(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),a=k(mn),o=k(Ie),s=r.useMemo((()=>{const h=W.getSignedInUser();return{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:o.tenantId}}),[o.tenantId]),u=`${re?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/templates`,d=o.companyId??W.getSignedInUserTenant(n??"")?.companyId,p=k((h=>yn(h,d))),v=k(Te),{activeMigrationSessionId:m}=v,S=m??void 0,f=S!=null?v.sessionDetail[S]??v.sessions.find((h=>h.id===S)):void 0;r.useEffect((()=>{i&&(t(Me()),t(En()))}),[i,t]),r.useEffect((()=>{if(m!=null)return;const h=(y=>{if(y==null||y==="")return null;try{return sessionStorage.getItem(zn(y))}catch{return null}})(n);h!=null&&t(ce(h))}),[m,t,n]),r.useEffect((()=>{se(n,m)}),[m,n]);const I=f?.status,E=I==="scanning"||I==="importing";return r.useEffect((()=>{if(!i||S==null||!E)return;const h=setInterval((()=>{t(je(S))}),3e3);return()=>clearInterval(h)}),[i,S,E,t]),r.useEffect((()=>{I==="done"&&(t(ce(null)),se(n,null))}),[t,I,n]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingDataImportMigratePage}),c.jsx(ca,{activeId:S,authParams:s,integrationsView:p,navigate:e,settings:a,templatesDownloadUrl:u,tenantEmailDomain:n,view:v,onBack:()=>{t(ce(null)),se(n,null),e(`/${n}/invoicing/data_import`)}})]})}const ra=O((function(t,e){const{editView:n}=e;return{fieldHelp:n.fieldHelp,coupon:n.coupon,discountLifecycleActionOptions:e.discountLifecycleActionOptions,discountsAccountName:n.discountsAccountName,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isRunningLifecycleAction:e.isRunningLifecycleAction,isSaving:n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e;return{onBack:()=>e.navigate(`${n}/discounts`),onLifecycleAction:a=>{g.trackInvoicingActionClick(l.Event.invoicingCouponLifecycleAction,{action:a,couponId:i,fromScreen:"discount_detail",status:e.editView.coupon?.status}),t(bn({action:a,id:i}))},onSaveEdit:a=>{g.trackInvoicingActionClick(l.Event.invoicingCouponEdited,{couponId:i}),t(fi({data:a,id:i}))}}}))(It);function la(){const t=L(),e=_(),{coupon_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),o=k((I=>Si(I,n))),s=o.actionState.fetchState==="In-Progress",u=o.pageFetchState.fetchState,d=u==="Completed",[p,v]=r.useState(d?n:void 0);r.useEffect((()=>{n!=null&&d&&v(n)}),[n,d]);const m=p===n;r.useEffect((()=>(t(ue({id:n})),()=>{t(ue({id:n}))})),[n,t]),r.useEffect((()=>{a&&t(Ae({id:n}))}),[a,n,t]);const S=r.useCallback((I=>t(Ae({cacheOverride:!0,id:I}))),[t]),f=ee(o.fetchState,o.isFormLoading,n,S);return N(u)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingDiscountDetailPage,isReady:d}),c.jsx(ra,{hasLoadedRecord:m,couponId:n??"",discountLifecycleActionOptions:o.discountLifecycleActionOptions,editView:o,isRunningLifecycleAction:s,navigate:e,tenantEmailDomain:i},f)]})}const da=O((function(t){const e=xn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,discountLifecycleActionOptions:e.discountLifecycleActionOptions,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",coupons:e.coupons,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.coupons.length===0,isLoadingMore:n==="In-Progress"&&e.coupons.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onCouponClick:i=>{g.trackInvoicingActionClick(l.Event.invoicingDiscountRowClicked,{couponId:i}),e.navigate(`${n}/discounts/${encodeURIComponent(i)}`)},onCreateCoupon:()=>{g.trackInvoicingActionClick(l.Event.invoicingCreateCouponClicked),e.navigate(`${n}/discounts/new`)},onImportCsv:()=>{g.trackInvoicingActionClick(l.Event.invoicingImportCsvClicked,{entity:"discounts"}),e.navigate(`${n}/data_import`)},onDiscountLifecycleAction:(i,a)=>{g.trackInvoicingActionClick(l.Event.invoicingCouponLifecycleAction,{action:a,couponId:i,fromScreen:"discounts_list"}),t(bn({action:a,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(l.Event.invoicingListLoadMore,{entity:"discounts",status:e.activeStatus}),t(hi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(ht);function ua(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[d,p]=r.useState(null),v=r.useMemo((()=>d!=null?{dir:d.direction,field:d.columnKey}:void 0),[d]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:S,appliedSearch:f,appliedSort:I,nextCursor:E,couponListFetchState:h,runningDiscountActionId:y}=k((b=>{const A=xn(b);return{activeStatus:A.activeTab,appliedSearch:A.filters.search,appliedSort:A.sort,nextCursor:A.nextCursor,couponListFetchState:A.fetchState,runningDiscountActionId:A.runningActionId??null}}),H),D=h==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>u(a)),300);return()=>clearTimeout(b)}),[a]),r.useEffect((()=>{i&&t(Ye({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Ye({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingDiscountsListPage,isReady:D}),c.jsx(da,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:d,filters:m,sort:v,nextCursor:E,runningDiscountActionId:y,onSearchChange:o,onStatusChange:b=>t(Ii(b)),onSortChange:p})]})}const ga=O((function(t,e){const{readView:n}=e;return{fieldHelp:e.readView.fieldHelp,caseId:e.caseId,dunningAttempts:e.dunningAttempts,dunningCase:n.dunningCase,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{caseId:i}=e,a=i!=="",{dunningCase:o}=e.readView,s={amount:o?.amount?.amount,caseId:i,customerId:o?.customerID,invoiceId:o?.invoiceID,status:o?.status,subscriptionId:o?.subscriptionID};return{onBack:()=>e.navigate(`${n}/dunning`),onInvoiceClick:u=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{caseId:i,fromScreen:"dunning_detail",invoiceId:u,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(u)}`)},onCancel:a?()=>{g.trackInvoicingActionClick(l.Event.invoicingDunningAction,{...s,action:"cancel",fromScreen:"dunning_detail"}),t(Q({action:"cancel",id:i}))}:void 0,onResolve:a?()=>{g.trackInvoicingActionClick(l.Event.invoicingDunningAction,{...s,action:"resolve",fromScreen:"dunning_detail"}),t(Q({action:"resolve",id:i}))}:void 0,onResume:a?()=>{g.trackInvoicingActionClick(l.Event.invoicingDunningAction,{...s,action:"resume",fromScreen:"dunning_detail"}),t(Q({action:"resume",id:i}))}:void 0,onRetry:a?()=>{g.trackInvoicingActionClick(l.Event.invoicingDunningAction,{...s,action:"retry",fromScreen:"dunning_detail"}),t(Q({action:"retry",id:i}))}:void 0}}))(kt);function va(){const t=L(),e=_(),{case_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),o=k((C=>Ci(C,n??""))),s=o.fetchState==="Completed",u=o.dunningCase?.invoiceID,[d,p]=r.useState("idle"),[v,m]=r.useState(!1),[S,f]=r.useState(),[I,E]=r.useState(!1),h=r.useCallback((()=>{p("idle"),m(!1),f(void 0),E(!1)}),[]),y=r.useCallback((()=>{if(n==null)return;t(ki({id:n})),p("idle"),m(!1);const C=o.emailPreview.preview;f(C==null?void 0:{body:C.body,cc:C.cc,subject:C.subject,to:C.to}),E(!0)}),[n,t,o.emailPreview.preview]),D=r.useCallback((C=>{n!=null&&d!=="pending"&&(m(!1),p("pending"),g.trackInvoicingActionClick(l.Event.invoicingDunningAction,{action:"send-email",amount:o.dunningCase?.amount?.amount,caseId:n,customerId:o.dunningCase?.customerID,fromScreen:"dunning_detail",invoiceId:o.dunningCase?.invoiceID,status:o.dunningCase?.status,subscriptionId:o.dunningCase?.subscriptionID}),t(Q({action:"send-email",body:C,id:n})))}),[n,t,d,o.dunningCase]),b=r.useMemo((()=>o.emailPreview.preview==null?void 0:{bodyToken:o.emailPreview.preview.bodyToken,renderedHtmlTemplate:o.emailPreview.preview.renderedHtmlTemplate,subjectToken:o.emailPreview.preview.subjectToken}),[o.emailPreview.preview]);r.useEffect((()=>{a&&n!=null&&t(Ei({id:n}))}),[a,n,t]),r.useEffect((()=>{a&&u!=null&&t(he({invoiceId:u}))}),[a,u,t]),r.useEffect((()=>{p("idle"),m(!1),f(void 0),E(!1)}),[n]),r.useEffect((()=>{a||(p("idle"),m(!1),f(void 0),E(!1))}),[a]),r.useEffect((()=>{I&&S==null&&o.emailPreview.preview!=null&&f({body:o.emailPreview.preview.body,cc:o.emailPreview.preview.cc,subject:o.emailPreview.preview.subject,to:o.emailPreview.preview.to})}),[o.emailPreview.preview,S,I]),r.useEffect((()=>{d==="pending"&&(o.actionState.fetchState!=="In-Progress"?v&&o.actionState.fetchState==="Completed"?(n!=null&&t(yi({id:n})),h()):v&&o.actionState.fetchState==="Error"&&p("failed"):m(!0))}),[n,h,t,d,v,o.actionState.fetchState]);const A=u!=null&&o.linkedInvoice?.id===u?o.linkedInvoice.dunningAttempts:void 0;return N(o.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingDunningDetailPage,isReady:s}),c.jsx(ga,{navigate:e,tenantEmailDomain:i,caseId:n??"",readView:o,dunningAttempts:A,onSendEmail:y}),c.jsx(Ct,{initialDraft:S,isPreviewLoading:o.emailPreview.fetchState==="Not-Started"||o.emailPreview.fetchState==="In-Progress",isSending:d==="pending",onClose:h,onSend:D,open:I,preview:b,previewErrorMessage:o.emailPreview.fetchState==="Error"?o.emailPreview.error?.message:void 0,sendErrorMessage:d==="failed"?o.actionState.error?.message:void 0})]})}const ma=O((function(t){const e=An(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",dunningCases:e.dunningCases,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.dunningCases.length===0,isLoadingMore:n==="In-Progress"&&e.dunningCases.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=a=>{const o=e.dunningCases.find((s=>s.id===a));return{amount:o?.amount?.amount,caseId:a,customerId:o?.customerID,fromScreen:"dunning_list",invoiceId:o?.invoiceID,status:o?.status,subscriptionId:o?.subscriptionID}};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>e.navigate(`${n}/data_import`),onDunningCaseClick:a=>{g.trackInvoicingActionClick(l.Event.invoicingDunningCaseRowClicked,i(a)),e.navigate(`${n}/dunning/${encodeURIComponent(a)}`)},onRowAction:(a,o)=>{o!=="retry"&&o!=="resume"&&o!=="resolve"&&o!=="cancel"||(g.trackInvoicingActionClick(l.Event.invoicingDunningAction,{...i(a),action:o}),t(Q({action:o,id:a})))},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(l.Event.invoicingListLoadMore,{entity:"dunning",status:e.activeStatus}),t(xi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(Et);function pa(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[d,p]=r.useState(null),v=r.useMemo((()=>d!=null?{dir:d.direction,field:d.columnKey}:void 0),[d]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:S,appliedSearch:f,appliedSort:I,nextCursor:E,dunningCaseListFetchState:h,dunningCases:y}=k((b=>{const A=An(b);return{activeStatus:A.activeTab,appliedSearch:A.filters.search,appliedSort:A.sort,nextCursor:A.nextCursor,dunningCaseListFetchState:A.fetchState,dunningCases:A.dunningCases}}),H),D=h==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>u(a)),300);return()=>clearTimeout(b)}),[a]),r.useEffect((()=>{i&&t(Je({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Je({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingDunningListPage,isReady:D}),c.jsx(ma,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:d,filters:m,sort:v,dunningCases:y,nextCursor:E,onSearchChange:o,onStatusChange:b=>t(bi(b)),onSortChange:p})]})}const Sa=O((function(t,e){const{view:n}=e;return{fieldHelp:e.view.fieldHelp,billingAddress:n.billingAddress,invoice:n.invoice,invoiceId:e.invoiceId,shippingAddress:n.shippingAddress,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isSaving:n.actionState.fetchState==="In-Progress",isVoiding:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{invoiceId:i}=e,{invoice:a}=e.view,o={amount:a?.total?.amount,customerId:a?.customerID,invoiceId:i,status:a?.status};return{onBack:()=>e.navigate(`${n}/invoices`),onCustomerClick:s=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{customerId:s,fromScreen:"invoice_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(s)}`)},onIssueCreditNote:()=>{g.trackInvoicingActionClick(l.Event.invoicingIssueCreditNoteClicked,{...o,fromScreen:"invoice_detail"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`)},onRecordPayment:()=>{g.trackInvoicingActionClick(l.Event.invoicingRecordPaymentClicked,{...o,fromScreen:"invoice_detail"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`)},onRegenerate:()=>{g.trackInvoicingActionClick(l.Event.invoicingInvoiceRegenerated,{...o,fromScreen:"invoice_detail"}),t(V({action:"regenerate",invoiceId:i}))},onSaveEdit:s=>{g.trackInvoicingActionClick(l.Event.invoicingInvoiceEdited,{...o,fromScreen:"invoice_detail"}),t(Di({data:{due_date:s.due_date!==""?s.due_date:void 0,notes:s.notes.trim()!==""?s.notes.split(`
2
- `).map((u=>u.trim())).filter((u=>u!=="")).map((u=>({note:u}))):void 0,po_number:s.po_number!==""?s.po_number:null},invoiceId:i}))},onSendReminder:()=>{g.trackInvoicingActionClick(l.Event.invoicingInvoiceReminderSent,{...o,fromScreen:"invoice_detail"}),t(V({action:"send-reminder",invoiceId:i}))},onSubscriptionClick:s=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{fromScreen:"invoice_detail",subscriptionId:s,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(s)}`)},onVoid:s=>{g.trackInvoicingActionClick(l.Event.invoicingInvoiceVoided,{...o,fromScreen:"invoice_detail"}),t(V({action:"void",invoiceId:i,body:s}))}}}))(yt);function fa(){const t=L(),e=_(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),o=k((f=>Dn(f,n??""))),s=o.pageFetchState.fetchState,u=s==="Completed",[d,p]=r.useState(u?n:void 0);r.useEffect((()=>{n!=null&&u&&p(n)}),[n,u]);const v=d===n;r.useEffect((()=>{a&&n!=null&&t(Ai({invoiceId:n}))}),[a,n,t]);const m=r.useCallback((f=>t(he({invoiceId:f}))),[t]),S=ee(o.actionState.fetchState,o.fetchState==="In-Progress",n,m);return N(s)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingInvoiceDetailPage,isReady:u}),c.jsx(Sa,{invoiceId:n??"",hasLoadedRecord:v,navigate:e,tenantEmailDomain:i,view:o},S)]})}const Ia=O((function(t){const e=jn(t),{fetchState:n}=e;return{counts:e.counts,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,invoices:e.invoices,statusOptions:e.statusOptions,isLoading:n==="Not-Started"||n==="In-Progress"&&e.invoices.length===0,isLoadingMore:n==="In-Progress"&&e.invoices.length>0,kpis:e.kpis,kpisLoading:e.kpisFetchState.fetchState==="Not-Started"||e.kpisFetchState.fetchState==="In-Progress"&&e.kpis==null,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=a=>{const o=e.invoices.find((s=>s.id===a));return{amount:o?.total?.amount,customerId:o?.customerID,fromScreen:"invoices_list",invoiceId:a,status:o?.status}};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onCreateInvoice:()=>{g.trackInvoicingActionClick(l.Event.invoicingCreateInvoiceClicked),e.navigate(`${n}/invoices/create`)},onImportCsv:()=>{g.trackInvoicingActionClick(l.Event.invoicingImportCsvClicked,{entity:"invoices"}),e.navigate(`${n}/data_import`)},onInvoiceClick:a=>{g.trackInvoicingActionClick(l.Event.invoicingInvoiceRowClicked,i(a)),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onRowAction:(a,o)=>{switch(o){case"recordPayment":g.trackInvoicingActionClick(l.Event.invoicingRecordPaymentClicked,i(a)),e.navigate(`${n}/invoices/${encodeURIComponent(a)}/record-payment`);break;case"issueCreditNote":g.trackInvoicingActionClick(l.Event.invoicingIssueCreditNoteClicked,i(a)),e.navigate(`${n}/invoices/${encodeURIComponent(a)}/issue-credit-note`);break;case"sendReminder":g.trackInvoicingActionClick(l.Event.invoicingInvoiceReminderSent,i(a)),t(V({action:"send-reminder",invoiceId:a}));break;case"regenerate":g.trackInvoicingActionClick(l.Event.invoicingInvoiceRegenerated,i(a)),t(V({action:"regenerate",invoiceId:a}));break;case"void":g.trackInvoicingActionClick(l.Event.invoicingInvoiceVoided,i(a)),t(V({action:"void",invoiceId:a}))}},onVoidInvoice:(a,o)=>{g.trackInvoicingActionClick(l.Event.invoicingInvoiceVoided,i(a)),t(V({action:"void",invoiceId:a,body:o}))},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(l.Event.invoicingListLoadMore,{entity:"invoices",status:e.activeStatus}),t(Ln({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(bt);function ha(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[d,p]=r.useState(null),v=r.useMemo((()=>d!=null?{dir:d.direction,field:d.columnKey}:void 0),[d]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:S,appliedSearch:f,appliedSort:I,nextCursor:E,invoiceListFetchState:h,voidingInvoiceId:y,invoices:D}=k((A=>{const C=jn(A);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:A.invoicingInvoiceListState.sort,nextCursor:C.nextCursor,invoiceListFetchState:C.fetchState,voidingInvoiceId:C.runningActionId,invoices:C.invoices}}),H),b=h==="Completed";return r.useEffect((()=>{const A=setTimeout((()=>u(a)),300);return()=>clearTimeout(A)}),[a]),r.useEffect((()=>{i&&t(Ee({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Ee({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingInvoicesListPage,isReady:b}),c.jsx(Ia,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:d,filters:m,sort:v,invoices:D,nextCursor:E,voidingInvoiceId:y,onSearchChange:o,onStatusChange:A=>{t(ji(A)),t(Ee({cacheOverride:!1,filters:m,sort:v}))},onSortChange:p})]})}function an(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),i=xt(),a=ln(),[o,s]=r.useState(!1),{acceptTermsState:u,status:d}=k(_n),p=Li(i?.loggedInUserRoleMap),v=`/${n}/invoicing`,m=S=>{s(S)};return d==="completed"?c.jsx(B,{to:`${v}/overview`,replace:!0}):d==="settings"&&p?c.jsx(B,{to:`${v}/settings`,replace:!0}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingPromoPage}),c.jsx(_o,{isAppContentDrawerOpen:o,handleDrawerToggle:m}),c.jsx(At,{analytics:g,isAccepting:u.fetchState==="In-Progress",isReadOnlyUser:!p,meetingUrl:a("invoicing_promo"),onAcceptClick:()=>{g.trackInvoicingActionClick(l.Event.invoicingTermsAccepted),t(_i())},onBackClick:()=>{e(`/${n}`)},onClickMenuIcon:()=>{m(!0)}})]})}const Ca=O((function(t,e){const n=Pn(t,e.invoiceId),{invoice:i,localData:a,reasonCodeOptions:o,submitState:s,typeOptions:u}=n;return{fieldHelp:n.fieldHelp,amountDue:i?.amountDue,currencyCode:i?.currencyCode??"USD",customerName:i?.customerName??"",errorMessage:s.fetchState==="Error"?s.error?.message??"Failed to issue credit note. Please try again.":void 0,invoiceNumber:i?.invoiceNumber??e.invoiceId,isSubmitting:s.fetchState==="In-Progress",localData:a,reasonCodeOptions:o,typeOptions:u}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing/invoices/${encodeURIComponent(e.invoiceId)}`,i=()=>e.navigate(n);return{onBack:i,onCancel:i,onChange:a=>{t(Ri({localData:a}))},onSubmit:()=>{g.trackInvoicingActionClick(l.Event.invoicingCreditNoteIssued,{invoiceId:e.invoiceId}),t(Fi())}}}))(Dt);function ka(){const t=L(),e=_(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),{fetchState:o,invoice:s,isPageReady:u,issuedCreditNoteId:d,submitState:p}=k((f=>Pn(f,n??""))),v=`/${i}/invoicing`,m=r.useRef(null);r.useEffect((()=>{t(Pi()),m.current=null}),[t,n]),r.useEffect((()=>{a&&n!=null&&t(he({invoiceId:n}))}),[a,t,n]),r.useEffect((()=>{s!=null&&n!=null&&o==="Completed"&&m.current!==n&&(m.current=n,t(wi({localData:$i(s)})))}),[t,o,s,n]);const S=r.useRef(p.fetchState);return r.useEffect((()=>{const f=S.current;S.current=p.fetchState,f!=="Completed"&&p.fetchState==="Completed"&&d!=null&&e(`${v}/credits/${encodeURIComponent(d)}`)}),[d,e,p.fetchState,v]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingIssueCreditNotePage,isReady:u}),c.jsx(Ca,{invoiceId:n??"",navigate:e,tenantEmailDomain:i})]})}const Ea=O((function(t){return{invoicingOverview:wn(t)}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onRefresh:()=>{g.trackInvoicingActionClick(l.Event.invoicingOverviewRefreshed),t($n(e.selectedPeriod,!0))},onSubscriptionClick:i=>{g.trackInvoicingActionClick(l.Event.invoicingSubscriptionTileClicked,{subscriptionId:i}),e.navigate(`${n}/subscriptions/${i}`)},onViewInvoices:()=>{g.trackInvoicingActionClick(l.Event.invoicingViewInvoicesClicked),e.navigate(`${n}/invoices`)},onViewPayments:()=>{g.trackInvoicingActionClick(l.Event.invoicingViewPaymentsClicked),e.navigate(`${n}/payments`)}}}))(jt);function ya(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a]=r.useState((()=>{const s=new Date;return{month:s.getMonth()+1,year:s.getFullYear()}})),o=k((s=>wn(s).fetchState))==="Completed";return r.useEffect((()=>{i&&t($n(a))}),[i,t,a]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingOverviewPage,isReady:o}),c.jsx(Ea,{navigate:e,selectedPeriod:a,tenantEmailDomain:n})]})}const ba=O((function(t){const e=Fn(t),{fetchState:n}=e;return{columns:e.columns,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.transactions.length===0,isLoadingMore:n==="In-Progress"&&e.transactions.length>0,tabIds:e.tabIds,transactions:e.transactions}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeType:e.activeType,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTypeChange:e.onTypeChange,onViewTransactionCustomer:e.onViewTransactionCustomer,onViewTransactionInvoice:e.onViewTransactionInvoice,onImportCsv:()=>{g.trackInvoicingActionClick(l.Event.invoicingImportCsvClicked,{entity:"payments"}),e.navigate(`${n}/data_import`)},onTransactionClick:i=>{g.trackInvoicingActionClick(l.Event.invoicingPaymentRowClicked,{transactionId:i}),e.navigate(`${n}/payments/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(l.Event.invoicingListLoadMore,{entity:"payments",tab:e.activeType}),t(Oi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(Lt);function xa(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[d,p]=r.useState(null),v=r.useMemo((()=>d!=null?{dir:d.direction,field:d.columnKey}:void 0),[d]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeType:S,appliedSearch:f,appliedSort:I,nextCursor:E,transactionListFetchState:h,transactions:y}=k((j=>{const P=Fn(j);return{activeType:P.activeTab,appliedSearch:P.filters.search,appliedSort:P.sort,nextCursor:P.nextCursor,transactionListFetchState:P.fetchState,transactions:P.transactions}}),H),D=h==="Completed",b=`/${n}/invoicing`,A=r.useCallback((j=>{const P=y.find((T=>T.id===j)),U=P?.linkedInvoices?.[0]?.invoiceID??P?.invoiceID;U!=null&&(g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{fromScreen:"payments_list",invoiceId:U,toScreen:"invoice"}),e(`${b}/invoices/${encodeURIComponent(U)}`))}),[e,b,y]),C=r.useCallback((j=>{const P=y.find((U=>U.id===j))?.customerID;P!=null&&(g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{customerId:P,fromScreen:"payments_list",toScreen:"customer"}),e(`${b}/customers/${encodeURIComponent(P)}`))}),[e,b,y]);return r.useEffect((()=>{const j=setTimeout((()=>u(a)),300);return()=>clearTimeout(j)}),[a]),r.useEffect((()=>{i&&t(ye({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(ye({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingPaymentsListPage,isReady:D}),c.jsx(ba,{navigate:e,tenantEmailDomain:n,activeType:S,searchValue:a,sortState:d,filters:m,sort:v,nextCursor:E,onSearchChange:o,onTypeChange:j=>{t(Ti(j)),t(ye({cacheOverride:!1,filters:m,sort:v}))},onSortChange:p,onViewTransactionCustomer:C,onViewTransactionInvoice:A})]})}const Aa=t=>{const e=[t.firstName,t.lastName].filter((n=>n!=null&&n.trim()!=="")).join(" ").trim();return(t.company!=null&&t.company.trim()!==""?t.company.trim():"")||e||(t.email!=null&&t.email.trim()!==""?t.email.trim():"")||t.id};function cn(){const t=L(),e=_(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),o=n!=null&&n!=="",s=k(fe),u=k((C=>Mi(C))),d=k(Ni),p=k((C=>Dn(C,n??""))),v=p.invoice,m=`/${i}/invoicing`,S=r.useRef(null),f=r.useRef("");r.useEffect((()=>{t(Ui()),S.current=null,f.current=""}),[t,n]),r.useEffect((()=>{a&&t(o&&n!=null?he({invoiceId:n}):Cn({filters:{},keepExistingListItems:!1}))}),[a,t,n,o]),r.useEffect((()=>{o&&v!=null&&n!=null&&p.fetchState==="Completed"&&S.current!==n&&(S.current=n,t(Bi({contextInvoiceId:n,localData:Vi(v)})))}),[t,v,n,p.fetchState,o]),r.useEffect((()=>{if(o)return;const C=u.localData.customerId;C!==""&&C!==f.current&&(f.current=C,t(Ln({filters:{customerId:C},keepExistingListItems:!1})),u.localData.invoiceToLink!==""&&t(en({localData:{...u.localData,customerId:C,invoiceToLink:""}})))}),[t,u.localData,o]);const I=r.useRef(d.fetchState);r.useEffect((()=>{const C=I.current;if(I.current=d.fetchState,C!=="Completed"&&d.fetchState==="Completed"){if(d.recordedInvoiceId!=null)return void e(`${m}/invoices/${encodeURIComponent(d.recordedInvoiceId)}`);e(`${m}/payments`)}}),[e,d.fetchState,d.recordedInvoiceId,m]);const E=r.useMemo((()=>s.customers.map((C=>({id:C.id,name:Aa(C)})))),[s.customers]),h=k((C=>Hi(C,u.localData.customerId))),y=r.useMemo((()=>h.map((C=>{return{amountDue:(j=C.amountDue,P=qi.currencySymbol,wt("0,0.00",j,P)),amountDueValue:C.amountDue,id:C.id,label:C.invoiceNumber};var j,P}))),[h]),D=r.useMemo((()=>{if(!o||v==null)return;const C=v.currencyCode??"USD",j=v.amountDue?.amount??0;return{amountDue:_t("0,0.00",v.amountDue),amountDueValue:j,currencyCode:C,customerName:v.customerName??v.customerID,invoiceId:v.id,invoiceNumber:v.invoiceNumber??v.id}}),[v,o]),b=o?`${m}/invoices/${encodeURIComponent(n??"")}`:`${m}/payments`,A=!o||p.fetchState==="Completed"&&u.localData.invoiceToLink!=="";return c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingRecordPaymentPage,isReady:A}),c.jsx(Pt,{customers:E,fieldHelp:u.fieldHelp,errorMessage:d.fetchState==="Error"?d.error?.message??"Failed to record payment. Please try again.":void 0,gatewayOptions:u.gatewayOptions,invoiceContext:D,invoiceOptions:y,isSubmitting:d.fetchState==="In-Progress",localData:u.localData,mode:o?"invoice":"customer",paymentMethodOptions:u.paymentMethodOptions,onBack:()=>{e(b)},onCancel:()=>{g.trackInvoicingActionClick(l.Event.invoicingRecordPaymentCancelled),e(b)},onChange:C=>{t(en({localData:C}))},onSubmit:()=>{g.trackInvoicingActionClick(l.Event.invoicingPaymentRecorded,{customerId:u.localData.customerId,invoiceId:o?n:u.localData.invoiceToLink,paymentMethod:u.localData.paymentMethod}),t(Qi(o?n??void 0:void 0))}})]})}const Kn=(t,e,n)=>{const i=`/${t}/invoicing/subscriptions/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Da=O((function(t,e){const{editView:n}=e,i=n.subscription,a=i?.status,o=a!=null&&e.commercialEditAllowedFromStatuses.includes(a);return{cancelReasonCodeOptions:n.cancelReasonCodeOptions,fieldHelp:n.fieldHelp,addons:n.addons,canEditCommercial:o,charges:n.charges,coupons:n.coupons,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),isRunningAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",lifecycleActionOptions:e.lifecycleActionOptions,localData:n.localData,plans:n.plans,shippingAddressLabel:n.shippingAddressLabel,hasUnsavedShippingAddress:n.hasUnsavedShippingAddress,subscription:i}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,a=i!=="",o=(s,u)=>{const{subscription:d}=e.editView;g.trackInvoicingActionClick(l.Event.invoicingSubscriptionLifecycleAction,{action:s,amount:d?.mrr?.amount,customerId:d?.customerID,fromScreen:"subscription_detail",status:d?.status,subscriptionId:i}),t(Tn({action:s,id:i,body:u}))};return{onBack:()=>e.navigate(`${n}/subscriptions`),onChange:s=>{t(ve({id:i,localData:s}))},onChangeTermEnd:a?s=>{const u=s?.trim()??"";u!==""&&o("change_term_end",{term_ends_at:u})}:void 0,onCustomerClick:s=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{customerId:s,fromScreen:"subscription_detail",toScreen:"customer"}),window.open(`${n}/customers/${encodeURIComponent(s)}`,"_blank","noopener,noreferrer")},onDiscardEdit:()=>{t(J(me)),t(Gi({id:i}))},onOpenAddress:()=>{const s=Kn(e.tenantEmailDomain??"",me,i),u=Y(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(s,{state:{pathnameStackToGoBack:u}})},onViewInvoices:()=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{fromScreen:"subscription_detail",subscriptionId:i,toScreen:"invoices"}),e.navigate(`${n}/invoices`)},onSaveEdit:s=>{g.trackInvoicingActionClick(l.Event.invoicingSubscriptionEdited,{subscriptionId:i}),t(ve({id:i,localData:s})),t(Rn({id:i}))},onCancelSubscription:a?s=>{o("cancel",{cancel_reason_code:s.cancelReasonCode,end_of_term:!1,...s.cancelReason!=null&&s.cancelReason.trim()!==""?{cancel_reason:s.cancelReason.trim()}:{}})}:void 0,onLifecycleAction:a?(s,u)=>{s!=="pause"?o(s):o(s,u!=null&&u.trim()!==""?{resume_date:u.trim()}:void 0)}:void 0}}))($t);function ja(){const t=L(),e=_(),n=X(),{subscription_id:i,tenantEmailDomain:a}=F(),{areTenantIdsInSync:o}=R(),s=k((y=>Ne(y,i))),{subscriptionCommercialEditAllowedFromStatuses:u,subscriptionLifecycleActionOptions:d,subscriptionMetadataEditAllowedFromStatuses:p}=s,v=s.pageFetchState.fetchState,m=v==="Completed"&&!s.isFormLoading,[S,f]=r.useState(m?i:void 0);r.useEffect((()=>{i!=null&&m&&f(i)}),[i,m]);const I=S===i;Ce(o),r.useEffect((()=>{o&&i!=null&&t(zi({id:i}))}),[o,i,t]);const E=r.useCallback((y=>t(Ki({id:y}))),[t]),h=ee(s.fetchState,s.isFormLoading,i,E);return N(v)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingSubscriptionDetailPage,isReady:m}),c.jsx(Da,{hasLoadedRecord:I,commercialEditAllowedFromStatuses:u,editView:s,lifecycleActionOptions:d,location:n,metadataEditAllowedFromStatuses:p,navigate:e,subscriptionId:i??"",tenantEmailDomain:a},h)]})}const La=O((function(t,e){const n=Ne(t,e.subscriptionId);return{fieldHelp:n.fieldHelp,addons:n.addons,charges:n.charges,coupons:n.coupons,customers:n.customers,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save subscription.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,plans:n.plans,shippingAddressLabel:n.shippingAddressLabel}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,a=i!=null?"edit":"create";return{onCancel:()=>{g.trackInvoicingActionClick(l.Event.invoicingSubscriptionFormCancelled),t(On({id:i})),t(J(me)),i==null?e.navigate(`${n}/subscriptions`):e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)},onChange:o=>{t(ve({id:i,localData:o}))},onOpenAddress:()=>{g.trackInvoicingActionClick(l.Event.invoicingAddressOpened,{entity:"subscription",fromScreen:"subscription_form"});const o=Kn(e.tenantEmailDomain??"",me,i),s=Y(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(o,{state:{pathnameStackToGoBack:s}})},onSubmit:()=>{g.trackInvoicingActionClick(l.Event.invoicingSubscriptionSaved,{mode:a}),t(Rn({id:i}))}}}))(Ft);function _a(){const t=L(),e=_(),n=X(),{subscription_id:i,tenantEmailDomain:a}=F(),[o]=Z(),{areTenantIdsInSync:s}=R(),u=o.get("customerId"),{fetchState:d,savedSubscriptionId:p}=k((S=>Wi(S,i))),v=k((S=>Ne(S,i).localData));Ce(s),r.useEffect((()=>{s&&t(Zi({subscriptionId:i}))}),[s,i,t]);const m=r.useRef(!1);return r.useEffect((()=>{m.current||i!=null||u==null||u===""||v.customerId!==""||(m.current=!0,t(ve({id:i,localData:{...v,customerId:u}})))}),[u,i,v,t]),r.useEffect((()=>{if(d==="Completed"){const S=p??i,f=S!=null?`/${a}/invoicing/subscriptions/${encodeURIComponent(S)}`:`/${a}/invoicing/subscriptions`;e(f),t(On({id:i}))}}),[d,p,i,t,e,a]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingSubscriptionFormPage}),c.jsx(La,{location:n,navigate:e,subscriptionId:i,tenantEmailDomain:a})]})}const Pa=O((function(t){const e=Mn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.subscriptions.length===0,isLoadingMore:n==="In-Progress"&&e.subscriptions.length>0,cancelReasonCodeOptions:e.cancelReasonCodeOptions,lifecycleActionOptions:e.subscriptionLifecycleActionOptions,subscriptions:e.subscriptions,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=(a,o,s)=>{const u=e.subscriptions.find((d=>d.id===a));g.trackInvoicingActionClick(l.Event.invoicingSubscriptionLifecycleAction,{action:o,amount:u?.mrr?.amount,customerId:u?.customerID,fromScreen:"subscriptions_list",status:u?.status,subscriptionId:a}),t(Tn({action:o,id:a,body:s}))};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onAddSubscription:()=>{g.trackInvoicingActionClick(l.Event.invoicingAddSubscriptionClicked),e.navigate(`${n}/subscriptions/new`)},onImportCsv:()=>{g.trackInvoicingActionClick(l.Event.invoicingImportCsvClicked,{entity:"subscriptions"}),e.navigate(`${n}/data_import`)},onChangeTermEnd:(a,o)=>{const s=o?.trim()??"";s!==""&&i(a,"change_term_end",{term_ends_at:s})},onSubscriptionAction:(a,o,s)=>{o!=="pause"?i(a,o):i(a,o,s!=null&&s.trim()!==""?{resume_date:s.trim()}:void 0)},onCancelSubscription:(a,o)=>{i(a,"cancel",{cancel_reason_code:o.cancelReasonCode,end_of_term:!1,...o.cancelReason!=null&&o.cancelReason.trim()!==""?{cancel_reason:o.cancelReason.trim()}:{}})},onSubscriptionClick:a=>{g.trackInvoicingActionClick(l.Event.invoicingSubscriptionRowClicked,{subscriptionId:a}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onViewSubscriptionInvoices:()=>{e.navigate(`${n}/invoices`)},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(l.Event.invoicingListLoadMore,{entity:"subscriptions",status:e.activeStatus}),t(Ji({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(Rt);function wa(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[d,p]=r.useState(null),v=r.useMemo((()=>d!=null?{dir:d.direction,field:d.columnKey}:void 0),[d]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:S,appliedSearch:f,appliedSort:I,nextCursor:E,subscriptionListFetchState:h,runningActionSubscriptionId:y,subscriptions:D}=k((C=>{const j=Mn(C);return{activeStatus:j.activeTab,appliedSearch:j.filters.search,appliedSort:j.sort,nextCursor:j.nextCursor,subscriptionListFetchState:j.fetchState,runningActionSubscriptionId:j.runningActionId??null,subscriptions:j.subscriptions}}),H),b=h==="Completed";r.useEffect((()=>{const C=setTimeout((()=>u(a)),300);return()=>clearTimeout(C)}),[a]),r.useEffect((()=>{i&&t(nn({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(nn({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]);const A=r.useRef(y);return r.useEffect((()=>{const C=A.current!=null&&y==null;A.current=y,C&&i&&t(Xi())}),[y,i,t]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingSubscriptionsListPage,isReady:b}),c.jsx(Pa,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:d,filters:m,sort:v,nextCursor:E,runningActionSubscriptionId:y,subscriptions:D,onSearchChange:o,onStatusChange:C=>t(Yi(C)),onSortChange:p})]})}const $a=O((function(t,e){const{readView:n}=e;return{isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress",transaction:n.transaction,transactionId:e.transactionId}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{transactionId:i}=e;return{onBack:()=>e.navigate(`${n}/payments`),onCustomerClick:a=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{customerId:a,fromScreen:"transaction_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(a)}`)},onInvoiceClick:a=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onSubscriptionClick:a=>{g.trackInvoicingActionClick(l.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onCapture:i!==""?()=>{g.trackInvoicingActionClick(l.Event.invoicingTransactionCaptured,{transactionId:i}),t(to({action:"capture",id:i}))}:void 0}}))(Tt);function Fa(){const t=L(),e=_(),{tenantEmailDomain:n,transaction_id:i}=F(),{areTenantIdsInSync:a}=R(),o=k((u=>eo(u,i??""))),s=o.fetchState==="Completed";return r.useEffect((()=>{a&&i!=null&&t(no({id:i}))}),[a,i,t]),N(o.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingTransactionDetailPage,isReady:s}),c.jsx($a,{navigate:e,tenantEmailDomain:n,transactionId:i??"",readView:o})]})}function Gn(t={}){const{enabled:e=!0,fetchSyncHealth:n=!1,loadAccountingPickers:i=!1,reuseCached:a=!1}=t,o=L(),{areTenantIdsInSync:s}=R(),u=k(Ue),d=u.connection?.connected===!0,p=u.connectionFetchState.fetchState;return r.useEffect((()=>{e&&s&&(a&&p!=="Not-Started"||o(Nn()),n&&o(io()))}),[s,o,e,n,a]),r.useEffect((()=>{e&&s&&d&&i&&o(oo())}),[s,o,e,d,i]),{isQboConnected:d,qboView:u}}const Ra={branding:"invoicing_branding_save",dunning:"invoicing_dunning_settings_save",quickbooks:"invoicing_qbo_settings_save"};function ne(t){const e=L(),{areTenantIdsInSync:n}=R(),{tenantEmailDomain:i}=F(),{fetchState:a,fieldHelp:o,logoFile:s,saveState:u,settings:d,stripeConnectState:p}=k(ao),{configError:v,configFetchState:m,dunningScheduleActionOptions:S,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:I,qboSyncStatusOptions:E}=k(Un),h=k(Ue);Gn({enabled:t==="quickbooks",fetchSyncHealth:!0,loadAccountingPickers:!0});const y=k(Ie),D=t==="dunning"||t==="quickbooks",b=y.companyId??W.getSignedInUserTenant(i??"")?.companyId,A=k(($=>yn($,b))),C=co(y.userRole??[]),j=y.tenantId??"",P=W.getSignedInUser(),U={userId:P?.userId??"",sessionId:P?.zeniSessionId??"",tenantId:j},T=s?.fileId,te=k(($=>T!=null&&T!==""?so($,T):void 0)),Be=k(($=>T!=null&&T!==""?ro($,T):void 0)),Wn=T!=null&&T!==""&&te!=null?{[T]:te}:{},Zn=T!=null&&T!==""&&Be!=null?{[T]:Be}:{};r.useEffect((()=>(e(tn()),()=>{e(tn())})),[e]),r.useEffect((()=>{n&&(a!=="Not-Started"&&a!=="Error"||e(Me()))}),[n,e,a]),r.useEffect((()=>{n&&D&&m==="Not-Started"&&e(pe())}),[n,e,m,D]),r.useEffect((()=>{if(!n)return;const $=P?.userId;$!=null&&$!==""&&j!==""&&qe.shouldFetchActiveTenant(j)&&(qe.markActiveTenantFetchStarted(j),e(lo($,j,P?.zeniSessionId)))}),[n,e,P?.userId,P?.zeniSessionId,j]);const Xn=S.length>0||f.length>0,Yn=a==="Not-Started"||a==="In-Progress"&&d==null||D&&!Xn&&(m==="Not-Started"||m==="In-Progress"),Jn=a==="Completed"&&(!D||m==="Completed"),Ve=A.externalConnections?.revenue?.find(($=>$.connectionName==="chargebee"))?.connectionId,ke=re?.invoicingMicroServiceBaseUrl,He=ke!=null&&ke.length>0?`${ke}/1.0/webhooks/stripe`:"",z={deleteConnectionError:A.externalConnections?.deleteConnectionError?.message,deleteConnectionState:A.externalConnections?.deleteConnectionState??"Not-Started",integrationsView:A,isAdmin:C,isStripeBusy:p.fetchState==="In-Progress",onConnectStripe:$=>{g.trackInvoicingActionClick(l.Event.invoicingStripeConnectClicked,{fromScreen:t??"hub"}),e(ho($))},onDisconnect:($,q)=>{j!==""&&(g.trackInvoicingActionClick(l.Event.invoicingIntegrationDisconnected,{entity:q,entityId:$,fromScreen:t??"hub"}),e(Io(j,$,on(q))))},onDisconnectStripe:()=>{g.trackInvoicingActionClick(l.Event.invoicingStripeDisconnected,{fromScreen:t??"hub"}),e(fo())},onReconnectQBO:()=>{g.trackInvoicingActionClick(l.Event.invoicingQboAction,{action:"reconnect",fromScreen:t??"hub"});const $=y.tenantEmailDomain??i??"";Se.init("/connection/auth",$),Se.handleClick()},onRefreshQBO:()=>{A.integrations.refreshQBO.fetchState!=="In-Progress"&&(g.trackInvoicingActionClick(l.Event.invoicingQboAction,{action:"refresh",fromScreen:t??"hub"}),e(Hn()))},onSaveChargeBeeCredentials:($,q)=>{Ve!=null&&j!==""&&(g.trackInvoicingActionClick(l.Event.invoicingChargebeeCredentialsSaved,{fromScreen:t??"hub"}),e(po(j,Ve,on("revenue"),So("chargebee"),{api_key:$,site:q})))},saveChargeBeeError:A.externalConnections?.saveAPIKeyConnectionError?.message,saveChargeBeeState:A.externalConnections?.saveAPIKeyConnectionState??"Not-Started",settings:d,stripeError:p.fetchState==="Error"?p.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:He};return{authParams:U,deleteFileStatusById:Wn,fieldHelp:o,dunningScheduleActionOptions:S,filesEndPoint:re?.fileMicroServiceBaseUrl??"",integrationsSectionProps:z,isInvoicingPageReady:Jn,isLoading:Yn,isSaving:u.fetchState==="In-Progress",isStripeBusy:p.fetchState==="In-Progress",logoFile:s,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:I,qboSyncStatusOptions:E,qboView:h,saveErrorMessage:u.fetchState==="Error"?u.error?.message??"Failed to save settings.":D&&m==="Error"?v?.message??"Failed to load invoicing configuration.":void 0,settings:d,stripeError:p.fetchState==="Error"?p.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:He,updateFileStatusById:Zn,onConnectStripe:z.onConnectStripe,onDeleteFile:$=>{g.trackInvoicingActionClick(l.Event.invoicingLogoRemoved,{fromScreen:t??"hub"}),e(mo($,j))},onDisconnectStripe:z.onDisconnectStripe,onEditFileName:($,q)=>{g.trackInvoicingActionClick(l.Event.invoicingLogoRenamed,{fromScreen:t??"hub"}),e(vo($,q.split(".")[0],j))},onReconnectQBO:z.onReconnectQBO,onRefreshQBO:z.onRefreshQBO,onRetryQboSyncTask:$=>{g.trackInvoicingActionClick(l.Event.invoicingQboAction,{action:"retry_task",entityId:$,fromScreen:t??"hub"}),e(Vn($))},onSave:$=>{g.trackInvoicingActionClick(l.Event.invoicingSettingsSaved,{tab:t??"hub"}),e(go({settings:$,snackbarSection:Ra[t??""]}))},onStartQboBackfill:$=>{g.trackInvoicingActionClick(l.Event.invoicingQboAction,{action:"backfill",fromScreen:t??"hub"}),e(Bn($))},updateFilesEntity:$=>{g.trackInvoicingActionClick(l.Event.invoicingLogoUploaded,{fromScreen:t??"hub"}),e(uo({files:$}))}}}function sn({appContent:t}){const e=_(),n=X(),i=L(),{tenantEmailDomain:a}=F(),o=ne("branding"),s=k((p=>Co(p))),u=k((p=>ko(be,p)?.addressToCreate));r.useEffect((()=>{s.saveState.fetchState==="Completed"&&(i(Eo()),i(J(be)))}),[s.saveState.fetchState,i]);const d=Pe(s.saveState.fetchState);return r.useEffect((()=>{d==="In-Progress"&&s.saveState.fetchState==="Completed"&&e("..")}),[d,s.saveState.fetchState,e]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingBrandingSettingsPage,isReady:o.isInvoicingPageReady}),c.jsx(Ot,{address:u,fieldHelp:s.fieldHelp,addressLabel:s.addressLabel,appContent:t,authParams:o.authParams,dateFormatOptions:s.dateFormatOptions,deleteFileStatusById:o.deleteFileStatusById,filesEndPoint:o.filesEndPoint,isLoading:o.isLoading,isSaving:o.isSaving,localData:s.localData,logoFile:o.logoFile,saveErrorMessage:o.saveErrorMessage,settings:o.settings,updateFileStatusById:o.updateFileStatusById,onBackClick:()=>e(".."),onChange:p=>{i(bo({localData:p}))},onDeleteFile:o.onDeleteFile,onEditFileName:o.onEditFileName,onOpenAddress:()=>{g.trackInvoicingActionClick(l.Event.invoicingAddressOpened,{entity:"branding",fromScreen:"settings_branding"});const p=`/${a}/invoicing/settings/branding/${be}/`,v=Y(n.state?.pathnameStackToGoBack,n.pathname);e(p,{state:{pathnameStackToGoBack:v}})},onSubmit:()=>{g.trackInvoicingActionClick(l.Event.invoicingSettingsSaved,{tab:"branding"}),i(yo())},updateFilesEntity:o.updateFilesEntity})]})}function Ta(){const t=_(),e=ne("dunning");return c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingDunningSettingsPage,isReady:e.isInvoicingPageReady}),c.jsx(Mt,{dunningScheduleActionOptions:e.dunningScheduleActionOptions,isLoading:e.isLoading,isSaving:e.isSaving,saveErrorMessage:e.saveErrorMessage,settings:e.settings,onBackClick:()=>t(".."),onSave:e.onSave})]})}function Oa(){const t=_(),e=ne("integrations");return c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingIntegrationsSettingsPage,isReady:e.isInvoicingPageReady}),c.jsx(Nt,{integrationsSectionProps:{...e.integrationsSectionProps,onConfigureQBO:()=>t("../quickbooks"),onOpenPaymentDestination:()=>t("../payment-destination")},isLoading:e.isLoading,onBackClick:()=>t("..")})]})}function Ma(){const t=_(),e=ne("payment-destination");return c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingPaymentDestinationSettingsPage,isReady:e.isInvoicingPageReady}),c.jsx(Ut,{fieldHelp:e.fieldHelp,isLoading:e.isLoading,isStripeBusy:e.isStripeBusy,saveErrorMessage:e.saveErrorMessage,settings:e.settings,stripeError:e.stripeError,stripeWebhookUrl:e.stripeWebhookUrl,onBackClick:()=>t(".."),onConnectStripe:e.onConnectStripe})]})}const Na=O((function(t){const e=qn(t);return{accountMappingKindOptions:e.accountMappingKindOptions,fieldHelp:e.fieldHelp,accounts:e.accounts,connection:e.connection,customerMatchingOptions:e.customerMatchingOptions,isBackfilling:e.backfillState.fetchState==="In-Progress",isLoading:e.isLoading,isSaving:e.saveState.fetchState==="In-Progress",isSyncEnabledSaved:e.isSyncEnabledSaved,localData:e.localData,nestedAccountHierarchy:e.nestedAccountHierarchy,retryFetchStateByTaskId:e.retryFetchStateByTaskId,saveErrorMessage:e.saveState.fetchState==="Error"?e.saveState.error?.message:void 0,syncHealth:e.syncHealth,syncStatusOptions:e.syncStatusOptions}}),(function(t){return{onChange:e=>{t(Do({localData:e}))},onReset:()=>{g.trackInvoicingActionClick(l.Event.invoicingSettingsReset,{tab:"quickbooks"}),t(Ao())},onRetryTask:e=>{g.trackInvoicingActionClick(l.Event.invoicingQboAction,{action:"retry_task",entityId:e,fromScreen:"settings_qbo"}),t(Vn(e))},onSave:()=>{g.trackInvoicingActionClick(l.Event.invoicingSettingsSaved,{tab:"quickbooks"}),t(xo())},onStartBackfill:e=>{g.trackInvoicingActionClick(l.Event.invoicingQboAction,{action:"backfill",fromScreen:"settings_qbo"}),t(Bn(e))}}}))(Bt);function Ua(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),i=k(Ie),{configFetchState:a,saveState:o,settingsFetchState:s}=k(qn),u=Pe(o.fetchState);return r.useEffect((()=>{u==="In-Progress"&&o.fetchState==="Completed"&&e("..")}),[e,u,o.fetchState]),r.useEffect((()=>{s!=="Not-Started"&&s!=="Error"||t(Me())}),[t,s]),r.useEffect((()=>{a==="Not-Started"&&t(pe())}),[a,t]),Gn({fetchSyncHealth:!0,loadAccountingPickers:!0}),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingQboSettingsPage}),c.jsx(Na,{onBackClick:()=>e(".."),onReconnect:()=>{g.trackInvoicingActionClick(l.Event.invoicingQboAction,{action:"reconnect",fromScreen:"settings_qbo"}),Se.init("/connection/auth",i.tenantEmailDomain??n??""),Se.handleClick()},onRefresh:()=>{g.trackInvoicingActionClick(l.Event.invoicingQboAction,{action:"refresh",fromScreen:"settings_qbo"}),t(Hn())}})]})}const Ba={"payment-destination":"payment-destination",general:"branding",integrations:null,dunning:"dunning"};function Va(){const t=ln(),e=L(),n=_(),[i,a]=Z(),o=ne(),{canEnableInvoicing:s,isEnablingInvoicing:u,isInvoicingEnabled:d,isQboConfigured:p,isStripeConnected:v}=k(Un),m=i.get("tab");return r.useEffect((()=>{if(m==null)return;const S=Ba[m];a({},{replace:!0}),S!=null&&n(S,{replace:!0})}),[m,n,a]),c.jsxs(c.Fragment,{children:[c.jsx(w,{event:l.Event.invoicingSettingsPage,isReady:o.isInvoicingPageReady}),c.jsx(Vt,{analytics:g,integrationsSectionProps:{...o.integrationsSectionProps,onConfigureQBO:()=>n("quickbooks"),onOpenPaymentDestination:()=>n("payment-destination")},isEnablingInvoicing:u,isLoading:o.isLoading,meetingUrl:t("invoicing_settings"),settings:o.settings,onBrandingClick:()=>n("branding"),onDunningClick:()=>n("dunning"),canEnableInvoicing:s,isQboConfigured:p,isStripePaymentsReady:v,onEnableInvoicingClick:d?void 0:()=>{g.trackInvoicingActionClick(l.Event.invoicingEnableClicked),e(jo())}})]})}function rn(){return c.jsxs(ae,{children:[c.jsx(x,{index:!0,element:c.jsx(Va,{})}),c.jsx(x,{path:"payment-destination",element:c.jsx(Ma,{})}),c.jsx(x,{path:"branding",element:c.jsx(sn,{})}),c.jsx(x,{path:"branding/:addressType",element:c.jsx(sn,{appContent:c.jsx(K,{isSubPage:!0,hideAddressBackButton:!0})})}),c.jsx(x,{path:"integrations",element:c.jsx(Oa,{})}),c.jsx(x,{path:"dunning",element:c.jsx(Ta,{})}),c.jsx(x,{path:"quickbooks",element:c.jsx(Ua,{})}),c.jsx(x,{path:"*",element:c.jsx(B,{to:"..",replace:!0})})]})}function Sc(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),{enableState:a,fetchState:o,status:s}=k(_n),u=Pe(a.fetchState),d=`/${n}/invoicing`,p=r.useRef(!1),v=k((m=>Ue(m).connectionFetchState.fetchState));return r.useEffect((()=>{i&&(o!=="Not-Started"?o!=="Error"||p.current||(p.current=!0,t(pe({cacheOverride:!1}))):t(pe({cacheOverride:!1})))}),[i,t,o]),r.useEffect((()=>{i&&v==="Not-Started"&&t(Nn())}),[i,t,v]),r.useEffect((()=>{u==="In-Progress"&&a.fetchState==="Completed"&&(e(`${d}/catalog`),t(Lo()))}),[u,a.fetchState,d,t,e]),s==null&&o!=="Error"?c.jsx(Ht,{fetchState:"In-Progress"}):s==="not_started"?c.jsxs(ae,{children:[c.jsx(x,{path:"promo",element:c.jsx(an,{})}),c.jsx(x,{path:"*",element:c.jsx(B,{to:`${d}/promo`,replace:!0})})]}):s==="settings"?c.jsxs(ae,{children:[c.jsx(x,{path:"promo",element:c.jsx(an,{})}),c.jsx(x,{path:"settings/*",element:c.jsx(rn,{})}),c.jsx(x,{path:"*",element:c.jsx(B,{to:`${d}/settings`,replace:!0})})]}):c.jsxs(ae,{children:[c.jsx(x,{path:"/",element:c.jsx(B,{to:"overview",replace:!0})}),c.jsx(x,{path:"overview",element:c.jsx(ya,{})}),c.jsx(x,{path:"promo",element:c.jsx(B,{to:`${d}/overview`,replace:!0})}),c.jsx(x,{path:"customers",element:c.jsx(na,{})}),c.jsx(x,{path:"customers/new",element:c.jsx(Jo,{})}),c.jsx(x,{path:"customers/new/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"customers/:customer_id",element:c.jsx(Xo,{})}),c.jsx(x,{path:"customers/:customer_id/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"subscriptions",element:c.jsx(wa,{})}),c.jsx(x,{path:"subscriptions/new",element:c.jsx(_a,{})}),c.jsx(x,{path:"subscriptions/new/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"subscriptions/:subscription_id",element:c.jsx(ja,{})}),c.jsx(x,{path:"subscriptions/:subscription_id/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"invoices",element:c.jsx(ha,{})}),c.jsx(x,{path:"invoices/create",element:c.jsx(Qo,{})}),c.jsx(x,{path:"invoices/:invoice_id",element:c.jsx(fa,{})}),c.jsx(x,{path:"invoices/:invoice_id/record-payment",element:c.jsx(cn,{})}),c.jsx(x,{path:"invoices/:invoice_id/issue-credit-note",element:c.jsx(ka,{})}),c.jsx(x,{path:"payments",element:c.jsx(xa,{})}),c.jsx(x,{path:"payments/record",element:c.jsx(cn,{})}),c.jsx(x,{path:"payments/:transaction_id",element:c.jsx(Fa,{})}),c.jsx(x,{path:"credits",element:c.jsx(Wo,{})}),c.jsx(x,{path:"credits/:credit_note_id",element:c.jsx(Ko,{})}),c.jsx(x,{path:"discounts",element:c.jsx(ua,{})}),c.jsx(x,{path:"discounts/new",element:c.jsx(Ho,{})}),c.jsx(x,{path:"discounts/:coupon_id",element:c.jsx(la,{})}),c.jsx(x,{path:"dunning",element:c.jsx(pa,{})}),c.jsx(x,{path:"dunning/:case_id",element:c.jsx(va,{})}),c.jsx(x,{path:"catalog",element:c.jsx(Bo,{})}),c.jsx(x,{path:"catalog/new",element:c.jsx(Mo,{})}),c.jsx(x,{path:"catalog/:item_id",element:c.jsx(Fo,{})}),c.jsx(x,{path:"settings/*",element:c.jsx(rn,{})}),c.jsx(x,{path:"audit_log",element:c.jsx(Po,{})}),c.jsx(x,{path:"data_import",element:c.jsx(aa,{})}),c.jsx(x,{path:"data_import/migrate",element:c.jsx(sa,{})}),c.jsx(x,{path:"data_import/:sessionId",element:c.jsx(ia,{})}),c.jsx(x,{path:"*",element:c.jsx(M,{})})]})}export{Sc as default};
@@ -1,72 +0,0 @@
1
- import{j as a}from"./liveblocks-CzCs-qU3.js";import{i as S,l as g,h as C,g as y,u as ee,t as ae,j as L,N as te,n as ne,o as p}from"./core-BBG4mxvC.js";import{UA as k,UB as v,UC as T,JE as B,Jq as U,UD as D,UE as oe,UF as ie,Ju as se,gl as $,JB as le,Jy as de}from"./zeni-epic-state-FRanwwFO.js";import{a1 as x,M as d,a2 as re,j,W as G,a3 as ce,a4 as me,a5 as pe,p as J,c as ue,m as he,a6 as ge,Z as xe,E as fe,f as be,a7 as we,a8 as Se,$ as ye,a9 as ke,aa as ve,ab as je,ac as $e}from"./index-De2R2YuA.js";import{n as m}from"./mui-B2F_PvWe.js";import f from"./NotFoundScreen-BXryZNID.js";import{a as I}from"./sentry-CWp8Ph3h.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.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]="33cbb1ac-e21d-4c20-8868-de3397ad7be1",e._sentryDebugIdIdentifier="sentry-dbid-33cbb1ac-e21d-4c20-8868-de3397ad7be1")}catch{}})();const Ie=m.div`
2
- display: flex;
3
- height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
10
- `,Ce=g((function(e){const t=k(e),n=v(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}}),(function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:i=>{e(U(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(T({data:l}))}}}))(re);function F(){const e=x(),{vendorId:t,billId:n}=S();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(Ce,{vendorId:t,billId:n})})})}const Be=m.div`
11
- display: flex;
12
- height: 100vh;
13
- width: 100%;
14
- flex: 1 1 auto;
15
- flex-direction: column;
16
- align-items: center;
17
- background-color: ${e=>e.theme.colors.grey4};
18
- box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
19
- `,De=g((function(e,t){const{isSubPage:n}=t;return{addressToEdit:D(e),googleAPIKey:G.googleMapsAPIKey,isSubPage:n}}),(function(e,t){const{navigate:n,location:o}=t,i=()=>{const l=me(o.state?.pathnameStackToGoBack),s=l.poppedPathname??Pe();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=Ee(l);e(oe({addressToCreate:s})),i()},onCancel:()=>{i()}}}))(ce);function Ae({isSubPage:e}){const t=C(),n=y(),o=x();return a.jsx(a.Fragment,{children:a.jsx(Be,{windowSize:o,children:a.jsx(De,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:G.googleMapsAPIKey})})})}const Pe=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},Ee=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),ze=m.div`
20
- display: flex;
21
- height: 100%;
22
- width: 100%;
23
- flex: 1 1 auto;
24
- flex-direction: column;
25
- align-items: center;
26
- background-color: ${e=>e.theme.colors.grey4};
27
- box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
28
- `,Ne=g((function(e){const t=k(e),n=v(e),o=D(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}}),(function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankName:s=>{e(U(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(T({data:r}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),r=J(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:r}})}}}))(pe);function Le(){const e=C(),t=y(),n=x(),{vendorId:o,billId:i}=S();return o==null||i==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(ze,{windowSize:n,children:a.jsx(Ne,{location:t,navigate:e,vendorId:o,billId:i})})})}const Fe=m.div`
29
- display: flex;
30
- height: 100%;
31
- width: 100%;
32
- flex: 1 1 auto;
33
- flex-direction: column;
34
- align-items: center;
35
- background-color: ${e=>e.theme.colors.grey4};
36
- box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
37
- `,Te=g((function(e){const t=k(e),n=v(e),o=D(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}}),(function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankNameBySwift:s=>{e(se(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(s,"international",i,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:r}=s;e(ie({data:r}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),r=J(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:r}})}}}))(ge);function Ue(){const e=C(),t=y(),n=x(),{vendorId:o,billId:i}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:s}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?a.jsx(f,{}):a.jsx(Fe,{windowSize:n,children:a.jsx(Te,{location:t,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Ge={containerWidth:new je(100,58)},Je=m(ke)`
38
- width: ${d.sp4};
39
- height: ${d.sp4};
40
- margin-bottom: ${d.sp3};
41
- margin-top: ${d.sp3};
42
- margin-left: ${d.sp8};
43
- cursor: pointer;
44
- position: absolute;
45
- color: ${e=>e.theme.colors.brandColorJade};
46
- `,Me=m.div`
47
- display: flex;
48
- height: 100vh;
49
- flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
- width: 100vw;
51
- overflow-y: scroll;
52
- background-color: ${e=>e.theme.colors.grey4};
53
- `,He=m.div`
54
- display: flex;
55
- flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
- flex-direction: column;
57
- width: ${e=>`${Ge.containerWidth.value(e.windowSize)}%`};
58
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
- box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
60
- padding-top: ${e=>e.windowSize!=="small"?d.sp2:"0px"};
61
- `,Ve=m.div`
62
- display: flex;
63
- flex-direction: column;
64
- align-items: center;
65
- justify-content: center;
66
- padding: ${e=>e.windowSize==="small"?d.sp3:`62px ${d.sp6} ${d.sp9} ${d.sp8}`};
67
- height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
- overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
- width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
- background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
- margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
- `,We=g((function(e,t){return{file:t.file,type:t.type}}))(ve);function h({appContent:e}){const t=ee(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=S(),[s]=ae(),r=s.get("token"),M=n.pathname.includes("address"),b=x(),H=xe(),A=fe(),w=be(),V=()=>{H.toggle()},W=L((u=>k(u))),_=L((u=>v(u))),{authParams:K,fetchState:c,billAttachment:Z,billFetchState:P,companyName:q,currencySymbol:O,amount:Q}=W,{tenantId:E,userId:z,sessionId:N}=K,{fetchState:R,internationalBankAccountCreateStatus:X}=_;return I.useEffect((()=>{$()}),[]),I.useEffect((()=>{w&&c==="Not-Started"&&i!=null&&o!=null&&r!=null&&t(le(i,o,r))}),[w,c,i,o,r,t]),I.useEffect((()=>{w&&c==="Completed"&&($(z,N,E),l!=null&&t(de(l)))}),[c,w,z,N,E,l,t]),c==="Error"?a.jsx(f,{}):R==="Completed"||X.fetchState==="Completed"?($(),a.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?a.jsx(we,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${d.sp1} ${A.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[c==="Completed"&&P==="Completed"&&a.jsx(Se,{analytics:j,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",i??"",q,l??"",_e(n.pathname),O,Q))(u)}),a.jsxs(Me,{windowSize:b,children:[b!=="small"?a.jsx(Je,{onClick:V}):null,a.jsx(Ve,{windowSize:b,isAddressPage:M,children:P==="In-Progress"?a.jsx(ye,{size:"ExtraLarge",start:!0}):a.jsx(We,{file:Z,type:"bill"})}),a.jsx(He,{windowSize:b,children:e})]})]})}const _e=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ke(){return a.jsx($e,{})}function ra(){return a.jsxs(ne,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(Ke,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Ae,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Le,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Ue,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{ra as default};
@@ -1,12 +0,0 @@
1
- import{j as u}from"./liveblocks-CzCs-qU3.js";import{a as f}from"./sentry-CWp8Ph3h.js";import{u as O,g as w,h as _,t as M,j as l,N as L}from"./core-BBG4mxvC.js";import{z as r,E as P,G as V,S as A,j as N,T as X,X as $,$ as G,U as R}from"./index-De2R2YuA.js";import{fI as W,U3 as q,Uw as B,Un as H,gl as J,gn as K,Us as Q,gX as Y,dk as Z,Ux as ee,Uy as te}from"./zeni-epic-state-FRanwwFO.js";import{n as ne}from"./mui-B2F_PvWe.js";import{u as se}from"./useDeviceId-Bzw6IkAe.js";import{f as ae}from"./analyticsHelper-DoCIxX19.js";import{t as ie}from"./getLocaleForTenant-BYuz_wJa.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="7e10fda2-7a5f-44f9-8707-bc4a5f1b433b",t._sentryDebugIdIdentifier="sentry-dbid-7e10fda2-7a5f-44f9-8707-bc4a5f1b433b")}catch{}})();const T=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Te(){const t=O(),a=w(),m=_(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:z}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),y=l((e=>e.tenantState.activeTenantFetchState.fetchState)),I=l((e=>e.tenantState.signInState)),h=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>W(e))),b=l((e=>q(e))),D=r.getSignedInUser(),v=P().mode;f.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(B(n,i,g)))}),[n,p,t,i,g,s?.zeniSessionId]),f.useEffect((()=>{I!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(b.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then((()=>{const e=R();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin(X.Event.loginSuccess,"email",Z(o.productSettings))}),2e3))}),[I,S,y,s,o,b,v,a.state,t]);const E=f.useCallback((()=>{m("/signin/auth")}),[m]),j=f.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),F=f.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx($,{phoneNumber:x,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:E});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||D!=null){const e=a.state?.origin??"/";return u.jsx(L,{to:e,state:{...a.state,origin:""}})}if(!T(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",U=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(L,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:U,magicLinkExpired:!U&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(G,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- right: 0;
6
- bottom: 0;
7
- display: flex;
8
- align-items: center;
9
- justify-content: center;
10
- z-index: 9999;
11
- background-color: ${t=>t.theme.colors.background};
12
- `;export{Te as default};
@@ -1 +0,0 @@
1
- import{j as _}from"./liveblocks-CzCs-qU3.js";import{a as m}from"./sentry-CWp8Ph3h.js";import{u as te,j as t,i as $e,g as Ge,h as Ue,q as F}from"./core-BBG4mxvC.js";import{fI as ne,U4 as Me,U5 as se,gc as Ne,fH as xe,Ue as Pe,U7 as Re,U8 as Ve,q2 as je,gp as Le,Ub as b,Ug as Oe,Uh as Q,gq as Ze,Ui as qe,Eh as He,h4 as ze,cW as We,Uj as Ye,gb as Je,gr as Ke}from"./zeni-epic-state-FRanwwFO.js";import{w as Qe,i as Xe,Z as ea,c as aa,d as ta,f as na,u as sa,m as c,g as oa,k as ia,z as ra,e as da,o as ca,v as la,y as ua,q as ma,r as X,L as fa,I as ha,J as ba,p as S,j as ee,C as pa,N as ae,F as ga,H as Sa}from"./index-De2R2YuA.js";import{D as ka}from"./mui-B2F_PvWe.js";import{u as Ea}from"./InboxNotificationsProvider-J2K-16R3.js";import{u as Ca}from"./useTaskManagerAccess-CoE1FF6T.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new l.Error().stack;i&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[i]="b14a8333-84c5-4d08-a66e-39711e37f614",l._sentryDebugIdIdentifier="sentry-dbid-b14a8333-84c5-4d08-a66e-39711e37f614")}catch{}})();const Ta=Qe((({isAppContentDrawerOpen:l,handleDrawerToggle:i})=>{const{tenantEmailDomain:s}=$e(),a=Ge(),k=ea(),n=Ue(),B=Ne(),r=te(),{useFeatureGate:d}=aa(),p=ta(),{isTaskManagerAccessEnabled:E}=Ca(p),o=t((e=>ne(e))),oe=o.masterTOSInfo?.isMasterTOSAccepted??!1,$=t((e=>xe(e))),{status:ie}=t(Pe),G=$.uiState.currentChatSessionId,C=na(),{setLoading:re}=sa(),[w,U]=m.useState(void 0),v=F("/:tenantEmailDomain/dashboard")!==null,M=F("/:tenantEmailDomain/reports")!==null,f=F("/:tenantEmailDomain/onboarding/*")!==null,de=!!o.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ce}=d(c.isChargeCardFeatureEnabled),{isFeatureEnabled:N}=d(c.isDebitCardFeatureEnabled),le=oa(o,ce,N),{isFeatureEnabled:ue}=d(c.isSettingsFeatureEnabled),x=t((e=>Re(e))),{isFeatureEnabled:T}=d(c.isReferralFeatureEnabled),A=t((e=>Ve(e)));m.useEffect((()=>{C&&T&&!f&&A.fetchState==="Not-Started"&&r(je(!0))}),[C,T,A.fetchState,f]);const D=t((e=>e.tenantState)),me=t((e=>D.fetchState==="Completed"?Le(e):[])),g=t((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:fe}=d(c.isApAgingFeatureEnabled),{isFeatureEnabled:he}=d(c.isArAgingFeatureEnabled),P=ia(),{isFeatureEnabled:be}=d(c.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:pe}=d(c.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ge}=d(c.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Se}=d(c.isDashboardSidebarNewYearAnimationEnabled),ke=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",Ee=t((e=>b(e).totalUnreadCount)),Ce=t((e=>b(e).reducedFetchCountState)),R=t((e=>b(e).notificationDetailsByTab.tasks.uiState.unreadCount)),V=t((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),j=t((e=>b(e).notificationDetailsByTab.tasks.fetchCountState)),I=t((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:L,isLoading:O,isFetchingMore:Z,hasFetchedAll:q,fetchMore:Te}=Ea();m.useEffect((()=>{const e=setTimeout((()=>Te?.()),0);return()=>clearTimeout(e)})),m.useEffect((()=>{if(O===!1&&Z===!1&&q===!0)if(o?.companyId!=null&&L!=null){const e=`dashboard_${o.companyId}`;U(L.filter((u=>u.roomId===e&&u.readAt==null)).length)}else U(0)}),[O,Z,q]),m.useEffect((()=>{C&&E&&!f&&j.fetchState==="Not-Started"&&B.tenantId!=null&&r(Oe("task_manager","dashboard"))}),[C,E,f,j.fetchState,B.tenantId,r]),m.useEffect((()=>{f||I.fetchState!=="Not-Started"||r(Q({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[f,I.fetchState,r]),m.useEffect((()=>{w!=null&&I.fetchState==="In-Progress"&&(r(Q({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),r(se({unreadCount:w},"comments")))}),[w,I.fetchState]);const Ie={fetchStatus:Ce,count:Ee},H=s!=null?ra.getSignedInUserTenant(s):null,z=t((e=>H?.tenantId!=null?Ze(e,H.tenantId):void 0)),h=[];fe===!1&&h.push("accounts_payable_aging"),he===!1&&h.push("accounts_receivable_aging"),h.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&h.push("rewards_card"),P===!1&&h.push("expense_automation_card");const W=t((e=>qe(e,h).fetchState)),Y=t((e=>He(e).fetchState)),ye=v&&(W==="Completed"||W==="Error")||M&&(Y==="Completed"||Y==="Error")||!v&&!M?void 0:"disabled",we=m.useMemo((()=>ze(o.userRole)),[o.userRole]),ve=We(we),Ae=o?.rewardsLastViewedTime==null,De=p?.userEmail!=null&&x.fetchState==="Completed"&&Ye(x.notificationSettings,p.userEmail,N,o,E),J=da(),Fe=J&&ca(a);return _.jsx(ka,{container:window.document.body,variant:"temporary",open:l,onClose:()=>i(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:_.jsx(la,{signedInUser:p,currentTenantId:D.currentTenantId??"",tenants:D.fetchState==="Completed"?me:z!=null?[z]:[],currentTenant:o,isTenantDropdownDisabled:ye,isSettings:X(a),isInvoicing:ma(a)&&ie==="completed",isSettingsFeatureEnabled:ue,isVendorsTabVisible:ve,isZeniAccountEnabled:de,isChargeCardEnabled:le,isTreasuryEnabled:ke,isNotificationsTabVisible:De,notificationCountDetails:Ie,isExpenseAutomationEnabledForUser:P,selectedMenu:ua(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ae,rewardsPlan:A.rewardsPlan},isAiCfoAccessEnabled:J,onNotificationIconClick:()=>{i(!1);let e=R===0&&V>0?"notifications/comments":"notifications/tasks";X(a)&&(e=R===0&&V>0?"../../notifications/comments":"../../notifications/tasks");const u=S(a.state?.pathnameStackToGoBack,a.pathname);n(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{i(!1);const e=S(a.state?.pathnameStackToGoBack,a.pathname);n("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(i(!1),s==null)return;if(e.type==="invoicing")return void n(`../${s}/invoicing/overview`,{state:{pathnameStackToGoBack:S(a.state?.pathnameStackToGoBack,a.pathname),referrer:"Sidebar"}});if(e.type==="ai_cfo"){if(ee.trackAICFOChatScreenStateChanged("viewed","left_menu",G??null,null),!oe)return void pa({location:a,navigate:n,mergeState:{referrer:"Sidebar"}});const y=S(a.state?.pathnameStackToGoBack,a.pathname);return void n(`/${s}/ai-cfo/explore`,{state:{pathnameStackToGoBack:y,referrer:"Sidebar"}})}const u=S(a.state?.pathnameStackToGoBack,a.pathname),K=e.type,_e=ae(K)&&K!=="command_center";if(ae(e.type)&&g[o.tenantId]!=null&&ee.trackMonthEndCloseClicked(g[o.tenantId].month,g[o.tenantId].year,"Sidebar"),_e&&g[o.tenantId]!=null){const y=g[o.tenantId];return void n(`/${s}/month_end_close_checks/review/${e.type}/${y.month}-${y.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const Be=ga(e.type);Sa(e.type)?(G!=null&&r(Ke()),n(`/${s}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):n(`/${s}/${Be}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{i(!1),n(`/${s}/settings/my_profile`)},handleReferralsClick:()=>{i(!1),n(`/${s}/rewards`)},handleBackClick:()=>{n(`/${s}/dashboard`)},handleTenantSelect:e=>{re(fa.TENANT_SWITCHING),i(!1),ha({dispatch:r,navigate:n,pathToNavigate:ba(e.tenantEmailDomain,a),selectedTenant:e,signedInUser:p})},onZeniLogoClick:()=>{k.toggle()},isAiCfo:Fe,aiCfoView:$,isOnDashboard:v,updateCurrentChatSessionId:e=>{r(Je({sessionId:e,agentId:"controller"})),n(`/${s}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:be,isTaskManagerAccessEnabled:E,thanksGivingAnimationEnabled:pe,christmasAnimationEnabled:ge,newYearAnimationEnabled:Se})})})),Ba=l=>{const i=te(),s=t((k=>ne(k))),a={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(k,n)=>{Xe(n)&&Me(n.mode)==="dashboard"&&i(se({unreadCount:n.data.unread},"tasks"))}};return _.jsx(Ta,{...l,...a})};export{Ba as M};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-CzCs-qU3.js";import{h as r,l as i}from"./core-BBG4mxvC.js";import{am as n}from"./index-De2R2YuA.js";import"./mui-B2F_PvWe.js";import"./sentry-CWp8Ph3h.js";import"./zeni-epic-state-FRanwwFO.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="f2f6ef04-8019-4dfe-8bec-98d5efe59039",o._sentryDebugIdIdentifier="sentry-dbid-f2f6ef04-8019-4dfe-8bec-98d5efe59039")}catch{}})();const f=i(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(n);function _(){const o=r();return e.jsx(f,{navigate:o})}export{_ as default};
@@ -1 +0,0 @@
1
- import{n as mt,b as lt,o as ft,j as N}from"./liveblocks-CzCs-qU3.js";import ut from"./NotFoundScreen-BXryZNID.js";import{a as k}from"./sentry-CWp8Ph3h.js";import{h as ht,g as pt,i as kt,u as gt,j as S,l as St,n as bt,o as X}from"./core-BBG4mxvC.js";import{cB as It,U7 as z,fI as J,h4 as Ct,Ub as b,a15 as Q,Uh as m,U5 as y,Ax as F,Ge as Tt,a16 as At,U4 as yt,Uj as Et,AC as _t,a17 as j,br as $,gk as w,AG as Y,a18 as Nt,cN as Bt,cG as xt}from"./zeni-epic-state-FRanwwFO.js";import{aq as wt,d as Ut,c as Gt,m as vt,as as Dt,dK as Rt,p as B,dL as Pt,w as Mt,dM as jt,i as $t,a4 as Ft}from"./index-De2R2YuA.js";import"./mui-B2F_PvWe.js";import{u as Vt}from"./useAskAiCfoHostNavButtonProps-Bq-fQXG8.js";import{u as qt}from"./useTaskManagerAccess-CoE1FF6T.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="84f697c8-1b92-4c3a-9743-ed5732e78370",t._sentryDebugIdIdentifier="sentry-dbid-84f697c8-1b92-4c3a-9743-ed5732e78370")}catch{}})();const Lt=(t,l)=>new Promise(((n,h)=>{const g=t.map((c=>new Promise((o=>{l(c),o()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((c=>{h(c)}))})),Wt=St((function(t,l){const n=z(t),{signedInUser:h,isDebitCardFeatureEnabled:g,isTaskManagerAccessEnabled:c}=l,o=b(t),f=J(t),{currentTab:I}=o;return{notificationView:o,isNotificationSettingsVisible:h.userEmail!=null&&Et(n.notificationSettings,h.userEmail,g,f,c),isDisabled:o.notificationDetailsByTab[I].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:h,loggedInUserRoleMap:g,externalNotificationsUnreadCount:c,allUnreadCommentsNotificationIds:o,navigate:f,markInboxNotificationAsRead:I,fetchMoreCommentsNotifications:G}=l;return{onNotificationClick:(a,s,d,r)=>{if(r==="task_deleted"){const i=`/${h}/tasks`,C=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:C,message:"triggerBackClick"}})}else{const i=`/${h}/tasks/${s}`,C=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:C,message:"triggerBackClick"}})}d==="unread"&&t(Y("task_manager","read",[a],!1))},onCommentNotificationClick:(a,s,d)=>{const r=s.toString().split(`/${h}/`);if(r[1]!=null){d==="unread"&&(I(a),t(j([a],$())));let i=`/${h}/${r[1]}`;const C=B(n.state?.pathnameStackToGoBack,n.pathname);r[1].startsWith("reimbursement")&&!Bt(g)&&(i="not-found"),r[1].startsWith("bill")&&!xt(g)&&(i="not-found"),f(i,{state:{pathnameStackToGoBack:C,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,s)=>{t(y(a,s))},onUpdateNotificationTabState:(a,s)=>{t(m(a,s))},onUpdateNotificationViewCurrentTabAndSubTab:(a,s)=>{t(Q(a,s));const d=`../${a}`,r=B(n.state?.pathnameStackToGoBack,n.pathname);f(d,{state:{pathnameStackToGoBack:r}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,s)=>{if(a==="tasks"){const d=[];s==="all"?d.push("read","unread"):s!=="mentions"&&d.push(s),t(F("task_manager","dashboard",d))}else G?.()},onUpdateNotificationStatus:(a,s,d,r)=>{a==="tasks"?t(Y("task_manager",d,r)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(r.map((i=>{d==="read"&&(I(i),t(j([i],$())))}))).then((()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:c-r.length>0?c-r.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Lt(o,I).then((()=>{t(j(o,$())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((s=>{t(m({markAsAllReadState:{fetchState:"Error",error:s}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../../dashboard";f(s,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=B(n.state?.pathnameStackToGoBack,n.pathname);f("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Mt(jt)),Ht=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:h}=kt(),{areTenantIdsInSync:g}=wt(),c=It(h??""),o=gt(),f=Ut(),[I,G]=k.useState(!1),a=S((e=>z(e))),s=S((e=>J(e))),{useFeatureGate:d}=Gt(),{isFeatureEnabled:r}=d(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:i,onAskAiCfoClick:C}=Vt({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const Z=Ct(s.userRole);if(s==null||n==null||s.companyId==null)throw Error("Can't access notifications page without current tenant...");if(f==null)throw Error("Can't access notifications page without signed in...");const V=S((e=>b(e).notificationDetailsByTab.tasks.fetchState)),q=S((e=>b(e).currentTab)),v=S((e=>b(e).currentSubTab)),tt=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),D=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),et=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),at=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),st=Rt().allUsers,{inboxNotifications:x,isLoading:E,hasFetchedAll:T,isFetchingMore:R,fetchMore:ot}=mt(),{threads:L,isLoading:W,fetchMore:H,isFetchingMore:K,hasFetchedAll:O}=lt({query:{metadata:{companyId:s.companyId,application:"dashboard"}}});k.useEffect((()=>{if(q!==c&&c!=null&&o(Q(c)),c==null){const e=`../${q}`,p=B(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[c]),k.useEffect((()=>{tt.fetchState==="Not-Started"&&o(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(E===!1&&T===!0&&s?.companyId!=null&&x!=null){const e=`dashboard_${s.companyId}`,p=x.filter((A=>A.roomId===e&&A.readAt==null)).length;o(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(y({unreadCount:p},"comments"))}}),[E,T]),k.useEffect((()=>{V!=="In-Progress"&&g&&o(F("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const P=E||R===!0||T!==!0||E||R===!0||T!==!0;k.useEffect((()=>{P&&D!=="In-Progress"?o(m({fetchState:"In-Progress",error:void 0},"comments")):P||D!=="In-Progress"||o(m({fetchState:"Completed",error:void 0},"comments"))}),[P,D]),k.useEffect((()=>{o(y({hasMore:T!==!0},"comments"))}),[T]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&I===!1&&(G(!0),o(Tt()))}),[a.fetchState]),k.useEffect((()=>{if(E===!1&&W===!1&&x!=null&&L!=null){const e=`dashboard_${s.companyId}`,p=x.filter((u=>u.roomId===e)).filter((u=>Pt(u.kind))),A=p.filter((u=>u.readAt==null)),_=p.map((u=>u.id)),ct=p.map((u=>{const M=L.find((dt=>{return dt.id===((U=u).kind==="thread"?U.threadId:"subjectId"in U?U.subjectId:void 0);var U}));return M!=null?{inboxNotification:{...u,threadId:M.id},thread:M}:(K||O===!0||H==null||H(),null)})).filter((u=>u!=null));o(m({allNotificationsIds:_},"comments")),o(y({totalCount:_.length,unreadCount:A.length},"comments")),o(At(ct))}}),[E,R,K,T,O,W,x?.length]);const nt={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if($t(p)){const A=yt(p.mode);if(A==="dashboard"&&o(y({unreadCount:p.data.unread},"tasks")),V!=="In-Progress"){const _=[];v==="all"?_.push("read","unread"):v!=="mentions"&&_.push(v),o(F("task_manager",A,_,!0))}}}},it=ft(),{isTaskManagerAccessEnabled:rt}=qt(f);return N.jsx(Wt,{tenantEmailDomain:n,loggedInUserRoleMap:Z,signedInUser:f,externalNotificationsUnreadCount:et,location:l,navigate:t,isDebitCardFeatureEnabled:r,isTaskManagerAccessEnabled:rt,users:st,markInboxNotificationAsRead:it,allUnreadCommentsNotificationIds:at,isAiCfoAccessEnabled:i,onAskAiCfoClick:C,...nt})};function me(){return N.jsxs(bt,{children:[N.jsx(X,{path:"/:selectedTab",element:N.jsx(Ht,{})}),N.jsx(X,{path:"*",element:N.jsx(ut,{})})]})}export{me as default};
@@ -1 +0,0 @@
1
- import{j as m}from"./liveblocks-CzCs-qU3.js";import{a as r}from"./sentry-CWp8Ph3h.js";import{u as A,g as j,j as o,N as C}from"./core-BBG4mxvC.js";import{UK as M,fI as P,gp as x,UL as z,UM as D,UN as L,UO as N,pV as R,Tp as k}from"./zeni-epic-state-FRanwwFO.js";import{z as h,ah as I}from"./index-De2R2YuA.js";import"./mui-B2F_PvWe.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="c0c0c2dd-06ea-49f7-89ff-99c0b9b0a35f",n._sentryDebugIdIdentifier="sentry-dbid-c0c0c2dd-06ea-49f7-89ff-99c0b9b0a35f")}catch{}})();function ee(){const n=A(),s=j(),{params:t,error:i}=r.useMemo((()=>M(s.search)),[s.search]),w=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o((e=>P(e))),l=o((e=>x(e))),d=o((e=>e.tenantState.fetchState)),y=o(z),b=o(D),c=o(L),[U,v]=r.useState(null),[S,E]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(N())}),[n,s.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(R(a.userId,a.zeniSessionId??void 0))))}),[f,a,d,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const _=r.useMemo((()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((T=>T.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[p?.tenantId,l]),u=U??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:v,approveError:S??b,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(k(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{E("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(C,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +0,0 @@
1
- import{j as n}from"./liveblocks-CzCs-qU3.js";import{h as G,u as W,g as z,i as H,j as d,l as J,n as K,o as C}from"./core-BBG4mxvC.js";import{fI as v,Ai as R,vb as Q,VC as M,v6 as T,bq as X,c0 as Z,v7 as ee,VD as ae,Vk as S,ek as te,E6 as se,VE as oe,Eu as re,e0 as ne,d$ as ce}from"./zeni-epic-state-FRanwwFO.js";import{ai as ie,z as le,aq as de,as as fe,_ as me,a8 as pe,j as w,aD as ue,p as he,c as Fe,m as ge}from"./index-De2R2YuA.js";import"./mui-B2F_PvWe.js";import Ie from"./NotFoundScreen-BXryZNID.js";import{F as be}from"./FeaturePreviewScreen-C1hVuos1.js";import{a as F}from"./sentry-CWp8Ph3h.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-Bq-fQXG8.js";import{u as Se}from"./useInitialThreadRequest-C1rKRZSH.js";import{t as Te}from"./routePaths-BRju88LA.js";import{M as ye}from"./MobileAppDrawer-B_zpLZqx.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";import"./InboxNotificationsProvider-J2K-16R3.js";import"./useTaskManagerAccess-CoE1FF6T.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="cbd0beef-1da9-48dd-9ff6-6c5817075a9f",s._sentryDebugIdIdentifier="sentry-dbid-cbd0beef-1da9-48dd-9ff6-6c5817075a9f")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=J((function(s){const e=ae(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(M(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=te(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),f=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:f,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=G(),a=W(),o=z(),{forecastId:r,tenantEmailDomain:c}=H(),[p,u]=F.useState(!1),[f,A]=F.useState(!1),g=le.getSignedInUser(),D=d((t=>v(t))),_=D.company?.companyInfo.firstMonthOfFY??1,i=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),k=d((t=>t.profitAndLossState)),x=d((t=>t.reportUIOptionsState.selectedForecast)),j=t=>k.pandLByForecastID[t]!=null&&ee(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=de();fe({isDataReady:l});const{isAiCfoAccessEnabled:q,onAskAiCfoClick:V}=Ce({mobileExploreReferrer:"Forecast"});F.useEffect((()=>{if(!p&&I)u(!0),l||a(Q());else if(l&&!f){A(!0);const t=((m,P,O)=>P!=null?m.forecasts.findIndex((b=>b.id===P)):O!=null?m.forecasts.findIndex((b=>b.id===O)):m.forecasts.length>0?0:-1)(i,r,x?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=x?.index?(a(M(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!j(i.forecasts[t].id)&&I&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,f,A,R,T,I]);const E=me(),$=E?.loggedInUserRole!=null&&X(E.loggedInUserRole),B=Se(D?.companyId,{clearParams:l&&f}),[N,Y]=F.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",g?.firstName??""),h.searchParams.set("lastname",g?.lastName??""),h.searchParams.set("email",g?.userEmail??"");const L=t=>{Y(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:w,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:N,handleDrawerToggle:L}),n.jsx(Ae,{firstMonthOfFY:_,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:j,meetingUrl:Z(h.toString()),hasTransactionAccess:$,isAiCfoAccessEnabled:q,onAskAiCfoClick:V,initialOpenThreadRequest:B,onClickMenuIcon:()=>{L(!0)}})]})}function He(){const s=d((c=>v(c))),{useFeatureGate:e}=Fe(),{isFeatureEnabled:a}=e(ge.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(K,{children:[n.jsx(C,{path:"/",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ie,{})})]})}export{He as default};
@@ -1,22 +0,0 @@
1
- import{j as a}from"./liveblocks-CzCs-qU3.js";import{Vy as re,fI as N,m2 as _,e0 as Y,d$ as le,Sp as J,UX as ce,D1 as Ee,Vz as X,CS as je,Db as Le,D5 as de,CW as pe,D9 as Te,D6 as ve,VA as ue,sw as Ae,g9 as Ve,gG as Fe,VB as G,C_ as me,CZ as ge,De as Re,c9 as Oe}from"./zeni-epic-state-FRanwwFO.js";import{a1 as fe,c as Q,m as H,z as W,g as Ce,P as he,af as ye,az as be,aA as Be,ab as Se,M as R,ag as we,G as K,aB as Ze,aq as Ue,as as $e,a8 as ze,j as De,T as Ge,p as He,aC as _e,_ as We}from"./index-De2R2YuA.js";import{D as xe,n as M,S as Ie}from"./mui-B2F_PvWe.js";import ae from"./NotFoundScreen-BXryZNID.js";import{a as c}from"./sentry-CWp8Ph3h.js";import{u as ee,i as Ke,j as g,h as Me,g as qe,l as Xe,n as se,o as z}from"./core-BBG4mxvC.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-Bq-fQXG8.js";import{M as Ye}from"./MobileAppDrawer-B_zpLZqx.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";import"./InboxNotificationsProvider-J2K-16R3.js";import"./useTaskManagerAccess-CoE1FF6T.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]="72807287-0305-4585-9e60-6c5947f8a40f",e._sentryDebugIdIdentifier="sentry-dbid-72807287-0305-4585-9e60-6c5947f8a40f")}catch{}})();const Je={overlayWidth:new Se(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Qe=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const C=fe(),m=ee(),[O,B]=c.useState(!1),[k,S]=c.useState(!1),{userId:w}=Ke(),r=g((l=>re(l))),p=g((l=>N(l))),P=g((l=>_(l))),{useFeatureGate:x}=Q(),{isFeatureEnabled:I}=x(H.isDebitCardFeatureEnabled),E=Y(I,p),T=le(p),v=J(p),Z=ce(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,D=!E&&P&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const h=()=>{m(X()),b()},A=()=>{O===!0?S(!0):h()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(H.isChargeCardFeatureEnabled),L=Ce(p,j,I),{isCardsHidden:V}=he(p?.tenantId),y=!L||V,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:v,isAccountingClassesEnabled:P,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:E,isCardsOnlyTenant:T,onResetClick:h,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),B(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(v))},onCloseClick:A,isLoading:D||r.person==null},o={onOkClick:()=>{S(!1),h()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{D===!1&&w!=null&&m(Ee(w))}),[D,w]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&h()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Je.overlayWidth.valuePercentage(C),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Pe,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Be,{...s})]})})},ea=M(Ie)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,ke=M(we.H6Regular)`
6
- margin-top: ${R.sp7};
7
- padding-left: ${R.sp8};
8
- padding-right: ${R.sp8};
9
- color: ${e=>e.theme.colors.primary};
10
- word-break: break-word;
11
- `,Pe=M(we.LargeRegularSp)`
12
- color: ${e=>e.theme.colors.hero};
13
- padding-left: ${R.sp8};
14
- padding-right: ${R.sp8};
15
- margin-bottom: 30px;
16
- margin-top: ${R.sp4};
17
- white-space: pre-line;
18
- `,aa={overlayWidth:new Se(100,100,48)},oe=K.getLocalizedStrings().peoplePage.invitePage,ie=K.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const C=fe(),m=ee(),[O,B]=c.useState(!1),[k,S]=c.useState(!1),w=g((o=>re(o))),r=g((o=>N(o))),p=g((o=>_(o))),{useFeatureGate:P}=Q(),{isFeatureEnabled:x}=P(H.isDebitCardFeatureEnabled),I=Y(x,r),E=le(r),T=J(r),v=ce(r),Z=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const D=()=>{b(),m(X())},h=()=>{O===!0?S(!0):D()},A={onOkClick:()=>{S(!1),D()},onCancelClick:()=>{S(!1)}},$=d.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=P(H.isChargeCardFeatureEnabled),L=Ce(r,j,x),{isCardsHidden:V}=he(r?.tenantId),y=!L||V,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,onPeopleLocalDataUpdated:o=>{m(de({peopleLocalData:o})),B(!0)},onResetClick:D,onSaveClick:()=>{m(f==="zeni_only"?Te(e):ve())},onCloseClick:h,peopleDetails:w,isAccountingClassesEnabled:p,isReimbursementDisabled:Z===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:E,isLoading:U};return c.useEffect((()=>{w.invitePersonState.fetchState==="Completed"&&(b(),m(X()))}),[w.invitePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(C),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:h,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Pe,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:A}):null,a.jsx(Ze,{...s})]})})},ta=M(Ie)`
19
- display: flex;
20
- min-height: 100%;
21
- flex-direction: column;
22
- `,na=Xe((function(e,t){const d=ue(e),n=W.getSignedInUser();return{data:d,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:_(e),analytics:De}}),(function(e,t){const{navigate:d,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,b)=>{e(pe(i,b))},onResendInvite:i=>{e(Re(i))},onReloadPeople:()=>{e(me()),e(ge(n,f))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(G({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(G({searchText:i}))}}}}))(_e);function q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const d=Me(),n=ee(),f=qe(),{areTenantIdsInSync:i}=Ue(),b=W.getSignedInUser(),C=g((s=>N(s))),{useFeatureGate:m}=Q(),{isFeatureEnabled:O}=m(H.isDebitCardFeatureEnabled),B=g((s=>_(s))),k=!Y(O,C)&&B,S=J(C),w=C?.tenantId,{tenantEmailDomain:r}=C,[p,P]=c.useState(!1),[x,I]=c.useState(!1),[E,T]=c.useState(!1),[v,Z]=c.useState("off"),[U,D]=c.useState(!1),h=s=>{D(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=Ne({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ae(s.classState,s.classListState))),L=g((s=>Ve(s.userState,s.userRoleState,s.userListViewState,"manager"))),V=g((s=>Fe(s))),y=C?.companyId;c.useEffect((()=>{p&&v===u.uiState.mode||!i||(n(G({searchText:"",sortKey:"name",sortOrder:"ascending"})),Z(u.uiState.mode),P(!0),n(me()))}),[p,b,w,n,u.uiState.mode,i]),c.useEffect((()=>{y!=null&&i&&n(ge(y,k))}),[y,k,i]),c.useEffect((()=>{I(e!=null&&e===!0),T(t!=null&&t===!0&&t)}),[e,t]),c.useEffect((()=>{n(G({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),T(!1),d("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:De,onLoad:s=>s.trackPageLoaded(Ge.Event.members)}):null,x===!0?a.jsx(sa,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:x,managersListView:L,companyPassportView:V,classListView:j,companyId:y,mode:u.uiState.mode}):null,E===!0?a.jsx(Qe,{closeDrawerHandler:F,isEditPeopleDrawerOpen:E,managersListView:L,companyPassportView:V,classListView:j,companyId:y,mode:u.uiState.mode}):null,a.jsx(Ye,{isAppContentDrawerOpen:U,handleDrawerToggle:h}),a.jsx(na,{navigate:d,signedInUser:b,isZeni:C.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(s,o)=>{n(G({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=He(f.state?.pathnameStackToGoBack,f.pathname);d(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{h(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function ka(){const e=We();return Oe(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(z,{path:"/",element:a.jsx(q,{})}),a.jsx(z,{path:"new",element:a.jsx(q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(q,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(z,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-CzCs-qU3.js";import E from"./NotFoundScreen-BXryZNID.js";import{a as r}from"./sentry-CWp8Ph3h.js";import{h as _,g as v,j as p,i as M,u as U,N as O,l as P,n as z,o as b}from"./core-BBG4mxvC.js";import{fI as N,a19 as h,bo as B,bn as F,iO as V,gk as Z}from"./zeni-epic-state-FRanwwFO.js";import{Z as $,z as I,as as q,dN as G}from"./index-De2R2YuA.js";import"./mui-B2F_PvWe.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-Bq-fQXG8.js";import{M as J}from"./MobileAppDrawer-B_zpLZqx.js";import"./recharts-CzGMTm3v.js";import"./analytics-cC2XJoxx.js";import"./plaid-BWZxX3Bn.js";import"./dnd-oIrpOltC.js";import"./stripe-cKAAJElX.js";import"./lottie-ULJlrwjP.js";import"./lexical-BRrdO5Cu.js";import"./pdf-CeVn9A9c.js";import"./utils-u0mlLj2I.js";import"./InboxNotificationsProvider-J2K-16R3.js";import"./useTaskManagerAccess-CoE1FF6T.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]="6b6578bc-920a-4264-90bc-b9b92b4f22c7",e._sentryDebugIdIdentifier="sentry-dbid-6b6578bc-920a-4264-90bc-b9b92b4f22c7")}catch{}})();const K=P((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),L=()=>{const e=_(),t=v(),c=$(),o=p((a=>N(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:f}=M(),u=U(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=F(d),y=C||k||x,l=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(Z({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),m.current=!0}),[n?.fetchState,l]),j=r.useCallback(((a,i)=>{l(a,i,!1)}),[l]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(O,{to:`/${f}/dashboard`,replace:!0})};function be(){return s.jsxs(z,{children:[s.jsx(b,{path:"*",element:s.jsx(L,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{be as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./liveblocks-CzCs-qU3.js";import Z from"./NotFoundScreen-BXryZNID.js";import{a as p}from"./sentry-CWp8Ph3h.js";import{h as C,g as N,u as V,j as u,N as D,l as k,n as z,o as g}from"./core-BBG4mxvC.js";import{fI as E,Zf as w,Zw as h,NQ as U,NM as L,NP as m,NF as B,ZV as T,NJ as F,NS as J}from"./zeni-epic-state-FRanwwFO.js";import{z as $,w as O,ca as K,r as W,bT as M,cb as P}from"./index-De2R2YuA.js";import"./mui-B2F_PvWe.js";import{u as Q,R as x}from"./ReimbursementApprovalRuleDetailScreen-ChXGgpkg.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]="fdfb7fd5-94ba-4768-81bd-e5f6a87f3ec2",e._sentryDebugIdIdentifier="sentry-dbid-fdfb7fd5-94ba-4768-81bd-e5f6a87f3ec2")}catch{}})();const j="reimbursement-approval-rule-update",q=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(j)&&e(T(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(m(t)),n(`./${t}/edit`)):(e(m()),n("./new"))}}}))(O(K)),G=({isLoading:e})=>{const s=C(),n=N(),a=V(),[t,l]=p.useState(!1),[v,R]=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]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(m())),s("./new"))}),[v,d,a]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(o,y,I)=>{o.endsWith(j)&&I.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(q,{currentTenant:c,location:n,navigate:s,...f})},A="reimbursement-approval-rule-update",H=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(A)&&e(T(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(m(t)),n(`./${t}/edit`)):(e(m()),n("./new"))},onReorderRules:t=>{e(J(t,!0))}}}))(O(P)),X=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=M(e?.tenantId);return s?r.jsx(Y,{isLoading:n}):r.jsx(G,{isLoading:n})},Y=({isLoading:e})=>{const s=C(),n=N(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),f=u((i=>E(i))),o=u((i=>w(i)));Q();const y=u((i=>h(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),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||(R(!0),a(F(!1,!0)))}),[v,b,e,a]),$.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(m())),s("./new"))}),[S,o,a]);const I={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${A}`]:[],eventCallback:(i,ee,_)=>{i.endsWith(A)&&_.onApprovalRulesEventReceived(i)}};return f?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(H,{currentTenant:f,location:n,navigate:s,isLoading:e,...I})};function le(){return r.jsxs(z,{children:[r.jsx(g,{path:"/",element:r.jsx(X,{})}),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};