@nodefony/studio 10.0.0-beta.4 → 10.0.0-beta.5

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 (204) hide show
  1. package/dist/frontend/assets/Accordion-B95T_jqd.js +1 -0
  2. package/dist/frontend/assets/{ActionsLiveGraph-Bgmlddil.js → ActionsLiveGraph-D3-4cU7L.js} +1 -1
  3. package/dist/frontend/assets/AgentsPreview-jk8ZqKC0.js +12 -0
  4. package/dist/frontend/assets/ApiKeys-BsOVh9jZ.js +2 -0
  5. package/dist/frontend/assets/{ArchitectureLiveGraph-6B27wQFi.js → ArchitectureLiveGraph-DxdFansn.js} +1 -1
  6. package/dist/frontend/assets/Audit-DN46ibNe.js +1 -0
  7. package/dist/frontend/assets/{BackplaneLiveGraph-DFbKM68H.js → BackplaneLiveGraph-CO5_VjW2.js} +1 -1
  8. package/dist/frontend/assets/Breadcrumbs-BIn6iL6M.js +1 -0
  9. package/dist/frontend/assets/BrickStoreChip-qSqdbJGs.js +1 -0
  10. package/dist/frontend/assets/Chat-CYSa6u-p.js +1 -0
  11. package/dist/frontend/assets/Chip-vBXuu2Pb.js +1 -0
  12. package/dist/frontend/assets/Cluster-OJGOgCyg.js +1 -0
  13. package/dist/frontend/assets/ConfigPage-BjzVG-6E.js +1 -0
  14. package/dist/frontend/assets/ConnectorCard-zvQhWOBu.js +11 -0
  15. package/dist/frontend/assets/Create-CTWnL96w.js +2 -0
  16. package/dist/frontend/assets/DashboardSupervision-CuO-q63s.js +1 -0
  17. package/dist/frontend/assets/Database-CiQgVd4R.js +1 -0
  18. package/dist/frontend/assets/{DbLogo-CPVaIo-1.js → DbLogo-DnsxrIuK.js} +1 -1
  19. package/dist/frontend/assets/Documentation-D7PIdZhA.js +1 -0
  20. package/dist/frontend/assets/{FanOutLiveGraph-CA025u8m.js → FanOutLiveGraph-Dx91GfJH.js} +1 -1
  21. package/dist/frontend/assets/Firewall-0tS7vsj8.js +1 -0
  22. package/dist/frontend/assets/{IconAdjustmentsHorizontal-Bze9w1KM.js → IconAdjustmentsHorizontal-Cl0HIZIL.js} +1 -1
  23. package/dist/frontend/assets/IconAppWindow-Bs58vZIt.js +1 -0
  24. package/dist/frontend/assets/{IconApps-99oikTTs.js → IconApps-65-UAwsK.js} +1 -1
  25. package/dist/frontend/assets/{IconArrowDown-CVg6dTJG.js → IconArrowDown-D9YrjBsl.js} +1 -1
  26. package/dist/frontend/assets/{IconArrowLeft-BjXaYGFL.js → IconArrowLeft-DfkbqW0P.js} +1 -1
  27. package/dist/frontend/assets/{IconArrowUp-BI5oNIYX.js → IconArrowUp-Wl2xauER.js} +1 -1
  28. package/dist/frontend/assets/{IconArrowsSplit2-2czCcKl1.js → IconArrowsSplit2-C9n20g2v.js} +1 -1
  29. package/dist/frontend/assets/IconBan-BpUuW2o7.js +1 -0
  30. package/dist/frontend/assets/{IconBook-3zpOeyw5.js → IconBook-CeLncPbQ.js} +1 -1
  31. package/dist/frontend/assets/{IconCircleCheck-4L5q2AOa.js → IconCircleCheck-Cev1g2jp.js} +1 -1
  32. package/dist/frontend/assets/{IconCircleDot-UeVVj0Hw.js → IconCircleDot-iaW-20aN.js} +1 -1
  33. package/dist/frontend/assets/IconCircuitResistor-BLDyvG8t.js +1 -0
  34. package/dist/frontend/assets/{IconCode-CZBF6Fre.js → IconCode-Back6-pr.js} +1 -1
  35. package/dist/frontend/assets/{IconDeviceDesktop-CmA2QS1y.js → IconDeviceDesktop-Cjz_ZorW.js} +1 -1
  36. package/dist/frontend/assets/{IconDots-CGp_6hGw.js → IconDots-Uc12X1j1.js} +1 -1
  37. package/dist/frontend/assets/{IconDownload-BHadX_X7.js → IconDownload-TLEMvh4h.js} +1 -1
  38. package/dist/frontend/assets/{IconEye-DtO-67sS.js → IconEye-Bp3WBW_K.js} +1 -1
  39. package/dist/frontend/assets/{IconFile-CawVe9xy.js → IconFile-D_IwbZbP.js} +1 -1
  40. package/dist/frontend/assets/{IconFolder-DtN07M63.js → IconFolder-TW06P_HX.js} +1 -1
  41. package/dist/frontend/assets/{IconGitBranch-B0jrHkO3.js → IconGitBranch-DfUYidP2.js} +1 -1
  42. package/dist/frontend/assets/{IconHandStop-ysGACXTj.js → IconHandStop-BlYaZ8pd.js} +1 -1
  43. package/dist/frontend/assets/{IconHeartRateMonitor-Bvl8jHTd.js → IconHeartRateMonitor-CqXgvjmG.js} +1 -1
  44. package/dist/frontend/assets/{IconHelpCircle-BCItd8VT.js → IconHelpCircle-CNDr9FpE.js} +1 -1
  45. package/dist/frontend/assets/{IconLayoutGrid-CfSdAIlD.js → IconLayoutGrid-B99HuO3B.js} +1 -1
  46. package/dist/frontend/assets/IconListSearch-BkvbitIl.js +1 -0
  47. package/dist/frontend/assets/IconPackages-BCP9yEBr.js +1 -0
  48. package/dist/frontend/assets/{IconPencil-BpxtlIcN.js → IconPencil-DcuxW7s6.js} +1 -1
  49. package/dist/frontend/assets/{IconPlayerPause-CbRWQ0OJ.js → IconPlayerPause-BnZOaBnJ.js} +1 -1
  50. package/dist/frontend/assets/IconPlayerPlay-Dmu0_cO7.js +1 -0
  51. package/dist/frontend/assets/{IconPlayerStop-CJYvZ1j2.js → IconPlayerStop-0cIrjKL1.js} +1 -1
  52. package/dist/frontend/assets/IconPlus-DJnai39n.js +1 -0
  53. package/dist/frontend/assets/{IconPuzzle-D3bEL-Kr.js → IconPuzzle-BB3XWSJ3.js} +1 -1
  54. package/dist/frontend/assets/{IconRecycle-BtnT8ZXv.js → IconRecycle-Cs7uLh99.js} +1 -1
  55. package/dist/frontend/assets/{IconSend-zQNYJbkq.js → IconSend-BiPxzhGo.js} +1 -1
  56. package/dist/frontend/assets/{IconServer2-D61W-eXq.js → IconServer2-CwKH5DuF.js} +1 -1
  57. package/dist/frontend/assets/{IconShieldOff-C2WA-gmj.js → IconShieldOff-BtjbLiFI.js} +1 -1
  58. package/dist/frontend/assets/{IconSitemap-BJzupAxl.js → IconSitemap-DsC21r-y.js} +1 -1
  59. package/dist/frontend/assets/{IconStack2-B9YJBVEL.js → IconStack2-Bi2TDP1d.js} +1 -1
  60. package/dist/frontend/assets/{IconTerminal2-ZtXcXVK9.js → IconTerminal2-DWYhp77C.js} +1 -1
  61. package/dist/frontend/assets/{IconTool-BhLKKx-z.js → IconTool-CCYc3z_c.js} +1 -1
  62. package/dist/frontend/assets/{IconUserOff-FIAY4a-C.js → IconUserOff-BJroVvTi.js} +1 -1
  63. package/dist/frontend/assets/{IconWorld-DoL6V4LE.js → IconWorld-DwwvBIep.js} +1 -1
  64. package/dist/frontend/assets/KnowledgePreview-DD3gFPVj.js +1 -0
  65. package/dist/frontend/assets/List-CSxy5t8i.js +1 -0
  66. package/dist/frontend/assets/LlmProvidersPreview-BqcHOOz6.js +1 -0
  67. package/dist/frontend/assets/LogVisuals-BzU1XVTx.js +1 -0
  68. package/dist/frontend/assets/Logs-Biv9FSPR.js +1 -0
  69. package/dist/frontend/assets/McpPreview-yS6eWMSn.js +1 -0
  70. package/dist/frontend/assets/MemoryPreview-Di6W70HF.js +1 -0
  71. package/dist/frontend/assets/Migrations-3DzAGzE5.js +3 -0
  72. package/dist/frontend/assets/ModuleDetail-B3ddL_Ni.js +1 -0
  73. package/dist/frontend/assets/Modules-BjkwQo-M.js +1 -0
  74. package/dist/frontend/assets/OrmConnector-3ghomo2w.js +1 -0
  75. package/dist/frontend/assets/OrmEntity-CCgAuLJw.js +1 -0
  76. package/dist/frontend/assets/OrmOverview-DN4Oeaqi.js +1 -0
  77. package/dist/frontend/assets/OrmWorker-DVB3-CXZ.js +1 -0
  78. package/dist/frontend/assets/Playground-Dm51zhvM.js +1 -0
  79. package/dist/frontend/assets/{ProbesLiveGraph-36Y6b2-W.js → ProbesLiveGraph-DguMpU4r.js} +1 -1
  80. package/dist/frontend/assets/{Profile-DbK_K53D.js → Profile-C5DZ3RBe.js} +2 -2
  81. package/dist/frontend/assets/{ProfileFields-CY-cyHpl.js → ProfileFields-CVd01diC.js} +1 -1
  82. package/dist/frontend/assets/Progress-CBHZcl7M.js +1 -0
  83. package/dist/frontend/assets/{ProtocoleLiveGraph-CzsBhPwX.js → ProtocoleLiveGraph-B3ylCzdY.js} +1 -1
  84. package/dist/frontend/assets/RealtimeConsole-CifCD0gL.js +1 -0
  85. package/dist/frontend/assets/{RingProgress-CvPWmY4T.js → RingProgress-DG5R3qG5.js} +1 -1
  86. package/dist/frontend/assets/Roadmap-N0SiFkET.js +1 -0
  87. package/dist/frontend/assets/RoleSwitch-DxxRjBDk.js +1 -0
  88. package/dist/frontend/assets/Roles-BoWhfMpG.js +1 -0
  89. package/dist/frontend/assets/RoutesView-D_jPoY8n.js +1 -0
  90. package/dist/frontend/assets/Runtime-B0KTrYTl.js +1 -0
  91. package/dist/frontend/assets/Sessions-DZNuM2pE.js +1 -0
  92. package/dist/frontend/assets/Skeleton-BPMtTBl8.js +1 -0
  93. package/dist/frontend/assets/StoresView-DwMaOetW.js +1 -0
  94. package/dist/frontend/assets/System-z6oDmzUd.js +1 -0
  95. package/dist/frontend/assets/TagsInput-DL4sudtP.js +1 -0
  96. package/dist/frontend/assets/{Textarea-BWkcGO8Z.js → Textarea-DxkrnirS.js} +1 -1
  97. package/dist/frontend/assets/Timeline-C0f-zZ9I.js +1 -0
  98. package/dist/frontend/assets/TraceView-BMAOmZcO.js +1 -0
  99. package/dist/frontend/assets/Twin-ByLKTjbH.js +19 -0
  100. package/dist/frontend/assets/UserProfile-BWD1GuI6.js +1 -0
  101. package/dist/frontend/assets/Users-Cx-wNGfg.js +1 -0
  102. package/dist/frontend/assets/VectorStoresPreview-DU8fG7oS.js +1 -0
  103. package/dist/frontend/assets/Webhooks-CrpDmgYf.js +1 -0
  104. package/dist/frontend/assets/Workspace-CPYmh57b.js +1 -0
  105. package/dist/frontend/assets/{aiPreviewModel-gSgeWhaX.js → aiPreviewModel-CCdOgd0j.js} +1 -1
  106. package/dist/frontend/assets/aiPreviewParts-DvLkNJZw.js +1 -0
  107. package/dist/frontend/assets/{apiKeysModel-Pn7Cxpaa.js → apiKeysModel-Ds886u9a.js} +1 -1
  108. package/dist/frontend/assets/auditFormat-DkcEhB6E.js +1 -0
  109. package/dist/frontend/assets/{auditModel-VtcG7xbJ.js → auditModel-Btt_BBhB.js} +1 -1
  110. package/dist/frontend/assets/configEdit-BUcR8Rdh.js +1 -0
  111. package/dist/frontend/assets/eventFlow-B3Lx-Ogd.js +1 -0
  112. package/dist/frontend/assets/health-DFLTZnXO.js +1 -0
  113. package/dist/frontend/assets/index-C96TEx9w.js +28 -0
  114. package/dist/frontend/assets/logFormat-crJLA6Hd.js +1 -0
  115. package/dist/frontend/assets/{mobx-BS2cOtno.js → mobx-P4YDScON.js} +1 -1
  116. package/dist/frontend/assets/{ormConnectorInsights-CKmNqZef.js → ormConnectorInsights-lP0jkfsV.js} +1 -1
  117. package/dist/frontend/assets/profileVisuals-DodchGbL.js +1 -0
  118. package/dist/frontend/assets/stores-59plMWc-.js +1 -0
  119. package/dist/frontend/assets/ui-DL2XgTmu.js +322 -0
  120. package/dist/frontend/assets/useBlockSource-CTef4isR.js +1 -0
  121. package/dist/frontend/assets/{useSocketLiveData-DC2osqZB.js → useSocketLiveData-C39Aqu7R.js} +1 -1
  122. package/dist/frontend/assets/{usersFormat-D6muig0U.js → usersFormat-yj2abAgj.js} +1 -1
  123. package/dist/frontend/index.html +5 -16
  124. package/dist/nodefony/controller/StudioRealtimeController.js +1 -1
  125. package/dist/types/nodefony/controller/StudioRealtimeController.d.ts +1 -1
  126. package/package.json +12 -12
  127. package/dist/frontend/assets/Accordion-DPLwcjdo.js +0 -1
  128. package/dist/frontend/assets/AgentsPreview-Cp3oKlQh.js +0 -12
  129. package/dist/frontend/assets/ApiKeys-Dlm_QgbE.js +0 -2
  130. package/dist/frontend/assets/Audit-l60asEjU.js +0 -1
  131. package/dist/frontend/assets/Breadcrumbs-CInUn91P.js +0 -1
  132. package/dist/frontend/assets/BrickStoreChip-LPzFtCle.js +0 -1
  133. package/dist/frontend/assets/Chat-xbAsLtf7.js +0 -1
  134. package/dist/frontend/assets/Chip-63u3nm6a.js +0 -1
  135. package/dist/frontend/assets/Cluster-BnzcBsK2.js +0 -1
  136. package/dist/frontend/assets/Collapse-D-ll8NHt.js +0 -1
  137. package/dist/frontend/assets/ConfigPage-D5ppGWC2.js +0 -1
  138. package/dist/frontend/assets/ConnectorCard-nuZmjP-K.js +0 -11
  139. package/dist/frontend/assets/Create--I7q2Y8w.js +0 -2
  140. package/dist/frontend/assets/DashboardSupervision-D7iTvKNf.js +0 -1
  141. package/dist/frontend/assets/Database-7pHzPOh2.js +0 -1
  142. package/dist/frontend/assets/Documentation-tjr0i1rN.js +0 -1
  143. package/dist/frontend/assets/Firewall-C6l1OCox.js +0 -1
  144. package/dist/frontend/assets/IconAdjustments-e-MmJIEd.js +0 -1
  145. package/dist/frontend/assets/IconAdjustmentsAlt-Dh7-w67A.js +0 -1
  146. package/dist/frontend/assets/IconAffiliate-CM-xujb3.js +0 -1
  147. package/dist/frontend/assets/IconArchive-Be62Qpuc.js +0 -1
  148. package/dist/frontend/assets/IconArrowsExchange-Dosh8wE8.js +0 -1
  149. package/dist/frontend/assets/IconBan-tceVLRjs.js +0 -1
  150. package/dist/frontend/assets/IconBooks-BsR3SerW.js +0 -1
  151. package/dist/frontend/assets/IconBox-CyPTTK_h.js +0 -1
  152. package/dist/frontend/assets/IconBrain-CtK-z0Qs.js +0 -1
  153. package/dist/frontend/assets/IconCircuitResistor-Dv8iGOzw.js +0 -1
  154. package/dist/frontend/assets/IconNetwork-BCMPgpvp.js +0 -1
  155. package/dist/frontend/assets/IconPackages-CBNINLGq.js +0 -1
  156. package/dist/frontend/assets/IconPlayerPlay-CeEI-a5d.js +0 -1
  157. package/dist/frontend/assets/IconPlus-B4Sx19oD.js +0 -1
  158. package/dist/frontend/assets/KnowledgePreview-COznqEer.js +0 -1
  159. package/dist/frontend/assets/List-Bj6cz52O.js +0 -1
  160. package/dist/frontend/assets/LlmProvidersPreview-UMxVNx56.js +0 -1
  161. package/dist/frontend/assets/LogVisuals-CXlOPxZ6.js +0 -1
  162. package/dist/frontend/assets/Logs-Df5U_3dr.js +0 -1
  163. package/dist/frontend/assets/McpPreview-CHu7On2q.js +0 -1
  164. package/dist/frontend/assets/MemoryPreview-BXeS4rSe.js +0 -1
  165. package/dist/frontend/assets/Migrations-CuHMt_YR.js +0 -3
  166. package/dist/frontend/assets/ModuleDetail-9YIWV_UR.js +0 -1
  167. package/dist/frontend/assets/Modules-ICjDZ1Yo.js +0 -1
  168. package/dist/frontend/assets/OrmConnector-CEarnKy7.js +0 -1
  169. package/dist/frontend/assets/OrmEntity-CnaPZLRa.js +0 -1
  170. package/dist/frontend/assets/OrmOverview-Chuz9Nje.js +0 -1
  171. package/dist/frontend/assets/OrmWorker-DHtNzOdb.js +0 -1
  172. package/dist/frontend/assets/Playground-CPNuVkEh.js +0 -1
  173. package/dist/frontend/assets/Progress-CPoEshia.js +0 -1
  174. package/dist/frontend/assets/RealtimeConsole-Cr9YdudM.js +0 -1
  175. package/dist/frontend/assets/Roadmap-BiASdXjA.js +0 -1
  176. package/dist/frontend/assets/RoleSwitch-v6onvCmL.js +0 -1
  177. package/dist/frontend/assets/Roles-CUb-FE31.js +0 -1
  178. package/dist/frontend/assets/RoutesView-CGimbB-9.js +0 -1
  179. package/dist/frontend/assets/Runtime-CztgXN5v.js +0 -1
  180. package/dist/frontend/assets/Sessions-BW_6RCRC.js +0 -1
  181. package/dist/frontend/assets/Skeleton-BqubVkfg.js +0 -1
  182. package/dist/frontend/assets/Slider-BO4JNkw0.js +0 -1
  183. package/dist/frontend/assets/StoresView-CGJXEbaQ.js +0 -1
  184. package/dist/frontend/assets/System-0WArSNzm.js +0 -1
  185. package/dist/frontend/assets/TagsInput-B3frWkGT.js +0 -1
  186. package/dist/frontend/assets/Timeline-BS9j6buj.js +0 -1
  187. package/dist/frontend/assets/TraceView-C3_Vw0sJ.js +0 -1
  188. package/dist/frontend/assets/Twin-Cjb5ugDT.js +0 -19
  189. package/dist/frontend/assets/UserProfile-Dc-MHueA.js +0 -1
  190. package/dist/frontend/assets/Users-BcoVqTuA.js +0 -1
  191. package/dist/frontend/assets/VectorStoresPreview-tksJNhKy.js +0 -1
  192. package/dist/frontend/assets/Webhooks-vDwD2cQK.js +0 -1
  193. package/dist/frontend/assets/Workspace-DO9hKEhR.js +0 -1
  194. package/dist/frontend/assets/aiPreviewParts-B25TmKBV.js +0 -1
  195. package/dist/frontend/assets/auditFormat-D14fq0tI.js +0 -1
  196. package/dist/frontend/assets/configModel-mJGNa2Qn.js +0 -1
  197. package/dist/frontend/assets/eventFlow-By4EcYar.js +0 -1
  198. package/dist/frontend/assets/health-COCuwYbZ.js +0 -1
  199. package/dist/frontend/assets/hooks-DneHygq8.js +0 -1
  200. package/dist/frontend/assets/index-D7ndDYxA.js +0 -28
  201. package/dist/frontend/assets/profileVisuals-B9NxSpR3.js +0 -1
  202. package/dist/frontend/assets/stores-D6_Y8E6i.js +0 -1
  203. package/dist/frontend/assets/ui-CQg7PBQQ.js +0 -321
  204. package/dist/frontend/assets/useBlockSource-DhXmelWN.js +0 -1
@@ -1,19 +0,0 @@
1
- import{k as e}from"./src-3uYsZQ6M.js";import{$n as t,B as n,Di as r,Dr as i,En as a,F as o,It as s,J as c,Ln as l,Nt as u,Qt as d,Rn as f,Tn as p,V as m,W as h,Y as ee,an as g,cn as _,dn as v,dr as y,hn as b,jt as x,lr as S,lt as te,mt as ne,or as re,q as C,rn as w,sn as ie,tr as ae,wt as T,xn as E,yn as oe}from"./ui-CQg7PBQQ.js";import{t as se}from"./Breadcrumbs-CInUn91P.js";import{T as ce,c as le,p as ue}from"./stores-D6_Y8E6i.js";import{l as de}from"./hooks-DneHygq8.js";import{t as fe}from"./IconArrowsSplit2-2czCcKl1.js";import{t as pe}from"./IconBook-3zpOeyw5.js";import{n as me,t as he}from"./useBlockSource-DhXmelWN.js";import{t as D}from"./IconCircuitResistor-Dv8iGOzw.js";import{t as ge}from"./IconDeviceDesktop-CmA2QS1y.js";import{t as _e}from"./IconSend-zQNYJbkq.js";import{t as O}from"./IconStack2-B9YJBVEL.js";import{$ as k,A as ve,F as ye,M as be,P as A,Q as j,S as xe,St as Se,V as M,dt as Ce,et as we,it as N,lt as Te,ut as Ee,z as De}from"./index-D7ndDYxA.js";import{n as P}from"./realtimeHealth-CEJDxl45.js";import{OrmOverview as Oe}from"./OrmOverview-Chuz9Nje.js";var F=s(`outline`,`atom-2`,`Atom2`,[[`path`,{d:`M9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0`,key:`svg-0`}],[`path`,{d:`M12 21l0 .01`,key:`svg-1`}],[`path`,{d:`M3 9l0 .01`,key:`svg-2`}],[`path`,{d:`M21 9l0 .01`,key:`svg-3`}],[`path`,{d:`M8 20.1a9 9 0 0 1 -5 -7.1`,key:`svg-4`}],[`path`,{d:`M16 20.1a9 9 0 0 0 5 -7.1`,key:`svg-5`}],[`path`,{d:`M6.2 5a9 9 0 0 1 11.4 0`,key:`svg-6`}]]),ke=s(`outline`,`binary-tree-2`,`BinaryTree2`,[[`path`,{d:`M14 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0`,key:`svg-0`}],[`path`,{d:`M7 14a2 2 0 1 0 -4 0a2 2 0 0 0 4 0`,key:`svg-1`}],[`path`,{d:`M21 14a2 2 0 1 0 -4 0a2 2 0 0 0 4 0`,key:`svg-2`}],[`path`,{d:`M14 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0`,key:`svg-3`}],[`path`,{d:`M12 8v8`,key:`svg-4`}],[`path`,{d:`M6.316 12.496l4.368 -4.992`,key:`svg-5`}],[`path`,{d:`M17.684 12.496l-4.366 -4.99`,key:`svg-6`}]]),I=s(`outline`,`cloud-data-connection`,`CloudDataConnection`,[[`path`,{d:`M5 9.897c0 -1.714 1.46 -3.104 3.26 -3.104c.275 -1.22 1.255 -2.215 2.572 -2.611c1.317 -.397 2.77 -.134 3.811 .69c1.042 .822 1.514 2.08 1.239 3.3h.693a2.42 2.42 0 0 1 2.425 2.414a2.42 2.42 0 0 1 -2.425 2.414h-8.315c-1.8 0 -3.26 -1.39 -3.26 -3.103`,key:`svg-0`}],[`path`,{d:`M12 13v3`,key:`svg-1`}],[`path`,{d:`M10 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-2`}],[`path`,{d:`M14 18h7`,key:`svg-3`}],[`path`,{d:`M3 18h7`,key:`svg-4`}]]),Ae=s(`outline`,`router`,`Router`,[[`path`,{d:`M3 15a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -4`,key:`svg-0`}],[`path`,{d:`M17 17l0 .01`,key:`svg-1`}],[`path`,{d:`M13 17l0 .01`,key:`svg-2`}],[`path`,{d:`M15 13l0 -2`,key:`svg-3`}],[`path`,{d:`M11.75 8.75a4 4 0 0 1 6.5 0`,key:`svg-4`}],[`path`,{d:`M8.5 6.5a8 8 0 0 1 13 0`,key:`svg-5`}]]),L=e(r(),1),je=`/nodefony/kernel/api/info`,Me=`/nodefony/kernel/api/modules`,Ne=`/nodefony/realtime/api/health`,Pe=`/nodefony/orm/api/connection/health`;function Fe(){let e=le(),t=(0,L.useCallback)(async()=>{let[t,n,r,i]=await Promise.all([e.api.getAbsolute(je),e.api.getAbsolute(Me),e.api.getAbsolute(Ne).catch(()=>null),e.api.getAbsolute(Pe).catch(()=>[])]);return{info:t,modules:n,normalized:P(r),connectors:i}},[e]);return xe(t)}var R=i(),z={http:{title:`Entrée HTTP`,color:`blue`,icon:()=>(0,R.jsx)(A,{size:20}),href:`/nodefony/routes`},ws:{title:`Entrée WebSocket`,color:`cyan`,icon:()=>(0,R.jsx)(M,{size:20}),href:`/nodefony/hub`},kernel:{title:`Kernel · Pipeline`,color:`indigo`,icon:()=>(0,R.jsx)(F,{size:22}),href:`/nodefony/runtime`},orm:{title:`ORM`,color:`teal`,icon:()=>(0,R.jsx)(k,{size:20}),href:`/nodefony/orm`},connectors:{title:`Connecteurs`,color:`teal`,icon:()=>(0,R.jsx)(De,{size:20}),href:`/nodefony/databases`},realtime:{title:`Realtime Hub`,color:`grape`,icon:()=>(0,R.jsx)(N,{size:20}),href:`/nodefony/hub`},"bp-realtime":{title:`Fond de panier · Realtime`,color:`orange`,icon:()=>(0,R.jsx)(D,{size:20}),href:`/nodefony/cluster`},"bp-logs":{title:`Fond de panier · Logs`,color:`orange`,icon:()=>(0,R.jsx)(j,{size:20}),href:`/nodefony/logs`}};function B(e){return e==null||Number.isNaN(e)?`—`:e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function Ie(e,t,n){let r=e?.totals,i=r?.connectionCount??0,a=r?.orm,o=r?.channelCount??0,s=r?.fanoutTotal??r?.publishTotal??0,c=n>0,l=!!t?.cluster?.isCluster;return{http:{status:c?`ok`:`idle`,pulse:c,metrics:[{label:`événements/8s`,value:B(n)}]},ws:{status:i>0?`ok`:`idle`,pulse:i>0,metrics:[{label:`connexions`,value:B(i)}]},kernel:{status:e?`ok`:`idle`,metrics:[{label:`modules`,value:B(t?.modules)}]},orm:{status:a?a.connected>0?`ok`:`down`:`idle`,pulse:!!a&&a.queryTotal>0,metrics:a?[{label:`requêtes`,value:B(a.queryTotal)},{label:`connectés`,value:`${a.connected}/${a.connectors}`}]:void 0},connectors:{status:a?a.connected>0?`ok`:`down`:`idle`,metrics:a?[{label:`connectés`,value:`${a.connected}/${a.connectors}`}]:void 0},realtime:{status:o>0?`ok`:`idle`,pulse:s>0,metrics:[{label:`canaux`,value:B(o)},{label:`fan-out`,value:B(s)}]},"bp-realtime":{status:e?`ok`:`idle`,metrics:[{label:`mode`,value:l?`cluster`:`loopback`}]},"bp-logs":{status:t?`ok`:`idle`,metrics:[{label:`driver`,value:t?.backplanes?.log?.driver??`—`}]}}}function V(e){return e&&typeof e==`object`?e:{}}function H(e){if(typeof e==`string`)return e;if(typeof e==`number`)return String(e)}function Le(e){let t=V(e),n=V(t.context);return{requestId:H(t.requestId)??H(n.requestId),severity:(H(t.severityName)??H(t.severity)??`info`).toLowerCase(),message:H(t.payload)??H(t.message)??H(t.msg)??``,module:H(t.moduleName)??H(t.module),ts:Date.now()}}var Re=8e3;function U(){let e=(0,L.useRef)([]),[t,n]=(0,L.useState)({count:0,recent:[]});return Te(d.syslog,t=>{let r=Date.now(),i=e.current.filter(e=>r-e.ts<Re);i.push(Le(t)),e.current=i.slice(-80),n({count:e.current.length,recent:e.current.slice(-14).reverse()})}),t}function ze(e){let t=e.toLowerCase();return t.includes(`drizzle`)?`lime`:t.includes(`mongoose`)?`green`:`teal`}function W(e){let t=e.slice(0,4),n=t.length,r=t.map((e,t)=>({id:`conn-${e.name}`,title:e.name,color:ze(e.vendor),icon:(0,R.jsx)(k,{size:18}),pos:{x:n<=1?24:24+(t-(n-1)/2)*14,y:72},info:!0})),i=n===0?[{from:`orm`,to:`ext-db`,cross:!0}]:t.flatMap(e=>[{from:`orm`,to:`conn-${e.name}`},{from:`conn-${e.name}`,to:`ext-db`,cross:!0}]);return{id:`root`,title:`Architecture runtime`,boundaries:[{y:11,label:`Frontière · entrée (clients ↑)`},{y:91,label:`Frontière · sortie (infrastructure ↓)`}],bricks:[{id:`ext-clients`,title:`Clients · navigateurs`,color:`gray`,icon:(0,R.jsx)(ge,{size:16}),pos:{x:50,y:5},external:!0},{id:`http`,title:`Entrée HTTP`,color:`blue`,icon:(0,R.jsx)(A,{size:20}),pos:{x:35,y:18},info:!0,enter:`http-detail`},{id:`ws`,title:`Entrée WebSocket`,color:`cyan`,icon:(0,R.jsx)(M,{size:20}),pos:{x:65,y:18},info:!0},{id:`kernel`,title:`Kernel · Pipeline`,color:`indigo`,icon:(0,R.jsx)(F,{size:22}),pos:{x:50,y:39},emphasis:!0,info:!0,enter:`kernel-detail`},{id:`orm`,title:`ORM`,color:`teal`,icon:(0,R.jsx)(k,{size:20}),pos:{x:24,y:56},info:!0,enter:`orm-view`},{id:`realtime`,title:`Realtime Hub`,color:`grape`,icon:(0,R.jsx)(N,{size:20}),pos:{x:72,y:55},info:!0,enter:`realtime-view`},...r,{id:`bp-realtime`,title:`Fond de panier · Realtime`,color:`orange`,icon:(0,R.jsx)(D,{size:20}),pos:{x:56,y:86},info:!0,enter:`bp-realtime-detail`},{id:`bp-logs`,title:`Fond de panier · Logs`,color:`orange`,icon:(0,R.jsx)(j,{size:20}),pos:{x:79,y:86},info:!0,enter:`bp-logs-detail`},{id:`ext-db`,title:`Bases de données`,color:`gray`,icon:(0,R.jsx)(k,{size:16}),pos:{x:24,y:95},external:!0}],links:[{from:`ext-clients`,to:`http`,cross:!0},{from:`ext-clients`,to:`ws`,cross:!0},{from:`http`,to:`kernel`},{from:`ws`,to:`kernel`},{from:`ws`,to:`realtime`},{from:`kernel`,to:`orm`},{from:`kernel`,to:`realtime`},...i,{from:`realtime`,to:`bp-realtime`},{from:`kernel`,to:`bp-logs`}]}}var Be=[{id:`loopback`,label:`Loopback`,icon:(0,R.jsx)(D,{size:16}),topo:`en mémoire`,external:!1},{id:`ipc`,label:`IPC cluster`,icon:(0,R.jsx)(I,{size:16}),topo:`workers du pod`,external:!1},{id:`redis`,label:`Redis`,icon:(0,R.jsx)(k,{size:16}),topo:`N hôtes`,external:!0},{id:`kafka`,label:`Kafka`,icon:(0,R.jsx)(O,{size:16}),topo:`N hôtes · replay`,external:!0}],Ve=[{id:`stdout`,label:`stdout / console`,icon:(0,R.jsx)(j,{size:16}),topo:`process`,external:!1},{id:`file`,label:`Fichier`,icon:(0,R.jsx)(j,{size:16}),topo:`disque local`,external:!1},{id:`loki`,label:`Loki`,icon:(0,R.jsx)(te,{size:16}),topo:`Grafana`,external:!0},{id:`opensearch`,label:`OpenSearch`,icon:(0,R.jsx)(te,{size:16}),topo:`Kibana`,external:!0}];function He(e,t,n,r){let i=[{...n,pos:{x:50,y:20},enter:void 0}],a=[],o=(e,t,r)=>{let o=e.length;e.forEach((e,s)=>{let c=o<=1?50:18+s/(o-1)*64;i.push({id:`drv-${e.id}`,title:e.label,color:`gray`,icon:e.icon,pos:{x:c,y:t},external:!0}),a.push({from:n.id,to:`drv-${e.id}`,cross:r})})};return o(r.filter(e=>!e.external),47,!1),o(r.filter(e=>e.external),82,!0),{id:e,title:t,boundaries:[{y:64,label:`Frontière du process · infrastructure externe ↓`}],bricks:i,links:a}}function Ue(){return{id:`kernel-detail`,title:`Kernel · Pipeline`,boundaries:[],bricks:[{id:`kernel`,title:`Kernel`,color:`indigo`,icon:(0,R.jsx)(F,{size:22}),pos:{x:50,y:18},emphasis:!0,info:!0},{id:`k-http`,title:`HttpKernel`,color:`blue`,icon:(0,R.jsx)(A,{size:18}),pos:{x:22,y:48}},{id:`k-ws`,title:`WebsocketKernel`,color:`cyan`,icon:(0,R.jsx)(M,{size:18}),pos:{x:50,y:48}},{id:`k-di`,title:`Container DI`,color:`grape`,icon:(0,R.jsx)(D,{size:18}),pos:{x:78,y:48}},{id:`k-router`,title:`Router · Controllers`,color:`teal`,icon:(0,R.jsx)(I,{size:18}),pos:{x:33,y:80}},{id:`k-boot`,title:`Boot · Lifecycle`,color:`orange`,icon:(0,R.jsx)(O,{size:18}),pos:{x:67,y:80}}],links:[{from:`kernel`,to:`k-http`},{from:`kernel`,to:`k-ws`},{from:`kernel`,to:`k-di`},{from:`k-http`,to:`k-router`},{from:`k-di`,to:`k-boot`}]}}function We(){return{id:`http-detail`,title:`Entrée HTTP`,boundaries:[],bricks:[{id:`h-servers`,title:`Serveurs HTTP`,color:`blue`,icon:(0,R.jsx)(A,{size:20}),pos:{x:42,y:9},emphasis:!0},{id:`h-context`,title:`Contexte · requestId`,color:`blue`,icon:(0,R.jsx)(ye,{size:18}),pos:{x:42,y:24}},{id:`h-route`,title:`Route match`,color:`teal`,icon:(0,R.jsx)(Ae,{size:18}),pos:{x:42,y:39}},{id:`h-parse`,title:`Parse du body`,color:`grape`,icon:(0,R.jsx)(O,{size:18}),pos:{x:30,y:55}},{id:`h-firewall`,title:`Firewall · Sécurité`,color:`orange`,icon:(0,R.jsx)(be,{size:18}),pos:{x:30,y:70}},{id:`h-controller`,title:`Controller`,color:`indigo`,icon:(0,R.jsx)(F,{size:18}),pos:{x:30,y:85}},{id:`h-static`,title:`Static · fallback`,color:`gray`,icon:(0,R.jsx)(j,{size:18}),pos:{x:75,y:55}},{id:`h-response`,title:`Réponse`,color:`cyan`,icon:(0,R.jsx)(_e,{size:18}),pos:{x:58,y:92}}],links:[{from:`h-servers`,to:`h-context`},{from:`h-context`,to:`h-route`},{from:`h-route`,to:`h-parse`},{from:`h-parse`,to:`h-firewall`},{from:`h-firewall`,to:`h-controller`},{from:`h-controller`,to:`h-response`},{from:`h-route`,to:`h-static`},{from:`h-static`,to:`h-response`}]}}function Ge(e,t){let n={};for(let r of t){let t=!!e&&r.toLowerCase()===e.toLowerCase();n[`drv-${r}`]={status:t?`ok`:`idle`,pulse:t,metrics:[{label:t?`actif (config)`:`disponible`,value:t?`✓`:`—`}]}}return n}function Ke(e){let t=W([]).bricks.find(t=>t.id===e);if(!t)throw Error(`twin : brique racine « ${e} » introuvable`);return t}function qe(e,t){if(e===`bp-realtime-detail`){let e=Ke(`bp-realtime`),n=t.normalized?.instances[0]?.backplane?.driver;return{schema:He(`bp-realtime-detail`,`Fond de panier · Realtime`,e,Be),live:{...Ge(n,Be.map(e=>e.id)),"bp-realtime":{status:`ok`,metrics:[{label:`driver`,value:n??`loopback`}]}}}}if(e===`bp-logs-detail`){let e=Ke(`bp-logs`),n=t.info?.backplanes?.log?.driver;return{schema:He(`bp-logs-detail`,`Fond de panier · Logs`,e,Ve),live:{...Ge(n,Ve.map(e=>e.id)),"bp-logs":{status:`ok`,metrics:[{label:`driver`,value:n??`—`}]}}}}if(e===`kernel-detail`)return{schema:Ue(),live:{kernel:{status:`ok`,metrics:[{label:`modules`,value:String(t.info?.modules??`—`)}]}}};if(e===`http-detail`){let e=t.activity;return{schema:We(),live:{"h-servers":{status:e>0?`ok`:`idle`,pulse:e>0,metrics:[{label:`événements/8s`,value:String(e)}]}}}}let n={};for(let e of t.connectors.slice(0,5))n[`conn-${e.name}`]={status:e.connected?`ok`:`down`,metrics:[{label:e.vendor,value:e.driver}]};return{schema:W(t.connectors),live:{...Ie(t.normalized,t.info,t.activity),...n}}}function Je(e){return e===`bp-realtime-detail`?`Fond de panier · Realtime`:e===`bp-logs-detail`?`Fond de panier · Logs`:e===`kernel-detail`?`Kernel · Pipeline`:e===`http-detail`?`Entrée HTTP`:e===`realtime-view`?`Realtime Hub`:e===`orm-view`?`Dashboard ORM`:`Architecture runtime`}function Ye(){let e=Ee(d.socket),t=Ce();return{normalized:P(e),clientState:t}}var Xe=(e,t=4,n=96)=>Math.max(t,Math.min(n,e));function Ze(){if(typeof document>`u`||document.getElementById(`nf-twinmap-styles`))return;let e=document.createElement(`style`);e.id=`nf-twinmap-styles`,e.textContent=`
2
- .nf-tm-link { stroke-width: 1.5; vector-effect: non-scaling-stroke; fill: none; opacity: .42; }
3
- .nf-tm-link.is-cross { stroke-dasharray: 2 3; opacity: .28; }
4
- .nf-tm-link.is-live { stroke-dasharray: 3 5; animation: nf-tm-flow 1.1s linear infinite; opacity: .7; }
5
- @keyframes nf-tm-flow { to { stroke-dashoffset: -8; } }
6
- .nf-tm-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; transition: background-color .25s ease, opacity .25s ease; }
7
- .nf-tm-dot.is-ok { background: var(--mantine-color-teal-5); }
8
- .nf-tm-dot.is-warn { background: var(--mantine-color-yellow-5); }
9
- .nf-tm-dot.is-down { background: var(--mantine-color-red-5); }
10
- .nf-tm-dot.is-idle { background: var(--mantine-color-gray-5); opacity: .5; }
11
- .nf-tm-dot.is-pulse { animation: nf-tm-pulse 2.4s ease-in-out infinite; }
12
- @keyframes nf-tm-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
13
- .nf-tm-brick { cursor: pointer; text-align: left; background: none; border: none; padding: 0; display: block; }
14
- .nf-tm-brick:focus-visible { outline: 2px solid var(--mantine-color-blue-5); outline-offset: 3px; border-radius: 12px; }
15
- @media (prefers-reduced-motion: reduce) {
16
- .nf-tm-link.is-live { animation: none; }
17
- .nf-tm-dot.is-pulse { animation: none; opacity: 1; }
18
- }
19
- `,document.head.appendChild(e)}var G=(e,t)=>`var(--mantine-color-${e}-${t})`;function Qe({brick:e,pos:n,live:r,liveOn:i,containerRef:a,onMove:o,onEnter:s,onInfo:c}){let l=r?.metrics?.[0],u=(0,L.useRef)(null),d=()=>e.enter?s(e.enter):c(e.id);return(0,R.jsx)(y,{role:`button`,tabIndex:0,className:`nf-tm-brick`,onPointerDown:e=>{e.button===0&&(u.current={sx:e.clientX,sy:e.clientY,ox:n.x,oy:n.y,moved:!1},e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:t=>{let n=u.current,r=a.current?.getBoundingClientRect();n&&r&&((Math.abs(t.clientX-n.sx)>4||Math.abs(t.clientY-n.sy)>4)&&(n.moved=!0),n.moved&&o(e.id,Xe(n.ox+(t.clientX-n.sx)/r.width*100),Xe(n.oy+(t.clientY-n.sy)/r.height*100)))},onPointerUp:e=>{let t=u.current;u.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}t&&!t.moved&&d()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d())},"aria-label":`${e.title}${e.enter?` — entrer dans le détail`:` — ouvrir la fiche`}`,style:{position:`absolute`,left:`${n.x}%`,top:`${n.y}%`,transform:`translate(-50%,-50%)`,zIndex:2,cursor:`grab`,touchAction:`none`},children:(0,R.jsx)(re,{radius:`md`,p:`xs`,withBorder:!0,style:{width:e.emphasis?188:162,borderColor:G(e.color,5),borderWidth:e.emphasis?2:1,background:`color-mix(in srgb, ${G(e.color,6)} 14%, var(--mantine-color-body))`,boxShadow:e.emphasis?`0 0 0 3px color-mix(in srgb, ${G(e.color,6)} 20%, transparent)`:void 0},children:(0,R.jsxs)(t,{gap:8,wrap:`nowrap`,align:`flex-start`,children:[(0,R.jsx)(w,{variant:`light`,color:e.color,size:e.emphasis?34:28,radius:`md`,style:{flexShrink:0},children:e.icon}),(0,R.jsxs)(y,{style:{minWidth:0,flex:1},children:[(0,R.jsxs)(t,{gap:4,wrap:`nowrap`,justify:`space-between`,children:[(0,R.jsx)(f,{fw:700,size:`sm`,lh:1.15,lineClamp:1,children:e.title}),(0,R.jsxs)(t,{gap:4,wrap:`nowrap`,style:{flexShrink:0},children:[r?(0,R.jsx)(`span`,{className:`nf-tm-dot is-${r.status??`idle`}${i&&r.pulse?` is-pulse`:``}`,"aria-hidden":!0}):null,e.info?(0,R.jsx)(v,{label:`Explications & docs`,withArrow:!0,children:(0,R.jsx)(ae,{size:`sm`,variant:`subtle`,color:`gray`,"aria-label":`Explications : ${e.title}`,onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),c(e.id)},children:(0,R.jsx)(ne,{size:15})})}):null]})]}),(0,R.jsxs)(t,{gap:4,wrap:`nowrap`,justify:`space-between`,children:[l?(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,lineClamp:1,style:{fontVariantNumeric:`tabular-nums`},children:[l.label,` : `,(0,R.jsx)(`b`,{children:l.value})]}):(0,R.jsx)(`span`,{}),e.enter?(0,R.jsxs)(t,{gap:2,wrap:`nowrap`,style:{flexShrink:0},children:[(0,R.jsx)(f,{size:`10px`,c:e.color,fw:600,children:`creuser`}),(0,R.jsx)(T,{size:12,color:`var(--mantine-color-${e.color}-5)`})]}):null]})]})]})})})}function $e({brick:e,live:n}){let r=n?.status===`ok`;return(0,R.jsx)(y,{style:{position:`absolute`,left:`${e.pos.x}%`,top:`${e.pos.y}%`,transform:`translate(-50%,-50%)`,zIndex:2},children:(0,R.jsxs)(t,{gap:6,wrap:`nowrap`,px:`xs`,py:4,style:{border:`1px ${r?`solid`:`dashed`} ${r?G(e.color===`gray`?`teal`:e.color,5):`var(--mantine-color-dimmed)`}`,borderRadius:999,opacity:r?1:.6,background:r?`color-mix(in srgb, var(--mantine-color-teal-6) 10%, var(--mantine-color-body))`:void 0},children:[(0,R.jsx)(w,{variant:`transparent`,color:r?`teal`:`gray`,size:18,children:e.icon}),(0,R.jsxs)(y,{children:[(0,R.jsx)(f,{size:`xs`,c:r?void 0:`dimmed`,fw:r?600:400,children:e.title}),n?.metrics?.[0]?(0,R.jsx)(f,{size:`9px`,c:`dimmed`,lh:1,children:n.metrics[0].label}):null]})]})})}function et({y:e,label:t}){return(0,R.jsx)(y,{style:{position:`absolute`,left:0,right:0,top:`${e}%`,borderTop:`1px dashed var(--mantine-color-default-border)`,zIndex:1,pointerEvents:`none`},children:(0,R.jsx)(f,{size:`10px`,c:`dimmed`,tt:`uppercase`,fw:600,style:{position:`absolute`,left:16,top:-8,background:`var(--mantine-color-body)`,padding:`0 6px`,letterSpacing:.6},children:t})})}function tt({schema:e,liveNodeData:t,live:n,height:r,onEnter:i,onInfo:a}){(0,L.useEffect)(()=>Ze(),[]);let o=(0,L.useRef)(null),[s,c]=(0,L.useState)({});(0,L.useEffect)(()=>c({}),[e.id]);let l=t=>s[t]??e.bricks.find(e=>e.id===t)?.pos??{x:50,y:50},u=(0,L.useCallback)((e,t,n)=>c(r=>({...r,[e]:{x:t,y:n}})),[]);return(0,R.jsxs)(y,{ref:o,role:`img`,"aria-label":`Carte d'architecture : ${e.title}`,style:{position:`relative`,height:r,borderRadius:12,border:`1px solid var(--mantine-color-default-border)`,overflow:`hidden`,background:`radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--mantine-color-indigo-9) 14%, var(--mantine-color-body)) 0%, var(--mantine-color-body) 60%)`,contain:`content`},children:[(0,R.jsx)(`svg`,{width:`100%`,height:`100%`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,style:{position:`absolute`,inset:0,zIndex:0},"aria-hidden":!0,children:e.links.map((e,t)=>{let r=l(e.from),i=l(e.to);return(0,R.jsx)(`line`,{x1:r.x,y1:r.y,x2:i.x,y2:i.y,className:`nf-tm-link${e.cross?` is-cross`:``}${n&&!e.cross?` is-live`:``}`,stroke:`var(--mantine-color-blue-4)`},t)})}),e.boundaries.map((e,t)=>(0,R.jsx)(et,{y:e.y,label:e.label},t)),e.bricks.map(e=>e.external?(0,R.jsx)($e,{brick:e,live:t?.[e.id]},e.id):(0,R.jsx)(Qe,{brick:e,pos:l(e.id),live:t?.[e.id],liveOn:n,containerRef:o,onMove:u,onEnter:i,onInfo:a},e.id))]})}function nt({schemaId:e,info:t,connectors:n,snapshot:r,height:i,onEnter:a,onInfo:o}){let s=Ye(),c=U(),{schema:l,live:u}=qe(e,{info:t,normalized:s.normalized??r,activity:c.count,connectors:n});return(0,R.jsx)(tt,{schema:l,liveNodeData:u,live:!0,height:i,onEnter:a,onInfo:o})}function rt({schemaId:e,info:t,connectors:n,snapshot:r,live:i,height:a,onEnter:o,onInfo:s}){if(i)return(0,R.jsx)(nt,{schemaId:e,info:t,connectors:n,snapshot:r,height:a,onEnter:o,onInfo:s});let{schema:c,live:l}=qe(e,{info:t,normalized:r,activity:0,connectors:n});return(0,R.jsx)(tt,{schema:c,liveNodeData:l,live:!1,height:a,onEnter:o,onInfo:s})}function it({def:e,ctx:t,span:n=12,container:r=`dialog`}){let i=me(e.source,t.live);return(0,R.jsx)(he,{def:e,state:i,ctx:t,span:n,container:r})}function K(e){return e==null||Number.isNaN(e)?`—`:e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function q(e){return e?e<1024?`${e} o`:e<1048576?`${(e/1024).toFixed(1)} Ko`:`${(e/1024/1024).toFixed(1)} Mo`:`—`}function at(e){if(!e)return`—`;if(e<60)return`${Math.round(e)}s`;if(e<3600)return`${Math.floor(e/60)}min`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60);return n?`${t}h${n}`:`${t}h`}function ot(e){return/(emerg|alert|crit|error|err)/.test(e)?`red`:e.includes(`warn`)?`yellow`:/(notice|info)/.test(e)?`blue`:`gray`}function st(e){let t=e.toLowerCase();return t.includes(`drizzle`)?`lime`:t.includes(`mongoose`)?`green`:`teal`}function ct({href:e,label:t,icon:n,onClose:r}){let i=de();return(0,R.jsx)(p,{variant:`light`,size:`xs`,leftSection:n,rightSection:n?void 0:(0,R.jsx)(u,{size:14}),onClick:()=>{r(),i(e)},children:t})}function lt({onClose:e}){let n=de(),{count:r,recent:i}=U();return(0,R.jsxs)(_,{gap:`sm`,children:[(0,R.jsx)(t,{gap:`xs`,children:(0,R.jsxs)(a,{color:r>0?`teal`:`gray`,variant:`light`,leftSection:(0,R.jsx)(x,{size:12}),children:[r,` événement(s) / 8 s`]})}),(0,R.jsx)(f,{size:`sm`,fw:600,children:`Requêtes récentes`}),(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[`Chaque ligne porte son `,(0,R.jsx)(E,{children:`requestId`}),` — cliquez-le pour suivre la requête de bout en bout.`]}),(0,R.jsx)(S.Autosize,{mah:300,children:(0,R.jsx)(_,{gap:6,children:i.length===0?(0,R.jsx)(f,{size:`sm`,c:`dimmed`,children:`En attente d'activité… (le trafic arrive ici en direct)`}):i.map((r,i)=>(0,R.jsxs)(t,{gap:6,wrap:`nowrap`,align:`flex-start`,children:[(0,R.jsx)(a,{size:`xs`,color:ot(r.severity),variant:`light`,style:{flexShrink:0},children:r.severity}),r.requestId?(0,R.jsx)(E,{style:{cursor:`pointer`,flexShrink:0},onClick:()=>{e(),n(`/nodefony/logs/trace/${encodeURIComponent(r.requestId)}`)},children:r.requestId.slice(0,8)}):(0,R.jsx)(E,{c:`dimmed`,style:{flexShrink:0},children:`—`}),(0,R.jsx)(f,{size:`xs`,lineClamp:2,style:{minWidth:0},children:r.message||(0,R.jsx)(`span`,{style:{opacity:.5},children:`(sans message)`})})]},`${r.requestId??`x`}-${i}`))})})]})}function ut({totals:e}){return(0,R.jsxs)(_,{gap:`sm`,children:[(0,R.jsxs)(n,{children:[(0,R.jsx)(m,{k:`Connexions WS`,v:K(e?.connectionCount)}),(0,R.jsx)(m,{k:`Canaux abonnés`,v:K(e?.channelCount)}),(0,R.jsx)(m,{k:`Messages émis`,v:K(e?.messagesSentTotal)}),(0,R.jsx)(m,{k:`Octets émis`,v:q(e?.bytesSentTotal)}),(0,R.jsx)(m,{k:`Entrants (inbound)`,v:K(e?.inboundTotal)})]}),(0,R.jsx)(f,{size:`xs`,c:`dimmed`,children:`Le WebSocket est full-duplex : il alimente le Realtime Hub (la Socket Nodefony) qui fan-out vers les abonnés.`})]})}function dt({info:e}){return(0,R.jsxs)(_,{gap:`sm`,children:[(0,R.jsxs)(n,{children:[(0,R.jsx)(m,{k:`Version`,v:e?.version??`—`,mono:!0}),(0,R.jsx)(m,{k:`Environnement`,v:e?.environment??`—`}),(0,R.jsx)(m,{k:`Uptime`,v:at(e?.uptime)}),(0,R.jsx)(m,{k:`PID`,v:e?String(e.pid):`—`,mono:!0}),(0,R.jsx)(m,{k:`Node`,v:e?.node??`—`,mono:!0}),(0,R.jsx)(m,{k:`Modules chargés`,v:K(e?.modules)}),e?.git?.branch?(0,R.jsx)(m,{k:`Git`,v:`${e.git.branch} · ${e.git.commit??``}`,mono:!0}):null]}),(0,R.jsx)(f,{size:`xs`,c:`dimmed`,children:`Le kernel route chaque requête vers son controller, orchestre le boot et héberge les services (DI).`})]})}function ft({totals:e}){let r=e?.orm;return r?(0,R.jsxs)(_,{gap:`sm`,children:[(0,R.jsx)(t,{gap:`xs`,children:(0,R.jsxs)(a,{color:r.connected>0?`teal`:`red`,variant:`light`,children:[r.connected,`/`,r.connectors,` connecteur(s)`]})}),(0,R.jsxs)(n,{children:[(0,R.jsx)(m,{k:`Requêtes (total)`,v:K(r.queryTotal)}),(0,R.jsx)(m,{k:`Lentes`,v:K(r.slowTotal)}),(0,R.jsx)(m,{k:`Erreurs`,v:K(r.errorTotal)}),(0,R.jsx)(m,{k:`Reconnexions`,v:K(r.reconnectTotal)}),(0,R.jsx)(m,{k:`Latence EWMA max`,v:r.maxEwmaMs==null?`—`:`${r.maxEwmaMs.toFixed(2)} ms`})]}),(0,R.jsx)(f,{size:`xs`,c:`dimmed`,children:`Le pipeline touche l'ORM pour chaque requête base ; les connecteurs portent les connexions réelles aux bases.`})]}):(0,R.jsxs)(f,{size:`sm`,c:`dimmed`,children:[`Aucun flux ORM remonté. En production, activez la sonde de flux (`,(0,R.jsx)(E,{children:`NF_ORM_FLOW=1`}),`).`]})}function pt({connector:e}){return(0,R.jsxs)(_,{gap:`sm`,children:[(0,R.jsxs)(t,{gap:`xs`,children:[(0,R.jsx)(a,{color:e.connected?`teal`:`red`,variant:`light`,children:e.connected?`connecté`:`déconnecté`}),(0,R.jsx)(a,{color:st(e.vendor),variant:`light`,children:e.vendor})]}),(0,R.jsxs)(n,{children:[(0,R.jsx)(m,{k:`Nom`,v:e.name,mono:!0}),(0,R.jsx)(m,{k:`Driver`,v:e.driver,mono:!0}),(0,R.jsx)(m,{k:`Cible`,v:e.target,mono:!0}),(0,R.jsx)(m,{k:`Version`,v:e.version,mono:!0})]}),(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[`Connecteur de base géré par l'ORM `,(0,R.jsx)(`b`,{children:e.vendor}),` via le driver `,(0,R.jsx)(E,{children:e.driver}),`.`]})]})}function mt({norm:e}){let r=e?.totals,i=(0,L.useMemo)(()=>{let t=new Map;for(let n of e?.instances??[])for(let e of n.channels){let n=t.get(e.channel)??{subscribers:0,messages:0};n.subscribers+=e.subscribers,n.messages+=e.messages,t.set(e.channel,n)}return[...t.entries()].sort((e,t)=>t[1].messages-e[1].messages)},[e]);return(0,R.jsxs)(_,{gap:`sm`,children:[(0,R.jsxs)(n,{children:[(0,R.jsx)(m,{k:`Canaux actifs`,v:K(r?.channelCount)}),(0,R.jsx)(m,{k:`Fan-out (total)`,v:K(r?.fanoutTotal)}),(0,R.jsx)(m,{k:`Connexions`,v:K(r?.connectionCount)}),(0,R.jsx)(m,{k:`Backpressure`,v:`${q(r?.backpressure.totalBufferedAmount)} · ${r?.backpressure.slowConsumers??0} lents`})]}),(0,R.jsxs)(f,{size:`sm`,fw:600,children:[`Canaux (`,i.length,`)`]}),(0,R.jsx)(S.Autosize,{mah:220,children:(0,R.jsx)(_,{gap:4,children:i.map(([e,n])=>(0,R.jsxs)(t,{justify:`space-between`,gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(E,{style:{minWidth:0},children:e}),(0,R.jsxs)(t,{gap:6,wrap:`nowrap`,style:{flexShrink:0},children:[(0,R.jsxs)(a,{size:`xs`,variant:`light`,color:`grape`,children:[n.subscribers,` ab.`]}),(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[K(n.messages),` msg`]})]})]},e))})})]})}var J=`v1.0`,Y=`/nodefony/documentation?doc=mod~realtime~configuration`,X=`/nodefony/documentation?doc=mod~realtime~securite`;function Z({label:e,hint:n}){return(0,R.jsxs)(t,{gap:6,wrap:`nowrap`,children:[(0,R.jsx)(`span`,{children:e}),n]})}function ht({norm:e,cluster:t}){let r=e?.instances[0]?.backplane,i=e?.totals.ingressRejectedTotal??0,a=r?.driver??(t?`ipc`:`loopback`),o=r?.channel,s=r?.crossPod===!0,c=r?.sealed===!0,l=r?.queue,u=l?.droppedTotal??0;return(0,R.jsxs)(_,{gap:`sm`,children:[(0,R.jsxs)(n,{children:[(0,R.jsx)(m,{k:(0,R.jsx)(Z,{label:`Driver`,hint:(0,R.jsx)(h,{title:`Le fil qui relie les processus`,version:J,summary:`Ce processus relaie ses publications par « ${a} ». Sans fil, un message publié ici n'atteindrait que les navigateurs connectés à CE processus.`,sections:[{label:`Les trois fils natifs`,body:`« loopback » : aucun relais, un seul processus. « cluster » : liaison interne entre les workers d'une même machine. « redis » : publication/abonnement entre machines distinctes.`},{label:`Si la valeur surprend`,body:"Le fil se choisit à la configuration (`backplane.driver`) et peut être imposé au déploiement par NF_REALTIME_DRIVER. Un nom inconnu au démarrage laisse le hub local, avec un avertissement dans le journal."}],links:[{label:`Configuration du temps réel`,href:Y}]})}),v:a,mono:!0}),(0,R.jsx)(m,{k:`Portée`,v:r?.kind??(t?`cluster`:`local`)}),(0,R.jsx)(m,{k:(0,R.jsx)(Z,{label:`Cross-pod`,hint:(0,R.jsx)(h,{title:`Jusqu'où porte le relais`,version:J,summary:s?`Oui : le relais franchit les frontières de machine — d'autres hôtes reçoivent ce qui est publié ici.`:`Non : le relais ne sort pas de cette machine (un seul processus, ou des workers locaux).`,sections:[{label:`Pourquoi ça change tout`,body:`Un relais qui sort de la machine passe par une infrastructure partagée, que d'autres peuvent atteindre. C'est là que le scellement des messages devient nécessaire — et c'est pourquoi il n'est pas demandé sur une liaison interne.`}],links:[{label:`Architecture du temps réel`,href:Y}]})}),v:s?`oui`:`non`}),o?(0,R.jsx)(m,{k:(0,R.jsx)(Z,{label:`Canal`,hint:(0,R.jsx)(h,{title:`Sur quel bus ce processus est branché`,version:J,summary:`Le transport publie et écoute sur « ${o} ». Tout ce qui passe par ce nom est reçu par tous les processus qui l'écoutent, et par eux seuls.`,sections:[{label:`À quoi ça sert de le voir`,body:`C'est la seule façon de répondre à « suis-je sur le bus que je crois ? ». Deux déploiements d'une même application (préproduction et production) qui partagent une infrastructure portent le même nom dérivé : sans cloison explicite, ils s'échangent leurs diffusions.`},{label:`Comment le changer`,body:"Par la cloison `backplane.namespace`, ou au déploiement par NF_REALTIME_BACKPLANE_NAMESPACE. Le nom affiché ici est celui réellement utilisé, pas celui qui est écrit dans la configuration."}],links:[{label:`La cloison, clé par clé`,href:Y},{label:`Ce que le bus ne défend pas`,href:X}]})}),v:o,mono:!0}):null,s?(0,R.jsx)(m,{k:(0,R.jsx)(Z,{label:`Messages scellés`,hint:c?(0,R.jsx)(h,{title:`Les messages portent une signature`,version:J,summary:`Chaque message publié sur ce bus est signé, et ce processus rejette tout message dont la signature est absente ou fausse.`,sections:[{label:`Ce que ça empêche`,body:`Une infrastructure de diffusion ne vérifie pas qui publie. Sans signature, quiconque peut y écrire — autre application, identifiant fuité — diffuse ce qu'il veut sur vos canaux, sur tous vos processus à la fois.`},{label:`La condition`,body:`Le secret doit être IDENTIQUE sur tous les processus de l'application. S'il diverge, plus rien ne passe entre eux et le compteur de messages refusés reste à zéro : le trafic est écarté avant même l'examen du canal.`}],links:[{label:`Sécurité du temps réel`,href:X},{label:`Poser le secret`,href:Y}]}):(0,R.jsx)(C,{title:`Bus ouvert — aucune signature`,summary:`Les messages circulent sans preuve d'origine : quiconque peut écrire sur cette infrastructure publie sur vos canaux, sur tous vos processus.`,sections:[{label:`Ce qui reste protégé`,body:`Les canaux internes (journaux, audit, santé) restent hors d'atteinte : seuls les canaux explicitement diffusables sont acceptés depuis le bus. L'injection est donc bornée aux canaux applicatifs.`},{label:`Comment fermer`,body:"Poser `backplane.secret`, ou NF_REALTIME_BACKPLANE_SECRET au déploiement — au moins 32 caractères, le même partout. Le démarrage signale ce mode ouvert par un avertissement."}]})}),v:c?`oui`:`NON — bus ouvert`}):null,(0,R.jsx)(m,{k:(0,R.jsx)(Z,{label:`Messages du bus refusés`,hint:(0,R.jsx)(h,{title:`Messages venus du bus et jetés`,version:J,summary:i===0?`Zéro : aucun message étranger n'a tenté d'atteindre un canal interdit de circulation. C'est la valeur normale.`:`${i} message(s) reçus du bus visaient un canal qui n'a pas le droit de circuler entre processus. Ils ont été comptés puis jetés.`,sections:[{label:`Ce qui est refusé`,body:`Un canal ne franchit la frontière du processus que s'il est déclaré diffusable. Les canaux internes — journaux, audit, santé — décrivent CE processus : les faire voyager n'aurait aucun sens, et permettrait d'y injecter de fausses lignes.`},{label:`Si ce n'est pas zéro`,body:`Deux explications. Bénigne : une autre application partage la même cloison et ses canaux sont refusés — chacun chez soi. Sérieuse : quelqu'un écrit sur votre bus. Le nom du canal visé n'est pas exposé ici, volontairement : un compteur ne doit pas devenir un moyen de sonder ce que le système accepte.`},{label:`Ce que ce compteur ne voit pas`,body:`Les messages rejetés PLUS TÔT, faute de signature valide, ne sont pas comptés ici : ils sont écartés par le transport avant d'atteindre le hub.`}],links:[{label:`Sécurité du temps réel`,href:X}]})}),v:K(i)}),l?(0,R.jsx)(m,{k:(0,R.jsx)(Z,{label:`File d'envoi vers le bus`,hint:u===0?(0,R.jsx)(h,{title:`Ce qui attend d'être remis au bus`,version:J,summary:`${q(l.bytes)} en attente d'accusé de réception. Au-delà de ${q(l.maxBytes)}, les publications suivantes sont abandonnées plutôt que de s'empiler.`,sections:[{label:`Pourquoi une limite`,body:`Publier n'attend pas : le message est confié au bus et le code continue. Si le bus ralentit, les messages s'accumulent en mémoire — sans plafond, une rafale peut faire enfler le processus jusqu'à l'étouffement.`},{label:`Ce qui se passe à la limite`,body:`Les publications sont abandonnées et comptées ici : le processus reste debout, mais les autres processus ne reçoivent pas ces messages-là. Les pages connectées se resynchronisent d'elles-mêmes à la reprise.`},{label:`Régler le plafond`,body:"Par `backplane.maxQueueBytes`. La valeur 0 lève toute limite — la mémoire n'est alors plus protégée du tout."}],links:[{label:`Configuration`,href:Y}]}):(0,R.jsx)(C,{title:`Le bus n'a pas suivi — des messages ont été abandonnés`,summary:`${u} publication(s) n'ont pas été remises aux autres processus : la file avait atteint son plafond de ${q(l.maxBytes)}.`,sections:[{label:`Ce que ça veut dire`,body:`Le bus n'accuse plus réception assez vite : soit il est lent ou injoignable, soit cette application publie plus que le lien ne peut porter. La mémoire du processus a été préservée au prix de ces messages.`},{label:`Quoi regarder`,body:`L'état du serveur de bus et sa latence d'abord ; le volume publié ensuite. Relever le plafond ne fait que retarder le problème si le bus reste en retard.`}]})}),v:u===0?`${q(l.bytes)} en attente`:`${K(u)} abandonnée(s)`}):null]}),(0,R.jsx)(f,{size:`xs`,c:`dimmed`,children:`Le fond de panier relie les processus : un message publié sur l'un est relayé aux autres. Survolez un libellé pour savoir ce qu'il décrit.`})]})}function gt({info:e}){let t=e?.backplanes?.log;return(0,R.jsxs)(_,{gap:`sm`,children:[(0,R.jsxs)(n,{children:[(0,R.jsx)(m,{k:`Driver`,v:t?.driver??`—`,mono:!0}),(0,R.jsx)(m,{k:`Sortie (sink)`,v:t?.sink??`—`,mono:!0})]}),(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[`Le backplane de logs collecte chaque Pdu et le diffuse (console, fichier, Loki, OpenSearch…) sans coupler le code à la destination.`,` `,(0,R.jsx)(E,{children:`nodefony:syslog`}),` en est la prise temps réel.`]})]})}function _t(e,t){if(e.startsWith(`conn-`)){let n=t.find(t=>`conn-${t.name}`===e);return n?{title:n.name,color:st(n.vendor),icon:()=>(0,R.jsx)(k,{size:20}),href:`/nodefony/orm`}:null}return e in z?z[e]:null}function vt({nodeId:e,info:t,connectors:n,onClose:r}){let i=Ye().normalized,a=i?.totals;if(e.startsWith(`conn-`)){let t=n.find(t=>`conn-${t.name}`===e);return t?(0,R.jsx)(pt,{connector:t}):null}switch(e){case`http`:return(0,R.jsx)(lt,{onClose:r});case`ws`:return(0,R.jsx)(ut,{totals:a});case`kernel`:return(0,R.jsx)(dt,{info:t});case`orm`:case`connectors`:return(0,R.jsx)(ft,{totals:a});case`realtime`:{let e=ue(`realtime.hub`);return e?(0,R.jsx)(it,{def:e,ctx:{live:!0,cluster:!!i?.cluster,instanceCount:i?.instances.length??1,roles:[]},container:`dialog`}):(0,R.jsx)(mt,{norm:i})}case`bp-realtime`:return(0,R.jsx)(ht,{norm:i,cluster:!!t?.cluster?.isCluster});case`bp-logs`:{let e=ue(`logs.backplane`);return e?(0,R.jsx)(it,{def:e,ctx:{live:!1,cluster:!!i?.cluster,instanceCount:i?.instances.length??1,roles:[]},container:`dialog`}):(0,R.jsx)(gt,{info:t})}default:return null}}function yt({nodeId:e,info:n,connectors:r,onClose:i}){let o=e?_t(e,r):null;return(0,R.jsx)(b,{opened:e!==null&&o!==null,onClose:i,size:`lg`,centered:!0,radius:`md`,title:o?(0,R.jsxs)(t,{gap:`xs`,children:[(0,R.jsx)(w,{variant:`light`,color:o.color,radius:`md`,children:o.icon()}),(0,R.jsx)(f,{fw:700,children:o.title}),(0,R.jsx)(a,{size:`xs`,color:`teal`,variant:`dot`,children:`en direct`})]}):null,children:e&&o?(0,R.jsxs)(_,{gap:`sm`,children:[(0,R.jsx)(vt,{nodeId:e,info:n,connectors:r,onClose:i}),(0,R.jsx)(oe,{my:4,label:`Liens & docs`,labelPosition:`left`}),(0,R.jsxs)(t,{gap:`xs`,children:[(0,R.jsx)(ct,{href:o.href,label:`Page dédiée`,onClose:i}),(0,R.jsx)(ct,{href:`/nodefony/documentation`,label:`Documentation`,icon:(0,R.jsx)(pe,{size:14}),onClose:i})]}),(0,R.jsx)(f,{size:`10px`,c:`dimmed`,children:`Bientôt : extraits de doc ciblés tirés du portail, directement ici.`})]}):null})}var bt=560,xt={architecture:(0,R.jsx)(N,{size:15}),"fan-out":(0,R.jsx)(fe,{size:15}),backplane:(0,R.jsx)(D,{size:15}),protocole:(0,R.jsx)(ke,{size:15}),probes:(0,R.jsx)(ce,{size:15}),actions:(0,R.jsx)(x,{size:15})},Q=o;function St({live:e}){let[t,n]=(0,L.useState)(Q[0]?.name??``);return(0,R.jsxs)(g,{value:t,onChange:e=>n(e??Q.at(0)?.name??``),children:[(0,R.jsx)(g.List,{mb:`md`,children:Q.map(e=>(0,R.jsx)(g.Tab,{value:e.name,leftSection:xt[e.name]??(0,R.jsx)(N,{size:15}),children:e.label},e.name))}),Q.map(n=>{let r=n.component;return(0,R.jsx)(g.Panel,{value:n.name,children:t===n.name?(0,R.jsx)(L.Suspense,{fallback:(0,R.jsx)(f,{size:`sm`,c:`dimmed`,py:`xl`,children:`Chargement du schéma…`}),children:(0,R.jsx)(r,{live:e,height:bt})}):null},n.name)})]})}var Ct=`v1.3`,$=Se(()=>{let{data:e,loading:n,error:r,reload:i}=Fe(),[o,s]=(0,L.useState)(!0),[u,d]=(0,L.useState)([`root`]),[f,p]=(0,L.useState)(null),m=e?.info??null,g=e?.connectors??[],_=e?.normalized??null,v=u.at(-1)??`root`,y=!!e?.normalized?.cluster&&e.normalized.instances.length>1,b=e?.normalized?.instances.length??0,x=u.length>1,S={"realtime-view":(0,R.jsx)(St,{live:o}),"orm-view":(0,R.jsx)(Oe,{embedded:!0})};return(0,R.jsxs)(ee,{icon:(0,R.jsx)(ve,{size:22}),title:`Carte du serveur`,subtitle:`Votre serveur en train de tourner, vu d'un coup d'œil : les requêtes entrent par le haut, traversent le cœur, atteignent les bases et services en bas. Cliquez sur un élément pour zoomer, ⓘ pour une explication.`,actions:(0,R.jsxs)(t,{gap:`xs`,children:[y?(0,R.jsxs)(a,{variant:`light`,color:`grape`,leftSection:(0,R.jsx)(we,{size:12}),children:[`Cluster · `,b,` workers`]}):null,(0,R.jsx)(h,{title:`Carte du serveur`,version:Ct,summary:`Une vue vivante de l'architecture de votre serveur en train de tourner — pour comprendre, en un coup d'œil, par où passe une requête. Aussi appelée « jumeau numérique » (digital twin).`,sections:[{label:`À quoi ça sert`,body:`Voir comment votre serveur est construit et ce qu'il fait en direct : quels éléments le composent, comment une requête les traverse, et lesquels sont actifs maintenant.`},{label:`Lire la carte`,body:`En haut : les clients (navigateurs, autres services). Au centre : le cœur du serveur, qui reçoit et traite. En bas : les bases de données et services externes (Redis, Kafka, Loki, OpenSearch). Les pointillés = la limite de votre serveur (au-dessus/en dessous = hors de lui, reliés par configuration).`},{label:`Deux gestes`,body:`Cliquer sur un élément = zoomer dedans (on entre dans son détail ; le fil d'Ariane en haut permet de revenir). Icône ⓘ = une explication (à quoi il sert + liens vers la doc).`},{label:`Temps réel`,body:`Activé par défaut : les liens s'animent quand des données circulent et les éléments montrent leur activité (connexions, requêtes, canaux). Coupez l'interrupteur « Temps réel » pour figer l'image.`}]}),(0,R.jsx)(ie,{size:`sm`,checked:o,onChange:e=>s(e.currentTarget.checked),label:`Temps réel`,"aria-label":`Activer le temps réel sur la carte du serveur`})]}),children:[x?(0,R.jsx)(se,{separator:(0,R.jsx)(T,{size:14}),children:u.map((e,t)=>(0,R.jsx)(l,{onClick:()=>d(e=>e.slice(0,t+1)),c:t===u.length-1?void 0:`dimmed`,fw:t===u.length-1?600:400,children:Je(e)},`${e}-${t}`))}):null,(0,R.jsx)(c,{loading:n&&!e,error:r,onRetry:i,minHeight:420,children:e?S[v]??(0,R.jsx)(rt,{schemaId:v,info:m,connectors:g,snapshot:_,live:o,height:x?`calc(100dvh - var(--app-shell-header-height, 56px) - var(--nf-pageheader-height, 76px) - 48px - var(--nodefony-debugbar-height, 0px) - var(--mantine-spacing-md, 16px) * 2)`:`calc(100dvh - var(--app-shell-header-height, 56px) - var(--nf-pageheader-height, 76px) - var(--nodefony-debugbar-height, 0px) - var(--mantine-spacing-md, 16px) * 3)`,onEnter:e=>d(t=>[...t,e]),onInfo:p}):null}),(0,R.jsx)(yt,{nodeId:f,info:m,connectors:g,onClose:()=>p(null)})]})});export{$ as Twin,$ as default};
@@ -1 +0,0 @@
1
- import{k as e}from"./src-3uYsZQ6M.js";import{$n as t,Di as n,Dr as r,En as i,J as a,Pt as o,Rn as s,Tn as c,V as l,X as u,Y as d,an as f,cn as p,ft as m,hn as h,nn as g,rn as _,sn as v,st as y,ut as b,vn as x,wn as S,yt as C}from"./ui-CQg7PBQQ.js";import{t as w}from"./TagsInput-B3frWkGT.js";import{c as T,o as E,r as ee}from"./stores-D6_Y8E6i.js";import{f as te,l as D}from"./hooks-DneHygq8.js";import{t as O}from"./IconArrowLeft-BjXaYGFL.js";import{t as k}from"./IconShieldOff-C2WA-gmj.js";import{K as A,M as j,S as M,St as N,V as P,Z as F,h as I,ht as L,k as R,l as z,s as B,vt as V}from"./index-D7ndDYxA.js";import{a as H,c as ne,i as U,n as W,o as G,r as K,s as q,t as J}from"./ProfileFields-CY-cyHpl.js";import{f as Y,r as X}from"./usersFormat-D6muig0U.js";var Z=e(n(),1),Q=r();function re({userId:e}){let n=T(),r=E(),a=(0,Z.useCallback)(()=>n.api.getAbsolute(ne(e)),[n,e]),{data:o,reload:l}=M(a),[u,d]=(0,Z.useState)(!1),[f,m]=(0,Z.useState)(!1),v=o?.enabled??!1,y=o?.recoveryCodesRemaining??0,b=async()=>{m(!0);try{await n.api.postAbsolute(q(e)),r.notify(`success`,`2FA de l'utilisateur désactivée.`,{source:`api`}),d(!1),l()}catch(e){r.notify(`error`,W(e),{source:`api`})}finally{m(!1)}};return(0,Q.jsxs)(S,{withBorder:!0,padding:`lg`,radius:`md`,children:[(0,Q.jsxs)(t,{gap:`xs`,mb:`xs`,children:[(0,Q.jsx)(_,{variant:`light`,color:`brand`,size:`md`,children:(0,Q.jsx)(j,{size:18})}),(0,Q.jsx)(g,{order:4,children:`Double authentification (2FA)`}),(0,Q.jsx)(i,{color:v?`teal`:`gray`,variant:`light`,children:v?`Activée`:`Désactivée`})]}),(0,Q.jsx)(s,{size:`sm`,c:`dimmed`,mb:`md`,children:v?`2FA active — ${y} code(s) de récupération restant(s). Vous pouvez la réinitialiser (ex. appareil perdu) ; l'utilisateur devra ensuite la réactiver lui-même.`:`2FA non activée. Seul l'utilisateur peut l'activer (scan d'un QR code sur son appareil) — un administrateur ne peut que la désactiver.`}),(0,Q.jsx)(t,{justify:`flex-end`,children:(0,Q.jsx)(c,{color:`red`,variant:`light`,leftSection:(0,Q.jsx)(k,{size:16}),disabled:!v,onClick:()=>d(!0),children:`Désactiver la 2FA`})}),(0,Q.jsx)(h,{opened:u,onClose:()=>d(!1),title:`Désactiver la 2FA de cet utilisateur ?`,centered:!0,children:(0,Q.jsxs)(p,{gap:`md`,children:[(0,Q.jsx)(s,{size:`sm`,children:`Le second facteur sera retiré : l'utilisateur se connectera avec son seul mot de passe jusqu'à ce qu'il réactive la 2FA. Action tracée dans le journal d'audit.`}),(0,Q.jsxs)(t,{justify:`flex-end`,children:[(0,Q.jsx)(c,{variant:`default`,onClick:()=>d(!1),children:`Annuler`}),(0,Q.jsx)(c,{color:`red`,loading:f,onClick:()=>void b(),children:`Désactiver`})]})]})})]})}function ie({userId:e}){let n=T(),r=E(),a=(0,Z.useCallback)(()=>n.api.getAbsolute(H(e)),[n,e]),{data:o,reload:l}=M(a),u=o?.credentials??[],[d,f]=(0,Z.useState)(null),[m,v]=(0,Z.useState)(!1),b=async t=>{v(!0);try{await n.api.deleteAbsolute(U(e,t)),r.notify(`success`,`Passkey révoquée.`,{source:`api`}),f(null),l()}catch(e){r.notify(`error`,W(e),{source:`api`})}finally{v(!1)}};return(0,Q.jsxs)(S,{withBorder:!0,padding:`lg`,radius:`md`,children:[(0,Q.jsxs)(t,{gap:`xs`,mb:`xs`,children:[(0,Q.jsx)(_,{variant:`light`,color:`brand`,size:`md`,children:(0,Q.jsx)(F,{size:18})}),(0,Q.jsx)(g,{order:4,children:`Passkeys & clés de sécurité`}),u.length>0&&(0,Q.jsx)(i,{variant:`light`,color:`brand`,children:u.length})]}),(0,Q.jsx)(s,{size:`sm`,c:`dimmed`,mb:`md`,children:`Clés d'accès de l'utilisateur (Touch ID, Windows Hello, FIDO2). Un administrateur peut en révoquer (ex. appareil perdu ou volé) ; seul l'utilisateur peut en ajouter depuis son appareil.`}),u.length===0?(0,Q.jsx)(s,{size:`sm`,c:`dimmed`,children:`Aucune passkey enregistrée.`}):(0,Q.jsx)(p,{gap:`xs`,children:u.map(e=>(0,Q.jsxs)(t,{justify:`space-between`,wrap:`nowrap`,children:[(0,Q.jsxs)(t,{gap:`sm`,wrap:`nowrap`,style:{minWidth:0},children:[(0,Q.jsx)(_,{variant:`light`,color:`gray`,size:`md`,children:(0,Q.jsx)(F,{size:16})}),(0,Q.jsxs)(`div`,{style:{minWidth:0},children:[(0,Q.jsxs)(t,{gap:6,wrap:`nowrap`,children:[(0,Q.jsx)(s,{size:`sm`,fw:500,children:e.nickname??`Passkey ···${e.id.slice(-8)}`}),e.backupState&&(0,Q.jsx)(i,{size:`xs`,variant:`light`,color:`teal`,children:`synchronisée`})]}),(0,Q.jsxs)(s,{size:`xs`,c:`dimmed`,children:[`Ajoutée le `,I(e.createdAt),e.lastUsedAt?` · utilisée le ${I(e.lastUsedAt)}`:` · jamais utilisée`]})]})]}),(0,Q.jsx)(c,{color:`red`,variant:`subtle`,size:`xs`,leftSection:(0,Q.jsx)(y,{size:14}),onClick:()=>f(e.id),children:`Révoquer`})]},e.id))}),(0,Q.jsx)(h,{opened:d!==null,onClose:()=>f(null),title:`Révoquer cette passkey ?`,centered:!0,children:(0,Q.jsxs)(p,{gap:`md`,children:[(0,Q.jsx)(s,{size:`sm`,children:`L'utilisateur ne pourra plus se connecter avec cette clé. Action tracée dans le journal d'audit.`}),(0,Q.jsxs)(t,{justify:`flex-end`,children:[(0,Q.jsx)(c,{variant:`default`,onClick:()=>f(null),children:`Annuler`}),(0,Q.jsx)(c,{color:`red`,loading:m,onClick:()=>{d&&b(d)},children:`Révoquer`})]})]})})]})}var ae=[`ROLE_USER`,`ROLE_DEV`,`ROLE_ADMIN`,`ROLE_SUPERVISOR`,`ROLE_AUDITOR`,`ROLE_NODEFONY_ADMIN`],oe=8;function se({detail:e}){return(0,Q.jsxs)(S,{withBorder:!0,padding:`lg`,radius:`md`,h:`100%`,children:[(0,Q.jsxs)(t,{gap:`xs`,mb:`md`,children:[(0,Q.jsx)(_,{variant:`light`,size:`md`,children:(0,Q.jsx)(R,{size:18})}),(0,Q.jsx)(g,{order:4,children:`Identité`})]}),(0,Q.jsxs)(p,{gap:`xs`,children:[(0,Q.jsx)(l,{k:`Identifiant`,v:e.identifier,mono:!0}),(0,Q.jsx)(l,{k:`Identifiant technique`,v:e.id,mono:!0}),(0,Q.jsxs)(t,{justify:`space-between`,wrap:`nowrap`,children:[(0,Q.jsx)(s,{size:`sm`,c:`dimmed`,children:`Statut`}),(0,Q.jsx)(X,{enabled:e.enabled,locked:e.locked})]}),e.currentRole&&(0,Q.jsx)(l,{k:`Rôle actif`,v:e.currentRole}),e.createdAt!=null&&(0,Q.jsx)(l,{k:`Créé le`,v:Y(e.createdAt)}),e.updatedAt!=null&&(0,Q.jsx)(l,{k:`Modifié le`,v:Y(e.updatedAt)})]})]})}function ce({providers:e}){return(0,Q.jsxs)(S,{withBorder:!0,padding:`lg`,radius:`md`,children:[(0,Q.jsxs)(t,{gap:`xs`,mb:`md`,children:[(0,Q.jsx)(_,{variant:`light`,size:`md`,children:(0,Q.jsx)(P,{size:18})}),(0,Q.jsx)(g,{order:4,children:`Connexions externes`})]}),e.length===0?(0,Q.jsx)(s,{c:`dimmed`,size:`sm`,children:`Aucun compte externe lié — connexion par mot de passe.`}):(0,Q.jsx)(p,{gap:`xs`,children:e.map(e=>(0,Q.jsxs)(t,{justify:`space-between`,children:[(0,Q.jsxs)(t,{gap:`xs`,children:[(0,Q.jsx)(i,{variant:`light`,children:e.provider}),(0,Q.jsx)(s,{size:`sm`,c:`dimmed`,ff:`monospace`,children:e.providerId})]}),(0,Q.jsx)(s,{size:`xs`,c:`dimmed`,children:e.createdAt==null?`—`:Y(e.createdAt)})]},`${e.provider}:${e.providerId}`))})]})}function le({initial:e,managed:n,isSelf:r,saving:a,onSave:o}){let[l,u]=(0,Z.useState)(e),d=Object.entries(n).filter(([,e])=>e.length>0),f=JSON.stringify(l)!==JSON.stringify(e);return(0,Q.jsxs)(S,{withBorder:!0,padding:`lg`,radius:`md`,children:[(0,Q.jsxs)(t,{gap:`xs`,mb:`md`,children:[(0,Q.jsx)(_,{variant:`light`,size:`md`,children:(0,Q.jsx)(j,{size:18})}),(0,Q.jsx)(g,{order:4,children:`Rôles`})]}),(0,Q.jsx)(w,{label:`Rôles attribués`,description:`Déterminent les accès. Un rôle inconnu reste sans effet.`,data:ae,value:l,onChange:u,clearable:!0}),d.length>0&&(0,Q.jsxs)(p,{gap:4,mt:`sm`,children:[d.map(([e,n])=>(0,Q.jsxs)(t,{gap:6,wrap:`wrap`,children:[(0,Q.jsxs)(s,{size:`xs`,c:`dimmed`,children:[`Gérés par `,e,` :`]}),n.map(t=>(0,Q.jsx)(i,{variant:`light`,color:`teal`,leftSection:(0,Q.jsx)(B,{name:e,size:12}),style:{textTransform:`none`},children:t},t))]},e)),(0,Q.jsxs)(s,{size:`xs`,c:`dimmed`,children:[`Recalculés à chaque connexion : un rôle géré retiré ici revient à la connexion suivante — le retirer chez`,` `,d.map(([e])=>e).join(`, `),`. Les autres rôles sont locaux et ne sont jamais touchés par ce calcul.`]})]}),r&&(0,Q.jsx)(s,{size:`xs`,c:`dimmed`,mt:`xs`,children:`Vous ne pouvez pas retirer votre propre rôle d'administrateur.`}),(0,Q.jsx)(t,{justify:`flex-end`,mt:`md`,children:(0,Q.jsx)(c,{leftSection:(0,Q.jsx)(C,{size:16}),loading:a,disabled:!f,onClick:()=>o(l),children:`Enregistrer les rôles`})})]})}function ue({userId:e}){let n=T(),r=E(),[i,a]=(0,Z.useState)(``),[o,l]=(0,Z.useState)(!1),u=async()=>{l(!0);try{await n.api.postAbsolute(G(e),{plainPassword:i}),r.notify(`success`,`Mot de passe réinitialisé.`,{source:`api`}),a(``)}catch(e){r.notify(`error`,W(e),{source:`api`})}finally{l(!1)}};return(0,Q.jsxs)(S,{withBorder:!0,padding:`lg`,radius:`md`,children:[(0,Q.jsxs)(t,{gap:`xs`,mb:`xs`,children:[(0,Q.jsx)(_,{variant:`light`,size:`md`,children:(0,Q.jsx)(A,{size:18})}),(0,Q.jsx)(g,{order:4,children:`Mot de passe`})]}),(0,Q.jsx)(s,{size:`sm`,c:`dimmed`,mb:`md`,children:`Réinitialisation FORCÉE (l'ancien mot de passe n'est pas requis — c'est une action d'administration). Communiquez le nouveau mot de passe à l'utilisateur par un canal sûr ; il pourra le changer ensuite.`}),(0,Q.jsxs)(t,{align:`flex-end`,maw:460,children:[(0,Q.jsx)(V,{flex:1,label:`Nouveau mot de passe`,value:i,onChange:e=>a(e.currentTarget.value),autoComplete:`new-password`,leftSection:(0,Q.jsx)(m,{size:16})}),(0,Q.jsx)(c,{loading:o,disabled:i.length<oe,onClick:()=>void u(),children:`Réinitialiser`})]})]})}function de({detail:e,isSelf:n,busy:r,onPatch:i,onDelete:a}){let l=`Indisponible sur votre propre compte (anti-verrouillage).`;return(0,Q.jsxs)(S,{withBorder:!0,padding:`lg`,radius:`md`,style:{borderColor:`var(--mantine-color-red-5)`},children:[(0,Q.jsxs)(t,{gap:`xs`,mb:`xs`,children:[(0,Q.jsx)(_,{variant:`light`,color:`red`,size:`md`,children:(0,Q.jsx)(o,{size:18})}),(0,Q.jsx)(g,{order:4,c:`red`,children:`Zone danger`})]}),(0,Q.jsxs)(p,{gap:`lg`,mt:`sm`,children:[(0,Q.jsxs)(t,{justify:`space-between`,wrap:`nowrap`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(s,{fw:500,size:`sm`,children:[`Compte `,e.enabled?`actif`:`désactivé`]}),(0,Q.jsxs)(s,{size:`xs`,c:`dimmed`,children:[`Désactiver révoque immédiatement l'accès (sessions et jetons éjectés). `,n?l:``]})]}),(0,Q.jsx)(v,{checked:e.enabled,disabled:n||r,onChange:e=>i({enabled:e.currentTarget.checked}),"aria-label":`Activer ou désactiver le compte`})]}),(0,Q.jsxs)(t,{justify:`space-between`,wrap:`nowrap`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(s,{fw:500,size:`sm`,children:[`Compte `,e.locked?`verrouillé`:`déverrouillé`]}),(0,Q.jsxs)(s,{size:`xs`,c:`dimmed`,children:[`Le verrouillage bloque la connexion sans supprimer le compte.`,` `,n?l:``]})]}),(0,Q.jsx)(v,{checked:e.locked,disabled:n||r,onChange:e=>i({locked:e.currentTarget.checked}),"aria-label":`Verrouiller ou déverrouiller le compte`})]}),(0,Q.jsxs)(t,{justify:`space-between`,wrap:`nowrap`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(s,{fw:500,size:`sm`,c:`red`,children:`Supprimer le compte`}),(0,Q.jsxs)(s,{size:`xs`,c:`dimmed`,children:[`Action définitive. `,n?l:``]})]}),(0,Q.jsx)(c,{color:`red`,variant:`light`,leftSection:(0,Q.jsx)(y,{size:16}),disabled:n||r,onClick:a,children:`Supprimer`})]})]})]})}var $=N(()=>{let{id:e=``}=te(),n=D(),r=T(),i=ee(),l=E(),m=(0,Z.useCallback)(()=>r.api.getAbsolute(K(e)),[r,e]),{data:h,loading:g,error:_,reload:v}=M(m),[y,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(!1),N=!!h&&i.user?.identifier===h.identifier,P=async(t,n)=>{S(!0);try{await r.api.patchAbsolute(K(e),t),l.notify(`success`,n,{source:`api`}),v()}catch(e){l.notify(`error`,W(e),{source:`api`})}finally{S(!1)}},F=async t=>{A(!0);try{await r.api.patchAbsolute(K(e),{profile:t}),l.notify(`success`,`Profil enregistré.`,{source:`api`}),v()}catch(e){l.notify(`error`,W(e),{source:`api`})}finally{A(!1)}},I=async e=>{w(!0),await P({roles:e},`Rôles enregistrés.`),w(!1)},B=()=>{h&&L.openConfirmModal({title:`Supprimer définitivement ce compte ?`,centered:!0,children:(0,Q.jsxs)(s,{size:`sm`,children:[`Le compte « `,h.identifier,` » et ses accès seront supprimés. Cette action est irréversible.`]}),labels:{confirm:`Supprimer`,cancel:`Annuler`},confirmProps:{color:`red`},onConfirm:()=>{(async()=>{S(!0);try{await r.api.deleteAbsolute(K(e)),l.notify(`success`,`Compte supprimé.`,{source:`api`}),n(`/nodefony/users`)}catch(e){l.notify(`error`,W(e),{source:`api`}),S(!1)}})()}})},V=h?`${h.roles.length} rôle(s) · ${h.enabled?`actif`:`désactivé`}${h.locked?` · verrouillé`:``}`:e;return(0,Q.jsx)(d,{title:h?.identifier??`Utilisateur`,subtitle:V,icon:h?(0,Q.jsx)(z,{profile:h.profile,identifier:h.identifier,size:34}):(0,Q.jsx)(R,{size:26}),actions:(0,Q.jsxs)(t,{gap:`xs`,children:[(0,Q.jsx)(c,{variant:`default`,leftSection:(0,Q.jsx)(O,{size:16}),onClick:()=>void n(`/nodefony/users`),children:`Utilisateurs`}),(0,Q.jsx)(c,{variant:`light`,leftSection:(0,Q.jsx)(b,{size:16}),loading:g,onClick:v,children:`Recharger`})]}),children:(0,Q.jsx)(a,{loading:g&&!h,error:_,onRetry:v,children:h&&(0,Q.jsxs)(f,{defaultValue:`profile`,keepMounted:!1,children:[(0,Q.jsxs)(u,{children:[(0,Q.jsx)(f.Tab,{value:`profile`,leftSection:(0,Q.jsx)(R,{size:16}),children:`Profil`}),(0,Q.jsx)(f.Tab,{value:`security`,leftSection:(0,Q.jsx)(j,{size:16}),children:`Sécurité`}),(0,Q.jsx)(f.Tab,{value:`danger`,leftSection:(0,Q.jsx)(o,{size:16}),color:`red`,children:`Zone danger`})]}),(0,Q.jsx)(f.Panel,{value:`profile`,pt:`md`,children:(0,Q.jsxs)(p,{gap:`md`,children:[(0,Q.jsx)(J,{profile:h.profile,identifier:h.identifier,onSubmit:F,saving:k}),(0,Q.jsxs)(x,{children:[(0,Q.jsx)(x.Col,{span:{base:12,md:6},children:(0,Q.jsx)(se,{detail:h})}),(0,Q.jsx)(x.Col,{span:{base:12,md:6},children:(0,Q.jsx)(le,{initial:h.roles,managed:h.providerRoles,isSelf:N,saving:C,onSave:e=>void I(e)})})]}),(0,Q.jsx)(ce,{providers:h.socialProviders})]})}),(0,Q.jsx)(f.Panel,{value:`security`,pt:`md`,children:(0,Q.jsxs)(p,{gap:`md`,children:[(0,Q.jsx)(ue,{userId:e}),(0,Q.jsx)(re,{userId:e}),(0,Q.jsx)(ie,{userId:e})]})}),(0,Q.jsx)(f.Panel,{value:`danger`,pt:`md`,children:(0,Q.jsx)(de,{detail:h,isSelf:N,busy:y,onPatch:e=>void P(e,e.enabled===!1?`Compte désactivé.`:e.enabled===!0?`Compte réactivé.`:e.locked?`Compte verrouillé.`:`Compte déverrouillé.`),onDelete:B})})]})})})});export{$ as UserProfile,$ as default};
@@ -1 +0,0 @@
1
- import{k as e}from"./src-3uYsZQ6M.js";import{$n as t,Di as n,Dr as r,It as i,Pt as a,Rn as o,Tn as s,U as c,W as l,Y as u,an as d,cn as f,dr as p,hn as m,in as h,n as g,nn as _,pt as v,st as y,t as b,ut as x,vn as S,wn as C,xn as w,zn as T}from"./ui-CQg7PBQQ.js";import{t as E}from"./List-Bj6cz52O.js";import{t as D}from"./TagsInput-B3frWkGT.js";import{E as O,c as k,o as ee,r as A,x as te}from"./stores-D6_Y8E6i.js";import{l as ne}from"./hooks-DneHygq8.js";import{n as re,r as ie}from"./IconUserOff-FIAY4a-C.js";import{t as ae}from"./IconHelpCircle-BCItd8VT.js";import{a as j,n as M,s as oe,t as N}from"./pageQuery-CeNWND3J.js";import{C as se,D as P,M as F,N as ce,S as I,St as L,V as le,vt as R,x as ue,y as de}from"./index-D7ndDYxA.js";import{t as fe}from"./BrickStoreChip-LPzFtCle.js";import{a as pe}from"./firewallModel-DKOWcjIb.js";import{a as me,c as z,d as B,f as he,i as ge,l as _e,n as ve,o as V,p as H,r as U,s as W,t as G,u as ye}from"./usersFormat-D6muig0U.js";import{n as be}from"./rolesModel-BqkpwhLp.js";var K=i(`outline`,`user-plus`,`UserPlus`,[[`path`,{d:`M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0`,key:`svg-0`}],[`path`,{d:`M16 19h6`,key:`svg-1`}],[`path`,{d:`M19 16v6`,key:`svg-2`}],[`path`,{d:`M6 21v-2a4 4 0 0 1 4 -4h4`,key:`svg-3`}]]),q=e(n(),1),J=r(),xe=L(({roles:e,admin:t,fallback:n=null,children:r})=>{let i=A(),a=[...t?[te]:[],...e??[]];return a.length===0||O(i.roles,a)?(0,J.jsx)(J.Fragment,{children:r}):(0,J.jsx)(J.Fragment,{children:n})}),Y={role:{label:`Rôle`,hint:`Comptes portant CE rôle exactement (ex. ROLE_NODEFONY_ADMIN). Correspondance stricte, pas une recherche.`,placeholder:`ROLE_…`},enabled:{label:`Activation`,hint:`Activé = le compte peut s'authentifier. Un compte peut être activé ET verrouillé : les deux filtres sont indépendants.`,values:{true:`Activés`,false:`Désactivés`}},locked:{label:`Verrouillage`,hint:`Verrouillé par la défense anti-force brute — distinct d'une désactivation, qui est une décision d'administration.`,values:{true:`Verrouillés`,false:`Non verrouillés`}},hasSocial:{label:`Connexion`,hint:`Comptes liés à au moins un fournisseur externe (OAuth : Google, GitHub, Keycloak…).`,values:{true:`Sociaux`,false:`Locaux`}}},Se=L(function({filters:e,onFiltersChange:n,onEdit:r,onBulkDelete:i,reloadKey:a=0,onLoaded:c,onSearchChange:u}){let d=k(),p=d.admin.pageCapabilities(W),{signal:m,filters:h}=de(e),_=(0,q.useMemo)(N,[a]),v=(0,q.useCallback)(async e=>{try{let t=await j(_,e,h,e=>d.api.getAbsolute(`${W}?${e}`));return c?.(t.rows),t}catch(e){throw Error(B(e),{cause:e})}},[d,h,c,_]),x=(0,q.useMemo)(()=>new Set(p?.sortable??[]),[p?.sortable]),S=(0,q.useMemo)(()=>[{key:`identifier`,header:`Identifiant`,sortable:x.has(`identifier`),value:e=>e.identifier,render:e=>(0,J.jsx)(o,{fw:600,size:`sm`,style:{wordBreak:`break-all`},children:e.identifier}),size:200},{key:`roles`,header:`Rôles`,value:e=>e.roles.join(` `),render:e=>(0,J.jsx)(ve,{roles:e.roles}),size:240},{key:`status`,header:`État`,value:e=>e.locked?`Verrouillé`:e.enabled?`Actif`:`Désactivé`,render:e=>(0,J.jsx)(U,{enabled:e.enabled,locked:e.locked}),size:130},{key:`provider`,header:`Connexion`,value:e=>e.socialProviders.length>0?e.socialProviders.map(e=>e.provider).join(` `):`local`,render:e=>(0,J.jsx)(G,{providers:e.socialProviders}),size:150},{key:`tenant`,header:`Tenant`,value:e=>e.tenantId??`global`,render:e=>(0,J.jsx)(ge,{tenantId:e.tenantId}),size:120},{key:`createdAt`,header:`Créé`,sortable:x.has(`createdAt`),value:e=>e.createdAt??0,render:e=>(0,J.jsx)(o,{size:`sm`,c:e.createdAt===null?`dimmed`:void 0,children:he(e.createdAt)}),size:170},{key:`updatedAt`,header:`Dernière maj`,sortable:x.has(`updatedAt`),value:e=>e.updatedAt??0,render:e=>(0,J.jsx)(o,{size:`sm`,c:e.updatedAt===null?`dimmed`:void 0,children:H(e.updatedAt)}),size:150}],[x]);return(0,J.jsxs)(f,{gap:`md`,children:[(0,J.jsxs)(t,{gap:`xs`,children:[(0,J.jsx)(o,{size:`sm`,c:`dimmed`,children:`Clic sur une ligne pour gérer le compte.`}),(0,J.jsx)(l,{title:`Utilisateurs`,version:V,summary:`Les comptes utilisateurs du serveur (source d'identité du firewall). La table lit l'annuaire page par page : tri, filtres et recherche sont exécutés par le serveur, jamais sur un extrait chargé d'avance.`,sections:[{label:`Ce qui est proposé`,body:p?`Le serveur déclare savoir trier sur ${p.sortable.length} champ(s) et filtrer sur ${Object.keys(p.filters).length}. Ce qu'il ne déclare pas n'est pas offert : une en-tête cliquable qui répondrait 400 serait pire qu'une en-tête inerte.`:`Les capacités de l'annuaire ne sont pas encore connues (catalogue d'administration en cours de chargement) : ni tri ni filtre ne sont proposés tant qu'on ne sait pas ce que le serveur honore.`},{label:`Redaction`,body:`Le hash de mot de passe n'est JAMAIS exposé : le DTO d'administration ne porte que l'identité, les rôles et l'état. Les liens sociaux (OAuth) sont montrés sans jeton.`},{label:`Garde-fous anti-verrouillage`,body:`Le serveur refuse de supprimer votre propre compte ou le dernier administrateur actif (sinon plus personne ne pourrait administrer). Ces refus reviennent en erreur explicite (409).`},{label:`Tenant`,body:`La colonne Tenant prépare le multi-tenant (P17) : aujourd'hui « global » (mono-tenant), demain l'organisation porteuse du compte.`}]})]}),(0,J.jsx)(b,{spec:p?.filters??null,value:e,onChange:n,labels:Y}),(0,J.jsx)(g,{mode:`server`,loader:v,columns:S,getRowId:e=>e.id,onRowClick:e=>r(e),dimRow:e=>!e.enabled||e.locked,initialSort:x.has(`identifier`)?{key:`identifier`,dir:`asc`}:void 0,searchable:p?.search??!1,searchPlaceholder:`Rechercher un identifiant…`,onSearchChange:u,resetPageSignal:m,pageSize:25,persist:{key:`studio.users`,storage:`session`},emptyMessage:`Aucun utilisateur ne correspond.`,selectable:!0,renderBulkActions:(e,t)=>(0,J.jsxs)(s,{color:`red`,size:`xs`,variant:`light`,leftSection:(0,J.jsx)(y,{size:14}),onClick:()=>i(e,t),children:[`Supprimer `,e.length,` compte`,e.length>1?`s`:``]})})]})});function X({icon:e,title:t,children:n}){return(0,J.jsx)(C,{withBorder:!0,radius:`md`,p:`lg`,children:(0,J.jsxs)(f,{gap:`sm`,children:[(0,J.jsxs)(_,{order:4,style:{display:`flex`,alignItems:`center`,gap:8},children:[e,t]}),n]})})}function Ce(){return(0,J.jsxs)(f,{gap:`md`,children:[(0,J.jsx)(X,{icon:(0,J.jsx)(P,{size:18}),title:`Qu'est-ce qu'un utilisateur ?`,children:(0,J.jsxs)(o,{size:`sm`,children:[`Un utilisateur est un compte porté par le service `,(0,J.jsx)(w,{children:`users`}),` — la `,(0,J.jsx)(`strong`,{children:`source d'identité`}),` du firewall. C'est l'application qui décide `,(0,J.jsx)(`em`,{children:`qui`}),` sont ses utilisateurs et `,(0,J.jsx)(`em`,{children:`où`}),` ils sont stockés (annuaire en mémoire, SQL via Drizzle, ou MongoDB). Cette console liste les comptes, leur état et leurs rôles, et permet de les gouverner.`]})}),(0,J.jsxs)(X,{icon:(0,J.jsx)(F,{size:18}),title:`Le hash de mot de passe n'est jamais exposé`,children:[(0,J.jsxs)(o,{size:`sm`,children:[`Le DTO d'administration est `,(0,J.jsx)(`strong`,{children:`redacté par construction`}),` `,`(allowlist côté serveur) : il ne porte que l'identité, les rôles, l'état et les liens sociaux. Le `,(0,J.jsx)(w,{children:`password`}),` (hash) et les`,` `,(0,J.jsx)(w,{children:`metadata`}),` (potentiellement sensibles) ne sortent jamais de l'API. Les comptes OAuth sont montrés `,(0,J.jsx)(`strong`,{children:`sans jeton`}),` `,`(fournisseur + référence seulement).`]}),(0,J.jsx)(T,{variant:`light`,color:`gray`,children:(0,J.jsxs)(o,{size:`xs`,children:[`Un compte « local » s'authentifie par mot de passe ; un compte`,` `,(0,J.jsx)(w,{children:`google`}),`/`,(0,J.jsx)(w,{children:`github`}),` est un`,` `,(0,J.jsx)(`strong`,{children:`Shadow User`}),` (ligne locale liée à un compte externe, sans mot de passe stocké).`]})})]}),(0,J.jsx)(X,{icon:(0,J.jsx)(ce,{size:18}),title:`Garde-fous anti-verrouillage`,children:(0,J.jsxs)(E,{size:`sm`,spacing:`xs`,children:[(0,J.jsxs)(E.Item,{children:[(0,J.jsx)(`strong`,{children:`Pas d'auto-suppression`}),` : le serveur refuse de supprimer le compte de l'administrateur connecté.`]}),(0,J.jsxs)(E.Item,{children:[(0,J.jsx)(`strong`,{children:`Pas de suppression du dernier admin`}),` : si un seul administrateur actif reste, sa suppression (ou déchéance) est refusée — sinon plus personne ne pourrait administrer.`]}),(0,J.jsxs)(E.Item,{children:[`Ces refus reviennent en `,(0,J.jsx)(`strong`,{children:`erreur explicite (409)`}),` `,`affichée dans Studio. Chaque suppression est`,` `,(0,J.jsx)(`strong`,{children:`auditée`}),` et passe en HTTP (pipeline CSRF complet).`]}),(0,J.jsxs)(E.Item,{children:[`Supprimer un compte `,(0,J.jsx)(`strong`,{children:`révoque en cascade`}),` ses sessions et ses jetons d'accès (PAT) — déconnexion immédiate.`]})]})}),(0,J.jsx)(X,{icon:(0,J.jsx)(ie,{size:18}),title:`Multi-tenant (P17) — réservé`,children:(0,J.jsxs)(o,{size:`sm`,children:[`La colonne `,(0,J.jsx)(`strong`,{children:`Tenant`}),` prépare le mode multi-organisations : aujourd'hui `,(0,J.jsx)(w,{children:`global`}),` (mono-tenant), demain le filtrage par organisation porteuse du compte. Le contrat porte déjà le champ`,` `,(0,J.jsx)(w,{children:`tenantId`}),` — aucun changement d'API ne sera nécessaire pour l'activer.`]})})]})}function we({opened:e,onClose:n,roleSuggestions:r,rolesUnavailable:i=!1,onCreated:c}){let l=k(),u=ee(),[d,g]=(0,q.useState)(``),[_,v]=(0,q.useState)(``),[y,b]=(0,q.useState)([]),[x,S]=(0,q.useState)(!1),[C,w]=(0,q.useState)(null);function E(){g(``),v(``),b([]),w(null),S(!1)}function O(){E(),n()}async function A(){w(null);let e=d.trim();if(e.length===0)w(`Renseignez un identifiant (email ou login).`);else{S(!0);try{let t={identifier:e};_&&(t.plainPassword=_),y.length>0&&(t.roles=y);let r=await l.api.postAbsolute(W,t);u.notify(`success`,`Compte « ${r.identifier} » créé.`,{source:`api`}),E(),n(),c()}catch(e){let t=e?.status;w(t===409?`Un compte avec cet identifiant existe déjà.`:B(e))}finally{S(!1)}}}return(0,J.jsx)(m,{opened:e,onClose:()=>x?void 0:O(),title:(0,J.jsxs)(t,{gap:`xs`,children:[(0,J.jsx)(K,{size:18}),(0,J.jsx)(o,{fw:700,children:`Nouvel utilisateur`})]}),centered:!0,size:`lg`,children:(0,J.jsxs)(f,{gap:`md`,children:[(0,J.jsx)(p,{mih:44,children:C&&(0,J.jsx)(T,{role:`alert`,variant:`light`,color:`red`,icon:(0,J.jsx)(a,{size:16}),children:C})}),(0,J.jsx)(h,{label:`Identifiant`,description:`Email ou login — la clé de connexion du compte.`,placeholder:`alice@example.com`,required:!0,value:d,maxLength:200,onChange:e=>{g(e.currentTarget.value),C&&w(null)},"data-autofocus":!0}),(0,J.jsx)(R,{label:`Mot de passe (optionnel)`,description:`Laissez vide pour un compte sans mot de passe (connexion sociale / passkey, ou à définir plus tard via « Modifier »).`,placeholder:`••••••••`,value:_,onChange:e=>v(e.currentTarget.value)}),(0,J.jsx)(D,{label:`Rôles (optionnel)`,description:i?`Hiérarchie du serveur illisible — seuls les ${r.length} rôle(s) portés par les comptes affichés sont proposés. La saisie reste libre.`:`${r.length} rôle(s) déclarés par le serveur ; vous pouvez en saisir d'autres. Vide = compte de base.`,placeholder:`ROLE_USER…`,data:r,value:y,onChange:b,clearable:!0}),(0,J.jsxs)(t,{justify:`flex-end`,mt:`xs`,children:[(0,J.jsx)(s,{variant:`default`,onClick:O,children:`Annuler`}),(0,J.jsx)(s,{leftSection:(0,J.jsx)(K,{size:16}),loading:x,onClick:()=>void A(),children:`Créer le compte`})]})]})})}var Z=L(()=>{let e=k(),n=A(),r=ee(),i=n.user?.identifier??null,p=se(),h=ne(),[g,_]=(0,q.useState)(`list`),[b,C]=(0,q.useState)(!1),[w,E]=(0,q.useState)(null),[D,O]=(0,q.useState)(!1),[te,ie]=(0,q.useState)(0),[j,N]=(0,q.useState)([]),F=(0,q.useCallback)(()=>ie(e=>e+1),[]),[L,R]=(0,q.useState)({}),[de,he]=(0,q.useState)(``),ge=(0,q.useCallback)(()=>p?e.api.getAbsolute(_e):Promise.resolve(null),[e,p]),{data:ve}=I(ge),H=e.admin.pageCapabilities(z),U=oe(L,H,de).toString(),W=(0,q.useCallback)(()=>p?e.api.getAbsolute(U?`${z}?${U}`:z):Promise.resolve(null),[e,p,U]),{data:G,reload:Y}=I(W),X=ue(H,L,R),Z=(0,q.useMemo)(()=>G??{total:null,active:null,disabled:null,locked:null,admins:null,social:null},[G]),Q=Z.total??ve?.count??null,Te=(0,q.useCallback)(()=>p?e.api.getAbsolute(pe):Promise.resolve(null),[e,p]),{data:$,error:Ee}=I(Te),De=(0,q.useMemo)(()=>{let e=new Set($?be($.hierarchy):[]);for(let t of j)for(let n of t.roles)e.add(n);return[...e].sort()},[j,$]);async function Oe(){if(!w)return;let{users:t,clear:n}=w;O(!0);try{let i=await Promise.allSettled(t.map(t=>e.api.deleteAbsolute(ye(t.id)))),a=i.filter(e=>e.status===`fulfilled`).length,o=i.length-a;r.notify(o===0?`success`:`warning`,o===0?`${a} compte(s) supprimé(s).`:`${a} supprimé(s), ${o} refusé(s) (garde-fou : dernier admin / votre compte).`,{source:`api`}),n(),E(null),F(),Y()}catch(e){r.notify(`error`,B(e),{source:`api`})}finally{O(!1)}}let ke=w?.users.some(e=>e.identifier===i)??!1,Ae=w?.users.filter(e=>e.roles.includes(me)).length??0,je=`${M(Q)} compte(s) · ${M(Z.admins)} admin(s)`;return(0,J.jsxs)(u,{title:`Users`,subtitle:je,icon:(0,J.jsx)(P,{size:26}),actions:(0,J.jsxs)(t,{gap:`sm`,wrap:`nowrap`,children:[(0,J.jsx)(xe,{admin:!0,children:(0,J.jsx)(s,{leftSection:(0,J.jsx)(K,{size:16}),onClick:()=>C(!0),children:`Nouvel utilisateur`})}),(0,J.jsx)(s,{variant:`light`,leftSection:(0,J.jsx)(x,{size:16}),onClick:()=>{F(),Y()},children:`Recharger`})]}),children:[(0,J.jsx)(t,{gap:`md`,align:`center`,wrap:`wrap`,children:(0,J.jsxs)(t,{gap:`xs`,align:`center`,children:[(0,J.jsx)(o,{size:`sm`,fw:600,children:`Comptes du serveur`}),(0,J.jsx)(l,{title:`Administration des utilisateurs`,version:V,summary:`Vue gouvernance des comptes utilisateurs (source d'identité du firewall). Suppression auditée, protégée par des garde-fous anti-verrouillage.`,sections:[{label:`RBAC`,body:`L'administration des utilisateurs est réservée aux administrateurs (ROLE_NODEFONY_ADMIN). L'affichage Studio est un gating ; l'enforcement réel est côté firewall serveur.`},{label:`Tenant (P17)`,body:`La colonne Tenant prépare le multi-tenant : la même vue scopée à une organisation (le champ tenantId existe déjà sur chaque compte).`}]}),p&&(0,J.jsx)(o,{size:`xs`,c:`dimmed`,children:`Vue gouvernance — suppression auditée.`}),(0,J.jsx)(fe,{brick:`user`})]})}),(0,J.jsxs)(S,{children:[(0,J.jsx)(c,{label:`Total`,...X(`total`,`l'annuaire entier (retire les filtres de facette)`),icon:(0,J.jsx)(P,{size:20,color:`var(--mantine-color-brand-5)`}),hint:p?Q===null?`Le dépôt d'utilisateurs branché ne sait pas compter ses lignes — aucun total n'est affiché plutôt qu'un chiffre inventé.`:`Total de l'annuaire, compté par le serveur : ${Q} comptes. La table les parcourt page par page.`:`Le total de l'annuaire est réservé aux administrateurs — « — » signifie « je ne sais pas », pas « aucun compte ».`,children:(0,J.jsx)(o,{fz:28,fw:700,style:{fontVariantNumeric:`tabular-nums`},children:M(Q)})}),(0,J.jsx)(c,{label:`Actifs`,...X(`active`,`les comptes actifs (activés et non verrouillés)`),icon:(0,J.jsx)(re,{size:20,color:`var(--mantine-color-teal-6)`}),hint:`Comptes activés et non verrouillés (peuvent s'authentifier).`,children:(0,J.jsx)(o,{fz:28,fw:700,c:`teal`,style:{fontVariantNumeric:`tabular-nums`},children:M(Z.active)})}),(0,J.jsx)(c,{label:`Administrateurs`,icon:(0,J.jsx)(ce,{size:20,color:`var(--mantine-color-red-6)`}),info:(0,J.jsx)(l,{title:`Administrateurs`,version:V,summary:`Comptes portant ROLE_NODEFONY_ADMIN.`,sections:[{label:`Garde-fou`,body:`Le serveur refuse de supprimer ou déchoir le dernier administrateur actif — sinon l'administration deviendrait inaccessible.`}]}),children:(0,J.jsx)(o,{fz:28,fw:700,c:`red`,style:{fontVariantNumeric:`tabular-nums`},children:M(Z.admins)})}),(0,J.jsx)(c,{label:`Comptes sociaux`,...X(`social`,`les comptes liés à un fournisseur externe`),icon:(0,J.jsx)(le,{size:20,color:`var(--mantine-color-grape-6)`}),hint:`Comptes liés à un fournisseur externe (OAuth — Google, GitHub, Keycloak…).`,children:(0,J.jsx)(o,{fz:28,fw:700,c:`grape`,style:{fontVariantNumeric:`tabular-nums`},children:M(Z.social)})})]}),(0,J.jsxs)(d,{value:g,onChange:e=>e&&_(e),mt:`xs`,children:[(0,J.jsxs)(d.List,{children:[(0,J.jsx)(d.Tab,{value:`list`,leftSection:(0,J.jsx)(v,{size:15}),children:`Utilisateurs`}),(0,J.jsx)(d.Tab,{value:`help`,leftSection:(0,J.jsx)(ae,{size:15}),children:`Utilisation & aide`})]}),(0,J.jsx)(d.Panel,{value:`list`,pt:`md`,children:(0,J.jsx)(Se,{filters:L,onFiltersChange:R,onEdit:e=>void h(`/nodefony/users/${e.id}`),onBulkDelete:(e,t)=>E({users:e,clear:t}),reloadKey:te,onLoaded:N,onSearchChange:he})}),(0,J.jsx)(d.Panel,{value:`help`,pt:`md`,children:g===`help`&&(0,J.jsx)(Ce,{})})]}),(0,J.jsx)(we,{opened:b,onClose:()=>C(!1),roleSuggestions:De,rolesUnavailable:!!Ee,onCreated:F}),(0,J.jsx)(m,{opened:w!==null,onClose:()=>D?void 0:E(null),title:(0,J.jsxs)(t,{gap:`xs`,children:[(0,J.jsx)(y,{size:18,color:`var(--mantine-color-red-6)`}),(0,J.jsx)(o,{fw:700,children:`Supprimer les comptes sélectionnés ?`})]}),centered:!0,children:w&&(0,J.jsxs)(f,{gap:`md`,children:[(0,J.jsx)(T,{variant:`light`,color:`red`,icon:(0,J.jsx)(a,{size:16}),children:(0,J.jsxs)(o,{size:`sm`,children:[(0,J.jsx)(`strong`,{children:w.users.length}),` compte(s) seront`,` `,(0,J.jsx)(`strong`,{children:`immédiatement`}),` supprimés — sessions et jetons révoqués en cascade. Action irréversible.`,ke?` ⚠ VOTRE compte est dans la sélection : le serveur le refusera (garde-fou).`:``,Ae>0?` ${Ae} administrateur(s) sélectionné(s) : le dernier admin actif ne pourra pas être supprimé.`:``]})}),(0,J.jsxs)(t,{justify:`flex-end`,children:[(0,J.jsx)(s,{variant:`default`,disabled:D,onClick:()=>E(null),children:`Annuler`}),(0,J.jsxs)(s,{color:`red`,leftSection:(0,J.jsx)(y,{size:16}),loading:D,onClick:()=>void Oe(),children:[`Supprimer `,w.users.length]})]})]})})]})});export{Z as Users,Z as default};
@@ -1 +0,0 @@
1
- import{k as e}from"./src-3uYsZQ6M.js";import{$n as t,Di as n,Dr as r,En as i,Rn as a,Tn as o,U as s,W as c,Y as l,cn as u,in as d,ln as f,lt as p,n as m,vn as h,wn as g}from"./ui-CQg7PBQQ.js";import{t as _}from"./Progress-CPoEshia.js";import{b as v,r as y}from"./aiPreviewModel-gSgeWhaX.js";import{E as b}from"./index-D7ndDYxA.js";import{i as x,o as S}from"./aiPreviewParts-B25TmKBV.js";var C=e(n(),1),w=r(),T=[{key:`collection`,header:`Collection`,render:e=>(0,w.jsx)(a,{size:`sm`,fw:600,ff:`monospace`,children:e.collection}),value:e=>e.collection},{key:`adapter`,header:`Adaptateur`,value:e=>e.adapter},{key:`embedModel`,header:`Modèle d'embedding`,value:e=>e.embedModel,render:e=>(0,w.jsx)(a,{size:`sm`,ff:`monospace`,children:e.embedModel})},{key:`dimensions`,header:`Dimensions`,align:`right`,value:e=>e.dimensions},{key:`distance`,header:`Distance`,value:e=>e.distance},{key:`index`,header:`Index`,value:e=>e.index},{key:`vectors`,header:`Vecteurs`,align:`right`,value:e=>e.vectors,render:e=>S(e.vectors)},{key:`sizeMb`,header:`Taille`,align:`right`,value:e=>e.sizeMb,render:e=>`${S(e.sizeMb)} Mo`},{key:`lastWrite`,header:`Dernière écriture`,value:e=>e.lastWrite}];function E({hit:e}){let n=e.chunk;return(0,w.jsxs)(g,{withBorder:!0,radius:`md`,padding:`sm`,children:[(0,w.jsxs)(t,{justify:`space-between`,wrap:`nowrap`,mb:6,children:[(0,w.jsxs)(t,{gap:8,wrap:`nowrap`,children:[(0,w.jsx)(i,{variant:`filled`,color:`brand`,size:`sm`,circle:!0,children:e.rank}),(0,w.jsxs)(a,{size:`sm`,fw:600,children:[n.source,n.page?` · p. ${n.page}`:``]}),n.section&&(0,w.jsx)(a,{size:`xs`,c:`dimmed`,children:n.section})]}),(0,w.jsxs)(a,{size:`xs`,ff:`monospace`,c:`dimmed`,children:[`sha256 `,n.hash,`…`]})]}),(0,w.jsx)(a,{size:`sm`,children:n.text}),(0,w.jsxs)(t,{gap:`xs`,mt:8,wrap:`nowrap`,children:[(0,w.jsx)(_,{value:e.score*100,size:`xs`,style:{flex:1},color:e.score>=.75?`teal`:e.score>=.6?`yellow`:`gray`,"aria-label":`similarité ${e.score.toFixed(3)}`}),(0,w.jsx)(a,{size:`xs`,ff:`monospace`,style:{fontVariantNumeric:`tabular-nums`},children:e.score.toFixed(3)})]})]})}function D(){let[e,n]=(0,C.useState)(null),[r,i]=(0,C.useState)(`délai pour annuler une commande`),[_,D]=(0,C.useState)(r),O=(0,C.useMemo)(()=>v(_,{...e?{collection:e}:{},limit:5}),[_,e]),k=y.reduce((e,t)=>e+t.vectors,0),A=y.reduce((e,t)=>e+t.sizeMb,0);return(0,w.jsxs)(l,{title:`Bases vectorielles`,subtitle:`Les collections d'embeddings, et ce qu'elles rendent pour une question.`,icon:(0,w.jsx)(b,{size:22}),children:[(0,w.jsx)(x,{module:`@nodefony/ai`,contract:`IVectorStore`}),(0,w.jsxs)(h,{children:[(0,w.jsx)(s,{label:`Collections`,hint:`une collection = un modèle d'embedding, une dimension`,children:y.length}),(0,w.jsx)(s,{label:`Vecteurs`,hint:`passages indexés, toutes collections`,children:S(k)}),(0,w.jsxs)(s,{label:`Volume`,hint:`index HNSW compris`,children:[S(A),` Mo`]}),(0,w.jsx)(s,{label:`Recherche (p95)`,hint:`top-5, filtre de collection compris`,children:`38 ms`})]}),(0,w.jsx)(m,{mode:`client`,data:y,columns:T,getRowId:e=>e.collection,searchable:!1,height:240}),(0,w.jsxs)(g,{withBorder:!0,radius:`md`,padding:`md`,children:[(0,w.jsxs)(t,{gap:6,mb:`sm`,children:[(0,w.jsx)(a,{fw:600,children:`Recherche de similarité`}),(0,w.jsx)(c,{title:`Ce que fait cette recherche simulée`,summary:`Elle classe vraiment un petit corpus, par proximité de mots. Le vrai index comparera des embeddings ; la forme du résultat sera la même.`,sections:[{label:`Score`,body:`Similarité cosinus, de 0 à 1. En dessous de 0,6, un passage n'est pas jugé assez proche pour être cité.`},{label:`Empreinte`,body:`Chaque passage garde l'empreinte SHA-256 de son texte d'origine : une citation se vérifie, elle ne se croit pas.`}]})]}),(0,w.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),D(r)},children:(0,w.jsxs)(t,{gap:`xs`,align:`flex-end`,mb:`md`,children:[(0,w.jsx)(d,{label:`Question`,value:r,onChange:e=>i(e.currentTarget.value),style:{flex:1}}),(0,w.jsx)(f,{label:`Collection`,placeholder:`toutes`,clearable:!0,data:y.map(e=>e.collection),value:e,onChange:n,w:220}),(0,w.jsx)(o,{type:`submit`,leftSection:(0,w.jsx)(p,{size:16}),children:`Chercher`})]})}),(0,w.jsx)(u,{gap:`xs`,"aria-live":`polite`,children:O.length===0?(0,w.jsx)(a,{size:`sm`,c:`dimmed`,children:`Aucun passage dans cette collection.`}):O.map(e=>(0,w.jsx)(E,{hit:e},e.chunk.id))})]})]})}export{E as SearchHit,D as VectorStoresPreview};
@@ -1 +0,0 @@
1
- import{k as e}from"./src-3uYsZQ6M.js";import{$n as t,Di as n,Dr as r,En as i,Et as a,It as o,J as s,Ln as c,Pt as l,Rn as u,Tn as d,U as f,W as p,Y as m,an as h,bn as g,bt as _,cn as v,dn as y,dr as b,gn as x,h as S,hn as ee,in as te,jn as C,mt as w,n as T,nn as E,on as D,pt as O,sn as k,st as A,t as j,tr as M,ut as N,vn as ne,vt as P,xn as F,zn as I}from"./ui-CQg7PBQQ.js";import{t as L}from"./Accordion-DPLwcjdo.js";import{t as re}from"./Textarea-BWkcGO8Z.js";import{t as R}from"./List-Bj6cz52O.js";import{t as ie}from"./TagsInput-B3frWkGT.js";import{c as ae,o as oe}from"./stores-D6_Y8E6i.js";import{t as z}from"./IconArrowDown-CVg6dTJG.js";import{t as B}from"./IconArrowUp-BI5oNIYX.js";import{t as V}from"./IconCircleCheck-4L5q2AOa.js";import{t as H}from"./IconDots-CGp_6hGw.js";import{t as U}from"./IconEye-DtO-67sS.js";import{t as se}from"./IconHelpCircle-BCItd8VT.js";import{t as W}from"./IconPlayerPause-CbRWQ0OJ.js";import{t as G}from"./IconPlayerPlay-CeEI-a5d.js";import{t as ce}from"./IconPlus-B4Sx19oD.js";import{a as le,n as K,s as ue,t as de}from"./pageQuery-CeNWND3J.js";import{$ as fe,N as pe,S as me,St as he,T as q,Y as ge,x as _e,y as ve}from"./index-D7ndDYxA.js";import{t as ye}from"./BrickStoreChip-LPzFtCle.js";var be=o(`outline`,`asterisk`,`Asterisk`,[[`path`,{d:`M12 12l8 -4.5`,key:`svg-0`}],[`path`,{d:`M12 12v9`,key:`svg-1`}],[`path`,{d:`M12 12l-8 -4.5`,key:`svg-2`}],[`path`,{d:`M12 12l8 4.5`,key:`svg-3`}],[`path`,{d:`M12 3v9`,key:`svg-4`}],[`path`,{d:`M12 12l-8 4.5`,key:`svg-5`}]]),xe=o(`outline`,`circle-x`,`CircleX`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M10 10l4 4m0 -4l-4 4`,key:`svg-1`}]]),Se=o(`outline`,`clock-pause`,`ClockPause`,[[`path`,{d:`M20.942 13.018a9 9 0 1 0 -7.909 7.922`,key:`svg-0`}],[`path`,{d:`M12 7v5l2 2`,key:`svg-1`}],[`path`,{d:`M17 17v5`,key:`svg-2`}],[`path`,{d:`M21 17v5`,key:`svg-3`}]]),Ce=o(`outline`,`edit`,`Edit`,[[`path`,{d:`M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1`,key:`svg-0`}],[`path`,{d:`M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415`,key:`svg-1`}],[`path`,{d:`M16 5l3 3`,key:`svg-2`}]]),we=o(`outline`,`rotate-clockwise`,`RotateClockwise`,[[`path`,{d:`M4.05 11a8 8 0 1 1 .5 4m-.5 5v-5h5`,key:`svg-0`}]]),J=e(n(),1),Y=`/nodefony/security/api/webhooks`,Te=`${Y}/stats`;function X(e){return`${Y}/${encodeURIComponent(e)}`}function Ee(e){return`${X(e)}/rotate`}function De(e){return`${X(e)}/reveal`}function Oe(e){return`${X(e)}/deliveries`}var ke=`v1.0`,Ae=[{domain:`Authentification`,events:[{value:`login.success`,label:`login.success — connexion réussie`},{value:`login.failure`,label:`login.failure — connexion échouée`},{value:`login.throttled`,label:`login.throttled — connexion freinée`},{value:`logout`,label:`logout — déconnexion`},{value:`auth.failure`,label:`auth.failure — credential invalide`},{value:`auth.throttled`,label:`auth.throttled — backoff NIST`},{value:`auth.denied`,label:`auth.denied — Zero Trust`}]},{domain:`Autorisation`,events:[{value:`access.denied`,label:`access.denied — refus voters/RBAC`},{value:`frame.denied`,label:`frame.denied — verrou de frame WS`}]},{domain:`Jetons & clés`,events:[{value:`token.issued`,label:`token.issued — jeton émis`},{value:`token.reuse_detected`,label:`token.reuse_detected — réutilisation détectée`},{value:`apikey.created`,label:`apikey.created — clé API créée`},{value:`apikey.revoked`,label:`apikey.revoked — clé API révoquée`}]}],je=Ae.flatMap(e=>e.events.map(e=>e.value));function Me(e){if(e.lastDeliveryAt===null)return`never`;if(e.failureCount>0)return`failing`;let t=e.lastDeliveryStatus;return t!==null&&t>=200&&t<300?`ok`:`failing`}function Ne(e){let t=e.trim();if(t.length===0)return`L'URL de destination est requise.`;let n;try{n=new URL(t)}catch{return`URL invalide (ex. https://example.com/hooks/nodefony).`}return n.protocol!==`https:`&&n.protocol!==`http:`?`Seules les URL http(s) sont acceptées.`:null}function Pe(e){return e===null?`—`:new Date(e).toLocaleString(`fr-FR`,{dateStyle:`medium`,timeStyle:`short`})}function Fe(e,t=Date.now()){if(e===null)return`Jamais`;let n=Math.floor((t-e)/1e3);if(n<5)return`À l'instant`;if(n<60)return`Il y a ${n} s`;let r=Math.floor(n/60);if(r<60)return`Il y a ${r} min`;let i=Math.floor(r/60);if(i<24)return`Il y a ${i} h`;let a=Math.floor(i/24);if(a<30)return`Il y a ${a} j`;let o=Math.floor(a/30);return o<12?`Il y a ${o} mois`:`Il y a ${Math.floor(o/12)} an(s)`}function Z(e){let t=e?.status;if(t===401)return`Non authentifié — votre session Studio a expiré ou n'est plus reconnue par le firewall. Reconnectez-vous.`;if(t===403)return`Accès refusé — la gestion des webhooks est réservée aux administrateurs plateforme (ROLE_NODEFONY_ADMIN).`;if(t===422){let t=e?.message;return t?`URL refusée : ${t}`:`URL refusée — cible privée/interne interdite (protection anti-SSRF).`}if(t===400){let t=e?.message;return t?`Requête invalide : ${t}`:`Requête invalide.`}if(t===503)return`Webhooks indisponibles — désactivés en config sécurité (webhooks.enabled = false) ou store non provisionné.`;if(t===404)return`Endpoint introuvable — il a peut-être été supprimé entre-temps.`;let n=e?.message;return n?`Erreur de chargement des webhooks : ${n}`:`Erreur de chargement des webhooks.`}var Q=r();function Ie(e){try{return JSON.parse(e)}catch{return null}}function Le({d:e}){return(0,Q.jsx)(i,{variant:e.ok?`light`:`filled`,color:e.ok?`teal`:`red`,size:`sm`,leftSection:e.ok?(0,Q.jsx)(V,{size:12}):(0,Q.jsx)(xe,{size:12}),style:{textTransform:`none`,fontVariantNumeric:`tabular-nums`},children:e.status??(e.error?`réseau`:`—`)})}function Re({id:e}){let n=ae(),r=(0,J.useCallback)(async()=>{try{return(await n.api.getAbsolute(Oe(e))).deliveries??[]}catch(e){throw Error(Z(e),{cause:e})}},[n,e]),{data:a,loading:o,error:c,reload:l}=me(r),f=a??[];return(0,Q.jsxs)(v,{gap:`sm`,children:[(0,Q.jsxs)(t,{justify:`space-between`,children:[(0,Q.jsxs)(u,{size:`sm`,c:`dimmed`,children:[f.length,` livraison(s) récente(s) — gardées en mémoire (par pod, éphémère).`]}),(0,Q.jsx)(d,{size:`xs`,variant:`light`,leftSection:(0,Q.jsx)(N,{size:14}),loading:o,onClick:l,children:`Recharger`})]}),(0,Q.jsx)(s,{loading:o&&!a,error:c,empty:f.length===0,emptyMessage:`Aucune livraison encore. Déclenche un événement souscrit (ex. un login échoué) pour en voir arriver.`,onRetry:l,children:(0,Q.jsx)(L,{variant:`separated`,chevronPosition:`left`,children:f.map(e=>{let n=Ie(e.requestBody),r=e.responseBody?Ie(e.responseBody):null;return(0,Q.jsxs)(L.Item,{value:`${e.messageId}-${e.attempt}`,children:[(0,Q.jsx)(L.Control,{children:(0,Q.jsxs)(t,{gap:`sm`,wrap:`nowrap`,children:[(0,Q.jsx)(Le,{d:e}),(0,Q.jsx)(i,{variant:`outline`,color:`grape`,size:`sm`,style:{textTransform:`none`},children:e.type}),(0,Q.jsxs)(u,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[e.durationMs,` ms`]}),e.attempt>0&&(0,Q.jsxs)(i,{variant:`light`,color:`orange`,size:`xs`,children:[`retry #`,e.attempt]}),(0,Q.jsx)(b,{style:{flex:1}}),(0,Q.jsx)(u,{size:`xs`,c:`dimmed`,children:Fe(e.ts)})]})}),(0,Q.jsx)(L.Panel,{children:(0,Q.jsxs)(v,{gap:`xs`,children:[(0,Q.jsxs)(t,{gap:`lg`,children:[(0,Q.jsxs)(u,{size:`xs`,c:`dimmed`,children:[`Message\xA0`,(0,Q.jsx)(F,{children:e.messageId})]}),(0,Q.jsx)(u,{size:`xs`,c:`dimmed`,children:Pe(e.ts)})]}),e.error&&(0,Q.jsx)(u,{size:`sm`,c:`red`,style:{wordBreak:`break-word`},children:e.error}),(0,Q.jsxs)(u,{size:`xs`,fw:600,c:`dimmed`,children:[(0,Q.jsx)(B,{size:11}),` Envoyé (payload signé)`]}),n===null?(0,Q.jsx)(F,{block:!0,children:e.requestBody}):(0,Q.jsx)(S,{value:n,maxHeight:240}),(0,Q.jsxs)(u,{size:`xs`,fw:600,c:`dimmed`,children:[(0,Q.jsx)(z,{size:11}),` Réponse du destinataire`]}),e.responseBody===null?(0,Q.jsx)(u,{size:`xs`,c:`dimmed`,fs:`italic`,children:`(aucun corps de réponse)`}):r===null?(0,Q.jsx)(F,{block:!0,children:e.responseBody}):(0,Q.jsx)(S,{value:r,maxHeight:200})]})})]},`${e.messageId}-${e.attempt}`)})})})]})}var ze={memory:`mémoire (volatile)`,orm:`base SQL (ORM)`};function Be({enabled:e,size:t=`sm`}){return(0,Q.jsx)(i,{variant:e?`light`:`outline`,color:e?`teal`:`gray`,size:t,leftSection:e?(0,Q.jsx)(V,{size:12}):(0,Q.jsx)(W,{size:12}),style:{textTransform:`none`},children:e?`Actif`:`Désactivé`})}var Ve={never:{color:`gray`,label:`Jamais livré`,Icon:Se},ok:{color:`teal`,label:`OK`,Icon:V},failing:{color:`red`,label:`Échec`,Icon:xe}};function He({endpoint:e,size:t=`sm`}){let n=Me(e),r=Ve[n],a=e.lastDeliveryStatus,o=n===`ok`&&a!==null?`${a}`:n===`failing`&&a!==null?`Échec (${a})`:r.label,s=(0,Q.jsx)(i,{variant:n===`ok`?`light`:n===`failing`?`filled`:`outline`,color:r.color,size:t,leftSection:(0,Q.jsx)(r.Icon,{size:12}),style:{textTransform:`none`},children:o});return e.lastDeliveryError||a!==null?(0,Q.jsx)(y,{withArrow:!0,openDelay:150,multiline:!0,maw:340,label:(0,Q.jsxs)(v,{gap:2,children:[a!==null&&(0,Q.jsxs)(u,{size:`xs`,children:[`Code HTTP : `,a]}),e.lastDeliveryError&&(0,Q.jsxs)(u,{size:`xs`,children:[`Erreur : `,e.lastDeliveryError]})]}),children:s}):s}function Ue({count:e,size:t=`sm`}){return e===0?(0,Q.jsx)(u,{size:`sm`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:`0`}):(0,Q.jsx)(i,{variant:`light`,color:e>=5?`red`:`orange`,size:t,leftSection:(0,Q.jsx)(l,{size:12}),style:{textTransform:`none`,fontVariantNumeric:`tabular-nums`},children:e})}function We({events:e}){return e.includes(`*`)?(0,Q.jsx)(i,{variant:`light`,color:`grape`,size:`sm`,leftSection:(0,Q.jsx)(be,{size:12}),style:{textTransform:`none`},children:`Tous les événements`}):e.length===0?(0,Q.jsx)(u,{size:`sm`,c:`dimmed`,fs:`italic`,children:`aucun`}):(0,Q.jsx)(t,{gap:4,wrap:`wrap`,children:e.map(e=>(0,Q.jsx)(i,{variant:`outline`,color:`grape`,size:`sm`,style:{textTransform:`none`},children:e},e))})}function Ge({store:e,driver:t}){let n=t?ze[t]:`inconnu`,r=t===`orm`;return(0,Q.jsx)(y,{withArrow:!0,openDelay:150,multiline:!0,label:(0,Q.jsxs)(v,{gap:2,children:[(0,Q.jsxs)(u,{size:`xs`,children:[`Store : `,e]}),(0,Q.jsxs)(u,{size:`xs`,children:[`Driver : `,n]}),(0,Q.jsx)(u,{size:`xs`,children:r?`Endpoints persistés (survivent au redémarrage) ✓`:`⚠ Store volatile — endpoints perdus au redémarrage`})]}),children:(0,Q.jsx)(i,{variant:`light`,color:r?`grape`:`orange`,size:`sm`,leftSection:(0,Q.jsx)(fe,{size:12}),style:{textTransform:`none`},children:e})})}function $({k:e,children:n}){return(0,Q.jsxs)(t,{justify:`space-between`,wrap:`nowrap`,gap:`xl`,align:`flex-start`,children:[(0,Q.jsx)(u,{size:`sm`,c:`dimmed`,style:{flexShrink:0},children:e}),(0,Q.jsx)(b,{style:{textAlign:`right`,minWidth:0},children:n})]})}function Ke({ep:e,actions:t,busyId:n}){return(0,Q.jsxs)(x,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,Q.jsx)(x.Target,{children:(0,Q.jsx)(M,{variant:`subtle`,color:`gray`,"aria-label":`Actions du webhook ${e.url}`,loading:n===e.id,onClick:e=>e.stopPropagation(),children:(0,Q.jsx)(H,{size:16})})}),(0,Q.jsxs)(x.Dropdown,{onClick:e=>e.stopPropagation(),children:[(0,Q.jsx)(x.Item,{leftSection:(0,Q.jsx)(Ce,{size:14}),onClick:()=>t.onEdit(e),children:`Modifier`}),(0,Q.jsx)(x.Item,{leftSection:e.enabled?(0,Q.jsx)(W,{size:14}):(0,Q.jsx)(G,{size:14}),onClick:()=>t.onToggle(e),children:e.enabled?`Désactiver`:`Activer`}),(0,Q.jsx)(x.Item,{leftSection:(0,Q.jsx)(we,{size:14}),onClick:()=>t.onRotate(e),children:`Tourner le secret`}),(0,Q.jsx)(x.Item,{leftSection:(0,Q.jsx)(U,{size:14}),onClick:()=>t.onReveal(e),children:`Révéler le secret`}),(0,Q.jsx)(x.Divider,{}),(0,Q.jsx)(x.Item,{color:`red`,leftSection:(0,Q.jsx)(A,{size:14}),onClick:()=>t.onDelete(e),children:`Supprimer`})]})]})}var qe={enabled:{label:`État`,hint:`Actif = le dispatcher lui livre. Désactivé = à la main, ou par le coupe-circuit après trop d'échecs consécutifs.`,values:{true:`Actifs`,false:`Désactivés`}},event:{label:`Événement`,hint:`Endpoints ABONNÉS à cet événement — « qui écoute user.created ? ». Nom exact de l'événement.`,placeholder:`user.created`},failing:{label:`Livraison`,hint:`En échec = compteur d'échecs consécutifs non nul. Se cumule avec l'état : un endpoint actif peut être en échec.`,values:{true:`En échec`,false:`Sains`}}},Je=he(function({store:e,driver:n,filters:r,onFiltersChange:i,reloadKey:a=0,actions:o,busyId:s,onSearchChange:l}){let f=ae(),[m,g]=(0,J.useState)(null),[_,y]=(0,J.useState)(`infos`),x=f.admin.pageCapabilities(Y),{signal:S,filters:te}=ve(r),C=(0,J.useMemo)(de,[a]),E=(0,J.useCallback)(async e=>{try{return await le(C,e,te,async e=>{let t=await f.api.getAbsolute(`${Y}?${e}`);return{...t,items:t.endpoints??[]}})}catch(e){throw Error(Z(e),{cause:e})}},[f,te,C]),D=(0,J.useMemo)(()=>new Set(x?.sortable??[]),[x?.sortable]),O=(0,J.useMemo)(()=>[{key:`url`,header:`URL`,sortable:D.has(`url`),value:e=>e.url,render:e=>(0,Q.jsx)(u,{size:`sm`,style:{wordBreak:`break-all`},children:e.url}),size:240},{key:`description`,header:`Description`,sortable:D.has(`description`),value:e=>e.description??``,render:e=>e.description?(0,Q.jsx)(u,{size:`sm`,style:{wordBreak:`break-word`},children:e.description}):(0,Q.jsx)(u,{size:`sm`,c:`dimmed`,children:`—`}),size:180},{key:`events`,header:`Événements`,value:e=>e.events.join(`, `),render:e=>(0,Q.jsx)(We,{events:e.events}),size:200},{key:`enabled`,header:`État`,sortable:D.has(`enabled`),value:e=>e.enabled?`Actif`:`Désactivé`,render:e=>(0,Q.jsx)(Be,{enabled:e.enabled}),size:110},{key:`lastDelivery`,header:`Dernière livraison`,sortable:D.has(`lastDelivery`),value:e=>e.lastDeliveryAt??0,render:e=>(0,Q.jsxs)(t,{gap:6,wrap:`nowrap`,children:[(0,Q.jsx)(He,{endpoint:e}),(0,Q.jsx)(u,{size:`xs`,c:`dimmed`,children:Fe(e.lastDeliveryAt)})]}),size:200},{key:`failureCount`,header:`Échecs`,sortable:D.has(`failureCount`),align:`right`,value:e=>e.failureCount,render:e=>(0,Q.jsx)(Ue,{count:e.failureCount}),size:90},{key:`actions`,header:``,align:`right`,render:e=>(0,Q.jsx)(Ke,{ep:e,actions:o,busyId:s}),size:60}],[o,s,D]);return(0,Q.jsxs)(v,{gap:`md`,children:[(0,Q.jsxs)(t,{gap:`xs`,children:[(0,Q.jsx)(u,{size:`sm`,c:`dimmed`,children:`Clic sur une ligne pour le détail.`}),(0,Q.jsx)(p,{title:`Webhooks sortants`,version:ke,summary:`Un webhook notifie une URL externe quand un événement d'audit souscrit survient (modèle GitHub/Stripe). Chaque livraison est signée (Standard Webhooks v1) avec un secret propre à l'endpoint.`,sections:[{label:`Livraison`,body:`Au plus une livraison par événement matchant. En cas d'échec : retries bornés avec backoff, puis auto-désactivation au-delà d'un seuil (le compteur d'échecs consécutifs le pilote).`},{label:`Sécurité`,body:`L'URL est validée anti-SSRF (pas d'IP privée/interne, redirections 3xx non suivies, IP épinglée anti-rebinding). Le secret de signature est chiffré au repos et n'est montré qu'à la création/rotation/révélation.`},{label:`Anti-boucle`,body:`Les événements de la catégorie webhook (webhook.created/disabled…) ne déclenchent jamais de livraison (sinon boucle infinie).`}]}),(0,Q.jsx)(b,{style:{flex:1}}),(0,Q.jsx)(Ge,{store:e,driver:n})]}),(0,Q.jsx)(j,{spec:x?.filters??null,value:r,onChange:i,labels:qe}),(0,Q.jsx)(T,{mode:`server`,loader:E,columns:O,getRowId:e=>e.id,onRowClick:e=>{g(e),y(`infos`)},dimRow:e=>!e.enabled,initialSort:D.has(`url`)?{key:`url`,dir:`asc`}:void 0,searchable:x?.search??!1,onSearchChange:l,searchPlaceholder:`Rechercher (URL, description, événement…)`,resetPageSignal:S,pageSize:25,persist:{key:`studio.webhooks`,storage:`session`},emptyMessage:`Aucun webhook ne correspond.`}),(0,Q.jsx)(ee,{opened:m!==null,onClose:()=>g(null),title:m?(0,Q.jsxs)(t,{gap:`xs`,children:[(0,Q.jsx)(q,{size:18}),(0,Q.jsx)(u,{fw:700,children:`Webhook`}),(0,Q.jsx)(Be,{enabled:m.enabled})]}):``,centered:!0,size:`lg`,children:m&&(0,Q.jsxs)(h,{value:_,onChange:y,children:[(0,Q.jsxs)(h.List,{mb:`md`,children:[(0,Q.jsx)(h.Tab,{value:`infos`,leftSection:(0,Q.jsx)(w,{size:15}),children:`Infos`}),(0,Q.jsx)(h.Tab,{value:`deliveries`,leftSection:(0,Q.jsx)(ge,{size:15}),children:`Livraisons récentes`})]}),(0,Q.jsx)(h.Panel,{value:`infos`,children:(0,Q.jsxs)(v,{gap:`sm`,children:[(0,Q.jsx)($,{k:`URL de destination`,children:(0,Q.jsx)(c,{href:m.url,target:`_blank`,rel:`noreferrer noopener`,size:`sm`,style:{wordBreak:`break-all`},children:(0,Q.jsxs)(t,{gap:4,wrap:`nowrap`,justify:`flex-end`,children:[m.url,(0,Q.jsx)(P,{size:13})]})})}),(0,Q.jsx)($,{k:`Identifiant`,children:(0,Q.jsx)(F,{children:m.id})}),(0,Q.jsx)($,{k:`Événements`,children:(0,Q.jsx)(We,{events:m.events})}),m.description&&(0,Q.jsx)($,{k:`Description`,children:(0,Q.jsx)(u,{size:`sm`,children:m.description})}),(0,Q.jsx)($,{k:`Dernière livraison`,children:(0,Q.jsxs)(t,{gap:6,wrap:`nowrap`,justify:`flex-end`,children:[(0,Q.jsx)(He,{endpoint:m}),(0,Q.jsx)(u,{size:`sm`,c:`dimmed`,children:m.lastDeliveryAt===null?``:Pe(m.lastDeliveryAt)})]})}),m.lastDeliveryError&&(0,Q.jsx)($,{k:`Erreur de livraison`,children:(0,Q.jsx)(u,{size:`sm`,c:`red`,style:{wordBreak:`break-word`},children:m.lastDeliveryError})}),(0,Q.jsx)($,{k:`Échecs consécutifs`,children:(0,Q.jsx)(Ue,{count:m.failureCount})}),m.createdBy&&(0,Q.jsx)($,{k:`Créé par`,children:(0,Q.jsx)(F,{children:m.createdBy})}),m.tenantId&&(0,Q.jsx)($,{k:`Tenant`,children:(0,Q.jsx)(F,{children:m.tenantId})}),(0,Q.jsx)($,{k:`Créé le`,children:(0,Q.jsx)(u,{size:`sm`,children:Pe(m.createdAt)})}),(0,Q.jsx)($,{k:`Modifié le`,children:(0,Q.jsx)(u,{size:`sm`,children:Pe(m.updatedAt)})}),(0,Q.jsx)(I,{variant:`light`,color:`gray`,icon:(0,Q.jsx)(w,{size:16}),mt:`xs`,children:(0,Q.jsx)(u,{size:`xs`,children:`Le secret de signature n'est pas affiché ici : utilisez « Révéler le secret » (action sensible, auditée). « Tourner le secret » invalide immédiatement l'ancien.`})}),(0,Q.jsxs)(t,{justify:`space-between`,mt:`xs`,children:[(0,Q.jsx)(d,{variant:`default`,leftSection:m.enabled?(0,Q.jsx)(W,{size:16}):(0,Q.jsx)(G,{size:16}),onClick:()=>{let e=m;g(null),o.onToggle(e)},children:m.enabled?`Désactiver`:`Activer`}),(0,Q.jsxs)(t,{gap:`xs`,children:[(0,Q.jsx)(d,{variant:`light`,leftSection:(0,Q.jsx)(Ce,{size:16}),onClick:()=>{let e=m;g(null),o.onEdit(e)},children:`Modifier`}),(0,Q.jsx)(d,{color:`red`,variant:`light`,leftSection:(0,Q.jsx)(A,{size:16}),onClick:()=>{let e=m;g(null),o.onDelete(e)},children:`Supprimer`})]})]})]})}),(0,Q.jsx)(h.Panel,{value:`deliveries`,children:_===`deliveries`&&(0,Q.jsx)(Re,{id:m.id})})]})})]})}),Ye={created:{title:`Endpoint créé — copiez le secret`,once:!0,intro:`Configurez ce secret chez le destinataire pour qu'il vérifie la signature de chaque livraison.`},rotated:{title:`Secret régénéré — copiez le nouveau`,once:!0,intro:`L'ancien secret cesse immédiatement d'être valide. Mettez à jour le destinataire avec ce nouveau secret.`},revealed:{title:`Secret de signature`,once:!1,intro:`Secret en clair (réversible, conservé chiffré au repos). Copiez-le pour configurer ou diagnostiquer la vérification de signature.`}};function Xe({secret:e,url:n,context:r}){let i=Ye[r];return(0,Q.jsxs)(v,{gap:`md`,children:[(0,Q.jsx)(I,{role:`alert`,variant:`light`,color:i.once?`orange`:`blue`,icon:(0,Q.jsx)(l,{size:16}),title:i.once?`Copiez ce secret maintenant`:`Secret sensible`,children:i.once?(0,Q.jsxs)(Q.Fragment,{children:[`Il ne sera `,(0,Q.jsx)(`strong`,{children:`plus jamais affiché automatiquement`}),` `,`(récupérable seulement via « Révéler »). `,i.intro]}):i.intro}),(0,Q.jsxs)(b,{children:[(0,Q.jsxs)(u,{size:`sm`,c:`dimmed`,mb:4,children:[`Secret pour `,(0,Q.jsx)(F,{children:n})]}),(0,Q.jsxs)(t,{gap:`xs`,wrap:`nowrap`,align:`stretch`,style:{border:`1px solid var(--mantine-color-default-border)`,borderRadius:`var(--mantine-radius-sm)`,padding:`var(--mantine-spacing-xs)`},children:[(0,Q.jsx)(F,{block:!0,style:{flex:1,wordBreak:`break-all`,background:`transparent`},children:e}),(0,Q.jsx)(g,{value:e,timeout:2e3,children:({copied:e,copy:t})=>(0,Q.jsx)(d,{color:e?`teal`:`brand`,variant:e?`light`:`filled`,leftSection:e?(0,Q.jsx)(a,{size:16}):(0,Q.jsx)(_,{size:16}),onClick:t,children:e?`Copié`:`Copier`})})]})]}),(0,Q.jsx)(I,{variant:`light`,color:`gray`,icon:(0,Q.jsx)(pe,{size:16}),children:(0,Q.jsxs)(u,{size:`xs`,children:[`Signature `,(0,Q.jsx)(`strong`,{children:`Standard Webhooks v1`}),` : chaque livraison porte les en-têtes `,(0,Q.jsx)(F,{children:`webhook-id`}),`,`,` `,(0,Q.jsx)(F,{children:`webhook-timestamp`}),` et`,` `,(0,Q.jsx)(F,{children:`webhook-signature: v1,<base64>`}),` (HMAC-SHA256 de`,` `,(0,Q.jsx)(F,{children:`id.timestamp.payload`}),` avec ce secret). Le destinataire recalcule la signature pour authentifier l'appel.`]})})]})}function Ze({opened:e,onClose:n,secret:r,url:i,context:o}){return(0,Q.jsx)(ee,{opened:e,onClose:n,title:(0,Q.jsxs)(t,{gap:`xs`,children:[(0,Q.jsx)(o===`rotated`?we:U,{size:18}),(0,Q.jsx)(u,{fw:700,children:Ye[o].title})]}),centered:!0,size:`lg`,closeOnClickOutside:!1,children:r!==null&&(0,Q.jsxs)(v,{gap:`md`,children:[(0,Q.jsx)(Xe,{secret:r,url:i,context:o}),(0,Q.jsx)(t,{justify:`flex-end`,children:(0,Q.jsx)(d,{leftSection:(0,Q.jsx)(a,{size:16}),onClick:n,children:o===`rotated`?`J'ai copié le nouveau secret`:`Fermer`})})]})})}function Qe({opened:e,onClose:n,endpoint:r,onSaved:i}){let o=ae(),s=r!==null,[c,f]=(0,J.useState)(r?.url??``),[p,m]=(0,J.useState)(r?r.events.includes(`*`):!1),[h,g]=(0,J.useState)(r?r.events.filter(e=>e!==`*`):[]),[_,y]=(0,J.useState)(r?.description??``),[x,S]=(0,J.useState)(r?.enabled??!0),[w,T]=(0,J.useState)(!1),[E,D]=(0,J.useState)(null),[O,A]=(0,J.useState)(null),j=(0,J.useMemo)(()=>h.filter(e=>je.includes(e)),[h]),M=(0,J.useMemo)(()=>h.filter(e=>!je.includes(e)),[h]);function N(){let e=O!==null;n(),e&&i()}function ne(){return p?[`*`]:h}async function P(){D(null);let e=Ne(c);if(e){D(e);return}let t=ne();if(t.length===0)D(`Sélectionnez au moins un événement (ou « Tous les événements »).`);else{T(!0);try{let e=_.trim()===``?null:_.trim();if(s)await o.api.patchAbsolute(X(r.id),{url:c.trim(),events:t,description:e,enabled:x}),i(),n();else{let n=await o.api.postAbsolute(Y,{url:c.trim(),events:t,description:e,enabled:x});A(n)}}catch(e){D(Z(e))}finally{T(!1)}}}return(0,Q.jsx)(ee,{opened:e,onClose:N,title:(0,Q.jsxs)(t,{gap:`xs`,children:[(0,Q.jsx)(q,{size:18}),(0,Q.jsx)(u,{fw:700,children:O?`Webhook créé — copiez le secret`:s?`Modifier le webhook`:`Nouveau webhook`})]}),centered:!0,size:`lg`,closeOnClickOutside:O===null,children:O===null?(0,Q.jsxs)(v,{gap:`md`,children:[(0,Q.jsx)(b,{mih:44,children:E&&(0,Q.jsx)(I,{role:`alert`,variant:`light`,color:`red`,icon:(0,Q.jsx)(l,{size:16}),children:E})}),(0,Q.jsx)(te,{label:`URL de destination`,description:`Endpoint qui recevra les livraisons signées. Validé anti-SSRF côté serveur (pas d'IP privée/interne en prod). En dev, le récepteur de test local est sur le port http 5151.`,placeholder:`http://127.0.0.1:5151/nodefony/test/webhooks/sink`,required:!0,value:c,onChange:e=>{f(e.currentTarget.value),E&&D(null)},"data-autofocus":!0}),(0,Q.jsxs)(v,{gap:`xs`,children:[(0,Q.jsx)(k,{label:`Tous les événements (*)`,description:`Livrer chaque événement d'audit (sauf les événements webhook eux-mêmes, anti-boucle).`,checked:p,onChange:e=>m(e.currentTarget.checked),thumbIcon:p?(0,Q.jsx)(be,{size:12}):void 0}),!p&&(0,Q.jsxs)(v,{gap:`sm`,children:[(0,Q.jsx)(C.Group,{label:`Événements souscrits`,description:`Actions d'audit qui déclenchent une livraison. La liste s'enrichit côté serveur ; complétez librement ci-dessous si besoin.`,value:j,onChange:e=>g([...e,...M]),children:(0,Q.jsx)(v,{gap:`sm`,mt:`xs`,children:Ae.map(e=>(0,Q.jsxs)(b,{children:[(0,Q.jsx)(u,{size:`xs`,fw:600,c:`dimmed`,tt:`uppercase`,children:e.domain}),(0,Q.jsx)(v,{gap:4,mt:4,children:e.events.map(e=>(0,Q.jsx)(C,{value:e.value,label:e.label},e.value))})]},e.domain))})}),(0,Q.jsx)(ie,{label:`Événements personnalisés (optionnel)`,description:`Toute action d'audit hors catalogue (ex. user.created, order.shipped si émise par votre app).`,placeholder:`user.created, session.expired…`,value:M,onChange:e=>g([...j,...e]),clearable:!0})]})]}),(0,Q.jsx)(re,{label:`Description (optionnel)`,description:`Libellé humain pour reconnaître l'endpoint.`,placeholder:`Notifie le SIEM des connexions échouées`,value:_,maxLength:200,autosize:!0,minRows:1,maxRows:3,onChange:e=>y(e.currentTarget.value)}),(0,Q.jsx)(k,{label:`Actif`,description:`Un endpoint désactivé ne reçoit aucune livraison.`,checked:x,onChange:e=>S(e.currentTarget.checked)}),(0,Q.jsxs)(t,{justify:`flex-end`,mt:`xs`,children:[(0,Q.jsx)(d,{variant:`default`,onClick:N,children:`Annuler`}),(0,Q.jsx)(d,{leftSection:(0,Q.jsx)(q,{size:16}),loading:w,onClick:()=>void P(),children:s?`Enregistrer`:`Créer le webhook`})]})]}):(0,Q.jsxs)(v,{gap:`md`,children:[(0,Q.jsx)(Xe,{secret:O.secret,url:O.endpoint.url,context:`created`}),(0,Q.jsx)(t,{justify:`flex-end`,children:(0,Q.jsx)(d,{leftSection:(0,Q.jsx)(a,{size:16}),onClick:N,children:`J'ai copié le secret`})})]})})}function $e(){return(0,Q.jsxs)(v,{gap:`lg`,maw:820,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(E,{order:4,mb:4,children:`Qu'est-ce qu'un webhook ?`}),(0,Q.jsxs)(u,{size:`sm`,c:`dimmed`,children:[`Un webhook notifie une `,(0,Q.jsx)(`strong`,{children:`URL externe`}),` (votre application, un SIEM, un canal Slack…) chaque fois qu'un`,` `,(0,Q.jsx)(`strong`,{children:`événement d'audit`}),` souscrit survient côté serveur. Nodefony envoie une requête `,(0,Q.jsx)(F,{children:`POST`}),` signée à la destination ; à charge du destinataire de vérifier la signature puis de traiter l'événement.`]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(E,{order:4,mb:4,children:`Vérifier la signature (Standard Webhooks v1)`}),(0,Q.jsxs)(u,{size:`sm`,c:`dimmed`,mb:`xs`,children:[`Chaque livraison porte trois en-têtes ; le destinataire recalcule la signature avec le `,(0,Q.jsx)(`strong`,{children:`secret de l'endpoint`}),` et la compare en temps constant :`]}),(0,Q.jsxs)(R,{size:`sm`,spacing:4,children:[(0,Q.jsxs)(R.Item,{children:[(0,Q.jsx)(F,{children:`webhook-id`}),` — identifiant unique de la livraison (idempotence côté récepteur).`]}),(0,Q.jsxs)(R.Item,{children:[(0,Q.jsx)(F,{children:`webhook-timestamp`}),` — epoch (s) ; rejeter si trop ancien (anti-rejeu).`]}),(0,Q.jsxs)(R.Item,{children:[(0,Q.jsx)(F,{children:`webhook-signature`}),` —`,` `,(0,Q.jsx)(F,{children:`v1,<base64(HMAC-SHA256)>`}),` de la chaîne`,` `,(0,Q.jsx)(F,{children:`{id}.{timestamp}.{payload}`}),`.`]})]}),(0,Q.jsx)(I,{variant:`light`,color:`gray`,icon:(0,Q.jsx)(pe,{size:16}),mt:`xs`,children:(0,Q.jsxs)(u,{size:`xs`,children:[`Format conforme à la spécification`,` `,(0,Q.jsx)(`strong`,{children:`Standard Webhooks`}),` — la plupart des SDK (`,(0,Q.jsx)(F,{children:`standardwebhooks`}),`, Svix…) vérifient ces en-têtes nativement. Un slot `,(0,Q.jsx)(F,{children:`v1a`}),` (Ed25519) est réservé pour une signature asymétrique future.`]})})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(E,{order:4,mb:4,children:`Protections`}),(0,Q.jsxs)(R,{size:`sm`,spacing:4,children:[(0,Q.jsxs)(R.Item,{children:[(0,Q.jsx)(`strong`,{children:`Anti-SSRF`}),` : l'URL est refusée si elle pointe vers une IP privée/interne (RFC 6890) ; les redirections `,(0,Q.jsx)(F,{children:`3xx`}),` `,`ne sont pas suivies ; l'IP résolue est épinglée à la livraison (anti-rebinding DNS).`]}),(0,Q.jsxs)(R.Item,{children:[(0,Q.jsx)(`strong`,{children:`Retries bornés`}),` : un échec déclenche quelques tentatives avec backoff ; au-delà d'un seuil d'échecs consécutifs, l'endpoint est `,(0,Q.jsx)(`strong`,{children:`auto-désactivé`}),` (un événement d'audit`,` `,(0,Q.jsx)(F,{children:`webhook.disabled`}),` est tracé).`]}),(0,Q.jsxs)(R.Item,{children:[(0,Q.jsx)(`strong`,{children:`Anti-DoS`}),` : concurrence et file d'attente bornées — un destinataire lent ou mort ne met jamais le framework en danger.`]}),(0,Q.jsxs)(R.Item,{children:[(0,Q.jsx)(`strong`,{children:`Secret chiffré au repos`}),` (AES-256-GCM, réversible pour signer) — jamais stocké ni journalisé en clair.`]})]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(E,{order:4,mb:4,children:`Événements disponibles`}),(0,Q.jsxs)(u,{size:`sm`,c:`dimmed`,mb:`xs`,children:[`Un webhook s'abonne à des `,(0,Q.jsx)(`strong`,{children:`actions d'audit`}),` (`,(0,Q.jsx)(F,{children:`<sujet>.<verbe>`}),`). Cochez `,(0,Q.jsx)(be,{size:11}),` `,(0,Q.jsx)(`strong`,{children:`Tous les événements`}),` pour tout recevoir, ou choisissez dans le catalogue ci-dessous (complétable en saisie libre — la liste s'enrichit au fil des versions).`]}),(0,Q.jsxs)(D,{withTableBorder:!0,withColumnBorders:!0,striped:`odd`,children:[(0,Q.jsx)(D.Thead,{children:(0,Q.jsxs)(D.Tr,{children:[(0,Q.jsx)(D.Th,{children:`Domaine`}),(0,Q.jsx)(D.Th,{children:`Action`})]})}),(0,Q.jsx)(D.Tbody,{children:Ae.map(e=>e.events.map((t,n)=>(0,Q.jsxs)(D.Tr,{children:[n===0&&(0,Q.jsx)(D.Td,{rowSpan:e.events.length,children:(0,Q.jsx)(u,{size:`sm`,fw:600,children:e.domain})}),(0,Q.jsxs)(D.Td,{children:[(0,Q.jsx)(F,{children:t.value}),` `,(0,Q.jsx)(u,{span:!0,size:`xs`,c:`dimmed`,children:t.label.replace(`${t.value} — `,``)})]})]},t.value)))})]}),(0,Q.jsx)(I,{variant:`light`,color:`orange`,icon:(0,Q.jsx)(l,{size:16}),mt:`xs`,children:(0,Q.jsxs)(u,{size:`xs`,children:[`Les événements de la catégorie `,(0,Q.jsx)(F,{children:`webhook.*`}),` ne sont`,` `,(0,Q.jsx)(`strong`,{children:`pas`}),` livrables (garde anti-boucle : un webhook ne déclenche pas un webhook).`]})})]})]})}var et=he(()=>{let e=ae(),n=oe(),[r,i]=(0,J.useState)(void 0),[a,o]=(0,J.useState)(null),[c,p]=(0,J.useState)(null),[g,_]=(0,J.useState)(!1),[y,b]=(0,J.useState)(null),[x,S]=(0,J.useState)({}),[te,C]=(0,J.useState)(``),[w,T]=(0,J.useState)(0),E=(0,J.useCallback)(async()=>{try{return await e.api.getAbsolute(`${Y}?limit=1`)}catch(e){throw Error(Z(e),{cause:e})}},[e]),{data:D,loading:k,error:j,reload:M}=me(E),P=(0,J.useCallback)(()=>{M(),T(e=>e+1)},[M]),F=D?.enabled??!1,L=e.admin.pageCapabilities(Te),re=ue(x,L,te).toString(),R=(0,J.useCallback)(()=>e.api.getAbsolute(re?`${Te}?${re}`:Te),[e,re]),{data:ie,reload:z}=me(R),B=_e(L,x,S),H=(0,J.useMemo)(()=>ie??{total:null,active:null,disabled:null,failing:null},[ie]),U=(0,J.useCallback)(async t=>{b(t.id);try{await e.api.patchAbsolute(X(t.id),{enabled:!t.enabled}),n.notify(`success`,`Webhook ${t.enabled?`désactivé`:`activé`}.`,{source:`api`}),P(),z()}catch(e){n.notify(`error`,Z(e),{source:`api`})}finally{b(null)}},[e,n,P,z]),G=(0,J.useCallback)(async t=>{b(t.id);try{let n=await e.api.postAbsolute(Ee(t.id));o({context:`rotated`,secret:n.secret,url:t.url}),P(),z()}catch(e){n.notify(`error`,Z(e),{source:`api`})}finally{b(null)}},[e,n,P,z]),le=(0,J.useCallback)(async t=>{b(t.id);try{let n=await e.api.postAbsolute(De(t.id));o({context:`revealed`,secret:n.secret,url:t.url})}catch(e){n.notify(`error`,Z(e),{source:`api`})}finally{b(null)}},[e,n]);async function de(){if(!c)return;let t=c;_(!0);try{await e.api.deleteAbsolute(X(t.id)),n.notify(`success`,`Webhook supprimé.`,{source:`api`}),p(null),P(),z()}catch(e){n.notify(`error`,Z(e),{source:`api`})}finally{_(!1)}}let fe=(0,J.useMemo)(()=>({onEdit:e=>i(e),onToggle:e=>void U(e),onRotate:e=>void G(e),onReveal:e=>void le(e),onDelete:e=>p(e)}),[U,G,le]),pe=`${K(H.total)} endpoint(s) · ${K(H.active)} actif(s)${H.failing!==null&&H.failing>0?` · ${H.failing} en échec`:``}`;return(0,Q.jsxs)(m,{title:`Webhooks`,subtitle:pe,icon:(0,Q.jsx)(q,{size:26}),actions:(0,Q.jsxs)(t,{gap:`sm`,wrap:`nowrap`,children:[(0,Q.jsx)(ye,{brick:`webhooks`}),(0,Q.jsx)(d,{leftSection:(0,Q.jsx)(ce,{size:16}),disabled:!F,onClick:()=>i(null),children:`Nouveau webhook`}),(0,Q.jsx)(d,{variant:`light`,leftSection:(0,Q.jsx)(N,{size:16}),loading:k,onClick:P,children:`Recharger`})]}),children:[D&&!F&&(0,Q.jsxs)(I,{variant:`light`,color:`orange`,icon:(0,Q.jsx)(l,{size:16}),title:`Webhooks désactivés`,children:[`Le sous-système webhooks est désactivé en configuration sécurité (`,(0,Q.jsx)(u,{span:!0,ff:`monospace`,fz:`xs`,children:`webhooks.enabled = false`}),`) ou son store n'est pas provisionné. La création est indisponible ; les endpoints existants (s'il y en a) sont affichés en lecture seule.`]}),(0,Q.jsxs)(ne,{children:[(0,Q.jsx)(f,{label:`Total`,...B(`total`,`tout le registre (retire les filtres de facette)`),icon:(0,Q.jsx)(q,{size:20,color:`var(--mantine-color-brand-5)`}),hint:`Nombre d'endpoints enregistrés, compté par le serveur sur le registre ENTIER — pas sur les lignes affichées. « — » = webhooks coupés ou backend incapable de compter.`,children:(0,Q.jsx)(u,{fz:28,fw:700,style:{fontVariantNumeric:`tabular-nums`},children:K(H.total)})}),(0,Q.jsx)(f,{label:`Actifs`,...B(`active`,`les endpoints actifs`),icon:(0,Q.jsx)(V,{size:20,color:`var(--mantine-color-teal-6)`}),hint:`Endpoints qui reçoivent les livraisons (enabled).`,children:(0,Q.jsx)(u,{fz:28,fw:700,c:`teal`,style:{fontVariantNumeric:`tabular-nums`},children:K(H.active)})}),(0,Q.jsx)(f,{label:`En échec`,...B(`failing`,`les endpoints en échec de livraison`),icon:(0,Q.jsx)(l,{size:20,color:`var(--mantine-color-orange-6)`}),hint:`Endpoints avec au moins un échec de livraison consécutif courant (auto-désactivation au-delà du seuil). Recoupe « Actifs » et « Désactivés » : un endpoint peut être actif ET en échec.`,children:(0,Q.jsx)(u,{fz:28,fw:700,c:H.failing!==null&&H.failing>0?`orange`:void 0,style:{fontVariantNumeric:`tabular-nums`},children:K(H.failing)})}),(0,Q.jsx)(f,{label:`Désactivés`,...B(`disabled`,`les endpoints désactivés`),icon:(0,Q.jsx)(W,{size:20,color:`var(--mantine-color-gray-6)`}),hint:`Endpoints inactifs (désactivés manuellement ou auto-désactivés après trop d'échecs).`,children:(0,Q.jsx)(u,{fz:28,fw:700,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:K(H.disabled)})})]}),(0,Q.jsxs)(h,{defaultValue:`endpoints`,mt:`xs`,children:[(0,Q.jsxs)(h.List,{children:[(0,Q.jsx)(h.Tab,{value:`endpoints`,leftSection:(0,Q.jsx)(O,{size:15}),children:`Endpoints`}),(0,Q.jsx)(h.Tab,{value:`help`,leftSection:(0,Q.jsx)(se,{size:15}),children:`Utilisation & aide`})]}),(0,Q.jsx)(h.Panel,{value:`endpoints`,pt:`md`,children:(0,Q.jsx)(s,{loading:k&&!D,error:j,onRetry:P,children:(0,Q.jsx)(Je,{store:D?.store??`none`,driver:D?.driver??null,filters:x,onFiltersChange:S,reloadKey:w,actions:fe,busyId:y,onSearchChange:C})})}),(0,Q.jsx)(h.Panel,{value:`help`,pt:`md`,children:(0,Q.jsx)($e,{})})]}),r!==void 0&&(0,Q.jsx)(Qe,{opened:!0,endpoint:r,onClose:()=>i(void 0),onSaved:P},r?.id??`create`),(0,Q.jsx)(Ze,{opened:a!==null,onClose:()=>o(null),secret:a?.secret??null,url:a?.url??``,context:a?.context??`revealed`}),(0,Q.jsx)(ee,{opened:c!==null,onClose:()=>g?void 0:p(null),title:(0,Q.jsxs)(t,{gap:`xs`,children:[(0,Q.jsx)(A,{size:18,color:`var(--mantine-color-red-6)`}),(0,Q.jsx)(u,{fw:700,children:`Supprimer le webhook ?`})]}),centered:!0,children:c&&(0,Q.jsxs)(v,{gap:`md`,children:[(0,Q.jsx)(I,{variant:`light`,color:`red`,icon:(0,Q.jsx)(l,{size:16}),children:(0,Q.jsxs)(u,{size:`sm`,children:[`L'endpoint`,` `,(0,Q.jsx)(u,{span:!0,ff:`monospace`,fz:`xs`,children:c.url}),` `,`sera `,(0,Q.jsx)(`strong`,{children:`définitivement supprimé`}),` ; plus aucune livraison ne lui sera envoyée. Action irréversible (auditée).`]})}),(0,Q.jsxs)(t,{justify:`flex-end`,children:[(0,Q.jsx)(d,{variant:`default`,disabled:g,onClick:()=>p(null),children:`Annuler`}),(0,Q.jsx)(d,{color:`red`,leftSection:(0,Q.jsx)(A,{size:16}),loading:g,onClick:()=>void de(),children:`Supprimer`})]})]})})]})});export{et as Webhooks,et as default};
@@ -1 +0,0 @@
1
- import{k as e}from"./src-3uYsZQ6M.js";import{$n as t,Di as n,Dr as r,En as i,Et as a,It as o,Mt as s,Nt as c,Rn as l,Tn as u,Tt as d,Z as f,_n as p,bt as m,cn as h,cr as g,dn as _,dr as v,gn as y,hn as b,in as ee,lr as x,lt as S,rn as C,sn as w,st as T,tr as E,ut as D,wn as O}from"./ui-CQg7PBQQ.js";import{t as te}from"./Collapse-D-ll8NHt.js";import{t as k}from"./Chip-63u3nm6a.js";import{_ as A,c as j,f as M,g as N,l as P,m as F,p as I,r as L,u as R,v as ne}from"./stores-D6_Y8E6i.js";import{t as re}from"./IconApps-99oikTTs.js";import{t as ie}from"./IconArrowLeft-BjXaYGFL.js";import{n as ae,t as oe}from"./useBlockSource-DhXmelWN.js";import{t as se}from"./IconDots-CGp_6hGw.js";import{t as z}from"./IconLayoutGrid-CfSdAIlD.js";import{t as ce}from"./IconPencil-BpxtlIcN.js";import{t as B}from"./IconPlus-B4Sx19oD.js";import{C as le,S as ue,St as V,et as de,gt as fe,w as H}from"./index-D7ndDYxA.js";import{n as pe}from"./realtimeHealth-CEJDxl45.js";var U=o(`outline`,`arrows-minimize`,`ArrowsMinimize`,[[`path`,{d:`M5 9l4 0l0 -4`,key:`svg-0`}],[`path`,{d:`M3 3l6 6`,key:`svg-1`}],[`path`,{d:`M5 15l4 0l0 4`,key:`svg-2`}],[`path`,{d:`M3 21l6 -6`,key:`svg-3`}],[`path`,{d:`M19 9l-4 0l0 -4`,key:`svg-4`}],[`path`,{d:`M15 9l6 -6`,key:`svg-5`}],[`path`,{d:`M19 15l-4 0l0 4`,key:`svg-6`}],[`path`,{d:`M15 15l6 6`,key:`svg-7`}]]),me=o(`outline`,`dots-vertical`,`DotsVertical`,[[`path`,{d:`M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M11 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M11 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}]]),W=o(`outline`,`grip-vertical`,`GripVertical`,[[`path`,{d:`M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}],[`path`,{d:`M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-5`}]]),G=e(n(),1),K=r(),he=V(({def:e,instance:n,ctx:r,dragHandlers:i,resizeHandlers:a})=>{let o=R(),s=ae(e.source,r.live),c=e.icon,u=e.source.kind!==`snapshot`;return(0,K.jsxs)(O,{withBorder:!0,radius:`md`,p:`sm`,h:`100%`,style:{contain:`content`,position:`relative`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,K.jsxs)(t,{justify:`space-between`,wrap:`nowrap`,mb:`xs`,style:{flexShrink:0},children:[(0,K.jsxs)(t,{gap:`xs`,wrap:`nowrap`,style:{minWidth:0,cursor:i?`grab`:void 0,touchAction:`none`},...i,children:[i?(0,K.jsx)(W,{size:14,style:{opacity:.45,flexShrink:0}}):null,(0,K.jsx)(C,{variant:`light`,color:`gray`,size:`sm`,radius:`md`,children:(0,K.jsx)(c,{size:15})}),(0,K.jsx)(l,{fw:600,size:`sm`,truncate:!0,children:e.title}),u?(0,K.jsx)(v,{"aria-hidden":!0,style:{width:7,height:7,borderRadius:`50%`,flexShrink:0,background:s.source.fromLive?`var(--mantine-color-teal-6)`:`var(--mantine-color-gray-5)`}}):null]}),(0,K.jsxs)(y,{position:`bottom-end`,withinPortal:!0,children:[(0,K.jsx)(y.Target,{children:(0,K.jsx)(E,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Options du widget`,children:(0,K.jsx)(me,{size:15})})}),(0,K.jsxs)(y.Dropdown,{children:[(0,K.jsx)(y.Label,{children:ne[e.category]}),(0,K.jsx)(y.Item,{color:`red`,leftSection:(0,K.jsx)(H,{size:14}),onClick:()=>o.removeWidget(e.id),children:`Retirer du bureau`})]})]})]}),(0,K.jsx)(v,{style:{flex:1,minHeight:0,overflow:`auto`},children:(0,K.jsx)(oe,{def:e,state:s,ctx:r,span:Math.max(1,Math.min(12,Math.round(n.w*12))),container:`widget`})}),a?(0,K.jsx)(v,{"aria-hidden":!0,...a,style:{position:`absolute`,right:3,bottom:3,width:14,height:14,cursor:`nwse-resize`,touchAction:`none`,borderRight:`2px solid var(--mantine-color-dimmed)`,borderBottom:`2px solid var(--mantine-color-dimmed)`,borderBottomRightRadius:4,opacity:.5}}):null]})}),ge=6,_e=V(({layout:e,ctx:t})=>{let n=R(),r=(0,G.useRef)(null),i=(0,G.useRef)(null),a=(0,G.useRef)(null),o=(0,G.useRef)(0),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),d=e.items.filter(e=>I(e.widgetId)),f=d.reduce((e,t)=>Math.max(e,t.y+t.h),0)+80,p=(0,G.useCallback)(e=>{let t=i.current;t&&(t.cx=e.clientX,t.cy=e.clientY,!o.current&&(o.current=requestAnimationFrame(()=>{o.current=0;let e=i.current;e&&(e.el.style.transform=`translate3d(${e.cx-e.sx}px, ${e.cy-e.sy}px, 0)`)})))},[]),m=(0,G.useCallback)(e=>{let t=i.current;if(!t)return;o.current&&=(cancelAnimationFrame(o.current),0);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}t.el.style.transform=``,t.el.style.willChange=``,document.body.style.userSelect=``;let r=t.ox+(t.cx-t.sx)/t.W,a=t.oy+(t.cy-t.sy);i.current=null,c(null),n.moveTo(t.id,r,a)},[n]),h=(0,G.useCallback)((e,t,a)=>o=>{if(o.button!==0)return;let s=r.current,l=o.currentTarget.closest(`[data-window]`);if(s&&l){o.preventDefault();try{o.currentTarget.setPointerCapture(o.pointerId)}catch{}n.bringToFront(e),i.current={id:e,el:l,sx:o.clientX,sy:o.clientY,cx:o.clientX,cy:o.clientY,ox:t,oy:a,W:s.getBoundingClientRect().width||1},l.style.willChange=`transform`,document.body.style.userSelect=`none`,c(e)}},[n]),g=(0,G.useCallback)(e=>{let t=a.current;t&&(t.cx=e.clientX,t.cy=e.clientY,!o.current&&(o.current=requestAnimationFrame(()=>{o.current=0;let e=a.current;if(!e)return;let t=M(e.w0+(e.cx-e.sx)/e.W,A,1),n=Math.max(96,e.h0+(e.cy-e.sy));e.el.style.width=`${t*100}%`,e.el.style.height=`${n}px`})))},[]),_=(0,G.useCallback)(e=>{let t=a.current;if(!t)return;o.current&&=(cancelAnimationFrame(o.current),0);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}t.el.style.willChange=``,document.body.style.userSelect=``;let r=M(t.w0+(t.cx-t.sx)/t.W,A,1),i=Math.max(96,t.h0+(t.cy-t.sy));a.current=null,u(null),n.setSize(t.id,r,i)},[n]),y=(0,G.useCallback)((e,t,i)=>o=>{if(o.button!==0)return;let s=r.current,c=o.currentTarget.closest(`[data-window]`);if(s&&c){o.preventDefault(),o.stopPropagation();try{o.currentTarget.setPointerCapture(o.pointerId)}catch{}n.bringToFront(e),a.current={id:e,el:c,sx:o.clientX,sy:o.clientY,cx:o.clientX,cy:o.clientY,w0:t,h0:i,W:s.getBoundingClientRect().width||1},c.style.willChange=`width, height`,document.body.style.userSelect=`none`,u(e)}},[n]);return(0,K.jsx)(v,{ref:r,style:{position:`relative`,minHeight:f,width:`100%`,isolation:`isolate`},children:d.map(e=>{let r=I(e.widgetId);if(!r)return null;let i=s===e.widgetId||l===e.widgetId;return(0,K.jsx)(v,{"data-window":!0,"data-widget":e.widgetId,onPointerDownCapture:()=>n.bringToFront(e.widgetId),style:{position:`absolute`,left:`${e.x*100}%`,top:e.y,width:`${e.w*100}%`,height:e.h,padding:ge,zIndex:e.z,transition:i?`none`:`left .18s ease, top .18s ease, width .12s ease, height .12s ease`},children:(0,K.jsx)(he,{def:r,instance:e,ctx:t,dragHandlers:{onPointerDown:h(e.widgetId,e.x,e.y),onPointerMove:p,onPointerUp:m},resizeHandlers:{onPointerDown:y(e.widgetId,e.w,e.h),onPointerMove:g,onPointerUp:_}})},e.widgetId)})})}),ve=[{id:`runtime`,label:`Runtime & lancement`,group:`domaine`},{id:`config`,label:`Configuration`,group:`domaine`},{id:`systeme`,label:`Système & santé`,group:`domaine`},{id:`orm`,label:`Données / ORM`,group:`domaine`},{id:`logs`,label:`Logs`,group:`domaine`},{id:`realtime`,label:`Temps réel`,group:`domaine`},{id:`cluster`,label:`Cluster`,group:`domaine`},{id:`erreurs`,label:`Erreurs`,group:`domaine`},{id:`securite`,label:`Sécurité`,group:`domaine`},{id:`compte`,label:`Mon compte`,group:`domaine`},{id:`ia`,label:`IA`,group:`domaine`},{id:`cpu`,label:`CPU`,group:`domaine`,parent:`systeme`},{id:`memoire`,label:`Mémoire`,group:`domaine`,parent:`systeme`},{id:`event-loop`,label:`Event-loop`,group:`domaine`,parent:`systeme`},{id:`gc`,label:`Garbage Collector`,group:`domaine`,parent:`systeme`},{id:`sante`,label:`Santé`,group:`domaine`,parent:`systeme`},{id:`handles`,label:`Ressources actives`,group:`domaine`,parent:`systeme`},{id:`identite`,label:`Identité`,group:`domaine`,parent:`systeme`},{id:`orm-debit`,label:`Débit`,group:`domaine`,parent:`orm`},{id:`orm-connecteurs`,label:`Connecteurs`,group:`domaine`,parent:`orm`},{id:`kpi`,label:`KPI (valeur)`,group:`nature`},{id:`graphe`,label:`Graphe (courbe)`,group:`nature`},{id:`indice`,label:`Indice composite`,group:`nature`},{id:`liste`,label:`Liste / flux`,group:`nature`},{id:`panneau`,label:`Panneau`,group:`nature`}],ye=Object.fromEntries(ve.map(e=>[e.id,e]));function q(e){return ye[e]}function J(e,t){return ve.filter(n=>n.group===e&&(t===void 0||n.parent===t))}function be(e){return{clusterReady:e.clusterAware===!0,realtime:e.source.kind!==`snapshot`}}var xe=`min(1280px, 95vw)`,Se=`min(720px, 90vh)`,Ce=e=>e.normalize(`NFD`).replace(/\p{Diacritic}/gu,``).toLowerCase();function Y(e,t){return(e.tags??[]).includes(t)}function we({def:e,roles:t}){let n=ae(e.source,!0);return(0,K.jsx)(v,{style:{height:230,overflow:`auto`,padding:8,border:`1px solid var(--mantine-color-default-border)`,borderRadius:8,background:`var(--mantine-color-body)`},children:(0,K.jsx)(oe,{def:e,state:n,ctx:{live:!0,cluster:!1,instanceCount:1,roles:t},span:6,container:`widget`})})}function Te({def:e}){let t=be(e);return(0,K.jsxs)(K.Fragment,{children:[t.clusterReady?(0,K.jsx)(i,{size:`xs`,variant:`light`,color:`grape`,children:`cluster-ready`}):null,t.realtime?(0,K.jsx)(i,{size:`xs`,variant:`light`,color:`teal`,children:`temps réel`}):null]})}function Ee({def:e,onBoard:n,roles:r,onToggle:o}){let s=e.icon,c=(e.tags??[]).map(q).filter(e=>!!e);return(0,K.jsxs)(p,{width:400,position:`right`,openDelay:220,closeDelay:80,withinPortal:!0,shadow:`md`,radius:`md`,children:[(0,K.jsx)(p.Target,{children:(0,K.jsx)(g,{"aria-pressed":n,onClick:o,style:{height:`100%`},children:(0,K.jsxs)(h,{gap:6,p:`sm`,h:`100%`,style:{border:`1px solid ${n?`var(--mantine-color-teal-5)`:`var(--mantine-color-default-border)`}`,borderRadius:10,background:n?`var(--mantine-color-teal-light)`:void 0},children:[(0,K.jsxs)(t,{gap:`sm`,wrap:`nowrap`,align:`flex-start`,children:[(0,K.jsx)(C,{variant:`light`,color:n?`teal`:`gray`,radius:`md`,children:(0,K.jsx)(s,{size:16})}),(0,K.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,K.jsx)(l,{size:`sm`,fw:600,truncate:!0,children:e.title}),(0,K.jsx)(l,{size:`xs`,c:`dimmed`,lineClamp:2,children:e.description})]}),(0,K.jsx)(C,{variant:n?`filled`:`light`,color:n?`teal`:`blue`,radius:`xl`,size:`sm`,children:n?(0,K.jsx)(a,{size:14}):(0,K.jsx)(B,{size:14})})]}),(0,K.jsxs)(t,{gap:4,wrap:`wrap`,children:[(0,K.jsx)(Te,{def:e}),c.map(e=>(0,K.jsx)(i,{size:`xs`,variant:`default`,children:e.label},e.id))]})]})})}),(0,K.jsx)(p.Dropdown,{p:`sm`,children:(0,K.jsxs)(h,{gap:`sm`,children:[(0,K.jsxs)(t,{gap:`xs`,wrap:`wrap`,children:[(0,K.jsx)(C,{variant:`light`,color:`gray`,radius:`md`,size:`sm`,children:(0,K.jsx)(s,{size:15})}),(0,K.jsx)(l,{fw:700,size:`sm`,children:e.title}),(0,K.jsx)(Te,{def:e})]}),(0,K.jsx)(l,{size:`xs`,c:`dimmed`,children:e.description}),(0,K.jsx)(l,{size:`xs`,fw:700,tt:`uppercase`,c:`dimmed`,children:`Aperçu en direct`}),(0,K.jsx)(we,{def:e,roles:r}),(0,K.jsx)(u,{size:`xs`,fullWidth:!0,variant:n?`light`:`filled`,color:n?`red`:`blue`,leftSection:n?(0,K.jsx)(a,{size:14}):(0,K.jsx)(B,{size:14}),onClick:o,children:n?`Retirer du bureau`:`Ajouter au bureau`})]})})]})}var X=`all`,De=V(({opened:e,onClose:n})=>{let r=R(),a=L(),o=F(a.roles),[c,u]=(0,G.useState)(``),[d,f]=(0,G.useState)(!1),[p,m]=(0,G.useState)(X),[g,v]=(0,G.useState)(X),[y,C]=(0,G.useState)(X),[w,T]=(0,G.useState)(!1),[D,O]=(0,G.useState)(!1),te=(0,G.useMemo)(()=>J(`domaine`).filter(e=>!e.parent),[]),A=(0,G.useMemo)(()=>p===X?[]:J(`domaine`,p),[p]),j=(0,G.useMemo)(()=>J(`nature`),[]),M=c.trim(),N=(0,G.useMemo)(()=>{let e=Ce(M).split(/\s+/).filter(Boolean);return o.filter(t=>{if(p!==X&&!Y(t,p)||g!==X&&!Y(t,g)||y!==X&&!Y(t,y))return!1;let n=be(t);if(w&&!n.clusterReady||D&&!n.realtime)return!1;if(e.length){let n=Ce(`${t.title} ${t.description} ${(t.tags??[]).map(e=>q(e)?.label??``).join(` `)}`);if(!e.every(e=>n.includes(e)))return!1}return!0})},[o,M,p,g,y,w,D]),P=e=>o.filter(t=>Y(t,e)).length;return(0,K.jsx)(b,{opened:e,onClose:n,centered:!0,radius:`md`,size:`auto`,fullScreen:d,title:(0,K.jsxs)(t,{gap:`xs`,children:[(0,K.jsx)(l,{fw:700,children:`Catalogue de blocs`}),(0,K.jsx)(i,{variant:`light`,color:`gray`,children:o.length}),(0,K.jsx)(_,{label:d?`Réduire (16/9)`:`Plein écran`,withArrow:!0,children:(0,K.jsx)(E,{variant:`subtle`,color:`gray`,size:`sm`,onClick:()=>f(e=>!e),"aria-label":d?`Réduire la fenêtre`:`Passer en plein écran`,children:d?(0,K.jsx)(U,{size:16}):(0,K.jsx)(s,{size:16})})})]}),styles:{content:{display:`flex`,flexDirection:`column`,...d?{}:{width:xe,height:Se}},header:{flexShrink:0},body:{flex:1,minHeight:0,display:`flex`,flexDirection:`column`}},children:(0,K.jsxs)(h,{gap:`sm`,style:{flex:1,minHeight:0},children:[(0,K.jsx)(ee,{placeholder:`Rechercher un bloc (titre, description, tag)…`,leftSection:(0,K.jsx)(S,{size:16}),value:c,onChange:e=>u(e.currentTarget.value),"aria-label":`Rechercher un bloc dans le catalogue`}),(0,K.jsx)(k.Group,{value:p,onChange:e=>{m(e||X),v(X)},children:(0,K.jsxs)(t,{gap:6,wrap:`wrap`,children:[(0,K.jsxs)(k,{value:X,size:`xs`,variant:`light`,children:[`Tous (`,o.length,`)`]}),te.map(e=>(0,K.jsxs)(k,{value:e.id,size:`xs`,variant:`light`,children:[e.label,` (`,P(e.id),`)`]},e.id))]})}),A.length>0?(0,K.jsx)(k.Group,{value:g,onChange:e=>v(e||X),children:(0,K.jsxs)(t,{gap:6,wrap:`wrap`,pl:`md`,children:[(0,K.jsxs)(k,{value:X,size:`xs`,children:[`Tout `,q(p)?.label]}),A.map(e=>(0,K.jsx)(k,{value:e.id,size:`xs`,children:e.label},e.id))]})}):null,(0,K.jsxs)(t,{gap:`md`,wrap:`wrap`,children:[(0,K.jsx)(k.Group,{value:y,onChange:e=>C(e||X),children:(0,K.jsxs)(t,{gap:6,wrap:`wrap`,children:[(0,K.jsx)(l,{size:`xs`,c:`dimmed`,fw:600,children:`Nature`}),(0,K.jsx)(k,{value:X,size:`xs`,variant:`outline`,children:`Toutes`}),j.map(e=>(0,K.jsx)(k,{value:e.id,size:`xs`,variant:`outline`,children:e.label},e.id))]})}),(0,K.jsxs)(t,{gap:6,wrap:`nowrap`,children:[(0,K.jsx)(k,{checked:w,onChange:T,size:`xs`,color:`grape`,children:`cluster-ready`}),(0,K.jsx)(k,{checked:D,onChange:O,size:`xs`,color:`teal`,children:`temps réel`})]})]}),(0,K.jsxs)(x,{style:{flex:1},type:`auto`,children:[(0,K.jsx)(fe,{cols:{base:1,sm:2,lg:3},spacing:`sm`,pr:`xs`,children:N.map(e=>(0,K.jsx)(Ee,{def:e,roles:a.roles,onBoard:r.hasWidget(e.id),onToggle:()=>r.hasWidget(e.id)?r.removeWidget(e.id):r.addWidget(e.id)},e.id))}),N.length===0?(0,K.jsx)(l,{c:`dimmed`,size:`sm`,py:`xl`,ta:`center`,children:`Aucun bloc pour ces filtres.`}):null]})]})})}),Z=156,Q=88,Oe=4;function ke({layout:e,active:t}){let n=e.items,r=n.reduce((e,t)=>Math.max(e,t.y+t.h),0)||1;return(0,K.jsxs)(v,{"aria-hidden":!0,style:{position:`relative`,width:Z,height:Q,borderRadius:6,overflow:`hidden`,background:`radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--mantine-color-indigo-9) 16%, var(--mantine-color-body)) 0%, var(--mantine-color-body) 70%)`,border:`${t?`2px`:`1px`} solid ${t?`var(--mantine-color-brand-5)`:`var(--mantine-color-default-border)`}`},children:[n.map(e=>(0,K.jsx)(v,{style:{position:`absolute`,left:e.x*Z+1,top:e.y/r*Q+1,width:Math.max(2,e.w*Z-2),height:Math.max(2,e.h/r*Q-2),borderRadius:2,background:`color-mix(in srgb, var(--mantine-color-brand-5) 38%, var(--mantine-color-body))`,border:`1px solid var(--mantine-color-brand-4)`}},e.widgetId)),n.length===0?(0,K.jsx)(l,{size:`9px`,c:`dimmed`,style:{position:`absolute`,inset:0,display:`grid`,placeItems:`center`},children:`vide`}):null]})}var Ae=V(()=>{let e=R(),n=L(),[r,a]=(0,G.useState)(!0),[o,s]=(0,G.useState)(null),[u,f]=(0,G.useState)(``),p=e.layoutList.filter(e=>N(e.id,n.roles)),h=e.active,b=p.length>1,x=(0,G.useRef)(null),S=(0,G.useRef)(null),[C,w]=(0,G.useState)(null),[D,O]=(0,G.useState)(void 0),k=(0,G.useCallback)((e,t)=>{let n=x.current;if(!n)return null;let r=Array.from(n.querySelectorAll(`[data-ws-id]`));for(let n of r){let r=n.dataset.wsId;if(!r||r===t)continue;let i=n.getBoundingClientRect();if(e<i.left+i.width/2)return r}return null},[]),A=(0,G.useCallback)(e=>{let t=S.current;if(!t)return;let n=e.clientX-t.sx;!t.moved&&Math.abs(n)<Oe||(t.moved||(t.moved=!0,w(t.id),document.body.style.userSelect=`none`,t.el.style.willChange=`transform`),t.el.style.transform=`translate3d(${n}px, 0, 0)`,O(k(e.clientX,t.id)))},[k]),j=(0,G.useCallback)(t=>{let n=S.current;if(!n)return;try{t.currentTarget.releasePointerCapture(t.pointerId)}catch{}n.el.style.transform=``,n.el.style.willChange=``,document.body.style.userSelect=``;let r=n.moved,i=k(t.clientX,n.id);S.current=null,w(null),O(void 0),r&&e.moveWorkspace(n.id,i)},[k,e]),M=(0,G.useCallback)(e=>t=>{if(t.button!==0)return;let n=t.currentTarget.closest(`[data-ws-id]`);if(n){try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}S.current={id:e,el:n,sx:t.clientX,moved:!1}}},[]),P=(t,n)=>{let r=p.findIndex(e=>e.id===t);if(r<0)return;let i=r+n,a=p[i];a&&e.moveWorkspace(t,n===-1?a.id:p[i+1]?.id??null)},F=(e,t)=>{f(t),s(e)},I=()=>{o&&e.renameWorkspace(o,u),s(null)},ne=(0,K.jsxs)(y,{position:`bottom-end`,withinPortal:!0,children:[(0,K.jsx)(y.Target,{children:(0,K.jsx)(_,{label:`Nouveau bureau`,withArrow:!0,children:(0,K.jsx)(E,{variant:`light`,size:`sm`,"aria-label":`Ajouter un bureau`,children:(0,K.jsx)(B,{size:15})})})}),(0,K.jsxs)(y.Dropdown,{children:[(0,K.jsx)(y.Label,{children:`Nouveau bureau`}),(0,K.jsx)(y.Item,{leftSection:(0,K.jsx)(z,{size:14}),onClick:()=>e.createWorkspace(),children:`Vierge`}),(0,K.jsx)(y.Divider,{}),(0,K.jsx)(y.Label,{children:`Depuis un modèle`}),e.templates.filter(e=>e.id!==`blank`&&N(e.id,n.roles)).map(t=>(0,K.jsx)(y.Item,{onClick:()=>e.createWorkspace(t.id),children:t.label},t.id))]})]});return(0,K.jsxs)(v,{children:[(0,K.jsxs)(t,{justify:`space-between`,wrap:`nowrap`,py:6,children:[(0,K.jsxs)(g,{onClick:()=>a(e=>!e),"aria-expanded":r,"aria-label":r?`Replier les bureaux`:`Afficher les bureaux`,style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[(0,K.jsx)(d,{size:16,style:{transition:`transform .15s ease`,transform:r?`none`:`rotate(-90deg)`}}),(0,K.jsx)(l,{fw:600,size:`sm`,children:`Bureaux`}),(0,K.jsx)(i,{size:`sm`,variant:`light`,color:`gray`,children:p.length}),r?null:(0,K.jsxs)(l,{size:`xs`,c:`dimmed`,truncate:!0,children:[`· `,h.label]})]}),ne]}),(0,K.jsx)(te,{expanded:r,children:(0,K.jsxs)(v,{ref:x,role:`tablist`,"aria-label":`Bureaux`,style:{display:`flex`,gap:12,alignItems:`flex-start`,overflowX:`auto`,paddingTop:6,paddingBottom:12,scrollSnapType:C?`none`:`x proximity`},children:[p.map(n=>{let r=n.id===h.id,i=C===n.id,a=C!==null&&D===n.id;return(0,K.jsxs)(v,{"data-ws-id":n.id,style:{position:`relative`,flexShrink:0,width:Z,scrollSnapAlign:`start`,zIndex:i?2:void 0,opacity:i?.85:1,cursor:i?`grabbing`:void 0,borderLeft:a?`2px solid var(--mantine-color-brand-5)`:`2px solid transparent`,paddingLeft:4},children:[b?(0,K.jsx)(_,{label:`Supprimer ce bureau`,withArrow:!0,children:(0,K.jsx)(E,{size:`xs`,variant:`filled`,color:`dark`,radius:`xl`,"aria-label":`Supprimer le bureau ${n.label}`,onClick:t=>{t.stopPropagation(),e.deleteWorkspace(n.id)},style:{position:`absolute`,top:4,right:4,zIndex:2,opacity:.85},children:(0,K.jsx)(H,{size:12})})}):null,(0,K.jsx)(_,{label:`Glisser pour réordonner`,withArrow:!0,children:(0,K.jsx)(v,{role:`button`,tabIndex:-1,"aria-label":`Déplacer le bureau ${n.label}`,onPointerDown:M(n.id),onPointerMove:A,onPointerUp:j,onPointerCancel:j,style:{position:`absolute`,top:4,left:4,zIndex:2,display:`grid`,placeItems:`center`,width:20,height:20,borderRadius:4,color:`var(--mantine-color-dimmed)`,background:`color-mix(in srgb, var(--mantine-color-body) 70%, transparent)`,cursor:i?`grabbing`:`grab`,touchAction:`none`},children:(0,K.jsx)(W,{size:13})})}),(0,K.jsx)(g,{role:`tab`,"aria-selected":r,onClick:()=>e.setActive(n.id),style:{display:`block`,width:Z},children:(0,K.jsx)(ke,{layout:n,active:r})}),(0,K.jsxs)(t,{gap:2,wrap:`nowrap`,mt:4,justify:`space-between`,children:[o===n.id?(0,K.jsx)(ee,{size:`xs`,value:u,autoFocus:!0,"aria-label":`Nom du bureau`,onChange:e=>f(e.currentTarget.value),onBlur:I,onKeyDown:e=>{e.key===`Enter`&&I(),e.key===`Escape`&&s(null)},style:{flex:1}}):(0,K.jsx)(l,{size:`xs`,fw:r?700:500,c:r?`brand`:void 0,truncate:!0,style:{flex:1,cursor:`text`,userSelect:`none`},onDoubleClick:()=>F(n.id,n.label),title:`Double-clic pour renommer`,children:n.label}),(0,K.jsxs)(y,{position:`bottom-end`,withinPortal:!0,returnFocus:!1,children:[(0,K.jsx)(y.Target,{children:(0,K.jsx)(E,{variant:`subtle`,color:`gray`,size:`xs`,"aria-label":`Options du bureau ${n.label}`,children:(0,K.jsx)(se,{size:13})})}),(0,K.jsxs)(y.Dropdown,{children:[(0,K.jsx)(y.Item,{leftSection:(0,K.jsx)(ce,{size:13}),onClick:()=>F(n.id,n.label),children:`Renommer`}),(0,K.jsx)(y.Item,{leftSection:(0,K.jsx)(m,{size:13}),onClick:()=>e.duplicateWorkspace(n.id),children:`Dupliquer`}),(0,K.jsx)(y.Divider,{}),(0,K.jsx)(y.Item,{leftSection:(0,K.jsx)(ie,{size:13}),disabled:p[0]?.id===n.id,onClick:()=>P(n.id,-1),children:`Déplacer à gauche`}),(0,K.jsx)(y.Item,{leftSection:(0,K.jsx)(c,{size:13}),disabled:p[p.length-1]?.id===n.id,onClick:()=>P(n.id,1),children:`Déplacer à droite`}),(0,K.jsx)(y.Divider,{}),(0,K.jsx)(y.Item,{color:`red`,leftSection:(0,K.jsx)(T,{size:13}),disabled:!b,onClick:()=>e.deleteWorkspace(n.id),children:`Supprimer`})]})]})]})]},n.id)}),(0,K.jsxs)(v,{style:{flexShrink:0,width:Z},children:[(0,K.jsxs)(y,{position:`bottom-start`,withinPortal:!0,children:[(0,K.jsx)(y.Target,{children:(0,K.jsx)(_,{label:`Nouveau bureau`,withArrow:!0,children:(0,K.jsx)(g,{"aria-label":`Ajouter un bureau`,style:{display:`grid`,placeItems:`center`,width:Z,height:Q,borderRadius:6,border:`1px dashed var(--mantine-color-default-border)`,color:`var(--mantine-color-dimmed)`},children:(0,K.jsx)(B,{size:22})})})}),(0,K.jsxs)(y.Dropdown,{children:[(0,K.jsx)(y.Label,{children:`Nouveau bureau`}),(0,K.jsx)(y.Item,{leftSection:(0,K.jsx)(z,{size:14}),onClick:()=>e.createWorkspace(),children:`Vierge`}),(0,K.jsx)(y.Divider,{}),(0,K.jsx)(y.Label,{children:`Depuis un modèle`}),e.templates.filter(e=>e.id!==`blank`&&N(e.id,n.roles)).map(t=>(0,K.jsx)(y.Item,{onClick:()=>e.createWorkspace(t.id),children:t.label},t.id))]})]}),(0,K.jsx)(l,{size:`xs`,c:`dimmed`,mt:4,ta:`center`,children:`Ajouter`})]})]})})]})});function je(){let e=j(),t=P(),n=L(),r=le(),i=ue((0,G.useCallback)(()=>r?e.api.getAbsolute(`/nodefony/realtime/api/health`):Promise.resolve(null),[e,r])),a=pe(i.data);return{ctx:{live:t.realtimeLive,cluster:a?.cluster??!1,instanceCount:a?.instances.length??1,roles:n.roles},reload:i.reload}}var $=V(()=>{let e=R(),n=P(),r=L(),[a,o]=(0,G.useState)(!1),{ctx:s,reload:c}=je(),d=e.active,p=e.layoutList.find(e=>N(e.id,r.roles))?.id;return(0,G.useEffect)(()=>{p&&!N(e.active.id,r.roles)&&e.setActive(p)},[e,r.roles,p]),(0,K.jsxs)(h,{gap:`md`,children:[(0,K.jsxs)(v,{style:{position:`sticky`,top:0,zIndex:5,background:`var(--mantine-color-body)`,marginInline:`calc(var(--mantine-spacing-md) * -1)`,paddingInline:`var(--mantine-spacing-md)`,borderBottom:`1px solid var(--mantine-color-default-border)`},children:[(0,K.jsx)(Ae,{}),(0,K.jsx)(f,{title:d.label,subtitle:`Composez votre espace : ajoutez, retirez et agencez vos widgets.`,actions:(0,K.jsxs)(t,{gap:`xs`,children:[(0,K.jsx)(w,{size:`sm`,checked:n.realtimeLive,onChange:e=>n.setRealtimeLive(e.currentTarget.checked),label:`Temps réel`}),(0,K.jsx)(u,{size:`xs`,variant:`light`,leftSection:(0,K.jsx)(re,{size:14}),onClick:()=>o(!0),children:`Ajouter`}),(0,K.jsx)(u,{size:`xs`,variant:`subtle`,color:`gray`,leftSection:(0,K.jsx)(U,{size:14}),onClick:()=>e.tidy(),children:`Ranger`}),(0,K.jsx)(u,{size:`xs`,variant:`subtle`,color:`gray`,leftSection:(0,K.jsx)(D,{size:14}),onClick:c,children:`Rafraîchir`}),(0,K.jsx)(u,{size:`xs`,variant:`subtle`,color:`gray`,onClick:()=>e.resetToPreset(),children:`Réinitialiser`})]})})]}),s.cluster?(0,K.jsx)(t,{children:(0,K.jsxs)(i,{variant:`light`,color:`grape`,leftSection:(0,K.jsx)(de,{size:12}),children:[`Cluster · `,s.instanceCount,` workers — chaque tuile montre le pod, forage par worker au dépliage`]})}):null,d.items.length===0?(0,K.jsx)(l,{c:`dimmed`,ta:`center`,py:`xl`,children:`Bureau vide. Cliquez « Ajouter » pour poser vos premiers widgets.`}):(0,K.jsx)(_e,{layout:d,ctx:s}),(0,K.jsx)(De,{opened:a,onClose:()=>o(!1)})]})});export{$ as Workspace,$ as default};
@@ -1 +0,0 @@
1
- import{$n as e,Dr as t,En as n,Rn as r,cn as i,xn as a,zn as o}from"./ui-CQg7PBQQ.js";import{t as s}from"./Progress-CPoEshia.js";import{X as c}from"./index-D7ndDYxA.js";var l=t();function u({module:e,contract:t}){return(0,l.jsx)(o,{variant:`light`,color:`violet`,icon:(0,l.jsx)(c,{size:18}),title:`Aperçu — données simulées`,children:(0,l.jsxs)(r,{size:`sm`,children:[`Cet écran montre la cible de `,(0,l.jsx)(a,{children:e}),`, dans la forme de son contrat `,(0,l.jsx)(a,{children:t}),`. Aucune donnée n'est réelle et rien n'est branché : ces capacités ne sont pas dans la version 10.`]})})}var d={ok:{color:`teal`,label:`sain`},degraded:{color:`yellow`,label:`dégradé`},down:{color:`red`,label:`injoignable`},off:{color:`gray`,label:`non configuré`}};function f({status:e}){let t=d[e];return(0,l.jsx)(n,{variant:`light`,color:t.color,size:`sm`,children:t.label})}var p={public:{color:`blue`,label:`public`},internal:{color:`grape`,label:`interne`},restricted:{color:`red`,label:`restreinte`}};function m({zone:e}){return(0,l.jsx)(n,{variant:`outline`,color:p[e].color,size:`sm`,children:p[e].label})}var h={closed:{color:`teal`,label:`fermé`},"half-open":{color:`yellow`,label:`semi-ouvert`},open:{color:`red`,label:`ouvert`}};function g({state:e}){let t=h[e];return(0,l.jsxs)(n,{variant:`light`,color:t.color,size:`sm`,children:[`disjoncteur `,t.label]})}function _({label:t,current:n,limit:a,unit:o}){let c=Math.min(100,n/a*100),u=c>=90?`red`:c>=70?`yellow`:`teal`;return(0,l.jsxs)(i,{gap:4,children:[(0,l.jsxs)(e,{justify:`space-between`,gap:`xs`,wrap:`nowrap`,children:[(0,l.jsx)(r,{size:`sm`,fw:500,children:t}),(0,l.jsxs)(r,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[n.toLocaleString(`fr-FR`),` / `,a.toLocaleString(`fr-FR`),` `,o]})]}),(0,l.jsx)(s,{value:c,color:u,size:`sm`,"aria-label":`${t} : ${Math.round(c)} % du plafond`})]})}function v(e,t=0){return e.toLocaleString(`fr-FR`,{minimumFractionDigits:t,maximumFractionDigits:t})}export{m as a,u as i,f as n,v as o,_ as r,g as t};
@@ -1 +0,0 @@
1
- import{Dr as e,En as t,Et as n,It as r,Rn as i,ct as a,dn as o}from"./ui-CQg7PBQQ.js";import{t as s}from"./IconBan-tceVLRjs.js";import{t as c}from"./IconWorld-DoL6V4LE.js";import{K as l,M as u,N as d,T as f,V as p,W as m,Z as h,tt as g,w as _}from"./index-D7ndDYxA.js";import{n as v,r as y}from"./auditModel-VtcG7xbJ.js";var b=r(`outline`,`world-www`,`WorldWww`,[[`path`,{d:`M19.5 7a9 9 0 0 0 -7.5 -4a8.991 8.991 0 0 0 -7.484 4`,key:`svg-0`}],[`path`,{d:`M11.5 3a16.989 16.989 0 0 0 -1.826 4`,key:`svg-1`}],[`path`,{d:`M12.5 3a16.989 16.989 0 0 1 1.828 4`,key:`svg-2`}],[`path`,{d:`M19.5 17a9 9 0 0 1 -7.5 4a8.991 8.991 0 0 1 -7.484 -4`,key:`svg-3`}],[`path`,{d:`M11.5 21a16.989 16.989 0 0 1 -1.826 -4`,key:`svg-4`}],[`path`,{d:`M12.5 21a16.989 16.989 0 0 0 1.828 -4`,key:`svg-5`}],[`path`,{d:`M2 10l1 4l1.5 -4l1.5 4l1 -4`,key:`svg-6`}],[`path`,{d:`M17 10l1 4l1.5 -4l1.5 4l1 -4`,key:`svg-7`}],[`path`,{d:`M9.5 10l1 4l1.5 -4l1.5 4l1 -4`,key:`svg-8`}]]),x=e(),S={auth:m,authz:d,token:l,session:g,oauth:b,webauthn:h,csrf:u,cors:c,ws:p,webhook:f,config:a},C={success:n,failure:_,denied:s},w=new Map(v.map(e=>[e.value,e])),T=new Map(y.map(e=>[e.value,e]));function E(e){return T.get(e)?.label??e}function D({category:e}){let n=w.get(e),r=S[e]??d;return(0,x.jsx)(t,{variant:`light`,color:n?.color??`gray`,leftSection:(0,x.jsx)(r,{size:12}),style:{textTransform:`none`},children:n?.label??e})}function O({outcome:e}){let r=T.get(e),i=C[e]??n;return(0,x.jsx)(t,{variant:e===`denied`||e===`failure`?`filled`:`light`,color:r?.color??`gray`,leftSection:(0,x.jsx)(i,{size:12}),style:{textTransform:`none`},children:r?.label??e})}var k=new Intl.DateTimeFormat(`fr-FR`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),A=new Intl.DateTimeFormat(`fr-FR`,{dateStyle:`medium`,timeStyle:`medium`});function j({ts:e}){let t=new Date(e);return(0,x.jsx)(o,{label:A.format(t),openDelay:300,withinPortal:!0,children:(0,x.jsx)(i,{size:`sm`,ff:`monospace`,style:{whiteSpace:`nowrap`},children:k.format(t)})})}function M(e){return A.format(new Date(e))}function N({actor:e}){return e?(0,x.jsx)(i,{size:`sm`,ff:`monospace`,children:e}):(0,x.jsx)(i,{size:`sm`,c:`dimmed`,fs:`italic`,children:`anonyme`})}export{M as a,O as i,D as n,E as o,j as r,N as t};
@@ -1 +0,0 @@
1
- import{Dr as e,P as t,m as n,xn as r}from"./ui-CQg7PBQQ.js";var i=e(),a=`•••••`,o=/secret|password|passwd|passphrase|privatekey|keysetjson|clientsecret|credential/i;function s(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function c(e){if(e.properties||s(e.additionalProperties))return e;if(Array.isArray(e.anyOf)){let t=e.anyOf.find(e=>e.properties??s(e.additionalProperties));if(t)return t}return null}function l(e,t){if(!s(e))return null;let n=e;for(let e of t.split(`.`)){let t=c(n);if(!t)return null;let r=t.properties?.[e];if(r)n=r;else if(s(t.additionalProperties))n=t.additionalProperties;else return null}return n}function u(e){if(Array.isArray(e.enum))return`enum`;if(Array.isArray(e.anyOf)){let t=e.anyOf.map(e=>e.type===`null`?`null`:e.type===`array`?`array`:typeof e.type==`string`?e.type:`object`);return Array.from(new Set(t)).join(` | `)}return e.type===`array`?`array`:typeof e.type==`string`?e.type:`object`}function d(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function f(e){let t=new Set,n=e=>{Array.isArray(e)?e.forEach(e=>t.add(e)):e&&t.add(e)};return n(e.type),Array.isArray(e.anyOf)&&e.anyOf.forEach(e=>n(e.type)),[...t]}function p(e){if(e?.runtimeMutable!==!0||e.secret===!0)return;if(Array.isArray(e.enum)){let t=e.enum.filter(e=>typeof e==`string`);return t.length?{kind:`select`,options:t,nullable:e.enum.includes(null)}:void 0}let t=f(e);if(t.includes(`array`)||t.includes(`object`))return;let n=t.includes(`null`);if(t.includes(`boolean`))return{kind:`switch`};if(t.includes(`integer`)||t.includes(`number`))return{kind:`number`,min:e.minimum,max:e.maximum,integer:t.includes(`integer`)&&!t.includes(`number`),nullable:n};if(t.includes(`string`))return{kind:`text`,nullable:n}}function m(e){if(Array.isArray(e.enum))return e.enum.map(e=>e===null?`null`:t(e)).join(` · `);let n=[];return typeof e.minimum==`number`&&n.push(`≥ ${e.minimum}`),typeof e.maximum==`number`&&n.push(`≤ ${e.maximum}`),n.length?n.join(` · `):void 0}function h(e,a,o){if(e===void 0)return;let c=Array.isArray(e)&&e.length===0,l=s(e)&&Object.keys(e).length===0;return(e===``||c||l)&&a?(0,i.jsx)(r,{style:{fontSize:12},children:`auto`}):e===null?(0,i.jsx)(r,{style:{fontSize:12},children:`null`}):c?(0,i.jsx)(r,{style:{fontSize:12},children:`(aucun)`}):l?(0,i.jsx)(r,{style:{fontSize:12},children:`{}`}):Array.isArray(e)||s(e)?(0,i.jsx)(n,{value:e,title:o}):typeof e==`string`?(0,i.jsx)(r,{style:{fontSize:12},children:e===``?`""`:JSON.stringify(e)}):(0,i.jsx)(r,{style:{fontSize:12},children:t(e)})}function g(e,t,n,s){let c=e.slice(e.lastIndexOf(`.`)+1),l=t?.secret===!0||o.test(c),f=l?void 0:p(t);return{key:e,type:t?u(t):d(n),constraint:t?m(t):void 0,defaultValue:t?h(t.default,t.kernelDerived,`${e} (défaut)`):void 0,description:t?.description,mutability:t?.runtimeMutable?`live`:`boot`,reserved:t?.reserved===!0,kernelDerived:t?.kernelDerived===!0,secret:l,source:s,editControl:f,editValue:f?n:void 0,effective:l?(0,i.jsx)(r,{style:{fontSize:12},children:a}):h(n,t?.kernelDerived,e)}}function _(e){let t=e?c(e):null;return!!(t?.properties&&Object.keys(t.properties).length>0)}function v(e,t,n,r){if(n.split(`.`).length>8)return;let i=t?c(t):null,a=new Set;if(i?.properties)for(let e of Object.keys(i.properties))a.add(e);if(s(e))for(let t of Object.keys(e))a.add(t);for(let t of a){let a=n?`${n}.${t}`:t,o=s(e)?e[t]:void 0,c=i?.properties?.[t]??(s(i?.additionalProperties)?i.additionalProperties:null);_(c)||s(o)&&Object.keys(o).length>0?v(o,c,a,r):r.push({path:a,node:c,value:o})}}function y(e,t,n){let r=s(e)?e:null,i=[];v(t,r,``,i);let a=[],o=new Map;for(let{path:e,node:t,value:r}of i){let i=g(e,t,r,n?.[e]),s=e.indexOf(`.`);if(s===-1)a.push(i);else{let t=e.slice(0,s),n=o.get(t);n?n.push(i):o.set(t,[i])}}let c=[];a.length&&c.push({title:`Général`,fields:a});for(let[t,n]of o){let r=l(e,t);c.push({title:t,description:r?.description,fields:n})}return c}function b(e,t){return`NF__${e.toUpperCase()}__${t.replace(/\./g,`__`).toUpperCase()}`}function x(e,t,n){return n===`env`?e.envKeys[t.toLowerCase()]??b(e.seg,t):e.overriddenBy[t]??`nodefony.config.ts`}function S(e,t,n){let r=[];for(let i of e)for(let e of i.fields){let i=e.source;if(i!==`app`&&i!==`env`&&i!==`runtime`)continue;let a=b(t,e.key);r.push({field:e.key,source:i,secret:!!e.secret,overrideKey:a,where:i===`runtime`?`édité à chaud (runtime)`:n?n(e.key,i):a})}return r}function C(e,t){return e.map(e=>({...e,fields:e.fields.map(e=>e.reserved?e:{...e,recipe:e.recipe??b(t,e.key)})}))}function w(e){let t=[],n=[],r={moduleCount:0,fieldCount:0,byProvenance:{default:0,app:0,env:0},secrets:0,live:0},i=[...e].sort((e,t)=>e.isApp===t.isApp?e.name.localeCompare(t.name):e.isApp?-1:1);for(let e of i){let i=y(e.configSchema,e.config,e.provenance);if(i.length===0)continue;let a=C(i,e.seg);t.push({entry:e,sections:a,schemaStatus:e.configSchema?`zod`:`none`});for(let t of a)for(let i of t.fields){r.fieldCount++;let t=i.source??`default`;t===`app`?r.byProvenance.app++:t===`env`?r.byProvenance.env++:r.byProvenance.default++,i.secret&&r.secrets++,i.mutability===`live`&&r.live++,(t===`app`||t===`env`)&&n.push({module:e.name,moduleKey:e.key,field:i.key,source:t,secret:!!i.secret,overrideKey:b(e.seg,i.key),where:x(e,i.key,t)})}}return r.moduleCount=t.length,{modules:t,overrides:n,stats:r}}export{y as i,S as n,C as r,w as t};
@@ -1 +0,0 @@
1
- import{It as e}from"./ui-CQg7PBQQ.js";import{T as t,w as n}from"./LogVisuals-CXlOPxZ6.js";var r=e(`outline`,`arrows-left-right`,`ArrowsLeftRight`,[[`path`,{d:`M21 17l-18 0`,key:`svg-0`}],[`path`,{d:`M6 10l-3 -3l3 -3`,key:`svg-1`}],[`path`,{d:`M3 7l18 0`,key:`svg-2`}],[`path`,{d:`M18 20l3 -3l-3 -3`,key:`svg-3`}]]),i=e(`outline`,`route-2`,`Route2`,[[`path`,{d:`M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4`,key:`svg-1`}],[`path`,{d:`M14 5a2 2 0 0 0 -2 2v10a2 2 0 0 1 -2 2`,key:`svg-2`}]]),a=e(`outline`,`timeline`,`Timeline`,[[`path`,{d:`M4 16l6 -7l5 5l5 -6`,key:`svg-0`}],[`path`,{d:`M14 14a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M9 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M3 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M19 8a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}]]),o={"request-in":{label:`Requête entrante`,color:`blue`,event:`onRequest (contexte)`,meaning:`Le contexte HTTP démarre le traitement de la requête.`},"body-received":{label:`Corps reçu`,color:`gray`,event:`onRequestEnd`,meaning:`Le corps de la requête est entièrement lu. Pour un GET (sans corps), ça arrive tout de suite → l'un des PREMIERS events, malgré le mot « End ».`},"route-matched":{label:`Route trouvée`,color:`blue`,event:`Match route`,meaning:`Le routeur a associé l'URL à un controller + une action.`},"kernel-dispatch":{label:`Dispatch kernel`,color:`blue`,event:`onRequest (KERNEL)`,meaning:`Le kernel passe la main au pipeline (firewall, controller…).`},session:{label:`Session`,color:`grape`,event:`NEW/MIGRATE/DESTROY SESSION, onSessionStart`,meaning:`Une session est créée, rouverte, migrée ou détruite pour cette requête (HTTP ou WS).`},response:{label:`Réponse envoyée`,color:`teal`,event:`onSend / ADD COOKIE`,meaning:`Les octets de réponse partent vers le client (cookies posés au passage).`},"session-saved":{label:`Session enregistrée`,color:`grape`,event:`onSaveSession / SAVE SESSION`,meaning:`L'état de session modifié est persisté avant la réponse.`},"request-end":{label:`Bilan requête`,color:`indigo`,event:`req`,meaning:`Ligne récapitulative de fin : méthode, statut, durée, IP, requestId. En WebSocket = fin du handshake.`},finish:{label:`Requête terminée`,color:`gray`,event:`onFinish`,meaning:`Nettoyage post-réponse (hooks onAfterResponse). Vraie fin du cycle.`},"ws-open":{label:`Connexion ouverte`,color:`teal`,event:`onConnect / client connected`,meaning:`Le handshake WebSocket est accepté — la socket est vivante.`},"ws-message":{label:`Message reçu`,color:`cyan`,event:`onMessage / subscribe`,meaning:`Une frame entrante au fil de l'eau (message applicatif, abonnement à un canal, ping…).`},"ws-close":{label:`Connexion fermée`,color:`gray`,event:`onClose`,meaning:`Le socket WebSocket se ferme.`}};function s(e){let r=t(e);if(!r)return null;let i=o[r];return{label:i.label,color:i.color,order:n[r].order}}function c(e){let t=Object.keys(o).filter(t=>{let r=n[t].protocol;return e===`all`||r===e||r===`both`}),r={http:0,both:1,ws:2};return t.sort((e,t)=>{let i=n[e].protocol,a=n[t].protocol;return i===a?n[e].order-n[t].order:r[i]-r[a]})}var l={http:`HTTP`,both:`Commun (session)`,ws:`WebSocket`};function u(e){let t=c(e),r=[];for(let e of[`http`,`both`,`ws`]){let i=t.filter(t=>n[t].protocol===e).map(e=>({value:e,label:o[e].label}));i.length&&r.push({group:l[e],items:i})}return r}var d=c(`all`).map(e=>({id:e,protocol:n[e].protocol,event:o[e].event,label:o[e].label,meaning:o[e].meaning}));export{a,c as i,s as n,i as o,u as r,r as s,d as t};
@@ -1 +0,0 @@
1
- import{$ as e,at as t,nt as n}from"./ui-CQg7PBQQ.js";var r=`nf.supervision.weights`,i={CPU:1,"Saturation (ELU)":1.5,"Event-loop":1.5,"Mémoire (heap)":1,"GC overhead":.8,Erreurs:1.2,Connecteurs:1,"Temps réel":.5};function a(e,t){let n=i;return e[t]??n[t]??1}function o(e,t,n){return n<=t?+(e<=t):e<=t?1:e>=n?0:(n-e)/(n-t)}function s(e){let t=e.filter(e=>e.value!=null&&e.weight>0);if(!t.length)return{score:null,label:`—`,color:`gray`,worst:null,parts:[]};let n=!1,r=0,i=0,a=null,s=2,c=[];for(let e of t){let t=o(e.value,e.good,e.crit),l=Math.max(t,e.floor??0);c.push({label:e.label,score:Math.round(l*100),weight:e.weight,kind:e.critical?`fail`:`sat`}),l<s&&(s=l,a=e),e.critical&&t<=0&&(n=!0),r+=e.weight,i+=e.weight*Math.log(Math.max(l,1e-9))}let l=n?0:Math.exp(i/r),u=Math.round(l*100),[d,f]=u>=90?[`Excellent`,`teal`]:u>=75?[`Bon`,`green`]:u>=50?[`À surveiller`,`yellow`]:u>=25?[`Dégradé`,`orange`]:[`Critique`,`red`];return{score:u,label:d,color:f,worst:a?.label??null,parts:c}}function c(){let a=t(e(`local`,r),e=>n(e)&&e>=0);return{...i,...a}}export{a,c as i,r as n,s as r,i as t};
@@ -1 +0,0 @@
1
- import{k as e}from"./src-3uYsZQ6M.js";import{Di as t}from"./ui-CQg7PBQQ.js";var n=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,r=/^[\\/]{2}/;function i(e,t){return t+e.replace(/\\/g,`/`)}var a=`popstate`;function o(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function s(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return f(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:p(t)}return h(t,n,null,e)}function c(e,t){if(e===!1||e==null)throw Error(t)}function l(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function u(){return Math.random().toString(36).substring(2,10)}function d(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function f(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?m(t):t,state:n,key:t&&t.key||r||u(),mask:i}}function p({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function m(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function h(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,c=i.history,l=`POP`,u=null,p=m();p??(p=0,c.replaceState({...c.state,idx:p},``));function m(){return(c.state||{idx:null}).idx}function h(){l=`POP`;let e=m(),t=e==null?null:e-p;p=e,u&&u({action:l,location:b.location,delta:t})}function _(e,t){l=`PUSH`;let r=o(e)?e:f(b.location,e,t);n&&n(r,e),p=m()+1;let a=d(r,p),h=b.createHref(r.mask||r);try{c.pushState(a,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}s&&u&&u({action:l,location:b.location,delta:1})}function v(e,t){l=`REPLACE`;let r=o(e)?e:f(b.location,e,t);n&&n(r,e),p=m();let i=d(r,p),a=b.createHref(r.mask||r);c.replaceState(i,``,a),s&&u&&u({action:l,location:b.location,delta:0})}function y(e){return g(i,e)}let b={get action(){return l},get location(){return e(i,c)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(a,h),u=e,()=>{i.removeEventListener(a,h),u=null}},createHref(e){return t(i,e)},createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:_,replace:v,go(e){return c.go(e)}};return b}function g(e,t,n=!1){let i=`http://localhost`;e&&(i=e.location.origin===`null`?e.location.href:e.location.origin),c(i,`No window.location.(origin|href) available to create URL`);let a=typeof t==`string`?t:p(t);return a=a.replace(/ $/,`%20`),!n&&r.test(a)&&(a=i+a),new URL(a,i)}var _=e(t(),1),v=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},y=class extends Error{},b=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function x(e){return b.has(e)}var S=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function C(e){return S.has(e)}function w(e){return e.index===!0}function T(e){let t={};return e.Component&&Object.assign(t,{element:_.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function E(e,t=T,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(c(e.index!==!0||!e.children,`Cannot specify children on an index route`),c(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),w(e)){let n={...e,id:s};return r[s]=D(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=D(n,t(n)),e.children&&(n.children=E(e.children,t,o,r,i)),n}})}function D(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function O(e,t,n=`/`){return ee(e,t,n,!1)}function ee(e,t,n,r,i){let a=ue((typeof t==`string`?m(t):t).pathname||`/`,n);if(a==null)return null;let o=i??te(e),s=null,c=le(a);for(let e=0;s==null&&e<o.length;++e)s=oe(o[e],c,r);return s}function k(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function te(e){let t=A(e);return M(t),t}function A(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let l={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(l.relativePath.startsWith(`/`)){if(!l.relativePath.startsWith(r)&&o)return;c(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length)}let u=W([r,l.relativePath]),d=n.concat(l);e.children&&e.children.length>0&&(c(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),A(e.children,t,d,u,o)),(e.path!=null||e.index)&&t.push({path:u,score:ie(u,e.index),routesMeta:d.map((e,t)=>{let[n,r]=ce(e.relativePath,e.caseSensitive,t===d.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of j(e.path))a(e,t,!0,n)}),t}function j(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=j(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function M(e){e.sort((e,t)=>e.score===t.score?ae(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var N=/^:[\w-]+$/,P=/^:[\w-]+/,ne=3.5,F=3,I=2,L=1,R=10,z=-2,re=e=>e===`*`;function ie(e,t){let n=e.split(`/`),r=n.length;return n.some(re)&&(r+=z),t&&(r+=I),n.filter(e=>!re(e)).reduce((e,t)=>e+(N.test(t)?F:P.test(t)?ne:t===``?L:R),r)}function ae(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function oe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?B(u,l,s.matcher,s.compiledParams):se(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=se({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:W([a,d.pathname]),pathnameBase:ve(W([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=W([a,d.pathnameBase]))}return o}function se(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ce(e.path,e.caseSensitive,e.end);return B(e,t,n,r)}function B(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=_e(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=_e(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ce(e,t=!1,n=!0){l(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/((?:[^/?()[\]*^\\]|\\.)+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function le(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return l(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ue(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function de({basename:e,pathname:t}){return t===`/`?e:W([e,t])}var fe=e=>n.test(e);function pe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?m(e):e,a;return n?(n=ge(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?V(n.substring(1),`/`):V(n,t)):a=t,{pathname:a,search:G(r),hash:ye(i)}}function V(e,t){let n=_e(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function me(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function H(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function U(e){let t=H(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function he(e,t,n,r=!1){let i;typeof e==`string`?i=m(e):(i={...e},c(!i.pathname||!i.pathname.includes(`?`),me(`?`,`pathname`,`search`,i)),c(!i.pathname||!i.pathname.includes(`#`),me(`#`,`pathname`,`hash`,i)),c(!i.search||!i.search.includes(`#`),me(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let l=pe(i,s),u=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!l.pathname.endsWith(`/`)&&(u||d)&&(l.pathname+=`/`),l}var ge=e=>e.replace(/[\\/]{2,}/g,`/`),W=e=>ge(e.join(`/`));function _e(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var ve=e=>_e(e).replace(/^\/*/,`/`),G=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ye=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,be=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],xe=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Se(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ce(e){return W(e.map(e=>e.route.path).filter(Boolean))||`/`}function we(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?m(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var Te=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ee(e,t){let a=e;if(typeof a!=`string`||!n.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,s=!1;if(Te)try{let e=new URL(window.location.href),n=r.test(a)?new URL(i(a,e.protocol)):new URL(a),o=ue(n.pathname,t);n.origin===e.origin&&o!=null?a=o+n.search+n.hash:s=!0}catch{l(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:a}}var De=Symbol(`Uninstrumented`),Oe=new WeakMap;function ke(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>K(await q(n.lazy,void 0,()=>e(...t),J))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>K(await q(n[`lazy.middleware`],void 0,()=>t(...e),J))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>K(await q(n[`lazy.loader`],void 0,()=>t(...e),J))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>K(await q(n[`lazy.action`],void 0,()=>t(...e),J))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=je(t.loader),i=async(...t)=>K(await q(n.loader,Fe(t[0]),()=>e(...t),J));e.hydrate===!0&&(i.hydrate=!0),Me(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=je(t.action),i=async(...t)=>K(await q(n.action,Fe(t[0]),()=>e(...t),J));Me(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=je(e),r=async(...e)=>K(await q(n.middleware,Fe(e[0]),()=>t(...e),J));return Me(r,t),r})),r}function Ae(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=je(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?p(i):`.`,...Ie(e,a??{})};return K(await q(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=Ne(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...J(e),meta:o})))};Me(r,t),e.navigate=r}if(n.fetch.length>0){let t=je(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return K(await q(n.fetch,{href:o??`.`,fetcherKey:i,...Ie(e,s??{})},async()=>{let n=Ne(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...J(e),meta:c})))};Me(r,t),e.fetch=r}return e}function je(e){return e[De]??e}function Me(e,t){e[De]=t}function Ne(e,t){return Oe.set(e,t),()=>{Oe.get(e)===t&&Oe.delete(e)}}function Pe(e){let t=Oe.get(e);return Oe.delete(e),t}function K(e){if(e.type===`error`)throw e.value;return e.value}async function q(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,l=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=q(e,t,n,r,i,a-1),await s,c(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(l,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await l(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result||(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t)),i.result}function J(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Fe(e){let{request:t,context:n,params:r}=e;return{...e,request:Y(t),params:{...r},context:Le(n)}}function Ie(e,t){return{currentUrl:p(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Y(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Le(e){return{get:t=>e.get(t)}}var Re=class{#e=[];#t=[];#n;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=te(e)}match(e,t=!1){return ee(this.#e,e,this.#n,t,this.#t)}},ze=new URL(`http://localhost`);function Be(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),ze)}catch{return ze}}function Ve(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function He(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Ue(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Ve(i,n),s=!Ve(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!He(e,i)||!Ve(i,a)))throw Error(`External navigation is not allowed`)}var We=[`POST`,`PUT`,`PATCH`,`DELETE`],Ge=new Set(We),Ke=[`GET`,...We],qe=new Set(Ke),Je=new Set([301,302,303,307,308]),Ye=new Set([307,308]),Xe={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ze={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qe={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},$e=`remix-router-transitions`,et=Symbol(`ResetLoaderData`);function tt(e,t){return e.unstable_routePatternMatching?(c(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new Re(t)}var nt=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#n=t,this.#n.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#n.update(e)}setHmrRoutes(e){this.#t=e,this.#n.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#n.update(this.#e))}},rt=new WeakMap;function it(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;c(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let i=e.hydrationRouteProperties||[],a=e.mapRouteProperties,o=a||(()=>({}));if(e.instrumentations){let t=e.instrumentations;o=e=>({...a?.(e),...ke(t.map(e=>e.route).filter(Boolean),e)})}let s={...e.future},u=e.basename||`/`;u.startsWith(`/`)||(u=`/${u}`);let d=tt(s,u),h={},_=new nt(E(e.routes,o,void 0,h),d),b=e.dataStrategy||xt,x=null,S=new Set,C=null,w=null,T=null,D=e.hydrationData!=null,O=d.match(e.history.location),ee=!1,te=null,A,j;if(O==null&&!e.patchRoutesOnNavigation){let t=X(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Wt(_.activeRoutes);A=!0,j=!A,O=n,te={[r.id]:t}}else if(O&&!e.hydrationData&&ht(O,e.history.location.pathname).active&&(O=null),!O){A=!1,j=!A,O=[];let t=ht(null,e.history.location.pathname);t.active&&t.matches&&(ee=!0,O=t.matches)}else if(O.some(e=>e.route.lazy))A=!1,j=!A;else if(!O.some(e=>lt(e.route)))A=!0,j=!A;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=O;if(n){let e=O.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}j=!1,A=!0,r.forEach(e=>{let r=ut(e.route,t,n);j||=r.renderFallback,A&&=!r.shouldLoad})}let M,N={historyAction:e.history.action,location:e.history.location,matches:O,initialized:A,renderFallback:j,navigation:Xe,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||te,fetchers:new Map,blockers:new Map},P=`POP`,ne=0,F,I=null,L=!1,R,z=!1,re=new Map,ie=null,ae=!1,oe=!1,se=new Set,B=new Map,ce=0,le=-1,de=new Map,pe=new Set,V=new Map,me=new Map,H=new Set,U=new Map,he,ge=null;function W(){if(x=e.history.listen(({action:t,location:n,delta:r})=>{if(he){he(),he=void 0;return}l(U.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=et({currentLocation:N.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{he=e});e.history.go(r*-1),$e(i,{state:`blocked`,location:n,proceed(){$e(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(N.blockers);e.set(i,Qe),G({blockers:e})}}),I?.resolve(),I=null}else return s.unstable_customRouteDiscovery&&(ne+=r||0),we(t,n)}),n){pn(t,re);let e=()=>mn(t,re);t.addEventListener(`pagehide`,e),ie=()=>t.removeEventListener(`pagehide`,e)}return N.initialized||we(`POP`,N.location,{initialHydration:!0}),M}function _e(){x&&x(),ie&&ie(),S.clear(),R&&R.abort(),N.fetchers.forEach((e,t)=>Be(N.fetchers,t)),N.blockers.forEach((e,t)=>Je(t))}function ve(e){return S.add(e),()=>S.delete(e)}function G(e,t={}){let n=e.errors??null,r=n?rt.get(n):void 0;r!==void 0&&(n=r),(e.errors!==void 0||e.initialized)&&(N.errors&&rt.delete(N.errors),e.errors&&rt.set(e.errors,n)),e.matches&&=e.matches.map(e=>{let t=h[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),N={...N,...e};let i=[],a=[];N.fetchers.forEach((e,t)=>{e.state===`idle`&&(H.has(t)?i.push(t):a.push(t))}),H.forEach(e=>{!N.fetchers.has(e)&&!B.has(e)&&i.push(e)}),[...S].forEach(e=>e(N,{deletedFetchers:i,newErrors:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),i.forEach(e=>Be(N.fetchers,e)),a.forEach(e=>N.fetchers.delete(e))}function ye(t,n,{flushSync:r}={}){let i=N.actionData!=null&&N.navigation.formMethod!=null&&Q(N.navigation.formMethod)&&N.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?N.actionData:null;let o=n.loaderData?Vt(N.loaderData,n.loaderData,n.matches||[],n.errors):N.loaderData,s=N.blockers;s.size>0&&!ae&&(s=new Map(s),s.forEach((e,t)=>s.set(t,Qe)));let c=!ae&&pt(t,n.matches||N.matches),l=L===!0||N.navigation.formMethod!=null&&Q(N.navigation.formMethod)&&t.state?._isRedirect!==!0;_.commitHmrRoutes(),ae||P===`POP`||(P===`PUSH`?e.history.push(t,t.state):P===`REPLACE`&&e.history.replace(t,t.state));let u;if(P===`POP`&&!ae&&t!==N.location){let e=re.get(N.location.pathname);e&&e.has(t.pathname)?u={currentLocation:N.location,nextLocation:t}:re.has(t.pathname)&&(u={currentLocation:t,nextLocation:N.location})}else if(z){let e=re.get(N.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),re.set(N.location.pathname,e)),u={currentLocation:N.location,nextLocation:t}}G({...n,actionData:a,loaderData:o,historyAction:P,location:t,initialized:!0,renderFallback:!1,navigation:Xe,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:u,flushSync:r===!0}),be(),I?.resolve(),I=null,ge?.resolve(),ge=null}function be(){ne=0,P=`POP`,L=!1,z=!1,ae=!1,oe=!1}async function xe(t,n){if(F&&await F,I?.resolve(),I=null,typeof t==`number`){I||=hn();let n=I.promise;return e.history.go(t),n}let i=Pe(M),{path:a,submission:o,error:s}=st(!1,ot(N.location,N.matches,u,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?m(n.mask):{...N.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},r.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),Ue(typeof n.mask==`string`?n.mask:p(n.mask),p(c),e.history.createURL(`/`),`reject`)}let l=N.location,d=f(l,a,n&&n.state,void 0,c);d={...d,...e.history.encodeLocation(d)},Ue(t==null?e.history.createHref(N.location):typeof t==`string`?t:p(t),e.history.createHref(d.mask||d),e.history.createURL(`/`),`reject`);let h=n&&n.replace!=null?n.replace:void 0,g=`PUSH`;h===!0?g=`REPLACE`:h===!1||o!=null&&Q(o.formMethod)&&o.formAction===N.location.pathname+N.location.search&&(g=`REPLACE`);let _=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,v=(n&&n.flushSync)===!0,y=et({currentLocation:l,nextLocation:d,historyAction:g});y?$e(y,{state:`blocked`,location:d,proceed(){$e(y,{state:`proceeding`,proceed:void 0,reset:void 0,location:d}),xe(t,n)},reset(){let e=new Map(N.blockers);e.set(y,Qe),G({blockers:e})}}):await we(g,d,{submission:o,pendingError:s,preventScrollReset:_,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:v,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:i})}function Ce(){if(F)return F.then(Ce);ge||=hn(),Ie(),G({revalidation:`loading`});let e=ge.promise;return N.navigation.state===`submitting`?e:N.navigation.state===`idle`?(we(N.historyAction,N.location,{startUninterruptedRevalidation:!0,dataStrategyInitiator:`revalidation`}),e):(we(P||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,dataStrategyInitiator:`revalidation`,enableViewTransition:z===!0}),e)}async function we(t,n,r){F&&await F,R&&R.abort(),R=null,P=t,ae=(r&&r.startUninterruptedRevalidation)===!0,ft(N.location,N.matches),L=(r&&r.preventScrollReset)===!0,z=(r&&r.enableViewTransition)===!0;let i=r?.initialHydration&&N.matches&&N.matches.length>0&&!ee?N.matches:d.match(n),a=(r&&r.flushSync)===!0;if(i&&N.initialized&&!oe&&qt(N.location,n)&&!(r&&r.submission&&Q(r.submission.formMethod))){ye(n,{matches:i},{flushSync:a});return}let o=ht(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=sn(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=it(n.pathname);ye(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:a});return}let s=r&&r.overrideNavigation?{...r.overrideNavigation,matches:i,historyAction:t}:void 0;R=new AbortController;let c=It(e.history,n,R.signal,r&&r.submission),l=r?.initialHydration?`initialization`:r?.dataStrategyInitiator??`navigation`,u=e.getContext?await e.getContext():new v,f;if(r&&r.pendingError)f=[Ut(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Q(r.submission.formMethod)){let d=await Ee(c,l,n,r.submission,i,t,u,o.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:a});if(d.shortCircuited)return;if(d.pendingActionResult){let[e,t]=d.pendingActionResult;if(Z(t)&&Se(t.error)&&t.error.status===404){R=null,ye(n,{matches:d.matches,loaderData:{},errors:{[e]:t.error}});return}}i=d.matches||i,f=d.pendingActionResult,s=ln(n,i,t,r.submission),a=!1,o.active=!1,c=It(e.history,c.url,c.signal)}let{shortCircuited:p,matches:m,loaderData:h,errors:g,workingFetchers:_}=await De(c,l,n,i,t,u,o.active,s,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,a,f,r&&r.callSiteDefaultShouldRevalidate);p||(R=null,ye(n,{matches:m||i,...Ht(f),loaderData:h,errors:g,..._?{fetchers:_}:{}}))}function Te(){let t=hn();F=t.promise;let n=ne,r=I;I=null,R?.abort(),R=null,be(),ge?.resolve(),ge=null;let i=new Map(N.blockers);i.forEach((e,t)=>{e.state===`proceeding`&&i.set(t,Qe)});let a=new Map(N.fetchers),o=Ge(a);a.forEach((e,t)=>{e.state===`loading`&&!B.has(t)&&(a.set(t,$(e.data)),o=!0)}),se.clear(),G({navigation:Xe,revalidation:`idle`,blockers:i,...o?{fetchers:a}:{}});function s(){F=void 0,r?.resolve(),t.resolve()}return n?(he=s,e.history.go(-n)):s(),t.promise}async function Ee(t,n,r,a,c,l,d,f,p,m={}){if(s.unstable_customRouteDiscovery||Ie(),G({navigation:un(r,c,l,a)},{flushSync:m.flushSync===!0}),f){let e=await gt(c,r.pathname,t.signal);if(s.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await Te(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Wt(_.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Ut(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)c=e.matches;else{let{notFoundMatches:e,error:t,route:n}=it(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:`error`,error:t}]}}}s.unstable_customRouteDiscovery&&Ie();let g,v=on(c,r);if(!v.route.action&&!v.route.lazy)g={type:`error`,error:X(405,{method:t.method,pathname:r.pathname,routeId:v.route.id})};else{let e=await J(t,r,Dt(o,h,t,r,c,v,p?[]:i,d),d,null,n,l);if(g=e[v.route.id],!g){for(let t of c)if(e[t.route.id]){g=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Qt(g)){let r;return r=m&&m.replace!=null?m.replace:Ft(g.response.headers.get(`Location`),new URL(t.url),u,e.history)===N.location.pathname+N.location.search,await q(t,g,!0,n,{submission:a,replace:r}),{shortCircuited:!0}}if(Z(g)){let e=Ut(c,v.route.id);return(m&&m.replace)!==!0&&(P=`PUSH`),{matches:c,pendingActionResult:[e.route.id,g,v.route.id]}}return{matches:c,pendingActionResult:[v.route.id,g]}}async function De(t,n,r,a,c,l,u,f,p,m,g,v,y,b,x){let S=f||ln(r,a,c,p),C=p||m||cn(S),w=!ae&&!v;if(u){if(w){let e=Oe(b);G({navigation:S,...e===void 0?{}:{actionData:e}},{flushSync:y})}let e=await gt(a,r.pathname,t.signal);if(s.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await Te(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Wt(_.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Ut(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)a=e.matches,v&&!t.signal.aborted&&G({matches:a});else{let{error:e,notFoundMatches:t,route:n}=it(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}}let{dsMatches:T,revalidatingFetchers:E}=ct(t,l,o,h,e.history,N,a,C,r,v?[]:i,v===!0,oe,se,H,V,pe,d,b,x);if(le=++ce,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(N.fetchers),t=Ge(e);return ye(r,{matches:a,loaderData:{},errors:b&&Z(b[1])?{[b[0]]:b[1].error}:null,...Ht(b),...t?{fetchers:e}:{}},{flushSync:y}),{shortCircuited:!0}}if(w){let e={};if(!u){e.navigation=S;let t=Oe(b);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=je(E)),G(e,{flushSync:y})}E.forEach(e=>{He(e.key),e.controller&&B.set(e.key,e.controller)});let D=()=>E.forEach(e=>He(e.key));R&&R.signal.addEventListener(`abort`,D);let{loaderResults:O,fetcherResults:ee}=await Fe(T,E,t,r,l,n,c);if(t.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener(`abort`,D),E.forEach(e=>B.delete(e.key));let k=Gt(O);if(k)return await q(t,k.result,!0,n,{replace:g}),{shortCircuited:!0};if(k=Gt(ee),k)return pe.add(k.key),await q(t,k.result,!0,n,{replace:g}),{shortCircuited:!0};let te=new Map(N.fetchers),{loaderData:A,errors:j}=Bt(N,a,O,b,E,ee,te);if(v&&N.errors){let e=j??null;j={...N.errors,...j},rt.set(j,e)}let M=Ge(te),P=Ke(le,te),ne=M||P||E.length>0;return{matches:a,loaderData:A,errors:j,...ne?{workingFetchers:te}:{}}}function Oe(e){if(e&&!Z(e[1]))return{[e[0]]:e[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function je(e){let t=new Map(N.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=dn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Me(t,n,r,i){F&&await F,He(t);let a=(i&&i.flushSync)===!0,o=Pe(M),s=ot(N.location,N.matches,u,r,n,i?.relative),c=d.match(s),l=ht(c,s);if(l.active&&l.matches&&(c=l.matches),o&&o(sn(e.history,s,c)),!c){Le(t,n,X(404,{pathname:s}),{flushSync:a});return}let{path:f,submission:p,error:m}=st(!0,s,i);if(m){Le(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new v,g=(i&&i.preventScrollReset)===!0;if(p&&Q(p.formMethod)){await Ne(t,n,f,c,h,l.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:l.active};V.set(t,_),await K(t,_,c,h,a,g,p)}async function Ne(t,n,r,a,l,u,f,p,m,g){s.unstable_customRouteDiscovery||Ie(),V.delete(t);let _=N.fetchers.get(t);Y(t,fn(m,_),{flushSync:f});let v=new AbortController;s.unstable_customRouteDiscovery&&B.set(t,v);let y=It(e.history,r,v.signal,m);if(u){let e=await gt(a,new URL(y.url).pathname,y.signal,t);if(s.unstable_customRouteDiscovery&&y.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){B.delete(t),V.delete(t),Y(t,$(_?.data),{flushSync:f});return}if(e.type===`error`){Le(t,n,e.error,{flushSync:f});return}if(e.matches)a=e.matches;else{Le(t,n,X(404,{pathname:r}),{flushSync:f});return}}let b=on(a,r);if(!b.route.action&&!b.route.lazy){Le(t,n,X(405,{method:m.formMethod,pathname:r,routeId:n}),{flushSync:f});return}s.unstable_customRouteDiscovery&&Ie(),B.set(t,v);let x=ce,S=Dt(o,h,y,r,a,b,i,l),C=await J(y,r,S,l,t,`fetcher`),w=C[b.route.id];if(!w){for(let e of S)if(C[e.route.id]){w=C[e.route.id];break}}if(y.signal.aborted){B.get(t)===v&&B.delete(t);return}if(H.has(t)){if(Qt(w)||Z(w)){Y(t,$(void 0));return}}else{if(Qt(w)){if(B.delete(t),le>x){Y(t,$(void 0));return}return pe.add(t),Y(t,dn(m)),q(y,w,!1,`fetcher`,{fetcherSubmission:m,preventScrollReset:p})}if(Z(w)){Le(t,n,w.error);return}}let T=N.navigation.location||N.location,E=It(e.history,T,v.signal),D=N.navigation.state===`idle`?N.matches:d.match(N.navigation.location);c(D,`Didn't find any matches after fetcher action`);let O=++ce;de.set(t,O);let{dsMatches:ee,revalidatingFetchers:k}=ct(E,l,o,h,e.history,N,D,m,T,i,!1,oe,se,H,V,pe,d,[b.route.id,w],g),te=dn(m,w.data),A=new Map(N.fetchers);A.set(t,te),k.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=A.get(t),r=dn(void 0,n?n.data:void 0);A.set(t,r),He(t),e.controller&&B.set(t,e.controller)}),G({fetchers:A});let j=()=>k.forEach(e=>He(e.key));v.signal.addEventListener(`abort`,j);let{loaderResults:M,fetcherResults:ne}=await Fe(ee,k,E,T,l,`fetcher`);if(v.signal.aborted){de.get(t)===O&&de.delete(t);return}v.signal.removeEventListener(`abort`,j),de.delete(t),B.delete(t),k.forEach(e=>B.delete(e.key));let F=N.fetchers.has(t),I=e=>{if(!F)return e;let n=new Map(e.fetchers);return n.set(t,$(w.data)),{...e,fetchers:n}},L=Gt(M);if(L)return N=I(N),q(E,L.result,!1,`fetcher`,{preventScrollReset:p});if(L=Gt(ne),L)return pe.add(L.key),N=I(N),q(E,L.result,!1,`fetcher`,{preventScrollReset:p});let z=new Map(N.fetchers);F&&z.set(t,$(w.data));let{loaderData:re,errors:ie}=Bt(N,D,M,void 0,k,ne,z);Ke(O,z),N.navigation.state===`loading`&&O>le?(c(P,`Expected pending action`),R&&R.abort(),ye(N.navigation.location,{matches:D,loaderData:re,errors:ie,fetchers:z})):(G({errors:ie,loaderData:Vt(N.loaderData,re,D,ie),fetchers:z}),oe=!1)}async function K(t,n,r,a,c,l,u){let{routeId:d,path:f}=n,p=N.fetchers.get(t);Y(t,dn(u,p?p.data:void 0),{flushSync:c});let m=new AbortController;s.unstable_customRouteDiscovery&&B.set(t,m);let g=It(e.history,f,m.signal);if(n.isDiscovering){let e=await gt(r,new URL(g.url).pathname,g.signal,t);if(s.unstable_customRouteDiscovery&&g.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){B.delete(t),V.delete(t),Y(t,$(p?.data),{flushSync:c});return}if(e.type===`error`){Le(t,d,e.error,{flushSync:c});return}if(e.matches)r=e.matches,n.isDiscovering=!1;else{Le(t,d,X(404,{pathname:f}),{flushSync:c});return}}let _=on(r,f);B.set(t,m);let v=ce,y=await J(g,f,Dt(o,h,g,f,r,_,i,a),a,t,`fetcher`),b=y[_.route.id];if(!b){for(let e of r)if(y[e.route.id]){b=y[e.route.id];break}}if(B.get(t)===m&&B.delete(t),!g.signal.aborted){if(H.has(t))Y(t,$(void 0));else{if(Qt(b)){if(le>v){Y(t,$(void 0));return}pe.add(t),await q(g,b,!1,`fetcher`,{preventScrollReset:l});return}Z(b)?Le(t,d,b.error):Y(t,$(b.data))}}}async function q(r,i,a,o,{submission:s,fetcherSubmission:l,preventScrollReset:d,replace:p}={}){a||(I?.resolve(),I=null),i.response.headers.has(`X-Remix-Revalidate`)&&(oe=!0);let m=i.response.headers.get(`Location`);c(m,`Expected a Location header on the redirect Response`);let h=m,_=new URL(r.url);m=Ft(m,_,u,e.history),Ue(h,m,_,`allow-explicit`);let v=f(N.location,m,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(fe(m)){let n=g(t,m,!0);e=n.origin!==t.location.origin||ue(n.pathname,u)==null}if(e){p?t.location.replace(m):t.location.assign(m);return}}R=null;let y=p===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:b,formAction:x,formEncType:S}=N.navigation;!s&&!l&&b&&x&&S&&(s=cn(N.navigation));let C=s||l;Ye.has(i.response.status)&&C&&Q(C.formMethod)?await we(y,v,{submission:{...C,formAction:m},preventScrollReset:d||L,enableViewTransition:a?z:void 0,dataStrategyInitiator:o}):await we(y,v,{overrideNavigation:ln(v,[],y,s),fetcherSubmission:l,preventScrollReset:d||L,enableViewTransition:a?z:void 0,dataStrategyInitiator:o})}async function J(e,t,n,r,i,a,o=null){let s,c={};try{s=await Ot(b,e,t,n,i,a,r,!1,o)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{c[t.route.id]={type:`error`,error:e}}),c}if(e.signal.aborted)return c;if(!Q(e.method))for(let e of n){if(s[e.route.id]?.type===`error`)break;s.hasOwnProperty(e.route.id)||N.loaderData.hasOwnProperty(e.route.id)||N.errors&&N.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(s[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(s))if(Zt(r)){let i=r.result;c[t]={type:`redirect`,response:Mt(i,e,t,n,u)}}else c[t]=await jt(r);return c}async function Fe(e,t,n,r,i,a,o=null){let s=J(n,r,e,i,null,a,o),c=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await J(e.request,e.path,e.matches,i,e.key,a,o))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:X(404,{pathname:e.path})}})}));return{loaderResults:await s,fetcherResults:(await c).reduce((e,t)=>Object.assign(e,t),{})}}function Ie(){oe=!0,V.forEach((e,t)=>{s.unstable_customRouteDiscovery&&e.isDiscovering||(B.has(t)&&se.add(t),He(t))})}function Y(e,t,n={}){let r=new Map(N.fetchers);r.set(e,t),G({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Le(e,t,n,r={}){let i=Ut(N.matches,t),a=new Map(N.fetchers);Be(a,e),G({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Re(e){return me.set(e,(me.get(e)||0)+1),H.has(e)&&H.delete(e),N.fetchers.get(e)||Ze}function ze(e,t){He(e,t?.reason),V.delete(e),se.delete(e),Y(e,$(null))}function Be(e,t){let n=N.fetchers.get(t);B.has(t)&&!(n&&n.state===`loading`&&de.has(t))&&He(t),V.delete(t),de.delete(t),pe.delete(t),H.delete(t),se.delete(t),e.delete(t)}function Ve(e){let t=(me.get(e)||0)-1;t<=0?(me.delete(e),H.add(e)):me.set(e,t),G({fetchers:new Map(N.fetchers)})}function He(e,t){let n=B.get(e);n&&(n.abort(t),B.delete(e))}function We(e,t){for(let n of e){let e=t.get(n);c(e,`Expected fetcher: ${n}`);let r=$(e.data);t.set(n,r)}}function Ge(e){let t=[],n=!1;for(let r of pe){let i=e.get(r);c(i,`Expected fetcher: ${r}`),i.state===`loading`&&(pe.delete(r),t.push(r),n=!0)}return We(t,e),n}function Ke(e,t){let n=[];for(let[r,i]of de)if(i<e){let e=t.get(r);c(e,`Expected fetcher: ${r}`),e.state===`loading`&&(He(r),de.delete(r),n.push(r))}return We(n,t),n.length>0}function qe(e,t){let n=N.blockers.get(e)||Qe;return U.get(e)!==t&&U.set(e,t),n}function Je(e){N.blockers.delete(e),U.delete(e)}function $e(e,t){let n=N.blockers.get(e)||Qe;c(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(N.blockers);r.set(e,t),G({blockers:r})}function et({currentLocation:e,nextLocation:t,historyAction:n}){if(U.size===0)return;U.size>1&&l(!1,`A router only supports one blocker at a time`);let r=Array.from(U.entries()),[i,a]=r[r.length-1],o=N.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function it(e){let t=X(404,{pathname:e}),n=_.activeRoutes,{matches:r,route:i}=Wt(n);return{notFoundMatches:r,route:i,error:t}}function at(e,t,n){if(C=e,T=t,w=n||null,!D&&N.navigation===Xe){D=!0;let e=pt(N.location,N.matches);e!=null&&G({restoreScrollPosition:e})}return()=>{C=null,T=null,w=null}}function dt(e,t){return w&&w(e,t.map(e=>k(e,N.loaderData)))||e.key}function ft(e,t){if(C&&T){let n=dt(e,t);C[n]=T()}}function pt(e,t){if(C){let n=dt(e,t),r=C[n];if(typeof r==`number`)return r}return null}function ht(t,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:d.match(n,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:d.match(n,!0)}}return{active:!1,matches:null}}async function gt(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let a=t;for(;;){let t=h;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:a,fetcherKey:i,patch:(e,n)=>{r.aborted||mt(e,n,_,t,o,!1)}})}catch(e){if(s.unstable_customRouteDiscovery){if(r.aborted)return{type:`aborted`};if(e instanceof y)return{type:`cancelled`}}return{type:`error`,error:e,partialMatches:a}}if(r.aborted)return{type:`aborted`};let c=d.match(n),l=null;if(c&&(Object.keys(c[0].params).length===0||(l=d.match(n,!0),!(l&&a.length<l.length&&_t(a,l.slice(0,a.length))))))return{type:`success`,matches:c};if(l||=d.match(n,!0),!l||_t(a,l))return{type:`success`,matches:null};a=l}}function _t(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function vt(e){h={},_.setHmrRoutes(E(e,o,void 0,h))}function yt(e,t,n=!1){mt(e,t,_,h,o,n),_.hasHMRRoutes||G({})}return M={get basename(){return u},get future(){return s},get state(){return N},get routes(){return _.stableRoutes},match(e){return d.match(e)},get manifest(){return h},get window(){return t},initialize:W,subscribe:ve,enableScrollRestoration:at,navigate:xe,fetch:Me,revalidate:Ce,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Re,resetFetcher:ze,deleteFetcher:Ve,dispose:_e,getBlocker:qe,deleteBlocker:Je,patchRoutes:yt,_internalFetchControllers:B,_internalSetRoutes:vt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){G(e)}},e.instrumentations&&(M=Ae(M,e.instrumentations.map(e=>e.router).filter(Boolean))),M}function at(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ot(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=he(r||`.`,U(o),ue(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=an(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=de({basename:n,pathname:c.pathname})),p(c)}function st(e,t,n){if(!n||!at(n))return{path:t};if(n.formMethod&&!rn(n.formMethod))return{path:t,error:X(405,{method:n.formMethod})};let r=()=>({path:t,error:X(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Kt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Q(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!Q(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}c(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Lt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Lt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Rt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Rt(o)}catch{return r()}let l={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Q(l.formMethod))return{path:t,submission:l};let u=m(t);return e&&u.search&&an(u.search)&&o.append(`index`,``),u.search=`?${o}`,{path:p(u),submission:l}}function ct(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?Z(_[1])?_[1].error:_[1].data:void 0,b=i.createURL(a.location),x=i.createURL(c),S;if(u&&a.errors){let e=Object.keys(a.errors)[0];S=o.findIndex(t=>t.route.id===e)}else if(_&&Z(_[1])){let e=_[0];S=o.findIndex(t=>t.route.id===e)-1}let C=_?_[1].statusCode:void 0,w=C&&C>=400,T={currentUrl:b,currentParams:a.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...s,actionResult:y,actionStatus:C},E=Ce(o),D=o.map((i,o)=>{let{route:s}=i,f=null;if(S!=null&&o>S)f=!1;else if(s.lazy)f=!0;else if(!lt(s))f=!1;else if(u){let{shouldLoad:e}=ut(s,a.loaderData,a.errors);f=e}else dt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Et(n,r,e,c,E,i,l,t,f);let p=!1;typeof v==`boolean`?p=v:w?p=!1:d||b.pathname+b.search===x.pathname+x.search?p=!0:b.search===x.search?ft(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return Et(n,r,e,c,E,i,l,t,pt(i,m),m,v)}),O=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s)||e.isDiscovering)return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,_=g.match(e.path);if(!_){O.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let y=on(_,e.path),b=new AbortController,x=It(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=Dt(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=Dt(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};pt(y,a)&&(S=Dt(n,r,x,e.path,_,y,l,t,a))}S&&O.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:O}}function lt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ut(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!lt(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function dt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function ft(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function pt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function mt(e,t,n,r,i,a){let o;if(e){let t=r[e];c(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],l=[];if(t.forEach(e=>{let t=o.find(t=>ht(e,t));t?l.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=E(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&l.length>0)for(let e=0;e<l.length;e++){let{existingRoute:t,newRoute:n}=l[e],r=t,[a]=E([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function ht(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>ht(e,t)))??!1}var gt=new WeakMap,_t=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(c(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=gt.get(i);o||(o={},gt.set(i,o));let s=o[e];if(s)return s;let u=(async()=>{let t=x(e),n=i[e]!==void 0;if(t)l(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)l(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=u,u},vt=new WeakMap;function yt(e,t,n,r,i){let a=n[e.id];if(c(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=vt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{c(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=C(e),o=a[e]!==void 0;i?l(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?l(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return vt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],u;for(let a of o){if(i&&i.includes(a))continue;let o=_t({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(u=o))}let d=s.length>0?Promise.all(s).then(()=>{}):void 0;return d?.catch(()=>{}),u?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:u}}async function bt(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function xt(e){return e.matches.some(e=>e.route.middleware)?St(e,()=>bt(e)):bt(e)}function St(e,t){return Ct(e,t,e=>{if(nn(e))throw e;return e},Yt,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[Ut(r,a).route.id]:{type:`error`,result:t}}}}}async function Ct(e,t,n,r,i){let{matches:a,...o}=e;return await wt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function wt(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await wt(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Tt(e,t,n,r,i){let a=_t({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=yt(r.route,Q(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Et(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Tt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?pt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?pt(a,{...l,defaultShouldRevalidate:e}):pt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Q(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Q(n.method)||!p)?kt({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Dt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Et(e,t,n,r,Ce(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Tt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Ot(e,t,n,r,i,a,o,s,c=null){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let l={request:t,url:we(t,n),pattern:Ce(r),params:r[0].params,context:o,matches:r,unstable_initiator:a,unstable_navigationType:a===`navigation`?c:null},u=s?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=l;return St(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},d=await e({...l,fetcherKey:i,runClientMiddleware:u});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return d}async function kt({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Q(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:we(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw X(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw X(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function At(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function jt(e){let{result:t,type:n}=e;if(en(t)){let e;try{e=await At(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new xe(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?$t(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Jt(t),statusCode:Se(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Se(t)?t.status:void 0}:$t(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Mt(e,t,n,r,i){let a=e.headers.get(`Location`);if(c(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!fe(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=ot(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Nt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Pt(e){try{return Nt.includes(new URL(e).protocol)}catch{return!1}}function Ft(e,t,n,a){if(fe(e)){let a=e,o=r.test(a)?new URL(i(a,t.protocol)):new URL(a);if(Pt(o.toString()))throw Error(`Invalid redirect location`);let s=ue(o.pathname,n)!=null;if(o.origin===t.origin&&s)return ge(o.pathname)+o.search+o.hash}try{if(Pt(a.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function It(e,t,n,r){let i=e.createURL(Kt(t)).toString(),a={signal:n};if(r&&Q(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Lt(r.formData):r.formData}return new Request(i,a)}function Lt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Rt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function zt(e,t,n,r=!1,i=!1){let a={},o=null,s,l=!1,u={},d=n&&Z(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let f=n.route.id,p=t[f];if(c(!Qt(p),`Cannot handle redirect results in processLoaderData`),Z(p)){let t=p.error;if(d!==void 0&&(t=d,d=void 0),o||={},i)o[f]=t;else{let n=Ut(e,f);o[n.route.id]??(o[n.route.id]=t)}r||(a[f]=et),l||(l=!0,s=Se(p.error)?p.error.status:500),p.headers&&(u[f]=p.headers)}else a[f]=p.data,p.statusCode&&p.statusCode!==200&&!l&&(s=p.statusCode),p.headers&&(u[f]=p.headers)}),d!==void 0&&n&&(o={[n[0]]:d},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:u}}function Bt(e,t,n,r,i,a,o){let{loaderData:s,errors:l}=zt(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(c(s,`Did not find corresponding fetcher result`),Z(s)){let t=Ut(e.matches,r?.route.id);l&&l[t.route.id]||(l={...l,[t.route.id]:s.error}),o.delete(n)}else if(Qt(s))c(!1,`Unhandled fetcher revalidation redirect`);else{let e=$(s.data);o.set(n,e)}}),{loaderData:s,errors:l}}function Vt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==et).reduce((e,[t,n])=>(e[t]=n,e),{}),a=0;for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n],a++),r&&r.hasOwnProperty(n))break}return Object.keys(t).length===0&&a===Object.keys(e).length?e:i}function Ht(e){return e?Z(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ut(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function Wt(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function X(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new xe(e||500,o,Error(s),!0)}function Gt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Qt(r))return{key:n,result:r}}}function Kt(e){return p({...typeof e==`string`?m(e):e,hash:``})}function qt(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Jt(e){return new xe(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Yt(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Xt(t))}function Xt(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Zt(e){return en(e.result)&&Je.has(e.result.status)}function Z(e){return e.type===`error`}function Qt(e){return(e&&e.type)===`redirect`}function $t(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function en(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function tn(e){return Je.has(e)}function nn(e){return en(e)&&tn(e.status)&&e.headers.has(`Location`)}function rn(e){return qe.has(e.toUpperCase())}function Q(e){return Ge.has(e.toUpperCase())}function an(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function on(e,t){let n=typeof t==`string`?m(t).search:t.search;if(e[e.length-1].route.index&&an(n||``))return e[e.length-1];let r=H(e);return r[r.length-1]}function sn(e,t,n){return{url:we(e.createURL(t),t),pattern:n?Ce(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function cn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function ln(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function un(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function dn(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function fn(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function $(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function pn(e,t){try{let n=e.sessionStorage.getItem($e);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function mn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem($e,JSON.stringify(n))}catch(e){l(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function hn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var gn=_.createContext(null);gn.displayName=`DataRouter`;var _n=_.createContext(null);_n.displayName=`DataRouterState`;var vn=_.createContext(null);vn.displayName=`DataRouterData`;var yn=_.createContext(null);yn.displayName=`DataRouterNavigation`;var bn=_.createContext(!1);function xn(){return _.useContext(bn)}var Sn=_.createContext({isTransitioning:!1});Sn.displayName=`ViewTransition`;var Cn=_.createContext(null);Cn.displayName=`Fetchers`;var wn=_.createContext(null);wn.displayName=`Await`;var Tn=_.createContext(null);Tn.displayName=`Navigation`;var En=_.createContext(null);En.displayName=`Location`;var Dn=_.createContext({outlet:null,matches:[],isDataRoute:!1});Dn.displayName=`Route`;var On=_.createContext(!1);On.displayName=`IsDataRoute`;var kn=_.createContext(void 0);kn.displayName=`RouteId`;var An=_.createContext(null);An.displayName=`RouteError`;var jn=`REACT_ROUTER_ERROR`,Mn=`REDIRECT`,Nn=`ROUTE_ERROR_RESPONSE`;function Pn(e){if(e.startsWith(`${jn}:${Mn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Fn(e){if(e.startsWith(`${jn}:${Nn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new xe(t.status,t.statusText,t.data)}catch{}}function In(e,{relative:t}={}){c(Ln(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext(Tn),{hash:i,pathname:a,search:o}=Gn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:W([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Ln(){return _.useContext(En)!=null}function Rn(){return c(Ln(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext(En).location}var zn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Bn(){return _.useContext(On)?lr():Vn()}function Vn(){c(Ln(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext(gn),{basename:t,navigator:n}=_.useContext(Tn),{matches:r}=_.useContext(Dn),{pathname:i}=Rn(),a=JSON.stringify(U(r)),o=_.useRef(!1);return _.useLayoutEffect(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(l(o.current,zn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=he(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:W([t,c.pathname])),Ue(typeof r==`string`?r:p(r),n.createHref(c),Be(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Hn=_.createContext(null);function Un(e){let t=_.useContext(Dn).outlet;return _.useMemo(()=>t&&_.createElement(Hn.Provider,{value:e},t),[t,e])}function Wn(){let{matches:e}=_.useContext(Dn);return e[e.length-1]?.params??{}}function Gn(e,{relative:t}={}){let{matches:n}=_.useContext(Dn),{pathname:r}=Rn(),i=JSON.stringify(U(n));return _.useMemo(()=>he(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Kn(e,t,n){c(Ln(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext(Tn),{matches:i}=_.useContext(Dn),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let l=Rn(),u;if(t){let e=typeof t==`string`?m(t):t;c(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),u=e}else u=l;let d=u.pathname||`/`,f=d;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p;p=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):O(e,{pathname:f});let h=$n(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:W([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:W([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(En.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...u},navigationType:`POP`}},h):h}function qn(){let e=cr(),t=Se(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return _.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Jn=_.createElement(qn,null),Yn=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=bn;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Fn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(Dn.Provider,{value:this.props.routeContext},_.createElement(On.Provider,{value:this.props.routeContext.isDataRoute},_.createElement(kn.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},_.createElement(An.Provider,{value:e,children:this.props.component}))));return this.context?_.createElement(Zn,{error:e},t):t}},Xn=new WeakMap;function Zn({children:e,error:t}){let{basename:n,navigator:r}=_.useContext(Tn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Pn(t.digest);if(e){let i=Xn.get(t);if(i)throw i;let a=Ee(e.location,n),o=a.absoluteURL||a.to;if(Ue(e.location,o,Be(r),`allow-explicit`),Pt(o))throw Error(`Invalid redirect location`);if(Te&&!Xn.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Xn.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Qn({routeContext:e,match:t,children:n}){let r=_.useContext(gn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(Dn.Provider,{value:e},_.createElement(On.Provider,{value:e.isDataRoute},_.createElement(kn.Provider,{value:t.route.id},n)))}function $n(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);c(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ce(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let l,d=!1,f=null,p=null;r&&(l=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Jn,o&&(s<0&&c===0?(dr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=l?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(Qn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(Yn,{location:r.location,revalidation:r.revalidation,component:f,error:l,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:u}):h()},null)}function er(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tr(e){let t=_.useContext(gn);return c(t,er(e)),t}function nr(e){let t=_.useContext(_n);return c(t,er(e)),t}function rr(e){let t=_.useContext(vn);return c(t,er(e)),t}function ir(e){let t=_.useContext(yn);return c(t,er(e)),t}function ar(e){let t=_.useContext(kn);return c(t,`${e} can only be used on routes that contain a unique "id"`),t}function or(){let{navigation:e}=ir(`useNavigation`);return _.useMemo(()=>{let{matches:t,historyAction:n,...r}=e;return r},[e])}function sr(){let{matches:e}=nr(`useMatches`),{loaderData:t}=rr(`useMatches`);return _.useMemo(()=>e.map(e=>k(e,t)),[e,t])}function cr(){let e=_.useContext(An),t=rr(`useRouteError`),n=ar(`useRouteError`);return e===void 0?t.errors?.[n]:e}function lr(){let{router:e}=tr(`useNavigate`),t=ar(`useNavigate`),n=_.useRef(!1);return _.useLayoutEffect(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{l(n.current,zn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ur={};function dr(e,t,n){!t&&!ur[e]&&(ur[e]=!0,l(!1,n))}export{xe as A,s as B,Dn as C,it as D,rt as E,W as F,n as G,c as H,se as I,Ee as L,T as M,U as N,Be as O,Ce as P,he as R,Tn as S,xn as T,m as U,p as V,l as W,vn as _,In as a,Cn as b,sr as c,Un as d,Wn as f,gn as g,wn as h,nr as i,be as j,Ue as k,Bn as l,Kn as m,tr as n,Ln as o,Gn as p,rr as r,Rn as s,ar as t,or as u,yn as v,Sn as w,En as x,_n as y,ue as z};