adonisjs-server-stats 1.11.6 → 1.11.7

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 (62) hide show
  1. package/README.md +13 -0
  2. package/dist/core/types-diagnostics.d.ts +2 -0
  3. package/dist/react/{CacheSection-BYN53kYO.js → CacheSection-DOUnyUrw.js} +1 -1
  4. package/dist/react/{CacheTab-DOhuK05d.js → CacheTab-D9o6bsPc.js} +1 -1
  5. package/dist/react/{ConfigSection-B9EHh4Rp.js → ConfigSection-DzNC7pOJ.js} +1 -1
  6. package/dist/react/{ConfigTab-C8kriE2b.js → ConfigTab-CT-Tu-ct.js} +1 -1
  7. package/dist/react/{CustomPaneTab-CvzQS_Wh.js → CustomPaneTab-CvIPe7NP.js} +1 -1
  8. package/dist/react/{EmailsSection-BJyFJf7A.js → EmailsSection-B1LT7Nx3.js} +1 -1
  9. package/dist/react/{EmailsTab-Ch8jp10B.js → EmailsTab-DKxK322z.js} +1 -1
  10. package/dist/react/{EventsSection-DJPwHeT8.js → EventsSection-D3AK0mhw.js} +1 -1
  11. package/dist/react/{EventsTab-B-FoehXC.js → EventsTab-BRRSW6RI.js} +1 -1
  12. package/dist/react/InternalsContent-BNOnSoi9.js +393 -0
  13. package/dist/react/{InternalsSection-B6VlVx5f.js → InternalsSection-BwrTfpjA.js} +1 -1
  14. package/dist/react/{InternalsTab-CkEKpRMU.js → InternalsTab--RD-L1dX.js} +1 -1
  15. package/dist/react/{JobsSection-DWF4i1t_.js → JobsSection-BMvj5886.js} +1 -1
  16. package/dist/react/{JobsTab-DqnifQXV.js → JobsTab-CQXWCrl8.js} +1 -1
  17. package/dist/react/{LogEntryRow-CMMkqA9M.js → LogEntryRow-DFI52ZEw.js} +1 -1
  18. package/dist/react/{LogsSection-C1xC5aP4.js → LogsSection-CW2hQ976.js} +2 -2
  19. package/dist/react/{LogsTab-CS4sLfLw.js → LogsTab-CV4Gf_yb.js} +2 -2
  20. package/dist/react/{OverviewSection-CxvfOR0v.js → OverviewSection-CxF9cabq.js} +1 -1
  21. package/dist/react/{QueriesSection-CrMdU5Ax.js → QueriesSection-CZJ-imAb.js} +117 -101
  22. package/dist/react/{QueriesTab-x85PjkyS.js → QueriesTab-CQHa1ck3.js} +23 -14
  23. package/dist/react/{RequestsSection-DETN9oZb.js → RequestsSection-Cb5YeqvI.js} +2 -2
  24. package/dist/react/{RoutesSection-CmorkJeC.js → RoutesSection-B43olD9v.js} +1 -1
  25. package/dist/react/{RoutesTab-CbzBOzpc.js → RoutesTab-RfhCUbkx.js} +1 -1
  26. package/dist/react/{SplitPaneWrapper-BiIgT4ND.js → SplitPaneWrapper-B05Mg6Sg.js} +1 -1
  27. package/dist/react/{TimelineTab-Ue9tUD_n.js → TimelineTab-Dx4686Ti.js} +2 -2
  28. package/dist/react/components/Dashboard/shared/DataTable.d.ts +1 -1
  29. package/dist/react/{index-DwDK-4oX.js → index-C4EMJrkH.js} +2 -2
  30. package/dist/react/index.js +1 -1
  31. package/dist/react/style.css +1 -1
  32. package/dist/src/collectors/db_pool_collector.js +17 -23
  33. package/dist/src/edge/client/dashboard.js +2 -2
  34. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  35. package/dist/src/edge/client-vue/dashboard.js +3 -3
  36. package/dist/src/edge/client-vue/debug-panel-deferred.js +2 -2
  37. package/dist/src/provider/diagnostics.d.ts +3 -0
  38. package/dist/src/provider/diagnostics.js +1 -0
  39. package/dist/src/provider/server_stats_provider.d.ts +7 -0
  40. package/dist/src/provider/server_stats_provider.js +36 -0
  41. package/dist/src/styles/components.css +16 -0
  42. package/dist/src/styles/dashboard.css +20 -12
  43. package/dist/vue/{CacheSection-DT2Mwf_s.js → CacheSection-BAotiuQq.js} +1 -1
  44. package/dist/vue/{ConfigSection-BwKwS9lh.js → ConfigSection-JZjK5E5F.js} +1 -1
  45. package/dist/vue/{EmailsSection-B65g0FVS.js → EmailsSection-BLwyQO7B.js} +1 -1
  46. package/dist/vue/{EventsSection-CxqtVF-o.js → EventsSection-BUEwO-0A.js} +1 -1
  47. package/dist/vue/{InternalsSection-BJUXE-5F.js → InternalsSection-jhTCuK3j.js} +149 -130
  48. package/dist/vue/{InternalsTab-DEMjqtlw.js → InternalsTab-521fxYYj.js} +152 -133
  49. package/dist/vue/{JobsSection-rMIyMb-g.js → JobsSection-21A0yQMq.js} +1 -1
  50. package/dist/vue/{LogsSection-DmmZVJ7D.js → LogsSection-BmOx8SNa.js} +1 -1
  51. package/dist/vue/{OverviewSection-BMabyqw-.js → OverviewSection-BRDK3Ony.js} +1 -1
  52. package/dist/vue/QueriesSection-D2WGsuR4.js +444 -0
  53. package/dist/vue/QueriesTab-6D_xfi7Q.js +114 -0
  54. package/dist/vue/{RequestsSection-CTu4jPZ_.js → RequestsSection-DLrjCfcE.js} +1 -1
  55. package/dist/vue/{RoutesSection-zQZDedL7.js → RoutesSection-CPr9w42B.js} +1 -1
  56. package/dist/vue/{index-CM3yNVUR.js → index-CYaqRGIT.js} +2 -2
  57. package/dist/vue/index.js +1 -1
  58. package/dist/vue/style.css +1 -1
  59. package/package.json +1 -1
  60. package/dist/react/InternalsContent-O8ino9oM.js +0 -370
  61. package/dist/vue/QueriesSection-BfDFwGqH.js +0 -428
  62. package/dist/vue/QueriesTab-DuTG7cpC.js +0 -106
@@ -1 +1 @@
1
- (function(){"use strict";var ne,x,Ie,J,Re,Fe,Ue,He,ye,we,Ne,re={},se=[],Zt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Q=Array.isArray;function U(e,n){for(var r in n)e[r]=n[r];return e}function xe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function le(e,n,r){var s,l,i,c={};for(i in n)i=="key"?s=n[i]:i=="ref"?l=n[i]:c[i]=n[i];if(arguments.length>2&&(c.children=arguments.length>3?ne.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)c[i]===void 0&&(c[i]=e.defaultProps[i]);return ie(e,c,s,l,null)}function ie(e,n,r,s,l){var i={type:e,props:n,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++Ie,__i:-1,__u:0};return l==null&&x.vnode!=null&&x.vnode(i),i}function M(e){return e.children}function H(e,n){this.props=e,this.context=n}function K(e,n){if(n==null)return e.__?K(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?K(e):null}function en(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,s=[],l=[],i=U({},n);i.__v=n.__v+1,x.vnode&&x.vnode(i),$e(e.__P,i,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,s,r??K(n),!!(32&n.__u),l),i.__v=n.__v,i.__.__k[i.__i]=i,Qe(s,i,l),n.__e=n.__=null,i.__e!=r&&ze(i)}}function ze(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),ze(e)}function Ve(e){(!e.__d&&(e.__d=!0)&&J.push(e)&&!oe.__r++||Re!=x.debounceRendering)&&((Re=x.debounceRendering)||Fe)(oe)}function oe(){for(var e,n=1;J.length;)J.length>n&&J.sort(Ue),e=J.shift(),n=J.length,en(e);oe.__r=0}function qe(e,n,r,s,l,i,c,d,a,o,h){var u,f,_,p,v,y,b,m=s&&s.__k||se,N=n.length;for(a=tn(r,n,m,a,N),u=0;u<N;u++)(_=r.__k[u])!=null&&(f=_.__i!=-1&&m[_.__i]||re,_.__i=u,y=$e(e,_,f,l,i,c,d,a,o,h),p=_.__e,_.ref&&f.ref!=_.ref&&(f.ref&&ke(f.ref,null,_),h.push(_.ref,_.__c||p,_)),v==null&&p!=null&&(v=p),(b=!!(4&_.__u))||f.__k===_.__k?a=We(_,a,e,b):typeof _.type=="function"&&y!==void 0?a=y:p&&(a=p.nextSibling),_.__u&=-7);return r.__e=v,a}function tn(e,n,r,s,l){var i,c,d,a,o,h=r.length,u=h,f=0;for(e.__k=new Array(l),i=0;i<l;i++)(c=n[i])!=null&&typeof c!="boolean"&&typeof c!="function"?(typeof c=="string"||typeof c=="number"||typeof c=="bigint"||c.constructor==String?c=e.__k[i]=ie(null,c,null,null,null):Q(c)?c=e.__k[i]=ie(M,{children:c},null,null,null):c.constructor===void 0&&c.__b>0?c=e.__k[i]=ie(c.type,c.props,c.key,c.ref?c.ref:null,c.__v):e.__k[i]=c,a=i+f,c.__=e,c.__b=e.__b+1,d=null,(o=c.__i=nn(c,r,a,u))!=-1&&(u--,(d=r[o])&&(d.__u|=2)),d==null||d.__v==null?(o==-1&&(l>h?f--:l<h&&f++),typeof c.type!="function"&&(c.__u|=4)):o!=a&&(o==a-1?f--:o==a+1?f++:(o>a?f--:f++,c.__u|=4))):e.__k[i]=null;if(u)for(i=0;i<h;i++)(d=r[i])!=null&&(2&d.__u)==0&&(d.__e==s&&(s=K(d)),Ye(d,d));return s}function We(e,n,r,s){var l,i;if(typeof e.type=="function"){for(l=e.__k,i=0;l&&i<l.length;i++)l[i]&&(l[i].__=e,n=We(l[i],n,r,s));return n}e.__e!=n&&(s&&(n&&e.type&&!n.parentNode&&(n=K(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function ae(e,n){return n=n||[],e==null||typeof e=="boolean"||(Q(e)?e.some(function(r){ae(r,n)}):n.push(e)),n}function nn(e,n,r,s){var l,i,c,d=e.key,a=e.type,o=n[r],h=o!=null&&(2&o.__u)==0;if(o===null&&d==null||h&&d==o.key&&a==o.type)return r;if(s>(h?1:0)){for(l=r-1,i=r+1;l>=0||i<n.length;)if((o=n[c=l>=0?l--:i++])!=null&&(2&o.__u)==0&&d==o.key&&a==o.type)return c}return-1}function Je(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||Zt.test(n)?r:r+"px"}function ce(e,n,r,s,l){var i,c;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof s=="string"&&(e.style.cssText=s=""),s)for(n in s)r&&n in r||Je(e.style,n,"");if(r)for(n in r)s&&r[n]==s[n]||Je(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")i=n!=(n=n.replace(He,"$1")),c=n.toLowerCase(),n=c in e||n=="onFocusOut"||n=="onFocusIn"?c.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+i]=r,r?s?r.u=s.u:(r.u=ye,e.addEventListener(n,i?Ne:we,i)):e.removeEventListener(n,i?Ne:we,i);else{if(l=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function Ke(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=ye++;else if(n.t<r.u)return;return r(x.event?x.event(n):n)}}}function $e(e,n,r,s,l,i,c,d,a,o){var h,u,f,_,p,v,y,b,m,N,$,g,S,P,W,O=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(a=!!(32&r.__u),i=[d=n.__e=r.__e]),(h=x.__b)&&h(n);e:if(typeof O=="function")try{if(b=n.props,m="prototype"in O&&O.prototype.render,N=(h=O.contextType)&&s[h.__c],$=h?N?N.props.value:h.__:s,r.__c?y=(u=n.__c=r.__c).__=u.__E:(m?n.__c=u=new O(b,$):(n.__c=u=new H(b,$),u.constructor=O,u.render=sn),N&&N.sub(u),u.state||(u.state={}),u.__n=s,f=u.__d=!0,u.__h=[],u._sb=[]),m&&u.__s==null&&(u.__s=u.state),m&&O.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=U({},u.__s)),U(u.__s,O.getDerivedStateFromProps(b,u.__s))),_=u.props,p=u.state,u.__v=n,f)m&&O.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),m&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(m&&O.getDerivedStateFromProps==null&&b!==_&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(b,$),n.__v==r.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(b,u.__s,$)===!1){n.__v!=r.__v&&(u.props=b,u.state=u.__s,u.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(T){T&&(T.__=n)}),se.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&c.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(b,u.__s,$),m&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(_,p,v)})}if(u.context=$,u.props=b,u.__P=e,u.__e=!1,g=x.__r,S=0,m)u.state=u.__s,u.__d=!1,g&&g(n),h=u.render(u.props,u.state,u.context),se.push.apply(u.__h,u._sb),u._sb=[];else do u.__d=!1,g&&g(n),h=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++S<25);u.state=u.__s,u.getChildContext!=null&&(s=U(U({},s),u.getChildContext())),m&&!f&&u.getSnapshotBeforeUpdate!=null&&(v=u.getSnapshotBeforeUpdate(_,p)),P=h!=null&&h.type===M&&h.key==null?Ge(h.props.children):h,d=qe(e,Q(P)?P:[P],n,r,s,l,i,c,d,a,o),u.base=n.__e,n.__u&=-161,u.__h.length&&c.push(u),y&&(u.__E=u.__=null)}catch(T){if(n.__v=null,a||i!=null)if(T.then){for(n.__u|=a?160:128;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;i[i.indexOf(d)]=null,n.__e=d}else{for(W=i.length;W--;)xe(i[W]);Se(n)}else n.__e=r.__e,n.__k=r.__k,T.then||Se(n);x.__e(T,n,r)}else i==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):d=n.__e=rn(r.__e,n,r,s,l,i,c,a,o);return(h=x.diffed)&&h(n),128&n.__u?void 0:d}function Se(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Se))}function Qe(e,n,r){for(var s=0;s<r.length;s++)ke(r[s],r[++s],r[++s]);x.__c&&x.__c(n,e),e.some(function(l){try{e=l.__h,l.__h=[],e.some(function(i){i.call(l)})}catch(i){x.__e(i,l.__v)}})}function Ge(e){return typeof e!="object"||e==null||e.__b>0?e:Q(e)?e.map(Ge):U({},e)}function rn(e,n,r,s,l,i,c,d,a){var o,h,u,f,_,p,v,y=r.props||re,b=n.props,m=n.type;if(m=="svg"?l="http://www.w3.org/2000/svg":m=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),i!=null){for(o=0;o<i.length;o++)if((_=i[o])&&"setAttribute"in _==!!m&&(m?_.localName==m:_.nodeType==3)){e=_,i[o]=null;break}}if(e==null){if(m==null)return document.createTextNode(b);e=document.createElementNS(l,m,b.is&&b),d&&(x.__m&&x.__m(n,i),d=!1),i=null}if(m==null)y===b||d&&e.data==b||(e.data=b);else{if(i=i&&ne.call(e.childNodes),!d&&i!=null)for(y={},o=0;o<e.attributes.length;o++)y[(_=e.attributes[o]).name]=_.value;for(o in y)_=y[o],o=="dangerouslySetInnerHTML"?u=_:o=="children"||o in b||o=="value"&&"defaultValue"in b||o=="checked"&&"defaultChecked"in b||ce(e,o,null,_,l);for(o in b)_=b[o],o=="children"?f=_:o=="dangerouslySetInnerHTML"?h=_:o=="value"?p=_:o=="checked"?v=_:d&&typeof _!="function"||y[o]===_||ce(e,o,_,y[o],l);if(h)d||u&&(h.__html==u.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(u&&(e.innerHTML=""),qe(n.type=="template"?e.content:e,Q(f)?f:[f],n,r,s,m=="foreignObject"?"http://www.w3.org/1999/xhtml":l,i,c,i?i[0]:r.__k&&K(r,0),d,a),i!=null)for(o=i.length;o--;)xe(i[o]);d||(o="value",m=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[o]||m=="progress"&&!p||m=="option"&&p!=y[o])&&ce(e,o,p,y[o],l),o="checked",v!=null&&v!=e[o]&&ce(e,o,v,y[o],l))}return e}function ke(e,n,r){try{if(typeof e=="function"){var s=typeof e.__u=="function";s&&e.__u(),s&&n==null||(e.__u=e(n))}else e.current=n}catch(l){x.__e(l,r)}}function Ye(e,n,r){var s,l;if(x.unmount&&x.unmount(e),(s=e.ref)&&(s.current&&s.current!=e.__e||ke(s,null,n)),(s=e.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(i){x.__e(i,n)}s.base=s.__P=null}if(s=e.__k)for(l=0;l<s.length;l++)s[l]&&Ye(s[l],n,r||typeof e.type!="function");r||xe(e.__e),e.__c=e.__=e.__e=void 0}function sn(e,n,r){return this.constructor(e,r)}function Xe(e,n,r){var s,l,i,c;n==document&&(n=document.documentElement),x.__&&x.__(e,n),l=(s=!1)?null:n.__k,i=[],c=[],$e(n,e=n.__k=le(M,null,[e]),l||re,re,n.namespaceURI,l?null:n.firstChild?ne.call(n.childNodes):null,i,l?l.__e:n.firstChild,s,c),Qe(i,e,c)}ne=se.slice,x={__e:function(e,n,r,s){for(var l,i,c;n=n.__;)if((l=n.__c)&&!l.__)try{if((i=l.constructor)&&i.getDerivedStateFromError!=null&&(l.setState(i.getDerivedStateFromError(e)),c=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(e,s||{}),c=l.__d),c)return l.__E=l}catch(d){e=d}throw e}},Ie=0,H.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=U({},this.state),typeof e=="function"&&(e=e(U({},r),this.props)),e&&U(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),Ve(this))},H.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ve(this))},H.prototype.render=M,J=[],Fe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ue=function(e,n){return e.__v.__b-n.__v.__b},oe.__r=0,He=/(PointerCapture)$|Capture$/i,ye=0,we=Ke(!1),Ne=Ke(!0);var ln=0;function t(e,n,r,s,l,i){n||(n={});var c,d,a=n;if("ref"in a)for(d in a={},n)d=="ref"?c=n[d]:a[d]=n[d];var o={type:e,props:a,key:r,ref:c,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ln,__i:-1,__u:0,__source:l,__self:i};if(typeof e=="function"&&(c=e.defaultProps))for(d in c)a[d]===void 0&&(a[d]=c[d]);return x.vnode&&x.vnode(o),o}var G,L,Ce,Ze,Y=0,et=[],A=x,tt=A.__b,nt=A.__r,rt=A.diffed,st=A.__c,lt=A.unmount,it=A.__;function Te(e,n){A.__h&&A.__h(L,e,Y||n),Y=0;var r=L.__H||(L.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function w(e){return Y=1,on(ct,e)}function on(e,n,r){var s=Te(G++,2);if(s.t=e,!s.__c&&(s.__=[r?r(n):ct(void 0,n),function(d){var a=s.__N?s.__N[0]:s.__[0],o=s.t(a,d);a!==o&&(s.__N=[o,s.__[1]],s.__c.setState({}))}],s.__c=L,!L.__f)){var l=function(d,a,o){if(!s.__c.__H)return!0;var h=s.__c.__H.__.filter(function(f){return f.__c});if(h.every(function(f){return!f.__N}))return!i||i.call(this,d,a,o);var u=s.__c.props!==d;return h.some(function(f){if(f.__N){var _=f.__[0];f.__=f.__N,f.__N=void 0,_!==f.__[0]&&(u=!0)}}),i&&i.call(this,d,a,o)||u};L.__f=!0;var i=L.shouldComponentUpdate,c=L.componentWillUpdate;L.componentWillUpdate=function(d,a,o){if(this.__e){var h=i;i=void 0,l(d,a,o),i=h}c&&c.call(this,d,a,o)},L.shouldComponentUpdate=l}return s.__N||s.__}function I(e,n){var r=Te(G++,3);!A.__s&&at(r.__H,n)&&(r.__=e,r.u=n,L.__H.__h.push(r))}function j(e){return Y=5,C(function(){return{current:e}},[])}function C(e,n){var r=Te(G++,7);return at(r.__H,n)&&(r.__=e(),r.__H=n,r.__h=e),r.__}function k(e,n){return Y=8,C(function(){return e},n)}function an(){for(var e;e=et.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(de),n.__h.some(Le),n.__h=[]}catch(r){n.__h=[],A.__e(r,e.__v)}}}A.__b=function(e){L=null,tt&&tt(e)},A.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),it&&it(e,n)},A.__r=function(e){nt&&nt(e),G=0;var n=(L=e.__c).__H;n&&(Ce===L?(n.__h=[],L.__h=[],n.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(n.__h.some(de),n.__h.some(Le),n.__h=[],G=0)),Ce=L},A.diffed=function(e){rt&&rt(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(et.push(n)!==1&&Ze===A.requestAnimationFrame||((Ze=A.requestAnimationFrame)||cn)(an)),n.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Ce=L=null},A.__c=function(e,n){n.some(function(r){try{r.__h.some(de),r.__h=r.__h.filter(function(s){return!s.__||Le(s)})}catch(s){n.some(function(l){l.__h&&(l.__h=[])}),n=[],A.__e(s,r.__v)}}),st&&st(e,n)},A.unmount=function(e){lt&&lt(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(s){try{de(s)}catch(l){n=l}}),r.__H=void 0,n&&A.__e(n,r.__v))};var ot=typeof requestAnimationFrame=="function";function cn(e){var n,r=function(){clearTimeout(s),ot&&cancelAnimationFrame(n),setTimeout(e)},s=setTimeout(r,35);ot&&(n=requestAnimationFrame(r))}function de(e){var n=L,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),L=n}function Le(e){var n=L;e.__c=e.__(),L=n}function at(e,n){return!e||e.length!==n.length||n.some(function(r,s){return r!==e[s]})}function ct(e,n){return typeof n=="function"?n(e):n}function dn(e,n){for(var r in n)e[r]=n[r];return e}function dt(e,n){for(var r in e)if(r!=="__source"&&!(r in n))return!0;for(var s in n)if(s!=="__source"&&e[s]!==n[s])return!0;return!1}function ut(e,n){this.props=e,this.context=n}(ut.prototype=new H).isPureReactComponent=!0,ut.prototype.shouldComponentUpdate=function(e,n){return dt(this.props,e)||dt(this.state,n)};var ht=x.__b;x.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ht&&ht(e)};var un=x.__e;x.__e=function(e,n,r,s){if(e.then){for(var l,i=n;i=i.__;)if((l=i.__c)&&l.__c)return n.__e==null&&(n.__e=r.__e,n.__k=r.__k),l.__c(e,n)}un(e,n,r,s)};var ft=x.unmount;function pt(e,n,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(s){typeof s.__c=="function"&&s.__c()}),e.__c.__H=null),(e=dn({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=n),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(s){return pt(s,n,r)})),e}function _t(e,n,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(s){return _t(s,n,r)}),e.__c&&e.__c.__P===n&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function X(){this.__u=0,this.o=null,this.__b=null}function mt(e){if(!e.__)return null;var n=e.__.__c;return n&&n.__a&&n.__a(e)}function D(e){var n,r,s,l=null;function i(c){if(n||(n=e()).then(function(d){d&&(l=d.default||d),s=!0},function(d){r=d,s=!0}),r)throw r;if(!s)throw n;return l?le(l,c):null}return i.displayName="Lazy",i.__f=!0,i}function ue(){this.i=null,this.l=null}x.unmount=function(e){var n=e.__c;n&&(n.__z=!0),n&&n.__R&&n.__R(),n&&32&e.__u&&(e.type=null),ft&&ft(e)},(X.prototype=new H).__c=function(e,n){var r=n.__c,s=this;s.o==null&&(s.o=[]),s.o.push(r);var l=mt(s.__v),i=!1,c=function(){i||s.__z||(i=!0,r.__R=null,l?l(a):a())};r.__R=c;var d=r.__P;r.__P=null;var a=function(){if(!--s.__u){if(s.state.__a){var o=s.state.__a;s.__v.__k[0]=_t(o,o.__c.__P,o.__c.__O)}var h;for(s.setState({__a:s.__b=null});h=s.o.pop();)h.__P=d,h.forceUpdate()}};s.__u++||32&n.__u||s.setState({__a:s.__b=s.__v.__k[0]}),e.then(c,c)},X.prototype.componentWillUnmount=function(){this.o=[]},X.prototype.render=function(e,n){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),s=this.__v.__k[0].__c;this.__v.__k[0]=pt(this.__b,r,s.__O=s.__P)}this.__b=null}var l=n.__a&&le(M,null,e.fallback);return l&&(l.__u&=-33),[le(M,null,n.__a?null:e.children),l]};var gt=function(e,n,r){if(++r[1]===r[0]&&e.l.delete(n),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(ue.prototype=new H).__a=function(e){var n=this,r=mt(n.__v),s=n.l.get(e);return s[0]++,function(l){var i=function(){n.props.revealOrder?(s.push(l),gt(n,e,s)):l()};r?r(i):i()}},ue.prototype.render=function(e){this.i=null,this.l=new Map;var n=ae(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&n.reverse();for(var r=n.length;r--;)this.l.set(n[r],this.i=[1,0,this.i]);return e.children},ue.prototype.componentDidUpdate=ue.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(n,r){gt(e,r,n)})};var hn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,fn=/^(?: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]/,pn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,_n=/[A-Z0-9]/g,mn=typeof document<"u",gn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};H.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(H.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})});var bt=x.event;function bn(){}function vn(){return this.cancelBubble}function yn(){return this.defaultPrevented}x.event=function(e){return bt&&(e=bt(e)),e.persist=bn,e.isPropagationStopped=vn,e.isDefaultPrevented=yn,e.nativeEvent=e};var wn={enumerable:!1,configurable:!0,get:function(){return this.class}},vt=x.vnode;x.vnode=function(e){typeof e.type=="string"&&(function(n){var r=n.props,s=n.type,l={},i=s.indexOf("-")===-1;for(var c in r){var d=r[c];if(!(c==="value"&&"defaultValue"in r&&d==null||mn&&c==="children"&&s==="noscript"||c==="class"||c==="className")){var a=c.toLowerCase();c==="defaultValue"&&"value"in r&&r.value==null?c="value":c==="download"&&d===!0?d="":a==="translate"&&d==="no"?d=!1:a[0]==="o"&&a[1]==="n"?a==="ondoubleclick"?c="ondblclick":a!=="onchange"||s!=="input"&&s!=="textarea"||gn(r.type)?a==="onfocus"?c="onfocusin":a==="onblur"?c="onfocusout":pn.test(c)&&(c=a):a=c="oninput":i&&fn.test(c)?c=c.replace(_n,"-$&").toLowerCase():d===null&&(d=void 0),a==="oninput"&&l[c=a]&&(c="oninputCapture"),l[c]=d}}s=="select"&&l.multiple&&Array.isArray(l.value)&&(l.value=ae(r.children).forEach(function(o){o.props.selected=l.value.indexOf(o.props.value)!=-1})),s=="select"&&l.defaultValue!=null&&(l.value=ae(r.children).forEach(function(o){o.props.selected=l.multiple?l.defaultValue.indexOf(o.props.value)!=-1:l.defaultValue==o.props.value})),r.class&&!r.className?(l.class=r.class,Object.defineProperty(l,"className",wn)):r.className&&(l.class=l.className=r.className),n.props=l})(e),e.$$typeof=hn,vt&&vt(e)};var yt=x.__r;x.__r=function(e){yt&&yt(e),e.__c};var wt=x.diffed;x.diffed=function(e){wt&&wt(e);var n=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in n&&n.value!==r.value&&(r.value=n.value==null?"":n.value)};var Nn={Fragment:M};const E={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"/>']}};class he extends Error{status;constructor(n=403){super(`Unauthorized (HTTP ${n})`),this.name="UnauthorizedError",this.status=n}}class xn extends Error{status;body;constructor(n,r){super(`API error (HTTP ${n})`),this.name="ApiError",this.status=n,this.body=r}}class Ee{baseUrl;authToken;constructor(n){this.baseUrl=n.baseUrl.replace(/\/+$/,""),this.authToken=n.authToken}async fetch(n,r){const l={...{Accept:"application/json",...this.authToken?{Authorization:`Bearer ${this.authToken}`}:{}},...r?.headers},i=await globalThis.fetch(`${this.baseUrl}${n}`,{...r,headers:l,credentials:this.authToken?"omit":"include"});if(r?.signal?.aborted)throw new DOMException("The operation was aborted.","AbortError");if(i.status===401||i.status===403)throw new he(i.status);if(!i.ok){const c=await i.text().catch(()=>"");throw new xn(i.status,c)}return i.json()}async get(n,r){const s=r?`${n}?${r}`:n;return this.fetch(s)}async post(n,r){const s={method:"POST",...r!==void 0?{body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}:{}};return this.fetch(n,s)}async delete(n){return this.fetch(n,{method:"DELETE"})}}const $n=["tracing","process","system","http","db","redis","queues","cache","app","log","emails","dashboard"],Nt="/admin/api/debug",xt={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 Sn(e){const n={customPanes:e.customPanes??[]},r=e.features;for(const s of $n)n[s]=r?.[s]??!1;return n}async function kn(e,n=Nt){const r=`${n.replace(/\/+$/,"")}/config`;return e.fetch(r)}async function Cn(e){const{baseUrl:n="",debugEndpoint:r=Nt,authToken:s}=e,l=new Ee({baseUrl:n,authToken:s});try{const i=await kn(l,r);return Sn(i)}catch{return xt}}function Tn(e={}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e,[l,i]=w(xt),[c,d]=w(!0),[a,o]=w(null),h=j(!1);return I(()=>{if(h.current)return;h.current=!0;let u=!1;return(async()=>{try{const _=await Cn({baseUrl:n,debugEndpoint:r,authToken:s});u||(i(_),d(!1))}catch(_){u||(o(_ instanceof Error?_:new Error(String(_))),d(!1))}})(),()=>{u=!0}},[n,r,s]),{features:l,isLoading:c,error:a}}const fe="ss-dash-theme",Pe="ss-theme-change";function Ae(){if(typeof window>"u")return"light";const e=localStorage.getItem(fe);return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ln(e){typeof window>"u"||(localStorage.setItem(fe,e),window.dispatchEvent(new CustomEvent(Pe,{detail:e})))}function En(){const n=Ae()==="dark"?"light":"dark";return Ln(n),n}function Pn(e){if(typeof window>"u")return()=>{};const n=i=>{const c=i.detail;(c==="dark"||c==="light")&&e(c)},r=i=>{if(i.key===fe){const c=i.newValue;e(c==="dark"||c==="light"?c:Ae())}},s=window.matchMedia("(prefers-color-scheme: dark)"),l=i=>{localStorage.getItem(fe)||e(i.matches?"dark":"light")};return window.addEventListener(Pe,n),window.addEventListener("storage",r),s.addEventListener("change",l),()=>{window.removeEventListener(Pe,n),window.removeEventListener("storage",r),s.removeEventListener("change",l)}}function An(){const[e,n]=w(()=>Ae());I(()=>Pn(l=>{n(l)}),[]);const r=k(()=>{const s=En();return n(s),s},[]);return{theme:e,toggleTheme:r}}function Mn({theme:e,onToggle:n,className:r="",classPrefix:s="ss-dash"}){const l=e==="dark";return t("button",{type:"button",className:`${s==="ss-dbg"?"ss-dbg-theme-toggle":"ss-dash-theme-btn"} ${r}`,onClick:n,title:l?"Switch to light theme":"Switch to dark theme","aria-label":l?"Switch to light theme":"Switch to dark theme",children:l?t("svg",{width:"16",height:"16",viewBox:E.sun.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.sun.elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:E.moon.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.moon.elements.join("")}})})}const On=D(()=>Promise.resolve().then(()=>ur)),jn=D(()=>Promise.resolve().then(()=>fr)),Dn=D(()=>Promise.resolve().then(()=>_r)),Bn=D(()=>Promise.resolve().then(()=>mr)),In=D(()=>Promise.resolve().then(()=>$r)),Rn=D(()=>Promise.resolve().then(()=>Lr)),Fn=D(()=>Promise.resolve().then(()=>Pr)),Un=D(()=>Promise.resolve().then(()=>Br)),Hn=D(()=>Promise.resolve().then(()=>qr)),zn=D(()=>Promise.resolve().then(()=>ls)),Vn=D(()=>Promise.resolve().then(()=>is));function qn(e){const{defaultOpen:n=!1,dashboardPath:r,isOpen:s,onOpenChange:l,isLive:i=!1,...c}=e,[d,a]=w(n),o=s!==void 0?s:d,h=g=>{l?l(g):a(g)},[u,f]=w("queries"),{features:_}=Tn(c),{theme:p,toggleTheme:v}=An(),y=_.customPanes||[];I(()=>{const g=S=>{S.key==="Escape"&&o&&h(!1)};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[o]);const b=C(()=>[{id:"queries",label:"Queries",visible:!0},{id:"events",label:"Events",visible:!0},{id:"emails",label:"Emails",visible:!0},{id:"routes",label:"Routes",visible:!0},{id:"logs",label:"Logs",visible:!0},{id:"timeline",label:"Requests",visible:_.tracing},{id:"cache",label:"Cache",visible:_.cache},{id:"jobs",label:"Jobs",visible:_.queues},{id:"config",label:"Config",visible:!0},{id:"internals",label:"Internals",visible:!0}],[_]),m=C(()=>b.filter(g=>g.visible),[b]);I(()=>{const g=[...m.map(S=>S.id),...y.map(S=>S.id)];!g.includes(u)&&g.length>0&&f(g[0])},[m,y,u]);const N=k(()=>{h(!o)},[o]),$=k(()=>{const g={options:c},S=y.find(W=>W.id===u);if(S)return t(X,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:t(Vn,{pane:S,options:c})});const P={queries:t(On,{...g}),events:t(jn,{...g}),emails:t(Dn,{...g}),routes:t(Bn,{...g,currentPath:typeof window<"u"?window.location.pathname:""}),logs:t(In,{...g}),timeline:t(Rn,{...g}),cache:t(Fn,{...g,dashboardPath:r}),jobs:t(Un,{...g,dashboardPath:r}),config:t(Hn,{...g,dashboardPath:r}),internals:t(zn,{...g})};return t(X,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:P[u]||t("div",{className:"ss-dbg-empty",children:"Unknown tab"})})},[u,c,y]);return t(M,{children:[s===void 0&&t("button",{type:"button",className:`ss-dbg-btn ${o?"ss-dbg-active":""}`,onClick:N,title:"Toggle debug panel",id:"ss-dbg-wrench",children:t("svg",{width:"14",height:"14",viewBox:E.wrench.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.wrench.elements.join("")}})}),t("div",{className:`ss-dbg-panel ${o?"ss-dbg-open":""}`,"data-ss-theme":p,id:"ss-dbg-panel",children:[t("div",{className:"ss-dbg-tabs",children:[t("div",{className:"ss-dbg-tabs-scroll",children:[m.map(g=>t("button",{type:"button",className:`ss-dbg-tab ${u===g.id?"ss-dbg-active":""}`,onClick:()=>f(g.id),children:[E[g.id]?t("svg",{className:"ss-dbg-tab-icon",viewBox:E[g.id].viewBox,dangerouslySetInnerHTML:{__html:E[g.id].elements.join("")}}):null,g.label]},g.id)),y.map(g=>t("button",{type:"button",className:`ss-dbg-tab ${u===g.id?"ss-dbg-active":""}`,onClick:()=>f(g.id),children:g.label},g.id))]}),t("div",{className:"ss-dbg-tabs-right",children:[t("span",{className:`ss-dbg-conn-mode ${i?"ss-dbg-conn-live":"ss-dbg-conn-polling"}`,title:i?"Connected via Transmit (SSE) — real-time updates":"Polling every 3s",children:i?"live":"polling"}),t(Mn,{theme:p,onToggle:v,classPrefix:"ss-dbg"}),r&&t("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"ss-dbg-dashboard-link",title:"Open dashboard",children:t("svg",{width:"14",height:"14",viewBox:E["external-link"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E["external-link"].elements.join("")}})}),t("button",{type:"button",className:"ss-dbg-close",onClick:()=>h(!1),title:"Close panel",children:"×"})]})]}),t("div",{className:"ss-dbg-content",children:o&&$()})]})]})}window.__ssDebugPanel={mount(e,n,r){Xe(t(qn,{debugEndpoint:n.debugEndpoint,authToken:n.authToken,dashboardPath:n.dashboardPath||void 0,defaultOpen:!0,isLive:r}),e)},unmount(e){Xe(null,e)}};const Wn=3e3,Jn=100,Kn=500;function Qn(e){return'"'+(e.length>40?e.slice(0,40)+"...":e)+'"'}function Gn(e,n,r){if(e.length===0)return"[]";const s=e.slice(0,3).map(c=>r(c,30)),l=e.length>3?", ..."+e.length+" items":"",i="["+s.join(", ")+l+"]";return i.length>n?"["+e.length+" items]":i}function Yn(e,n,r){const s=Object.keys(e);if(s.length===0)return"{}";const l=[];for(let a=0;a<Math.min(s.length,4);a++)l.push(s[a]+": "+r(e[s[a]],30));const i=s.length>4?", ...+"+(s.length-4):"",c="{ "+l.join(", ")+i+" }";return c.length<=n?c:"{ "+(s.slice(0,6).join(", ")+(s.length>6?", ...":""))+" }"}function Xn(e){if(!e&&e!==0)return"-";const n=Math.floor(e),r=Math.floor(n/86400),s=Math.floor(n%86400/3600),l=Math.floor(n%3600/60);return r>0?`${r}d ${s}h`:s>0?`${s}h ${l}m`:l>0?`${l}m ${n%60}s`:`${n}s`}function R(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:e>=1?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`}function $t(e){return/([+-]\d{2}:?\d{2}|Z)\s*$/.test(e)?e:e+"Z"}function Zn(e){if(!e)return"-";const n=typeof e=="string"?new Date($t(e)):new Date(e);return Number.isNaN(n.getTime())?"-":n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+String(n.getMilliseconds()).padStart(3,"0")}function Me(e){if(!e)return"-";const n=typeof e=="string"?new Date($t(e)).getTime():e,r=Math.floor((Date.now()-n)/1e3);return r<0?"just now":r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function er(e){return e>Kn?"very-slow":e>Jn?"slow":"normal"}function Oe(e,n="ss-dash"){const r=er(e);return r==="very-slow"?`${n}-very-slow`:r==="slow"?`${n}-slow`:""}function pe(e,n=100){return e===null?"null":e===void 0?"-":typeof e=="string"?Qn(e):typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?Gn(e,n,pe):typeof e=="object"?Yn(e,n,pe):String(e)}function tr(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 nr(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function V({ts:e,className:n,style:r}){return e?t("span",{className:n,style:r,title:Zn(e),children:Me(e)}):t("span",{className:n,style:r,children:"-"})}function rr(e,n){if(!n)return e;const r=n.toLowerCase();return e.filter(s=>s.sql.toLowerCase().includes(r)||s.model&&s.model.toLowerCase().includes(r)||s.method.toLowerCase().includes(r))}function sr(e){const n={};for(const r of e)n[r.sql]=(n[r.sql]||0)+1;return n}function lr(e,n){const r=e.filter(i=>i.duration>100).length,s=Object.values(n).filter(i=>i>1).length,l=e.length>0?e.reduce((i,c)=>i+c.duration,0)/e.length:0;return{slowCount:r,dupCount:s,avgDuration:l,totalCount:e.length}}const ir={queries:"/queries",events:"/events",emails:"/emails",routes:"/routes",logs:"/logs",timeline:"/traces",cache:"/cache",jobs:"/jobs",config:"/config",internals:"/diagnostics"};function or(e){return ir[e]||`/${e}`}class ar{client;endpoint;refreshInterval;callbacks;timer=null;currentTab=null;fetchOnceCache={};abortController=null;constructor(n){this.client=new Ee({baseUrl:n.baseUrl,authToken:n.authToken}),this.endpoint=n.endpoint??"/admin/api/debug",this.refreshInterval=n.refreshInterval??Wn,this.callbacks={onData:n.onData,onLoading:n.onLoading,onError:n.onError,onUnauthorized:n.onUnauthorized}}start(n){this.stop(),this.currentTab=n,this.callbacks.onLoading(!0),this.callbacks.onError(null),this.fetchData(),this.timer=setInterval(()=>this.fetchData(),this.refreshInterval)}stop(){this.timer&&(clearInterval(this.timer),this.timer=null),this.abortController?.abort(),this.abortController=null}switchTab(n){this.start(n)}refresh(){this.currentTab&&this.fetchData()}async fetchCustomPane(n,r=!1){if(r&&this.fetchOnceCache[n]!==void 0){this.callbacks.onData(this.fetchOnceCache[n]),this.callbacks.onLoading(!1);return}this.callbacks.onLoading(!0);try{const s=await this.client.fetch(n);this.callbacks.onData(s),this.callbacks.onError(null),r&&(this.fetchOnceCache[n]=s)}catch(s){if(s instanceof he){this.callbacks.onUnauthorized(s);return}this.callbacks.onError(s instanceof Error?s:new Error(String(s)))}finally{this.callbacks.onLoading(!1)}}cacheForTab(n,r){this.fetchOnceCache[n]=r}clearCache(){this.fetchOnceCache={}}async fetchData(){const n=this.currentTab;if(!n||this.serveFromCache(n))return;this.abortController?.abort();const r=new AbortController;this.abortController=r;try{const s=`${this.endpoint}${or(n)}`,l=await this.client.fetch(s,{signal:r.signal});if(r.signal.aborted)return;this.callbacks.onData(l),this.callbacks.onError(null),this.callbacks.onLoading(!1)}catch(s){this.handleFetchError(s,r)}}serveFromCache(n){return this.fetchOnceCache[n]===void 0?!1:(this.callbacks.onData(this.fetchOnceCache[n]),this.callbacks.onLoading(!1),!0)}handleFetchError(n,r){if(!(n instanceof DOMException&&n.name==="AbortError")&&!r.signal.aborted){if(n instanceof he){this.callbacks.onError(n),this.callbacks.onLoading(!1),this.stop(),this.callbacks.onUnauthorized(n);return}this.callbacks.onError(n instanceof Error?n:new Error(String(n))),this.callbacks.onLoading(!1)}}}function F(e,n={}){const{baseUrl:r="",debugEndpoint:s="/admin/api/debug",authToken:l}=n,[i,c]=w(null),[d,a]=w(!0),[o,h]=w(null),u=j(null);u.current||(u.current=new ar({baseUrl:r,endpoint:s,authToken:l,onData:v=>c(v),onLoading:v=>a(v),onError:v=>h(v),onUnauthorized:v=>h(v)})),I(()=>{const v=u.current;return v.start(e),()=>v.stop()},[e]);const f=k(()=>{u.current?.refresh()},[]),_=k(()=>{c(null)},[]),p=k((v,y)=>{u.current?.cacheForTab(v,y)},[]);return{data:i,isLoading:d,error:o,refresh:f,clearData:_,cacheForTab:p}}const cr="ss-col-resize",St="ss-resizing";function kt(e){const n=Array.from(e.querySelectorAll("thead th"));if(n.length===0)return()=>{};const r=[];let s=!1;function l(){if(!s){s=!0;for(const i of n)i.style.width=i.offsetWidth+"px";e.style.tableLayout="fixed"}}for(const i of n){let c=function(a){a.preventDefault(),a.stopPropagation(),l();const o=a.clientX,h=i.offsetWidth;d.classList.add(St),d.setPointerCapture(a.pointerId);function u(_){const p=_.clientX-o,v=Math.max(30,h+p);i.style.width=v+"px"}function f(){d.classList.remove(St),d.removeEventListener("pointermove",u),d.removeEventListener("pointerup",f)}d.addEventListener("pointermove",u),d.addEventListener("pointerup",f)};if(!i.textContent?.trim())continue;const d=document.createElement("div");d.className=cr,i.appendChild(d),d.addEventListener("pointerdown",c),r.push(()=>{d.removeEventListener("pointerdown",c),d.remove()})}return()=>{for(const i of r)i()}}function q(e=[]){const n=j(null),r=j(null);return I(()=>(n.current&&(r.current?.(),r.current=kt(n.current)),()=>{r.current?.(),r.current=null}),e),k(l=>{r.current?.(),r.current=null,n.current=l,l&&(r.current=kt(l))},[])}function dr({color:e="muted",children:n,className:r="",classPrefix:s="ss-dash"}){return t("span",{className:`${s}-badge ${s}-badge-${e} ${r}`,children:n})}function Z({method:e,className:n="",classPrefix:r="ss-dash"}){return t("span",{className:`${r}-method ${r}-method-${e.toLowerCase()} ${n}`,children:e})}function Ct({code:e,className:n="",classPrefix:r="ss-dash"}){let s=`${r}-status-2xx`;return e>=500?s=`${r}-status-5xx`:e>=400?s=`${r}-status-4xx`:e>=300&&(s=`${r}-status-3xx`),t("span",{className:`${r}-status ${s} ${n}`,children:e})}function z({search:e,onSearchChange:n,placeholder:r="Search...",summary:s,children:l,className:i=""}){const c=k(()=>{n("")},[n]);return t("div",{className:`ss-dbg-filter-bar ${i}`,children:[s!=null&&t("span",{className:"ss-dbg-summary",children:s}),t("div",{className:"ss-dbg-search-wrapper",children:[t("svg",{className:"ss-dbg-search-icon",width:"14",height:"14",viewBox:E.search.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.search.elements.join("")}}),t("input",{type:"text",className:"ss-dbg-search",placeholder:r,value:e,onChange:d=>n(d.target.value)}),e&&t("button",{type:"button",className:"ss-dbg-search-clear",onClick:c,children:"×"})]}),l&&t("div",{className:"ss-dbg-filter-controls",children:l})]})}function Tt({options:e}){const{data:n,isLoading:r,error:s}=F("queries",e),[l,i]=w(""),[c,d]=w(null),a=C(()=>n?.queries||[],[n]),o=C(()=>rr(a,l),[a,l]),h=C(()=>sr(a),[a]),u=C(()=>lr(a,h),[a,h]),f=k(p=>{d(v=>v===p?null:p)},[]),_=q([o]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading queries..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t(z,{search:l,onSearchChange:i,placeholder:"Filter queries...",summary:t(M,{children:[o.length," queries",u.slowCount>0&&` | ${u.slowCount} slow`,u.dupCount>0&&` | ${u.dupCount} dup`,o.length>0&&` | avg ${R(u.avgDuration)}`]})}),o.length===0?t("div",{className:"ss-dbg-empty",children:"No queries captured"}):t("table",{ref:_,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"70px"}}),t("col",{style:{width:"100px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"SQL"}),t("th",{children:"Duration"}),t("th",{children:"Method"}),t("th",{children:"Model"}),t("th",{children:"Time"})]})}),t("tbody",{children:o.map(p=>t("tr",{children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:p.id}),t("td",{children:[t("span",{className:`ss-dbg-sql ${c===p.id?"ss-dbg-expanded":""}`,onClick:()=>f(p.id),role:"button",tabIndex:0,onKeyDown:v=>v.key==="Enter"&&f(p.id),children:p.sql}),h[p.sql]>1&&t("span",{className:"ss-dbg-dup",children:[" x",h[p.sql]]}),p.inTransaction&&t("span",{className:"ss-dbg-dup",children:" TXN"})]}),t("td",{className:`ss-dbg-duration ${Oe(p.duration,"ss-dbg")}`,children:R(p.duration)}),t("td",{children:t(Z,{method:p.method,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-muted",children:p.model||"-"}),t("td",{children:t(V,{ts:p.timestamp,className:"ss-dbg-event-time"})})]},p.id))})]})]})}const ur=Object.freeze(Object.defineProperty({__proto__:null,QueriesTab:Tt,default:Tt},Symbol.toStringTag,{value:"Module"}));function Lt(e,...n){for(const r of n){const s=e[r];if(s!=null)return s}}function Et(e){return Lt(e,"createdAt","created_at","timestamp")}function hr(e){return Lt(e,"timestamp","createdAt","processedAt","created_at")}function _e({data:e,maxPreviewLength:n=100,className:r="",classPrefix:s="ss-dash",defaultExpanded:l=!1}){const[i,c]=w(l),d=C(()=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},[e]),a=C(()=>typeof d=="object"&&d!==null?pe(d,n):String(d??"-"),[d,n]),o=C(()=>typeof d=="object"&&d!==null?JSON.stringify(d,null,2):String(d),[d]),h=k(()=>{c(f=>!f)},[]),u=k(async()=>{try{await navigator.clipboard.writeText(o)}catch{}},[o]);return!e&&e!==0&&e!==!1?t("span",{className:`ss-dim ${s}-c-dim`,children:"-"}):t("div",{className:`${s}-data-cell ${r}`,children:[!i&&t("span",{className:`${s}-data-preview`,onClick:h,role:"button",tabIndex:0,onKeyDown:f=>f.key==="Enter"&&h(),children:a}),i&&t("div",{className:`${s}-data-full`,onClick:h,children:[t("button",{className:`${s}-copy-btn`,onClick:f=>{f.stopPropagation(),u()},title:"Copy to clipboard",type:"button",children:"Copy"}),t("pre",{children:o})]})]})}function Pt({options:e}){const{data:n,isLoading:r,error:s}=F("events",e),[l,i]=w(""),c=C(()=>{const a=n?.events||[];if(!l)return a;const o=l.toLowerCase();return a.filter(h=>(h.event||"").toLowerCase().includes(o)||(h.data||"").toLowerCase().includes(o))},[n,l]),d=q([c]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading events..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t(z,{search:l,onSearchChange:i,placeholder:"Filter events...",summary:`${c.length} events`}),c.length===0?t("div",{className:"ss-dbg-empty",children:"No events captured"}):t("table",{ref:d,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"20%"}}),t("col",{}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"Event"}),t("th",{children:"Data"}),t("th",{children:"Time"})]})}),t("tbody",{children:c.map(a=>{const o=Et(a);return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:a.id}),t("td",{className:"ss-dbg-event-name",children:a.event}),t("td",{className:"ss-dbg-event-data",children:t(_e,{data:a.data,maxPreviewLength:80,classPrefix:"ss-dbg"})}),t("td",{children:t(V,{ts:o,className:"ss-dbg-event-time"})})]},a.id)})})]})]})}const fr=Object.freeze(Object.defineProperty({__proto__:null,EventsTab:Pt,default:Pt},Symbol.toStringTag,{value:"Module"}));function pr({email:e,previewHtml:n,isLoading:r=!1,onClose:s,className:l}){return t("div",{className:l||"ss-email-preview",children:[t("div",{className:"ss-email-preview-header",children:[t("div",{className:"ss-email-preview-meta",children:e&&t(M,{children:[e.subject!=null&&t("div",{children:[t("strong",{children:"Subject:"})," ",e.subject]}),e.from!=null&&t("div",{children:[t("strong",{children:"From:"})," ",e.from]}),e.to!=null&&t("div",{children:[t("strong",{children:"To:"})," ",e.to]}),e.cc&&t("div",{children:[t("strong",{children:"CC:"})," ",e.cc]}),e.status&&t("div",{children:[t("strong",{children:"Status:"})," ",t("span",{className:`ss-email-status ss-email-status-${e.status}`,children:e.status})]}),e.mailer&&t("div",{children:[t("strong",{children:"Mailer:"})," ",e.mailer]})]})}),t("button",{className:"ss-dbg-btn-clear",onClick:s,type:"button",children:"×"})]}),r?t("div",{className:"ss-empty",children:"Loading preview..."}):n?t("iframe",{className:"ss-email-iframe",srcDoc:n,title:"Email preview",sandbox:""}):t("div",{style:{padding:"12px",whiteSpace:"pre-wrap"},children:e?.text||"No content"})]})}function At({options:e}){const{data:n,isLoading:r,error:s}=F("emails",e),[l,i]=w(""),[c,d]=w(null),[a,o]=w(null),[h,u]=w(!1),f=C(()=>{const m=n?.emails||[];if(!l)return m;const N=l.toLowerCase();return m.filter($=>($.subject||"").toLowerCase().includes(N)||($.to||"").toLowerCase().includes(N)||($.from||"").toLowerCase().includes(N)||($.mailer||"").toLowerCase().includes(N))},[n,l]),_=C(()=>f.find(m=>m.id===c),[f,c]),p=k(async m=>{if(d(m.id),o(m.html||null),!m.html&&m.id){u(!0);try{const N=e?.debugEndpoint||"/admin/api/debug",$={};e?.authToken&&($.Authorization=`Bearer ${e.authToken}`);const g=await fetch(`${N}/emails/${m.id}/preview`,{headers:$,credentials:e?.authToken?"omit":"include"});g.ok&&o(await g.text())}catch{}finally{u(!1)}}},[e]),v=k(()=>{d(null),o(null),u(!1)},[]),y={sent:"ss-dbg-email-status-sent",sending:"ss-dbg-email-status-sending",queueing:"ss-dbg-email-status-queued",queued:"ss-dbg-email-status-queued",failed:"ss-dbg-email-status-failed"},b=q([f]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading emails..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):_?t(pr,{email:_,previewHtml:a,isLoading:h,onClose:v,className:"ss-dbg-email-preview"}):t("div",{children:[t(z,{search:l,onSearchChange:i,placeholder:"Filter emails...",summary:`${f.length} emails`}),f.length===0?t("div",{className:"ss-dbg-empty",children:"No emails captured"}):t("table",{ref:b,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"140px"}}),t("col",{style:{width:"140px"}}),t("col",{}),t("col",{style:{width:"70px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"40px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"From"}),t("th",{children:"To"}),t("th",{children:"Subject"}),t("th",{children:"Status"}),t("th",{children:"Mailer"}),t("th",{title:"Attachments",children:"📎"}),t("th",{children:"Time"})]})}),t("tbody",{children:f.map(m=>t("tr",{className:"ss-dbg-email-row",onClick:()=>p(m),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:m.id}),t("td",{className:"ss-dbg-c-secondary",title:m.from,children:m.from}),t("td",{className:"ss-dbg-c-secondary",title:m.to,children:m.to}),t("td",{className:"ss-dbg-c-sql",children:m.subject}),t("td",{children:t("span",{className:`ss-dbg-email-status ${y[m.status]||""}`,children:m.status})}),t("td",{className:"ss-dbg-c-muted",children:m.mailer}),t("td",{className:"ss-dbg-c-dim",style:{textAlign:"center"},children:m.attachmentCount>0?m.attachmentCount:"-"}),t("td",{children:t(V,{ts:Et(m),className:"ss-dbg-event-time"})})]},m.id))})]})]})}const _r=Object.freeze(Object.defineProperty({__proto__:null,EmailsTab:At,default:At},Symbol.toStringTag,{value:"Module"}));function Mt({options:e,currentPath:n}){const{data:r,isLoading:s,error:l}=F("routes",e),[i,c]=w(""),d=C(()=>{const o=r?.routes||[];if(!i)return o;const h=i.toLowerCase();return o.filter(u=>u.pattern.toLowerCase().includes(h)||u.handler.toLowerCase().includes(h)||u.method.toLowerCase().includes(h)||u.name&&u.name.toLowerCase().includes(h))},[r,i]),a=q([d]);return s&&!r?t("div",{className:"ss-dbg-empty",children:"Loading routes..."}):l?t("div",{className:"ss-dbg-empty",children:["Error: ",l.message]}):t("div",{children:[t(z,{search:i,onSearchChange:c,placeholder:"Filter routes...",summary:`${d.length} routes`}),d.length===0?t("div",{className:"ss-dbg-empty",children:"No routes found"}):t("table",{ref:a,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"70px"}}),t("col",{style:{width:"25%"}}),t("col",{style:{width:"15%"}}),t("col",{}),t("col",{style:{width:"20%"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"Method"}),t("th",{children:"Pattern"}),t("th",{children:"Name"}),t("th",{children:"Handler"}),t("th",{children:"Middleware"})]})}),t("tbody",{children:d.map((o,h)=>{const u=n&&(o.pattern===n||new RegExp("^"+o.pattern.replace(/:[^/]+/g,"[^/]+")+"$").test(n));return t("tr",{className:u?"ss-dbg-current-route":"",children:[t("td",{children:t(Z,{method:o.method,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-text",children:o.pattern}),t("td",{className:"ss-dbg-c-muted",children:o.name||"-"}),t("td",{className:"ss-dbg-c-sql",children:o.handler}),t("td",{className:"ss-dbg-c-dim",style:{fontSize:"10px"},children:o.middleware.length>0?o.middleware.join(", "):"-"})]},`${o.method}-${o.pattern}-${h}`)})})]})]})}const mr=Object.freeze(Object.defineProperty({__proto__:null,RoutesTab:Mt,default:Mt},Symbol.toStringTag,{value:"Module"}));function gr(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 Ot(e){const n={};for(const[r,s]of Object.entries(e))Nr.has(r)||(n[r]=s);return Object.keys(n).length>0?n:null}const br=["all","error","warn","info","debug"];function jt(e){return(e.levelName||e.level_name||(typeof e.level=="string"?e.level:"")||"info").toLowerCase()}function Dt(e){return e.msg||e.message||JSON.stringify(e)}function vr(e){return e.createdAt||e.created_at||e.time||e.timestamp||0}function Bt(e){const n=e.data||{};return e.requestId||e.request_id||e["x-request-id"]||n.requestId||n.request_id||n["x-request-id"]||""}function yr(e,n="ss-dbg-log-level"){switch(e){case"error":case"fatal":return`${n}-error`;case"warn":return`${n}-warn`;case"info":return`${n}-info`;case"debug":return`${n}-debug`;case"trace":return`${n}-trace`;default:return`${n}-info`}}function wr(e,n){return n==="all"?e:e.filter(r=>{const s=jt(r);return n==="error"?s==="error"||s==="fatal":s===n})}const Nr=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 xr(e){if(e.data){const n=gr(e.data);if(n){const r=Ot(n);if(r)return r}}return Ot(e)}function It({log:e,index:n,expanded:r,onToggleExpand:s,onReqIdClick:l}){const i=jt(e),c=Dt(e),d=vr(e),a=Bt(e),o=xr(e);return t(Nn.Fragment,{children:[t("div",{className:`ss-log-entry${o?" ss-log-entry-expandable":""}`,onClick:()=>o&&s(n),children:[t("span",{className:`ss-log-level ${yr(i,"ss-log-level")}`,children:i.toUpperCase()}),t(V,{ts:d,className:"ss-log-time"}),a?t("span",{className:"ss-log-reqid",title:a,onClick:l?h=>{h.stopPropagation(),l(a)}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,onKeyDown:l?h=>{h.key==="Enter"&&(h.stopPropagation(),l(a))}:void 0,children:a.slice(0,8)}):t("span",{className:"ss-log-reqid-empty",children:"--"}),o?t("span",{className:`ss-log-expand-icon${r?" ss-log-expand-icon-open":""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:"ss-log-msg",children:c})]}),r&&o&&t("div",{className:"ss-log-detail",children:t(_e,{data:o,classPrefix:"ss-dbg",defaultExpanded:!0})})]})}function Rt({options:e}){const{data:n,isLoading:r,error:s}=F("logs",e),[l,i]=w("all"),[c,d]=w(""),[a,o]=w(""),[h,u]=w(null),f=C(()=>{let p=Array.isArray(n)?n:n?.logs||n?.entries||[];if(p=wr(p,l),a){const v=a.toLowerCase();p=p.filter(y=>Bt(y).toLowerCase().includes(v))}if(c){const v=c.toLowerCase();p=p.filter(y=>Dt(y).toLowerCase().includes(v))}return p},[n,l,c,a]),_=k(p=>{o(v=>v===p?"":p)},[]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading logs..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t("div",{className:"ss-dbg-log-filters",children:[br.map(p=>t("button",{type:"button",className:`ss-dbg-log-filter ${l===p?"ss-dbg-active":""}`,onClick:()=>i(p),children:p},p)),a&&t("button",{type:"button",className:"ss-dbg-log-filter ss-dbg-active",onClick:()=>o(""),children:["req: ",a.slice(0,8)," x"]}),t("span",{className:"ss-dbg-summary",style:{marginLeft:"auto"},children:[f.length," entries"]})]}),t(z,{search:c,onSearchChange:d,placeholder:"Filter log messages..."}),t("div",{style:{overflow:"auto",flex:1},children:f.length===0?t("div",{className:"ss-dbg-empty",children:"No log entries"}):f.slice(0,200).map((p,v)=>t(It,{log:p,index:v,expanded:h===v,onToggleExpand:y=>u(h===y?null:y),onReqIdClick:_},v))})]})}const $r=Object.freeze(Object.defineProperty({__proto__:null,LogsTab:Rt,default:Rt},Symbol.toStringTag,{value:"Module"}));function Ft(e="",n){const r=j(null);return k(()=>(r.current||(r.current=new Ee({baseUrl:e,authToken:n})),r.current),[e,n])}function Sr({logs:e,onReqIdClick:n}){const[r,s]=w(null);return e.length===0?null:t("div",{children:[t("div",{className:"ss-related-logs-title",children:["Related Logs",t("span",{className:"ss-related-logs-count",children:["(",e.length,")"]})]}),t("div",{style:{overflow:"auto"},children:e.map((l,i)=>t(It,{log:l,index:i,expanded:r===i,onToggleExpand:c=>s(r===c?null:c),onReqIdClick:n},l.id||i))})]})}function kr(e){const{container:n,handle:r,topPane:s,bottomPane:l,storageKey:i,minHeight:c=60}=e;if(i){const a=localStorage.getItem(i);if(a){const o=parseFloat(a);o>0&&o<1&&(s.style.flex=`${o}`,l.style.flex=`${1-o}`)}}function d(a){a.preventDefault(),r.setPointerCapture(a.pointerId);const h=n.getBoundingClientRect().height,u=a.clientY,f=s.getBoundingClientRect().height;function _(v){const y=v.clientY-u;let b=f+y;const m=h-c-r.offsetHeight;b=Math.max(c,Math.min(b,m));const N=b/(h-r.offsetHeight);s.style.flex=`${N}`,l.style.flex=`${1-N}`}function p(){if(r.removeEventListener("pointermove",_),r.removeEventListener("pointerup",p),i){const v=n.getBoundingClientRect().height-r.offsetHeight;if(v>0){const y=s.getBoundingClientRect().height/v;localStorage.setItem(i,String(y))}}}r.addEventListener("pointermove",_),r.addEventListener("pointerup",p)}return r.addEventListener("pointerdown",d),()=>{r.removeEventListener("pointerdown",d)}}function Cr({children:e,storageKey:n}){const r=j(null),s=j(null),l=j(null),i=j(null);return I(()=>{if(r.current&&s.current&&l.current&&i.current)return kr({container:r.current,handle:s.current,topPane:l.current,bottomPane:i.current,storageKey:n})},[n]),t("div",{ref:r,className:"ss-split-container",children:[t("div",{ref:l,className:"ss-split-top",children:e[0]}),t("div",{ref:s,className:"ss-split-handle"}),t("div",{ref:i,className:"ss-split-bottom",children:e[1]})]})}const Ut={request:"#1e3a5f",middleware:"rgba(30, 58, 95, 0.7)",db:"#6d28d9",view:"#0e7490",mail:"#059669",event:"#b45309",custom:"#525252"},Tr=[{label:"Request",color:"#1e3a5f"},{label:"Middleware",color:"rgba(30, 58, 95, 0.7)"},{label:"Database",color:"#6d28d9"},{label:"View",color:"#0e7490"},{label:"Mail",color:"#059669"},{label:"Event",color:"#b45309"}];function Ht({options:e}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e||{},{data:l,isLoading:i,error:c}=F("timeline",e),[d,a]=w(""),[o,h]=w(null),[u,f]=w(null),[_,p]=w(!1),[v,y]=w(null),b=C(()=>{const g=l?.traces||[];if(!d)return g;const S=d.toLowerCase();return g.filter(P=>P.url.toLowerCase().includes(S)||P.method.toLowerCase().includes(S)||String(P.statusCode).includes(S))},[l,d]),m=Ft(n,s);I(()=>{if(o===null){f(null),y(null);return}let g=!1;return p(!0),y(null),m().get(`${r}/traces/${o}`).then(P=>{g||(f(P),p(!1))}).catch(P=>{g||(y(P instanceof Error?P.message:"Failed to load trace"),p(!1))}),()=>{g=!0}},[o,r,m]);const N=k(g=>{h(S=>S===g?null:g)},[]),$=q([b]);if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading traces..."});if(c)return t("div",{className:"ss-dbg-empty",children:["Error: ",c.message]});if(o!==null){if(_)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});if(v)return t("div",{children:[t("div",{className:"ss-dbg-tl-detail-header",children:t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:"← Back"})}),t("div",{className:"ss-dbg-empty",children:["Error: ",v]})]});if(!u)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});const g=u.spans||[],S=u.warnings||[],P=u.logs||[],W=P.length>0,O=t("div",{children:[t("div",{className:"ss-dbg-tl-legend",children:Tr.map(T=>t("div",{className:"ss-dbg-tl-legend-item",children:[t("div",{className:"ss-dbg-tl-legend-dot",style:{background:T.color}}),t("span",{children:T.label})]},T.label))}),t("div",{style:{padding:"8px 12px",overflow:"auto"},children:g.length===0?t("div",{className:"ss-dbg-empty",children:"No spans captured for this request"}):g.map(T=>{const ve=u.totalDuration||1,os=T.startOffset/ve*100,as=Math.max(T.duration/ve*100,.5);return t("div",{className:"ss-dbg-tl-row",children:[t("div",{className:"ss-dbg-tl-label",title:T.label,children:T.label}),t("div",{className:"ss-dbg-tl-track",children:t("div",{className:`ss-dbg-tl-bar ss-dbg-tl-bar-${T.category}`,style:{left:`${os}%`,width:`${as}%`,background:Ut[T.category]||Ut.custom},title:`${T.label}: ${R(T.duration)}`})}),t("span",{className:"ss-dbg-tl-dur",children:R(T.duration)})]},T.id)})}),S.length>0&&t("div",{className:"ss-dbg-tl-warnings",children:[t("div",{className:"ss-dbg-tl-warnings-title",children:"Warnings"}),S.map((T,ve)=>t("div",{className:"ss-dbg-tl-warning",children:T},ve))]})]});return t("div",{className:"ss-dbg-tl-detail-wrapper",children:[t("div",{className:"ss-dbg-tl-detail-header",children:[t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:"← Back"}),t(Z,{method:u.method,classPrefix:"ss-dbg"}),t("span",{className:"ss-dbg-tl-detail-url",children:u.url}),t(Ct,{code:u.statusCode,classPrefix:"ss-dbg"}),t("span",{className:"ss-dbg-tl-meta",children:[R(u.totalDuration)," · ",u.spanCount," spans"]})]}),W?t(Cr,{storageKey:"ss-dbg-timeline-split",children:[O,t(Sr,{logs:P})]}):O]})}return t("div",{children:[t(z,{search:d,onSearchChange:a,placeholder:"Filter traces...",summary:`${b.length} traces`}),b.length===0?t("div",{className:"ss-dbg-empty",children:"No traces captured. Enable tracing in config."}):t("table",{ref:$,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"70px"}}),t("col",{}),t("col",{style:{width:"60px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"50px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"Method"}),t("th",{children:"URL"}),t("th",{children:"Status"}),t("th",{children:"Duration"}),t("th",{children:"Spans"}),t("th",{children:"Time"})]})}),t("tbody",{children:b.map(g=>t("tr",{className:"ss-dbg-email-row",onClick:()=>N(g.id),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:g.id}),t("td",{children:t(Z,{method:g.method,classPrefix:"ss-dbg"})}),t("td",{title:g.url,children:g.url}),t("td",{children:t(Ct,{code:g.statusCode,classPrefix:"ss-dbg"})}),t("td",{className:`ss-dbg-duration ${Oe(g.totalDuration,"ss-dbg")}`,children:R(g.totalDuration)}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:g.spanCount}),t("td",{children:t(V,{ts:g.timestamp,className:"ss-dbg-event-time"})})]},g.id))})]})]})}const Lr=Object.freeze(Object.defineProperty({__proto__:null,TimelineTab:Ht,default:Ht},Symbol.toStringTag,{value:"Module"}));function je(e,n){const r=C(()=>e?e.replace(/\/+$/,"")+"/api":null,[e]),s=C(()=>r?{...n,debugEndpoint:r}:n,[r,n]);return{dashApiBase:r,resolvedOptions:s}}function Er({hitRate:e,hits:n,misses:r,keys:s}){return t("div",{className:"ss-cache-stats",children:[t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hit Rate:"}),t("span",{className:"ss-cache-stat-value",children:[e.toFixed(1),"%"]})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hits:"}),t("span",{className:"ss-cache-stat-value",children:n})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Misses:"}),t("span",{className:"ss-cache-stat-value",children:r})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Keys:"}),t("span",{className:"ss-cache-stat-value",children:s})]})]})}function zt({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=je(n,e),{data:l,isLoading:i,error:c}=F("cache",s),[d,a]=w(""),[o,h]=w(null),[u,f]=w(null),_=C(()=>{const m=l?.keys||[];if(!d)return m;const N=d.toLowerCase();return m.filter($=>$.key.toLowerCase().includes(N))},[l,d]),p=k(async m=>{if(o===m){h(null),f(null);return}h(m);try{const{baseUrl:N="",authToken:$}=e||{},g=r||e?.debugEndpoint||"/admin/api/debug",S=`${N}${g}/cache/${encodeURIComponent(m)}`,P={Accept:"application/json"};$&&(P.Authorization=`Bearer ${$}`);const O=await(await fetch(S,{headers:P,credentials:$?"omit":"same-origin"})).json();f(O)}catch{f({error:"Failed to fetch key value"})}},[o,e,r]),v=q([_]);if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading cache data..."});if(c)return t("div",{className:"ss-dbg-empty",children:["Error: ",c.message]});if(!l)return t("div",{className:"ss-dbg-empty",children:"Cache inspector not available"});const b=l.stats||l;return t("div",{children:[t(Er,{hitRate:b.hitRate??0,hits:b.totalHits??0,misses:b.totalMisses??0,keys:b.keyCount??0}),t(z,{search:d,onSearchChange:a,placeholder:"Filter keys...",summary:`${_.length} keys`}),o&&!!u&&t("div",{className:"ss-dbg-cache-detail",children:[t("strong",{children:o}),t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:["←"," Back"]}),t(_e,{data:u,classPrefix:"ss-dbg"})]}),_.length===0?t("div",{className:"ss-dbg-empty",children:"No cache keys found"}):t("table",{ref:v,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"Key"}),t("th",{children:"Type"}),t("th",{children:"TTL"}),t("th",{children:"Size"})]})}),t("tbody",{children:_.map(m=>t("tr",{className:"ss-dbg-email-row",onClick:()=>p(m.key),children:[t("td",{className:"ss-dbg-c-sql",children:m.key}),t("td",{className:"ss-dbg-c-muted",children:m.type}),t("td",{className:"ss-dbg-c-muted",children:m.ttl>0?tr(m.ttl):"-"}),t("td",{className:"ss-dbg-c-dim",children:m.size>0?nr(m.size):"-"})]},m.key))})]})]})}const Pr=Object.freeze(Object.defineProperty({__proto__:null,CacheTab:zt,default:zt},Symbol.toStringTag,{value:"Module"})),Ar=["all","active","waiting","delayed","completed","failed"];function Mr(e,n="ss-dbg-job-status"){switch(e){case"completed":case"failed":case"active":case"waiting":case"delayed":return`${n}-${e}`;default:return"ss-dbg-badge-muted"}}function Or(e){if(!e)return[];if(Array.isArray(e))return e;const n=e;return n.jobs||n.data||[]}function jr(e){if(!e||Array.isArray(e))return null;const n=e;return n.stats||n.overview||null}function Dr({stats:e,classPrefix:n="ss"}){if(!e)return null;const r=n;return t("div",{className:`${r}-job-stats`,children:[t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Active:"}),t("span",{className:`${r}-job-stat-value`,children:e.active??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Waiting:"}),t("span",{className:`${r}-job-stat-value`,children:e.waiting??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Delayed:"}),t("span",{className:`${r}-job-stat-value`,children:e.delayed??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Completed:"}),t("span",{className:`${r}-job-stat-value`,children:e.completed??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Failed:"}),t("span",{className:`${r}-job-stat-value ${r}-c-red`,children:e.failed??0})]})]})}function Vt({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=je(n,e),{data:l,isLoading:i,error:c}=F("jobs",s),[d,a]=w(""),[o,h]=w("all"),[u,f]=w(null),_=C(()=>{const b=Or(l),m=o==="all"?b:b.filter($=>$.status===o);if(!d)return m;const N=d.toLowerCase();return m.filter($=>$.name?.toLowerCase().includes(N)||$.id?.toString().includes(N))},[l,o,d]),p=k(async b=>{f(b);try{const{baseUrl:m="",authToken:N}=e||{},$=r||e?.debugEndpoint||"/admin/api/debug",g=`${m}${$}/jobs/${b}/retry`,S={Accept:"application/json"};N&&(S.Authorization=`Bearer ${N}`),await fetch(g,{method:"POST",headers:S,credentials:N?"omit":"same-origin"})}catch{}f(null)},[e,r]),v=q([_]);if(!r)return t("div",{className:"ss-dbg-empty",children:"Queue inspector not available (no dashboard configured)"});if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading jobs..."});if(c)return t("div",{className:"ss-dbg-empty",children:["Error: ",c.message]});if(!l)return t("div",{className:"ss-dbg-empty",children:"Queue inspector not available"});const y=jr(l);return t("div",{children:[t(z,{search:d,onSearchChange:a,placeholder:"Filter jobs...",summary:`${_.length} jobs`}),t("div",{className:"ss-dbg-job-stats-area",children:[t(Dr,{stats:y,classPrefix:"ss-dbg"}),t("div",{className:"ss-dbg-log-filters",children:Ar.map(b=>t("button",{type:"button",className:`ss-dbg-job-filter ${o===b?"ss-dbg-active":""}`,onClick:()=>h(b),children:b},b))})]}),_.length===0?t("div",{className:"ss-dbg-empty",children:"No jobs found"}):t("table",{ref:v,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"15%"}}),t("col",{style:{width:"80px"}}),t("col",{}),t("col",{style:{width:"50px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"60px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"ID"}),t("th",{children:"Name"}),t("th",{children:"Status"}),t("th",{children:"Payload"}),t("th",{children:"Tries"}),t("th",{children:"Duration"}),t("th",{children:"Time"}),t("th",{})]})}),t("tbody",{children:_.map(b=>{const m=b;return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",children:b.id}),t("td",{className:"ss-dbg-c-sql",title:b.name,children:b.name}),t("td",{children:t("span",{className:`ss-dbg-badge ${Mr(b.status)}`,children:b.status})}),t("td",{children:t(_e,{data:b.payload||b.data,maxPreviewLength:60,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:b.attempts||m.attemptsMade||0}),t("td",{className:"ss-dbg-duration",children:b.duration!==null?R(b.duration):"-"}),t("td",{children:t(V,{ts:hr(m),className:"ss-dbg-event-time"})}),t("td",{children:b.status==="failed"&&t("button",{type:"button",className:"ss-dbg-retry-btn",onClick:()=>p(b.id),disabled:u===b.id,children:u===b.id?"...":"Retry"})})]},b.id)})})]})]})}const Br=Object.freeze(Object.defineProperty({__proto__:null,JobsTab:Vt,default:Vt},Symbol.toStringTag,{value:"Module"}));function B(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.__redacted===!0}function me(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!B(e)}function De(e,n=""){if(!me(e))return[{path:n,value:e}];const r=[];for(const s of Object.keys(e)){const l=n?`${n}.${s}`:s,i=e[s];me(i)?r.push(...De(i,l)):r.push({path:l,value:i})}return r}function Be(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(r=>r==null?"null":typeof r=="object"?JSON.stringify(r):String(r)).join(", ")}]`,color:"var(--ss-purple-fg)"}:typeof e=="object"?{text:JSON.stringify(e),color:"var(--ss-dim)"}:{text:String(e)}}function qt(e){if(e==null||typeof e!="object"||Array.isArray(e)||B(e))return 1;let n=0;for(const r of Object.keys(e))n+=qt(e[r]);return n}function Ir(e){if(!me(e))return[];const n=[];for(const r of Object.keys(e))me(e[r])&&n.push(r);return n}function ge(e,n,r){n&&navigator.clipboard.writeText(e).then(()=>{const s=n.textContent;n.textContent="✓",n.classList.add(`${r}-copy-row-ok`),setTimeout(()=>{n.textContent=s,n.classList.remove(`${r}-copy-row-ok`)},1200)}).catch(()=>{})}function be({redacted:e,p:n}){const[r,s]=w(!1);return t("span",{className:`${n}-config-redacted`,style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[t("span",{children:r?e.value:e.display}),t("button",{type:"button",className:`${n}-btn`,title:r?"Hide":"Reveal",style:{padding:"0 4px",fontSize:"0.85em",lineHeight:1,minWidth:"auto"},onClick:l=>{l.stopPropagation(),s(i=>!i)},children:r?t("svg",{width:"14",height:"14",viewBox:E["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E["eye-off"].elements.join("")}}):t("svg",{width:"14",height:"14",viewBox:E.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.eye.elements.join("")}})})]})}function Rr({env:e,search:n,p:r}){const s=j(new Map),l=n.toLowerCase(),i=Object.entries(e).filter(([c,d])=>{if(!l)return!0;const a=B(d)?d.display:d==null?"":String(d);return c.toLowerCase().includes(l)||a.toLowerCase().includes(l)});return t("div",{className:`${r}-config-table-wrap`,children:t("table",{className:`${r}-table ${r}-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:[i.map(([c,d])=>{const a=B(d),o=a?d.display:d==null?"null":String(d),h=`${c}=${o}`;return t("tr",{children:[t("td",{className:`${r}-env-key`,children:t("span",{className:`${r}-config-key`,children:c})}),t("td",{className:`${r}-env-val`,children:a?t(be,{redacted:d,p:r}):t("span",{className:`${r}-config-val`,children:o})}),t("td",{children:!a&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:u=>{s.current.set(c,u)},onClick:u=>{u.stopPropagation(),ge(h,s.current.get(c)??null,r)},children:"⎘"})})]},c)}),i.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching variables"})})]})]})})}function Fr({source:e,search:n,p:r}){const s=j(new Map),l=n.toLowerCase(),i=De(e,""),c=i.filter(d=>{const a=B(d.value)?d.value.display:d.value===null||d.value===void 0?"":String(d.value);return d.path.toLowerCase().includes(l)||a.toLowerCase().includes(l)});return t("div",{className:`${r}-config-table-wrap`,children:[t("table",{className:`${r}-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Path"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[c.map(d=>{const a=B(d.value),o=a?null:Be(d.value),h=a?d.value.display:o.text,u=`${d.path}: ${h}`;return t("tr",{children:[t("td",{children:t("span",{className:`${r}-config-key`,style:{whiteSpace:"nowrap"},children:d.path})}),t("td",{children:a?t(be,{redacted:d.value,p:r}):t("span",{className:`${r}-config-val`,style:{wordBreak:"break-all",color:o.color},children:o.text})}),t("td",{children:!a&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:f=>{s.current.set(d.path,f)},onClick:f=>{f.stopPropagation(),ge(u,s.current.get(d.path)??null,r)},children:"⎘"})})]},d.path)}),c.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:[c.length," of ",i.length," entries"]})]})}function Ur({obj:e,prefix:n,p:r}){const s=j(new Map),l=De(e,n);return t("table",{className:`${r}-table ${r}-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:l.map(i=>{const c=i.path.indexOf(n+".")===0?i.path.slice(n.length+1):i.path,d=B(i.value),a=d?null:Be(i.value),o=d?i.value.display:a.text,h=`${i.path}: ${o}`;return t("tr",{children:[t("td",{title:c,children:t("span",{className:`${r}-config-key`,children:c})}),t("td",{title:o,children:d?t(be,{redacted:i.value,p:r}):t("span",{className:`${r}-config-val`,style:{color:a.color},children:a.text})}),t("td",{children:!d&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:u=>{s.current.set(i.path,u)},onClick:u=>{u.stopPropagation(),ge(h,s.current.get(i.path)??null,r)},children:"⎘"})})]},i.path)})})]})}function Hr({value:e,p:n}){if(e==null)return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-dim)"},children:"null"});if(B(e))return t(be,{redacted:e,p:n});if(typeof e=="boolean")return t("span",{className:`${n}-config-val`,style:{color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"},children:String(e)});if(typeof e=="number")return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-amber-fg)"},children:String(e)});if(Array.isArray(e)){const r=e.map(s=>s==null?"null":typeof s=="object"?JSON.stringify(s):String(s));return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-purple-fg)"},children:["[",r.join(", "),"]"]})}return typeof e=="object"?t("span",{className:`${n}-config-val`,style:{color:"var(--ss-dim)"},children:JSON.stringify(e)}):t("span",{className:`${n}-config-val`,children:String(e)})}function zr({obj:e,expandedPaths:n,onToggle:r,p:s}){if(e==null||typeof e!="object"||Array.isArray(e)||B(e))return null;const l=Object.keys(e),i=j(new Map);return t("div",{className:`${s}-config-sections`,children:l.map(c=>{const d=e[c],a=d!==null&&typeof d=="object"&&!Array.isArray(d)&&!B(d),o=n.has(c),h=B(d);return t("div",{className:`${s}-config-section`,children:[t("div",{className:`${s}-config-section-header${a?"":` ${s}-config-leaf`}`,onClick:a?()=>r(c):void 0,style:{cursor:a?"pointer":"default"},children:[a?t("span",{className:`${s}-config-toggle`,children:o?"▼":"▶"}):t("span",{className:`${s}-config-toggle`,style:{visibility:"hidden"},children:"•"}),t("span",{className:`${s}-config-key`,children:c}),a?t("span",{className:`${s}-config-count`,children:[qt(d)," entries"]}):t(M,{children:[t("span",{className:`${s}-config-val`,style:{marginLeft:"8px"},children:t(Hr,{value:d,p:s})}),!h&&t("button",{type:"button",className:`${s}-copy-row-btn`,style:{marginLeft:"4px"},title:"Copy",ref:u=>{i.current.set(c,u)},onClick:u=>{u.stopPropagation();const f=Be(d);ge(`${c}: ${f.text}`,i.current.get(c)??null,s)},children:"⎘"})]})]}),a&&o&&t("div",{className:`${s}-config-section-body`,children:t(Ur,{obj:d,prefix:c,p:s})})]},c)})})}function Vr({data:e,isLoading:n,classPrefix:r}){const s=r,[l,i]=w(""),[c,d]=w(""),[a,o]=w("app"),[h,u]=w(new Set),[f,_]=w("Copy JSON");I(()=>{const N=setTimeout(()=>d(l),200);return()=>clearTimeout(N)},[l]);const p=e,v=k(N=>{u($=>{const g=new Set($);return g.has(N)?g.delete(N):g.add(N),g})},[]),y=k(()=>{if(!p)return;const N=a==="app"?p.app:p.env;if(!N)return;const $=Ir(N);u(new Set($))},[p,a]),b=k(()=>{u(new Set)},[]),m=k(async()=>{if(p)try{const N=a==="app"?p.app:p.env;await navigator.clipboard.writeText(JSON.stringify(N,null,2)),_("Copied!"),setTimeout(()=>_("Copy JSON"),1500)}catch{}},[p,a]);return t("div",{children:[t("div",{className:`${s}-config-toolbar`,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px"},children:[t("button",{type:"button",className:`${s}-config-tab${a==="app"?` ${s}-active`:""}`,onClick:()=>o("app"),children:"App Config"}),t("button",{type:"button",className:`${s}-config-tab${a==="env"?` ${s}-active`:""}`,onClick:()=>o("env"),children:"Env"}),t("div",{style:{position:"relative",flex:1},children:[t("input",{type:"text",className:`${s}-search`,placeholder:"Search keys and values...",value:l,onChange:N=>i(N.target.value),style:{width:"100%"}}),l&&t("button",{type:"button",onClick:()=>i(""),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:"×"})]}),a==="app"&&!c&&t(M,{children:[t("button",{type:"button",className:`${s}-btn`,onClick:y,children:"Expand All"}),t("button",{type:"button",className:`${s}-btn`,onClick:b,children:"Collapse All"})]}),t("button",{type:"button",className:`${s}-btn`,onClick:m,children:f})]}),n&&!e?t("div",{className:`${s}-empty`,children:"Loading config..."}):p?a==="env"?t(Rr,{env:p.env??{},search:c,p:s}):c?t(Fr,{source:p.app??{},search:c,p:s}):t("div",{className:`${s}-config-table-wrap`,children:t(zr,{obj:p.app,expandedPaths:h,onToggle:v,p:s})}):t("div",{className:`${s}-empty`,children:"Config not available"})]})}function Wt({options:e,dashboardPath:n}){const{resolvedOptions:r}=je(n,e),{data:s,isLoading:l,error:i}=F("config",r);return i?t("div",{className:"ss-dbg-empty",children:["Error: ",i.message]}):t(Vr,{data:s,isLoading:l,classPrefix:"ss-dbg"})}const qr=Object.freeze(Object.defineProperty({__proto__:null,ConfigTab:Wt,default:Wt},Symbol.toStringTag,{value:"Module"}));function Wr(e={}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s,refreshInterval:l=3e3}=e,[i,c]=w(null),[d,a]=w(!0),[o,h]=w(null),u=j(null),f=Ft(n,s),_=k(async()=>{try{const v=await f().get(`${r}/diagnostics`);c(v),h(null),a(!1)}catch(p){if(p instanceof he){h(p),a(!1),u.current&&(clearInterval(u.current),u.current=null);return}h(p instanceof Error?p:new Error(String(p))),a(!1)}},[r,f]);return I(()=>(a(!0),h(null),_(),u.current=setInterval(_,l),()=>{u.current&&(clearInterval(u.current),u.current=null)}),[_,l]),{data:i,isLoading:d,error:o}}const Jr=["password","secret","token","key","credential","auth"];function Jt(e){const n=e.toLowerCase();return Jr.some(r=>n.includes(r))}function Kt(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 Kr={collectionInterval:"Stats Collection",dashboardBroadcast:"Dashboard Broadcast",debugBroadcast:"Debug Broadcast",persistFlush:"Persist Flush",retentionCleanup:"Retention Cleanup"};function Qr(e){return Kr[e]||e}const Gr={prometheus:"Prometheus",pinoHook:"Pino Log Hook",edgePlugin:"Edge Plugin",cacheInspector:"Cache Inspector",queueInspector:"Queue Inspector"};function Yr(e){return Gr[e]||e}const Xr=["healthy","active","connected","available","ready"],Zr=["errored","unavailable"];function es(e){return Xr.includes(e)?"ok":Zr.includes(e)?"err":""}function ee({status:e,prefix:n}){const r=es(e);let s=`${n}-dot`;return r==="ok"?s+=` ${n}-dot-ok`:r==="err"&&(s+=` ${n}-dot-err`),t("span",{className:s})}const Qt=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:E.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.eye.elements.join("")}}),Gt=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:E["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E["eye-off"].elements.join("")}});function ts({value:e}){const[n,r]=w(!1);return t("span",{children:[n?e:"••••••••"," ",t("button",{type:"button",onClick:()=>r(s=>!s),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:n?t(Gt,{}):t(Qt,{})})]})}function ns({current:e,max:n,prefix:r}){const s=n>0?Math.min(100,Math.round(e/n*100)):0,l=s>=100;return t("div",{className:`${r}-bar`,children:[t("div",{className:`${r}-bar-track`,children:t("div",{className:`${r}-bar-fill${l?` ${r}-bar-fill-warn`:""}`,style:{width:`${s}%`}})}),t("span",{className:`${r}-bar-pct${l?` ${r}-bar-pct-warn`:""}`,children:[s,"%"]})]})}function rs({config:e,prefix:n}){const r=Object.entries(e);return r.length===0?t("span",{className:`${n}-c-dim`,children:"-"}):t("span",{className:`${n}-c-muted`,children:r.map(([s,l],i)=>t("span",{children:[i>0&&", ",t("span",{className:`${n}-c-dim`,children:s}),"=",Jt(s)&&typeof l=="string"?t(ts,{value:l}):t("span",{children:Kt(l)})]},s))})}function te({label:e,value:n,prefix:r}){return t("div",{className:`${r}-info-card`,children:[t("span",{className:`${r}-info-card-label`,children:e}),t("span",{className:`${r}-info-card-value`,children:n})]})}function ss({data:e,tableClassName:n,classPrefix:r}){const s=r||"ss-dash",[l,i]=w(new Set),c=k(a=>{i(o=>{const h=new Set(o);return h.has(a)?h.delete(a):h.add(a),h})},[]),d=k((a,o)=>{if(o==null)return t("span",{className:`${s}-c-dim`,children:"null"});if(typeof o=="boolean")return t("span",{className:o?`${s}-c-green`:`${s}-c-red`,children:String(o)});if(Array.isArray(o))return t("span",{children:o.join(", ")||"-"});const h=Kt(o);if(Jt(a)){const u=l.has(a);return t("span",{children:[u?h:"••••••••"," ",t("button",{type:"button",onClick:()=>c(a),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:u?t(Gt,{}):t(Qt,{})})]})}return t("span",{children:h})},[l,c,s]);return t("div",{children:[t("h3",{className:`${s}-internals-title`,children:"Package Info"}),t("div",{className:`${s}-info-cards`,children:[t(te,{label:"Version",value:e.package.version||"-",prefix:s}),t(te,{label:"Node.js",value:e.package.nodeVersion||"-",prefix:s}),t(te,{label:"AdonisJS",value:e.package.adonisVersion||"-",prefix:s}),t(te,{label:"Uptime",value:Xn(e.package.uptime),prefix:s}),t(te,{label:"Renderer",value:e.devToolbar?.renderer||"preact",prefix:s})]}),e.collectors.length>0&&t(M,{children:[t("h3",{className:`${s}-internals-title`,children:"Collectors"}),t("table",{className:n,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(a=>t("tr",{children:[t("td",{children:[t("code",{children:a.name}),a.label&&a.label!==a.name&&t("span",{className:`${s}-c-dim`,children:[" ",a.label]})]}),t("td",{children:[t(ee,{status:a.status,prefix:s}),a.status]}),t("td",{className:a.lastError?`${s}-c-red`:`${s}-c-dim`,children:a.lastError?t(M,{children:[a.lastError,a.lastErrorAt&&t("span",{className:`${s}-c-dim`,style:{fontSize:"10px"},children:Me(a.lastErrorAt)})]}):"-"}),t("td",{children:t(rs,{config:a.config,prefix:s})})]},a.name))})]})]}),t("h3",{className:`${s}-internals-title`,children:"Buffers"}),t("table",{className:n,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(([a,o])=>t("tr",{children:[t("td",{style:{textTransform:"capitalize"},children:a}),t("td",{children:[o.current.toLocaleString()," / ",o.max.toLocaleString()]}),t("td",{children:t(ns,{current:o.current,max:o.max,prefix:s})})]},a))})]}),t("h3",{className:`${s}-internals-title`,children:"Timers"}),t("table",{className:n,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(([a,o])=>t("tr",{children:[t("td",{children:Qr(a)}),t("td",{children:[t(ee,{status:o.active?"active":"inactive",prefix:s}),t("span",{className:o.active?`${s}-c-green`:`${s}-c-dim`,children:o.active?"active":"inactive"})]}),t("td",{children:o.active?o.intervalMs?R(o.intervalMs):o.debounceMs?`${R(o.debounceMs)} (debounce)`:"-":t("span",{className:`${s}-c-dim`,children:"—"})})]},a))})]}),t("h3",{className:`${s}-internals-title`,children:"Integrations"}),t("table",{className:n,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(ee,{status:e.transmit.available?"connected":"inactive",prefix:s}),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(([a,o])=>{const h=o.active??o.available??!1,u=o.active?"active":o.available?"available":"unavailable";let f=o.mode?`Mode: ${o.mode}`:"-";return a==="edgePlugin"&&o.active?f="@serverStats() tag registered":a==="cacheInspector"&&o.available?f="Redis dependency detected":a==="queueInspector"&&o.available&&(f="Queue dependency detected"),t("tr",{children:[t("td",{children:Yr(a)}),t("td",{children:[t(ee,{status:h?"active":"inactive",prefix:s}),u]}),t("td",{className:`${s}-c-dim`,style:{fontSize:"11px"},children:f})]},a)})]})]}),e.storage&&t(M,{children:[t("h3",{className:`${s}-internals-title`,children:"Storage (SQLite)"}),t("table",{className:n,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(ee,{status:e.storage.ready?"ready":"inactive",prefix:s}),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?Me(e.storage.lastCleanupAt):"-"})]})]})]}),e.storage.tables.length>0&&t("table",{className:n,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(a=>t("tr",{children:[t("td",{children:t("code",{children:a.name})}),t("td",{children:a.rowCount.toLocaleString()})]},a.name))})]})]}),t("h3",{className:`${s}-internals-title`,children:"Resolved Config"}),t("table",{className:n,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:d("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:`${s}-internals-title`,children:"DevToolbar"}),t("table",{className:n,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(([a,o])=>t("tr",{children:[t("td",{children:a==="customPaneCount"?"customPanes":a}),t("td",{children:a==="customPaneCount"?`${o} registered`:d(a,o)})]},a))})]})]})}function Yt({options:e}){const{data:n,isLoading:r,error:s}=Wr({baseUrl:e?.baseUrl,debugEndpoint:e?.debugEndpoint,authToken:e?.authToken});return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading diagnostics..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):n?t(ss,{data:n,tableClassName:"ss-dbg-table",classPrefix:"ss-dbg"}):t("div",{className:"ss-dbg-empty",children:"Diagnostics not available"})}const ls=Object.freeze(Object.defineProperty({__proto__:null,InternalsTab:Yt,default:Yt},Symbol.toStringTag,{value:"Module"}));function Xt({pane:e,options:n}){({...n});const{data:r,isLoading:s,error:l,clearData:i}=F(e.endpoint.replace(/^\//,""),{...n,debugEndpoint:""}),[c,d]=w(""),a=C(()=>{if(!r)return[];const f=e.dataKey||e.id;let _=r;for(const p of f.split("."))_=_?.[p];return Array.isArray(_)?_:[]},[r,e.dataKey,e.id]),o=C(()=>{if(!c)return a;const f=c.toLowerCase(),_=e.columns.filter(p=>p.searchable).map(p=>p.key);return _.length===0?a:a.filter(p=>_.some(v=>{const y=p[v];return y!==null&&String(y).toLowerCase().includes(f)}))},[a,c,e.columns]),h=(f,_)=>{if(f==null)return t("span",{className:"ss-dbg-c-dim",children:"-"});switch(_.format||"text"){case"time":return typeof f=="number"?t(V,{ts:f,className:"ss-dbg-event-time"}):t("span",{className:"ss-dbg-event-time",children:String(f)});case"timeAgo":return t(V,{ts:f,className:"ss-dbg-event-time"});case"duration":{const v=typeof f=="number"?f:parseFloat(String(f));return isNaN(v)?String(f):t("span",{className:`ss-dbg-duration ${Oe(v,"ss-dbg")}`,children:R(v)})}case"method":return t(Z,{method:String(f),classPrefix:"ss-dbg"});case"json":{let v=f;if(typeof f=="string")try{v=JSON.parse(f)}catch{}return pe(v,80)}case"badge":{const v=String(f).toLowerCase(),b=(_.badgeColorMap||{})[v]||"muted";return t(dr,{color:b,classPrefix:"ss-dbg",children:String(f)})}default:return String(f)}},u=q([o]);return s&&!r?t("div",{className:"ss-dbg-empty",children:["Loading ",e.label,"..."]}):l?t("div",{className:"ss-dbg-empty",children:["Error: ",l.message]}):t("div",{children:[e.search&&t(z,{search:c,onSearchChange:d,placeholder:e.search.placeholder,summary:`${o.length} items`,children:e.clearable&&t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:i,children:"Clear"})}),o.length===0?t("div",{className:"ss-dbg-empty",children:"No data"}):t("table",{ref:u,className:"ss-dbg-table",children:[t("thead",{children:t("tr",{children:e.columns.map(f=>t("th",{children:f.label},f.key))})}),t("tbody",{children:o.map((f,_)=>t("tr",{children:e.columns.map(p=>t("td",{children:h(f[p.key],p)},p.key))},f.id??_))})]})]})}const is=Object.freeze(Object.defineProperty({__proto__:null,CustomPaneTab:Xt,default:Xt},Symbol.toStringTag,{value:"Module"}))})();
1
+ (function(){"use strict";var ne,x,Ie,J,Re,Fe,He,Ue,ye,we,Ne,re={},se=[],Zt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Q=Array.isArray;function H(e,n){for(var r in n)e[r]=n[r];return e}function xe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function le(e,n,r){var s,l,i,a={};for(i in n)i=="key"?s=n[i]:i=="ref"?l=n[i]:a[i]=n[i];if(arguments.length>2&&(a.children=arguments.length>3?ne.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return ie(e,a,s,l,null)}function ie(e,n,r,s,l){var i={type:e,props:n,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++Ie,__i:-1,__u:0};return l==null&&x.vnode!=null&&x.vnode(i),i}function M(e){return e.children}function U(e,n){this.props=e,this.context=n}function K(e,n){if(n==null)return e.__?K(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?K(e):null}function en(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,s=[],l=[],i=H({},n);i.__v=n.__v+1,x.vnode&&x.vnode(i),$e(e.__P,i,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,s,r??K(n),!!(32&n.__u),l),i.__v=n.__v,i.__.__k[i.__i]=i,Qe(s,i,l),n.__e=n.__=null,i.__e!=r&&ze(i)}}function ze(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),ze(e)}function Ve(e){(!e.__d&&(e.__d=!0)&&J.push(e)&&!oe.__r++||Re!=x.debounceRendering)&&((Re=x.debounceRendering)||Fe)(oe)}function oe(){for(var e,n=1;J.length;)J.length>n&&J.sort(He),e=J.shift(),n=J.length,en(e);oe.__r=0}function qe(e,n,r,s,l,i,a,c,u,d,h){var o,f,_,p,v,y,b,m=s&&s.__k||se,N=n.length;for(u=tn(r,n,m,u,N),o=0;o<N;o++)(_=r.__k[o])!=null&&(f=_.__i!=-1&&m[_.__i]||re,_.__i=o,y=$e(e,_,f,l,i,a,c,u,d,h),p=_.__e,_.ref&&f.ref!=_.ref&&(f.ref&&ke(f.ref,null,_),h.push(_.ref,_.__c||p,_)),v==null&&p!=null&&(v=p),(b=!!(4&_.__u))||f.__k===_.__k?u=We(_,u,e,b):typeof _.type=="function"&&y!==void 0?u=y:p&&(u=p.nextSibling),_.__u&=-7);return r.__e=v,u}function tn(e,n,r,s,l){var i,a,c,u,d,h=r.length,o=h,f=0;for(e.__k=new Array(l),i=0;i<l;i++)(a=n[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[i]=ie(null,a,null,null,null):Q(a)?a=e.__k[i]=ie(M,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=ie(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,u=i+f,a.__=e,a.__b=e.__b+1,c=null,(d=a.__i=nn(a,r,u,o))!=-1&&(o--,(c=r[d])&&(c.__u|=2)),c==null||c.__v==null?(d==-1&&(l>h?f--:l<h&&f++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?f--:d==u+1?f++:(d>u?f--:f++,a.__u|=4))):e.__k[i]=null;if(o)for(i=0;i<h;i++)(c=r[i])!=null&&(2&c.__u)==0&&(c.__e==s&&(s=K(c)),Ye(c,c));return s}function We(e,n,r,s){var l,i;if(typeof e.type=="function"){for(l=e.__k,i=0;l&&i<l.length;i++)l[i]&&(l[i].__=e,n=We(l[i],n,r,s));return n}e.__e!=n&&(s&&(n&&e.type&&!n.parentNode&&(n=K(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function ae(e,n){return n=n||[],e==null||typeof e=="boolean"||(Q(e)?e.some(function(r){ae(r,n)}):n.push(e)),n}function nn(e,n,r,s){var l,i,a,c=e.key,u=e.type,d=n[r],h=d!=null&&(2&d.__u)==0;if(d===null&&c==null||h&&c==d.key&&u==d.type)return r;if(s>(h?1:0)){for(l=r-1,i=r+1;l>=0||i<n.length;)if((d=n[a=l>=0?l--:i++])!=null&&(2&d.__u)==0&&c==d.key&&u==d.type)return a}return-1}function Je(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||Zt.test(n)?r:r+"px"}function ce(e,n,r,s,l){var i,a;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof s=="string"&&(e.style.cssText=s=""),s)for(n in s)r&&n in r||Je(e.style,n,"");if(r)for(n in r)s&&r[n]==s[n]||Je(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")i=n!=(n=n.replace(Ue,"$1")),a=n.toLowerCase(),n=a in e||n=="onFocusOut"||n=="onFocusIn"?a.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+i]=r,r?s?r.u=s.u:(r.u=ye,e.addEventListener(n,i?Ne:we,i)):e.removeEventListener(n,i?Ne:we,i);else{if(l=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function Ke(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=ye++;else if(n.t<r.u)return;return r(x.event?x.event(n):n)}}}function $e(e,n,r,s,l,i,a,c,u,d){var h,o,f,_,p,v,y,b,m,N,$,g,S,P,W,O=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),i=[c=n.__e=r.__e]),(h=x.__b)&&h(n);e:if(typeof O=="function")try{if(b=n.props,m="prototype"in O&&O.prototype.render,N=(h=O.contextType)&&s[h.__c],$=h?N?N.props.value:h.__:s,r.__c?y=(o=n.__c=r.__c).__=o.__E:(m?n.__c=o=new O(b,$):(n.__c=o=new U(b,$),o.constructor=O,o.render=sn),N&&N.sub(o),o.state||(o.state={}),o.__n=s,f=o.__d=!0,o.__h=[],o._sb=[]),m&&o.__s==null&&(o.__s=o.state),m&&O.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=H({},o.__s)),H(o.__s,O.getDerivedStateFromProps(b,o.__s))),_=o.props,p=o.state,o.__v=n,f)m&&O.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),m&&o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else{if(m&&O.getDerivedStateFromProps==null&&b!==_&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(b,$),n.__v==r.__v||!o.__e&&o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(b,o.__s,$)===!1){n.__v!=r.__v&&(o.props=b,o.state=o.__s,o.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(T){T&&(T.__=n)}),se.push.apply(o.__h,o._sb),o._sb=[],o.__h.length&&a.push(o);break e}o.componentWillUpdate!=null&&o.componentWillUpdate(b,o.__s,$),m&&o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(_,p,v)})}if(o.context=$,o.props=b,o.__P=e,o.__e=!1,g=x.__r,S=0,m)o.state=o.__s,o.__d=!1,g&&g(n),h=o.render(o.props,o.state,o.context),se.push.apply(o.__h,o._sb),o._sb=[];else do o.__d=!1,g&&g(n),h=o.render(o.props,o.state,o.context),o.state=o.__s;while(o.__d&&++S<25);o.state=o.__s,o.getChildContext!=null&&(s=H(H({},s),o.getChildContext())),m&&!f&&o.getSnapshotBeforeUpdate!=null&&(v=o.getSnapshotBeforeUpdate(_,p)),P=h!=null&&h.type===M&&h.key==null?Ge(h.props.children):h,c=qe(e,Q(P)?P:[P],n,r,s,l,i,a,c,u,d),o.base=n.__e,n.__u&=-161,o.__h.length&&a.push(o),y&&(o.__E=o.__=null)}catch(T){if(n.__v=null,u||i!=null)if(T.then){for(n.__u|=u?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;i[i.indexOf(c)]=null,n.__e=c}else{for(W=i.length;W--;)xe(i[W]);Se(n)}else n.__e=r.__e,n.__k=r.__k,T.then||Se(n);x.__e(T,n,r)}else i==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=rn(r.__e,n,r,s,l,i,a,u,d);return(h=x.diffed)&&h(n),128&n.__u?void 0:c}function Se(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Se))}function Qe(e,n,r){for(var s=0;s<r.length;s++)ke(r[s],r[++s],r[++s]);x.__c&&x.__c(n,e),e.some(function(l){try{e=l.__h,l.__h=[],e.some(function(i){i.call(l)})}catch(i){x.__e(i,l.__v)}})}function Ge(e){return typeof e!="object"||e==null||e.__b>0?e:Q(e)?e.map(Ge):H({},e)}function rn(e,n,r,s,l,i,a,c,u){var d,h,o,f,_,p,v,y=r.props||re,b=n.props,m=n.type;if(m=="svg"?l="http://www.w3.org/2000/svg":m=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((_=i[d])&&"setAttribute"in _==!!m&&(m?_.localName==m:_.nodeType==3)){e=_,i[d]=null;break}}if(e==null){if(m==null)return document.createTextNode(b);e=document.createElementNS(l,m,b.is&&b),c&&(x.__m&&x.__m(n,i),c=!1),i=null}if(m==null)y===b||c&&e.data==b||(e.data=b);else{if(i=i&&ne.call(e.childNodes),!c&&i!=null)for(y={},d=0;d<e.attributes.length;d++)y[(_=e.attributes[d]).name]=_.value;for(d in y)_=y[d],d=="dangerouslySetInnerHTML"?o=_:d=="children"||d in b||d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b||ce(e,d,null,_,l);for(d in b)_=b[d],d=="children"?f=_:d=="dangerouslySetInnerHTML"?h=_:d=="value"?p=_:d=="checked"?v=_:c&&typeof _!="function"||y[d]===_||ce(e,d,_,y[d],l);if(h)c||o&&(h.__html==o.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(o&&(e.innerHTML=""),qe(n.type=="template"?e.content:e,Q(f)?f:[f],n,r,s,m=="foreignObject"?"http://www.w3.org/1999/xhtml":l,i,a,i?i[0]:r.__k&&K(r,0),c,u),i!=null)for(d=i.length;d--;)xe(i[d]);c||(d="value",m=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[d]||m=="progress"&&!p||m=="option"&&p!=y[d])&&ce(e,d,p,y[d],l),d="checked",v!=null&&v!=e[d]&&ce(e,d,v,y[d],l))}return e}function ke(e,n,r){try{if(typeof e=="function"){var s=typeof e.__u=="function";s&&e.__u(),s&&n==null||(e.__u=e(n))}else e.current=n}catch(l){x.__e(l,r)}}function Ye(e,n,r){var s,l;if(x.unmount&&x.unmount(e),(s=e.ref)&&(s.current&&s.current!=e.__e||ke(s,null,n)),(s=e.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(i){x.__e(i,n)}s.base=s.__P=null}if(s=e.__k)for(l=0;l<s.length;l++)s[l]&&Ye(s[l],n,r||typeof e.type!="function");r||xe(e.__e),e.__c=e.__=e.__e=void 0}function sn(e,n,r){return this.constructor(e,r)}function Xe(e,n,r){var s,l,i,a;n==document&&(n=document.documentElement),x.__&&x.__(e,n),l=(s=!1)?null:n.__k,i=[],a=[],$e(n,e=n.__k=le(M,null,[e]),l||re,re,n.namespaceURI,l?null:n.firstChild?ne.call(n.childNodes):null,i,l?l.__e:n.firstChild,s,a),Qe(i,e,a)}ne=se.slice,x={__e:function(e,n,r,s){for(var l,i,a;n=n.__;)if((l=n.__c)&&!l.__)try{if((i=l.constructor)&&i.getDerivedStateFromError!=null&&(l.setState(i.getDerivedStateFromError(e)),a=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(e,s||{}),a=l.__d),a)return l.__E=l}catch(c){e=c}throw e}},Ie=0,U.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=H({},this.state),typeof e=="function"&&(e=e(H({},r),this.props)),e&&H(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),Ve(this))},U.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ve(this))},U.prototype.render=M,J=[],Fe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,He=function(e,n){return e.__v.__b-n.__v.__b},oe.__r=0,Ue=/(PointerCapture)$|Capture$/i,ye=0,we=Ke(!1),Ne=Ke(!0);var ln=0;function t(e,n,r,s,l,i){n||(n={});var a,c,u=n;if("ref"in u)for(c in u={},n)c=="ref"?a=n[c]:u[c]=n[c];var d={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ln,__i:-1,__u:0,__source:l,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(c in a)u[c]===void 0&&(u[c]=a[c]);return x.vnode&&x.vnode(d),d}var G,L,Ce,Ze,Y=0,et=[],A=x,tt=A.__b,nt=A.__r,rt=A.diffed,st=A.__c,lt=A.unmount,it=A.__;function Te(e,n){A.__h&&A.__h(L,e,Y||n),Y=0;var r=L.__H||(L.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function w(e){return Y=1,on(ct,e)}function on(e,n,r){var s=Te(G++,2);if(s.t=e,!s.__c&&(s.__=[r?r(n):ct(void 0,n),function(c){var u=s.__N?s.__N[0]:s.__[0],d=s.t(u,c);u!==d&&(s.__N=[d,s.__[1]],s.__c.setState({}))}],s.__c=L,!L.__f)){var l=function(c,u,d){if(!s.__c.__H)return!0;var h=s.__c.__H.__.filter(function(f){return f.__c});if(h.every(function(f){return!f.__N}))return!i||i.call(this,c,u,d);var o=s.__c.props!==c;return h.some(function(f){if(f.__N){var _=f.__[0];f.__=f.__N,f.__N=void 0,_!==f.__[0]&&(o=!0)}}),i&&i.call(this,c,u,d)||o};L.__f=!0;var i=L.shouldComponentUpdate,a=L.componentWillUpdate;L.componentWillUpdate=function(c,u,d){if(this.__e){var h=i;i=void 0,l(c,u,d),i=h}a&&a.call(this,c,u,d)},L.shouldComponentUpdate=l}return s.__N||s.__}function I(e,n){var r=Te(G++,3);!A.__s&&at(r.__H,n)&&(r.__=e,r.u=n,L.__H.__h.push(r))}function j(e){return Y=5,C(function(){return{current:e}},[])}function C(e,n){var r=Te(G++,7);return at(r.__H,n)&&(r.__=e(),r.__H=n,r.__h=e),r.__}function k(e,n){return Y=8,C(function(){return e},n)}function an(){for(var e;e=et.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(de),n.__h.some(Le),n.__h=[]}catch(r){n.__h=[],A.__e(r,e.__v)}}}A.__b=function(e){L=null,tt&&tt(e)},A.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),it&&it(e,n)},A.__r=function(e){nt&&nt(e),G=0;var n=(L=e.__c).__H;n&&(Ce===L?(n.__h=[],L.__h=[],n.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(n.__h.some(de),n.__h.some(Le),n.__h=[],G=0)),Ce=L},A.diffed=function(e){rt&&rt(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(et.push(n)!==1&&Ze===A.requestAnimationFrame||((Ze=A.requestAnimationFrame)||cn)(an)),n.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Ce=L=null},A.__c=function(e,n){n.some(function(r){try{r.__h.some(de),r.__h=r.__h.filter(function(s){return!s.__||Le(s)})}catch(s){n.some(function(l){l.__h&&(l.__h=[])}),n=[],A.__e(s,r.__v)}}),st&&st(e,n)},A.unmount=function(e){lt&&lt(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(s){try{de(s)}catch(l){n=l}}),r.__H=void 0,n&&A.__e(n,r.__v))};var ot=typeof requestAnimationFrame=="function";function cn(e){var n,r=function(){clearTimeout(s),ot&&cancelAnimationFrame(n),setTimeout(e)},s=setTimeout(r,35);ot&&(n=requestAnimationFrame(r))}function de(e){var n=L,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),L=n}function Le(e){var n=L;e.__c=e.__(),L=n}function at(e,n){return!e||e.length!==n.length||n.some(function(r,s){return r!==e[s]})}function ct(e,n){return typeof n=="function"?n(e):n}function dn(e,n){for(var r in n)e[r]=n[r];return e}function dt(e,n){for(var r in e)if(r!=="__source"&&!(r in n))return!0;for(var s in n)if(s!=="__source"&&e[s]!==n[s])return!0;return!1}function ut(e,n){this.props=e,this.context=n}(ut.prototype=new U).isPureReactComponent=!0,ut.prototype.shouldComponentUpdate=function(e,n){return dt(this.props,e)||dt(this.state,n)};var ht=x.__b;x.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ht&&ht(e)};var un=x.__e;x.__e=function(e,n,r,s){if(e.then){for(var l,i=n;i=i.__;)if((l=i.__c)&&l.__c)return n.__e==null&&(n.__e=r.__e,n.__k=r.__k),l.__c(e,n)}un(e,n,r,s)};var ft=x.unmount;function pt(e,n,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(s){typeof s.__c=="function"&&s.__c()}),e.__c.__H=null),(e=dn({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=n),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(s){return pt(s,n,r)})),e}function _t(e,n,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(s){return _t(s,n,r)}),e.__c&&e.__c.__P===n&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function X(){this.__u=0,this.o=null,this.__b=null}function mt(e){if(!e.__)return null;var n=e.__.__c;return n&&n.__a&&n.__a(e)}function D(e){var n,r,s,l=null;function i(a){if(n||(n=e()).then(function(c){c&&(l=c.default||c),s=!0},function(c){r=c,s=!0}),r)throw r;if(!s)throw n;return l?le(l,a):null}return i.displayName="Lazy",i.__f=!0,i}function ue(){this.i=null,this.l=null}x.unmount=function(e){var n=e.__c;n&&(n.__z=!0),n&&n.__R&&n.__R(),n&&32&e.__u&&(e.type=null),ft&&ft(e)},(X.prototype=new U).__c=function(e,n){var r=n.__c,s=this;s.o==null&&(s.o=[]),s.o.push(r);var l=mt(s.__v),i=!1,a=function(){i||s.__z||(i=!0,r.__R=null,l?l(u):u())};r.__R=a;var c=r.__P;r.__P=null;var u=function(){if(!--s.__u){if(s.state.__a){var d=s.state.__a;s.__v.__k[0]=_t(d,d.__c.__P,d.__c.__O)}var h;for(s.setState({__a:s.__b=null});h=s.o.pop();)h.__P=c,h.forceUpdate()}};s.__u++||32&n.__u||s.setState({__a:s.__b=s.__v.__k[0]}),e.then(a,a)},X.prototype.componentWillUnmount=function(){this.o=[]},X.prototype.render=function(e,n){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),s=this.__v.__k[0].__c;this.__v.__k[0]=pt(this.__b,r,s.__O=s.__P)}this.__b=null}var l=n.__a&&le(M,null,e.fallback);return l&&(l.__u&=-33),[le(M,null,n.__a?null:e.children),l]};var gt=function(e,n,r){if(++r[1]===r[0]&&e.l.delete(n),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(ue.prototype=new U).__a=function(e){var n=this,r=mt(n.__v),s=n.l.get(e);return s[0]++,function(l){var i=function(){n.props.revealOrder?(s.push(l),gt(n,e,s)):l()};r?r(i):i()}},ue.prototype.render=function(e){this.i=null,this.l=new Map;var n=ae(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&n.reverse();for(var r=n.length;r--;)this.l.set(n[r],this.i=[1,0,this.i]);return e.children},ue.prototype.componentDidUpdate=ue.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(n,r){gt(e,r,n)})};var hn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,fn=/^(?: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]/,pn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,_n=/[A-Z0-9]/g,mn=typeof document<"u",gn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};U.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(U.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})});var bt=x.event;function bn(){}function vn(){return this.cancelBubble}function yn(){return this.defaultPrevented}x.event=function(e){return bt&&(e=bt(e)),e.persist=bn,e.isPropagationStopped=vn,e.isDefaultPrevented=yn,e.nativeEvent=e};var wn={enumerable:!1,configurable:!0,get:function(){return this.class}},vt=x.vnode;x.vnode=function(e){typeof e.type=="string"&&(function(n){var r=n.props,s=n.type,l={},i=s.indexOf("-")===-1;for(var a in r){var c=r[a];if(!(a==="value"&&"defaultValue"in r&&c==null||mn&&a==="children"&&s==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&c===!0?c="":u==="translate"&&c==="no"?c=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||s!=="input"&&s!=="textarea"||gn(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":pn.test(a)&&(a=u):u=a="oninput":i&&fn.test(a)?a=a.replace(_n,"-$&").toLowerCase():c===null&&(c=void 0),u==="oninput"&&l[a=u]&&(a="oninputCapture"),l[a]=c}}s=="select"&&l.multiple&&Array.isArray(l.value)&&(l.value=ae(r.children).forEach(function(d){d.props.selected=l.value.indexOf(d.props.value)!=-1})),s=="select"&&l.defaultValue!=null&&(l.value=ae(r.children).forEach(function(d){d.props.selected=l.multiple?l.defaultValue.indexOf(d.props.value)!=-1:l.defaultValue==d.props.value})),r.class&&!r.className?(l.class=r.class,Object.defineProperty(l,"className",wn)):r.className&&(l.class=l.className=r.className),n.props=l})(e),e.$$typeof=hn,vt&&vt(e)};var yt=x.__r;x.__r=function(e){yt&&yt(e),e.__c};var wt=x.diffed;x.diffed=function(e){wt&&wt(e);var n=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in n&&n.value!==r.value&&(r.value=n.value==null?"":n.value)};var Nn={Fragment:M};const E={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"/>']}};class he extends Error{status;constructor(n=403){super(`Unauthorized (HTTP ${n})`),this.name="UnauthorizedError",this.status=n}}class xn extends Error{status;body;constructor(n,r){super(`API error (HTTP ${n})`),this.name="ApiError",this.status=n,this.body=r}}class Ee{baseUrl;authToken;constructor(n){this.baseUrl=n.baseUrl.replace(/\/+$/,""),this.authToken=n.authToken}async fetch(n,r){const l={...{Accept:"application/json",...this.authToken?{Authorization:`Bearer ${this.authToken}`}:{}},...r?.headers},i=await globalThis.fetch(`${this.baseUrl}${n}`,{...r,headers:l,credentials:this.authToken?"omit":"include"});if(r?.signal?.aborted)throw new DOMException("The operation was aborted.","AbortError");if(i.status===401||i.status===403)throw new he(i.status);if(!i.ok){const a=await i.text().catch(()=>"");throw new xn(i.status,a)}return i.json()}async get(n,r){const s=r?`${n}?${r}`:n;return this.fetch(s)}async post(n,r){const s={method:"POST",...r!==void 0?{body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}:{}};return this.fetch(n,s)}async delete(n){return this.fetch(n,{method:"DELETE"})}}const $n=["tracing","process","system","http","db","redis","queues","cache","app","log","emails","dashboard"],Nt="/admin/api/debug",xt={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 Sn(e){const n={customPanes:e.customPanes??[]},r=e.features;for(const s of $n)n[s]=r?.[s]??!1;return n}async function kn(e,n=Nt){const r=`${n.replace(/\/+$/,"")}/config`;return e.fetch(r)}async function Cn(e){const{baseUrl:n="",debugEndpoint:r=Nt,authToken:s}=e,l=new Ee({baseUrl:n,authToken:s});try{const i=await kn(l,r);return Sn(i)}catch{return xt}}function Tn(e={}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e,[l,i]=w(xt),[a,c]=w(!0),[u,d]=w(null),h=j(!1);return I(()=>{if(h.current)return;h.current=!0;let o=!1;return(async()=>{try{const _=await Cn({baseUrl:n,debugEndpoint:r,authToken:s});o||(i(_),c(!1))}catch(_){o||(d(_ instanceof Error?_:new Error(String(_))),c(!1))}})(),()=>{o=!0}},[n,r,s]),{features:l,isLoading:a,error:u}}const fe="ss-dash-theme",Pe="ss-theme-change";function Ae(){if(typeof window>"u")return"light";const e=localStorage.getItem(fe);return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ln(e){typeof window>"u"||(localStorage.setItem(fe,e),window.dispatchEvent(new CustomEvent(Pe,{detail:e})))}function En(){const n=Ae()==="dark"?"light":"dark";return Ln(n),n}function Pn(e){if(typeof window>"u")return()=>{};const n=i=>{const a=i.detail;(a==="dark"||a==="light")&&e(a)},r=i=>{if(i.key===fe){const a=i.newValue;e(a==="dark"||a==="light"?a:Ae())}},s=window.matchMedia("(prefers-color-scheme: dark)"),l=i=>{localStorage.getItem(fe)||e(i.matches?"dark":"light")};return window.addEventListener(Pe,n),window.addEventListener("storage",r),s.addEventListener("change",l),()=>{window.removeEventListener(Pe,n),window.removeEventListener("storage",r),s.removeEventListener("change",l)}}function An(){const[e,n]=w(()=>Ae());I(()=>Pn(l=>{n(l)}),[]);const r=k(()=>{const s=En();return n(s),s},[]);return{theme:e,toggleTheme:r}}function Mn({theme:e,onToggle:n,className:r="",classPrefix:s="ss-dash"}){const l=e==="dark";return t("button",{type:"button",className:`${s==="ss-dbg"?"ss-dbg-theme-toggle":"ss-dash-theme-btn"} ${r}`,onClick:n,title:l?"Switch to light theme":"Switch to dark theme","aria-label":l?"Switch to light theme":"Switch to dark theme",children:l?t("svg",{width:"16",height:"16",viewBox:E.sun.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.sun.elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:E.moon.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.moon.elements.join("")}})})}const On=D(()=>Promise.resolve().then(()=>ur)),jn=D(()=>Promise.resolve().then(()=>fr)),Dn=D(()=>Promise.resolve().then(()=>_r)),Bn=D(()=>Promise.resolve().then(()=>mr)),In=D(()=>Promise.resolve().then(()=>$r)),Rn=D(()=>Promise.resolve().then(()=>Lr)),Fn=D(()=>Promise.resolve().then(()=>Pr)),Hn=D(()=>Promise.resolve().then(()=>Br)),Un=D(()=>Promise.resolve().then(()=>qr)),zn=D(()=>Promise.resolve().then(()=>ls)),Vn=D(()=>Promise.resolve().then(()=>is));function qn(e){const{defaultOpen:n=!1,dashboardPath:r,isOpen:s,onOpenChange:l,isLive:i=!1,...a}=e,[c,u]=w(n),d=s!==void 0?s:c,h=g=>{l?l(g):u(g)},[o,f]=w("queries"),{features:_}=Tn(a),{theme:p,toggleTheme:v}=An(),y=_.customPanes||[];I(()=>{const g=S=>{S.key==="Escape"&&d&&h(!1)};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[d]);const b=C(()=>[{id:"queries",label:"Queries",visible:!0},{id:"events",label:"Events",visible:!0},{id:"emails",label:"Emails",visible:!0},{id:"routes",label:"Routes",visible:!0},{id:"logs",label:"Logs",visible:!0},{id:"timeline",label:"Requests",visible:_.tracing},{id:"cache",label:"Cache",visible:_.cache},{id:"jobs",label:"Jobs",visible:_.queues},{id:"config",label:"Config",visible:!0},{id:"internals",label:"Internals",visible:!0}],[_]),m=C(()=>b.filter(g=>g.visible),[b]);I(()=>{const g=[...m.map(S=>S.id),...y.map(S=>S.id)];!g.includes(o)&&g.length>0&&f(g[0])},[m,y,o]);const N=k(()=>{h(!d)},[d]),$=k(()=>{const g={options:a},S=y.find(W=>W.id===o);if(S)return t(X,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:t(Vn,{pane:S,options:a})});const P={queries:t(On,{...g}),events:t(jn,{...g}),emails:t(Dn,{...g}),routes:t(Bn,{...g,currentPath:typeof window<"u"?window.location.pathname:""}),logs:t(In,{...g}),timeline:t(Rn,{...g}),cache:t(Fn,{...g,dashboardPath:r}),jobs:t(Hn,{...g,dashboardPath:r}),config:t(Un,{...g,dashboardPath:r}),internals:t(zn,{...g})};return t(X,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:P[o]||t("div",{className:"ss-dbg-empty",children:"Unknown tab"})})},[o,a,y]);return t(M,{children:[s===void 0&&t("button",{type:"button",className:`ss-dbg-btn ${d?"ss-dbg-active":""}`,onClick:N,title:"Toggle debug panel",id:"ss-dbg-wrench",children:t("svg",{width:"14",height:"14",viewBox:E.wrench.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.wrench.elements.join("")}})}),t("div",{className:`ss-dbg-panel ${d?"ss-dbg-open":""}`,"data-ss-theme":p,id:"ss-dbg-panel",children:[t("div",{className:"ss-dbg-tabs",children:[t("div",{className:"ss-dbg-tabs-scroll",children:[m.map(g=>t("button",{type:"button",className:`ss-dbg-tab ${o===g.id?"ss-dbg-active":""}`,onClick:()=>f(g.id),children:[E[g.id]?t("svg",{className:"ss-dbg-tab-icon",viewBox:E[g.id].viewBox,dangerouslySetInnerHTML:{__html:E[g.id].elements.join("")}}):null,g.label]},g.id)),y.map(g=>t("button",{type:"button",className:`ss-dbg-tab ${o===g.id?"ss-dbg-active":""}`,onClick:()=>f(g.id),children:g.label},g.id))]}),t("div",{className:"ss-dbg-tabs-right",children:[t("span",{className:`ss-dbg-conn-mode ${i?"ss-dbg-conn-live":"ss-dbg-conn-polling"}`,title:i?"Connected via Transmit (SSE) — real-time updates":"Polling every 3s",children:i?"live":"polling"}),t(Mn,{theme:p,onToggle:v,classPrefix:"ss-dbg"}),r&&t("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"ss-dbg-dashboard-link",title:"Open dashboard",children:t("svg",{width:"14",height:"14",viewBox:E["external-link"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E["external-link"].elements.join("")}})}),t("button",{type:"button",className:"ss-dbg-close",onClick:()=>h(!1),title:"Close panel",children:"×"})]})]}),t("div",{className:"ss-dbg-content",children:d&&$()})]})]})}window.__ssDebugPanel={mount(e,n,r){Xe(t(qn,{debugEndpoint:n.debugEndpoint,authToken:n.authToken,dashboardPath:n.dashboardPath||void 0,defaultOpen:!0,isLive:r}),e)},unmount(e){Xe(null,e)}};const Wn=3e3,Jn=100,Kn=500;function Qn(e){return'"'+(e.length>40?e.slice(0,40)+"...":e)+'"'}function Gn(e,n,r){if(e.length===0)return"[]";const s=e.slice(0,3).map(a=>r(a,30)),l=e.length>3?", ..."+e.length+" items":"",i="["+s.join(", ")+l+"]";return i.length>n?"["+e.length+" items]":i}function Yn(e,n,r){const s=Object.keys(e);if(s.length===0)return"{}";const l=[];for(let u=0;u<Math.min(s.length,4);u++)l.push(s[u]+": "+r(e[s[u]],30));const i=s.length>4?", ...+"+(s.length-4):"",a="{ "+l.join(", ")+i+" }";return a.length<=n?a:"{ "+(s.slice(0,6).join(", ")+(s.length>6?", ...":""))+" }"}function Xn(e){if(!e&&e!==0)return"-";const n=Math.floor(e),r=Math.floor(n/86400),s=Math.floor(n%86400/3600),l=Math.floor(n%3600/60);return r>0?`${r}d ${s}h`:s>0?`${s}h ${l}m`:l>0?`${l}m ${n%60}s`:`${n}s`}function R(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:e>=1?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`}function $t(e){return/([+-]\d{2}:?\d{2}|Z)\s*$/.test(e)?e:e+"Z"}function Zn(e){if(!e)return"-";const n=typeof e=="string"?new Date($t(e)):new Date(e);return Number.isNaN(n.getTime())?"-":n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+String(n.getMilliseconds()).padStart(3,"0")}function Me(e){if(!e)return"-";const n=typeof e=="string"?new Date($t(e)).getTime():e,r=Math.floor((Date.now()-n)/1e3);return r<0?"just now":r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function er(e){return e>Kn?"very-slow":e>Jn?"slow":"normal"}function Oe(e,n="ss-dash"){const r=er(e);return r==="very-slow"?`${n}-very-slow`:r==="slow"?`${n}-slow`:""}function pe(e,n=100){return e===null?"null":e===void 0?"-":typeof e=="string"?Qn(e):typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?Gn(e,n,pe):typeof e=="object"?Yn(e,n,pe):String(e)}function tr(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 nr(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function V({ts:e,className:n,style:r}){return e?t("span",{className:n,style:r,title:Zn(e),children:Me(e)}):t("span",{className:n,style:r,children:"-"})}function rr(e,n){if(!n)return e;const r=n.toLowerCase();return e.filter(s=>s.sql.toLowerCase().includes(r)||s.model&&s.model.toLowerCase().includes(r)||s.method.toLowerCase().includes(r))}function sr(e){const n={};for(const r of e)n[r.sql]=(n[r.sql]||0)+1;return n}function lr(e,n){const r=e.filter(i=>i.duration>100).length,s=Object.values(n).filter(i=>i>1).length,l=e.length>0?e.reduce((i,a)=>i+a.duration,0)/e.length:0;return{slowCount:r,dupCount:s,avgDuration:l,totalCount:e.length}}const ir={queries:"/queries",events:"/events",emails:"/emails",routes:"/routes",logs:"/logs",timeline:"/traces",cache:"/cache",jobs:"/jobs",config:"/config",internals:"/diagnostics"};function or(e){return ir[e]||`/${e}`}class ar{client;endpoint;refreshInterval;callbacks;timer=null;currentTab=null;fetchOnceCache={};abortController=null;constructor(n){this.client=new Ee({baseUrl:n.baseUrl,authToken:n.authToken}),this.endpoint=n.endpoint??"/admin/api/debug",this.refreshInterval=n.refreshInterval??Wn,this.callbacks={onData:n.onData,onLoading:n.onLoading,onError:n.onError,onUnauthorized:n.onUnauthorized}}start(n){this.stop(),this.currentTab=n,this.callbacks.onLoading(!0),this.callbacks.onError(null),this.fetchData(),this.timer=setInterval(()=>this.fetchData(),this.refreshInterval)}stop(){this.timer&&(clearInterval(this.timer),this.timer=null),this.abortController?.abort(),this.abortController=null}switchTab(n){this.start(n)}refresh(){this.currentTab&&this.fetchData()}async fetchCustomPane(n,r=!1){if(r&&this.fetchOnceCache[n]!==void 0){this.callbacks.onData(this.fetchOnceCache[n]),this.callbacks.onLoading(!1);return}this.callbacks.onLoading(!0);try{const s=await this.client.fetch(n);this.callbacks.onData(s),this.callbacks.onError(null),r&&(this.fetchOnceCache[n]=s)}catch(s){if(s instanceof he){this.callbacks.onUnauthorized(s);return}this.callbacks.onError(s instanceof Error?s:new Error(String(s)))}finally{this.callbacks.onLoading(!1)}}cacheForTab(n,r){this.fetchOnceCache[n]=r}clearCache(){this.fetchOnceCache={}}async fetchData(){const n=this.currentTab;if(!n||this.serveFromCache(n))return;this.abortController?.abort();const r=new AbortController;this.abortController=r;try{const s=`${this.endpoint}${or(n)}`,l=await this.client.fetch(s,{signal:r.signal});if(r.signal.aborted)return;this.callbacks.onData(l),this.callbacks.onError(null),this.callbacks.onLoading(!1)}catch(s){this.handleFetchError(s,r)}}serveFromCache(n){return this.fetchOnceCache[n]===void 0?!1:(this.callbacks.onData(this.fetchOnceCache[n]),this.callbacks.onLoading(!1),!0)}handleFetchError(n,r){if(!(n instanceof DOMException&&n.name==="AbortError")&&!r.signal.aborted){if(n instanceof he){this.callbacks.onError(n),this.callbacks.onLoading(!1),this.stop(),this.callbacks.onUnauthorized(n);return}this.callbacks.onError(n instanceof Error?n:new Error(String(n))),this.callbacks.onLoading(!1)}}}function F(e,n={}){const{baseUrl:r="",debugEndpoint:s="/admin/api/debug",authToken:l}=n,[i,a]=w(null),[c,u]=w(!0),[d,h]=w(null),o=j(null);o.current||(o.current=new ar({baseUrl:r,endpoint:s,authToken:l,onData:v=>a(v),onLoading:v=>u(v),onError:v=>h(v),onUnauthorized:v=>h(v)})),I(()=>{const v=o.current;return v.start(e),()=>v.stop()},[e]);const f=k(()=>{o.current?.refresh()},[]),_=k(()=>{a(null)},[]),p=k((v,y)=>{o.current?.cacheForTab(v,y)},[]);return{data:i,isLoading:c,error:d,refresh:f,clearData:_,cacheForTab:p}}const cr="ss-col-resize",St="ss-resizing";function kt(e){const n=Array.from(e.querySelectorAll("thead th"));if(n.length===0)return()=>{};const r=[];let s=!1;function l(){if(!s){s=!0;for(const i of n)i.style.width=i.offsetWidth+"px";e.style.tableLayout="fixed"}}for(const i of n){let a=function(u){u.preventDefault(),u.stopPropagation(),l();const d=u.clientX,h=i.offsetWidth;c.classList.add(St),c.setPointerCapture(u.pointerId);function o(_){const p=_.clientX-d,v=Math.max(30,h+p);i.style.width=v+"px"}function f(){c.classList.remove(St),c.removeEventListener("pointermove",o),c.removeEventListener("pointerup",f)}c.addEventListener("pointermove",o),c.addEventListener("pointerup",f)};if(!i.textContent?.trim())continue;const c=document.createElement("div");c.className=cr,i.appendChild(c),c.addEventListener("pointerdown",a),r.push(()=>{c.removeEventListener("pointerdown",a),c.remove()})}return()=>{for(const i of r)i()}}function q(e=[]){const n=j(null),r=j(null);return I(()=>(n.current&&(r.current?.(),r.current=kt(n.current)),()=>{r.current?.(),r.current=null}),e),k(l=>{r.current?.(),r.current=null,n.current=l,l&&(r.current=kt(l))},[])}function dr({color:e="muted",children:n,className:r="",classPrefix:s="ss-dash"}){return t("span",{className:`${s}-badge ${s}-badge-${e} ${r}`,children:n})}function Z({method:e,className:n="",classPrefix:r="ss-dash"}){return t("span",{className:`${r}-method ${r}-method-${e.toLowerCase()} ${n}`,children:e})}function Ct({code:e,className:n="",classPrefix:r="ss-dash"}){let s=`${r}-status-2xx`;return e>=500?s=`${r}-status-5xx`:e>=400?s=`${r}-status-4xx`:e>=300&&(s=`${r}-status-3xx`),t("span",{className:`${r}-status ${s} ${n}`,children:e})}function z({search:e,onSearchChange:n,placeholder:r="Search...",summary:s,children:l,className:i=""}){const a=k(()=>{n("")},[n]);return t("div",{className:`ss-dbg-filter-bar ${i}`,children:[s!=null&&t("span",{className:"ss-dbg-summary",children:s}),t("div",{className:"ss-dbg-search-wrapper",children:[t("svg",{className:"ss-dbg-search-icon",width:"14",height:"14",viewBox:E.search.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.search.elements.join("")}}),t("input",{type:"text",className:"ss-dbg-search",placeholder:r,value:e,onChange:c=>n(c.target.value)}),e&&t("button",{type:"button",className:"ss-dbg-search-clear",onClick:a,children:"×"})]}),l&&t("div",{className:"ss-dbg-filter-controls",children:l})]})}function Tt({options:e}){const{data:n,isLoading:r,error:s}=F("queries",e),[l,i]=w(""),[a,c]=w(null),u=C(()=>n?.queries||[],[n]),d=C(()=>rr(u,l),[u,l]),h=C(()=>sr(u),[u]),o=C(()=>lr(u,h),[u,h]),f=k(p=>{c(v=>v===p?null:p)},[]),_=q([d]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading queries..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t(z,{search:l,onSearchChange:i,placeholder:"Filter queries...",summary:t(M,{children:[d.length," queries",o.slowCount>0&&` | ${o.slowCount} slow`,o.dupCount>0&&` | ${o.dupCount} dup`,d.length>0&&` | avg ${R(o.avgDuration)}`]})}),d.length===0?t("div",{className:"ss-dbg-empty",children:[t("span",{children:"No queries captured"}),t("span",{className:"ss-empty-hint",children:["Queries require ",t("code",{children:"debug: true"})," on your Lucid connections in"," ",t("code",{children:"config/database.ts"})]})]}):t("table",{ref:_,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"70px"}}),t("col",{style:{width:"100px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"SQL"}),t("th",{children:"Duration"}),t("th",{children:"Method"}),t("th",{children:"Model"}),t("th",{children:"Time"})]})}),t("tbody",{children:d.map(p=>t("tr",{children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:p.id}),t("td",{children:[t("span",{className:`ss-dbg-sql ${a===p.id?"ss-dbg-expanded":""}`,onClick:()=>f(p.id),role:"button",tabIndex:0,onKeyDown:v=>v.key==="Enter"&&f(p.id),children:p.sql}),h[p.sql]>1&&t("span",{className:"ss-dbg-dup",children:[" x",h[p.sql]]}),p.inTransaction&&t("span",{className:"ss-dbg-dup",children:" TXN"})]}),t("td",{className:`ss-dbg-duration ${Oe(p.duration,"ss-dbg")}`,children:R(p.duration)}),t("td",{children:t(Z,{method:p.method,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-muted",children:p.model||"-"}),t("td",{children:t(V,{ts:p.timestamp,className:"ss-dbg-event-time"})})]},p.id))})]})]})}const ur=Object.freeze(Object.defineProperty({__proto__:null,QueriesTab:Tt,default:Tt},Symbol.toStringTag,{value:"Module"}));function Lt(e,...n){for(const r of n){const s=e[r];if(s!=null)return s}}function Et(e){return Lt(e,"createdAt","created_at","timestamp")}function hr(e){return Lt(e,"timestamp","createdAt","processedAt","created_at")}function _e({data:e,maxPreviewLength:n=100,className:r="",classPrefix:s="ss-dash",defaultExpanded:l=!1}){const[i,a]=w(l),c=C(()=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},[e]),u=C(()=>typeof c=="object"&&c!==null?pe(c,n):String(c??"-"),[c,n]),d=C(()=>typeof c=="object"&&c!==null?JSON.stringify(c,null,2):String(c),[c]),h=k(()=>{a(f=>!f)},[]),o=k(async()=>{try{await navigator.clipboard.writeText(d)}catch{}},[d]);return!e&&e!==0&&e!==!1?t("span",{className:`ss-dim ${s}-c-dim`,children:"-"}):t("div",{className:`${s}-data-cell ${r}`,children:[!i&&t("span",{className:`${s}-data-preview`,onClick:h,role:"button",tabIndex:0,onKeyDown:f=>f.key==="Enter"&&h(),children:u}),i&&t("div",{className:`${s}-data-full`,onClick:h,children:[t("button",{className:`${s}-copy-btn`,onClick:f=>{f.stopPropagation(),o()},title:"Copy to clipboard",type:"button",children:"Copy"}),t("pre",{children:d})]})]})}function Pt({options:e}){const{data:n,isLoading:r,error:s}=F("events",e),[l,i]=w(""),a=C(()=>{const u=n?.events||[];if(!l)return u;const d=l.toLowerCase();return u.filter(h=>(h.event||"").toLowerCase().includes(d)||(h.data||"").toLowerCase().includes(d))},[n,l]),c=q([a]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading events..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t(z,{search:l,onSearchChange:i,placeholder:"Filter events...",summary:`${a.length} events`}),a.length===0?t("div",{className:"ss-dbg-empty",children:"No events captured"}):t("table",{ref:c,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"20%"}}),t("col",{}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"Event"}),t("th",{children:"Data"}),t("th",{children:"Time"})]})}),t("tbody",{children:a.map(u=>{const d=Et(u);return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:u.id}),t("td",{className:"ss-dbg-event-name",children:u.event}),t("td",{className:"ss-dbg-event-data",children:t(_e,{data:u.data,maxPreviewLength:80,classPrefix:"ss-dbg"})}),t("td",{children:t(V,{ts:d,className:"ss-dbg-event-time"})})]},u.id)})})]})]})}const fr=Object.freeze(Object.defineProperty({__proto__:null,EventsTab:Pt,default:Pt},Symbol.toStringTag,{value:"Module"}));function pr({email:e,previewHtml:n,isLoading:r=!1,onClose:s,className:l}){return t("div",{className:l||"ss-email-preview",children:[t("div",{className:"ss-email-preview-header",children:[t("div",{className:"ss-email-preview-meta",children:e&&t(M,{children:[e.subject!=null&&t("div",{children:[t("strong",{children:"Subject:"})," ",e.subject]}),e.from!=null&&t("div",{children:[t("strong",{children:"From:"})," ",e.from]}),e.to!=null&&t("div",{children:[t("strong",{children:"To:"})," ",e.to]}),e.cc&&t("div",{children:[t("strong",{children:"CC:"})," ",e.cc]}),e.status&&t("div",{children:[t("strong",{children:"Status:"})," ",t("span",{className:`ss-email-status ss-email-status-${e.status}`,children:e.status})]}),e.mailer&&t("div",{children:[t("strong",{children:"Mailer:"})," ",e.mailer]})]})}),t("button",{className:"ss-dbg-btn-clear",onClick:s,type:"button",children:"×"})]}),r?t("div",{className:"ss-empty",children:"Loading preview..."}):n?t("iframe",{className:"ss-email-iframe",srcDoc:n,title:"Email preview",sandbox:""}):t("div",{style:{padding:"12px",whiteSpace:"pre-wrap"},children:e?.text||"No content"})]})}function At({options:e}){const{data:n,isLoading:r,error:s}=F("emails",e),[l,i]=w(""),[a,c]=w(null),[u,d]=w(null),[h,o]=w(!1),f=C(()=>{const m=n?.emails||[];if(!l)return m;const N=l.toLowerCase();return m.filter($=>($.subject||"").toLowerCase().includes(N)||($.to||"").toLowerCase().includes(N)||($.from||"").toLowerCase().includes(N)||($.mailer||"").toLowerCase().includes(N))},[n,l]),_=C(()=>f.find(m=>m.id===a),[f,a]),p=k(async m=>{if(c(m.id),d(m.html||null),!m.html&&m.id){o(!0);try{const N=e?.debugEndpoint||"/admin/api/debug",$={};e?.authToken&&($.Authorization=`Bearer ${e.authToken}`);const g=await fetch(`${N}/emails/${m.id}/preview`,{headers:$,credentials:e?.authToken?"omit":"include"});g.ok&&d(await g.text())}catch{}finally{o(!1)}}},[e]),v=k(()=>{c(null),d(null),o(!1)},[]),y={sent:"ss-dbg-email-status-sent",sending:"ss-dbg-email-status-sending",queueing:"ss-dbg-email-status-queued",queued:"ss-dbg-email-status-queued",failed:"ss-dbg-email-status-failed"},b=q([f]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading emails..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):_?t(pr,{email:_,previewHtml:u,isLoading:h,onClose:v,className:"ss-dbg-email-preview"}):t("div",{children:[t(z,{search:l,onSearchChange:i,placeholder:"Filter emails...",summary:`${f.length} emails`}),f.length===0?t("div",{className:"ss-dbg-empty",children:"No emails captured"}):t("table",{ref:b,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"140px"}}),t("col",{style:{width:"140px"}}),t("col",{}),t("col",{style:{width:"70px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"40px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"From"}),t("th",{children:"To"}),t("th",{children:"Subject"}),t("th",{children:"Status"}),t("th",{children:"Mailer"}),t("th",{title:"Attachments",children:"📎"}),t("th",{children:"Time"})]})}),t("tbody",{children:f.map(m=>t("tr",{className:"ss-dbg-email-row",onClick:()=>p(m),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:m.id}),t("td",{className:"ss-dbg-c-secondary",title:m.from,children:m.from}),t("td",{className:"ss-dbg-c-secondary",title:m.to,children:m.to}),t("td",{className:"ss-dbg-c-sql",children:m.subject}),t("td",{children:t("span",{className:`ss-dbg-email-status ${y[m.status]||""}`,children:m.status})}),t("td",{className:"ss-dbg-c-muted",children:m.mailer}),t("td",{className:"ss-dbg-c-dim",style:{textAlign:"center"},children:m.attachmentCount>0?m.attachmentCount:"-"}),t("td",{children:t(V,{ts:Et(m),className:"ss-dbg-event-time"})})]},m.id))})]})]})}const _r=Object.freeze(Object.defineProperty({__proto__:null,EmailsTab:At,default:At},Symbol.toStringTag,{value:"Module"}));function Mt({options:e,currentPath:n}){const{data:r,isLoading:s,error:l}=F("routes",e),[i,a]=w(""),c=C(()=>{const d=r?.routes||[];if(!i)return d;const h=i.toLowerCase();return d.filter(o=>o.pattern.toLowerCase().includes(h)||o.handler.toLowerCase().includes(h)||o.method.toLowerCase().includes(h)||o.name&&o.name.toLowerCase().includes(h))},[r,i]),u=q([c]);return s&&!r?t("div",{className:"ss-dbg-empty",children:"Loading routes..."}):l?t("div",{className:"ss-dbg-empty",children:["Error: ",l.message]}):t("div",{children:[t(z,{search:i,onSearchChange:a,placeholder:"Filter routes...",summary:`${c.length} routes`}),c.length===0?t("div",{className:"ss-dbg-empty",children:"No routes found"}):t("table",{ref:u,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"70px"}}),t("col",{style:{width:"25%"}}),t("col",{style:{width:"15%"}}),t("col",{}),t("col",{style:{width:"20%"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"Method"}),t("th",{children:"Pattern"}),t("th",{children:"Name"}),t("th",{children:"Handler"}),t("th",{children:"Middleware"})]})}),t("tbody",{children:c.map((d,h)=>{const o=n&&(d.pattern===n||new RegExp("^"+d.pattern.replace(/:[^/]+/g,"[^/]+")+"$").test(n));return t("tr",{className:o?"ss-dbg-current-route":"",children:[t("td",{children:t(Z,{method:d.method,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-text",children:d.pattern}),t("td",{className:"ss-dbg-c-muted",children:d.name||"-"}),t("td",{className:"ss-dbg-c-sql",children:d.handler}),t("td",{className:"ss-dbg-c-dim",style:{fontSize:"10px"},children:d.middleware.length>0?d.middleware.join(", "):"-"})]},`${d.method}-${d.pattern}-${h}`)})})]})]})}const mr=Object.freeze(Object.defineProperty({__proto__:null,RoutesTab:Mt,default:Mt},Symbol.toStringTag,{value:"Module"}));function gr(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 Ot(e){const n={};for(const[r,s]of Object.entries(e))Nr.has(r)||(n[r]=s);return Object.keys(n).length>0?n:null}const br=["all","error","warn","info","debug"];function jt(e){return(e.levelName||e.level_name||(typeof e.level=="string"?e.level:"")||"info").toLowerCase()}function Dt(e){return e.msg||e.message||JSON.stringify(e)}function vr(e){return e.createdAt||e.created_at||e.time||e.timestamp||0}function Bt(e){const n=e.data||{};return e.requestId||e.request_id||e["x-request-id"]||n.requestId||n.request_id||n["x-request-id"]||""}function yr(e,n="ss-dbg-log-level"){switch(e){case"error":case"fatal":return`${n}-error`;case"warn":return`${n}-warn`;case"info":return`${n}-info`;case"debug":return`${n}-debug`;case"trace":return`${n}-trace`;default:return`${n}-info`}}function wr(e,n){return n==="all"?e:e.filter(r=>{const s=jt(r);return n==="error"?s==="error"||s==="fatal":s===n})}const Nr=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 xr(e){if(e.data){const n=gr(e.data);if(n){const r=Ot(n);if(r)return r}}return Ot(e)}function It({log:e,index:n,expanded:r,onToggleExpand:s,onReqIdClick:l}){const i=jt(e),a=Dt(e),c=vr(e),u=Bt(e),d=xr(e);return t(Nn.Fragment,{children:[t("div",{className:`ss-log-entry${d?" ss-log-entry-expandable":""}`,onClick:()=>d&&s(n),children:[t("span",{className:`ss-log-level ${yr(i,"ss-log-level")}`,children:i.toUpperCase()}),t(V,{ts:c,className:"ss-log-time"}),u?t("span",{className:"ss-log-reqid",title:u,onClick:l?h=>{h.stopPropagation(),l(u)}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,onKeyDown:l?h=>{h.key==="Enter"&&(h.stopPropagation(),l(u))}:void 0,children:u.slice(0,8)}):t("span",{className:"ss-log-reqid-empty",children:"--"}),d?t("span",{className:`ss-log-expand-icon${r?" ss-log-expand-icon-open":""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:"ss-log-msg",children:a})]}),r&&d&&t("div",{className:"ss-log-detail",children:t(_e,{data:d,classPrefix:"ss-dbg",defaultExpanded:!0})})]})}function Rt({options:e}){const{data:n,isLoading:r,error:s}=F("logs",e),[l,i]=w("all"),[a,c]=w(""),[u,d]=w(""),[h,o]=w(null),f=C(()=>{let p=Array.isArray(n)?n:n?.logs||n?.entries||[];if(p=wr(p,l),u){const v=u.toLowerCase();p=p.filter(y=>Bt(y).toLowerCase().includes(v))}if(a){const v=a.toLowerCase();p=p.filter(y=>Dt(y).toLowerCase().includes(v))}return p},[n,l,a,u]),_=k(p=>{d(v=>v===p?"":p)},[]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading logs..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t("div",{className:"ss-dbg-log-filters",children:[br.map(p=>t("button",{type:"button",className:`ss-dbg-log-filter ${l===p?"ss-dbg-active":""}`,onClick:()=>i(p),children:p},p)),u&&t("button",{type:"button",className:"ss-dbg-log-filter ss-dbg-active",onClick:()=>d(""),children:["req: ",u.slice(0,8)," x"]}),t("span",{className:"ss-dbg-summary",style:{marginLeft:"auto"},children:[f.length," entries"]})]}),t(z,{search:a,onSearchChange:c,placeholder:"Filter log messages..."}),t("div",{style:{overflow:"auto",flex:1},children:f.length===0?t("div",{className:"ss-dbg-empty",children:"No log entries"}):f.slice(0,200).map((p,v)=>t(It,{log:p,index:v,expanded:h===v,onToggleExpand:y=>o(h===y?null:y),onReqIdClick:_},v))})]})}const $r=Object.freeze(Object.defineProperty({__proto__:null,LogsTab:Rt,default:Rt},Symbol.toStringTag,{value:"Module"}));function Ft(e="",n){const r=j(null);return k(()=>(r.current||(r.current=new Ee({baseUrl:e,authToken:n})),r.current),[e,n])}function Sr({logs:e,onReqIdClick:n}){const[r,s]=w(null);return e.length===0?null:t("div",{children:[t("div",{className:"ss-related-logs-title",children:["Related Logs",t("span",{className:"ss-related-logs-count",children:["(",e.length,")"]})]}),t("div",{style:{overflow:"auto"},children:e.map((l,i)=>t(It,{log:l,index:i,expanded:r===i,onToggleExpand:a=>s(r===a?null:a),onReqIdClick:n},l.id||i))})]})}function kr(e){const{container:n,handle:r,topPane:s,bottomPane:l,storageKey:i,minHeight:a=60}=e;if(i){const u=localStorage.getItem(i);if(u){const d=parseFloat(u);d>0&&d<1&&(s.style.flex=`${d}`,l.style.flex=`${1-d}`)}}function c(u){u.preventDefault(),r.setPointerCapture(u.pointerId);const h=n.getBoundingClientRect().height,o=u.clientY,f=s.getBoundingClientRect().height;function _(v){const y=v.clientY-o;let b=f+y;const m=h-a-r.offsetHeight;b=Math.max(a,Math.min(b,m));const N=b/(h-r.offsetHeight);s.style.flex=`${N}`,l.style.flex=`${1-N}`}function p(){if(r.removeEventListener("pointermove",_),r.removeEventListener("pointerup",p),i){const v=n.getBoundingClientRect().height-r.offsetHeight;if(v>0){const y=s.getBoundingClientRect().height/v;localStorage.setItem(i,String(y))}}}r.addEventListener("pointermove",_),r.addEventListener("pointerup",p)}return r.addEventListener("pointerdown",c),()=>{r.removeEventListener("pointerdown",c)}}function Cr({children:e,storageKey:n}){const r=j(null),s=j(null),l=j(null),i=j(null);return I(()=>{if(r.current&&s.current&&l.current&&i.current)return kr({container:r.current,handle:s.current,topPane:l.current,bottomPane:i.current,storageKey:n})},[n]),t("div",{ref:r,className:"ss-split-container",children:[t("div",{ref:l,className:"ss-split-top",children:e[0]}),t("div",{ref:s,className:"ss-split-handle"}),t("div",{ref:i,className:"ss-split-bottom",children:e[1]})]})}const Ht={request:"#1e3a5f",middleware:"rgba(30, 58, 95, 0.7)",db:"#6d28d9",view:"#0e7490",mail:"#059669",event:"#b45309",custom:"#525252"},Tr=[{label:"Request",color:"#1e3a5f"},{label:"Middleware",color:"rgba(30, 58, 95, 0.7)"},{label:"Database",color:"#6d28d9"},{label:"View",color:"#0e7490"},{label:"Mail",color:"#059669"},{label:"Event",color:"#b45309"}];function Ut({options:e}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e||{},{data:l,isLoading:i,error:a}=F("timeline",e),[c,u]=w(""),[d,h]=w(null),[o,f]=w(null),[_,p]=w(!1),[v,y]=w(null),b=C(()=>{const g=l?.traces||[];if(!c)return g;const S=c.toLowerCase();return g.filter(P=>P.url.toLowerCase().includes(S)||P.method.toLowerCase().includes(S)||String(P.statusCode).includes(S))},[l,c]),m=Ft(n,s);I(()=>{if(d===null){f(null),y(null);return}let g=!1;return p(!0),y(null),m().get(`${r}/traces/${d}`).then(P=>{g||(f(P),p(!1))}).catch(P=>{g||(y(P instanceof Error?P.message:"Failed to load trace"),p(!1))}),()=>{g=!0}},[d,r,m]);const N=k(g=>{h(S=>S===g?null:g)},[]),$=q([b]);if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading traces..."});if(a)return t("div",{className:"ss-dbg-empty",children:["Error: ",a.message]});if(d!==null){if(_)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});if(v)return t("div",{children:[t("div",{className:"ss-dbg-tl-detail-header",children:t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:"← Back"})}),t("div",{className:"ss-dbg-empty",children:["Error: ",v]})]});if(!o)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});const g=o.spans||[],S=o.warnings||[],P=o.logs||[],W=P.length>0,O=t("div",{children:[t("div",{className:"ss-dbg-tl-legend",children:Tr.map(T=>t("div",{className:"ss-dbg-tl-legend-item",children:[t("div",{className:"ss-dbg-tl-legend-dot",style:{background:T.color}}),t("span",{children:T.label})]},T.label))}),t("div",{style:{padding:"8px 12px",overflow:"auto"},children:g.length===0?t("div",{className:"ss-dbg-empty",children:"No spans captured for this request"}):g.map(T=>{const ve=o.totalDuration||1,os=T.startOffset/ve*100,as=Math.max(T.duration/ve*100,.5);return t("div",{className:"ss-dbg-tl-row",children:[t("div",{className:"ss-dbg-tl-label",title:T.label,children:T.label}),t("div",{className:"ss-dbg-tl-track",children:t("div",{className:`ss-dbg-tl-bar ss-dbg-tl-bar-${T.category}`,style:{left:`${os}%`,width:`${as}%`,background:Ht[T.category]||Ht.custom},title:`${T.label}: ${R(T.duration)}`})}),t("span",{className:"ss-dbg-tl-dur",children:R(T.duration)})]},T.id)})}),S.length>0&&t("div",{className:"ss-dbg-tl-warnings",children:[t("div",{className:"ss-dbg-tl-warnings-title",children:"Warnings"}),S.map((T,ve)=>t("div",{className:"ss-dbg-tl-warning",children:T},ve))]})]});return t("div",{className:"ss-dbg-tl-detail-wrapper",children:[t("div",{className:"ss-dbg-tl-detail-header",children:[t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:"← Back"}),t(Z,{method:o.method,classPrefix:"ss-dbg"}),t("span",{className:"ss-dbg-tl-detail-url",children:o.url}),t(Ct,{code:o.statusCode,classPrefix:"ss-dbg"}),t("span",{className:"ss-dbg-tl-meta",children:[R(o.totalDuration)," · ",o.spanCount," spans"]})]}),W?t(Cr,{storageKey:"ss-dbg-timeline-split",children:[O,t(Sr,{logs:P})]}):O]})}return t("div",{children:[t(z,{search:c,onSearchChange:u,placeholder:"Filter traces...",summary:`${b.length} traces`}),b.length===0?t("div",{className:"ss-dbg-empty",children:"No traces captured. Enable tracing in config."}):t("table",{ref:$,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"70px"}}),t("col",{}),t("col",{style:{width:"60px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"50px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"Method"}),t("th",{children:"URL"}),t("th",{children:"Status"}),t("th",{children:"Duration"}),t("th",{children:"Spans"}),t("th",{children:"Time"})]})}),t("tbody",{children:b.map(g=>t("tr",{className:"ss-dbg-email-row",onClick:()=>N(g.id),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:g.id}),t("td",{children:t(Z,{method:g.method,classPrefix:"ss-dbg"})}),t("td",{title:g.url,children:g.url}),t("td",{children:t(Ct,{code:g.statusCode,classPrefix:"ss-dbg"})}),t("td",{className:`ss-dbg-duration ${Oe(g.totalDuration,"ss-dbg")}`,children:R(g.totalDuration)}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:g.spanCount}),t("td",{children:t(V,{ts:g.timestamp,className:"ss-dbg-event-time"})})]},g.id))})]})]})}const Lr=Object.freeze(Object.defineProperty({__proto__:null,TimelineTab:Ut,default:Ut},Symbol.toStringTag,{value:"Module"}));function je(e,n){const r=C(()=>e?e.replace(/\/+$/,"")+"/api":null,[e]),s=C(()=>r?{...n,debugEndpoint:r}:n,[r,n]);return{dashApiBase:r,resolvedOptions:s}}function Er({hitRate:e,hits:n,misses:r,keys:s}){return t("div",{className:"ss-cache-stats",children:[t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hit Rate:"}),t("span",{className:"ss-cache-stat-value",children:[e.toFixed(1),"%"]})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hits:"}),t("span",{className:"ss-cache-stat-value",children:n})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Misses:"}),t("span",{className:"ss-cache-stat-value",children:r})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Keys:"}),t("span",{className:"ss-cache-stat-value",children:s})]})]})}function zt({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=je(n,e),{data:l,isLoading:i,error:a}=F("cache",s),[c,u]=w(""),[d,h]=w(null),[o,f]=w(null),_=C(()=>{const m=l?.keys||[];if(!c)return m;const N=c.toLowerCase();return m.filter($=>$.key.toLowerCase().includes(N))},[l,c]),p=k(async m=>{if(d===m){h(null),f(null);return}h(m);try{const{baseUrl:N="",authToken:$}=e||{},g=r||e?.debugEndpoint||"/admin/api/debug",S=`${N}${g}/cache/${encodeURIComponent(m)}`,P={Accept:"application/json"};$&&(P.Authorization=`Bearer ${$}`);const O=await(await fetch(S,{headers:P,credentials:$?"omit":"same-origin"})).json();f(O)}catch{f({error:"Failed to fetch key value"})}},[d,e,r]),v=q([_]);if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading cache data..."});if(a)return t("div",{className:"ss-dbg-empty",children:["Error: ",a.message]});if(!l)return t("div",{className:"ss-dbg-empty",children:"Cache inspector not available"});const b=l.stats||l;return t("div",{children:[t(Er,{hitRate:b.hitRate??0,hits:b.totalHits??0,misses:b.totalMisses??0,keys:b.keyCount??0}),t(z,{search:c,onSearchChange:u,placeholder:"Filter keys...",summary:`${_.length} keys`}),d&&!!o&&t("div",{className:"ss-dbg-cache-detail",children:[t("strong",{children:d}),t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:["←"," Back"]}),t(_e,{data:o,classPrefix:"ss-dbg"})]}),_.length===0?t("div",{className:"ss-dbg-empty",children:"No cache keys found"}):t("table",{ref:v,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"Key"}),t("th",{children:"Type"}),t("th",{children:"TTL"}),t("th",{children:"Size"})]})}),t("tbody",{children:_.map(m=>t("tr",{className:"ss-dbg-email-row",onClick:()=>p(m.key),children:[t("td",{className:"ss-dbg-c-sql",children:m.key}),t("td",{className:"ss-dbg-c-muted",children:m.type}),t("td",{className:"ss-dbg-c-muted",children:m.ttl>0?tr(m.ttl):"-"}),t("td",{className:"ss-dbg-c-dim",children:m.size>0?nr(m.size):"-"})]},m.key))})]})]})}const Pr=Object.freeze(Object.defineProperty({__proto__:null,CacheTab:zt,default:zt},Symbol.toStringTag,{value:"Module"})),Ar=["all","active","waiting","delayed","completed","failed"];function Mr(e,n="ss-dbg-job-status"){switch(e){case"completed":case"failed":case"active":case"waiting":case"delayed":return`${n}-${e}`;default:return"ss-dbg-badge-muted"}}function Or(e){if(!e)return[];if(Array.isArray(e))return e;const n=e;return n.jobs||n.data||[]}function jr(e){if(!e||Array.isArray(e))return null;const n=e;return n.stats||n.overview||null}function Dr({stats:e,classPrefix:n="ss"}){if(!e)return null;const r=n;return t("div",{className:`${r}-job-stats`,children:[t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Active:"}),t("span",{className:`${r}-job-stat-value`,children:e.active??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Waiting:"}),t("span",{className:`${r}-job-stat-value`,children:e.waiting??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Delayed:"}),t("span",{className:`${r}-job-stat-value`,children:e.delayed??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Completed:"}),t("span",{className:`${r}-job-stat-value`,children:e.completed??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Failed:"}),t("span",{className:`${r}-job-stat-value ${r}-c-red`,children:e.failed??0})]})]})}function Vt({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=je(n,e),{data:l,isLoading:i,error:a}=F("jobs",s),[c,u]=w(""),[d,h]=w("all"),[o,f]=w(null),_=C(()=>{const b=Or(l),m=d==="all"?b:b.filter($=>$.status===d);if(!c)return m;const N=c.toLowerCase();return m.filter($=>$.name?.toLowerCase().includes(N)||$.id?.toString().includes(N))},[l,d,c]),p=k(async b=>{f(b);try{const{baseUrl:m="",authToken:N}=e||{},$=r||e?.debugEndpoint||"/admin/api/debug",g=`${m}${$}/jobs/${b}/retry`,S={Accept:"application/json"};N&&(S.Authorization=`Bearer ${N}`),await fetch(g,{method:"POST",headers:S,credentials:N?"omit":"same-origin"})}catch{}f(null)},[e,r]),v=q([_]);if(!r)return t("div",{className:"ss-dbg-empty",children:"Queue inspector not available (no dashboard configured)"});if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading jobs..."});if(a)return t("div",{className:"ss-dbg-empty",children:["Error: ",a.message]});if(!l)return t("div",{className:"ss-dbg-empty",children:"Queue inspector not available"});const y=jr(l);return t("div",{children:[t(z,{search:c,onSearchChange:u,placeholder:"Filter jobs...",summary:`${_.length} jobs`}),t("div",{className:"ss-dbg-job-stats-area",children:[t(Dr,{stats:y,classPrefix:"ss-dbg"}),t("div",{className:"ss-dbg-log-filters",children:Ar.map(b=>t("button",{type:"button",className:`ss-dbg-job-filter ${d===b?"ss-dbg-active":""}`,onClick:()=>h(b),children:b},b))})]}),_.length===0?t("div",{className:"ss-dbg-empty",children:"No jobs found"}):t("table",{ref:v,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"15%"}}),t("col",{style:{width:"80px"}}),t("col",{}),t("col",{style:{width:"50px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"60px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"ID"}),t("th",{children:"Name"}),t("th",{children:"Status"}),t("th",{children:"Payload"}),t("th",{children:"Tries"}),t("th",{children:"Duration"}),t("th",{children:"Time"}),t("th",{})]})}),t("tbody",{children:_.map(b=>{const m=b;return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",children:b.id}),t("td",{className:"ss-dbg-c-sql",title:b.name,children:b.name}),t("td",{children:t("span",{className:`ss-dbg-badge ${Mr(b.status)}`,children:b.status})}),t("td",{children:t(_e,{data:b.payload||b.data,maxPreviewLength:60,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:b.attempts||m.attemptsMade||0}),t("td",{className:"ss-dbg-duration",children:b.duration!==null?R(b.duration):"-"}),t("td",{children:t(V,{ts:hr(m),className:"ss-dbg-event-time"})}),t("td",{children:b.status==="failed"&&t("button",{type:"button",className:"ss-dbg-retry-btn",onClick:()=>p(b.id),disabled:o===b.id,children:o===b.id?"...":"Retry"})})]},b.id)})})]})]})}const Br=Object.freeze(Object.defineProperty({__proto__:null,JobsTab:Vt,default:Vt},Symbol.toStringTag,{value:"Module"}));function B(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.__redacted===!0}function me(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!B(e)}function De(e,n=""){if(!me(e))return[{path:n,value:e}];const r=[];for(const s of Object.keys(e)){const l=n?`${n}.${s}`:s,i=e[s];me(i)?r.push(...De(i,l)):r.push({path:l,value:i})}return r}function Be(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(r=>r==null?"null":typeof r=="object"?JSON.stringify(r):String(r)).join(", ")}]`,color:"var(--ss-purple-fg)"}:typeof e=="object"?{text:JSON.stringify(e),color:"var(--ss-dim)"}:{text:String(e)}}function qt(e){if(e==null||typeof e!="object"||Array.isArray(e)||B(e))return 1;let n=0;for(const r of Object.keys(e))n+=qt(e[r]);return n}function Ir(e){if(!me(e))return[];const n=[];for(const r of Object.keys(e))me(e[r])&&n.push(r);return n}function ge(e,n,r){n&&navigator.clipboard.writeText(e).then(()=>{const s=n.textContent;n.textContent="✓",n.classList.add(`${r}-copy-row-ok`),setTimeout(()=>{n.textContent=s,n.classList.remove(`${r}-copy-row-ok`)},1200)}).catch(()=>{})}function be({redacted:e,p:n}){const[r,s]=w(!1);return t("span",{className:`${n}-config-redacted`,style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[t("span",{children:r?e.value:e.display}),t("button",{type:"button",className:`${n}-btn`,title:r?"Hide":"Reveal",style:{padding:"0 4px",fontSize:"0.85em",lineHeight:1,minWidth:"auto"},onClick:l=>{l.stopPropagation(),s(i=>!i)},children:r?t("svg",{width:"14",height:"14",viewBox:E["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E["eye-off"].elements.join("")}}):t("svg",{width:"14",height:"14",viewBox:E.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.eye.elements.join("")}})})]})}function Rr({env:e,search:n,p:r}){const s=j(new Map),l=n.toLowerCase(),i=Object.entries(e).filter(([a,c])=>{if(!l)return!0;const u=B(c)?c.display:c==null?"":String(c);return a.toLowerCase().includes(l)||u.toLowerCase().includes(l)});return t("div",{className:`${r}-config-table-wrap`,children:t("table",{className:`${r}-table ${r}-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:[i.map(([a,c])=>{const u=B(c),d=u?c.display:c==null?"null":String(c),h=`${a}=${d}`;return t("tr",{children:[t("td",{className:`${r}-env-key`,children:t("span",{className:`${r}-config-key`,children:a})}),t("td",{className:`${r}-env-val`,children:u?t(be,{redacted:c,p:r}):t("span",{className:`${r}-config-val`,children:d})}),t("td",{children:!u&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:o=>{s.current.set(a,o)},onClick:o=>{o.stopPropagation(),ge(h,s.current.get(a)??null,r)},children:"⎘"})})]},a)}),i.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching variables"})})]})]})})}function Fr({source:e,search:n,p:r}){const s=j(new Map),l=n.toLowerCase(),i=De(e,""),a=i.filter(c=>{const u=B(c.value)?c.value.display:c.value===null||c.value===void 0?"":String(c.value);return c.path.toLowerCase().includes(l)||u.toLowerCase().includes(l)});return t("div",{className:`${r}-config-table-wrap`,children:[t("table",{className:`${r}-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Path"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[a.map(c=>{const u=B(c.value),d=u?null:Be(c.value),h=u?c.value.display:d.text,o=`${c.path}: ${h}`;return t("tr",{children:[t("td",{children:t("span",{className:`${r}-config-key`,style:{whiteSpace:"nowrap"},children:c.path})}),t("td",{children:u?t(be,{redacted:c.value,p:r}):t("span",{className:`${r}-config-val`,style:{wordBreak:"break-all",color:d.color},children:d.text})}),t("td",{children:!u&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:f=>{s.current.set(c.path,f)},onClick:f=>{f.stopPropagation(),ge(o,s.current.get(c.path)??null,r)},children:"⎘"})})]},c.path)}),a.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:[a.length," of ",i.length," entries"]})]})}function Hr({obj:e,prefix:n,p:r}){const s=j(new Map),l=De(e,n);return t("table",{className:`${r}-table ${r}-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:l.map(i=>{const a=i.path.indexOf(n+".")===0?i.path.slice(n.length+1):i.path,c=B(i.value),u=c?null:Be(i.value),d=c?i.value.display:u.text,h=`${i.path}: ${d}`;return t("tr",{children:[t("td",{title:a,children:t("span",{className:`${r}-config-key`,children:a})}),t("td",{title:d,children:c?t(be,{redacted:i.value,p:r}):t("span",{className:`${r}-config-val`,style:{color:u.color},children:u.text})}),t("td",{children:!c&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:o=>{s.current.set(i.path,o)},onClick:o=>{o.stopPropagation(),ge(h,s.current.get(i.path)??null,r)},children:"⎘"})})]},i.path)})})]})}function Ur({value:e,p:n}){if(e==null)return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-dim)"},children:"null"});if(B(e))return t(be,{redacted:e,p:n});if(typeof e=="boolean")return t("span",{className:`${n}-config-val`,style:{color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"},children:String(e)});if(typeof e=="number")return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-amber-fg)"},children:String(e)});if(Array.isArray(e)){const r=e.map(s=>s==null?"null":typeof s=="object"?JSON.stringify(s):String(s));return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-purple-fg)"},children:["[",r.join(", "),"]"]})}return typeof e=="object"?t("span",{className:`${n}-config-val`,style:{color:"var(--ss-dim)"},children:JSON.stringify(e)}):t("span",{className:`${n}-config-val`,children:String(e)})}function zr({obj:e,expandedPaths:n,onToggle:r,p:s}){if(e==null||typeof e!="object"||Array.isArray(e)||B(e))return null;const l=Object.keys(e),i=j(new Map);return t("div",{className:`${s}-config-sections`,children:l.map(a=>{const c=e[a],u=c!==null&&typeof c=="object"&&!Array.isArray(c)&&!B(c),d=n.has(a),h=B(c);return t("div",{className:`${s}-config-section`,children:[t("div",{className:`${s}-config-section-header${u?"":` ${s}-config-leaf`}`,onClick:u?()=>r(a):void 0,style:{cursor:u?"pointer":"default"},children:[u?t("span",{className:`${s}-config-toggle`,children:d?"▼":"▶"}):t("span",{className:`${s}-config-toggle`,style:{visibility:"hidden"},children:"•"}),t("span",{className:`${s}-config-key`,children:a}),u?t("span",{className:`${s}-config-count`,children:[qt(c)," entries"]}):t(M,{children:[t("span",{className:`${s}-config-val`,style:{marginLeft:"8px"},children:t(Ur,{value:c,p:s})}),!h&&t("button",{type:"button",className:`${s}-copy-row-btn`,style:{marginLeft:"4px"},title:"Copy",ref:o=>{i.current.set(a,o)},onClick:o=>{o.stopPropagation();const f=Be(c);ge(`${a}: ${f.text}`,i.current.get(a)??null,s)},children:"⎘"})]})]}),u&&d&&t("div",{className:`${s}-config-section-body`,children:t(Hr,{obj:c,prefix:a,p:s})})]},a)})})}function Vr({data:e,isLoading:n,classPrefix:r}){const s=r,[l,i]=w(""),[a,c]=w(""),[u,d]=w("app"),[h,o]=w(new Set),[f,_]=w("Copy JSON");I(()=>{const N=setTimeout(()=>c(l),200);return()=>clearTimeout(N)},[l]);const p=e,v=k(N=>{o($=>{const g=new Set($);return g.has(N)?g.delete(N):g.add(N),g})},[]),y=k(()=>{if(!p)return;const N=u==="app"?p.app:p.env;if(!N)return;const $=Ir(N);o(new Set($))},[p,u]),b=k(()=>{o(new Set)},[]),m=k(async()=>{if(p)try{const N=u==="app"?p.app:p.env;await navigator.clipboard.writeText(JSON.stringify(N,null,2)),_("Copied!"),setTimeout(()=>_("Copy JSON"),1500)}catch{}},[p,u]);return t("div",{children:[t("div",{className:`${s}-config-toolbar`,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px"},children:[t("button",{type:"button",className:`${s}-config-tab${u==="app"?` ${s}-active`:""}`,onClick:()=>d("app"),children:"App Config"}),t("button",{type:"button",className:`${s}-config-tab${u==="env"?` ${s}-active`:""}`,onClick:()=>d("env"),children:"Env"}),t("div",{style:{position:"relative",flex:1},children:[t("input",{type:"text",className:`${s}-search`,placeholder:"Search keys and values...",value:l,onChange:N=>i(N.target.value),style:{width:"100%"}}),l&&t("button",{type:"button",onClick:()=>i(""),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:"×"})]}),u==="app"&&!a&&t(M,{children:[t("button",{type:"button",className:`${s}-btn`,onClick:y,children:"Expand All"}),t("button",{type:"button",className:`${s}-btn`,onClick:b,children:"Collapse All"})]}),t("button",{type:"button",className:`${s}-btn`,onClick:m,children:f})]}),n&&!e?t("div",{className:`${s}-empty`,children:"Loading config..."}):p?u==="env"?t(Rr,{env:p.env??{},search:a,p:s}):a?t(Fr,{source:p.app??{},search:a,p:s}):t("div",{className:`${s}-config-table-wrap`,children:t(zr,{obj:p.app,expandedPaths:h,onToggle:v,p:s})}):t("div",{className:`${s}-empty`,children:"Config not available"})]})}function Wt({options:e,dashboardPath:n}){const{resolvedOptions:r}=je(n,e),{data:s,isLoading:l,error:i}=F("config",r);return i?t("div",{className:"ss-dbg-empty",children:["Error: ",i.message]}):t(Vr,{data:s,isLoading:l,classPrefix:"ss-dbg"})}const qr=Object.freeze(Object.defineProperty({__proto__:null,ConfigTab:Wt,default:Wt},Symbol.toStringTag,{value:"Module"}));function Wr(e={}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s,refreshInterval:l=3e3}=e,[i,a]=w(null),[c,u]=w(!0),[d,h]=w(null),o=j(null),f=Ft(n,s),_=k(async()=>{try{const v=await f().get(`${r}/diagnostics`);a(v),h(null),u(!1)}catch(p){if(p instanceof he){h(p),u(!1),o.current&&(clearInterval(o.current),o.current=null);return}h(p instanceof Error?p:new Error(String(p))),u(!1)}},[r,f]);return I(()=>(u(!0),h(null),_(),o.current=setInterval(_,l),()=>{o.current&&(clearInterval(o.current),o.current=null)}),[_,l]),{data:i,isLoading:c,error:d}}const Jr=["password","secret","token","key","credential","auth"];function Jt(e){const n=e.toLowerCase();return Jr.some(r=>n.includes(r))}function Kt(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 Kr={collectionInterval:"Stats Collection",dashboardBroadcast:"Dashboard Broadcast",debugBroadcast:"Debug Broadcast",persistFlush:"Persist Flush",retentionCleanup:"Retention Cleanup"};function Qr(e){return Kr[e]||e}const Gr={prometheus:"Prometheus",pinoHook:"Pino Log Hook",edgePlugin:"Edge Plugin",cacheInspector:"Cache Inspector",queueInspector:"Queue Inspector"};function Yr(e){return Gr[e]||e}const Xr=["healthy","active","connected","available","ready"],Zr=["errored","unavailable"];function es(e){return Xr.includes(e)?"ok":Zr.includes(e)?"err":""}function ee({status:e,prefix:n}){const r=es(e);let s=`${n}-dot`;return r==="ok"?s+=` ${n}-dot-ok`:r==="err"&&(s+=` ${n}-dot-err`),t("span",{className:s})}const Qt=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:E.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E.eye.elements.join("")}}),Gt=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:E["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:E["eye-off"].elements.join("")}});function ts({value:e}){const[n,r]=w(!1);return t("span",{children:[n?e:"••••••••"," ",t("button",{type:"button",onClick:()=>r(s=>!s),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:n?t(Gt,{}):t(Qt,{})})]})}function ns({current:e,max:n,prefix:r}){const s=n>0?Math.min(100,Math.round(e/n*100)):0,l=s>=100;return t("div",{className:`${r}-bar`,children:[t("div",{className:`${r}-bar-track`,children:t("div",{className:`${r}-bar-fill${l?` ${r}-bar-fill-warn`:""}`,style:{width:`${s}%`}})}),t("span",{className:`${r}-bar-pct${l?` ${r}-bar-pct-warn`:""}`,children:[s,"%"]})]})}function rs({config:e,prefix:n}){const r=Object.entries(e);return r.length===0?t("span",{className:`${n}-c-dim`,children:"-"}):t("span",{className:`${n}-c-muted`,children:r.map(([s,l],i)=>t("span",{children:[i>0&&", ",t("span",{className:`${n}-c-dim`,children:s}),"=",Jt(s)&&typeof l=="string"?t(ts,{value:l}):t("span",{children:Kt(l)})]},s))})}function te({label:e,value:n,prefix:r}){return t("div",{className:`${r}-info-card`,children:[t("span",{className:`${r}-info-card-label`,children:e}),t("span",{className:`${r}-info-card-value`,children:n})]})}function ss({data:e,tableClassName:n,classPrefix:r}){const s=r||"ss-dash",[l,i]=w(new Set),a=k(h=>{i(o=>{const f=new Set(o);return f.has(h)?f.delete(h):f.add(h),f})},[]),c=k((h,o)=>{if(o==null)return t("span",{className:`${s}-c-dim`,children:"null"});if(typeof o=="boolean")return t("span",{className:o?`${s}-c-green`:`${s}-c-red`,children:String(o)});if(Array.isArray(o))return t("span",{children:o.join(", ")||"-"});const f=Kt(o);if(Jt(h)){const _=l.has(h);return t("span",{children:[_?f:"••••••••"," ",t("button",{type:"button",onClick:()=>a(h),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:_?t(Gt,{}):t(Qt,{})})]})}return t("span",{children:f})},[l,a,s]),d=e.collectors?.some(h=>h.name==="db_pool"||h.name==="app")&&Array.isArray(e.lucidDebugConnections)&&e.lucidDebugConnections.length===0;return t("div",{children:[d&&t("div",{style:{background:"var(--ss-amber-bg)",color:"var(--ss-amber-fg)",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",marginBottom:"12px",lineHeight:1.5},children:[t("strong",{children:"Query capture disabled"})," — no Lucid connections have"," ",t("code",{style:{fontSize:"11px"},children:"debug: true"}),". Add it to your database connection in ",t("code",{style:{fontSize:"11px"},children:"config/database.ts"})," to see queries in the Queries panel."]}),t("h3",{className:`${s}-internals-title`,children:"Package Info"}),t("div",{className:`${s}-info-cards`,children:[t(te,{label:"Version",value:e.package.version||"-",prefix:s}),t(te,{label:"Node.js",value:e.package.nodeVersion||"-",prefix:s}),t(te,{label:"AdonisJS",value:e.package.adonisVersion||"-",prefix:s}),t(te,{label:"Uptime",value:Xn(e.package.uptime),prefix:s}),t(te,{label:"Renderer",value:e.devToolbar?.renderer||"preact",prefix:s})]}),e.collectors.length>0&&t(M,{children:[t("h3",{className:`${s}-internals-title`,children:"Collectors"}),t("table",{className:n,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(h=>t("tr",{children:[t("td",{children:[t("code",{children:h.name}),h.label&&h.label!==h.name&&t("span",{className:`${s}-c-dim`,children:[" ",h.label]})]}),t("td",{children:[t(ee,{status:h.status,prefix:s}),h.status]}),t("td",{className:h.lastError?`${s}-c-red`:`${s}-c-dim`,children:h.lastError?t(M,{children:[h.lastError,h.lastErrorAt&&t("span",{className:`${s}-c-dim`,style:{fontSize:"10px"},children:Me(h.lastErrorAt)})]}):"-"}),t("td",{children:t(rs,{config:h.config,prefix:s})})]},h.name))})]})]}),t("h3",{className:`${s}-internals-title`,children:"Buffers"}),t("table",{className:n,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(([h,o])=>t("tr",{children:[t("td",{style:{textTransform:"capitalize"},children:h}),t("td",{children:[o.current.toLocaleString()," / ",o.max.toLocaleString()]}),t("td",{children:t(ns,{current:o.current,max:o.max,prefix:s})})]},h))})]}),t("h3",{className:`${s}-internals-title`,children:"Timers"}),t("table",{className:n,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(([h,o])=>t("tr",{children:[t("td",{children:Qr(h)}),t("td",{children:[t(ee,{status:o.active?"active":"inactive",prefix:s}),t("span",{className:o.active?`${s}-c-green`:`${s}-c-dim`,children:o.active?"active":"inactive"})]}),t("td",{children:o.active?o.intervalMs?R(o.intervalMs):o.debounceMs?`${R(o.debounceMs)} (debounce)`:"-":t("span",{className:`${s}-c-dim`,children:"—"})})]},h))})]}),t("h3",{className:`${s}-internals-title`,children:"Integrations"}),t("table",{className:n,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(ee,{status:e.transmit.available?"connected":"inactive",prefix:s}),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(([h,o])=>{const f=o.active??o.available??!1,_=o.active?"active":o.available?"available":"unavailable";let p=o.mode?`Mode: ${o.mode}`:"-";return h==="edgePlugin"&&o.active?p="@serverStats() tag registered":h==="cacheInspector"&&o.available?p="Redis dependency detected":h==="queueInspector"&&o.available&&(p="Queue dependency detected"),t("tr",{children:[t("td",{children:Yr(h)}),t("td",{children:[t(ee,{status:f?"active":"inactive",prefix:s}),_]}),t("td",{className:`${s}-c-dim`,style:{fontSize:"11px"},children:p})]},h)})]})]}),e.storage&&t(M,{children:[t("h3",{className:`${s}-internals-title`,children:"Storage (SQLite)"}),t("table",{className:n,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(ee,{status:e.storage.ready?"ready":"inactive",prefix:s}),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?Me(e.storage.lastCleanupAt):"-"})]})]})]}),e.storage.tables.length>0&&t("table",{className:n,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(h=>t("tr",{children:[t("td",{children:t("code",{children:h.name})}),t("td",{children:h.rowCount.toLocaleString()})]},h.name))})]})]}),t("h3",{className:`${s}-internals-title`,children:"Resolved Config"}),t("table",{className:n,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:c("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:`${s}-internals-title`,children:"DevToolbar"}),t("table",{className:n,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(([h,o])=>t("tr",{children:[t("td",{children:h==="customPaneCount"?"customPanes":h}),t("td",{children:h==="customPaneCount"?`${o} registered`:c(h,o)})]},h))})]})]})}function Yt({options:e}){const{data:n,isLoading:r,error:s}=Wr({baseUrl:e?.baseUrl,debugEndpoint:e?.debugEndpoint,authToken:e?.authToken});return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading diagnostics..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):n?t(ss,{data:n,tableClassName:"ss-dbg-table",classPrefix:"ss-dbg"}):t("div",{className:"ss-dbg-empty",children:"Diagnostics not available"})}const ls=Object.freeze(Object.defineProperty({__proto__:null,InternalsTab:Yt,default:Yt},Symbol.toStringTag,{value:"Module"}));function Xt({pane:e,options:n}){({...n});const{data:r,isLoading:s,error:l,clearData:i}=F(e.endpoint.replace(/^\//,""),{...n,debugEndpoint:""}),[a,c]=w(""),u=C(()=>{if(!r)return[];const f=e.dataKey||e.id;let _=r;for(const p of f.split("."))_=_?.[p];return Array.isArray(_)?_:[]},[r,e.dataKey,e.id]),d=C(()=>{if(!a)return u;const f=a.toLowerCase(),_=e.columns.filter(p=>p.searchable).map(p=>p.key);return _.length===0?u:u.filter(p=>_.some(v=>{const y=p[v];return y!==null&&String(y).toLowerCase().includes(f)}))},[u,a,e.columns]),h=(f,_)=>{if(f==null)return t("span",{className:"ss-dbg-c-dim",children:"-"});switch(_.format||"text"){case"time":return typeof f=="number"?t(V,{ts:f,className:"ss-dbg-event-time"}):t("span",{className:"ss-dbg-event-time",children:String(f)});case"timeAgo":return t(V,{ts:f,className:"ss-dbg-event-time"});case"duration":{const v=typeof f=="number"?f:parseFloat(String(f));return isNaN(v)?String(f):t("span",{className:`ss-dbg-duration ${Oe(v,"ss-dbg")}`,children:R(v)})}case"method":return t(Z,{method:String(f),classPrefix:"ss-dbg"});case"json":{let v=f;if(typeof f=="string")try{v=JSON.parse(f)}catch{}return pe(v,80)}case"badge":{const v=String(f).toLowerCase(),b=(_.badgeColorMap||{})[v]||"muted";return t(dr,{color:b,classPrefix:"ss-dbg",children:String(f)})}default:return String(f)}},o=q([d]);return s&&!r?t("div",{className:"ss-dbg-empty",children:["Loading ",e.label,"..."]}):l?t("div",{className:"ss-dbg-empty",children:["Error: ",l.message]}):t("div",{children:[e.search&&t(z,{search:a,onSearchChange:c,placeholder:e.search.placeholder,summary:`${d.length} items`,children:e.clearable&&t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:i,children:"Clear"})}),d.length===0?t("div",{className:"ss-dbg-empty",children:"No data"}):t("table",{ref:o,className:"ss-dbg-table",children:[t("thead",{children:t("tr",{children:e.columns.map(f=>t("th",{children:f.label},f.key))})}),t("tbody",{children:d.map((f,_)=>t("tr",{children:e.columns.map(p=>t("td",{children:h(f[p.key],p)},p.key))},f.id??_))})]})]})}const is=Object.freeze(Object.defineProperty({__proto__:null,CustomPaneTab:Xt,default:Xt},Symbol.toStringTag,{value:"Module"}))})();