adonisjs-server-stats 1.10.0 → 1.10.3

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 (210) hide show
  1. package/README.md +23 -14
  2. package/dist/core/config-utils.d.ts +8 -0
  3. package/dist/core/constants.d.ts +4 -0
  4. package/dist/core/dashboard-data-controller.d.ts +16 -0
  5. package/dist/core/dashboard-data-helpers.d.ts +12 -0
  6. package/dist/core/debug-data-controller.d.ts +4 -0
  7. package/dist/core/define-config-helpers.d.ts +25 -0
  8. package/dist/core/feature-detect-helpers.d.ts +36 -0
  9. package/dist/core/formatters-helpers.d.ts +23 -0
  10. package/dist/core/index.js +594 -509
  11. package/dist/core/log-utils-helpers.d.ts +13 -0
  12. package/dist/core/metrics.d.ts +3 -28
  13. package/dist/core/pagination.d.ts +0 -9
  14. package/dist/core/server-stats-controller.d.ts +6 -0
  15. package/dist/core/transmit-helpers.d.ts +7 -0
  16. package/dist/core/types-dashboard.d.ts +178 -0
  17. package/dist/core/types-diagnostics.d.ts +85 -0
  18. package/dist/core/types.d.ts +10 -442
  19. package/dist/react/{CacheSection-UCMptWyn.js → CacheSection-baMZotSn.js} +2 -2
  20. package/dist/react/CacheTab-2cw_rMzj.js +117 -0
  21. package/dist/react/{ConfigSection-DfFd-WRq.js → ConfigSection-DGgqjAal.js} +1 -1
  22. package/dist/react/{ConfigTab-Bdg8YMer.js → ConfigTab-H3OnYqmK.js} +1 -1
  23. package/dist/react/CustomPaneTab-B6r7ha0u.js +98 -0
  24. package/dist/react/{EmailsSection-CM7stSyh.js → EmailsSection-C-UZISG-.js} +2 -2
  25. package/dist/react/EmailsTab-DbK4Eobn.js +139 -0
  26. package/dist/react/{EventsSection-ByQ-9blq.js → EventsSection-C7RQW_LY.js} +2 -2
  27. package/dist/react/EventsTab-CfVr7AiM.js +57 -0
  28. package/dist/react/{FilterBar-DQRXpWrb.js → FilterBar-CQ7bD669.js} +15 -15
  29. package/dist/react/{JobsSection-DF3qEv9O.js → JobsSection-CQHNK_Ls.js} +2 -2
  30. package/dist/react/{JobsTab-BbrBWIOb.js → JobsTab-znzf6jzk.js} +54 -42
  31. package/dist/react/{LogsSection-DcFTZY7b.js → LogsSection-Dmm3rE2B.js} +9 -3
  32. package/dist/react/LogsTab-D8unMV5P.js +108 -0
  33. package/dist/react/{OverviewSection-C4T1ur51.js → OverviewSection-ABP9ueBo.js} +1 -1
  34. package/dist/react/{QueriesSection-PswteoF9.js → QueriesSection-CnmSkznA.js} +2 -2
  35. package/dist/react/{QueriesTab-osLUWd4L.js → QueriesTab-BQzcxEiW.js} +37 -40
  36. package/dist/react/{RelatedLogs-DFDOyUMr.js → RelatedLogs-3A8RuGKH.js} +15 -3
  37. package/dist/react/{RequestsSection-Nag30rEA.js → RequestsSection-kW79_M7k.js} +3 -3
  38. package/dist/react/{RoutesSection-BUSkM6PY.js → RoutesSection-BRhxrtjZ.js} +2 -2
  39. package/dist/react/RoutesTab-CpYH5lUw.js +68 -0
  40. package/dist/react/{TimelineTab-Covg5weo.js → TimelineTab-DjLR35Ce.js} +47 -53
  41. package/dist/react/index-CsImORX6.js +1121 -0
  42. package/dist/react/index.js +1 -1
  43. package/dist/react/react/components/{Dashboard/shared → shared}/FilterBar.d.ts +4 -3
  44. package/dist/react/react/hooks/useDashboardData.d.ts +4 -8
  45. package/dist/react/style.css +1 -1
  46. package/dist/src/collectors/app_collector.d.ts +0 -8
  47. package/dist/src/collectors/app_collector.js +45 -52
  48. package/dist/src/collectors/auto_detect.d.ts +0 -23
  49. package/dist/src/collectors/auto_detect.js +33 -55
  50. package/dist/src/collectors/db_pool_collector.d.ts +14 -16
  51. package/dist/src/collectors/db_pool_collector.js +72 -57
  52. package/dist/src/collectors/log_collector.d.ts +0 -47
  53. package/dist/src/collectors/log_collector.js +36 -65
  54. package/dist/src/collectors/queue_collector.d.ts +0 -20
  55. package/dist/src/collectors/queue_collector.js +60 -76
  56. package/dist/src/collectors/redis_collector.d.ts +10 -10
  57. package/dist/src/collectors/redis_collector.js +69 -66
  58. package/dist/src/config/deprecation_migration.d.ts +7 -0
  59. package/dist/src/config/deprecation_migration.js +201 -0
  60. package/dist/src/controller/debug_controller.d.ts +1 -1
  61. package/dist/src/controller/debug_controller.js +87 -81
  62. package/dist/src/dashboard/cache_handlers.d.ts +14 -0
  63. package/dist/src/dashboard/cache_handlers.js +52 -0
  64. package/dist/src/dashboard/chart_aggregator.d.ts +0 -7
  65. package/dist/src/dashboard/chart_aggregator.js +68 -50
  66. package/dist/src/dashboard/coalesce_cache.d.ts +25 -0
  67. package/dist/src/dashboard/coalesce_cache.js +47 -0
  68. package/dist/src/dashboard/dashboard_controller.d.ts +11 -37
  69. package/dist/src/dashboard/dashboard_controller.js +51 -544
  70. package/dist/src/dashboard/dashboard_page_assets.d.ts +17 -0
  71. package/dist/src/dashboard/dashboard_page_assets.js +51 -0
  72. package/dist/src/dashboard/dashboard_store.d.ts +19 -218
  73. package/dist/src/dashboard/dashboard_store.js +115 -1116
  74. package/dist/src/dashboard/dashboard_types.d.ts +83 -0
  75. package/dist/src/dashboard/dashboard_types.js +4 -0
  76. package/dist/src/dashboard/detail_queries.d.ts +19 -0
  77. package/dist/src/dashboard/detail_queries.js +98 -0
  78. package/dist/src/dashboard/email_event_builder.d.ts +8 -0
  79. package/dist/src/dashboard/email_event_builder.js +65 -0
  80. package/dist/src/dashboard/explain_query.d.ts +8 -0
  81. package/dist/src/dashboard/explain_query.js +22 -0
  82. package/dist/src/dashboard/filter_handlers.d.ts +23 -0
  83. package/dist/src/dashboard/filter_handlers.js +56 -0
  84. package/dist/src/dashboard/filtered_queries.d.ts +15 -0
  85. package/dist/src/dashboard/filtered_queries.js +155 -0
  86. package/dist/src/dashboard/flush_manager.d.ts +25 -0
  87. package/dist/src/dashboard/flush_manager.js +107 -0
  88. package/dist/src/dashboard/format_helpers.d.ts +126 -0
  89. package/dist/src/dashboard/format_helpers.js +140 -0
  90. package/dist/src/dashboard/inspector_manager.d.ts +36 -0
  91. package/dist/src/dashboard/inspector_manager.js +102 -0
  92. package/dist/src/dashboard/integrations/config_inspector.js +11 -13
  93. package/dist/src/dashboard/integrations/queue_inspector.d.ts +3 -3
  94. package/dist/src/dashboard/integrations/queue_inspector.js +13 -10
  95. package/dist/src/dashboard/jobs_handlers.d.ts +14 -0
  96. package/dist/src/dashboard/jobs_handlers.js +61 -0
  97. package/dist/src/dashboard/knex_factory.d.ts +18 -0
  98. package/dist/src/dashboard/knex_factory.js +91 -0
  99. package/dist/src/dashboard/migrator.js +30 -159
  100. package/dist/src/dashboard/migrator_tables.d.ts +19 -0
  101. package/dist/src/dashboard/migrator_tables.js +153 -0
  102. package/dist/src/dashboard/overview_queries.d.ts +66 -0
  103. package/dist/src/dashboard/overview_queries.js +155 -0
  104. package/dist/src/dashboard/overview_query_runners.d.ts +25 -0
  105. package/dist/src/dashboard/overview_query_runners.js +84 -0
  106. package/dist/src/dashboard/overview_store_queries.d.ts +40 -0
  107. package/dist/src/dashboard/overview_store_queries.js +69 -0
  108. package/dist/src/dashboard/paginate_helper.d.ts +12 -0
  109. package/dist/src/dashboard/paginate_helper.js +33 -0
  110. package/dist/src/dashboard/query_explain_handler.d.ts +10 -0
  111. package/dist/src/dashboard/query_explain_handler.js +80 -0
  112. package/dist/src/dashboard/read_queries.d.ts +32 -0
  113. package/dist/src/dashboard/read_queries.js +107 -0
  114. package/dist/src/dashboard/saved_filter_queries.d.ts +10 -0
  115. package/dist/src/dashboard/saved_filter_queries.js +24 -0
  116. package/dist/src/dashboard/storage_stats.d.ts +41 -0
  117. package/dist/src/dashboard/storage_stats.js +81 -0
  118. package/dist/src/dashboard/write_queue.d.ts +106 -0
  119. package/dist/src/dashboard/write_queue.js +225 -0
  120. package/dist/src/data/data_access.d.ts +2 -39
  121. package/dist/src/data/data_access.js +17 -193
  122. package/dist/src/data/data_access_helpers.d.ts +130 -0
  123. package/dist/src/data/data_access_helpers.js +212 -0
  124. package/dist/src/debug/debug_store.js +37 -32
  125. package/dist/src/debug/email_collector.d.ts +1 -10
  126. package/dist/src/debug/email_collector.js +78 -81
  127. package/dist/src/debug/event_collector.d.ts +0 -9
  128. package/dist/src/debug/event_collector.js +79 -62
  129. package/dist/src/debug/query_collector.js +23 -19
  130. package/dist/src/debug/route_inspector.d.ts +1 -5
  131. package/dist/src/debug/route_inspector.js +50 -51
  132. package/dist/src/debug/trace_collector.d.ts +9 -1
  133. package/dist/src/debug/trace_collector.js +21 -15
  134. package/dist/src/debug/types.d.ts +1 -1
  135. package/dist/src/define_config.d.ts +0 -65
  136. package/dist/src/define_config.js +93 -333
  137. package/dist/src/edge/client/dashboard.js +2 -2
  138. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  139. package/dist/src/edge/client/stats-bar.js +1 -1
  140. package/dist/src/edge/client-vue/dashboard.js +5 -5
  141. package/dist/src/edge/client-vue/debug-panel-deferred.js +3 -3
  142. package/dist/src/edge/client-vue/stats-bar.js +3 -3
  143. package/dist/src/edge/plugin.d.ts +0 -16
  144. package/dist/src/edge/plugin.js +57 -64
  145. package/dist/src/engine/request_metrics.d.ts +1 -0
  146. package/dist/src/engine/request_metrics.js +32 -42
  147. package/dist/src/middleware/request_tracking_middleware.d.ts +2 -8
  148. package/dist/src/middleware/request_tracking_middleware.js +65 -93
  149. package/dist/src/provider/auth_middleware_detector.d.ts +16 -0
  150. package/dist/src/provider/auth_middleware_detector.js +97 -0
  151. package/dist/src/provider/boot_helpers.d.ts +20 -0
  152. package/dist/src/provider/boot_helpers.js +91 -0
  153. package/dist/src/provider/boot_initializer.d.ts +28 -0
  154. package/dist/src/provider/boot_initializer.js +35 -0
  155. package/dist/src/provider/dashboard_init.d.ts +30 -0
  156. package/dist/src/provider/dashboard_init.js +138 -0
  157. package/dist/src/provider/dashboard_setup.d.ts +25 -0
  158. package/dist/src/provider/dashboard_setup.js +78 -0
  159. package/dist/src/provider/diagnostics.d.ts +134 -0
  160. package/dist/src/provider/diagnostics.js +127 -0
  161. package/dist/src/provider/email_bridge.d.ts +43 -0
  162. package/dist/src/provider/email_bridge.js +80 -0
  163. package/dist/src/provider/email_helpers.d.ts +13 -0
  164. package/dist/src/provider/email_helpers.js +68 -0
  165. package/dist/src/provider/pino_hook.d.ts +17 -0
  166. package/dist/src/provider/pino_hook.js +35 -0
  167. package/dist/src/provider/provider_helpers_extra.d.ts +47 -0
  168. package/dist/src/provider/provider_helpers_extra.js +177 -0
  169. package/dist/src/provider/server_stats_provider.d.ts +39 -85
  170. package/dist/src/provider/server_stats_provider.js +132 -951
  171. package/dist/src/provider/shutdown_helpers.d.ts +43 -0
  172. package/dist/src/provider/shutdown_helpers.js +70 -0
  173. package/dist/src/provider/toolbar_setup.d.ts +57 -0
  174. package/dist/src/provider/toolbar_setup.js +141 -0
  175. package/dist/src/routes/dashboard_routes.d.ts +14 -0
  176. package/dist/src/routes/dashboard_routes.js +197 -0
  177. package/dist/src/routes/debug_routes.d.ts +14 -0
  178. package/dist/src/routes/debug_routes.js +101 -0
  179. package/dist/src/routes/register_routes.d.ts +0 -78
  180. package/dist/src/routes/register_routes.js +22 -352
  181. package/dist/src/routes/stats_routes.d.ts +5 -0
  182. package/dist/src/routes/stats_routes.js +14 -0
  183. package/dist/src/styles/components.css +96 -0
  184. package/dist/src/styles/dashboard.css +8 -90
  185. package/dist/src/styles/debug-panel.css +1 -31
  186. package/dist/src/types.d.ts +305 -14
  187. package/dist/vue/{CacheSection-oFAJL3mo.js → CacheSection-ITqvpfH5.js} +1 -1
  188. package/dist/vue/{ConfigSection-BhfJ4KqL.js → ConfigSection-DTn3GslE.js} +1 -1
  189. package/dist/vue/{EmailsSection-BcNyhyHs.js → EmailsSection-DtLJ4XoS.js} +1 -1
  190. package/dist/vue/{EventsSection-r60Q5Lmu.js → EventsSection-BOYYz0Ty.js} +1 -1
  191. package/dist/vue/{JobsSection-BHL-hkQw.js → JobsSection-BazTxcJL.js} +1 -1
  192. package/dist/vue/{LogsSection-DRMGzJmg.js → LogsSection-D55PjTKX.js} +9 -3
  193. package/dist/vue/{LogsTab-Bg3o0Mm6.js → LogsTab-47zEK7jL.js} +4 -1
  194. package/dist/vue/{OverviewSection-CXh6Ja1B.js → OverviewSection-1uBKo-Tu.js} +1 -1
  195. package/dist/vue/{QueriesSection-IodIsCJ-.js → QueriesSection-rpoZ4ogd.js} +1 -1
  196. package/dist/vue/{RequestsSection-BPuMdmMc.js → RequestsSection-x7LvT0MC.js} +1 -1
  197. package/dist/vue/{RoutesSection-NKo3Rbq3.js → RoutesSection-CCD0zZqQ.js} +1 -1
  198. package/dist/vue/composables/useDashboardData.d.ts +12 -23
  199. package/dist/vue/index-C8MxnS7Q.js +1232 -0
  200. package/dist/vue/index.js +1 -1
  201. package/dist/vue/style.css +1 -1
  202. package/package.json +1 -1
  203. package/dist/react/CacheTab-CA8LB1J5.js +0 -123
  204. package/dist/react/CustomPaneTab-Bxtv_8Rw.js +0 -104
  205. package/dist/react/EmailsTab-BDhEiomM.js +0 -153
  206. package/dist/react/EventsTab-CMfY98Rl.js +0 -63
  207. package/dist/react/LogsTab-CicucmVk.js +0 -103
  208. package/dist/react/RoutesTab-DgVzd2PZ.js +0 -74
  209. package/dist/react/index-Cflz9Ebj.js +0 -1069
  210. package/dist/vue/index-Dtgysd26.js +0 -1229
@@ -1,2 +1,2 @@
1
- (function(){"use strict";var ye,A,et,oe,tt,st,nt,rt,Me,De,Oe,be={},we=[],ks=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pe=Array.isArray;function ee(e,s){for(var n in s)e[n]=s[n];return e}function Ie(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ne(e,s,n){var r,o,a,l={};for(a in s)a=="key"?r=s[a]:a=="ref"?o=s[a]:l[a]=s[a];if(arguments.length>2&&(l.children=arguments.length>3?ye.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)l[a]===void 0&&(l[a]=e.defaultProps[a]);return xe(e,l,r,o,null)}function xe(e,s,n,r,o){var a={type:e,props:s,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++et,__i:-1,__u:0};return o==null&&A.vnode!=null&&A.vnode(a),a}function O(e){return e.children}function te(e,s){this.props=e,this.context=s}function de(e,s){if(s==null)return e.__?de(e.__,e.__i+1):null;for(var n;s<e.__k.length;s++)if((n=e.__k[s])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?de(e):null}function $s(e){if(e.__P&&e.__d){var s=e.__v,n=s.__e,r=[],o=[],a=ee({},s);a.__v=s.__v+1,A.vnode&&A.vnode(a),je(e.__P,a,s,e.__n,e.__P.namespaceURI,32&s.__u?[n]:null,r,n??de(s),!!(32&s.__u),o),a.__v=s.__v,a.__.__k[a.__i]=a,ht(r,a,o),s.__e=s.__=null,a.__e!=n&&at(a)}}function at(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(s){if(s!=null&&s.__e!=null)return e.__e=e.__c.base=s.__e}),at(e)}function lt(e){(!e.__d&&(e.__d=!0)&&oe.push(e)&&!ke.__r++||tt!=A.debounceRendering)&&((tt=A.debounceRendering)||st)(ke)}function ke(){for(var e,s=1;oe.length;)oe.length>s&&oe.sort(nt),e=oe.shift(),s=oe.length,$s(e);ke.__r=0}function it(e,s,n,r,o,a,l,i,c,d,u){var h,v,p,m,_,S,x,N=r&&r.__k||we,f=s.length;for(c=Ss(n,s,N,c,f),h=0;h<f;h++)(p=n.__k[h])!=null&&(v=p.__i!=-1&&N[p.__i]||be,p.__i=h,S=je(e,p,v,o,a,l,i,c,d,u),m=p.__e,p.ref&&v.ref!=p.ref&&(v.ref&&Be(v.ref,null,p),u.push(p.ref,p.__c||m,p)),_==null&&m!=null&&(_=m),(x=!!(4&p.__u))||v.__k===p.__k?c=ot(p,c,e,x):typeof p.type=="function"&&S!==void 0?c=S:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=_,c}function Ss(e,s,n,r,o){var a,l,i,c,d,u=n.length,h=u,v=0;for(e.__k=new Array(o),a=0;a<o;a++)(l=s[a])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[a]=xe(null,l,null,null,null):pe(l)?l=e.__k[a]=xe(O,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[a]=xe(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[a]=l,c=a+v,l.__=e,l.__b=e.__b+1,i=null,(d=l.__i=Cs(l,n,c,h))!=-1&&(h--,(i=n[d])&&(i.__u|=2)),i==null||i.__v==null?(d==-1&&(o>u?v--:o<u&&v++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?v--:d==c+1?v++:(d>c?v--:v++,l.__u|=4))):e.__k[a]=null;if(h)for(a=0;a<u;a++)(i=n[a])!=null&&(2&i.__u)==0&&(i.__e==r&&(r=de(i)),pt(i,i));return r}function ot(e,s,n,r){var o,a;if(typeof e.type=="function"){for(o=e.__k,a=0;o&&a<o.length;a++)o[a]&&(o[a].__=e,s=ot(o[a],s,n,r));return s}e.__e!=s&&(r&&(s&&e.type&&!s.parentNode&&(s=de(e)),n.insertBefore(e.__e,s||null)),s=e.__e);do s=s&&s.nextSibling;while(s!=null&&s.nodeType==8);return s}function $e(e,s){return s=s||[],e==null||typeof e=="boolean"||(pe(e)?e.some(function(n){$e(n,s)}):s.push(e)),s}function Cs(e,s,n,r){var o,a,l,i=e.key,c=e.type,d=s[n],u=d!=null&&(2&d.__u)==0;if(d===null&&i==null||u&&i==d.key&&c==d.type)return n;if(r>(u?1:0)){for(o=n-1,a=n+1;o>=0||a<s.length;)if((d=s[l=o>=0?o--:a++])!=null&&(2&d.__u)==0&&i==d.key&&c==d.type)return l}return-1}function ct(e,s,n){s[0]=="-"?e.setProperty(s,n??""):e[s]=n==null?"":typeof n!="number"||ks.test(s)?n:n+"px"}function Se(e,s,n,r,o){var a,l;e:if(s=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(s in r)n&&s in n||ct(e.style,s,"");if(n)for(s in n)r&&n[s]==r[s]||ct(e.style,s,n[s])}else if(s[0]=="o"&&s[1]=="n")a=s!=(s=s.replace(rt,"$1")),l=s.toLowerCase(),s=l in e||s=="onFocusOut"||s=="onFocusIn"?l.slice(2):s.slice(2),e.l||(e.l={}),e.l[s+a]=n,n?r?n.u=r.u:(n.u=Me,e.addEventListener(s,a?Oe:De,a)):e.removeEventListener(s,a?Oe:De,a);else{if(o=="http://www.w3.org/2000/svg")s=s.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(s!="width"&&s!="height"&&s!="href"&&s!="list"&&s!="form"&&s!="tabIndex"&&s!="download"&&s!="rowSpan"&&s!="colSpan"&&s!="role"&&s!="popover"&&s in e)try{e[s]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&s[4]!="-"?e.removeAttribute(s):e.setAttribute(s,s=="popover"&&n==1?"":n))}}function dt(e){return function(s){if(this.l){var n=this.l[s.type+e];if(s.t==null)s.t=Me++;else if(s.t<n.u)return;return n(A.event?A.event(s):s)}}}function je(e,s,n,r,o,a,l,i,c,d){var u,h,v,p,m,_,S,x,N,f,k,b,L,q,D,P=s.type;if(s.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[i=s.__e=n.__e]),(u=A.__b)&&u(s);e:if(typeof P=="function")try{if(x=s.props,N="prototype"in P&&P.prototype.render,f=(u=P.contextType)&&r[u.__c],k=u?f?f.props.value:u.__:r,n.__c?S=(h=s.__c=n.__c).__=h.__E:(N?s.__c=h=new P(x,k):(s.__c=h=new te(x,k),h.constructor=P,h.render=Ls),f&&f.sub(h),h.state||(h.state={}),h.__n=r,v=h.__d=!0,h.__h=[],h._sb=[]),N&&h.__s==null&&(h.__s=h.state),N&&P.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=ee({},h.__s)),ee(h.__s,P.getDerivedStateFromProps(x,h.__s))),p=h.props,m=h.state,h.__v=s,v)N&&P.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),N&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(N&&P.getDerivedStateFromProps==null&&x!==p&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(x,k),s.__v==n.__v||!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(x,h.__s,k)===!1){s.__v!=n.__v&&(h.props=x,h.state=h.__s,h.__d=!1),s.__e=n.__e,s.__k=n.__k,s.__k.some(function(j){j&&(j.__=s)}),we.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&l.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(x,h.__s,k),N&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(p,m,_)})}if(h.context=k,h.props=x,h.__P=e,h.__e=!1,b=A.__r,L=0,N)h.state=h.__s,h.__d=!1,b&&b(s),u=h.render(h.props,h.state,h.context),we.push.apply(h.__h,h._sb),h._sb=[];else do h.__d=!1,b&&b(s),u=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++L<25);h.state=h.__s,h.getChildContext!=null&&(r=ee(ee({},r),h.getChildContext())),N&&!v&&h.getSnapshotBeforeUpdate!=null&&(_=h.getSnapshotBeforeUpdate(p,m)),q=u!=null&&u.type===O&&u.key==null?ut(u.props.children):u,i=it(e,pe(q)?q:[q],s,n,r,o,a,l,i,c,d),h.base=s.__e,s.__u&=-161,h.__h.length&&l.push(h),S&&(h.__E=h.__=null)}catch(j){if(s.__v=null,c||a!=null)if(j.then){for(s.__u|=c?160:128;i&&i.nodeType==8&&i.nextSibling;)i=i.nextSibling;a[a.indexOf(i)]=null,s.__e=i}else{for(D=a.length;D--;)Ie(a[D]);Fe(s)}else s.__e=n.__e,s.__k=n.__k,j.then||Fe(s);A.__e(j,s,n)}else a==null&&s.__v==n.__v?(s.__k=n.__k,s.__e=n.__e):i=s.__e=Ts(n.__e,s,n,r,o,a,l,c,d);return(u=A.diffed)&&u(s),128&s.__u?void 0:i}function Fe(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Fe))}function ht(e,s,n){for(var r=0;r<n.length;r++)Be(n[r],n[++r],n[++r]);A.__c&&A.__c(s,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){A.__e(a,o.__v)}})}function ut(e){return typeof e!="object"||e==null||e.__b>0?e:pe(e)?e.map(ut):ee({},e)}function Ts(e,s,n,r,o,a,l,i,c){var d,u,h,v,p,m,_,S=n.props||be,x=s.props,N=s.type;if(N=="svg"?o="http://www.w3.org/2000/svg":N=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(d=0;d<a.length;d++)if((p=a[d])&&"setAttribute"in p==!!N&&(N?p.localName==N:p.nodeType==3)){e=p,a[d]=null;break}}if(e==null){if(N==null)return document.createTextNode(x);e=document.createElementNS(o,N,x.is&&x),i&&(A.__m&&A.__m(s,a),i=!1),a=null}if(N==null)S===x||i&&e.data==x||(e.data=x);else{if(a=a&&ye.call(e.childNodes),!i&&a!=null)for(S={},d=0;d<e.attributes.length;d++)S[(p=e.attributes[d]).name]=p.value;for(d in S)p=S[d],d=="dangerouslySetInnerHTML"?h=p:d=="children"||d in x||d=="value"&&"defaultValue"in x||d=="checked"&&"defaultChecked"in x||Se(e,d,null,p,o);for(d in x)p=x[d],d=="children"?v=p:d=="dangerouslySetInnerHTML"?u=p:d=="value"?m=p:d=="checked"?_=p:i&&typeof p!="function"||S[d]===p||Se(e,d,p,S[d],o);if(u)i||h&&(u.__html==h.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),s.__k=[];else if(h&&(e.innerHTML=""),it(s.type=="template"?e.content:e,pe(v)?v:[v],s,n,r,N=="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,l,a?a[0]:n.__k&&de(n,0),i,c),a!=null)for(d=a.length;d--;)Ie(a[d]);i||(d="value",N=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||N=="progress"&&!m||N=="option"&&m!=S[d])&&Se(e,d,m,S[d],o),d="checked",_!=null&&_!=e[d]&&Se(e,d,_,S[d],o))}return e}function Be(e,s,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&s==null||(e.__u=e(s))}else e.current=s}catch(o){A.__e(o,n)}}function pt(e,s,n){var r,o;if(A.unmount&&A.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Be(r,null,s)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){A.__e(a,s)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&pt(r[o],s,n||typeof e.type!="function");n||Ie(e.__e),e.__c=e.__=e.__e=void 0}function Ls(e,s,n){return this.constructor(e,n)}function Es(e,s,n){var r,o,a,l;s==document&&(s=document.documentElement),A.__&&A.__(e,s),o=(r=!1)?null:s.__k,a=[],l=[],je(s,e=s.__k=Ne(O,null,[e]),o||be,be,s.namespaceURI,o?null:s.firstChild?ye.call(s.childNodes):null,a,o?o.__e:s.firstChild,r,l),ht(a,e,l)}ye=we.slice,A={__e:function(e,s,n,r){for(var o,a,l;s=s.__;)if((o=s.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),l=o.__d),l)return o.__E=o}catch(i){e=i}throw e}},et=0,te.prototype.setState=function(e,s){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ee({},this.state),typeof e=="function"&&(e=e(ee({},n),this.props)),e&&ee(n,e),e!=null&&this.__v&&(s&&this._sb.push(s),lt(this))},te.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),lt(this))},te.prototype.render=O,oe=[],st=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,nt=function(e,s){return e.__v.__b-s.__v.__b},ke.__r=0,rt=/(PointerCapture)$|Capture$/i,Me=0,De=dt(!1),Oe=dt(!0);var As=0;function t(e,s,n,r,o,a){s||(s={});var l,i,c=s;if("ref"in c)for(i in c={},s)i=="ref"?l=s[i]:c[i]=s[i];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--As,__i:-1,__u:0,__source:o,__self:a};if(typeof e=="function"&&(l=e.defaultProps))for(i in l)c[i]===void 0&&(c[i]=l[i]);return A.vnode&&A.vnode(d),d}var fe,F,Ue,ft,me=0,mt=[],U=A,vt=U.__b,_t=U.__r,gt=U.diffed,yt=U.__c,bt=U.unmount,wt=U.__;function He(e,s){U.__h&&U.__h(F,e,me||s),me=0;var n=F.__H||(F.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function $(e){return me=1,Rs(kt,e)}function Rs(e,s,n){var r=He(fe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(s):kt(void 0,s),function(i){var c=r.__N?r.__N[0]:r.__[0],d=r.t(c,i);c!==d&&(r.__N=[d,r.__[1]],r.__c.setState({}))}],r.__c=F,!F.__f)){var o=function(i,c,d){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(v){return v.__c});if(u.every(function(v){return!v.__N}))return!a||a.call(this,i,c,d);var h=r.__c.props!==i;return u.some(function(v){if(v.__N){var p=v.__[0];v.__=v.__N,v.__N=void 0,p!==v.__[0]&&(h=!0)}}),a&&a.call(this,i,c,d)||h};F.__f=!0;var a=F.shouldComponentUpdate,l=F.componentWillUpdate;F.componentWillUpdate=function(i,c,d){if(this.__e){var u=a;a=void 0,o(i,c,d),a=u}l&&l.call(this,i,c,d)},F.shouldComponentUpdate=o}return r.__N||r.__}function W(e,s){var n=He(fe++,3);!U.__s&&xt(n.__H,s)&&(n.__=e,n.u=s,F.__H.__h.push(n))}function H(e){return me=5,z(function(){return{current:e}},[])}function z(e,s){var n=He(fe++,7);return xt(n.__H,s)&&(n.__=e(),n.__H=s,n.__h=e),n.__}function R(e,s){return me=8,z(function(){return e},s)}function qs(){for(var e;e=mt.shift();){var s=e.__H;if(e.__P&&s)try{s.__h.some(Ce),s.__h.some(ze),s.__h=[]}catch(n){s.__h=[],U.__e(n,e.__v)}}}U.__b=function(e){F=null,vt&&vt(e)},U.__=function(e,s){e&&s.__k&&s.__k.__m&&(e.__m=s.__k.__m),wt&&wt(e,s)},U.__r=function(e){_t&&_t(e),fe=0;var s=(F=e.__c).__H;s&&(Ue===F?(s.__h=[],F.__h=[],s.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(s.__h.some(Ce),s.__h.some(ze),s.__h=[],fe=0)),Ue=F},U.diffed=function(e){gt&&gt(e);var s=e.__c;s&&s.__H&&(s.__H.__h.length&&(mt.push(s)!==1&&ft===U.requestAnimationFrame||((ft=U.requestAnimationFrame)||Ps)(qs)),s.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Ue=F=null},U.__c=function(e,s){s.some(function(n){try{n.__h.some(Ce),n.__h=n.__h.filter(function(r){return!r.__||ze(r)})}catch(r){s.some(function(o){o.__h&&(o.__h=[])}),s=[],U.__e(r,n.__v)}}),yt&&yt(e,s)},U.unmount=function(e){bt&&bt(e);var s,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{Ce(r)}catch(o){s=o}}),n.__H=void 0,s&&U.__e(s,n.__v))};var Nt=typeof requestAnimationFrame=="function";function Ps(e){var s,n=function(){clearTimeout(r),Nt&&cancelAnimationFrame(s),setTimeout(e)},r=setTimeout(n,35);Nt&&(s=requestAnimationFrame(n))}function Ce(e){var s=F,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),F=s}function ze(e){var s=F;e.__c=e.__(),F=s}function xt(e,s){return!e||e.length!==s.length||s.some(function(n,r){return n!==e[r]})}function kt(e,s){return typeof s=="function"?s(e):s}function Ms(e,s){for(var n in s)e[n]=s[n];return e}function $t(e,s){for(var n in e)if(n!=="__source"&&!(n in s))return!0;for(var r in s)if(r!=="__source"&&e[r]!==s[r])return!0;return!1}function St(e,s){this.props=e,this.context=s}(St.prototype=new te).isPureReactComponent=!0,St.prototype.shouldComponentUpdate=function(e,s){return $t(this.props,e)||$t(this.state,s)};var Ct=A.__b;A.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ct&&Ct(e)};var Ds=A.__e;A.__e=function(e,s,n,r){if(e.then){for(var o,a=s;a=a.__;)if((o=a.__c)&&o.__c)return s.__e==null&&(s.__e=n.__e,s.__k=n.__k),o.__c(e,s)}Ds(e,s,n,r)};var Tt=A.unmount;function Lt(e,s,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Ms({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=s),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Lt(r,s,n)})),e}function Et(e,s,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Et(r,s,n)}),e.__c&&e.__c.__P===s&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Te(){this.__u=0,this.o=null,this.__b=null}function At(e){if(!e.__)return null;var s=e.__.__c;return s&&s.__a&&s.__a(e)}function G(e){var s,n,r,o=null;function a(l){if(s||(s=e()).then(function(i){i&&(o=i.default||i),r=!0},function(i){n=i,r=!0}),n)throw n;if(!r)throw s;return o?Ne(o,l):null}return a.displayName="Lazy",a.__f=!0,a}function Le(){this.i=null,this.l=null}A.unmount=function(e){var s=e.__c;s&&(s.__z=!0),s&&s.__R&&s.__R(),s&&32&e.__u&&(e.type=null),Tt&&Tt(e)},(Te.prototype=new te).__c=function(e,s){var n=s.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=At(r.__v),a=!1,l=function(){a||r.__z||(a=!0,n.__R=null,o?o(c):c())};n.__R=l;var i=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var d=r.state.__a;r.__v.__k[0]=Et(d,d.__c.__P,d.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.__P=i,u.forceUpdate()}};r.__u++||32&s.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(l,l)},Te.prototype.componentWillUnmount=function(){this.o=[]},Te.prototype.render=function(e,s){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Lt(this.__b,n,r.__O=r.__P)}this.__b=null}var o=s.__a&&Ne(O,null,e.fallback);return o&&(o.__u&=-33),[Ne(O,null,s.__a?null:e.children),o]};var Rt=function(e,s,n){if(++n[1]===n[0]&&e.l.delete(s),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Le.prototype=new te).__a=function(e){var s=this,n=At(s.__v),r=s.l.get(e);return r[0]++,function(o){var a=function(){s.props.revealOrder?(r.push(o),Rt(s,e,r)):o()};n?n(a):a()}},Le.prototype.render=function(e){this.i=null,this.l=new Map;var s=$e(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&s.reverse();for(var n=s.length;n--;)this.l.set(s[n],this.i=[1,0,this.i]);return e.children},Le.prototype.componentDidUpdate=Le.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(s,n){Rt(e,n,s)})};var Os=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Is=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,js=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Fs=/[A-Z0-9]/g,Bs=typeof document<"u",Us=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};te.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(te.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(s){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:s})}})});var qt=A.event;function Hs(){}function zs(){return this.cancelBubble}function Vs(){return this.defaultPrevented}A.event=function(e){return qt&&(e=qt(e)),e.persist=Hs,e.isPropagationStopped=zs,e.isDefaultPrevented=Vs,e.nativeEvent=e};var Ws={enumerable:!1,configurable:!0,get:function(){return this.class}},Pt=A.vnode;A.vnode=function(e){typeof e.type=="string"&&(function(s){var n=s.props,r=s.type,o={},a=r.indexOf("-")===-1;for(var l in n){var i=n[l];if(!(l==="value"&&"defaultValue"in n&&i==null||Bs&&l==="children"&&r==="noscript"||l==="class"||l==="className")){var c=l.toLowerCase();l==="defaultValue"&&"value"in n&&n.value==null?l="value":l==="download"&&i===!0?i="":c==="translate"&&i==="no"?i=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?l="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||Us(n.type)?c==="onfocus"?l="onfocusin":c==="onblur"?l="onfocusout":js.test(l)&&(l=c):c=l="oninput":a&&Is.test(l)?l=l.replace(Fs,"-$&").toLowerCase():i===null&&(i=void 0),c==="oninput"&&o[l=c]&&(l="oninputCapture"),o[l]=i}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=$e(n.children).forEach(function(d){d.props.selected=o.value.indexOf(d.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=$e(n.children).forEach(function(d){d.props.selected=o.multiple?o.defaultValue.indexOf(d.props.value)!=-1:o.defaultValue==d.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Ws)):n.className&&(o.class=o.className=n.className),s.props=o})(e),e.$$typeof=Os,Pt&&Pt(e)};var Mt=A.__r;A.__r=function(e){Mt&&Mt(e),e.__c};var Dt=A.diffed;A.diffed=function(e){Dt&&Dt(e);var s=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in s&&s.value!==n.value&&(n.value=s.value==null?"":s.value)};var Ve={Fragment:O};const I={queries:{viewBox:"0 0 24 24",elements:['<ellipse cx="12" cy="5" rx="9" ry="3"/>','<path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/>','<path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>']},events:{viewBox:"0 0 24 24",elements:['<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>']},emails:{viewBox:"0 0 24 24",elements:['<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>','<polyline points="22,6 12,13 2,6"/>']},routes:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<line x1="2" y1="12" x2="22" y2="12"/>','<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>']},logs:{viewBox:"0 0 24 24",elements:['<line x1="8" y1="6" x2="21" y2="6"/>','<line x1="8" y1="12" x2="21" y2="12"/>','<line x1="8" y1="18" x2="21" y2="18"/>','<line x1="3" y1="6" x2="3.01" y2="6"/>','<line x1="3" y1="12" x2="3.01" y2="12"/>','<line x1="3" y1="18" x2="3.01" y2="18"/>']},timeline:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},cache:{viewBox:"0 0 24 24",elements:['<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/>','<rect x="2" y="14" width="20" height="8" rx="2" ry="2"/>','<line x1="6" y1="6" x2="6.01" y2="6"/>','<line x1="6" y1="18" x2="6.01" y2="18"/>']},jobs:{viewBox:"0 0 24 24",elements:['<rect x="2" y="7" width="20" height="14" rx="2" ry="2"/>','<path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/>']},config:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="3"/>','<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>']},internals:{viewBox:"0 0 24 24",elements:['<rect x="4" y="4" width="16" height="16" rx="2"/>','<rect x="9" y="9" width="6" height="6"/>','<line x1="9" y1="1" x2="9" y2="4"/>','<line x1="15" y1="1" x2="15" y2="4"/>','<line x1="9" y1="20" x2="9" y2="23"/>','<line x1="15" y1="20" x2="15" y2="23"/>','<line x1="20" y1="9" x2="23" y2="9"/>','<line x1="20" y1="14" x2="23" y2="14"/>','<line x1="1" y1="9" x2="4" y2="9"/>','<line x1="1" y1="14" x2="4" y2="14"/>']},overview:{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="7" height="7"/>','<rect x="14" y="3" width="7" height="7"/>','<rect x="14" y="14" width="7" height="7"/>','<rect x="3" y="14" width="7" height="7"/>']},requests:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},"dashboard-timeline":{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<polyline points="12 6 12 12 16 14"/>']},"custom-pane":{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="18" height="18" rx="2"/>','<path d="M9 3v18"/>']},wrench:{viewBox:"0 0 24 24",elements:['<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>']},"external-link":{viewBox:"0 0 24 24",elements:['<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>','<polyline points="15 3 21 3 21 9"/>','<line x1="10" y1="14" x2="21" y2="3"/>']},sun:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="5"/>','<line x1="12" y1="1" x2="12" y2="3"/>','<line x1="12" y1="21" x2="12" y2="23"/>','<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>','<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>','<line x1="1" y1="12" x2="3" y2="12"/>','<line x1="21" y1="12" x2="23" y2="12"/>','<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>','<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>']},moon:{viewBox:"0 0 24 24",elements:['<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>']},search:{viewBox:"0 0 24 24",elements:['<circle cx="11" cy="11" r="8"/>','<line x1="21" y1="21" x2="16.65" y2="16.65"/>']},eye:{viewBox:"0 0 24 24",elements:['<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>','<circle cx="12" cy="12" r="3"/>']},"eye-off":{viewBox:"0 0 24 24",elements:['<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/>','<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/>','<line x1="1" y1="1" x2="23" y2="23"/>','<path d="M14.12 14.12a3 3 0 1 1-4.24-4.24"/>']},"chevron-right":{viewBox:"0 0 24 24",elements:['<path d="M9 18l6-6-6-6"/>']},"chevron-left":{viewBox:"0 0 24 24",elements:['<path d="M15 18l-6-6 6-6"/>']},"open-external":{viewBox:"0 0 16 16",elements:['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']}};async function Ks(){if(typeof window<"u"&&window.Transmit&&typeof window.Transmit=="function")return window.Transmit;try{const e=await import("@adonisjs/transmit-client");return e.Transmit??e.default??null}catch{return null}}function Js(e){let s=null,n=null,r=!1;return{subscribe:async()=>{try{const l=await Ks();if(!l)throw new Error("Transmit client not available (neither window.Transmit nor @adonisjs/transmit-client)");if(r)return;s=new l({baseUrl:e.baseUrl||window.location.origin,...e.authToken?{beforeSubscribe(i){return{headers:{Authorization:`Bearer ${e.authToken}`}}},beforeUnsubscribe(i){return{headers:{Authorization:`Bearer ${e.authToken}`}}}}:{}}),n=s.subscription(e.channelName),n.onMessage(i=>{r||e.onMessage(i)}),await n.create()}catch(l){e.onError&&e.onError(l)}},unsubscribe:async()=>{r=!0;try{n&&(await n.delete(),n=null),s&&(s=null)}catch{}}}}function Qs(e){let s=!1;const n=Js({baseUrl:e.baseUrl,channelName:e.channelName,authToken:e.authToken,onMessage:e.onMessage,onError:r=>{s=!0,e.onError?.(r),e.onDisconnect?.()}});return n.subscribe().then(()=>{s||e.onConnect?.()}).catch(r=>{e.onError?.(r),e.onDisconnect?.()}),{unsubscribe:()=>{n.unsubscribe().catch(()=>{})}}}class We extends Error{status;constructor(s=403){super(`Unauthorized (HTTP ${s})`),this.name="UnauthorizedError",this.status=s}}class Gs extends Error{status;body;constructor(s,n){super(`API error (HTTP ${s})`),this.name="ApiError",this.status=s,this.body=n}}class Ke{baseUrl;authToken;constructor(s){this.baseUrl=s.baseUrl.replace(/\/+$/,""),this.authToken=s.authToken}async fetch(s,n){const o={...{Accept:"application/json",...this.authToken?{Authorization:`Bearer ${this.authToken}`}:{}},...n?.headers},a=await globalThis.fetch(`${this.baseUrl}${s}`,{...n,headers:o,credentials:this.authToken?"omit":"include"});if(n?.signal?.aborted)throw new DOMException("The operation was aborted.","AbortError");if(a.status===401||a.status===403)throw new We(a.status);if(!a.ok){const l=await a.text().catch(()=>"");throw new Gs(a.status,l)}return a.json()}async get(s,n){const r=n?`${s}?${n}`:s;return this.fetch(r)}async post(s,n){const r={method:"POST",...n!==void 0?{body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}:{}};return this.fetch(s,r)}async delete(s){return this.fetch(s,{method:"DELETE"})}}const Ys=5e3,Ot=1e4,It=100,Zs=500,Xs={overview:"/overview",requests:"/requests",queries:"/queries",events:"/events",routes:"/routes",logs:"/logs",emails:"/emails",timeline:"/traces",cache:"/cache",jobs:"/jobs",config:"/config"};function en(e){return Xs[e]||`/${e}`}class tn{constructor(s,n){this.client=s,this.basePath=n}async fetchSection(s,n,r){const o=en(s),a=n?`${this.basePath}${o}?${n}`:`${this.basePath}${o}`;return this.client.fetch(a,r)}async fetchChart(s){return this.client.fetch(`${this.basePath}/overview/chart?range=${s}`)}async fetchGroupedQueries(){return this.client.fetch(`${this.basePath}/queries/grouped`)}async explainQuery(s){return this.client.fetch(`${this.basePath}/queries/${s}/explain`)}async retryJob(s){return this.client.fetch(`${this.basePath}/jobs/${s}/retry`,{method:"POST"})}async fetchCacheKey(s){return this.client.fetch(`${this.basePath}/cache/${encodeURIComponent(s)}`)}async deleteCacheKey(s){return this.client.fetch(`${this.basePath}/cache/${encodeURIComponent(s)}`,{method:"DELETE"})}async fetchEmailPreview(s){return this.client.fetch(`${this.basePath}/emails/${s}/preview`)}}function sn(e){const s=new URLSearchParams;if(e.page!==null&&e.page!==void 0&&s.set("page",String(e.page)),e.perPage!==null&&e.perPage!==void 0&&s.set("perPage",String(e.perPage)),e.search&&s.set("search",e.search),e.sort&&s.set("sort",e.sort),e.sortDir&&s.set("direction",e.sortDir),e.timeRange&&s.set("range",e.timeRange),e.filters)for(const[n,r]of Object.entries(e.filters))r&&s.set(n,r);return s.toString()}function nn(e,s,n=2){if(s<=1)return[1];const r=[],o=Math.max(2,e-n),a=Math.min(s-1,e+n);r.push(1),o>2&&r.push("...");for(let l=o;l<=a;l++)r.push(l);return a<s-1&&r.push("..."),s>1&&r.push(s),r}class rn{client;api;callbacks;endpoint;perPage;section;page=1;search;sort;sortDir;filters;timeRange;timer=null;fetchId=0;explicitFetchPending=!1;hasFetched=!1;stopped=!1;abortController=null;constructor(s){this.client=new Ke({baseUrl:s.baseUrl,authToken:s.authToken}),this.api=new tn(this.client,s.endpoint),this.endpoint=s.endpoint,this.section=s.section,this.perPage=s.perPage,this.callbacks=s.callbacks}start(){this.stopped=!1,this.fetch(!1),this.startRefreshTimer()}stop(){this.stopped=!0,this.stopRefreshTimer(),this.abortController?.abort(),this.abortController=null}async fetch(s=!0){if(s&&this.explicitFetchPending)return;this.abortController?.abort();const n=new AbortController;this.abortController=n;const r=++this.fetchId,o=this.section;if(!o)return;const a=this.filters,l=this.sort?this.sort.replace(/[A-Z]/g,c=>"_"+c.toLowerCase()):void 0,i=sn({page:this.page,perPage:this.perPage,search:this.search,sort:l,sortDir:this.sort?this.sortDir:void 0,filters:a&&Object.keys(a).length>0?a:void 0,timeRange:o.startsWith("overview")?this.timeRange:void 0});s||(this.callbacks.onLoading(!0),this.explicitFetchPending=!0);try{const c=await this.api.fetchSection(o,i||void 0,{signal:n.signal});if(r!==this.fetchId||this.stopped)return;if(c&&typeof c=="object"&&c.data!==void 0&&c.meta!==void 0){const d=c;this.callbacks.onData(d.data),this.callbacks.onPagination(d.meta)}else this.callbacks.onData(c),this.callbacks.onPagination(null);this.callbacks.onError(null),this.callbacks.onLoading(!1),this.hasFetched=!0}catch(c){if(c instanceof DOMException&&c.name==="AbortError"||n.signal.aborted||r!==this.fetchId||this.stopped)return;if(c instanceof We){this.callbacks.onError(c),this.callbacks.onLoading(!1),this.stopRefreshTimer(),this.callbacks.onUnauthorized();return}s||(this.callbacks.onError(c instanceof Error?c:new Error(String(c))),this.callbacks.onLoading(!1))}finally{s||(this.explicitFetchPending=!1)}}setSection(s){this.section!==s&&(this.section=s,this.page=1,this.search=void 0,this.sort=void 0,this.sortDir=void 0,this.filters=void 0,this.hasFetched=!1,this.callbacks.onData(null),this.callbacks.onPagination(null),this.callbacks.onLoading(!0),this.callbacks.onError(null),this.fetch(!1),this.startRefreshTimer())}setPage(s){this.page=s,this.fetch(!1)}setSearch(s){this.search=s||void 0,this.page=1,this.fetch(!1)}setFilter(s,n){this.filters||(this.filters={}),this.filters[s]=String(n),this.page=1,this.fetch(!1)}setSort(s,n){this.sort===s&&!n?this.sortDir=this.sortDir==="asc"?"desc":"asc":(this.sort=s,this.sortDir=n||"desc"),this.fetch(!1)}setTimeRange(s){this.timeRange=s,this.fetch(!1)}async mutate(s,n="post",r){const o=`${this.endpoint}/${s}`;try{const a=n==="post"?await this.client.post(o,r):await this.client.delete(o);return await this.fetch(!0),a}catch(a){throw a instanceof Error?a:new Error(String(a))}}configure(s){s.page!==void 0&&(this.page=s.page),s.perPage!==void 0&&(this.perPage=s.perPage),this.search=s.search,this.sort=s.sort,this.sortDir=s.sortDir,this.filters=s.filters,this.timeRange=s.timeRange}hasData(){return this.hasFetched}handleRefreshSignal(){this.hasFetched&&this.fetch(!0)}getApi(){return this.api}getClient(){return this.client}startRefreshTimer(){this.stopRefreshTimer();const s=this.section==="overview"?Ys:Ot;this.timer=setInterval(()=>this.fetch(!0),s)}stopRefreshTimer(){this.timer&&(clearInterval(this.timer),this.timer=null)}}function J(e,s={}){const{baseUrl:n="",dashboardEndpoint:r="/__stats/api",authToken:o,page:a=1,perPage:l=50,search:i,sort:c,sortDir:d,filters:u,timeRange:h,refreshKey:v}=s,[p,m]=$(null),[_,S]=$(null),[x,N]=$(!0),[f,k]=$(null),b=H(null),L=H(e),q=H(!1);b.current||(b.current=new rn({baseUrl:n,endpoint:r,authToken:o,section:e,perPage:l,callbacks:{onData:E=>m(E),onPagination:E=>S(E),onLoading:E=>N(E),onError:E=>k(E),onUnauthorized:()=>{}}})),W(()=>{const E=b.current,T=L.current!==e;return L.current=e,E.configure({page:a,perPage:l,search:i,sort:c,sortDir:d,filters:u,timeRange:h}),T||!q.current?(T?E.setSection(e):E.start(),q.current=!0):E.fetch(!0),()=>{E.stop()}},[e,a,l,i,c,d,u,h,v]);const D=R(()=>{b.current?.fetch(!0)},[]),P=R(async(E,T="post",M)=>b.current.mutate(E,T,M),[]),j=R(()=>b.current.getApi(),[]);return{data:p,meta:_,isLoading:x,error:f,refresh:D,mutate:P,getApi:j}}const jt="/admin/api/debug",Ft={tracing:!1,process:!1,system:!1,http:!1,db:!1,redis:!1,queues:!1,cache:!1,app:!1,log:!1,emails:!1,dashboard:!1,customPanes:[]};function an(e){return{tracing:e.features?.tracing??!1,process:e.features?.process??!1,system:e.features?.system??!1,http:e.features?.http??!1,db:e.features?.db??!1,redis:e.features?.redis??!1,queues:e.features?.queues??!1,cache:e.features?.cache??!1,app:e.features?.app??!1,log:e.features?.log??!1,emails:e.features?.emails??!1,dashboard:e.features?.dashboard??!1,customPanes:e.customPanes??[]}}async function ln(e,s=jt){const n=`${s.replace(/\/+$/,"")}/config`;return e.fetch(n)}async function on(e){const{baseUrl:s="",debugEndpoint:n=jt,authToken:r}=e,o=new Ke({baseUrl:s,authToken:r});try{const a=await ln(o,n);return an(a)}catch{return Ft}}function cn(e={}){const{baseUrl:s="",debugEndpoint:n="/admin/api/debug",authToken:r}=e,[o,a]=$(Ft),[l,i]=$(!0),[c,d]=$(null),u=H(!1);return W(()=>{if(u.current)return;u.current=!0;let h=!1;return(async()=>{try{const p=await on({baseUrl:s,debugEndpoint:n,authToken:r});h||(a(p),i(!1))}catch(p){h||(d(p instanceof Error?p:new Error(String(p))),i(!1))}})(),()=>{h=!0}},[s,n,r]),{features:o,isLoading:l,error:c}}const Ee="ss-dash-theme",Je="ss-theme-change";function Ae(){if(typeof window>"u")return"light";const e=localStorage.getItem(Ee);return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function dn(e){typeof window>"u"||(localStorage.setItem(Ee,e),window.dispatchEvent(new CustomEvent(Je,{detail:e})))}function hn(){const s=Ae()==="dark"?"light":"dark";return dn(s),s}function Bt(e){if(typeof window>"u")return()=>{};const s=a=>{const l=a.detail;(l==="dark"||l==="light")&&e(l)},n=a=>{if(a.key===Ee){const l=a.newValue;e(l==="dark"||l==="light"?l:Ae())}},r=window.matchMedia("(prefers-color-scheme: dark)"),o=a=>{localStorage.getItem(Ee)||e(a.matches?"dark":"light")};return window.addEventListener(Je,s),window.addEventListener("storage",n),r.addEventListener("change",o),()=>{window.removeEventListener(Je,s),window.removeEventListener("storage",n),r.removeEventListener("change",o)}}function un(){const[e,s]=$(()=>Ae());W(()=>Bt(o=>{s(o)}),[]);const n=R(()=>{const r=hn();return s(r),r},[]);return{theme:e,toggleTheme:n}}function pn({theme:e,onToggle:s,className:n="",classPrefix:r="ss-dash"}){const o=e==="dark";return t("button",{type:"button",className:`${r==="ss-dbg"?"ss-dbg-theme-toggle":"ss-dash-theme-btn"} ${n}`,onClick:s,title:o?"Switch to light theme":"Switch to dark theme","aria-label":o?"Switch to light theme":"Switch to dark theme",children:o?t("svg",{width:"16",height:"16",viewBox:I.sun.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:I.sun.elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:I.moon.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:I.moon.elements.join("")}})})}const fn=["overview","requests","queries","events","routes","logs","emails","cache","jobs","config","internals"],mn=G(()=>Promise.resolve().then(()=>Un)),vn=G(()=>Promise.resolve().then(()=>er)),_n=G(()=>Promise.resolve().then(()=>nr)),gn=G(()=>Promise.resolve().then(()=>rr)),yn=G(()=>Promise.resolve().then(()=>ar)),bn=G(()=>Promise.resolve().then(()=>lr)),wn=G(()=>Promise.resolve().then(()=>ir)),Nn=G(()=>Promise.resolve().then(()=>or)),xn=G(()=>Promise.resolve().then(()=>pr)),kn=G(()=>Promise.resolve().then(()=>wr)),$n=G(()=>Promise.resolve().then(()=>Pr));function Sn(e){const{baseUrl:s="",dashboardEndpoint:n="/__stats/api",debugEndpoint:r,authToken:o,backUrl:a="/",channelName:l="server-stats/dashboard"}=e,{features:i}=cn({baseUrl:s,debugEndpoint:r,authToken:o}),{theme:c,toggleTheme:d}=un(),[u,h]=$("overview"),[v,p]=$(()=>typeof window>"u"?!1:localStorage.getItem("ss-dash-sidebar")==="collapsed"),[m,_]=$(!1),[S,x]=$(0),N=H(0);W(()=>{if(!l)return;const T=Qs({baseUrl:s,channelName:l,authToken:o,onMessage:()=>{N.current+=1,x(N.current)},onConnect:()=>_(!0),onDisconnect:()=>_(!1),onError:()=>_(!1)});return()=>T.unsubscribe()},[s,l,o]);const f=i.customPanes||[],k=R(T=>{const M=T.replace("#","").split("?")[0];return M&&[...fn,...f.map(w=>w.id)].includes(M)?M:"overview"},[f]);W(()=>{if(typeof window>"u")return;const T=k(window.location.hash);(T!=="overview"||window.location.hash)&&h(T)},[k]),W(()=>{const T=()=>{const M=k(window.location.hash);M!==u&&h(M)};return window.addEventListener("hashchange",T),()=>window.removeEventListener("hashchange",T)},[u,k]),W(()=>{typeof window>"u"||(window.location.hash=u)},[u]);const b=R(()=>{p(T=>{const M=!T;return localStorage.setItem("ss-dash-sidebar",M?"collapsed":"expanded"),M})},[]),L=z(()=>[{id:"overview",label:"Overview",visible:!0},{id:"requests",label:"Requests",visible:!0},{id:"queries",label:"Queries",visible:!0},{id:"events",label:"Events",visible:!0},{id:"routes",label:"Routes",visible:!0},{id:"logs",label:"Logs",visible:!0},{id:"emails",label:"Emails",visible:!0},{id:"cache",label:"Cache",visible:i.cache},{id:"jobs",label:"Jobs",visible:i.queues},{id:"config",label:"Config",visible:!0},{id:"internals",label:"Internals",visible:!0}],[i]),q=z(()=>L.filter(T=>T.visible),[L]),D=z(()=>({baseUrl:s,dashboardEndpoint:n,authToken:o,refreshKey:S}),[s,n,o,S]),{data:P}=J("overview",D),j=z(()=>{if(!P)return{};const T={};if(P.totalRequests>0&&(T.requests={count:P.totalRequests}),P.queryStats?.total>0&&(T.queries={count:P.queryStats.total}),P.logLevelBreakdown){const M=P.logLevelBreakdown,X=M.error+M.warn+M.info+M.debug;X>0&&(T.logs={count:X})}return T},[P]),E=R(()=>{const T={overview:t(mn,{options:D}),requests:t(vn,{options:D}),queries:t(_n,{options:D}),events:t(gn,{options:D}),routes:t(yn,{options:D}),logs:t(bn,{options:D}),emails:t(wn,{options:D}),cache:t(Nn,{options:D}),jobs:t(xn,{options:D}),config:t(kn,{options:D}),internals:t($n,{options:D,debugEndpoint:r})};return t("div",{className:"ss-dash-pane ss-dash-active",id:`ss-dash-pane-${u}`,children:t("div",{className:"ss-dash-pane-inner",children:t(Te,{fallback:t("div",{className:"ss-dash-empty",children:"Loading..."}),children:T[u]||t("div",{className:"ss-dash-empty",children:"Unknown section"})})})})},[u,D]);return t("div",{className:"ss-dash","data-theme":c,id:"ss-dash",children:[t("div",{className:"ss-dash-header",children:[t("div",{className:"ss-dash-header-left",children:[t("span",{className:"ss-dash-logo",children:"Server Stats"}),t("span",{className:"ss-dash-logo-sub",children:"Dashboard"})]}),t("div",{className:"ss-dash-header-center",children:[t("span",{className:`ss-dash-live-dot ${m?"ss-dash-connected":""}`,id:"ss-dash-live-dot"}),t("span",{className:`ss-dash-live-label ${m?"ss-dash-connected":""}`,id:"ss-dash-live-label",children:m?"Live":"Polling"})]}),t("div",{className:"ss-dash-header-right",children:[t(pn,{theme:c,onToggle:d}),a&&t("a",{href:a,className:"ss-dash-back-link",title:"Back to app",children:"← App"})]})]}),t("div",{className:"ss-dash-body",children:[t("div",{className:`ss-dash-sidebar ${v?"ss-dash-collapsed":""}`,id:"ss-dash-sidebar",children:[t("nav",{className:"ss-dash-nav",children:[q.map(T=>{const M=j[T.id];return t("button",{type:"button",className:`ss-dash-nav-item ${u===T.id?"ss-dash-active":""}`,"data-ss-section":T.id,onClick:()=>{T.id!==u&&h(T.id)},title:v?T.label:void 0,children:[t("span",{className:"ss-dash-nav-icon",children:t("svg",{width:"20",height:"20",viewBox:(I[T.id]||I.config).viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:(I[T.id]||I.config).elements.join("")}})}),t("span",{className:"ss-dash-nav-label",children:T.label}),M&&M.count>0&&t("span",{className:`ss-dash-nav-badge${M.variant?" "+M.variant:""}`,children:M.count})]},T.id)}),f.length>0&&t("div",{className:"ss-dash-nav-sep"}),f.map(T=>t("button",{type:"button",className:`ss-dash-nav-item ${u===T.id?"ss-dash-active":""}`,onClick:()=>h(T.id),title:v?T.label:void 0,children:[t("span",{className:"ss-dash-nav-icon",children:t("svg",{width:"20",height:"20",viewBox:I["custom-pane"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:I["custom-pane"].elements.join("")}})}),t("span",{className:"ss-dash-nav-label",children:T.label})]},T.id))]}),t("button",{type:"button",className:"ss-dash-sidebar-toggle",id:"ss-dash-sidebar-toggle",onClick:b,title:v?"Expand sidebar":"Collapse sidebar",children:v?t("svg",{width:"16",height:"16",viewBox:I["chevron-right"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"1.5",dangerouslySetInnerHTML:{__html:I["chevron-right"].elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:I["chevron-left"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"1.5",dangerouslySetInnerHTML:{__html:I["chevron-left"].elements.join("")}})})]}),t("div",{className:"ss-dash-main",children:E()})]})]})}function Cn(e){const s=document.getElementById(e);return s?JSON.parse(s.textContent||"{}"):{}}function Tn(){function e(s){document.documentElement.setAttribute("data-theme",s)}e(Ae()),Bt(e)}const he=Cn("ss-dash-config");Tn();const Ut=document.getElementById("ss-dash");Ut&&Es(t(Sn,{baseUrl:he.baseUrl,dashboardEndpoint:he.dashboardEndpoint,debugEndpoint:he.debugEndpoint,authToken:he.authToken,backUrl:he.backUrl,channelName:he.channelName}),Ut);function Ln(e){if(!e&&e!==0)return"-";const s=Math.floor(e),n=Math.floor(s/86400),r=Math.floor(s%86400/3600),o=Math.floor(s%3600/60);return n>0?`${n}d ${r}h`:r>0?`${r}h ${o}m`:o>0?`${o}m ${s%60}s`:`${s}s`}function ne(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:e>=1?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`}function Ht(e){return/([+-]\d{2}:?\d{2}|Z)\s*$/.test(e)?e:e+"Z"}function re(e){if(!e)return"-";const s=typeof e=="string"?new Date(Ht(e)):new Date(e);return Number.isNaN(s.getTime())?"-":s.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+String(s.getMilliseconds()).padStart(3,"0")}function Z(e){if(!e)return"-";const s=typeof e=="string"?new Date(Ht(e)).getTime():e,n=Math.floor((Date.now()-s)/1e3);return n<0?"just now":n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}function se(e){return e>Zs?"very-slow":e>It?"slow":"normal"}function Qe(e,s=100){if(e===null)return"null";if(e===void 0)return"-";if(typeof e=="string")return'"'+(e.length>40?e.slice(0,40)+"...":e)+'"';if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){if(e.length===0)return"[]";const r="["+e.slice(0,3).map(o=>Qe(o,30)).join(", ")+(e.length>3?", ..."+e.length+" items":"")+"]";return r.length>s?"["+e.length+" items]":r}if(typeof e=="object"){const n=Object.keys(e);if(n.length===0)return"{}";const r=[];for(let a=0;a<Math.min(n.length,4);a++)r.push(n[a]+": "+Qe(e[n[a]],30));const o="{ "+r.join(", ")+(n.length>4?", ...+"+(n.length-4):"")+" }";return o.length>s?"{ "+n.slice(0,6).join(", ")+(n.length>6?", ...":"")+" }":o}return String(e)}function En(e){return e<0?"no expiry":e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h`:`${Math.floor(e/86400)}d`}function An(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}const Rn={color:"#34d399",fillOpacityTop:.25,fillOpacityBottom:.02,strokeWidth:1.5,width:120,height:32,padding:2};function qn(e){return{...Rn,...e}}let Pn=0;function Mn(){return`ss-grad-${Pn++}`}function Dn(e){if(e.length===0)return null;let s=e[0],n=e[0],r=e[0];for(let o=1;o<e.length;o++){const a=e[o];a<s&&(s=a),a>n&&(n=a),r+=a}return{min:s,max:n,avg:r/e.length}}function On(e,s){if(e.length<2)return null;const n=qn(s),r=Dn(e),o=r.max-r.min||1,a=n.width-n.padding*2,l=n.height-n.padding*2,i=n.padding,c=e.length,d=Array.from({length:c});for(let _=0;_<c;_++){const S=i+_/(c-1)*a,x=i+l-(e[_]-r.min)/o*l;d[_]=`${S.toFixed(1)},${x.toFixed(1)}`}const u=d.join(" "),h=(i+a).toFixed(1),v=(i+l).toFixed(1),p=i.toFixed(1),m=`M${d[0]} `+d.slice(1).map(_=>`L${_}`).join(" ")+` L${h},${v} L${p},${v} Z`;return{points:u,areaPath:m,gradientId:Mn(),options:n,stats:r}}function Re({data:e,color:s="#34d399",width:n=120,height:r=32,className:o=""}){const a=z(()=>On(e,{width:n,height:r}),[e,n,r]),l=z(()=>"ss-grad-"+Math.random().toString(36).slice(2,8),[]),i={"--ss-accent":s};if(!a)return t("div",{className:`ss-dash-sparkline ${o}`,style:i,children:t("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,style:{display:"block"},children:t("text",{x:n/2,y:r/2+3,textAnchor:"middle",fill:"#737373",fontSize:"9",children:["collecting","…"]})})});const c=s||"var(--ss-accent)";return t("div",{className:`ss-dash-sparkline ${o}`,style:i,children:t("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,style:{display:"block"},children:[t("defs",{children:t("linearGradient",{id:l,x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:c,stopOpacity:"0.25"}),t("stop",{offset:"100%",stopColor:c,stopOpacity:"0.02"})]})}),t("path",{d:a.areaPath,fill:`url(#${l})`}),t("path",{className:"ss-dash-sparkline-line",d:"M"+a.points.replace(/ /g," L"),fill:"none",stroke:c,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})]})})}const In=[{value:"5m",label:"5m"},{value:"15m",label:"15m"},{value:"30m",label:"30m"},{value:"1h",label:"1h"},{value:"6h",label:"6h"},{value:"24h",label:"24h"},{value:"7d",label:"7d"}];function jn({value:e,onChange:s,className:n=""}){return t("div",{className:`ss-dash-btn-group ${n}`,children:In.map(r=>t("button",{type:"button",className:`ss-dash-btn ${e===r.value?"ss-dash-active":""}`,onClick:()=>s(r.value),children:r.label},r.value))})}function Fn(e,s){if(e<=0)return[0];const n=e/s,r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r;let a;o<=1?a=r:o<=2?a=2*r:o<=5?a=5*r:a=10*r;const l=[];for(let i=a;i<=e+a*.5;i+=a)l.push(Math.round(i));return l.length===0&&l.push(Math.ceil(e)),l}function zt(e){try{return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"})}catch{return""}}function Vt(e){if(e.length===0)return"";if(e.length===1)return`M${e[0].x},${e[0].y}`;let s=`M${e[0].x.toFixed(1)},${e[0].y.toFixed(1)}`;for(let n=0;n<e.length-1;n++){const r=e[n],o=e[n+1],a=(r.x+o.x)/2;s+=` C${a.toFixed(1)},${r.y.toFixed(1)} ${a.toFixed(1)},${o.y.toFixed(1)} ${o.x.toFixed(1)},${o.y.toFixed(1)}`}return s}function Wt(e){const s=se(e);return s==="very-slow"?"ss-dash-very-slow":s==="slow"?"ss-dash-slow":""}function Bn({chartPoints:e}){const s={top:12,right:12,bottom:28,left:38},n=220,r=H(null),[o,a]=$(0);W(()=>{const g=r.current;if(!g)return;a(g.clientWidth);const C=new ResizeObserver(B=>{for(const Y of B)a(Y.contentRect.width)});return C.observe(g),()=>C.disconnect()},[]);const l=o||600,i=l-s.left-s.right,c=n-s.top-s.bottom,d=s.top+c,u=e.map(g=>{const C=g;return(g.requestCount??0)+(Number(C.request_count)||0)||g.total||0}),h=e.map(g=>{const C=g;return(g.errorCount??0)+(Number(C.error_count)||0)}),v=Math.max(...u,1),p=Math.ceil(v*1.1),m=h.some(g=>g>0),_=Fn(p,4),S=_.length>0?_[_.length-1]:p,x=g=>s.left+g/Math.max(e.length-1,1)*i,N=g=>s.top+c-g/(S||1)*c,f=e.map((g,C)=>({x:x(C),y:N(u[C])})),k=e.map((g,C)=>({x:x(C),y:N(h[C])})),b=Vt(f),L=m?Vt(k):"",q=f.length>1?`${b} L${f[f.length-1].x.toFixed(1)},${d} L${f[0].x.toFixed(1)},${d} Z`:"",D=m&&k.length>1?`${L} L${k[k.length-1].x.toFixed(1)},${d} L${k[0].x.toFixed(1)},${d} Z`:"",P=Math.min(10,e.length),j=Math.max(1,Math.ceil(e.length/P)),[E,T]=$({visible:!1,x:0,idx:-1}),M=R(g=>{const C=f[g].x;T({visible:!0,x:C,idx:g})},[f]),X=R(()=>{T({visible:!1,x:0,idx:-1})},[]),w=120,y=E.visible?Math.max(w/2,Math.min(E.x,l-w/2)):0;return t("div",{ref:r,style:{position:"relative"},children:[t("svg",{viewBox:`0 0 ${l} ${n}`,className:"ss-dash-chart-svg",children:[t("defs",{children:[t("linearGradient",{id:"ss-cg-total",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:"var(--ss-accent)",stopOpacity:.3}),t("stop",{offset:"100%",stopColor:"var(--ss-accent)",stopOpacity:.02})]}),t("linearGradient",{id:"ss-cg-error",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:"var(--ss-red-fg)",stopOpacity:.35}),t("stop",{offset:"100%",stopColor:"var(--ss-red-fg)",stopOpacity:.02})]})]}),_.map(g=>{const C=N(g);return t("g",{children:[t("line",{x1:s.left,y1:C,x2:l-s.right,y2:C,stroke:"var(--ss-border-faint)",strokeWidth:.5,strokeDasharray:"3,3"}),t("text",{x:s.left-6,y:C,textAnchor:"end",fill:"var(--ss-dim)",fontSize:9,dominantBaseline:"middle",children:g})]},`ytick-${g}`)}),q&&t("path",{d:q,fill:"url(#ss-cg-total)"}),b&&t("path",{d:b,fill:"none",stroke:"var(--ss-accent)",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"}),D&&t("path",{d:D,fill:"url(#ss-cg-error)"}),L&&t("path",{d:L,fill:"none",stroke:"var(--ss-red-fg)",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:"4,2"}),e.map((g,C)=>{const B=u[C],Y=h[C],V=f[C].x,Q=f[C].y,ie=i/(e.length||1),ce=E.visible&&E.idx===C,xs=E.visible&&E.idx!==C;return t("g",{children:[t("rect",{x:V-ie/2,y:s.top,width:ie,height:c,fill:"transparent",className:"ss-dash-chart-hover-zone","data-idx":C,onMouseEnter:()=>M(C),onMouseLeave:X}),B>0&&t("circle",{cx:V,cy:Q,r:ce?4:2.5,fill:"var(--ss-accent)",stroke:"var(--ss-surface)",strokeWidth:1,className:"ss-dash-chart-dot","data-idx":C,opacity:xs?.3:1}),Y>0&&t("circle",{cx:V,cy:k[C].y,r:ce?3.5:2,fill:"var(--ss-red-fg)",stroke:"var(--ss-surface)",strokeWidth:1,className:"ss-dash-chart-dot ss-dash-chart-dot-err","data-idx":C,opacity:xs?.3:1})]},C)}),e.map((g,C)=>{if(C%j!==0&&C!==e.length-1)return null;const B=zt(g.bucket);return B?t("text",{x:x(C),y:n-6,textAnchor:"middle",fill:"var(--ss-dim)",fontSize:9,children:B},`xlabel-${C}`):null})]}),E.visible&&E.idx>=0&&t("div",{className:"ss-dash-chart-tooltip",style:{left:y,top:s.top-4,transform:"translate(-50%, -100%)"},children:[t("div",{children:zt(e[E.idx].bucket)}),t("div",{children:["Requests: ",u[E.idx]]}),h[E.idx]>0&&t("div",{style:{color:"var(--ss-red-fg)"},children:["Errors: ",h[E.idx]]})]})]})}function Kt({options:e={}}){const[s,n]=$("1h"),{data:r,isLoading:o}=J("overview",e),{data:a}=J("overview/chart",{...e,timeRange:s});if(o&&!r)return t("div",{className:"ss-dash-empty",children:"Loading overview..."});const l=r||{avgResponseTime:0,p95ResponseTime:0,requestsPerMinute:0,errorRate:0,totalRequests:0,slowestEndpoints:[],queryStats:{total:0,avgDuration:0,perRequest:0},recentErrors:[],topEvents:[],emailActivity:{sent:0,queued:0,failed:0},logLevelBreakdown:{error:0,warn:0,info:0,debug:0},cacheStats:null,jobQueueStatus:null,statusDistribution:{"2xx":0,"3xx":0,"4xx":0,"5xx":0},slowestQueries:[]},i=l,c=l.avgResponseTime||Number(i.avg_response_time)||0,d=l.p95ResponseTime||Number(i.p95_response_time)||0,u=l.requestsPerMinute||Number(i.requests_per_minute)||0,h=l.errorRate||Number(i.error_rate)||0,p=(l.totalRequests||Number(i.total_requests)||0)>0,m=a?.buckets||[],_=l.sparklines?.avgResponseTime??m.map(f=>f.avgDuration??0),S=l.sparklines?.p95ResponseTime??m.map(f=>f.p95Duration??0),x=l.sparklines?.requestsPerMinute??m.map(f=>f.requestCount??0),N=l.sparklines?.errorRate??m.map(f=>f.errorCount??0);return t("div",{className:"ss-dash-overview",children:[t("div",{className:"ss-dash-cards",children:[t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Avg Response Time"}),t("div",{className:`ss-dash-card-value ${p?c>500?"ss-dash-red":c>200?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?ne(c):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Re,{data:_,color:"#34d399",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"P95 Response Time"}),t("div",{className:`ss-dash-card-value ${p?d>500?"ss-dash-red":d>200?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?ne(d):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Re,{data:S,color:"#60a5fa",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Requests / min"}),t("div",{className:`ss-dash-card-value ${p?"ss-dash-accent":"ss-dash-dim"}`,children:p?u.toFixed(1):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Re,{data:x,color:"#34d399",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Error Rate"}),t("div",{className:`ss-dash-card-value ${p?h>5?"ss-dash-red":h>1?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?`${h.toFixed(1)}%`:"-"}),t("div",{className:"ss-dash-sparkline",children:t(Re,{data:N,color:"#f87171",width:160,height:40})})]})]}),t("div",{className:"ss-dash-chart-container",children:[t("div",{className:"ss-dash-chart-header",children:[t("span",{className:"ss-dash-chart-title",children:"Request Volume"}),t(jn,{value:s,onChange:n})]}),t("div",{className:"ss-dash-chart",id:"ss-dash-chart-area",children:m.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"120px"},children:"No data for this range"}):t(Bn,{chartPoints:m})}),t("div",{className:"ss-dash-chart-legend",id:"ss-dash-chart-legend",children:[t("span",{className:"ss-dash-chart-legend-item",children:[t("span",{className:"ss-dash-legend-dot",style:{background:"var(--ss-accent)"}}),"Requests"]}),m.some(f=>(f.errorCount??0)>0)&&t("span",{className:"ss-dash-chart-legend-item",children:[t("span",{className:"ss-dash-legend-dot",style:{background:"var(--ss-red-fg)"}}),"Errors"]})]})]}),t("div",{className:"ss-dash-secondary-cards",children:[t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#requests",className:"ss-dash-widget-link",children:"Slowest Endpoints"})}),l.slowestEndpoints.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No data yet"}):t("ul",{className:"ss-dash-secondary-list",children:l.slowestEndpoints.slice(0,5).map((f,k)=>{const b=f.url||f.pattern||"-";return t("li",{children:t("a",{href:`#requests?url=${encodeURIComponent(b)}`,className:"ss-dash-widget-row-link",children:[t("span",{title:b,children:b}),t("span",{className:`ss-dash-secondary-list-value ss-dash-duration ${Wt(f.avgDuration)}`,children:ne(f.avgDuration)})]})},k)})})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#queries",className:"ss-dash-widget-link",children:"Query Stats"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:[t("span",{children:"Total Queries"}),t("span",{className:"ss-dash-secondary-list-value",children:l.queryStats.total})]}),t("li",{children:[t("span",{children:"Avg Duration"}),t("span",{className:"ss-dash-secondary-list-value",children:ne(l.queryStats.avgDuration)})]}),t("li",{children:[t("span",{children:"Queries / Request"}),t("span",{className:"ss-dash-secondary-list-value",children:l.queryStats.perRequest.toFixed(1)})]})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#logs?level=error",className:"ss-dash-widget-link",children:"Recent Errors"})}),l.recentErrors.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No recent errors"}):t("ul",{className:"ss-dash-secondary-list",children:l.recentErrors.map((f,k)=>t("li",{children:t("a",{href:`#logs?id=${f.id??""}`,className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},title:f.message,children:f.message}),f.timestamp&&t("span",{className:"ss-dash-secondary-list-value",style:{color:"var(--ss-dim)"},title:re(f.timestamp),children:Z(f.timestamp)})]})},k))})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#events",className:"ss-dash-widget-link",children:"Top Events"})}),l.topEvents.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No events yet"}):t("ul",{className:"ss-dash-secondary-list",children:l.topEvents.slice(0,5).map((f,k)=>{const b=f.name||f.eventName||f.event_name||f.event||"";return t("li",{children:t("a",{href:`#events?event_name=${encodeURIComponent(b)}`,className:"ss-dash-widget-row-link",children:[t("span",{children:b}),t("span",{className:"ss-dash-secondary-list-value",children:f.count})]})},k)})})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#emails",className:"ss-dash-widget-link",children:"Email Activity"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#emails?status=sent",className:"ss-dash-widget-row-link",children:[t("span",{children:"Sent"}),t("span",{className:"ss-dash-secondary-list-value",children:l.emailActivity.sent})]})}),t("li",{children:t("a",{href:"#emails?status=queued",className:"ss-dash-widget-row-link",children:[t("span",{children:"Queued"}),t("span",{className:"ss-dash-secondary-list-value",children:l.emailActivity.queued})]})}),t("li",{children:t("a",{href:"#emails?status=failed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Failed"}),t("span",{className:"ss-dash-secondary-list-value",style:l.emailActivity.failed>0?{color:"var(--ss-red-fg)"}:void 0,children:l.emailActivity.failed})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#logs",className:"ss-dash-widget-link",children:"Log Levels"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#logs?level=error",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},children:"Error"}),t("span",{className:"ss-dash-secondary-list-value",children:l.logLevelBreakdown.error})]})}),t("li",{children:t("a",{href:"#logs?level=warn",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-amber-fg)"},children:"Warn"}),t("span",{className:"ss-dash-secondary-list-value",children:l.logLevelBreakdown.warn})]})}),t("li",{children:t("a",{href:"#logs?level=info",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-green-fg)"},children:"Info"}),t("span",{className:"ss-dash-secondary-list-value",children:l.logLevelBreakdown.info})]})}),t("li",{children:t("a",{href:"#logs?level=debug",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-dim)"},children:"Debug"}),t("span",{className:"ss-dash-secondary-list-value",children:l.logLevelBreakdown.debug})]})})]})]}),l.cacheStats&&l.cacheStats.available&&t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#cache",className:"ss-dash-widget-link",children:"Cache"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Keys"}),t("span",{className:"ss-dash-secondary-list-value",children:l.cacheStats.totalKeys})]})}),t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Hit Rate"}),t("span",{className:"ss-dash-secondary-list-value",children:[l.cacheStats.hitRate.toFixed(1),"%"]})]})}),t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Memory"}),t("span",{className:"ss-dash-secondary-list-value",children:l.cacheStats.memoryUsedHuman})]})})]})]}),l.jobQueueStatus&&l.jobQueueStatus.available&&t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#jobs",className:"ss-dash-widget-link",children:"Job Queue"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#jobs?status=active",className:"ss-dash-widget-row-link",children:[t("span",{children:"Active"}),t("span",{className:"ss-dash-secondary-list-value",children:l.jobQueueStatus.active})]})}),t("li",{children:t("a",{href:"#jobs?status=waiting",className:"ss-dash-widget-row-link",children:[t("span",{children:"Waiting"}),t("span",{className:"ss-dash-secondary-list-value",children:l.jobQueueStatus.waiting})]})}),t("li",{children:t("a",{href:"#jobs?status=failed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Failed"}),t("span",{className:"ss-dash-secondary-list-value",style:l.jobQueueStatus.failed>0?{color:"var(--ss-red-fg)"}:void 0,children:l.jobQueueStatus.failed})]})}),t("li",{children:t("a",{href:"#jobs?status=completed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Completed"}),t("span",{className:"ss-dash-secondary-list-value",children:l.jobQueueStatus.completed})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#requests",className:"ss-dash-widget-link",children:"Response Status"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#requests?status=2xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-green-fg)"},children:"2xx"}),t("span",{className:"ss-dash-secondary-list-value",children:l.statusDistribution["2xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=3xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-blue-fg)"},children:"3xx"}),t("span",{className:"ss-dash-secondary-list-value",children:l.statusDistribution["3xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=4xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-amber-fg)"},children:"4xx"}),t("span",{className:"ss-dash-secondary-list-value",children:l.statusDistribution["4xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=5xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},children:"5xx"}),t("span",{className:"ss-dash-secondary-list-value",children:l.statusDistribution["5xx"]})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#queries",className:"ss-dash-widget-link",children:"Slowest Queries"})}),l.slowestQueries.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No query data yet"}):t("ul",{className:"ss-dash-secondary-list",children:l.slowestQueries.slice(0,5).map((f,k)=>{const b=f.sqlNormalized||f.normalizedSql||f.sql_normalized||f.sql||"-";return t("li",{children:t("a",{href:`#queries?pattern=${encodeURIComponent(b)}`,className:"ss-dash-widget-row-link",children:[t("span",{title:b,children:b}),t("span",{className:`ss-dash-secondary-list-value ss-dash-duration ${Wt(f.avgDuration)}`,children:ne(f.avgDuration)})]})},k)})})]})]})]})}const Un=Object.freeze(Object.defineProperty({__proto__:null,OverviewSection:Kt,default:Kt},Symbol.toStringTag,{value:"Module"}));function Hn(e){const{container:s,handle:n,topPane:r,bottomPane:o,storageKey:a,minHeight:l=60}=e;if(a){const c=localStorage.getItem(a);if(c){const d=parseFloat(c);d>0&&d<1&&(r.style.flex=`${d}`,o.style.flex=`${1-d}`)}}function i(c){c.preventDefault(),n.setPointerCapture(c.pointerId);const u=s.getBoundingClientRect().height,h=c.clientY,v=r.getBoundingClientRect().height;function p(_){const S=_.clientY-h;let x=v+S;const N=u-l-n.offsetHeight;x=Math.max(l,Math.min(x,N));const f=x/(u-n.offsetHeight);r.style.flex=`${f}`,o.style.flex=`${1-f}`}function m(){if(n.removeEventListener("pointermove",p),n.removeEventListener("pointerup",m),a){const _=s.getBoundingClientRect().height-n.offsetHeight;if(_>0){const S=r.getBoundingClientRect().height/_;localStorage.setItem(a,String(S))}}}n.addEventListener("pointermove",p),n.addEventListener("pointerup",m)}return n.addEventListener("pointerdown",i),()=>{n.removeEventListener("pointerdown",i)}}function zn(e){if(!e)return[];if(typeof e=="string")try{return JSON.parse(e)}catch{return[]}return Array.isArray(e)?e:[]}function Vn(e){if(!e)return[];if(typeof e=="string")try{return JSON.parse(e)}catch{return[]}return Array.isArray(e)?e:[]}function Ge(e,s,n,r=0){return e[s]??e[n]??r}function Wn(e){return{method:e.method||"",url:e.url||"",statusCode:Ge(e,"status_code","statusCode"),totalDuration:Ge(e,"total_duration","totalDuration")||e.duration||0,spanCount:Ge(e,"span_count","spanCount"),spans:zn(e.spans),warnings:Vn(e.warnings),logs:e.logs||[],httpRequestId:e.httpRequestId||e.http_request_id||void 0}}function Jt(e="",s){const n=H(null);return R(()=>(n.current||(n.current=new Ke({baseUrl:e,authToken:s})),n.current),[e,s])}function Kn({color:e="muted",children:s,className:n="",classPrefix:r="ss-dash"}){return t("span",{className:`${r}-badge ${r}-badge-${e} ${n}`,children:s})}function Ye({method:e,className:s="",classPrefix:n="ss-dash"}){return t("span",{className:`${n}-method ${n}-method-${e.toLowerCase()} ${s}`,children:e})}function Qt({code:e,className:s="",classPrefix:n="ss-dash"}){let r=`${n}-status-2xx`;return e>=500?r=`${n}-status-5xx`:e>=400?r=`${n}-status-4xx`:e>=300&&(r=`${n}-status-3xx`),t("span",{className:`${n}-status ${r} ${s}`,children:e})}const Jn=["all","error","warn","info","debug"];function Gt(e){return(e.levelName||e.level_name||(typeof e.level=="string"?e.level:"")||"info").toLowerCase()}function Yt(e){return e.msg||e.message||JSON.stringify(e)}function Zt(e){return e.createdAt||e.created_at||e.time||e.timestamp||0}function Xt(e){const s=e.data||{};return e.requestId||e.request_id||e["x-request-id"]||s.requestId||s.request_id||s["x-request-id"]||""}function es(e,s="ss-dbg-log-level"){switch(e){case"error":case"fatal":return`${s}-error`;case"warn":return`${s}-warn`;case"info":return`${s}-info`;case"debug":return`${s}-debug`;case"trace":return`${s}-trace`;default:return`${s}-info`}}const ts=new Set(["level","time","pid","hostname","msg","message","v","name","levelName","level_name","timestamp","createdAt","created_at","requestId","request_id","x-request-id","id","data"]);function ss(e){if(e.data){let n=null;if(typeof e.data=="string")try{n=JSON.parse(e.data)}catch{}else typeof e.data=="object"&&!Array.isArray(e.data)&&(n=e.data);if(n){const r={};for(const[o,a]of Object.entries(n))ts.has(o)||(r[o]=a);if(Object.keys(r).length>0)return r}}const s={};for(const[n,r]of Object.entries(e))ts.has(n)||(s[n]=r);return Object.keys(s).length>0?s:null}function ve({data:e,maxPreviewLength:s=100,className:n="",classPrefix:r="ss-dash",defaultExpanded:o=!1}){const[a,l]=$(o),i=z(()=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},[e]),c=z(()=>typeof i=="object"&&i!==null?Qe(i,s):String(i??"-"),[i,s]),d=z(()=>typeof i=="object"&&i!==null?JSON.stringify(i,null,2):String(i),[i]),u=R(()=>{l(v=>!v)},[]),h=R(async()=>{try{await navigator.clipboard.writeText(d)}catch{}},[d]);return!e&&e!==0&&e!==!1?t("span",{className:`ss-dim ${r}-c-dim`,children:"-"}):t("div",{className:`${r}-data-cell ${n}`,children:[!a&&t("span",{className:`${r}-data-preview`,onClick:u,role:"button",tabIndex:0,onKeyDown:v=>v.key==="Enter"&&u(),children:c}),a&&t("div",{className:`${r}-data-full`,onClick:u,children:[t("button",{className:`${r}-copy-btn`,onClick:v=>{v.stopPropagation(),h()},title:"Copy to clipboard",type:"button",children:"Copy"}),t("pre",{children:d})]})]})}function Qn({logs:e,classPrefix:s="ss-dash"}){const[n,r]=$(null);return e.length===0?null:t("div",{children:[t("div",{className:`${s}-related-logs-title`,children:["Related Logs",t("span",{className:`${s}-related-logs-count`,children:["(",e.length,")"]})]}),t("div",{className:`${s}-log-entries`,style:{overflow:"auto"},children:e.map((o,a)=>{const l=Gt(o),i=Yt(o),c=Xt(o),d=Zt(o),u=ss(o);return t(Ve.Fragment,{children:[t("div",{className:`${s}-log-entry${u?` ${s}-log-entry-expandable`:""}`,onClick:()=>u&&r(n===a?null:a),children:[t("span",{className:`${s}-log-level ${es(l,`${s}-log-level`)}`,children:l.toUpperCase()}),t("span",{className:`${s}-log-time`,title:d?re(d):"",children:d?Z(d):"-"}),c?t("span",{className:`${s}-log-reqid`,title:c,children:c.slice(0,8)}):t("span",{className:`${s}-log-reqid-empty`,children:"--"}),u?t("span",{className:`${s}-log-expand-icon${n===a?` ${s}-log-expand-icon-open`:""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:`${s}-log-msg`,children:i})]}),n===a&&u&&t("div",{className:`${s}-log-detail`,children:t(ve,{data:u,classPrefix:s,defaultExpanded:!0})})]},o.id||a)})})]})}const Gn="ss-col-resize",ns="ss-resizing";function rs(e){const s=Array.from(e.querySelectorAll("thead th"));if(s.length===0)return()=>{};const n=[];let r=!1;function o(){if(!r){r=!0;for(const a of s)a.style.width=a.offsetWidth+"px";e.style.tableLayout="fixed"}}for(const a of s){let l=function(c){c.preventDefault(),c.stopPropagation(),o();const d=c.clientX,u=a.offsetWidth;i.classList.add(ns),i.setPointerCapture(c.pointerId);function h(p){const m=p.clientX-d,_=Math.max(30,u+m);a.style.width=_+"px"}function v(){i.classList.remove(ns),i.removeEventListener("pointermove",h),i.removeEventListener("pointerup",v)}i.addEventListener("pointermove",h),i.addEventListener("pointerup",v)};if(!a.textContent?.trim())continue;const i=document.createElement("div");i.className=Gn,a.appendChild(i),i.addEventListener("pointerdown",l),n.push(()=>{i.removeEventListener("pointerdown",l),i.remove()})}return()=>{for(const a of n)a()}}function Yn(e=[]){const s=H(null),n=H(null);return W(()=>(s.current&&(n.current?.(),n.current=rs(s.current)),()=>{n.current?.(),n.current=null}),e),R(o=>{n.current?.(),n.current=null,s.current=o,o&&(n.current=rs(o))},[])}function ae({columns:e,data:s,keyField:n="id",sort:r,sortDir:o,onSort:a,onRowClick:l,rowClassName:i,emptyMessage:c="No data",className:d="",renderAfterRow:u}){const h=R(p=>{a&&a(p)},[a]),v=Yn([s,e]);return s.length===0?t("div",{className:"ss-dash-empty",children:c}):t("table",{ref:v,className:`ss-dash-table ${d}`,children:[t("colgroup",{children:e.map(p=>t("col",{style:p.width?{width:p.width}:void 0},p.key))}),t("thead",{children:t("tr",{children:e.map(p=>t("th",{onClick:p.sortable?()=>h(p.key):void 0,className:p.sortable?"ss-dash-sortable":"",children:[p.label,r===p.key&&t("span",{className:"ss-dash-sort-arrow",children:o==="asc"?" ▲":" ▼"})]},p.key))})}),t("tbody",{children:s.map((p,m)=>{const _=i?typeof i=="function"?i(p):i:"",S=l?"ss-dash-clickable":"";return t(Ve.Fragment,{children:[t("tr",{onClick:l?()=>l(p):void 0,className:`${S} ${_}`.trim(),children:e.map(x=>t("td",{children:x.render?x.render(p[x.key],p):p[x.key]??"-"},x.key))}),u?u(p,m):null]},p[n]??m)})})]})}function le({search:e,onSearchChange:s,placeholder:n="Search...",summary:r,children:o,className:a=""}){const l=R(()=>{s("")},[s]);return t("div",{className:`ss-dash-filter-bar ${a}`,children:[r!=null&&t("span",{className:"ss-dash-summary",children:r}),t("div",{className:"ss-dash-search-wrapper",children:[t("svg",{className:"ss-dash-search-icon",width:"14",height:"14",viewBox:I.search.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:I.search.elements.join("")}}),t("input",{type:"text",className:"ss-dash-search",placeholder:n,value:e,onChange:i=>s(i.target.value)}),e&&t("button",{type:"button",className:"ss-dash-search-clear",onClick:l,children:"×"})]}),o&&t("div",{className:"ss-dash-filter-controls",children:o})]})}function ue({page:e,lastPage:s,total:n,onPageChange:r,className:o=""}){const a=z(()=>nn(e,s),[e,s]),l=R(()=>{e>1&&r(e-1)},[e,r]),i=R(()=>{e<s&&r(e+1)},[e,s,r]);return s<=1?null:t("div",{className:`ss-dash-pagination ${o}`,children:[t("span",{className:"ss-dash-page-info",children:["Page ",e," of ",s," (",n," total)"]}),t("div",{className:"ss-dash-pagination-controls",children:[t("button",{type:"button",className:"ss-dash-page-btn",onClick:l,disabled:e<=1,children:"« Prev"}),a.map((c,d)=>c==="..."?t("span",{className:"ss-dash-page-ellipsis",children:"..."},`ellipsis-${d}`):t("button",{type:"button",className:`ss-dash-page-btn ${c===e?"ss-dash-active":""}`,onClick:()=>r(c),children:c},c)),t("button",{type:"button",className:"ss-dash-page-btn",onClick:i,disabled:e>=s,children:"Next »"})]})]})}const as={request:"#1e3a5f",middleware:"rgba(30, 58, 95, 0.7)",db:"#6d28d9",view:"#0e7490",mail:"#059669",event:"#b45309",custom:"var(--ss-dim)"},Zn={request:"Request",middleware:"Middleware",db:"DB",mail:"Mail",event:"Event",view:"View",custom:"Custom"};function ls({spans:e,totalDuration:s,className:n="",warnings:r}){const o=e||[],a=z(()=>[...o].sort((i,c)=>i.startOffset-c.startOffset),[o]),l=z(()=>{const i={};for(const c of a)i[c.id]=c.parentId?(i[c.parentId]||0)+1:0;return i},[a]);return o.length===0?t("div",{className:"ss-dash-empty",children:"No spans recorded"}):t("div",{className:`ss-dash-tl-waterfall ${n}`,children:[t("div",{className:"ss-dash-tl-legend",children:Object.entries(Zn).map(([i,c])=>t("div",{className:"ss-dash-tl-legend-item",children:[t("span",{className:"ss-dash-tl-legend-dot",style:{background:as[i]||as.custom}}),t("span",{children:c})]},i))}),a.map(i=>{const c=s>0?i.startOffset/s*100:0,d=s>0?Math.max(i.duration/s*100,.5):1,u=l[i.id]||0,h=i.label.length>50?i.label.slice(0,50)+"...":i.label,v=i.category==="db"?"DB":i.category,p=i.category==="db"?"purple":i.category==="mail"?"green":i.category==="event"?"amber":i.category==="view"?"blue":"muted",m=i.metadata?Object.entries(i.metadata).filter(([,S])=>S!=null).map(([S,x])=>`${S}=${x}`).join(", "):"",_=m?`${i.label} (${i.duration.toFixed(2)}ms)
2
- ${m}`:`${i.label} (${i.duration.toFixed(2)}ms)`;return t("div",{className:"ss-dash-tl-row",children:[t("div",{className:"ss-dash-tl-label",title:_,style:{paddingLeft:8+u*16+"px"},children:[t("span",{className:`ss-dash-badge ss-dash-badge-${p}`,style:{fontSize:"9px",marginRight:"4px"},children:v}),h]}),t("div",{className:"ss-dash-tl-track",children:t("div",{className:`ss-dash-tl-bar ss-dash-tl-bar-${i.category||"custom"}`,style:{left:`${c}%`,width:`${d}%`},title:_})}),t("span",{className:"ss-dash-tl-dur",children:[i.duration.toFixed(2),"ms"]})]},i.id)}),r&&r.length>0&&t("div",{className:"ss-dash-tl-warnings",children:[t("div",{className:"ss-dash-tl-warnings-title",children:["Warnings (",r.length,")"]}),r.map((i,c)=>t("div",{className:"ss-dash-tl-warning",children:i},c))]})]})}function Xn({children:e,classPrefix:s="ss-dash",storageKey:n}){const r=H(null),o=H(null),a=H(null),l=H(null);return W(()=>{if(r.current&&o.current&&a.current&&l.current)return Hn({container:r.current,handle:o.current,topPane:a.current,bottomPane:l.current,storageKey:n})},[n]),t("div",{ref:r,className:`${s}-split-container`,children:[t("div",{ref:a,className:`${s}-split-top`,children:e[0]}),t("div",{ref:o,className:`${s}-split-handle`}),t("div",{ref:l,className:`${s}-split-bottom`,children:e[1]})]})}function is({options:e={}}){const[s,n]=$(1),[r,o]=$(""),[a,l]=$("createdAt"),[i,c]=$("desc"),[d,u]=$(null),[h,v]=$(!1);W(()=>n(1),[r]);const{data:p,meta:m,isLoading:_,error:S}=J("requests",{...e,page:s,search:r,sort:a,sortDir:i}),x=Jt(e.baseUrl||"",e.authToken),N=R(b=>{const L=b.id;v(!0);const q=e.dashboardEndpoint||"/__stats/api";x().fetch(`${q}/requests/${L}`).then(D=>{const P=D,j=P.trace;if(j){const E={...P,...j,logs:P.logs};u(E)}else u(D);v(!1)}).catch(()=>{v(!1)})},[x,e.dashboardEndpoint]),f=R(b=>{a===b?c(L=>L==="asc"?"desc":"asc"):(l(b),c("desc"))},[a]),k=p||[];if(d){const b=Wn(d),L=b.logs.length>0;return t("div",{children:[t("div",{className:"ss-dash-tl-detail-header",children:[t("button",{type:"button",className:"ss-dash-btn",onClick:()=>u(null),children:"← Back to Requests"}),t(Ye,{method:b.method}),t("span",{style:{color:"var(--ss-text)"},children:b.url}),t(Qt,{code:b.statusCode}),t("span",{className:"ss-dash-tl-meta",children:[b.totalDuration.toFixed(1),"ms · ",b.spanCount," spans"]})]}),L?t(Xn,{classPrefix:"ss-dash",storageKey:"ss-requests-split",children:[t(ls,{spans:b.spans,totalDuration:b.totalDuration,warnings:b.warnings}),t(Qn,{logs:b.logs,classPrefix:"ss-dash"})]}):t(ls,{spans:b.spans,totalDuration:b.totalDuration,warnings:b.warnings})]})}return h?t("div",{children:[t("div",{className:"ss-dash-tl-detail-header",children:t("button",{type:"button",className:"ss-dash-btn",onClick:()=>v(!1),children:"← Back to Requests"})}),t("div",{className:"ss-dash-empty",children:"Loading request detail..."})]}):t("div",{children:[t(le,{search:r,onSearchChange:o,placeholder:"Filter requests...",summary:`${m?.total??0} requests`}),S&&t("div",{className:"ss-dash-empty",children:"Failed to load requests"}),_&&!p?t("div",{className:"ss-dash-empty",children:"Loading requests..."}):t(O,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"id",label:"#",width:"40px",render:b=>t("span",{style:{color:"var(--ss-dim)"},children:b})},{key:"method",label:"Method",width:"70px",sortable:!0,render:b=>t(Ye,{method:b})},{key:"url",label:"URL",sortable:!0,render:b=>t("span",{style:{color:"var(--ss-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:b,children:b})},{key:"statusCode",label:"Status",width:"60px",sortable:!0,render:(b,L)=>{const q=L.status_code||L.statusCode||L.statusCode;return t(Qt,{code:q})}},{key:"duration",label:"Duration",width:"80px",sortable:!0,render:(b,L)=>{const q=L.total_duration||L.totalDuration||L.duration||0;return t("span",{className:`ss-dash-duration ${se(q)==="very-slow"?"ss-dash-very-slow":se(q)==="slow"?"ss-dash-slow":""}`,children:[q.toFixed(1),"ms"]})}},{key:"spanCount",label:"Spans",width:"50px",render:(b,L)=>{const q=L.span_count||L.spanCount||0;return t("span",{style:{color:"var(--ss-muted)",textAlign:"center"},children:q})}},{key:"warningCount",label:"⚠",width:"40px",render:(b,L)=>{const q=L.warning_count||L.warningCount||0;return q>0?t("span",{style:{color:"var(--ss-amber-fg)",textAlign:"center",display:"block"},children:q}):t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:"-"})}},{key:"createdAt",label:"Time",width:"80px",sortable:!0,render:(b,L)=>{const q=L.createdAt||L.created_at||L.timestamp||"";return t("span",{className:"ss-dash-event-time",title:re(q),children:Z(q)})}}],data:k,sort:a,sortDir:i,onSort:f,onRowClick:N,emptyMessage:"No requests recorded yet"})}),m&&t(ue,{page:m.page,lastPage:m.lastPage,total:m.total,onPageChange:n})]})]})}const er=Object.freeze(Object.defineProperty({__proto__:null,RequestsSection:is,default:is},Symbol.toStringTag,{value:"Module"}));function os({node:e,depth:s=0}){if(!e)return null;const n=s*20,r=e["Node Type"]||"Unknown",o=e["Relation Name"]?t(O,{children:[" on ",t("strong",{children:e["Relation Name"]})]}):null,a=e.Alias&&e.Alias!==e["Relation Name"]?` (${e.Alias})`:"",l=e["Index Name"]?t(O,{children:[" using ",t("em",{children:e["Index Name"]})]}):null,i=[];if(e["Startup Cost"]!==null&&e["Startup Cost"]!==void 0&&i.push(`cost=${e["Startup Cost"]}..${e["Total Cost"]}`),e["Plan Rows"]!==null&&e["Plan Rows"]!==void 0&&i.push(`rows=${e["Plan Rows"]}`),e["Plan Width"]!==null&&e["Plan Width"]!==void 0&&i.push(`width=${e["Plan Width"]}`),e.Filter&&i.push(`filter: ${e.Filter}`),e["Index Cond"]&&i.push(`cond: ${e["Index Cond"]}`),e["Hash Cond"]&&i.push(`hash: ${e["Hash Cond"]}`),e["Join Type"]&&i.push(`join: ${e["Join Type"]}`),e["Sort Key"]){const d=Array.isArray(e["Sort Key"])?e["Sort Key"].join(", "):e["Sort Key"];i.push(`sort: ${d}`)}const c=e.Plans||[];return t("div",{className:"ss-dash-explain-node",style:{marginLeft:`${n}px`},children:[t("div",{className:"ss-dash-explain-node-header",children:[t("span",{className:"ss-dash-explain-node-type",children:r}),o,a,l]}),i.length>0&&t("div",{className:"ss-dash-explain-metrics",children:i.join(" · ")}),c.map((d,u)=>t(os,{node:d,depth:s+1},u))]})}function tr({plan:e}){if(!e||!Array.isArray(e)||e.length===0)return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"});const s=e[0];if(s&&s.Plan)return t("div",{className:"ss-dash-explain-result",children:t(os,{node:s.Plan,depth:0})});if(typeof s=="object"&&s!==null){const n=Object.keys(s);return t("div",{className:"ss-dash-explain-result",children:t("table",{children:[t("thead",{children:t("tr",{children:n.map(r=>t("th",{children:r},r))})}),t("tbody",{children:e.map((r,o)=>{const a=r;return t("tr",{children:n.map(l=>t("td",{children:a[l]!==null&&a[l]!==void 0?String(a[l]):"-"},l))},o)})})]})})}return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"})}const sr=8;function cs({options:e={}}){const[s,n]=$(1),[r,o]=$(""),[a,l]=$("createdAt"),[i,c]=$("desc"),[d,u]=$("list"),[h,v]=$(null),[p,m]=$(null),[_,S]=$(null),x=R(w=>{w!==d&&(u(w),n(1),l(w==="list"?"createdAt":"count"),c("desc"),v(null),m(null),S(null))},[d]);W(()=>n(1),[r]);const N=d==="grouped"?"queries/grouped":"queries",{data:f,meta:k,isLoading:b,mutate:L}=J(N,{...e,page:s,search:r,sort:a,sortDir:i}),q=R(w=>{a===w?c(y=>y==="asc"?"desc":"asc"):(l(w),c("desc"))},[a]),D=R(async w=>{if(p&&p.queryId===w){m(null);return}S(w);try{const y=await L(`queries/${w}/explain`);y&&y.error?m({queryId:w,plan:[],error:y.error,message:y.message}):m({queryId:w,plan:y?.plan||y?.rows||[]})}catch(y){console.warn("[ss] Query explain failed:",y),m({queryId:w,plan:[],error:y instanceof Error?y.message:String(y)})}finally{S(null)}},[L,p]),P=R(w=>{const y=w.id;return!p||p.queryId!==y?null:t("tr",{className:"ss-dash-explain-row",children:t("td",{colSpan:sr,className:"ss-dash-explain",children:t("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[t("div",{style:{flex:1},children:p.error?t("div",{className:"ss-dash-explain-result ss-dash-explain-error",children:[t("strong",{children:"Error:"})," ",p.error,p.message&&t(O,{children:[t("br",{}),p.message]})]}):t(tr,{plan:p.plan})}),t("button",{type:"button",className:"ss-dash-explain-btn",onClick:()=>m(null),style:{marginLeft:"8px",flexShrink:0},children:"Close"})]})})})},[p]),j=d==="grouped"?f?.groups||[]:f||[],E=z(()=>d!=="grouped"?j:j.map(w=>{const y={...w};return(y.sqlNormalized===null||y.sqlNormalized===void 0)&&(w.sql_normalized||w.pattern)&&(y.sqlNormalized=w.sql_normalized||w.pattern||""),(y.count===null||y.count===void 0)&&w.total_count!==null&&w.total_count!==void 0&&(y.count=w.total_count),(y.avgDuration===null||y.avgDuration===void 0)&&w.avg_duration!==null&&w.avg_duration!==void 0&&(y.avgDuration=w.avg_duration),(y.maxDuration===null||y.maxDuration===void 0)&&w.max_duration!==null&&w.max_duration!==void 0&&(y.maxDuration=w.max_duration),(y.minDuration===null||y.minDuration===void 0)&&w.min_duration!==null&&w.min_duration!==void 0&&(y.minDuration=w.min_duration),(y.totalDuration===null||y.totalDuration===void 0)&&w.total_duration!==null&&w.total_duration!==void 0&&(y.totalDuration=w.total_duration),(y.percentOfTotal===null||y.percentOfTotal===void 0)&&w.pct_time!==null&&w.pct_time!==void 0&&(y.percentOfTotal=w.pct_time),y}),[j,d]),T=z(()=>{const w=k?.total??E.length;let y=0,g=0,C=0,B=0;for(const V of E){const Q=V.duration||0;C+=Q,B++,Q>It&&y++}const Y=new Map;for(const V of E){const Q=V.sqlNormalized||V.sql||V.sql_text||"";Y.set(Q,(Y.get(Q)||0)+1)}for(const V of Y.values())V>1&&(g+=V);return{total:w,slow:y,duplicates:g,avgDuration:B>0?C/B:0}},[E,k]),M=z(()=>{const w=new Map;for(const y of E){const g=y.sqlNormalized||y.sql||y.sql_text||"";w.set(g,(w.get(g)||0)+1)}return w},[E]),X=z(()=>{if(d==="grouped")return`${E.length} query patterns`;const w=[`${T.total} queries`];return T.slow>0&&w.push(`${T.slow} slow`),T.duplicates>0&&w.push(`${T.duplicates} dup`),w.push(`avg ${(T.avgDuration||0).toFixed(1)}ms`),w.join(", ")},[d,E.length,T]);return t("div",{children:[t(le,{search:r,onSearchChange:o,placeholder:"Filter queries...",summary:X,children:t("div",{className:"ss-dash-btn-group",children:[t("button",{type:"button",className:`ss-dash-btn ${d==="list"?"ss-dash-active":""}`,onClick:()=>x("list"),children:"List"}),t("button",{type:"button",className:`ss-dash-btn ${d==="grouped"?"ss-dash-active":""}`,onClick:()=>x("grouped"),children:"Grouped"})]})}),b&&!f?t("div",{className:"ss-dash-empty",children:"Loading queries..."}):d==="grouped"?t(O,{children:t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"sqlNormalized",label:"Pattern",render:(w,y)=>{const g=w||"",C=(y.count||0)>=3;return t(O,{children:[t("span",{className:`ss-dash-sql ${h===g?"ss-dash-expanded":""}`,title:"Click to expand",onClick:B=>{B.stopPropagation(),v(h===g?null:g)},role:"button",tabIndex:0,onKeyDown:B=>B.key==="Enter"&&v(h===g?null:g),children:g}),C&&t(O,{children:[" ",t("span",{className:"ss-dash-dup",children:"DUP"})]})]})}},{key:"count",label:"Count",width:"60px",sortable:!0,render:w=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:w||0})},{key:"avgDuration",label:"Avg",width:"70px",sortable:!0,render:w=>{const y=w||0;return t("span",{className:`ss-dash-duration ${se(y)==="very-slow"?"ss-dash-very-slow":se(y)==="slow"?"ss-dash-slow":""}`,children:y.toFixed(2)+"ms"})}},{key:"minDuration",label:"Min",width:"70px",render:w=>t("span",{className:"ss-dash-duration",children:(w||0).toFixed(2)+"ms"})},{key:"maxDuration",label:"Max",width:"70px",render:w=>{const y=w||0;return t("span",{className:`ss-dash-duration ${se(y)==="very-slow"?"ss-dash-very-slow":se(y)==="slow"?"ss-dash-slow":""}`,children:y.toFixed(2)+"ms"})}},{key:"totalDuration",label:"Total",width:"70px",sortable:!0,render:w=>t("span",{className:"ss-dash-duration",children:(w||0).toFixed(1)+"ms"})},{key:"percentOfTotal",label:"% Time",width:"60px",render:w=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:(w||0).toFixed(1)+"%"})}],data:E,keyField:"sqlNormalized",sort:a,sortDir:i,onSort:q,emptyMessage:"No queries recorded"})})}):t(O,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"id",label:"#",width:"40px",render:w=>t("span",{style:{color:"var(--ss-dim)"},children:w})},{key:"sql",label:"SQL",render:(w,y)=>{const g=y.sql||y.sql_text||"";return t("div",{children:[t("span",{className:`ss-dash-sql ${h===y.id?"ss-dash-expanded":""}`,title:"Click to expand",onClick:C=>{C.stopPropagation(),v(h===y.id?null:y.id)},role:"button",tabIndex:0,onKeyDown:C=>C.key==="Enter"&&v(h===y.id?null:y.id),children:g}),(M.get((y.sqlNormalized||y.sql||y.sql_text)??"")??0)>1&&t("span",{className:"ss-dash-dup",children:["×",M.get((y.sqlNormalized||y.sql||y.sql_text)??"")]})]})}},{key:"duration",label:"Duration",width:"70px",sortable:!0,render:w=>{const y=w||0;return t("span",{className:`ss-dash-duration ${se(y)==="very-slow"?"ss-dash-very-slow":se(y)==="slow"?"ss-dash-slow":""}`,children:y.toFixed(2)+"ms"})}},{key:"method",label:"Method",width:"60px",render:(w,y)=>{const g=y.method||y.sql_method||"";return t("span",{className:`ss-dash-method ss-dash-method-${g.toLowerCase()}`,children:g})}},{key:"model",label:"Model",width:"90px",render:w=>t("span",{style:{color:"var(--ss-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:w,children:w||"-"})},{key:"connection",label:"Connection",width:"80px",render:w=>t("span",{style:{color:"var(--ss-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w||"-"})},{key:"createdAt",label:"Time",width:"90px",sortable:!0,render:(w,y)=>{const g=w||y.created_at||y.timestamp||"";return t("span",{className:"ss-dash-event-time",title:re(g),children:Z(g)})}},{key:"id",label:"",width:"70px",render:(w,y)=>{if((y.method||y.sql_method||"")!=="select")return null;const C=p?.queryId===y.id&&!p?.error;return t("button",{type:"button",className:`ss-dash-explain-btn${C?" ss-dash-explain-btn-active":""}`,onClick:B=>{B.stopPropagation(),D(y.id)},disabled:_===y.id,children:_===y.id?"...":"EXPLAIN"})}}],data:E,sort:a,sortDir:i,onSort:q,emptyMessage:"No queries recorded",renderAfterRow:P})}),k&&t(ue,{page:k.page,lastPage:k.lastPage,total:k.total,onPageChange:n})]})]})}const nr=Object.freeze(Object.defineProperty({__proto__:null,QueriesSection:cs,default:cs},Symbol.toStringTag,{value:"Module"}));function ds({options:e={}}){const[s,n]=$(1),[r,o]=$(""),{data:a,meta:l,isLoading:i}=J("events",{...e,page:s,search:r}),c=a||[];return W(()=>n(1),[r]),t("div",{children:[t(le,{search:r,onSearchChange:o,placeholder:"Filter events...",summary:`${l?.total??0} events`}),i&&!a?t("div",{className:"ss-dash-empty",children:"Loading events..."}):t(O,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"id",label:"#",width:"40px",render:d=>t("span",{style:{color:"var(--ss-dim)"},children:d})},{key:"eventName",label:"Event",render:(d,u)=>{const h=u.event_name||u.eventName||u.event||"";return t("span",{className:"ss-dash-event-name",title:h,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:h})}},{key:"data",label:"Data",render:d=>t(ve,{data:d,maxPreviewLength:80,className:"ss-dash-event-data"})},{key:"createdAt",label:"Time",width:"80px",render:(d,u)=>{const h=u.createdAt||u.created_at||u.timestamp;return t("span",{className:"ss-dash-event-time",title:re(h),children:Z(h)})}}],data:c,emptyMessage:"No events recorded yet"})}),l&&t(ue,{page:l.page,lastPage:l.lastPage,total:l.total,onPageChange:n})]})]})}const rr=Object.freeze(Object.defineProperty({__proto__:null,EventsSection:ds,default:ds},Symbol.toStringTag,{value:"Module"}));function hs({options:e={}}){const[s,n]=$(""),{data:r,isLoading:o,error:a}=J("routes",{...e,search:s}),l=r,i=Array.isArray(l)?l:l&&Array.isArray(l.routes)?l.routes:l&&Array.isArray(l.data)?l.data:[],c={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};return t("div",{children:[t(le,{search:s,onSearchChange:n,placeholder:"Filter routes...",summary:`${i.length} routes`}),a?t("div",{className:"ss-dash-empty",children:"Failed to load routes"}):o&&!r?t("div",{className:"ss-dash-empty",children:"Loading routes..."}):t(O,{children:t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"method",label:"Method",width:"70px",render:d=>t(Ye,{method:d})},{key:"pattern",label:"Pattern",render:d=>t("span",{style:{color:"var(--ss-text)",...c},title:d,children:d})},{key:"name",label:"Name",width:"120px",render:d=>t("span",{style:{color:"var(--ss-muted)",...c},title:d||"-",children:d||"-"})},{key:"handler",label:"Handler",render:d=>t("span",{style:{color:"var(--ss-sql-color)",...c},title:d,children:d})},{key:"middleware",label:"Middleware",render:d=>{const u=d?.length?d.join(", "):"-";return t("span",{style:{color:"var(--ss-dim)",fontSize:"10px",...c},title:u,children:u})}}],data:i,keyField:"pattern",emptyMessage:"No routes available"})})})]})}const ar=Object.freeze(Object.defineProperty({__proto__:null,RoutesSection:hs,default:hs},Symbol.toStringTag,{value:"Module"}));function us({options:e={}}){const[s,n]=$(1),[r,o]=$(""),[a,l]=$("all"),[i,c]=$(""),[d,u]=$(""),[h,v]=$([]),[p,m]=$("level"),[_,S]=$("equals"),[x,N]=$(""),[f,k]=$(null),b={};a!=="all"&&(b.level=a),i&&(b.request_id=i),h.forEach((g,C)=>{b[`filter_field_${C}`]=g.field,b[`filter_op_${C}`]=g.operator,b[`filter_value_${C}`]=g.value});const{data:L,meta:q,isLoading:D}=J("logs",{...e,page:s,search:r,filters:b}),P=L||[],j=R(g=>{c(g),u(g),n(1)},[]),E=R(()=>{const g=d.trim();c(g),n(1)},[d]),T=R(()=>{c(""),u(""),n(1)},[]),M=R(()=>{l("all"),n(1)},[]),X=R(()=>{const g=x.trim();g&&(v(C=>[...C,{field:p,operator:_,value:g}]),N(""))},[p,_,x]),w=R(g=>{v(C=>C.filter((B,Y)=>Y!==g))},[]),y=a!=="all"||i!==""||h.length>0;return t("div",{children:[t(le,{search:r,onSearchChange:o,placeholder:"Search logs...",summary:`${q?.total??0} logs`,children:t("div",{className:"ss-dash-log-filters",children:[Jn.map(g=>t("button",{type:"button",className:`ss-dash-log-filter ${a===g?"ss-dash-active":""}`,onClick:()=>{l(g),n(1)},children:g},g)),t("input",{type:"text",className:"ss-dash-filter-input ss-dash-reqid-input",placeholder:"Filter by request ID...",value:d,onChange:g=>u(g.target.value),onKeyDown:g=>g.key==="Enter"&&E()}),(d||i)&&t("button",{type:"button",className:"ss-dash-btn ss-dash-reqid-clear",onClick:()=>{T()},children:"Clear"})]})}),t("div",{className:"ss-dash-structured-search",children:[t("select",{className:"ss-dash-filter-select",value:p,onChange:g=>m(g.target.value),children:[t("option",{value:"level",children:"level"}),t("option",{value:"message",children:"message"}),t("option",{value:"request_id",children:"request_id"}),t("option",{value:"userId",children:"userId"}),t("option",{value:"email",children:"email"}),t("option",{value:"path",children:"path"})]}),t("select",{className:"ss-dash-filter-select",value:_,onChange:g=>S(g.target.value),children:[t("option",{value:"equals",children:"equals"}),t("option",{value:"contains",children:"contains"}),t("option",{value:"starts_with",children:"starts with"})]}),t("input",{className:"ss-dash-filter-input",placeholder:"Value...",value:x,onChange:g=>N(g.target.value),onKeyDown:g=>g.key==="Enter"&&X()}),t("button",{type:"button",className:"ss-dash-btn",onClick:X,children:"Add"})]}),y&&t("div",{className:"ss-dash-filter-chips",children:[a!=="all"&&t("span",{className:"ss-dash-filter-chip",children:["level: ",a,t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:M,children:"×"})]}),i&&t("span",{className:"ss-dash-filter-chip",children:["requestId: ",i.slice(0,8),"...",t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:T,children:"×"})]}),h.map((g,C)=>t("span",{className:"ss-dash-filter-chip",children:[g.field," ",g.operator,' "',g.value,'"',t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:()=>w(C),children:"×"})]},C))]}),D&&!L?t("div",{className:"ss-dash-empty",children:"Loading logs..."}):P.length===0?t("div",{className:"ss-dash-empty",children:["No log entries",i?` matching request ${i}`:a!=="all"?` for ${a}`:""]}):t("div",{className:"ss-dash-log-entries",children:P.map((g,C)=>{const B=Gt(g),Y=Yt(g),V=Xt(g),Q=Zt(g),ie=ss(g);return t(Ve.Fragment,{children:[t("div",{className:`ss-dash-log-entry${ie?" ss-dash-log-entry-expandable":""}`,onClick:()=>ie&&k(f===C?null:C),children:[t("span",{className:`ss-dash-log-level ${es(B,"ss-dash-log-level")}`,children:B.toUpperCase()}),t("span",{className:"ss-dash-log-time",title:Q?re(Q):"",children:Q?Z(Q):"-"}),V?t("span",{className:"ss-dash-log-reqid",title:V,onClick:ce=>{ce.stopPropagation(),j(V)},role:"button",tabIndex:0,onKeyDown:ce=>{ce.key==="Enter"&&(ce.stopPropagation(),j(V))},children:V.slice(0,8)}):t("span",{className:"ss-dash-log-reqid-empty",children:"--"}),ie?t("span",{className:`ss-dash-log-expand-icon${f===C?" ss-dash-log-expand-icon-open":""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:"ss-dash-log-msg",children:Y})]}),f===C&&ie&&t("div",{className:"ss-dash-log-detail",children:t(ve,{data:ie,classPrefix:"ss-dash",defaultExpanded:!0})})]},g.id||C)})}),q&&t(ue,{page:q.page,lastPage:q.lastPage,total:q.total,onPageChange:n})]})}const lr=Object.freeze(Object.defineProperty({__proto__:null,LogsSection:us,default:us},Symbol.toStringTag,{value:"Module"}));function ps({options:e={}}){const[s,n]=$(1),[r,o]=$(""),[a,l]=$(null),[i,c]=$(null),{data:d,meta:u,isLoading:h}=J("emails",{...e,page:s,search:r}),v=d||[];W(()=>n(1),[r]);const p=R(async m=>{if(m.html){l(m.id),c(m.html);return}try{const{baseUrl:_="",dashboardEndpoint:S="/__stats/api",authToken:x}=e,N=`${_}${S}/emails/${m.id}/preview`,f={Accept:"text/html"};x&&(f.Authorization=`Bearer ${x}`);const b=await(await fetch(N,{headers:f,credentials:"same-origin"})).text();l(m.id),c(b)}catch{}},[e]);if(a&&i){const m=v.find(_=>_.id===a);return t("div",{className:"ss-dash-email-preview",id:"ss-dash-email-preview",children:[t("div",{className:"ss-dash-email-preview-header",children:[t("div",{className:"ss-dash-email-preview-meta",id:"ss-dash-email-preview-meta",children:m&&t(O,{children:[t("strong",{children:"Subject:"})," ",m.subject,"  |  ",t("strong",{children:"From:"})," ",m.from_addr||m.from,"  |  ",t("strong",{children:"To:"})," ",m.to_addr||m.to,(m.cc||m.cc_addr)&&t(O,{children:["  |  ",t("strong",{children:"CC:"})," ",m.cc||m.cc_addr]}),"  |  ",t("strong",{children:"Status:"})," ",t("span",{className:`ss-dash-badge ss-dash-email-status-${m.status}`,children:m.status}),m.mailer&&t(O,{children:["  |  ",t("strong",{children:"Mailer:"})," ",m.mailer]})]})}),t("button",{type:"button",className:"ss-dash-btn",id:"ss-dash-email-preview-close",onClick:()=>{l(null),c(null)},children:"Close"})]}),t("iframe",{className:"ss-dash-email-iframe",id:"ss-dash-email-iframe",srcDoc:i,title:"Email preview",sandbox:""})]})}return t("div",{children:[t(le,{search:r,onSearchChange:o,placeholder:"Filter emails...",summary:`${u?.total??0} emails`}),h&&!d?t("div",{className:"ss-dash-empty",children:"Loading emails..."}):t(O,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"id",label:"#",width:"40px",render:m=>t("span",{style:{color:"var(--ss-dim)"},children:m})},{key:"from",label:"From",width:"150px",render:(m,_)=>{const S=_.from_addr||_.from||"";return t("span",{title:S,style:{color:"var(--ss-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:S})}},{key:"to",label:"To",width:"150px",render:(m,_)=>{const S=_.to_addr||_.to||"";return t("span",{title:S,style:{color:"var(--ss-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:S})}},{key:"subject",label:"Subject",render:m=>{const _=m||"";return t("span",{title:_,style:{color:"var(--ss-sql-color)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:_})}},{key:"status",label:"Status",width:"80px",render:m=>{const _=m||"";return t("span",{className:`ss-dash-badge ss-dash-email-status-${_}`,children:_})}},{key:"attachmentCount",label:"ATT",width:"40px",render:(m,_)=>{const S=_.attachment_count||_.attachmentCount||0;return S>0?t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:S}):t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:"-"})}},{key:"mailer",label:"Mailer",width:"70px",render:m=>{const _=m||"";return t("span",{title:_,style:{color:"var(--ss-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:_})}},{key:"createdAt",label:"Time",width:"80px",render:(m,_)=>{const S=_.createdAt||_.created_at||_.timestamp;return t("span",{className:"ss-dash-event-time",style:{whiteSpace:"nowrap"},title:re(S),children:Z(S)})}}],data:v,onRowClick:p,rowClassName:"ss-dash-email-row",emptyMessage:"No emails captured yet"})}),u&&t(ue,{page:u.page,lastPage:u.lastPage,total:u.total,onPageChange:n})]})]})}const ir=Object.freeze(Object.defineProperty({__proto__:null,EmailsSection:ps,default:ps},Symbol.toStringTag,{value:"Module"}));function fs({options:e={}}){const[s,n]=$(""),[r,o]=$(null),[a,l]=$(null),[i,c]=$(!1),[d,u]=$(null),{data:h,isLoading:v,mutate:p,getApi:m}=J("cache",{...e,search:s}),_=h,S=R(async N=>{if(confirm(`Delete cache key "${N}"?`))try{await p(`cache/${encodeURIComponent(N)}`,"delete"),r===N&&(o(null),l(null),u(null))}catch{}},[p,r]),x=R(async N=>{if(r===N){o(null),l(null),u(null);return}o(N),l(null),u(null),c(!0);try{const k=await m().fetchCacheKey(N);l(k.value!==void 0?k.value:k.data!==void 0?k.data:k),u(null)}catch{l(null),u("Failed to fetch key value")}finally{c(!1)}},[r,m]);return t("div",{children:[_?.available&&_?.stats&&t("div",{className:"ss-dash-cache-stats",children:[t("div",{className:"ss-dash-cache-stat",children:[t("span",{className:"ss-dash-cache-stat-label",children:"Hit Rate:"}),t("span",{className:"ss-dash-cache-stat-value",children:[(_.stats.hitRate??0).toFixed(1),"%"]})]}),t("div",{className:"ss-dash-cache-stat",children:[t("span",{className:"ss-dash-cache-stat-label",children:"Hits:"}),t("span",{className:"ss-dash-cache-stat-value",children:_.stats.hits??0})]}),t("div",{className:"ss-dash-cache-stat",children:[t("span",{className:"ss-dash-cache-stat-label",children:"Misses:"}),t("span",{className:"ss-dash-cache-stat-value",children:_.stats.misses??0})]}),t("div",{className:"ss-dash-cache-stat",children:[t("span",{className:"ss-dash-cache-stat-label",children:"Keys:"}),t("span",{className:"ss-dash-cache-stat-value",children:_.stats.totalKeys||_.stats.keyCount||_.keys?.length||0})]})]}),t(le,{search:s,onSearchChange:n,placeholder:"Filter cache keys...",summary:`${(_?.keys||_?.data||[]).length} keys`}),v&&!h?t("div",{className:"ss-dash-empty",children:"Loading cache..."}):!_||!_.available?t("div",{className:"ss-dash-empty",children:"Cache inspector not available"}):t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"key",label:"Key",render:N=>t("span",{title:N,style:{color:"var(--ss-sql-color)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:N})},{key:"type",label:"Type",width:"70px",render:N=>t("span",{style:{color:"var(--ss-muted)"},children:N})},{key:"size",label:"Size",width:"60px",render:N=>N!=null&&N>0?An(N):"-"},{key:"ttl",label:"TTL",width:"70px",render:N=>N>0?En(N):"-"},{key:"_actions",label:"",width:"60px",render:(N,f)=>t("button",{type:"button",className:"ss-dash-retry-btn",onClick:k=>{k.stopPropagation(),S(f.key)},children:"Delete"})}],data:_.keys||_.data||[],keyField:"key",onRowClick:N=>x(N.key),emptyMessage:"No cache keys found"})}),r&&t("div",{className:"ss-dash-cache-detail",children:[t("h4",{children:["Key: ",r]}),i?t("div",{className:"ss-dash-empty",children:"Loading value..."}):d?t("div",{className:"ss-dash-empty",style:{color:"var(--ss-red-fg)"},children:d}):t(ve,{data:a})]})]})}const or=Object.freeze(Object.defineProperty({__proto__:null,CacheSection:fs,default:fs},Symbol.toStringTag,{value:"Module"})),cr=["all","active","waiting","delayed","completed","failed"];function dr(e){switch(e){case"active":return"blue";case"waiting":return"amber";case"delayed":return"purple";case"completed":return"green";case"failed":return"red";default:return"muted"}}function hr(e){if(!e)return[];if(Array.isArray(e))return e;const s=e;return s.jobs||s.data||[]}function ur(e){if(!e||Array.isArray(e))return null;const s=e;return s.stats||s.overview||null}function ms({options:e={}}){const[s,n]=$(1),[r,o]=$(""),[a,l]=$("all"),[i,c]=$({}),d={};a!=="all"&&(d.status=a);const{data:u,meta:h,isLoading:v,error:p,refresh:m,mutate:_}=J("jobs",{...e,page:s,search:r,filters:d}),S=hr(u),x=ur(u),N=R(async f=>{c(k=>({...k,[f]:"pending"}));try{await _(`jobs/${f}/retry`),c(k=>({...k,[f]:"success"})),setTimeout(()=>{c(k=>{const b={...k};return delete b[f],b}),m()},1e3)}catch{c(k=>{const b={...k};return delete b[f],b})}},[_,m]);return t("div",{children:[x&&t("div",{className:"ss-dash-job-stats",children:[t("div",{className:"ss-dash-job-stat",children:[t("span",{className:"ss-dash-job-stat-label",children:"Active:"}),t("span",{className:"ss-dash-job-stat-value",children:x.active??0})]}),t("div",{className:"ss-dash-job-stat",children:[t("span",{className:"ss-dash-job-stat-label",children:"Waiting:"}),t("span",{className:"ss-dash-job-stat-value",children:x.waiting??0})]}),t("div",{className:"ss-dash-job-stat",children:[t("span",{className:"ss-dash-job-stat-label",children:"Delayed:"}),t("span",{className:"ss-dash-job-stat-value",children:x.delayed??0})]}),t("div",{className:"ss-dash-job-stat",children:[t("span",{className:"ss-dash-job-stat-label",children:"Completed:"}),t("span",{className:"ss-dash-job-stat-value",children:x.completed??0})]}),t("div",{className:"ss-dash-job-stat",children:[t("span",{className:"ss-dash-job-stat-label",children:"Failed:"}),t("span",{className:"ss-dash-job-stat-value",style:{color:"var(--ss-red-fg)"},children:x.failed??0})]})]}),t(le,{search:r,onSearchChange:o,placeholder:"Filter jobs...",summary:`${h?.total??S.length} jobs`,children:t("div",{className:"ss-dash-btn-group",children:cr.map(f=>t("button",{type:"button",className:`ss-dash-btn ${a===f?"ss-dash-active":""}`,onClick:()=>{l(f),n(1)},children:f.charAt(0).toUpperCase()+f.slice(1)},f))})}),v&&!u?t("div",{className:"ss-dash-empty",children:"Loading jobs..."}):p?t("div",{className:"ss-dash-empty",children:"Jobs/Queue not available"}):t(O,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"id",label:"ID",width:"40px",render:f=>t("span",{style:{color:"var(--ss-dim)"},children:f})},{key:"name",label:"Name",render:f=>t("span",{style:{color:"var(--ss-text)"},title:f,children:f})},{key:"status",label:"Status",width:"90px",render:f=>t(Kn,{color:dr(f),children:f})},{key:"payload",label:"Payload",render:(f,k)=>t(ve,{data:f||k?.data,maxPreviewLength:60})},{key:"attempts",label:"Tries",width:"50px",render:(f,k)=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:f||k.attemptsMade||0})},{key:"duration",label:"Duration",width:"75px",render:f=>t("span",{className:"ss-dash-duration",children:f!==null?ne(f):"-"})},{key:"timestamp",label:"Time",width:"70px",render:(f,k)=>{const b=f||k?.createdAt||k?.processedAt||k?.created_at;return t("span",{className:"ss-dash-event-time",style:{whiteSpace:"nowrap"},title:re(b),children:Z(b)})}},{key:"_actions",label:"",width:"50px",render:(f,k)=>{const b=k.id,L=i[b];return k.status!=="failed"?null:t("button",{type:"button",className:"ss-dash-retry-btn",disabled:L==="pending"||L==="success",onClick:q=>{q.stopPropagation(),N(b)},children:L==="pending"?"...":L==="success"?"OK":"Retry"})}}],data:S,emptyMessage:"No jobs found"})}),h&&t(ue,{page:h.page,lastPage:h.lastPage,total:h.total,onPageChange:n})]})]})}const pr=Object.freeze(Object.defineProperty({__proto__:null,JobsSection:ms,default:ms},Symbol.toStringTag,{value:"Module"}));function K(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.__redacted===!0}function Ze(e,s=""){if(typeof e!="object"||e===null||e===void 0)return[{path:s,value:e}];if(Array.isArray(e)||K(e))return[{path:s,value:e}];const n=[];for(const r of Object.keys(e)){const o=s?`${s}.${r}`:r,a=e[r];typeof a=="object"&&a!==null&&!Array.isArray(a)&&!K(a)?n.push(...Ze(a,o)):n.push({path:o,value:a})}return n}function Xe(e){return e==null?{text:"null",color:"var(--ss-dim)"}:typeof e=="boolean"?{text:String(e),color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"}:typeof e=="number"?{text:String(e),color:"var(--ss-amber-fg)"}:Array.isArray(e)?{text:`[${e.map(n=>n==null?"null":typeof n=="object"?JSON.stringify(n):String(n)).join(", ")}]`,color:"var(--ss-purple-fg)"}:typeof e=="object"?{text:JSON.stringify(e),color:"var(--ss-dim)"}:{text:String(e)}}function vs(e){if(e==null||typeof e!="object"||Array.isArray(e)||K(e))return 1;let s=0;for(const n of Object.keys(e))s+=vs(e[n]);return s}function fr(e){if(e==null||typeof e!="object"||Array.isArray(e)||K(e))return[];const s=[];for(const n of Object.keys(e)){const r=e[n];r!==null&&typeof r=="object"&&!Array.isArray(r)&&!K(r)&&s.push(n)}return s}function qe(e,s,n){s&&navigator.clipboard.writeText(e).then(()=>{const r=s.textContent;s.textContent="✓",s.classList.add(`${n}-copy-row-ok`),setTimeout(()=>{s.textContent=r,s.classList.remove(`${n}-copy-row-ok`)},1200)}).catch(()=>{})}function Pe({redacted:e,p:s}){const[n,r]=$(!1);return t("span",{className:`${s}-config-redacted`,style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[t("span",{children:n?e.value:e.display}),t("button",{type:"button",className:`${s}-btn`,title:n?"Hide":"Reveal",style:{padding:"0 4px",fontSize:"0.85em",lineHeight:1,minWidth:"auto"},onClick:o=>{o.stopPropagation(),r(a=>!a)},children:n?t("svg",{width:"14",height:"14",viewBox:I["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:I["eye-off"].elements.join("")}}):t("svg",{width:"14",height:"14",viewBox:I.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:I.eye.elements.join("")}})})]})}function mr({env:e,search:s,p:n}){const r=H(new Map),o=s.toLowerCase(),a=Object.entries(e).filter(([l,i])=>{if(!o)return!0;const c=K(i)?i.display:i==null?"":String(i);return l.toLowerCase().includes(o)||c.toLowerCase().includes(o)});return t("div",{className:`${n}-config-table-wrap`,children:t("table",{className:`${n}-table ${n}-config-env-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Variable"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[a.map(([l,i])=>{const c=K(i),d=c?i.display:i==null?"null":String(i),u=`${l}=${d}`;return t("tr",{children:[t("td",{className:`${n}-env-key`,children:t("span",{className:`${n}-config-key`,children:l})}),t("td",{className:`${n}-env-val`,children:c?t(Pe,{redacted:i,p:n}):t("span",{className:`${n}-config-val`,children:d})}),t("td",{children:!c&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:h=>{r.current.set(l,h)},onClick:h=>{h.stopPropagation(),qe(u,r.current.get(l)??null,n)},children:"⎘"})})]},l)}),a.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching variables"})})]})]})})}function vr({source:e,search:s,p:n}){const r=H(new Map),o=s.toLowerCase(),a=Ze(e,""),l=a.filter(i=>{const c=K(i.value)?i.value.display:i.value===null||i.value===void 0?"":String(i.value);return i.path.toLowerCase().includes(o)||c.toLowerCase().includes(o)});return t("div",{className:`${n}-config-table-wrap`,children:[t("table",{className:`${n}-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Path"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[l.map(i=>{const c=K(i.value),d=c?null:Xe(i.value),u=c?i.value.display:d.text,h=`${i.path}: ${u}`;return t("tr",{children:[t("td",{children:t("span",{className:`${n}-config-key`,style:{whiteSpace:"nowrap"},children:i.path})}),t("td",{children:c?t(Pe,{redacted:i.value,p:n}):t("span",{className:`${n}-config-val`,style:{wordBreak:"break-all",color:d.color},children:d.text})}),t("td",{children:!c&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:v=>{r.current.set(i.path,v)},onClick:v=>{v.stopPropagation(),qe(h,r.current.get(i.path)??null,n)},children:"⎘"})})]},i.path)}),l.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching entries"})})]})]}),t("div",{style:{padding:"4px 16px",fontSize:"10px",color:"var(--ss-muted)"},children:[l.length," of ",a.length," entries"]})]})}function _r({obj:e,prefix:s,p:n}){const r=H(new Map),o=Ze(e,s);return t("table",{className:`${n}-table ${n}-config-inner-table`,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"35%"},children:"Key"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:o.map(a=>{const l=a.path.indexOf(s+".")===0?a.path.slice(s.length+1):a.path,i=K(a.value),c=i?null:Xe(a.value),d=i?a.value.display:c.text,u=`${a.path}: ${d}`;return t("tr",{children:[t("td",{title:l,children:t("span",{className:`${n}-config-key`,children:l})}),t("td",{title:d,children:i?t(Pe,{redacted:a.value,p:n}):t("span",{className:`${n}-config-val`,style:{color:c.color},children:c.text})}),t("td",{children:!i&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:h=>{r.current.set(a.path,h)},onClick:h=>{h.stopPropagation(),qe(u,r.current.get(a.path)??null,n)},children:"⎘"})})]},a.path)})})]})}function gr({value:e,p:s}){if(e==null)return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-dim)"},children:"null"});if(K(e))return t(Pe,{redacted:e,p:s});if(typeof e=="boolean")return t("span",{className:`${s}-config-val`,style:{color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"},children:String(e)});if(typeof e=="number")return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-amber-fg)"},children:String(e)});if(Array.isArray(e)){const n=e.map(r=>r==null?"null":typeof r=="object"?JSON.stringify(r):String(r));return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-purple-fg)"},children:["[",n.join(", "),"]"]})}return typeof e=="object"?t("span",{className:`${s}-config-val`,style:{color:"var(--ss-dim)"},children:JSON.stringify(e)}):t("span",{className:`${s}-config-val`,children:String(e)})}function yr({obj:e,expandedPaths:s,onToggle:n,p:r}){if(e==null||typeof e!="object"||Array.isArray(e)||K(e))return null;const o=Object.keys(e),a=H(new Map);return t("div",{className:`${r}-config-sections`,children:o.map(l=>{const i=e[l],c=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!K(i),d=s.has(l),u=K(i);return t("div",{className:`${r}-config-section`,children:[t("div",{className:`${r}-config-section-header${c?"":` ${r}-config-leaf`}`,onClick:c?()=>n(l):void 0,style:{cursor:c?"pointer":"default"},children:[c?t("span",{className:`${r}-config-toggle`,children:d?"▼":"▶"}):t("span",{className:`${r}-config-toggle`,style:{visibility:"hidden"},children:"•"}),t("span",{className:`${r}-config-key`,children:l}),c?t("span",{className:`${r}-config-count`,children:[vs(i)," entries"]}):t(O,{children:[t("span",{className:`${r}-config-val`,style:{marginLeft:"8px"},children:t(gr,{value:i,p:r})}),!u&&t("button",{type:"button",className:`${r}-copy-row-btn`,style:{marginLeft:"4px"},title:"Copy",ref:h=>{a.current.set(l,h)},onClick:h=>{h.stopPropagation();const v=Xe(i);qe(`${l}: ${v.text}`,a.current.get(l)??null,r)},children:"⎘"})]})]}),c&&d&&t("div",{className:`${r}-config-section-body`,children:t(_r,{obj:i,prefix:l,p:r})})]},l)})})}function br({data:e,isLoading:s,classPrefix:n}){const r=n,[o,a]=$(""),[l,i]=$(""),[c,d]=$("app"),[u,h]=$(new Set),[v,p]=$("Copy JSON");W(()=>{const f=setTimeout(()=>i(o),200);return()=>clearTimeout(f)},[o]);const m=e,_=R(f=>{h(k=>{const b=new Set(k);return b.has(f)?b.delete(f):b.add(f),b})},[]),S=R(()=>{if(!m)return;const f=c==="app"?m.app:m.env;if(!f)return;const k=fr(f);h(new Set(k))},[m,c]),x=R(()=>{h(new Set)},[]),N=R(async()=>{if(m)try{const f=c==="app"?m.app:m.env;await navigator.clipboard.writeText(JSON.stringify(f,null,2)),p("Copied!"),setTimeout(()=>p("Copy JSON"),1500)}catch{}},[m,c]);return t("div",{children:[t("div",{className:`${r}-config-toolbar`,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px"},children:[t("button",{type:"button",className:`${r}-config-tab${c==="app"?` ${r}-active`:""}`,onClick:()=>d("app"),children:"App Config"}),t("button",{type:"button",className:`${r}-config-tab${c==="env"?` ${r}-active`:""}`,onClick:()=>d("env"),children:"Env"}),t("div",{style:{position:"relative",flex:1},children:[t("input",{type:"text",className:`${r}-search`,placeholder:"Search keys and values...",value:o,onChange:f=>a(f.target.value),style:{width:"100%"}}),o&&t("button",{type:"button",onClick:()=>a(""),style:{position:"absolute",right:"6px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",fontSize:"14px",color:"var(--ss-dim)",padding:"0 2px",lineHeight:1},children:"×"})]}),c==="app"&&!l&&t(O,{children:[t("button",{type:"button",className:`${r}-btn`,onClick:S,children:"Expand All"}),t("button",{type:"button",className:`${r}-btn`,onClick:x,children:"Collapse All"})]}),t("button",{type:"button",className:`${r}-btn`,onClick:N,children:v})]}),s&&!e?t("div",{className:`${r}-empty`,children:"Loading config..."}):m?c==="env"?t(mr,{env:m.env??{},search:l,p:r}):l?t(vr,{source:m.app??{},search:l,p:r}):t("div",{className:`${r}-config-table-wrap`,children:t(yr,{obj:m.app,expandedPaths:u,onToggle:_,p:r})}):t("div",{className:`${r}-empty`,children:"Config not available"})]})}function _s({options:e={}}){const{data:s,isLoading:n}=J("config",e);return t(br,{data:s,isLoading:n,classPrefix:"ss-dash"})}const wr=Object.freeze(Object.defineProperty({__proto__:null,ConfigSection:_s,default:_s},Symbol.toStringTag,{value:"Module"})),Nr=["password","secret","token","key","credential","auth"];function gs(e){const s=e.toLowerCase();return Nr.some(n=>s.includes(n))}function ys(e){if(e==null)return"-";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.join(", ")||"-";try{return JSON.stringify(e)}catch{return String(e)}}const xr={collectionInterval:"Stats Collection",dashboardBroadcast:"Dashboard Broadcast",debugBroadcast:"Debug Broadcast",persistFlush:"Persist Flush",retentionCleanup:"Retention Cleanup"};function kr(e){return xr[e]||e}const $r={prometheus:"Prometheus",pinoHook:"Pino Log Hook",edgePlugin:"Edge Plugin",cacheInspector:"Cache Inspector",queueInspector:"Queue Inspector"};function Sr(e){return $r[e]||e}const Cr=["healthy","active","connected","available","ready"],Tr=["errored","unavailable"];function Lr(e){return Cr.includes(e)?"ok":Tr.includes(e)?"err":""}function _e({status:e,prefix:s}){const n=Lr(e);let r=`${s}-dot`;return n==="ok"?r+=` ${s}-dot-ok`:n==="err"&&(r+=` ${s}-dot-err`),t("span",{className:r})}const bs=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:I.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:I.eye.elements.join("")}}),ws=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:I["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:I["eye-off"].elements.join("")}});function Er({value:e}){const[s,n]=$(!1);return t("span",{children:[s?e:"••••••••"," ",t("button",{type:"button",onClick:()=>n(r=>!r),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:s?t(ws,{}):t(bs,{})})]})}function Ar({current:e,max:s,prefix:n}){const r=s>0?Math.min(100,Math.round(e/s*100)):0,o=r>=100;return t("div",{className:`${n}-bar`,children:[t("div",{className:`${n}-bar-track`,children:t("div",{className:`${n}-bar-fill${o?` ${n}-bar-fill-warn`:""}`,style:{width:`${r}%`}})}),t("span",{className:`${n}-bar-pct${o?` ${n}-bar-pct-warn`:""}`,children:[r,"%"]})]})}function Rr({config:e,prefix:s}){const n=Object.entries(e);return n.length===0?t("span",{className:`${s}-c-dim`,children:"-"}):t("span",{className:`${s}-c-muted`,children:n.map(([r,o],a)=>t("span",{children:[a>0&&", ",t("span",{className:`${s}-c-dim`,children:r}),"=",gs(r)&&typeof o=="string"?t(Er,{value:o}):t("span",{children:ys(o)})]},r))})}function ge({label:e,value:s,prefix:n}){return t("div",{className:`${n}-info-card`,children:[t("span",{className:`${n}-info-card-label`,children:e}),t("span",{className:`${n}-info-card-value`,children:s})]})}function qr({data:e,tableClassName:s,classPrefix:n}){const r=n||"ss-dash",[o,a]=$(new Set),l=R(c=>{a(d=>{const u=new Set(d);return u.has(c)?u.delete(c):u.add(c),u})},[]),i=R((c,d)=>{if(d==null)return t("span",{className:`${r}-c-dim`,children:"null"});if(typeof d=="boolean")return t("span",{className:d?`${r}-c-green`:`${r}-c-red`,children:String(d)});if(Array.isArray(d))return t("span",{children:d.join(", ")||"-"});const u=ys(d);if(gs(c)){const h=o.has(c);return t("span",{children:[h?u:"••••••••"," ",t("button",{type:"button",onClick:()=>l(c),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:h?t(ws,{}):t(bs,{})})]})}return t("span",{children:u})},[o,l,r]);return t("div",{children:[t("h3",{className:`${r}-internals-title`,children:"Package Info"}),t("div",{className:`${r}-info-cards`,children:[t(ge,{label:"Version",value:e.package.version||"-",prefix:r}),t(ge,{label:"Node.js",value:e.package.nodeVersion||"-",prefix:r}),t(ge,{label:"AdonisJS",value:e.package.adonisVersion||"-",prefix:r}),t(ge,{label:"Uptime",value:Ln(e.package.uptime),prefix:r}),t(ge,{label:"Renderer",value:e.devToolbar?.renderer||"preact",prefix:r})]}),e.collectors.length>0&&t(O,{children:[t("h3",{className:`${r}-internals-title`,children:"Collectors"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Collector"}),t("th",{children:"Status"}),t("th",{children:"Last Error"}),t("th",{children:"Config"})]})}),t("tbody",{children:e.collectors.map(c=>t("tr",{children:[t("td",{children:[t("code",{children:c.name}),c.label&&c.label!==c.name&&t("span",{className:`${r}-c-dim`,children:[" ",c.label]})]}),t("td",{children:[t(_e,{status:c.status,prefix:r}),c.status]}),t("td",{className:c.lastError?`${r}-c-red`:`${r}-c-dim`,children:c.lastError?t(O,{children:[c.lastError,c.lastErrorAt&&t("span",{className:`${r}-c-dim`,style:{fontSize:"10px"},children:Z(c.lastErrorAt)})]}):"-"}),t("td",{children:t(Rr,{config:c.config,prefix:r})})]},c.name))})]})]}),t("h3",{className:`${r}-internals-title`,children:"Buffers"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Buffer"}),t("th",{children:"Usage"}),t("th",{children:"Fill %"})]})}),t("tbody",{children:Object.entries(e.buffers).map(([c,d])=>t("tr",{children:[t("td",{style:{textTransform:"capitalize"},children:c}),t("td",{children:[d.current.toLocaleString()," / ",d.max.toLocaleString()]}),t("td",{children:t(Ar,{current:d.current,max:d.max,prefix:r})})]},c))})]}),t("h3",{className:`${r}-internals-title`,children:"Timers"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Timer"}),t("th",{children:"Status"}),t("th",{children:"Interval"})]})}),t("tbody",{children:Object.entries(e.timers).map(([c,d])=>t("tr",{children:[t("td",{children:kr(c)}),t("td",{children:[t(_e,{status:d.active?"active":"inactive",prefix:r}),t("span",{className:d.active?`${r}-c-green`:`${r}-c-dim`,children:d.active?"active":"inactive"})]}),t("td",{children:d.active?d.intervalMs?ne(d.intervalMs):d.debounceMs?`${ne(d.debounceMs)} (debounce)`:"-":t("span",{className:`${r}-c-dim`,children:"—"})})]},c))})]}),t("h3",{className:`${r}-internals-title`,children:"Integrations"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Integration"}),t("th",{children:"Status"}),t("th",{children:"Details"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Transmit (SSE)"}),t("td",{children:[t(_e,{status:e.transmit.available?"connected":"inactive",prefix:r}),e.transmit.available?"connected":"unavailable"]}),t("td",{style:{fontSize:"11px"},children:e.transmit.channels.length>0?`Channels: ${e.transmit.channels.join(", ")}`:"-"})]}),Object.entries(e.integrations).map(([c,d])=>{const u=d.active??d.available??!1,h=d.active?"active":d.available?"available":"unavailable";let v=d.mode?`Mode: ${d.mode}`:"-";return c==="edgePlugin"&&d.active?v="@serverStats() tag registered":c==="cacheInspector"&&d.available?v="Redis dependency detected":c==="queueInspector"&&d.available&&(v="Queue dependency detected"),t("tr",{children:[t("td",{children:Sr(c)}),t("td",{children:[t(_e,{status:u?"active":"inactive",prefix:r}),h]}),t("td",{className:`${r}-c-dim`,style:{fontSize:"11px"},children:v})]},c)})]})]}),e.storage&&t(O,{children:[t("h3",{className:`${r}-internals-title`,children:"Storage (SQLite)"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Metric"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Status"}),t("td",{children:[t(_e,{status:e.storage.ready?"ready":"inactive",prefix:r}),e.storage.ready?"ready":"not ready"]})]}),t("tr",{children:[t("td",{children:"DB Path"}),t("td",{children:t("code",{children:e.storage.dbPath})})]}),t("tr",{children:[t("td",{children:"File Size"}),t("td",{children:[e.storage.fileSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"WAL Size"}),t("td",{children:[e.storage.walSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"Retention"}),t("td",{children:[e.storage.retentionDays," days"]})]}),t("tr",{children:[t("td",{children:"Last Cleanup"}),t("td",{children:e.storage.lastCleanupAt?Z(e.storage.lastCleanupAt):"-"})]})]})]}),e.storage.tables.length>0&&t("table",{className:s,style:{marginTop:8},children:[t("thead",{children:t("tr",{children:[t("th",{children:"Table"}),t("th",{children:"Rows"})]})}),t("tbody",{children:e.storage.tables.map(c=>t("tr",{children:[t("td",{children:t("code",{children:c.name})}),t("td",{children:c.rowCount.toLocaleString()})]},c.name))})]})]}),t("h3",{className:`${r}-internals-title`,children:"Resolved Config"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"intervalMs"}),t("td",{children:e.config.intervalMs})]}),t("tr",{children:[t("td",{children:"transport"}),t("td",{children:e.config.transport})]}),t("tr",{children:[t("td",{children:"channelName"}),t("td",{children:e.config.channelName})]}),t("tr",{children:[t("td",{children:"endpoint"}),t("td",{children:e.config.endpoint===!1?"false":e.config.endpoint})]}),t("tr",{children:[t("td",{children:"skipInTest"}),t("td",{children:i("skipInTest",e.config.skipInTest)})]}),t("tr",{children:[t("td",{children:"onStats callback"}),t("td",{children:e.config.hasOnStatsCallback?"defined":"not defined"})]}),t("tr",{children:[t("td",{children:"shouldShow callback"}),t("td",{children:e.config.hasShouldShowCallback?"defined":"not defined"})]})]})]}),t("h4",{className:`${r}-internals-title`,children:"DevToolbar"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:Object.entries(e.devToolbar).map(([c,d])=>t("tr",{children:[t("td",{children:c==="customPaneCount"?"customPanes":c}),t("td",{children:c==="customPaneCount"?`${d} registered`:i(c,d)})]},c))})]})]})}function Ns({options:e={},debugEndpoint:s="/admin/api/debug"}){const{baseUrl:n="",authToken:r}=e,[o,a]=$(null),[l,i]=$(!0),[c,d]=$(null),u=H(null),h=Jt(n,r),v=R(async()=>{try{const m=await h().get(`${s}/diagnostics`);a(m),d(null),i(!1)}catch(p){if(p instanceof We){d(p),i(!1),u.current&&(clearInterval(u.current),u.current=null);return}d(p instanceof Error?p:new Error(String(p))),i(!1)}},[s,h]);return W(()=>(i(!0),d(null),v(),u.current=setInterval(v,Ot),()=>{u.current&&(clearInterval(u.current),u.current=null)}),[v]),l&&!o?t("div",{className:"ss-dash-empty",children:"Loading diagnostics..."}):c?t("div",{className:"ss-dash-empty",children:["Error: ",c.message]}):o?t(qr,{data:o,tableClassName:"ss-dash-table",classPrefix:"ss-dash"}):t("div",{className:"ss-dash-empty",children:"Diagnostics not available"})}const Pr=Object.freeze(Object.defineProperty({__proto__:null,InternalsSection:Ns,default:Ns},Symbol.toStringTag,{value:"Module"}))})();
1
+ (function(){"use strict";var ye,E,tt,oe,st,nt,rt,at,De,Fe,Oe,be={},we=[],$s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pe=Array.isArray;function ee(e,s){for(var n in s)e[n]=s[n];return e}function Ie(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ne(e,s,n){var r,i,a,l={};for(a in s)a=="key"?r=s[a]:a=="ref"?i=s[a]:l[a]=s[a];if(arguments.length>2&&(l.children=arguments.length>3?ye.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)l[a]===void 0&&(l[a]=e.defaultProps[a]);return xe(e,l,r,i,null)}function xe(e,s,n,r,i){var a={type:e,props:s,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++tt,__i:-1,__u:0};return i==null&&E.vnode!=null&&E.vnode(a),a}function M(e){return e.children}function te(e,s){this.props=e,this.context=s}function de(e,s){if(s==null)return e.__?de(e.__,e.__i+1):null;for(var n;s<e.__k.length;s++)if((n=e.__k[s])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?de(e):null}function Ss(e){if(e.__P&&e.__d){var s=e.__v,n=s.__e,r=[],i=[],a=ee({},s);a.__v=s.__v+1,E.vnode&&E.vnode(a),je(e.__P,a,s,e.__n,e.__P.namespaceURI,32&s.__u?[n]:null,r,n??de(s),!!(32&s.__u),i),a.__v=s.__v,a.__.__k[a.__i]=a,ut(r,a,i),s.__e=s.__=null,a.__e!=n&&lt(a)}}function lt(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(s){if(s!=null&&s.__e!=null)return e.__e=e.__c.base=s.__e}),lt(e)}function it(e){(!e.__d&&(e.__d=!0)&&oe.push(e)&&!ke.__r++||st!=E.debounceRendering)&&((st=E.debounceRendering)||nt)(ke)}function ke(){for(var e,s=1;oe.length;)oe.length>s&&oe.sort(rt),e=oe.shift(),s=oe.length,Ss(e);ke.__r=0}function ot(e,s,n,r,i,a,l,o,c,d,u){var h,v,p,m,_,S,x,N=r&&r.__k||we,f=s.length;for(c=Cs(n,s,N,c,f),h=0;h<f;h++)(p=n.__k[h])!=null&&(v=p.__i!=-1&&N[p.__i]||be,p.__i=h,S=je(e,p,v,i,a,l,o,c,d,u),m=p.__e,p.ref&&v.ref!=p.ref&&(v.ref&&Ue(v.ref,null,p),u.push(p.ref,p.__c||m,p)),_==null&&m!=null&&(_=m),(x=!!(4&p.__u))||v.__k===p.__k?c=ct(p,c,e,x):typeof p.type=="function"&&S!==void 0?c=S:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=_,c}function Cs(e,s,n,r,i){var a,l,o,c,d,u=n.length,h=u,v=0;for(e.__k=new Array(i),a=0;a<i;a++)(l=s[a])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[a]=xe(null,l,null,null,null):pe(l)?l=e.__k[a]=xe(M,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[a]=xe(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[a]=l,c=a+v,l.__=e,l.__b=e.__b+1,o=null,(d=l.__i=Ts(l,n,c,h))!=-1&&(h--,(o=n[d])&&(o.__u|=2)),o==null||o.__v==null?(d==-1&&(i>u?v--:i<u&&v++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?v--:d==c+1?v++:(d>c?v--:v++,l.__u|=4))):e.__k[a]=null;if(h)for(a=0;a<u;a++)(o=n[a])!=null&&(2&o.__u)==0&&(o.__e==r&&(r=de(o)),ft(o,o));return r}function ct(e,s,n,r){var i,a;if(typeof e.type=="function"){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,s=ct(i[a],s,n,r));return s}e.__e!=s&&(r&&(s&&e.type&&!s.parentNode&&(s=de(e)),n.insertBefore(e.__e,s||null)),s=e.__e);do s=s&&s.nextSibling;while(s!=null&&s.nodeType==8);return s}function $e(e,s){return s=s||[],e==null||typeof e=="boolean"||(pe(e)?e.some(function(n){$e(n,s)}):s.push(e)),s}function Ts(e,s,n,r){var i,a,l,o=e.key,c=e.type,d=s[n],u=d!=null&&(2&d.__u)==0;if(d===null&&o==null||u&&o==d.key&&c==d.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<s.length;)if((d=s[l=i>=0?i--:a++])!=null&&(2&d.__u)==0&&o==d.key&&c==d.type)return l}return-1}function dt(e,s,n){s[0]=="-"?e.setProperty(s,n??""):e[s]=n==null?"":typeof n!="number"||$s.test(s)?n:n+"px"}function Se(e,s,n,r,i){var a,l;e:if(s=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(s in r)n&&s in n||dt(e.style,s,"");if(n)for(s in n)r&&n[s]==r[s]||dt(e.style,s,n[s])}else if(s[0]=="o"&&s[1]=="n")a=s!=(s=s.replace(at,"$1")),l=s.toLowerCase(),s=l in e||s=="onFocusOut"||s=="onFocusIn"?l.slice(2):s.slice(2),e.l||(e.l={}),e.l[s+a]=n,n?r?n.u=r.u:(n.u=De,e.addEventListener(s,a?Oe:Fe,a)):e.removeEventListener(s,a?Oe:Fe,a);else{if(i=="http://www.w3.org/2000/svg")s=s.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(s!="width"&&s!="height"&&s!="href"&&s!="list"&&s!="form"&&s!="tabIndex"&&s!="download"&&s!="rowSpan"&&s!="colSpan"&&s!="role"&&s!="popover"&&s in e)try{e[s]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&s[4]!="-"?e.removeAttribute(s):e.setAttribute(s,s=="popover"&&n==1?"":n))}}function ht(e){return function(s){if(this.l){var n=this.l[s.type+e];if(s.t==null)s.t=De++;else if(s.t<n.u)return;return n(E.event?E.event(s):s)}}}function je(e,s,n,r,i,a,l,o,c,d){var u,h,v,p,m,_,S,x,N,f,k,w,L,R,D,P=s.type;if(s.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[o=s.__e=n.__e]),(u=E.__b)&&u(s);e:if(typeof P=="function")try{if(x=s.props,N="prototype"in P&&P.prototype.render,f=(u=P.contextType)&&r[u.__c],k=u?f?f.props.value:u.__:r,n.__c?S=(h=s.__c=n.__c).__=h.__E:(N?s.__c=h=new P(x,k):(s.__c=h=new te(x,k),h.constructor=P,h.render=Es),f&&f.sub(h),h.state||(h.state={}),h.__n=r,v=h.__d=!0,h.__h=[],h._sb=[]),N&&h.__s==null&&(h.__s=h.state),N&&P.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=ee({},h.__s)),ee(h.__s,P.getDerivedStateFromProps(x,h.__s))),p=h.props,m=h.state,h.__v=s,v)N&&P.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),N&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(N&&P.getDerivedStateFromProps==null&&x!==p&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(x,k),s.__v==n.__v||!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(x,h.__s,k)===!1){s.__v!=n.__v&&(h.props=x,h.state=h.__s,h.__d=!1),s.__e=n.__e,s.__k=n.__k,s.__k.some(function(U){U&&(U.__=s)}),we.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&l.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(x,h.__s,k),N&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(p,m,_)})}if(h.context=k,h.props=x,h.__P=e,h.__e=!1,w=E.__r,L=0,N)h.state=h.__s,h.__d=!1,w&&w(s),u=h.render(h.props,h.state,h.context),we.push.apply(h.__h,h._sb),h._sb=[];else do h.__d=!1,w&&w(s),u=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++L<25);h.state=h.__s,h.getChildContext!=null&&(r=ee(ee({},r),h.getChildContext())),N&&!v&&h.getSnapshotBeforeUpdate!=null&&(_=h.getSnapshotBeforeUpdate(p,m)),R=u!=null&&u.type===M&&u.key==null?pt(u.props.children):u,o=ot(e,pe(R)?R:[R],s,n,r,i,a,l,o,c,d),h.base=s.__e,s.__u&=-161,h.__h.length&&l.push(h),S&&(h.__E=h.__=null)}catch(U){if(s.__v=null,c||a!=null)if(U.then){for(s.__u|=c?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;a[a.indexOf(o)]=null,s.__e=o}else{for(D=a.length;D--;)Ie(a[D]);Be(s)}else s.__e=n.__e,s.__k=n.__k,U.then||Be(s);E.__e(U,s,n)}else a==null&&s.__v==n.__v?(s.__k=n.__k,s.__e=n.__e):o=s.__e=Ls(n.__e,s,n,r,i,a,l,c,d);return(u=E.diffed)&&u(s),128&s.__u?void 0:o}function Be(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Be))}function ut(e,s,n){for(var r=0;r<n.length;r++)Ue(n[r],n[++r],n[++r]);E.__c&&E.__c(s,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(a){a.call(i)})}catch(a){E.__e(a,i.__v)}})}function pt(e){return typeof e!="object"||e==null||e.__b>0?e:pe(e)?e.map(pt):ee({},e)}function Ls(e,s,n,r,i,a,l,o,c){var d,u,h,v,p,m,_,S=n.props||be,x=s.props,N=s.type;if(N=="svg"?i="http://www.w3.org/2000/svg":N=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(d=0;d<a.length;d++)if((p=a[d])&&"setAttribute"in p==!!N&&(N?p.localName==N:p.nodeType==3)){e=p,a[d]=null;break}}if(e==null){if(N==null)return document.createTextNode(x);e=document.createElementNS(i,N,x.is&&x),o&&(E.__m&&E.__m(s,a),o=!1),a=null}if(N==null)S===x||o&&e.data==x||(e.data=x);else{if(a=a&&ye.call(e.childNodes),!o&&a!=null)for(S={},d=0;d<e.attributes.length;d++)S[(p=e.attributes[d]).name]=p.value;for(d in S)p=S[d],d=="dangerouslySetInnerHTML"?h=p:d=="children"||d in x||d=="value"&&"defaultValue"in x||d=="checked"&&"defaultChecked"in x||Se(e,d,null,p,i);for(d in x)p=x[d],d=="children"?v=p:d=="dangerouslySetInnerHTML"?u=p:d=="value"?m=p:d=="checked"?_=p:o&&typeof p!="function"||S[d]===p||Se(e,d,p,S[d],i);if(u)o||h&&(u.__html==h.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),s.__k=[];else if(h&&(e.innerHTML=""),ot(s.type=="template"?e.content:e,pe(v)?v:[v],s,n,r,N=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,l,a?a[0]:n.__k&&de(n,0),o,c),a!=null)for(d=a.length;d--;)Ie(a[d]);o||(d="value",N=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||N=="progress"&&!m||N=="option"&&m!=S[d])&&Se(e,d,m,S[d],i),d="checked",_!=null&&_!=e[d]&&Se(e,d,_,S[d],i))}return e}function Ue(e,s,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&s==null||(e.__u=e(s))}else e.current=s}catch(i){E.__e(i,n)}}function ft(e,s,n){var r,i;if(E.unmount&&E.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Ue(r,null,s)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){E.__e(a,s)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ft(r[i],s,n||typeof e.type!="function");n||Ie(e.__e),e.__c=e.__=e.__e=void 0}function Es(e,s,n){return this.constructor(e,n)}function As(e,s,n){var r,i,a,l;s==document&&(s=document.documentElement),E.__&&E.__(e,s),i=(r=!1)?null:s.__k,a=[],l=[],je(s,e=s.__k=Ne(M,null,[e]),i||be,be,s.namespaceURI,i?null:s.firstChild?ye.call(s.childNodes):null,a,i?i.__e:s.firstChild,r,l),ut(a,e,l)}ye=we.slice,E={__e:function(e,s,n,r){for(var i,a,l;s=s.__;)if((i=s.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),l=i.__d),l)return i.__E=i}catch(o){e=o}throw e}},tt=0,te.prototype.setState=function(e,s){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ee({},this.state),typeof e=="function"&&(e=e(ee({},n),this.props)),e&&ee(n,e),e!=null&&this.__v&&(s&&this._sb.push(s),it(this))},te.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),it(this))},te.prototype.render=M,oe=[],nt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rt=function(e,s){return e.__v.__b-s.__v.__b},ke.__r=0,at=/(PointerCapture)$|Capture$/i,De=0,Fe=ht(!1),Oe=ht(!0);var Rs=0;function t(e,s,n,r,i,a){s||(s={});var l,o,c=s;if("ref"in c)for(o in c={},s)o=="ref"?l=s[o]:c[o]=s[o];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Rs,__i:-1,__u:0,__source:i,__self:a};if(typeof e=="function"&&(l=e.defaultProps))for(o in l)c[o]===void 0&&(c[o]=l[o]);return E.vnode&&E.vnode(d),d}var fe,I,He,mt,me=0,vt=[],B=E,_t=B.__b,gt=B.__r,yt=B.diffed,bt=B.__c,wt=B.unmount,Nt=B.__;function ze(e,s){B.__h&&B.__h(I,e,me||s),me=0;var n=I.__H||(I.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function $(e){return me=1,Ps($t,e)}function Ps(e,s,n){var r=ze(fe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(s):$t(void 0,s),function(o){var c=r.__N?r.__N[0]:r.__[0],d=r.t(c,o);c!==d&&(r.__N=[d,r.__[1]],r.__c.setState({}))}],r.__c=I,!I.__f)){var i=function(o,c,d){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(v){return v.__c});if(u.every(function(v){return!v.__N}))return!a||a.call(this,o,c,d);var h=r.__c.props!==o;return u.some(function(v){if(v.__N){var p=v.__[0];v.__=v.__N,v.__N=void 0,p!==v.__[0]&&(h=!0)}}),a&&a.call(this,o,c,d)||h};I.__f=!0;var a=I.shouldComponentUpdate,l=I.componentWillUpdate;I.componentWillUpdate=function(o,c,d){if(this.__e){var u=a;a=void 0,i(o,c,d),a=u}l&&l.call(this,o,c,d)},I.shouldComponentUpdate=i}return r.__N||r.__}function W(e,s){var n=ze(fe++,3);!B.__s&&kt(n.__H,s)&&(n.__=e,n.u=s,I.__H.__h.push(n))}function H(e){return me=5,z(function(){return{current:e}},[])}function z(e,s){var n=ze(fe++,7);return kt(n.__H,s)&&(n.__=e(),n.__H=s,n.__h=e),n.__}function A(e,s){return me=8,z(function(){return e},s)}function qs(){for(var e;e=vt.shift();){var s=e.__H;if(e.__P&&s)try{s.__h.some(Ce),s.__h.some(Ve),s.__h=[]}catch(n){s.__h=[],B.__e(n,e.__v)}}}B.__b=function(e){I=null,_t&&_t(e)},B.__=function(e,s){e&&s.__k&&s.__k.__m&&(e.__m=s.__k.__m),Nt&&Nt(e,s)},B.__r=function(e){gt&&gt(e),fe=0;var s=(I=e.__c).__H;s&&(He===I?(s.__h=[],I.__h=[],s.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(s.__h.some(Ce),s.__h.some(Ve),s.__h=[],fe=0)),He=I},B.diffed=function(e){yt&&yt(e);var s=e.__c;s&&s.__H&&(s.__H.__h.length&&(vt.push(s)!==1&&mt===B.requestAnimationFrame||((mt=B.requestAnimationFrame)||Ms)(qs)),s.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),He=I=null},B.__c=function(e,s){s.some(function(n){try{n.__h.some(Ce),n.__h=n.__h.filter(function(r){return!r.__||Ve(r)})}catch(r){s.some(function(i){i.__h&&(i.__h=[])}),s=[],B.__e(r,n.__v)}}),bt&&bt(e,s)},B.unmount=function(e){wt&&wt(e);var s,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{Ce(r)}catch(i){s=i}}),n.__H=void 0,s&&B.__e(s,n.__v))};var xt=typeof requestAnimationFrame=="function";function Ms(e){var s,n=function(){clearTimeout(r),xt&&cancelAnimationFrame(s),setTimeout(e)},r=setTimeout(n,35);xt&&(s=requestAnimationFrame(n))}function Ce(e){var s=I,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),I=s}function Ve(e){var s=I;e.__c=e.__(),I=s}function kt(e,s){return!e||e.length!==s.length||s.some(function(n,r){return n!==e[r]})}function $t(e,s){return typeof s=="function"?s(e):s}function Ds(e,s){for(var n in s)e[n]=s[n];return e}function St(e,s){for(var n in e)if(n!=="__source"&&!(n in s))return!0;for(var r in s)if(r!=="__source"&&e[r]!==s[r])return!0;return!1}function Ct(e,s){this.props=e,this.context=s}(Ct.prototype=new te).isPureReactComponent=!0,Ct.prototype.shouldComponentUpdate=function(e,s){return St(this.props,e)||St(this.state,s)};var Tt=E.__b;E.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Tt&&Tt(e)};var Fs=E.__e;E.__e=function(e,s,n,r){if(e.then){for(var i,a=s;a=a.__;)if((i=a.__c)&&i.__c)return s.__e==null&&(s.__e=n.__e,s.__k=n.__k),i.__c(e,s)}Fs(e,s,n,r)};var Lt=E.unmount;function Et(e,s,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Ds({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=s),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Et(r,s,n)})),e}function At(e,s,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return At(r,s,n)}),e.__c&&e.__c.__P===s&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Te(){this.__u=0,this.o=null,this.__b=null}function Rt(e){if(!e.__)return null;var s=e.__.__c;return s&&s.__a&&s.__a(e)}function J(e){var s,n,r,i=null;function a(l){if(s||(s=e()).then(function(o){o&&(i=o.default||o),r=!0},function(o){n=o,r=!0}),n)throw n;if(!r)throw s;return i?Ne(i,l):null}return a.displayName="Lazy",a.__f=!0,a}function Le(){this.i=null,this.l=null}E.unmount=function(e){var s=e.__c;s&&(s.__z=!0),s&&s.__R&&s.__R(),s&&32&e.__u&&(e.type=null),Lt&&Lt(e)},(Te.prototype=new te).__c=function(e,s){var n=s.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var i=Rt(r.__v),a=!1,l=function(){a||r.__z||(a=!0,n.__R=null,i?i(c):c())};n.__R=l;var o=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var d=r.state.__a;r.__v.__k[0]=At(d,d.__c.__P,d.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.__P=o,u.forceUpdate()}};r.__u++||32&s.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(l,l)},Te.prototype.componentWillUnmount=function(){this.o=[]},Te.prototype.render=function(e,s){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Et(this.__b,n,r.__O=r.__P)}this.__b=null}var i=s.__a&&Ne(M,null,e.fallback);return i&&(i.__u&=-33),[Ne(M,null,s.__a?null:e.children),i]};var Pt=function(e,s,n){if(++n[1]===n[0]&&e.l.delete(s),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Le.prototype=new te).__a=function(e){var s=this,n=Rt(s.__v),r=s.l.get(e);return r[0]++,function(i){var a=function(){s.props.revealOrder?(r.push(i),Pt(s,e,r)):i()};n?n(a):a()}},Le.prototype.render=function(e){this.i=null,this.l=new Map;var s=$e(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&s.reverse();for(var n=s.length;n--;)this.l.set(s[n],this.i=[1,0,this.i]);return e.children},Le.prototype.componentDidUpdate=Le.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(s,n){Pt(e,n,s)})};var Os=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Is=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,js=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Bs=/[A-Z0-9]/g,Us=typeof document<"u",Hs=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};te.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(te.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(s){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:s})}})});var qt=E.event;function zs(){}function Vs(){return this.cancelBubble}function Ws(){return this.defaultPrevented}E.event=function(e){return qt&&(e=qt(e)),e.persist=zs,e.isPropagationStopped=Vs,e.isDefaultPrevented=Ws,e.nativeEvent=e};var Ks={enumerable:!1,configurable:!0,get:function(){return this.class}},Mt=E.vnode;E.vnode=function(e){typeof e.type=="string"&&(function(s){var n=s.props,r=s.type,i={},a=r.indexOf("-")===-1;for(var l in n){var o=n[l];if(!(l==="value"&&"defaultValue"in n&&o==null||Us&&l==="children"&&r==="noscript"||l==="class"||l==="className")){var c=l.toLowerCase();l==="defaultValue"&&"value"in n&&n.value==null?l="value":l==="download"&&o===!0?o="":c==="translate"&&o==="no"?o=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?l="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||Hs(n.type)?c==="onfocus"?l="onfocusin":c==="onblur"?l="onfocusout":js.test(l)&&(l=c):c=l="oninput":a&&Is.test(l)?l=l.replace(Bs,"-$&").toLowerCase():o===null&&(o=void 0),c==="oninput"&&i[l=c]&&(l="oninputCapture"),i[l]=o}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=$e(n.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=$e(n.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",Ks)):n.className&&(i.class=i.className=n.className),s.props=i})(e),e.$$typeof=Os,Mt&&Mt(e)};var Dt=E.__r;E.__r=function(e){Dt&&Dt(e),e.__c};var Ft=E.diffed;E.diffed=function(e){Ft&&Ft(e);var s=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in s&&s.value!==n.value&&(n.value=s.value==null?"":s.value)};var We={Fragment:M};const O={queries:{viewBox:"0 0 24 24",elements:['<ellipse cx="12" cy="5" rx="9" ry="3"/>','<path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/>','<path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>']},events:{viewBox:"0 0 24 24",elements:['<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>']},emails:{viewBox:"0 0 24 24",elements:['<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>','<polyline points="22,6 12,13 2,6"/>']},routes:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<line x1="2" y1="12" x2="22" y2="12"/>','<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>']},logs:{viewBox:"0 0 24 24",elements:['<line x1="8" y1="6" x2="21" y2="6"/>','<line x1="8" y1="12" x2="21" y2="12"/>','<line x1="8" y1="18" x2="21" y2="18"/>','<line x1="3" y1="6" x2="3.01" y2="6"/>','<line x1="3" y1="12" x2="3.01" y2="12"/>','<line x1="3" y1="18" x2="3.01" y2="18"/>']},timeline:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},cache:{viewBox:"0 0 24 24",elements:['<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/>','<rect x="2" y="14" width="20" height="8" rx="2" ry="2"/>','<line x1="6" y1="6" x2="6.01" y2="6"/>','<line x1="6" y1="18" x2="6.01" y2="18"/>']},jobs:{viewBox:"0 0 24 24",elements:['<rect x="2" y="7" width="20" height="14" rx="2" ry="2"/>','<path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/>']},config:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="3"/>','<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>']},internals:{viewBox:"0 0 24 24",elements:['<rect x="4" y="4" width="16" height="16" rx="2"/>','<rect x="9" y="9" width="6" height="6"/>','<line x1="9" y1="1" x2="9" y2="4"/>','<line x1="15" y1="1" x2="15" y2="4"/>','<line x1="9" y1="20" x2="9" y2="23"/>','<line x1="15" y1="20" x2="15" y2="23"/>','<line x1="20" y1="9" x2="23" y2="9"/>','<line x1="20" y1="14" x2="23" y2="14"/>','<line x1="1" y1="9" x2="4" y2="9"/>','<line x1="1" y1="14" x2="4" y2="14"/>']},overview:{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="7" height="7"/>','<rect x="14" y="3" width="7" height="7"/>','<rect x="14" y="14" width="7" height="7"/>','<rect x="3" y="14" width="7" height="7"/>']},requests:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},"dashboard-timeline":{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<polyline points="12 6 12 12 16 14"/>']},"custom-pane":{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="18" height="18" rx="2"/>','<path d="M9 3v18"/>']},wrench:{viewBox:"0 0 24 24",elements:['<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>']},"external-link":{viewBox:"0 0 24 24",elements:['<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>','<polyline points="15 3 21 3 21 9"/>','<line x1="10" y1="14" x2="21" y2="3"/>']},sun:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="5"/>','<line x1="12" y1="1" x2="12" y2="3"/>','<line x1="12" y1="21" x2="12" y2="23"/>','<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>','<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>','<line x1="1" y1="12" x2="3" y2="12"/>','<line x1="21" y1="12" x2="23" y2="12"/>','<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>','<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>']},moon:{viewBox:"0 0 24 24",elements:['<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>']},search:{viewBox:"0 0 24 24",elements:['<circle cx="11" cy="11" r="8"/>','<line x1="21" y1="21" x2="16.65" y2="16.65"/>']},eye:{viewBox:"0 0 24 24",elements:['<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>','<circle cx="12" cy="12" r="3"/>']},"eye-off":{viewBox:"0 0 24 24",elements:['<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/>','<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/>','<line x1="1" y1="1" x2="23" y2="23"/>','<path d="M14.12 14.12a3 3 0 1 1-4.24-4.24"/>']},"chevron-right":{viewBox:"0 0 24 24",elements:['<path d="M9 18l6-6-6-6"/>']},"chevron-left":{viewBox:"0 0 24 24",elements:['<path d="M15 18l-6-6 6-6"/>']},"open-external":{viewBox:"0 0 16 16",elements:['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']}};function Qs(e,s){const n=e||(typeof window<"u"?window.location.origin:"");if(!s)return{baseUrl:n};const r={headers:{Authorization:`Bearer ${s}`}};return{baseUrl:n,beforeSubscribe(i){return r},beforeUnsubscribe(i){return r}}}async function Js(){if(typeof window<"u"&&window.Transmit&&typeof window.Transmit=="function")return window.Transmit;try{const e=await import("@adonisjs/transmit-client");return e.Transmit??e.default??null}catch{return null}}function Gs(e){let s=null,n=null,r=!1;return{subscribe:async()=>{try{const l=await Js();if(!l)throw new Error("Transmit client not available (neither window.Transmit nor @adonisjs/transmit-client)");if(r)return;s=new l(Qs(e.baseUrl,e.authToken)),n=s.subscription(e.channelName),n.onMessage(o=>{r||e.onMessage(o)}),await n.create()}catch(l){e.onError?.(l)}},unsubscribe:async()=>{r=!0;try{await n?.delete(),n=null,s=null}catch{}}}}function Ys(e){let s=!1;const n=Gs({baseUrl:e.baseUrl,channelName:e.channelName,authToken:e.authToken,onMessage:e.onMessage,onError:r=>{s=!0,e.onError?.(r),e.onDisconnect?.()}});return n.subscribe().then(()=>{s||e.onConnect?.()}).catch(r=>{e.onError?.(r),e.onDisconnect?.()}),{unsubscribe:()=>{n.unsubscribe().catch(()=>{})}}}class Ke extends Error{status;constructor(s=403){super(`Unauthorized (HTTP ${s})`),this.name="UnauthorizedError",this.status=s}}class Zs extends Error{status;body;constructor(s,n){super(`API error (HTTP ${s})`),this.name="ApiError",this.status=s,this.body=n}}class Qe{baseUrl;authToken;constructor(s){this.baseUrl=s.baseUrl.replace(/\/+$/,""),this.authToken=s.authToken}async fetch(s,n){const i={...{Accept:"application/json",...this.authToken?{Authorization:`Bearer ${this.authToken}`}:{}},...n?.headers},a=await globalThis.fetch(`${this.baseUrl}${s}`,{...n,headers:i,credentials:this.authToken?"omit":"include"});if(n?.signal?.aborted)throw new DOMException("The operation was aborted.","AbortError");if(a.status===401||a.status===403)throw new Ke(a.status);if(!a.ok){const l=await a.text().catch(()=>"");throw new Zs(a.status,l)}return a.json()}async get(s,n){const r=n?`${s}?${n}`:s;return this.fetch(r)}async post(s,n){const r={method:"POST",...n!==void 0?{body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}:{}};return this.fetch(s,r)}async delete(s){return this.fetch(s,{method:"DELETE"})}}const Xs=5e3,Ot=1e4,It=100,en=500,tn={overview:"/overview",requests:"/requests",queries:"/queries",events:"/events",routes:"/routes",logs:"/logs",emails:"/emails",timeline:"/traces",cache:"/cache",jobs:"/jobs",config:"/config"};function sn(e){return tn[e]||`/${e}`}class nn{constructor(s,n){this.client=s,this.basePath=n}async fetchSection(s,n,r){const i=sn(s),a=n?`${this.basePath}${i}?${n}`:`${this.basePath}${i}`;return this.client.fetch(a,r)}async fetchChart(s){return this.client.fetch(`${this.basePath}/overview/chart?range=${s}`)}async fetchGroupedQueries(){return this.client.fetch(`${this.basePath}/queries/grouped`)}async explainQuery(s){return this.client.fetch(`${this.basePath}/queries/${s}/explain`)}async retryJob(s){return this.client.fetch(`${this.basePath}/jobs/${s}/retry`,{method:"POST"})}async fetchCacheKey(s){return this.client.fetch(`${this.basePath}/cache/${encodeURIComponent(s)}`)}async deleteCacheKey(s){return this.client.fetch(`${this.basePath}/cache/${encodeURIComponent(s)}`,{method:"DELETE"})}async fetchEmailPreview(s){return this.client.fetch(`${this.basePath}/emails/${s}/preview`)}}function rn(e){if(!e||typeof e!="object")return!1;const s=e;return s.data!==void 0&&s.meta!==void 0}function an(e,s){return s.aborted?!0:e instanceof DOMException&&e.name==="AbortError"}const ln=[{key:"page",param:"page",isNumeric:!0},{key:"perPage",param:"perPage",isNumeric:!0},{key:"search",param:"search"},{key:"sort",param:"sort"},{key:"sortDir",param:"direction"},{key:"timeRange",param:"range"}];function on(e){const s=new URLSearchParams,n=e;for(const{key:r,param:i,isNumeric:a}of ln){const l=n[r];(a?l!=null:l)&&s.set(i,String(l))}if(e.filters)for(const[r,i]of Object.entries(e.filters))i&&s.set(r,i);return s.toString()}function cn(e,s,n=2){if(s<=1)return[1];const r=[],i=Math.max(2,e-n),a=Math.min(s-1,e+n);r.push(1),i>2&&r.push("...");for(let l=i;l<=a;l++)r.push(l);return a<s-1&&r.push("..."),s>1&&r.push(s),r}class dn{client;api;callbacks;endpoint;perPage;section;page=1;search;sort;sortDir;filters;timeRange;timer=null;fetchId=0;explicitFetchPending=!1;hasFetched=!1;stopped=!1;abortController=null;constructor(s){this.client=new Qe({baseUrl:s.baseUrl,authToken:s.authToken}),this.api=new nn(this.client,s.endpoint),this.endpoint=s.endpoint,this.section=s.section,this.perPage=s.perPage,this.callbacks=s.callbacks}start(){this.stopped=!1,this.fetch(!1),this.startRefreshTimer()}stop(){this.stopped=!0,this.stopRefreshTimer(),this.abortController?.abort(),this.abortController=null}async fetch(s=!0){if(this.shouldSkipFetch(s))return;const{controller:n,myFetchId:r}=this.prepareFetch(s);try{const i=await this.executeFetch(n);if(this.isStaleResponse(r))return;this.applyFetchResult(i)}catch(i){if(this.shouldIgnoreError(i,n.signal,r))return;this.handleFetchError(i,s)}finally{s||(this.explicitFetchPending=!1)}}setSection(s){this.section!==s&&(this.section=s,this.page=1,this.search=void 0,this.sort=void 0,this.sortDir=void 0,this.filters=void 0,this.hasFetched=!1,this.callbacks.onData(null),this.callbacks.onPagination(null),this.callbacks.onLoading(!0),this.callbacks.onError(null),this.fetch(!1),this.startRefreshTimer())}setPage(s){this.page=s,this.fetch(!1)}setSearch(s){this.search=s||void 0,this.page=1,this.fetch(!1)}setFilter(s,n){this.filters||(this.filters={}),this.filters[s]=String(n),this.page=1,this.fetch(!1)}setSort(s,n){this.sort===s&&!n?this.sortDir=this.sortDir==="asc"?"desc":"asc":(this.sort=s,this.sortDir=n||"desc"),this.fetch(!1)}setTimeRange(s){this.timeRange=s,this.fetch(!1)}async mutate(s,n="post",r){const i=`${this.endpoint}/${s}`;try{const a=n==="post"?await this.client.post(i,r):await this.client.delete(i);return await this.fetch(!0),a}catch(a){throw a instanceof Error?a:new Error(String(a))}}configure(s){s.page!==void 0&&(this.page=s.page),s.perPage!==void 0&&(this.perPage=s.perPage),this.search=s.search,this.sort=s.sort,this.sortDir=s.sortDir,this.filters=s.filters,this.timeRange=s.timeRange}hasData(){return this.hasFetched}handleRefreshSignal(){this.hasFetched&&this.fetch(!0)}getApi(){return this.api}getClient(){return this.client}shouldSkipFetch(s){return s&&this.explicitFetchPending?!0:!this.section}prepareFetch(s){this.abortController?.abort();const n=new AbortController;this.abortController=n;const r=++this.fetchId;return s||(this.callbacks.onLoading(!0),this.explicitFetchPending=!0),{controller:n,myFetchId:r}}async executeFetch(s){const n=this.buildCurrentQueryString();return this.api.fetchSection(this.section,n||void 0,{signal:s.signal})}isStaleResponse(s){return s!==this.fetchId||this.stopped}shouldIgnoreError(s,n,r){return an(s,n)?!0:this.isStaleResponse(r)}buildCurrentQueryString(){const s=this.sort?this.sort.replace(/[A-Z]/g,r=>"_"+r.toLowerCase()):void 0,n=this.filters;return on({page:this.page,perPage:this.perPage,search:this.search,sort:s,sortDir:this.sort?this.sortDir:void 0,filters:n&&Object.keys(n).length>0?n:void 0,timeRange:this.section.startsWith("overview")?this.timeRange:void 0})}applyFetchResult(s){rn(s)?(this.callbacks.onData(s.data),this.callbacks.onPagination(s.meta)):(this.callbacks.onData(s),this.callbacks.onPagination(null)),this.callbacks.onError(null),this.callbacks.onLoading(!1),this.hasFetched=!0}handleFetchError(s,n){if(s instanceof Ke){this.callbacks.onError(s),this.callbacks.onLoading(!1),this.stopRefreshTimer(),this.callbacks.onUnauthorized();return}n||(this.callbacks.onError(s instanceof Error?s:new Error(String(s))),this.callbacks.onLoading(!1))}startRefreshTimer(){this.stopRefreshTimer();const s=this.section==="overview"?Xs:Ot;this.timer=setInterval(()=>this.fetch(!0),s)}stopRefreshTimer(){this.timer&&(clearInterval(this.timer),this.timer=null)}}function hn(e,s){return new dn({baseUrl:s.baseUrl,endpoint:s.dashboardEndpoint,authToken:s.authToken,section:e,perPage:s.perPage,callbacks:{onData:n=>s.setData(n),onPagination:n=>s.setMeta(n),onLoading:n=>s.setIsLoading(n),onError:n=>s.setError(n),onUnauthorized:()=>{}}})}function un(e,s){e.ctrl.configure(s);const n=e.prevSection!==e.section;return n||!e.hasFetched?(n?e.ctrl.setSection(e.section):e.ctrl.start(),!0):(e.ctrl.start(),e.hasFetched)}function pn(){const[e,s]=$(null),[n,r]=$(null),[i,a]=$(!0),[l,o]=$(null);return{data:e,setData:s,meta:n,setMeta:r,isLoading:i,setIsLoading:a,error:l,setError:o}}function fn(e){const s=A(()=>{e.current?.fetch(!0)},[]),n=A(async(i,a="post",l)=>e.current.mutate(i,a,l),[]),r=A(()=>e.current.getApi(),[]);return{refresh:s,mutate:n,getApi:r}}function mn(e,s,n,r){e.current||(e.current=hn(s,{...n,setData:i=>r.setData(i),setMeta:r.setMeta,setIsLoading:r.setIsLoading,setError:r.setError}))}function vn(e){return{baseUrl:e.baseUrl??"",dashboardEndpoint:e.dashboardEndpoint??"/__stats/api",authToken:e.authToken,page:e.page??1,perPage:e.perPage??50,search:e.search,sort:e.sort,sortDir:e.sortDir,filters:e.filters,timeRange:e.timeRange,refreshKey:e.refreshKey}}function K(e,s={}){const n=vn(s),r=pn(),i=H(null),a=H(e),l=H(!1);mn(i,e,n,r),W(()=>{const c=a.current;return a.current=e,l.current=un({ctrl:i.current,section:e,prevSection:c,hasFetched:l.current},n),()=>{i.current.stop()}},[e,n.page,n.perPage,n.search,n.sort,n.sortDir,n.filters,n.timeRange,n.refreshKey]);const o=fn(i);return{data:r.data,meta:r.meta,isLoading:r.isLoading,error:r.error,...o}}const _n=["tracing","process","system","http","db","redis","queues","cache","app","log","emails","dashboard"],jt="/admin/api/debug",Bt={tracing:!1,process:!1,system:!1,http:!1,db:!1,redis:!1,queues:!1,cache:!1,app:!1,log:!1,emails:!1,dashboard:!1,customPanes:[]};function gn(e){const s={customPanes:e.customPanes??[]},n=e.features;for(const r of _n)s[r]=n?.[r]??!1;return s}async function yn(e,s=jt){const n=`${s.replace(/\/+$/,"")}/config`;return e.fetch(n)}async function bn(e){const{baseUrl:s="",debugEndpoint:n=jt,authToken:r}=e,i=new Qe({baseUrl:s,authToken:r});try{const a=await yn(i,n);return gn(a)}catch{return Bt}}function wn(e={}){const{baseUrl:s="",debugEndpoint:n="/admin/api/debug",authToken:r}=e,[i,a]=$(Bt),[l,o]=$(!0),[c,d]=$(null),u=H(!1);return W(()=>{if(u.current)return;u.current=!0;let h=!1;return(async()=>{try{const p=await bn({baseUrl:s,debugEndpoint:n,authToken:r});h||(a(p),o(!1))}catch(p){h||(d(p instanceof Error?p:new Error(String(p))),o(!1))}})(),()=>{h=!0}},[s,n,r]),{features:i,isLoading:l,error:c}}const Ee="ss-dash-theme",Je="ss-theme-change";function Ae(){if(typeof window>"u")return"light";const e=localStorage.getItem(Ee);return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Nn(e){typeof window>"u"||(localStorage.setItem(Ee,e),window.dispatchEvent(new CustomEvent(Je,{detail:e})))}function xn(){const s=Ae()==="dark"?"light":"dark";return Nn(s),s}function Ut(e){if(typeof window>"u")return()=>{};const s=a=>{const l=a.detail;(l==="dark"||l==="light")&&e(l)},n=a=>{if(a.key===Ee){const l=a.newValue;e(l==="dark"||l==="light"?l:Ae())}},r=window.matchMedia("(prefers-color-scheme: dark)"),i=a=>{localStorage.getItem(Ee)||e(a.matches?"dark":"light")};return window.addEventListener(Je,s),window.addEventListener("storage",n),r.addEventListener("change",i),()=>{window.removeEventListener(Je,s),window.removeEventListener("storage",n),r.removeEventListener("change",i)}}function kn(){const[e,s]=$(()=>Ae());W(()=>Ut(i=>{s(i)}),[]);const n=A(()=>{const r=xn();return s(r),r},[]);return{theme:e,toggleTheme:n}}function $n({theme:e,onToggle:s,className:n="",classPrefix:r="ss-dash"}){const i=e==="dark";return t("button",{type:"button",className:`${r==="ss-dbg"?"ss-dbg-theme-toggle":"ss-dash-theme-btn"} ${n}`,onClick:s,title:i?"Switch to light theme":"Switch to dark theme","aria-label":i?"Switch to light theme":"Switch to dark theme",children:i?t("svg",{width:"16",height:"16",viewBox:O.sun.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:O.sun.elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:O.moon.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:O.moon.elements.join("")}})})}const Sn=["overview","requests","queries","events","routes","logs","emails","cache","jobs","config","internals"],Cn=J(()=>Promise.resolve().then(()=>nr)),Tn=J(()=>Promise.resolve().then(()=>_r)),Ln=J(()=>Promise.resolve().then(()=>br)),En=J(()=>Promise.resolve().then(()=>wr)),An=J(()=>Promise.resolve().then(()=>Nr)),Rn=J(()=>Promise.resolve().then(()=>xr)),Pn=J(()=>Promise.resolve().then(()=>kr)),qn=J(()=>Promise.resolve().then(()=>$r)),Mn=J(()=>Promise.resolve().then(()=>Er)),Dn=J(()=>Promise.resolve().then(()=>Or)),Fn=J(()=>Promise.resolve().then(()=>Yr));function On(e){const{baseUrl:s="",dashboardEndpoint:n="/__stats/api",debugEndpoint:r,authToken:i,backUrl:a="/",channelName:l="server-stats/dashboard"}=e,{features:o}=wn({baseUrl:s,debugEndpoint:r,authToken:i}),{theme:c,toggleTheme:d}=kn(),[u,h]=$("overview"),[v,p]=$(()=>typeof window>"u"?!1:localStorage.getItem("ss-dash-sidebar")==="collapsed"),[m,_]=$(!1),[S,x]=$(0),N=H(0);W(()=>{if(!l)return;const T=Ys({baseUrl:s,channelName:l,authToken:i,onMessage:()=>{N.current+=1,x(N.current)},onConnect:()=>_(!0),onDisconnect:()=>_(!1),onError:()=>_(!1)});return()=>T.unsubscribe()},[s,l,i]);const f=o.customPanes||[],k=A(T=>{const F=T.replace("#","").split("?")[0];return F&&[...Sn,...f.map(b=>b.id)].includes(F)?F:"overview"},[f]);W(()=>{if(typeof window>"u")return;const T=k(window.location.hash);(T!=="overview"||window.location.hash)&&h(T)},[k]),W(()=>{const T=()=>{const F=k(window.location.hash);F!==u&&h(F)};return window.addEventListener("hashchange",T),()=>window.removeEventListener("hashchange",T)},[u,k]),W(()=>{typeof window>"u"||(window.location.hash=u)},[u]);const w=A(()=>{p(T=>{const F=!T;return localStorage.setItem("ss-dash-sidebar",F?"collapsed":"expanded"),F})},[]),L=z(()=>[{id:"overview",label:"Overview",visible:!0},{id:"requests",label:"Requests",visible:!0},{id:"queries",label:"Queries",visible:!0},{id:"events",label:"Events",visible:!0},{id:"routes",label:"Routes",visible:!0},{id:"logs",label:"Logs",visible:!0},{id:"emails",label:"Emails",visible:!0},{id:"cache",label:"Cache",visible:o.cache},{id:"jobs",label:"Jobs",visible:o.queues},{id:"config",label:"Config",visible:!0},{id:"internals",label:"Internals",visible:!0}],[o]),R=z(()=>L.filter(T=>T.visible),[L]),D=z(()=>({baseUrl:s,dashboardEndpoint:n,authToken:i,refreshKey:S}),[s,n,i,S]),{data:P}=K("overview",D),U=z(()=>{if(!P)return{};const T={};if(P.totalRequests>0&&(T.requests={count:P.totalRequests}),P.queryStats?.total>0&&(T.queries={count:P.queryStats.total}),P.logLevelBreakdown){const F=P.logLevelBreakdown,X=F.error+F.warn+F.info+F.debug;X>0&&(T.logs={count:X})}return T},[P]),q=A(()=>{const T={overview:t(Cn,{options:D}),requests:t(Tn,{options:D}),queries:t(Ln,{options:D}),events:t(En,{options:D}),routes:t(An,{options:D}),logs:t(Rn,{options:D}),emails:t(Pn,{options:D}),cache:t(qn,{options:D}),jobs:t(Mn,{options:D}),config:t(Dn,{options:D}),internals:t(Fn,{options:D,debugEndpoint:r})};return t("div",{className:"ss-dash-pane ss-dash-active",id:`ss-dash-pane-${u}`,children:t("div",{className:"ss-dash-pane-inner",children:t(Te,{fallback:t("div",{className:"ss-dash-empty",children:"Loading..."}),children:T[u]||t("div",{className:"ss-dash-empty",children:"Unknown section"})})})})},[u,D]);return t("div",{className:"ss-dash","data-theme":c,id:"ss-dash",children:[t("div",{className:"ss-dash-header",children:[t("div",{className:"ss-dash-header-left",children:[t("span",{className:"ss-dash-logo",children:"Server Stats"}),t("span",{className:"ss-dash-logo-sub",children:"Dashboard"})]}),t("div",{className:"ss-dash-header-center",children:[t("span",{className:`ss-dash-live-dot ${m?"ss-dash-connected":""}`,id:"ss-dash-live-dot"}),t("span",{className:`ss-dash-live-label ${m?"ss-dash-connected":""}`,id:"ss-dash-live-label",children:m?"Live":"Polling"})]}),t("div",{className:"ss-dash-header-right",children:[t($n,{theme:c,onToggle:d}),a&&t("a",{href:a,className:"ss-dash-back-link",title:"Back to app",children:"← App"})]})]}),t("div",{className:"ss-dash-body",children:[t("div",{className:`ss-dash-sidebar ${v?"ss-dash-collapsed":""}`,id:"ss-dash-sidebar",children:[t("nav",{className:"ss-dash-nav",children:[R.map(T=>{const F=U[T.id];return t("button",{type:"button",className:`ss-dash-nav-item ${u===T.id?"ss-dash-active":""}`,"data-ss-section":T.id,onClick:()=>{T.id!==u&&h(T.id)},title:v?T.label:void 0,children:[t("span",{className:"ss-dash-nav-icon",children:t("svg",{width:"20",height:"20",viewBox:(O[T.id]||O.config).viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:(O[T.id]||O.config).elements.join("")}})}),t("span",{className:"ss-dash-nav-label",children:T.label}),F&&F.count>0&&t("span",{className:`ss-dash-nav-badge${F.variant?" "+F.variant:""}`,children:F.count})]},T.id)}),f.length>0&&t("div",{className:"ss-dash-nav-sep"}),f.map(T=>t("button",{type:"button",className:`ss-dash-nav-item ${u===T.id?"ss-dash-active":""}`,onClick:()=>h(T.id),title:v?T.label:void 0,children:[t("span",{className:"ss-dash-nav-icon",children:t("svg",{width:"20",height:"20",viewBox:O["custom-pane"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:O["custom-pane"].elements.join("")}})}),t("span",{className:"ss-dash-nav-label",children:T.label})]},T.id))]}),t("button",{type:"button",className:"ss-dash-sidebar-toggle",id:"ss-dash-sidebar-toggle",onClick:w,title:v?"Expand sidebar":"Collapse sidebar",children:v?t("svg",{width:"16",height:"16",viewBox:O["chevron-right"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"1.5",dangerouslySetInnerHTML:{__html:O["chevron-right"].elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:O["chevron-left"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"1.5",dangerouslySetInnerHTML:{__html:O["chevron-left"].elements.join("")}})})]}),t("div",{className:"ss-dash-main",children:q()})]})]})}function In(e){const s=document.getElementById(e);return s?JSON.parse(s.textContent||"{}"):{}}function jn(){function e(s){document.documentElement.setAttribute("data-theme",s)}e(Ae()),Ut(e)}const he=In("ss-dash-config");jn();const Ht=document.getElementById("ss-dash");Ht&&As(t(On,{baseUrl:he.baseUrl,dashboardEndpoint:he.dashboardEndpoint,debugEndpoint:he.debugEndpoint,authToken:he.authToken,backUrl:he.backUrl,channelName:he.channelName}),Ht);function Bn(e){return'"'+(e.length>40?e.slice(0,40)+"...":e)+'"'}function Un(e,s,n){if(e.length===0)return"[]";const r=e.slice(0,3).map(l=>n(l,30)),i=e.length>3?", ..."+e.length+" items":"",a="["+r.join(", ")+i+"]";return a.length>s?"["+e.length+" items]":a}function Hn(e,s,n){const r=Object.keys(e);if(r.length===0)return"{}";const i=[];for(let c=0;c<Math.min(r.length,4);c++)i.push(r[c]+": "+n(e[r[c]],30));const a=r.length>4?", ...+"+(r.length-4):"",l="{ "+i.join(", ")+a+" }";return l.length<=s?l:"{ "+(r.slice(0,6).join(", ")+(r.length>6?", ...":""))+" }"}function zn(e){if(!e&&e!==0)return"-";const s=Math.floor(e),n=Math.floor(s/86400),r=Math.floor(s%86400/3600),i=Math.floor(s%3600/60);return n>0?`${n}d ${r}h`:r>0?`${r}h ${i}m`:i>0?`${i}m ${s%60}s`:`${s}s`}function ne(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:e>=1?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`}function zt(e){return/([+-]\d{2}:?\d{2}|Z)\s*$/.test(e)?e:e+"Z"}function re(e){if(!e)return"-";const s=typeof e=="string"?new Date(zt(e)):new Date(e);return Number.isNaN(s.getTime())?"-":s.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+String(s.getMilliseconds()).padStart(3,"0")}function Z(e){if(!e)return"-";const s=typeof e=="string"?new Date(zt(e)).getTime():e,n=Math.floor((Date.now()-s)/1e3);return n<0?"just now":n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}function se(e){return e>en?"very-slow":e>It?"slow":"normal"}function Ge(e,s=100){return e===null?"null":e===void 0?"-":typeof e=="string"?Bn(e):typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?Un(e,s,Ge):typeof e=="object"?Hn(e,s,Ge):String(e)}function Vn(e){return e<0?"no expiry":e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h`:`${Math.floor(e/86400)}d`}function Wn(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}const Kn={color:"#34d399",fillOpacityTop:.25,fillOpacityBottom:.02,strokeWidth:1.5,width:120,height:32,padding:2};function Qn(e){return{...Kn,...e}}let Jn=0;function Gn(){return`ss-grad-${Jn++}`}function Yn(e){if(e.length===0)return null;let s=e[0],n=e[0],r=e[0];for(let i=1;i<e.length;i++){const a=e[i];a<s&&(s=a),a>n&&(n=a),r+=a}return{min:s,max:n,avg:r/e.length}}function Zn(e,s){if(e.length<2)return null;const n=Qn(s),r=Yn(e),i=r.max-r.min||1,a=n.width-n.padding*2,l=n.height-n.padding*2,o=n.padding,c=e.length,d=Array.from({length:c});for(let _=0;_<c;_++){const S=o+_/(c-1)*a,x=o+l-(e[_]-r.min)/i*l;d[_]=`${S.toFixed(1)},${x.toFixed(1)}`}const u=d.join(" "),h=(o+a).toFixed(1),v=(o+l).toFixed(1),p=o.toFixed(1),m=`M${d[0]} `+d.slice(1).map(_=>`L${_}`).join(" ")+` L${h},${v} L${p},${v} Z`;return{points:u,areaPath:m,gradientId:Gn(),options:n,stats:r}}function Re({data:e,color:s="#34d399",width:n=120,height:r=32,className:i=""}){const a=z(()=>Zn(e,{width:n,height:r}),[e,n,r]),l=z(()=>"ss-grad-"+Math.random().toString(36).slice(2,8),[]),o={"--ss-accent":s};if(!a)return t("div",{className:`ss-dash-sparkline ${i}`,style:o,children:t("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,style:{display:"block"},children:t("text",{x:n/2,y:r/2+3,textAnchor:"middle",fill:"#737373",fontSize:"9",children:["collecting","…"]})})});const c=s||"var(--ss-accent)";return t("div",{className:`ss-dash-sparkline ${i}`,style:o,children:t("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,style:{display:"block"},children:[t("defs",{children:t("linearGradient",{id:l,x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:c,stopOpacity:"0.25"}),t("stop",{offset:"100%",stopColor:c,stopOpacity:"0.02"})]})}),t("path",{d:a.areaPath,fill:`url(#${l})`}),t("path",{className:"ss-dash-sparkline-line",d:"M"+a.points.replace(/ /g," L"),fill:"none",stroke:c,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})]})})}const Xn=[{value:"5m",label:"5m"},{value:"15m",label:"15m"},{value:"30m",label:"30m"},{value:"1h",label:"1h"},{value:"6h",label:"6h"},{value:"24h",label:"24h"},{value:"7d",label:"7d"}];function er({value:e,onChange:s,className:n=""}){return t("div",{className:`ss-dash-btn-group ${n}`,children:Xn.map(r=>t("button",{type:"button",className:`ss-dash-btn ${e===r.value?"ss-dash-active":""}`,onClick:()=>s(r.value),children:r.label},r.value))})}function tr(e,s){if(e<=0)return[0];const n=e/s,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;let a;i<=1?a=r:i<=2?a=2*r:i<=5?a=5*r:a=10*r;const l=[];for(let o=a;o<=e+a*.5;o+=a)l.push(Math.round(o));return l.length===0&&l.push(Math.ceil(e)),l}function Vt(e){try{return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"})}catch{return""}}function Wt(e){if(e.length===0)return"";if(e.length===1)return`M${e[0].x},${e[0].y}`;let s=`M${e[0].x.toFixed(1)},${e[0].y.toFixed(1)}`;for(let n=0;n<e.length-1;n++){const r=e[n],i=e[n+1],a=(r.x+i.x)/2;s+=` C${a.toFixed(1)},${r.y.toFixed(1)} ${a.toFixed(1)},${i.y.toFixed(1)} ${i.x.toFixed(1)},${i.y.toFixed(1)}`}return s}function Kt(e){const s=se(e);return s==="very-slow"?"ss-dash-very-slow":s==="slow"?"ss-dash-slow":""}function sr({chartPoints:e}){const s={top:12,right:12,bottom:28,left:38},n=220,r=H(null),[i,a]=$(0);W(()=>{const g=r.current;if(!g)return;a(g.clientWidth);const C=new ResizeObserver(j=>{for(const Y of j)a(Y.contentRect.width)});return C.observe(g),()=>C.disconnect()},[]);const l=i||600,o=l-s.left-s.right,c=n-s.top-s.bottom,d=s.top+c,u=e.map(g=>{const C=g;return(g.requestCount??0)+(Number(C.request_count)||0)||g.total||0}),h=e.map(g=>{const C=g;return(g.errorCount??0)+(Number(C.error_count)||0)}),v=Math.max(...u,1),p=Math.ceil(v*1.1),m=h.some(g=>g>0),_=tr(p,4),S=_.length>0?_[_.length-1]:p,x=g=>s.left+g/Math.max(e.length-1,1)*o,N=g=>s.top+c-g/(S||1)*c,f=e.map((g,C)=>({x:x(C),y:N(u[C])})),k=e.map((g,C)=>({x:x(C),y:N(h[C])})),w=Wt(f),L=m?Wt(k):"",R=f.length>1?`${w} L${f[f.length-1].x.toFixed(1)},${d} L${f[0].x.toFixed(1)},${d} Z`:"",D=m&&k.length>1?`${L} L${k[k.length-1].x.toFixed(1)},${d} L${k[0].x.toFixed(1)},${d} Z`:"",P=Math.min(10,e.length),U=Math.max(1,Math.ceil(e.length/P)),[q,T]=$({visible:!1,x:0,idx:-1}),F=A(g=>{const C=f[g].x;T({visible:!0,x:C,idx:g})},[f]),X=A(()=>{T({visible:!1,x:0,idx:-1})},[]),b=120,y=q.visible?Math.max(b/2,Math.min(q.x,l-b/2)):0;return t("div",{ref:r,style:{position:"relative"},children:[t("svg",{viewBox:`0 0 ${l} ${n}`,className:"ss-dash-chart-svg",children:[t("defs",{children:[t("linearGradient",{id:"ss-cg-total",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:"var(--ss-accent)",stopOpacity:.3}),t("stop",{offset:"100%",stopColor:"var(--ss-accent)",stopOpacity:.02})]}),t("linearGradient",{id:"ss-cg-error",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:"var(--ss-red-fg)",stopOpacity:.35}),t("stop",{offset:"100%",stopColor:"var(--ss-red-fg)",stopOpacity:.02})]})]}),_.map(g=>{const C=N(g);return t("g",{children:[t("line",{x1:s.left,y1:C,x2:l-s.right,y2:C,stroke:"var(--ss-border-faint)",strokeWidth:.5,strokeDasharray:"3,3"}),t("text",{x:s.left-6,y:C,textAnchor:"end",fill:"var(--ss-dim)",fontSize:9,dominantBaseline:"middle",children:g})]},`ytick-${g}`)}),R&&t("path",{d:R,fill:"url(#ss-cg-total)"}),w&&t("path",{d:w,fill:"none",stroke:"var(--ss-accent)",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"}),D&&t("path",{d:D,fill:"url(#ss-cg-error)"}),L&&t("path",{d:L,fill:"none",stroke:"var(--ss-red-fg)",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:"4,2"}),e.map((g,C)=>{const j=u[C],Y=h[C],V=f[C].x,Q=f[C].y,ie=o/(e.length||1),ce=q.visible&&q.idx===C,ks=q.visible&&q.idx!==C;return t("g",{children:[t("rect",{x:V-ie/2,y:s.top,width:ie,height:c,fill:"transparent",className:"ss-dash-chart-hover-zone","data-idx":C,onMouseEnter:()=>F(C),onMouseLeave:X}),j>0&&t("circle",{cx:V,cy:Q,r:ce?4:2.5,fill:"var(--ss-accent)",stroke:"var(--ss-surface)",strokeWidth:1,className:"ss-dash-chart-dot","data-idx":C,opacity:ks?.3:1}),Y>0&&t("circle",{cx:V,cy:k[C].y,r:ce?3.5:2,fill:"var(--ss-red-fg)",stroke:"var(--ss-surface)",strokeWidth:1,className:"ss-dash-chart-dot ss-dash-chart-dot-err","data-idx":C,opacity:ks?.3:1})]},C)}),e.map((g,C)=>{if(C%U!==0&&C!==e.length-1)return null;const j=Vt(g.bucket);return j?t("text",{x:x(C),y:n-6,textAnchor:"middle",fill:"var(--ss-dim)",fontSize:9,children:j},`xlabel-${C}`):null})]}),q.visible&&q.idx>=0&&t("div",{className:"ss-dash-chart-tooltip",style:{left:y,top:s.top-4,transform:"translate(-50%, -100%)"},children:[t("div",{children:Vt(e[q.idx].bucket)}),t("div",{children:["Requests: ",u[q.idx]]}),h[q.idx]>0&&t("div",{style:{color:"var(--ss-red-fg)"},children:["Errors: ",h[q.idx]]})]})]})}function Qt({options:e={}}){const[s,n]=$("1h"),{data:r,isLoading:i}=K("overview",e),{data:a}=K("overview/chart",{...e,timeRange:s});if(i&&!r)return t("div",{className:"ss-dash-empty",children:"Loading overview..."});const l=r||{avgResponseTime:0,p95ResponseTime:0,requestsPerMinute:0,errorRate:0,totalRequests:0,slowestEndpoints:[],queryStats:{total:0,avgDuration:0,perRequest:0},recentErrors:[],topEvents:[],emailActivity:{sent:0,queued:0,failed:0},logLevelBreakdown:{error:0,warn:0,info:0,debug:0},cacheStats:null,jobQueueStatus:null,statusDistribution:{"2xx":0,"3xx":0,"4xx":0,"5xx":0},slowestQueries:[]},o=l,c=l.avgResponseTime||Number(o.avg_response_time)||0,d=l.p95ResponseTime||Number(o.p95_response_time)||0,u=l.requestsPerMinute||Number(o.requests_per_minute)||0,h=l.errorRate||Number(o.error_rate)||0,p=(l.totalRequests||Number(o.total_requests)||0)>0,m=a?.buckets||[],_=l.sparklines?.avgResponseTime??m.map(f=>f.avgDuration??0),S=l.sparklines?.p95ResponseTime??m.map(f=>f.p95Duration??0),x=l.sparklines?.requestsPerMinute??m.map(f=>f.requestCount??0),N=l.sparklines?.errorRate??m.map(f=>f.errorCount??0);return t("div",{className:"ss-dash-overview",children:[t("div",{className:"ss-dash-cards",children:[t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Avg Response Time"}),t("div",{className:`ss-dash-card-value ${p?c>500?"ss-dash-red":c>200?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?ne(c):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Re,{data:_,color:"#34d399",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"P95 Response Time"}),t("div",{className:`ss-dash-card-value ${p?d>500?"ss-dash-red":d>200?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?ne(d):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Re,{data:S,color:"#60a5fa",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Requests / min"}),t("div",{className:`ss-dash-card-value ${p?"ss-dash-accent":"ss-dash-dim"}`,children:p?u.toFixed(1):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Re,{data:x,color:"#34d399",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Error Rate"}),t("div",{className:`ss-dash-card-value ${p?h>5?"ss-dash-red":h>1?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?`${h.toFixed(1)}%`:"-"}),t("div",{className:"ss-dash-sparkline",children:t(Re,{data:N,color:"#f87171",width:160,height:40})})]})]}),t("div",{className:"ss-dash-chart-container",children:[t("div",{className:"ss-dash-chart-header",children:[t("span",{className:"ss-dash-chart-title",children:"Request Volume"}),t(er,{value:s,onChange:n})]}),t("div",{className:"ss-dash-chart",id:"ss-dash-chart-area",children:m.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"120px"},children:"No data for this range"}):t(sr,{chartPoints:m})}),t("div",{className:"ss-dash-chart-legend",id:"ss-dash-chart-legend",children:[t("span",{className:"ss-dash-chart-legend-item",children:[t("span",{className:"ss-dash-legend-dot",style:{background:"var(--ss-accent)"}}),"Requests"]}),m.some(f=>(f.errorCount??0)>0)&&t("span",{className:"ss-dash-chart-legend-item",children:[t("span",{className:"ss-dash-legend-dot",style:{background:"var(--ss-red-fg)"}}),"Errors"]})]})]}),t("div",{className:"ss-dash-secondary-cards",children:[t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#requests",className:"ss-dash-widget-link",children:"Slowest Endpoints"})}),l.slowestEndpoints.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No data yet"}):t("ul",{className:"ss-dash-secondary-list",children:l.slowestEndpoints.slice(0,5).map((f,k)=>{const w=f.url||f.pattern||"-";return t("li",{children:t("a",{href:`#requests?url=${encodeURIComponent(w)}`,className:"ss-dash-widget-row-link",children:[t("span",{title:w,children:w}),t("span",{className:`ss-dash-secondary-list-value ss-dash-duration ${Kt(f.avgDuration)}`,children:ne(f.avgDuration)})]})},k)})})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#queries",className:"ss-dash-widget-link",children:"Query Stats"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:[t("span",{children:"Total Queries"}),t("span",{className:"ss-dash-secondary-list-value",children:l.queryStats.total})]}),t("li",{children:[t("span",{children:"Avg Duration"}),t("span",{className:"ss-dash-secondary-list-value",children:ne(l.queryStats.avgDuration)})]}),t("li",{children:[t("span",{children:"Queries / Request"}),t("span",{className:"ss-dash-secondary-list-value",children:l.queryStats.perRequest.toFixed(1)})]})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#logs?level=error",className:"ss-dash-widget-link",children:"Recent Errors"})}),l.recentErrors.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No recent errors"}):t("ul",{className:"ss-dash-secondary-list",children:l.recentErrors.map((f,k)=>t("li",{children:t("a",{href:`#logs?id=${f.id??""}`,className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},title:f.message,children:f.message}),f.timestamp&&t("span",{className:"ss-dash-secondary-list-value",style:{color:"var(--ss-dim)"},title:re(f.timestamp),children:Z(f.timestamp)})]})},k))})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#events",className:"ss-dash-widget-link",children:"Top Events"})}),l.topEvents.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No events yet"}):t("ul",{className:"ss-dash-secondary-list",children:l.topEvents.slice(0,5).map((f,k)=>{const w=f.name||f.eventName||f.event_name||f.event||"";return t("li",{children:t("a",{href:`#events?event_name=${encodeURIComponent(w)}`,className:"ss-dash-widget-row-link",children:[t("span",{children:w}),t("span",{className:"ss-dash-secondary-list-value",children:f.count})]})},k)})})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#emails",className:"ss-dash-widget-link",children:"Email Activity"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#emails?status=sent",className:"ss-dash-widget-row-link",children:[t("span",{children:"Sent"}),t("span",{className:"ss-dash-secondary-list-value",children:l.emailActivity.sent})]})}),t("li",{children:t("a",{href:"#emails?status=queued",className:"ss-dash-widget-row-link",children:[t("span",{children:"Queued"}),t("span",{className:"ss-dash-secondary-list-value",children:l.emailActivity.queued})]})}),t("li",{children:t("a",{href:"#emails?status=failed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Failed"}),t("span",{className:"ss-dash-secondary-list-value",style:l.emailActivity.failed>0?{color:"var(--ss-red-fg)"}:void 0,children:l.emailActivity.failed})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#logs",className:"ss-dash-widget-link",children:"Log Levels"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#logs?level=error",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},children:"Error"}),t("span",{className:"ss-dash-secondary-list-value",children:l.logLevelBreakdown.error})]})}),t("li",{children:t("a",{href:"#logs?level=warn",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-amber-fg)"},children:"Warn"}),t("span",{className:"ss-dash-secondary-list-value",children:l.logLevelBreakdown.warn})]})}),t("li",{children:t("a",{href:"#logs?level=info",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-green-fg)"},children:"Info"}),t("span",{className:"ss-dash-secondary-list-value",children:l.logLevelBreakdown.info})]})}),t("li",{children:t("a",{href:"#logs?level=debug",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-dim)"},children:"Debug"}),t("span",{className:"ss-dash-secondary-list-value",children:l.logLevelBreakdown.debug})]})})]})]}),l.cacheStats&&l.cacheStats.available&&t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#cache",className:"ss-dash-widget-link",children:"Cache"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Keys"}),t("span",{className:"ss-dash-secondary-list-value",children:l.cacheStats.totalKeys})]})}),t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Hit Rate"}),t("span",{className:"ss-dash-secondary-list-value",children:[l.cacheStats.hitRate.toFixed(1),"%"]})]})}),t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Memory"}),t("span",{className:"ss-dash-secondary-list-value",children:l.cacheStats.memoryUsedHuman})]})})]})]}),l.jobQueueStatus&&l.jobQueueStatus.available&&t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#jobs",className:"ss-dash-widget-link",children:"Job Queue"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#jobs?status=active",className:"ss-dash-widget-row-link",children:[t("span",{children:"Active"}),t("span",{className:"ss-dash-secondary-list-value",children:l.jobQueueStatus.active})]})}),t("li",{children:t("a",{href:"#jobs?status=waiting",className:"ss-dash-widget-row-link",children:[t("span",{children:"Waiting"}),t("span",{className:"ss-dash-secondary-list-value",children:l.jobQueueStatus.waiting})]})}),t("li",{children:t("a",{href:"#jobs?status=failed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Failed"}),t("span",{className:"ss-dash-secondary-list-value",style:l.jobQueueStatus.failed>0?{color:"var(--ss-red-fg)"}:void 0,children:l.jobQueueStatus.failed})]})}),t("li",{children:t("a",{href:"#jobs?status=completed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Completed"}),t("span",{className:"ss-dash-secondary-list-value",children:l.jobQueueStatus.completed})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#requests",className:"ss-dash-widget-link",children:"Response Status"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#requests?status=2xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-green-fg)"},children:"2xx"}),t("span",{className:"ss-dash-secondary-list-value",children:l.statusDistribution["2xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=3xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-blue-fg)"},children:"3xx"}),t("span",{className:"ss-dash-secondary-list-value",children:l.statusDistribution["3xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=4xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-amber-fg)"},children:"4xx"}),t("span",{className:"ss-dash-secondary-list-value",children:l.statusDistribution["4xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=5xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},children:"5xx"}),t("span",{className:"ss-dash-secondary-list-value",children:l.statusDistribution["5xx"]})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#queries",className:"ss-dash-widget-link",children:"Slowest Queries"})}),l.slowestQueries.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No query data yet"}):t("ul",{className:"ss-dash-secondary-list",children:l.slowestQueries.slice(0,5).map((f,k)=>{const w=f.sqlNormalized||f.normalizedSql||f.sql_normalized||f.sql||"-";return t("li",{children:t("a",{href:`#queries?pattern=${encodeURIComponent(w)}`,className:"ss-dash-widget-row-link",children:[t("span",{title:w,children:w}),t("span",{className:`ss-dash-secondary-list-value ss-dash-duration ${Kt(f.avgDuration)}`,children:ne(f.avgDuration)})]})},k)})})]})]})]})}const nr=Object.freeze(Object.defineProperty({__proto__:null,OverviewSection:Qt,default:Qt},Symbol.toStringTag,{value:"Module"}));function rr(e){const{container:s,handle:n,topPane:r,bottomPane:i,storageKey:a,minHeight:l=60}=e;if(a){const c=localStorage.getItem(a);if(c){const d=parseFloat(c);d>0&&d<1&&(r.style.flex=`${d}`,i.style.flex=`${1-d}`)}}function o(c){c.preventDefault(),n.setPointerCapture(c.pointerId);const u=s.getBoundingClientRect().height,h=c.clientY,v=r.getBoundingClientRect().height;function p(_){const S=_.clientY-h;let x=v+S;const N=u-l-n.offsetHeight;x=Math.max(l,Math.min(x,N));const f=x/(u-n.offsetHeight);r.style.flex=`${f}`,i.style.flex=`${1-f}`}function m(){if(n.removeEventListener("pointermove",p),n.removeEventListener("pointerup",m),a){const _=s.getBoundingClientRect().height-n.offsetHeight;if(_>0){const S=r.getBoundingClientRect().height/_;localStorage.setItem(a,String(S))}}}n.addEventListener("pointermove",p),n.addEventListener("pointerup",m)}return n.addEventListener("pointerdown",o),()=>{n.removeEventListener("pointerdown",o)}}function ar(e){if(!e)return[];if(typeof e=="string")try{return JSON.parse(e)}catch{return[]}return Array.isArray(e)?e:[]}function lr(e){if(!e)return[];if(typeof e=="string")try{return JSON.parse(e)}catch{return[]}return Array.isArray(e)?e:[]}function Ye(e,s,n,r=0){return e[s]??e[n]??r}function ir(e){return{method:e.method||"",url:e.url||"",statusCode:Ye(e,"status_code","statusCode"),totalDuration:Ye(e,"total_duration","totalDuration")||e.duration||0,spanCount:Ye(e,"span_count","spanCount"),spans:ar(e.spans),warnings:lr(e.warnings),logs:e.logs||[],httpRequestId:e.httpRequestId||e.http_request_id||void 0}}function Jt(e="",s){const n=H(null);return A(()=>(n.current||(n.current=new Qe({baseUrl:e,authToken:s})),n.current),[e,s])}function or({color:e="muted",children:s,className:n="",classPrefix:r="ss-dash"}){return t("span",{className:`${r}-badge ${r}-badge-${e} ${n}`,children:s})}function Ze({method:e,className:s="",classPrefix:n="ss-dash"}){return t("span",{className:`${n}-method ${n}-method-${e.toLowerCase()} ${s}`,children:e})}function Gt({code:e,className:s="",classPrefix:n="ss-dash"}){let r=`${n}-status-2xx`;return e>=500?r=`${n}-status-5xx`:e>=400?r=`${n}-status-4xx`:e>=300&&(r=`${n}-status-3xx`),t("span",{className:`${n}-status ${r} ${s}`,children:e})}function cr(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return null}return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}function Yt(e){const s={};for(const[n,r]of Object.entries(e))hr.has(n)||(s[n]=r);return Object.keys(s).length>0?s:null}const dr=["all","error","warn","info","debug"];function Zt(e){return(e.levelName||e.level_name||(typeof e.level=="string"?e.level:"")||"info").toLowerCase()}function Xt(e){return e.msg||e.message||JSON.stringify(e)}function es(e){return e.createdAt||e.created_at||e.time||e.timestamp||0}function ts(e){const s=e.data||{};return e.requestId||e.request_id||e["x-request-id"]||s.requestId||s.request_id||s["x-request-id"]||""}function ss(e,s="ss-dbg-log-level"){switch(e){case"error":case"fatal":return`${s}-error`;case"warn":return`${s}-warn`;case"info":return`${s}-info`;case"debug":return`${s}-debug`;case"trace":return`${s}-trace`;default:return`${s}-info`}}const hr=new Set(["level","time","pid","hostname","msg","message","v","name","levelName","level_name","timestamp","createdAt","created_at","requestId","request_id","x-request-id","id","data"]);function ns(e){if(e.data){const s=cr(e.data);if(s){const n=Yt(s);if(n)return n}}return Yt(e)}function ve({data:e,maxPreviewLength:s=100,className:n="",classPrefix:r="ss-dash",defaultExpanded:i=!1}){const[a,l]=$(i),o=z(()=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},[e]),c=z(()=>typeof o=="object"&&o!==null?Ge(o,s):String(o??"-"),[o,s]),d=z(()=>typeof o=="object"&&o!==null?JSON.stringify(o,null,2):String(o),[o]),u=A(()=>{l(v=>!v)},[]),h=A(async()=>{try{await navigator.clipboard.writeText(d)}catch{}},[d]);return!e&&e!==0&&e!==!1?t("span",{className:`ss-dim ${r}-c-dim`,children:"-"}):t("div",{className:`${r}-data-cell ${n}`,children:[!a&&t("span",{className:`${r}-data-preview`,onClick:u,role:"button",tabIndex:0,onKeyDown:v=>v.key==="Enter"&&u(),children:c}),a&&t("div",{className:`${r}-data-full`,onClick:u,children:[t("button",{className:`${r}-copy-btn`,onClick:v=>{v.stopPropagation(),h()},title:"Copy to clipboard",type:"button",children:"Copy"}),t("pre",{children:d})]})]})}function ur({logs:e,classPrefix:s="ss-dash"}){const[n,r]=$(null);return e.length===0?null:t("div",{children:[t("div",{className:`${s}-related-logs-title`,children:["Related Logs",t("span",{className:`${s}-related-logs-count`,children:["(",e.length,")"]})]}),t("div",{className:`${s}-log-entries`,style:{overflow:"auto"},children:e.map((i,a)=>{const l=Zt(i),o=Xt(i),c=ts(i),d=es(i),u=ns(i);return t(We.Fragment,{children:[t("div",{className:`${s}-log-entry${u?` ${s}-log-entry-expandable`:""}`,onClick:()=>u&&r(n===a?null:a),children:[t("span",{className:`${s}-log-level ${ss(l,`${s}-log-level`)}`,children:l.toUpperCase()}),t("span",{className:`${s}-log-time`,title:d?re(d):"",children:d?Z(d):"-"}),c?t("span",{className:`${s}-log-reqid`,title:c,children:c.slice(0,8)}):t("span",{className:`${s}-log-reqid-empty`,children:"--"}),u?t("span",{className:`${s}-log-expand-icon${n===a?` ${s}-log-expand-icon-open`:""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:`${s}-log-msg`,children:o})]}),n===a&&u&&t("div",{className:`${s}-log-detail`,children:t(ve,{data:u,classPrefix:s,defaultExpanded:!0})})]},i.id||a)})})]})}const pr="ss-col-resize",rs="ss-resizing";function as(e){const s=Array.from(e.querySelectorAll("thead th"));if(s.length===0)return()=>{};const n=[];let r=!1;function i(){if(!r){r=!0;for(const a of s)a.style.width=a.offsetWidth+"px";e.style.tableLayout="fixed"}}for(const a of s){let l=function(c){c.preventDefault(),c.stopPropagation(),i();const d=c.clientX,u=a.offsetWidth;o.classList.add(rs),o.setPointerCapture(c.pointerId);function h(p){const m=p.clientX-d,_=Math.max(30,u+m);a.style.width=_+"px"}function v(){o.classList.remove(rs),o.removeEventListener("pointermove",h),o.removeEventListener("pointerup",v)}o.addEventListener("pointermove",h),o.addEventListener("pointerup",v)};if(!a.textContent?.trim())continue;const o=document.createElement("div");o.className=pr,a.appendChild(o),o.addEventListener("pointerdown",l),n.push(()=>{o.removeEventListener("pointerdown",l),o.remove()})}return()=>{for(const a of n)a()}}function fr(e=[]){const s=H(null),n=H(null);return W(()=>(s.current&&(n.current?.(),n.current=as(s.current)),()=>{n.current?.(),n.current=null}),e),A(i=>{n.current?.(),n.current=null,s.current=i,i&&(n.current=as(i))},[])}function ae({columns:e,data:s,keyField:n="id",sort:r,sortDir:i,onSort:a,onRowClick:l,rowClassName:o,emptyMessage:c="No data",className:d="",renderAfterRow:u}){const h=A(p=>{a&&a(p)},[a]),v=fr([s,e]);return s.length===0?t("div",{className:"ss-dash-empty",children:c}):t("table",{ref:v,className:`ss-dash-table ${d}`,children:[t("colgroup",{children:e.map(p=>t("col",{style:p.width?{width:p.width}:void 0},p.key))}),t("thead",{children:t("tr",{children:e.map(p=>t("th",{onClick:p.sortable?()=>h(p.key):void 0,className:p.sortable?"ss-dash-sortable":"",children:[p.label,r===p.key&&t("span",{className:"ss-dash-sort-arrow",children:i==="asc"?" ▲":" ▼"})]},p.key))})}),t("tbody",{children:s.map((p,m)=>{const _=o?typeof o=="function"?o(p):o:"",S=l?"ss-dash-clickable":"";return t(We.Fragment,{children:[t("tr",{onClick:l?()=>l(p):void 0,className:`${S} ${_}`.trim(),children:e.map(x=>t("td",{children:x.render?x.render(p[x.key],p):p[x.key]??"-"},x.key))}),u?u(p,m):null]},p[n]??m)})})]})}function le({search:e,onSearchChange:s,placeholder:n="Search...",summary:r,children:i,className:a=""}){const l=A(()=>{s("")},[s]);return t("div",{className:`ss-dbg-filter-bar ${a}`,children:[r!=null&&t("span",{className:"ss-dbg-summary",children:r}),t("div",{className:"ss-dbg-search-wrapper",children:[t("svg",{className:"ss-dbg-search-icon",width:"14",height:"14",viewBox:O.search.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:O.search.elements.join("")}}),t("input",{type:"text",className:"ss-dbg-search",placeholder:n,value:e,onChange:o=>s(o.target.value)}),e&&t("button",{type:"button",className:"ss-dbg-search-clear",onClick:l,children:"×"})]}),i&&t("div",{className:"ss-dbg-filter-controls",children:i})]})}function ue({page:e,lastPage:s,total:n,onPageChange:r,className:i=""}){const a=z(()=>cn(e,s),[e,s]),l=A(()=>{e>1&&r(e-1)},[e,r]),o=A(()=>{e<s&&r(e+1)},[e,s,r]);return s<=1?null:t("div",{className:`ss-dash-pagination ${i}`,children:[t("span",{className:"ss-dash-page-info",children:["Page ",e," of ",s," (",n," total)"]}),t("div",{className:"ss-dash-pagination-controls",children:[t("button",{type:"button",className:"ss-dash-page-btn",onClick:l,disabled:e<=1,children:"« Prev"}),a.map((c,d)=>c==="..."?t("span",{className:"ss-dash-page-ellipsis",children:"..."},`ellipsis-${d}`):t("button",{type:"button",className:`ss-dash-page-btn ${c===e?"ss-dash-active":""}`,onClick:()=>r(c),children:c},c)),t("button",{type:"button",className:"ss-dash-page-btn",onClick:o,disabled:e>=s,children:"Next »"})]})]})}const ls={request:"#1e3a5f",middleware:"rgba(30, 58, 95, 0.7)",db:"#6d28d9",view:"#0e7490",mail:"#059669",event:"#b45309",custom:"var(--ss-dim)"},mr={request:"Request",middleware:"Middleware",db:"DB",mail:"Mail",event:"Event",view:"View",custom:"Custom"};function is({spans:e,totalDuration:s,className:n="",warnings:r}){const i=e||[],a=z(()=>[...i].sort((o,c)=>o.startOffset-c.startOffset),[i]),l=z(()=>{const o={};for(const c of a)o[c.id]=c.parentId?(o[c.parentId]||0)+1:0;return o},[a]);return i.length===0?t("div",{className:"ss-dash-empty",children:"No spans recorded"}):t("div",{className:`ss-dash-tl-waterfall ${n}`,children:[t("div",{className:"ss-dash-tl-legend",children:Object.entries(mr).map(([o,c])=>t("div",{className:"ss-dash-tl-legend-item",children:[t("span",{className:"ss-dash-tl-legend-dot",style:{background:ls[o]||ls.custom}}),t("span",{children:c})]},o))}),a.map(o=>{const c=s>0?o.startOffset/s*100:0,d=s>0?Math.max(o.duration/s*100,.5):1,u=l[o.id]||0,h=o.label.length>50?o.label.slice(0,50)+"...":o.label,v=o.category==="db"?"DB":o.category,p=o.category==="db"?"purple":o.category==="mail"?"green":o.category==="event"?"amber":o.category==="view"?"blue":"muted",m=o.metadata?Object.entries(o.metadata).filter(([,S])=>S!=null).map(([S,x])=>`${S}=${x}`).join(", "):"",_=m?`${o.label} (${o.duration.toFixed(2)}ms)
2
+ ${m}`:`${o.label} (${o.duration.toFixed(2)}ms)`;return t("div",{className:"ss-dash-tl-row",children:[t("div",{className:"ss-dash-tl-label",title:_,style:{paddingLeft:8+u*16+"px"},children:[t("span",{className:`ss-dash-badge ss-dash-badge-${p}`,style:{fontSize:"9px",marginRight:"4px"},children:v}),h]}),t("div",{className:"ss-dash-tl-track",children:t("div",{className:`ss-dash-tl-bar ss-dash-tl-bar-${o.category||"custom"}`,style:{left:`${c}%`,width:`${d}%`},title:_})}),t("span",{className:"ss-dash-tl-dur",children:[o.duration.toFixed(2),"ms"]})]},o.id)}),r&&r.length>0&&t("div",{className:"ss-dash-tl-warnings",children:[t("div",{className:"ss-dash-tl-warnings-title",children:["Warnings (",r.length,")"]}),r.map((o,c)=>t("div",{className:"ss-dash-tl-warning",children:o},c))]})]})}function vr({children:e,classPrefix:s="ss-dash",storageKey:n}){const r=H(null),i=H(null),a=H(null),l=H(null);return W(()=>{if(r.current&&i.current&&a.current&&l.current)return rr({container:r.current,handle:i.current,topPane:a.current,bottomPane:l.current,storageKey:n})},[n]),t("div",{ref:r,className:`${s}-split-container`,children:[t("div",{ref:a,className:`${s}-split-top`,children:e[0]}),t("div",{ref:i,className:`${s}-split-handle`}),t("div",{ref:l,className:`${s}-split-bottom`,children:e[1]})]})}function os({options:e={}}){const[s,n]=$(1),[r,i]=$(""),[a,l]=$("createdAt"),[o,c]=$("desc"),[d,u]=$(null),[h,v]=$(!1);W(()=>n(1),[r]);const{data:p,meta:m,isLoading:_,error:S}=K("requests",{...e,page:s,search:r,sort:a,sortDir:o}),x=Jt(e.baseUrl||"",e.authToken),N=A(w=>{const L=w.id;v(!0);const R=e.dashboardEndpoint||"/__stats/api";x().fetch(`${R}/requests/${L}`).then(D=>{const P=D,U=P.trace;if(U){const q={...P,...U,logs:P.logs};u(q)}else u(D);v(!1)}).catch(()=>{v(!1)})},[x,e.dashboardEndpoint]),f=A(w=>{a===w?c(L=>L==="asc"?"desc":"asc"):(l(w),c("desc"))},[a]),k=p||[];if(d){const w=ir(d),L=w.logs.length>0;return t("div",{children:[t("div",{className:"ss-dash-tl-detail-header",children:[t("button",{type:"button",className:"ss-dash-btn",onClick:()=>u(null),children:"← Back to Requests"}),t(Ze,{method:w.method}),t("span",{style:{color:"var(--ss-text)"},children:w.url}),t(Gt,{code:w.statusCode}),t("span",{className:"ss-dash-tl-meta",children:[w.totalDuration.toFixed(1),"ms · ",w.spanCount," spans"]})]}),L?t(vr,{classPrefix:"ss-dash",storageKey:"ss-requests-split",children:[t(is,{spans:w.spans,totalDuration:w.totalDuration,warnings:w.warnings}),t(ur,{logs:w.logs,classPrefix:"ss-dash"})]}):t(is,{spans:w.spans,totalDuration:w.totalDuration,warnings:w.warnings})]})}return h?t("div",{children:[t("div",{className:"ss-dash-tl-detail-header",children:t("button",{type:"button",className:"ss-dash-btn",onClick:()=>v(!1),children:"← Back to Requests"})}),t("div",{className:"ss-dash-empty",children:"Loading request detail..."})]}):t("div",{children:[t(le,{search:r,onSearchChange:i,placeholder:"Filter requests...",summary:`${m?.total??0} requests`}),S&&t("div",{className:"ss-dash-empty",children:"Failed to load requests"}),_&&!p?t("div",{className:"ss-dash-empty",children:"Loading requests..."}):t(M,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"id",label:"#",width:"40px",render:w=>t("span",{style:{color:"var(--ss-dim)"},children:w})},{key:"method",label:"Method",width:"70px",sortable:!0,render:w=>t(Ze,{method:w})},{key:"url",label:"URL",sortable:!0,render:w=>t("span",{style:{color:"var(--ss-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:w,children:w})},{key:"statusCode",label:"Status",width:"60px",sortable:!0,render:(w,L)=>{const R=L.status_code||L.statusCode||L.statusCode;return t(Gt,{code:R})}},{key:"duration",label:"Duration",width:"80px",sortable:!0,render:(w,L)=>{const R=L.total_duration||L.totalDuration||L.duration||0;return t("span",{className:`ss-dash-duration ${se(R)==="very-slow"?"ss-dash-very-slow":se(R)==="slow"?"ss-dash-slow":""}`,children:[R.toFixed(1),"ms"]})}},{key:"spanCount",label:"Spans",width:"50px",render:(w,L)=>{const R=L.span_count||L.spanCount||0;return t("span",{style:{color:"var(--ss-muted)",textAlign:"center"},children:R})}},{key:"warningCount",label:"⚠",width:"40px",render:(w,L)=>{const R=L.warning_count||L.warningCount||0;return R>0?t("span",{style:{color:"var(--ss-amber-fg)",textAlign:"center",display:"block"},children:R}):t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:"-"})}},{key:"createdAt",label:"Time",width:"80px",sortable:!0,render:(w,L)=>{const R=L.createdAt||L.created_at||L.timestamp||"";return t("span",{className:"ss-dash-event-time",title:re(R),children:Z(R)})}}],data:k,sort:a,sortDir:o,onSort:f,onRowClick:N,emptyMessage:"No requests recorded yet"})}),m&&t(ue,{page:m.page,lastPage:m.lastPage,total:m.total,onPageChange:n})]})]})}const _r=Object.freeze(Object.defineProperty({__proto__:null,RequestsSection:os,default:os},Symbol.toStringTag,{value:"Module"}));function cs({node:e,depth:s=0}){if(!e)return null;const n=s*20,r=e["Node Type"]||"Unknown",i=e["Relation Name"]?t(M,{children:[" on ",t("strong",{children:e["Relation Name"]})]}):null,a=e.Alias&&e.Alias!==e["Relation Name"]?` (${e.Alias})`:"",l=e["Index Name"]?t(M,{children:[" using ",t("em",{children:e["Index Name"]})]}):null,o=[];if(e["Startup Cost"]!==null&&e["Startup Cost"]!==void 0&&o.push(`cost=${e["Startup Cost"]}..${e["Total Cost"]}`),e["Plan Rows"]!==null&&e["Plan Rows"]!==void 0&&o.push(`rows=${e["Plan Rows"]}`),e["Plan Width"]!==null&&e["Plan Width"]!==void 0&&o.push(`width=${e["Plan Width"]}`),e.Filter&&o.push(`filter: ${e.Filter}`),e["Index Cond"]&&o.push(`cond: ${e["Index Cond"]}`),e["Hash Cond"]&&o.push(`hash: ${e["Hash Cond"]}`),e["Join Type"]&&o.push(`join: ${e["Join Type"]}`),e["Sort Key"]){const d=Array.isArray(e["Sort Key"])?e["Sort Key"].join(", "):e["Sort Key"];o.push(`sort: ${d}`)}const c=e.Plans||[];return t("div",{className:"ss-dash-explain-node",style:{marginLeft:`${n}px`},children:[t("div",{className:"ss-dash-explain-node-header",children:[t("span",{className:"ss-dash-explain-node-type",children:r}),i,a,l]}),o.length>0&&t("div",{className:"ss-dash-explain-metrics",children:o.join(" · ")}),c.map((d,u)=>t(cs,{node:d,depth:s+1},u))]})}function gr({plan:e}){if(!e||!Array.isArray(e)||e.length===0)return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"});const s=e[0];if(s&&s.Plan)return t("div",{className:"ss-dash-explain-result",children:t(cs,{node:s.Plan,depth:0})});if(typeof s=="object"&&s!==null){const n=Object.keys(s);return t("div",{className:"ss-dash-explain-result",children:t("table",{children:[t("thead",{children:t("tr",{children:n.map(r=>t("th",{children:r},r))})}),t("tbody",{children:e.map((r,i)=>{const a=r;return t("tr",{children:n.map(l=>t("td",{children:a[l]!==null&&a[l]!==void 0?String(a[l]):"-"},l))},i)})})]})})}return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"})}const yr=8;function ds({options:e={}}){const[s,n]=$(1),[r,i]=$(""),[a,l]=$("createdAt"),[o,c]=$("desc"),[d,u]=$("list"),[h,v]=$(null),[p,m]=$(null),[_,S]=$(null),x=A(b=>{b!==d&&(u(b),n(1),l(b==="list"?"createdAt":"count"),c("desc"),v(null),m(null),S(null))},[d]);W(()=>n(1),[r]);const N=d==="grouped"?"queries/grouped":"queries",{data:f,meta:k,isLoading:w,mutate:L}=K(N,{...e,page:s,search:r,sort:a,sortDir:o}),R=A(b=>{a===b?c(y=>y==="asc"?"desc":"asc"):(l(b),c("desc"))},[a]),D=A(async b=>{if(p&&p.queryId===b){m(null);return}S(b);try{const y=await L(`queries/${b}/explain`);y&&y.error?m({queryId:b,plan:[],error:y.error,message:y.message}):m({queryId:b,plan:y?.plan||y?.rows||[]})}catch(y){console.warn("[ss] Query explain failed:",y),m({queryId:b,plan:[],error:y instanceof Error?y.message:String(y)})}finally{S(null)}},[L,p]),P=A(b=>{const y=b.id;return!p||p.queryId!==y?null:t("tr",{className:"ss-dash-explain-row",children:t("td",{colSpan:yr,className:"ss-dash-explain",children:t("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[t("div",{style:{flex:1},children:p.error?t("div",{className:"ss-dash-explain-result ss-dash-explain-error",children:[t("strong",{children:"Error:"})," ",p.error,p.message&&t(M,{children:[t("br",{}),p.message]})]}):t(gr,{plan:p.plan})}),t("button",{type:"button",className:"ss-dash-explain-btn",onClick:()=>m(null),style:{marginLeft:"8px",flexShrink:0},children:"Close"})]})})})},[p]),U=d==="grouped"?f?.groups||[]:f||[],q=z(()=>d!=="grouped"?U:U.map(b=>{const y={...b};return(y.sqlNormalized===null||y.sqlNormalized===void 0)&&(b.sql_normalized||b.pattern)&&(y.sqlNormalized=b.sql_normalized||b.pattern||""),(y.count===null||y.count===void 0)&&b.total_count!==null&&b.total_count!==void 0&&(y.count=b.total_count),(y.avgDuration===null||y.avgDuration===void 0)&&b.avg_duration!==null&&b.avg_duration!==void 0&&(y.avgDuration=b.avg_duration),(y.maxDuration===null||y.maxDuration===void 0)&&b.max_duration!==null&&b.max_duration!==void 0&&(y.maxDuration=b.max_duration),(y.minDuration===null||y.minDuration===void 0)&&b.min_duration!==null&&b.min_duration!==void 0&&(y.minDuration=b.min_duration),(y.totalDuration===null||y.totalDuration===void 0)&&b.total_duration!==null&&b.total_duration!==void 0&&(y.totalDuration=b.total_duration),(y.percentOfTotal===null||y.percentOfTotal===void 0)&&b.pct_time!==null&&b.pct_time!==void 0&&(y.percentOfTotal=b.pct_time),y}),[U,d]),T=z(()=>{const b=k?.total??q.length;let y=0,g=0,C=0,j=0;for(const V of q){const Q=V.duration||0;C+=Q,j++,Q>It&&y++}const Y=new Map;for(const V of q){const Q=V.sqlNormalized||V.sql||V.sql_text||"";Y.set(Q,(Y.get(Q)||0)+1)}for(const V of Y.values())V>1&&(g+=V);return{total:b,slow:y,duplicates:g,avgDuration:j>0?C/j:0}},[q,k]),F=z(()=>{const b=new Map;for(const y of q){const g=y.sqlNormalized||y.sql||y.sql_text||"";b.set(g,(b.get(g)||0)+1)}return b},[q]),X=z(()=>{if(d==="grouped")return`${q.length} query patterns`;const b=[`${T.total} queries`];return T.slow>0&&b.push(`${T.slow} slow`),T.duplicates>0&&b.push(`${T.duplicates} dup`),b.push(`avg ${(T.avgDuration||0).toFixed(1)}ms`),b.join(", ")},[d,q.length,T]);return t("div",{children:[t(le,{search:r,onSearchChange:i,placeholder:"Filter queries...",summary:X,children:t("div",{className:"ss-dash-btn-group",children:[t("button",{type:"button",className:`ss-dash-btn ${d==="list"?"ss-dash-active":""}`,onClick:()=>x("list"),children:"List"}),t("button",{type:"button",className:`ss-dash-btn ${d==="grouped"?"ss-dash-active":""}`,onClick:()=>x("grouped"),children:"Grouped"})]})}),w&&!f?t("div",{className:"ss-dash-empty",children:"Loading queries..."}):d==="grouped"?t(M,{children:t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"sqlNormalized",label:"Pattern",render:(b,y)=>{const g=b||"",C=(y.count||0)>=3;return t(M,{children:[t("span",{className:`ss-dash-sql ${h===g?"ss-dash-expanded":""}`,title:"Click to expand",onClick:j=>{j.stopPropagation(),v(h===g?null:g)},role:"button",tabIndex:0,onKeyDown:j=>j.key==="Enter"&&v(h===g?null:g),children:g}),C&&t(M,{children:[" ",t("span",{className:"ss-dash-dup",children:"DUP"})]})]})}},{key:"count",label:"Count",width:"60px",sortable:!0,render:b=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:b||0})},{key:"avgDuration",label:"Avg",width:"70px",sortable:!0,render:b=>{const y=b||0;return t("span",{className:`ss-dash-duration ${se(y)==="very-slow"?"ss-dash-very-slow":se(y)==="slow"?"ss-dash-slow":""}`,children:y.toFixed(2)+"ms"})}},{key:"minDuration",label:"Min",width:"70px",render:b=>t("span",{className:"ss-dash-duration",children:(b||0).toFixed(2)+"ms"})},{key:"maxDuration",label:"Max",width:"70px",render:b=>{const y=b||0;return t("span",{className:`ss-dash-duration ${se(y)==="very-slow"?"ss-dash-very-slow":se(y)==="slow"?"ss-dash-slow":""}`,children:y.toFixed(2)+"ms"})}},{key:"totalDuration",label:"Total",width:"70px",sortable:!0,render:b=>t("span",{className:"ss-dash-duration",children:(b||0).toFixed(1)+"ms"})},{key:"percentOfTotal",label:"% Time",width:"60px",render:b=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:(b||0).toFixed(1)+"%"})}],data:q,keyField:"sqlNormalized",sort:a,sortDir:o,onSort:R,emptyMessage:"No queries recorded"})})}):t(M,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"id",label:"#",width:"40px",render:b=>t("span",{style:{color:"var(--ss-dim)"},children:b})},{key:"sql",label:"SQL",render:(b,y)=>{const g=y.sql||y.sql_text||"";return t("div",{children:[t("span",{className:`ss-dash-sql ${h===y.id?"ss-dash-expanded":""}`,title:"Click to expand",onClick:C=>{C.stopPropagation(),v(h===y.id?null:y.id)},role:"button",tabIndex:0,onKeyDown:C=>C.key==="Enter"&&v(h===y.id?null:y.id),children:g}),(F.get((y.sqlNormalized||y.sql||y.sql_text)??"")??0)>1&&t("span",{className:"ss-dash-dup",children:["×",F.get((y.sqlNormalized||y.sql||y.sql_text)??"")]})]})}},{key:"duration",label:"Duration",width:"70px",sortable:!0,render:b=>{const y=b||0;return t("span",{className:`ss-dash-duration ${se(y)==="very-slow"?"ss-dash-very-slow":se(y)==="slow"?"ss-dash-slow":""}`,children:y.toFixed(2)+"ms"})}},{key:"method",label:"Method",width:"60px",render:(b,y)=>{const g=y.method||y.sql_method||"";return t("span",{className:`ss-dash-method ss-dash-method-${g.toLowerCase()}`,children:g})}},{key:"model",label:"Model",width:"90px",render:b=>t("span",{style:{color:"var(--ss-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:b,children:b||"-"})},{key:"connection",label:"Connection",width:"80px",render:b=>t("span",{style:{color:"var(--ss-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b||"-"})},{key:"createdAt",label:"Time",width:"90px",sortable:!0,render:(b,y)=>{const g=b||y.created_at||y.timestamp||"";return t("span",{className:"ss-dash-event-time",title:re(g),children:Z(g)})}},{key:"id",label:"",width:"70px",render:(b,y)=>{if((y.method||y.sql_method||"")!=="select")return null;const C=p?.queryId===y.id&&!p?.error;return t("button",{type:"button",className:`ss-dash-explain-btn${C?" ss-dash-explain-btn-active":""}`,onClick:j=>{j.stopPropagation(),D(y.id)},disabled:_===y.id,children:_===y.id?"...":"EXPLAIN"})}}],data:q,sort:a,sortDir:o,onSort:R,emptyMessage:"No queries recorded",renderAfterRow:P})}),k&&t(ue,{page:k.page,lastPage:k.lastPage,total:k.total,onPageChange:n})]})]})}const br=Object.freeze(Object.defineProperty({__proto__:null,QueriesSection:ds,default:ds},Symbol.toStringTag,{value:"Module"}));function hs({options:e={}}){const[s,n]=$(1),[r,i]=$(""),{data:a,meta:l,isLoading:o}=K("events",{...e,page:s,search:r}),c=a||[];return W(()=>n(1),[r]),t("div",{children:[t(le,{search:r,onSearchChange:i,placeholder:"Filter events...",summary:`${l?.total??0} events`}),o&&!a?t("div",{className:"ss-dash-empty",children:"Loading events..."}):t(M,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"id",label:"#",width:"40px",render:d=>t("span",{style:{color:"var(--ss-dim)"},children:d})},{key:"eventName",label:"Event",render:(d,u)=>{const h=u.event_name||u.eventName||u.event||"";return t("span",{className:"ss-dash-event-name",title:h,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:h})}},{key:"data",label:"Data",render:d=>t(ve,{data:d,maxPreviewLength:80,className:"ss-dash-event-data"})},{key:"createdAt",label:"Time",width:"80px",render:(d,u)=>{const h=u.createdAt||u.created_at||u.timestamp;return t("span",{className:"ss-dash-event-time",title:re(h),children:Z(h)})}}],data:c,emptyMessage:"No events recorded yet"})}),l&&t(ue,{page:l.page,lastPage:l.lastPage,total:l.total,onPageChange:n})]})]})}const wr=Object.freeze(Object.defineProperty({__proto__:null,EventsSection:hs,default:hs},Symbol.toStringTag,{value:"Module"}));function us({options:e={}}){const[s,n]=$(""),{data:r,isLoading:i,error:a}=K("routes",{...e,search:s}),l=r,o=Array.isArray(l)?l:l&&Array.isArray(l.routes)?l.routes:l&&Array.isArray(l.data)?l.data:[],c={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};return t("div",{children:[t(le,{search:s,onSearchChange:n,placeholder:"Filter routes...",summary:`${o.length} routes`}),a?t("div",{className:"ss-dash-empty",children:"Failed to load routes"}):i&&!r?t("div",{className:"ss-dash-empty",children:"Loading routes..."}):t(M,{children:t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"method",label:"Method",width:"70px",render:d=>t(Ze,{method:d})},{key:"pattern",label:"Pattern",render:d=>t("span",{style:{color:"var(--ss-text)",...c},title:d,children:d})},{key:"name",label:"Name",width:"120px",render:d=>t("span",{style:{color:"var(--ss-muted)",...c},title:d||"-",children:d||"-"})},{key:"handler",label:"Handler",render:d=>t("span",{style:{color:"var(--ss-sql-color)",...c},title:d,children:d})},{key:"middleware",label:"Middleware",render:d=>{const u=d?.length?d.join(", "):"-";return t("span",{style:{color:"var(--ss-dim)",fontSize:"10px",...c},title:u,children:u})}}],data:o,keyField:"pattern",emptyMessage:"No routes available"})})})]})}const Nr=Object.freeze(Object.defineProperty({__proto__:null,RoutesSection:us,default:us},Symbol.toStringTag,{value:"Module"}));function ps({options:e={}}){const[s,n]=$(1),[r,i]=$(""),[a,l]=$("all"),[o,c]=$(""),[d,u]=$(""),[h,v]=$([]),[p,m]=$("level"),[_,S]=$("equals"),[x,N]=$(""),[f,k]=$(null),w={};a!=="all"&&(w.level=a),o&&(w.request_id=o),h.forEach((g,C)=>{w[`filter_field_${C}`]=g.field,w[`filter_op_${C}`]=g.operator,w[`filter_value_${C}`]=g.value});const{data:L,meta:R,isLoading:D}=K("logs",{...e,page:s,search:r,filters:w}),P=L||[],U=A(g=>{c(g),u(g),n(1)},[]),q=A(()=>{const g=d.trim();c(g),n(1)},[d]),T=A(()=>{c(""),u(""),n(1)},[]),F=A(()=>{l("all"),n(1)},[]),X=A(()=>{const g=x.trim();g&&(v(C=>[...C,{field:p,operator:_,value:g}]),N(""))},[p,_,x]),b=A(g=>{v(C=>C.filter((j,Y)=>Y!==g))},[]),y=a!=="all"||o!==""||h.length>0;return t("div",{children:[t(le,{search:r,onSearchChange:i,placeholder:"Search logs...",summary:`${R?.total??0} logs`,children:t("div",{className:"ss-dash-log-filters",children:[dr.map(g=>t("button",{type:"button",className:`ss-dash-log-filter ${a===g?"ss-dash-active":""}`,onClick:()=>{l(g),n(1)},children:g},g)),t("input",{type:"text",className:"ss-dash-filter-input ss-dash-reqid-input",placeholder:"Filter by request ID...",value:d,onChange:g=>u(g.target.value),onKeyDown:g=>g.key==="Enter"&&q()}),(d||o)&&t("button",{type:"button",className:"ss-dash-btn ss-dash-reqid-clear",onClick:()=>{T()},children:"Clear"})]})}),t("div",{className:"ss-dash-structured-search",children:[t("select",{className:"ss-dash-filter-select",value:p,onChange:g=>m(g.target.value),children:[t("option",{value:"level",children:"level"}),t("option",{value:"message",children:"message"}),t("option",{value:"request_id",children:"request_id"}),t("option",{value:"userId",children:"userId"}),t("option",{value:"email",children:"email"}),t("option",{value:"path",children:"path"})]}),t("select",{className:"ss-dash-filter-select",value:_,onChange:g=>S(g.target.value),children:[t("option",{value:"equals",children:"equals"}),t("option",{value:"contains",children:"contains"}),t("option",{value:"starts_with",children:"starts with"})]}),t("input",{className:"ss-dash-filter-input",placeholder:"Value...",value:x,onChange:g=>N(g.target.value),onKeyDown:g=>g.key==="Enter"&&X()}),t("button",{type:"button",className:"ss-dash-btn",onClick:X,children:"Add"})]}),y&&t("div",{className:"ss-dash-filter-chips",children:[a!=="all"&&t("span",{className:"ss-dash-filter-chip",children:["level: ",a,t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:F,children:"×"})]}),o&&t("span",{className:"ss-dash-filter-chip",children:["requestId: ",o.slice(0,8),"...",t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:T,children:"×"})]}),h.map((g,C)=>t("span",{className:"ss-dash-filter-chip",children:[g.field," ",g.operator,' "',g.value,'"',t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:()=>b(C),children:"×"})]},C))]}),D&&!L?t("div",{className:"ss-dash-empty",children:"Loading logs..."}):P.length===0?t("div",{className:"ss-dash-empty",children:["No log entries",o?` matching request ${o}`:a!=="all"?` for ${a}`:""]}):t("div",{className:"ss-dash-log-entries",children:P.map((g,C)=>{const j=Zt(g),Y=Xt(g),V=ts(g),Q=es(g),ie=ns(g);return t(We.Fragment,{children:[t("div",{className:`ss-dash-log-entry${ie?" ss-dash-log-entry-expandable":""}`,onClick:()=>ie&&k(f===C?null:C),children:[t("span",{className:`ss-dash-log-level ${ss(j,"ss-dash-log-level")}`,children:j.toUpperCase()}),t("span",{className:"ss-dash-log-time",title:Q?re(Q):"",children:Q?Z(Q):"-"}),V?t("span",{className:"ss-dash-log-reqid",title:V,onClick:ce=>{ce.stopPropagation(),U(V)},role:"button",tabIndex:0,onKeyDown:ce=>{ce.key==="Enter"&&(ce.stopPropagation(),U(V))},children:V.slice(0,8)}):t("span",{className:"ss-dash-log-reqid-empty",children:"--"}),ie?t("span",{className:`ss-dash-log-expand-icon${f===C?" ss-dash-log-expand-icon-open":""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:"ss-dash-log-msg",children:Y})]}),f===C&&ie&&t("div",{className:"ss-dash-log-detail",children:t(ve,{data:ie,classPrefix:"ss-dash",defaultExpanded:!0})})]},g.id||C)})}),R&&t(ue,{page:R.page,lastPage:R.lastPage,total:R.total,onPageChange:n})]})}const xr=Object.freeze(Object.defineProperty({__proto__:null,LogsSection:ps,default:ps},Symbol.toStringTag,{value:"Module"}));function fs({options:e={}}){const[s,n]=$(1),[r,i]=$(""),[a,l]=$(null),[o,c]=$(null),{data:d,meta:u,isLoading:h}=K("emails",{...e,page:s,search:r}),v=d||[];W(()=>n(1),[r]);const p=A(async m=>{if(m.html){l(m.id),c(m.html);return}try{const{baseUrl:_="",dashboardEndpoint:S="/__stats/api",authToken:x}=e,N=`${_}${S}/emails/${m.id}/preview`,f={Accept:"text/html"};x&&(f.Authorization=`Bearer ${x}`);const w=await(await fetch(N,{headers:f,credentials:"same-origin"})).text();l(m.id),c(w)}catch{}},[e]);if(a&&o){const m=v.find(_=>_.id===a);return t("div",{className:"ss-dash-email-preview",id:"ss-dash-email-preview",children:[t("div",{className:"ss-dash-email-preview-header",children:[t("div",{className:"ss-dash-email-preview-meta",id:"ss-dash-email-preview-meta",children:m&&t(M,{children:[t("strong",{children:"Subject:"})," ",m.subject,"  |  ",t("strong",{children:"From:"})," ",m.from_addr||m.from,"  |  ",t("strong",{children:"To:"})," ",m.to_addr||m.to,(m.cc||m.cc_addr)&&t(M,{children:["  |  ",t("strong",{children:"CC:"})," ",m.cc||m.cc_addr]}),"  |  ",t("strong",{children:"Status:"})," ",t("span",{className:`ss-dash-badge ss-dash-email-status-${m.status}`,children:m.status}),m.mailer&&t(M,{children:["  |  ",t("strong",{children:"Mailer:"})," ",m.mailer]})]})}),t("button",{type:"button",className:"ss-dash-btn",id:"ss-dash-email-preview-close",onClick:()=>{l(null),c(null)},children:"Close"})]}),t("iframe",{className:"ss-dash-email-iframe",id:"ss-dash-email-iframe",srcDoc:o,title:"Email preview",sandbox:""})]})}return t("div",{children:[t(le,{search:r,onSearchChange:i,placeholder:"Filter emails...",summary:`${u?.total??0} emails`}),h&&!d?t("div",{className:"ss-dash-empty",children:"Loading emails..."}):t(M,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"id",label:"#",width:"40px",render:m=>t("span",{style:{color:"var(--ss-dim)"},children:m})},{key:"from",label:"From",width:"150px",render:(m,_)=>{const S=_.from_addr||_.from||"";return t("span",{title:S,style:{color:"var(--ss-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:S})}},{key:"to",label:"To",width:"150px",render:(m,_)=>{const S=_.to_addr||_.to||"";return t("span",{title:S,style:{color:"var(--ss-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:S})}},{key:"subject",label:"Subject",render:m=>{const _=m||"";return t("span",{title:_,style:{color:"var(--ss-sql-color)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:_})}},{key:"status",label:"Status",width:"80px",render:m=>{const _=m||"";return t("span",{className:`ss-dash-badge ss-dash-email-status-${_}`,children:_})}},{key:"attachmentCount",label:"ATT",width:"40px",render:(m,_)=>{const S=_.attachment_count||_.attachmentCount||0;return S>0?t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:S}):t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:"-"})}},{key:"mailer",label:"Mailer",width:"70px",render:m=>{const _=m||"";return t("span",{title:_,style:{color:"var(--ss-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:_})}},{key:"createdAt",label:"Time",width:"80px",render:(m,_)=>{const S=_.createdAt||_.created_at||_.timestamp;return t("span",{className:"ss-dash-event-time",style:{whiteSpace:"nowrap"},title:re(S),children:Z(S)})}}],data:v,onRowClick:p,rowClassName:"ss-dash-email-row",emptyMessage:"No emails captured yet"})}),u&&t(ue,{page:u.page,lastPage:u.lastPage,total:u.total,onPageChange:n})]})]})}const kr=Object.freeze(Object.defineProperty({__proto__:null,EmailsSection:fs,default:fs},Symbol.toStringTag,{value:"Module"}));function ms({options:e={}}){const[s,n]=$(""),[r,i]=$(null),[a,l]=$(null),[o,c]=$(!1),[d,u]=$(null),{data:h,isLoading:v,mutate:p,getApi:m}=K("cache",{...e,search:s}),_=h,S=A(async N=>{if(confirm(`Delete cache key "${N}"?`))try{await p(`cache/${encodeURIComponent(N)}`,"delete"),r===N&&(i(null),l(null),u(null))}catch{}},[p,r]),x=A(async N=>{if(r===N){i(null),l(null),u(null);return}i(N),l(null),u(null),c(!0);try{const k=await m().fetchCacheKey(N);l(k.value!==void 0?k.value:k.data!==void 0?k.data:k),u(null)}catch{l(null),u("Failed to fetch key value")}finally{c(!1)}},[r,m]);return t("div",{children:[_?.available&&_?.stats&&t("div",{className:"ss-dash-cache-stats",children:[t("div",{className:"ss-dash-cache-stat",children:[t("span",{className:"ss-dash-cache-stat-label",children:"Hit Rate:"}),t("span",{className:"ss-dash-cache-stat-value",children:[(_.stats.hitRate??0).toFixed(1),"%"]})]}),t("div",{className:"ss-dash-cache-stat",children:[t("span",{className:"ss-dash-cache-stat-label",children:"Hits:"}),t("span",{className:"ss-dash-cache-stat-value",children:_.stats.hits??0})]}),t("div",{className:"ss-dash-cache-stat",children:[t("span",{className:"ss-dash-cache-stat-label",children:"Misses:"}),t("span",{className:"ss-dash-cache-stat-value",children:_.stats.misses??0})]}),t("div",{className:"ss-dash-cache-stat",children:[t("span",{className:"ss-dash-cache-stat-label",children:"Keys:"}),t("span",{className:"ss-dash-cache-stat-value",children:_.stats.totalKeys||_.stats.keyCount||_.keys?.length||0})]})]}),t(le,{search:s,onSearchChange:n,placeholder:"Filter cache keys...",summary:`${(_?.keys||_?.data||[]).length} keys`}),v&&!h?t("div",{className:"ss-dash-empty",children:"Loading cache..."}):!_||!_.available?t("div",{className:"ss-dash-empty",children:"Cache inspector not available"}):t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"key",label:"Key",render:N=>t("span",{title:N,style:{color:"var(--ss-sql-color)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:N})},{key:"type",label:"Type",width:"70px",render:N=>t("span",{style:{color:"var(--ss-muted)"},children:N})},{key:"size",label:"Size",width:"60px",render:N=>N!=null&&N>0?Wn(N):"-"},{key:"ttl",label:"TTL",width:"70px",render:N=>N>0?Vn(N):"-"},{key:"_actions",label:"",width:"60px",render:(N,f)=>t("button",{type:"button",className:"ss-dash-retry-btn",onClick:k=>{k.stopPropagation(),S(f.key)},children:"Delete"})}],data:_.keys||_.data||[],keyField:"key",onRowClick:N=>x(N.key),emptyMessage:"No cache keys found"})}),r&&t("div",{className:"ss-dash-cache-detail",children:[t("h4",{children:["Key: ",r]}),o?t("div",{className:"ss-dash-empty",children:"Loading value..."}):d?t("div",{className:"ss-dash-empty",style:{color:"var(--ss-red-fg)"},children:d}):t(ve,{data:a})]})]})}const $r=Object.freeze(Object.defineProperty({__proto__:null,CacheSection:ms,default:ms},Symbol.toStringTag,{value:"Module"})),Sr=["all","active","waiting","delayed","completed","failed"];function Cr(e){switch(e){case"active":return"blue";case"waiting":return"amber";case"delayed":return"purple";case"completed":return"green";case"failed":return"red";default:return"muted"}}function Tr(e){if(!e)return[];if(Array.isArray(e))return e;const s=e;return s.jobs||s.data||[]}function Lr(e){if(!e||Array.isArray(e))return null;const s=e;return s.stats||s.overview||null}function vs({options:e={}}){const[s,n]=$(1),[r,i]=$(""),[a,l]=$("all"),[o,c]=$({}),d={};a!=="all"&&(d.status=a);const{data:u,meta:h,isLoading:v,error:p,refresh:m,mutate:_}=K("jobs",{...e,page:s,search:r,filters:d}),S=Tr(u),x=Lr(u),N=A(async f=>{c(k=>({...k,[f]:"pending"}));try{await _(`jobs/${f}/retry`),c(k=>({...k,[f]:"success"})),setTimeout(()=>{c(k=>{const w={...k};return delete w[f],w}),m()},1e3)}catch{c(k=>{const w={...k};return delete w[f],w})}},[_,m]);return t("div",{children:[x&&t("div",{className:"ss-dash-job-stats",children:[t("div",{className:"ss-dash-job-stat",children:[t("span",{className:"ss-dash-job-stat-label",children:"Active:"}),t("span",{className:"ss-dash-job-stat-value",children:x.active??0})]}),t("div",{className:"ss-dash-job-stat",children:[t("span",{className:"ss-dash-job-stat-label",children:"Waiting:"}),t("span",{className:"ss-dash-job-stat-value",children:x.waiting??0})]}),t("div",{className:"ss-dash-job-stat",children:[t("span",{className:"ss-dash-job-stat-label",children:"Delayed:"}),t("span",{className:"ss-dash-job-stat-value",children:x.delayed??0})]}),t("div",{className:"ss-dash-job-stat",children:[t("span",{className:"ss-dash-job-stat-label",children:"Completed:"}),t("span",{className:"ss-dash-job-stat-value",children:x.completed??0})]}),t("div",{className:"ss-dash-job-stat",children:[t("span",{className:"ss-dash-job-stat-label",children:"Failed:"}),t("span",{className:"ss-dash-job-stat-value",style:{color:"var(--ss-red-fg)"},children:x.failed??0})]})]}),t(le,{search:r,onSearchChange:i,placeholder:"Filter jobs...",summary:`${h?.total??S.length} jobs`,children:t("div",{className:"ss-dash-btn-group",children:Sr.map(f=>t("button",{type:"button",className:`ss-dash-btn ${a===f?"ss-dash-active":""}`,onClick:()=>{l(f),n(1)},children:f.charAt(0).toUpperCase()+f.slice(1)},f))})}),v&&!u?t("div",{className:"ss-dash-empty",children:"Loading jobs..."}):p?t("div",{className:"ss-dash-empty",children:"Jobs/Queue not available"}):t(M,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ae,{columns:[{key:"id",label:"ID",width:"40px",render:f=>t("span",{style:{color:"var(--ss-dim)"},children:f})},{key:"name",label:"Name",render:f=>t("span",{style:{color:"var(--ss-text)"},title:f,children:f})},{key:"status",label:"Status",width:"90px",render:f=>t(or,{color:Cr(f),children:f})},{key:"payload",label:"Payload",render:(f,k)=>t(ve,{data:f||k?.data,maxPreviewLength:60})},{key:"attempts",label:"Tries",width:"50px",render:(f,k)=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:f||k.attemptsMade||0})},{key:"duration",label:"Duration",width:"75px",render:f=>t("span",{className:"ss-dash-duration",children:f!==null?ne(f):"-"})},{key:"timestamp",label:"Time",width:"70px",render:(f,k)=>{const w=f||k?.createdAt||k?.processedAt||k?.created_at;return t("span",{className:"ss-dash-event-time",style:{whiteSpace:"nowrap"},title:re(w),children:Z(w)})}},{key:"_actions",label:"",width:"50px",render:(f,k)=>{const w=k.id,L=o[w];return k.status!=="failed"?null:t("button",{type:"button",className:"ss-dash-retry-btn",disabled:L==="pending"||L==="success",onClick:R=>{R.stopPropagation(),N(w)},children:L==="pending"?"...":L==="success"?"OK":"Retry"})}}],data:S,emptyMessage:"No jobs found"})}),h&&t(ue,{page:h.page,lastPage:h.lastPage,total:h.total,onPageChange:n})]})]})}const Er=Object.freeze(Object.defineProperty({__proto__:null,JobsSection:vs,default:vs},Symbol.toStringTag,{value:"Module"}));function G(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.__redacted===!0}function Pe(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!G(e)}function Xe(e,s=""){if(!Pe(e))return[{path:s,value:e}];const n=[];for(const r of Object.keys(e)){const i=s?`${s}.${r}`:r,a=e[r];Pe(a)?n.push(...Xe(a,i)):n.push({path:i,value:a})}return n}function et(e){return e==null?{text:"null",color:"var(--ss-dim)"}:typeof e=="boolean"?{text:String(e),color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"}:typeof e=="number"?{text:String(e),color:"var(--ss-amber-fg)"}:Array.isArray(e)?{text:`[${e.map(n=>n==null?"null":typeof n=="object"?JSON.stringify(n):String(n)).join(", ")}]`,color:"var(--ss-purple-fg)"}:typeof e=="object"?{text:JSON.stringify(e),color:"var(--ss-dim)"}:{text:String(e)}}function _s(e){if(e==null||typeof e!="object"||Array.isArray(e)||G(e))return 1;let s=0;for(const n of Object.keys(e))s+=_s(e[n]);return s}function Ar(e){if(!Pe(e))return[];const s=[];for(const n of Object.keys(e))Pe(e[n])&&s.push(n);return s}function qe(e,s,n){s&&navigator.clipboard.writeText(e).then(()=>{const r=s.textContent;s.textContent="✓",s.classList.add(`${n}-copy-row-ok`),setTimeout(()=>{s.textContent=r,s.classList.remove(`${n}-copy-row-ok`)},1200)}).catch(()=>{})}function Me({redacted:e,p:s}){const[n,r]=$(!1);return t("span",{className:`${s}-config-redacted`,style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[t("span",{children:n?e.value:e.display}),t("button",{type:"button",className:`${s}-btn`,title:n?"Hide":"Reveal",style:{padding:"0 4px",fontSize:"0.85em",lineHeight:1,minWidth:"auto"},onClick:i=>{i.stopPropagation(),r(a=>!a)},children:n?t("svg",{width:"14",height:"14",viewBox:O["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:O["eye-off"].elements.join("")}}):t("svg",{width:"14",height:"14",viewBox:O.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:O.eye.elements.join("")}})})]})}function Rr({env:e,search:s,p:n}){const r=H(new Map),i=s.toLowerCase(),a=Object.entries(e).filter(([l,o])=>{if(!i)return!0;const c=G(o)?o.display:o==null?"":String(o);return l.toLowerCase().includes(i)||c.toLowerCase().includes(i)});return t("div",{className:`${n}-config-table-wrap`,children:t("table",{className:`${n}-table ${n}-config-env-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Variable"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[a.map(([l,o])=>{const c=G(o),d=c?o.display:o==null?"null":String(o),u=`${l}=${d}`;return t("tr",{children:[t("td",{className:`${n}-env-key`,children:t("span",{className:`${n}-config-key`,children:l})}),t("td",{className:`${n}-env-val`,children:c?t(Me,{redacted:o,p:n}):t("span",{className:`${n}-config-val`,children:d})}),t("td",{children:!c&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:h=>{r.current.set(l,h)},onClick:h=>{h.stopPropagation(),qe(u,r.current.get(l)??null,n)},children:"⎘"})})]},l)}),a.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching variables"})})]})]})})}function Pr({source:e,search:s,p:n}){const r=H(new Map),i=s.toLowerCase(),a=Xe(e,""),l=a.filter(o=>{const c=G(o.value)?o.value.display:o.value===null||o.value===void 0?"":String(o.value);return o.path.toLowerCase().includes(i)||c.toLowerCase().includes(i)});return t("div",{className:`${n}-config-table-wrap`,children:[t("table",{className:`${n}-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Path"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[l.map(o=>{const c=G(o.value),d=c?null:et(o.value),u=c?o.value.display:d.text,h=`${o.path}: ${u}`;return t("tr",{children:[t("td",{children:t("span",{className:`${n}-config-key`,style:{whiteSpace:"nowrap"},children:o.path})}),t("td",{children:c?t(Me,{redacted:o.value,p:n}):t("span",{className:`${n}-config-val`,style:{wordBreak:"break-all",color:d.color},children:d.text})}),t("td",{children:!c&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:v=>{r.current.set(o.path,v)},onClick:v=>{v.stopPropagation(),qe(h,r.current.get(o.path)??null,n)},children:"⎘"})})]},o.path)}),l.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching entries"})})]})]}),t("div",{style:{padding:"4px 16px",fontSize:"10px",color:"var(--ss-muted)"},children:[l.length," of ",a.length," entries"]})]})}function qr({obj:e,prefix:s,p:n}){const r=H(new Map),i=Xe(e,s);return t("table",{className:`${n}-table ${n}-config-inner-table`,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"35%"},children:"Key"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:i.map(a=>{const l=a.path.indexOf(s+".")===0?a.path.slice(s.length+1):a.path,o=G(a.value),c=o?null:et(a.value),d=o?a.value.display:c.text,u=`${a.path}: ${d}`;return t("tr",{children:[t("td",{title:l,children:t("span",{className:`${n}-config-key`,children:l})}),t("td",{title:d,children:o?t(Me,{redacted:a.value,p:n}):t("span",{className:`${n}-config-val`,style:{color:c.color},children:c.text})}),t("td",{children:!o&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:h=>{r.current.set(a.path,h)},onClick:h=>{h.stopPropagation(),qe(u,r.current.get(a.path)??null,n)},children:"⎘"})})]},a.path)})})]})}function Mr({value:e,p:s}){if(e==null)return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-dim)"},children:"null"});if(G(e))return t(Me,{redacted:e,p:s});if(typeof e=="boolean")return t("span",{className:`${s}-config-val`,style:{color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"},children:String(e)});if(typeof e=="number")return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-amber-fg)"},children:String(e)});if(Array.isArray(e)){const n=e.map(r=>r==null?"null":typeof r=="object"?JSON.stringify(r):String(r));return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-purple-fg)"},children:["[",n.join(", "),"]"]})}return typeof e=="object"?t("span",{className:`${s}-config-val`,style:{color:"var(--ss-dim)"},children:JSON.stringify(e)}):t("span",{className:`${s}-config-val`,children:String(e)})}function Dr({obj:e,expandedPaths:s,onToggle:n,p:r}){if(e==null||typeof e!="object"||Array.isArray(e)||G(e))return null;const i=Object.keys(e),a=H(new Map);return t("div",{className:`${r}-config-sections`,children:i.map(l=>{const o=e[l],c=o!==null&&typeof o=="object"&&!Array.isArray(o)&&!G(o),d=s.has(l),u=G(o);return t("div",{className:`${r}-config-section`,children:[t("div",{className:`${r}-config-section-header${c?"":` ${r}-config-leaf`}`,onClick:c?()=>n(l):void 0,style:{cursor:c?"pointer":"default"},children:[c?t("span",{className:`${r}-config-toggle`,children:d?"▼":"▶"}):t("span",{className:`${r}-config-toggle`,style:{visibility:"hidden"},children:"•"}),t("span",{className:`${r}-config-key`,children:l}),c?t("span",{className:`${r}-config-count`,children:[_s(o)," entries"]}):t(M,{children:[t("span",{className:`${r}-config-val`,style:{marginLeft:"8px"},children:t(Mr,{value:o,p:r})}),!u&&t("button",{type:"button",className:`${r}-copy-row-btn`,style:{marginLeft:"4px"},title:"Copy",ref:h=>{a.current.set(l,h)},onClick:h=>{h.stopPropagation();const v=et(o);qe(`${l}: ${v.text}`,a.current.get(l)??null,r)},children:"⎘"})]})]}),c&&d&&t("div",{className:`${r}-config-section-body`,children:t(qr,{obj:o,prefix:l,p:r})})]},l)})})}function Fr({data:e,isLoading:s,classPrefix:n}){const r=n,[i,a]=$(""),[l,o]=$(""),[c,d]=$("app"),[u,h]=$(new Set),[v,p]=$("Copy JSON");W(()=>{const f=setTimeout(()=>o(i),200);return()=>clearTimeout(f)},[i]);const m=e,_=A(f=>{h(k=>{const w=new Set(k);return w.has(f)?w.delete(f):w.add(f),w})},[]),S=A(()=>{if(!m)return;const f=c==="app"?m.app:m.env;if(!f)return;const k=Ar(f);h(new Set(k))},[m,c]),x=A(()=>{h(new Set)},[]),N=A(async()=>{if(m)try{const f=c==="app"?m.app:m.env;await navigator.clipboard.writeText(JSON.stringify(f,null,2)),p("Copied!"),setTimeout(()=>p("Copy JSON"),1500)}catch{}},[m,c]);return t("div",{children:[t("div",{className:`${r}-config-toolbar`,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px"},children:[t("button",{type:"button",className:`${r}-config-tab${c==="app"?` ${r}-active`:""}`,onClick:()=>d("app"),children:"App Config"}),t("button",{type:"button",className:`${r}-config-tab${c==="env"?` ${r}-active`:""}`,onClick:()=>d("env"),children:"Env"}),t("div",{style:{position:"relative",flex:1},children:[t("input",{type:"text",className:`${r}-search`,placeholder:"Search keys and values...",value:i,onChange:f=>a(f.target.value),style:{width:"100%"}}),i&&t("button",{type:"button",onClick:()=>a(""),style:{position:"absolute",right:"6px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",fontSize:"14px",color:"var(--ss-dim)",padding:"0 2px",lineHeight:1},children:"×"})]}),c==="app"&&!l&&t(M,{children:[t("button",{type:"button",className:`${r}-btn`,onClick:S,children:"Expand All"}),t("button",{type:"button",className:`${r}-btn`,onClick:x,children:"Collapse All"})]}),t("button",{type:"button",className:`${r}-btn`,onClick:N,children:v})]}),s&&!e?t("div",{className:`${r}-empty`,children:"Loading config..."}):m?c==="env"?t(Rr,{env:m.env??{},search:l,p:r}):l?t(Pr,{source:m.app??{},search:l,p:r}):t("div",{className:`${r}-config-table-wrap`,children:t(Dr,{obj:m.app,expandedPaths:u,onToggle:_,p:r})}):t("div",{className:`${r}-empty`,children:"Config not available"})]})}function gs({options:e={}}){const{data:s,isLoading:n}=K("config",e);return t(Fr,{data:s,isLoading:n,classPrefix:"ss-dash"})}const Or=Object.freeze(Object.defineProperty({__proto__:null,ConfigSection:gs,default:gs},Symbol.toStringTag,{value:"Module"})),Ir=["password","secret","token","key","credential","auth"];function ys(e){const s=e.toLowerCase();return Ir.some(n=>s.includes(n))}function bs(e){if(e==null)return"-";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.join(", ")||"-";try{return JSON.stringify(e)}catch{return String(e)}}const jr={collectionInterval:"Stats Collection",dashboardBroadcast:"Dashboard Broadcast",debugBroadcast:"Debug Broadcast",persistFlush:"Persist Flush",retentionCleanup:"Retention Cleanup"};function Br(e){return jr[e]||e}const Ur={prometheus:"Prometheus",pinoHook:"Pino Log Hook",edgePlugin:"Edge Plugin",cacheInspector:"Cache Inspector",queueInspector:"Queue Inspector"};function Hr(e){return Ur[e]||e}const zr=["healthy","active","connected","available","ready"],Vr=["errored","unavailable"];function Wr(e){return zr.includes(e)?"ok":Vr.includes(e)?"err":""}function _e({status:e,prefix:s}){const n=Wr(e);let r=`${s}-dot`;return n==="ok"?r+=` ${s}-dot-ok`:n==="err"&&(r+=` ${s}-dot-err`),t("span",{className:r})}const ws=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:O.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:O.eye.elements.join("")}}),Ns=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:O["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:O["eye-off"].elements.join("")}});function Kr({value:e}){const[s,n]=$(!1);return t("span",{children:[s?e:"••••••••"," ",t("button",{type:"button",onClick:()=>n(r=>!r),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:s?t(Ns,{}):t(ws,{})})]})}function Qr({current:e,max:s,prefix:n}){const r=s>0?Math.min(100,Math.round(e/s*100)):0,i=r>=100;return t("div",{className:`${n}-bar`,children:[t("div",{className:`${n}-bar-track`,children:t("div",{className:`${n}-bar-fill${i?` ${n}-bar-fill-warn`:""}`,style:{width:`${r}%`}})}),t("span",{className:`${n}-bar-pct${i?` ${n}-bar-pct-warn`:""}`,children:[r,"%"]})]})}function Jr({config:e,prefix:s}){const n=Object.entries(e);return n.length===0?t("span",{className:`${s}-c-dim`,children:"-"}):t("span",{className:`${s}-c-muted`,children:n.map(([r,i],a)=>t("span",{children:[a>0&&", ",t("span",{className:`${s}-c-dim`,children:r}),"=",ys(r)&&typeof i=="string"?t(Kr,{value:i}):t("span",{children:bs(i)})]},r))})}function ge({label:e,value:s,prefix:n}){return t("div",{className:`${n}-info-card`,children:[t("span",{className:`${n}-info-card-label`,children:e}),t("span",{className:`${n}-info-card-value`,children:s})]})}function Gr({data:e,tableClassName:s,classPrefix:n}){const r=n||"ss-dash",[i,a]=$(new Set),l=A(c=>{a(d=>{const u=new Set(d);return u.has(c)?u.delete(c):u.add(c),u})},[]),o=A((c,d)=>{if(d==null)return t("span",{className:`${r}-c-dim`,children:"null"});if(typeof d=="boolean")return t("span",{className:d?`${r}-c-green`:`${r}-c-red`,children:String(d)});if(Array.isArray(d))return t("span",{children:d.join(", ")||"-"});const u=bs(d);if(ys(c)){const h=i.has(c);return t("span",{children:[h?u:"••••••••"," ",t("button",{type:"button",onClick:()=>l(c),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:h?t(Ns,{}):t(ws,{})})]})}return t("span",{children:u})},[i,l,r]);return t("div",{children:[t("h3",{className:`${r}-internals-title`,children:"Package Info"}),t("div",{className:`${r}-info-cards`,children:[t(ge,{label:"Version",value:e.package.version||"-",prefix:r}),t(ge,{label:"Node.js",value:e.package.nodeVersion||"-",prefix:r}),t(ge,{label:"AdonisJS",value:e.package.adonisVersion||"-",prefix:r}),t(ge,{label:"Uptime",value:zn(e.package.uptime),prefix:r}),t(ge,{label:"Renderer",value:e.devToolbar?.renderer||"preact",prefix:r})]}),e.collectors.length>0&&t(M,{children:[t("h3",{className:`${r}-internals-title`,children:"Collectors"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Collector"}),t("th",{children:"Status"}),t("th",{children:"Last Error"}),t("th",{children:"Config"})]})}),t("tbody",{children:e.collectors.map(c=>t("tr",{children:[t("td",{children:[t("code",{children:c.name}),c.label&&c.label!==c.name&&t("span",{className:`${r}-c-dim`,children:[" ",c.label]})]}),t("td",{children:[t(_e,{status:c.status,prefix:r}),c.status]}),t("td",{className:c.lastError?`${r}-c-red`:`${r}-c-dim`,children:c.lastError?t(M,{children:[c.lastError,c.lastErrorAt&&t("span",{className:`${r}-c-dim`,style:{fontSize:"10px"},children:Z(c.lastErrorAt)})]}):"-"}),t("td",{children:t(Jr,{config:c.config,prefix:r})})]},c.name))})]})]}),t("h3",{className:`${r}-internals-title`,children:"Buffers"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Buffer"}),t("th",{children:"Usage"}),t("th",{children:"Fill %"})]})}),t("tbody",{children:Object.entries(e.buffers).map(([c,d])=>t("tr",{children:[t("td",{style:{textTransform:"capitalize"},children:c}),t("td",{children:[d.current.toLocaleString()," / ",d.max.toLocaleString()]}),t("td",{children:t(Qr,{current:d.current,max:d.max,prefix:r})})]},c))})]}),t("h3",{className:`${r}-internals-title`,children:"Timers"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Timer"}),t("th",{children:"Status"}),t("th",{children:"Interval"})]})}),t("tbody",{children:Object.entries(e.timers).map(([c,d])=>t("tr",{children:[t("td",{children:Br(c)}),t("td",{children:[t(_e,{status:d.active?"active":"inactive",prefix:r}),t("span",{className:d.active?`${r}-c-green`:`${r}-c-dim`,children:d.active?"active":"inactive"})]}),t("td",{children:d.active?d.intervalMs?ne(d.intervalMs):d.debounceMs?`${ne(d.debounceMs)} (debounce)`:"-":t("span",{className:`${r}-c-dim`,children:"—"})})]},c))})]}),t("h3",{className:`${r}-internals-title`,children:"Integrations"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Integration"}),t("th",{children:"Status"}),t("th",{children:"Details"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Transmit (SSE)"}),t("td",{children:[t(_e,{status:e.transmit.available?"connected":"inactive",prefix:r}),e.transmit.available?"connected":"unavailable"]}),t("td",{style:{fontSize:"11px"},children:e.transmit.channels.length>0?`Channels: ${e.transmit.channels.join(", ")}`:"-"})]}),Object.entries(e.integrations).map(([c,d])=>{const u=d.active??d.available??!1,h=d.active?"active":d.available?"available":"unavailable";let v=d.mode?`Mode: ${d.mode}`:"-";return c==="edgePlugin"&&d.active?v="@serverStats() tag registered":c==="cacheInspector"&&d.available?v="Redis dependency detected":c==="queueInspector"&&d.available&&(v="Queue dependency detected"),t("tr",{children:[t("td",{children:Hr(c)}),t("td",{children:[t(_e,{status:u?"active":"inactive",prefix:r}),h]}),t("td",{className:`${r}-c-dim`,style:{fontSize:"11px"},children:v})]},c)})]})]}),e.storage&&t(M,{children:[t("h3",{className:`${r}-internals-title`,children:"Storage (SQLite)"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Metric"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Status"}),t("td",{children:[t(_e,{status:e.storage.ready?"ready":"inactive",prefix:r}),e.storage.ready?"ready":"not ready"]})]}),t("tr",{children:[t("td",{children:"DB Path"}),t("td",{children:t("code",{children:e.storage.dbPath})})]}),t("tr",{children:[t("td",{children:"File Size"}),t("td",{children:[e.storage.fileSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"WAL Size"}),t("td",{children:[e.storage.walSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"Retention"}),t("td",{children:[e.storage.retentionDays," days"]})]}),t("tr",{children:[t("td",{children:"Last Cleanup"}),t("td",{children:e.storage.lastCleanupAt?Z(e.storage.lastCleanupAt):"-"})]})]})]}),e.storage.tables.length>0&&t("table",{className:s,style:{marginTop:8},children:[t("thead",{children:t("tr",{children:[t("th",{children:"Table"}),t("th",{children:"Rows"})]})}),t("tbody",{children:e.storage.tables.map(c=>t("tr",{children:[t("td",{children:t("code",{children:c.name})}),t("td",{children:c.rowCount.toLocaleString()})]},c.name))})]})]}),t("h3",{className:`${r}-internals-title`,children:"Resolved Config"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"intervalMs"}),t("td",{children:e.config.intervalMs})]}),t("tr",{children:[t("td",{children:"transport"}),t("td",{children:e.config.transport})]}),t("tr",{children:[t("td",{children:"channelName"}),t("td",{children:e.config.channelName})]}),t("tr",{children:[t("td",{children:"endpoint"}),t("td",{children:e.config.endpoint===!1?"false":e.config.endpoint})]}),t("tr",{children:[t("td",{children:"skipInTest"}),t("td",{children:o("skipInTest",e.config.skipInTest)})]}),t("tr",{children:[t("td",{children:"onStats callback"}),t("td",{children:e.config.hasOnStatsCallback?"defined":"not defined"})]}),t("tr",{children:[t("td",{children:"shouldShow callback"}),t("td",{children:e.config.hasShouldShowCallback?"defined":"not defined"})]})]})]}),t("h4",{className:`${r}-internals-title`,children:"DevToolbar"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:Object.entries(e.devToolbar).map(([c,d])=>t("tr",{children:[t("td",{children:c==="customPaneCount"?"customPanes":c}),t("td",{children:c==="customPaneCount"?`${d} registered`:o(c,d)})]},c))})]})]})}function xs({options:e={},debugEndpoint:s="/admin/api/debug"}){const{baseUrl:n="",authToken:r}=e,[i,a]=$(null),[l,o]=$(!0),[c,d]=$(null),u=H(null),h=Jt(n,r),v=A(async()=>{try{const m=await h().get(`${s}/diagnostics`);a(m),d(null),o(!1)}catch(p){if(p instanceof Ke){d(p),o(!1),u.current&&(clearInterval(u.current),u.current=null);return}d(p instanceof Error?p:new Error(String(p))),o(!1)}},[s,h]);return W(()=>(o(!0),d(null),v(),u.current=setInterval(v,Ot),()=>{u.current&&(clearInterval(u.current),u.current=null)}),[v]),l&&!i?t("div",{className:"ss-dash-empty",children:"Loading diagnostics..."}):c?t("div",{className:"ss-dash-empty",children:["Error: ",c.message]}):i?t(Gr,{data:i,tableClassName:"ss-dash-table",classPrefix:"ss-dash"}):t("div",{className:"ss-dash-empty",children:"Diagnostics not available"})}const Yr=Object.freeze(Object.defineProperty({__proto__:null,InternalsSection:xs,default:xs},Symbol.toStringTag,{value:"Module"}))})();