@lunora/studio 1.0.0-alpha.19 → 1.0.0-alpha.191

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 (333) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/index.d.mts +1566 -0
  4. package/dist/index.d.ts +962 -803
  5. package/dist/index.mjs +1 -0
  6. package/dist/mount.d.mts +22 -0
  7. package/dist/mount.d.ts +11 -10
  8. package/dist/mount.mjs +1 -0
  9. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
  10. package/dist/packem_chunks/ApiTab.mjs +1 -0
  11. package/dist/packem_chunks/AuditPanel.mjs +1 -0
  12. package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
  13. package/dist/packem_chunks/ExportImportPanel.mjs +3 -0
  14. package/dist/packem_chunks/FileBrowser.mjs +4 -0
  15. package/dist/packem_chunks/FunctionRunner.mjs +1 -0
  16. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
  17. package/dist/packem_chunks/HealthPanel.mjs +1 -0
  18. package/dist/packem_chunks/InsightsPanel.mjs +1 -0
  19. package/dist/packem_chunks/LogsPanel.mjs +1 -0
  20. package/dist/packem_chunks/MailPanel.mjs +2 -0
  21. package/dist/packem_chunks/MetricsPanel.mjs +1 -0
  22. package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
  23. package/dist/packem_chunks/PitrPanel.mjs +1 -0
  24. package/dist/packem_chunks/SchemaViewer.mjs +1 -0
  25. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
  26. package/dist/packem_chunks/SettingsPanel.mjs +1 -0
  27. package/dist/packem_chunks/SqlEditorPanel.mjs +8 -0
  28. package/dist/packem_chunks/TableEditor.mjs +1 -0
  29. package/dist/packem_chunks/agents-panel.mjs +1 -0
  30. package/dist/packem_chunks/analytics-panel.mjs +1 -0
  31. package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
  32. package/dist/packem_chunks/auth-config-panel.mjs +1 -0
  33. package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
  34. package/dist/packem_chunks/containers-panel.mjs +1 -0
  35. package/dist/packem_chunks/dashboards-panel.mjs +1 -0
  36. package/dist/packem_chunks/evals-panel.mjs +1 -0
  37. package/dist/packem_chunks/fanout-panel.mjs +1 -0
  38. package/dist/packem_chunks/flags-panel.mjs +1 -0
  39. package/dist/packem_chunks/issues-panel.mjs +1 -0
  40. package/dist/packem_chunks/kv-browser.mjs +1 -0
  41. package/dist/packem_chunks/log-drains-panel.mjs +4 -0
  42. package/dist/packem_chunks/migrations-route.mjs +1 -0
  43. package/dist/packem_chunks/organizations-panel.mjs +1 -0
  44. package/dist/packem_chunks/payments-panel.mjs +1 -0
  45. package/dist/packem_chunks/permissions-panel.mjs +1 -0
  46. package/dist/packem_chunks/queues-panel.mjs +1 -0
  47. package/dist/packem_chunks/reactors-panel.mjs +1 -0
  48. package/dist/packem_chunks/rls-panel.mjs +1 -0
  49. package/dist/packem_chunks/schedule-panel.mjs +1 -0
  50. package/dist/packem_chunks/sparkline.mjs +1 -0
  51. package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
  52. package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
  53. package/dist/packem_chunks/sync-client-panel.mjs +1 -0
  54. package/dist/packem_chunks/traces-panel.mjs +1 -0
  55. package/dist/packem_chunks/users-panel.mjs +1 -0
  56. package/dist/packem_chunks/vector-browser.mjs +1 -0
  57. package/dist/packem_chunks/workflows-panel.mjs +1 -0
  58. package/dist/packem_shared/ADMIN_FUNCTIONS-B8yyk5BX.mjs +1 -0
  59. package/dist/packem_shared/ApiDocsPanel-BImfQhyJ.mjs +2 -0
  60. package/dist/packem_shared/ApiReferencePanel-CigvHhCa.mjs +1 -0
  61. package/dist/packem_shared/CommandPalette-CSdz9zax.mjs +1 -0
  62. package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
  63. package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.mjs +1 -0
  64. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.mjs +1 -0
  65. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
  66. package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
  67. package/dist/packem_shared/DataBrowser-zqK4s0IE.mjs +4 -0
  68. package/dist/packem_shared/DataFilters-Cocu-WWE.mjs +1 -0
  69. package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
  70. package/dist/packem_shared/GlobalDataBrowser-BTbqR6Wc.mjs +1 -0
  71. package/dist/packem_shared/HomePanel-_BwLI4TQ.mjs +1 -0
  72. package/dist/packem_shared/MigrationsPanel-BPWzFdxC.mjs +1 -0
  73. package/dist/packem_shared/OpenRpcReferencePanel-C6CM791D.mjs +1 -0
  74. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
  75. package/dist/packem_shared/ScheduledJobs-B4DPADwk.mjs +1 -0
  76. package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
  77. package/dist/packem_shared/Studio-CcWQdYrV.mjs +1 -0
  78. package/dist/packem_shared/StudioApp-fYFz6zZQ.mjs +1 -0
  79. package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
  80. package/dist/packem_shared/advisor-view-CPgOok_h.mjs +1 -0
  81. package/dist/packem_shared/aggregateMetrics-CY05xrYU.mjs +1 -0
  82. package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
  83. package/dist/packem_shared/app.d-BbmO2HA2.d.mts +301 -0
  84. package/dist/packem_shared/app.d-BbmO2HA2.d.ts +301 -0
  85. package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
  86. package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
  87. package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
  88. package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
  89. package/dist/packem_shared/card--2hKx4L2.mjs +1 -0
  90. package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
  91. package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
  92. package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
  93. package/dist/packem_shared/data-grid-DTBAKZlm.mjs +1 -0
  94. package/dist/packem_shared/data-view-params-qoSTqjAj.mjs +1 -0
  95. package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
  96. package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
  97. package/dist/packem_shared/error-alert-tf5zvSLV.mjs +1 -0
  98. package/dist/packem_shared/grid-features-Dm80ngyR.mjs +6 -0
  99. package/dist/packem_shared/home-panel-DCUKd8Uk.mjs +3 -0
  100. package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
  101. package/dist/packem_shared/internal-B6haJbiP.mjs +2 -0
  102. package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
  103. package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
  104. package/dist/packem_shared/log-fields-SBxKyBug.mjs +1 -0
  105. package/dist/packem_shared/log-line-BoObzuue.mjs +1 -0
  106. package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
  107. package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
  108. package/dist/packem_shared/recording-client-BXUIyBL4.mjs +1 -0
  109. package/dist/packem_shared/reference-view-DiikOols.mjs +13 -0
  110. package/dist/packem_shared/schema-diagram-CDj_69jF.mjs +2 -0
  111. package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
  112. package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
  113. package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
  114. package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
  115. package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
  116. package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
  117. package/dist/packem_shared/sql-result-table-C5y0jwaK.mjs +1 -0
  118. package/dist/packem_shared/stat-card-D0Fe04cX.mjs +1 -0
  119. package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
  120. package/dist/packem_shared/studio-OqNyRY1N.mjs +2 -0
  121. package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
  122. package/dist/packem_shared/table-list-sidebar-DHG1UJC4.mjs +1 -0
  123. package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
  124. package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
  125. package/dist/packem_shared/use-admin-query-BKXiqLci.mjs +1 -0
  126. package/dist/packem_shared/use-async-submit-BTr3w2-K.mjs +1 -0
  127. package/dist/packem_shared/use-auth-config-CuM3eJZz.mjs +1 -0
  128. package/dist/packem_shared/use-open-trace-BCW0c9qq.mjs +1 -0
  129. package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
  130. package/dist/packem_shared/use-sql-assistant-BhIMDQHV.mjs +1 -0
  131. package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
  132. package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
  133. package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
  134. package/dist/packem_shared/wire-codec-Bk4XZGE4.mjs +1 -0
  135. package/dist/standalone/chunk-225VJ77I.js +1 -0
  136. package/dist/standalone/chunk-22FKIHUY.js +1 -0
  137. package/dist/standalone/chunk-23C2QL7Z.js +8 -0
  138. package/dist/standalone/chunk-2DX5MROH.js +1 -0
  139. package/dist/standalone/chunk-2T32GEQQ.js +1 -0
  140. package/dist/standalone/chunk-2URQKGWU.js +1 -0
  141. package/dist/standalone/chunk-33TZIQ2S.js +3 -0
  142. package/dist/standalone/chunk-35DM4JJG.js +1 -0
  143. package/dist/standalone/chunk-3FBLWUXD.js +1 -0
  144. package/dist/standalone/chunk-3FTKCJ7O.js +4 -0
  145. package/dist/standalone/chunk-3Q2P62UR.js +1 -0
  146. package/dist/standalone/chunk-43IYGZQ6.js +1 -0
  147. package/dist/standalone/chunk-4GTO7FL5.js +1 -0
  148. package/dist/standalone/chunk-4JLGLPWV.js +1 -0
  149. package/dist/standalone/chunk-4L4WTGN5.js +1 -0
  150. package/dist/standalone/chunk-4POCWNXY.js +1 -0
  151. package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
  152. package/dist/standalone/chunk-55754F6H.js +1 -0
  153. package/dist/standalone/chunk-5FAP63DI.js +1 -0
  154. package/dist/standalone/chunk-5JDWLCSH.js +1 -0
  155. package/dist/standalone/chunk-5WJXVZMZ.js +1 -0
  156. package/dist/standalone/chunk-66UGPQVC.js +1 -0
  157. package/dist/standalone/chunk-6D6Z2KXU.js +1 -0
  158. package/dist/standalone/chunk-7ZHHYQ4T.js +1 -0
  159. package/dist/standalone/chunk-AAVLPU5Q.js +1 -0
  160. package/dist/standalone/chunk-AJP7B63M.js +1 -0
  161. package/dist/standalone/chunk-AWHXPIXU.js +1 -0
  162. package/dist/standalone/chunk-AYZMJVUF.js +1 -0
  163. package/dist/standalone/chunk-AZVN24IA.js +1 -0
  164. package/dist/standalone/chunk-BDO4YYBB.js +6 -0
  165. package/dist/standalone/chunk-BOM2BBWF.js +1 -0
  166. package/dist/standalone/chunk-BOTGXX4H.js +1 -0
  167. package/dist/standalone/chunk-C6T7K5XP.js +1 -0
  168. package/dist/standalone/chunk-CA3OW2WZ.js +1 -0
  169. package/dist/standalone/chunk-CHRWZLGV.js +1 -0
  170. package/dist/standalone/chunk-CMA4PTV7.js +1 -0
  171. package/dist/standalone/chunk-CSUROWL2.js +1 -0
  172. package/dist/standalone/chunk-DNJ65IEL.js +1 -0
  173. package/dist/standalone/chunk-DWJBMAZK.js +8 -0
  174. package/dist/standalone/chunk-DX6FAHR2.js +1 -0
  175. package/dist/standalone/chunk-E7TOMONS.js +4 -0
  176. package/dist/standalone/chunk-EA2JKR5D.js +1 -0
  177. package/dist/standalone/chunk-EQF3OTY7.js +1 -0
  178. package/dist/standalone/chunk-EVTM6Q43.js +1 -0
  179. package/dist/standalone/chunk-EVW7O6HB.js +1 -0
  180. package/dist/standalone/chunk-F7UC63UN.js +1 -0
  181. package/dist/standalone/chunk-FEWMAPNI.js +1 -0
  182. package/dist/standalone/chunk-FI3ECXVE.js +1 -0
  183. package/dist/standalone/chunk-FKVZRPV5.js +1 -0
  184. package/dist/standalone/chunk-FODLDLE2.js +19 -0
  185. package/dist/standalone/chunk-FSRSK4LY.js +1 -0
  186. package/dist/standalone/chunk-FTV2YW7O.js +1 -0
  187. package/dist/standalone/chunk-GGPSI4ZR.js +1 -0
  188. package/dist/standalone/chunk-GMS77BZD.js +1 -0
  189. package/dist/standalone/chunk-GUPNWYY4.js +1 -0
  190. package/dist/standalone/chunk-H7DF4RS7.js +1 -0
  191. package/dist/standalone/chunk-HEAQVSNS.js +1 -0
  192. package/dist/standalone/chunk-HXD4OZRG.js +1 -0
  193. package/dist/standalone/chunk-I4UWU3J5.js +1 -0
  194. package/dist/standalone/chunk-IHMGCHAA.js +1 -0
  195. package/dist/standalone/chunk-IIQQMD2H.js +1 -0
  196. package/dist/standalone/chunk-IMOHEGMV.js +1 -0
  197. package/dist/standalone/chunk-IS6LVJ6L.js +1 -0
  198. package/dist/standalone/chunk-IYBEVL3D.js +1 -0
  199. package/dist/standalone/chunk-K7AJEMKE.js +1 -0
  200. package/dist/standalone/chunk-K7UN7BX4.js +1 -0
  201. package/dist/standalone/chunk-KNCZAQG6.js +11 -0
  202. package/dist/standalone/chunk-KQSYYO6Q.js +1 -0
  203. package/dist/standalone/chunk-LBMSRD6N.js +1 -0
  204. package/dist/standalone/chunk-LJFYYHU7.js +1 -0
  205. package/dist/standalone/chunk-MEWNGXGQ.js +1 -0
  206. package/dist/standalone/chunk-MKL7VDTL.js +15 -0
  207. package/dist/standalone/chunk-MN6FO3NX.js +1 -0
  208. package/dist/standalone/chunk-MTUKLG3H.js +5 -0
  209. package/dist/standalone/chunk-MU3P2FI7.js +1 -0
  210. package/dist/standalone/chunk-MUZKHVS3.js +1 -0
  211. package/dist/standalone/chunk-MXLAOCAN.js +1 -0
  212. package/dist/standalone/chunk-MZFWCHUZ.js +1 -0
  213. package/dist/standalone/chunk-NZI67TPT.js +1 -0
  214. package/dist/standalone/chunk-OGUKYRFM.js +1 -0
  215. package/dist/standalone/chunk-OKG3HWSJ.js +1 -0
  216. package/dist/standalone/chunk-OSDSDUGS.js +1 -0
  217. package/dist/standalone/chunk-OWZ3CC4J.js +1 -0
  218. package/dist/standalone/chunk-P5RUFDVX.js +59 -0
  219. package/dist/standalone/chunk-PD6WIDY6.js +1 -0
  220. package/dist/standalone/chunk-PJE523S5.js +1 -0
  221. package/dist/standalone/chunk-PLHA3OWK.js +3 -0
  222. package/dist/standalone/chunk-Q2V33DP4.js +1 -0
  223. package/dist/standalone/chunk-Q4CAKBWN.js +1 -0
  224. package/dist/standalone/chunk-QCZEJFOU.js +1 -0
  225. package/dist/standalone/chunk-QDGH4GMS.js +1 -0
  226. package/dist/standalone/chunk-QKEJLVC5.js +1 -0
  227. package/dist/standalone/chunk-QZGZTILS.js +14 -0
  228. package/dist/standalone/chunk-RFNGDE33.js +1 -0
  229. package/dist/standalone/chunk-RFSMJBUZ.js +1 -0
  230. package/dist/standalone/chunk-RLLKECZT.js +1 -0
  231. package/dist/standalone/chunk-RPQL45FL.js +1 -0
  232. package/dist/standalone/chunk-S3CRZLGS.js +1 -0
  233. package/dist/standalone/chunk-SUDJTC4S.js +1 -0
  234. package/dist/standalone/chunk-TIUMFAN2.js +1 -0
  235. package/dist/standalone/chunk-UC3X7OZS.js +1 -0
  236. package/dist/standalone/chunk-ULIQFBZU.js +1 -0
  237. package/dist/standalone/chunk-USCV7TYG.js +1 -0
  238. package/dist/standalone/chunk-UYEZR3BI.js +1 -0
  239. package/dist/standalone/chunk-V3CZW3JB.js +1 -0
  240. package/dist/standalone/chunk-V3VJAA4D.js +1 -0
  241. package/dist/standalone/chunk-W6GSTWSM.js +1 -0
  242. package/dist/standalone/chunk-W6VN64ZP.js +1 -0
  243. package/dist/standalone/chunk-WUWBZPUK.js +1 -0
  244. package/dist/standalone/chunk-XWMTRNWU.js +1 -0
  245. package/dist/standalone/chunk-XYFUZ3FC.js +1 -0
  246. package/dist/standalone/chunk-XZMOZFE6.js +1 -0
  247. package/dist/standalone/chunk-Y5SVNBXX.js +1 -0
  248. package/dist/standalone/chunk-Y6CXU7T4.js +1 -0
  249. package/dist/standalone/chunk-YAVGBYLX.js +1 -0
  250. package/dist/standalone/chunk-YKXDMIHQ.js +1 -0
  251. package/dist/standalone/chunk-YOB2X3FZ.js +1 -0
  252. package/dist/standalone/chunk-YPRQLCKF.js +1 -0
  253. package/dist/standalone/chunk-YVVP4DRM.js +1 -0
  254. package/dist/standalone/chunk-YXFRZ4WU.js +1 -0
  255. package/dist/standalone/chunk-YXMBF7AD.js +1 -0
  256. package/dist/standalone/chunk-ZF4ZY6GC.js +3 -0
  257. package/dist/standalone/chunk-ZKUNMHG5.js +2 -0
  258. package/dist/standalone/chunk-ZSLVBHNB.js +1 -0
  259. package/dist/standalone/studio.js +9 -378
  260. package/dist/styles.css +2 -2
  261. package/package.json +23 -20
  262. package/dist/index.js +0 -41
  263. package/dist/mount.js +0 -26
  264. package/dist/packem_shared/ADMIN_FUNCTIONS-CZJCZ4c7.js +0 -47
  265. package/dist/packem_shared/ApiDocsPanel-yEz0fiof.js +0 -842
  266. package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
  267. package/dist/packem_shared/ApiTab-DdubReQI.js +0 -251
  268. package/dist/packem_shared/AuditPanel-CE5ofjCc.js +0 -200
  269. package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
  270. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  271. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  272. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  273. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  274. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  275. package/dist/packem_shared/DataBrowser-DpL8U-Nf.js +0 -4475
  276. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  277. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  278. package/dist/packem_shared/ExportImportPanel-ChsSUCYZ.js +0 -197
  279. package/dist/packem_shared/FileBrowser-DsRBnVhZ.js +0 -2932
  280. package/dist/packem_shared/FunctionRunner-D4cZ6fuA.js +0 -343
  281. package/dist/packem_shared/FunctionStatsPanel-BVelWgNv.js +0 -375
  282. package/dist/packem_shared/GlobalDataBrowser-3X9uRfdO.js +0 -289
  283. package/dist/packem_shared/HealthPanel-CxUVKfvo.js +0 -648
  284. package/dist/packem_shared/HomePanel-tfqpZxuu.js +0 -1334
  285. package/dist/packem_shared/InsightsPanel-DNg3K9XN.js +0 -461
  286. package/dist/packem_shared/LogsPanel-B4LoSRj0.js +0 -827
  287. package/dist/packem_shared/MailPanel-CcpdyWYs.js +0 -440
  288. package/dist/packem_shared/MetricsPanel-CxoyWbNb.js +0 -1611
  289. package/dist/packem_shared/MigrationsPanel-DGwJGWDA.js +0 -239
  290. package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
  291. package/dist/packem_shared/PitrPanel-CKUzyyHi.js +0 -252
  292. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  293. package/dist/packem_shared/ScheduledJobs-BWNwIN3I.js +0 -262
  294. package/dist/packem_shared/SchemaViewer-RclXFo9Q.js +0 -2512
  295. package/dist/packem_shared/SecurityAdvisorPanel-Dqql1Z5O.js +0 -92
  296. package/dist/packem_shared/SettingsPanel-D5iTY0YE.js +0 -390
  297. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  298. package/dist/packem_shared/SqlEditorPanel-Dj-In-B3.js +0 -13
  299. package/dist/packem_shared/Studio-VWvKNOw4.js +0 -33
  300. package/dist/packem_shared/StudioApp-BhQ6T2pn.js +0 -657
  301. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  302. package/dist/packem_shared/TableEditor-BY8bTpCl.js +0 -11
  303. package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
  304. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  305. package/dist/packem_shared/app.d-BVJFkXyj.d.ts +0 -300
  306. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  307. package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
  308. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  309. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  310. package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
  311. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  312. package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
  313. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  314. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  315. package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
  316. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  317. package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
  318. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  319. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  320. package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
  321. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  322. package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
  323. package/dist/packem_shared/sql-editor-panel-CMdxstu5.js +0 -2562
  324. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  325. package/dist/packem_shared/studio-D8ry3tJR.js +0 -11043
  326. package/dist/packem_shared/table-_RzNvy3R.js +0 -246
  327. package/dist/packem_shared/table-editor-CWx68ZCg.js +0 -407
  328. package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
  329. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  330. package/dist/packem_shared/use-admin-query-BkbdNFNz.js +0 -105
  331. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  332. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  333. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
@@ -0,0 +1 @@
1
+ import{b as Nr}from"./chunk-Y6CXU7T4.js";import{a as i,d as k,e as B,g as Z}from"./chunk-YKXDMIHQ.js";var jn=k(B(),1),ie=jn.createContext(null);var Kn=k(B(),1);function D(t){return Kn.useContext(ie)}i(D,"useRouter");var Ue=k(B(),1),xt=Ue.createContext(void 0),qn=Ue.createContext(void 0);function dt(t){return t[t.length-1]}i(dt,"last");function q(t,e){return typeof t=="function"?t(e):t}i(q,"functionalUpdate");var Xn=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable;function ht(t){for(let e in t)if(Xn.call(t,e))return!0;return!1}i(ht,"hasKeys");var Tr=i(()=>Object.create(null),"createNull"),pt=i((t,e)=>rt(t,e,Tr),"nullReplaceEqualDeep");function rt(t,e,n=()=>({}),r=0){if(!1)return e;if(t===e)return t;if(r>500)return e;let o=e,s=Ve(t)&&Ve(o);if(!s&&!(Ht(t)&&Ht(o)))return o;let c=s?t:Gn(t);if(!c)return o;let a=s?o:Gn(o);if(!a)return o;let u=c.length,l=a.length,f=s?new Array(l):n(),d=0;for(let h=0;h<l;h++){let p=s?h:a[h],g=t[p],m=o[p];if(g===m){f[p]=g,(s?h<u:Xn.call(t,p))&&d++;continue}if(g===null||m===null||typeof g!="object"||typeof m!="object"){f[p]=m;continue}let y=rt(g,m,n,r+1);f[p]=y,y===g&&d++}return u===l&&d===u?t:f}i(rt,"replaceEqualDeep");function Gn(t){let e=Object.keys(t);if(e.length!==Object.getOwnPropertyNames(t).length)return!1;let n=Object.getOwnPropertySymbols(t);if(n.length===0)return e;for(let r of n){if(!Or.call(t,r))return!1;e.push(r)}return e}i(Gn,"getEnumerableOwnKeys");function Ht(t){if(!Jn(t))return!1;let e=t.constructor;if(typeof e>"u")return!0;let n=e.prototype;return!(!Jn(n)||!n.hasOwnProperty("isPrototypeOf"))}i(Ht,"isPlainObject");function Jn(t){return Object.prototype.toString.call(t)==="[object Object]"}i(Jn,"hasObjectPrototype");function Ve(t){return Array.isArray(t)&&t.length===Object.keys(t).length}i(Ve,"isPlainArray");function Q(t,e,n){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,o=t.length;r<o;r++)if(!Q(t[r],e[r],n))return!1;return!0}if(Ht(t)&&Ht(e)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let c in e)if((!r||e[c]!==void 0)&&!Q(t[c],e[c],n))return!1;return!0}let o=0;if(!r)o=Object.keys(t).length;else for(let c in t)t[c]!==void 0&&o++;let s=0;for(let c in e)if((!r||e[c]!==void 0)&&(s++,s>o||!Q(t[c],e[c],n)))return!1;return o===s}return!1}i(Q,"deepEqual");var Dr=/[\x00-\x1f\x7f"<>`{}]/g;function Fr(t){return t.replace(Dr,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}i(Fr,"sanitizePathSegment");function Yn(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return Fr(e)}i(Yn,"decodeSegment");var We=["http:","https:","mailto:","tel:"];function st(t,e){if(!t)return!1;try{let n=new URL(t);return!e.has(n.protocol)}catch{return!1}}i(st,"isDangerousProtocol");function Dt(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};let e=/%25|%5C/gi,n=0,r="",o;for(;(o=e.exec(t))!==null;)r+=Yn(t.slice(n,o.index))+o[0],n=e.lastIndex;r=r+Yn(n?t.slice(n):t);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}i(Dt,"decodePath");function Zn(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}i(Zn,"encodePathLikeUrl");function Qn(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}i(Qn,"arraysEqual");function mt(){throw new Error("Invariant failed")}i(mt,"invariant");function Ft(t){let e=new Map,n,r,o=i(s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)},"touch");return{get(s){let c=e.get(s);if(c)return o(c),c.value},set(s,c){if(e.size>=t&&n){let u=n;e.delete(u.key),u.next&&(n=u.next,u.next.prev=void 0),u===r&&(r=void 0)}let a=e.get(s);if(a)a.value=c,o(a);else{let u={key:s,value:c,prev:r};r&&(r.next=u),r=u,n||(n=u),e.set(s,u)}},clear(){e.clear(),n=void 0,r=void 0}}}i(Ft,"createLRUCache");var gt=4,eo=5;function ze(t,e,n=new Uint16Array(6)){let r=t.indexOf("/",e),o=r===-1?t.length:r,s=t.substring(e,o);if(!s||!s.includes("$"))return n[0]=0,n[1]=e,n[2]=e,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){let u=t.length;return n[0]=2,n[1]=e,n[2]=e,n[3]=u,n[4]=u,n[5]=u,n}if(s.charCodeAt(0)===36)return n[0]=1,n[1]=e,n[2]=e+1,n[3]=o,n[4]=o,n[5]=o,n;let c=s.indexOf("{"),a;if(c!==-1&&c+1<s.length&&(a=s.indexOf("}",c))!==-1){let u=s.charCodeAt(c+1);if(u===45){if(c+2<s.length&&s.charCodeAt(c+2)===36){let l=c+3,f=a;if(l<f)return n[0]=3,n[1]=e+c,n[2]=e+l,n[3]=e+f,n[4]=e+a+1,n[5]=o,n}}else if(u===36){let l=c+1,f=c+2;return f===a?(n[0]=2,n[1]=e+c,n[2]=e+l,n[3]=e+f,n[4]=e+a+1,n[5]=t.length,n):(n[0]=1,n[1]=e+c,n[2]=e+f,n[3]=e+a,n[4]=e+a+1,n[5]=o,n)}}return n[0]=0,n[1]=e,n[2]=e,n[3]=o,n[4]=o,n[5]=o,n}i(ze,"parseSegment");function le(t,e,n,r,o,s,c,a){a?.(n);let u=r;{let l=n.fullPath??n.from,f=n.options,d=l.length,h=f?.caseSensitive??t,p=f?.params?.parse??f?.parseParams;for(;u<d;){let m=ze(l,u,e),y,R=u,v=m[5];u=v+1,s++;let _=m[0];switch(_){case 0:{let x=l.substring(m[2],m[3]),L=x,b;h?b=o.static??=new Map:(L=x.toLowerCase(),b=o.staticInsensitive??=new Map);let S=b.get(L);if(S)y=S;else{let C=Mt(l);C.parent=o,C.depth=s,y=C,b.set(L,C)}break}case 1:case 3:case 2:{let x=l.substring(R,m[1]),L=l.substring(m[4],v),b=h&&!!(x||L);h||(x=x.toLowerCase(),L=L.toLowerCase());let S=_===1?o.dynamic:_===3?o.optional:o.wildcard,C=_!==2&&!p&&S?.find(w=>!w.parse&&w.caseSensitive===b&&w.prefix===x&&w.suffix===L);if(C)y=C;else{let w=Mr(_,l,b,x,L);y=w,w.parent=o,w.depth=s;let P;_===1?P=o.dynamic??=[]:_===3?P=o.optional??=[]:P=o.wildcard??=[],P.push(w),P.length===2&&c?.push(P)}break}}o=y}if(p&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){let m=Mt(l);m.kind=eo,m.parent=o,s++,m.depth=s,o.pathless??=[],o.pathless.push(m),o=m}let g=(n.path||!n.children)&&!n.isRoot;if(g&&l.endsWith("/")){let m=Mt(l);m.kind=gt,m.parent=o,s++,m.depth=s,o.index=m,o=m}o.parse=p??null,o.priority=f?.params?.priority??0,g&&!o.route&&(o.route=n,o.fullPath=l)}if(n.children)for(let l of n.children)le(t,e,l,u,o,s,c,a)}i(le,"parseSegments");function no(t,e){if(t.parse&&!e.parse)return-1;if(!t.parse&&e.parse)return 1;if(t.parse&&e.parse&&(t.priority||e.priority))return e.priority-t.priority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}i(no,"sortDynamic");function Mt(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0}}i(Mt,"createStaticNode");function Mr(t,e,n,r,o){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:o}}i(Mr,"createDynamicNode");function oo(t,e){let n=Mt("/"),r=new Uint16Array(6),o=[];for(let s of t)le(!1,r,s,1,n,0,o);for(let s of o)s.sort(no);e.masksTree=n,e.flatCache=Ft(1e3)}i(oo,"processRouteMasks");function ro(t,e){t||="/";let n=e.flatCache.get(t);if(n!==void 0)return n;let r=He(t,e.masksTree);return e.flatCache.set(t,r),r}i(ro,"findFlatMatch");function so(t,e,n,r,o){t||="/",r||="/";let s=e?`case\0${t}`:t,c=o.singleCache.get(s);return c||(c=Mt("/"),le(e,new Uint16Array(6),{from:t},1,c,0),o.singleCache.set(s,c)),He(r,c,n)}i(so,"findSingleMatch");function io(t,e,n=!1){let r=n?t:`nofuzz\0${t}`,o=e.matchCache.get(r);if(o!==void 0)return o;t||="/";let s;try{s=He(t,e.segmentTree,n)}catch(c){if(c instanceof URIError)s=null;else throw c}return s&&(s.branch=je(s.route)),e.matchCache.set(r,s),s}i(io,"findRouteMatch");function Ar(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}i(Ar,"trimPathRight");function ao(t,e=!1,n){let r=Mt(t.fullPath),o=new Uint16Array(6),s=[],c={},a={},u=0;le(e,o,t,1,r,0,s,l=>{if(n?.(l,u),l.id in c&&mt(),c[l.id]=l,u!==0&&l.path){let f=Ar(l.fullPath);(!a[f]||l.fullPath.endsWith("/"))&&(a[f]=l)}u++});for(let l of s)l.sort(no);return{processedTree:{segmentTree:r,singleCache:Ft(1e3),matchCache:Ft(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:a}}i(ao,"processRouteTree");function He(t,e,n=!1){let r=t.split("/"),o=Br(t,r,e,n);if(!o)return null;let[s]=co(t,r,o);return{route:o.node.route,rawParams:s}}i(He,"findMatch");function co(t,e,n){let r=$r(n.node),o=null,s=Object.create(null),c=n.extract?.part??0,a=n.extract?.node??0,u=n.extract?.path??0,l=n.extract?.segment??0;for(;a<r.length;c++,a++,u++,l++){let f=r[a];if(f.kind===gt)break;if(f.kind===eo){l--,c--,u--;continue}let d=e[c],h=u;if(d&&(u+=d.length),f.kind===1){o??=n.node.fullPath.split("/");let p=o[l],g=f.prefix.length;if(p.charCodeAt(g)===123){let m=f.suffix.length,y=p.substring(g+2,p.length-m-1),R=d.substring(g,d.length-m);s[y]=decodeURIComponent(R)}else{let m=p.substring(1);s[m]=decodeURIComponent(d)}}else if(f.kind===3){if(n.skipped&1<<a){c--,u=h-1;continue}o??=n.node.fullPath.split("/");let p=o[l],g=f.prefix.length,m=f.suffix.length,y=p.substring(g+3,p.length-m-1),R=f.suffix||f.prefix?d.substring(g,d.length-m):d;R&&(s[y]=decodeURIComponent(R))}else if(f.kind===2){let p=f,g=t.substring(h+p.prefix.length,t.length-p.suffix.length),m=decodeURIComponent(g);s["*"]=m,s._splat=m;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:c,node:a,path:u,segment:l}]}i(co,"extractParams");function je(t){let e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}i(je,"buildRouteBranch");function $r(t){let e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}i($r,"buildBranch");function Br(t,e,n,r){if(t==="/"&&n.index)return{node:n.index,skipped:0};let o=!dt(e),s=o&&t!=="/",c=e.length-(o?1:0),a=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],u=null,l=null;for(;a.length;){let f=a.pop(),{node:d,index:h,skipped:p,statics:g,dynamics:m,optionals:y}=f,{extract:R,rawParams:v}=f;if(d.kind===2&&d.route&&!ce(l,f))continue;if(d.parse){if(!to(t,e,f))continue;v=f.rawParams,R=f.extract}r&&d.route&&d.kind!==gt&&ce(u,f)&&(u=f);let _=h===c;if(_&&(d.route&&(!s||d.kind===gt||d.kind===2)&&ce(l,f)&&(l=f),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;let x=_?void 0:e[h],L;if(_&&d.index){let b={node:d.index,index:h,skipped:p,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v},S=!0;if(d.index.parse&&(to(t,e,b)||(S=!1)),S){if(!m&&!y&&!p&&Ur(g,c))return b;ce(l,b)&&(l=b)}}if(d.wildcard)for(let b=d.wildcard.length-1;b>=0;b--){let S=d.wildcard[b],{prefix:C,suffix:w}=S;if(!(C&&(_||!(S.caseSensitive?x:L??=x.toLowerCase()).startsWith(C)))){if(w){if(_)continue;let P=e.slice(h).join("/"),E=P.slice(-w.length);if((S.caseSensitive?E:E.toLowerCase())!==w||P.length-w.length<C.length)continue}a.push({node:S,index:c,skipped:p,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v})}}if(d.optional){let b=p|1<<d.depth+1;for(let S=d.optional.length-1;S>=0;S--){let C=d.optional[S];a.push({node:C,index:h,skipped:b,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v})}if(!_)for(let S=d.optional.length-1;S>=0;S--){let C=d.optional[S],{prefix:w,suffix:P}=C;if(w||P){let E=C.caseSensitive?x:L??=x.toLowerCase();if(w&&!E.startsWith(w)||P&&E.indexOf(P,E.length-P.length)<w.length)continue}a.push({node:C,index:h+1,skipped:p,statics:g,dynamics:m,optionals:y+ae(c,h),extract:R,rawParams:v})}}if(!_&&d.dynamic&&x)for(let b=d.dynamic.length-1;b>=0;b--){let S=d.dynamic[b],{prefix:C,suffix:w}=S;if(C||w){let P=S.caseSensitive?x:L??=x.toLowerCase();if(C&&!P.startsWith(C)||w&&P.indexOf(w,P.length-w.length)<C.length)continue}a.push({node:S,index:h+1,skipped:p,statics:g,dynamics:m+ae(c,h),optionals:y,extract:R,rawParams:v})}if(!_&&d.staticInsensitive){let b=d.staticInsensitive.get(L??=x.toLowerCase());b&&a.push({node:b,index:h+1,skipped:p,statics:g+ae(c,h),dynamics:m,optionals:y,extract:R,rawParams:v})}if(!_&&d.static){let b=d.static.get(x);b&&a.push({node:b,index:h+1,skipped:p,statics:g+ae(c,h),dynamics:m,optionals:y,extract:R,rawParams:v})}if(d.pathless)for(let b=d.pathless.length-1;b>=0;b--){let S=d.pathless[b];a.push({node:S,index:h,skipped:p,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v})}}if(l)return l;if(r&&u){let f=u.index;for(let h=0;h<u.index;h++)f+=e[h].length;let d=f===t.length?"/":t.slice(f);return u.rawParams??=Object.create(null),u.rawParams["**"]=decodeURIComponent(d),u}return null}i(Br,"getNodeMatch");function ae(t,e){return 2**(t-e-1)}i(ae,"segmentScore");function Ur(t,e){return t===2**(e-1)-1}i(Ur,"isPerfectStaticMatch");function to(t,e,n){let r,o;try{[r,o]=co(t,e,n)}catch{return null}if(n.rawParams=r,n.extract=o,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}i(to,"validateParseParams");function ce(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===gt)>(t.node.kind===gt)||e.node.kind===gt==(t.node.kind===gt)&&e.node.depth>t.node.depth))):!0}i(ce,"isFrameMoreSpecific");function bt(t){return Kt(t.filter(e=>e!==void 0).join("/"))}i(bt,"joinPaths");function Kt(t){return t.replace(/\/{2,}/g,"/")}i(Kt,"cleanPath");function ue(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}i(ue,"trimPathLeft");function G(t){let e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}i(G,"trimPathRight");function qt(t){return G(ue(t))}i(qt,"trimPath");function yt(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}i(yt,"removeTrailingSlash");function fe(t,e,n){return yt(t,n)===yt(e,n)}i(fe,"exactPathTest");function Ke({base:t,to:e,trailingSlash:n="never",cache:r}){if(e.includes("//")&&(e=Kt(e)),e.startsWith("/"))return e.length===1||n==="preserve"?e:n==="always"?e.endsWith("/")?e:`${e}/`:e.endsWith("/")?e.slice(0,-1):e;let o=e===".",s;if(r){s=o?t:t+"\0"+e;let l=r.get(s);if(l)return l}let c;if(o)c=t.split("/");else{for(t.includes("//")&&(t=Kt(t)),c=t.split("/");c.length>1&&dt(c)==="";)c.pop();let l=e.split("/");for(let f=0,d=l.length;f<d;f++){let h=l[f];h===""?f?f===d-1&&c.push(h):c=[h]:h===".."?c.length>1?c.pop():c=[""]:h==="."||c.push(h)}}c.length>1&&(dt(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let a=c.join("/"),u=(o?Kt(a):a)||"/";return s&&r&&r.set(s,u),u}i(Ke,"resolvePath");function uo(t){let e=new Map(t.map(o=>[encodeURIComponent(o),o])),n=Array.from(e.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>e.get(s)??s)}i(uo,"compileDecodeCharMap");function jt(t,e,n){let r=e[t];return typeof r!="string"?r:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>lo(o,n)).join("/"):lo(r,n)}i(jt,"encodeParam");function de({path:t,params:e,decoder:n,...r}){let o=!1,s=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!t.includes("$"))return{interpolatedPath:t,usedParams:s,isMissingParams:o};if(!1){let f=t.length,d=0,h="";for(;d<f;){for(;d<f&&t.charCodeAt(d)===47;)d++;if(d>=f)break;let p=d,g=t.indexOf("/",d);g===-1&&(g=f),d=g;let m=t.substring(p,g);if(m)if(m.charCodeAt(0)===36)if(m.length===1){let y=e._splat;if(s._splat=y,s["*"]=y,!y){o=!0;continue}let R=jt("_splat",e,n);h+="/"+R}else{let y=m.substring(1);!o&&!(y in e)&&(o=!0),s[y]=e[y];let R=jt(y,e,n)??"undefined";h+="/"+R}else h+="/"+m}return t.endsWith("/")&&(h+="/"),{usedParams:s,interpolatedPath:h||"/",isMissingParams:o}}let c=t.length,a=0,u,l="";for(;a<c;){let f=a;u=ze(t,f,u);let d=u[5];if(a=d+1,f===d)continue;let h=u[0];if(h===0){l+="/"+t.substring(f,d);continue}if(h===2){let p=e._splat;s._splat=p,s["*"]=p;let g=t.substring(f,u[1]),m=t.substring(u[4],d);if(!p){o=!0,(g||m)&&(l+="/"+g+m);continue}let y=jt("_splat",e,n);l+="/"+g+y+m;continue}if(h===1){let p=t.substring(u[2],u[3]);!o&&!(p in e)&&(o=!0),s[p]=e[p];let g=t.substring(f,u[1]),m=t.substring(u[4],d),y=jt(p,e,n)??"undefined";l+="/"+g+y+m;continue}if(h===3){let p=t.substring(u[2],u[3]),g=e[p];if(g==null)continue;s[p]=g;let m=t.substring(f,u[1]),y=t.substring(u[4],d),R=jt(p,e,n)??"";l+="/"+m+R+y;continue}}return t.endsWith("/")&&(l+="/"),{usedParams:s,interpolatedPath:l||"/",isMissingParams:o}}i(de,"interpolatePath");function lo(t,e){let n=encodeURIComponent(t);return e?.(n)??n}i(lo,"encodePathParam");function J(t){return t?.isNotFound===!0}i(J,"isNotFound");function Vr(){try{return sessionStorage}catch{return}}i(Vr,"getSafeSessionStorage");var Wr="tsr-scroll-restoration-v1_3",po=Vr();function zr(){try{return JSON.parse(po?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}i(zr,"createScrollRestorationCache");function Hr(){try{po?.setItem(Wr,JSON.stringify(At))}catch{}}i(Hr,"persistScrollRestorationCache");var At=zr(),fo="data-scroll-restoration-id",jr=i(t=>t.state.__TSR_key||t.href,"defaultGetScrollRestorationKey");function Kr(t){let e=t.getAttribute(fo);if(e)return`[${fo}="${e}"]`;let n="",r=t,o;for(;o=r.parentNode;){let s=1,c=r;for(;c=c.previousElementSibling;)s++;let a=`${r.localName}:nth-child(${s})`;n=n?`${a} > ${n}`:a,r=o}return n}i(Kr,"getScrollRestorationSelector");var he=!1,pe="window";function qe(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}i(qe,"getElement");function ho(t){let e=new Set;for(let n of t){if(n===pe)continue;let r=qe(n);r&&e.add(r)}return e}i(ho,"getScrollToTopElements");function mo(t,e){let n=e??t.options.scrollRestoration,r=t._scroll;if(n&&(r.restoring=!0),!1)return;let o=t.options.getScrollRestorationKey||jr,s=new Set,c=i(a=>{let u=At[a]||={};for(let l of s)l===document?u[pe]={scrollX,scrollY}:l.isConnected&&(u[Kr(l)]={scrollX:l.scrollLeft,scrollY:l.scrollTop})},"snapshotCurrentScrollTargets");n&&!r.restoration&&(r.restoration=!0,he=!1,history.scrollRestoration="manual",document.addEventListener("scroll",a=>{he||s.add(a.target)},!0),t.subscribe("onBeforeLoad",a=>{a.fromLocation&&c(o(a.fromLocation)),s.clear()}),addEventListener("pagehide",()=>{c(o(t.stores.resolvedLocation.get()??t.stores.location.get())),Hr()})),!r.reset&&(r.reset=!0,t.subscribe("onRendered",a=>{let u=t.options.scrollRestorationBehavior,l=t.options.scrollToTopSelectors,f=r.next,d=r.hash,h;if(s.clear(),r.next=!0,r.hash=!1,typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;let p=o(a.toLocation),g=a.fromLocation&&o(a.fromLocation);if(r.restoring&&g&&g!==p){let m=At[g];if(m){let y=At[p];for(let R in m){if(R===pe){if(f)continue}else{let v=qe(R);if(!v||f&&l&&(h??=ho(l),h.has(v)))continue}y||(y=At[p]={}),y[R]??=m[R]}}}he=!0;try{let m=a.toLocation.hash,y=a.toLocation.state.__hashScrollIntoViewOptions??!0,R=!1;if(f){!m&&l&&(h??=ho(l));let v=m&&y&&d,_=r.restoring?At[p]:void 0;if(_)for(let x in _){let{scrollX:L,scrollY:b}=_[x];if(x===pe){if(v)continue;scrollTo({top:b,left:L,behavior:u}),R=!0}else{let S=qe(x);S&&(S.scrollLeft=L,S.scrollTop=b,h?.delete(S))}}if(!m){let x={top:0,left:0,behavior:u};if(R||scrollTo(x),h)for(let L of h)L.scrollTo(x)}}!R&&m&&y&&document.getElementById(m)?.scrollIntoView(y)}finally{he=!1}}))}i(mo,"setupScrollRestoration");function go(t,e=String){let n=new URLSearchParams;for(let r in t){let o=t[r];o!==void 0&&n.set(r,e(o))}return n.toString()}i(go,"encode");function Ge(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}i(Ge,"toValue");function yo(t){let e=new URLSearchParams(t),n=Object.create(null);for(let[r,o]of e.entries()){let s=n[r];s==null?n[r]=Ge(o):Array.isArray(s)?s.push(Ge(o)):n[r]=[s,Ge(o)]}return n}i(yo,"decode");var qr=/^(?:\s|["[{\d-]|fa|nu|tr)/,vo=Gr(JSON.parse),Ro=Jr(JSON.stringify,JSON.parse);function Gr(t){return e=>{e[0]==="?"&&(e=e.substring(1));let n=yo(e);for(let r in n){let o=n[r];if(typeof o=="string")try{n[r]=t(o)}catch{}}return n}}i(Gr,"parseSearchWith");function Jr(t,e){let n=e===JSON.parse;function r(o){if(o&&typeof o=="object")try{return t(o)}catch{}else if(e&&typeof o=="string"){if(n&&!qr.test(o))return o;try{return e(o),t(o)}catch{}}return o}return i(r,"stringifyValue"),o=>{let s=go(o,r);return s?`?${s}`:""}}i(Jr,"stringifySearchWith");var tt="__root__";function So(t){if(t.statusCode=t.statusCode||t.code||307,!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}let e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);let n=new Response(null,{status:t.statusCode,headers:e});if(n.options=t,t.throw)throw n;return n}i(So,"redirect");function me(t){return t instanceof Response&&!!t.options}i(me,"isRedirect");function _o(t){return{input:i(({url:e})=>{for(let n of t)e=ge(n,e);return e},"input"),output:i(({url:e})=>{for(let n=t.length-1;n>=0;n--)e=Je(t[n],e);return e},"output")}}i(_o,"composeRewrites");function wo(t){let e=qt(t.basepath),n=`/${e}`,r=t.caseSensitive?n:n.toLowerCase(),o=`${r}/`;return{input:i(({url:s})=>{let c=t.caseSensitive?s.pathname:s.pathname.toLowerCase();return c===r?s.pathname="/":c.startsWith(o)&&(s.pathname=s.pathname.slice(n.length)),s},"input"),output:i(({url:s})=>(s.pathname=bt(["/",e,s.pathname]),s),"output")}}i(wo,"rewriteBasepath");function ge(t,e){let n=t?.input?.({url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}i(ge,"executeRewriteInput");function Je(t,e){let n=t?.output?.({url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}i(Je,"executeRewriteOutput");function Ye(t){let e=t;return{get(){return e},set(n){e=q(n,e)}}}i(Ye,"createNonReactiveMutableStore");function Xe(t){return{get(){return t()}}}i(Xe,"createNonReactiveReadonlyStore");function xo(t,e){let{createMutableStore:n,createReadonlyStore:r,batch:o}=e,s=new Map,c=n("idle"),a=n(t),u=n(void 0),l=n([]),f=r(()=>l.get().map(m=>s.get(m).get())),d=r(()=>({status:c.get(),isLoading:c.get()==="pending",matches:f.get(),location:a.get(),resolvedLocation:u.get()}));function h(m){let y=s.get(m);return y||(y=n(void 0),s.set(m,y)),y}i(h,"getMatchStore");let p={status:c,location:a,resolvedLocation:u,ids:l,matches:f,byRoute:s,__store:d,getMatchStore:h,setMatches:g};function g(m){let y=l.get(),R=m.map(v=>v.routeId);o(()=>{Qn(y,R)||l.set(R);for(let v of y)R.includes(v)||s.get(v).set(()=>{});for(let v of m){let _=h(v.routeId);_.get()!==v&&_.set(v)}})}return i(g,"setMatches"),p}i(xo,"createRouterStores");var vt="__TSR_index",bo="popstate",Co="beforeunload";function Qe(t){let e=t.getLocation(),n=new Set,r=i(c=>{e=t.getLocation(),n.forEach(a=>a({location:e,action:c}))},"notify"),o=i(c=>{t.notifyOnIndexChange??!0?r(c):e=t.getLocation()},"handleIndexChange"),s=i(async({task:c,navigateOpts:a,...u})=>{if(a?.ignoreBlocker??!1){c();return}let l=t.getBlockers?.()??[],f=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&l.length&&f)for(let d of l){let h=$t(u.path,u.state);if(await d.blockerFn({currentLocation:e,nextLocation:h,action:u.type})){t.onBlocked?.();return}}c()},"tryNavigation");return{get location(){return e},get length(){return t.getLength()},subscribers:n,subscribe:i(c=>(n.add(c),()=>{n.delete(c)}),"subscribe"),push:i((c,a,u)=>{let l=e.state[vt];a=Ze(l+1,a),s({task:i(()=>{t.pushState(c,a),r({type:"PUSH"})},"task"),navigateOpts:u,type:"PUSH",path:c,state:a})},"push"),replace:i((c,a,u)=>{let l=e.state[vt];a=Ze(l,a),s({task:i(()=>{t.replaceState(c,a),r({type:"REPLACE"})},"task"),navigateOpts:u,type:"REPLACE",path:c,state:a})},"replace"),go:i((c,a)=>{s({task:i(()=>{t.go(c),o({type:"GO",index:c})},"task"),navigateOpts:a,type:"GO"})},"go"),back:i(c=>{s({task:i(()=>{t.back(c?.ignoreBlocker??!1),o({type:"BACK"})},"task"),navigateOpts:c,type:"BACK"})},"back"),forward:i(c=>{s({task:i(()=>{t.forward(c?.ignoreBlocker??!1),o({type:"FORWARD"})},"task"),navigateOpts:c,type:"FORWARD"})},"forward"),canGoBack:i(()=>e.state[vt]!==0,"canGoBack"),createHref:i(c=>t.createHref(c),"createHref"),block:i(c=>{if(!t.setBlockers)return()=>{};let a=t.getBlockers?.()??[];return t.setBlockers([...a,c]),()=>{let u=t.getBlockers?.()??[];t.setBlockers?.(u.filter(l=>l!==c))}},"block"),flush:i(()=>t.flush?.(),"flush"),destroy:i(()=>t.destroy?.(),"destroy"),notify:r}}i(Qe,"createHistory");function Ze(t,e){e||(e={});let n=en();return{...e,key:n,__TSR_key:n,[vt]:t}}i(Ze,"assignKeyAndIndex");function tn(t){let e=t?.window??(typeof document<"u"?window:void 0),n=e.history.pushState,r=e.history.replaceState,o=[],s=i(()=>o,"_getBlockers"),c=i(S=>o=S,"_setBlockers"),a=t?.createHref??(S=>S),u=t?.parseLocation??(()=>$t(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){let S=en();e.history.replaceState({[vt]:0,key:S,__TSR_key:S},"")}let l=u(),f,d=!1,h=!1,p=!1,g=!1,m=i(()=>l,"getLocation"),y,R=i(()=>{y&&(b._ignoreSubscribers=!0,(y[2]?e.history.pushState:e.history.replaceState)(y[1],"",y[0]),b._ignoreSubscribers=!1,y=void 0,f=void 0)},"flush"),v=i((S,C,w)=>{let P=a(C),E=!!y;E||(f=l),l=$t(C,w),y=[P,w,y?.[2]||S],E||queueMicrotask(()=>R())},"queueHistoryAction"),_=i(S=>{l=u(),b.notify({type:S})},"onPushPop"),x=i(async()=>{if(h){h=!1;return}let S=u(),C=S.state[vt]-l.state[vt],w=C===1,P=C===-1,E=!w&&!P||d;d=!1;let I=E?"GO":P?"BACK":"FORWARD",N=E?{type:"GO",index:C}:{type:P?"BACK":"FORWARD"};if(p)p=!1;else{let _t=s();if(typeof document<"u"&&_t.length){for(let nt of _t)if(await nt.blockerFn({currentLocation:l,nextLocation:S,action:I})){h=!0,e.history.go(1),b.notify(N);return}}}l=u(),b.notify(N)},"onPushPopEvent"),L=i(S=>{if(g){g=!1;return}let C=!1,w=s();if(typeof document<"u"&&w.length)for(let P of w){let E=P.enableBeforeUnload??!0;if(E===!0){C=!0;break}if(typeof E=="function"&&E()===!0){C=!0;break}}if(C)return S.preventDefault(),S.returnValue=""},"onBeforeUnload"),b=Qe({getLocation:m,getLength:i(()=>e.history.length,"getLength"),pushState:i((S,C)=>v(!0,S,C),"pushState"),replaceState:i((S,C)=>v(!1,S,C),"replaceState"),back:i(S=>(S&&(p=!0),g=!0,e.history.back()),"back"),forward:i(S=>{S&&(p=!0),g=!0,e.history.forward()},"forward"),go:i(S=>{d=!0,e.history.go(S)},"go"),createHref:i(S=>a(S),"createHref"),flush:R,destroy:i(()=>{e.history.pushState=n,e.history.replaceState=r,e.removeEventListener(Co,L,{capture:!0}),e.removeEventListener(bo,x)},"destroy"),onBlocked:i(()=>{f&&l!==f&&(l=f)},"onBlocked"),getBlockers:s,setBlockers:c,notifyOnIndexChange:!1});return e.addEventListener(Co,L,{capture:!0}),e.addEventListener(bo,x),e.history.pushState=function(...S){let C=n.apply(e.history,S);return b._ignoreSubscribers||_("PUSH"),C},e.history.replaceState=function(...S){let C=r.apply(e.history,S);return b._ignoreSubscribers||_("REPLACE"),C},b}i(tn,"createBrowserHistory");function Yr(t={initialEntries:["/"]}){let e=t.initialEntries,n=t.initialIndex?Math.min(Math.max(t.initialIndex,0),e.length-1):e.length-1,r=e.map((u,l)=>Ze(l,void 0)),o=i(()=>$t(e[n],r[n]),"getLocation"),s=[];return Qe({getLocation:o,getLength:i(()=>e.length,"getLength"),pushState:i((u,l)=>{n<e.length-1&&(e.splice(n+1),r.splice(n+1)),r.push(l),e.push(u),n=Math.max(e.length-1,0)},"pushState"),replaceState:i((u,l)=>{r[n]=l,e[n]=u},"replaceState"),back:i(()=>{n=Math.max(n-1,0)},"back"),forward:i(()=>{n=Math.min(n+1,e.length-1)},"forward"),go:i(u=>{n=Math.min(Math.max(n+u,0),e.length-1)},"go"),createHref:i(u=>u,"createHref"),getBlockers:i(()=>s,"_getBlockers"),setBlockers:i(u=>s=u,"_setBlockers")})}i(Yr,"createMemoryHistory");function Xr(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}i(Xr,"sanitizePath");function $t(t,e){let n=Xr(t),r=n.indexOf("#"),o=n.indexOf("?"),s=en();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:e||{[vt]:0,key:s,__TSR_key:s}}}i($t,"parseHref");function en(){return(Math.random()+1).toString(36).substring(7)}i(en,"createRandomKey");function Po(t){return t.options.loader||t.options.beforeLoad||t.lazyFn||t.options.component?.preload||t.options.pendingComponent?.preload}i(Po,"routeNeedsLoad");function Ct(t,e){return{fromLocation:e,toLocation:t,pathChanged:e?.pathname!==t.pathname,hrefChanged:e?.href!==t.href,hashChanged:e?.hash!==t.hash}}i(Ct,"getLocationChangeInfo");function Lo({key:t,__TSR_key:e,__TSR_index:n,__hashScrollIntoViewOptions:r,...o}){return o}i(Lo,"_getUserHistoryState");function Io(t,e,n,r){for(let o of e){if(r&&t._tx!==r)return;n.some(s=>s.routeId===o.routeId)||t.routesById[o.routeId].options.onLeave?.(o)}for(let o of n){if(r&&t._tx!==r)return;t.routesById[o.routeId].options[e.some(s=>s.routeId===o.routeId)?"onStay":"onEnter"]?.(o)}}i(Io,"runRouteLifecycle");var nn=class{static{i(this,"RouterCore")}constructor(t,e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async n=>(n(),!1),this.update=n=>{let r=this.options,o=this.basepath??r?.basepath??"/",s=this.basepath===void 0,c=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??!1??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=uo(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=tn()),this.origin=this.options.origin,this.origin||(!!1&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let l;if(!1){let f=globalThis.__TSR_CACHE__;this.resolvePathCache=f.resolvePathCache,l=f.processRouteTreeResult}else this.resolvePathCache=Ft(1e3),l=this.buildRouteTree(),!1;this.setRoutes(l)}if(!this.stores&&this.latestLocation){let l=this.getStoreConfig(this);this.batch=l.batch,this.stores=xo(this.latestLocation,l),mo(this)}let a=this.options.basepath??"/",u=this.options.rewrite;if(s||o!==a||c!==u){this.basepath=a;let l=[],f=qt(a);f&&f!=="/"&&l.push(wo({basepath:a})),u&&l.push(u),this.rewrite=l.length===0?void 0:l.length===1?l[0]:_o(l),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let n=ao(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&oo(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{let o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{for(let r of this.subscribers)if(r.eventType===n.type)try{r.fn(n)}catch(o){console.error(o)}},this.parseLocation=(n,r)=>{let o=i(({pathname:u,search:l,hash:f,href:d,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){let R=this.options.parseSearch(l),v=this.options.stringifySearch(R);return{href:u+v+f,publicHref:u+v+f,pathname:Dt(u).path,external:!1,searchStr:v,search:pt(r?.search,R),hash:Dt(f.slice(1)).path,state:rt(r?.state,h)}}let p=new URL(d,this.origin),g=ge(this.rewrite,p),m=this.options.parseSearch(g.search),y=this.options.stringifySearch(m);return g.search=y,{href:g.href.replace(g.origin,""),publicHref:d,pathname:Dt(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:y,search:pt(r?.search,m),hash:Dt(g.hash.slice(1)).path,state:rt(r?.state,h)}},"parse"),s=o(n),{__tempLocation:c,__tempKey:a}=s.state;if(c&&(!a||a===this.tempLocationKey)){let u=o(c);return u.state.key=s.state.key,u.state.__TSR_key=s.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>Ke({base:n,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>{let r=Object.create(null),o=io(G(n),this.processedTree,!0);return o&&Object.assign(r,o.rawParams),[o?.branch||[this.routesById.__root__],r,o?.route]},this.buildLocation=n=>{let r=i((s={})=>{if(s.href){let w=$t(s.href,{});s={...s,to:ge(this.rewrite,new URL(w.pathname,this.origin)).pathname,search:this.options.parseSearch(w.search),hash:w.hash.slice(1)}}let c=s._fromLocation||this._pendingLocation||this.latestLocation,a=this.matchRoutesLightweight(c);s.from;let u=s.unsafeRelative==="path"?c.pathname:s.from??a[1],l=a[2],f=a[3],d=this.resolvePathWithBase(u,s.to?`${s.to}`:"."),h=Eo(s.params,f),p=this.routesByPath[G(d)],g;if(p)g=this.getRouteBranch(p);else if(d.includes("$"))g=[];else{let[w,P,E]=this.getMatchedRoutes(d);g=w,this.options.notFoundRoute&&(!E||E.path!=="/"&&P["**"])&&(g=[...g,this.options.notFoundRoute])}if(g.length&&ht(h))for(let w of g){let P=w.options.params?.stringify??w.options.stringifyParams;if(P){h===f&&(h=Object.assign(Object.create(null),h));try{Object.assign(h,P(h))}catch{}}}let m=n.leaveParams?d:Dt(de({path:d,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=l;if(n._includeValidateSearch&&this.options.search?.strict){let w={};g.forEach(P=>{if(P.options.validateSearch)try{Object.assign(w,ye(P.options.validateSearch,{...w,...y}))}catch{}}),y=w}y=Zr(y,s,g,n._includeValidateSearch),y=pt(l,y);let R=this.options.stringifySearch(y),v=s.hash===!0?c.hash:s.hash?q(s.hash,c.hash):void 0,_=v?`#${v}`:"",x=s.state===!0?c.state:s.state?q(s.state,c.state):{};s.state&&(x=rt(c.state,x));let L=`${m}${R}${_}`,b,S,C=!1;if(this.rewrite){let w=new URL(L,this.origin),P=Je(this.rewrite,w);b=w.href.replace(w.origin,""),P.origin!==this.origin?(S=P.href,C=!0):S=P.pathname+P.search+P.hash}else b=Zn(L),S=b;return{publicHref:S,href:b,pathname:m,search:y,searchStr:R,state:x,hash:v??"",external:C,unmaskOnReload:s.unmaskOnReload}},"build"),o=r(n);if(n.mask)o.maskedLocation=r({from:n.from,...n.mask});else if(this.options.routeMasks){let s=ro(o.pathname,this.processedTree);if(s){let c=Object.assign(Object.create(null),s.rawParams),{from:a,params:u,...l}=s.route,f=Eo(u,c);o.maskedLocation=r({from:n.from,...l,params:f})}}return o},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{let s,c=G(this.latestLocation.href)===G(o.href)&&Q(Lo(o.state),Lo(this.latestLocation.state)),a=this._commitPromise,u,l=new Promise(f=>{u=f});if(l.resolve=()=>{u(),a?.resolve()},this._commitPromise=l,c)this.load();else{let{maskedLocation:f,hashScrollIntoView:d,...h}=o;f&&(h={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,s=o.replace?"REPLACE":"PUSH",this.history[s==="REPLACE"?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:s}})}return this._scroll.next=o.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:c,...a}={})=>{let u=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=u;let l=this.commitLocation({...u,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:c});return queueMicrotask(()=>{this._pendingLocation===u&&(this._pendingLocation=void 0)}),l},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:s,...c})=>{let a=!1;if(o)try{new URL(`${o}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!o){let l=this.buildLocation({to:n,...c});o=o??l.publicHref,s=s??l.publicHref}let u=!a&&s?s:o;if(st(u,this.protocolAllowlist))return;if(!c.ignoreBlocker){let l=this.history.getBlockers?.()??[];for(let f of l)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}c.replace?window.location.replace(u):window.location.href=u;return}return this.buildAndCommitLocation({...c,href:o,to:n,_isNavigate:!0})},this.load=async n=>{if(!1)return(void 0)(this,n);this.updateLatestLocation(),n?.action&&(this._scroll.hash=n.action.type==="PUSH"||n.action.type==="REPLACE"),await Oo(this,n)},this.startViewTransition=n=>{let r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&!!1&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&window.CSS?.supports?.("selector(:active-view-transition-type(a))")){let s=this.latestLocation,c=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(Ct(s,c)):r.types;if(a===!1)return n();o={update:n,types:a}}else o=n;return document.startViewTransition(o).updateCallbackDone}return n()},this.invalidate=n=>{let r=this._committed,o=n?.filter,s=this._preloads,c=new Set([...r,...this._cache.values(),...[...s?.values()??[]].flat(),...this._tx?.[3]??[]].filter(l=>!o||o(l)).map(l=>l.id)),a=[];for(let[l,f]of s??[])f.some(d=>c.has(d.id))&&(s.delete(l),a.push(l));let u=i(l=>{if(c.has(l.id)){let f=this.routesById[l.routeId],d={...l,invalid:!0,...(n?.forcePending||l.status==="error"||l.status==="notFound")&&Po(f)?{status:"pending",error:void 0}:void 0};return l._flight=void 0,d}return l},"invalidate");this._committed=r.map(u);for(let[l,f]of this._cache)c.has(l)&&(f.invalid=!0,n?.forcePending&&(f.status="pending"));for(let l of c)this._flights?.delete(l);for(let l of a)l.abort();return this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.resolveRedirect=n=>{let r=n.headers.get("Location");if(n.options.href){if(r)try{let o=new URL(r);if(this.origin&&o.origin===this.origin){let s=o.pathname+o.search+o.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}}else{let o=this.buildLocation(n.options).publicHref||"/";n.options.href=o,n.headers.set("Location",o)}if(n.options.href&&st(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{let r=this._cache,o=this._preloads,s=n?.filter,c=[],a=[];for(let[l,f]of r)(!s||s(f))&&(a.push(l),c.push(f));let u=[];for(let[l,f]of o??[])(!s||f.some(s))&&(u.push(l),c.push(...f));for(let l of a)r.delete(l);for(let l of u)o.delete(l);for(let l of c){let f=l._flight;l._flight=void 0,f&&!--f[2]&&(this._flights?.get(l.id)===f&&this._flights.delete(l.id),u.push(f[1]))}for(let l of u)l.abort()},this.loadRouteChunk=Pt,this.preloadRoute=n=>To(this,n),this.matchRoute=(n,r)=>{let o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(o),c=this.stores.status.get()==="pending";if(r?.pending&&!c)return!1;let a=r?.pending??!c?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=so(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!u||n.params&&!Q(u.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Q(a.search,s.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.getStoreConfig=e,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Ro,parseSearch:t.parseSearch??vo,protocolAllowlist:t.protocolAllowlist??We}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:e,processedTree:n}){this.routesById=t,this.routesByPath=e,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(t){let e=this.routeBranchCache.get(t);return e||(e=je(t),this.routeBranchCache.set(t,e)),e}matchRoutesInternal(t,e){let[n,r,o]=this.getMatchedRoutes(t.pathname),s=n,c=!1;(o?o.path!=="/"&&r["**"]:G(t.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:c=!0);let a=c?Qr(this.options.notFoundMode,s):void 0,u=new Array(s.length),l=this._committed,f=i((h,p)=>{let g=l[p];return g?.routeId===h.id?g:h===this.options.notFoundRoute?l.find(m=>m.routeId===h.id):void 0},"previousAt"),d;for(let h=0;h<s.length;h++){let p=s[h],g=u[h-1],m,y,R;{let N=g?.search??t.search,_t=g?._strictSearch??void 0;try{let nt=ye(p.options.validateSearch,{...N})??void 0;m={...N,...nt},y={..._t,...nt}}catch(nt){let oe=nt;if(nt instanceof Gt||(oe=new Gt(nt.message,{cause:nt})),e?.throwOnError)throw oe;m=N,y={},R=oe}}let v="",_="";try{v=p.options.loaderDeps?.({search:m})??"",_=v&&JSON.stringify(v)||""}catch(N){if(e?.throwOnError)throw N;R??=N}let{interpolatedPath:x,usedParams:L}=de({path:p.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),b=p.id+x+_,S=f(p,h),C=this._cache.get(b)??(S?.id===b?S:void 0);d=C?._strictParams??Object.assign(L,d);let w;if(!C)try{ko(p,d)}catch(N){if(J(N)||me(N)?w=N:w=new No(N.message,{cause:N}),e?.throwOnError)throw w}let P=S?"stay":"enter",E;if(C)E={...C,cause:P,search:S?pt(S.search,m):pt(C.search,m),_strictSearch:y,searchError:R};else{let N=Po(p)?"pending":"success";E={id:b,ssr:p.options.ssr,index:h,routeId:p.id,params:S?.params??d,_strictParams:d,pathname:x,updatedAt:Date.now(),search:S?pt(S.search,m):m,_strictSearch:y,searchError:R,status:N,isFetching:!1,error:void 0,paramsError:w,context:{},abortController:e?._controller??new AbortController,cause:P,loaderDeps:S?rt(S.loaderDeps,v):v,invalid:!1,preload:!1,staticData:p.options.staticData||{},fullPath:p.fullPath}}let I=a===p.id;E._notFound&&!I&&(E.error=void 0),E._notFound=I,u[h]=E}for(let h=0;h<u.length;h++){let p=u[h];p.params=p.cause==="stay"?pt(p.params,d):d,e?._controller&&(p.context={})}return u}matchRoutesLightweight(t){let e=dt(this.stores.ids.get()),n=e?this.stores.byRoute.get(e).get():void 0,r=n?.id,o=this.lightweightCache.get(t);if(o&&o[0]===r)return o[1];let[s,c]=this.getMatchedRoutes(t.pathname),a=dt(s),u={...t.search};for(let h of s)try{Object.assign(u,ye(h.options.validateSearch,u))}catch{}let l=n&&n.routeId===a.id&&n.pathname===t.pathname,f;if(l)f=n.params;else{let h=Object.assign(Object.create(null),c);for(let p of s)try{ko(p,h)}catch{}f=h}let d=[s,a.fullPath,u,f];return this.lightweightCache.set(t,[r,d]),d}},Gt=class extends Error{static{i(this,"SearchParamError")}},No=class extends Error{static{i(this,"PathParamError")}};function ye(t,e){if(t==null)return{};if("~standard"in t){let n=t["~standard"].validate(e);if(n instanceof Promise)throw new Gt("Async validation not supported");if(n.issues)throw new Gt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}i(ye,"validateSearch");function Zr(t,e,n,r){let o=[];for(let c of n){let a=c.options;if("search"in a)a.search?.middlewares&&o.push(...a.search.middlewares);else if(a.preSearchFilters||a.postSearchFilters){let l=i(({search:f,next:d})=>{let h=d(a.preSearchFilters?a.preSearchFilters.reduce((p,g)=>g(p),f):f);return a.postSearchFilters?a.postSearchFilters.reduce((p,g)=>g(p),h):h},"legacyMiddleware");o.push(l)}let u=a.validateSearch;if(r&&u){let l=i(({search:f,next:d,meta:h})=>{let p=d(f);try{let g=ye(u,p);if(h&&g)for(let m in g)m in p||(h.defaulted||=new Map).set(m,g[m]);return{...p,...g}}catch{}return p},"validate");o.push(l)}}let s=i((c,a,u)=>{if(c>=o.length){if(!e.search)return{};if(e.search===!0)return a;let f=q(e.search,a);return u&&(u.explicit=f),f}let l=i((f,d)=>{if(d){let h=u||{};return{search:s(c+1,f,h),meta:h}}return s(c+1,f,u)},"next");return o[c]({search:a,next:l,meta:u})},"applyNext");return s(0,t)}i(Zr,"applySearchMiddleware");function Qr(t,e){if(t!=="root"){let n;for(let r=e.length-1;r>=0;r--){let o=e[r];if(o.options.notFoundComponent)return o.id;n||=o.children&&o.id}if(n)return n}return tt}i(Qr,"findGlobalNotFoundRouteId");function Eo(t,e){if(t===!1||t===null)return Object.create(null);if((t??!0)===!0)return e;let n=Object.assign(Object.create(null),e);return Object.assign(n,q(t,n))}i(Eo,"resolveNextParams");function ko(t,e){let n=t.options.params?.parse??t.options.parseParams;n&&Object.assign(e,n(e))}i(ko,"extractStrictParams");function on(t,e){return t.options[e]?.preload?.()}i(on,"preloadComponent");function ts(t,e){let n=on(t,"component"),r=on(t,"pendingComponent");return e&&(r?r=r.then(e):e()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}i(ts,"loadComponents");function Pt(t,e,n){let r=i(()=>e===!1?void 0:e?on(t,e):ts(t,n),"afterLazy"),o=t._lazy;if(o)return o===!0?r():o.then(r);if(!t.lazyFn)return r();let s=t.lazyFn().then(c=>{{let{id:a,...u}=c.options;Object.assign(t.options,u),t._lazy=!0}},c=>{throw t._lazy=void 0,c});return t._lazy=s,s.then(r)}i(Pt,"loadRouteChunk");function an(t){let e=t.findIndex(n=>n.status!=="success"||n._notFound)+1;return e&&e<t.length?t.slice(0,e):t}i(an,"_getRenderedMatches");var it=0,ft=1,Re=2,Y=3,Rt=[4];function Xt(t){return typeof t[0]=="number"}i(Xt,"isControl");function Et(t,e){return e.aborted?Promise.race([Promise.reject(e),t]):new Promise((n,r)=>{let o=i(()=>r(e),"abort");e.addEventListener("abort",o,{once:!0}),Promise.resolve(t).then(n,r).finally(()=>e.removeEventListener("abort",o))})}i(Et,"waitFor");function kt(t,e){return t.routesById[e.routeId]}i(kt,"getRoute");function Zt(t,e,n){return me(t)?[Y,t]:J(t)?(t.routeId||=n,[Re,t]):e?(typeof t?.then=="function"&&(t=new Error("A Promise was thrown",{cause:t})),[ft,t]):[it,t]}i(Zt,"normalize");function cn(t,e){let n=Zt(e,!0,t.id);if(n[0]!==ft)return n;try{t.options.onError?.(n[1])}catch(r){n=Zt(r,!0,t.id)}return n}i(cn,"normalizeError");function Yt(t,e,n,r,o){return o[0].signal.aborted?Rt:fn(t,e,n,cn(n,r),o)}i(Yt,"normalizeLaneError");async function es(t,e,n,r,o,s){let[c,a]=e,u=n[0].signal,l=!!n[3];for(let f=n[6]??0;f<r;f++){let d=a[f],h=kt(t,d);d.abortController=n[0];let p=a[f-1]?.context??t.options.context??{},g={params:d.params,location:c,navigate:i(v=>t.navigate({...v,_fromLocation:c}),"navigate"),buildLocation:t.buildLocation,cause:l?"preload":d.cause,abortController:n[0],preload:l,matches:a,routeId:h.id};try{let v=d._ctx||=h.options.context?h.options.context({...g,deps:d.loaderDeps,context:p})||{}:void 0;d.context={...p,...v}}catch(v){return ut(t,d),[f,Yt(t,e,h,v,n)]}if(u.aborted)return[f,Rt];let m=d.paramsError??d.searchError;if(m!==void 0)return ut(t,d),[f,Yt(t,e,h,m,n)];let y=h.options.beforeLoad;if(!y)continue;let R=d.status;f>=s&&(d.status="pending",n[7]?.());try{Qt(t,d,"beforeLoad",n[0]);let v=await Et(y({...g,search:d.search,context:d.context,...t.options.additionalContext}),u);if(u.aborted)return[f,Rt];let _=fn(t,e,h,Zt(v,!1,h.id),n);if(_[0]!==it)return ut(t,d),[f,_];d.context={...d.context,...v}}catch(v){return ut(t,d),[f,Yt(t,e,h,v,n)]}finally{d.status=R,Qt(t,d,!1,n[0])}}o()}i(es,"contextualize");function ln(t,e,n){if(!(!n||--n[2])){if(t._flights?.get(e.id)===n){let r=t._tx;if(r&&!r[0].signal.aborted&&!r[3].includes(e)&&r[3].some(o=>o.id===e.id)&&r[3].some(o=>o.isFetching==="beforeLoad"))return;t._flights.delete(e.id)}return n[1]}}i(ln,"releaseOwnedFlight");function ut(t,e){let n=e._flight;e._flight=void 0,ln(t,e,n)?.abort()}i(ut,"releaseFlight");function j(t,e,n,r){let o=[];for(let s of e)if(!n?.includes(s)){let c=s._flight;if(s._flight=void 0,r&&c?.[2]===1&&t._flights?.get(s.id)===c&&n?.some(a=>a.id===s.id))c[2]=0;else{let a=ln(t,s,c);a&&o.push(a)}}for(let s of o)s.abort()}i(j,"transferMatchResources");function un(t){for(let e of t){let n=e._flight;n&&n[2]++}}i(un,"acquireMatchResources");function Qt(t,e,n,r){if(e.isFetching=n,r&&t._tx?.[0]!==r)return;let o=t.stores.byRoute.get(e.routeId),s=o?.get();s?.id===e.id&&o.set({...s,isFetching:n})}i(Qt,"setFetching");function Bo(t,e,n,r,o,s,c){let a=e[0];return{params:n.params,location:a,navigate:i(u=>t.navigate({...u,_fromLocation:a}),"navigate"),cause:c?"preload":n.cause,abortController:o,preload:c,deps:n.loaderDeps,parentMatchPromise:s,context:n.context,route:r,...t.options.additionalContext}}i(Bo,"getLoaderContext");async function Do(t,e,n,r,o,s,c){let a=c[0],u=a.signal;if(u.aborted)return Rt;if(!o)return[it,void 0];let l=n._flight;Qt(t,n,"loader",a);try{if(!l){let f=new AbortController;l=[Promise.resolve().then(()=>o(Bo(t,e,n,r,f,s,!!c[3]))).then(d=>Zt(d,!1,r.id),d=>Zt(d,!0,r.id)).then(d=>(d[0]!==it&&t._flights?.get(n.id)===l&&(t._flights.delete(n.id),l[2]||f.abort()),d[0]===ft&&l[2]?cn(r,d[1]):d)),f,1],(t._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],fn(t,e,r,await Et(l[0],u),c)}catch(f){if(f!==u||!u.aborted)throw f;return ut(t,n),Rt}finally{Qt(t,n,!1,a)}}i(Do,"loadResource");function Fo(t,e,n){e[0]!==Y&&(t.status="success",t.error=void 0,e[0]===it?(t.loaderData=e[1],t.invalid=!1,t.updatedAt=Date.now(),t.preload=n):t.invalid=!0)}i(Fo,"settleInto");function ns(t,e,n){let r=t._cache.get(e.id);if(r!==n||t._committed.some(s=>s.id===e.id&&s._flight===e._flight))return;let o={...e,_notFound:void 0,context:{}};o._flight&&o._flight[2]++,t._cache.set(e.id,o),r&&ut(t,r)}i(ns,"cacheLoaderMatch");function Mo(t,e){return e[0]===ft||e[0]===Re?{...t,status:e[0]===ft?"error":"notFound",error:e[1],_flight:void 0}:t}i(Mo,"getParentSnapshot");function os(t,e,n,r,o,s,c){let a=e[1][n],u=kt(t,a),l=!!s[3],f=t._cache.get(a.id),d,h=!1,p;try{if(a.status==="success"&&(d=u.options.shouldReload,typeof d=="function"&&(d=d(Bo(t,e,a,u,s[0],o,l))),s[0].signal.aborted&&(p=Rt)),!p)if(a.status!=="success")h=!0;else{let I=l||a.preload?u.options.preloadStaleTime??t.options.defaultPreloadStaleTime??3e4:u.options.staleTime??t.options.defaultStaleTime??0;h=!!(a.invalid||d||d===void 0&&Date.now()-a.updatedAt>=I&&(s[5]||a.cause==="enter"||s[2].some(N=>N.routeId===a.routeId&&N.id!==a.id)))}}catch(I){a.invalid=!0,ut(t,a),p=Yt(t,e,u,I,s)}let g=u.options.loader,m=typeof g=="function",y=m?g:g?.handler,R=!l||u.options.preload!==!1,v=R&&g?t._flights?.get(a.id):void 0;v===a._flight||p?v=void 0:v&&!h&&!l&&d===void 0?h=!0:h||(v=void 0);let _=!!(g&&h&&a.status==="success"&&!l&&!s[4]&&((m?void 0:g.staleReloadMode)??t.options.defaultStaleReloadMode)!=="blocking"),x=h&&R,L=x&&!_&&(a.status!=="success"||!!g),b=n>=c?s[7]:void 0,S=u.lazyFn&&u._lazy!==!0?b:void 0;if(x&&!g&&(a.invalid=!1,a.updatedAt=Date.now()),v&&v[2]++,L){let I=a._flight;a._flight=v,ln(t,a,I)?.abort(),n>=c&&(a.status="pending"),b?.()}x||(a.isFetching=!1);let C=(p?Promise.resolve(p):L?Do(t,e,a,u,y,o,s):Promise.resolve([it,a.loaderData])).then(I=>(L&&(Fo(a,I,l),I[0]===it&&(g&&!s[0].signal.aborted&&ns(t,a,f),n>=c&&(a.status="pending"))),I)),w=Et(Promise.resolve().then(()=>Pt(u,void 0,S)),s[0].signal).then(()=>{},I=>e[1].some((N,_t)=>_t<=n&&(N.status==="error"||N.status==="notFound"||N._notFound))?void 0:[n,Yt(t,e,u,I,s)]).then(I=>C.then(N=>(L&&!I&&N[0]===it&&a.status==="pending"&&!s[0].signal.aborted&&(a.status="success",b?.()),I)));if(r.push([n,C,w]),!_)return C.then(I=>Mo(a,I));let P={...a,status:"pending",preload:!1,_flight:v};a.invalid=!1,a.isFetching="loader";let E=Do(t,e,P,u,y,o,s).then(I=>(a.isFetching=!1,Fo(P,I,!1),I));return(e[2]??=[]).push([n,E,w,P]),E.then(I=>Mo(P,I))}i(os,"createLoaderTask");async function rn(t,e,n,r,o=0){let s=n?.[1][1],c=s?.routeId?e.findIndex(a=>a.routeId===s.routeId):n?.[0]??e.length-1;c<0&&(c=0);for(let a=c;a>=0;a--){let u=kt(t,e[a]);try{let l=Pt(u,!1);l&&await Et(l,r)}catch(l){if(l===r&&r.aborted)throw l}if(u.options.notFoundComponent)return a}return s?.routeId?c:o}i(rn,"getNotFoundBoundary");function Lt(t,e){e[2]&&(j(t,e[2].map(n=>n[3])),e[2]=void 0)}i(Lt,"discardBackground");async function Ao(t,e,n,r){let o;try{await Promise.all(t.map(s=>s[1].then(async c=>{let a=s[0];if(!(r&&a>=await r)){if(c[0]>=Y)throw[a,c];!o&&c[0]!==it&&(o=[a,c],await Promise.all((n??[]).map(u=>{if(!(u[0]<=a))return u[1].then(l=>{if(l[0]===Y)throw[u[0],l]})})))}})))}catch(s){return s}return e??o}i(Ao,"settleTasks");function fn(t,e,n,r,o,s){for(;r[0]===Y;){let c=r[1],a=c.options;if(a.reloadDocument?o[3]:o[1]>=20)return r;try{return a.href&&a.reloadDocument?(t.resolveRedirect(c),r):[Y,c,t.buildLocation({...a,_fromLocation:e[0],_includeValidateSearch:!0})]}catch(u){r=s?[ft,u]:cn(n,u),s=!0}}return r}i(fn,"materializeRedirect");async function Uo(t,e,n,r,o,s){let c=e[1],a=await o,u=!1,l=c.findIndex(p=>p._notFound),f=i(p=>p[1][0]===Re?rn(t,c,p,r.signal):p[0],"boundaryOf"),d=l<0?c.length:l;if((a?.[1][0]??0)>=Y)d=0;else if(a){d=a[2]??=await f(a);for(let p of n){if(p[0]>=d)break;let g=await p[1];if(g[0]!==it&&g[0]<Y&&!("loaderData"in c[p[0]])){a=[p[0],g],d=a[2]=await f(a);break}}}for(let p of n){if(p[0]>=d)break;let g=await p[2];if(g){a=g;break}}if((a?.[1][0]??0)>=Y){let p=a[1];if(p[0]!==Y||p[1].options.reloadDocument||p[2])return Lt(t,e),p;u=!0,a=[0,[ft,new Error("Too many redirects")]]}let h=a?a[2]??await f(a):l;if(h>=0){let p=a?.[1],g=p?.[0],m=c[h],y=p?.[1],R=i(()=>{p&&(m._notFound=void 0,g===ft?m.status="error":(y.routeId=m.routeId,m.routeId===t.routeTree.id?(m.status="success",m._notFound=!0):m.status="notFound"),m.error=y,m.isFetching=!1)},"install");R(),p||s?.();let v=kt(t,m);try{await Et(p?Promise.resolve().then(()=>Pt(v,g===ft?"errorComponent":"notFoundComponent")):Promise.all([Pt(v),Pt(v,"notFoundComponent")]),r.signal)}catch(_){if(_===r.signal&&r.signal.aborted)return Lt(t,e),Rt}p?u&&(r.abort(),await Promise.all([...n.map(_=>_[1]),...n.map(_=>_[2]),...(e[2]??[]).map(_=>_[1])]),Lt(t,e),j(t,c),R()):m.status="success"}return e}i(Uo,"reduceLane");async function Vo(t,e,n,r=0,o=e[1].length){let s=e[1];for(let c=r;c<o;c++){let a=s[c],u=kt(t,a).options;if(u.head||u.scripts)try{let l={ssr:t.options.ssr,matches:s,match:a,params:a.params,loaderData:a.loaderData},[f,d]=await Et(Promise.all([u.head?.(l),u.scripts?.(l)]),n);a.meta=f?.meta,a.links=f?.links,a.headScripts=f?.scripts,a.styles=f?.styles,a.scripts=d}catch(l){if(l===n&&n.aborted)break;console.error(l)}if(a.status!=="success"||a._notFound)break}return e}i(Vo,"projectLane");async function Wo(t,e,n,r){let o=[e,n],s=r[0].signal,c;try{let a=t.stores.matches.get(),u=n.findIndex(R=>R._notFound);if(t.options.notFoundMode!=="root"&&u>=0){let R=await rn(t,n,void 0,s,u);n[u]._notFound=void 0,n[R]._notFound=!0,u=R}let l=u<0?n.length:u+1,f=0;for(;f<l&&f!==u;){let R=n[f],v=r[2][f],_=a[f];if(v?.id!==R.id||v.status!=="success"||v._notFound||R.preload||_?.id!==R.id||_.status!=="success"||_._notFound)break;f++}let d=[],h=r[6]??0,p=h?Promise.resolve(n[h-1]):void 0,g=i(()=>{for(let R=h;R<l&&!s.aborted;R++)p=os(t,o,R,d,p,r,f)},"planSuccessfulLane"),m=await es(t,o,r,l,g,f);if(m){if(r[4]=!0,l=m[0],m[1][0]===Re){let R=await rn(t,n,m,s);m[2]=R,l=Math.min(l,R+1)}else m[1][0]>=Y&&(l=0);g()}if(!s.aborted&&!r[3]){let R=[];for(let[v,_]of t._flights??[])_[2]||(t._flights.delete(v),R.push(_[1]));for(let v of R)v.abort()}let y=Uo(t,o,d,r[0],Ao(d,m,o[2]),r[7]);o[2]?.length&&(o[3]=Ao(o[2],void 0,void 0,y.then(R=>Xt(R)?0:an(n).length,()=>0))),c=await y}catch(a){if(Lt(t,o),a===s&&s.aborted)return Rt;throw a}return Xt(c)?c:Vo(t,c,s,r[6]===n.length?r[6]:0)}i(Wo,"executeClientLane");function sn(t,e){if(t._tx!==e)return;let n=e[3],r=t.stores.matches.get(),o=t._pending;for(let s=0;s<n.length;s++){let c=n[s],a=c.status==="success"&&!c._notFound,u=r[s]?.id===c.id&&r[s]?.status==="pending";if(a&&!u)continue;let l=kt(t,c),f=a||c.invalid?0:l.options.pendingMs??t.options.defaultPendingMs,d=l.options.pendingComponent??t.options.defaultPendingComponent;if(!d||typeof f!="number"||f===1/0){o&&(o[0]=e,o[2]=0,o[4]=!0);return}let h=l.options.pendingMinMs??t.options.defaultPendingMinMs??0,p=!1;if(o?.[1]===c.id?(p=o[0]!==e,o[0]=e):(clearTimeout(o?.[3]),t._pending=o=void 0),o||(t._pending=o=[e,c.id,u?Date.now()+h:e[4]+f,void 0,u||void 0,d]),o[4]&&!p&&o[5]===d)return;if(o[5]=d,!o[4]){clearTimeout(o[3]);let y=o[2]-Date.now();if(y>0){o[3]=setTimeout(()=>sn(t,e),y);return}o[2]=0}let g=n.map(y=>({...y,_flight:void 0}));g[s].status="pending";let m=o[4]=t.startTransition(()=>t.stores.setMatches(g),g).then(y=>(y&&t._pending===o&&o[4]===m&&!o[2]&&(o[2]=Date.now()+h),y));return}}i(sn,"offerPending");function Jt(t,e){let n=t._pending;(t._tx===e||!t._tx?.[3].some(r=>r.id===n?.[1]))&&(clearTimeout(n?.[3]),t._pending=void 0)}i(Jt,"finishPending");async function $o(t,e){let n=t._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!an(e[3]).some(s=>s.id===n[1]))return;let o;try{await Et(new Promise(s=>{o=setTimeout(s,r)}),e[0].signal)}catch{}clearTimeout(o)}i($o,"awaitPendingMinimum");function zo(t,e){t._committed=e,t.stores.setMatches(e)}i(zo,"publishMatches");function rs(t,e,n,r){let o=t._committed,s=t._cache;for(let u of n)u.preload=!1,r&&(u._assetEnd=void 0);let c=an(n).length,a=new Map;{let u=Date.now();for(let l of[...o,...s.values()]){if(l.status!=="success"||n.some((d,h)=>d.id===l.id&&(h<c||d.status==="success")))continue;let f=kt(t,l);!f.options.loader||u-l.updatedAt>=(l.preload?f.options.preloadGcTime??t.options.defaultPreloadGcTime??3e5:f.options.gcTime??t.options.defaultGcTime??3e5)||a.set(l.id,s.get(l.id)===l?l:{...l,_flight:void 0,isFetching:!1,context:{}})}}e[3]=[],t._cache=a,zo(t,n),j(t,[...s.values(),...o],[...n,...a.values()]),Io(t,o,n,e)}i(rs,"commitMatches");async function ve(t,e){let n=t._tx;for(;n&&n!==e;){if(await n[5],t._tx===n)return;n=t._tx}}i(ve,"awaitCurrent");function Ho(t,e,n){let r=n[1].options,o=n[2];if(!o)return t.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return t.navigate({href:o.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});o._redirects=e[1]+1,t._pendingLocation=o;let s=t.commitLocation({...o,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{t._pendingLocation===o&&(t._pendingLocation=void 0)}),s}i(Ho,"followRedirect");async function ss(t,e,n,r,o){let s=n.map(u=>({...u}));un(s);for(let u of r)ut(t,s[u[0]]),s[u[0]]=u[3];let c=[e[2],s],a;try{a=await Uo(t,c,r,e[0],o)}catch(u){throw j(t,s),u}if(Xt(a)){j(t,s),a[0]===Y&&t._tx===e&&t._committed===n&&await Ho(t,e,a);return}if(await Vo(t,a,e[0].signal),t._tx!==e||t._committed!==n){j(t,s);return}for(let u of s){let l=t._cache.get(u.id);l?._flight&&l._flight===u._flight&&(t._cache.delete(u.id),ut(t,l))}zo(t,s),j(t,n,s)}i(ss,"runBackground");async function is(t,e,n,r,o,s){let c=await Wo(t,e[2],e[3],[e[0],e[1],t._committed,void 0,o,n,s,r]);if(Xt(c)){let d=c[0]===Y&&t._tx===e;if((!d||c[1].options.reloadDocument)&&Jt(t,e),j(t,e[3]),e[3]=[],!d)return;if(t._tx!==e){Jt(t,e);return}await Ho(t,e,c);return}let a=c[1];if(t._tx===e&&await $o(t,e),t._tx!==e){Jt(t,e),j(t,a),Lt(t,c);return}let u=e[2],l=Ct(u,t.stores.resolvedLocation.get()),f=c[2];await t.startViewTransition(async()=>{if(t._tx===e&&await $o(t,e),t._tx!==e){Jt(t,e),j(t,a),Lt(t,c);return}let d=i(()=>{Jt(t,e),rs(t,e,a,s),t._tx===e&&(t.emit({type:"onLoad",...l}),t._tx===e&&t.emit({type:"onBeforeRouteMount",...l}))},"commit"),h=await t.startTransition(d,a);if(t._tx!==e){Lt(t,c);return}f?.length&&ss(t,e,a,f,c[3]).catch(console.error),t.batch(()=>{t.stores.resolvedLocation.set(u),t.stores.status.set("idle"),t._tx===e&&t.emit({type:"onResolved",...l}),h&&t._tx===e&&t.emit({type:"onRendered",...l})}),t._tx===e&&(t._commitPromise?.resolve(),t._commitPromise=void 0)})}i(is,"runClientTransaction");async function Oo(t,e){let n=!1,r=t._tx,o=t.stores.resolvedLocation.get(),s=o??t.stores.location.get(),c=t.latestLocation,a=t._pendingLocation,u=a?.href===c.href?a._redirects??0:0,l=t._handoff,f=n?void 0:l?.[0](),d=new AbortController,h=t._preflight;if(t._preflight=d,!n&&!f&&l?.[1](),h?.abort(),!d.signal.aborted){let L=Ct(c,o);t.emit({type:"onBeforeNavigate",...L}),d.signal.aborted||t.emit({type:"onBeforeLoad",...L})}if(d.signal.aborted){await ve(t,r);return}let p=s.href===c.href,g=d,m=t.matchRoutes(c,{_controller:d});un(m);let y=f?l[1](m):void 0;if(y?g=f:f?.abort(),d.signal.aborted){j(t,m),await ve(t,r);return}t._preflight=void 0;let R,v=i(()=>is(t,x,p,()=>sn(t,x),e?.sync,y),"run"),_=e?.sync?new Promise(L=>R=L):Promise.resolve().then(v).then(),x=[g,u,c,m,Date.now(),_];if(t._tx=x,r){for(let L of t.stores.matches.get()){if(t._tx!==x)break;L.isFetching&&Qt(t,L,!1)}r[0].abort(),j(t,r[3],x[3],!0)}if(t._tx!==x){j(t,x[3]),x[3]=[],R?.(),await ve(t,x);return}t.batch(()=>{t.stores.status.set("pending"),t.stores.location.set(c)}),(y||!t._committed.length&&m[0]?.status!=="success"&&!m.some(L=>L._notFound))&&sn(t,x),R?.(v()),await _,await ve(t,x)}i(Oo,"loadClientRoute");async function To(t,e){let n=t.buildLocation(e);for(let r=0;;r++){let o=t._committed,s=new AbortController,c,a,u;try{try{c=t.matchRoutes(n,{_controller:s}),un(c),a=(t._preloads??=new Map).set(s,c),u=await Wo(t,n,c,[s,r,o,!0])}finally{a&&(a=a.delete(s),j(t,c)),s.abort()}if(!Xt(u))return u[1];if(!a||u.length<3)return;n=u[2]}catch(l){J(l)||console.error(l);return}}}i(To,"preloadClientRoute");var dn="Error preloading route! \u261D\uFE0F";var Se=class{static{i(this,"BaseRoute")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{this.originalIndex=e.originalIndex;let n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=tt:this.parentRoute||mt();let o=r?tt:n?.path;o&&o!=="/"&&(o=ue(o));let s=n?.id||o,c=r?tt:bt([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);o==="__root__"&&(o="/"),c!=="__root__"&&(c=bt(["/",c]));let a=c==="__root__"?"/":bt([this.parentRoute.fullPath,o]);this._path=o,this._id=c,this._fullPath=a,this._to=G(a)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>So({from:this.fullPath,...e}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}};var hn=class extends Se{static{i(this,"BaseRootRoute")}constructor(t){super(t)}};var Ce=k(B(),1);var T=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(T||{});function jo({update:t,notify:e,unwatched:n}){return{link:r,unlink:o,propagate:s,checkDirty:c,shallowPropagate:a};function r(l,f,d){let h=f.depsTail;if(h!==void 0&&h.dep===l)return;let p=h!==void 0?h.nextDep:f.deps;if(p!==void 0&&p.dep===l){p.version=d,f.depsTail=p;return}let g=l.subsTail;if(g!==void 0&&g.version===d&&g.sub===f)return;let m=f.depsTail=l.subsTail={version:d,dep:l,sub:f,prevDep:h,nextDep:p,prevSub:g,nextSub:void 0};p!==void 0&&(p.prevDep=m),h!==void 0?h.nextDep=m:f.deps=m,g!==void 0?g.nextSub=m:l.subs=m}function o(l,f=l.sub){let d=l.dep,h=l.prevDep,p=l.nextDep,g=l.nextSub,m=l.prevSub;return p!==void 0?p.prevDep=h:f.depsTail=h,h!==void 0?h.nextDep=p:f.deps=p,g!==void 0?g.prevSub=m:d.subsTail=m,m!==void 0?m.nextSub=g:(d.subs=g)===void 0&&n(d),p}function s(l){let f=l.nextSub,d;t:do{let h=l.sub,p=h.flags;if(p&60?p&12?p&4?!(p&48)&&u(l,h)?(h.flags=p|40,p&=1):p=0:h.flags=p&-9|32:p=0:h.flags=p|32,p&2&&e(h),p&1){let g=h.subs;if(g!==void 0){let m=(l=g).nextSub;m!==void 0&&(d={value:f,prev:d},f=m);continue}}if((l=f)!==void 0){f=l.nextSub;continue}for(;d!==void 0;)if(l=d.value,d=d.prev,l!==void 0){f=l.nextSub;continue t}break}while(!0)}function c(l,f){let d,h=0,p=!1;t:do{let g=l.dep,m=g.flags;if(f.flags&16)p=!0;else if((m&17)===17){if(t(g)){let y=g.subs;y.nextSub!==void 0&&a(y),p=!0}}else if((m&33)===33){(l.nextSub!==void 0||l.prevSub!==void 0)&&(d={value:l,prev:d}),l=g.deps,f=g,++h;continue}if(!p){let y=l.nextDep;if(y!==void 0){l=y;continue}}for(;h--;){let y=f.subs,R=y.nextSub!==void 0;if(R?(l=d.value,d=d.prev):l=y,p){if(t(f)){R&&a(y),f=l.sub;continue}p=!1}else f.flags&=-33;f=l.sub;let v=l.nextDep;if(v!==void 0){l=v;continue t}}return p}while(!0)}function a(l){do{let f=l.sub,d=f.flags;(d&48)===32&&(f.flags=d|16,(d&6)===2&&e(f))}while((l=l.nextSub)!==void 0)}function u(l,f){let d=f.depsTail;for(;d!==void 0;){if(d===l)return!0;d=d.prevDep}return!1}}i(jo,"createReactiveSystem");function Go(t,e,n){let r=typeof t=="object",o=r?t:void 0;return{next:(r?t.next:t)?.bind(o),error:(r?t.error:e)?.bind(o),complete:(r?t.complete:n)?.bind(o)}}i(Go,"toObserver");var pn=[],we=0,{link:Ko,unlink:ls,propagate:us,checkDirty:Jo,shallowPropagate:qo}=jo({update(t){return t._update()},notify(t){pn[mn++]=t,t.flags&=~T.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=T.Mutable|T.Dirty,xe(t))}}),_e=0,mn=0,at,gn=0;function yn(t){try{++gn,t()}finally{--gn||vn()}}i(yn,"batch");function xe(t){let e=t.depsTail,n=e!==void 0?e.nextDep:t.deps;for(;n!==void 0;)n=ls(n,t)}i(xe,"purgeDeps");function vn(){if(!(gn>0)){for(;_e<mn;){let t=pn[_e];pn[_e++]=void 0,t.notify()}_e=0,mn=0}}i(vn,"flush");function be(t,e){let n=typeof t=="function",r=t,o={_snapshot:n?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?T.None:T.Mutable,get(){return at!==void 0&&Ko(o,at,we),o._snapshot},subscribe(s){let c=Go(s),a={current:!1},u=fs(()=>{o.get(),a.current?c.next?.(o._snapshot):a.current=!0});return{unsubscribe:i(()=>{u.stop()},"unsubscribe")}},_update(s){let c=at,a=e?.compare??Object.is;if(n)at=o,++we,o.depsTail=void 0;else if(s===void 0)return!1;n&&(o.flags=T.Mutable|T.RecursedCheck);try{let u=o._snapshot,l=typeof s=="function"?s(u):s===void 0&&n?r(u):s;return u===void 0||!a(u,l)?(o._snapshot=l,!0):!1}finally{at=c,n&&(o.flags&=~T.RecursedCheck),xe(o)}}};return n?(o.flags=T.Mutable|T.Dirty,o.get=function(){let s=o.flags;if(s&T.Dirty||s&T.Pending&&Jo(o.deps,o)){if(o._update()){let c=o.subs;c!==void 0&&qo(c)}}else s&T.Pending&&(o.flags=s&~T.Pending);return at!==void 0&&Ko(o,at,we),o._snapshot}):o.set=function(s){if(o._update(s)){let c=o.subs;c!==void 0&&(us(c),qo(c),vn())}},o}i(be,"createAtom");function fs(t){let e=i(()=>{let r=at;at=n,++we,n.depsTail=void 0,n.flags=T.Watching|T.RecursedCheck;try{return t()}finally{at=r,n.flags&=~T.RecursedCheck,xe(n)}},"run"),n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:T.Watching|T.RecursedCheck,notify(){let r=this.flags;r&T.Dirty||r&T.Pending&&Jo(this.deps,this)?e():this.flags=T.Watching},stop(){this.flags=T.None,this.depsTail=void 0,xe(this)}};return e(),n}i(fs,"effect");var Rn=k(B(),1),Yo=k(Nr(),1);function ds(t,e){return t===e}i(ds,"defaultCompare");function V(t,e,n=ds){let r=(0,Rn.useCallback)(c=>{if(!t)return()=>{};let{unsubscribe:a}=t.subscribe(c);return a},[t]),o=(0,Rn.useCallback)(()=>t?.get(),[t]);return(0,Yo.useSyncExternalStoreWithSelector)(r,o,o,e,n)}i(V,"useStore");var Xo={};function Sn(t,e){let n=Ce.useRef();return r=>{let o=t?.select?t.select(r):r;return t?.structuralSharing??e.options.defaultStructuralSharing?n.current=rt(n.current,o):o}}i(Sn,"useStructuralSharing");function X(t){let e=D(),n=Ce.useContext(t.from?qn:xt),r=t.from??n,o=e.stores.getMatchStore(r);if(!1){let a=o.get();if(!a){(t.shouldThrow??!0)&&mt();return}return t.select?t.select(a):a}let s=Sn(t,e),c=V(o,a=>a?s(a):Xo);if(c!==Xo)return c;(t.shouldThrow??!0)&&mt()}i(X,"useMatch");function Pe(t){return X({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:i(e=>t.select?t.select(e.search):e.search,"select")})}i(Pe,"useSearch");var ct=k(B(),1);var Le=ct.useLayoutEffect;function Zo(t,e,n){ct.useEffect(()=>{if(!t.current||n||typeof IntersectionObserver!="function")return()=>e();let r=new IntersectionObserver(o=>{e(o.pop())},{rootMargin:"100px"});return r.observe(t.current),()=>{r.disconnect(),e()}},[e,n,t])}i(Zo,"useIntersectionObserver");function Qo(t){let e=ct.useRef(null);return ct.useImperativeHandle(t,()=>e.current,[]),e}i(Qo,"useForwardedRef");var _n=k(B(),1);function Ee(t){let e=D();return _n.useCallback(n=>e.navigate({...n,from:n.from??t?.from}),[t?.from,e])}i(Ee,"useNavigate");var Bt=k(B(),1),lt=k(Z(),1);var It=class extends Bt.Component{static{i(this,"CatchBoundary")}constructor(...t){super(...t),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(t,e){let n=t.getResetKey();return e.error&&e.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,e){this.props.onCatch?.(t,e)}render(){let t=this.state.error;return t?Bt.createElement(this.props.errorComponent??wn,{error:t,reset:this.reset}):this.props.children}};function wn({error:t}){let[e,n]=Bt.useState(!1);return(0,lt.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,lt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,lt.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,lt.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:i(()=>n(r=>!r),"onClick"),children:e?"Hide Error":"Show Error"})]}),(0,lt.jsx)("div",{style:{height:".25rem"}}),e?(0,lt.jsx)("div",{children:(0,lt.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,lt.jsx)("code",{children:t.message}):null})}):null]})}i(wn,"ErrorComponent");var xn=k(B(),1),tr=k(Z(),1);function er({children:t,fallback:e=null}){return(0,tr.jsx)(xn.default.Fragment,{children:bn()?t:e})}i(er,"ClientOnly");function bn(){return xn.default.useSyncExternalStore(hs,()=>!0,()=>!1)}i(bn,"useHydrated");function hs(){return()=>{}}i(hs,"subscribe");function Cn(t){return X({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:i(e=>t.select?t.select(e.loaderData):e.loaderData,"select")})}i(Cn,"useLoaderData");function Pn(t){let{select:e,...n}=t;return X({...n,select:i(r=>e?e(r.loaderDeps):r.loaderDeps,"select")})}i(Pn,"useLoaderDeps");function Ln(t){return X({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:i(e=>{let n=t.strict===!1?e.params:e._strictParams;return t.select?t.select(n):n},"select")})}i(Ln,"useParams");function En(t){return X({...t,select:i(e=>t.select?t.select(e.context):e.context,"select")})}i(En,"useRouteContext");var W=k(B(),1);var ps=k(Z(),1);function kn(t){let e=W.useRef(t);return Q(e.current,t,{ignoreUndefined:!1})||(e.current=t),e.current}i(kn,"useValueStable");function ms(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}i(ms,"compareLinkState");function gs(t,e,n){if(t?.external)return st(t.href,n)?void 0:t.href;if(!ir(e)&&!(typeof e!="string"||e.indexOf(":")===-1))try{return new URL(e),st(e,n)?void 0:e}catch{}}i(gs,"resolveExternalLink");function ys(t,e,n,r,o,s){if(s)return!1;if(n?.exact){if(!fe(t.pathname,e.pathname,r))return!1}else{let c=yt(t.pathname,r),a=yt(e.pathname,r);if(!(c.startsWith(a)&&(c.length===a.length||c[a.length]==="/")))return!1}return(n?.includeSearch??!0)&&!Q(t.search,e.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:n?.includeHash?o&&t.hash===e.hash:!0}i(ys,"resolveIsActive");function vs(t,e){let n=D(),r=Qo(e),{activeProps:o,inactiveProps:s,activeOptions:c,to:a,preload:u,preloadDelay:l,preloadIntentProximity:f,hashScrollIntoView:d,replace:h,startTransition:p,resetScroll:g,viewTransition:m,children:y,target:R,disabled:v,style:_,className:x,onClick:L,onBlur:b,onFocus:S,onMouseEnter:C,onMouseLeave:w,onTouchStart:P,ignoreBlocker:E,params:I,search:N,hash:_t,state:nt,mask:oe,reloadDocument:Ps,unsafeRelative:Ls,from:Es,_fromLocation:ks,...Nt}=t;if(!1){let M=ir(a);if(typeof a=="string"&&!M&&a.indexOf(":")>-1)try{return new URL(a),st(a,n.protocolAllowlist)?{...Nt,ref:r,href:void 0,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x}}:{...Nt,ref:r,href:a,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x}}}catch{}let F=n.buildLocation({...t,from:t.from}),ot=sr(F.maskedLocation?F.maskedLocation.publicHref:F.publicHref,F.maskedLocation?F.maskedLocation.external:F.external,n.history,v),Tt=(()=>{if(ot?.external)return st(ot.href,n.protocolAllowlist)?void 0:ot.href;if(!M&&typeof a=="string"&&a.indexOf(":")>-1)try{return new URL(a),st(a,n.protocolAllowlist)?void 0:a}catch{}})(),Ae=(()=>{if(Tt)return!1;let $=n.stores.location.get(),z=c?.exact??!1;if(z){if(!fe($.pathname,F.pathname,n.basepath))return!1}else{let U=yt($.pathname,n.basepath),H=yt(F.pathname,n.basepath);if(!(U.startsWith(H)&&(U.length===H.length||U[H.length]==="/")))return!1}if((c?.includeSearch??!0)&&$.search!==F.search){let U=!$.search||typeof $.search=="object"&&!ht($.search),H=!F.search||typeof F.search=="object"&&!ht(F.search);if(!(U&&H)&&!Q($.search,F.search,{partial:!z,ignoreUndefined:!c?.explicitUndefined}))return!1}return!c?.includeHash})();if(Tt)return{...Nt,ref:r,href:Tt,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x}};let $e=Ae?q(o,{})??nr:Ut,Be=Ae?Ut:q(s,{})??Ut,zn=(()=>{let $=_,z=$e.style,U=Be.style;if(!(!$&&!z&&!U))return $&&!z&&!U?$:!$&&z&&!U?z:!$&&!z&&U?U:{...$,...z,...U}})(),Hn=(()=>{let $=x,z=$e.className,U=Be.className;if(!$&&!z&&!U)return"";let H="";return $&&(H=$),z&&(H=H?`${H} ${z}`:z),U&&(H=H?`${H} ${U}`:U),H})();return{...Nt,...$e,...Be,href:ot?.href,ref:r,disabled:!!v,target:R,...zn&&{style:zn},...Hn&&{className:Hn},...v&&or,...Ae&&rr}}let An=bn(),Cr=kn(t.search),Pr=kn(t.params),$n=kn(c),zt=W.useMemo(()=>t,[n,t.from,t._fromLocation,t.hash,t.to,Cr,Pr,t.state,t.mask,t.unsafeRelative]),Lr=W.useCallback(M=>{let F=n.buildLocation({_fromLocation:M,...zt}),ot=sr(F.maskedLocation?F.maskedLocation.publicHref:F.publicHref,F.maskedLocation?F.maskedLocation.external:F.external,n.history,v),Tt=gs(ot,a,n.protocolAllowlist);return[ot?.href,Tt,ys(M,F,$n,n.basepath,An,Tt!==void 0)]},[$n,v,An,zt,n,a]),[Er,Te,De]=V(n.stores.location,Lr,ms),re=De?q(o,{})??nr:Ut,se=De?Ut:q(s,{})??Ut,Bn=[x,re.className,se.className].filter(Boolean).join(" "),Un=(_||re.style||se.style)&&{..._,...re.style,...se.style},Vn=W.useRef(!1),wt=t.reloadDocument||Te||v?!1:u??n.options.defaultPreload,Fe=l??n.options.defaultPreloadDelay??0,Ot=W.useCallback(()=>{n.preloadRoute(zt).catch(M=>{console.warn(M),console.warn(dn)})},[n,zt]),Me=W.useCallback(M=>{if(!M){In(r);return}if(!(M.isIntersecting??wt==="intent")){M.isIntersecting===!1&&In(r);return}if(!Fe){Ot();return}te.has(r)||te.set(r,setTimeout(()=>{te.delete(r),Ot()},Fe))},[Ot,r,wt,Fe]);Zo(r,Me,wt!=="viewport"),W.useEffect(()=>{Vn.current||wt==="render"&&(Ot(),Vn.current=!0)},[Ot,wt]);let kr=i(M=>{let F=M.currentTarget.getAttribute("target"),ot=R!==void 0?R:F;!v&&!(M.metaKey||M.altKey||M.ctrlKey||M.shiftKey)&&!M.defaultPrevented&&(!ot||ot==="_self")&&M.button===0&&(M.preventDefault(),n.navigate({...zt,replace:h,resetScroll:g,hashScrollIntoView:d,startTransition:p,viewTransition:m,ignoreBlocker:E}))},"handleClick");if(Te)return{...Nt,ref:r,href:Te,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x},...L&&{onClick:L},...b&&{onBlur:b},...S&&{onFocus:S},...C&&{onMouseEnter:C},...w&&{onMouseLeave:w},...P&&{onTouchStart:P}};let Ir=i(()=>{wt==="intent"&&Ot()},"handleTouchStart"),Wn=i(()=>{wt==="intent"&&In(r)},"handleLeave");return{...Nt,...re,...se,href:Er,ref:r,onClick:Vt([L,kr]),onBlur:Vt([b,Wn]),onFocus:Vt([S,Me]),onMouseEnter:Vt([C,Me]),onMouseLeave:Vt([w,Wn]),onTouchStart:Vt([P,Ir]),disabled:!!v,target:R,...Un&&{style:Un},...Bn&&{className:Bn},...v&&or,...De&&rr}}i(vs,"useLinkProps");var Ut={},nr={className:"active"},or={role:"link","aria-disabled":!0},rr={"data-status":"active","aria-current":"page"},te=new WeakMap,In=i(t=>{clearTimeout(te.get(t)),te.delete(t)},"cancelPreload"),Vt=i(t=>e=>{for(let n of t)if(n){if(e.defaultPrevented)return;n(e)}},"composeHandlers");function sr(t,e,n,r){if(!r)return e?{href:t,external:!0}:{href:n.createHref(t)||"/",external:!1}}i(sr,"getHrefOption");function ir(t){if(typeof t!="string")return!1;let e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}i(ir,"isSafeInternal");var Nn=W.forwardRef((t,e)=>{let{_asChild:n,...r}=t,{type:o,...s}=vs(r,e),c=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){let{disabled:a,...u}=s;return W.createElement("a",u,c)}return W.createElement(n,s,c)});var On=k(B(),1),Tn=k(Z(),1);var ar=class extends Se{static{i(this,"Route")}constructor(t){super(t),this.useMatch=e=>X({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>En({...e,from:this.id}),this.useSearch=e=>Pe({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Ln({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Pn({...e,from:this.id}),this.useLoaderData=e=>Cn({...e,from:this.id}),this.useNavigate=()=>Ee({from:this.fullPath}),this.Link=On.default.forwardRef((e,n)=>(0,Tn.jsx)(Nn,{ref:n,from:this.fullPath,...e}))}};function Rs(t){return new ar(t)}i(Rs,"createRoute");var cr=class extends hn{static{i(this,"RootRoute")}constructor(t){super(t),this.useMatch=e=>X({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>En({...e,from:this.id}),this.useSearch=e=>Pe({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Ln({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Pn({...e,from:this.id}),this.useLoaderData=e=>Cn({...e,from:this.id}),this.useNavigate=()=>Ee({from:this.fullPath}),this.Link=On.default.forwardRef((e,n)=>(0,Tn.jsx)(Nn,{ref:n,from:this.fullPath,...e}))}};function Ss(t){return new cr(t)}i(Ss,"createRootRoute");var Ic=k(B(),1);var ke=k(Z(),1);function lr(t){let e=D();if(!1){let r=`not-found-${e.stores.location.get().pathname}-${e.stores.status.get()}`;return(0,ke.jsx)(It,{getResetKey:i(()=>r,"getResetKey"),onCatch:i((o,s)=>{if(J(o))t.onCatch?.(o,s);else throw o},"onCatch"),errorComponent:i(({error:o})=>{if(J(o))return t.fallback?.(o);throw o},"errorComponent"),children:t.children})}let n=`not-found-${V(e.stores.location,r=>r.pathname)}-${V(e.stores.status,r=>r)}`;return(0,ke.jsx)(It,{getResetKey:i(()=>n,"getResetKey"),onCatch:i((r,o)=>{if(J(r))t.onCatch?.(r,o);else throw r},"onCatch"),errorComponent:i(({error:r})=>{if(J(r))return t.fallback?.(r);throw r},"errorComponent"),children:t.children})}i(lr,"CatchNotFound");function ur(){return(0,ke.jsx)("p",{children:"Not Found"})}i(ur,"DefaultGlobalNotFound");var fr=k(Z(),1);function dr({children:t}){let e=D();return null}i(dr,"ScriptOnce");var Ac=k(B(),1),Ie=k(Z(),1);function St(t){return(0,Ie.jsx)(Ie.Fragment,{children:t.children})}i(St,"SafeFragment");var Vc=k(B(),1),Ne=k(Z(),1);function Dn(t,e,n){return e.options.notFoundComponent?(0,Ne.jsx)(e.options.notFoundComponent,{...n}):t.options.defaultNotFoundComponent?(0,Ne.jsx)(t.options.defaultNotFoundComponent,{...n}):(0,Ne.jsx)(ur,{})}i(Dn,"renderRouteNotFound");var pr=k(Z(),1);function hr(t){return null}i(hr,"getScrollRestorationScriptForRouter");function mr(){let t=hr(D());return t?(0,pr.jsx)(dr,{children:t}):null}i(mr,"ScrollRestoration");var K=k(B(),1);var A=k(Z(),1);function ee(t,e){let n=e?.options.pendingComponent??t.options.defaultPendingComponent;return n?(0,A.jsx)(n,{}):null}i(ee,"renderPending");var _s=i((t,e)=>t[0]===e[0]&&t[1]===e[1],"outletMatchSelectionEqual"),vr=i((t,e,n)=>!e.isRoot||e.options.shellComponent||e.options.wrapInSuspense||n===!1||n==="data-only"||!t.ssr,"canWrapInSuspense"),Oe=K.memo(i(function({routeId:e}){let n=D();return(0,A.jsx)(gr,{router:n,match:V(n.stores.getMatchStore(e),r=>r)})},"MatchImpl"));function gr({router:t,match:e}){let n=t.routesById[e.routeId],r=ee(t,n),o=n.options.errorComponent??t.options.defaultErrorComponent,s=n.options.onCatch??t.options.defaultOnCatch,c=n.isRoot?n.options.notFoundComponent??t.options.notFoundRoute?.options.component:n.options.notFoundComponent,a=e.ssr===!1||e.ssr==="data-only",u=vr(t,n,e.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||a))?K.Suspense:St,l=o?It:St,f=c?lr:St;return(0,A.jsxs)(n.isRoot?n.options.shellComponent??St:St,{children:[(0,A.jsx)(xt.Provider,{value:e.routeId,children:(0,A.jsx)(u,{fallback:r,children:(0,A.jsx)(l,{getResetKey:i(()=>e,"getResetKey"),errorComponent:o,onCatch:i((d,h)=>{if(J(d))throw d.routeId??=e.routeId,d;s?.(d,h)},"onCatch"),children:(0,A.jsx)(f,{fallback:i(d=>{if(d.routeId??=e.routeId,d.routeId!==e.routeId)throw d;return K.createElement(c,d)},"fallback"),children:a?(0,A.jsx)(er,{fallback:r,children:(0,A.jsx)(yr,{match:e})}):(0,A.jsx)(yr,{match:e})})})})}),null]})}i(gr,"MatchView");var yr=K.memo(i(function({match:e}){let n=D(),r=e.routeId,o=n.routesById[r],s=K.useMemo(()=>{let a=(o.options.remountDeps??n.options.defaultRemountDeps)?.({routeId:r,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return a?JSON.stringify(a):void 0},[r,e.loaderDeps,e._strictParams,e._strictSearch,o.options.remountDeps,n.options.defaultRemountDeps]),c=K.useMemo(()=>{let a=o.options.component??n.options.defaultComponent;return a?(0,A.jsx)(a,{},s):(0,A.jsx)(Rr,{})},[s,o.options.component,n.options.defaultComponent]);if(e.status==="pending"){if(n.ssr&&!vr(n,o,e.ssr))return c;if(n._tx)throw n._tx[5];return ee(n,o)}if(e.status==="notFound")return Dn(n,o,e.error);if(e.status==="error"){if(!1)return(0,A.jsx)((o.options.errorComponent??n.options.defaultErrorComponent)||wn,{error:e.error,reset:void 0,info:{componentStack:""}});throw e.error}return c},"MatchInnerImpl")),Rr=K.memo(i(function(){let e=D(),n=K.useContext(xt),r,o,s;if(!1){let a=e.stores.matches.get(),u=a.findIndex(f=>f.routeId===n),l=a[u];r=!!l._notFound,o=l.error,s=a[u+1]?.routeId}else{let a=e.stores.getMatchStore(n);[r,o]=V(a,u=>[!!u._notFound,u.error],_s),s=V(e.stores.ids,u=>u[u.indexOf(n)+1])}if(r)return Dn(e,e.routesById[n],o);if(!s)return null;let c=(0,A.jsx)(Oe,{routeId:s});return n===tt?(0,A.jsx)(K.Suspense,{fallback:ee(e),children:c}):c},"OutletImpl"));var Fn=k(B(),1);function Mn(t,e){let n=t[1];t.length=0,n?.(e)}i(Mn,"settleOwner");function Sr({t}){let e=D(),n=e._rendered??=[],r=void 0;return e.startTransition=(o,s)=>new Promise(c=>{Mn(n,!1),n.push(s,c),t(e),Fn.startTransition(o)}),Le(()=>{let o=e.history.subscribe(e.load);if(r?.current)return o;r&&(r.current=!0),e.updateLatestLocation();let s=e.latestLocation,c=e.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(G(s.publicHref)!==G(c.publicHref))return e.commitLocation({...c,replace:!0,ignoreBlocker:!0}),o;let a=e.stores.resolvedLocation.get();return a?.href===s.href&&a.state.__TSR_key===s.state.__TSR_key?n.push(e.stores.matches.get(),u=>{u&&e.emit({type:"onRendered",...Ct(a,a)})}):e._tx||e.load({sync:!0}).catch(console.error),o},[e,e.history]),null}i(Sr,"Transitioner");var Wt=k(B(),1);var et=k(Z(),1);function _r(){let t=D(),e=t.routesById[tt],n=ee(t,e),r=t.ssr?St:Wt.Suspense,o=(0,et.jsxs)(et.Fragment,{children:[!!1&&(0,et.jsx)(Sr,{t:Wt.useState()[1]}),(0,et.jsx)(r,{fallback:n,children:(0,et.jsx)(ws,{})})]});return t.options.InnerWrap?(0,et.jsx)(t.options.InnerWrap,{children:o}):o}i(_r,"Matches");function ws(){let t=D(),e=t._rendered,n=V(t.stores.matches,c=>e[0]??c),r=n[0],o=r?.routeId;Le(()=>{e[0]===n&&Mn(e,!0)},[e,n]);let s=o?(0,et.jsx)(Oe,{routeId:o}):null;return(0,et.jsx)(xt.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?s:(0,et.jsx)(It,{getResetKey:i(()=>r,"getResetKey"),onCatch:void 0,children:s})})}i(ws,"MatchesInner");var wr=i(t=>({createMutableStore:be,createReadonlyStore:be,batch:yn}),"getStoreFactory");var xs=i(t=>new xr(t),"createRouter"),xr=class extends nn{static{i(this,"Router")}constructor(t){super(t,wr)}};var Al=k(B(),1),ne=k(Z(),1);function br({router:t,children:e,...n}){ht(n)&&t.update({...t.options,...n,context:{...t.options.context,...n.context}});let r=(0,ne.jsx)(ie.Provider,{value:t,children:e});return t.options.Wrap?(0,ne.jsx)(t.options.Wrap,{children:r}):r}i(br,"RouterContextProvider");function bs({router:t,...e}){return(0,ne.jsx)(br,{router:t,...e,children:(0,ne.jsx)(_r,{})})}i(bs,"RouterProvider");function Cs(t){let e=D({warn:t?.router===void 0}),n=t?.router||e;if(!1){let r=n.stores.__store.get();return t?.select?t.select(r):r}return V(n.stores.__store,Sn(t,n))}i(Cs,"useRouterState");export{tn as a,Yr as b,D as c,Pe as d,Ee as e,Rs as f,Ss as g,Rr as h,xs as i,bs as j,Cs as k};
@@ -0,0 +1 @@
1
+ import{a as Pe,b as Re}from"./chunk-LBMSRD6N.js";import{a as ce}from"./chunk-RPQL45FL.js";import{a as Te}from"./chunk-GGPSI4ZR.js";import"./chunk-4GTO7FL5.js";import{a as Se}from"./chunk-MXLAOCAN.js";import{b as ke}from"./chunk-CMA4PTV7.js";import{a as de}from"./chunk-UYEZR3BI.js";import{a as Le}from"./chunk-BOTGXX4H.js";import{a as ie}from"./chunk-QKEJLVC5.js";import{a as xe}from"./chunk-S3CRZLGS.js";import{a as be}from"./chunk-2DX5MROH.js";import{b as ve}from"./chunk-OGUKYRFM.js";import"./chunk-6D6Z2KXU.js";import"./chunk-OKG3HWSJ.js";import{W as D}from"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as pe}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as re}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as ye}from"./chunk-4POCWNXY.js";import"./chunk-ULIQFBZU.js";import"./chunk-GUPNWYY4.js";import"./chunk-35DM4JJG.js";import{a as ne}from"./chunk-4ZEL6BYL.js";import{c as oe}from"./chunk-AZVN24IA.js";import{f as ge}from"./chunk-KNCZAQG6.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as J}from"./chunk-FKVZRPV5.js";import{a as we,b as Ne,c as Ce,d as se,e as B,f as W}from"./chunk-HEAQVSNS.js";import{d as z,h as ae,i as fe,o as le}from"./chunk-FODLDLE2.js";import{a as v,d as te,e as _e,f as Ae,g as Ue,i as j}from"./chunk-YKXDMIHQ.js";var K=te(Ae(),1);var I=te(_e(),1);var r=te(Ue(),1);var me=["trace","debug","log","info","warn","error","fatal"],$e="LOG_ARCHIVE_NOT_CONFIGURED",ze={cursor:void 0,error:null,loading:!1,notConfigured:!1,rows:null},De=v((i,e)=>{switch(e.type){case"append":return{...i,cursor:e.cursor,error:null,loading:!1,rows:[...i.rows??[],...e.rows]};case"failed":return{cursor:void 0,error:e.message,loading:!1,notConfigured:!1,rows:null};case"loaded":return{cursor:e.cursor,error:null,loading:!1,notConfigured:!1,rows:e.rows};case"loading":return{...i,error:null,loading:!0,notConfigured:!1};case"notConfigured":return{cursor:void 0,error:null,loading:!1,notConfigured:!0,rows:null};case"pageFailed":return{...i,error:e.message,loading:!1};default:return i}},"De"),Be=v(i=>{let e=(0,K.c)(33),{row:t}=i,n;e[0]!==t.fields?(n=ce(t.fields),e[0]=t.fields,e[1]=n):n=e[1];let s=n,o=`lg-archive-row-${String(t.ts)}`,c;e[2]!==t.ts?(c=new Date(t.ts).toLocaleString(),e[2]=t.ts,e[3]=c):c=e[3];let f;e[4]!==c?(f=(0,r.jsx)(W,{className:"tabular-nums whitespace-nowrap text-xs text-muted-foreground",children:c}),e[4]=c,e[5]=f):f=e[5];let m=Pe[t.level],d;e[6]!==t.level||e[7]!==m?(d=(0,r.jsx)(W,{children:(0,r.jsx)(re,{variant:m,children:t.level})}),e[6]=t.level,e[7]=m,e[8]=d):d=e[8];let a;e[9]!==t.functionPath?(a=(0,r.jsx)(W,{className:"font-mono text-xs",children:t.functionPath}),e[9]=t.functionPath,e[10]=a):a=e[10];let h;e[11]!==t.message?(h=(0,r.jsx)("div",{className:"truncate",title:t.message,children:t.message}),e[11]=t.message,e[12]=h):h=e[12];let l;e[13]!==s?(l=s!==""&&(0,r.jsx)("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:s,children:s}),e[13]=s,e[14]=l):l=e[14];let u;e[15]!==h||e[16]!==l?(u=(0,r.jsxs)(W,{className:"max-w-md",children:[h,l]}),e[15]=h,e[16]=l,e[17]=u):u=e[17];let g=t.traceId??"\u2014",b;e[18]!==g?(b=(0,r.jsx)(W,{className:"font-mono text-[11px] text-muted-foreground",children:g}),e[18]=g,e[19]=b):b=e[19];let x=t.shardKey??"\u2014",w;e[20]!==x?(w=(0,r.jsx)(W,{className:"font-mono text-[11px] text-muted-foreground",children:x}),e[20]=x,e[21]=w):w=e[21];let N=t.userId??"\u2014",y;e[22]!==N?(y=(0,r.jsx)(W,{className:"font-mono text-[11px] text-muted-foreground",children:N}),e[22]=N,e[23]=y):y=e[23];let T;return e[24]!==u||e[25]!==b||e[26]!==w||e[27]!==y||e[28]!==o||e[29]!==f||e[30]!==d||e[31]!==a?(T=(0,r.jsxs)(se,{"data-testid":o,children:[f,d,a,u,b,w,y]}),e[24]=u,e[25]=b,e[26]=w,e[27]=y,e[28]=o,e[29]=f,e[30]=d,e[31]=a,e[32]=T):T=e[32],T},"Qe"),We=v(({shardKey:i})=>{let e=ge(),t=z(),[n,s]=(0,I.useState)(""),[o,c]=(0,I.useState)(""),[f,m]=(0,I.useState)(""),[{cursor:d,error:a,loading:h,notConfigured:l,rows:u},g]=(0,I.useReducer)(De,ze),b=ie(n.trim(),400),x=ie(o.trim(),400),w={...b===""?{}:{functionPathPrefix:b},...f===""?{}:{minLevel:f},...i===""?{}:{shardKey:i},...x===""?{}:{userId:x}},N=JSON.stringify(w),y=(0,I.useRef)(N);(0,I.useEffect)(()=>{let p={cancelled:!1};return y.current=N,le((async()=>{g({type:"loading"});try{let C=await e.queryLogArchive(w);p.cancelled||g({cursor:C.nextCursor,rows:C.rows,type:"loaded"})}catch(C){p.cancelled||g(fe(C)===$e?{type:"notConfigured"}:{message:ae(C),type:"failed"})}})()),()=>{p.cancelled=!0}},[e,N]);let T=v(async()=>{if(d===void 0)return;let p=N;g({type:"loading"});try{let C=await e.queryLogArchive({...w,cursor:d});y.current===p&&g({cursor:C.nextCursor,rows:C.rows,type:"append"})}catch(C){y.current===p&&g({message:ae(C),type:"pageFailed"})}},"T"),R=v(p=>{s(p.target.value)},"R"),k=v(p=>{c(p.target.value)},"N"),L=v(p=>{m(p.target.value)},"L"),S=v(()=>{le(T())},"S");return l?(0,r.jsx)(J,{action:(0,r.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline",href:de,rel:"noreferrer",target:"_blank",children:t("Open in Cloudflare")}),description:t("Wire pipelineLogSink to a Cloudflare Pipeline \u2192 R2 Data Catalog table and set R2_SQL_ACCOUNT_ID, R2_SQL_TOKEN, R2_SQL_BUCKET to browse the durable log archive here."),testId:"lg-archive-not-configured",title:t("Log archive not configured")}):(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lg-archive",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(D,{"aria-label":t("Function path prefix"),className:"h-8 w-48","data-testid":"lg-archive-path",onChange:R,placeholder:t("function path\u2026"),value:n}),(0,r.jsx)(D,{"aria-label":t("User id"),className:"h-8 w-40","data-testid":"lg-archive-user",onChange:k,placeholder:t("user id\u2026"),value:o}),(0,r.jsxs)("select",{"aria-label":t("Minimum level"),className:"h-8 rounded-md border border-border bg-background px-2 text-sm","data-testid":"lg-archive-min-level",onChange:L,value:f,children:[(0,r.jsx)("option",{value:"",children:t("min level")}),me.map(p=>(0,r.jsx)("option",{value:p,children:p},p))]})]}),a!==null&&(0,r.jsx)("p",{className:"text-sm text-destructive","data-testid":"lg-archive-error",role:"alert",children:a}),h&&u===null&&a===null&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"lg-archive-loading",children:t("Loading\u2026")}),u!==null&&u.length===0&&(0,r.jsx)(J,{description:t("No archived logs match these filters. The durable archive fills as pipelineLogSink flushes records to R2."),testId:"lg-archive-empty",title:t("No archived logs.")}),u!==null&&u.length>0&&(0,r.jsx)("div",{className:"overflow-hidden rounded-xl border border-border shadow-xs",children:(0,r.jsxs)(we,{"data-testid":"lg-archive-table",children:[(0,r.jsx)(Ne,{children:(0,r.jsxs)(se,{children:[(0,r.jsx)(B,{children:t("Time")}),(0,r.jsx)(B,{children:t("Level")}),(0,r.jsx)(B,{children:t("Function")}),(0,r.jsx)(B,{children:t("Message")}),(0,r.jsx)(B,{children:t("Trace")}),(0,r.jsx)(B,{children:t("Shard")}),(0,r.jsx)(B,{children:t("User")})]})}),(0,r.jsx)(Ce,{children:u.map((p,C)=>(0,r.jsx)(Be,{row:p},`${String(p.ts)}-${String(C)}`))})]})}),d!==void 0&&(0,r.jsx)("div",{children:(0,r.jsx)(pe,{"data-testid":"lg-archive-more",disabled:h,onClick:S,size:"sm",variant:"outline",children:t(h?"Loading\u2026":"Load more")})})]})},"ze"),je=v(i=>{let e=(0,K.c)(11),{level:t,onToggle:n,selected:s}=i,o;e[0]!==t||e[1]!==n?(o=v(()=>{n(t)},"o"),e[0]=t,e[1]=n,e[2]=o):o=e[2];let c=o,f=s?"border-border bg-muted font-medium":"border-input text-muted-foreground",m;e[3]!==f?(m=j("rounded-md border px-2 py-1 text-xs",f),e[3]=f,e[4]=m):m=e[4];let d=`logs-level-${t}`,a;return e[5]!==t||e[6]!==c||e[7]!==s||e[8]!==m||e[9]!==d?(a=(0,r.jsx)("button",{"aria-pressed":s,className:m,"data-testid":d,onClick:c,type:"button",children:t}),e[5]=t,e[6]=c,e[7]=s,e[8]=m,e[9]=d,e[10]=a):a=e[10],a},"Ge"),Ve=v(i=>{let e=(0,K.c)(68),{levelFilter:t,onLogPathChange:n,onSearchChange:s,onTimeRangeChange:o,onToggleLevel:c,onToggleSummary:f,pathFilter:m,search:d,showSummary:a,timeRange:h}=i,l=z(),u;e[0]!==l?(u=l("Search messages"),e[0]=l,e[1]=u):u=e[1];let g;e[2]!==l?(g=l("search message"),e[2]=l,e[3]=g):g=e[3];let b;e[4]!==s||e[5]!==d||e[6]!==u||e[7]!==g?(b=(0,r.jsx)(D,{"aria-label":u,className:"h-8 w-48","data-testid":"lg-search",onChange:s,placeholder:g,value:d}),e[4]=s,e[5]=d,e[6]=u,e[7]=g,e[8]=b):b=e[8];let x;e[9]!==l?(x=l("Function path"),e[9]=l,e[10]=x):x=e[10];let w;e[11]!==l?(w=l("filter path"),e[11]=l,e[12]=w):w=e[12];let N;e[13]!==n||e[14]!==m||e[15]!==x||e[16]!==w?(N=(0,r.jsx)(D,{"aria-label":x,className:"h-8 w-40","data-testid":"logs-path-filter",onChange:n,placeholder:w,value:m}),e[13]=n,e[14]=m,e[15]=x,e[16]=w,e[17]=N):N=e[17];let y;e[18]!==l?(y=l("Level filter"),e[18]=l,e[19]=y):y=e[19];let T;e[20]!==t||e[21]!==c?(T=me.map(Q=>(0,r.jsx)(je,{level:Q,onToggle:c,selected:t.has(Q)},Q)),e[20]=t,e[21]=c,e[22]=T):T=e[22];let R;e[23]!==y||e[24]!==T?(R=(0,r.jsx)("div",{"aria-label":y,className:"inline-flex items-center gap-1","data-testid":"logs-level-filter",role:"group",children:T}),e[23]=y,e[24]=T,e[25]=R):R=e[25];let k;e[26]!==l?(k=l("Time range"),e[26]=l,e[27]=k):k=e[27];let L;e[28]!==l?(L=l("All time"),e[28]=l,e[29]=L):L=e[29];let S;e[30]!==L?(S=(0,r.jsx)("option",{value:"all",children:L}),e[30]=L,e[31]=S):S=e[31];let p;e[32]!==l?(p=l("Last 5m"),e[32]=l,e[33]=p):p=e[33];let C;e[34]!==p?(C=(0,r.jsx)("option",{value:"5m",children:p}),e[34]=p,e[35]=C):C=e[35];let q;e[36]!==l?(q=l("Last 15m"),e[36]=l,e[37]=q):q=e[37];let F;e[38]!==q?(F=(0,r.jsx)("option",{value:"15m",children:q}),e[38]=q,e[39]=F):F=e[39];let O;e[40]!==l?(O=l("Last hour"),e[40]=l,e[41]=O):O=e[41];let E;e[42]!==O?(E=(0,r.jsx)("option",{value:"1h",children:O}),e[42]=O,e[43]=E):E=e[43];let M;e[44]!==o||e[45]!==k||e[46]!==S||e[47]!==C||e[48]!==F||e[49]!==E||e[50]!==h?(M=(0,r.jsxs)("select",{"aria-label":k,className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none","data-testid":"logs-time-range",onChange:o,value:h,children:[S,C,F,E]}),e[44]=o,e[45]=k,e[46]=S,e[47]=C,e[48]=F,e[49]=E,e[50]=h,e[51]=M):M=e[51];let V=a?"border-border bg-muted font-medium":"border-input text-muted-foreground",_;e[52]!==V?(_=j("h-8 rounded-md border px-3 text-sm",V),e[52]=V,e[53]=_):_=e[53];let U;e[54]!==a||e[55]!==l?(U=l(a?"List":"Summary"),e[54]=a,e[55]=l,e[56]=U):U=e[56];let A;e[57]!==f||e[58]!==a||e[59]!==_||e[60]!==U?(A=(0,r.jsx)("button",{"aria-pressed":a,className:_,"data-testid":"logs-summary-toggle",onClick:f,type:"button",children:U}),e[57]=f,e[58]=a,e[59]=_,e[60]=U,e[61]=A):A=e[61];let $;return e[62]!==M||e[63]!==A||e[64]!==b||e[65]!==N||e[66]!==R?($=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[b,N,R,M,A]}),e[62]=M,e[63]=A,e[64]=b,e[65]=N,e[66]=R,e[67]=$):$=e[67],$},"He"),Qe=v(i=>{let e=(0,K.c)(53),{onOutcomeChange:t,onPathChange:n,onTableChange:s,onUserChange:o,outcomeFilter:c,pathPrefix:f,tableFilter:m,userIdFilter:d}=i,a=z(),h;e[0]!==a?(h=a("Function path"),e[0]=a,e[1]=h):h=e[1];let l;e[2]!==a?(l=a("file:function"),e[2]=a,e[3]=l):l=e[3];let u;e[4]!==n||e[5]!==f||e[6]!==h||e[7]!==l?(u=(0,r.jsx)(D,{"aria-label":h,className:"h-8 w-44","data-testid":"lg-req-path",onChange:n,placeholder:l,value:f}),e[4]=n,e[5]=f,e[6]=h,e[7]=l,e[8]=u):u=e[8];let g;e[9]!==a?(g=a("User id"),e[9]=a,e[10]=g):g=e[10];let b;e[11]!==a?(b=a("userId"),e[11]=a,e[12]=b):b=e[12];let x;e[13]!==o||e[14]!==g||e[15]!==b||e[16]!==d?(x=(0,r.jsx)(D,{"aria-label":g,className:"h-8 w-32","data-testid":"lg-req-user",onChange:o,placeholder:b,value:d}),e[13]=o,e[14]=g,e[15]=b,e[16]=d,e[17]=x):x=e[17];let w;e[18]!==a?(w=a("Table touched"),e[18]=a,e[19]=w):w=e[19];let N;e[20]!==a?(N=a("table"),e[20]=a,e[21]=N):N=e[21];let y;e[22]!==s||e[23]!==w||e[24]!==N||e[25]!==m?(y=(0,r.jsx)(D,{"aria-label":w,className:"h-8 w-32","data-testid":"lg-req-table",onChange:s,placeholder:N,value:m}),e[22]=s,e[23]=w,e[24]=N,e[25]=m,e[26]=y):y=e[26];let T;e[27]!==a?(T=a("Outcome filter"),e[27]=a,e[28]=T):T=e[28];let R;e[29]!==a?(R=a("all"),e[29]=a,e[30]=R):R=e[30];let k;e[31]!==R?(k=(0,r.jsx)("option",{value:"all",children:R}),e[31]=R,e[32]=k):k=e[32];let L;e[33]!==a?(L=a("ok"),e[33]=a,e[34]=L):L=e[34];let S;e[35]!==L?(S=(0,r.jsx)("option",{value:"ok",children:L}),e[35]=L,e[36]=S):S=e[36];let p;e[37]!==a?(p=a("error"),e[37]=a,e[38]=p):p=e[38];let C;e[39]!==p?(C=(0,r.jsx)("option",{value:"error",children:p}),e[39]=p,e[40]=C):C=e[40];let q;e[41]!==t||e[42]!==c||e[43]!==T||e[44]!==k||e[45]!==S||e[46]!==C?(q=(0,r.jsxs)("select",{"aria-label":T,className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none","data-testid":"lg-req-outcome",onChange:t,value:c,children:[k,S,C]}),e[41]=t,e[42]=c,e[43]=T,e[44]=k,e[45]=S,e[46]=C,e[47]=q):q=e[47];let F;return e[48]!==q||e[49]!==u||e[50]!==x||e[51]!==y?(F=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,x,y,q]}),e[48]=q,e[49]=u,e[50]=x,e[51]=y,e[52]=F):F=e[52],F},"We"),Fe=v(i=>{let e=(0,K.c)(7),{bucket:t}=i,n;e[0]!==t.key?(n=(0,r.jsx)("span",{className:"truncate text-muted-foreground",role:"gridcell",children:t.key}),e[0]=t.key,e[1]=n):n=e[1];let s;e[2]!==t.count?(s=(0,r.jsx)("span",{className:"shrink-0 tabular-nums",role:"gridcell",children:t.count}),e[2]=t.count,e[3]=s):s=e[3];let o;return e[4]!==n||e[5]!==s?(o=(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 px-3 py-1 font-mono text-xs","data-testid":"logs-summary-row",role:"row",children:[n,s]}),e[4]=n,e[5]=s,e[6]=o):o=e[6],o},"ve"),Ye=v(i=>{let e=(0,K.c)(31),{summary:t}=i,n=z(),s;e[0]!==t.total||e[1]!==n?(s=n("{count} entries",{count:t.total}),e[0]=t.total,e[1]=n,e[2]=s):s=e[2];let o;e[3]!==s?(o=(0,r.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"logs-summary-total",children:s}),e[3]=s,e[4]=o):o=e[4];let c;e[5]!==n?(c=n("By level"),e[5]=n,e[6]=c):c=e[6];let f;e[7]!==c?(f=(0,r.jsx)("h4",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:c}),e[7]=c,e[8]=f):f=e[8];let m;e[9]!==t.byLevel?(m=t.byLevel.map(Ge),e[9]=t.byLevel,e[10]=m):m=e[10];let d;e[11]!==m?(d=(0,r.jsx)("div",{className:"overflow-hidden rounded-lg border border-border","data-testid":"logs-summary-levels",role:"grid",children:m}),e[11]=m,e[12]=d):d=e[12];let a;e[13]!==f||e[14]!==d?(a=(0,r.jsxs)("div",{children:[f,d]}),e[13]=f,e[14]=d,e[15]=a):a=e[15];let h;e[16]!==n?(h=n("By function"),e[16]=n,e[17]=h):h=e[17];let l;e[18]!==h?(l=(0,r.jsx)("h4",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h}),e[18]=h,e[19]=l):l=e[19];let u;e[20]!==t.byPath?(u=t.byPath.map(He),e[20]=t.byPath,e[21]=u):u=e[21];let g;e[22]!==u?(g=(0,r.jsx)("div",{className:"overflow-hidden rounded-lg border border-border","data-testid":"logs-summary-paths",role:"grid",children:u}),e[22]=u,e[23]=g):g=e[23];let b;e[24]!==g||e[25]!==l?(b=(0,r.jsxs)("div",{children:[l,g]}),e[24]=g,e[25]=l,e[26]=b):b=e[26];let x;return e[27]!==b||e[28]!==o||e[29]!==a?(x=(0,r.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"logs-summary",children:[o,a,b]}),e[27]=b,e[28]=o,e[29]=a,e[30]=x):x=e[30],x},"Ye");function Ge(i){return(0,r.jsx)(Fe,{bucket:i},i.key)}v(Ge,"je");function He(i){return(0,r.jsx)(Fe,{bucket:i},i.key)}v(He,"Je");var Je=v(i=>{let e=(0,K.c)(46),{liveError:t,onShardKeyChange:n,onShowArchive:s,onShowErrors:o,onShowRequests:c,shardKey:f,view:m}=i,d=z(),a=m==="requests",h=m==="requests"?"bg-muted font-medium":"text-muted-foreground",l;e[0]!==h?(l=j("px-3 py-1 text-sm",h),e[0]=h,e[1]=l):l=e[1];let u;e[2]!==d?(u=d("Requests"),e[2]=d,e[3]=u):u=e[3];let g;e[4]!==c||e[5]!==a||e[6]!==l||e[7]!==u?(g=(0,r.jsx)("button",{"aria-selected":a,className:l,"data-testid":"lg-view-requests",onClick:c,role:"tab",type:"button",children:u}),e[4]=c,e[5]=a,e[6]=l,e[7]=u,e[8]=g):g=e[8];let b=m==="errors",x=m==="errors"?"bg-muted font-medium":"text-muted-foreground",w;e[9]!==x?(w=j("px-3 py-1 text-sm",x),e[9]=x,e[10]=w):w=e[10];let N;e[11]!==d?(N=d("Errors"),e[11]=d,e[12]=N):N=e[12];let y;e[13]!==o||e[14]!==b||e[15]!==w||e[16]!==N?(y=(0,r.jsx)("button",{"aria-selected":b,className:w,"data-testid":"lg-view-errors",onClick:o,role:"tab",type:"button",children:N}),e[13]=o,e[14]=b,e[15]=w,e[16]=N,e[17]=y):y=e[17];let T=m==="archive",R=m==="archive"?"bg-muted font-medium":"text-muted-foreground",k;e[18]!==R?(k=j("px-3 py-1 text-sm",R),e[18]=R,e[19]=k):k=e[19];let L;e[20]!==d?(L=d("Archive"),e[20]=d,e[21]=L):L=e[21];let S;e[22]!==s||e[23]!==T||e[24]!==k||e[25]!==L?(S=(0,r.jsx)("button",{"aria-selected":T,className:k,"data-testid":"lg-view-archive",onClick:s,role:"tab",type:"button",children:L}),e[22]=s,e[23]=T,e[24]=k,e[25]=L,e[26]=S):S=e[26];let p;e[27]!==y||e[28]!==S||e[29]!==g?(p=(0,r.jsxs)("div",{className:"inline-flex overflow-hidden rounded-lg border border-border",role:"tablist",children:[g,y,S]}),e[27]=y,e[28]=S,e[29]=g,e[30]=p):p=e[30];let C;e[31]!==n||e[32]!==f?(C=(0,r.jsx)(be,{onChange:n,testId:"lg-shard-input",value:f}),e[31]=n,e[32]=f,e[33]=C):C=e[33];let q;e[34]!==t||e[35]!==m?(q=m!=="archive"&&(0,r.jsx)(Le,{message:t,prefix:"lg"}),e[34]=t,e[35]=m,e[36]=q):q=e[36];let F;e[37]!==d?(F=d("Open in Cloudflare"),e[37]=d,e[38]=F):F=e[38];let O;e[39]!==F?(O=(0,r.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"lg-cf-link",href:de,rel:"noreferrer",target:"_blank",children:F}),e[39]=F,e[40]=O):O=e[40];let E;return e[41]!==p||e[42]!==C||e[43]!==q||e[44]!==O?(E=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,C,q,O]}),e[41]=p,e[42]=C,e[43]=q,e[44]=O,e[45]=E):E=e[45],E},"Xe"),ue=400,Xe=36,Ze={height:ue,overflow:"auto"},Oe={left:0,position:"absolute",top:0,width:"100%"},et={error:"destructive",ok:"secondary"},Ee=v(i=>{let e=(0,K.c)(6),{onOpenTrace:t,traceId:n}=i,s=z(),o;e[0]!==t||e[1]!==s||e[2]!==n?(o=n===void 0?null:(0,r.jsx)("button",{className:"text-primary underline-offset-2 hover:underline","data-testid":"lg-trace-link",onClick:v(()=>{t(n)},"onClick"),type:"button",children:s("Trace")}),e[0]=t,e[1]=s,e[2]=n,e[3]=o):o=e[3];let c;return e[4]!==o?(c=(0,r.jsx)("span",{className:"w-16 shrink-0 text-right",role:"gridcell",children:o}),e[4]=o,e[5]=c):c=e[5],c},"xe"),tt=v(i=>{let e=(0,K.c)(13),{entry:t,index:n,measureRef:s,onOpenTrace:o,start:c}=i,f=`translateY(${String(c)}px)`,m;e[0]!==f?(m={...Oe,transform:f},e[0]=f,e[1]=m):m=e[1];let d=m,a;e[2]!==t?(a=(0,r.jsx)(Re,{entry:t}),e[2]=t,e[3]=a):a=e[3];let h;e[4]!==t.traceId||e[5]!==o?(h=(0,r.jsx)(Ee,{onOpenTrace:o,traceId:t.traceId}),e[4]=t.traceId,e[5]=o,e[6]=h):h=e[6];let l;return e[7]!==n||e[8]!==s||e[9]!==d||e[10]!==a||e[11]!==h?(l=(0,r.jsxs)("div",{className:"flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50","data-index":n,"data-testid":"lg-row",ref:s,role:"row",style:d,children:[a,h]}),e[7]=n,e[8]=s,e[9]=d,e[10]=a,e[11]=h,e[12]=l):l=e[12],l},"rt"),Ie=v(i=>i.length===0?"\u2014":i.join(", "),"ce"),rt=v(i=>{let e=(0,K.c)(41),{entry:t,index:n,measureRef:s,onOpenTrace:o,start:c}=i,f=`translateY(${String(c)}px)`,m;e[0]!==f?(m={...Oe,transform:f},e[0]=f,e[1]=m):m=e[1];let d=m,a;e[2]!==t.ts?(a=new Date(t.ts).toLocaleString(),e[2]=t.ts,e[3]=a):a=e[3];let h;e[4]!==a?(h=(0,r.jsx)("span",{className:"w-40 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:a}),e[4]=a,e[5]=h):h=e[5];let l=et[t.outcome],u;e[6]!==t.outcome||e[7]!==l?(u=(0,r.jsx)("span",{className:"w-16 shrink-0",role:"gridcell",children:(0,r.jsx)(re,{variant:l,children:t.outcome})}),e[6]=t.outcome,e[7]=l,e[8]=u):u=e[8];let g;e[9]!==t.functionPath?(g=(0,r.jsx)("span",{className:"w-44 shrink-0 truncate",role:"gridcell",title:t.functionPath,children:t.functionPath}),e[9]=t.functionPath,e[10]=g):g=e[10];let b=t.shardKey??"\u2014",x;e[11]!==b?(x=(0,r.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",role:"gridcell",children:b}),e[11]=b,e[12]=x):x=e[12];let w=t.userId??"\u2014",N;e[13]!==w?(N=(0,r.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",role:"gridcell",children:w}),e[13]=w,e[14]=N):N=e[14];let y;e[15]!==t.durationMs?(y=Math.round(t.durationMs),e[15]=t.durationMs,e[16]=y):y=e[16];let T=`${String(y)}ms`,R;e[17]!==T?(R=(0,r.jsx)("span",{className:"w-16 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:T}),e[17]=T,e[18]=R):R=e[18];let k;e[19]!==t.errorMessage||e[20]!==t.outcome||e[21]!==t.tablesRead||e[22]!==t.tablesWritten?(k=t.outcome==="error"&&t.errorMessage!==void 0?t.errorMessage:`r:${Ie(t.tablesRead)} \xB7 w:${Ie(t.tablesWritten)}`,e[19]=t.errorMessage,e[20]=t.outcome,e[21]=t.tablesRead,e[22]=t.tablesWritten,e[23]=k):k=e[23];let L;e[24]!==k?(L=(0,r.jsx)("span",{className:"flex-1 truncate text-muted-foreground",role:"gridcell",children:k}),e[24]=k,e[25]=L):L=e[25];let S;e[26]!==t.traceId||e[27]!==o?(S=(0,r.jsx)(Ee,{onOpenTrace:o,traceId:t.traceId}),e[26]=t.traceId,e[27]=o,e[28]=S):S=e[28];let p;return e[29]!==n||e[30]!==s||e[31]!==d||e[32]!==N||e[33]!==R||e[34]!==L||e[35]!==S||e[36]!==h||e[37]!==u||e[38]!==g||e[39]!==x?(p=(0,r.jsxs)("div",{className:"flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50","data-index":n,"data-testid":"lg-req-row",ref:s,role:"row",style:d,children:[h,u,g,x,N,R,L,S]}),e[29]=n,e[30]=s,e[31]=d,e[32]=N,e[33]=R,e[34]=L,e[35]=S,e[36]=h,e[37]=u,e[38]=g,e[39]=x,e[40]=p):p=e[40],p},"st"),qe=v(i=>{let{entries:e}=i??{};return Array.isArray(e)?e:[]},"de"),at=v(i=>{let e={};return i.functionPathPrefix.trim()!==""&&(e.functionPathPrefix=i.functionPathPrefix.trim()),i.userId.trim()!==""&&(e.userId=i.userId.trim()),i.tableTouched.trim()!==""&&(e.tableTouched=i.tableTouched.trim()),(i.outcome==="ok"||i.outcome==="error")&&(e.outcome=i.outcome),e},"lt"),lt={"5m":300*1e3,"15m":900*1e3,"1h":3600*1e3},ot=v((i,e)=>{let t=e.search.trim().toLowerCase(),n=e.path.trim().toLowerCase(),s=e.range==="all"?Number.NEGATIVE_INFINITY:e.now-lt[e.range];return i.filter(o=>e.levels.size>0&&!e.levels.has(o.level)||o.timestamp<s||n!==""&&!(o.functionPath??"").toLowerCase().includes(n)?!1:t===""||o.message.toLowerCase().includes(t)||ce(o.fields).toLowerCase().includes(t))},"at"),nt="\u2014",st=v(i=>{let e=new Map,t=new Map;for(let o of i){e.set(o.level,(e.get(o.level)??0)+1);let c=o.functionPath??nt;t.set(c,(t.get(c)??0)+1)}let n=me.filter(o=>e.has(o)).map(o=>({count:e.get(o)??0,key:o})),s=[...t.entries()].map(([o,c])=>({count:c,key:o})).toSorted((o,c)=>c.count===o.count?o.key.localeCompare(c.key):c.count-o.count);return{byLevel:n,byPath:s,total:i.length}},"it"),qt=v(({initialShardKey:i})=>{let e=z(),[t,n]=(0,I.useState)("requests"),{queryShardKey:s,setShardKey:o,shardKey:c}=xe(i),[f,m]=(0,I.useState)(""),[d,a]=(0,I.useState)(()=>new Set),[h,l]=(0,I.useState)(""),[u,g]=(0,I.useState)("all"),[b,x]=(0,I.useState)(!1),[w,N]=(0,I.useState)(""),[y,T]=(0,I.useState)(""),[R,k]=(0,I.useState)(""),[L,S]=(0,I.useState)("all"),p=at({functionPathPrefix:w,outcome:L,tableTouched:R,userId:y}),C=oe(ne.getRequestLog,p,{enabled:t==="requests",live:!0,shardKey:s}),q=oe(ne.getLogs,{},{enabled:t==="errors",live:!0,shardKey:s}),F=t==="requests"?C:q,{error:O,errorSource:E,isLoading:M,liveError:V}=F,_=Te(s),U=qe(q.data),A=qe(C.data);(0,I.useEffect)(()=>{F.data!==void 0&&ve(s)},[F.data,s]);let $=ot(U,{levels:d,now:Date.now(),path:h,range:u,search:f}),Q=st($),X=t==="requests"?A.length:$.length,Z=t==="errors"&&b,Y=(0,I.useMemo)(()=>O!==null?"error":X===0?M?Z?"summary":"list":"empty":Z?"summary":"list",[X,M,O,Z]),he=(0,I.useRef)(null),G=ke({count:X,estimateSize:v(()=>Xe,"estimateSize"),getScrollElement:v(()=>he.current,"getScrollElement"),initialRect:{height:ue,width:800},observeElementRect:v((P,ee)=>Se(P,ee,ue),"observeElementRect"),overscan:8}),Ke=G.getVirtualItems(),Me={height:G.getTotalSize(),position:"relative",width:"100%"};return(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-logs",children:[(0,r.jsx)(Je,{liveError:V,onShardKeyChange:o,onShowArchive:v(()=>{n("archive"),x(!1)},"onShowArchive"),onShowErrors:v(()=>{n("errors"),x(!1)},"onShowErrors"),onShowRequests:v(()=>{n("requests"),x(!1)},"onShowRequests"),shardKey:c,view:t}),t==="errors"&&(0,r.jsx)(Ve,{levelFilter:d,onLogPathChange:v(P=>{l(P.target.value)},"onLogPathChange"),onSearchChange:v(P=>{m(P.target.value)},"onSearchChange"),onTimeRangeChange:v(P=>{g(P.target.value)},"onTimeRangeChange"),onToggleLevel:v(P=>{a(ee=>{let H=new Set(ee);return H.has(P)?H.delete(P):H.add(P),H})},"onToggleLevel"),onToggleSummary:v(()=>{x(P=>!P)},"onToggleSummary"),pathFilter:h,search:f,showSummary:b,timeRange:u}),t==="requests"&&(0,r.jsx)(Qe,{onOutcomeChange:v(P=>{S(P.target.value)},"onOutcomeChange"),onPathChange:v(P=>{N(P.target.value)},"onPathChange"),onTableChange:v(P=>{k(P.target.value)},"onTableChange"),onUserChange:v(P=>{T(P.target.value)},"onUserChange"),outcomeFilter:L,pathPrefix:w,tableFilter:R,userIdFilter:y}),t==="archive"?(0,r.jsx)(We,{shardKey:s}):(0,r.jsxs)(r.Fragment,{children:[Y==="error"&&(0,r.jsx)(ye,{error:E,testId:"lg-error"}),Y==="empty"&&(0,r.jsx)(J,{description:e("Function and request logs for this shard show up here as your app handles traffic."),icon:(0,r.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M4 5h16M4 12h16M4 19h10"})}),testId:"lg-empty",title:e("No logs.")}),Y==="summary"&&(0,r.jsx)(Ye,{summary:Q}),Y==="list"&&(0,r.jsx)("div",{className:"rounded-xl border border-border shadow-xs","data-testid":"lg-scroll",ref:he,style:Ze,children:(0,r.jsx)("div",{"aria-label":e("Recent logs"),"data-testid":"lg-table",role:"grid",style:Me,children:Ke.map(P=>t==="requests"?(0,r.jsx)(rt,{entry:A[P.index],index:P.index,measureRef:G.measureElement,onOpenTrace:_,start:P.start},P.key):(0,r.jsx)(tt,{entry:$[P.index],index:P.index,measureRef:G.measureElement,onOpenTrace:_,start:P.start},P.key))})})]})]})},"Wt");export{qt as LogsPanel,ot as filterLogs,st as summarizeLogs};
@@ -0,0 +1 @@
1
+ import{d as E}from"./chunk-225VJ77I.js";import{a as n,d as b,e as h}from"./chunk-YKXDMIHQ.js";var y=b(h(),1);var T=n(()=>{},"noop"),K=typeof document<"u"?y.useLayoutEffect:T;var W=b(h(),1),l={...W};var a=l.useInsertionEffect,_=a&&a!==l.useLayoutEffect?a:t=>t();function q(t){let e=E(B).current;return e.next=t,_(e.effect),e.trampoline}n(q,"useStableCallback");function B(){let t={next:void 0,callback:O,trampoline:n((...e)=>t.callback?.(...e),"trampoline"),effect:n(()=>{t.callback=t.next},"effect")};return t}n(B,"createStableCallback");function O(){}n(O,"assertNotCalled");function s(){return typeof window<"u"}n(s,"hasWindow");function m(t){return N(t)?(t.nodeName||"").toLowerCase():"#document"}n(m,"getNodeName");function c(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}n(c,"getWindow");function V(t){var e;return(e=(N(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}n(V,"getDocumentElement");function N(t){return s()?t instanceof Node||t instanceof c(t).Node:!1}n(N,"isNode");function C(t){return s()?t instanceof Element||t instanceof c(t).Element:!1}n(C,"isElement");function L(t){return s()?t instanceof HTMLElement||t instanceof c(t).HTMLElement:!1}n(L,"isHTMLElement");function g(t){return!s()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof c(t).ShadowRoot}n(g,"isShadowRoot");function R(t){let{overflow:e,overflowX:i,overflowY:u,display:o}=v(t);return/auto|scroll|overlay|hidden|clip/.test(e+u+i)&&o!=="inline"&&o!=="contents"}n(R,"isOverflowElement");function J(t){return/^(table|td|th)$/.test(m(t))}n(J,"isTableElement");function $(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}n($,"isTopLayer");var A=/transform|translate|scale|rotate|perspective|filter/,H=/paint|layout|strict|content/,r=n(t=>!!t&&t!=="none","isNotNone"),d;function I(t){let e=C(t)?v(t):t;return r(e.transform)||r(e.translate)||r(e.scale)||r(e.rotate)||r(e.perspective)||!M()&&(r(e.backdropFilter)||r(e.filter))||A.test(e.willChange||"")||H.test(e.contain||"")}n(I,"isContainingBlock");function Q(t){let e=p(t);for(;L(e)&&!k(e);){if(I(e))return e;if($(e))return null;e=p(e)}return null}n(Q,"getContainingBlock");function M(){return d==null&&(d=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),d}n(M,"isWebKit");function k(t){return/^(html|body|#document)$/.test(m(t))}n(k,"isLastTraversableNode");function v(t){return c(t).getComputedStyle(t)}n(v,"getComputedStyle");function Z(t){return C(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}n(Z,"getNodeScroll");function p(t){if(m(t)==="html")return t;let e=t.assignedSlot||t.parentNode||g(t)&&t.host||V(t);return g(e)?e.host:e}n(p,"getParentNode");function D(t){let e=p(t);return k(e)?(t.ownerDocument||t).body:L(e)&&R(e)?e:D(e)}n(D,"getNearestOverflowAncestor");function S(t,e,i){var u;e===void 0&&(e=[]),i===void 0&&(i=!0);let o=D(t),x=o===((u=t.ownerDocument)==null?void 0:u.body),f=c(o);if(x){let w=F(f);return e.concat(f,f.visualViewport||[],R(o)?o:[],w&&i?S(w):[])}else return e.concat(o,S(o,[],i))}n(S,"getOverflowAncestors");function F(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}n(F,"getFrameElement");function nt(t){return t?.ownerDocument||document}n(nt,"ownerDocument");export{K as a,l as b,q as c,m as d,c as e,V as f,N as g,C as h,L as i,g as j,R as k,J as l,$ as m,I as n,Q as o,M as p,k as q,v as r,Z as s,p as t,S as u,F as v,nt as w};
@@ -0,0 +1 @@
1
+ import{a as q}from"./chunk-66UGPQVC.js";import{a as F}from"./chunk-S3CRZLGS.js";import{a as D}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import"./chunk-AAVLPU5Q.js";import{b as S}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as L}from"./chunk-4POCWNXY.js";import"./chunk-ULIQFBZU.js";import"./chunk-GUPNWYY4.js";import"./chunk-35DM4JJG.js";import{a as B}from"./chunk-4ZEL6BYL.js";import{c as _}from"./chunk-AZVN24IA.js";import"./chunk-KNCZAQG6.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as $}from"./chunk-FKVZRPV5.js";import{a as O,b as P,c as W,d as C,e as h,f as p}from"./chunk-HEAQVSNS.js";import{a as M,e as T}from"./chunk-WUWBZPUK.js";import{d as A,m as E}from"./chunk-FODLDLE2.js";import{a as N,d as j,f as H,g as U}from"./chunk-YKXDMIHQ.js";var R=j(H(),1);var t=j(U(),1);var J=80,Z=N(a=>{if(a===void 0)return"";let e=JSON.stringify(a,E);return e.length>J?`${e.slice(0,J)}\u2026`:e},"G"),z=N(a=>{let e=[];for(let r of a){let n=r.id.toString();if(r.subscriptions.length===0){e.push({admin:r.admin,connectionId:r.id,key:`c${n}`,subscription:null});continue}r.subscriptions.forEach((l,i)=>{e.push({admin:r.admin,connectionId:r.id,key:`c${n}-s${i.toString()}`,subscription:l})})}return e},"J"),w=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),ce=N(a=>{let e=(0,R.c)(22),{initialShardKey:r}=a,n=A(),{queryShardKey:l,setShardKey:i,shardKey:m}=F(r),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];let b;e[1]!==l?(b={keepPreviousData:!0,shardKey:l},e[1]=l,e[2]=b):b=e[2];let{data:s,error:o,errorSource:u,refetch:G}=_(B.listSubscriptions,f,b);q(G,!0);let x;if(e[3]!==o||e[4]!==u||e[5]!==s||e[6]!==i||e[7]!==m||e[8]!==n){let k=s===void 0?[]:z(s.connections),c;e[10]!==i||e[11]!==m?(c=(0,t.jsx)(D,{onChange:i,testId:"subs-shard-input",value:m}),e[10]=i,e[11]=m,e[12]=c):c=e[12];let d;e[13]!==s||e[14]!==n?(d=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,t.jsx)(S,{variant:"secondary",children:n("{count} connections",{count:s.totalConnections})}),(0,t.jsx)(S,{variant:"secondary",children:n("{count} subscriptions",{count:s.totalSubscriptions})})]}),e[13]=s,e[14]=n,e[15]=d):d=e[15];let g;e[16]!==c||e[17]!==d?(g=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,d]}),e[16]=c,e[17]=d,e[18]=g):g=e[18];let v;e[19]!==o||e[20]!==u?(v=o!==null&&(0,t.jsx)(L,{error:u,testId:"subs-error"}),e[19]=o,e[20]=u,e[21]=v):v=e[21],x=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[g,v,o===null&&s!==void 0&&k.length===0&&(0,t.jsx)($,{description:n("Active WebSocket subscriptions on this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),testId:"subs-empty",title:n("No active subscriptions.")}),o===null&&k.length>0&&(0,t.jsx)(M,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(O,{"data-testid":"subs-table",children:[(0,t.jsx)(P,{children:(0,t.jsxs)(C,{children:[(0,t.jsx)(h,{children:n("Connection")}),(0,t.jsx)(h,{children:n("Function path")}),(0,t.jsx)(h,{children:n("Table")}),(0,t.jsx)(h,{children:n("Arguments")})]})}),(0,t.jsx)(W,{children:k.map(y=>{let{subscription:I}=y,K=Z(I?.args);return(0,t.jsxs)(C,{"data-testid":"subs-row",children:[(0,t.jsx)(p,{className:"font-medium tabular-nums",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["#",y.connectionId,y.admin&&(0,t.jsx)(S,{variant:"outline",children:n("admin")})]})}),(0,t.jsx)(p,{className:"font-mono text-xs",children:I?.functionPath??w}),(0,t.jsx)(p,{children:I?.table??w}),(0,t.jsx)(p,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:K||void 0,children:K||w})]},y.key)})})]})})})]}),e[3]=o,e[4]=u,e[5]=s,e[6]=i,e[7]=m,e[8]=n,e[9]=x}else x=e[9];return x},"ae");export{ce as default};
@@ -0,0 +1 @@
1
+ var i={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},e={...i,position:"fixed",top:0,left:0},t={...i,position:"absolute"};export{e as a,t as b};
@@ -0,0 +1 @@
1
+ import{a as F,b as O}from"./chunk-CMA4PTV7.js";import{a as B}from"./chunk-BOTGXX4H.js";import{a as V}from"./chunk-S3CRZLGS.js";import{a as T}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as L}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import"./chunk-AAVLPU5Q.js";import{b as C}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as j}from"./chunk-4POCWNXY.js";import"./chunk-ULIQFBZU.js";import"./chunk-GUPNWYY4.js";import"./chunk-35DM4JJG.js";import{a as R}from"./chunk-4ZEL6BYL.js";import{c as M}from"./chunk-AZVN24IA.js";import"./chunk-KNCZAQG6.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as K}from"./chunk-FKVZRPV5.js";import{a as z,b as A,c as q,d as p,e as n,f as d}from"./chunk-HEAQVSNS.js";import{a as I,e as E}from"./chunk-WUWBZPUK.js";import{d as b,r as k}from"./chunk-FODLDLE2.js";import{a as i,d as y,e as ee,g as te}from"./chunk-YKXDMIHQ.js";var o=y(ee(),1);var e=y(te(),1);var D=80,re=i(s=>{if(s===void 0)return"";let t=JSON.stringify(s);return t.length>D?`${t.slice(0,D)}\u2026`:t},"te"),ae=41,J=480,H=5,ie=i((s,t)=>F(s,l=>{t(l.height>0?l:{height:J,width:l.width})}),"ae"),Ne=i(({initialShardKey:s})=>{let t=b(),{queryShardKey:l,setShardKey:P,shardKey:U}=V(s),[h,W]=(0,o.useState)(""),{data:f,error:g,errorSource:Z,isLoading:_,liveError:$}=M(R.getAuditLog,{},{live:!0,shardKey:l}),m=(0,o.useMemo)(()=>f?.entries??[],[f]),c=(0,o.useMemo)(()=>{let a=h.trim().toLowerCase();return a===""?m:m.filter(r=>r.op.toLowerCase().includes(a)||(r.table??"").toLowerCase().includes(a)||(r.id??"").toLowerCase().includes(a))},[m,h]),x=(0,o.useRef)(null),v=O({count:c.length,estimateSize:i(()=>ae,"estimateSize"),getScrollElement:i(()=>x.current,"getScrollElement"),initialRect:{height:J,width:800},observeElementRect:ie,overscan:8}),u=v.getVirtualItems(),G=v.getTotalSize(),N=u[0]?.start??0,w=G-(u.at(-1)?.end??0),Q={height:N},X={height:w},Y=i(a=>{W(a.target.value)},"_");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-audit",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(T,{onChange:P,testId:"au-shard-input",value:U}),(0,e.jsx)(B,{message:$,prefix:"au"}),(0,e.jsx)(L,{"aria-label":t("Filter audit log"),className:"h-8 w-48","data-testid":"au-search",onChange:Y,placeholder:t("filter op, table, id"),value:h})]}),g!==null&&(0,e.jsx)(j,{error:Z,testId:"au-error"}),g===null&&!_&&c.length===0&&(0,e.jsx)(K,{description:t("State-changing admin operations are recorded here."),icon:(0,e.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M8 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M9 3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V3Zm-1 9h8m-8 4h5"})}),testId:"au-empty",title:t("No audit entries.")}),c.length>0&&(0,e.jsx)(I,{className:"overflow-hidden py-0",children:(0,e.jsx)(E,{className:"max-h-[30rem] overflow-auto px-0",ref:x,children:(0,e.jsxs)(z,{"data-testid":"au-table",children:[(0,e.jsx)(A,{children:(0,e.jsxs)(p,{children:[(0,e.jsx)(n,{children:t("time")}),(0,e.jsx)(n,{children:t("op")}),(0,e.jsx)(n,{children:t("table")}),(0,e.jsx)(n,{children:t("id")}),(0,e.jsx)(n,{children:t("detail")})]})}),(0,e.jsxs)(q,{children:[N>0&&(0,e.jsx)("tr",{"aria-hidden":"true",children:(0,e.jsx)("td",{colSpan:H,style:Q})}),u.map(a=>{let r=c[a.index],S=re(r.detail);return(0,e.jsxs)(p,{"data-testid":"au-row",children:[(0,e.jsx)(d,{className:"text-muted-foreground tabular-nums",children:k(r.ts,"\u2014")}),(0,e.jsx)(d,{children:(0,e.jsx)(C,{variant:"secondary",children:r.op})}),(0,e.jsx)(d,{className:"font-medium",children:r.table??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,e.jsx)(d,{className:"max-w-[20ch] truncate font-mono text-xs",children:r.id??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,e.jsx)(d,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:S||void 0,children:S||(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},r.seq)}),w>0&&(0,e.jsx)("tr",{"aria-hidden":"true",children:(0,e.jsx)("td",{colSpan:H,style:X})})]})]})})})]})},"Ne");export{Ne as AuditPanel};
@@ -0,0 +1 @@
1
+ import{b as j,c as v,d as D,f as g}from"./chunk-KNCZAQG6.js";import{f as S,g as w,h as P,o as q}from"./chunk-FODLDLE2.js";import{a as i,d as A,e as x,f as M}from"./chunk-YKXDMIHQ.js";var E=A(M(),1);var p=A(x(),1);var I=300,l=i(t=>typeof t=="string"?t===""?void 0:t:typeof t=="number"||typeof t=="boolean"?String(t):void 0,"a"),u=i(t=>t.filter(r=>r!==void 0).join(" "),"c"),T=i(t=>{let r=Array.isArray(t.filters)?t.filters.length:0,e=typeof t.search=="string"&&t.search!=="";return r===0&&!e?"no predicate":u([r===0?void 0:`${String(r)} filters`,e?"search":void 0])},"q"),N={clearTable:i(t=>u([l(t.table),"whole table"]),"clearTable"),deleteRows:i(t=>u([l(t.table),T(t)]),"deleteRows"),facetColumn:i(t=>u([l(t.table),l(t.column)]),"facetColumn"),importShard:i(t=>{if(!Array.isArray(t.rows))return"";let r=[...new Set(t.rows.filter(e=>typeof e=="object"&&e!==null).map(e=>e.table).filter(e=>typeof e=="string"))].toSorted((e,s)=>e.localeCompare(s));return u([`${String(t.rows.length)} rows`,r.length===0?void 0:`into ${r.join(", ")}`])},"importShard"),lintSql:i(()=>"sql","lintSql"),patchRows:i(t=>u([l(t.table),typeof t.doc=="object"&&t.doc!==null?`set ${Object.keys(t.doc).join(", ")}`:void 0,T(t)]),"patchRows"),pitrRestore:i(t=>u([l(t.time)===void 0?void 0:`to ${String(t.time)}`,typeof t.bookmark=="string"&&t.bookmark!==""?"from bookmark":void 0,t.restart===!0?"restart now":void 0]),"pitrRestore"),readTablePage:i(t=>u([l(t.table),Array.isArray(t.filters)&&t.filters.length>0?`${String(t.filters.length)} filters`:void 0,typeof t.search=="string"&&t.search!==""?"search":void 0,typeof t.limit=="number"?`limit ${String(t.limit)}`:void 0]),"readTablePage"),runMigration:i(t=>u([l(t.id),l(t.direction),t.dryRun===!0?"dry-run":void 0]),"runMigration"),runSql:i(t=>typeof t.sql=="string"?`${String(t.sql.length)} chars`:"","runSql"),schemaVersion:i(t=>typeof t.hash=="string"?t.hash.slice(0,8):"","schemaVersion"),writeRow:i(t=>u([l(t.table),"1 row"]),"writeRow")},$="__lunora_admin__:",F=i((t,r)=>{let e=t.startsWith($)?t.slice($.length):t,s=N[e];if(s!==void 0)return s(r);let n=Object.keys(r);return n.length===0?"":n.join(", ")},"M"),V=i(t=>{if(Array.isArray(t))return t.length;if(!(typeof t!="object"||t===null)){for(let r of Object.values(t))if(Array.isArray(r))return r.length}},"K"),k=class{static{i(this,"x")}entries=[];listeners=new Set;nextSeq=1;getSnapshot=i(()=>this.entries,"getSnapshot");subscribe=i(r=>(this.listeners.add(r),()=>{this.listeners.delete(r)}),"subscribe");start(r,e,s){return this.append(r,e,s,"call","pending")}startSubscription(r,e,s){return this.append(r,e,s,"subscription","live")}recordPush(r){if(this.listeners.size===0){let e=this.entries.find(s=>s.seq===r);e!==void 0&&(e.pushes=(e.pushes??0)+1);return}this.patch(r,e=>({...e,pushes:(e.pushes??0)+1}))}failSubscription(r,e){this.patch(r,s=>({...s,error:e,status:"error"}))}endSubscription(r){this.patch(r,e=>e.status==="error"?e:{...e,durationMs:Date.now()-e.startedAt,status:"closed"})}lastErrorSeq(){return this.entries.findLast(r=>r.status==="error")?.seq}settle(r,e){this.patch(r,s=>({...s,durationMs:Date.now()-s.startedAt,...e.error===void 0?{resultCount:V(e.result),status:"ok"}:{error:e.error,status:"error"}}))}clear(){this.entries=[],this.emit()}append(r,e,s,n,a){let d=this.nextSeq;this.nextSeq+=1;let c={functionPath:r,kind:n,seq:d,shardKey:s,startedAt:Date.now(),status:a,summary:F(r,e),...n==="subscription"?{pushes:0}:{}},o=[...this.entries,c];return this.entries=o.length>I?o.slice(o.length-I):o,this.emit(),d}patch(r,e){let s=this.entries.findIndex(n=>n.seq===r);s!==-1&&(this.entries=this.entries.with(s,e(this.entries[s])),this.emit())}emit(){for(let r of this.listeners)r()}},f=new k,_=i((t,r,e)=>["lunora-admin",t,r,e.trim()],"j"),O=i((t,r)=>[...t,r],"E");function W(t,r,e={}){let s=g(),{enabled:n=!0,keepPreviousData:a=!1,staleTime:d=0}=e,c=O(t,s.clientIdentifier()),o=D({enabled:n,queryFn:r,placeholderData:a?j:void 0,queryKey:c,staleTime:d});return{data:o.data,error:o.error?P(o.error):o.error,errorSource:o.error??void 0,isLoading:o.isLoading,liveError:void 0,refetch:i(()=>{q(o.refetch())},"refetch")}}i(W,"F");function Y(t,r,e={}){let s=g(),n=v(),{enabled:a=!0,keepPreviousData:d=!1,live:c=!1,shardKey:o="",staleTime:R}=e,m=_(t,r,o),C=W(m,()=>s.query(S(t),r,w(o)),{enabled:a,keepPreviousData:d,staleTime:R??(c?Number.POSITIVE_INFINITY:0)}),[K,b]=(0,p.useState)(void 0),L=JSON.stringify(m);return(0,p.useEffect)(()=>{if(!a||!c)return;b(void 0);let y=f.startSubscription(t,r,o),Q=s.subscribe(S(t),r,h=>{f.recordPush(y),b(void 0),n.setQueryData(O(m,s.clientIdentifier()),h)},{...w(o),onError:i(h=>{f.failSubscription(y,h.message),b(h.message)},"onError")});return()=>{f.endSubscription(y),Q()}},[s,L,a,c]),{...C,liveError:a&&c?K:void 0}}i(Y,"U");var B=i(()=>{let t=(0,E.c)(2),r=v(),e;return t[0]!==r?(e=i((s,n,a)=>{let d=n===void 0?["lunora-admin",s]:_(s,n,a??"");q(r.invalidateQueries({queryKey:d}))},"r"),t[0]=r,t[1]=e):e=t[1],e},"W");export{f as a,W as b,Y as c,B as d};
@@ -0,0 +1,6 @@
1
+ import{a as V,b as J,c as K,d as M,e as B,f as A,g as I,h as F}from"./chunk-RFNGDE33.js";import{a as P}from"./chunk-XZMOZFE6.js";import{a as z}from"./chunk-PD6WIDY6.js";import{d as L,m as D,n as U,o as Q,q as W}from"./chunk-FODLDLE2.js";import{a as p,d as q,e as ee,f as te,g as le}from"./chunk-YKXDMIHQ.js";var R=q(te(),1),E=q(ee(),1);var $="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",fe=`${$} aria-pressed:bg-accent aria-pressed:text-accent-foreground`;var r=q(le(),1);var X=p(l=>`"${l.replaceAll('"','""')}"`,"F"),ne=/["\n,]/u,oe=/^[=+\-@\t\r]/u,Y=p(l=>{if(l==null)return"";let e;return typeof l=="string"?e=oe.test(l)?` ${l}`:l:typeof l=="number"||typeof l=="boolean"||typeof l=="bigint"?e=String(l):e=U(l),ne.test(e)?`"${e.replaceAll('"','""')}"`:e},"J"),ae=p((l,e)=>{let n=l.map(t=>Y(t)).join(","),o=e.map(t=>l.map(i=>Y(t[i])).join(","));return[n,...o].join(`
2
+ `)},"ne"),se=p(l=>JSON.stringify(l,D,2),"oe"),Z=500,re=p(l=>l==null?"NULL":typeof l=="number"?Number.isFinite(l)?String(l):"NULL":typeof l=="bigint"?String(l):typeof l=="boolean"?l?"1":"0":`'${(typeof l=="string"?l:U(l)).replaceAll("'","''")}'`,"K"),G="__doc__",ie=p((l,e,n,o)=>{if(e.length===0||n.length===0)return"";let t=o?.includes(G)===!0&&!e.includes(G)?e.filter(c=>!o.includes(c)):void 0,i=t===void 0?e:o,s=p((c,g)=>re(t===void 0||g!==G?c[g]:JSON.stringify(Object.fromEntries(t.map(d=>[d,c[d]])),D)),"i"),a=i.map(c=>X(c)).join(", "),u=[];for(let c=0;c<n.length;c+=Z){let g=n.slice(c,c+Z).map(d=>` (${i.map(m=>s(d,m)).join(", ")})`).join(`,
3
+ `);u.push(`INSERT INTO ${X(l)} (${a}) VALUES
4
+ ${g};`)}return u.join(`
5
+
6
+ `)},"se"),H=p((l,e,n)=>{if(!("document"in globalThis))return;let o=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:n})),t=globalThis.document.createElement("a");t.href=o,t.download=l,globalThis.document.body.append(t),t.click(),t.remove(),globalThis.URL.revokeObjectURL(o)},"M"),ce=p(l=>{let e=(0,R.c)(37),{columns:n,name:o,rows:t,sqlColumns:i}=l,s=L(),a;e[0]!==n||e[1]!==o||e[2]!==t?(a=p(()=>{H(`${o}.csv`,ae(n,t),"text/csv;charset=utf-8")},"s"),e[0]=n,e[1]=o,e[2]=t,e[3]=a):a=e[3];let u=a,c;e[4]!==o||e[5]!==t?(c=p(()=>{H(`${o}.json`,se(t),"application/json")},"c"),e[4]=o,e[5]=t,e[6]=c):c=e[6];let g=c,d;e[7]!==n||e[8]!==o||e[9]!==t||e[10]!==i?(d=p(()=>{H(`${o}.sql`,ie(o,n,t,i),"application/sql;charset=utf-8")},"a"),e[7]=n,e[8]=o,e[9]=t,e[10]=i,e[11]=d):d=e[11];let m=d,j=t.length===0,b;e[12]!==j?(b=(0,r.jsx)(J,{className:$,"data-testid":"grid-export",disabled:j,title:"Exports only the rows loaded on the current page, not the whole table",children:"Export page"}),e[12]=j,e[13]=b):b=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=(0,r.jsx)(B,{children:"Export loaded rows"}),e[14]=k):k=e[14];let h;e[15]!==s?(h=s("CSV"),e[15]=s,e[16]=h):h=e[16];let x;e[17]!==u||e[18]!==h?(x=(0,r.jsx)(A,{"data-testid":"grid-export-csv",onClick:u,children:h}),e[17]=u,e[18]=h,e[19]=x):x=e[19];let w;e[20]!==s?(w=s("JSON"),e[20]=s,e[21]=w):w=e[21];let y;e[22]!==g||e[23]!==w?(y=(0,r.jsx)(A,{"data-testid":"grid-export-json",onClick:g,children:w}),e[22]=g,e[23]=w,e[24]=y):y=e[24];let N;e[25]!==s?(N=s("SQL"),e[25]=s,e[26]=N):N=e[26];let f;e[27]!==m||e[28]!==N?(f=(0,r.jsx)(A,{"data-testid":"grid-export-sql",onClick:m,children:N}),e[27]=m,e[28]=N,e[29]=f):f=e[29];let C;e[30]!==y||e[31]!==f||e[32]!==x?(C=(0,r.jsxs)(K,{align:"end",children:[k,x,y,f]}),e[30]=y,e[31]=f,e[32]=x,e[33]=C):C=e[33];let v;return e[34]!==C||e[35]!==b?(v=(0,r.jsxs)(V,{children:[b,C]}),e[34]=C,e[35]=b,e[36]=v):v=e[36],v},"ie"),de=p(l=>{let e=(0,R.c)(9),{column:n}=l,o;e[0]!==n?(o=p(()=>{n.toggleVisibility()},"o"),e[0]=n,e[1]=o):o=e[1];let t=o,i;e[2]!==n?(i=n.getIsVisible(),e[2]=n,e[3]=i):i=e[3];let s=`grid-column-${n.id}`,a;return e[4]!==n.id||e[5]!==t||e[6]!==i||e[7]!==s?(a=(0,r.jsx)(I,{checked:i,closeOnClick:!1,"data-testid":s,onCheckedChange:t,children:n.id}),e[4]=n.id,e[5]=t,e[6]=i,e[7]=s,e[8]=a):a=e[8],a},"re"),me=[],ue=p(({backRelations:l=me,enabledBackRelations:e,onToggleBackRelation:n,table:o})=>{let t=L(),i=o.getIsAllColumnsVisible(),s=p(()=>{o.toggleAllColumnsVisible(!i)},"i");return(0,r.jsxs)(V,{children:[(0,r.jsx)(J,{className:$,"data-testid":"grid-columns",children:t("Columns")}),(0,r.jsxs)(K,{align:"end",className:"max-h-80 overflow-y-auto",children:[(0,r.jsxs)(M,{children:[(0,r.jsx)(B,{children:t("Columns")}),(0,r.jsx)(I,{checked:i,closeOnClick:!1,"data-testid":"grid-columns-all",onCheckedChange:s,children:t(i?"Hide all":"Show all")}),(0,r.jsx)(F,{}),o.getAllLeafColumns().filter(a=>!a.id.startsWith("__back__:")).map(a=>(0,r.jsx)(de,{column:a},a.id))]}),l.length>0&&n!==void 0&&(0,r.jsxs)(M,{children:[(0,r.jsx)(F,{}),(0,r.jsx)(B,{children:t("Related")}),l.map(a=>{let u=`${a.table}.${a.column}`;return(0,r.jsx)(I,{checked:e?.has(u)===!0,closeOnClick:!1,"data-testid":`grid-back-relation-${u}`,onCheckedChange:p(()=>{n(u)},"onCheckedChange"),children:`\u2190 ${a.table}.${a.column}`},u)})]})]})]})},"ae"),ge=p(l=>{let e=(0,R.c)(19),{count:n,editable:o,onClear:t,onDelete:i}=l,s=L(),a;e[0]!==n||e[1]!==s?(a=s("{count} selected",{count:n}),e[0]=n,e[1]=s,e[2]=a):a=e[2];let u;e[3]!==a?(u=(0,r.jsx)("span",{className:"font-medium tabular-nums","data-testid":"grid-selection-count",children:a}),e[3]=a,e[4]=u):u=e[4];let c;e[5]!==s?(c=s("Clear"),e[5]=s,e[6]=c):c=e[6];let g;e[7]!==t||e[8]!==c?(g=(0,r.jsx)("button",{className:$,"data-testid":"grid-selection-clear",onClick:t,type:"button",children:c}),e[7]=t,e[8]=c,e[9]=g):g=e[9];let d;e[10]!==n||e[11]!==o||e[12]!==i||e[13]!==s?(d=o&&(0,r.jsx)(z,{confirmLabel:s("Delete {count} rows and everything that cascades?",{count:n}),onConfirm:i,testId:"grid-selection-delete",children:s("Delete {count}",{count:n})}),e[10]=n,e[11]=o,e[12]=i,e[13]=s,e[14]=d):d=e[14];let m;return e[15]!==u||e[16]!==g||e[17]!==d?(m=(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-accent/40 px-3 py-1.5 text-xs","data-testid":"grid-selection-bar",children:[u,g,d]}),e[15]=u,e[16]=g,e[17]=d,e[18]=m):m=e[18],m},"de"),pe=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,be=p(l=>{let e=(0,R.c)(9),{bucket:n,objectKey:o,resolveUrl:t}=l,[i,s]=(0,E.useState)(null),[a,u]=(0,E.useState)(!1),c,g;e[0]!==n||e[1]!==o||e[2]!==t?(c=p(()=>{let b={cancelled:!1};return Q((async()=>{try{let k=await t(o,n);b.cancelled||s(k)}catch{b.cancelled||u(!0)}})()),()=>{b.cancelled=!0}},"c"),g=[n,o,t],e[0]=n,e[1]=o,e[2]=t,e[3]=c,e[4]=g):(c=e[3],g=e[4]),(0,E.useEffect)(c,g);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=p(()=>{u(!0)},"a"),e[5]=d):d=e[5];let m=d;if(i===null||a)return null;let j;return e[6]!==o||e[7]!==i?(j=(0,r.jsx)("div",{className:"flex max-h-64 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:(0,r.jsx)("img",{alt:o,className:"max-h-64 object-contain","data-testid":"grid-cell-image",onError:m,src:i})}),e[6]=o,e[7]=i,e[8]=j):j=e[8],j},"me"),je=p(l=>{let e=(0,R.c)(37),{bucket:n,column:o,onClose:t,resolveUrl:i,value:s}=l,a=L(),[u,c]=(0,E.useState)(!1),g;e[0]!==s?(g=U(s),e[0]=s,e[1]=g):g=e[1];let d=g,m;e[2]!==d?(m=p(()=>{W(d)&&c(!0)},"d"),e[2]=d,e[3]=m):m=e[3];let j=m,b;e[4]!==a?(b=a("Cell value"),e[4]=a,e[5]=b):b=e[5];let k;e[6]!==o?(k=(0,r.jsx)("h2",{className:"truncate font-mono text-sm font-semibold text-foreground",children:o}),e[6]=o,e[7]=k):k=e[7];let h;e[8]!==u||e[9]!==a?(h=a(u?"Copied":"Copy"),e[8]=u,e[9]=a,e[10]=h):h=e[10];let x;e[11]!==j||e[12]!==h?(x=(0,r.jsx)("button",{className:$,"data-testid":"grid-cell-copy",onClick:j,type:"button",children:h}),e[11]=j,e[12]=h,e[13]=x):x=e[13];let w;e[14]!==a?(w=a("Close"),e[14]=a,e[15]=w):w=e[15];let y;e[16]!==t||e[17]!==w?(y=(0,r.jsx)("button",{className:$,"data-testid":"grid-cell-close",onClick:t,type:"button",children:w}),e[16]=t,e[17]=w,e[18]=y):y=e[18];let N;e[19]!==x||e[20]!==y?(N=(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[x,y]}),e[19]=x,e[20]=y,e[21]=N):N=e[21];let f;e[22]!==k||e[23]!==N?(f=(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[k,N]}),e[22]=k,e[23]=N,e[24]=f):f=e[24];let C;e[25]!==n||e[26]!==i||e[27]!==s?(C=i!==void 0&&typeof s=="string"&&pe.test(s)&&(0,r.jsx)(be,{bucket:n,objectKey:s,resolveUrl:i}),e[25]=n,e[26]=i,e[27]=s,e[28]=C):C=e[28];let v;e[29]!==d?(v=(0,r.jsx)("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs whitespace-pre-wrap","data-testid":"grid-cell-value",children:d}),e[29]=d,e[30]=v):v=e[30];let S;return e[31]!==t||e[32]!==f||e[33]!==C||e[34]!==v||e[35]!==b?(S=(0,r.jsxs)(P,{className:"max-h-[70vh] w-[min(40rem,90vw)]",label:b,onClose:t,panelTestId:"grid-cell-dialog",testId:"grid-cell-dialog-overlay",variant:"dialog",children:[f,C,v]}),e[31]=t,e[32]=f,e[33]=C,e[34]=v,e[35]=b,e[36]=S):S=e[36],S},"Se"),Se=p(l=>{let e=(0,R.c)(37),{backRelations:n,enabledBackRelations:o,onToggleBackRelation:t,columns:i,editable:s,name:a,onBulkDelete:u,onToggleTranspose:c,rows:g,sqlColumns:d,table:m,transposed:j}=l,b=L(),k;e[0]!==m?(k=m.getSelectedRowModel(),e[0]=m,e[1]=k):k=e[1];let h=k.rows,x;e[2]!==m?(x=p(()=>{m.resetRowSelection()},"y"),e[2]=m,e[3]=x):x=e[3];let w=x,y;e[4]!==u||e[5]!==h||e[6]!==m?(y=p(()=>{u(h.map(he)),m.resetRowSelection()},"x"),e[4]=u,e[5]=h,e[6]=m,e[7]=y):y=e[7];let N=y,f;e[8]!==i||e[9]!==a||e[10]!==g||e[11]!==d?(f=(0,r.jsx)(ce,{columns:i,name:a,rows:g,sqlColumns:d}),e[8]=i,e[9]=a,e[10]=g,e[11]=d,e[12]=f):f=e[12];let C;e[13]!==n||e[14]!==o||e[15]!==t||e[16]!==m?(C=(0,r.jsx)(ue,{backRelations:n,enabledBackRelations:o,onToggleBackRelation:t,table:m}),e[13]=n,e[14]=o,e[15]=t,e[16]=m,e[17]=C):C=e[17];let v;e[18]!==b?(v=b("Swap rows and columns"),e[18]=b,e[19]=v):v=e[19];let S;e[20]!==b?(S=b("Transpose"),e[20]=b,e[21]=S):S=e[21];let T;e[22]!==c||e[23]!==v||e[24]!==S||e[25]!==j?(T=(0,r.jsx)("button",{"aria-pressed":j,className:$,"data-testid":"grid-transpose",onClick:c,title:v,type:"button",children:S}),e[22]=c,e[23]=v,e[24]=S,e[25]=j,e[26]=T):T=e[26];let _;e[27]!==s||e[28]!==w||e[29]!==N||e[30]!==h.length?(_=h.length>0&&(0,r.jsx)(ge,{count:h.length,editable:s,onClear:w,onDelete:N}),e[27]=s,e[28]=w,e[29]=N,e[30]=h.length,e[31]=_):_=e[31];let O;return e[32]!==f||e[33]!==C||e[34]!==T||e[35]!==_?(O=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"grid-actions",children:[f,C,T,_]}),e[32]=f,e[33]=C,e[34]=T,e[35]=_,e[36]=O):O=e[36],O},"ke");function he(l){return l.id}p(he,"ue");export{$ as a,fe as b,ce as c,ge as d,je as e,Se as f};
@@ -0,0 +1 @@
1
+ import{a as me}from"./chunk-F7UC63UN.js";import{a as Ot,b as zt,c as At,d as Kt}from"./chunk-SUDJTC4S.js";import{a as it}from"./chunk-YVVP4DRM.js";import{a as Dt,b as Ct,c as It,d as Ft,e as Pe}from"./chunk-IHMGCHAA.js";import{a as Tt}from"./chunk-RPQL45FL.js";import{a as Rt}from"./chunk-GGPSI4ZR.js";import"./chunk-4GTO7FL5.js";import"./chunk-4JLGLPWV.js";import{e as $t}from"./chunk-UYEZR3BI.js";import"./chunk-V3CZW3JB.js";import{a as _t}from"./chunk-BOTGXX4H.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import{a as Ee,b as et,c as tt,d as vt,e as yt,f as rt,g as at,h as Nt,i as St}from"./chunk-P5RUFDVX.js";import"./chunk-5JDWLCSH.js";import"./chunk-EVTM6Q43.js";import{a as kt}from"./chunk-S3CRZLGS.js";import{a as Mt}from"./chunk-2DX5MROH.js";import{a as wt,b as qt}from"./chunk-OGUKYRFM.js";import"./chunk-6D6Z2KXU.js";import"./chunk-OKG3HWSJ.js";import"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as Ze}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as We}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import"./chunk-35DM4JJG.js";import{a as ze}from"./chunk-4ZEL6BYL.js";import{c as Le}from"./chunk-AZVN24IA.js";import{f as ct}from"./chunk-KNCZAQG6.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as ht}from"./chunk-FKVZRPV5.js";import{a as st,b as lt,c as nt,d as je,e as ce,f as U}from"./chunk-HEAQVSNS.js";import{a as fe,b as Ae,c as Ke,d as ut,e as pe}from"./chunk-WUWBZPUK.js";import{d as ge,f as gt,g as ft,h as pt,i as xt,l as Ge,o as bt}from"./chunk-FODLDLE2.js";import{a as o,d as Ye,e as Jt,f as Bt,g as Ht,i as mt}from"./chunk-YKXDMIHQ.js";var P=Ye(Jt(),1);var xe=Ye(Bt(),1);var t=Ye(Ht(),1);var Ut=/["\\\u0000-\u001F\uD800-\uDFFF]/,Lt=o(s=>Ut.test(s)?JSON.stringify(s):`"${s}"`,"ot"),dt=o(s=>{if(s===void 0)return"null";if(typeof s=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key \u2014 pass it as a string, or use stableWireKey");if(typeof s=="number"){if(Number.isNaN(s))return"nan";if(s===1/0)return"inf";if(s===-1/0)return"-inf";if(Object.is(s,-0))return"-0"}if(typeof s=="string")return Lt(s);if(s===null||typeof s!="object")return JSON.stringify(s);if(Array.isArray(s)){let i="[";for(let n=0;n<s.length;n++)n>0&&(i+=","),i+=dt(s[n]);return i+"]"}let e=Object.getPrototypeOf(s);if(e!==null&&e!==Object.prototype){let i=s.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${i} in a stable JSON cache key \u2014 only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}let l=s,a=Object.keys(l).sort(),r="{",u=!0;for(let i of a){let n=l[i];n!==void 0&&(u?u=!1:r+=",",r+=Lt(i),r+=":",r+=dt(n))}return r+"}"},"Ze"),Pt=o((s,e,l)=>`${s}:${e}:${dt(l??{})}`,"ht"),Qt=o((s,e)=>s==="gauge"?e.last:s==="histogram"?e.sum/Math.max(1,e.count):e.sum,"gt"),Wt=o((s,e)=>Qt(s,e),"Jt"),Gt=o(s=>Qt(s.kind,s),"Vt"),ot=o(s=>Number.isInteger(s)?s.toLocaleString():s.toLocaleString(void 0,{maximumFractionDigits:2}),"We"),Vt=o(s=>Array.isArray(s?.series)?s.series:[],"Gt"),Xt="FUNCTION_NOT_FOUND",Yt=o(s=>{let e=new Map;if(!Array.isArray(s?.series))return e;for(let l of s.series)e.set(Pt(l.kind,l.name,l.attributes),l.points);return e},"Xt"),Zt={counter:"secondary",gauge:"default",histogram:"outline"},Et=o(s=>{let e=(0,xe.c)(18),{name:l,onOpenTrace:a,traceId:r}=s,u=ge();if(r===void 0){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=c):c=e[0],c}let i;e[1]!==r?(i=r.slice(0,8),e[1]=r,e[2]=i):i=e[2];let n=i;if(a===void 0){let c=`mt-instrument-trace-${l}`,f;return e[3]!==n||e[4]!==c||e[5]!==r?(f=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":c,title:r,children:n}),e[3]=n,e[4]=c,e[5]=r,e[6]=f):f=e[6],f}let h=`mt-instrument-trace-${l}`,y;e[7]!==a||e[8]!==r?(y=o(()=>{a(r)},"v"),e[7]=a,e[8]=r,e[9]=y):y=e[9];let w;e[10]!==u||e[11]!==r?(w=u("Open the exemplar trace {trace}",{trace:r}),e[10]=u,e[11]=r,e[12]=w):w=e[12];let g;return e[13]!==n||e[14]!==h||e[15]!==y||e[16]!==w?(g=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":h,onClick:y,title:w,type:"button",children:n}),e[13]=n,e[14]=h,e[15]=y,e[16]=w,e[17]=g):g=e[17],g},"Zt"),er=o(s=>{let e=(0,xe.c)(105),{onOpenTrace:l,shardKey:a}=s,r=ge(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={},e[0]=u):u=e[0];let i;e[1]!==a?(i={live:!0,shardKey:a},e[1]=a,e[2]=i):i=e[2];let{data:n,error:h,errorSource:y}=Le(ze.getMetricSeries,u,i),w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w={},e[3]=w):w=e[3];let g;e[4]!==a?(g={live:!0,shardKey:a},e[4]=a,e[5]=g):g=e[5];let{data:c}=Le(ze.getMetricHistory,w,g),f,N,q,_,d,x,p,b,M,$,S,I,C;if(e[6]!==n||e[7]!==h||e[8]!==y||e[9]!==c||e[10]!==l||e[11]!==r){b=Symbol.for("react.early_return_sentinel");e:{let z=Vt(n),A=xt(y)===Xt;if(h!==null&&!A){let m;e[25]!==r?(m=r("Instruments"),e[25]=r,e[26]=m):m=e[26];let j;e[27]!==m?(j=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[27]=m,e[28]=j):j=e[28];let J;e[29]!==h||e[30]!==r?(J=r("Instruments unavailable: {error}",{error:h}),e[29]=h,e[30]=r,e[31]=J):J=e[31];let B;e[32]!==J?(B=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:J}),e[32]=J,e[33]=B):B=e[33];let de;e[34]!==j||e[35]!==B?(de=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[j,B]}),e[34]=j,e[35]=B,e[36]=de):de=e[36],b=de;break e}if(z.length===0){b=null;break e}let D=Yt(c),L;e[37]!==r?(L=o(m=>r(m==="counter"?"Counter":m==="gauge"?"Gauge":"Histogram"),"z"),e[37]=r,e[38]=L):L=e[38];let Q=L;d="flex flex-col gap-2",x="mt-instruments";let K;e[39]!==r?(K=r("Instruments"),e[39]=r,e[40]=K):K=e[40],e[41]!==K?(p=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:K}),e[41]=K,e[42]=p):p=e[42],_=fe,C="overflow-hidden py-0",q=pe,I="px-0",N=st,$="mt-instruments-table";let W;e[43]!==r?(W=r("name"),e[43]=r,e[44]=W):W=e[44];let G;e[45]!==W?(G=(0,t.jsx)(ce,{children:W}),e[45]=W,e[46]=G):G=e[46];let V;e[47]!==r?(V=r("kind"),e[47]=r,e[48]=V):V=e[48];let X;e[49]!==V?(X=(0,t.jsx)(ce,{children:V}),e[49]=V,e[50]=X):X=e[50];let Y;e[51]!==r?(Y=r("value"),e[51]=r,e[52]=Y):Y=e[52];let Z;e[53]!==Y?(Z=(0,t.jsx)(ce,{className:"text-right",children:Y}),e[53]=Y,e[54]=Z):Z=e[54];let E;e[55]!==r?(E=r("count"),e[55]=r,e[56]=E):E=e[56];let ee;e[57]!==E?(ee=(0,t.jsx)(ce,{className:"text-right",children:E}),e[57]=E,e[58]=ee):ee=e[58];let te;e[59]!==r?(te=r("range"),e[59]=r,e[60]=te):te=e[60];let re;e[61]!==te?(re=(0,t.jsx)(ce,{className:"text-right",children:te}),e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==r?(ae=r("trend"),e[63]=r,e[64]=ae):ae=e[64];let se;e[65]!==ae?(se=(0,t.jsx)(ce,{children:ae}),e[65]=ae,e[66]=se):se=e[66];let le;e[67]!==r?(le=r("trace"),e[67]=r,e[68]=le):le=e[68];let ne;e[69]!==le?(ne=(0,t.jsx)(ce,{children:le}),e[69]=le,e[70]=ne):ne=e[70];let ie;e[71]!==r?(ie=r("dimensions"),e[71]=r,e[72]=ie):ie=e[72];let oe;e[73]!==ie?(oe=(0,t.jsx)(ce,{children:ie}),e[73]=ie,e[74]=oe):oe=e[74],e[75]!==G||e[76]!==X||e[77]!==Z||e[78]!==ee||e[79]!==re||e[80]!==se||e[81]!==ne||e[82]!==oe?(S=(0,t.jsx)(lt,{children:(0,t.jsxs)(je,{children:[G,X,Z,ee,re,se,ne,oe]})}),e[75]=G,e[76]=X,e[77]=Z,e[78]=ee,e[79]=re,e[80]=se,e[81]=ne,e[82]=oe,e[83]=S):S=e[83],f=nt,M=z.map(m=>{let j=Tt(m.attributes),J=Pt(m.kind,m.name,m.attributes),B=(D.get(J)??[]).map(de=>Wt(m.kind,de));return(0,t.jsxs)(je,{"data-testid":`mt-instrument-${m.name}`,children:[(0,t.jsx)(U,{className:"font-mono text-xs",title:m.functionPath,children:m.name}),(0,t.jsx)(U,{children:(0,t.jsx)(We,{variant:Zt[m.kind],children:Q(m.kind)})}),(0,t.jsx)(U,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${m.name}`,children:ot(Gt(m))}),(0,t.jsx)(U,{className:"text-right tabular-nums text-muted-foreground",children:m.count.toLocaleString()}),(0,t.jsx)(U,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:m.min===m.max?"\u2014":`${ot(m.min)}\u2013${ot(m.max)}`}),(0,t.jsx)(U,{children:B.length>=2?(0,t.jsx)(it,{ariaLabel:r("{name} trend",{name:m.name}),className:"h-6 w-24 text-foreground",series:B,testId:`mt-instrument-trend-${m.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(U,{className:"font-mono text-xs",children:(0,t.jsx)(Et,{name:m.name,onOpenTrace:l,traceId:m.exemplarTraceId})}),(0,t.jsx)(U,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:j,children:j===""?"\u2014":j})]},J)})}e[6]=n,e[7]=h,e[8]=y,e[9]=c,e[10]=l,e[11]=r,e[12]=f,e[13]=N,e[14]=q,e[15]=_,e[16]=d,e[17]=x,e[18]=p,e[19]=b,e[20]=M,e[21]=$,e[22]=S,e[23]=I,e[24]=C}else f=e[12],N=e[13],q=e[14],_=e[15],d=e[16],x=e[17],p=e[18],b=e[19],M=e[20],$=e[21],S=e[22],I=e[23],C=e[24];if(b!==Symbol.for("react.early_return_sentinel"))return b;let F;e[84]!==f||e[85]!==M?(F=(0,t.jsx)(f,{children:M}),e[84]=f,e[85]=M,e[86]=F):F=e[86];let k;e[87]!==N||e[88]!==F||e[89]!==$||e[90]!==S?(k=(0,t.jsxs)(N,{"data-testid":$,children:[S,F]}),e[87]=N,e[88]=F,e[89]=$,e[90]=S,e[91]=k):k=e[91];let v;e[92]!==q||e[93]!==k||e[94]!==I?(v=(0,t.jsx)(q,{className:I,children:k}),e[92]=q,e[93]=k,e[94]=I,e[95]=v):v=e[95];let T;e[96]!==_||e[97]!==v||e[98]!==C?(T=(0,t.jsx)(_,{className:C,children:v}),e[96]=_,e[97]=v,e[98]=C,e[99]=T):T=e[99];let O;return e[100]!==d||e[101]!==x||e[102]!==p||e[103]!==T?(O=(0,t.jsxs)("section",{className:d,"data-testid":x,children:[p,T]}),e[100]=d,e[101]=x,e[102]=p,e[103]=T,e[104]=O):O=e[104],O},"er"),tr=o(s=>{let e=(0,xe.c)(74),{aggregate:l,shardResults:a}=s,r=ge(),u;e[0]!==r?(u=r("Shards"),e[0]=r,e[1]=u):u=e[1];let i;e[2]!==l.failed||e[3]!==l.reachable||e[4]!==r?(i=l.failed>0?r("{reachable} reachable, {failed} unreachable",{failed:l.failed,reachable:l.reachable}):r("{reachable} reachable",{reachable:l.reachable}),e[2]=l.failed,e[3]=l.reachable,e[4]=r,e[5]=i):i=e[5];let n;e[6]!==u||e[7]!==i?(n=(0,t.jsx)(me,{label:u,testId:"mt-agg-shards",value:i}),e[6]=u,e[7]=i,e[8]=n):n=e[8];let h;e[9]!==r?(h=r("Total requests"),e[9]=r,e[10]=h):h=e[10];let y;e[11]!==l.totalRequests||e[12]!==h?(y=(0,t.jsx)(me,{label:h,testId:"mt-agg-requests",value:l.totalRequests}),e[11]=l.totalRequests,e[12]=h,e[13]=y):y=e[13];let w;e[14]!==r?(w=r("Total errors"),e[14]=r,e[15]=w):w=e[15];let g;e[16]!==l.totalErrors||e[17]!==w?(g=(0,t.jsx)(me,{label:w,testId:"mt-agg-errors",value:l.totalErrors}),e[16]=l.totalErrors,e[17]=w,e[18]=g):g=e[18];let c;e[19]!==r?(c=r("Total database size"),e[19]=r,e[20]=c):c=e[20];let f;e[21]!==l.totalDatabaseSize?(f=Ge(l.totalDatabaseSize),e[21]=l.totalDatabaseSize,e[22]=f):f=e[22];let N;e[23]!==c||e[24]!==f?(N=(0,t.jsx)(me,{label:c,testId:"mt-agg-db-size",value:f}),e[23]=c,e[24]=f,e[25]=N):N=e[25];let q;e[26]!==r?(q=r("Combined cache hit rate"),e[26]=r,e[27]=q):q=e[27];let _;e[28]!==l.hitRate||e[29]!==r?(_=l.hitRate===null?r("no cache configured"):`${(l.hitRate*100).toFixed(1)}%`,e[28]=l.hitRate,e[29]=r,e[30]=_):_=e[30];let d;e[31]!==q||e[32]!==_?(d=(0,t.jsx)(me,{label:q,testId:"mt-agg-cache",value:_}),e[31]=q,e[32]=_,e[33]=d):d=e[33];let x;e[34]!==N||e[35]!==d||e[36]!==n||e[37]!==y||e[38]!==g?(x=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[n,y,g,N,d]}),e[34]=N,e[35]=d,e[36]=n,e[37]=y,e[38]=g,e[39]=x):x=e[39];let p;e[40]!==r?(p=r("shard"),e[40]=r,e[41]=p):p=e[41];let b;e[42]!==p?(b=(0,t.jsx)(ce,{children:p}),e[42]=p,e[43]=b):b=e[43];let M;e[44]!==r?(M=r("requests"),e[44]=r,e[45]=M):M=e[45];let $;e[46]!==M?($=(0,t.jsx)(ce,{children:M}),e[46]=M,e[47]=$):$=e[47];let S;e[48]!==r?(S=r("errors"),e[48]=r,e[49]=S):S=e[49];let I;e[50]!==S?(I=(0,t.jsx)(ce,{children:S}),e[50]=S,e[51]=I):I=e[51];let C;e[52]!==r?(C=r("db size"),e[52]=r,e[53]=C):C=e[53];let F;e[54]!==C?(F=(0,t.jsx)(ce,{children:C}),e[54]=C,e[55]=F):F=e[55];let k;e[56]!==b||e[57]!==$||e[58]!==I||e[59]!==F?(k=(0,t.jsx)(lt,{children:(0,t.jsxs)(je,{children:[b,$,I,F]})}),e[56]=b,e[57]=$,e[58]=I,e[59]=F,e[60]=k):k=e[60];let v;if(e[61]!==a||e[62]!==r){let A;e[64]!==r?(A=o(D=>(0,t.jsxs)(je,{"data-testid":`mt-agg-row-${D.shard}`,children:[(0,t.jsx)(U,{children:D.shard}),D.metrics===null?(0,t.jsx)(U,{className:"text-destructive",colSpan:3,children:D.error??r("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(U,{className:"tabular-nums",children:D.metrics.requests}),(0,t.jsx)(U,{className:"tabular-nums",children:D.metrics.errors}),(0,t.jsx)(U,{className:"tabular-nums",children:Ge(D.metrics.databaseSize)})]})]},D.shard),"O"),e[64]=r,e[65]=A):A=e[65],v=a.map(A),e[61]=a,e[62]=r,e[63]=v}else v=e[63];let T;e[66]!==v?(T=(0,t.jsx)(nt,{children:v}),e[66]=v,e[67]=T):T=e[67];let O;e[68]!==k||e[69]!==T?(O=(0,t.jsx)(fe,{className:"overflow-hidden py-0",children:(0,t.jsx)(pe,{className:"px-0",children:(0,t.jsxs)(st,{"data-testid":"mt-agg-table",children:[k,T]})})}),e[68]=k,e[69]=T,e[70]=O):O=e[70];let z;return e[71]!==x||e[72]!==O?(z=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[x,O]}),e[71]=x,e[72]=O,e[73]=z):z=e[73],z},"tr"),rr=o(s=>{let e=Math.floor(s/1e3),l=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return l>0?`${l.toString()}h ${a.toString()}m`:a>0?`${a.toString()}m ${r.toString()}s`:`${r.toString()}s`},"rr"),ar=o((s,e)=>{let l=s+e;return l===0?"\u2014":`${(s/l*100).toFixed(1)}%`},"sr"),jt=o(s=>s<=0?"\u2014":s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"ct"),sr=o(s=>{let e=(0,xe.c)(75),{currentDelta:l,errorRate:a,history:r,latencyPercentiles:u,metrics:i}=s,n=ge(),{cache:h}=i,y;e[0]!==r||e[1]!==n?(y=r.length>=2?(0,t.jsx)(it,{ariaLabel:n("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:r,testId:"mt-sparkline"}):void 0,e[0]=r,e[1]=n,e[2]=y):y=e[2];let w;e[3]!==l||e[4]!==r.length||e[5]!==n?(w=r.length>=2?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:`+${l.toLocaleString()}`})," ",n("last interval")]}):(0,t.jsx)("span",{"data-testid":"mt-sparkline-empty",children:n("collecting samples\u2026")}),e[3]=l,e[4]=r.length,e[5]=n,e[6]=w):w=e[6];let g;e[7]!==n?(g=n("Requests"),e[7]=n,e[8]=g):g=e[8];let c;e[9]!==i.requests||e[10]!==y||e[11]!==w||e[12]!==g?(c=(0,t.jsx)(me,{chart:y,footer:w,label:g,testId:"mt-requests",value:i.requests}),e[9]=i.requests,e[10]=y,e[11]=w,e[12]=g,e[13]=c):c=e[13];let f;e[14]!==a||e[15]!==n?(f=n("{rate} error rate",{rate:a}),e[14]=a,e[15]=n,e[16]=f):f=e[16];let N;e[17]!==n?(N=n("Errors"),e[17]=n,e[18]=N):N=e[18];let q;e[19]!==a||e[20]!==i.errors?(q=(0,t.jsxs)(t.Fragment,{children:[i.errors," (",a,")"]}),e[19]=a,e[20]=i.errors,e[21]=q):q=e[21];let _;e[22]!==f||e[23]!==N||e[24]!==q?(_=(0,t.jsx)(me,{footer:f,label:N,testId:"mt-errors",value:q}),e[22]=f,e[23]=N,e[24]=q,e[25]=_):_=e[25];let d;e[26]!==u.p90?(d=u.p90>0?`P90 ${jt(u.p90)}`:void 0,e[26]=u.p90,e[27]=d):d=e[27];let x;e[28]!==n?(x=n("P95 latency"),e[28]=n,e[29]=x):x=e[29];let p;e[30]!==u.p95?(p=u.p95>0?jt(u.p95):"\u2014",e[30]=u.p95,e[31]=p):p=e[31];let b;e[32]!==x||e[33]!==p||e[34]!==d?(b=(0,t.jsx)(me,{footer:d,label:x,testId:"mt-p95",value:p}),e[32]=x,e[33]=p,e[34]=d,e[35]=b):b=e[35];let M;e[36]!==h||e[37]!==n?(M=h?`${h.entries.toLocaleString()} ${n("cache entries")}`:void 0,e[36]=h,e[37]=n,e[38]=M):M=e[38];let $;e[39]!==n?($=n("Database size"),e[39]=n,e[40]=$):$=e[40];let S;e[41]!==i.databaseSize?(S=Ge(i.databaseSize),e[41]=i.databaseSize,e[42]=S):S=e[42];let I;e[43]!==M||e[44]!==$||e[45]!==S?(I=(0,t.jsx)(me,{footer:M,label:$,testId:"mt-db-size",value:S}),e[43]=M,e[44]=$,e[45]=S,e[46]=I):I=e[46];let C;e[47]!==n?(C=n("Shard"),e[47]=n,e[48]=C):C=e[48];let F;e[49]!==i.shard||e[50]!==C?(F=(0,t.jsx)(me,{label:C,testId:"mt-shard",value:i.shard}),e[49]=i.shard,e[50]=C,e[51]=F):F=e[51];let k;e[52]!==n?(k=n("Uptime"),e[52]=n,e[53]=k):k=e[53];let v;e[54]!==i.uptimeMs?(v=rr(i.uptimeMs),e[54]=i.uptimeMs,e[55]=v):v=e[55];let T;e[56]!==k||e[57]!==v?(T=(0,t.jsx)(me,{label:k,testId:"mt-uptime",value:v}),e[56]=k,e[57]=v,e[58]=T):T=e[58];let O;e[59]!==n?(O=n("Cache hit rate"),e[59]=n,e[60]=O):O=e[60];let z;e[61]!==h||e[62]!==n?(z=h?n("{rate} ({count} entries)",{count:h.entries,rate:ar(h.hits,h.misses)}):n("no cache configured"),e[61]=h,e[62]=n,e[63]=z):z=e[63];let A;e[64]!==O||e[65]!==z?(A=(0,t.jsx)(me,{label:O,testId:"mt-cache",value:z}),e[64]=O,e[65]=z,e[66]=A):A=e[66];let D;return e[67]!==b||e[68]!==I||e[69]!==F||e[70]!==T||e[71]!==A||e[72]!==c||e[73]!==_?(D=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[c,_,b,I,F,T,A]}),e[67]=b,e[68]=I,e[69]=F,e[70]=T,e[71]=A,e[72]=c,e[73]=_,e[74]=D):D=e[74],D},"lr"),Xe=o(s=>s>=100?"critical":s>=50?"warning":"good","Ve"),Qe=o(s=>s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"Ae"),Ve=o(s=>s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString(),"He"),lr=o(s=>{let e=(0,xe.c)(3),{level:l}=s;if(l==="critical"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(We,{variant:"destructive",children:"Slow"}),e[0]=r):r=e[0],r}if(l==="warning"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=r):r=e[1],r}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=a):a=e[2],a},"ir"),nr=o((s,e)=>{let l=[...s];return l.sort((a,r)=>{switch(e){case"avgTime":return r.avgDurationMs-a.avgDurationMs;case"execCount":return r.execCount-a.execCount;case"rowsRead":return r.rowsRead-a.rowsRead;default:return r.totalDurationMs-a.totalDurationMs}}),l},"ar"),ir=o(s=>{let e=(0,xe.c)(161),{queryStats:l}=s,a=ge(),[r,u]=(0,P.useState)("totalTime"),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,e[0]=i):i=e[0];let[n,h]=(0,P.useState)(i),y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=o(C=>{C!==null&&u(C)},"v"),e[1]=y):y=e[1];let w=y,g,c,f,N,q,_,d,x,p,b;if(e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==a){f=Symbol.for("react.early_return_sentinel");e:{let C=nr(l,r),F;e[16]!==l?(F=l.filter(or),e[16]=l,e[17]=F):F=e[17];let k=F.length,v;e[18]!==l?(v=l.filter(dr),e[18]=l,e[19]=v):v=e[19];let T=v.length,O;e[20]!==l?(O=l.filter(cr),e[20]=l,e[21]=O):O=e[21];let z=O.length,A;e[22]===Symbol.for("react.memo_cache_sentinel")?(A=o(R=>{h(ue=>{let H=new Set(ue);return H.has(R)?H.delete(R):H.add(R),H})},"O"),e[22]=A):A=e[22];let D=A;if(l.length===0){let R;e[23]!==a?(R=a("No query insights yet"),e[23]=a,e[24]=R):R=e[24];let ue;e[25]!==R?(ue=(0,t.jsx)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:R}),e[25]=R,e[26]=ue):ue=e[26];let H;e[27]!==a?(H=a("Query insights appear once statements are executed against this shard."),e[27]=a,e[28]=H):H=e[28];let he;e[29]!==H?(he=(0,t.jsx)("p",{className:"mt-1 text-sm",children:H}),e[29]=H,e[30]=he):he=e[30];let Ue;e[31]!==ue||e[32]!==he?(Ue=(0,t.jsx)(fe,{children:(0,t.jsx)(pe,{className:"py-12",children:(0,t.jsxs)("div",{className:"text-center text-muted-foreground",children:[ue,he]})})}),e[31]=ue,e[32]=he,e[33]=Ue):Ue=e[33],f=Ue;break e}d="space-y-4",x="qi-root";let L;e[34]!==a?(L=a("Critical queries"),e[34]=a,e[35]=L):L=e[35];let Q;e[36]!==L?(Q=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:L})}),e[36]=L,e[37]=Q):Q=e[37];let K;e[38]!==k?(K=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:k}),e[38]=k,e[39]=K):K=e[39];let W;e[40]!==a?(W=a(">100ms avg execution"),e[40]=a,e[41]=W):W=e[41];let G;e[42]!==W?(G=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:W}),e[42]=W,e[43]=G):G=e[43];let V;e[44]!==K||e[45]!==G?(V=(0,t.jsxs)(pe,{children:[K,G]}),e[44]=K,e[45]=G,e[46]=V):V=e[46];let X;e[47]!==Q||e[48]!==V?(X=(0,t.jsxs)(fe,{children:[Q,V]}),e[47]=Q,e[48]=V,e[49]=X):X=e[49];let Y;e[50]!==a?(Y=a("Moderate queries"),e[50]=a,e[51]=Y):Y=e[51];let Z;e[52]!==Y?(Z=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:Y})}),e[52]=Y,e[53]=Z):Z=e[53];let E;e[54]!==T?(E=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:T}),e[54]=T,e[55]=E):E=e[55];let ee;e[56]!==a?(ee=a("50\u2013100ms avg execution"),e[56]=a,e[57]=ee):ee=e[57];let te;e[58]!==ee?(te=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ee}),e[58]=ee,e[59]=te):te=e[59];let re;e[60]!==E||e[61]!==te?(re=(0,t.jsxs)(pe,{children:[E,te]}),e[60]=E,e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==Z||e[64]!==re?(ae=(0,t.jsxs)(fe,{children:[Z,re]}),e[63]=Z,e[64]=re,e[65]=ae):ae=e[65];let se;e[66]!==a?(se=a("Fast queries"),e[66]=a,e[67]=se):se=e[67];let le;e[68]!==se?(le=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:se})}),e[68]=se,e[69]=le):le=e[69];let ne;e[70]!==z?(ne=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:z}),e[70]=z,e[71]=ne):ne=e[71];let ie;e[72]!==a?(ie=a("<50ms avg execution"),e[72]=a,e[73]=ie):ie=e[73];let oe;e[74]!==ie?(oe=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ie}),e[74]=ie,e[75]=oe):oe=e[75];let m;e[76]!==ne||e[77]!==oe?(m=(0,t.jsxs)(pe,{children:[ne,oe]}),e[76]=ne,e[77]=oe,e[78]=m):m=e[78];let j;e[79]!==le||e[80]!==m?(j=(0,t.jsxs)(fe,{children:[le,m]}),e[79]=le,e[80]=m,e[81]=j):j=e[81],e[82]!==X||e[83]!==ae||e[84]!==j?(p=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[X,ae,j]}),e[82]=X,e[83]=ae,e[84]=j,e[85]=p):p=e[85];let J;e[86]!==a?(J=a("Query leaderboard"),e[86]=a,e[87]=J):J=e[87];let B;e[88]!==J?(B=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:J}),e[88]=J,e[89]=B):B=e[89];let de;e[90]!==r||e[91]!==a?(de=a("Slow queries sorted by {sortField}",{sortField:a(r)}),e[90]=r,e[91]=a,e[92]=de):de=e[92];let be;e[93]!==de?(be=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:de}),e[93]=de,e[94]=be):be=e[94];let ve;e[95]!==B||e[96]!==be?(ve=(0,t.jsxs)("div",{children:[B,be]}),e[95]=B,e[96]=be,e[97]=ve):ve=e[97];let ye;e[98]!==a?(ye=a("Sort by"),e[98]=a,e[99]=ye):ye=e[99];let Ne;e[100]!==ye?(Ne=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:ye}),e[100]=ye,e[101]=Ne):Ne=e[101];let Se;e[102]!==a?(Se=a("Sort queries by"),e[102]=a,e[103]=Se):Se=e[103];let Je;e[104]===Symbol.for("react.memo_cache_sentinel")?(Je=(0,t.jsx)(Ct,{}),e[104]=Je):Je=e[104];let we;e[105]!==Se?(we=(0,t.jsx)(It,{"aria-label":Se,className:"w-[140px]","data-testid":"qi-sort",children:Je}),e[105]=Se,e[106]=we):we=e[106];let qe;e[107]!==a?(qe=a("Total time"),e[107]=a,e[108]=qe):qe=e[108];let Me;e[109]!==qe?(Me=(0,t.jsx)(Pe,{value:"totalTime",children:qe}),e[109]=qe,e[110]=Me):Me=e[110];let ke;e[111]!==a?(ke=a("Avg time"),e[111]=a,e[112]=ke):ke=e[112];let _e;e[113]!==ke?(_e=(0,t.jsx)(Pe,{value:"avgTime",children:ke}),e[113]=ke,e[114]=_e):_e=e[114];let $e;e[115]!==a?($e=a("Execution count"),e[115]=a,e[116]=$e):$e=e[116];let De;e[117]!==$e?(De=(0,t.jsx)(Pe,{value:"execCount",children:$e}),e[117]=$e,e[118]=De):De=e[118];let Ce;e[119]!==a?(Ce=a("Rows read"),e[119]=a,e[120]=Ce):Ce=e[120];let Ie;e[121]!==Ce?(Ie=(0,t.jsx)(Pe,{value:"rowsRead",children:Ce}),e[121]=Ce,e[122]=Ie):Ie=e[122];let Fe;e[123]!==Me||e[124]!==_e||e[125]!==De||e[126]!==Ie?(Fe=(0,t.jsxs)(Ft,{children:[Me,_e,De,Ie]}),e[123]=Me,e[124]=_e,e[125]=De,e[126]=Ie,e[127]=Fe):Fe=e[127];let Te;e[128]!==r||e[129]!==we||e[130]!==Fe?(Te=(0,t.jsxs)(Dt,{onValueChange:w,value:r,children:[we,Fe]}),e[128]=r,e[129]=we,e[130]=Fe,e[131]=Te):Te=e[131];let Re;e[132]!==Ne||e[133]!==Te?(Re=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Ne,Te]}),e[132]=Ne,e[133]=Te,e[134]=Re):Re=e[134],e[135]!==ve||e[136]!==Re?(b=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[ve,Re]}),e[135]=ve,e[136]=Re,e[137]=b):b=e[137],c=fe;let Oe;e[138]!==a?(Oe=a("Statements"),e[138]=a,e[139]=Oe):Oe=e[139];let Be;e[140]!==Oe?(Be=(0,t.jsx)(Ke,{children:Oe}),e[140]=Oe,e[141]=Be):Be=e[141],_=(0,t.jsxs)(Ae,{children:[Be,(0,t.jsx)(ut,{children:a("{count} tracked statements",{count:C.length})})]}),g=pe,N="space-y-2";let He;e[142]!==n||e[143]!==a?(He=o(R=>{let ue=R.normalizedSql,H=n.has(ue),he=Xe(R.avgDurationMs);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxs)("button",{"aria-expanded":H,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:o(()=>{D(ue)},"onClick"),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(lr,{level:he}),(0,t.jsx)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:R.normalizedSql})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.totalDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("total")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.avgDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("avg")})]}),R.p95DurationMs!==void 0&&(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.p95DurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("p95")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Ve(R.execCount)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("calls")})]})]})]}),H&&(0,t.jsxs)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:a("Full statement")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:R.normalizedSql})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[R.p50DurationMs!==void 0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("p50")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(R.p50DurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Exec count")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.execCount)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Total time")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(R.totalDurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows read")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.rowsRead)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows written")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.rowsWritten)})]})]})]})]},ue)},"Ke"),e[142]=n,e[143]=a,e[144]=He):He=e[144],q=C.map(He)}e[2]=n,e[3]=l,e[4]=r,e[5]=a,e[6]=g,e[7]=c,e[8]=f,e[9]=N,e[10]=q,e[11]=_,e[12]=d,e[13]=x,e[14]=p,e[15]=b}else g=e[6],c=e[7],f=e[8],N=e[9],q=e[10],_=e[11],d=e[12],x=e[13],p=e[14],b=e[15];if(f!==Symbol.for("react.early_return_sentinel"))return f;let M;e[145]!==N||e[146]!==q?(M=(0,t.jsx)("div",{className:N,children:q}),e[145]=N,e[146]=q,e[147]=M):M=e[147];let $;e[148]!==g||e[149]!==M?($=(0,t.jsx)(g,{children:M}),e[148]=g,e[149]=M,e[150]=$):$=e[150];let S;e[151]!==c||e[152]!==$||e[153]!==_?(S=(0,t.jsxs)(c,{children:[_,$]}),e[151]=c,e[152]=$,e[153]=_,e[154]=S):S=e[154];let I;return e[155]!==S||e[156]!==d||e[157]!==x||e[158]!==p||e[159]!==b?(I=(0,t.jsxs)("div",{className:d,"data-testid":x,children:[p,b,S]}),e[155]=S,e[156]=d,e[157]=x,e[158]=p,e[159]=b,e[160]=I):I=e[160],I},"nr");function or(s){return Xe(s.avgDurationMs)==="critical"}o(or,"or");function dr(s){return Xe(s.avgDurationMs)==="warning"}o(dr,"cr");function cr(s){return Xe(s.avgDurationMs)==="good"}o(cr,"dr");var mr=["1m","5m","15m","1h"],ur=o(s=>new Date(s).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),"ur"),hr=o(s=>s.map(e=>({avg:Math.round(e.avgDurationMs*100)/100,execs:e.execCount,label:ur(e.bucketMs)})),"fr"),gr=o(({shardKey:s=""})=>{let e=ge(),[l,a]=(0,P.useState)("15m"),r=Le(ze.getQueryInsights,{range:l},{live:!0,shardKey:s}).data,u=hr(r?.buckets??[]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"qi-range",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-border p-0.5","data-testid":"qi-ranges",role:"group",children:mr.map(i=>(0,t.jsx)("button",{"aria-pressed":i===l,className:mt("rounded px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",i===l&&"bg-accent font-medium text-foreground"),"data-testid":`qi-range-${i}`,onClick:o(()=>{a(i)},"onClick"),type:"button",children:i},i))}),r?.capped===!0&&(0,t.jsx)(We,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),u.length===0?(0,t.jsx)(ht,{description:e("Statements executed in the selected window appear here, with throughput and latency over time."),testId:"qi-empty",title:e("No queries in this window.")}):(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-throughput",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Throughput")}),(0,t.jsx)(Ee,{height:140,width:"100%",children:(0,t.jsxs)(St,{data:u,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(yt,{dataKey:"execs",fill:"var(--color-primary)",fillOpacity:.15,stroke:"var(--color-primary)",type:"monotone"})]})})]}),(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-latency",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Mean latency (ms)")}),(0,t.jsx)(Ee,{height:140,width:"100%",children:(0,t.jsxs)(Nt,{data:u,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(vt,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(ir,{queryStats:r?.entries??[]})]})},"hr"),fr=gt(ze.getMetrics),pr=o((s,e)=>s?e:"overview","pr"),jr=o(({initialShardKey:s})=>{let e=ct(),l=ge(),{queryShardKey:a,setShardKey:r,shardKey:u}=kt(s),[i,n]=(0,P.useState)("overview"),[h,y]=(0,P.useState)([]),w=(0,P.useRef)(null),g=(0,P.useRef)(null),c=(0,P.useRef)(!0);(0,P.useEffect)(()=>(c.current=!0,()=>{c.current=!1}),[]);let f=Rt(a),{data:N,error:q,liveError:_}=Le(ze.getMetrics,{},{live:!0,shardKey:a}),d=N??null;(0,P.useEffect)(()=>{if(N===void 0)return;qt(a);let D=N,L=w.current,Q=g.current!==null&&g.current!==D.shard;if(g.current=D.shard,w.current=D.requests,Q){y([]);return}L!==null&&D.requests>=L&&y(K=>[...K,D.requests-L].slice(-30))},[N,a]);let[x,p]=(0,P.useState)(null),[b,M]=(0,P.useState)(!1),$=o(async()=>{M(!0);let D=zt(u,wt());try{let L=await Promise.all(D.map(async Q=>{try{let K=await e.query(fr,{},ft(Q));return{error:null,metrics:K,shard:Q===""?K.shard:Q}}catch(K){return{error:pt(K),metrics:null,shard:Q===""?"__root__":Q}}}));c.current&&p(L)}finally{c.current&&M(!1)}},"R"),S=x===null?null:Ot(x),I=d===null||d.requests===0?"\u2014":`${(d.errors/d.requests*100).toFixed(1)}%`,C=h.length>0?h.at(-1):0,F=d?At(d):{p90:0,p95:0},k=(0,P.useMemo)(()=>{if(!d||!("queryStats"in d))return;let D=d.queryStats;if(!(!D||!Array.isArray(D)))return Kt(D)},[d]),v=pr(k!==void 0,i),T=o(()=>{bt($())},"D"),O=o(()=>{p(null)},"F"),z=o(()=>{n("overview")},"A"),A=o(()=>{n("query-insights")},"O");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(Mt,{onChange:r,testId:"mt-shard-input",value:u}),(0,t.jsx)(_t,{message:_,prefix:"mt"}),(0,t.jsx)(Ze,{"data-testid":"mt-aggregate",disabled:b,onClick:T,size:"sm",type:"button",variant:"secondary",children:l(b?"Aggregating\u2026":"All shards")}),x!==null&&(0,t.jsx)(Ze,{"data-testid":"mt-aggregate-clear",onClick:O,size:"sm",type:"button",variant:"ghost",children:l("Hide")}),(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:$t,rel:"noreferrer",target:"_blank",children:l("Open in Cloudflare")})]}),q!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:q}),k!==void 0&&(0,t.jsxs)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsx)("button",{className:`pb-2 text-sm font-medium transition-colors ${v==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:z,type:"button",children:l("Overview")}),(0,t.jsxs)("button",{className:`pb-2 text-sm font-medium transition-colors ${v==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:A,type:"button",children:[l("Query insights"),k.length>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:k.length})]})]}),v==="query-insights"&&k!==void 0&&(0,t.jsx)(gr,{shardKey:a}),v==="overview"&&d!==null&&(0,t.jsx)(sr,{currentDelta:C,errorRate:I,history:h,latencyPercentiles:F,metrics:d}),v==="overview"&&d===null&&null,v==="overview"&&(0,t.jsx)(er,{onOpenTrace:f,shardKey:a}),v==="overview"&&S!==null&&x!==null&&(0,t.jsx)(tr,{aggregate:S,shardResults:x})]})},"jr");export{jr as MetricsPanel};
@@ -0,0 +1 @@
1
+ import{b as p}from"./chunk-35DM4JJG.js";import{d as f}from"./chunk-FODLDLE2.js";import{a as v,d,f as g,g as h}from"./chunk-YKXDMIHQ.js";var x=d(g(),1);var c=d(h(),1);var y=v(b=>{let e=(0,x.c)(14),{message:i,prefix:n}=b,r=f(),t=p(),l;e[0]!==t?(l=v(()=>{t?.openConsole({errorsOnly:!0})},"l"),e[0]=t,e[1]=l):l=e[1];let u=l;if(i===void 0)return null;let m=`${n}-live-error`,o;e[2]!==i||e[3]!==r?(o=r("Live unavailable: {liveError}",{liveError:i}),e[2]=i,e[3]=r,e[4]=o):o=e[4];let s;e[5]!==t||e[6]!==n||e[7]!==u||e[8]!==r?(s=t===void 0?null:(0,c.jsx)("button",{className:"underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":`${n}-live-error-console`,onClick:u,type:"button",children:r("Show in console")}),e[5]=t,e[6]=n,e[7]=u,e[8]=r,e[9]=s):s=e[9];let a;return e[10]!==m||e[11]!==o||e[12]!==s?(a=(0,c.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-destructive","data-testid":m,role:"status",children:[o,s]}),e[10]=m,e[11]=o,e[12]=s,e[13]=a):a=e[13],a},"E");export{y as a};