@brickkit/cli 0.14.0 → 0.15.0
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.
- package/dashboard-dist/{api-reference-lLhahVJi.js → api-reference-BP4ULs5J.js} +3 -3
- package/dashboard-dist/app.js +4 -4
- package/dashboard-dist/{client-DRtkFydB.js → client-CID_ep-s.js} +1 -1
- package/dashboard-dist/{core-BSTqZqMg.js → core-B123mLVe.js} +1 -1
- package/dashboard-dist/{docs-Cye2p0fM.js → docs-B5JrvjJm.js} +1 -1
- package/dashboard-dist/kit.js +1 -1
- package/dashboard-dist/{popover-CKxhB1QI.js → popover-B4rnc_po.js} +1 -1
- package/dist/build.js +5 -1
- package/dist/build.js.map +1 -1
- package/dist/client-contract-file.js +1 -1
- package/dist/client-contract-file.js.map +1 -1
- package/dist/dashboard-host.js +26 -7
- package/dist/dashboard-host.js.map +1 -1
- package/dist/project.js +1 -1
- package/dist/vite.js +2 -1
- package/dist/vite.js.map +1 -1
- package/package.json +2 -2
package/dashboard-dist/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["api-reference-
|
|
2
|
-
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{Gn as n,Hn as r,Un as i,Vn as a,Wn as o}from"./CompositeRoot-D4sRkYq3.js";import{$ as s,A as c,Ct as l,F as u,G as d,J as f,K as p,M as m,N as h,P as g,Q as _,R as v,St as y,Tt as b,W as x,X as ee,Y as te,Z as ne,b as re,c as S,dt as C,f as w,ft as ie,g as ae,gt as oe,h as se,ht as ce,i as le,it as ue,j as de,k as fe,lt as pe,m as me,mt as he,n as ge,nt as T,o as _e,p as ve,pt as ye,q as be,r as xe,rt as Se,s as Ce,t as E,tt as D,u as O,ut as we,vt as Te,x as k,xt as A,yt as j}from"./popover-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["api-reference-BP4ULs5J.js","rolldown-runtime-XKyaHtl9.js","CompositeRoot-D4sRkYq3.js","CollapsiblePanel-CbUysOp5.js","ccount-CcG1m-Yh.js","PopoverPopup-CiI2avT_.js","popover-B4rnc_po.js","docs-B5JrvjJm.js","docs.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{Gn as n,Hn as r,Un as i,Vn as a,Wn as o}from"./CompositeRoot-D4sRkYq3.js";import{$ as s,A as c,Ct as l,F as u,G as d,J as f,K as p,M as m,N as h,P as g,Q as _,R as v,St as y,Tt as b,W as x,X as ee,Y as te,Z as ne,b as re,c as S,dt as C,f as w,ft as ie,g as ae,gt as oe,h as se,ht as ce,i as le,it as ue,j as de,k as fe,lt as pe,m as me,mt as he,n as ge,nt as T,o as _e,p as ve,pt as ye,q as be,r as xe,rt as Se,s as Ce,t as E,tt as D,u as O,ut as we,vt as Te,x as k,xt as A,yt as j}from"./popover-B4rnc_po.js";var Ee=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,ee||(ee=!0,w());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}}var ee=!1,te=-1,ne=5,re=-1;function S(){return g?!0:!(e.unstable_now()-re<ne)}function C(){if(g=!1,ee){var t=e.unstable_now();re=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(te),te=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&S());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?w():ee=!1}}}var w;if(typeof y==`function`)w=function(){y(C)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=C,w=function(){ae.postMessage(null)}}else w=function(){_(C,0)};function oe(t,n){te=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ne=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,w()))),r},e.unstable_shouldYield=S,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),De=t(((e,t)=>{t.exports=Ee()})),Oe=t((e=>{var t=De(),r=n(),i=o();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(a(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return d(i),e;if(o===r)return d(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function h(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function g(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function _(e){var t=[null,null],n=h(e);return n===null||v(t,e,n.child,{foundSelf:!1}),t}function v(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&v(e,t,n.child,r))return!0;n=n.sibling}return!1}function y(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var b=null,x=null;function ee(e,t,n){return e===n||e===t&&(b=e,!0)}function te(e,t,n){return e===n?(x=e,!1):e===t&&(x!==null&&(b=e),!0)}function ne(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function re(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var S=Object.assign,C=Symbol.for(`react.element`),w=Symbol.for(`react.transitional.element`),ie=Symbol.for(`react.portal`),ae=Symbol.for(`react.fragment`),oe=Symbol.for(`react.strict_mode`),se=Symbol.for(`react.profiler`),ce=Symbol.for(`react.consumer`),le=Symbol.for(`react.context`),ue=Symbol.for(`react.forward_ref`),de=Symbol.for(`react.suspense`),fe=Symbol.for(`react.suspense_list`),pe=Symbol.for(`react.memo`),me=Symbol.for(`react.lazy`),he=Symbol.for(`react.activity`),ge=Symbol.for(`react.legacy_hidden`),T=Symbol.for(`react.memo_cache_sentinel`),_e=Symbol.for(`react.view_transition`),ve=Symbol.for(`react.recoverable`),ye=Symbol.iterator;function be(e){return typeof e!=`object`||!e?null:(e=ye&&e[ye]||e[`@@iterator`],typeof e==`function`?e:null)}var xe=Symbol.for(`react.client.reference`);function Se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===xe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ae:return`Fragment`;case se:return`Profiler`;case oe:return`StrictMode`;case de:return`Suspense`;case fe:return`SuspenseList`;case he:return`Activity`;case _e:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ie:return`Portal`;case le:return e.displayName||`Context`;case ce:return(e._context.displayName||`Context`)+`.Consumer`;case ue:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case pe:return t=e.displayName||null,t===null?Se(e.type)||`Memo`:t;case me:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}var Ce=Array.isArray,E=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O={pending:!1,data:null,method:null,action:null},we=[],Te=-1;function k(e){return{current:e}}function A(e){0>Te||(e.current=we[Te],we[Te]=null,Te--)}function j(e,t){Te++,we[Te]=e.current,e.current=t}var Ee=k(null),Oe=k(null),ke=k(null),Ae=k(null);function je(e,t){switch(j(ke,t),j(Oe,e),j(Ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}A(Ee),j(Ee,e)}function Me(){A(Ee),A(Oe),A(ke)}function Ne(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,j(Ae,e)),t=Ee.current;var n=dp(t,e.type);t!==n&&(j(Oe,e),j(Ee,n))}function Pe(e){Oe.current===e&&(A(Ee),A(Oe)),Ae.current===e&&(A(Ae),sh._currentValue=O)}var Fe,Ie;function Le(e){if(Fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Fe=t&&t[1]||``,Ie=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+Fe+e+Ie}var Re=!1;function ze(e,t){if(!e||Re)return``;Re=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
5
|
`),l=s.split(`
|
|
@@ -10,8 +10,8 @@ Error generating stack: `+e.message+`
|
|
|
10
10
|
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&mn(e,``+r);else return;break;case`className`:$t(e,`class`,r);break;case`tabIndex`:$t(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:$t(e,n,r);break;case`style`:_n(e,r,o);return;case`data`:if(t!==`object`){$t(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=xn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=xn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Sn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=xn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Qt(e,`popover`,r);break;case`xlinkActuate`:en(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:en(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:en(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:en(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:en(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:en(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Qt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=yn.get(n)||n,Qt(e,n,r);else return}P=!0}function tp(e,t,n,r,i,o){switch(n){case`style`:_n(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)mn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Sn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Wt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),o=n.slice(2,i?n.length-7:void 0),t=e[At]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,i);break a}P=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Qt(e,n,r)}return}P=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,o,s,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:$(e,t,r,d,n,null)}}F(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&dn(e,!!r,n,!0):dn(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:$(e,t,s,c,n,null)}pn(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,u,r,n,null)}return;default:if(vn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(P=!0),o=m;break;case`name`:m!==f&&(P=!0),i=m;break;case`checked`:m!==f&&(P=!0),u=m;break;case`defaultChecked`:m!==f&&(P=!0),d=m;break;case`value`:m!==f&&(P=!0),s=m;break;case`defaultValue`:m!==f&&(P=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}ln(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:o!==l&&(P=!0),p=o;break;case`defaultValue`:o!==l&&(P=!0),c=o;break;case`multiple`:o!==l&&(P=!0),s=o;default:o!==l&&$(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?dn(e,!!n,n?[]:``,!1):dn(e,!!n,t,!0)):dn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:i!==o&&(P=!0),p=i;break;case`defaultValue`:i!==o&&(P=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&$(e,t,s,i,r,o)}fn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(P=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(vn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[kt]=r,n[At]=t,np(n,e,t),Vt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[M]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:S({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return y(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return y(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=h(this._fragmentFiber);if(t===null)return!0;t=y(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=y(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=h(this._fragmentFiber);e!==null&&(e=y(e),e=lp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=y(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=y(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=y(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=y(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=h(this._fragmentFiber);return t===null?this:y(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=h(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=y(t);if(n.length===0){if(n=r,g(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=_(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=y(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=y(n[0]),i=y(n[n.length-1]);var a=g(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Lt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=h(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=re(n,a,ne),t===null?t=!1:(m(t,!0,ee,a,n),a=b,b=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=re(r,a,ne),t===null?t=!1:(m(t,!0,te,a,r),a=b,x=b=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];m(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=_(this._fragmentFiber);if(r=n?r[1]||r[0]||h(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=y(r),Zp(e,n);return}if(r=y(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=y(i),Zp(i,n)):y(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=y(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),It(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[M])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===Sn&&(e.onclick=null),It(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);It(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=D.d;D.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=zd();return e||t}function Cm(e){var t=Rt(e);t!==null&&t.tag===5&&t.type===`form`?ac(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=cn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Vt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+cn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+cn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+cn(n.imageSizes)+`"]`)):i+=`[href="`+cn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=S({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[N]=!0,o.onload=o.onerror=function(){Ht(o)}),Vt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+cn(r)+`"][href="`+cn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=S({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Vt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Bt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=S({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Vt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Bt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=S({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Vt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Bt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=S({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Vt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=ke.current)?bm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Bt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=Bt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Bt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pm(e){return`href="`+cn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[N]){r.loading=1;return}}else t=e.createElement(`link`),t[N]=!0,t.onload=t.onerror=Ht.bind(null,t),np(t,`link`,n),Vt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+cn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+cn(n.href)+`"]`);if(r)return t.instance=r,Vt(r),r;var i=S({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Vt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var o=e.querySelector(Fm(i));if(o)return t.state.loading|=4,t.instance=o,Vt(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),Vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(i=e.querySelector(zm(o)))?(t.instance=i,Vt(i),i):(r=n,(i=vm.get(o))&&(r=S({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Vt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[M]||a[kt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Vt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:le,Provider:null,Consumer:null,_currentValue:O,_currentValue2:O,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ii(3,null,null,t),e.current=a,a.stateNode=e,t=Fa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},vo(a),e}function uh(e){return e?(e=Pi,e):Pi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=bo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=xo(e,r,t),n!==null&&(Pd(n,e,t),So(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=ji(e,67108864);t!==null&&Pd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=jd();t=wt(t);var n=ji(e,t);n!==null&&Pd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=2,yh(e,t,n,r)}finally{D.p=a,E.T=i}}function vh(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=8,yh(e,t,n,r)}finally{D.p=a,E.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Rt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ft(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-at(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(W&6)&&(_d=qe()+500,Df(0,!1))}}break;case 31:case 13:s=ji(a,2),s!==null&&Pd(s,a,2),zd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=wn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Lt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Je()){case Ye:return 2;case Xe:return 8;case Ze:case Qe:return 32;case $e:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Rt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Lt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Cn=r,n.target.dispatchEvent(r),Cn=null}else return t=Rt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Rt(n);a!==null&&(e.splice(t,3),t-=3,rc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[At]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[At]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;dh(n,jd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),zd(),t[jt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=r.version;if(Kh!==`19.3.1`)throw Error(a(527,Kh,`19.3.1`));D.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:E,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{nt=Jh.inject(qh),rt=Jh}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=Ec,o=Dc,c=Oc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,o,c,Uh),e[jt]=t.current,Wf(e),new Wh(t)},e.hydrateRoot=function(e,t,n){if(!s(e))throw Error(a(299));var r=!1,i=``,o=Ec,c=Dc,l=Oc,u=null;return n!=null&&(!0===n.unstable_strictMode&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(c=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=lh(e,1,!0,t,n??null,r,i,u,o,c,l,Uh),t.context=uh(null),n=t.current,r=jd(),r=wt(r),i=bo(r),i.callback=null,xo(n,i,r),n=r,t.current.lanes=n,yt(t,n),Ef(t),e[jt]=t.current,Wf(e),new Gh(t)},e.version=`19.3.1`})),ke=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Oe()})),Ae={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};Ae.node;var je=r(Ae),Me={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};Me.node;var Ne=r(Me),Pe={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};Pe.node;var Fe=r(Pe),Ie={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};Ie.node;var Le=r(Ie),Re={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};Re.node;var ze=r(Re),Be={name:`book-text`,size:24,node:[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}],[`path`,{d:`M8 11h8`,key:`vwpz6n`}],[`path`,{d:`M8 7h6`,key:`1f0q6e`}]]};Be.node;var Ve=r(Be),He={name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]};He.node;var Ue=r(He),We={name:`calendar-range`,size:24,node:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M17 13h-6`,key:`1qbiup`}],[`path`,{d:`M13 17H7`,key:`1x38vv`}],[`path`,{d:`M7 13h.01`,key:`1vezk1`}],[`path`,{d:`M17 17h.01`,key:`1sd3ek`}]]};We.node;var Ge=r(We),Ke={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Ke.node;var qe=r(Ke),Je={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Je.node;var Ye=r(Je),Xe={name:`crosshair`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]};Xe.node;var Ze=r(Xe),Qe={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Qe.node;var $e=r(Qe),et={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};et.node;var tt=r(et),nt={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};nt.node;var rt=r(nt),it={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};it.node;var at=r(it),ot={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};ot.node;var st=r(ot),ct={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};ct.node;var lt=r(ct),ut={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};ut.node;var dt=r(ut),ft={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};ft.node;var pt=r(ft),mt={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};mt.node;var ht=r(mt),gt={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};gt.node;var _t=r(gt),vt={name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]};vt.node;var yt=r(vt),bt={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};bt.node;var xt=r(bt),St={name:`sun-moon`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715`,key:`xlf6rm`}],[`path`,{d:`M16 12a4 4 0 0 0-4-4`,key:`6vsxu`}],[`path`,{d:`m19 5-1.256 1.256`,key:`1yg6a6`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}]]};St.node;var Ct=r(St),wt={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};wt.node;var Tt=r(wt),Et={name:`timer`,size:24,node:[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]};Et.node;var Dt=r(Et),Ot={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Ot.node;var kt=r(Ot),At={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};At.node;var jt=r(At),Mt={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Mt.node;var Nt=r(Mt),Pt=e(o(),1),Ft=e(ke(),1),M=e(n(),1),N=e(i(),1),It=(e,t,n)=>({key:e,view:e,label:t,icon:n,href:p(e)}),Lt=[It(`overview`,`Overview`,(0,N.jsx)(rt,{})),It(`requests`,`Requests`,(0,N.jsx)(je,{})),It(`logs`,`Logs`,(0,N.jsx)(yt,{})),It(`apis`,`APIs`,(0,N.jsx)(ze,{})),It(`docs`,`Docs`,(0,N.jsx)(Ve,{})),It(`workflows`,`Workflows`,(0,N.jsx)(jt,{})),It(`schedules`,`Schedules`,(0,N.jsx)(Ue,{})),It(`errors`,`Errors`,(0,N.jsx)(kt,{})),It(`reloads`,`Reloads`,(0,N.jsx)(ht,{}))];function Rt({nav:e,current:t,sidebar:n,errorCount:r,hasNewErrors:i,hasDocs:a,hasWorkflows:o,hasSchedules:s,production:c}){if(!n.visible)return null;let{expanded:d,desktop:f}=n;return(0,N.jsxs)(N.Fragment,{children:[!f&&(0,N.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-40 bg-background/60 backdrop-blur-sm`,onClick:n.close}),(0,N.jsxs)(`nav`,{"aria-label":`Dashboard`,"data-expanded":d,className:b(`flex shrink-0 flex-col gap-1 overflow-hidden border-r bg-background p-2 transition-[width] duration-200`,f?`sticky top-0 h-screen`:`fixed inset-y-0 left-0 z-50 h-screen shadow-xl`,d?`w-52`:`w-12`),children:[(0,N.jsxs)(`div`,{className:`mb-2 flex h-8 items-center gap-2 px-1.5 whitespace-nowrap [&_svg]:size-[18px] [&_svg]:shrink-0`,children:[(0,N.jsx)(Le,{}),d&&(0,N.jsx)(`span`,{className:`font-semibold`,children:c?`Brick`:`Brick dev`})]}),(0,N.jsx)(u,{name:`sidebar.header`,expanded:d}),e.filter(e=>(e.view!==`docs`||a)&&(e.view!==`workflows`||o)&&(e.view!==`schedules`||s)).map((e,a,o)=>{let s=e.view===`errors`&&r>0,c=e.section!==void 0&&e.section!==o[a-1]?.section?d?(0,N.jsx)(`div`,{className:`mt-3 mb-1 truncate px-2 text-xs font-medium text-muted-foreground`,children:e.section}):(0,N.jsx)(Te,{className:`my-2`}):null,u=(0,N.jsxs)(`a`,{href:e.href,...e.external?{target:`_blank`,rel:`noreferrer`}:{},"aria-label":e.label,"aria-current":e.key===t?`page`:void 0,onClick:f?void 0:n.close,className:b(`relative flex h-8 items-center gap-2 rounded-lg text-sm font-medium whitespace-nowrap text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-[current=page]:bg-muted aria-[current=page]:text-foreground [&_svg]:size-4 [&_svg]:shrink-0`,d?`px-2`:`w-8 justify-center`),children:[e.icon,d&&(0,N.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),d&&s&&(0,N.jsx)(l,{variant:i?`destructive`:`outline`,children:r}),!d&&e.view===`errors`&&i&&(0,N.jsx)(`span`,{className:`absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive`})]});return(0,N.jsxs)(M.Fragment,{children:[c,d?(0,N.jsx)(`div`,{children:u}):(0,N.jsxs)(ye,{children:[(0,N.jsx)(oe,{render:u}),(0,N.jsx)(he,{side:`right`,children:e.label})]})]},e.key)}),(0,N.jsx)(`div`,{className:`mt-auto`,children:(0,N.jsx)(u,{name:`sidebar.footer`,expanded:d})})]})]})}var zt={light:(0,N.jsx)(Tt,{}),dark:(0,N.jsx)(st,{}),system:(0,N.jsx)(Ct,{})};function Bt({current:e,connected:t,hasNewErrors:n,theme:r,canRestart:i,production:a,sidebarOpen:o,onSidebar:s,onSearch:c,onTheme:d,onRestart:f}){return(0,N.jsxs)(`header`,{className:`sticky top-0 z-30 flex h-14 shrink-0 items-center justify-between gap-2 border-b bg-background/95 px-6 backdrop-blur-sm supports-backdrop-filter:bg-background/50 max-sm:px-4`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsxs)(ye,{children:[(0,N.jsx)(oe,{render:(0,N.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`Toggle sidebar`,"aria-expanded":o,onClick:s}),children:(0,N.jsx)(lt,{})}),(0,N.jsxs)(he,{side:`bottom`,children:[`Toggle sidebar `,(0,N.jsx)(j,{children:`⌘B`})]})]}),(0,N.jsx)(Te,{orientation:`vertical`,className:`mr-1 h-4 self-center`}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2 font-medium [&_svg]:size-3.5 [&_svg]:text-muted-foreground`,children:[e?.icon,(0,N.jsx)(`span`,{children:e?.label})]}),(0,N.jsx)(u,{name:`topbar.start`})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(u,{name:`topbar.end`}),a&&(0,N.jsx)(l,{variant:`outline`,children:`Production`}),(0,N.jsxs)(`span`,{role:`status`,className:`mr-1 inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,N.jsx)(`i`,{className:b(`size-1.5 rounded-full`,t?`animate-pulse bg-positive`:`bg-destructive`)}),(0,N.jsx)(`span`,{className:`max-sm:hidden`,children:t?`Live`:`Reconnecting`})]}),(0,N.jsxs)(A,{variant:`outline`,className:`gap-3 pr-1 pl-2`,onClick:c,"aria-label":`Search requests`,children:[(0,N.jsx)(xt,{}),(0,N.jsx)(j,{className:`max-sm:hidden`,children:`/`})]}),(0,N.jsxs)(A,{variant:`outline`,size:`icon`,className:`relative`,"aria-label":`Open errors`,onClick:()=>{location.hash=p(`errors`)},children:[(0,N.jsx)(Fe,{}),n&&(0,N.jsx)(`span`,{className:`absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive`})]}),(0,N.jsx)(A,{variant:`outline`,size:`icon`,onClick:d,"aria-label":`Theme: ${r}`,title:`Theme: ${r}`,children:zt[r]}),i&&(0,N.jsxs)(A,{variant:`outline`,onClick:f,children:[(0,N.jsx)(_t,{}),`Restart app`]})]})]})}function Vt({page:e,context:t}){if(e.url!==void 0)return(0,N.jsx)(`iframe`,{title:e.label,src:e.url,className:`h-[calc(100svh-3.5rem)] w-full border-0`});let n=e.component;return(0,N.jsx)(m,{name:`page "${e.id}"`,children:(0,N.jsx)(n,{...t,path:t.route.path})})}var Ht={debug:`text-muted-foreground`,info:`text-foreground`,warn:`text-amber-600 dark:text-amber-400`,error:`text-destructive`};function Ut({level:e}){return(0,N.jsx)(`span`,{className:b(`font-mono text-[10px] font-semibold uppercase`,Ht[e]),children:e})}function Wt(e){let t=e.httpStatus??0;return e.status===`error`||t>=500?`server`:t>=400?`client`:`ok`}function Gt(e){return e.method&&e.route?`${e.method} ${e.route}`:e.name}function Kt(e){let{spans:t,...n}=e;return{...n,endpoint:Gt(e)}}function qt(e){let t=new URLSearchParams({from:String(e.from),to:String(e.to)});for(let n of e.endpoints??[])t.append(`endpoint`,n);for(let n of e.methods??[])t.append(`method`,n);for(let n of e.services??[])t.append(`service`,n);for(let n of e.outcomes??[])t.append(`outcome`,n);return e.minMs!==void 0&&t.set(`minMs`,String(e.minMs)),e.query&&t.set(`q`,e.query),e.sort&&e.sort!==`recent`&&t.set(`sort`,e.sort),e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.offset!==void 0&&t.set(`offset`,String(e.offset)),t}var Jt=[`endpoint`,`path`,`name`,`action`,`message`];function Yt(e,t,n){let r=(e,t,r)=>n===e||!t?.length||r!==void 0&&t.includes(r);if(!r(`endpoint`,t.endpoints,e.endpoint)||!r(`method`,t.methods,e.method)||!r(`service`,t.services,e.service)||!r(`outcome`,t.outcomes,Wt(e))||t.minMs!==void 0&&t.minMs>0&&(e.durationMs??0)<t.minMs)return!1;let i=t.query?.trim().toLowerCase();return!i||Jt.some(t=>String(e[t]??``).toLowerCase().includes(i))}function Xt(e){return e===`slowest`?(e,t)=>(t.durationMs??0)-(e.durationMs??0)||t.startMs-e.startMs:(e,t)=>t.startMs-e.startMs}function P(e,t){return e.filter(e=>Yt(e,t)).sort(Xt(t.sort))}var Zt={outcome:Wt,method:e=>e.method,service:e=>e.service,endpoint:e=>e.endpoint};function Qt(e,t){let n=n=>{let r=new Map;for(let i of e){if(!Yt(i,t,n))continue;let e=Zt[n](i);e!==void 0&&r.set(e,(r.get(e)??0)+1)}return[...r.entries()].map(([e,t])=>({value:e,count:t})).sort((e,t)=>t.count-e.count||(e.value<t.value?-1:+(e.value>t.value))).slice(0,30)};return{outcome:n(`outcome`),method:n(`method`),service:n(`service`),endpoint:n(`endpoint`)}}var $t=(e,t,n)=>Math.max(Math.ceil((t-e)/n),1);function en(e,t,n,r){let i=$t(t,n,r),a=Array.from({length:r},(e,n)=>({start:t+n*i,ok:0,client:0,server:0}));for(let o of e){if(o.startMs<t||o.startMs>n)continue;let e=Math.floor((o.startMs-t)/i);a[Math.min(e,r-1)][Wt(o)]+=1}return a}function tn(e,t){if(e.length===0)return 0;let n=(e.length-1)*t,r=Math.floor(n),i=Math.ceil(n);return e[r]+(e[i]-e[r])*(n-r)}function nn(e){let t=0,n=0,r=[];for(let i of e){let e=Wt(i);e===`client`&&(t+=1),e===`server`&&(n+=1),i.durationMs!==void 0&&r.push(i.durationMs)}return r.sort((e,t)=>e-t),{total:e.length,clientErrors:t,serverErrors:n,medianMs:tn(r,.5),p95Ms:tn(r,.95)}}var rn=[`time`,`method`,`route`,`path`,`status`,`outcome`,`duration_ms`,`service`,`action`,`message`,`trace_id`];function an(e){if(e===void 0)return``;let t=String(e),n=/^[=+\-@\t\r]/.test(t)?`'${t}`:t;return/[",\n\r]/.test(n)?`"${n.replace(/"/g,`""`)}"`:n}function on(e){let t=e.map(e=>[new Date(e.startMs).toISOString(),e.method,e.route,e.path,e.httpStatus??e.status,Wt(e),e.durationMs===void 0?void 0:e.durationMs.toFixed(3),e.service,e.action,e.message,e.traceId].map(an).join(`,`));return[rn.join(`,`),...t].join(`
|
|
11
11
|
`)+`
|
|
12
12
|
`}function sn(e,t){let n=e?.[t];return typeof n==`string`?n:void 0}function cn(e){return e.find(e=>e.name===ie.exceptionEvent)?.attributes}function ln(e){return Wt(e)!==`ok`}function F(e){return e===void 0?`running`:e<1?`${e.toFixed(2)} ms`:e<100?`${e.toFixed(1).replace(/\.0$/,``)} ms`:e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(2)} s`}function un(e,t){let n=new Date(e),r=String(n.getMilliseconds()).padStart(3,`0`).slice(0,2),i=`${n.toLocaleTimeString([],{hour12:!1})}.${r}`;return t?`${n.toLocaleDateString([],{month:`short`,day:`numeric`})} ${i}`:i}function dn(e){return new Date(e).toLocaleTimeString([],{hour12:!1})}function fn(e){return new Date(e).toLocaleString([],{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function pn(e,t){return t<=1296e5?new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hour12:!1}):new Date(e).toLocaleDateString([],{month:`short`,day:`numeric`})}function mn(e){return`${(e*100).toFixed(1).replace(/\.0$/,``)}%`}function hn(e){return e>=1e4?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function gn(e){return e.attributes[C.dbStatement]===void 0?e.name.startsWith(ie.actionPrefix)?`action`:e.name.startsWith(ie.rpcPrefix)?`rpc`:e.attributes[C.httpRoute]===void 0?`other`:`http`:`sql`}function _n(e){let t=new Map(e.map(e=>[e.spanId,e.parentSpanId])),n=new Map,r=e=>{let i=n.get(e);if(i!==void 0)return i;let a=t.get(e),o=a!==void 0&&t.has(a)?r(a)+1:0;return n.set(e,o),o};for(let t of e)r(t.spanId);return n}var vn=e=>e.endMs===void 0?0:e.endMs-e.startMs;function yn(e){let t=e.spans.filter(e=>gn(e)===`sql`),n=t.map(vn),r;for(let t of e.spans){let e=cn(t.events),n=sn(t.attributes,C.errorCode);if(e||n){r={message:sn(e,C.exceptionMessage)??t.statusMessage,stack:sn(e,C.exceptionStack),code:n,span:t.name};break}}return{action:e.spans.find(e=>gn(e)===`action`),calls:e.spans.filter(e=>gn(e)===`rpc`),queries:{count:t.length,totalMs:n.reduce((e,t)=>e+t,0),slowestMs:Math.max(0,...n)},exception:r}}function bn(e,t){if(!t)return e;let n=(Array.isArray(e.servers)?e.servers:[]).filter(e=>typeof e?.url==`string`).map(e=>{let n=e.url;return n.includes(`{`)?e:{...e,url:new URL(n,`${t}/`).href.replace(/\/$/,``)}});return{...e,servers:n.length>0?n:[{url:t,description:`Dev server`}]}}var xn={query:``,outcomes:[],methods:[],services:[],endpoints:[],sort:`recent`};function Sn(e){return e.query.trim()!==``||e.outcomes.length>0||e.methods.length>0||e.services.length>0||e.endpoints.length>0||e.minMs!==void 0}function Cn(e,t,n){return qt({...t,...e,query:t.query.trim(),...n&&{limit:100,offset:n.offset}})}function wn(e,t=8){let n=e??[],r=Math.ceil(n.length/t)||1,i=e=>Array.from({length:t},(t,i)=>n.slice(i*r,(i+1)*r).reduce((t,n)=>t+e(n),0));return{requests:i(e=>e.ok+e.client+e.server),errors:i(e=>e.client+e.server)}}var Tn=36e5,En=24*Tn,Dn=[{value:`1h`,label:`1H`,ms:Tn,text:`hour`},{value:`24h`,label:`24H`,ms:En,text:`24 hours`},{value:`7d`,label:`7D`,ms:7*En,text:`7 days`},{value:`30d`,label:`30D`,ms:30*En,text:`30 days`},{value:`90d`,label:`90D`,ms:90*En,text:`90 days`}],On=e=>(Dn.find(t=>t.value===e)??Dn[2]).ms;async function kn(e,t){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`${n.status}`);return await n.json()}var An=(e,t,n)=>kn(we(e,t),n);function jn(e,t,n){let[r,i]=(0,M.useState)(()=>{let r=localStorage.getItem(e);return t.includes(r)?r:n});return[r,t=>{localStorage.setItem(e,t),i(t)}]}function Mn(e,t,n){return(0,M.useMemo)(()=>{if(t)return t;let n=Date.now();return{from:n-e,to:n}},[e,t,n])}function Nn(e,t){let n=(0,M.useRef)(!0);(0,M.useEffect)(()=>{if(n.current){n.current=!1;return}let e=setTimeout(t,1500);return()=>clearTimeout(e)},[e,t])}function Pn(e,t,n){let{spanMs:r,fixed:i,enabled:a}=e,[o,s]=(0,M.useState)(0),c=Mn(r,i,o),[l,u]=(0,M.useState)([]),[d,f]=(0,M.useState)(0),[p,m]=(0,M.useState)(),[h,g]=(0,M.useState)(),[_,v]=(0,M.useState)(),[y,b]=(0,M.useState)(a),[x,ee]=(0,M.useState)(!1),te=(0,M.useRef)(0),ne=JSON.stringify(t),re=(0,M.useRef)({window:c,filters:t,key:``});re.current={window:c,filters:t,key:`${c.to}:${ne}`},(0,M.useEffect)(()=>{if(!a)return;let e=new AbortController,{signal:n}=e;b(!0),te.current=0;let r=Cn(c,t);return An(`traces`,Cn(c,t,{offset:0}),n).then(e=>{u(e.traces),f(e.total),b(!1),ee(!1)},()=>{n.aborted||(b(!1),ee(!0))}),An(`facets`,r,n).then(m,()=>{}),An(`volume`,r,n).then(g,()=>{}),An(`summary`,r,n).then(v,()=>{}),()=>e.abort()},[a,c,ne]);let S=(0,M.useCallback)(()=>{let{window:e,filters:t,key:n}=re.current,r=te.current+100;te.current=r,An(`traces`,Cn(e,t,{offset:r}),new AbortController().signal).then(e=>{re.current.key===n&&u(t=>[...t,...e.traces])},()=>ee(!0))},[]),C=(0,M.useCallback)(()=>s(e=>e+1),[]);return Nn(a?n:``,C),{window:c,rows:l,total:d,facets:p,volume:h,summary:_,loading:y,failed:x,more:S,refresh:C}}function Fn(e,t){let[n,r]=(0,M.useState)();return(0,M.useEffect)(()=>{if(!e||!t)return;let n=new AbortController;return kn(pe(e),n.signal).then(t=>r({id:e,trace:t,missing:!1}),()=>{n.signal.aborted||r({id:e,trace:void 0,missing:!0})}),()=>n.abort()},[e,t]),n&&e!==void 0&&n.id===e?{trace:n.trace,missing:n.missing}:{trace:void 0,missing:!1}}var In=[`debug`,`info`,`warn`,`error`],Ln=ie.logEvent,Rn=/\u001b(?:\[[0-?]*[ -/]*[@-~]|\][^\u0007\u001b]*(?:\u0007|\u001b\\))/g;function zn(e){return In.find(t=>t===e)??`info`}function Bn(e,t,n){let r=[];return t.events.forEach((i,a)=>{i.name===Ln&&r.push({id:`${e.traceId}:${t.spanId}:${a}`,timeMs:i.timeMs,level:zn(i.attributes[C.logLevel]),message:String(i.attributes[C.logMessage]??``).replace(Rn,``),traceId:e.traceId,span:t.name,route:n,method:e.method})}),r}var Vn=e=>(e.route?.includes(`*`)&&e.path?e.path:e.route)??e.name;function Hn(e){let t=Vn(e),n=[],r=0;for(let i of e.spans){n.push(...Bn(e,i,t));let a=i.attributes[C.logsDropped];typeof a==`number`&&(r+=a)}return n.sort((e,t)=>e.timeMs-t.timeMs),{entries:n,dropped:r}}function Un(e,t=1e3){let n=e.flatMap(e=>Hn(e).entries);return n.sort((e,t)=>t.timeMs-e.timeMs),n.slice(0,t)}var Wn=[`level`,`route`,`action`,`method`,`trace`];function Gn(e){let t=[];for(let n of e.match(/-?(?:[a-z]+:)?"[^"]*"|\S+/gi)??[]){let e=n,r=!1;e.length>1&&e.startsWith(`-`)&&(r=!0,e=e.slice(1));let i,a=e.indexOf(`:`);if(a>0){let t=e.slice(0,a).toLowerCase(),n=Wn.find(e=>e===t);n&&(i=n,e=e.slice(a+1))}e=e.replace(/^"/,``).replace(/"$/,``),e&&t.push({field:i,value:e.toLowerCase(),negate:r})}return t}function Kn(e,{field:t,value:n}){switch(t){case`level`:return n.split(`,`).includes(e.level);case`route`:return e.route.toLowerCase().includes(n);case`action`:return e.span.toLowerCase().includes(n);case`method`:return e.method?.toLowerCase()===n;case`trace`:return e.traceId.toLowerCase().startsWith(n);default:return`${e.message} ${e.route} ${e.span}`.toLowerCase().includes(n)}}function qn(e,t){return t.length===0?e:e.filter(e=>t.every(t=>Kn(e,t)!==t.negate))}function Jn(e){let t={debug:0,info:0,warn:0,error:0};for(let n of e)t[n.level]++;return t}function Yn(e){return e.filter(e=>!e.field&&!e.negate).map(e=>e.value)}function Xn(e,t){let n=[...new Set(t)].sort((e,t)=>t.length-e.length).slice(0,8).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`));return n.length===0?[{text:e,hit:!1}]:e.split(RegExp(`(${n.join(`|`)})`,`gi`)).map((e,t)=>({text:e,hit:t%2==1})).filter(e=>e.text!==``)}var Zn=2e3,Qn=150,$n=240,er=[{value:`all`,label:`All`,ms:1/0},{value:`5m`,label:`5m`,ms:3e5},{value:`15m`,label:`15m`,ms:9e5},{value:`1h`,label:`1h`,ms:36e5}],tr=er.map(e=>e.value),nr=`brick-dashboard-logs-levels`;function rr(){let[e,t]=(0,M.useState)(()=>{let e=localStorage.getItem(nr);return e===null?new Set(In):new Set(In.filter(t=>e.split(`,`).includes(t)))});return[e,e=>{localStorage.setItem(nr,[...e].join(`,`)),t(e)}]}function ir(e,t){let n=e.trim().split(/\s+/).filter(Boolean);return n.includes(t)?e:[...n,t].join(` `)}function ar({text:e,terms:t}){return(0,N.jsx)(N.Fragment,{children:Xn(e,t).map((e,t)=>e.hit?(0,N.jsx)(`mark`,{className:`rounded-[2px] bg-amber-300/70 px-px text-inherit dark:bg-amber-400/40`,children:e.text},t):e.text)})}function or({label:e,onClick:t,href:n,children:r}){let i=`grid size-6 cursor-pointer place-items-center rounded-md text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 [&_svg]:size-3.5`;return n?(0,N.jsx)(`a`,{href:n,"aria-label":e,title:e,className:i,children:r}):(0,N.jsx)(`button`,{type:`button`,"aria-label":e,title:e,onClick:t,className:i,children:r})}function sr({entry:e,terms:t,onOnlyRequest:n}){let[r,i]=(0,M.useState)(!1),[o,s]=(0,M.useState)(!1),c=e.message.length>$n||e.message.split(`
|
|
13
|
-
`).length>3;return(0,N.jsxs)(`div`,{className:`group relative grid grid-cols-[104px_44px_minmax(0,1fr)_minmax(0,200px)] items-baseline gap-3 border-b px-4 py-2 last:border-b-0 hover:bg-muted/40 max-md:grid-cols-[96px_44px_minmax(0,1fr)]`,children:[(0,N.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground tabular-nums`,children:un(e.timeMs,!1)}),(0,N.jsx)(Ut,{level:e.level}),(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsx)(`div`,{className:b(`font-mono text-xs leading-[18px] [overflow-wrap:anywhere] whitespace-pre-wrap`,c&&!r&&`line-clamp-3`),children:(0,N.jsx)(ar,{text:e.message,terms:t})}),c&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>i(!r),className:`mt-0.5 cursor-pointer text-xs text-muted-foreground underline-offset-4 hover:text-foreground hover:underline`,children:r?`Show less`:`Show more`})]}),(0,N.jsxs)(`div`,{className:`min-w-0 max-md:hidden`,children:[(0,N.jsxs)(`div`,{className:`truncate text-xs text-muted-foreground`,children:[e.method?`${e.method} `:``,e.route]}),(0,N.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground/70`,children:e.span})]}),(0,N.jsxs)(`div`,{className:`absolute top-1.5 right-2 flex items-center gap-0.5 rounded-md border bg-background p-0.5 opacity-0 shadow-xs group-focus-within:opacity-100 group-hover:opacity-100`,children:[(0,N.jsx)(or,{label:o?`Copied`:`Copy this line`,onClick:()=>{navigator.clipboard?.writeText(e.message),s(!0),setTimeout(()=>s(!1),1200)},children:o?(0,N.jsx)(a,{}):(0,N.jsx)(Ye,{})}),(0,N.jsx)(or,{label:`Only lines of this request`,onClick:()=>n(e.traceId),children:(0,N.jsx)(Ze,{})}),(0,N.jsx)(or,{label:`Open the request`,href:p(`requests`,e.traceId),children:(0,N.jsx)(Ne,{})})]})]})}function cr({traces:e}){let t=(0,M.useMemo)(()=>Un(e,Zn),[e]),[n,r]=(0,M.useState)(),i=n??t,a=(0,M.useMemo)(()=>{if(!n)return 0;let e=new Set(n.map(e=>e.id));return t.filter(t=>!e.has(t.id)).length},[n,t]),[o,s]=(0,M.useState)(``),[l,u]=rr(),[d,f]=jn(`brick-dashboard-logs-since`,tr,`all`),[p,m]=(0,M.useState)(Qn),h=te(d!==`all`&&!n,5e3)-(er.find(e=>e.value===d)?.ms??1/0),g=(0,M.useMemo)(()=>d===`all`?i:i.filter(e=>e.timeMs>=h),[i,d,h]),_=(0,M.useMemo)(()=>Gn(o),[o]),v=(0,M.useMemo)(()=>qn(g,_),[g,_]),y=(0,M.useMemo)(()=>Jn(v),[v]),b=(0,M.useMemo)(()=>v.filter(e=>l.has(e.level)),[v,l]),x=(0,M.useMemo)(()=>Yn(_),[_]),ee=o.trim()!==``||l.size<In.length,ne=e=>{s(e),m(Qn)},S=()=>{ne(``),u(new Set(In)),f(`all`)};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(c,{title:`Logs`,description:`What actions and tools log, newest first`,actions:(0,N.jsxs)(A,{variant:`outline`,"aria-pressed":n!==void 0,onClick:()=>r(n?void 0:t),children:[n?(0,N.jsx)(pt,{}):(0,N.jsx)(dt,{}),n?a>0?`Resume (${hn(a)} new)`:`Resume`:`Pause`]})}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsxs)(`div`,{className:`relative min-w-60 flex-1`,children:[(0,N.jsx)(xt,{className:`pointer-events-none absolute top-2.5 left-2.5 size-3.5 text-muted-foreground`}),(0,N.jsx)(re,{type:`search`,value:o,placeholder:`Search: words, "exact phrase", level:error, route:/api, trace:2ef0…`,"aria-label":`Search logs`,className:`pr-8 pl-8 [&::-webkit-search-cancel-button]:hidden`,onChange:e=>ne(e.target.value),onKeyDown:e=>{e.key===`Escape`&&ne(``)}}),o&&(0,N.jsx)(`button`,{type:`button`,"aria-label":`Clear search`,onClick:()=>ne(``),className:`absolute top-1.5 right-1.5 grid size-5 cursor-pointer place-items-center rounded-sm text-muted-foreground hover:text-foreground`,children:(0,N.jsx)(Nt,{className:`size-3.5`})})]}),(0,N.jsx)(se,{variant:`outline`,spacing:2,"aria-label":`How far back`,value:[d],onValueChange:e=>{let t=tr.find(t=>t===e[0]);t&&(f(t),m(Qn))},children:er.map(e=>(0,N.jsx)(ae,{value:e.value,children:e.label},e.value))}),(0,N.jsx)(se,{multiple:!0,variant:`outline`,spacing:2,"aria-label":`Levels`,value:[...l],onValueChange:e=>{u(new Set(In.filter(t=>e.includes(t)))),m(Qn)},children:In.map(e=>(0,N.jsxs)(ae,{value:e,className:`gap-1.5`,children:[(0,N.jsx)(`span`,{className:`capitalize`,children:e}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:hn(y[e])})]},e))})]}),(0,N.jsxs)(`p`,{className:`-mt-2 text-xs text-muted-foreground`,children:[`Words must all appear; `,(0,N.jsx)(`code`,{className:`font-mono`,children:`"in quotes"`}),` is an exact phrase; `,(0,N.jsx)(`code`,{className:`font-mono`,children:`-word`}),` leaves lines out. Fields: `,(0,N.jsx)(`code`,{className:`font-mono`,children:`level:`}),` `,(0,N.jsx)(`code`,{className:`font-mono`,children:`route:`}),` `,(0,N.jsx)(`code`,{className:`font-mono`,children:`action:`}),` `,(0,N.jsx)(`code`,{className:`font-mono`,children:`method:`}),` `,(0,N.jsx)(`code`,{className:`font-mono`,children:`trace:`})]}),(0,N.jsx)(k,{children:t.length===0&&!n?(0,N.jsx)(fe,{title:`Nothing logged yet`,hint:`Call ctx.logger.info(…) or console.log(…) in an action or tool, with telemetry on, and send a request that runs it`}):b.length===0?(0,N.jsxs)(`div`,{className:`grid place-items-center gap-3 px-4 py-12 text-center text-sm text-muted-foreground`,children:[(0,N.jsx)(`div`,{children:`No lines match`}),(ee||d!==`all`)&&(0,N.jsx)(A,{variant:`outline`,size:`sm`,onClick:S,children:`Clear search and filters`})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-4 py-2 text-xs text-muted-foreground`,children:[(0,N.jsxs)(`span`,{children:[b.length===i.length?`${hn(b.length)} lines`:`${hn(b.length)} of ${hn(i.length)} lines`,i.length===Zn&&` (the newest ${hn(Zn)})`]}),n&&(0,N.jsx)(`span`,{children:`Paused: the list is not following new lines`})]}),b.slice(0,p).map(e=>(0,N.jsx)(sr,{entry:e,terms:x,onOnlyRequest:e=>ne(ir(o,`trace:${e.slice(0,8)}`))},e.id)),b.length>p&&(0,N.jsx)(`div`,{className:`flex justify-center border-t p-2`,children:(0,N.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>m(p+Qn),children:[`Show `,hn(Math.min(Qn,b.length-p)),` more of `,hn(b.length-p)]})})]})})]})}var lr=`modulepreload`,ur=function(e){return`/assets/`+e},dr={},fr=function(e){return e.pathname.endsWith(`.css`)},pr=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},mr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)},a,o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{e=ur(e,n);let t=i(e),r=fr(t);return pr(dr,t.href,()=>{if(a===void 0){a={all:new Set,styles:new Set};let e=document.getElementsByTagName(`link`);for(let t=e.length-1;t>=0;t--){let n=e[t];a.all.add(n.href),n.rel===`stylesheet`&&a.styles.add(n.href)}}if((r?a.styles:a.all).has(t.href))return;let e=document.createElement(`link`);if(e.rel=r?`stylesheet`:lr,r||(e.as=`script`),e.crossOrigin=``,e.href=t.href,s&&e.setAttribute(`nonce`,s),document.head.appendChild(e),r)return new Promise((n,r)=>{e.addEventListener(`load`,n),e.addEventListener(`error`,()=>r(Error(`Unable to preload CSS for ${t}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},hr=(0,M.lazy)(()=>mr(()=>import(`./api-reference-lLhahVJi.js`),__vite__mapDeps([0,1,2,3,4,5,6])));function gr(e){let[t,n]=(0,M.useState)([]);return(0,M.useEffect)(()=>{if(e===void 0)return;let t=new AbortController;return fetch(T.openapi.path,{signal:t.signal}).then(e=>e.json()).then(n,()=>{}),()=>t.abort()},[e]),t}function _r(e){let t=(0,M.useRef)(0);(0,M.useLayoutEffect)(()=>{if(e)return;window.scrollTo(0,t.current);let n=()=>{t.current=window.scrollY};return window.addEventListener(`scroll`,n,{passive:!0}),()=>window.removeEventListener(`scroll`,n)},[e])}function vr({api:e,route:t,traces:n,failures:r,hidden:i}){let a=gr(e?.revision);_r(i),(0,M.useEffect)(()=>{i&&document.dispatchEvent(new KeyboardEvent(`keydown`,{key:`Escape`,bubbles:!0}))},[i]);let o=(0,M.useRef)(t.path);return!i&&t.path.length>0&&(o.current=t.path),(0,N.jsx)(`div`,{className:b(`min-h-[calc(100svh-3.5rem)]`,i&&`hidden`),children:e&&e.titles.length===0?(0,N.jsx)(fe,{title:`No API documents to show`,hint:`The app serves none: docs is false, and reference.documents is empty`}):a.length===0?(0,N.jsx)(fe,{title:e?`Loading API documents`:`Waiting for the app to start`}):(0,N.jsx)(M.Suspense,{fallback:(0,N.jsx)(fe,{title:`Loading API reference`}),children:(0,N.jsx)(hr,{documents:a,appUrl:e?.appUrl,path:o.current,traces:n,failures:r})})})}function yr({failures:e,traces:t,canLookBack:n}){return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(c,{title:`Errors`,description:`Failed requests, startup failures, and crashes, newest first`}),e.length===0?(0,N.jsx)(k,{children:(0,N.jsx)(fe,{title:`No errors recorded`})}):(0,N.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.map(e=>{let r=e.traceId!==void 0&&(n||t.some(t=>t.traceId===e.traceId)),i=[e.route,e.service&&e.action?`${e.service}.${e.action}`:void 0].filter(Boolean).join(` · `);return(0,N.jsx)(k,{children:(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`font-semibold text-destructive`,children:e.code}),e.status!==void 0&&(0,N.jsxs)(l,{variant:`destructive`,children:[`HTTP `,e.status]}),(0,N.jsx)(l,{variant:`outline`,children:e.phase}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:dn(e.at)})]}),(0,N.jsx)(`div`,{className:`[overflow-wrap:anywhere]`,children:e.message}),i&&(0,N.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:i}),r&&e.traceId&&(0,N.jsx)(`a`,{href:p(`requests`,e.traceId),className:b(y({variant:`outline`,size:`sm`}),`self-start`),children:`Open request`}),e.stack&&(0,N.jsxs)(`details`,{children:[(0,N.jsx)(`summary`,{className:`cursor-pointer text-xs text-muted-foreground`,children:`Stack trace`}),(0,N.jsx)(`pre`,{className:`mt-2 overflow-auto border bg-muted/50 p-3 font-mono text-xs leading-[18px] [overflow-wrap:anywhere] whitespace-pre-wrap`,children:e.stack})]})]})},e.id)})})]})}var br=()=>({calls:0,failures:0,timed:0,totalMs:0,lastAt:-1/0,lastFailed:!1});function xr(e,t,n,r){e.calls+=1,r&&(e.failures+=1),n!==void 0&&(e.timed+=1,e.totalMs+=n-t),t>=e.lastAt&&(e.lastAt=t,e.lastFailed=r)}var Sr=e=>e.timed===0?void 0:e.totalMs/e.timed,Cr=e=>e.calls===0?`idle`:e.lastFailed?`failing`:`ok`;function wr(e,t){let n=e.parentSpanId===void 0?void 0:t.get(e.parentSpanId);for(let e=0;n&&e<64;e++){let e=gn(n);if(e===`action`||e===`rpc`)return sn(n.attributes,C.service);n=n.parentSpanId===void 0?void 0:t.get(n.parentSpanId)}}var Tr=(e,t)=>`${hn(e)} ${t}${e===1?``:`s`}`;function Er(e,t){let n=e?.schema.services??[],r=n.flatMap(e=>(e.sockets??[]).map(t=>({...t,service:e.name,id:`socket:${e.name}/${t.name}`}))),i=n.map(e=>e.name),a=new Map,o=new Map;for(let e of n){let t=e.databaseConfig;if(!t)continue;let n=t.name??`${e.name} db`,r=`db:${n}`;o.set(e.name,r),a.set(r,{id:r,label:n,engine:t.engine,tables:t.tables.length})}let s=new Map,c=new Map,l=br(),u=new Map,d=(e,t)=>{let n=e.get(t);return n||e.set(t,n=br()),n},f=(e,t,n)=>{let r=`${t}->${n}`,i=u.get(r);return i||(i={id:r,kind:e,from:t,to:n,calls:0,avgMs:void 0,activity:br()},u.set(r,i)),i.activity};for(let e of n){e.actions.some(e=>e.method&&e.path)&&f(`request`,`client`,`service:${e.name}`);let t=o.get(e.name);t&&f(`sql`,`service:${e.name}`,t)}for(let e of r)f(`websocket`,`client`,e.id),f(`websocket`,e.id,`service:${e.service}`);let p=e?.schema.events;if(p&&p.recorders.length>0){for(let e of p.recorders)f(`event`,`service:${e}`,`events`);for(let e of p.listeners)f(`event`,`events`,`listener:${e.name}`)}for(let e of t){xr(l,e.startMs,e.endMs,e.status===`error`);let t=new Map(e.spans.map(e=>[e.spanId,e]));for(let n of e.spans){let e=gn(n),r=n.status===`error`;if(e===`action`){let e=sn(n.attributes,C.service);if(!e)continue;i.includes(e)||i.push(e),xr(d(s,e),n.startMs,n.endMs,r),xr(f(`request`,`client`,`service:${e}`),n.startMs,n.endMs,r)}else if(e===`rpc`){let e=sn(n.attributes,C.service);if(!e)continue;i.includes(e)||i.push(e),xr(d(s,e),n.startMs,n.endMs,r);let a=wr(n,t);a&&a!==e&&(i.includes(a)||i.push(a),xr(f(`rpc`,`service:${a}`,`service:${e}`),n.startMs,n.endMs,r))}else if(e===`sql`){let e=wr(n,t);if(!e)continue;i.includes(e)||i.push(e);let s=o.get(e)??`db:${e} db`;a.has(s)||a.set(s,{id:s,label:`${e} db`,engine:sn(n.attributes,C.dbSystem)??`database`,tables:0}),xr(d(c,s),n.startMs,n.endMs,r),xr(f(`sql`,`service:${e}`,s),n.startMs,n.endMs,r)}}}let m=[];(t.length>0||[...u.values()].some(e=>e.from===`client`))&&m.push({id:`client`,kind:`client`,label:`Clients`,caption:l.calls?Tr(l.calls,`request`):`no traffic`,metric:Dr(Sr(l)),detail:r.length?`HTTP and WebSocket clients`:`HTTP clients`,health:Cr(l),calls:l.calls,failures:l.failures,avgMs:Sr(l)});for(let e of r)m.push({id:e.id,kind:`socket`,label:`${e.service}.${e.name}`,detail:e.path??`WebSocket route`,caption:`in: ${e.input.join(`, `)||`none`} · out: ${e.output.join(`, `)||`none`}`,metric:``,health:`idle`,calls:0,failures:0,avgMs:void 0});for(let e of i){let t=s.get(e)??br(),r=n.find(t=>t.name===e);m.push({id:`service:${e}`,kind:`service`,label:e,caption:t.calls?Tr(t.calls,`call`):`no traffic`,metric:Dr(Sr(t)),detail:r?[Tr(r.actions.length,`action`),Tr(r.tools?.length??0,`tool`),...r.sockets?.length?[Tr(r.sockets.length,`socket`)]:[]].join(` · `):`Seen in requests`,health:Cr(t),calls:t.calls,failures:t.failures,avgMs:Sr(t)})}for(let e of a.values()){let t=c.get(e.id)??br();m.push({id:e.id,kind:`database`,label:e.label,caption:t.calls?`${hn(t.calls)} ${t.calls===1?`query`:`queries`}`:`no queries`,metric:Dr(Sr(t)),detail:e.tables>0?`${e.engine} · ${Tr(e.tables,`table`)}`:e.engine,health:Cr(t),calls:t.calls,failures:t.failures,avgMs:Sr(t)})}if(p&&p.recorders.length>0){m.push({id:`events`,kind:`events`,label:`Events`,caption:Tr(p.listeners.length,`listener`),metric:``,detail:p.dispatch?`outbox · delivering`:`outbox · record only`,health:`idle`,calls:0,failures:0,avgMs:void 0});for(let e of p.listeners)m.push({id:`listener:${e.name}`,kind:`listener`,label:e.name,caption:e.kind,metric:``,detail:`on ${e.on.join(`, `)}`,health:`idle`,calls:0,failures:0,avgMs:void 0})}let h=new Set(m.map(e=>e.id));return{nodes:m,edges:[...u.values()].filter(e=>h.has(e.from)&&h.has(e.to)).map(({activity:e,...t})=>({...t,calls:e.calls,avgMs:Sr(e)}))}}function Dr(e){return e===void 0?``:F(e)}var Or=104,kr=24;function Ar(e){let t=new Map(e.nodes.map(e=>[e.id,e.kind===`client`?0:1]));for(let n=0;n<e.nodes.length;n++){let n=!1;for(let r of e.edges){let i=(t.get(r.from)??0)+1;i>(t.get(r.to)??0)&&i<=e.nodes.length&&(t.set(r.to,i),n=!0)}if(!n)break}let n=Math.min(...t.values(),0),r=new Map;for(let i of e.nodes){let e=(t.get(i.id)??0)-n;r.set(e,[...r.get(e)??[],i])}let i=Math.max(0,...[...r.values()].map(e=>e.length)),a=i===0?0:i*88+(i-1)*kr,o=new Map;for(let[e,t]of r){let n=t.length*88+(t.length-1)*kr;t.forEach((t,r)=>{o.set(t.id,{...t,column:e,x:e*312,y:(a-n)/2+r*112})})}let s=[];for(let t of e.edges){let e=o.get(t.from),n=o.get(t.to);if(!e||!n)continue;let r=e.x+208,i=e.y+44,a=n.x,c=n.y+44,l=Math.max((a-r)/2,24);s.push({...t,path:`M ${r} ${i} C ${r+l} ${i}, ${a-l} ${c}, ${a-2} ${c}`})}let c=Math.max(-1,...r.keys());return{nodes:[...o.values()],edges:s,width:c<0?0:(c+1)*208+c*Or,height:a}}var jr={request:`stroke-span-request`,websocket:`stroke-span-request`,rpc:`stroke-span-rpc`,sql:`stroke-span-sql`,event:`stroke-span-event`},Mr={request:`fill-span-request`,websocket:`fill-span-request`,rpc:`fill-span-rpc`,sql:`fill-span-sql`,event:`fill-span-event`},Nr={request:`Request`,websocket:`WebSocket`,rpc:`Service call`,sql:`SQL`,event:`Event`},Pr={client:`border-l-span-request`,socket:`border-l-span-request`,service:`border-l-span-action`,database:`border-l-span-sql`,events:`border-l-span-event`,listener:`border-l-span-event`},Fr={client:`Client`,socket:`WebSocket`,service:`Service`,database:`Database`,events:`Events`,listener:`Listener`},Ir={ok:`bg-positive`,failing:`bg-destructive`,idle:`bg-muted-foreground/40`},Lr={ok:`Healthy`,failing:`Failing`,idle:`Idle`},Rr=.6;function zr(e){let t=(0,M.useRef)(null),[n,r]=(0,M.useState)(0);return(0,M.useEffect)(()=>{let e=t.current;if(!e)return;let n=()=>{let t=getComputedStyle(e);r(e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight))};n();let i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[]),{ref:t,scale:e===0||n===0?1:Math.min(1,Math.max(Rr,n/e))}}function Br(e){let t=[e.label,e.detail];return e.kind===`socket`&&t.push(e.caption),e.calls>0&&(t.push(e.caption),e.failures>0&&t.push(`${e.failures} failed`),e.avgMs!==void 0&&t.push(`${F(e.avgMs)} average`)),t.join(` · `)}function Vr({architecture:e,traces:t}){let n=(0,M.useMemo)(()=>Ar(Er(e,t)),[e,t]),{ref:r,scale:i}=zr(n.width),[a,o]=(0,M.useState)(),[s,c]=(0,M.useState)(),l=a??s,u=n.nodes.find(e=>e.id===l),d=new Set(l?[l]:[]);if(l)for(let e of n.edges)(e.from===l||e.to===l)&&(d.add(e.from),d.add(e.to));return(0,N.jsxs)(k,{children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4 p-4`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{className:`text-base leading-6 font-semibold`,children:`Service graph`}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Clients, WebSockets, services, databases, and observed calls`})]}),(0,N.jsxs)(`div`,{className:`flex flex-col items-end gap-1 text-xs text-muted-foreground`,children:[(0,N.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1`,children:Object.keys(Lr).map(e=>(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(`i`,{className:b(`size-2`,Ir[e])}),Lr[e]]},e))}),(0,N.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1`,children:Object.keys(Nr).map(e=>(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(`svg`,{width:`14`,height:`6`,"aria-hidden":!0,children:(0,N.jsx)(`line`,{x1:`0`,y1:`3`,x2:`14`,y2:`3`,strokeWidth:`2`,className:jr[e]})}),Nr[e]]},e))})]})]}),n.nodes.length===0?(0,N.jsx)(`div`,{className:`border-t`,children:(0,N.jsx)(fe,{title:`Waiting for the application to start`})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{ref:r,className:`overflow-x-auto border-t bg-[radial-gradient(circle,var(--border)_1px,transparent_1px)] bg-size-[16px_16px] p-6`,children:(0,N.jsx)(`div`,{className:`mx-auto`,style:{width:n.width*i,height:n.height*i},children:(0,N.jsxs)(`div`,{className:`relative origin-top-left`,style:{width:n.width,height:n.height,transform:`scale(${i})`},children:[(0,N.jsxs)(`svg`,{width:n.width,height:n.height,className:`absolute inset-0 overflow-visible`,"aria-hidden":!0,children:[(0,N.jsx)(`defs`,{children:Object.keys(Mr).map(e=>(0,N.jsx)(`marker`,{id:`arrow-${e}`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`8`,markerHeight:`8`,markerUnits:`userSpaceOnUse`,orient:`auto`,children:(0,N.jsx)(`path`,{d:`M0 0 L8 4 L0 8 z`,className:Mr[e]})},e))}),n.edges.map(e=>{let t=!l||e.from===l||e.to===l;return(0,N.jsx)(`path`,{d:e.path,fill:`none`,strokeWidth:1.5+Math.min(Math.log2(e.calls+1)/3,1.5),strokeDasharray:e.calls===0?`4 4`:void 0,markerEnd:`url(#arrow-${e.kind})`,className:b(jr[e.kind],`transition-opacity`,t?e.calls===0?`opacity-40`:`opacity-80`:`opacity-10`),children:(0,N.jsx)(`title`,{children:`${Nr[e.kind]}: ${e.calls===0?`not seen yet`:`${e.calls} call${e.calls===1?``:`s`}${e.avgMs===void 0?``:`, ${F(e.avgMs)} average`}`}`})},e.id)})]}),n.nodes.map(e=>(0,N.jsxs)(`button`,{type:`button`,title:Br(e),"aria-pressed":s===e.id,onClick:()=>c(t=>t===e.id?void 0:e.id),onMouseEnter:()=>o(e.id),onMouseLeave:()=>o(void 0),onFocus:()=>o(e.id),onBlur:()=>o(void 0),className:b(`absolute flex flex-col justify-between border border-l-2 bg-card px-3 py-2 text-left font-mono transition-[opacity,border-color] outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,Pr[e.kind],s===e.id?`border-positive/80`:`hover:border-foreground/40`,l&&!d.has(e.id)&&`opacity-40`),style:{left:e.x,top:e.y,width:208,height:88},children:[(0,N.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,N.jsx)(`i`,{className:b(`size-2.5 shrink-0`,Ir[e.health])}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:e.label}),(0,N.jsx)(`span`,{className:`text-[10px] tracking-wider text-muted-foreground uppercase`,children:Fr[e.kind]})]}),(0,N.jsx)(`span`,{className:`truncate text-xs text-foreground/80`,children:e.detail}),(0,N.jsxs)(`span`,{className:`flex items-baseline justify-between gap-2 border-t border-dashed pt-1.5 text-xs text-muted-foreground tabular-nums`,children:[(0,N.jsx)(`span`,{className:`truncate`,children:e.caption}),(0,N.jsx)(`span`,{children:e.metric})]})]},e.id))]})})}),(0,N.jsx)(`div`,{className:`border-t px-4 py-2 text-xs text-muted-foreground`,children:u?Br(u):`Hover a node to follow its calls. Click one to keep it highlighted.`})]})]})}function Hr({architecture:e,traces:t}){let n=e?.schema.services??[],r=n.flatMap(e=>(e.sockets??[]).map(t=>({...t,service:e.name}))),i=e?.schema.events?.listeners??[],a=n.flatMap(e=>(e.events??[]).map(t=>({...t,service:e.name,fields:Object.keys(t.schema?.properties??{}),listeners:i.filter(e=>e.on.some(e=>e.endsWith(`*`)?t.name.startsWith(e.slice(0,-1)):e===t.name)).map(e=>e.name)}))),o=(0,M.useMemo)(()=>{let e=[];for(let r of n)for(let n of r.actions){if(!n.method||!n.path)continue;let i=`${n.method} ${n.path}`,a=t.filter(e=>e.method!==void 0&&e.route!==void 0&&`${e.method} ${e.route}`===i);e.push({key:i,action:`${r.name}.${n.name}${n.plugin?` · ${n.plugin}`:``}`,requests:a.length,failures:a.filter(ln).length})}return e},[n,t]);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(c,{title:`Overview`,description:`Routes and services of the running app. Counts cover the recent requests kept in memory.`}),(0,N.jsx)(u,{name:`overview.top`}),e?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Vr,{architecture:e,traces:t}),(0,N.jsx)(k,{children:o.length===0?(0,N.jsx)(fe,{title:`No HTTP routes are registered`}):(0,N.jsxs)(Ce,{children:[(0,N.jsx)(ve,{children:(0,N.jsxs)(me,{children:[(0,N.jsx)(w,{className:`px-4`,children:`Route`}),(0,N.jsx)(w,{children:`Action`}),(0,N.jsx)(w,{className:`text-right`,children:`Requests`}),(0,N.jsx)(w,{className:`px-4 text-right`,children:`Failures`})]})}),(0,N.jsx)(S,{children:o.map(e=>(0,N.jsxs)(me,{children:[(0,N.jsx)(O,{className:`px-4 font-mono text-xs`,children:e.key}),(0,N.jsx)(O,{className:`text-muted-foreground`,children:e.action}),(0,N.jsx)(O,{className:`text-right tabular-nums`,children:e.requests}),(0,N.jsx)(O,{className:b(`px-4 text-right tabular-nums`,e.failures>0?`text-destructive`:`text-muted-foreground`),children:e.failures})]},e.key))})]})}),r.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`h2`,{className:`mt-2 -mb-1 text-xs font-medium tracking-wider text-muted-foreground uppercase`,children:`WebSockets`}),(0,N.jsx)(k,{children:(0,N.jsxs)(Ce,{children:[(0,N.jsx)(ve,{children:(0,N.jsxs)(me,{children:[(0,N.jsx)(w,{className:`px-4`,children:`Socket route`}),(0,N.jsx)(w,{children:`Client sends`}),(0,N.jsx)(w,{children:`Server sends`}),(0,N.jsx)(w,{className:`px-4`,children:`Authorization`})]})}),(0,N.jsx)(S,{children:r.map(e=>(0,N.jsxs)(me,{children:[(0,N.jsxs)(O,{className:`px-4`,children:[(0,N.jsxs)(`div`,{className:`font-mono text-xs`,children:[`WS `,e.path??e.name]}),(0,N.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.service,`.`,e.name]}),e.description&&(0,N.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.description})]}),(0,N.jsx)(O,{className:`font-mono text-xs`,children:e.input.join(`, `)||`none`}),(0,N.jsx)(O,{className:`font-mono text-xs`,children:e.output.join(`, `)||`none`}),(0,N.jsx)(O,{className:`px-4 text-muted-foreground`,children:e.hasAuthorize?`Checked on connect and messages`:`No authorize hook`})]},`${e.service}.${e.name}`))})]})})]}),a.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`h2`,{className:`mt-2 -mb-1 text-xs font-medium tracking-wider text-muted-foreground uppercase`,children:`Events`}),(0,N.jsx)(k,{children:(0,N.jsxs)(Ce,{children:[(0,N.jsx)(ve,{children:(0,N.jsxs)(me,{children:[(0,N.jsx)(w,{className:`px-4`,children:`Event`}),(0,N.jsx)(w,{children:`Payload`}),(0,N.jsx)(w,{className:`px-4`,children:`Listeners`})]})}),(0,N.jsx)(S,{children:a.map(e=>(0,N.jsxs)(me,{children:[(0,N.jsxs)(O,{className:`px-4 font-mono text-xs`,children:[e.name,e.plugin&&(0,N.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· `,e.plugin]})]}),(0,N.jsx)(O,{className:`font-mono text-xs`,children:e.fields.join(`, `)||`none`}),(0,N.jsx)(O,{className:`px-4 text-muted-foreground`,children:e.listeners.join(`, `)||`none`})]},e.name))})]})})]}),(0,N.jsx)(`h2`,{className:`mt-2 -mb-1 text-xs font-medium tracking-wider text-muted-foreground uppercase`,children:`Services`}),(0,N.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4`,children:n.map(e=>(0,N.jsx)(k,{children:(0,N.jsxs)(`div`,{className:`flex flex-col gap-1 p-4 text-sm`,children:[(0,N.jsx)(`div`,{className:`font-semibold`,children:e.name}),(0,N.jsx)(`div`,{className:`text-muted-foreground`,children:e.databaseConfig?`${e.databaseConfig.engine} · tables: ${e.databaseConfig.tables.map(t=>{let n=e.databaseConfig?.plugins?.[t];return n?`${t} (${n})`:t}).join(`, `)||`none`}`:`No database`}),(0,N.jsxs)(`div`,{className:`text-muted-foreground`,children:[`Resources:`,` `,(e.resources??[]).map(e=>e.name).join(`, `)||`none`]}),(0,N.jsxs)(`div`,{className:`text-muted-foreground`,children:[`Actions: `,e.actions.length]}),e.sockets&&e.sockets.length>0&&(0,N.jsxs)(`div`,{className:`text-muted-foreground`,children:[`WebSockets: `,e.sockets.length]})]})},e.name))})]}):(0,N.jsx)(k,{children:(0,N.jsx)(fe,{title:`Waiting for the application to start`})})]})}function Ur({reloads:e}){return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(c,{title:`Reloads`,description:`Each time the app started, restarted, or exited`}),(0,N.jsx)(k,{children:e.length===0?(0,N.jsx)(fe,{title:`No reloads yet`}):e.map(e=>(0,N.jsxs)(`div`,{className:`grid min-h-10 grid-cols-[72px_96px_minmax(0,1fr)_auto] items-center gap-3 border-b px-4 py-2 text-sm last:border-b-0`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:dn(e.at)}),(0,N.jsx)(`span`,{className:`font-medium`,children:e.kind}),(0,N.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.detail}),(0,N.jsxs)(l,{variant:`outline`,children:[`Generation `,e.generation]})]},e.id))})]})}var Wr=[{value:`ok`,label:`Succeeded`},{value:`client`,label:`Client error (4xx)`},{value:`server`,label:`Server error (5xx)`}],Gr=[{value:`any`,label:`Any speed`},{value:`100`,label:`100 ms or more`,minMs:100},{value:`500`,label:`500 ms or more`,minMs:500},{value:`1000`,label:`1 s or more`,minMs:1e3}],Kr=8;function qr({title:e,selected:t,children:n,initiallyOpen:r=!0}){let[i,a]=(0,M.useState)(r);return(0,N.jsxs)(`section`,{className:`border-b py-2 last:border-b-0`,children:[(0,N.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex h-8 w-full items-center justify-between gap-2 px-3 text-sm font-medium`,children:[(0,N.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e,t>0&&(0,N.jsx)(`span`,{className:`rounded-full bg-foreground px-1.5 text-[10px] leading-4 text-background tabular-nums`,children:t})]}),(0,N.jsx)(qe,{className:b(`size-3.5 text-muted-foreground transition-transform`,!i&&`-rotate-90`)})]}),i&&(0,N.jsx)(`div`,{className:`px-1 pb-1`,children:n})]})}function Jr({label:e,count:t,checked:n,mono:r,onChange:i}){return(0,N.jsxs)(`label`,{className:`flex min-h-7 cursor-pointer items-center gap-2 rounded-md px-2 text-sm hover:bg-muted/60`,children:[(0,N.jsx)(_e,{checked:n,onCheckedChange:e=>i(!!e)}),(0,N.jsx)(`span`,{className:b(`min-w-0 flex-1 truncate`,r&&`font-mono text-xs`,t===0&&!n&&`text-muted-foreground`),title:e,children:e}),t!==void 0&&(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:hn(t)})]})}function Yr(e,t){let n=new Set(e.map(e=>e.value));return[...e,...t.filter(e=>!n.has(e)).map(e=>({value:e,count:0}))]}function Xr(e,t,n){return n?e.includes(t)?e:[...e,t]:e.filter(e=>e!==t)}function Zr({values:e,selected:t,mono:n,onChange:r}){let[i,a]=(0,M.useState)(!1),o=i?e:e.slice(0,Kr),s=e.slice(Kr).filter(e=>t.includes(e.value)&&!i);return(0,N.jsxs)(N.Fragment,{children:[[...o,...s].map(e=>(0,N.jsx)(Jr,{label:e.value,mono:n,count:e.count,checked:t.includes(e.value),onChange:t=>r(e.value,t)},e.value)),e.length>Kr&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`px-2 py-1 text-xs text-muted-foreground hover:text-foreground`,children:i?`Show fewer`:`Show ${e.length-Kr} more`})]})}function Qr({facets:e,filters:t,onChange:n}){let r=(t,n)=>t?.find(e=>e.value===n)?.count??(e?0:void 0);return(0,N.jsxs)(`div`,{className:`border bg-card`,children:[(0,N.jsxs)(`div`,{className:`flex h-10 items-center justify-between border-b px-3`,children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Filters`}),Sn(t)&&(0,N.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>n({...xn,sort:t.sort}),children:`Clear all`})]}),(0,N.jsx)(qr,{title:`Outcome`,selected:t.outcomes.length,children:Wr.map(i=>(0,N.jsx)(Jr,{label:i.label,count:r(e?.outcome,i.value),checked:t.outcomes.includes(i.value),onChange:e=>n({...t,outcomes:Xr(t.outcomes,i.value,e)})},i.value))}),((e?.service.length??0)>0||t.services.length>0)&&(0,N.jsx)(qr,{title:`Service`,selected:t.services.length,children:(0,N.jsx)(Zr,{values:Yr(e?.service??[],t.services),selected:t.services,onChange:(e,r)=>n({...t,services:Xr(t.services,e,r)})})}),((e?.method.length??0)>0||t.methods.length>0)&&(0,N.jsx)(qr,{title:`Method`,selected:t.methods.length,children:(0,N.jsx)(Zr,{values:Yr(e?.method??[],t.methods),selected:t.methods,mono:!0,onChange:(e,r)=>n({...t,methods:Xr(t.methods,e,r)})})}),((e?.endpoint.length??0)>0||t.endpoints.length>0)&&(0,N.jsx)(qr,{title:`Route`,selected:t.endpoints.length,children:(0,N.jsx)(Zr,{values:Yr(e?.endpoint??[],t.endpoints),selected:t.endpoints,mono:!0,onChange:(e,r)=>n({...t,endpoints:Xr(t.endpoints,e,r)})})}),(0,N.jsx)(qr,{title:`Duration`,selected:t.minMs===void 0?0:1,initiallyOpen:!1,children:Gr.map(e=>(0,N.jsx)(Jr,{label:e.label,count:void 0,checked:t.minMs===e.minMs,onChange:()=>n({...t,minMs:e.minMs})},e.value))})]})}var $r={http:`bg-span-request`,action:`bg-span-action`,rpc:`bg-span-rpc`,sql:`bg-span-sql`,other:`bg-span-other`},ei={http:`Request`,action:`Action`,rpc:`Service call`,sql:`SQL`,other:`Other`},ti=`bg-[image:repeating-linear-gradient(135deg,transparent_0_4px,color-mix(in_oklab,var(--background)_45%,transparent)_4px_8px)]`;function ni(e){return e.status===`error`}function ri({span:e}){let t=Object.entries(e.attributes).filter(([,e])=>e!==void 0),n=e.events.filter(e=>e.name===ie.exceptionEvent);return(0,N.jsxs)(`div`,{className:`mb-2 flex flex-col gap-2`,children:[(0,N.jsx)(`dl`,{className:`m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-0.5 border bg-muted/50 p-3 font-mono text-xs leading-[18px]`,children:t.map(([e,t])=>(0,N.jsxs)(`div`,{className:`contents`,children:[(0,N.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,N.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:String(t)})]},e))}),n.map((e,t)=>(0,N.jsxs)(`pre`,{className:`m-0 overflow-auto border bg-muted/50 p-3 font-mono text-xs leading-[18px] [overflow-wrap:anywhere] whitespace-pre-wrap`,children:[String(e.attributes[C.exceptionMessage]??``),e.attributes[C.exceptionStack]?`\n\n${String(e.attributes[C.exceptionStack])}`:``]},t))]})}function ii({trace:e,now:t}){let[n,r]=(0,M.useState)(),i=_n(e.spans),a=Math.max(e.endMs??t,...e.spans.map(e=>e.endMs??t)),o=Math.max(a-e.startMs,.001),s=[...new Set(e.spans.map(gn))];return(0,N.jsxs)(`div`,{className:`flex flex-col px-4 pt-2 pb-4`,children:[(0,N.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[s.map(e=>(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(`i`,{className:b(`size-2 rounded-[1px]`,$r[e])}),ei[e]]},e)),e.spans.some(ni)&&(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(`i`,{className:`size-2 rounded-[1px] bg-destructive`}),`Failed`]})]}),e.spans.map(a=>{let s=a.endMs??t,c=gn(a),l=Math.min(Math.max((a.startMs-e.startMs)/o*100,0),99.5),u=Math.min(Math.max((s-a.startMs)/o*100,.5),100-l),d=n===a.spanId;return(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`button`,{type:`button`,"aria-expanded":d,onClick:()=>r(d?void 0:a.spanId),className:`group grid min-h-7 w-full grid-cols-[minmax(120px,38%)_minmax(0,1fr)_64px] items-center gap-3 text-left`,children:[(0,N.jsxs)(`span`,{className:`flex min-w-0 items-center truncate text-[13px] text-muted-foreground group-hover:text-foreground`,style:{paddingLeft:(i.get(a.spanId)??0)*14},title:String(a.attributes[C.dbStatement]??a.name),children:[(0,N.jsx)(`i`,{className:b(`mr-2 size-2 shrink-0 rounded-[1px]`,ni(a)?`bg-destructive`:$r[c])}),(0,N.jsx)(`span`,{className:`truncate`,children:a.name})]}),(0,N.jsx)(`span`,{className:`relative h-3 overflow-hidden bg-border/70`,children:(0,N.jsx)(`span`,{className:b(`absolute inset-y-0 min-w-0.5 rounded-[1.5px]`,ni(a)?`bg-destructive`:$r[c],a.status===`running`&&ti),style:{left:`${l}%`,width:`${u}%`}})}),(0,N.jsx)(`span`,{className:`text-right text-xs text-muted-foreground tabular-nums`,children:F(a.endMs===void 0?void 0:a.endMs-a.startMs)})]}),d&&(0,N.jsx)(ri,{span:a})]},a.spanId)}),e.truncated&&(0,N.jsx)(l,{variant:`outline`,className:`mt-2 self-start`,children:`Some spans were dropped`})]})}var ai=(e,t)=>t.padEnd(e);function oi(e,t){return e.split(`
|
|
13
|
+
`).length>3;return(0,N.jsxs)(`div`,{className:`group relative grid grid-cols-[104px_44px_minmax(0,1fr)_minmax(0,200px)] items-baseline gap-3 border-b px-4 py-2 last:border-b-0 hover:bg-muted/40 max-md:grid-cols-[96px_44px_minmax(0,1fr)]`,children:[(0,N.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground tabular-nums`,children:un(e.timeMs,!1)}),(0,N.jsx)(Ut,{level:e.level}),(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsx)(`div`,{className:b(`font-mono text-xs leading-[18px] [overflow-wrap:anywhere] whitespace-pre-wrap`,c&&!r&&`line-clamp-3`),children:(0,N.jsx)(ar,{text:e.message,terms:t})}),c&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>i(!r),className:`mt-0.5 cursor-pointer text-xs text-muted-foreground underline-offset-4 hover:text-foreground hover:underline`,children:r?`Show less`:`Show more`})]}),(0,N.jsxs)(`div`,{className:`min-w-0 max-md:hidden`,children:[(0,N.jsxs)(`div`,{className:`truncate text-xs text-muted-foreground`,children:[e.method?`${e.method} `:``,e.route]}),(0,N.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground/70`,children:e.span})]}),(0,N.jsxs)(`div`,{className:`absolute top-1.5 right-2 flex items-center gap-0.5 rounded-md border bg-background p-0.5 opacity-0 shadow-xs group-focus-within:opacity-100 group-hover:opacity-100`,children:[(0,N.jsx)(or,{label:o?`Copied`:`Copy this line`,onClick:()=>{navigator.clipboard?.writeText(e.message),s(!0),setTimeout(()=>s(!1),1200)},children:o?(0,N.jsx)(a,{}):(0,N.jsx)(Ye,{})}),(0,N.jsx)(or,{label:`Only lines of this request`,onClick:()=>n(e.traceId),children:(0,N.jsx)(Ze,{})}),(0,N.jsx)(or,{label:`Open the request`,href:p(`requests`,e.traceId),children:(0,N.jsx)(Ne,{})})]})]})}function cr({traces:e}){let t=(0,M.useMemo)(()=>Un(e,Zn),[e]),[n,r]=(0,M.useState)(),i=n??t,a=(0,M.useMemo)(()=>{if(!n)return 0;let e=new Set(n.map(e=>e.id));return t.filter(t=>!e.has(t.id)).length},[n,t]),[o,s]=(0,M.useState)(``),[l,u]=rr(),[d,f]=jn(`brick-dashboard-logs-since`,tr,`all`),[p,m]=(0,M.useState)(Qn),h=te(d!==`all`&&!n,5e3)-(er.find(e=>e.value===d)?.ms??1/0),g=(0,M.useMemo)(()=>d===`all`?i:i.filter(e=>e.timeMs>=h),[i,d,h]),_=(0,M.useMemo)(()=>Gn(o),[o]),v=(0,M.useMemo)(()=>qn(g,_),[g,_]),y=(0,M.useMemo)(()=>Jn(v),[v]),b=(0,M.useMemo)(()=>v.filter(e=>l.has(e.level)),[v,l]),x=(0,M.useMemo)(()=>Yn(_),[_]),ee=o.trim()!==``||l.size<In.length,ne=e=>{s(e),m(Qn)},S=()=>{ne(``),u(new Set(In)),f(`all`)};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(c,{title:`Logs`,description:`What actions and tools log, newest first`,actions:(0,N.jsxs)(A,{variant:`outline`,"aria-pressed":n!==void 0,onClick:()=>r(n?void 0:t),children:[n?(0,N.jsx)(pt,{}):(0,N.jsx)(dt,{}),n?a>0?`Resume (${hn(a)} new)`:`Resume`:`Pause`]})}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsxs)(`div`,{className:`relative min-w-60 flex-1`,children:[(0,N.jsx)(xt,{className:`pointer-events-none absolute top-2.5 left-2.5 size-3.5 text-muted-foreground`}),(0,N.jsx)(re,{type:`search`,value:o,placeholder:`Search: words, "exact phrase", level:error, route:/api, trace:2ef0…`,"aria-label":`Search logs`,className:`pr-8 pl-8 [&::-webkit-search-cancel-button]:hidden`,onChange:e=>ne(e.target.value),onKeyDown:e=>{e.key===`Escape`&&ne(``)}}),o&&(0,N.jsx)(`button`,{type:`button`,"aria-label":`Clear search`,onClick:()=>ne(``),className:`absolute top-1.5 right-1.5 grid size-5 cursor-pointer place-items-center rounded-sm text-muted-foreground hover:text-foreground`,children:(0,N.jsx)(Nt,{className:`size-3.5`})})]}),(0,N.jsx)(se,{variant:`outline`,spacing:2,"aria-label":`How far back`,value:[d],onValueChange:e=>{let t=tr.find(t=>t===e[0]);t&&(f(t),m(Qn))},children:er.map(e=>(0,N.jsx)(ae,{value:e.value,children:e.label},e.value))}),(0,N.jsx)(se,{multiple:!0,variant:`outline`,spacing:2,"aria-label":`Levels`,value:[...l],onValueChange:e=>{u(new Set(In.filter(t=>e.includes(t)))),m(Qn)},children:In.map(e=>(0,N.jsxs)(ae,{value:e,className:`gap-1.5`,children:[(0,N.jsx)(`span`,{className:`capitalize`,children:e}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:hn(y[e])})]},e))})]}),(0,N.jsxs)(`p`,{className:`-mt-2 text-xs text-muted-foreground`,children:[`Words must all appear; `,(0,N.jsx)(`code`,{className:`font-mono`,children:`"in quotes"`}),` is an exact phrase; `,(0,N.jsx)(`code`,{className:`font-mono`,children:`-word`}),` leaves lines out. Fields: `,(0,N.jsx)(`code`,{className:`font-mono`,children:`level:`}),` `,(0,N.jsx)(`code`,{className:`font-mono`,children:`route:`}),` `,(0,N.jsx)(`code`,{className:`font-mono`,children:`action:`}),` `,(0,N.jsx)(`code`,{className:`font-mono`,children:`method:`}),` `,(0,N.jsx)(`code`,{className:`font-mono`,children:`trace:`})]}),(0,N.jsx)(k,{children:t.length===0&&!n?(0,N.jsx)(fe,{title:`Nothing logged yet`,hint:`Call ctx.logger.info(…) or console.log(…) in an action or tool, with telemetry on, and send a request that runs it`}):b.length===0?(0,N.jsxs)(`div`,{className:`grid place-items-center gap-3 px-4 py-12 text-center text-sm text-muted-foreground`,children:[(0,N.jsx)(`div`,{children:`No lines match`}),(ee||d!==`all`)&&(0,N.jsx)(A,{variant:`outline`,size:`sm`,onClick:S,children:`Clear search and filters`})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-4 py-2 text-xs text-muted-foreground`,children:[(0,N.jsxs)(`span`,{children:[b.length===i.length?`${hn(b.length)} lines`:`${hn(b.length)} of ${hn(i.length)} lines`,i.length===Zn&&` (the newest ${hn(Zn)})`]}),n&&(0,N.jsx)(`span`,{children:`Paused: the list is not following new lines`})]}),b.slice(0,p).map(e=>(0,N.jsx)(sr,{entry:e,terms:x,onOnlyRequest:e=>ne(ir(o,`trace:${e.slice(0,8)}`))},e.id)),b.length>p&&(0,N.jsx)(`div`,{className:`flex justify-center border-t p-2`,children:(0,N.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>m(p+Qn),children:[`Show `,hn(Math.min(Qn,b.length-p)),` more of `,hn(b.length-p)]})})]})})]})}var lr=`modulepreload`,ur=function(e){return`/assets/`+e},dr={},fr=function(e){return e.pathname.endsWith(`.css`)},pr=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},mr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)},a,o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{e=ur(e,n);let t=i(e),r=fr(t);return pr(dr,t.href,()=>{if(a===void 0){a={all:new Set,styles:new Set};let e=document.getElementsByTagName(`link`);for(let t=e.length-1;t>=0;t--){let n=e[t];a.all.add(n.href),n.rel===`stylesheet`&&a.styles.add(n.href)}}if((r?a.styles:a.all).has(t.href))return;let e=document.createElement(`link`);if(e.rel=r?`stylesheet`:lr,r||(e.as=`script`),e.crossOrigin=``,e.href=t.href,s&&e.setAttribute(`nonce`,s),document.head.appendChild(e),r)return new Promise((n,r)=>{e.addEventListener(`load`,n),e.addEventListener(`error`,()=>r(Error(`Unable to preload CSS for ${t}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},hr=(0,M.lazy)(()=>mr(()=>import(`./api-reference-BP4ULs5J.js`),__vite__mapDeps([0,1,2,3,4,5,6])));function gr(e){let[t,n]=(0,M.useState)([]);return(0,M.useEffect)(()=>{if(e===void 0)return;let t=new AbortController;return fetch(T.openapi.path,{signal:t.signal}).then(e=>e.json()).then(n,()=>{}),()=>t.abort()},[e]),t}function _r(e){let t=(0,M.useRef)(0);(0,M.useLayoutEffect)(()=>{if(e)return;window.scrollTo(0,t.current);let n=()=>{t.current=window.scrollY};return window.addEventListener(`scroll`,n,{passive:!0}),()=>window.removeEventListener(`scroll`,n)},[e])}function vr({api:e,route:t,traces:n,failures:r,hidden:i}){let a=gr(e?.revision);_r(i),(0,M.useEffect)(()=>{i&&document.dispatchEvent(new KeyboardEvent(`keydown`,{key:`Escape`,bubbles:!0}))},[i]);let o=(0,M.useRef)(t.path);return!i&&t.path.length>0&&(o.current=t.path),(0,N.jsx)(`div`,{className:b(`min-h-[calc(100svh-3.5rem)]`,i&&`hidden`),children:e&&e.titles.length===0?(0,N.jsx)(fe,{title:`No API documents to show`,hint:`The app serves none: docs is false, and reference.documents is empty`}):a.length===0?(0,N.jsx)(fe,{title:e?`Loading API documents`:`Waiting for the app to start`}):(0,N.jsx)(M.Suspense,{fallback:(0,N.jsx)(fe,{title:`Loading API reference`}),children:(0,N.jsx)(hr,{documents:a,appUrl:e?.appUrl,path:o.current,traces:n,failures:r})})})}function yr({failures:e,traces:t,canLookBack:n}){return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(c,{title:`Errors`,description:`Failed requests, startup failures, and crashes, newest first`}),e.length===0?(0,N.jsx)(k,{children:(0,N.jsx)(fe,{title:`No errors recorded`})}):(0,N.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.map(e=>{let r=e.traceId!==void 0&&(n||t.some(t=>t.traceId===e.traceId)),i=[e.route,e.service&&e.action?`${e.service}.${e.action}`:void 0].filter(Boolean).join(` · `);return(0,N.jsx)(k,{children:(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`font-semibold text-destructive`,children:e.code}),e.status!==void 0&&(0,N.jsxs)(l,{variant:`destructive`,children:[`HTTP `,e.status]}),(0,N.jsx)(l,{variant:`outline`,children:e.phase}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:dn(e.at)})]}),(0,N.jsx)(`div`,{className:`[overflow-wrap:anywhere]`,children:e.message}),i&&(0,N.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:i}),r&&e.traceId&&(0,N.jsx)(`a`,{href:p(`requests`,e.traceId),className:b(y({variant:`outline`,size:`sm`}),`self-start`),children:`Open request`}),e.stack&&(0,N.jsxs)(`details`,{children:[(0,N.jsx)(`summary`,{className:`cursor-pointer text-xs text-muted-foreground`,children:`Stack trace`}),(0,N.jsx)(`pre`,{className:`mt-2 overflow-auto border bg-muted/50 p-3 font-mono text-xs leading-[18px] [overflow-wrap:anywhere] whitespace-pre-wrap`,children:e.stack})]})]})},e.id)})})]})}var br=()=>({calls:0,failures:0,timed:0,totalMs:0,lastAt:-1/0,lastFailed:!1});function xr(e,t,n,r){e.calls+=1,r&&(e.failures+=1),n!==void 0&&(e.timed+=1,e.totalMs+=n-t),t>=e.lastAt&&(e.lastAt=t,e.lastFailed=r)}var Sr=e=>e.timed===0?void 0:e.totalMs/e.timed,Cr=e=>e.calls===0?`idle`:e.lastFailed?`failing`:`ok`;function wr(e,t){let n=e.parentSpanId===void 0?void 0:t.get(e.parentSpanId);for(let e=0;n&&e<64;e++){let e=gn(n);if(e===`action`||e===`rpc`)return sn(n.attributes,C.service);n=n.parentSpanId===void 0?void 0:t.get(n.parentSpanId)}}var Tr=(e,t)=>`${hn(e)} ${t}${e===1?``:`s`}`;function Er(e,t){let n=e?.schema.services??[],r=n.flatMap(e=>(e.sockets??[]).map(t=>({...t,service:e.name,id:`socket:${e.name}/${t.name}`}))),i=n.map(e=>e.name),a=new Map,o=new Map;for(let e of n){let t=e.databaseConfig;if(!t)continue;let n=t.name??`${e.name} db`,r=`db:${n}`;o.set(e.name,r),a.set(r,{id:r,label:n,engine:t.engine,tables:t.tables.length})}let s=new Map,c=new Map,l=br(),u=new Map,d=(e,t)=>{let n=e.get(t);return n||e.set(t,n=br()),n},f=(e,t,n)=>{let r=`${t}->${n}`,i=u.get(r);return i||(i={id:r,kind:e,from:t,to:n,calls:0,avgMs:void 0,activity:br()},u.set(r,i)),i.activity};for(let e of n){e.actions.some(e=>e.method&&e.path)&&f(`request`,`client`,`service:${e.name}`);let t=o.get(e.name);t&&f(`sql`,`service:${e.name}`,t)}for(let e of r)f(`websocket`,`client`,e.id),f(`websocket`,e.id,`service:${e.service}`);let p=e?.schema.events;if(p&&p.recorders.length>0){for(let e of p.recorders)f(`event`,`service:${e}`,`events`);for(let e of p.listeners)f(`event`,`events`,`listener:${e.name}`)}for(let e of t){xr(l,e.startMs,e.endMs,e.status===`error`);let t=new Map(e.spans.map(e=>[e.spanId,e]));for(let n of e.spans){let e=gn(n),r=n.status===`error`;if(e===`action`){let e=sn(n.attributes,C.service);if(!e)continue;i.includes(e)||i.push(e),xr(d(s,e),n.startMs,n.endMs,r),xr(f(`request`,`client`,`service:${e}`),n.startMs,n.endMs,r)}else if(e===`rpc`){let e=sn(n.attributes,C.service);if(!e)continue;i.includes(e)||i.push(e),xr(d(s,e),n.startMs,n.endMs,r);let a=wr(n,t);a&&a!==e&&(i.includes(a)||i.push(a),xr(f(`rpc`,`service:${a}`,`service:${e}`),n.startMs,n.endMs,r))}else if(e===`sql`){let e=wr(n,t);if(!e)continue;i.includes(e)||i.push(e);let s=o.get(e)??`db:${e} db`;a.has(s)||a.set(s,{id:s,label:`${e} db`,engine:sn(n.attributes,C.dbSystem)??`database`,tables:0}),xr(d(c,s),n.startMs,n.endMs,r),xr(f(`sql`,`service:${e}`,s),n.startMs,n.endMs,r)}}}let m=[];(t.length>0||[...u.values()].some(e=>e.from===`client`))&&m.push({id:`client`,kind:`client`,label:`Clients`,caption:l.calls?Tr(l.calls,`request`):`no traffic`,metric:Dr(Sr(l)),detail:r.length?`HTTP and WebSocket clients`:`HTTP clients`,health:Cr(l),calls:l.calls,failures:l.failures,avgMs:Sr(l)});for(let e of r)m.push({id:e.id,kind:`socket`,label:`${e.service}.${e.name}`,detail:e.path??`WebSocket route`,caption:`in: ${e.input.join(`, `)||`none`} · out: ${e.output.join(`, `)||`none`}`,metric:``,health:`idle`,calls:0,failures:0,avgMs:void 0});for(let e of i){let t=s.get(e)??br(),r=n.find(t=>t.name===e);m.push({id:`service:${e}`,kind:`service`,label:e,caption:t.calls?Tr(t.calls,`call`):`no traffic`,metric:Dr(Sr(t)),detail:r?[Tr(r.actions.length,`action`),Tr(r.tools?.length??0,`tool`),...r.sockets?.length?[Tr(r.sockets.length,`socket`)]:[]].join(` · `):`Seen in requests`,health:Cr(t),calls:t.calls,failures:t.failures,avgMs:Sr(t)})}for(let e of a.values()){let t=c.get(e.id)??br();m.push({id:e.id,kind:`database`,label:e.label,caption:t.calls?`${hn(t.calls)} ${t.calls===1?`query`:`queries`}`:`no queries`,metric:Dr(Sr(t)),detail:e.tables>0?`${e.engine} · ${Tr(e.tables,`table`)}`:e.engine,health:Cr(t),calls:t.calls,failures:t.failures,avgMs:Sr(t)})}if(p&&p.recorders.length>0){m.push({id:`events`,kind:`events`,label:`Events`,caption:Tr(p.listeners.length,`listener`),metric:``,detail:p.dispatch?`outbox · delivering`:`outbox · record only`,health:`idle`,calls:0,failures:0,avgMs:void 0});for(let e of p.listeners)m.push({id:`listener:${e.name}`,kind:`listener`,label:e.name,caption:e.kind,metric:``,detail:`on ${e.on.join(`, `)}`,health:`idle`,calls:0,failures:0,avgMs:void 0})}let h=new Set(m.map(e=>e.id));return{nodes:m,edges:[...u.values()].filter(e=>h.has(e.from)&&h.has(e.to)).map(({activity:e,...t})=>({...t,calls:e.calls,avgMs:Sr(e)}))}}function Dr(e){return e===void 0?``:F(e)}var Or=104,kr=24;function Ar(e){let t=new Map(e.nodes.map(e=>[e.id,e.kind===`client`?0:1]));for(let n=0;n<e.nodes.length;n++){let n=!1;for(let r of e.edges){let i=(t.get(r.from)??0)+1;i>(t.get(r.to)??0)&&i<=e.nodes.length&&(t.set(r.to,i),n=!0)}if(!n)break}let n=Math.min(...t.values(),0),r=new Map;for(let i of e.nodes){let e=(t.get(i.id)??0)-n;r.set(e,[...r.get(e)??[],i])}let i=Math.max(0,...[...r.values()].map(e=>e.length)),a=i===0?0:i*88+(i-1)*kr,o=new Map;for(let[e,t]of r){let n=t.length*88+(t.length-1)*kr;t.forEach((t,r)=>{o.set(t.id,{...t,column:e,x:e*312,y:(a-n)/2+r*112})})}let s=[];for(let t of e.edges){let e=o.get(t.from),n=o.get(t.to);if(!e||!n)continue;let r=e.x+208,i=e.y+44,a=n.x,c=n.y+44,l=Math.max((a-r)/2,24);s.push({...t,path:`M ${r} ${i} C ${r+l} ${i}, ${a-l} ${c}, ${a-2} ${c}`})}let c=Math.max(-1,...r.keys());return{nodes:[...o.values()],edges:s,width:c<0?0:(c+1)*208+c*Or,height:a}}var jr={request:`stroke-span-request`,websocket:`stroke-span-request`,rpc:`stroke-span-rpc`,sql:`stroke-span-sql`,event:`stroke-span-event`},Mr={request:`fill-span-request`,websocket:`fill-span-request`,rpc:`fill-span-rpc`,sql:`fill-span-sql`,event:`fill-span-event`},Nr={request:`Request`,websocket:`WebSocket`,rpc:`Service call`,sql:`SQL`,event:`Event`},Pr={client:`border-l-span-request`,socket:`border-l-span-request`,service:`border-l-span-action`,database:`border-l-span-sql`,events:`border-l-span-event`,listener:`border-l-span-event`},Fr={client:`Client`,socket:`WebSocket`,service:`Service`,database:`Database`,events:`Events`,listener:`Listener`},Ir={ok:`bg-positive`,failing:`bg-destructive`,idle:`bg-muted-foreground/40`},Lr={ok:`Healthy`,failing:`Failing`,idle:`Idle`},Rr=.6;function zr(e){let t=(0,M.useRef)(null),[n,r]=(0,M.useState)(0);return(0,M.useEffect)(()=>{let e=t.current;if(!e)return;let n=()=>{let t=getComputedStyle(e);r(e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight))};n();let i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[]),{ref:t,scale:e===0||n===0?1:Math.min(1,Math.max(Rr,n/e))}}function Br(e){let t=[e.label,e.detail];return e.kind===`socket`&&t.push(e.caption),e.calls>0&&(t.push(e.caption),e.failures>0&&t.push(`${e.failures} failed`),e.avgMs!==void 0&&t.push(`${F(e.avgMs)} average`)),t.join(` · `)}function Vr({architecture:e,traces:t}){let n=(0,M.useMemo)(()=>Ar(Er(e,t)),[e,t]),{ref:r,scale:i}=zr(n.width),[a,o]=(0,M.useState)(),[s,c]=(0,M.useState)(),l=a??s,u=n.nodes.find(e=>e.id===l),d=new Set(l?[l]:[]);if(l)for(let e of n.edges)(e.from===l||e.to===l)&&(d.add(e.from),d.add(e.to));return(0,N.jsxs)(k,{children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4 p-4`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{className:`text-base leading-6 font-semibold`,children:`Service graph`}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Clients, WebSockets, services, databases, and observed calls`})]}),(0,N.jsxs)(`div`,{className:`flex flex-col items-end gap-1 text-xs text-muted-foreground`,children:[(0,N.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1`,children:Object.keys(Lr).map(e=>(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(`i`,{className:b(`size-2`,Ir[e])}),Lr[e]]},e))}),(0,N.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1`,children:Object.keys(Nr).map(e=>(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(`svg`,{width:`14`,height:`6`,"aria-hidden":!0,children:(0,N.jsx)(`line`,{x1:`0`,y1:`3`,x2:`14`,y2:`3`,strokeWidth:`2`,className:jr[e]})}),Nr[e]]},e))})]})]}),n.nodes.length===0?(0,N.jsx)(`div`,{className:`border-t`,children:(0,N.jsx)(fe,{title:`Waiting for the application to start`})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{ref:r,className:`overflow-x-auto border-t bg-[radial-gradient(circle,var(--border)_1px,transparent_1px)] bg-size-[16px_16px] p-6`,children:(0,N.jsx)(`div`,{className:`mx-auto`,style:{width:n.width*i,height:n.height*i},children:(0,N.jsxs)(`div`,{className:`relative origin-top-left`,style:{width:n.width,height:n.height,transform:`scale(${i})`},children:[(0,N.jsxs)(`svg`,{width:n.width,height:n.height,className:`absolute inset-0 overflow-visible`,"aria-hidden":!0,children:[(0,N.jsx)(`defs`,{children:Object.keys(Mr).map(e=>(0,N.jsx)(`marker`,{id:`arrow-${e}`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`8`,markerHeight:`8`,markerUnits:`userSpaceOnUse`,orient:`auto`,children:(0,N.jsx)(`path`,{d:`M0 0 L8 4 L0 8 z`,className:Mr[e]})},e))}),n.edges.map(e=>{let t=!l||e.from===l||e.to===l;return(0,N.jsx)(`path`,{d:e.path,fill:`none`,strokeWidth:1.5+Math.min(Math.log2(e.calls+1)/3,1.5),strokeDasharray:e.calls===0?`4 4`:void 0,markerEnd:`url(#arrow-${e.kind})`,className:b(jr[e.kind],`transition-opacity`,t?e.calls===0?`opacity-40`:`opacity-80`:`opacity-10`),children:(0,N.jsx)(`title`,{children:`${Nr[e.kind]}: ${e.calls===0?`not seen yet`:`${e.calls} call${e.calls===1?``:`s`}${e.avgMs===void 0?``:`, ${F(e.avgMs)} average`}`}`})},e.id)})]}),n.nodes.map(e=>(0,N.jsxs)(`button`,{type:`button`,title:Br(e),"aria-pressed":s===e.id,onClick:()=>c(t=>t===e.id?void 0:e.id),onMouseEnter:()=>o(e.id),onMouseLeave:()=>o(void 0),onFocus:()=>o(e.id),onBlur:()=>o(void 0),className:b(`absolute flex flex-col justify-between border border-l-2 bg-card px-3 py-2 text-left font-mono transition-[opacity,border-color] outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,Pr[e.kind],s===e.id?`border-positive/80`:`hover:border-foreground/40`,l&&!d.has(e.id)&&`opacity-40`),style:{left:e.x,top:e.y,width:208,height:88},children:[(0,N.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,N.jsx)(`i`,{className:b(`size-2.5 shrink-0`,Ir[e.health])}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:e.label}),(0,N.jsx)(`span`,{className:`text-[10px] tracking-wider text-muted-foreground uppercase`,children:Fr[e.kind]})]}),(0,N.jsx)(`span`,{className:`truncate text-xs text-foreground/80`,children:e.detail}),(0,N.jsxs)(`span`,{className:`flex items-baseline justify-between gap-2 border-t border-dashed pt-1.5 text-xs text-muted-foreground tabular-nums`,children:[(0,N.jsx)(`span`,{className:`truncate`,children:e.caption}),(0,N.jsx)(`span`,{children:e.metric})]})]},e.id))]})})}),(0,N.jsx)(`div`,{className:`border-t px-4 py-2 text-xs text-muted-foreground`,children:u?Br(u):`Hover a node to follow its calls. Click one to keep it highlighted.`})]})]})}function Hr({architecture:e,traces:t}){let n=e?.schema.services??[],r=n.flatMap(e=>(e.sockets??[]).map(t=>({...t,service:e.name}))),i=e?.schema.events?.listeners??[],a=n.flatMap(e=>(e.events??[]).map(t=>({...t,service:e.name,fields:Object.keys(t.schema?.properties??{}),listeners:i.filter(e=>e.on.some(e=>e.endsWith(`*`)?t.name.startsWith(e.slice(0,-1)):e===t.name)).map(e=>e.name)}))),o=(0,M.useMemo)(()=>{let e=[];for(let r of n)for(let n of r.actions){if(!n.method||!n.path)continue;let i=`${n.method} ${n.path}`,a=t.filter(e=>e.method!==void 0&&e.route!==void 0&&`${e.method} ${e.route}`===i);e.push({key:i,action:`${r.name}.${n.name}${n.plugin?` · ${n.plugin}`:``}`,requests:a.length,failures:a.filter(ln).length})}return e},[n,t]);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(c,{title:`Overview`,description:`Routes and services of the running app. Counts cover the recent requests kept in memory.`}),(0,N.jsx)(u,{name:`overview.top`}),e?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Vr,{architecture:e,traces:t}),(0,N.jsx)(k,{children:o.length===0?(0,N.jsx)(fe,{title:`No HTTP routes are registered`}):(0,N.jsxs)(Ce,{children:[(0,N.jsx)(ve,{children:(0,N.jsxs)(me,{children:[(0,N.jsx)(w,{className:`px-4`,children:`Route`}),(0,N.jsx)(w,{children:`Action`}),(0,N.jsx)(w,{className:`text-right`,children:`Requests`}),(0,N.jsx)(w,{className:`px-4 text-right`,children:`Failures`})]})}),(0,N.jsx)(S,{children:o.map(e=>(0,N.jsxs)(me,{children:[(0,N.jsx)(O,{className:`px-4 font-mono text-xs`,children:e.key}),(0,N.jsx)(O,{className:`text-muted-foreground`,children:e.action}),(0,N.jsx)(O,{className:`text-right tabular-nums`,children:e.requests}),(0,N.jsx)(O,{className:b(`px-4 text-right tabular-nums`,e.failures>0?`text-destructive`:`text-muted-foreground`),children:e.failures})]},e.key))})]})}),r.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`h2`,{className:`mt-2 -mb-1 text-xs font-medium tracking-wider text-muted-foreground uppercase`,children:`WebSockets`}),(0,N.jsx)(k,{children:(0,N.jsxs)(Ce,{children:[(0,N.jsx)(ve,{children:(0,N.jsxs)(me,{children:[(0,N.jsx)(w,{className:`px-4`,children:`Socket route`}),(0,N.jsx)(w,{children:`Client sends`}),(0,N.jsx)(w,{children:`Server sends`}),(0,N.jsx)(w,{className:`px-4`,children:`Authorization`})]})}),(0,N.jsx)(S,{children:r.map(e=>(0,N.jsxs)(me,{children:[(0,N.jsxs)(O,{className:`px-4`,children:[(0,N.jsxs)(`div`,{className:`font-mono text-xs`,children:[`WS `,e.path??e.name]}),(0,N.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.service,`.`,e.name]}),e.description&&(0,N.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.description})]}),(0,N.jsx)(O,{className:`font-mono text-xs`,children:e.input.join(`, `)||`none`}),(0,N.jsx)(O,{className:`font-mono text-xs`,children:e.output.join(`, `)||`none`}),(0,N.jsx)(O,{className:`px-4 text-muted-foreground`,children:e.hasAuthorize?`Checked on connect and messages`:`No authorize hook`})]},`${e.service}.${e.name}`))})]})})]}),a.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`h2`,{className:`mt-2 -mb-1 text-xs font-medium tracking-wider text-muted-foreground uppercase`,children:`Events`}),(0,N.jsx)(k,{children:(0,N.jsxs)(Ce,{children:[(0,N.jsx)(ve,{children:(0,N.jsxs)(me,{children:[(0,N.jsx)(w,{className:`px-4`,children:`Event`}),(0,N.jsx)(w,{children:`Payload`}),(0,N.jsx)(w,{className:`px-4`,children:`Listeners`})]})}),(0,N.jsx)(S,{children:a.map(e=>(0,N.jsxs)(me,{children:[(0,N.jsxs)(O,{className:`px-4 font-mono text-xs`,children:[e.name,e.plugin&&(0,N.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· `,e.plugin]})]}),(0,N.jsx)(O,{className:`font-mono text-xs`,children:e.fields.join(`, `)||`none`}),(0,N.jsx)(O,{className:`px-4 text-muted-foreground`,children:e.listeners.join(`, `)||`none`})]},e.name))})]})})]}),(0,N.jsx)(`h2`,{className:`mt-2 -mb-1 text-xs font-medium tracking-wider text-muted-foreground uppercase`,children:`Services`}),(0,N.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4`,children:n.map(e=>(0,N.jsx)(k,{children:(0,N.jsxs)(`div`,{className:`flex flex-col gap-1 p-4 text-sm`,children:[(0,N.jsx)(`div`,{className:`font-semibold`,children:e.name}),(0,N.jsx)(`div`,{className:`text-muted-foreground`,children:e.databaseConfig?`${e.databaseConfig.engine} · tables: ${e.databaseConfig.tables.map(t=>{let n=e.databaseConfig?.plugins?.[t];return n?`${t} (${n})`:t}).join(`, `)||`none`}`:`No database`}),(0,N.jsxs)(`div`,{className:`text-muted-foreground`,children:[`Resources:`,` `,(e.resources??[]).map(e=>e.name).join(`, `)||`none`]}),(0,N.jsxs)(`div`,{className:`text-muted-foreground`,children:[`Actions: `,e.actions.length]}),e.sockets&&e.sockets.length>0&&(0,N.jsxs)(`div`,{className:`text-muted-foreground`,children:[`WebSockets: `,e.sockets.length]})]})},e.name))})]}):(0,N.jsx)(k,{children:(0,N.jsx)(fe,{title:`Waiting for the application to start`})})]})}function Ur({reloads:e}){return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(c,{title:`Reloads`,description:`Each time the app started, restarted, or exited`}),(0,N.jsx)(k,{children:e.length===0?(0,N.jsx)(fe,{title:`No reloads yet`}):e.map(e=>(0,N.jsxs)(`div`,{className:`grid min-h-10 grid-cols-[72px_96px_minmax(0,1fr)_auto] items-center gap-3 border-b px-4 py-2 text-sm last:border-b-0`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:dn(e.at)}),(0,N.jsx)(`span`,{className:`font-medium`,children:e.kind}),(0,N.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.detail}),(0,N.jsxs)(l,{variant:`outline`,children:[`Generation `,e.generation]})]},e.id))})]})}var Wr=[{value:`ok`,label:`Succeeded`},{value:`client`,label:`Client error (4xx)`},{value:`server`,label:`Server error (5xx)`}],Gr=[{value:`any`,label:`Any speed`},{value:`100`,label:`100 ms or more`,minMs:100},{value:`500`,label:`500 ms or more`,minMs:500},{value:`1000`,label:`1 s or more`,minMs:1e3}],Kr=8;function qr({title:e,selected:t,children:n,initiallyOpen:r=!0}){let[i,a]=(0,M.useState)(r);return(0,N.jsxs)(`section`,{className:`border-b py-2 last:border-b-0`,children:[(0,N.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex h-8 w-full items-center justify-between gap-2 px-3 text-sm font-medium`,children:[(0,N.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e,t>0&&(0,N.jsx)(`span`,{className:`rounded-full bg-foreground px-1.5 text-[10px] leading-4 text-background tabular-nums`,children:t})]}),(0,N.jsx)(qe,{className:b(`size-3.5 text-muted-foreground transition-transform`,!i&&`-rotate-90`)})]}),i&&(0,N.jsx)(`div`,{className:`px-1 pb-1`,children:n})]})}function Jr({label:e,count:t,checked:n,mono:r,onChange:i}){return(0,N.jsxs)(`label`,{className:`flex min-h-7 cursor-pointer items-center gap-2 rounded-md px-2 text-sm hover:bg-muted/60`,children:[(0,N.jsx)(_e,{checked:n,onCheckedChange:e=>i(!!e)}),(0,N.jsx)(`span`,{className:b(`min-w-0 flex-1 truncate`,r&&`font-mono text-xs`,t===0&&!n&&`text-muted-foreground`),title:e,children:e}),t!==void 0&&(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:hn(t)})]})}function Yr(e,t){let n=new Set(e.map(e=>e.value));return[...e,...t.filter(e=>!n.has(e)).map(e=>({value:e,count:0}))]}function Xr(e,t,n){return n?e.includes(t)?e:[...e,t]:e.filter(e=>e!==t)}function Zr({values:e,selected:t,mono:n,onChange:r}){let[i,a]=(0,M.useState)(!1),o=i?e:e.slice(0,Kr),s=e.slice(Kr).filter(e=>t.includes(e.value)&&!i);return(0,N.jsxs)(N.Fragment,{children:[[...o,...s].map(e=>(0,N.jsx)(Jr,{label:e.value,mono:n,count:e.count,checked:t.includes(e.value),onChange:t=>r(e.value,t)},e.value)),e.length>Kr&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`px-2 py-1 text-xs text-muted-foreground hover:text-foreground`,children:i?`Show fewer`:`Show ${e.length-Kr} more`})]})}function Qr({facets:e,filters:t,onChange:n}){let r=(t,n)=>t?.find(e=>e.value===n)?.count??(e?0:void 0);return(0,N.jsxs)(`div`,{className:`border bg-card`,children:[(0,N.jsxs)(`div`,{className:`flex h-10 items-center justify-between border-b px-3`,children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Filters`}),Sn(t)&&(0,N.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>n({...xn,sort:t.sort}),children:`Clear all`})]}),(0,N.jsx)(qr,{title:`Outcome`,selected:t.outcomes.length,children:Wr.map(i=>(0,N.jsx)(Jr,{label:i.label,count:r(e?.outcome,i.value),checked:t.outcomes.includes(i.value),onChange:e=>n({...t,outcomes:Xr(t.outcomes,i.value,e)})},i.value))}),((e?.service.length??0)>0||t.services.length>0)&&(0,N.jsx)(qr,{title:`Service`,selected:t.services.length,children:(0,N.jsx)(Zr,{values:Yr(e?.service??[],t.services),selected:t.services,onChange:(e,r)=>n({...t,services:Xr(t.services,e,r)})})}),((e?.method.length??0)>0||t.methods.length>0)&&(0,N.jsx)(qr,{title:`Method`,selected:t.methods.length,children:(0,N.jsx)(Zr,{values:Yr(e?.method??[],t.methods),selected:t.methods,mono:!0,onChange:(e,r)=>n({...t,methods:Xr(t.methods,e,r)})})}),((e?.endpoint.length??0)>0||t.endpoints.length>0)&&(0,N.jsx)(qr,{title:`Route`,selected:t.endpoints.length,children:(0,N.jsx)(Zr,{values:Yr(e?.endpoint??[],t.endpoints),selected:t.endpoints,mono:!0,onChange:(e,r)=>n({...t,endpoints:Xr(t.endpoints,e,r)})})}),(0,N.jsx)(qr,{title:`Duration`,selected:t.minMs===void 0?0:1,initiallyOpen:!1,children:Gr.map(e=>(0,N.jsx)(Jr,{label:e.label,count:void 0,checked:t.minMs===e.minMs,onChange:()=>n({...t,minMs:e.minMs})},e.value))})]})}var $r={http:`bg-span-request`,action:`bg-span-action`,rpc:`bg-span-rpc`,sql:`bg-span-sql`,other:`bg-span-other`},ei={http:`Request`,action:`Action`,rpc:`Service call`,sql:`SQL`,other:`Other`},ti=`bg-[image:repeating-linear-gradient(135deg,transparent_0_4px,color-mix(in_oklab,var(--background)_45%,transparent)_4px_8px)]`;function ni(e){return e.status===`error`}function ri({span:e}){let t=Object.entries(e.attributes).filter(([,e])=>e!==void 0),n=e.events.filter(e=>e.name===ie.exceptionEvent);return(0,N.jsxs)(`div`,{className:`mb-2 flex flex-col gap-2`,children:[(0,N.jsx)(`dl`,{className:`m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-0.5 border bg-muted/50 p-3 font-mono text-xs leading-[18px]`,children:t.map(([e,t])=>(0,N.jsxs)(`div`,{className:`contents`,children:[(0,N.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,N.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:String(t)})]},e))}),n.map((e,t)=>(0,N.jsxs)(`pre`,{className:`m-0 overflow-auto border bg-muted/50 p-3 font-mono text-xs leading-[18px] [overflow-wrap:anywhere] whitespace-pre-wrap`,children:[String(e.attributes[C.exceptionMessage]??``),e.attributes[C.exceptionStack]?`\n\n${String(e.attributes[C.exceptionStack])}`:``]},t))]})}function ii({trace:e,now:t}){let[n,r]=(0,M.useState)(),i=_n(e.spans),a=Math.max(e.endMs??t,...e.spans.map(e=>e.endMs??t)),o=Math.max(a-e.startMs,.001),s=[...new Set(e.spans.map(gn))];return(0,N.jsxs)(`div`,{className:`flex flex-col px-4 pt-2 pb-4`,children:[(0,N.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[s.map(e=>(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(`i`,{className:b(`size-2 rounded-[1px]`,$r[e])}),ei[e]]},e)),e.spans.some(ni)&&(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(`i`,{className:`size-2 rounded-[1px] bg-destructive`}),`Failed`]})]}),e.spans.map(a=>{let s=a.endMs??t,c=gn(a),l=Math.min(Math.max((a.startMs-e.startMs)/o*100,0),99.5),u=Math.min(Math.max((s-a.startMs)/o*100,.5),100-l),d=n===a.spanId;return(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`button`,{type:`button`,"aria-expanded":d,onClick:()=>r(d?void 0:a.spanId),className:`group grid min-h-7 w-full grid-cols-[minmax(120px,38%)_minmax(0,1fr)_64px] items-center gap-3 text-left`,children:[(0,N.jsxs)(`span`,{className:`flex min-w-0 items-center truncate text-[13px] text-muted-foreground group-hover:text-foreground`,style:{paddingLeft:(i.get(a.spanId)??0)*14},title:String(a.attributes[C.dbStatement]??a.name),children:[(0,N.jsx)(`i`,{className:b(`mr-2 size-2 shrink-0 rounded-[1px]`,ni(a)?`bg-destructive`:$r[c])}),(0,N.jsx)(`span`,{className:`truncate`,children:a.name})]}),(0,N.jsx)(`span`,{className:`relative h-3 overflow-hidden bg-border/70`,children:(0,N.jsx)(`span`,{className:b(`absolute inset-y-0 min-w-0.5 rounded-[1.5px]`,ni(a)?`bg-destructive`:$r[c],a.status===`running`&&ti),style:{left:`${l}%`,width:`${u}%`}})}),(0,N.jsx)(`span`,{className:`text-right text-xs text-muted-foreground tabular-nums`,children:F(a.endMs===void 0?void 0:a.endMs-a.startMs)})]}),d&&(0,N.jsx)(ri,{span:a})]},a.spanId)}),e.truncated&&(0,N.jsx)(l,{variant:`outline`,className:`mt-2 self-start`,children:`Some spans were dropped`})]})}var ai=(e,t)=>t.padEnd(e);function oi(e,t){return e.split(`
|
|
14
14
|
`).join(`\n${` `.repeat(t)}`)}function si(e,t,n){let r=ci(n);return r.includes(`
|
|
15
15
|
`)?`${e}${t}:\n${e} ${oi(r,e.length+2)}`:`${e}${t}: ${r}`}function ci(e){return typeof e==`string`?e:JSON.stringify(e)}function li(e,t,n){let r=` `.repeat(n),i=e.endMs===void 0?`running`:F(e.endMs-e.startMs),a=[`${r}- ${e.name} [${gn(e)}] +${F(e.startMs-t.startMs)}, ${i}, ${e.status}${e.statusMessage?`: ${e.statusMessage}`:``}`],o=`${r} `;for(let[t,n]of Object.entries(e.attributes))n!==void 0&&a.push(si(o,t,n));for(let n of e.events)if(n.name!==ie.logEvent){a.push(`${o}event ${n.name} at +${F(n.timeMs-t.startMs)}`);for(let[e,t]of Object.entries(n.attributes))t!==void 0&&a.push(si(`${o} `,e,t))}return a.join(`
|
|
16
16
|
`)}function ui(e,t,n={}){let r=t??e,i=r.method?`${r.method} ${r.path??r.route??r.name}`:r.path??r.route??r.name,a=new Date(r.startMs),o=[`# ${i}`,``],s=[[`Trace ID`,r.traceId],[`Started`,`${a.toISOString()} (${a.toLocaleString([],{hour12:!1})}.${String(a.getMilliseconds()).padStart(3,`0`)} local)`],[`Status`,[r.httpStatus===void 0?`no HTTP status`:`HTTP ${r.httpStatus}`,r.status===`ok`&&r.httpStatus!==void 0?void 0:r.status].filter(Boolean).join(`, `)],[`Duration`,F(r.durationMs)],[`Route`,r.route],[`Path`,r.path],[`Handled by`,r.service?`${r.service}${r.action?`.${r.action}`:``}`:void 0]];for(let[e,t]of s)t!==void 0&&o.push(`${ai(12,`${e}:`)}${t}`);let c=(t?yn(t):void 0)?.exception;if((c||r.message)&&(o.push(``,`## Error`,``),c?.code&&o.push(`Code: ${c.code}`),o.push(`Message: ${c?.message??r.message??``}`),c?.span&&o.push(`Raised in: ${c.span}`),c?.stack&&o.push(`Stack trace:`,c.stack)),t){let e=Hn(t);if(e.entries.length>0||e.dropped>0){o.push(``,`## Logs (${e.entries.length})`,``);for(let n of e.entries)o.push(`+${F(n.timeMs-t.startMs)} ${n.level.toUpperCase()} [${n.span}] ${oi(n.message,2)}`);e.dropped>0&&o.push(`(${e.dropped} more lines were not kept)`)}let n=_n(t.spans);o.push(``,`## Spans (${t.spans.length})`,``);for(let e of t.spans)o.push(li(e,t,n.get(e.spanId)??0))}else o.push(``,n.loading?`(The spans were still loading when this was copied.)`:`(The spans are not available: the request is no longer kept.)`);return`${o.join(`
|
|
17
|
-
`)}\n`}function di(e){return(e.route?.includes(`*`)&&e.path?e.path:e.route)??e.name}function fi({label:e,children:t,mono:n}){return(0,N.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 border-b px-3 py-2 text-sm last:border-b-0`,children:[(0,N.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e}),(0,N.jsx)(`span`,{className:b(`min-w-0 text-right [overflow-wrap:anywhere]`,n&&`font-mono text-xs`),children:t})]})}function pi({tone:e,title:t,aside:n,children:r}){return(0,N.jsxs)(`div`,{className:`relative pb-3 pl-6 last:pb-0 before:absolute before:top-3 before:bottom-0 before:left-[5px] before:w-px before:bg-border last:before:hidden`,children:[(0,N.jsx)(`i`,{className:b(`absolute top-1.5 left-0 size-[11px] rounded-full border-2 bg-background`,e===`ok`&&`border-positive bg-positive`,e===`failed`&&`border-destructive bg-destructive`,e===`muted`&&`border-muted-foreground/60`)}),(0,N.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-sm`,children:[(0,N.jsx)(`span`,{className:`font-medium`,children:t}),n&&(0,N.jsx)(`span`,{className:`text-right text-xs text-muted-foreground tabular-nums`,children:n})]}),r&&(0,N.jsx)(`div`,{className:`mt-2 border bg-card`,children:r})]})}function mi({getValue:e,label:t,size:n=`icon`,disabled:r}){let[i,o]=(0,M.useState)(!1);return(0,N.jsx)(A,{variant:`ghost`,size:n,disabled:r,"aria-label":i?`Copied`:t,title:i?`Copied`:t,onClick:()=>{navigator.clipboard?.writeText(e()),o(!0),setTimeout(()=>o(!1),1200)},children:i?(0,N.jsx)(a,{}):(0,N.jsx)(Ye,{})})}function hi({row:e,trace:t,missing:n,now:r,onClose:i,className:a}){let o=t??e,s=o?ln(o):!1,c=t?yn(t):void 0,u=t?Hn(t):void 0,d=o?di(o):`Request`,f=o?.durationMs,{extension:p,context:g}=(0,M.useContext)(h),_=p?.slots?.[`request.drawer.tabs`]??[],[v,y]=(0,M.useState)(),x=_.find(e=>e.id===v),ee=x?.component;return(0,N.jsxs)(`aside`,{"aria-label":`Request details`,className:b(`flex flex-col border bg-background`,a),children:[(0,N.jsxs)(`header`,{className:`flex items-center gap-1 border-b p-2 pl-3`,children:[o?.method&&(0,N.jsx)(l,{variant:`outline`,className:`font-mono`,children:o.method}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate pl-1 font-mono text-sm`,title:d,children:d}),o&&(0,N.jsx)(mi,{getValue:()=>ui(o,t,{loading:!t&&!n}),label:`Copy everything about this request`}),(0,N.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`Close details`,onClick:i,children:(0,N.jsx)(Nt,{})})]}),_.length>0&&(0,N.jsx)(`div`,{role:`tablist`,className:`flex gap-1 border-b px-2`,children:[{id:void 0,label:`Details`},..._].map(e=>(0,N.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e.id===x?.id,onClick:()=>y(e.id),className:`-mb-px border-b-2 border-transparent px-2 py-2 text-xs font-medium text-muted-foreground hover:text-foreground aria-selected:border-foreground aria-selected:text-foreground`,children:e.label},e.id??``))}),ee&&(0,N.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,N.jsx)(m,{name:`drawer tab "${x.id}"`,children:(0,N.jsx)(ee,{...g,request:t})},x.id)}),(0,N.jsxs)(`div`,{className:b(`min-h-0 flex-1 overflow-auto`,ee&&`hidden`),children:[o?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{className:`border-b p-3`,children:(0,N.jsx)(pi,{tone:`muted`,title:`Request started`,aside:`${fn(o.startMs)}.${String(Math.floor(o.startMs%1e3)).padStart(3,`0`)}`})}),(0,N.jsxs)(`div`,{className:`border-b`,children:[(0,N.jsx)(fi,{label:`Trace ID`,mono:!0,children:(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[o.traceId,(0,N.jsx)(mi,{getValue:()=>o.traceId,label:`Copy trace ID`,size:`icon-xs`})]})}),o.route&&(0,N.jsx)(fi,{label:`Route`,mono:!0,children:o.route}),o.path&&o.path!==o.route&&(0,N.jsx)(fi,{label:`Path`,mono:!0,children:o.path}),(0,N.jsx)(fi,{label:`Status`,children:(0,N.jsx)(`span`,{className:s?`text-destructive`:`text-positive`,children:o.httpStatus??o.status})}),(0,N.jsx)(fi,{label:`Duration`,children:F(f)}),o.service&&(0,N.jsxs)(fi,{label:`Handled by`,mono:!0,children:[o.service,o.action?`.${o.action}`:``]})]}),c&&(0,N.jsxs)(`div`,{className:`border-b p-3`,children:[c.action&&(0,N.jsxs)(pi,{tone:`muted`,title:`Action`,children:[(0,N.jsx)(fi,{label:`Name`,mono:!0,children:c.action.name.replace(/^action /,``)}),(0,N.jsx)(fi,{label:`Duration`,children:F(c.action.endMs===void 0?void 0:c.action.endMs-c.action.startMs)})]}),c.calls.length>0&&(0,N.jsx)(pi,{tone:`muted`,title:`Service calls`,aside:`${c.calls.length}`,children:c.calls.map(e=>(0,N.jsx)(fi,{label:e.name.replace(/^rpc /,``),mono:!0,children:F(e.endMs===void 0?void 0:e.endMs-e.startMs)},e.spanId))}),c.queries.count>0&&(0,N.jsxs)(pi,{tone:`muted`,title:`Database`,children:[(0,N.jsx)(fi,{label:`Queries`,children:c.queries.count}),(0,N.jsx)(fi,{label:`Total time`,children:F(c.queries.totalMs)}),(0,N.jsx)(fi,{label:`Slowest`,children:F(c.queries.slowestMs)})]}),(0,N.jsx)(pi,{tone:s?`failed`:`ok`,title:t?.status===`running`?`Response in progress`:`Response finished in ${F(f)}`,aside:t?.endMs===void 0?void 0:un(t.endMs,!1)})]}),(c?.exception||o.message)&&(0,N.jsxs)(`div`,{className:`border-b p-3`,children:[(0,N.jsx)(`div`,{className:`mb-2 text-sm font-medium text-destructive`,children:c?.exception?.code??`Error`}),(0,N.jsx)(`p`,{className:`text-sm [overflow-wrap:anywhere]`,children:c?.exception?.message??o.message}),c?.exception?.stack&&(0,N.jsxs)(`details`,{className:`mt-2`,children:[(0,N.jsx)(`summary`,{className:`cursor-pointer text-xs text-muted-foreground`,children:`Stack trace`}),(0,N.jsx)(`pre`,{className:`mt-2 max-h-60 overflow-auto border bg-muted/50 p-3 font-mono text-xs leading-[18px] [overflow-wrap:anywhere] whitespace-pre-wrap`,children:c.exception.stack})]})]})]}):null,u&&(u.entries.length>0||u.dropped>0)&&(0,N.jsxs)(`div`,{className:`border-b`,children:[(0,N.jsxs)(`div`,{className:`px-3 pt-3 text-sm font-medium`,children:[`Logs`,` `,(0,N.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:u.entries.length})]}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-1.5 p-3`,children:[u.entries.map(e=>(0,N.jsxs)(`div`,{className:`grid grid-cols-[56px_36px_minmax(0,1fr)] items-baseline gap-2`,title:e.span,children:[(0,N.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground tabular-nums`,children:[`+`,F(e.timeMs-(t?.startMs??0))]}),(0,N.jsx)(Ut,{level:e.level}),(0,N.jsx)(`span`,{className:`font-mono text-xs leading-[18px] [overflow-wrap:anywhere] whitespace-pre-wrap`,children:e.message})]},e.id)),u.dropped>0&&(0,N.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[u.dropped,` more`,` `,u.dropped===1?`line was`:`lines were`,` not kept: a span keeps its first 100.`]})]})]}),t?(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`px-3 pt-3 text-sm font-medium`,children:`Trace`}),(0,N.jsx)(ii,{trace:t,now:r})]}):(0,N.jsx)(`div`,{className:`grid place-items-center gap-1 px-4 py-10 text-center text-sm text-muted-foreground`,children:n?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{children:`This request is no longer kept`}),(0,N.jsx)(`div`,{className:`text-xs`,children:`Live requests are held in memory; older ones come from history.`})]}):(0,N.jsx)(`div`,{children:`Loading request`})})]})]})}var gi=[0,1,2,3,4],_i=[{label:`Succeeded`,className:`bg-foreground/80`},{label:`Client error`,className:`bg-foreground/35`},{label:`Server error`,className:`bg-destructive`}];function vi(){return(0,N.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:_i.map(e=>(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(`i`,{className:`size-2 rounded-[1px] ${e.className}`}),e.label]},e.label))})}function yi({buckets:e,from:t,to:n,total:r,onBrush:i}){let a=(0,M.useRef)(null),[o,s]=(0,M.useState)(),[c,l]=(0,M.useState)(),u=e??[],d=Math.max(1,...u.map(e=>e.ok+e.client+e.server)),f=n-t,p=e=>{let t=a.current?.getBoundingClientRect();return!t||t.width===0?0:Math.min(1,Math.max(0,(e-t.left)/t.width))},m=o===void 0?void 0:u[o];return(0,N.jsxs)(`div`,{className:`px-4 pt-3 pb-3`,children:[(0,N.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3`,children:[(0,N.jsxs)(`span`,{className:`text-sm font-medium tabular-nums`,children:[hn(r),` requests`]}),(0,N.jsx)(vi,{})]}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:m?`${fn(m.start)} · ${m.ok+m.client+m.server} requests`:i?`Drag across the chart to zoom`:``})]}),(0,N.jsxs)(`div`,{ref:a,className:`relative h-14 touch-none select-none`,style:{cursor:i?`crosshair`:`default`},onPointerDown:e=>{if(!i)return;e.currentTarget.setPointerCapture(e.pointerId);let t=p(e.clientX);l({start:t,end:t})},onPointerMove:e=>{let t=p(e.clientX);u.length>0&&s(Math.min(u.length-1,Math.floor(t*u.length))),l(e=>e&&{...e,end:t})},onPointerUp:()=>{if(c&&i&&Math.abs(c.end-c.start)>.02){let e=Math.min(c.start,c.end),n=Math.max(c.start,c.end);i(Math.round(t+e*f),Math.round(t+n*f))}l(void 0)},onPointerLeave:()=>s(void 0),children:[(0,N.jsxs)(`div`,{className:`absolute inset-0 flex items-end gap-[2px]`,children:[u.map((e,t)=>(0,N.jsxs)(`div`,{className:`flex h-full min-w-0 flex-1 flex-col-reverse`,"data-hover":t===o,children:[(0,N.jsx)(`div`,{className:`block-bars w-full bg-foreground/80`,style:{height:`${e.ok/d*100}%`}}),(0,N.jsx)(`div`,{className:`block-bars w-full bg-foreground/35`,style:{height:`${e.client/d*100}%`}}),(0,N.jsx)(`div`,{className:`block-bars w-full bg-destructive`,style:{height:`${e.server/d*100}%`}})]},e.start)),u.length===0&&(0,N.jsx)(`div`,{className:`h-px w-full self-end border-t border-dashed`})]}),o!==void 0&&!c&&u.length>0&&(0,N.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 bg-foreground/10`,style:{left:`${o/u.length*100}%`,width:`${100/u.length}%`}}),c&&(0,N.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 border-x border-foreground/50 bg-foreground/10`,style:{left:`${Math.min(c.start,c.end)*100}%`,width:`${Math.abs(c.end-c.start)*100}%`}})]}),(0,N.jsx)(`div`,{className:`mt-1 flex justify-between text-xs leading-4 text-muted-foreground tabular-nums`,children:gi.map(e=>(0,N.jsx)(`span`,{children:pn(t+f*e/4,f)},e))})]})}var bi=1e3,xi=e=>String(e).padStart(2,`0`);function Si(e){let t=new Date(e);return`${t.getFullYear()}-${xi(t.getMonth()+1)}-${xi(t.getDate())}T${xi(t.getHours())}:${xi(t.getMinutes())}:${xi(t.getSeconds())}`}function Ci(e){if(!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2})?$/.test(e))return;let t=new Date(e).getTime();return Number.isNaN(t)?void 0:t}function wi(e,t){let n=Ci(e),r=Ci(t);return n===void 0||r===void 0?{problem:`Choose both a start and an end.`}:n>=r?{problem:`The start must be before the end.`}:{window:{from:n,to:r+999}}}var Ti=[{value:`15m`,label:`Last 15 min`},{value:`today`,label:`Today`},{value:`yesterday`,label:`Yesterday`}];function Ei(e,t){if(e===`15m`)return{from:t-900*bi,to:t};let n=new Date(t);if(n.setHours(0,0,0,0),e===`today`)return{from:n.getTime(),to:t};let r=new Date(n);return r.setDate(r.getDate()-1),{from:r.getTime(),to:n.getTime()-1}}var Di=36e5;function Oi({value:e,historyDays:t,onApply:n,onClear:r}){let[i,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)(``),[c,l]=(0,M.useState)(``),u=wi(o,c),d=`problem`in u?u.problem:void 0,f=t=>{if(t){let t=Date.now(),n=e??{from:t-Di,to:t};s(Si(n.from)),l(Si(n.to))}a(t)},p=e=>{let t=Ei(e,Date.now());s(Si(t.from)),l(Si(t.to))};return(0,N.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,N.jsxs)(E,{open:i,onOpenChange:f,children:[(0,N.jsxs)(xe,{render:(0,N.jsx)(A,{variant:`outline`,"aria-label":`Choose a time range`,className:`tabular-nums`}),children:[(0,N.jsx)(Ge,{}),e?`${fn(e.from)} – ${fn(e.to)}`:`Custom`]}),(0,N.jsx)(ge,{children:(0,N.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),`window`in u&&(n(u.window),a(!1))},children:[(0,N.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs font-medium`,children:[`From`,(0,N.jsx)(re,{type:`datetime-local`,step:1,value:o,onChange:e=>s(e.target.value)})]}),(0,N.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs font-medium`,children:[`To`,(0,N.jsx)(re,{type:`datetime-local`,step:1,value:c,onChange:e=>l(e.target.value)})]}),(0,N.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Ti.map(e=>(0,N.jsx)(A,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>p(e.value),children:e.label},e.value))}),d?(0,N.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:d}):(0,N.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Times are in your time zone. History keeps `,t,` `,t===1?`day`:`days`,`.`]}),(0,N.jsx)(`div`,{className:`flex justify-end`,children:(0,N.jsx)(A,{type:`submit`,disabled:d!==void 0,children:`Apply`})})]})})]}),e&&(0,N.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Clear time range`,onClick:r,children:(0,N.jsx)(Nt,{})})]})}var ki=[`live`,...Dn.map(e=>e.value)],Ai=9e5,ji=60,Mi=[{value:`recent`,label:`Newest`},{value:`slowest`,label:`Slowest`}],Ni={ok:`text-positive`,client:`text-destructive`,server:`text-destructive`};function Pi(e,t){let[n,r]=(0,M.useState)(e);return(0,M.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function Fi(e,t){let n=URL.createObjectURL(new Blob([t],{type:`text/csv`})),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),URL.revokeObjectURL(n)}function Ii({children:e,right:t}){return(0,N.jsx)(`span`,{className:b(`truncate`,t&&`text-right`),children:e})}var Li=e=>e?`grid-cols-[150px_minmax(0,84px)_minmax(0,1.2fr)_64px_minmax(0,1fr)] max-md:grid-cols-[130px_minmax(0,76px)_minmax(0,1fr)_60px]`:`grid-cols-[104px_minmax(0,84px)_minmax(0,1.2fr)_64px_minmax(0,1fr)] max-md:grid-cols-[96px_minmax(0,76px)_minmax(0,1fr)_60px]`;function Ri({traces:e,historyDays:t,selectedId:n,activity:r,filterRef:i}){let a=t>0,[o,s]=jn(`brick-dashboard-requests-range`,ki,`live`),[c,l]=(0,M.useState)(),[u,d]=(0,M.useState)(xn),[f,m]=(0,M.useState)(``),[h,g]=(0,M.useState)(!1),_=Pi(f,250),v=(0,M.useMemo)(()=>({...u,query:_}),[u,_]),x=o===`live`&&!c||!a,ee=te(x,1e3),ne=(0,M.useMemo)(()=>e.map(Kt),[e]),S=(0,M.useMemo)(()=>P(ne,v),[ne,v]),C=(0,M.useMemo)(()=>Qt(ne,v),[ne,v]),w=Math.min(ee-Ai,...S.map(e=>e.startMs)),ie={from:w,to:ee},oe=(0,M.useMemo)(()=>en(S,w,ee,ji),[S,w,ee]),ce=Pn({spanMs:On(o===`live`?`7d`:o),fixed:c,enabled:!x},v,r),ue=x?S:ce.rows,de=x?S.length:ce.total,pe=x?C:ce.facets,me=x?oe:ce.volume,he=x?ie:ce.window,ge=(0,M.useMemo)(()=>nn(S),[S]),T=x?ge:ce.summary,_e=(0,M.useMemo)(()=>wn(me),[me]),ve=he.to-he.from>432e5,ye=Sn(v),be=Dn.find(e=>e.value===o),xe=x?`in this run`:c?`in the chosen time`:`in the last ${be?.text??`week`}`,Se=!T||T.total===0,Ce=T?T.clientErrors+T.serverErrors:0,E=e.find(e=>e.traceId===n),D=Fn(n,a&&!E),O=E??D.trace,Te=ue.find(e=>e.traceId===n)??(E?Kt(E):void 0);(0,M.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&(location.hash=p(`requests`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]);let j=e=>{s(e),l(void 0)};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsxs)(A,{variant:`outline`,className:`lg:hidden`,"aria-expanded":h,onClick:()=>g(e=>!e),children:[(0,N.jsx)(at,{}),`Filters`]}),(0,N.jsx)(re,{ref:i,type:`search`,placeholder:`Search by route, path, action, or message`,"aria-label":`Search requests`,value:f,onChange:e=>m(e.target.value),className:`min-w-40 flex-1`}),a&&(0,N.jsxs)(se,{variant:`outline`,spacing:2,"aria-label":`Time range`,value:c?[]:[o],onValueChange:e=>{let t=ki.find(t=>t===e[0]);t&&j(t)},children:[(0,N.jsxs)(ae,{value:`live`,children:[(0,N.jsx)(`i`,{className:b(`size-1.5 rounded-full`,o===`live`&&!c?`animate-pulse bg-positive`:`bg-muted-foreground/60`)}),`Live`]}),Dn.filter(e=>e.ms<=t*864e5+1).map(e=>(0,N.jsx)(ae,{value:e.value,children:e.label},e.value))]}),a&&(0,N.jsx)(Oi,{value:c,historyDays:t,onApply:l,onClear:()=>l(void 0)}),!x&&(0,N.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Refresh requests`,onClick:ce.refresh,children:(0,N.jsx)(ht,{})}),x?(0,N.jsxs)(A,{variant:`outline`,disabled:S.length===0,onClick:()=>Fi(`brick-requests.csv`,on(S)),children:[(0,N.jsx)($e,{}),`Export`]}):(0,N.jsxs)(`a`,{download:!0,href:we(`export`,Cn(he,v)),className:y({variant:`outline`}),children:[(0,N.jsx)($e,{}),`Export`]})]}),!a&&(0,N.jsx)(`p`,{className:`-mt-2 text-xs text-muted-foreground`,children:`Showing this run's requests. Start the dashboard with history on to look back over earlier ones.`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4`,children:[(0,N.jsx)(le,{icon:(0,N.jsx)(je,{}),label:`Requests`,value:T?hn(T.total):`—`,note:ye?`${xe}, matching filters`:xe,spark:_e.requests}),(0,N.jsx)(le,{icon:(0,N.jsx)(kt,{}),label:`Error rate`,value:T&&!Se?mn(Ce/T.total):`—`,note:T&&!Se?`${hn(T.serverErrors)} server, ${hn(T.clientErrors)} client`:void 0,spark:_e.errors}),(0,N.jsx)(le,{icon:(0,N.jsx)(Dt,{}),label:`Median duration`,value:T&&!Se?F(T.medianMs):`—`,note:`of these requests`}),(0,N.jsx)(le,{icon:(0,N.jsx)(tt,{}),label:`Slowest 5%`,value:T&&!Se?F(T.p95Ms):`—`,note:`95th percentile`})]}),(0,N.jsx)(k,{children:(0,N.jsx)(yi,{buckets:me,from:he.from,to:he.to,total:de,onBrush:x?void 0:(e,t)=>l({from:e,to:t})})}),(0,N.jsxs)(`div`,{className:b(`grid items-start gap-4 lg:grid-cols-[230px_minmax(0,1fr)]`,n&&`xl:grid-cols-[230px_minmax(0,1fr)_440px]`),children:[(0,N.jsx)(`div`,{className:b(`lg:sticky lg:top-18 lg:max-h-[calc(100vh-6rem)] lg:overflow-auto`,!h&&`max-lg:hidden`),children:(0,N.jsx)(Qr,{facets:pe,filters:u,onChange:e=>d(e)})}),(0,N.jsxs)(k,{children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-4 py-2`,children:[(0,N.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[ce.failed&&!x?`Could not load history`:`${hn(ue.length)} of ${hn(de)} requests`,x&&` in this run`]}),(0,N.jsx)(se,{variant:`outline`,spacing:2,"aria-label":`Order`,value:[u.sort],onValueChange:e=>{let t=Mi.find(t=>t.value===e[0]);t&&d({...u,sort:t.value})},children:Mi.map(e=>(0,N.jsx)(ae,{value:e.value,children:e.label},e.value))})]}),(0,N.jsxs)(`div`,{className:b(`grid gap-3 border-b px-4 py-2 text-xs text-muted-foreground`,Li(ve)),children:[(0,N.jsx)(Ii,{children:`Time`}),(0,N.jsx)(Ii,{children:`Status`}),(0,N.jsx)(Ii,{children:`Request`}),(0,N.jsx)(Ii,{right:!0,children:`Took`}),(0,N.jsx)(`span`,{className:`truncate max-md:hidden`,children:`Details`})]}),ue.length===0?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(fe,{title:!x&&ce.loading?`Loading requests`:ye?`No requests match these filters`:x?`No requests yet`:`No requests in this range`,hint:!ce.loading&&!ye&&x?`Call your API and it will show up here.`:void 0}),ye&&(0,N.jsx)(`div`,{className:`flex justify-center pb-10`,children:(0,N.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>{d({...xn,sort:u.sort}),m(``)},children:`Clear filters`})})]}):(0,N.jsx)(`div`,{className:`max-h-[calc(100vh-12rem)] min-h-60 overflow-auto`,role:`list`,children:ue.map(e=>(0,N.jsx)(zi,{row:e,withDate:ve,selected:e.traceId===n},e.traceId))}),!x&&ue.length<de&&(0,N.jsx)(`div`,{className:`flex justify-center border-t p-2`,children:(0,N.jsx)(A,{variant:`outline`,size:`sm`,onClick:ce.more,children:`Show more`})})]}),n&&(0,N.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-30 bg-background/60 backdrop-blur-sm xl:hidden`,onClick:()=>{location.hash=p(`requests`)}}),n&&(0,N.jsx)(hi,{row:Te,trace:O,missing:!O&&!E&&(D.missing||!a),now:ee,onClose:()=>{location.hash=p(`requests`)},className:`fixed inset-y-0 right-0 z-40 w-[min(100vw,440px)] shadow-xl xl:sticky xl:top-18 xl:z-auto xl:max-h-[calc(100vh-6rem)] xl:w-auto xl:shadow-none`})]})]})}function zi({row:e,withDate:t,selected:n}){let r=Wt(e),i=e.status===`running`;return(0,N.jsxs)(`a`,{role:`listitem`,href:p(`requests`,e.traceId),"data-selected":n,className:b(`grid min-h-9 items-center gap-3 border-b px-4 text-sm last:border-b-0 hover:bg-muted/50 data-[selected=true]:bg-muted`,Li(t)),children:[(0,N.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground tabular-nums`,children:un(e.startMs,t)}),(0,N.jsxs)(`span`,{className:`flex items-baseline gap-1.5 font-mono text-xs`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:e.method}),i?(0,N.jsx)(`i`,{className:`inline-block size-1.5 animate-pulse self-center rounded-full bg-foreground`}):(0,N.jsx)(`span`,{className:Ni[r],children:e.httpStatus??e.status})]}),(0,N.jsx)(`span`,{className:`truncate`,title:di(e),children:di(e)}),(0,N.jsx)(`span`,{className:`text-right text-xs text-muted-foreground tabular-nums`,children:F(e.durationMs)}),(0,N.jsx)(`span`,{className:b(`truncate text-xs max-md:hidden`,e.message?`text-destructive`:`text-muted-foreground`),title:e.message,children:e.message??(e.service?`${e.service}${e.action?`.${e.action}`:``}`:``)})]})}async function Bi(e,t=fetch){try{let n=await t(`${T.schedules.path}/${encodeURIComponent(e)}`,{method:`POST`});if(!n.ok)return await n.text();let{started:r}=await n.json();return r?null:`'${e}' is running now, so it was not started again.`}catch(e){return e instanceof Error?e.message:String(e)}}var Vi=3e3,Hi=e=>e?fn(Date.parse(e)):`—`;function Ui({run:e}){let t=e.outcome===`failed`?`destructive`:e.outcome===`skipped`?`outline`:`secondary`;return(0,N.jsx)(l,{variant:t,title:`${e.trigger} run of ${e.slot}, try ${e.attempt}: ${e.startedAt} – ${e.finishedAt}${e.error?`\n${e.error}`:``}`,children:e.outcome})}function Wi(){let[e,t]=(0,M.useState)(null),[n,r]=(0,M.useState)(null),[i,a]=(0,M.useState)(null),o=(0,M.useCallback)(async()=>{try{let e=await fetch(T.schedules.path);if(!e.ok)throw Error(await e.text());t(await e.json()),r(null)}catch(e){r(e instanceof Error?e.message:String(e))}},[]);(0,M.useEffect)(()=>{o();let e=setInterval(()=>void o(),Vi);return()=>clearInterval(e)},[o]);let s=async e=>{a(await Bi(e)),o()};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(c,{title:`Schedules`,description:`When each schedule is next due, and its last runs`}),[n,i].map((e,t)=>e&&(0,N.jsx)(`div`,{className:`text-sm text-destructive`,children:e},t)),(0,N.jsx)(k,{children:e?e.length===0?(0,N.jsx)(fe,{title:`This app has no schedules`}):(0,N.jsxs)(Ce,{children:[(0,N.jsx)(ve,{children:(0,N.jsxs)(me,{children:[(0,N.jsx)(w,{className:`px-4`,children:`Schedule`}),(0,N.jsx)(w,{children:`When`}),(0,N.jsx)(w,{children:`Next run`}),(0,N.jsx)(w,{children:`Last success`}),(0,N.jsx)(w,{children:`Last runs`}),(0,N.jsx)(w,{className:`px-4`})]})}),(0,N.jsx)(S,{children:e.map(e=>(0,N.jsxs)(me,{children:[(0,N.jsxs)(O,{className:`px-4 font-mono text-xs`,children:[e.name,e.kind===`workflow`&&(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:` · workflow`})]}),(0,N.jsx)(O,{className:`font-mono text-xs`,children:ue(e)}),(0,N.jsx)(O,{className:`tabular-nums`,children:e.running?(0,N.jsx)(l,{children:`running`}):e.enabled?(0,N.jsxs)(N.Fragment,{children:[Hi(e.nextRunAt),e.attempts>0&&(0,N.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· retry `,e.attempts+1]})]}):(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:`disabled`})}),(0,N.jsx)(O,{className:`text-muted-foreground tabular-nums`,children:Hi(e.lastSuccessAt)}),(0,N.jsx)(O,{children:(0,N.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.runs.slice(0,5).map(e=>(0,N.jsx)(Ui,{run:e},`${e.startedAt}:${e.attempt}`))})}),(0,N.jsx)(O,{className:`px-4 text-right`,children:(0,N.jsx)(A,{size:`xs`,variant:`outline`,disabled:e.running,onClick:()=>void s(e.name),children:`Run now`})})]},e.name))})]}):(0,N.jsx)(fe,{title:`Loading schedules`})})]})}function Gi({available:e,hidden:t}){let[n,r]=(0,M.useState)(e);return(0,M.useEffect)(()=>{e&&r(!0)},[e]),n?(0,N.jsxs)(`div`,{className:b(`relative`,t&&`hidden`),children:[!e&&(0,N.jsx)(`div`,{className:`absolute inset-x-0 top-0 border-b bg-background px-4 py-2 text-center text-xs text-muted-foreground`,children:`The workflow inspector is not running. The app may be restarting.`}),(0,N.jsx)(`iframe`,{title:`Workflow inspector`,src:`${T.workflows.path}/`,className:`h-[calc(100svh-3.5rem)] w-full border-0`,onLoad:e=>{let t=document.querySelector(Se.themeLink),n=e.currentTarget.contentDocument?.head;t&&n&&n.append(t.cloneNode())}})]}):t?null:(0,N.jsx)(fe,{title:`The workflow inspector is not running`,hint:`It needs a workflow listener in the app, and shows its runs once the app is up.`})}var Ki=(0,M.lazy)(()=>mr(()=>import(`./docs-Cye2p0fM.js`),__vite__mapDeps([7,1,2,6,5,3,8])));function qi(e){return e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName))}function Ji({loaded:e={}}){let t=be(),n=ee(),{theme:r,cycle:i}=_(),a=f(`(prefers-color-scheme: dark)`),o=ne(),c=(0,M.useRef)(null),[l,u]=(0,M.useState)(0),v=t.mode===`production`,y=(0,M.useCallback)(e=>!(v&&D.has(e)),[v]),[te,re]=(0,M.useState)(n.view===`apis`),[S,C]=(0,M.useState)(n.view===`workflows`),{nav:w,extension:ie,extensionError:ae}=(0,M.useMemo)(()=>{let n=e=>e.filter(e=>!e.view||y(e.view));try{return{nav:n(x(Lt,e.extension,v)),extension:e.extension,extensionError:e.error??t.extension?.error}}catch(e){return{nav:n(Lt),extension:void 0,extensionError:e instanceof Error?e.message:String(e)}}},[e,v,y,t.extension?.error]),oe=w.find(e=>e.key===d(n)),se=(0,M.useMemo)(()=>({route:n,theme:r===`system`?a?`dark`:`light`:r,production:v,...n.view===`requests`&&n.traceId?{selectedRequestId:n.traceId}:{}}),[n,r,a,v]),le=t.failures[0]?.id??0,ue=n.view===`errors`,pe=`${t.traces.length}:${t.traces[0]?.traceId}:${t.traces[0]?.status}`;(0,M.useEffect)(()=>{n.view===`apis`&&y(`apis`)&&re(!0),n.view===`workflows`&&y(`workflows`)&&C(!0)},[n.view,y]),(0,M.useEffect)(()=>{y(n.view)||location.replace(p(`requests`))},[v,n.view,y]),(0,M.useEffect)(()=>{ue&&u(le)},[ue,le]);let me=le>l,he=t.inspector||(t.architecture?.schema.events?.listeners.some(e=>e.kind===`workflow`)??!1),ge=!!t.architecture?.schema.events?.schedules?.length,_e=(0,M.useCallback)(()=>{n.view===`requests`?c.current?.focus():(location.hash=p(`requests`),setTimeout(()=>c.current?.focus(),0))},[n.view]),{toggle:ve}=o;(0,M.useEffect)(()=>{let e=e=>{e.key.toLowerCase()===`b`&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),ve()):e.key!==`/`||e.metaKey||e.ctrlKey||qi(e.target)||(e.preventDefault(),_e())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_e,ve]);let ye=(0,M.useCallback)(()=>{fetch(T.restart.path,{method:`POST`,headers:{[s]:`1`}})},[]),xe=n.view===`x`?oe?.page:void 0,Se=(0,N.jsx)(ce,{children:(0,N.jsxs)(`div`,{className:`flex min-h-screen`,children:[(0,N.jsx)(Rt,{nav:w,current:oe?.key,sidebar:o,errorCount:t.failures.length,hasNewErrors:me,hasDocs:t.docs!==null,hasWorkflows:he,hasSchedules:ge,production:v}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,N.jsx)(Bt,{current:oe,connected:t.connected,hasNewErrors:me,theme:r,canRestart:t.canRestart,production:v,sidebarOpen:o.visible&&o.expanded,onSidebar:o.toggle,onSearch:_e,onTheme:i,onRestart:ye}),(0,N.jsxs)(`main`,{className:b(`flex flex-col gap-4`,n.view===`apis`||n.view===`docs`||n.view===`workflows`||xe?.url?`p-0`:`p-6 max-sm:p-4`),children:[ae&&(0,N.jsx)(g,{name:`loading`,message:ae}),n.view===`x`&&(xe?(0,N.jsx)(Vt,{page:xe,context:se},xe.id):(0,N.jsx)(fe,{title:`No page named "${n.page??``}"`,hint:`The dashboard extension does not have it, or it is not shown here.`})),n.view===`requests`&&(0,N.jsx)(Ri,{traces:t.traces,historyDays:t.historyDays,selectedId:n.traceId,activity:pe,filterRef:c}),n.view===`overview`&&(0,N.jsx)(Hr,{architecture:t.architecture,traces:t.traces}),te&&y(`apis`)&&(0,N.jsx)(vr,{api:t.api,route:n,traces:t.traces,failures:t.failures,hidden:n.view!==`apis`}),S&&y(`workflows`)&&(0,N.jsx)(Gi,{available:t.inspector,hidden:n.view!==`workflows`}),n.view===`schedules`&&y(`schedules`)&&(0,N.jsx)(Wi,{}),n.view===`docs`&&y(`docs`)&&(0,N.jsx)(M.Suspense,{fallback:(0,N.jsx)(fe,{title:`Loading docs`}),children:(0,N.jsx)(Ki,{docs:t.docs,route:n})}),n.view===`logs`&&(0,N.jsx)(cr,{traces:t.traces}),n.view===`errors`&&(0,N.jsx)(yr,{failures:t.failures,traces:t.traces,canLookBack:t.historyDays>0}),n.view===`reloads`&&(0,N.jsx)(Ur,{reloads:t.reloads})]})]})]})}),Ce=ie?.root;return(0,N.jsx)(de.Provider,{value:t,children:(0,N.jsx)(h.Provider,{value:{extension:ie,context:se},children:Ce?(0,N.jsx)(m,{name:`root`,fallback:Se,children:(0,N.jsx)(Ce,{children:Se})}):Se})})}Object.assign(globalThis,{__brickDashboard:{React:M,ReactDOM:Pt,ReactDOMClient:Ft,jsxRuntime:N}});var Yi=document.getElementById(`root`);if(!Yi)throw Error(`Brick dashboard: missing #root element`);v().then(e=>Ft.createRoot(Yi).render((0,N.jsx)(M.StrictMode,{children:(0,N.jsx)(Ji,{loaded:e})})));export{bn as a,xt as c,Ye as d,qe as f,F as i,pt as l,mr as n,Nt as o,yn as r,kt as s,ii as t,$e as u};
|
|
17
|
+
`)}\n`}function di(e){return(e.route?.includes(`*`)&&e.path?e.path:e.route)??e.name}function fi({label:e,children:t,mono:n}){return(0,N.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 border-b px-3 py-2 text-sm last:border-b-0`,children:[(0,N.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e}),(0,N.jsx)(`span`,{className:b(`min-w-0 text-right [overflow-wrap:anywhere]`,n&&`font-mono text-xs`),children:t})]})}function pi({tone:e,title:t,aside:n,children:r}){return(0,N.jsxs)(`div`,{className:`relative pb-3 pl-6 last:pb-0 before:absolute before:top-3 before:bottom-0 before:left-[5px] before:w-px before:bg-border last:before:hidden`,children:[(0,N.jsx)(`i`,{className:b(`absolute top-1.5 left-0 size-[11px] rounded-full border-2 bg-background`,e===`ok`&&`border-positive bg-positive`,e===`failed`&&`border-destructive bg-destructive`,e===`muted`&&`border-muted-foreground/60`)}),(0,N.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-sm`,children:[(0,N.jsx)(`span`,{className:`font-medium`,children:t}),n&&(0,N.jsx)(`span`,{className:`text-right text-xs text-muted-foreground tabular-nums`,children:n})]}),r&&(0,N.jsx)(`div`,{className:`mt-2 border bg-card`,children:r})]})}function mi({getValue:e,label:t,size:n=`icon`,disabled:r}){let[i,o]=(0,M.useState)(!1);return(0,N.jsx)(A,{variant:`ghost`,size:n,disabled:r,"aria-label":i?`Copied`:t,title:i?`Copied`:t,onClick:()=>{navigator.clipboard?.writeText(e()),o(!0),setTimeout(()=>o(!1),1200)},children:i?(0,N.jsx)(a,{}):(0,N.jsx)(Ye,{})})}function hi({row:e,trace:t,missing:n,now:r,onClose:i,className:a}){let o=t??e,s=o?ln(o):!1,c=t?yn(t):void 0,u=t?Hn(t):void 0,d=o?di(o):`Request`,f=o?.durationMs,{extension:p,context:g}=(0,M.useContext)(h),_=p?.slots?.[`request.drawer.tabs`]??[],[v,y]=(0,M.useState)(),x=_.find(e=>e.id===v),ee=x?.component;return(0,N.jsxs)(`aside`,{"aria-label":`Request details`,className:b(`flex flex-col border bg-background`,a),children:[(0,N.jsxs)(`header`,{className:`flex items-center gap-1 border-b p-2 pl-3`,children:[o?.method&&(0,N.jsx)(l,{variant:`outline`,className:`font-mono`,children:o.method}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate pl-1 font-mono text-sm`,title:d,children:d}),o&&(0,N.jsx)(mi,{getValue:()=>ui(o,t,{loading:!t&&!n}),label:`Copy everything about this request`}),(0,N.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`Close details`,onClick:i,children:(0,N.jsx)(Nt,{})})]}),_.length>0&&(0,N.jsx)(`div`,{role:`tablist`,className:`flex gap-1 border-b px-2`,children:[{id:void 0,label:`Details`},..._].map(e=>(0,N.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e.id===x?.id,onClick:()=>y(e.id),className:`-mb-px border-b-2 border-transparent px-2 py-2 text-xs font-medium text-muted-foreground hover:text-foreground aria-selected:border-foreground aria-selected:text-foreground`,children:e.label},e.id??``))}),ee&&(0,N.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,N.jsx)(m,{name:`drawer tab "${x.id}"`,children:(0,N.jsx)(ee,{...g,request:t})},x.id)}),(0,N.jsxs)(`div`,{className:b(`min-h-0 flex-1 overflow-auto`,ee&&`hidden`),children:[o?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{className:`border-b p-3`,children:(0,N.jsx)(pi,{tone:`muted`,title:`Request started`,aside:`${fn(o.startMs)}.${String(Math.floor(o.startMs%1e3)).padStart(3,`0`)}`})}),(0,N.jsxs)(`div`,{className:`border-b`,children:[(0,N.jsx)(fi,{label:`Trace ID`,mono:!0,children:(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[o.traceId,(0,N.jsx)(mi,{getValue:()=>o.traceId,label:`Copy trace ID`,size:`icon-xs`})]})}),o.route&&(0,N.jsx)(fi,{label:`Route`,mono:!0,children:o.route}),o.path&&o.path!==o.route&&(0,N.jsx)(fi,{label:`Path`,mono:!0,children:o.path}),(0,N.jsx)(fi,{label:`Status`,children:(0,N.jsx)(`span`,{className:s?`text-destructive`:`text-positive`,children:o.httpStatus??o.status})}),(0,N.jsx)(fi,{label:`Duration`,children:F(f)}),o.service&&(0,N.jsxs)(fi,{label:`Handled by`,mono:!0,children:[o.service,o.action?`.${o.action}`:``]})]}),c&&(0,N.jsxs)(`div`,{className:`border-b p-3`,children:[c.action&&(0,N.jsxs)(pi,{tone:`muted`,title:`Action`,children:[(0,N.jsx)(fi,{label:`Name`,mono:!0,children:c.action.name.replace(/^action /,``)}),(0,N.jsx)(fi,{label:`Duration`,children:F(c.action.endMs===void 0?void 0:c.action.endMs-c.action.startMs)})]}),c.calls.length>0&&(0,N.jsx)(pi,{tone:`muted`,title:`Service calls`,aside:`${c.calls.length}`,children:c.calls.map(e=>(0,N.jsx)(fi,{label:e.name.replace(/^rpc /,``),mono:!0,children:F(e.endMs===void 0?void 0:e.endMs-e.startMs)},e.spanId))}),c.queries.count>0&&(0,N.jsxs)(pi,{tone:`muted`,title:`Database`,children:[(0,N.jsx)(fi,{label:`Queries`,children:c.queries.count}),(0,N.jsx)(fi,{label:`Total time`,children:F(c.queries.totalMs)}),(0,N.jsx)(fi,{label:`Slowest`,children:F(c.queries.slowestMs)})]}),(0,N.jsx)(pi,{tone:s?`failed`:`ok`,title:t?.status===`running`?`Response in progress`:`Response finished in ${F(f)}`,aside:t?.endMs===void 0?void 0:un(t.endMs,!1)})]}),(c?.exception||o.message)&&(0,N.jsxs)(`div`,{className:`border-b p-3`,children:[(0,N.jsx)(`div`,{className:`mb-2 text-sm font-medium text-destructive`,children:c?.exception?.code??`Error`}),(0,N.jsx)(`p`,{className:`text-sm [overflow-wrap:anywhere]`,children:c?.exception?.message??o.message}),c?.exception?.stack&&(0,N.jsxs)(`details`,{className:`mt-2`,children:[(0,N.jsx)(`summary`,{className:`cursor-pointer text-xs text-muted-foreground`,children:`Stack trace`}),(0,N.jsx)(`pre`,{className:`mt-2 max-h-60 overflow-auto border bg-muted/50 p-3 font-mono text-xs leading-[18px] [overflow-wrap:anywhere] whitespace-pre-wrap`,children:c.exception.stack})]})]})]}):null,u&&(u.entries.length>0||u.dropped>0)&&(0,N.jsxs)(`div`,{className:`border-b`,children:[(0,N.jsxs)(`div`,{className:`px-3 pt-3 text-sm font-medium`,children:[`Logs`,` `,(0,N.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:u.entries.length})]}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-1.5 p-3`,children:[u.entries.map(e=>(0,N.jsxs)(`div`,{className:`grid grid-cols-[56px_36px_minmax(0,1fr)] items-baseline gap-2`,title:e.span,children:[(0,N.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground tabular-nums`,children:[`+`,F(e.timeMs-(t?.startMs??0))]}),(0,N.jsx)(Ut,{level:e.level}),(0,N.jsx)(`span`,{className:`font-mono text-xs leading-[18px] [overflow-wrap:anywhere] whitespace-pre-wrap`,children:e.message})]},e.id)),u.dropped>0&&(0,N.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[u.dropped,` more`,` `,u.dropped===1?`line was`:`lines were`,` not kept: a span keeps its first 100.`]})]})]}),t?(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`px-3 pt-3 text-sm font-medium`,children:`Trace`}),(0,N.jsx)(ii,{trace:t,now:r})]}):(0,N.jsx)(`div`,{className:`grid place-items-center gap-1 px-4 py-10 text-center text-sm text-muted-foreground`,children:n?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{children:`This request is no longer kept`}),(0,N.jsx)(`div`,{className:`text-xs`,children:`Live requests are held in memory; older ones come from history.`})]}):(0,N.jsx)(`div`,{children:`Loading request`})})]})]})}var gi=[0,1,2,3,4],_i=[{label:`Succeeded`,className:`bg-foreground/80`},{label:`Client error`,className:`bg-foreground/35`},{label:`Server error`,className:`bg-destructive`}];function vi(){return(0,N.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:_i.map(e=>(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)(`i`,{className:`size-2 rounded-[1px] ${e.className}`}),e.label]},e.label))})}function yi({buckets:e,from:t,to:n,total:r,onBrush:i}){let a=(0,M.useRef)(null),[o,s]=(0,M.useState)(),[c,l]=(0,M.useState)(),u=e??[],d=Math.max(1,...u.map(e=>e.ok+e.client+e.server)),f=n-t,p=e=>{let t=a.current?.getBoundingClientRect();return!t||t.width===0?0:Math.min(1,Math.max(0,(e-t.left)/t.width))},m=o===void 0?void 0:u[o];return(0,N.jsxs)(`div`,{className:`px-4 pt-3 pb-3`,children:[(0,N.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3`,children:[(0,N.jsxs)(`span`,{className:`text-sm font-medium tabular-nums`,children:[hn(r),` requests`]}),(0,N.jsx)(vi,{})]}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:m?`${fn(m.start)} · ${m.ok+m.client+m.server} requests`:i?`Drag across the chart to zoom`:``})]}),(0,N.jsxs)(`div`,{ref:a,className:`relative h-14 touch-none select-none`,style:{cursor:i?`crosshair`:`default`},onPointerDown:e=>{if(!i)return;e.currentTarget.setPointerCapture(e.pointerId);let t=p(e.clientX);l({start:t,end:t})},onPointerMove:e=>{let t=p(e.clientX);u.length>0&&s(Math.min(u.length-1,Math.floor(t*u.length))),l(e=>e&&{...e,end:t})},onPointerUp:()=>{if(c&&i&&Math.abs(c.end-c.start)>.02){let e=Math.min(c.start,c.end),n=Math.max(c.start,c.end);i(Math.round(t+e*f),Math.round(t+n*f))}l(void 0)},onPointerLeave:()=>s(void 0),children:[(0,N.jsxs)(`div`,{className:`absolute inset-0 flex items-end gap-[2px]`,children:[u.map((e,t)=>(0,N.jsxs)(`div`,{className:`flex h-full min-w-0 flex-1 flex-col-reverse`,"data-hover":t===o,children:[(0,N.jsx)(`div`,{className:`block-bars w-full bg-foreground/80`,style:{height:`${e.ok/d*100}%`}}),(0,N.jsx)(`div`,{className:`block-bars w-full bg-foreground/35`,style:{height:`${e.client/d*100}%`}}),(0,N.jsx)(`div`,{className:`block-bars w-full bg-destructive`,style:{height:`${e.server/d*100}%`}})]},e.start)),u.length===0&&(0,N.jsx)(`div`,{className:`h-px w-full self-end border-t border-dashed`})]}),o!==void 0&&!c&&u.length>0&&(0,N.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 bg-foreground/10`,style:{left:`${o/u.length*100}%`,width:`${100/u.length}%`}}),c&&(0,N.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 border-x border-foreground/50 bg-foreground/10`,style:{left:`${Math.min(c.start,c.end)*100}%`,width:`${Math.abs(c.end-c.start)*100}%`}})]}),(0,N.jsx)(`div`,{className:`mt-1 flex justify-between text-xs leading-4 text-muted-foreground tabular-nums`,children:gi.map(e=>(0,N.jsx)(`span`,{children:pn(t+f*e/4,f)},e))})]})}var bi=1e3,xi=e=>String(e).padStart(2,`0`);function Si(e){let t=new Date(e);return`${t.getFullYear()}-${xi(t.getMonth()+1)}-${xi(t.getDate())}T${xi(t.getHours())}:${xi(t.getMinutes())}:${xi(t.getSeconds())}`}function Ci(e){if(!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2})?$/.test(e))return;let t=new Date(e).getTime();return Number.isNaN(t)?void 0:t}function wi(e,t){let n=Ci(e),r=Ci(t);return n===void 0||r===void 0?{problem:`Choose both a start and an end.`}:n>=r?{problem:`The start must be before the end.`}:{window:{from:n,to:r+999}}}var Ti=[{value:`15m`,label:`Last 15 min`},{value:`today`,label:`Today`},{value:`yesterday`,label:`Yesterday`}];function Ei(e,t){if(e===`15m`)return{from:t-900*bi,to:t};let n=new Date(t);if(n.setHours(0,0,0,0),e===`today`)return{from:n.getTime(),to:t};let r=new Date(n);return r.setDate(r.getDate()-1),{from:r.getTime(),to:n.getTime()-1}}var Di=36e5;function Oi({value:e,historyDays:t,onApply:n,onClear:r}){let[i,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)(``),[c,l]=(0,M.useState)(``),u=wi(o,c),d=`problem`in u?u.problem:void 0,f=t=>{if(t){let t=Date.now(),n=e??{from:t-Di,to:t};s(Si(n.from)),l(Si(n.to))}a(t)},p=e=>{let t=Ei(e,Date.now());s(Si(t.from)),l(Si(t.to))};return(0,N.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,N.jsxs)(E,{open:i,onOpenChange:f,children:[(0,N.jsxs)(xe,{render:(0,N.jsx)(A,{variant:`outline`,"aria-label":`Choose a time range`,className:`tabular-nums`}),children:[(0,N.jsx)(Ge,{}),e?`${fn(e.from)} – ${fn(e.to)}`:`Custom`]}),(0,N.jsx)(ge,{children:(0,N.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),`window`in u&&(n(u.window),a(!1))},children:[(0,N.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs font-medium`,children:[`From`,(0,N.jsx)(re,{type:`datetime-local`,step:1,value:o,onChange:e=>s(e.target.value)})]}),(0,N.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs font-medium`,children:[`To`,(0,N.jsx)(re,{type:`datetime-local`,step:1,value:c,onChange:e=>l(e.target.value)})]}),(0,N.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Ti.map(e=>(0,N.jsx)(A,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>p(e.value),children:e.label},e.value))}),d?(0,N.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:d}):(0,N.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Times are in your time zone. History keeps `,t,` `,t===1?`day`:`days`,`.`]}),(0,N.jsx)(`div`,{className:`flex justify-end`,children:(0,N.jsx)(A,{type:`submit`,disabled:d!==void 0,children:`Apply`})})]})})]}),e&&(0,N.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Clear time range`,onClick:r,children:(0,N.jsx)(Nt,{})})]})}var ki=[`live`,...Dn.map(e=>e.value)],Ai=9e5,ji=60,Mi=[{value:`recent`,label:`Newest`},{value:`slowest`,label:`Slowest`}],Ni={ok:`text-positive`,client:`text-destructive`,server:`text-destructive`};function Pi(e,t){let[n,r]=(0,M.useState)(e);return(0,M.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function Fi(e,t){let n=URL.createObjectURL(new Blob([t],{type:`text/csv`})),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),URL.revokeObjectURL(n)}function Ii({children:e,right:t}){return(0,N.jsx)(`span`,{className:b(`truncate`,t&&`text-right`),children:e})}var Li=e=>e?`grid-cols-[150px_minmax(0,84px)_minmax(0,1.2fr)_64px_minmax(0,1fr)] max-md:grid-cols-[130px_minmax(0,76px)_minmax(0,1fr)_60px]`:`grid-cols-[104px_minmax(0,84px)_minmax(0,1.2fr)_64px_minmax(0,1fr)] max-md:grid-cols-[96px_minmax(0,76px)_minmax(0,1fr)_60px]`;function Ri({traces:e,historyDays:t,selectedId:n,activity:r,filterRef:i}){let a=t>0,[o,s]=jn(`brick-dashboard-requests-range`,ki,`live`),[c,l]=(0,M.useState)(),[u,d]=(0,M.useState)(xn),[f,m]=(0,M.useState)(``),[h,g]=(0,M.useState)(!1),_=Pi(f,250),v=(0,M.useMemo)(()=>({...u,query:_}),[u,_]),x=o===`live`&&!c||!a,ee=te(x,1e3),ne=(0,M.useMemo)(()=>e.map(Kt),[e]),S=(0,M.useMemo)(()=>P(ne,v),[ne,v]),C=(0,M.useMemo)(()=>Qt(ne,v),[ne,v]),w=Math.min(ee-Ai,...S.map(e=>e.startMs)),ie={from:w,to:ee},oe=(0,M.useMemo)(()=>en(S,w,ee,ji),[S,w,ee]),ce=Pn({spanMs:On(o===`live`?`7d`:o),fixed:c,enabled:!x},v,r),ue=x?S:ce.rows,de=x?S.length:ce.total,pe=x?C:ce.facets,me=x?oe:ce.volume,he=x?ie:ce.window,ge=(0,M.useMemo)(()=>nn(S),[S]),T=x?ge:ce.summary,_e=(0,M.useMemo)(()=>wn(me),[me]),ve=he.to-he.from>432e5,ye=Sn(v),be=Dn.find(e=>e.value===o),xe=x?`in this run`:c?`in the chosen time`:`in the last ${be?.text??`week`}`,Se=!T||T.total===0,Ce=T?T.clientErrors+T.serverErrors:0,E=e.find(e=>e.traceId===n),D=Fn(n,a&&!E),O=E??D.trace,Te=ue.find(e=>e.traceId===n)??(E?Kt(E):void 0);(0,M.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&(location.hash=p(`requests`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]);let j=e=>{s(e),l(void 0)};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsxs)(A,{variant:`outline`,className:`lg:hidden`,"aria-expanded":h,onClick:()=>g(e=>!e),children:[(0,N.jsx)(at,{}),`Filters`]}),(0,N.jsx)(re,{ref:i,type:`search`,placeholder:`Search by route, path, action, or message`,"aria-label":`Search requests`,value:f,onChange:e=>m(e.target.value),className:`min-w-40 flex-1`}),a&&(0,N.jsxs)(se,{variant:`outline`,spacing:2,"aria-label":`Time range`,value:c?[]:[o],onValueChange:e=>{let t=ki.find(t=>t===e[0]);t&&j(t)},children:[(0,N.jsxs)(ae,{value:`live`,children:[(0,N.jsx)(`i`,{className:b(`size-1.5 rounded-full`,o===`live`&&!c?`animate-pulse bg-positive`:`bg-muted-foreground/60`)}),`Live`]}),Dn.filter(e=>e.ms<=t*864e5+1).map(e=>(0,N.jsx)(ae,{value:e.value,children:e.label},e.value))]}),a&&(0,N.jsx)(Oi,{value:c,historyDays:t,onApply:l,onClear:()=>l(void 0)}),!x&&(0,N.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Refresh requests`,onClick:ce.refresh,children:(0,N.jsx)(ht,{})}),x?(0,N.jsxs)(A,{variant:`outline`,disabled:S.length===0,onClick:()=>Fi(`brick-requests.csv`,on(S)),children:[(0,N.jsx)($e,{}),`Export`]}):(0,N.jsxs)(`a`,{download:!0,href:we(`export`,Cn(he,v)),className:y({variant:`outline`}),children:[(0,N.jsx)($e,{}),`Export`]})]}),!a&&(0,N.jsx)(`p`,{className:`-mt-2 text-xs text-muted-foreground`,children:`Showing this run's requests. Start the dashboard with history on to look back over earlier ones.`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4`,children:[(0,N.jsx)(le,{icon:(0,N.jsx)(je,{}),label:`Requests`,value:T?hn(T.total):`—`,note:ye?`${xe}, matching filters`:xe,spark:_e.requests}),(0,N.jsx)(le,{icon:(0,N.jsx)(kt,{}),label:`Error rate`,value:T&&!Se?mn(Ce/T.total):`—`,note:T&&!Se?`${hn(T.serverErrors)} server, ${hn(T.clientErrors)} client`:void 0,spark:_e.errors}),(0,N.jsx)(le,{icon:(0,N.jsx)(Dt,{}),label:`Median duration`,value:T&&!Se?F(T.medianMs):`—`,note:`of these requests`}),(0,N.jsx)(le,{icon:(0,N.jsx)(tt,{}),label:`Slowest 5%`,value:T&&!Se?F(T.p95Ms):`—`,note:`95th percentile`})]}),(0,N.jsx)(k,{children:(0,N.jsx)(yi,{buckets:me,from:he.from,to:he.to,total:de,onBrush:x?void 0:(e,t)=>l({from:e,to:t})})}),(0,N.jsxs)(`div`,{className:b(`grid items-start gap-4 lg:grid-cols-[230px_minmax(0,1fr)]`,n&&`xl:grid-cols-[230px_minmax(0,1fr)_440px]`),children:[(0,N.jsx)(`div`,{className:b(`lg:sticky lg:top-18 lg:max-h-[calc(100vh-6rem)] lg:overflow-auto`,!h&&`max-lg:hidden`),children:(0,N.jsx)(Qr,{facets:pe,filters:u,onChange:e=>d(e)})}),(0,N.jsxs)(k,{children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-4 py-2`,children:[(0,N.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[ce.failed&&!x?`Could not load history`:`${hn(ue.length)} of ${hn(de)} requests`,x&&` in this run`]}),(0,N.jsx)(se,{variant:`outline`,spacing:2,"aria-label":`Order`,value:[u.sort],onValueChange:e=>{let t=Mi.find(t=>t.value===e[0]);t&&d({...u,sort:t.value})},children:Mi.map(e=>(0,N.jsx)(ae,{value:e.value,children:e.label},e.value))})]}),(0,N.jsxs)(`div`,{className:b(`grid gap-3 border-b px-4 py-2 text-xs text-muted-foreground`,Li(ve)),children:[(0,N.jsx)(Ii,{children:`Time`}),(0,N.jsx)(Ii,{children:`Status`}),(0,N.jsx)(Ii,{children:`Request`}),(0,N.jsx)(Ii,{right:!0,children:`Took`}),(0,N.jsx)(`span`,{className:`truncate max-md:hidden`,children:`Details`})]}),ue.length===0?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(fe,{title:!x&&ce.loading?`Loading requests`:ye?`No requests match these filters`:x?`No requests yet`:`No requests in this range`,hint:!ce.loading&&!ye&&x?`Call your API and it will show up here.`:void 0}),ye&&(0,N.jsx)(`div`,{className:`flex justify-center pb-10`,children:(0,N.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>{d({...xn,sort:u.sort}),m(``)},children:`Clear filters`})})]}):(0,N.jsx)(`div`,{className:`max-h-[calc(100vh-12rem)] min-h-60 overflow-auto`,role:`list`,children:ue.map(e=>(0,N.jsx)(zi,{row:e,withDate:ve,selected:e.traceId===n},e.traceId))}),!x&&ue.length<de&&(0,N.jsx)(`div`,{className:`flex justify-center border-t p-2`,children:(0,N.jsx)(A,{variant:`outline`,size:`sm`,onClick:ce.more,children:`Show more`})})]}),n&&(0,N.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-30 bg-background/60 backdrop-blur-sm xl:hidden`,onClick:()=>{location.hash=p(`requests`)}}),n&&(0,N.jsx)(hi,{row:Te,trace:O,missing:!O&&!E&&(D.missing||!a),now:ee,onClose:()=>{location.hash=p(`requests`)},className:`fixed inset-y-0 right-0 z-40 w-[min(100vw,440px)] shadow-xl xl:sticky xl:top-18 xl:z-auto xl:max-h-[calc(100vh-6rem)] xl:w-auto xl:shadow-none`})]})]})}function zi({row:e,withDate:t,selected:n}){let r=Wt(e),i=e.status===`running`;return(0,N.jsxs)(`a`,{role:`listitem`,href:p(`requests`,e.traceId),"data-selected":n,className:b(`grid min-h-9 items-center gap-3 border-b px-4 text-sm last:border-b-0 hover:bg-muted/50 data-[selected=true]:bg-muted`,Li(t)),children:[(0,N.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground tabular-nums`,children:un(e.startMs,t)}),(0,N.jsxs)(`span`,{className:`flex items-baseline gap-1.5 font-mono text-xs`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:e.method}),i?(0,N.jsx)(`i`,{className:`inline-block size-1.5 animate-pulse self-center rounded-full bg-foreground`}):(0,N.jsx)(`span`,{className:Ni[r],children:e.httpStatus??e.status})]}),(0,N.jsx)(`span`,{className:`truncate`,title:di(e),children:di(e)}),(0,N.jsx)(`span`,{className:`text-right text-xs text-muted-foreground tabular-nums`,children:F(e.durationMs)}),(0,N.jsx)(`span`,{className:b(`truncate text-xs max-md:hidden`,e.message?`text-destructive`:`text-muted-foreground`),title:e.message,children:e.message??(e.service?`${e.service}${e.action?`.${e.action}`:``}`:``)})]})}async function Bi(e,t=fetch){try{let n=await t(`${T.schedules.path}/${encodeURIComponent(e)}`,{method:`POST`});if(!n.ok)return await n.text();let{started:r}=await n.json();return r?null:`'${e}' is running now, so it was not started again.`}catch(e){return e instanceof Error?e.message:String(e)}}var Vi=3e3,Hi=e=>e?fn(Date.parse(e)):`—`;function Ui({run:e}){let t=e.outcome===`failed`?`destructive`:e.outcome===`skipped`?`outline`:`secondary`;return(0,N.jsx)(l,{variant:t,title:`${e.trigger} run of ${e.slot}, try ${e.attempt}: ${e.startedAt} – ${e.finishedAt}${e.error?`\n${e.error}`:``}`,children:e.outcome})}function Wi(){let[e,t]=(0,M.useState)(null),[n,r]=(0,M.useState)(null),[i,a]=(0,M.useState)(null),o=(0,M.useCallback)(async()=>{try{let e=await fetch(T.schedules.path);if(!e.ok)throw Error(await e.text());t(await e.json()),r(null)}catch(e){r(e instanceof Error?e.message:String(e))}},[]);(0,M.useEffect)(()=>{o();let e=setInterval(()=>void o(),Vi);return()=>clearInterval(e)},[o]);let s=async e=>{a(await Bi(e)),o()};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(c,{title:`Schedules`,description:`When each schedule is next due, and its last runs`}),[n,i].map((e,t)=>e&&(0,N.jsx)(`div`,{className:`text-sm text-destructive`,children:e},t)),(0,N.jsx)(k,{children:e?e.length===0?(0,N.jsx)(fe,{title:`This app has no schedules`}):(0,N.jsxs)(Ce,{children:[(0,N.jsx)(ve,{children:(0,N.jsxs)(me,{children:[(0,N.jsx)(w,{className:`px-4`,children:`Schedule`}),(0,N.jsx)(w,{children:`When`}),(0,N.jsx)(w,{children:`Next run`}),(0,N.jsx)(w,{children:`Last success`}),(0,N.jsx)(w,{children:`Last runs`}),(0,N.jsx)(w,{className:`px-4`})]})}),(0,N.jsx)(S,{children:e.map(e=>(0,N.jsxs)(me,{children:[(0,N.jsxs)(O,{className:`px-4 font-mono text-xs`,children:[e.name,e.kind===`workflow`&&(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:` · workflow`})]}),(0,N.jsx)(O,{className:`font-mono text-xs`,children:ue(e)}),(0,N.jsx)(O,{className:`tabular-nums`,children:e.running?(0,N.jsx)(l,{children:`running`}):e.enabled?(0,N.jsxs)(N.Fragment,{children:[Hi(e.nextRunAt),e.attempts>0&&(0,N.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· retry `,e.attempts+1]})]}):(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:`disabled`})}),(0,N.jsx)(O,{className:`text-muted-foreground tabular-nums`,children:Hi(e.lastSuccessAt)}),(0,N.jsx)(O,{children:(0,N.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.runs.slice(0,5).map(e=>(0,N.jsx)(Ui,{run:e},`${e.startedAt}:${e.attempt}`))})}),(0,N.jsx)(O,{className:`px-4 text-right`,children:(0,N.jsx)(A,{size:`xs`,variant:`outline`,disabled:e.running,onClick:()=>void s(e.name),children:`Run now`})})]},e.name))})]}):(0,N.jsx)(fe,{title:`Loading schedules`})})]})}function Gi({available:e,hidden:t}){let[n,r]=(0,M.useState)(e);return(0,M.useEffect)(()=>{e&&r(!0)},[e]),n?(0,N.jsxs)(`div`,{className:b(`relative`,t&&`hidden`),children:[!e&&(0,N.jsx)(`div`,{className:`absolute inset-x-0 top-0 border-b bg-background px-4 py-2 text-center text-xs text-muted-foreground`,children:`The workflow inspector is not running. The app may be restarting.`}),(0,N.jsx)(`iframe`,{title:`Workflow inspector`,src:`${T.workflows.path}/`,className:`h-[calc(100svh-3.5rem)] w-full border-0`,onLoad:e=>{let t=document.querySelector(Se.themeLink),n=e.currentTarget.contentDocument?.head;t&&n&&n.append(t.cloneNode())}})]}):t?null:(0,N.jsx)(fe,{title:`The workflow inspector is not running`,hint:`It needs a workflow listener in the app, and shows its runs once the app is up.`})}var Ki=(0,M.lazy)(()=>mr(()=>import(`./docs-B5JrvjJm.js`),__vite__mapDeps([7,1,2,6,5,3,8])));function qi(e){return e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName))}function Ji({loaded:e={}}){let t=be(),n=ee(),{theme:r,cycle:i}=_(),a=f(`(prefers-color-scheme: dark)`),o=ne(),c=(0,M.useRef)(null),[l,u]=(0,M.useState)(0),v=t.mode===`production`,y=(0,M.useCallback)(e=>!(v&&D.has(e)),[v]),[te,re]=(0,M.useState)(n.view===`apis`),[S,C]=(0,M.useState)(n.view===`workflows`),{nav:w,extension:ie,extensionError:ae}=(0,M.useMemo)(()=>{let n=e=>e.filter(e=>!e.view||y(e.view));try{return{nav:n(x(Lt,e.extension,v)),extension:e.extension,extensionError:e.error??t.extension?.error}}catch(e){return{nav:n(Lt),extension:void 0,extensionError:e instanceof Error?e.message:String(e)}}},[e,v,y,t.extension?.error]),oe=w.find(e=>e.key===d(n)),se=(0,M.useMemo)(()=>({route:n,theme:r===`system`?a?`dark`:`light`:r,production:v,...n.view===`requests`&&n.traceId?{selectedRequestId:n.traceId}:{}}),[n,r,a,v]),le=t.failures[0]?.id??0,ue=n.view===`errors`,pe=`${t.traces.length}:${t.traces[0]?.traceId}:${t.traces[0]?.status}`;(0,M.useEffect)(()=>{n.view===`apis`&&y(`apis`)&&re(!0),n.view===`workflows`&&y(`workflows`)&&C(!0)},[n.view,y]),(0,M.useEffect)(()=>{y(n.view)||location.replace(p(`requests`))},[v,n.view,y]),(0,M.useEffect)(()=>{ue&&u(le)},[ue,le]);let me=le>l,he=t.inspector||(t.architecture?.schema.events?.listeners.some(e=>e.kind===`workflow`)??!1),ge=!!t.architecture?.schema.events?.schedules?.length,_e=(0,M.useCallback)(()=>{n.view===`requests`?c.current?.focus():(location.hash=p(`requests`),setTimeout(()=>c.current?.focus(),0))},[n.view]),{toggle:ve}=o;(0,M.useEffect)(()=>{let e=e=>{e.key.toLowerCase()===`b`&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),ve()):e.key!==`/`||e.metaKey||e.ctrlKey||qi(e.target)||(e.preventDefault(),_e())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_e,ve]);let ye=(0,M.useCallback)(()=>{fetch(T.restart.path,{method:`POST`,headers:{[s]:`1`}})},[]),xe=n.view===`x`?oe?.page:void 0,Se=(0,N.jsx)(ce,{children:(0,N.jsxs)(`div`,{className:`flex min-h-screen`,children:[(0,N.jsx)(Rt,{nav:w,current:oe?.key,sidebar:o,errorCount:t.failures.length,hasNewErrors:me,hasDocs:t.docs!==null,hasWorkflows:he,hasSchedules:ge,production:v}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,N.jsx)(Bt,{current:oe,connected:t.connected,hasNewErrors:me,theme:r,canRestart:t.canRestart,production:v,sidebarOpen:o.visible&&o.expanded,onSidebar:o.toggle,onSearch:_e,onTheme:i,onRestart:ye}),(0,N.jsxs)(`main`,{className:b(`flex flex-col gap-4`,n.view===`apis`||n.view===`docs`||n.view===`workflows`||xe?.url?`p-0`:`p-6 max-sm:p-4`),children:[ae&&(0,N.jsx)(g,{name:`loading`,message:ae}),n.view===`x`&&(xe?(0,N.jsx)(Vt,{page:xe,context:se},xe.id):(0,N.jsx)(fe,{title:`No page named "${n.page??``}"`,hint:`The dashboard extension does not have it, or it is not shown here.`})),n.view===`requests`&&(0,N.jsx)(Ri,{traces:t.traces,historyDays:t.historyDays,selectedId:n.traceId,activity:pe,filterRef:c}),n.view===`overview`&&(0,N.jsx)(Hr,{architecture:t.architecture,traces:t.traces}),te&&y(`apis`)&&(0,N.jsx)(vr,{api:t.api,route:n,traces:t.traces,failures:t.failures,hidden:n.view!==`apis`}),S&&y(`workflows`)&&(0,N.jsx)(Gi,{available:t.inspector,hidden:n.view!==`workflows`}),n.view===`schedules`&&y(`schedules`)&&(0,N.jsx)(Wi,{}),n.view===`docs`&&y(`docs`)&&(0,N.jsx)(M.Suspense,{fallback:(0,N.jsx)(fe,{title:`Loading docs`}),children:(0,N.jsx)(Ki,{docs:t.docs,route:n})}),n.view===`logs`&&(0,N.jsx)(cr,{traces:t.traces}),n.view===`errors`&&(0,N.jsx)(yr,{failures:t.failures,traces:t.traces,canLookBack:t.historyDays>0}),n.view===`reloads`&&(0,N.jsx)(Ur,{reloads:t.reloads})]})]})]})}),Ce=ie?.root;return(0,N.jsx)(de.Provider,{value:t,children:(0,N.jsx)(h.Provider,{value:{extension:ie,context:se},children:Ce?(0,N.jsx)(m,{name:`root`,fallback:Se,children:(0,N.jsx)(Ce,{children:Se})}):Se})})}Object.assign(globalThis,{__brickDashboard:{React:M,ReactDOM:Pt,ReactDOMClient:Ft,jsxRuntime:N}});var Yi=document.getElementById(`root`);if(!Yi)throw Error(`Brick dashboard: missing #root element`);v().then(e=>Ft.createRoot(Yi).render((0,N.jsx)(M.StrictMode,{children:(0,N.jsx)(Ji,{loaded:e})})));export{bn as a,xt as c,Ye as d,qe as f,F as i,pt as l,mr as n,Nt as o,yn as r,kt as s,ii as t,$e as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{U as Custom,G as DefaultResultDisplay,W as default}from"./api-reference-
|
|
1
|
+
export{U as Custom,G as DefaultResultDisplay,W as default}from"./api-reference-BP4ULs5J.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{H as ShikiError,t as addClassToHast,T as applyColorReplacements,n as codeToHast,r as codeToHtml,i as codeToTokens,a as codeToTokensBase,E as codeToTokensWithThemes,o as createBundledHighlighter,s as createCssVariablesTheme,c as createHighlighterCore,l as createHighlighterCoreSync,u as createPositionConverter,D as createShikiInternal,O as createShikiInternalSync,k as createShikiPrimitive,A as createShikiPrimitiveAsync,d as createSingletonShorthands,f as flatTokenVariants,j as getLastGrammarState,p as getSingletonHighlighterCore,m as getTokenStyleObject,h as guessEmbeddedLanguages,g as hastToHtml,M as isNoneTheme,N as isPlainLang,P as isSpecialLang,F as isSpecialTheme,_ as makeSingletonHighlighter,v as makeSingletonHighlighterCore,I as normalizeGetter,L as normalizeTheme,R as resolveColorReplacements,z as splitLines,y as splitToken,b as splitTokens,x as stringifyTokenStyle,B as toArray,S as tokenizeAnsiWithTheme,V as tokenizeWithTheme,C as tokensToHast,w as transformerDecorations}from"./api-reference-
|
|
1
|
+
export{H as ShikiError,t as addClassToHast,T as applyColorReplacements,n as codeToHast,r as codeToHtml,i as codeToTokens,a as codeToTokensBase,E as codeToTokensWithThemes,o as createBundledHighlighter,s as createCssVariablesTheme,c as createHighlighterCore,l as createHighlighterCoreSync,u as createPositionConverter,D as createShikiInternal,O as createShikiInternalSync,k as createShikiPrimitive,A as createShikiPrimitiveAsync,d as createSingletonShorthands,f as flatTokenVariants,j as getLastGrammarState,p as getSingletonHighlighterCore,m as getTokenStyleObject,h as guessEmbeddedLanguages,g as hastToHtml,M as isNoneTheme,N as isPlainLang,P as isSpecialLang,F as isSpecialTheme,_ as makeSingletonHighlighter,v as makeSingletonHighlighterCore,I as normalizeGetter,L as normalizeTheme,R as resolveColorReplacements,z as splitLines,y as splitToken,b as splitTokens,x as stringifyTokenStyle,B as toArray,S as tokenizeAnsiWithTheme,V as tokenizeWithTheme,C as tokensToHast,w as transformerDecorations}from"./api-reference-BP4ULs5J.js";
|