@newrelic/preflight 1.14.13 → 1.14.15
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/dist/dashboard/routes/api-handler.d.ts +3 -1
- package/dist/dashboard/routes/api-handler.d.ts.map +1 -1
- package/dist/dashboard/routes/api-handler.js +79 -2
- package/dist/dashboard/routes/api-handler.js.map +1 -1
- package/dist/dashboard/routes/tool-selection-aggregate.d.ts +3 -0
- package/dist/dashboard/routes/tool-selection-aggregate.d.ts.map +1 -0
- package/dist/dashboard/routes/tool-selection-aggregate.js +62 -0
- package/dist/dashboard/routes/tool-selection-aggregate.js.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/metrics/tool-selection-scorer.d.ts +18 -0
- package/dist/metrics/tool-selection-scorer.d.ts.map +1 -1
- package/dist/metrics/tool-selection-scorer.js +59 -0
- package/dist/metrics/tool-selection-scorer.js.map +1 -1
- package/dist/storage/session-store.d.ts +11 -0
- package/dist/storage/session-store.d.ts.map +1 -1
- package/dist/storage/session-store.js +32 -0
- package/dist/storage/session-store.js.map +1 -1
- package/dist/web/assets/{index-Bdp6UUC4.js → index-D6fu2Tlp.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
6
6
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ye(n):``}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return ye(e.type);case 16:return ye(`Lazy`);case 13:return e.child!==t&&t!==null?ye(`Suspense Fallback`):ye(`Suspense`);case 19:return ye(`SuspenseList`);case 0:case 15:return xe(e.type,!1);case 11:return xe(e.type.render,!1);case 1:return xe(e.type,!0);case 31:return ye(`Activity`);default:return``}}function Ce(e){try{var t=``,n=null;do t+=Se(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
7
|
Error generating stack: `+e.message+`
|
|
8
8
|
`+e.stack}}var we=Object.prototype.hasOwnProperty,Te=t.unstable_scheduleCallback,Ee=t.unstable_cancelCallback,De=t.unstable_shouldYield,Oe=t.unstable_requestPaint,ke=t.unstable_now,Ae=t.unstable_getCurrentPriorityLevel,je=t.unstable_ImmediatePriority,Me=t.unstable_UserBlockingPriority,Ne=t.unstable_NormalPriority,Pe=t.unstable_LowPriority,Fe=t.unstable_IdlePriority,Ie=t.log,Le=t.unstable_setDisableYieldValue,Re=null,ze=null;function Be(e){if(typeof Ie==`function`&&Le(e),ze&&typeof ze.setStrictMode==`function`)try{ze.setStrictMode(Re,e)}catch{}}var Ve=Math.clz32?Math.clz32:We,He=Math.log,Ue=Math.LN2;function We(e){return e>>>=0,e===0?32:31-(He(e)/Ue|0)|0}var Ge=256,Ke=262144,qe=4194304;function F(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function I(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=F(n))):i=F(o):i=F(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=F(n))):i=F(o)):i=F(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xe(){var e=qe;return qe<<=1,!(qe&62914560)&&(qe=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ve(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&et(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function et(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ve(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ve(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:rt(n),(n&(e.suspendedLanes|t))===0?n:0}function rt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function it(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=P.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function ot(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,lt=`__reactProps$`+st,L=`__reactContainer$`+st,ut=`__reactEvents$`+st,dt=`__reactListeners$`+st,ft=`__reactHandles$`+st,pt=`__reactResources$`+st,mt=`__reactMarker$`+st;function ht(e){delete e[ct],delete e[lt],delete e[ut],delete e[dt],delete e[ft]}function gt(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[L]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mf(e);e!==null;){if(n=e[ct])return n;e=mf(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[ct]||e[L]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yt(e){var t=e[pt];return t||=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var xt=new Set,St={};function Ct(e,t){wt(e,t),wt(e+`Capture`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)xt.add(t[e])}var Tt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Et={},Dt={};function Ot(e){return we.call(Dt,e)?!0:we.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function At(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function jt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Mt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Pt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ft(e){if(!e._valueTracker){var t=Nt(e)?`checked`:`value`;e._valueTracker=Pt(e,t,``+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Nt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Mt(t)):e.value!==``+Mt(t)&&(e.value=``+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ht(e,o,Mt(n)):Ht(e,o,Mt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Mt(s):e.removeAttribute(`name`)}function Vt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ft(e);return}n=n==null?``:``+Mt(n),t=t==null?n:``+Mt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ft(e)}function Ht(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ut(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Mt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Wt(e,t,n){if(t!=null&&(t=``+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Mt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ft(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Jt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Yt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Jt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Xt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Zt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Qt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[lt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[lt]||null;if(!a)throw Error(i(90));Bt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&It(r)}break a;case`textarea`:Wt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(xu(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[lt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,"passive",{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return hn=i.slice(e,1<r?1-r:void 0)}function _n(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function vn(){return!0}function yn(){return!1}function bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?vn:yn,this.isPropagationStopped=yn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=m({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=m({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(m({},On,{dataTransfer:0})),jn=bn(m({},Cn,{relatedTarget:0})),Mn=bn(m({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(m({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=bn(m({},xn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=bn(m({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=bn(m({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=bn(m({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=bn(m({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=bn(m({},On,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Gn=bn(m({},xn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=un&&`CompositionEvent`in window,Jn=null;un&&`documentMode`in document&&(Jn=document.documentMode);var Yn=un&&`TextEvent`in window&&!Jn,Xn=un&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function R(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function nr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),hn=mn=pn=null,tr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Xn&&t.locale!==`ko`?null:t.data;default:return null}}var rr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ir(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!rr[e.type]:t===`textarea`}function ar(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=Od(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var or=null,sr=null;function cr(e){xd(e,0)}function lr(e){if(It(vt(e)))return e}function ur(e,t){if(e===`change`)return t}var dr=!1;if(un){var fr;if(un){var pr=`oninput`in document;if(!pr){var mr=document.createElement(`div`);mr.setAttribute(`oninput`,`return;`),pr=typeof mr.oninput==`function`}fr=pr}else fr=!1;dr=fr&&(!document.documentMode||9<document.documentMode)}function hr(){or&&(or.detachEvent(`onpropertychange`,gr),sr=or=null)}function gr(e){if(e.propertyName===`value`&&lr(sr)){var t=[];ar(t,sr,e,nn(e)),cn(cr,t)}}function _r(e,t,n){e===`focusin`?(hr(),or=t,sr=n,or.attachEvent(`onpropertychange`,gr)):e===`focusout`&&hr()}function vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return lr(sr)}function yr(e,t){if(e===`click`)return lr(t)}function br(e,t){if(e===`input`||e===`change`)return lr(t)}function xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Sr=typeof Object.is==`function`?Object.is:xr;function Cr(e,t){if(Sr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!we.call(t,i)||!Sr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lt(e.document)}return t}function Or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var kr=un&&`documentMode`in document&&11>=document.documentMode,Ar=null,jr=null,Mr=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||Ar==null||Ar!==Lt(r)||(r=Ar,`selectionStart`in r&&Or(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mr&&Cr(Mr,r)||(Mr=r,r=Od(jr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var z={animationend:Fr(`Animation`,`AnimationEnd`),animationiteration:Fr(`Animation`,`AnimationIteration`),animationstart:Fr(`Animation`,`AnimationStart`),transitionrun:Fr(`Transition`,`TransitionRun`),transitionstart:Fr(`Transition`,`TransitionStart`),transitioncancel:Fr(`Transition`,`TransitionCancel`),transitionend:Fr(`Transition`,`TransitionEnd`)},Ir={},Lr={};un&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete z.animationend.animation,delete z.animationiteration.animation,delete z.animationstart.animation),`TransitionEvent`in window||delete z.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!z[e])return e;var t=z[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),B=Rr(`animationstart`),Vr=Rr(`transitionrun`),Hr=Rr(`transitionstart`),Ur=Rr(`transitioncancel`),Wr=Rr(`transitionend`),Gr=new Map,Kr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Kr.push(`scrollEnd`);function qr(e,t){Gr.set(e,t),Ct(t,[e])}var Jr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Yr=[],Xr=0,Zr=0;function Qr(){for(var e=Xr,t=Zr=Xr=0;t<e;){var n=Yr[t];Yr[t++]=null;var r=Yr[t];Yr[t++]=null;var i=Yr[t];Yr[t++]=null;var a=Yr[t];if(Yr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ti(n,i,a)}}function V(e,t,n,r){Yr[Xr++]=e,Yr[Xr++]=t,Yr[Xr++]=n,Yr[Xr++]=r,Zr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $r(e,t,n,r){return V(e,t,n,r),ni(e)}function ei(e,t){return V(e,null,null,t),ni(e)}function ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ve(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ni(e){if(50<pu)throw pu=0,mu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function ii(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(e,t,n,r){return new ii(e,t,n,r)}function oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function si(e,t){var n=e.alternate;return n===null?(n=ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ci(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)oi(e)&&(s=1);else if(typeof e==`string`)s=Gf(e,n,le.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ai(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ui(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ai(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ai(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ai(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ui(e,t,n,r){return e=ai(7,e,r,t),e.lanes=n,e}function di(e,t,n){return e=ai(6,e,null,t),e.lanes=n,e}function fi(e){var t=ai(18,null,null,0);return t.stateNode=e,t}function pi(e,t,n){return t=ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mi=new WeakMap;function hi(e,t){if(typeof e==`object`&&e){var n=mi.get(e);return n===void 0?(t={value:e,source:t,stack:Ce(t)},mi.set(e,t),t):n}return{value:e,source:t,stack:Ce(t)}}var gi=[],_i=0,vi=null,yi=0,bi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){gi[_i++]=yi,gi[_i++]=vi,vi=e,yi=t}function Ei(e,t,n){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-Ve(r)-1;r&=~(1<<i),n+=1;var a=32-Ve(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-Ve(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===vi;)vi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null;for(;e===Si;)Si=bi[--xi],bi[xi]=null,wi=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null}function ki(e,t){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,H=!1,Mi=null,Ni=!1,Pi=Error(i(519));function Fi(e){throw Bi(hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Pi}function Ii(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[lt]=r,n){case`dialog`:X(`cancel`,t),X(`close`,t);break;case`iframe`:case`object`:case`embed`:X(`load`,t);break;case`video`:case`audio`:for(n=0;n<yd.length;n++)X(yd[n],t);break;case`source`:X(`error`,t);break;case`img`:case`image`:case`link`:X(`error`,t),X(`load`,t);break;case`details`:X(`toggle`,t);break;case`input`:X(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:X(`invalid`,t);break;case`textarea`:X(`invalid`,t),Gt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Pd(t.textContent,n)?(r.popover!=null&&(X(`beforetoggle`,t),X(`toggle`,t)),r.onScroll!=null&&X(`scroll`,t),r.onScrollEnd!=null&&X(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||Fi(e,!0)}function Li(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Ni=!1;return;case 27:case 3:Ni=!0;return;default:Ai=Ai.return}}function Ri(e){if(e!==Ai)return!1;if(!H)return Li(e),H=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Kd(e.type,e.memoizedProps)),n=!n),n&&ji&&Fi(e),Li(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=pf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=pf(e)}else t===27?(t=ji,ef(e.type)?(e=ff,ff=null,ji=e):ji=t):ji=Ai?df(e.stateNode.nextSibling):null;return!0}function U(){ji=Ai=null,H=!1}function zi(){var e=Mi;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),Mi=null),e}function Bi(e){Mi===null?Mi=[e]:Mi.push(e)}var Vi=oe(null),Hi=null,Ui=null;function Wi(e,t,n){ce(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,se(Vi)}function Ki(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ki(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ki(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ji(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Sr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===fe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!Sr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(i(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=pd(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var pa=N.S;N.S=function(e,t){ru=ke(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=oe(null);function ha(){var e=ma.current;return e===null?Bl.pooledCache:e}function ga(e,t){t===null?ce(ma,ma.current):ce(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(i(460)),ya=Error(i(474)),ba=Error(i(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ca(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e;default:if(typeof t.status==`string`)t.then(en,en);else{if(e=Bl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e}throw Ta=t,va}}function wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ta=e,va):e}}var Ta=null;function Ea(){if(Ta===null)throw Error(i(459));var e=Ta;return Ta=null,e}function Da(e){if(e===va||e===ba)throw Error(i(483))}var Oa=null,ka=0;function Aa(e){var t=ka;return ka+=1,Oa===null&&(Oa=[]),Ca(Oa,e,t)}function ja(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ma(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Na(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=si(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&wa(i)===t.type)?(t=a(t,n.props),ja(t,n),t.return=e,t):(t=li(n.type,n.key,n.props,null,e.mode,r),ja(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ui(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=li(t.type,t.key,t.props,null,e.mode,n),ja(n,t),n.return=e,n;case v:return t=pi(t,e.mode,n),t.return=e,t;case O:return t=wa(t),f(e,t,n)}if(ne(t)||ee(t))return t=ui(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Aa(t),n);if(t.$$typeof===C)return f(e,Qi(e,t),n);Ma(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=wa(n),p(e,t,n,r)}if(ne(n)||ee(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Aa(n),r);if(n.$$typeof===C)return p(e,t,Qi(e,n),r);Ma(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=wa(r),m(e,t,n,r,i)}if(ne(r)||ee(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Aa(r),i);if(r.$$typeof===C)return m(e,t,n,Qi(t,r),i);Ma(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),H&&Ti(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return H&&Ti(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),H&&Ti(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),H&&Ti(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return H&&Ti(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),H&&Ti(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&wa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ui(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=li(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=pi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=wa(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(ee(o)){if(l=ee(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===C)return b(e,r,Qi(e,o),c);Ma(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ni(e),ti(e,null,n),t}return V(e,r,t,n),ni(e)}function Va(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}function Ha(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ia=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Jl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ka(n[e],t)}var Ja=oe(null),Ya=oe(0);function Xa(e,t){e=Kl,ce(Ya,e),ce(Ja,t),Kl=e|t.baseLanes}function Za(){ce(Ya,Kl),ce(Ja,Ja.current)}function Qa(){Kl=Ya.current,se(Ja),se(Ya)}var $a=oe(null),eo=null;function to(e){var t=e.alternate;ce(oo,oo.current&1),ce($a,e),eo===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(eo=e)}function no(e){ce(oo,oo.current),ce($a,e),eo===null&&(eo=e)}function ro(e){e.tag===22?(ce(oo,oo.current),ce($a,e),eo===null&&(eo=e)):io(e)}function io(){ce(oo,oo.current),ce($a,$a.current)}function ao(e){se($a),eo===e&&(eo=null),se(oo)}var oo=oe(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cf(n)||lf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var co=0,W=null,lo=null,uo=null,fo=!1,po=!1,mo=!1,ho=0,go=0,_o=null,vo=0;function yo(){throw Error(i(321))}function bo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sr(e[n],t[n]))return!1;return!0}function xo(e,t,n,r,i,a){return co=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Rs:zs,mo=!1,a=n(r,i),mo=!1,po&&(a=Co(t,n,r,i)),So(e),a}function So(e){N.H=Ls;var t=lo!==null&&lo.next!==null;if(co=0,uo=lo=W=null,fo=!1,go=0,_o=null,t)throw Error(i(300));e===null||tc||(e=e.dependencies,e!==null&&Yi(e)&&(tc=!0))}function Co(e,t,n,r){W=e;var a=0;do{if(po&&(_o=null),go=0,po=!1,25<=a)throw Error(i(301));if(a+=1,uo=lo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Bs,o=t(n,r)}while(po);return o}function wo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?jo(t):t,e=e.useState()[0],(lo===null?null:lo.memoizedState)!==e&&(W.flags|=1024),t}function To(){var e=ho!==0;return ho=0,e}function Eo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Do(e){if(fo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}fo=!1}co=0,uo=lo=W=null,po=!1,go=ho=0,_o=null}function Oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return uo===null?W.memoizedState=uo=e:uo=uo.next=e,uo}function ko(){if(lo===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=lo.next;var t=uo===null?W.memoizedState:uo.next;if(t!==null)uo=t,lo=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));lo=e,e={memoizedState:lo.memoizedState,baseState:lo.baseState,baseQueue:lo.baseQueue,queue:lo.queue,next:null},uo===null?W.memoizedState=uo=e:uo=uo.next=e}return uo}function Ao(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(e){var t=go;return go+=1,_o===null&&(_o=[]),e=Ca(_o,e,t),t=W,(uo===null?t.memoizedState:uo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Rs:zs),e}function Mo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return jo(e);if(e.$$typeof===C)return Zi(e)}throw Error(i(438,String(e)))}function No(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Ao(),W.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Po(e,t){return typeof t==`function`?t(e):t}function Fo(e){return Io(ko(),lo,e)}function Io(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(co&f)===f:(q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ca&&(d=!0);else if((co&p)===p){u=u.next,p===ca&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,W.lanes|=p,Jl|=p;f=u.action,mo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,W.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Sr(o,e.memoizedState)&&(tc=!0,d&&(n=la,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Lo(e){var t=ko(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Sr(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ro(e,t,n){var r=W,a=ko(),o=H;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Sr((lo||a).memoizedState,n);if(s&&(a.memoizedState=n,tc=!0),a=a.queue,ls(Vo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||uo!==null&&uo.memoizedState.tag&1){if(r.flags|=2048,is(9,{destroy:void 0},Bo.bind(null,r,a,n,t),null),Bl===null)throw Error(i(349));o||co&127||zo(r,t,n)}return n}function zo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=Ao(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Bo(e,t,n,r){t.value=n,t.getSnapshot=r,Ho(t)&&Uo(e)}function Vo(e,t,n){return n(function(){Ho(t)&&Uo(e)})}function Ho(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sr(e,n)}catch{return!0}}function Uo(e){var t=ei(e,2);t!==null&&_u(t,e,2)}function Wo(e){var t=Oo();if(typeof e==`function`){var n=e;if(e=n(),mo){Be(!0);try{n()}finally{Be(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t}function Go(e,t,n,r){return e.baseState=n,Io(e,lo,typeof r==`function`?r:Po)}function Ko(e,t,n,r,a){if(Ps(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Jo(e,t,s)}catch(n){Xo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Jo(e,t,a)}catch(n){Xo(e,t,n)}}function Jo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Yo(e,t,n)},function(n){return Xo(e,t,n)}):Yo(e,t,n)}function Yo(e,t,n){t.status=`fulfilled`,t.value=n,Zo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,qo(e,n)))}function Xo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Zo(t),t=t.next;while(t!==r)}e.action=null}function Zo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qo(e,t){return t}function $o(e,t){if(H){var n=Bl.formState;if(n!==null){a:{var r=W;if(H){if(ji){b:{for(var i=ji,a=Ni;i.nodeType!==8;){if(!a){i=null;break b}if(i=df(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=df(i.nextSibling),r=i.data===`F!`;break a}}Fi(r)}r=!1}r&&(t=n[0])}}return n=Oo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:t},n.queue=r,n=js.bind(null,W,r),r.dispatch=n,r=Wo(!1),a=Ns.bind(null,W,!1,r.queue),r=Oo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ko.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function es(e){return ts(ko(),lo,e)}function ts(e,t,n){if(t=Io(e,t,Qo)[0],e=Fo(Po)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=jo(t)}catch(e){throw e===va?ba:e}else r=t;t=ko();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,is(9,{destroy:void 0},ns.bind(null,i,n),null)),[r,a,e]}function ns(e,t){e.action=t}function rs(e){var t=ko(),n=lo;if(n!==null)return ts(t,n,e);ko(),t=t.memoizedState,n=ko();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=Ao(),W.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function as(){return ko().memoizedState}function os(e,t,n,r){var i=Oo();W.flags|=e,i.memoizedState=is(1|t,{destroy:void 0},n,r===void 0?null:r)}function ss(e,t,n,r){var i=ko();r=r===void 0?null:r;var a=i.memoizedState.inst;lo!==null&&r!==null&&bo(r,lo.memoizedState.deps)?i.memoizedState=is(t,a,n,r):(W.flags|=e,i.memoizedState=is(1|t,a,n,r))}function cs(e,t){os(8390656,8,e,t)}function ls(e,t){ss(2048,8,e,t)}function us(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=Ao(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ds(e){var t=ko().memoizedState;return us({ref:t,nextImpl:e}),function(){if(zl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function fs(e,t){return ss(4,2,e,t)}function ps(e,t){return ss(4,4,e,t)}function ms(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function hs(e,t,n){n=n==null?null:n.concat([e]),ss(4,4,ms.bind(null,t,e),n)}function gs(){}function _s(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&bo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vs(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&bo(t,r[1]))return r[0];if(r=e(),mo){Be(!0);try{e()}finally{Be(!1)}}return n.memoizedState=[r,t],r}function ys(e,t,n){return n===void 0||co&1073741824&&!(q&261930)?e.memoizedState=t:(e.memoizedState=n,e=gu(),W.lanes|=e,Jl|=e,n)}function bs(e,t,n,r){return Sr(n,t)?n:Ja.current===null?!(co&42)||co&1073741824&&!(q&261930)?(tc=!0,e.memoizedState=n):(e=gu(),W.lanes|=e,Jl|=e,t):(e=ys(e,n,r),Sr(e,t)||(tc=!0),e)}function xs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Ns(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ms(e,t,fa(c,r),hu(e)):Ms(e,t,r,hu(e))}catch(n){Ms(e,t,{then:function(){},status:`rejected`,reason:n},hu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function Ss(){}function Cs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ws(e).queue;xs(e,a,t,re,n===null?Ss:function(){return Ts(e),n(r)})}function ws(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ts(e){var t=ws(e);t.next===null&&(t=e.alternate.memoizedState),Ms(e,t.next.queue,{},hu())}function Es(){return Zi(ep)}function Ds(){return ko().memoizedState}function Os(){return ko().memoizedState}function ks(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=hu();e=za(n);var r=Ba(t,e,n);r!==null&&(_u(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function As(e,t,n){var r=hu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ps(e)?Fs(t,n):(n=$r(e,t,n,r),n!==null&&(_u(n,e,r),Is(n,t,r)))}function js(e,t,n){Ms(e,t,n,hu())}function Ms(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ps(e))Fs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Sr(s,o))return V(e,t,i,0),Bl===null&&Qr(),!1}catch{}if(n=$r(e,t,i,r),n!==null)return _u(n,e,r),Is(n,t,r),!0}return!1}function Ns(e,t,n,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ps(e)){if(t)throw Error(i(479))}else t=$r(e,n,r,2),t!==null&&_u(t,e,2)}function Ps(e){var t=e.alternate;return e===W||t!==null&&t===W}function Fs(e,t){po=fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Is(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Ls={readContext:Zi,use:Mo,useCallback:yo,useContext:yo,useEffect:yo,useImperativeHandle:yo,useLayoutEffect:yo,useInsertionEffect:yo,useMemo:yo,useReducer:yo,useRef:yo,useState:yo,useDebugValue:yo,useDeferredValue:yo,useTransition:yo,useSyncExternalStore:yo,useId:yo,useHostTransitionStatus:yo,useFormState:yo,useActionState:yo,useOptimistic:yo,useMemoCache:yo,useCacheRefresh:yo};Ls.useEffectEvent=yo;var Rs={readContext:Zi,use:Mo,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:cs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),os(4194308,4,ms.bind(null,t,e),n)},useLayoutEffect:function(e,t){return os(4194308,4,e,t)},useInsertionEffect:function(e,t){os(4,2,e,t)},useMemo:function(e,t){var n=Oo();t=t===void 0?null:t;var r=e();if(mo){Be(!0);try{e()}finally{Be(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Oo();if(n!==void 0){var i=n(t);if(mo){Be(!0);try{n(t)}finally{Be(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=As.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:function(e){e=Wo(e);var t=e.queue,n=js.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(e,t){return ys(Oo(),e,t)},useTransition:function(){var e=Wo(!1);return e=xs.bind(null,W,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=Oo();if(H){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Bl===null)throw Error(i(349));q&127||zo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,cs(Vo.bind(null,r,o,e),[e]),r.flags|=2048,is(9,{destroy:void 0},Bo.bind(null,r,o,n,t),null),n},useId:function(){var e=Oo(),t=Bl.identifierPrefix;if(H){var n=wi,r=Ci;n=(r&~(1<<32-Ve(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ho++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=vo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Es,useFormState:$o,useActionState:$o,useOptimistic:function(e){var t=Oo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ns.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:No,useCacheRefresh:function(){return Oo().memoizedState=ks.bind(null,W)},useEffectEvent:function(e){var t=Oo(),n={impl:e};return t.memoizedState=n,function(){if(zl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},zs={readContext:Zi,use:Mo,useCallback:_s,useContext:Zi,useEffect:ls,useImperativeHandle:hs,useInsertionEffect:fs,useLayoutEffect:ps,useMemo:vs,useReducer:Fo,useRef:as,useState:function(){return Fo(Po)},useDebugValue:gs,useDeferredValue:function(e,t){return bs(ko(),lo.memoizedState,e,t)},useTransition:function(){var e=Fo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Ds,useHostTransitionStatus:Es,useFormState:es,useActionState:es,useOptimistic:function(e,t){return Go(ko(),lo,e,t)},useMemoCache:No,useCacheRefresh:Os};zs.useEffectEvent=ds;var Bs={readContext:Zi,use:Mo,useCallback:_s,useContext:Zi,useEffect:ls,useImperativeHandle:hs,useInsertionEffect:fs,useLayoutEffect:ps,useMemo:vs,useReducer:Lo,useRef:as,useState:function(){return Lo(Po)},useDebugValue:gs,useDeferredValue:function(e,t){var n=ko();return lo===null?ys(n,e,t):bs(n,lo.memoizedState,e,t)},useTransition:function(){var e=Lo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Ds,useHostTransitionStatus:Es,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){var n=ko();return lo===null?(n.baseState=e,[e,n.queue.dispatch]):Go(n,lo,e,t)},useMemoCache:No,useCacheRefresh:Os};Bs.useEffectEvent=ds;function Vs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hu(),i=za(r);i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(_u(t,e,r),Va(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hu(),i=za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(_u(t,e,r),Va(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hu(),r=za(n);r.tag=2,t!=null&&(r.callback=t),t=Ba(e,r,n),t!==null&&(_u(t,e,n),Va(t,e,n))}};function Us(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Cr(n,r)||!Cr(i,a):!0}function G(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Hs.enqueueReplaceState(t,t.state,null)}function Ws(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){Jr(e)}function Ks(e){console.error(e)}function qs(e){Jr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){return n=za(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=za(e),e.tag=3,e}function Qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,a,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Ou():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qu(e,r,a)),!1;case 22:return n.flags|=65536,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),qu(e,r,a)),!1}throw Error(i(435,n.tag))}return qu(e,r,a),Ou(),!1}if(H)return t=$a.current,t===null?(r!==Pi&&(t=Error(i(423),{cause:r}),Bi(hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=hi(r,n),a=Xs(e.stateNode,r,a),Ha(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Pi&&(e=Error(i(422),{cause:r}),Bi(hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=hi(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Xs(n.stateNode,r,e),Ha(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Zs(a),Qs(a,e,n,r),Ha(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(i(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Pa(t,e.child,n,r)}function rc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Xi(t),r=xo(e,t,n,o,a,i),s=To(),e!==null&&!tc?(Eo(e,t,i),Dc(e,t,i)):(H&&s&&Di(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=si(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),ro(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Za(),io(t)):(ga(t,a.cachePool),Xa(t,a),io(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Za(),ro(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Pa(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(H){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(no(t),(e=ji)?(e=sf(e,Ni),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(no(t),a)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(tc||Ji(e,t,n,!1),a=(n&e.childLanes)!==0,tc||a){if(r=Bl,r!==null&&(s=nt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ei(e,s),_u(r,e,s),ec;Ou(),t=uc(e,t,n)}else e=o.treeContext,ji=df(s.nextSibling),Ai=t,H=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=lc(t,r),t.flags|=4096;return t}return e=si(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return Xi(t),n=xo(e,t,n,r,void 0,i),r=To(),e!==null&&!tc?(Eo(e,t,i),Dc(e,t,i)):(H&&r&&Di(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=Co(t,r,n,i),So(e),r=To(),e!==null&&!tc?(Eo(e,t,a),Dc(e,t,a)):(H&&r&&Di(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ri,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Hs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},La(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Vs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Hs.enqueueReplaceState(a,a.state,null),Ga(t,r,a,i),Wa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=ri,typeof u==`object`&&u&&(o=Zi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&G(t,a,r,o),Ia=!1;var f=t.memoizedState;a.state=f,Ga(t,r,a,i),Wa(),l=t.memoizedState,s||f!==l||Ia?(typeof d==`function`&&(Vs(t,n,d,r),l=t.memoizedState),(c=Ia||Us(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ra(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ri,typeof l==`object`&&l&&(c=Zi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&G(t,a,r,c),Ia=!1,f=t.memoizedState,a.state=f,Ga(t,r,a,i),Wa();var p=t.memoizedState;o!==d||f!==p||Ia||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(Vs(t,n,s,r),p=t.memoizedState),(u=Ia||Us(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return U(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:_a()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function bc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(H){if(a?to(t):io(t),(e=ji)?(e=sf(e,Ni),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return lf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=ui(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(to(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(to(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=ui(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Pa(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(to(t),lf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=Bl,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ei(e,r),_u(s,e,r),ec;cf(c)||Ou(),t=Cc(e,t,n)}else cf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=df(c.nextSibling),Ai=t,H=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=si(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ui(c,a,n,null),c.flags|=2):c=si(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=_a():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(to(t),n=e.child,e=n.sibling,n=si(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=ai(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Pa(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Tc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,ce(oo,o),nc(e,t,r,n),r=H?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=si(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=si(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Yi(e))):!0}function kc(e,t,n){switch(t.tag){case 3:pe(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),U();break;case 27:case 5:he(t);break;case 4:pe(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,no(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(to(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(to(t),t.flags|=128,null);to(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ce(oo,oo.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,H&&t.flags&1048576&&Ei(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=wa(t.elementType),t.type=e,typeof e==`function`)oi(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=rc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=te(e)||e,Error(i(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ws(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(pe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ra(e,t),Ga(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),Wa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=gc(e,t,r,n);break a}else if(r!==a){a=hi(Error(i(424)),t),Bi(a),t=gc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ji=df(e.firstChild),Ai=t,H=!0,Mi=null,Ni=!0,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(U(),r===a){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=jf(t.type,null,t.pendingProps,null))?t.memoizedState=n:H||(n=t.type,e=t.pendingProps,r=Ud(de.current).createElement(n),r[ct]=t,r[lt]=e,Ld(r,n,e),bt(r),t.stateNode=r):t.memoizedState=jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return he(t),e===null&&H&&(r=t.stateNode=hf(t.type,t.pendingProps,de.current),Ai=t,Ni=!0,a=ji,ef(t.type)?(ff=a,ji=df(r.firstChild)):ji=a),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&H&&((a=r=ji)&&(r=af(r,t.type,t.pendingProps,Ni),r===null?a=!1:(t.stateNode=r,Ai=t,ji=df(r.firstChild),Ni=!1,a=!0)),a||Fi(t)),he(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Kd(a,o)?r=null:s!==null&&Kd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=xo(e,t,wo,null,null,n),ep._currentValue=a),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&H&&((e=n=ji)&&(n=of(n,t.pendingProps,Ni),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Fi(t)),null;case 13:return bc(e,t,n);case 4:return pe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Xi(t),a=Zi(a),r=r(a),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(a=ha(),a===null&&(a=Bl,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},La(t),Wi(t,ra,a)):((e.lanes&n)!==0&&(Ra(e,t),Ga(t,null,null,n),Wa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Wi(t,ra,r),r!==a.cache&&qi(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Wi(t,ra,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Tu())e.flags|=8192;else throw Ta=xa,ya}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Kf(t))if(Tu())e.flags|=8192;else throw Ta=xa,ya}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,Ql|=t)}function Fc(e,t){if(!H)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ri(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(ge(t),n=de.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=le.current,Ri(t)?Ii(t,e):(e=hf(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(ge(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=le.current,Ri(t))Ii(t,o);else{var s=Ud(de.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ct]=t,o[lt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Ld(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=de.current,Ri(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Pd(e.nodeValue,n)),e||Fi(t,!0)}else e=Ud(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ri(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ct]=t}else U(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ri(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ct]=t}else U(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return me(),e===null&&wd(t.stateNode.containerInfo),Ic(t),null;case 10:return Gi(t.type),Ic(t),null;case 19:if(se(oo),r=t.memoizedState,r===null)return Ic(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Fc(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ci(n,e),n=n.sibling;return ce(oo,oo.current&1|2),H&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ke()>iu&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!H)return Ic(t),null}else 2*ke()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ke(),e.sibling=null,n=oo.current,ce(oo,a?n&1|2:n&1),H&&Ti(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&se(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ge(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));U()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));U()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(oo),null;case 4:return me(),null;case 10:return Gi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&se(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function zc(e,t){switch(Oi(t),t.tag){case 3:Gi(ra),me();break;case 26:case 27:case 5:ge(t);break;case 4:me();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:se(oo);break;case 10:Gi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&se(ma);break;case 24:Gi(ra)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ku(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ku(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ku(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Ku(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ku(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ku(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ku(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ku(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ku(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Rd(r,e.type,n,t),r[lt]=t}catch(t){Ku(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ef(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ef(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=en));else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ld(t,r,n),t[ct]=e,t[lt]=n}catch(t){Ku(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Vd=lp,e=Dr(e),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Hd={focusedElem:e,selectionRange:n},lp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ku(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)rf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:rf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ku(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ku(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{qa(e,t)}catch(e){Ku(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),uf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(ze&&typeof ze.onCommitFiberUnmount==`function`)try{ze.onCommitFiberUnmount(Re,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;ef(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),gf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Ku(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Ku(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,tf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Fp(e)):tf(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fp(e)}catch(e){Ku(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fp(e)}catch(e){Ku(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(ef(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[mt]||o[ct]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Ld(o,r,n),o[ct]=e,bt(o),r=o;break a;case`link`:var s=Uf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Ld(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Uf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Ld(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ct]=e,bt(o),r=o}e.stateNode=r}else Wf(a,e.type,e.stateNode);else e.stateNode=Rf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Wf(a,e.type,e.stateNode):Rf(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{Kt(a,``)}catch(t){Ku(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ku(e,e.return,t)}}break;case 3:if(Hf=null,a=gl,gl=Z(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(t){Ku(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=Z(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=ke()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ku(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ku(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?nf(m,!0):nf(l.stateNode,!1)}catch(e){Ku(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Kt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Ku(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:gf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ku(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ka(c[i],s)}catch(e){Ku(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&aa(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ku(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&qf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=Z(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,zl=0,Bl=null,K=null,q=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,J=0,su=null,cu=null,lu=0,uu=0,du=null,fu=null,pu=0,mu=null;function hu(){return zl&2&&q!==0?q&-q:N.T===null?at():pd()}function gu(){if(Zl===0)if(!(q&536870912)||H){var e=Ke;Ke<<=1,!(Ke&3932160)&&(Ke=262144),Zl=e}else Zl=536870912;return e=$a.current,e!==null&&(e.flags|=32),Zl}function _u(e,t,n){(e===Bl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,q,Zl,!1)),Qe(e,n),(!(zl&2)||e!==Bl)&&(e===Bl&&(!(zl&2)&&(Yl|=n),ql===4&&bu(e,q,Zl,!1)),ad(e))}function vu(e,t,n){if(zl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Je(e,t),a=r?ju(e,t):ku(e,t,!0),o=r;do{if(a===0){Wl&&!r&&bu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Y(n)){a=ku(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Cu(e,0),bu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:bu(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-ke(),10<a)){if(bu(r,t,Zl,!Ul),I(r,0,!0)!==0)break a;lu=t,r.timeoutHandle=Yd(yu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),a);break a}yu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}}break}while(1);ad(e)}function yu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:en},jl(t,a,d);var m=(a&62914560)===a?nu-ke():(a&4194048)===a?ru-ke():0;if(m=Yf(d,m),m!==null){lu=a,e.cancelPendingCommit=m(Ru.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),bu(e,a,o,!l);return}}Ru(e,t,a,n,r,i,o,s,c)}function Y(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Sr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bu(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ve(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&et(e,n,t)}function xu(){return zl&6?!0:(od(0,!1),!1)}function Su(){if(K!==null){if(Vl===0)var e=K.return;else e=K,Ui=Hi=null,Do(e),Oa=null,ka=0,e=K;for(;e!==null;)zc(e.alternate,e),e=e.return;K=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Xd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),lu=0,Su(),Bl=e,K=n=si(e.current,null),q=t,Vl=0,Hl=null,Ul=!1,Wl=Je(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ve(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,Qr(),n}function wu(e,t){W=null,N.H=Ls,t===va||t===ba?(t=Ea(),Vl=3):t===ya?(t=Ea(),Vl=4):Vl=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,K===null&&(ql=1,Js(e,hi(t,e.current)))}function Tu(){var e=$a.current;return e===null?!0:(q&4194048)===q?eo===null:(q&62914560)===q||q&536870912?e===eo:!1}function Eu(){var e=N.H;return N.H=Ls,e===null?Ls:e}function Du(){var e=N.A;return N.A=Ll,e}function Ou(){ql=4,Ul||(q&4194048)!==q&&$a.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||Bl===null||bu(Bl,q,Zl,!1)}function ku(e,t,n){var r=zl;zl|=2;var i=Eu(),a=Du();(Bl!==e||q!==t)&&(au=null,Cu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&K!==null){var s=K,c=Hl;switch(Vl){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Fu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Fu(e,s,c,l)}}Au(),o=ql;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,zl=r,N.H=i,N.A=a,K===null&&(Bl=null,q=0,Qr()),o}function Au(){for(;K!==null;)Nu(K)}function ju(e,t){var n=zl;zl|=2;var r=Eu(),a=Du();Bl!==e||q!==t?(au=null,iu=ke()+500,Cu(e,t)):Wl=Je(e,t);a:do try{if(Vl!==0&&K!==null){t=K;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Fu(e,t,o,1);break;case 2:case 9:if(Sa(o)){Vl=0,Hl=null,Pu(t);break}t=function(){Vl!==2&&Vl!==9||Bl!==e||(Vl=7),ad(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:Sa(o)?(Vl=0,Hl=null,Pu(t)):(Vl=0,Hl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(K.tag){case 26:s=K.memoizedState;case 5:case 27:var c=K;if(s?Kf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)K=l;else{var u=c.return;u===null?K=null:(K=u,Iu(u))}break b}}Vl=0,Hl=null,Fu(e,t,o,5);break;case 6:Vl=0,Hl=null,Fu(e,t,o,6);break;case 8:Su(),ql=6;break a;default:throw Error(i(462))}}Mu();break}catch(t){wu(e,t)}while(1);return Ui=Hi=null,N.H=r,N.A=a,zl=n,K===null?(Bl=null,q=0,Qr(),ql):0}function Mu(){for(;K!==null&&!De();)Nu(K)}function Nu(e){var t=Ac(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Iu(e):K=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,q);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,q);break;case 5:Do(t);default:zc(n,t),t=K=ci(t,Kl),t=Ac(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):K=t}function Fu(e,t,n,r){Ui=Hi=null,Do(t),Oa=null,ka=0;var i=t.return;try{if($s(e,i,t,n,q)){ql=1,Js(e,hi(n,e.current)),K=null;return}}catch(t){if(i!==null)throw K=i,t;ql=1,Js(e,hi(n,e.current)),K=null;return}t.flags&32768?(H||r===1?e=!0:Wl||q&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),Lu(t,e)):Iu(t)}function Iu(e){var t=e;do{if(t.flags&32768){Lu(t,Ul);return}e=t.return;var n=Lc(t.alternate,t,Kl);if(n!==null){K=n;return}if(t=t.sibling,t!==null){K=t;return}K=t=e}while(t!==null);ql===0&&(ql=5)}function Lu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,K=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){K=e;return}K=e=n}while(e!==null);ql=6,K=null}function Ru(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(J!==0);if(zl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Zr,$e(e,n,o,s,c,l),e===Bl&&(K=Bl=null,q=0),cu=t,su=e,lu=n,uu=o,du=a,fu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(Ne,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=zl,zl|=4;try{il(e,t,n)}finally{zl=s,P.p=a,N.T=r}}J=1,zu(),Bu(),Vu()}}function zu(){if(J===1){J=0;var e=su,t=cu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=zl;zl|=4;try{_l(t,e);var a=Hd,o=Dr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Er(s.ownerDocument.documentElement,s)){if(c!==null&&Or(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Tr(s,h),v=Tr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}lp=!!Vd,Hd=Vd=null}finally{zl=i,P.p=r,N.T=n}}e.current=t,J=2}}function Bu(){if(J===2){J=0;var e=su,t=cu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=zl;zl|=4;try{al(e,t.alternate,t)}finally{zl=i,P.p=r,N.T=n}}J=3}}function Vu(){if(J===4||J===3){J=0,Oe();var e=su,t=cu,n=lu,r=fu;t.subtreeFlags&10256||t.flags&10256?J=5:(J=0,cu=su=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),it(n),t=t.stateNode,ze&&typeof ze.onCommitFiberRoot==`function`)try{ze.onCommitFiberRoot(Re,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}lu&3&&Uu(),ad(e),i=e.pendingLanes,n&261930&&i&42?e===mu?pu++:(pu=0,mu=e):pu=0,od(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Uu(){return zu(),Bu(),Vu(),Wu()}function Wu(){if(J!==5)return!1;var e=su,t=uu;uu=0;var n=it(lu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=du,du=null;var o=su,s=lu;if(J=0,cu=su=null,lu=0,zl&6)throw Error(i(331));var c=zl;if(zl|=4,Pl(o.current),El(o,o.current,s,n),zl=c,od(0,!1),ze&&typeof ze.onPostCommitFiberRoot==`function`)try{ze.onPostCommitFiberRoot(Re,o)}catch{}return!0}finally{P.p=a,N.T=r,Hu(e,t)}}function Gu(e,t,n){t=hi(n,t),t=Xs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(Qe(e,2),ad(e))}function Ku(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=hi(n,e),n=Zs(2),r=Ba(t,n,2),r!==null&&(Qs(n,r,t,e),Qe(r,2),ad(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Gl=!0,i.add(n),e=Ju.bind(null,e,t,n),t.then(e,e))}function Ju(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bl===e&&(q&n)===n&&(ql===4||ql===3&&(q&62914560)===q&&300>ke()-nu?!(zl&2)&&Cu(e,0):Xl|=n,Ql===q&&(Ql=0)),ad(e)}function Yu(e,t){t===0&&(t=Xe()),e=ei(e,t),e!==null&&(Qe(e,t),ad(e))}function Xu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yu(e,n)}function Zu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Yu(e,n)}function Qu(e,t){return Te(e,t)}var $u=null,ed=null,td=!1,nd=!1,rd=!1,id=0;function ad(e){e!==ed&&e.next===null&&(ed===null?$u=ed=e:ed=ed.next=e),nd=!0,td||(td=!0,fd())}function od(e,t){if(!rd&&nd){rd=!0;do for(var n=!1,r=$u;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ve(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,dd(r,a))}else a=q,a=I(r,r===Bl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,dd(r,a));r=r.next}while(n);rd=!1}}function sd(){cd()}function cd(){nd=td=!1;var e=0;id!==0&&Jd()&&(e=id);for(var t=ke(),n=null,r=$u;r!==null;){var i=r.next,a=ld(r,t);a===0?(r.next=null,n===null?$u=i:n.next=i,i===null&&(ed=n)):(n=r,(e!==0||a&3)&&(nd=!0)),r=i}J!==0&&J!==5||od(e,!1),id!==0&&(id=0)}function ld(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ve(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Bl,n=q,n=I(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ee(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ee(r),it(n)){case 2:case 8:n=Me;break;case 32:n=Ne;break;case 268435456:n=Fe;break;default:n=Ne}return r=ud.bind(null,e),n=Te(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ee(r),e.callbackPriority=2,e.callbackNode=null,2}function ud(e,t){if(J!==0&&J!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=q;return r=I(e,e===Bl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(vu(e,r,t),ld(e,ke()),e.callbackNode!=null&&e.callbackNode===n?ud.bind(null,e):null)}function dd(e,t){if(Uu())return null;vu(e,t,!0)}function fd(){Qd(function(){zl&6?Te(je,sd):cd()})}function pd(){if(id===0){var e=ca;e===0&&(e=Ge,Ge<<=1,!(Ge&261888)&&(Ge=256)),id=e}return id}function md(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function hd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function gd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=md((i[lt]||null).action),o=r.submitter;o&&(t=(t=o[lt]||null)?md(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(id!==0){var e=o?hd(i,o):new FormData(i);Cs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?hd(i,o):new FormData(i),Cs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var _d=0;_d<Kr.length;_d++){var vd=Kr[_d];qr(vd.toLowerCase(),`on`+(vd[0].toUpperCase()+vd.slice(1)))}qr(zr,`onAnimationEnd`),qr(Br,`onAnimationIteration`),qr(B,`onAnimationStart`),qr(`dblclick`,`onDoubleClick`),qr(`focusin`,`onFocus`),qr(`focusout`,`onBlur`),qr(Vr,`onTransitionRun`),qr(Hr,`onTransitionStart`),qr(Ur,`onTransitionCancel`),qr(Wr,`onTransitionEnd`),wt(`onMouseEnter`,[`mouseout`,`mouseover`]),wt(`onMouseLeave`,[`mouseout`,`mouseover`]),wt(`onPointerEnter`,[`pointerout`,`pointerover`]),wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ct(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ct(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ct(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ct(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var yd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),bd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(yd));function xd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Jr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Jr(e)}i.currentTarget=null,a=c}}}}function X(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+`__bubble`;n.has(r)||(Td(t,e,2,!1),n.add(r))}function Sd(e,t,n){var r=0;t&&(r|=4),Td(n,e,r,t)}var Cd=`_reactListening`+Math.random().toString(36).slice(2);function wd(e){if(!e[Cd]){e[Cd]=!0,xt.forEach(function(t){t!==`selectionchange`&&(bd.has(t)||Sd(t,!1,e),Sd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cd]||(t[Cd]=!0,Sd(`selectionchange`,!1,t))}}function Td(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!dn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ed(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=gt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}cn(function(){var r=a,i=nn(n),s=[];a:{var c=Gr.get(e);if(c!==void 0){var l=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:l=Bn;break;case`focusin`:u=`focus`,l=jn;break;case`focusout`:u=`blur`,l=jn;break;case`beforeblur`:case`afterblur`:l=jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Hn;break;case zr:case Br:case B:l=Mn;break;case Wr:l=Un;break;case`scroll`:case`scrollend`:l=wn;break;case`wheel`:l=Wn;break;case`copy`:case`cut`:case`paste`:l=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Vn;break;case`toggle`:case`beforetoggle`:l=Gn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=ln(m,p),g!=null&&d.push(Dd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[L]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?gt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:vt(l),h=u==null?c:vt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,gt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=kd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ad(s,c,l,d,!1),u!==null&&f!==null&&Ad(s,f,u,d,!0)}}a:{if(c=r?vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ur;else if(ir(c))if(dr)v=br;else{v=vr;var y=_r}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Xt(r.elementType)&&(v=ur):v=yr;if(v&&=v(e,r)){ar(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ht(c,`number`,c.value)}switch(y=r?vt(r):window,e){case`focusin`:(ir(y)||y.contentEditable===`true`)&&(Ar=y,jr=r,Mr=null);break;case`focusout`:Mr=jr=Ar=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,Pr(s,n,i);break;case`selectionchange`:if(kr)break;case`keydown`:case`keyup`:Pr(s,n,i)}var b;if(qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=gn()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,tr=!0)),y=Od(r,x),0<y.length&&(x=new Pn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?R(e,n):nr(e,n))&&(x=Od(r,`onBeforeInput`),0<x.length&&(y=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),gd(s,e,r,n,i)}xd(s,t)})}function Dd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Od(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=ln(e,n),i!=null&&r.unshift(Dd(e,i,a)),i=ln(e,t),i!=null&&r.push(Dd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function kd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ad(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=ln(n,a),l!=null&&o.unshift(Dd(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(Dd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var jd=/\r\n?/g,Md=/\u0000|\uFFFD/g;function Nd(e){return(typeof e==`string`?e:``+e).replace(jd,`
|
|
9
|
-
`).replace(Md,``)}function Pd(e,t){return t=Nd(t),Nd(e)===t}function Fd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Fd(e,t,`name`,a.name,a,null),Fd(e,t,`formEncType`,a.formEncType,a,null),Fd(e,t,`formMethod`,a.formMethod,a,null),Fd(e,t,`formTarget`,a.formTarget,a,null)):(Fd(e,t,`encType`,a.encType,a,null),Fd(e,t,`method`,a.method,a,null),Fd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));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=$t(``+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`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`:X(`beforetoggle`,e),X(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,kt(e,n,r))}}function Id(e,t,n,r,a,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[lt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function Ld(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:X(`error`,e),X(`load`,e);var r=!1,a=!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`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Fd(e,t,o,s,n,null)}}a&&Fd(e,t,`srcSet`,n.srcSet,n,null),r&&Fd(e,t,`src`,n.src,n,null);return;case`input`:X(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=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(i(137,t));break;default:Fd(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in X(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Fd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in X(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Fd(e,t,s,c,n,null)}Gt(e,r,a,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:Fd(e,t,l,r,n,null)}return;case`dialog`:X(`beforetoggle`,e),X(`toggle`,e),X(`cancel`,e),X(`close`,e);break;case`iframe`:case`object`:X(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)X(yd[r],e);break;case`image`:X(`error`,e),X(`load`,e);break;case`details`:X(`toggle`,e);break;case`embed`:case`source`:case`link`:X(`error`,e),X(`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(i(137,t));default:Fd(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Id(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Fd(e,t,c,r,n,null))}function Rd(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 a=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)||Fd(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Fd(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,o,a);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)||Fd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Fd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Fd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Fd(e,t,s,a,r,o)}Wt(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:Fd(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`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Fd(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)&&Fd(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(i(137,t));break;default:Fd(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Id(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||Id(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Fd(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||Fd(e,t,f,p,r,m)}function zd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Bd(){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&&zd(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&&zd(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 Vd=null,Hd=null;function Ud(e){return e.nodeType===9?e:e.ownerDocument}function Wd(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 Gd(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 Kd(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 qd=null;function Jd(){var e=window.event;return e&&e.type===`popstate`?e===qd?!1:(qd=e,!0):(qd=null,!1)}var Yd=typeof setTimeout==`function`?setTimeout:void 0,Xd=typeof clearTimeout==`function`?clearTimeout:void 0,Zd=typeof Promise==`function`?Promise:void 0,Qd=typeof queueMicrotask==`function`?queueMicrotask:Zd===void 0?Yd:function(e){return Zd.resolve(null).then(e).catch($d)};function $d(e){setTimeout(function(){throw e})}function ef(e){return e===`head`}function tf(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),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)gf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,gf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&gf(e.ownerDocument.body);n=i}while(n);Fp(t)}function nf(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 rf(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`:rf(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function af(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[mt])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=df(e.nextSibling),e===null)break}return null}function of(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=df(e.nextSibling),e===null))return null;return e}function sf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=df(e.nextSibling),e===null))return null;return e}function cf(e){return e.data===`$?`||e.data===`$~`}function lf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function uf(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 df(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 ff=null;function pf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return df(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mf(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 hf(e,t,n){switch(t=Ud(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var _f=new Map,vf=new Set;function Z(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=P.d;P.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=xu();return e||t}function xf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?Ts(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ld(t,`link`,e),bt(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}_f.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Ld(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!_f.has(a)&&(e=m({rel:`modulepreload`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Ld(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=yt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=_f.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);bt(c),Ld(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,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=yt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0},t),(t=_f.get(i))&&Vf(e,t),a=n.createElement(`script`),bt(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=yt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=_f.get(i))&&Vf(e,t),a=n.createElement(`script`),bt(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=de.current)?Z(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=yt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Mf(n.href);var o=yt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),_f.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_f.set(e,n),o||Ff(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=If(n),n=yt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Mf(e){return`href="`+zt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ld(t,`link`,n),bt(t),e.head.appendChild(t))}function If(e){return`[src="`+zt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Ld(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Pf(n),(a=_f.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ld(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,bt(a),a):(r=n,(a=_f.get(o))&&(r=m({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),Ld(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,zf(r,n.precedence,e));return t.instance}function zf(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 Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,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[mt]||a[ct]||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 Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(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 Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(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=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Pf(r),(i=_f.get(i))&&Bf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ld(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*Bd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function tp(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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ai(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},La(a),e}function rp(e){return e?(e=ri,e):ri}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ba(e,r,t),n!==null&&(_u(n,e,t),Va(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&_u(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=hu();t=rt(t);var n=ei(e,t);n!==null&&_u(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,fp(e,t,n,r)}finally{P.p=a,N.T=i}}function dp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,fp(e,t,n,r)}finally{P.p=a,N.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Ed(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=F(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ve(o);s.entanglements[1]|=c,o&=~c}ad(a),!(zl&6)&&(iu=ke()+500,od(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&_u(s,a,2),xu(),op(a,2)}if(a=pp(r),a===null&&Ed(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ed(e,t,r,null,n)}}function pp(e){return e=nn(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=gt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 mp=e,null}function gp(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`resize`: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`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`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ae()){case je:return 2;case Me:return 8;case Ne:case Pe:return 32;case Fe:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=_t(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=gt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ot(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){cp(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 kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=_t(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=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(hp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,Cs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[lt]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){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 Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,hu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),xu(),t[L]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.8`)throw Error(i(527,zp,`19.2.8`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Q=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Q.isDisabled&&Q.supportsFiber)try{Re=Q.inject(Bp),ze=Q}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[L]=t.current,wd(e),new Lp(t)}})),_=o(((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=g()})),v=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},y=new class extends v{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},b={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},x=new class{#e=b;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function S(e){setTimeout(e,0)}var C=typeof window>`u`||`Deno`in globalThis;function w(){}function T(e,t){return typeof e==`function`?e(t):e}function E(e){return typeof e==`number`&&e>=0&&e!==1/0}function D(e,t){return Math.max(e+(t||0)-Date.now(),0)}function O(e,t){return typeof e==`function`?e(t):e}function k(e,t){return typeof e==`function`?e(t):e}function A(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ee(o,t.options))return!1}else if(!te(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function j(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(M(t.options.mutationKey)!==M(a))return!1}else if(!te(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ee(e,t){return(t?.queryKeyHashFn||M)(e)}function M(e){return JSON.stringify(e,(e,t)=>ie(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function te(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!te(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!te(e[r],t[r]))return!1;return!0}return!1}var ne=Object.prototype.hasOwnProperty;function N(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=re(e)&&re(t);if(!r&&!(ie(e)&&ie(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ne.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=N(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function P(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function re(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ie(e){if(!ae(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ae(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ae(e){return Object.prototype.toString.call(e)===`[object Object]`}function oe(e){return new Promise(t=>{x.setTimeout(t,e)})}function se(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:N(e,t)}function ce(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function le(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ue=Symbol();function de(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ue?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fe(e,t){return typeof e==`function`?e(...t):!!e}function pe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var me=(()=>{let e=()=>C;return{isServer(){return e()},setIsServer(t){e=t}}})();function he(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ge=S;function _e(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ge,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ve=_e(),ye=new class extends v{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function be(e){return Math.min(1e3*2**e,3e4)}function xe(e){return(e??`online`)!==`online`||ye.isOnline()}var Se=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ce(e){let t=!1,n=0,r,i=he(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Se(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>y.isFocused()&&(e.networkMode===`always`||ye.isOnline())&&e.canRun(),u=()=>xe(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(me.isServer()?0:3),o=e.retryDelay??be,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),oe(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var we=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),E(this.gcTime)&&(this.#e=x.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(me.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(x.clearTimeout(this.#e),this.#e=void 0)}};function Te(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{pe(e,()=>t.signal,()=>n=!0)},u=de(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?le:ce;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?De:Ee,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ee(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Ee(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function De(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Oe=class extends we{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=je(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=je(this.options);e.data!==void 0&&(this.setState(Ae(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=se(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(w).catch(w):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>k(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ue||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>O(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!D(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=de(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Te(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Ce({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Se&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Se){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ke(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ae(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ve.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ke(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ae(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function je(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Me=class extends v{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=he(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Pe(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fe(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof k(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!P(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ie(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||O(this.options.staleTime,this.#t)!==O(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Re(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(w)),t}#g(){this.#b();let e=O(this.options.staleTime,this.#t);if(me.isServer()||this.#r.isStale||!E(e))return;let t=D(this.#r.dataUpdatedAt,e)+1;this.#d=x.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(me.isServer()||k(this.options.enabled,this.#t)===!1||!E(this.#p)||this.#p===0)&&(this.#f=x.setInterval(()=>{(this.options.refetchIntervalInBackground||y.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(x.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(x.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Pe(e,t),o=i&&Ie(e,n,t,r);(a||o)&&(l={...l,...ke(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=se(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=se(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Le(e,t),refetch:this.refetch,promise:this.#o,isEnabled:k(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=he();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!P(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){ve.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ne(e,t){return k(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&k(t.retryOnMount,e)===!1)}function Pe(e,t){return Ne(e,t)||e.state.data!==void 0&&Fe(e,t,t.refetchOnMount)}function Fe(e,t,n){if(k(t.enabled,e)!==!1&&O(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Le(e,t)}return!1}function Ie(e,t,n,r){return(e!==t||k(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Le(e,n)}function Le(e,t){return k(t.enabled,e)!==!1&&e.isStaleByTime(O(t.staleTime,e))}function Re(e,t){return!P(e.getCurrentResult(),t)}var ze=class extends we{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Be(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Ce({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ve.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Be(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ve=class extends v{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new ze({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=He(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=He(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=He(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=He(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ve.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>j(t,e))}findAll(e={}){return this.getAll().filter(t=>j(e,t))}notify(e){ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ve.batch(()=>Promise.all(e.map(e=>e.continue().catch(w))))}};function He(e){return e.options.scope?.id}var Ue=class extends v{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),P(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&M(t.mutationKey)!==M(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Be();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ve.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},We=class extends v{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ee(r,t),a=this.get(i);return a||(a=new Oe({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ve.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>A(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>A(e,t)):t}notify(e){ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ve.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ve.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ge=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new We,this.#t=e.mutationCache||new Ve,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=y.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ye.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(O(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=T(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ve.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ve.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ve.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=ve.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(w).catch(w)}invalidateQueries(e,t={}){return ve.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ve.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(w)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(w)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(O(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(w).catch(w)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(w).catch(w)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ye.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(M(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{te(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(M(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{te(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ee(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ue&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ke=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),qe=o(((e,t)=>{t.exports=Ke()})),F=l(d(),1),I=qe(),Je=F.createContext(void 0),Ye=e=>{let t=F.useContext(Je);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Xe=({client:e,children:t})=>(F.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(Je.Provider,{value:e,children:t})),Ze=F.createContext(!1),Qe=()=>F.useContext(Ze);Ze.Provider;function $e(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var et=F.createContext($e()),tt=()=>F.useContext(et),nt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?fe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},rt=e=>{F.useEffect(()=>{e.clearReset()},[e])},it=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||fe(n,[e.error,r])),at=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ot=(e,t)=>e.isLoading&&e.isFetching&&!t,st=(e,t)=>e?.suspense&&t.isPending,ct=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function lt(e,t,n){let r=Qe(),i=tt(),a=Ye(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,at(o),nt(o,i,s),rt(i);let l=!a.getQueryCache().get(o.queryHash),[u]=F.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(F.useSyncExternalStore(F.useCallback(e=>{let t=f?u.subscribe(ve.batchCalls(e)):w;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),F.useEffect(()=>{u.setOptions(o)},[o,u]),st(o,d))throw ct(o,u,i);if(it({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!me.isServer()&&ot(d,r)&&(l?ct(o,u,i):s?.promise)?.catch(w).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function L(e,t){return lt(e,Me,t)}function ut(e,t){let n=Ye(t),[r]=F.useState(()=>new Ue(n,e));F.useEffect(()=>{r.setOptions(e)},[r,e]);let i=F.useSyncExternalStore(F.useCallback(e=>r.subscribe(ve.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=F.useCallback((e,t)=>{r.mutate(e,t).catch(w)},[r]);if(i.error&&fe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var dt=_();function ft(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var pt=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),mt=o(((e,t)=>{t.exports=pt()})),ht=mt(),gt=F.useInsertionEffect,_t=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?F.useLayoutEffect:F.useEffect,vt=gt||_t,yt=e=>{let t=F.useRef([e,(...e)=>t[0](...e)]).current;return vt(()=>{t[0]=e}),t[1]},bt=`popstate`,xt=`pushState`,St=`replaceState`,Ct=[bt,xt,St,`hashchange`],wt=e=>{for(let t of Ct)addEventListener(t,e);return()=>{for(let t of Ct)removeEventListener(t,e)}},Tt=(e,t)=>(0,ht.useSyncExternalStore)(wt,e,t),Et=()=>location.search,Dt=({ssrSearch:e}={})=>Tt(Et,e==null?Et:()=>e),Ot=()=>location.pathname,kt=({ssrPath:e}={})=>Tt(Ot,e==null?Ot:()=>e),At=(e,{replace:t=!1,state:n=null}={})=>history[t?St:xt](n,``,e),jt=(e={})=>[kt(e),At],Mt=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[Mt]===void 0){for(let e of[xt,St]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,Mt,{value:!0})}var Nt=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?`~`+t:t.slice(e.length)||`/`,Pt=(e=``)=>e===`/`?``:e,Ft=(e,t)=>e[0]===`~`?e.slice(1):Pt(t)+e,It=(e=``,t)=>Nt(Rt(Pt(e)),Rt(t)),Lt=e=>e[0]===`?`?e.slice(1):e,Rt=e=>{try{return decodeURI(e)}catch{return e}},zt=e=>Rt(Lt(e)),Bt={hook:jt,searchHook:Dt,parser:ft,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},Vt=(0,F.createContext)(Bt),Ht=()=>(0,F.useContext)(Vt),Ut={},Wt=(0,F.createContext)(Ut),Gt=()=>(0,F.useContext)(Wt),Kt=e=>{let[t,n]=e.hook(e);return[It(e.base,t),yt((t,r)=>e.aroundNav(n,Ft(t,e.base),r))]},qt=()=>Kt(Ht()),Jt=()=>{let e=Ht();return zt(e.searchHook(e))},Yt=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||`*`,r),o=i.exec(n)||[],[s,...c]=o;return s===void 0?[!1,null]:[!0,(()=>{let e=a===!1?o.groups:Object.fromEntries(a.map((e,t)=>[e,c[t]])),t={...c};return e&&Object.assign(t,e),t})(),...r?[s]:[]]},Xt=({children:e,...t})=>{let n=Ht(),r=t.hook?Bt:n,i=r,[a,o=t.ssrSearch??``]=t.ssrPath?.split(`?`)??[];a&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let s=(0,F.useRef)({}),c=s.current,l=c;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];c===l&&n!==l[e]&&(s.current=l={...l}),l[e]=n,(n!==r[e]||n!==i[e])&&(i=l)}return(0,F.createElement)(Vt.Provider,{value:i,children:e})},Zt=({children:e,component:t},n)=>t?(0,F.createElement)(t,{params:n}):typeof e==`function`?e(n):e,Qt=e=>{let t=(0,F.useRef)(Ut),n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([e,t])=>t!==n[e])?e:n},$t=({path:e,nest:t,match:n,...r})=>{let i=Ht(),[a]=Kt(i),[o,s,c]=n??Yt(i.parser,e,a,t),l=Qt({...Gt(),...s});if(!o)return null;let u=c?(0,F.createElement)(Xt,{base:c},Zt(r,l)):Zt(r,l);return(0,F.createElement)(Wt.Provider,{value:l,children:u})},en=(0,F.forwardRef)((e,t)=>{let n=Ht(),[r,i]=Kt(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e,h=yt(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),g=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n);return c&&(0,F.isValidElement)(l)?(0,F.cloneElement)(l,{onClick:h,href:g}):(0,F.createElement)(`a`,{...m,onClick:h,href:g,className:u?.call?u(r===o):u,children:l,ref:t})}),tn=e=>Array.isArray(e)?e.flatMap(e=>tn(e&&e.type===F.Fragment?e.props.children:e)):[e],nn=({children:e,location:t})=>{let n=Ht(),[r]=Kt(n);for(let i of tn(e)){let e=0;if((0,F.isValidElement)(i)&&(e=Yt(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,F.cloneElement)(i,{match:e})}return null},rn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),an=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),on=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),sn=e=>{let t=on(e);return t.charAt(0).toUpperCase()+t.slice(1)},cn={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ln=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},un=(0,F.createContext)({}),dn=()=>(0,F.useContext)(un),fn=(0,F.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=dn()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,F.createElement)(`svg`,{ref:c,...cn,width:t??l??cn.width,height:t??l??cn.height,stroke:e??f,strokeWidth:m,className:rn(`lucide`,p,i),...!a&&!ln(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,F.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),pn=(e,t)=>{let n=(0,F.forwardRef)(({className:n,...r},i)=>(0,F.createElement)(fn,{ref:i,iconNode:t,className:rn(`lucide-${an(sn(e))}`,`lucide-${e}`,n),...r}));return n.displayName=sn(e),n},mn=pn(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),hn=pn(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),gn=pn(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),_n=pn(`bell`,[[`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`}]]),vn=pn(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),yn=pn(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),bn=pn(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),xn=pn(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Sn=pn(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Cn=pn(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),wn=pn(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Tn=pn(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),En=pn(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Dn=pn(`moon`,[[`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`}]]),On=pn(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),kn=pn(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),An=pn(`sun`,[[`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`}]]),jn=pn(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),Mn=pn(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Nn=e=>Symbol.iterator in e,Pn=e=>`entries`in e,Fn=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},In=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function Ln(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Nn(e)&&Nn(t)?Pn(e)&&Pn(t)?Fn(e,t):In(e,t):Fn({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Rn(e){let t=F.useRef(void 0);return n=>{let r=e(n);return Ln(t.current,r)?t.current:t.current=r}}var zn=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Bn=(e=>e?zn(e):zn),Vn=e=>e;function Hn(e,t=Vn){let n=F.useSyncExternalStore(e.subscribe,F.useCallback(()=>t(e.getState()),[e,t]),F.useCallback(()=>t(e.getInitialState()),[e,t]));return F.useDebugValue(n),n}var Un=e=>{let t=Bn(e),n=e=>Hn(t,e);return Object.assign(n,t),n},Wn=(e=>e?Un(e):Un),Gn=20,Kn=10,qn=50,Jn=Wn(e=>({connected:!1,recentToolCalls:[],cost:null,antiPatterns:[],contextBySession:new Map,firingAlerts:new Map,dismissedAlerts:new Set,activeSessionId:null,todaySubagentUsd:0,todaySubagentTurnCount:0,recentWorkflowRuns:[],observabilityHealth:null,setConnected:t=>e({connected:t}),setActiveSession:t=>e(e=>{if(e.activeSessionId===t)return{};let n=e=>t===null?e===void 0:e===t;return{activeSessionId:t,recentToolCalls:e.recentToolCalls.filter(e=>n(e.sessionId)),antiPatterns:e.antiPatterns.filter(e=>n(e.sessionId)),cost:e.cost&&n(e.cost.sessionId)?e.cost:null}}),pushToolCall:t=>e(e=>{if(e.recentToolCalls.some(e=>e.id===t.id))return{};let n=[...e.recentToolCalls,t];return{recentToolCalls:n.length>Gn?n.slice(n.length-Gn):n}}),setCost:t=>e({cost:t}),setContext:t=>e(e=>{let n=new Map(e.contextBySession);return n.set(t.sessionId,t),{contextBySession:n}}),pushAntiPattern:t=>e(e=>{let n=[...e.antiPatterns,t];return{antiPatterns:n.length>Kn?n.slice(n.length-Kn):n}}),addOrUpdateAlert:t=>e(e=>{let n=new Map(e.firingAlerts);if(t.state===`firing`)n.set(t.id,t);else if(n.delete(t.id),e.dismissedAlerts.has(t.id)){let r=new Set(e.dismissedAlerts);return r.delete(t.id),{firingAlerts:n,dismissedAlerts:r}}return{firingAlerts:n}}),clearAlert:t=>e(e=>{if(!e.firingAlerts.has(t))return e;let n=new Map(e.firingAlerts);return n.delete(t),{firingAlerts:n}}),dismissAlert:t=>e(e=>{if(e.dismissedAlerts.has(t))return e;let n=new Set(e.dismissedAlerts);return n.add(t),{dismissedAlerts:n}}),addSubagentTurn:t=>e(e=>({todaySubagentTurnCount:e.todaySubagentTurnCount+1,todaySubagentUsd:t==null?e.todaySubagentUsd:e.todaySubagentUsd+t})),upsertWorkflowRun:t=>e(e=>{let n=[...e.recentWorkflowRuns.filter(e=>e.workflowRunId!==t.workflowRunId),t];return{recentWorkflowRuns:n.length>qn?n.slice(n.length-qn):n}}),setObservabilityHealth:t=>e({observabilityHealth:t})})),Yn={info:0,warning:1,critical:2};function Xn(e){let t=[];for(let n of e.firingAlerts.values())e.dismissedAlerts.has(n.id)||t.push(n);return t.sort((e,t)=>{let n=Yn[t.severity]-Yn[e.severity];return n===0?e.firedAt-t.firedAt:n}),t}function Zn(e){let t=null;for(let n of e.firingAlerts.values())e.dismissedAlerts.has(n.id)||(t===null||Yn[n.severity]>Yn[t])&&(t=n.severity);return t}var Qn=()=>Jn(Rn(e=>({usd:e.todaySubagentUsd,turns:e.todaySubagentTurnCount}))),$n=()=>Jn(e=>e.observabilityHealth);function er(){let e=Jn(Rn(Xn)),t=Jn(Zn),n=Jn(e=>e.dismissAlert);return{alerts:e,maxSeverity:t,count:e.length,dismiss:n}}var tr=class extends Error{constructor(e){super(`Not found: ${e}`),this.name=`NotFoundError`}};async function R(e){let t=await fetch(e);if(t.status===404)throw new tr(e);if(!t.ok)throw Error(`${t.status} ${t.statusText} for ${e}`);return await t.json()}var nr=()=>R(`/api/health`),rr=()=>R(`/api/session/current`),ir=(e=50)=>R(`/api/sessions?limit=${e}`),ar=()=>R(`/api/sessions/today/aggregate`),or=()=>R(`/api/sessions/live`),sr=e=>R(`/api/sessions/${encodeURIComponent(e)}`),cr=()=>R(`/api/cost`),lr=()=>R(`/api/anti-patterns`),ur=()=>R(`/api/audit`),dr=()=>R(`/api/weekly`),fr=()=>R(`/api/budget`),pr=(e=30)=>R(`/api/cost-per-outcome?days=${e}`),mr=()=>R(`/api/personal-coach`),hr=()=>R(`/api/alerts/recent`),gr=e=>R(`/api/sessions/${encodeURIComponent(e)}/replay`),_r=e=>R(`/api/sessions/${encodeURIComponent(e)}/subagents`),vr=(e,t)=>R(`/api/sessions/${encodeURIComponent(e)}/subagents/${encodeURIComponent(t)}/calls`),yr=()=>R(`/api/quality-proxy`),br=()=>R(`/api/tool-selection-score`),xr=()=>R(`/api/git-efficiency`),Sr=()=>R(`/api/git-efficiency/repos`),Cr=()=>R(`/api/concurrency`),wr=(e=30)=>R(`/api/concurrency?view=history&days=${e}`);function Tr(e,t){return R(`/api/activity-heatmap?view=${encodeURIComponent(e)}${t?`&weeks=${t}`:``}`)}var Er=e=>R(e?`/api/context?sessionId=${encodeURIComponent(e)}`:`/api/context`),Dr=()=>R(`/api/model-usage`),Or=()=>R(`/api/cache-health`),kr=()=>R(`/api/settings`),Ar=()=>R(`/api/diagnostics`),jr=e=>fetch(`/api/settings`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}).then(async e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`);return await e.json()}),Mr=()=>fetch(`/api/digest/send`,{method:`POST`}).then(async e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`);return await e.json()}),Nr=()=>R(`/api/observability-health`),Pr=()=>R(`/api/workflows`),Fr=e=>R(`/api/workflows/${encodeURIComponent(e)}`),z={sessionCurrent:[`session`,`current`],sessionsList:e=>[`sessions`,`list`,e],sessionDetail:e=>[`session`,e],cost:[`cost`],antiPatterns:[`anti-patterns`],audit:[`audit`],weekly:[`weekly`],budget:[`budget`],latency:[`latency`],costPerOutcome:e=>[`cost-per-outcome`,e],personalCoach:[`personal-coach`],alertsRecent:[`alerts`,`recent`],sessionReplay:e=>[`session`,e,`replay`],sessionSubagents:e=>[`session`,e,`subagents`],agentCalls:(e,t)=>[`session`,e,`subagent`,t,`calls`],qualityProxy:[`quality-proxy`],toolSelectionScore:[`tool-selection-score`],gitEfficiency:[`git-efficiency`],gitEfficiencyRepos:[`git-efficiency-repos`],concurrency:[`concurrency`],concurrencyHistory:e=>[`concurrency`,`history`,e],activityHeatmap:e=>[`activity-heatmap`,e],context:[`context`],modelUsage:[`model-usage`],cacheHealth:[`cache-health`],settings:[`settings`],sessionsLive:[`sessions`,`live`],sessionsTodayAggregate:[`sessions`,`today`,`aggregate`],workflows:[`workflows`],workflowDetail:e=>[`workflow`,e],diagnostics:[`diagnostics`]},Ir={installed:null,latest:null,updateAvailable:!1};function Lr(){let[e,t]=(0,F.useState)(Ir);return(0,F.useEffect)(()=>{let e=!0;return nr().then(n=>{e&&t({installed:n.version,latest:n.latestVersion,updateAvailable:n.updateAvailable})}).catch(()=>{}),()=>{e=!1}},[]),e}var Rr={none:``,sm:`p-3`,md:`p-4`,lg:`p-5`},zr={default:`glass-card`,elevated:`glass-card bg-surface-5`,static:`glass-card glass-card-static`,danger:`glass-card glass-card-static border border-accent-red/60`,warning:`glass-card glass-card-static border border-accent-amber/40`},Br={none:``,green:`glow-green`,purple:`glow-purple`};function B({children:e,padding:t=`md`,tone:n=`default`,glow:r=`none`,className:i=``}){return(0,I.jsx)(`div`,{className:[zr[n],Rr[t],Br[r],i].filter(Boolean).join(` `),children:e})}var Vr={primary:`bg-accent-green/10 border border-accent-green/40 text-accent-green hover:bg-accent-green/20`,secondary:`bg-surface-5 border border-border-medium text-ink-subtle hover:border-border-strong hover:text-ink-base`,ghost:`bg-transparent border border-transparent text-ink-muted hover:text-ink-base hover:bg-surface-5`,danger:`bg-surface-5 border border-border-subtle text-ink-muted hover:border-accent-red hover:text-accent-red`},Hr={sm:`px-2 py-1 text-xs`,md:`px-3 py-1.5 text-xs`};function Ur({children:e,variant:t=`secondary`,size:n=`md`,disabled:r=!1,loading:i=!1,type:a=`button`,className:o=``,...s}){let c=r||i,l=[`inline-flex items-center justify-center gap-1.5 rounded-md transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 focus-visible:ring-offset-1 focus-visible:ring-offset-bg-deep`,Vr[t],Hr[n],c?`opacity-50 cursor-not-allowed`:``,o].filter(Boolean).join(` `);return(0,I.jsx)(`button`,{type:a,disabled:c,"aria-busy":i||void 0,className:l,...s,children:e})}var Wr={neutral:`bg-surface-5 text-ink-subtle`,info:`bg-accent-blue/15 text-accent-blue`,success:`bg-accent-green/15 text-accent-green`,warning:`bg-accent-amber/20 text-accent-amber`,danger:`bg-accent-red/20 text-accent-red`},Gr={neutral:`border border-border-medium`,info:`border border-accent-blue/30`,success:`border border-accent-green/30`,warning:`border border-accent-amber/30`,danger:`border border-accent-red/30`},Kr={sm:`px-1.5 py-0.5 text-[10px]`,md:`px-2 py-0.5 text-[11px]`};function qr({children:e,tone:t=`neutral`,size:n=`md`,uppercase:r=!1,bordered:i=!1,className:a=``,...o}){return(0,I.jsx)(`span`,{className:[`inline-flex items-center gap-1 rounded-full`,Wr[t],Kr[n],i?Gr[t]:``,r?`uppercase tracking-wider font-semibold`:``,a].filter(Boolean).join(` `),...o,children:e})}var Jr={sm:`text-[9px]`,md:`text-[10px]`};function Yr({label:e=`LIVE`,pulse:t=!0,size:n=`md`,className:r=``}){return(0,I.jsxs)(`span`,{className:[`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full`,`bg-accent-cyan/15 text-accent-cyan uppercase tracking-wider font-semibold`,Jr[n],r].filter(Boolean).join(` `),children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`w-1.5 h-1.5 rounded-full bg-accent-cyan ${t?`animate-pulse`:``}`}),e]})}var Xr={sm:`px-2 py-0.5 text-[10px] rounded-md`,md:`px-3 py-1 text-xs rounded-md`},Zr={green:`bg-accent-green/20 text-accent-green font-medium`,cyan:`bg-accent-cyan/20 text-accent-cyan font-medium`};function Qr({value:e,onChange:t,options:n,size:r=`md`,tone:i=`green`,ariaLabel:a,className:o=``}){return(0,I.jsx)(`div`,{role:`tablist`,"aria-label":a,className:[`inline-flex items-center gap-1`,o].filter(Boolean).join(` `),children:n.map(n=>{let a=n.value===e;return(0,I.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a,onClick:()=>t(n.value),className:[`transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 focus-visible:ring-offset-1 focus-visible:ring-offset-bg-deep`,Xr[r],a?Zr[i]:`text-ink-muted hover:text-ink-base`].join(` `),children:n.label},n.value)})})}function V({children:e,as:t=`div`,className:n=``}){let r=[`text-[10px] text-ink-muted uppercase tracking-wider font-medium`,n].filter(Boolean).join(` `);return t===`h2`?(0,I.jsx)(`h2`,{className:r,children:e}):t===`h3`?(0,I.jsx)(`h3`,{className:r,children:e}):(0,I.jsx)(`div`,{className:r,children:e})}function $r({title:e,subtitle:t,action:n,className:r=``}){return(0,I.jsxs)(`div`,{className:[`flex items-start justify-between gap-3 mb-3`,r].filter(Boolean).join(` `),children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium text-ink-base`,children:e}),t!=null&&(0,I.jsx)(`div`,{className:`text-xs text-ink-muted`,children:t})]}),n!=null&&(0,I.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:n})]})}var ei=[{path:`/`,label:`Today`,Icon:Tn},{path:`/sessions`,label:`Sessions`,Icon:Sn}],ti=[{path:`/history`,label:`History`,Icon:jn},{path:`/git`,label:`Git`,Icon:wn},{path:`/audit`,label:`Audit`,Icon:kn}],ni=[{path:`/settings`,label:`Settings`,Icon:On},{path:`/alerts`,label:`Alerts`,Icon:_n}],ri={info:`neutral`,warning:`warning`,critical:`danger`};function ii({currentPath:e,onNavigate:t,connected:n,theme:r,onToggleTheme:i}){let{count:a,maxSeverity:o}=er(),s=Lr();function c({path:n,label:r,Icon:i}){let s=e===n,c=n===`/`&&a>0,l=o??`info`;return(0,I.jsxs)(`button`,{type:`button`,"aria-current":s?`page`:void 0,onClick:()=>t(n),className:`flex items-center gap-2.5 px-3 py-2 rounded-lg text-xs text-left transition-colors duration-150 `+(s?`border-l-[3px] border-l-accent-green bg-accent-green/8 text-ink-base font-medium pl-2.5`:`border-l-[3px] border-l-transparent text-ink-subtle hover:text-ink-base hover:bg-surface-3`),children:[(0,I.jsx)(i,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,I.jsx)(`span`,{children:r}),c&&(0,I.jsx)(qr,{tone:ri[l],size:`sm`,className:`ml-auto font-semibold tabular-nums`,"data-testid":`alert-badge`,"data-severity":l,"aria-label":`${a>99?`99+`:a} firing ${a===1?`alert`:`alerts`}`,children:a>99?`99+`:a})]},n)}return(0,I.jsxs)(`aside`,{className:`w-52 bg-bg-deep border-r border-border-subtle p-4 flex flex-col`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,I.jsxs)(`svg`,{width:`22`,height:`22`,viewBox:`0 0 128 128`,"aria-hidden":`true`,children:[(0,I.jsx)(`rect`,{width:`128`,height:`128`,rx:`24`,fill:`url(#preflightGrad)`}),(0,I.jsx)(`path`,{d:`M21.1599 74.0495L29.1148 66.0946L45.3429 68.9583L56.7981 57.5032L21.1599 42.2297L30.7058 32.6838L73.9808 40.3205L87.9815 26.3198C89.7316 24.5697 91.8529 23.6947 94.3454 23.6947C96.838 23.6947 98.9593 24.5697 100.709 26.3198C102.459 28.0699 103.335 30.1912 103.335 32.6838C103.335 35.1763 102.459 37.2976 100.709 39.0477L86.7087 53.0484L94.3454 96.3234L84.7995 105.869L69.526 70.2311L58.0709 81.6863L60.9346 97.9144L52.9797 105.869L41.8428 85.1864L21.1599 74.0495Z`,fill:`#080F11`}),(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`preflightGrad`,x1:`64`,y1:`0`,x2:`64`,y2:`128`,gradientUnits:`userSpaceOnUse`,children:[(0,I.jsx)(`stop`,{offset:`0.12`,stopColor:`#D2FA37`}),(0,I.jsx)(`stop`,{offset:`0.88`,stopColor:`#1CE783`})]})})]}),(0,I.jsx)(`span`,{className:`font-semibold text-sm tracking-tight brand-text`,children:`Preflight`}),(0,I.jsx)(`span`,{className:`text-ink-muted text-[10px] leading-none select-none`,children:`|`}),(0,I.jsx)(`span`,{className:`text-ink-muted text-[9px] leading-none`,children:`by`}),(0,I.jsxs)(`svg`,{width:`46`,height:`9`,viewBox:`0 0 819.12 159.36`,"aria-label":`New Relic`,fill:`currentColor`,className:`text-ink-subtle flex-shrink-0`,children:[(0,I.jsx)(`polygon`,{points:`68.85 .18 8.05 35.28 34.54 50.57 68.85 30.76 111.21 55.22 111.21 104.14 76.9 123.95 76.9 154.53 137.7 119.43 137.7 39.93 68.85 .18`}),(0,I.jsx)(`polygon`,{points:`42.36 94.97 42.36 143.89 68.85 159.18 68.85 79.68 0 39.93 0 70.51 42.36 94.97`}),(0,I.jsx)(`path`,{d:`M232.21,39.81c-14.82,0-21.84,9.36-21.84,9.36h-.78l-1.56-7.8h-17.94v79.57h19.5v-46.03c0-10.14,7.02-17.16,17.16-17.16s17.16,7.02,17.16,17.16v46.03h19.5v-47.59c0-20.28-13.26-33.55-31.21-33.55Z`}),(0,I.jsx)(`polygon`,{points:`442.54 93.64 441.42 93.64 428.15 41.38 408.31 41.38 395.05 93.64 393.93 93.64 380.67 41.38 360.39 41.38 380.67 120.95 404.41 120.95 417.67 69.46 418.79 69.46 432.06 120.95 455.8 120.95 476.08 41.38 455.8 41.38 442.54 93.64`}),(0,I.jsx)(`path`,{d:`M535.8,48.4h-.78l-1.56-7.02h-16.38v79.57h19.5v-46.02c0-10.14,4.68-14.82,14.82-14.82h10.04v-18.72h-11.6c-9.36,0-14.04,7.02-14.04,7.02Z`}),(0,I.jsx)(`path`,{d:`M604.56,39.82c-23.4,0-40.56,17.16-40.56,41.34s16.19,41.34,40.56,41.34c19.73,0,31.61-11.61,36.56-20.15l-17.9-6.38c-1.78,3.24-8.91,9.47-18.66,9.47-11.37,0-19.5-7.12-21.06-18.04h59.29s.78-3.12.78-7.8c0-22.62-17.16-39.78-39-39.78ZM583.5,74.14c2.34-10.14,9.36-17.94,21.06-17.94,10.92,0,17.94,7.8,19.5,17.94h-40.56Z`}),(0,I.jsx)(`path`,{d:`M316.44,39.82c-23.4,0-40.56,17.16-40.56,41.34s16.19,41.34,40.56,41.34c19.73,0,31.61-11.61,36.56-20.15l-17.9-6.38c-1.78,3.24-8.91,9.47-18.66,9.47-11.37,0-19.5-7.12-21.06-18.04h59.29s.78-3.12.78-7.8c0-22.62-17.16-39.78-39-39.78ZM295.38,74.14c2.34-10.14,9.36-17.94,21.06-17.94,10.92,0,17.94,7.8,19.5,17.94h-40.56Z`}),(0,I.jsx)(`rect`,{x:`692.24`,y:`9.96`,width:`19.5`,height:`19.5`}),(0,I.jsx)(`path`,{d:`M765.56,104.56c-11.7,0-21.06-9.36-21.06-23.4s9.36-23.4,21.06-23.4,16.38,7.8,17.94,12.48l17.66-6.28c-4.27-11.11-14.77-24.14-35.6-24.14-23.4,0-40.56,17.16-40.56,41.34s17.16,41.34,40.56,41.34c21,0,31.5-13.25,35.71-24.88l-17.77-6.32c-1.56,5.46-6.24,13.26-17.94,13.26Z`}),(0,I.jsx)(`polygon`,{points:`645.72 27.3 656.79 27.3 656.79 120.95 676.3 120.95 676.3 9.96 645.72 9.96 645.72 27.3`}),(0,I.jsx)(`rect`,{x:`692.24`,y:`41.38`,width:`19.5`,height:`79.57`}),(0,I.jsx)(`path`,{d:`M811.7,105.65c-4.28,0-7.42,3.24-7.42,7.52s3.13,7.52,7.42,7.52,7.42-3.24,7.42-7.52-3.13-7.52-7.42-7.52ZM811.7,119.54c-3.66,0-6.27-2.72-6.27-6.37s2.61-6.37,6.27-6.37,6.27,2.72,6.27,6.37-2.61,6.37-6.27,6.37Z`}),(0,I.jsx)(`path`,{d:`M814.94,111.81c0-1.46-1.15-2.61-2.82-2.61h-3.34v7.83h1.15v-2.72h1.04l2.72,2.72h1.46l-2.72-2.72c1.46-.1,2.51-1.15,2.51-2.51ZM809.93,113.17v-2.82h2.19c1.04,0,1.67.63,1.67,1.46s-.52,1.36-1.67,1.36h-2.19Z`})]})]}),(0,I.jsx)(`div`,{className:`text-ink-muted text-[10px] tracking-wide mb-6`,children:`local · single-user`}),(0,I.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Observe`}),(0,I.jsx)(`nav`,{"aria-label":`Observe`,className:`flex flex-col gap-0.5 mb-4`,children:ei.map(e=>c(e))}),(0,I.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Analyze`}),(0,I.jsx)(`nav`,{"aria-label":`Analyze`,className:`flex flex-col gap-0.5 mb-4`,children:ti.map(e=>c(e))}),(0,I.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Configure`}),(0,I.jsx)(`nav`,{"aria-label":`Configure`,className:`flex flex-col gap-0.5`,children:ni.map(e=>c(e))}),(0,I.jsxs)(`div`,{className:`mt-auto`,children:[(0,I.jsxs)(`a`,{href:`https://newrelic.com/platform/ai-observability`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 px-2.5 py-2 rounded-md text-ink-subtle border border-accent-green/20 bg-accent-green/5 hover:bg-accent-green/10 hover:border-accent-green/50 hover:text-ink-base hover:shadow-[0_0_8px_rgba(28,231,131,0.35),0_0_20px_rgba(28,231,131,0.15)] transition-all duration-300 group/cta mb-2`,children:[(0,I.jsxs)(`svg`,{width:`11`,height:`13`,viewBox:`0 0 138 160`,fill:`currentColor`,"aria-hidden":`true`,className:`flex-shrink-0 text-accent-green opacity-75 group-hover/cta:opacity-100 transition-opacity`,children:[(0,I.jsx)(`polygon`,{points:`68.85 .18 8.05 35.28 34.54 50.57 68.85 30.76 111.21 55.22 111.21 104.14 76.9 123.95 76.9 154.53 137.7 119.43 137.7 39.93 68.85 .18`}),(0,I.jsx)(`polygon`,{points:`42.36 94.97 42.36 143.89 68.85 159.18 68.85 79.68 0 39.93 0 70.51 42.36 94.97`})]}),(0,I.jsx)(`span`,{className:`text-xs flex-1 leading-tight`,children:`Try AI Observability`}),(0,I.jsxs)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`flex-shrink-0 opacity-50 group-hover/cta:opacity-80 transition-opacity`,children:[(0,I.jsx)(`polyline`,{points:`15 3 21 3 21 9`}),(0,I.jsx)(`line`,{x1:`10`,y1:`14`,x2:`21`,y2:`3`})]})]}),(0,I.jsx)(`div`,{className:`pt-3 border-t border-border-subtle`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1.5 rounded-md bg-surface-3 transition-colors duration-150`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`span`,{className:`w-2 h-2 rounded-full ${n?`bg-accent-green animate-pulse`:`bg-accent-amber`}`}),(0,I.jsx)(`span`,{className:`text-[10px] text-ink-subtle tracking-wide`,children:n?`live`:`reconnecting`})]}),(0,I.jsx)(Ur,{variant:`ghost`,size:`sm`,onClick:i,"aria-label":r===`dark`?`Switch to light mode`:`Switch to dark mode`,className:`px-1 py-1`,children:r===`dark`?(0,I.jsx)(An,{size:12}):(0,I.jsx)(Dn,{size:12})})]})}),s.installed!==null&&(0,I.jsxs)(`div`,{className:`mt-2 px-2 flex items-center gap-1.5`,children:[(0,I.jsxs)(`span`,{className:`text-[10px] text-ink-muted`,children:[`v`,s.installed]}),(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted`,"aria-hidden":`true`,children:`·`}),(0,I.jsxs)(`a`,{href:`https://github.com/newrelic-experimental/preflight`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View Preflight on GitHub`,className:`text-[10px] text-ink-subtle hover:text-ink-base transition-colors duration-150 flex items-center gap-0.5`,children:[`GitHub`,(0,I.jsx)(Cn,{size:8,"aria-hidden":`true`})]})]}),s.updateAvailable&&s.latest!==null&&(0,I.jsx)(`div`,{className:`mt-0.5 px-2`,children:(0,I.jsxs)(`span`,{className:`text-[10px] text-accent-amber`,children:[`v`,s.latest,` available`]})})]})]})}function ai(e,t=.8,n=.5){return e===null?`text-ink-muted`:e>=t?`text-accent-green`:e>=n?`text-accent-amber`:`text-accent-red`}function oi(e){return e>=.8?`text-accent-cyan`:e>=.5?`text-accent-amber`:`text-accent-red`}function si(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function ci(e){return new Date(e).toLocaleString(void 0,{hour:`numeric`,minute:`2-digit`})}function li(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}function ui(e){if(!Number.isFinite(e)||e<0)return`—`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60){let e=t%60;return e>0?`${n}m ${e}s`:`${n}m`}let r=Math.floor(n/60);if(r<24){let e=n%60;return e>0?`${r}h ${e}m`:`${r}h`}let i=Math.floor(r/24),a=r%24;return a>0?`${i}d ${a}h`:`${i}d`}function di(e){return Number.isFinite(e)?Math.abs(e)>=100?e.toFixed(0):Math.abs(e)>=10?e.toFixed(1):Number.isInteger(e)?String(e):e.toFixed(2):`—`}function fi(e){if(!Number.isFinite(e))return`$0.00`;let t=Math.abs(e)>0&&Math.abs(e)<1?4:2;return`$${e.toFixed(t)}`}function pi(e){return e==null||!Number.isFinite(e)?`—`:fi(e)}function mi(e){if(!Number.isFinite(e))return`—`;let t=Math.abs(e);return t>=1e6?`${(e/1e6).toFixed(1)}M`:t>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function hi(e){let t=e.split(`__`);return t.length>=3&&t[0]===`mcp`?t.slice(2).join(`__`):e}var gi={info:`bg-surface-3 border-surface-8`,warning:`bg-accent-amber/5 border-accent-amber/40`,critical:`bg-accent-red/5 border-accent-red/50`},_i={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},vi={info:`INFO`,warning:`WARN`,critical:`CRIT`};function yi(e){return e===`critical`?`alert`:`status`}function bi({alert:e,onDismiss:t}){let n=n=>{n.key===`Escape`&&(n.preventDefault(),t(e.id))},r=`alert-title-${String(e.id).replace(/[^a-zA-Z0-9-_]/g,`_`)}`;return(0,I.jsxs)(`div`,{role:yi(e.severity),"aria-labelledby":r,tabIndex:0,"data-alert-id":e.id,"data-severity":e.severity,onKeyDown:n,className:`flex items-center gap-3 px-3 py-2 border-b text-xs focus:outline-none focus:ring-2 focus:ring-accent-cyan/40 ${gi[e.severity]}`,children:[(0,I.jsxs)(`span`,{"aria-hidden":`true`,className:`shrink-0 font-semibold tracking-wider ${_i[e.severity]}`,children:[`● `,vi[e.severity]]}),(0,I.jsx)(`span`,{id:r,className:`font-medium text-ink-base shrink-0`,children:e.title}),(0,I.jsx)(`span`,{className:`text-ink-muted truncate`,children:e.description}),(0,I.jsxs)(`span`,{className:`ml-auto shrink-0 text-ink-subtle tabular-nums whitespace-nowrap`,children:[di(e.value),` / `,di(e.threshold)]}),(0,I.jsx)(`button`,{type:`button`,"aria-label":`Dismiss alert`,onClick:()=>t(e.id),className:`shrink-0 ml-1 p-1 rounded-md text-ink-subtle hover:text-ink-base hover:bg-surface-5 transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:(0,I.jsx)(Mn,{size:14,"aria-hidden":`true`,focusable:`false`})})]})}var xi=5,Si={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},Ci={info:`border-bg-line`,warning:`border-accent-amber/50`,critical:`border-accent-red/60`};function wi(){let{alerts:e,maxSeverity:t,count:n,dismiss:r}=er(),[i,a]=(0,F.useState)(!1);if((0,F.useEffect)(()=>{n<xi&&a(!1)},[n]),n===0)return null;let o=n>=xi&&!i,s=t??`info`;return o?(0,I.jsx)(`div`,{className:`bg-bg-panel border-b`,"data-collapsed-stack":`true`,children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>a(!0),"aria-expanded":`false`,"aria-label":`${n} alerts firing — expand`,className:`w-full flex items-center gap-2 px-3 py-2 text-xs text-left border-b ${Ci[s]} transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:[(0,I.jsx)(yn,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,I.jsxs)(`span`,{className:`font-semibold ${Si[s]}`,children:[`● `,n,` alerts firing`]}),(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`— click to expand`})]})}):(0,I.jsxs)(`div`,{"data-stack":`true`,children:[n>=xi&&(0,I.jsxs)(`button`,{type:`button`,onClick:()=>a(!1),"aria-expanded":`true`,"aria-label":`${n} alerts firing — collapse`,className:`w-full flex items-center gap-2 px-3 py-2 text-xs text-left bg-bg-panel border-b ${Ci[s]} transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:[(0,I.jsx)(vn,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,I.jsxs)(`span`,{className:`font-semibold ${Si[s]}`,children:[`● `,n,` alerts firing`]}),(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`— click to collapse`})]}),e.map(e=>(0,I.jsx)(bi,{alert:e,onDismiss:r},e.id))]})}var Ti=class extends F.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught a render error`,{error:e,info:t})}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}handleReload=()=>{window.location.reload()};handleDismiss=()=>{this.setState({error:null})};render(){let{error:e}=this.state;return e?(0,I.jsx)(`div`,{role:`alert`,className:`flex justify-center p-8`,children:(0,I.jsx)(`div`,{className:`max-w-2xl w-full`,children:(0,I.jsxs)(B,{padding:`lg`,tone:`danger`,className:`space-y-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-accent-red font-semibold uppercase text-xs tracking-wider mb-1`,children:`Render error`}),(0,I.jsx)(`div`,{className:`text-ink-base text-base font-mono break-all`,children:e.message})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(Ur,{variant:`secondary`,size:`md`,onClick:this.handleReload,children:`Reload page`}),(0,I.jsx)(Ur,{variant:`ghost`,size:`md`,onClick:this.handleDismiss,children:`Dismiss`})]}),e.stack&&(0,I.jsxs)(`details`,{className:`text-xs text-ink-muted`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer select-none`,children:`Stack trace`}),(0,I.jsx)(`pre`,{className:`mt-2 p-2 bg-bg-line/30 rounded overflow-x-auto whitespace-pre-wrap break-all`,children:e.stack})]})]})})}):this.props.children}},Ei=[{keys:[`?`],description:`Show this help`},{keys:[`t`],description:`Toggle light/dark mode`},{keys:[`g`,`h`],description:`Go to Today`},{keys:[`g`,`s`],description:`Go to Sessions`},{keys:[`g`,`i`],description:`Go to History`},{keys:[`g`,`a`],description:`Go to Audit`},{keys:[`g`,`v`],description:`Go to Git Efficiency`},{keys:[`g`,`e`],description:`Go to Settings`},{keys:[`g`,`l`],description:`Go to Alerts`},{keys:[`Esc`],description:`Close overlay`}];function Di({open:e,onClose:t}){return(0,F.useEffect)(()=>{if(!e)return;function n(e){e.key===`Escape`&&(e.preventDefault(),t())}return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),e?(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:t,children:(0,I.jsxs)(`div`,{className:`glass-card animate-overlay-enter max-w-sm w-full mx-4 p-5`,onClick:e=>e.stopPropagation(),children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-semibold text-ink-base`,children:`Keyboard Shortcuts`}),(0,I.jsx)(Ur,{variant:`ghost`,size:`sm`,onClick:t,"aria-label":`Close keyboard shortcuts`,className:`px-1 py-1`,children:(0,I.jsx)(Mn,{size:16})})]}),(0,I.jsx)(`div`,{className:`space-y-2`,children:Ei.map(e=>(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,I.jsx)(`span`,{className:`text-ink-subtle`,children:e.description}),(0,I.jsx)(`span`,{className:`flex gap-1`,children:e.keys.map(e=>(0,I.jsx)(`kbd`,{className:`inline-block px-1.5 py-0.5 text-[11px] font-mono bg-bg-elevated rounded-md border border-border-subtle text-ink-base`,children:e},e))})]},e.description))})]})}):null}var Oi=75e3,ki=1e4;function Ai(e){let t=Jn.getState();fetch(`/api/session/current`,{signal:e}).then(e=>e.ok?e.json():null).then(e=>{if(e?.toolCallTimeline)for(let n of e.toolCallTimeline)t.pushToolCall({id:`${n.timestamp}-${n.toolName}`,tool:n.toolName,durationMs:n.durationMs??0,costUsd:0,ts:n.timestamp,sessionId:e.sessionId})}).catch(()=>{}),fetch(`/api/anti-patterns`,{signal:e}).then(e=>e.ok?e.json():null).then(e=>{if(Array.isArray(e))for(let n of e)n&&typeof n==`object`&&`type`in n&&t.pushAntiPattern({type:n.type,target:n.file??n.command??`unknown`,count:n.iterations??n.readCount??n.repeatCount??n.editCount??n.agentCount??0})}).catch(()=>{})}function ji(e=`/sse`){(0,F.useEffect)(()=>{let t=new AbortController;Ai(t.signal);let n=Date.now(),r=null,i=()=>{r||t.signal.aborted||(r=new EventSource(e),r.onopen=()=>{n=Date.now(),Jn.getState().setConnected(!0)},r.onerror=()=>Jn.getState().setConnected(!1),r.addEventListener(`tool-call`,a),r.addEventListener(`cost-update`,o),r.addEventListener(`anti-pattern`,s),r.addEventListener(`alert`,c),r.addEventListener(`context-update`,l),r.addEventListener(`heartbeat`,u))},a=e=>{try{Jn.getState().pushToolCall(JSON.parse(e.data))}catch{}},o=e=>{try{Jn.getState().setCost(JSON.parse(e.data))}catch{}},s=e=>{try{Jn.getState().pushAntiPattern(JSON.parse(e.data))}catch{}},c=e=>{try{Jn.getState().addOrUpdateAlert(JSON.parse(e.data))}catch{}},l=e=>{try{Jn.getState().setContext(JSON.parse(e.data))}catch{}},u=()=>{n=Date.now();let e=Jn.getState();e.connected||e.setConnected(!0)};typeof document<`u`&&document.readyState===`complete`?i():typeof window<`u`?window.addEventListener(`load`,i,{once:!0}):i();let d=setInterval(()=>{if(Date.now()-n>Oi){let e=Jn.getState();e.connected&&e.setConnected(!1)}},ki);return()=>{t.abort(),clearInterval(d),typeof window<`u`&&window.removeEventListener(`load`,i),r&&(r.removeEventListener(`tool-call`,a),r.removeEventListener(`cost-update`,o),r.removeEventListener(`anti-pattern`,s),r.removeEventListener(`alert`,c),r.removeEventListener(`context-update`,l),r.removeEventListener(`heartbeat`,u),r.close())}},[e])}function H({navigate:e,onToggleHelp:t,onToggleTheme:n}){let r=(0,F.useRef)(null),i=(0,F.useRef)(null);(0,F.useEffect)(()=>{function a(a){let o=a.target?.tagName;if(o===`INPUT`||o===`TEXTAREA`||o===`SELECT`||a.target?.isContentEditable||a.metaKey||a.ctrlKey||a.altKey)return;let s=a.key;if(r.current===`g`){if(s===`g`){i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=null},500);return}r.current=null,i.current&&=(clearTimeout(i.current),null);let t={h:`/`,s:`/sessions`,i:`/history`,a:`/audit`,v:`/git`,e:`/settings`,l:`/alerts`};t[s]&&(a.preventDefault(),e(t[s]));return}if(s===`g`){r.current=`g`,i.current=setTimeout(()=>{r.current=null},500);return}s===`?`&&(a.preventDefault(),t()),s===`t`&&n&&(a.preventDefault(),n())}return document.addEventListener(`keydown`,a),()=>{document.removeEventListener(`keydown`,a),i.current&&clearTimeout(i.current)}},[e,t,n])}var Mi=`preflight-theme`;function Ni(){try{let e=localStorage.getItem(Mi);if(e===`light`||e===`dark`)return e}catch{}try{if(window.matchMedia(`(prefers-color-scheme: light)`).matches)return`light`}catch{}return`dark`}function Pi(e){document.documentElement.classList.toggle(`light`,e===`light`)}function Fi(){let[e,t]=(0,F.useState)(Ni),n=(0,F.useRef)(!1);return(0,F.useLayoutEffect)(()=>{Pi(e)},[e]),(0,F.useEffect)(()=>{if(!n.current){n.current=!0;return}try{localStorage.setItem(Mi,e)}catch{}},[e]),{theme:e,toggleTheme:(0,F.useCallback)(()=>{t(e=>e===`dark`?`light`:`dark`)},[])}}function Ii(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Li(e,t={}){let{duration:n=800,decimals:r=0,enabled:i=!0,format:a}=t,o=i&&Ii(),[s,c]=(0,F.useState)(()=>o?0:e),l=(0,F.useRef)(0);return(0,F.useEffect)(()=>{if(!o){c(e);return}let t=performance.now();function r(i){let a=i-t,o=Math.min(a/n,1),s=1-(1-o)**3;c(s*e),o<1&&(l.current=requestAnimationFrame(r))}return l.current=requestAnimationFrame(r),()=>{l.current&&cancelAnimationFrame(l.current)}},[e,n,o]),a?a(s):s.toFixed(r)}var Ri={neutral:`text-ink-base`,good:`text-accent-green`,warn:`text-accent-amber`,bad:`text-accent-red`};function U({label:e,value:t,sub:n,tone:r=`neutral`,hero:i=!1,animate:a=!1,numericValue:o,prefix:s=``,suffix:c=``,decimals:l=0,format:u}){let d=Li(o??0,{decimals:l,enabled:a&&o!==void 0,format:u}),f=a&&o!==void 0?u?d:`${s}${d}${c}`:t,p=i?`text-3xl font-bold mt-1 tabular-nums gradient-text`:`text-3xl font-bold mt-1 tabular-nums ${Ri[r]}`;return(0,I.jsxs)(`div`,{className:`px-1`,children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider font-medium`,children:e}),(0,I.jsx)(`div`,{className:p,children:f}),n&&(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted mt-0.5`,children:n})]})}function zi({children:e,index:t=0,className:n=``}){let r=`${t*120}ms`;return(0,I.jsx)(`div`,{className:`animate-card-enter ${n}`,style:{animationDelay:r},children:e})}var Bi=6,Vi=5,Hi=[.01,.02,.05,.1,.25,.5,1,2,5,10,25,50,100,250,500,1e3];function Ui(e){if(e<=0)return .01;for(let t of Hi)if(t>=e)return t;return Hi[Hi.length-1]}function Wi(e){return e===0?`12am`:e<12?`${e}am`:e===12?`12pm`:`${e-12}pm`}function Gi(e){let t=e.reduce((e,t)=>e+t.cost,0),n=e.reduce((e,t)=>Math.max(e,t.cost),0),r=e.find(e=>e.cost===n);return r===void 0||n===0?`Hourly spend today: no activity yet.`:`Hourly spend today: ${fi(t)} total, peak ${fi(n)} at ${Wi(r.hour)}`}function Ki({hours:e,formatValue:t,ariaLabel:n}){let[r,i]=(0,F.useState)(null),a=e.reduce((e,t)=>Math.max(e,t.cost),0);if(a===0)return null;let o=Ui(a/Vi),s=e.map(e=>Math.max(0,Math.round(e.cost/o))),c=s.reduce((e,t)=>Math.max(e,t),0);if(c===0)return null;let l=c*7,u=t??(e=>fi(e)),d=n??Gi(e),f=r===null?null:e[r],p=f?`${Wi(f.hour)}: ${u(f.cost)} (start hour)`:``,m=r===null?0:(r+.5)/e.length*100;return(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`div`,{role:`img`,"aria-label":d,className:`flex w-full`,style:{height:l},onMouseLeave:()=>i(null),children:e.map((e,t)=>{let n=s[t],r=e.cost>0&&e.cost===a,o=[];for(let e=0;e<n;e++)o.push((0,I.jsx)(`span`,{className:`absolute rounded-sm heatmap-cell`,style:{bottom:e*7,left:`50%`,marginLeft:-6/2,width:Bi,height:Bi,backgroundColor:r?`var(--color-chart-block-peak)`:`var(--color-chart-block)`,animationDelay:`${t*12+e*6}ms`}},e));return(0,I.jsx)(`div`,{className:`relative flex-1 h-full`,onMouseEnter:()=>i(t),children:o},t)})}),f&&(0,I.jsx)(`div`,{className:`absolute -top-7 px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:`${m}%`,transform:`translateX(-50%)`},role:`tooltip`,children:p})]})}function qi(){return(0,I.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`13`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`6`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,I.jsx)(`line`,{x1:`24`,y1:`24`,x2:`24`,y2:`4`,stroke:`var(--color-accent-green)`,strokeWidth:`1.5`,strokeLinecap:`round`,className:`animate-radar-sweep`}),(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`2`,fill:`var(--color-accent-green)`})]})}function Ji(){return(0,I.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`M16 14 L6 24 L16 34`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`path`,{d:`M32 14 L42 24 L32 34`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`line`,{x1:`24`,y1:`18`,x2:`24`,y2:`30`,stroke:`var(--color-accent-green)`,strokeWidth:`2`,strokeLinecap:`round`,opacity:`0.8`})]})}function Yi(){return(0,I.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`line`,{x1:`4`,y1:`24`,x2:`44`,y2:`24`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.4`}),(0,I.jsx)(`circle`,{cx:`12`,cy:`24`,r:`3`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`}),(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`3`,stroke:`var(--color-accent-green)`,strokeWidth:`1.5`}),(0,I.jsx)(`circle`,{cx:`36`,cy:`24`,r:`3`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`}),(0,I.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12`,y2:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.5`}),(0,I.jsx)(`line`,{x1:`24`,y1:`16`,x2:`24`,y2:`20`,stroke:`var(--color-accent-green)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.7`}),(0,I.jsx)(`line`,{x1:`36`,y1:`16`,x2:`36`,y2:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.5`})]})}function Xi(){return(0,I.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`18`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,I.jsx)(`path`,{d:`M16 24 L22 30 L34 18`,stroke:`var(--color-accent-green)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Zi(){return(0,I.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`18`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,I.jsx)(`path`,{d:`M24 14 L24 24 L31 28`,stroke:`var(--color-ink-subtle)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}var Qi={radar:qi,code:Ji,timeline:Yi,checkmark:Xi,clock:Zi};function $i(){return(0,I.jsx)(`div`,{className:`flex items-center justify-center`,style:{width:48,height:48},"aria-hidden":`true`,children:(0,I.jsx)(`span`,{className:`rounded-full animate-pulse`,style:{width:10,height:10,backgroundColor:`var(--color-accent-green)`,boxShadow:`0 0 0 4px color-mix(in srgb, var(--color-accent-green) 15%, transparent)`}})})}function ea({icon:e,title:t,subtitle:n,variant:r=`empty`}){let i=e===void 0?void 0:Qi[e];return(0,I.jsxs)(`div`,{className:`py-8 flex flex-col items-center justify-center gap-3`,children:[r===`loading`?(0,I.jsx)($i,{}):i&&(0,I.jsx)(i,{}),(0,I.jsx)(`span`,{className:`text-sm font-medium text-ink-subtle`,children:t}),n&&(0,I.jsx)(`span`,{className:`text-xs text-ink-muted text-center max-w-[240px]`,children:n})]})}function ta(e){return e===`Read`?`bg-accent-blue`:e===`Edit`||e===`Write`?`bg-accent-green`:e===`Bash`?`bg-accent-purple`:e===`Agent`?`bg-accent-teal`:`bg-ink-subtle`}var na={thrashing:`Edit/Test Thrashing`,stuck_loop:`Stuck Loop`,blind_editing:`Blind Editing`,re_reading:`Repeated Reads`};function ra(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}function ia({entries:e,segments:t,windowStartMs:n,windowEndMs:r,showTicks:i=!0,gutterClass:a=`w-24`}){let[o,s]=(0,F.useState)(null),c=(0,F.useMemo)(()=>e.map((e,t)=>({entry:e,originalIdx:t})).sort((e,t)=>e.entry.timestamp-t.entry.timestamp),[e]),l=(0,F.useMemo)(()=>{let n=new Map;for(let e=0;e<c.length;e++)n.set(c[e].originalIdx,e);let r=Array(c.length).fill(null);for(let i of t){let t=Math.max(0,i.startIndex),a=Math.min(i.endIndex,e.length-1);for(let e=t;e<=a;e++){let t=n.get(e);t!==void 0&&(r[t]===null||i.severity===`critical`&&r[t].severity!==`critical`)&&(r[t]=i)}}return r},[c,t,e.length]);if(e.length===0)return(0,I.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No tool calls recorded.`});let u=n!==void 0&&r!==void 0,d=u?n:c[0].entry.timestamp,f=c.reduce((e,{entry:t})=>Math.max(e,t.timestamp+(t.durationMs??50)),0),p=Math.max(u?r-n:f-d,1),m=[1e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5].find(e=>p/e<=8)??Math.ceil(p/8),h=[];for(let e=m;e<p;e+=m)h.push(e);let g=Math.min(30,800/Math.max(e.length,1));return(0,I.jsxs)(`div`,{className:`p-2 overflow-x-hidden`,children:[i&&(0,I.jsxs)(`div`,{className:`flex`,children:[(0,I.jsx)(`div`,{className:`${a} shrink-0`}),(0,I.jsx)(`div`,{className:`relative flex-1 h-5 border-b border-bg-line overflow-x-auto`,children:h.map(e=>(0,I.jsx)(`span`,{className:`absolute top-0 text-[9px] text-ink-muted tabular-nums -translate-x-1/2`,style:{left:`${e/p*100}%`},children:ra(e)},e))})]}),(0,I.jsx)(`div`,{className:i?`mt-1`:``,children:c.map(({entry:e,originalIdx:t},n)=>{let r=e.timestamp-d,i=e.durationMs??50,u=r/p*100,f=i/p*100,m=l[n];return(0,I.jsxs)(`div`,{className:`flex items-center h-7 ${m?m.severity===`critical`?`border-l-2 border-l-accent-red`:`border-l-2 border-l-accent-amber`:`border-l-2 border-l-transparent`}`,children:[(0,I.jsx)(`div`,{className:`${a} shrink-0 truncate text-[11px] text-ink-subtle pr-2 text-right`,title:e.toolName,children:hi(e.toolName)}),(0,I.jsxs)(`div`,{className:`relative flex-1 h-full flex items-center`,children:[(0,I.jsx)(`div`,{role:`img`,"aria-label":`${e.toolName} · ${e.durationMs==null?`unknown`:`${e.durationMs}ms`} · ${e.success?`success`:`failed`}`,className:`gantt-bar absolute h-5 rounded-sm opacity-80 ${ta(hi(e.toolName))} ${e.success?``:`ring-1 ring-accent-red/60`}`,style:{left:`${u}%`,width:`${f}%`,minWidth:`4px`,animationDelay:`${Math.round(n*g)}ms`},onMouseEnter:()=>s(n),onMouseLeave:()=>s(null)}),o===n&&(0,I.jsxs)(`div`,{className:`absolute z-50 px-2 py-1.5 rounded-lg bg-bg-elevated border border-bg-line text-[11px] text-ink-base shadow-lg whitespace-nowrap pointer-events-none ${n>=3&&n>c.length-4?`bottom-full mb-1`:`top-full mt-1`}`,style:u>=50?{right:`${Math.max(0,100-u-f)}%`}:{left:`${u}%`},children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.toolName}),(e.filePath??e.command)&&(0,I.jsx)(`div`,{className:`text-ink-subtle truncate max-w-[200px]`,children:e.filePath??e.command}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[e.durationMs==null?`unknown`:`${e.durationMs}ms`,` ·`,` `,e.success?`success`:`failed`]}),m&&(0,I.jsx)(`div`,{className:`mt-0.5 font-medium ${m.severity===`critical`?`text-accent-red`:`text-accent-amber`}`,children:na[m.type]??m.type})]})]})]},`${t}-${e.timestamp}`)})})]})}function aa(e){let t=new Map;for(let n of e){let e=n.workflowRunId,r=t.get(e);r?r.push(n):t.set(e,[n])}let n=[];for(let[e,r]of t){let t=[...r].sort((e,t)=>e.startMs-t.startMs),i=t.reduce((e,t)=>Math.min(e,t.startMs),1/0),a=e===null?`Ad-hoc subagents`:r[0]?.workflowName??`Workflow run`;n.push({runId:e,name:a,earliestStartMs:i,agents:t})}return n.sort((e,t)=>e.earliestStartMs-t.earliestStartMs),n}var oa=[`bg-series-1`,`bg-series-2`,`bg-series-3`,`bg-series-4`,`bg-series-5`,`bg-series-6`],sa=`__parent__`,ca=`__adhoc__`;function la(e){return e===null?ca:`run:${e}`}function ua(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}var da=15,fa=`w-44`;function pa({status:e}){return e===`completed`?(0,I.jsx)(bn,{size:12,className:`shrink-0 text-accent-green`,"aria-label":`completed`,role:`img`}):e===`failed`?(0,I.jsx)(xn,{size:12,className:`shrink-0 text-accent-red`,"aria-label":`failed`,role:`img`}):e===`running`?(0,I.jsx)(En,{size:12,className:`shrink-0 text-accent-cyan animate-spin`,"aria-label":`running`,role:`img`}):e===`cancelled`?(0,I.jsx)(Sn,{size:12,className:`shrink-0 text-accent-amber`,"aria-label":`cancelled`,role:`img`}):null}function ma({sessionId:e,parentEntries:t,agents:n,window:r,onSelectRun:i,runStatusById:a,parentSegments:o}){let[s,c]=(0,F.useState)(`gantt`),l=(0,F.useMemo)(()=>aa(n),[n]),u=(0,F.useMemo)(()=>{let e=[];t.length>0&&e.push(sa);for(let t of l)e.push(la(t.runId));return e},[l,t.length]),d=(0,F.useMemo)(()=>n.map(e=>e.agentId),[n]),[f,p]=(0,F.useState)(()=>{let e=new Set;for(let t of l)t.agents.length>da&&e.add(la(t.runId));return e}),[m,h]=(0,F.useState)(()=>new Set),g=e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},_=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},v=e=>{e===`collapsed`?(p(new Set(u)),h(new Set)):e===`agents`?(p(t.length>0?new Set([sa]):new Set),h(new Set)):(p(new Set),h(new Set(d)))},y=(0,F.useMemo)(()=>{let e=t.length>0,n=u.filter(e=>e!==sa),r=!e||f.has(`__parent__`),i=f.size===0,a=u.length>0&&u.every(e=>f.has(e)),o=n.every(e=>!f.has(e)),s=m.size===0,c=d.length>0?d.every(e=>m.has(e)):m.size===0;return a&&s?`collapsed`:i&&c?`expanded`:r&&o&&s?`agents`:null},[f,m,u,d,t.length]),b=t.length,x=(0,F.useMemo)(()=>[...t],[t]);return t.length===0&&n.length===0?(0,I.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No activity recorded.`}):(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(Qr,{value:s,onChange:c,options:[{value:`gantt`,label:`Gantt`},{value:`list`,label:`List`}],size:`sm`,tone:`green`,ariaLabel:`Session trace view mode`}),(0,I.jsx)(`div`,{className:`h-4 w-px bg-border-subtle`,"aria-hidden":`true`}),(0,I.jsx)(ha,{active:y,onSelect:v})]}),(0,I.jsxs)(`span`,{className:`text-[10px] uppercase tracking-wider text-ink-muted tabular-nums`,children:[b,` parent call`,b===1?``:`s`,` · `,n.length,` agent`,n.length===1?``:`s`]})]}),s===`gantt`?(0,I.jsx)(_a,{parentRows:x,groups:l,window:r,sessionId:e,onSelectRun:i,runStatusById:a,parentSegments:o,collapsedGroups:f,toggleGroup:g,expandedAgents:m,toggleAgent:_}):(0,I.jsx)(xa,{parentRows:x,groups:l,window:r,sessionId:e,onSelectRun:i,runStatusById:a,collapsedGroups:f,toggleGroup:g,expandedAgents:m,toggleAgent:_})]})}function ha({active:e,onSelect:t}){return(0,I.jsx)(`div`,{role:`group`,"aria-label":`Trace expand level`,className:`inline-flex items-center gap-1`,children:[{value:`collapsed`,label:`Collapsed`},{value:`agents`,label:`Agents`},{value:`expanded`,label:`Expand all`}].map(n=>{let r=e===n.value;return(0,I.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>t(n.value),className:`px-2 py-0.5 text-[10px] rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 `+(r?`bg-accent-cyan/20 text-accent-cyan font-medium`:`text-ink-muted hover:text-ink-subtle`),children:n.label},n.value)})})}function ga({window:e}){let t=Math.max(e.endMs-e.startMs,1),n=(0,F.useMemo)(()=>{let e=[1e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5].find(e=>t/e<=8)??Math.ceil(t/8),n=[];for(let r=e;r<t;r+=e)n.push(r);return n},[t]);return(0,I.jsxs)(`div`,{className:`flex px-2`,children:[(0,I.jsx)(`div`,{className:`${fa} shrink-0`}),(0,I.jsx)(`div`,{className:`relative flex-1 h-5 border-b border-bg-line overflow-x-auto`,children:n.map(e=>(0,I.jsx)(`span`,{className:`absolute top-0 text-[9px] text-ink-muted tabular-nums -translate-x-1/2`,style:{left:`${e/t*100}%`},children:ua(e)},e))})]})}function _a({parentRows:e,groups:t,window:n,sessionId:r,onSelectRun:i,runStatusById:a,parentSegments:o,collapsedGroups:s,toggleGroup:c,expandedAgents:l,toggleAgent:u}){let d=s.has(sa),f=e.length>0;return(0,I.jsxs)(`div`,{className:`overflow-x-hidden`,children:[(0,I.jsx)(ga,{window:n}),f&&(0,I.jsxs)(`div`,{className:`mb-2 mt-1`,children:[(0,I.jsx)(Ea,{collapsed:d,onToggle:()=>c(`__parent__`),label:`Parent`,count:`${e.length} tool call${e.length===1?``:`s`}`}),!d&&(0,I.jsx)(ia,{entries:e,segments:o?[...o]:[],windowStartMs:n.startMs,windowEndMs:n.endMs,showTicks:!1,gutterClass:fa})]}),t.map((e,t)=>{let o=oa[t%oa.length],d=la(e.runId),f=s.has(d),p=e.runId===null?void 0:a?.[e.runId],m=e.runId!==null&&i?()=>i(e.runId):void 0,h=e.agents.map(e=>e.usd).filter(e=>e!=null),g=h.length>0?h.reduce((e,t)=>e+t,0):null,_=e.agents.reduce((e,t)=>Math.max(e,t.endMs),0),v=_-e.earliestStartMs,y=`${e.agents.length} agent${e.agents.length===1?``:`s`} · ${pi(g)} · ${ua(Math.max(0,v))} span`;return(0,I.jsx)(`div`,{className:`mb-2`,children:f?(0,I.jsx)(va,{onToggle:()=>c(d),label:e.name,summary:y,barColor:o,window:n,startMs:e.earliestStartMs,endMs:_,status:p,onOpenRun:m}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Ea,{collapsed:!1,onToggle:()=>c(d),label:e.name,swatchColor:o,count:`${e.agents.length} agent${e.agents.length===1?``:`s`}`,status:p,onOpenRun:m}),e.agents.map(e=>(0,I.jsx)(ya,{agent:e,barColor:o,window:n,sessionId:r,onSelectRun:i,expanded:l.has(e.agentId),onToggle:()=>u(e.agentId)},e.agentId))]})},e.runId??`__adhoc__`)})]})}function va({onToggle:e,label:t,summary:n,barColor:r,window:i,startMs:a,endMs:o,status:s,onOpenRun:c}){let l=Math.max(i.endMs-i.startMs,1),u=a-i.startMs,d=Math.max(0,u/l*100),f=Math.max(0,o-a)/l*100,p=`${t} · ${n}`,m=s===`failed`,h=`absolute inset-y-0 my-auto h-4 rounded-sm opacity-85 ${r}`+(m?` ring-1 ring-accent-red/60`:``);return(0,I.jsxs)(`div`,{className:`flex items-center h-7 px-2`,children:[(0,I.jsxs)(`div`,{className:`${fa} shrink-0 flex items-center gap-1.5 pr-2`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:e,"aria-expanded":!1,className:`shrink-0 flex items-center gap-1.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,title:n,children:[(0,I.jsx)(yn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm shrink-0 ${r}`,"aria-hidden":`true`})]}),c?(0,I.jsx)(`span`,{role:`button`,tabIndex:0,title:`${t} · open run`,onClick:e=>{e.stopPropagation(),c()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),c())},className:`text-[11px] font-medium text-ink-subtle truncate cursor-pointer hover:text-accent-cyan hover:underline underline-offset-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:t}):(0,I.jsx)(`span`,{className:`text-[11px] font-medium text-ink-subtle truncate`,title:t,children:t}),(0,I.jsx)(pa,{status:s})]}),(0,I.jsx)(`div`,{className:`relative flex-1 h-full flex items-center`,children:(0,I.jsx)(`div`,{role:`img`,"aria-label":p,title:p,className:h,style:{left:`${d}%`,width:`${f}%`,minWidth:`4px`}})})]})}function ya({agent:e,barColor:t,window:n,sessionId:r,onSelectRun:i,expanded:a,onToggle:o}){let[s,c]=(0,F.useState)(!1),l=Math.max(n.endMs-n.startMs,1),u=e.startMs-n.startMs,d=Math.max(0,u/l*100),f=e.durationMs/l*100,p=e.workflowRunId!==null&&i!==void 0,m=e.workflowRunId,h=d>=50?{right:`${Math.max(0,100-d-f)}%`}:{left:`${d}%`},g=`${e.label} · ${e.model} · ${e.turnCount} turns · ${mi(e.totalTokens)} tokens · ${pi(e.usd)} · ${ui(e.durationMs)}`+(p?` · open workflow run`:``),_=`absolute inset-y-0 my-auto h-5 rounded-sm opacity-85 ${t} `+(p?`cursor-pointer hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`:`cursor-default`);return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`flex items-center h-7 px-2`,children:[(0,I.jsxs)(`div`,{className:`${fa} shrink-0 flex items-center gap-1 pl-4 pr-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:o,"aria-expanded":a,"aria-label":`${a?`Collapse`:`Expand`} calls for ${e.label}`,className:`shrink-0 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:a?(0,I.jsx)(vn,{size:11,className:`text-ink-muted`,"aria-hidden":`true`}):(0,I.jsx)(yn,{size:11,className:`text-ink-muted`,"aria-hidden":`true`})}),(0,I.jsx)(`span`,{className:`truncate text-[11px] text-ink-subtle`,title:e.label,children:e.label})]}),(0,I.jsxs)(`div`,{className:`relative flex-1 h-full flex items-center`,children:[p?(0,I.jsx)(`button`,{type:`button`,"aria-label":g,className:_,style:{left:`${d}%`,width:`${f}%`,minWidth:`4px`},onClick:()=>i(m),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocus:()=>c(!0),onBlur:()=>c(!1)}):(0,I.jsx)(`div`,{role:`img`,"aria-label":g,className:_,style:{left:`${d}%`,width:`${f}%`,minWidth:`4px`},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)}),s&&(0,I.jsxs)(`div`,{className:`absolute z-50 top-full mt-1 px-2 py-1.5 rounded-lg bg-bg-elevated border border-bg-line text-[11px] text-ink-base shadow-lg whitespace-nowrap pointer-events-none`,style:h,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.label}),(0,I.jsx)(`div`,{className:`text-ink-subtle font-mono`,children:e.model}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[e.turnCount,` turn`,e.turnCount===1?``:`s`,` ·`,` `,mi(e.totalTokens),` tokens`]}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[pi(e.usd),` · `,ui(e.durationMs)]})]})]})]}),a&&(0,I.jsx)(ba,{agentId:e.agentId,sessionId:r,window:n})]})}function ba({agentId:e,sessionId:t,window:n}){let{data:r,isLoading:i,isError:a}=L({queryKey:z.agentCalls(t,e),queryFn:()=>vr(t,e),retry:!1});if(i)return(0,I.jsx)(`div`,{className:`pl-6 py-1 text-[10px] text-ink-muted`,children:`Loading calls…`});if(a)return(0,I.jsx)(`div`,{className:`pl-6 py-1 text-[10px] text-accent-red`,children:`Failed to load calls.`});let o=r?.calls??[];return o.length===0?(0,I.jsx)(`div`,{className:`pl-6 py-1 text-[10px] text-ink-muted`,children:`No calls recorded.`}):(0,I.jsx)(`div`,{className:`pl-3 border-l border-bg-line ml-3`,children:(0,I.jsx)(ia,{entries:[...o],segments:[],windowStartMs:n.startMs,windowEndMs:n.endMs,showTicks:!1,gutterClass:fa})})}function xa({parentRows:e,groups:t,window:n,sessionId:r,onSelectRun:i,runStatusById:a,collapsedGroups:o,toggleGroup:s,expandedAgents:c,toggleAgent:l}){let u=n.startMs,d=o.has(sa),f=(0,F.useMemo)(()=>{let t=1/0,n=0;for(let r of e){r.timestamp<t&&(t=r.timestamp);let e=r.timestamp+(r.durationMs??50);e>n&&(n=e)}return Number.isFinite(t)?Math.max(0,n-t):0},[e]);return(0,I.jsxs)(`div`,{className:`text-[11px]`,children:[e.length>0&&(0,I.jsxs)(`div`,{className:`mb-3`,children:[(0,I.jsx)(Ea,{collapsed:d,onToggle:()=>s(`__parent__`),label:`Parent`,count:`${e.length} tool call${e.length===1?``:`s`}`,trailing:(0,I.jsx)(Ta,{durationMs:f})}),!d&&(0,I.jsx)(`div`,{className:`flex flex-col`,children:[...e].sort((e,t)=>e.timestamp-t.timestamp).map((e,t)=>(0,I.jsx)(Sa,{entry:e,firstTs:u,detail:e.filePath??e.command??``},`${t}-${e.timestamp}`))})]}),t.map((e,t)=>{let u=oa[t%oa.length],d=la(e.runId),f=o.has(d),p=e.runId===null?void 0:a?.[e.runId],m=e.runId!==null&&i?()=>i(e.runId):void 0,h=e.agents.reduce((e,t)=>e+t.turnCount,0),g=e.agents.reduce((e,t)=>e+t.totalTokens,0),_=e.agents.map(e=>e.usd).filter(e=>e!=null),v=_.length>0?_.reduce((e,t)=>e+t,0):null,y=Math.max(0,e.agents.reduce((e,t)=>Math.max(e,t.endMs),0)-e.earliestStartMs);return(0,I.jsxs)(`div`,{className:`mb-3`,children:[(0,I.jsx)(Ea,{collapsed:f,onToggle:()=>s(d),label:e.name,swatchColor:u,count:`${e.agents.length} agent${e.agents.length===1?``:`s`}`,status:p,onOpenRun:m,trailing:(0,I.jsx)(Ta,{turns:h,tokens:g,usd:v,durationMs:y})}),!f&&(0,I.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:e.agents.map(e=>(0,I.jsx)(Ca,{agent:e,window:n,sessionId:r,onSelectRun:i,expanded:c.has(e.agentId),onToggle:()=>l(e.agentId)},e.agentId))})]},e.runId??`__adhoc__`)})]})}function Sa({entry:e,firstTs:t,detail:n}){return(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5`,children:[(0,I.jsxs)(`span`,{className:`w-10 text-ink-muted tabular-nums shrink-0`,children:[`+`,li(Math.max(0,e.timestamp-t))]}),(0,I.jsx)(`span`,{className:`w-28 truncate font-medium text-ink-base shrink-0`,title:e.toolName,children:hi(e.toolName)}),(0,I.jsx)(`span`,{className:`flex-1 truncate font-mono text-ink-subtle min-w-0`,title:n??``,children:n??``}),(0,I.jsx)(`span`,{className:`w-14 text-right tabular-nums text-ink-muted shrink-0`,children:e.durationMs==null?`—`:`${e.durationMs}ms`}),(0,I.jsx)(`span`,{className:`w-3 text-center shrink-0 ${e.success?`text-accent-green`:`text-accent-red`}`,"aria-label":e.success?`success`:`failed`,children:e.success?`✓`:`✗`})]})}function Ca({agent:e,window:t,sessionId:n,onSelectRun:r,expanded:i,onToggle:a}){let o=e.workflowRunId!==null&&r!==void 0,s=e.workflowRunId;return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:a,"aria-expanded":i,"aria-label":`${i?`Collapse`:`Expand`} calls for ${e.label}`,className:`shrink-0 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:i?(0,I.jsx)(vn,{size:11,className:`text-ink-muted`,"aria-hidden":`true`}):(0,I.jsx)(yn,{size:11,className:`text-ink-muted`,"aria-hidden":`true`})}),o?(0,I.jsx)(`button`,{type:`button`,onClick:()=>r(s),className:`truncate font-medium text-accent-cyan hover:underline text-left shrink-0 max-w-[160px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,title:`${e.label} · open workflow run`,children:e.label}):(0,I.jsx)(`span`,{className:`truncate font-medium text-ink-base shrink-0 max-w-[160px]`,title:e.label,children:e.label}),(0,I.jsx)(`span`,{className:`font-mono text-ink-muted truncate min-w-0 flex-1`,title:e.model,children:e.model}),(0,I.jsxs)(`span`,{className:`text-ink-muted tabular-nums shrink-0`,children:[e.turnCount,` turn`,e.turnCount===1?``:`s`]}),(0,I.jsxs)(`span`,{className:`text-ink-muted tabular-nums shrink-0`,children:[mi(e.totalTokens),` tok`]}),(0,I.jsx)(`span`,{className:`text-accent-amber tabular-nums shrink-0 w-12 text-right`,children:pi(e.usd)}),(0,I.jsx)(`span`,{className:`text-ink-muted tabular-nums shrink-0 w-12 text-right`,children:ui(e.durationMs)})]}),i&&(0,I.jsx)(wa,{agentId:e.agentId,sessionId:n,firstTs:t.startMs})]})}function wa({agentId:e,sessionId:t,firstTs:n}){let{data:r,isLoading:i,isError:a}=L({queryKey:z.agentCalls(t,e),queryFn:()=>vr(t,e),retry:!1});if(i)return(0,I.jsx)(`div`,{className:`pl-9 py-1 text-[10px] text-ink-muted`,children:`Loading calls…`});if(a)return(0,I.jsx)(`div`,{className:`pl-9 py-1 text-[10px] text-accent-red`,children:`Failed to load calls.`});let o=r?.calls??[];return o.length===0?(0,I.jsx)(`div`,{className:`pl-9 py-1 text-[10px] text-ink-muted`,children:`No calls recorded.`}):(0,I.jsx)(`div`,{className:`pl-6 border-l border-bg-line ml-3 flex flex-col`,children:[...o].sort((e,t)=>e.timestamp-t.timestamp).map((e,t)=>(0,I.jsx)(Sa,{entry:e,firstTs:n},`${t}-${e.timestamp}`))})}function Ta({turns:e,tokens:t,usd:n,durationMs:r}){return(0,I.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[10px] tabular-nums shrink-0 pl-2`,children:[e!=null&&(0,I.jsxs)(`span`,{className:`text-ink-muted`,children:[e,` turn`,e===1?``:`s`]}),t!=null&&(0,I.jsxs)(`span`,{className:`text-ink-muted`,children:[mi(t),` tok`]}),n!=null&&(0,I.jsx)(`span`,{className:`text-accent-amber`,children:fi(n)}),r!=null&&(0,I.jsx)(`span`,{className:`text-ink-muted`,children:ui(r)})]})}function Ea({collapsed:e,onToggle:t,label:n,count:r,swatchColor:i,status:a,trailing:o,onOpenRun:s}){return(0,I.jsxs)(`div`,{className:`flex w-full items-center gap-1.5 mb-0.5 px-2 text-left`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:t,"aria-expanded":!e,className:`flex items-center gap-1.5 shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,children:[e?(0,I.jsx)(yn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}):(0,I.jsx)(vn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}),i!=null&&(0,I.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm shrink-0 ${i}`,"aria-hidden":`true`})]}),s?(0,I.jsx)(`span`,{role:`button`,tabIndex:0,title:`${n} · open run`,onClick:e=>{e.stopPropagation(),s()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),s())},className:`text-[11px] font-medium text-ink-subtle truncate min-w-0 cursor-pointer hover:text-accent-cyan hover:underline underline-offset-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:n}):(0,I.jsx)(`span`,{className:`text-[11px] font-medium text-ink-subtle truncate min-w-0`,title:n,children:n}),(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted tabular-nums truncate shrink-0`,children:r}),(0,I.jsx)(pa,{status:a}),o]})}function Da(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Oa(e,t=16){return e.length<=t?e:`${e.slice(0,6)}…${e.slice(-6)}`}function ka({column:e,sortKey:t,sortDir:n}){return e===t?n===`asc`?(0,I.jsx)(gn,{className:`w-3 h-3 text-accent-amber`,"aria-hidden":`true`}):(0,I.jsx)(mn,{className:`w-3 h-3 text-accent-amber`,"aria-hidden":`true`}):(0,I.jsx)(hn,{className:`w-3 h-3 opacity-30`,"aria-hidden":`true`})}function Aa({column:e,label:t,sortKey:n,sortDir:r,onSort:i,className:a=``}){return(0,I.jsx)(`th`,{scope:`col`,"aria-sort":e===n?r===`asc`?`ascending`:`descending`:`none`,className:`px-3 py-2 text-left text-[10px] uppercase tracking-wider text-ink-muted font-semibold whitespace-nowrap select-none ${a}`,children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>i(e),className:`inline-flex items-center gap-1 cursor-pointer hover:text-ink-subtle transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,children:[t,(0,I.jsx)(ka,{column:e,sortKey:n,sortDir:r})]})})}function ja({agents:e}){let[t,n]=(0,F.useState)(`tokens`),[r,i]=(0,F.useState)(`desc`),[a,o]=(0,F.useState)(null);function s(e){e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`desc`))}async function c(e){try{await navigator.clipboard.writeText(e),o(e),setTimeout(()=>o(null),1500)}catch{}}let l=[...e].sort((e,n)=>{let i=e[t]??-1/0,a=n[t]??-1/0;if(typeof i==`string`&&typeof a==`string`)return r===`asc`?i.localeCompare(a):a.localeCompare(i);let o=i,s=a;return r===`asc`?o-s:s-o});return e.length===0?(0,I.jsx)(`div`,{className:`py-6 text-center text-xs text-ink-muted`,children:`No agent data recorded for this run.`}):(0,I.jsx)(`div`,{className:`overflow-x-auto rounded-lg border border-border-subtle`,children:(0,I.jsxs)(`table`,{className:`w-full text-xs`,"aria-label":`Agent activity`,children:[(0,I.jsx)(`thead`,{className:`bg-surface-5 border-b border-border-subtle`,children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(Aa,{column:`label`,label:`Agent`,sortKey:t,sortDir:r,onSort:s}),(0,I.jsx)(Aa,{column:`model`,label:`Model`,sortKey:t,sortDir:r,onSort:s}),(0,I.jsx)(Aa,{column:`state`,label:`State`,sortKey:t,sortDir:r,onSort:s}),(0,I.jsx)(Aa,{column:`tokens`,label:`Tokens`,sortKey:t,sortDir:r,onSort:s,className:`text-right`}),(0,I.jsx)(Aa,{column:`toolCalls`,label:`Tool Calls`,sortKey:t,sortDir:r,onSort:s,className:`text-right`}),(0,I.jsx)(Aa,{column:`durationMs`,label:`Duration`,sortKey:t,sortDir:r,onSort:s,className:`text-right`})]})}),(0,I.jsx)(`tbody`,{className:`divide-y divide-border-subtle`,children:l.map(e=>(0,I.jsxs)(`tr`,{className:`hover:bg-surface-5 transition-colors`,children:[(0,I.jsx)(`td`,{className:`px-3 py-2 min-w-0`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,I.jsx)(`button`,{type:`button`,title:e.agentId,"aria-label":`Copy agent ID ${e.agentId}`,onClick:()=>void c(e.agentId),className:`text-left text-ink-base font-medium truncate hover:text-accent-cyan transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded`,children:a===e.agentId?(0,I.jsx)(`span`,{className:`text-accent-green`,children:`Copied!`}):e.label||Oa(e.agentId)}),e.phaseTitle&&(0,I.jsxs)(`span`,{className:`text-[10px] text-ink-muted truncate`,children:[e.phaseTitle,e.attempt>1?` · attempt ${e.attempt}`:``]})]})}),(0,I.jsx)(`td`,{className:`px-3 py-2`,children:(0,I.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] bg-surface-5 text-ink-subtle font-mono`,children:e.model||`—`})}),(0,I.jsx)(`td`,{className:`px-3 py-2`,children:(0,I.jsx)(`span`,{className:`text-ink-subtle`,children:e.state||`—`})}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-right tabular-nums text-ink-base font-medium`,children:e.tokens>0?Da(e.tokens):(0,I.jsx)(`span`,{className:`text-ink-muted opacity-40`,children:`—`})}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-right tabular-nums text-ink-muted`,children:e.toolCalls>0?e.toolCalls.toLocaleString():(0,I.jsx)(`span`,{className:`text-ink-muted opacity-40`,children:`—`})}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-right tabular-nums text-ink-muted`,children:e.durationMs==null?(0,I.jsx)(`span`,{className:`text-ink-muted opacity-40`,children:`—`}):ui(e.durationMs)})]},e.agentId))})]})})}function Ma(e){return e===`Read`?`bg-accent-blue`:e===`Edit`||e===`Write`?`bg-accent-green`:e===`Bash`?`bg-accent-purple`:e===`Agent`?`bg-accent-teal`:`bg-ink-subtle`}var Na=15;function Pa({agents:e,window:t,parentEntries:n,onSelectRun:r}){let[i,a]=(0,F.useState)(null),o=Math.max(t.endMs-t.startMs,1),s=(0,F.useMemo)(()=>{let e=[1e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5].find(e=>o/e<=8)??Math.ceil(o/8),t=[];for(let n=e;n<o;n+=e)t.push(n);return t},[o]),c=(0,F.useMemo)(()=>aa(e),[e]),l=(0,F.useMemo)(()=>n?[...n].sort((e,t)=>e.timestamp-t.timestamp):[],[n]),u=n!==void 0,d=(0,F.useMemo)(()=>c.reduce((e,t)=>e+t.agents.length,0),[c])+ +!!u,[f,p]=(0,F.useState)(()=>{let e=new Set;for(let t of c)t.agents.length>Na&&e.add(la(t.runId));return e}),m=e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};if(e.length===0&&!u)return(0,I.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No subagents ran in this session.`});let h=-1,g=e=>e>=3&&e>d-4?`bottom-full mb-1`:`top-full mt-1`,_=f.has(sa);return(0,I.jsxs)(`div`,{className:`p-2 overflow-x-hidden`,children:[(0,I.jsxs)(`div`,{className:`flex`,children:[(0,I.jsx)(`div`,{className:`w-24 shrink-0`}),(0,I.jsx)(`div`,{className:`relative flex-1 h-5 border-b border-bg-line overflow-x-auto`,children:s.map(e=>(0,I.jsx)(`span`,{className:`absolute top-0 text-[9px] text-ink-muted tabular-nums -translate-x-1/2`,style:{left:`${e/o*100}%`},children:ua(e)},e))})]}),(0,I.jsxs)(`div`,{className:`mt-1`,children:[u&&(0,I.jsxs)(`div`,{className:`mb-2`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>m(`__parent__`),"aria-expanded":!_,className:`flex w-full items-center gap-1.5 mb-0.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,children:[_?(0,I.jsx)(yn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}):(0,I.jsx)(vn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-[11px] font-medium text-ink-subtle truncate`,children:`Parent activity`}),(0,I.jsxs)(`span`,{className:`text-[10px] text-ink-muted tabular-nums`,children:[l.length,` tool call`,l.length===1?``:`s`]})]}),!_&&(()=>{h+=1;let e=h;return(0,I.jsxs)(`div`,{className:`flex items-center h-7`,children:[(0,I.jsx)(`div`,{className:`w-24 shrink-0 truncate text-[11px] text-ink-subtle pr-2 text-right`,children:`Parent`}),(0,I.jsx)(`div`,{className:`relative flex-1 h-full flex items-center`,children:l.map((n,r)=>{let s=n.timestamp-t.startMs,c=Math.max(0,s/o*100),l=(n.durationMs??50)/o*100,u=`parent:${r}`,d=hi(n.toolName),f=c>=50?{right:`${Math.max(0,100-c-l)}%`}:{left:`${c}%`};return(0,I.jsxs)(`div`,{className:`contents`,children:[(0,I.jsx)(`div`,{role:`img`,"aria-label":`${n.toolName} · ${n.durationMs==null?`unknown`:`${n.durationMs}ms`} · ${n.success?`success`:`failed`}`,className:`absolute inset-y-0 my-auto h-5 rounded-sm opacity-80 cursor-default ${Ma(d)} `+(n.success?``:`ring-1 ring-accent-red/60`),style:{left:`${c}%`,width:`${l}%`,minWidth:`4px`},onMouseEnter:()=>a(u),onMouseLeave:()=>a(null)}),i===u&&(0,I.jsxs)(`div`,{className:`absolute z-50 ${g(e)} px-2 py-1.5 rounded-lg bg-bg-elevated border border-bg-line text-[11px] text-ink-base shadow-lg whitespace-nowrap pointer-events-none`,style:f,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:n.toolName}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[n.durationMs==null?`unknown`:`${n.durationMs}ms`,` `,`· `,n.success?`success`:`failed`]})]})]},u)})})]})})()]}),c.map((e,n)=>{let s=oa[n%oa.length],c=la(e.runId),l=f.has(c),u=e.agents.map(e=>e.usd).filter(e=>e!=null),d=u.length>0?u.reduce((e,t)=>e+t,0):null,p=e.agents.reduce((e,t)=>Math.max(e,t.endMs),0)-e.earliestStartMs,_=`${e.agents.length} agent${e.agents.length===1?``:`s`} · ${pi(d)} · ${ua(Math.max(0,p))} span`;return(0,I.jsxs)(`div`,{className:`mb-2`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>m(c),"aria-expanded":!l,className:`flex w-full items-center gap-1.5 mb-0.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,children:[l?(0,I.jsx)(yn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}):(0,I.jsx)(vn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm shrink-0 ${s}`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-[11px] font-medium text-ink-subtle truncate`,title:e.name,children:e.name}),l?(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted tabular-nums truncate`,children:_}):(0,I.jsxs)(`span`,{className:`text-[10px] text-ink-muted tabular-nums`,children:[e.agents.length,` agent`,e.agents.length===1?``:`s`]})]}),!l&&e.agents.map(e=>{h+=1;let c=h,l=e.startMs-t.startMs,u=Math.max(0,l/o*100),d=e.durationMs/o*100,f=`${n}:${e.agentId}`,p=e.workflowRunId!==null&&r!==void 0,m=e.workflowRunId,_=u>=50?{right:`${Math.max(0,100-u-d)}%`}:{left:`${u}%`},v=`${e.label} · ${e.model} · ${e.turnCount} turns · ${di(e.totalTokens)} tokens · ${pi(e.usd)} · ${ui(e.durationMs)}`+(p?` · open workflow run`:``),y=`absolute inset-y-0 my-auto h-5 rounded-sm opacity-85 ${s} `+(p?`cursor-pointer hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`:`cursor-default`);return(0,I.jsxs)(`div`,{className:`flex items-center h-7`,children:[(0,I.jsx)(`div`,{className:`w-24 shrink-0 truncate text-[11px] text-ink-subtle pr-2 text-right`,title:e.label,children:e.label}),(0,I.jsxs)(`div`,{className:`relative flex-1 h-full flex items-center`,children:[p?(0,I.jsx)(`button`,{type:`button`,"aria-label":v,className:y,style:{left:`${u}%`,width:`${d}%`,minWidth:`4px`},onClick:()=>r(m),onMouseEnter:()=>a(f),onMouseLeave:()=>a(null),onFocus:()=>a(f),onBlur:()=>a(null)}):(0,I.jsx)(`div`,{role:`img`,"aria-label":v,className:y,style:{left:`${u}%`,width:`${d}%`,minWidth:`4px`},onMouseEnter:()=>a(f),onMouseLeave:()=>a(null)}),i===f&&(0,I.jsxs)(`div`,{className:`absolute z-50 ${g(c)} px-2 py-1.5 rounded-lg bg-bg-elevated border border-bg-line text-[11px] text-ink-base shadow-lg whitespace-nowrap pointer-events-none`,style:_,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.label}),(0,I.jsx)(`div`,{className:`text-ink-subtle font-mono`,children:e.model}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[e.turnCount,` turn`,e.turnCount===1?``:`s`,` ·`,` `,di(e.totalTokens),` tokens`]}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[pi(e.usd),` ·`,` `,ui(e.durationMs)]})]})]})]},f)})]},e.runId??`__adhoc__`)})]})]})}var Fa={running:{tone:`info`,label:`Running`},completed:{tone:`success`,label:`Completed`},failed:{tone:`danger`,label:`Failed`},cancelled:{tone:`warning`,label:`Cancelled`},unknown:{tone:`neutral`,label:`Unknown`}};function Ia({status:e}){switch(e){case`completed`:return(0,I.jsx)(bn,{className:`w-4 h-4 text-accent-green`,"aria-hidden":`true`});case`failed`:return(0,I.jsx)(xn,{className:`w-4 h-4 text-accent-red`,"aria-hidden":`true`});case`running`:return(0,I.jsx)(En,{className:`w-4 h-4 text-accent-cyan animate-spin`,"aria-hidden":`true`});case`cancelled`:return(0,I.jsx)(Sn,{className:`w-4 h-4 text-accent-amber`,"aria-hidden":`true`});default:return(0,I.jsx)(Sn,{className:`w-4 h-4 text-ink-muted`,"aria-hidden":`true`})}}function La(e,t,n){let r=[];for(let i of e){if(i.startedAt==null)continue;let e=i.durationMs??0;r.push({agentId:i.agentId,workflowRunId:t,workflowName:n,label:i.label||i.agentId,model:i.model,startMs:i.startedAt,endMs:i.startedAt+e,durationMs:e,turnCount:i.toolCalls,totalTokens:i.tokens,usd:null})}return r}function Ra({runId:e,onClose:t}){let n=(0,F.useRef)(null),r=(0,F.useRef)(null);(0,F.useEffect)(()=>{function e(e){if(e.key===`Escape`){t();return}if(e.key===`Tab`&&n.current){let t=n.current.querySelectorAll(`button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`),r=t[0],i=t[t.length-1];!e.shiftKey&&document.activeElement===i?(e.preventDefault(),r?.focus()):e.shiftKey&&document.activeElement===r&&(e.preventDefault(),i?.focus())}}return document.addEventListener(`keydown`,e),r.current?.focus(),()=>document.removeEventListener(`keydown`,e)},[t]);let{data:i,isLoading:a,isError:o}=L({queryKey:z.workflowDetail(e),queryFn:()=>Fr(e),refetchInterval:5e3}),s=i?.run,c=(0,F.useMemo)(()=>i?.agents??[],[i?.agents]),l=i?.topology??null,u=s==null?null:Fa[s.status]??Fa.unknown,d=s!=null&&(s.status===`failed`||s.status===`cancelled`)&&typeof s.errorReason==`string`&&s.errorReason.trim()!==``?s.errorReason:null,f=c.reduce((e,t)=>e+(t.tokens??0),0),p=s?.totalTokens??null,m=p==null?null:p-f,h=(0,F.useMemo)(()=>s==null?[]:La(c,s.runId,s.workflowName??null),[c,s]),g=(0,F.useMemo)(()=>{if(h.length===0)return{startMs:0,endMs:1};let e=1/0,t=-1/0;for(let n of h)n.startMs<e&&(e=n.startMs),n.endMs>t&&(t=n.endMs);return{startMs:e,endMs:t>e?t:e+1}},[h]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,"aria-hidden":`true`,onClick:t}),(0,I.jsxs)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-label":`Workflow run details: ${s?.workflowName??e}`,className:`fixed right-0 top-0 bottom-0 z-50 w-[640px] max-w-full flex flex-col bg-bg-panel border-l border-border-medium shadow-2xl overflow-hidden`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3 px-5 py-4 border-b border-border-subtle shrink-0`,children:[(0,I.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[a&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-ink-muted`,children:[(0,I.jsx)(En,{className:`w-4 h-4 animate-spin`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-sm`,children:`Loading run details…`})]}),o&&(0,I.jsx)(`span`,{className:`text-sm text-accent-red`,children:`Failed to load run details.`}),s!=null&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(Ia,{status:s.status}),(0,I.jsx)(`h2`,{className:`text-sm font-semibold text-ink-base truncate`,children:s.workflowName}),u!=null&&(0,I.jsx)(qr,{tone:u.tone,size:`sm`,bordered:!0,children:u.label}),s.runSource!=null&&(0,I.jsx)(qr,{tone:`neutral`,size:`sm`,children:s.runSource})]}),(0,I.jsxs)(`div`,{className:`mt-1 flex items-center gap-3 text-[10px] text-ink-muted flex-wrap`,children:[(0,I.jsx)(`span`,{className:`font-mono`,children:e}),s.startedAt!=null&&(0,I.jsx)(`span`,{children:new Date(s.startedAt).toLocaleString()}),s.durationMs!=null&&(0,I.jsx)(`span`,{children:ui(s.durationMs)}),s.defaultModel&&(0,I.jsx)(`span`,{className:`font-mono`,children:s.defaultModel})]})]})]}),(0,I.jsx)(`button`,{ref:r,type:`button`,"aria-label":`Close run details`,onClick:t,className:`shrink-0 p-1.5 rounded-md text-ink-muted hover:text-ink-base hover:bg-surface-5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:(0,I.jsx)(Mn,{className:`w-4 h-4`,"aria-hidden":`true`})})]}),(0,I.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-4 space-y-5`,children:s!=null&&(0,I.jsxs)(I.Fragment,{children:[d!=null&&(0,I.jsxs)(B,{tone:`static`,padding:`sm`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Failure reason`}),(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(xn,{className:`w-4 h-4 text-accent-red shrink-0 mt-0.5`,"aria-hidden":`true`}),(0,I.jsx)(`p`,{className:`text-xs text-accent-red font-mono break-words`,children:d})]})]}),(s.totalTokens!=null||p!=null)&&(0,I.jsxs)(B,{tone:`static`,padding:`sm`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Token Reconciliation`}),(0,I.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Rollup`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums text-ink-base mt-0.5`,children:p==null?`—`:p.toLocaleString()})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Agent Sum`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums text-ink-base mt-0.5`,children:f.toLocaleString()})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Delta`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums mt-0.5 ${m===null?`text-ink-muted`:m===0?`text-accent-green`:`text-accent-amber`}`,children:m===null?`—`:m===0?`0`:`${m>0?`+`:``}${m.toLocaleString()}`})]})]}),s.totalUsd!=null&&(0,I.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border-subtle flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Total Cost`}),(0,I.jsx)(`span`,{className:`text-xs font-bold text-accent-amber tabular-nums`,children:fi(s.totalUsd)})]})]}),l!=null&&(0,I.jsxs)(B,{tone:`static`,padding:`sm`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Topology`}),(0,I.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Declared Phases`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums text-ink-base mt-0.5`,children:l.declaredPhases==null?`—`:l.declaredPhases})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Observed Phases`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums text-ink-base mt-0.5`,children:s.observedPhases==null?`—`:s.observedPhases})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Declared Agents`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums text-ink-base mt-0.5`,children:l.declaredAgents==null?`—`:l.declaredAgents})]})]}),l.declaredParallelWidths!=null&&l.declaredParallelWidths.length>0&&(0,I.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border-subtle flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Parallel Widths`}),l.declaredParallelWidths.map((e,t)=>(0,I.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] bg-surface-5 text-ink-subtle font-mono`,children:e},`${e}-${t}`))]})]}),h.length>0&&(0,I.jsxs)(`section`,{"aria-label":`Agent fan-out timeline`,children:[(0,I.jsx)(V,{className:`mb-3`,children:`Fan-out timeline`}),(0,I.jsx)(B,{tone:`static`,padding:`sm`,children:(0,I.jsx)(Pa,{agents:h,window:g})})]}),c.length>0?(0,I.jsxs)(`section`,{"aria-label":`Agent activity`,children:[(0,I.jsxs)(V,{className:`mb-3`,children:[`Agents (`,c.length,`)`]}),(0,I.jsx)(ja,{agents:c})]}):(0,I.jsx)(`div`,{className:`py-6 text-center text-xs text-ink-muted`,children:`No agent data recorded for this run.`})]})})]})]})}var za=`var(--color-chart-block)`,Ba=`var(--color-chart-block-peak)`,Va=10,Ha=13;function Ua({data:e,maxCount:t,ariaLabel:n}){let r=(0,F.useRef)(null),[i,a]=(0,F.useState)(null);if(e.length===0||e.every(e=>e.count===0))return null;let o=Math.max(t??0,...e.map(e=>e.count),1),s=o*12;return(0,I.jsxs)(`div`,{ref:r,className:`relative`,children:[(0,I.jsx)(`svg`,{width:`100%`,height:s,role:`img`,"aria-label":n,viewBox:`0 0 ${e.length*Ha} ${s}`,preserveAspectRatio:`xMidYMax meet`,onMouseLeave:()=>a(null),children:e.map((e,t)=>{let n=[];for(let r=0;r<e.count;r++){let i=e.count===o;n.push((0,I.jsx)(`rect`,{x:t*Ha,y:s-(r+1)*12,width:Va,height:Va,rx:1,fill:i?Ba:za,className:`heatmap-cell`,style:{animationDelay:`${t*20+r*10}ms`}},`${t}-${r}`))}return(0,I.jsxs)(`g`,{onMouseEnter:t=>{let n=r.current;if(!n)return;let i=n.getBoundingClientRect(),o=t.currentTarget,s=o.querySelectorAll(`rect.heatmap-cell`),c=(s[s.length-1]??o).getBoundingClientRect();a({x:c.left-i.left+c.width/2,y:c.top-i.top,text:e.tooltip})},children:[(0,I.jsx)(`rect`,{x:t*Ha,y:0,width:Ha,height:s,fill:`transparent`}),n]},t)})}),i&&(0,I.jsx)(`div`,{className:`absolute px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:i.x,top:i.y,transform:`translate(-50%, calc(-100% - 4px))`},children:i.text})]})}var Wa=`nr-observe-peak-concurrent`;function Ga({current:e,peak:t,allTimePeak:n,buckets:r}){let[i,a]=(0,F.useState)(!1),o=(0,F.useRef)(null),s=r.some(e=>e.count>0);(0,F.useEffect)(()=>{let e=n??t;if(e<=0)return;let r=parseInt(localStorage.getItem(Wa)??`0`,10);if(o.current===null&&(o.current=r),e>o.current){localStorage.setItem(Wa,String(e)),o.current=e,a(!0);let t=setTimeout(()=>a(!1),3e3);return()=>clearTimeout(t)}},[t,n]);let c=r.map(e=>{let t=new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`});return{count:e.count,tooltip:`${t} — ${e.count} concurrent`}});return(0,I.jsxs)(B,{padding:`sm`,className:`relative overflow-hidden${i?` new-peak-glow`:``}`,children:[i&&(0,I.jsx)(Ka,{}),(0,I.jsx)(V,{className:`mb-1.5`,children:`Concurrent Sessions`}),(0,I.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,I.jsx)(`span`,{className:`text-lg font-semibold text-accent-teal tabular-nums`,children:e}),(0,I.jsxs)(`span`,{className:`text-xs text-ink-muted tabular-nums`,children:[`today peak `,t,n&&n>t?` · all-time ${n}`:``]}),i&&(0,I.jsx)(`span`,{className:`text-[10px] text-accent-green font-semibold animate-bounce`,children:`NEW RECORD!`})]}),s&&(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Ua,{data:c,ariaLabel:`Concurrency over time, peak ${t}`})})]})}function Ka(){return(0,I.jsx)(I.Fragment,{children:Array.from({length:12},(e,t)=>{let n=t/12*360,r=40+Math.random()*30;return(0,I.jsx)(`span`,{className:`absolute w-1.5 h-1.5 rounded-full`,style:{left:`50%`,top:`50%`,backgroundColor:t%3==0?`#1CE783`:t%3==1?`#00D4AA`:`#9945FF`,animation:`particle-burst 1s ease-out forwards`,animationDelay:`${t*40}ms`,transform:`translate(-50%, -50%) rotate(${n}deg) translateY(-${r}px)`,opacity:0}},t)})})}var qa=5,Ja=[`var(--color-heatmap-0)`,`var(--color-heatmap-1)`,`var(--color-heatmap-2)`,`var(--color-heatmap-3)`,`var(--color-heatmap-4)`];function Ya(e,t){if(e===0)return Ja[0];let n=e/t;return Ja[Math.min(Math.ceil(n*(qa-1)),qa-1)]}function Xa(e,t,n){let r=e+n*t;return new Date(r).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}function Za({variant:e,buckets:t,maxCount:n,bucketSizeMs:r,startTimestamp:i,width:a,height:o,ariaLabel:s,days:c}){return e===`grid`&&c?(0,I.jsx)(eo,{days:c,maxCount:n,width:a,height:o,ariaLabel:s}):(0,I.jsx)(Qa,{buckets:t,maxCount:n,bucketSizeMs:r,startTimestamp:i,width:a,height:o,ariaLabel:s})}function Qa({buckets:e,maxCount:t,bucketSizeMs:n=9e5,startTimestamp:r=0,width:i,height:a=24,ariaLabel:o}){let[s,c]=(0,F.useState)(null),l=Math.max(4,Math.min(12,i?(i-e.length*1)/e.length:8)),u=i??e.length*(l+1);return(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`svg`,{width:u,height:a,role:`img`,"aria-label":o??`Activity heatmap: ${e.length} time buckets`,className:`w-full`,style:{maxWidth:u},viewBox:`0 0 ${u} ${a}`,preserveAspectRatio:`none`,onMouseLeave:()=>c(null),children:e.map((e,i)=>(0,I.jsx)(`rect`,{x:i*(l+1),y:0,width:l,height:a,rx:2,fill:Ya(e,t),className:`heatmap-cell`,style:{animationDelay:`${Math.min(i*8,400)}ms`},onMouseEnter:t=>{let a=Xa(r,n,i);c({x:t.currentTarget.x.baseVal.value,text:`${a}: ${e} calls`})}},i))}),s&&(0,I.jsx)(`div`,{className:`absolute -top-7 px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:s.x},children:s.text})]})}var $a=[`Mon`,``,`Wed`,``,`Fri`,``,`Sun`];function eo({days:e,maxCount:t,ariaLabel:n}){let[r,i]=(0,F.useState)(null),a=(0,F.useMemo)(()=>{if(e.length===0)return{weeks:0,cells:[]};let t=(new Date(e[0].date).getUTCDay()+6)%7,n=[];for(let r=0;r<e.length;r++){let i=r+t,a=i%7,o=Math.floor(i/7);n.push({...e[r],row:a,col:o})}return{weeks:n.length>0?n[n.length-1].col+1:0,cells:n}},[e]),o=28+a.weeks*12,s=(0,F.useMemo)(()=>{let e=[],t=``;for(let n of a.cells){if(n.row!==0)continue;let r=new Date(n.date).toLocaleString(void 0,{month:`short`,timeZone:`UTC`});r!==t&&(e.push({text:r,col:n.col}),t=r)}return e},[a.cells]);return(0,I.jsxs)(`div`,{className:`relative flex justify-center`,children:[(0,I.jsxs)(`svg`,{width:`100%`,height:98,role:`img`,"aria-label":n??`Activity grid: ${e.length} days`,viewBox:`0 0 ${o} 98`,preserveAspectRatio:`xMidYMid meet`,onMouseLeave:()=>i(null),children:[$a.map((e,t)=>e?(0,I.jsx)(`text`,{x:0,y:14+t*12+10-2,className:`fill-ink-muted`,fontSize:10,children:e},t):null),s.map(({text:e,col:t})=>(0,I.jsx)(`text`,{x:28+t*12,y:10,className:`fill-ink-muted`,fontSize:10,children:e},`${e}-${t}`)),a.cells.map((e,n)=>(0,I.jsx)(`rect`,{x:28+e.col*12,y:14+e.row*12,width:10,height:10,rx:2,fill:Ya(e.count,t),className:`heatmap-cell`,style:{animationDelay:`${Math.min(n*3,300)}ms`},onMouseEnter:t=>{let n=t.currentTarget;i({x:n.x.baseVal.value,y:n.y.baseVal.value-16,text:`${e.date}: ${e.count} calls`})}},n))]}),r&&(0,I.jsx)(`div`,{className:`absolute px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:r.x,top:r.y},children:r.text}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1 mt-1.5 text-[10px] text-ink-muted`,children:[(0,I.jsx)(`span`,{children:`Less`}),Ja.map((e,t)=>(0,I.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm`,style:{backgroundColor:e}},t)),(0,I.jsx)(`span`,{children:`More`})]})]})}function to({theme:e=`observatory`}){return(0,I.jsxs)(`div`,{className:`geo-banner`,"aria-hidden":`true`,children:[e===`observatory`&&(0,I.jsx)(no,{}),e===`sessions`&&(0,I.jsx)(ro,{}),e===`history`&&(0,I.jsx)(io,{}),e===`audit`&&(0,I.jsx)(ao,{}),e===`git`&&(0,I.jsx)(oo,{})]})}function no(){return(0,I.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`obsSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,I.jsx)(`stop`,{offset:`0%`,stopColor:`#1a3a5c`}),(0,I.jsx)(`stop`,{offset:`40%`,stopColor:`#2d5a7b`}),(0,I.jsx)(`stop`,{offset:`70%`,stopColor:`#e8834a`}),(0,I.jsx)(`stop`,{offset:`100%`,stopColor:`#f4a261`})]})}),(0,I.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#obsSky)`}),(0,I.jsx)(`polygon`,{points:`0,80 0,45 80,38 160,48 240,30 340,42 420,25 500,38 580,32 660,40 740,28 800,35 800,80`,fill:`#1a3a5c`,opacity:`0.7`}),(0,I.jsx)(`polygon`,{points:`0,80 0,55 60,48 140,58 220,42 300,52 380,40 460,50 520,38 600,48 680,42 760,52 800,48 800,80`,fill:`#234e6f`}),(0,I.jsx)(`polygon`,{points:`0,80 0,62 100,58 200,65 300,55 400,60 500,54 600,62 700,56 800,60 800,80`,fill:`#2a6b4a`,opacity:`0.8`}),(0,I.jsx)(`circle`,{cx:`680`,cy:`28`,r:`14`,fill:`#f4a261`,opacity:`0.6`}),(0,I.jsx)(`circle`,{cx:`680`,cy:`28`,r:`8`,fill:`#ffd166`,opacity:`0.5`}),(0,I.jsx)(`ellipse`,{cx:`150`,cy:`56`,rx:`18`,ry:`10`,fill:`#1a3a5c`}),(0,I.jsx)(`line`,{x1:`150`,y1:`46`,x2:`172`,y2:`34`,stroke:`#5ce0d8`,strokeWidth:`1.5`,opacity:`0.8`})]})}function ro(){return(0,I.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`seaSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,I.jsx)(`stop`,{offset:`0%`,stopColor:`#4aa8c7`}),(0,I.jsx)(`stop`,{offset:`60%`,stopColor:`#3a8fb7`}),(0,I.jsx)(`stop`,{offset:`100%`,stopColor:`#2d7a9e`})]})}),(0,I.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#seaSky)`}),(0,I.jsx)(`polygon`,{points:`600,48 640,35 680,48`,fill:`#2d7a4a`,opacity:`0.4`}),(0,I.jsx)(`polygon`,{points:`700,50 730,40 760,50`,fill:`#3d9b5b`,opacity:`0.3`}),(0,I.jsx)(`polygon`,{points:`0,80 0,15 40,12 80,20 120,18 160,25 180,30 180,80`,fill:`#c05a3c`}),(0,I.jsx)(`polygon`,{points:`0,80 0,25 30,22 60,28 100,25 140,30 160,35 160,80`,fill:`#e8834a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`20,20 35,8 50,20`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`60,22 72,12 84,24`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`100,20 115,10 130,22`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`140,28 150,18 160,28`,fill:`#4aad6b`,opacity:`0.8`}),(0,I.jsx)(`rect`,{x:`120`,y:`30`,width:`8`,height:`50`,fill:`#87ceeb`,opacity:`0.5`}),(0,I.jsx)(`rect`,{x:`122`,y:`30`,width:`4`,height:`50`,fill:`#fff`,opacity:`0.3`}),(0,I.jsx)(`polygon`,{points:`620,80 620,30 660,25 700,32 740,28 780,35 800,30 800,80`,fill:`#c05a3c`,opacity:`0.8`}),(0,I.jsx)(`polygon`,{points:`650,30 665,18 680,30`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`720,32 732,22 744,32`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`180,80 180,55 250,52 350,56 450,52 550,55 620,52 620,80`,fill:`#2d7a9e`,opacity:`0.6`}),(0,I.jsx)(`line`,{x1:`200`,y1:`60`,x2:`280`,y2:`58`,stroke:`#5ce0d8`,strokeWidth:`0.8`,opacity:`0.3`}),(0,I.jsx)(`line`,{x1:`350`,y1:`56`,x2:`450`,y2:`55`,stroke:`#5ce0d8`,strokeWidth:`0.8`,opacity:`0.25`}),(0,I.jsx)(`line`,{x1:`480`,y1:`58`,x2:`580`,y2:`56`,stroke:`#87ceeb`,strokeWidth:`0.8`,opacity:`0.3`})]})}function io(){return(0,I.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`histSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,I.jsx)(`stop`,{offset:`0%`,stopColor:`#3a7ca5`}),(0,I.jsx)(`stop`,{offset:`60%`,stopColor:`#5bb8d4`}),(0,I.jsx)(`stop`,{offset:`100%`,stopColor:`#8ed4c0`})]})}),(0,I.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#histSky)`}),(0,I.jsx)(`polygon`,{points:`100,50 140,20 180,50`,fill:`#e8834a`,opacity:`0.7`}),(0,I.jsx)(`polygon`,{points:`160,50 210,15 260,50`,fill:`#d4694a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`550,50 600,18 650,50`,fill:`#e8834a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`620,50 660,22 700,50`,fill:`#c05a3c`,opacity:`0.5`}),(0,I.jsx)(`polygon`,{points:`350,50 370,12 390,50`,fill:`#5ce0d8`,opacity:`0.4`}),(0,I.jsx)(`polygon`,{points:`380,50 395,20 410,50`,fill:`#87ceeb`,opacity:`0.3`}),(0,I.jsx)(`polygon`,{points:`700,50 715,25 730,50`,fill:`#5ce0d8`,opacity:`0.35`}),(0,I.jsx)(`polygon`,{points:`300,80 380,50 420,50 500,80`,fill:`#2a5a6b`,opacity:`0.6`}),(0,I.jsx)(`line`,{x1:`390`,y1:`52`,x2:`350`,y2:`78`,stroke:`#f4a261`,strokeWidth:`1`,opacity:`0.4`}),(0,I.jsx)(`line`,{x1:`410`,y1:`52`,x2:`450`,y2:`78`,stroke:`#f4a261`,strokeWidth:`1`,opacity:`0.4`}),(0,I.jsx)(`polygon`,{points:`0,80 0,55 80,52 160,58 240,50 320,55 500,52 580,56 660,50 740,55 800,52 800,80`,fill:`#2d8a4a`,opacity:`0.5`}),(0,I.jsx)(`polygon`,{points:`0,80 0,65 60,62 140,68 220,60 400,65 500,62 600,66 700,60 800,65 800,80`,fill:`#1e6b3a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`30,65 42,42 54,65`,fill:`#3d9b5b`,opacity:`0.8`}),(0,I.jsx)(`polygon`,{points:`50,65 60,48 70,65`,fill:`#2d8a4a`,opacity:`0.7`}),(0,I.jsx)(`polygon`,{points:`720,65 732,45 744,65`,fill:`#3d9b5b`,opacity:`0.7`}),(0,I.jsx)(`polygon`,{points:`760,65 770,50 780,65`,fill:`#2d8a4a`,opacity:`0.8`})]})}function ao(){return(0,I.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`auditSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,I.jsx)(`stop`,{offset:`0%`,stopColor:`#1a5c3a`}),(0,I.jsx)(`stop`,{offset:`50%`,stopColor:`#2d7a4a`}),(0,I.jsx)(`stop`,{offset:`100%`,stopColor:`#3d9b5b`})]})}),(0,I.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#auditSky)`}),(0,I.jsx)(`polygon`,{points:`200,0 210,80 220,0`,fill:`#ffd166`,opacity:`0.08`}),(0,I.jsx)(`polygon`,{points:`500,0 510,80 520,0`,fill:`#ffd166`,opacity:`0.06`}),(0,I.jsx)(`polygon`,{points:`650,0 660,80 670,0`,fill:`#fff`,opacity:`0.05`}),(0,I.jsx)(`rect`,{x:`80`,y:`20`,width:`6`,height:`60`,fill:`#1a4a2e`}),(0,I.jsx)(`rect`,{x:`180`,y:`10`,width:`7`,height:`70`,fill:`#1a4a2e`}),(0,I.jsx)(`rect`,{x:`320`,y:`15`,width:`6`,height:`65`,fill:`#1a4a2e`}),(0,I.jsx)(`rect`,{x:`500`,y:`8`,width:`7`,height:`72`,fill:`#1a4a2e`}),(0,I.jsx)(`rect`,{x:`620`,y:`18`,width:`6`,height:`62`,fill:`#1a4a2e`}),(0,I.jsx)(`rect`,{x:`740`,y:`12`,width:`7`,height:`68`,fill:`#1a4a2e`}),(0,I.jsx)(`polygon`,{points:`55,25 83,5 111,25`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`60,35 83,15 106,35`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`155,15 183,0 211,18`,fill:`#5bc47a`}),(0,I.jsx)(`polygon`,{points:`160,28 183,8 206,28`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`295,20 323,2 351,22`,fill:`#5bc47a`}),(0,I.jsx)(`polygon`,{points:`300,32 323,12 346,32`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`475,12 503,0 531,15`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`480,25 503,5 526,25`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`595,22 623,5 651,22`,fill:`#5bc47a`}),(0,I.jsx)(`polygon`,{points:`600,34 623,14 646,34`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`715,16 743,0 771,18`,fill:`#5bc47a`}),(0,I.jsx)(`polygon`,{points:`720,30 743,10 766,30`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`0,80 0,68 100,65 200,70 300,64 400,68 500,63 600,67 700,64 800,68 800,80`,fill:`#1e6b3a`}),(0,I.jsx)(`polygon`,{points:`250,80 258,65 266,80`,fill:`#e8834a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`450,80 456,68 462,80`,fill:`#f4a261`,opacity:`0.5`}),(0,I.jsx)(`polygon`,{points:`650,80 656,66 662,80`,fill:`#e8834a`,opacity:`0.55`})]})}function oo(){return(0,I.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`gitSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,I.jsx)(`stop`,{offset:`0%`,stopColor:`#2d5a7b`}),(0,I.jsx)(`stop`,{offset:`60%`,stopColor:`#3a8fb7`}),(0,I.jsx)(`stop`,{offset:`100%`,stopColor:`#5bb8d4`})]})}),(0,I.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#gitSky)`}),(0,I.jsx)(`polygon`,{points:`0,80 0,20 60,25 120,18 180,28 220,22 260,30 260,80`,fill:`#2d7a4a`,opacity:`0.7`}),(0,I.jsx)(`polygon`,{points:`540,80 540,22 600,28 660,20 720,25 780,18 800,22 800,80`,fill:`#2d7a4a`,opacity:`0.7`}),(0,I.jsx)(`path`,{d:`M 260,50 Q 320,48 400,45 Q 480,42 540,50`,fill:`none`,stroke:`#5ce0d8`,strokeWidth:`4`,opacity:`0.5`}),(0,I.jsx)(`path`,{d:`M 350,45 Q 370,35 400,28`,fill:`none`,stroke:`#87ceeb`,strokeWidth:`2`,opacity:`0.4`}),(0,I.jsx)(`path`,{d:`M 420,44 Q 440,52 470,60`,fill:`none`,stroke:`#87ceeb`,strokeWidth:`2`,opacity:`0.4`}),(0,I.jsx)(`path`,{d:`M 400,28 Q 430,25 460,30`,fill:`none`,stroke:`#5ce0d8`,strokeWidth:`1.5`,opacity:`0.35`}),(0,I.jsx)(`circle`,{cx:`400`,cy:`45`,r:`3`,fill:`#5ce0d8`,opacity:`0.6`}),(0,I.jsx)(`circle`,{cx:`350`,cy:`45`,r:`2`,fill:`#1ce783`,opacity:`0.5`}),(0,I.jsx)(`circle`,{cx:`460`,cy:`44`,r:`2`,fill:`#1ce783`,opacity:`0.5`}),(0,I.jsx)(`polygon`,{points:`300,65 310,55 320,65`,fill:`#3a6b4a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`480,62 492,52 504,62`,fill:`#3a6b4a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`240,35 250,18 260,35`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`540,35 550,20 560,35`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`270,50 278,38 286,50`,fill:`#3d9b5b`,opacity:`0.8`}),(0,I.jsx)(`polygon`,{points:`520,48 528,36 536,48`,fill:`#3d9b5b`,opacity:`0.8`})]})}var so=[`system`,`tools`,`user`,`assistant`],co={system:`bg-accent-indigo`,tools:`bg-accent-amber`,user:`bg-accent-blue`,assistant:`bg-accent-green`},W={system:`shadow-[0_0_8px_rgba(99,102,241,0.4)]`,tools:`shadow-[0_0_8px_rgba(255,178,36,0.4)]`,user:`shadow-[0_0_8px_rgba(0,149,255,0.4)]`,assistant:`shadow-[0_0_8px_rgba(28,231,131,0.4)]`},lo={system:`bg-accent-indigo`,tools:`bg-accent-amber`,user:`bg-accent-blue`,assistant:`bg-accent-green`},uo={system:`System`,tools:`Tools`,user:`User`,assistant:`Assistant`};function fo(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function po(e,t=``){return{sessionId:t,turnNumber:e.turnCount,totalTokens:e.growth.currentTokens,fillPercent:e.fillPercent,contextWindow:e.contextWindow,breakdown:e.currentBreakdown,growth:{startTokens:e.growth.startTokens,currentTokens:e.growth.currentTokens,delta:e.growth.deltaTokens},topTools:e.toolContributions.map(e=>({tool:e.tool,estimatedTokens:e.estimatedTokens}))}}function mo({data:e,sessionId:t}){let n=Jn(e=>e.contextBySession),r=t?n.get(t)??null:null,[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)(!1),c=(0,F.useRef)(0),l=(0,F.useRef)(0),{data:u}=L({queryKey:t?[`context`,t]:z.context,queryFn:()=>Er(t??void 0),refetchInterval:1e4,enabled:!e}),d=e??u,f=t??``,p=e?po(e,f):r??(d?po(d,f):null),m=p?.growth.currentTokens??0,h=Math.min(p?.fillPercent??0,100),g=l.current>0&&h>c.current;if((0,F.useEffect)(()=>{if(l.current>0&&m<l.current*.7){s(!0);let e=setTimeout(()=>s(!1),1e3);return l.current=m,c.current=h,()=>clearTimeout(e)}l.current=m,c.current=h},[h,m]),!p||p.totalTokens===0)return null;let{breakdown:_,growth:v,fillPercent:y,totalTokens:b}=p,x=y>=100,S=p.contextWindow;return(0,I.jsxs)(`div`,{className:`group`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(V,{children:`Context`}),x&&(0,I.jsx)(qr,{tone:`danger`,size:`sm`,uppercase:!0,className:`animate-pulse motion-reduce:animate-none`,children:`at capacity`})]}),(0,I.jsxs)(`div`,{className:`text-[11px] text-ink-subtle tabular-nums`,children:[fo(v.currentTokens),S&&S>0&&(0,I.jsx)(`span`,{className:`text-ink-muted`,children:` / ${fo(S)}`}),v.delta>0&&(0,I.jsxs)(`span`,{className:`text-accent-amber ml-1`,children:[`+`,fo(v.delta)]}),v.delta<0&&(0,I.jsx)(`span`,{className:`text-accent-cyan ml-1`,children:`compacted`})]})]}),(0,I.jsxs)(`div`,{className:`relative`,children:[o&&(0,I.jsx)(`div`,{className:`absolute inset-0 rounded-full bg-accent-cyan/20 animate-compact-flash pointer-events-none`}),(0,I.jsx)(`div`,{className:`w-full h-3 bg-surface-3 rounded-full overflow-hidden flex transition-colors duration-150 ${g?`shadow-[0_0_12px_rgba(255,178,36,0.3)]`:``} ${o?`animate-compact`:``}`,children:so.map(e=>{let t=_[e];if(t<=0)return null;let n=Math.round(t/b*100),r=i===e;return(0,I.jsx)(`div`,{className:`${co[e]} transition-all duration-500 ease-out cursor-default relative ${r?`brightness-125 ${W[e]}`:``}`,style:{width:`${t/b*h}%`},title:`${uo[e]}: ${fo(t)} (${n}%)`,onMouseEnter:()=>a(e),onMouseLeave:()=>a(null)},e)})})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 mt-1.5 text-[10px] text-ink-muted`,children:[so.map(e=>{let t=_[e],n=i===e;return(0,I.jsxs)(`span`,{className:`flex items-center gap-1 transition-colors duration-200 cursor-default ${n?`text-ink-base`:``}`,onMouseEnter:()=>a(e),onMouseLeave:()=>a(null),children:[(0,I.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full ${lo[e]} ${n?`scale-150`:``} transition-transform duration-200`}),uo[e],n&&t>0&&(0,I.jsx)(`span`,{className:`text-ink-subtle ml-0.5`,children:fo(t)})]},e)}),(0,I.jsxs)(`span`,{className:`ml-auto tabular-nums ${x?`text-accent-red`:h>=75?`text-accent-amber`:``}`,children:[h.toFixed(0),`%`]})]})]})}function ho(e){let t=e==null?new Date:new Date(e);return t.setHours(0,0,0,0),t.getTime()}function go(e,t){let n=new Date(e),r=t==null?new Date:new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}var _o={weekday:`short`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`},vo=3e4,yo={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},bo=1e4;function xo(){let e=Jn(e=>e.cost),t=Jn(e=>e.antiPatterns),n=Qn(),r=$n(),{data:i}=L({queryKey:[`observability-health`],queryFn:Nr,refetchInterval:3e4}),{data:a,isPending:o}=L({queryKey:z.cost,queryFn:cr}),{data:s,isPending:c}=L({queryKey:z.sessionsTodayAggregate,queryFn:ar,refetchInterval:1e4}),{data:l,isPending:u}=L({queryKey:z.sessionsList(200),queryFn:()=>ir(200),refetchInterval:1e4}),{data:d,isPending:f}=L({queryKey:z.antiPatterns,queryFn:lr}),{data:p,isPending:m}=L({queryKey:z.concurrency,queryFn:Cr,refetchInterval:1e4}),{data:h,isPending:g}=L({queryKey:z.activityHeatmap(`today`),queryFn:()=>Tr(`today`),refetchInterval:3e4}),{data:_,isPending:v}=L({queryKey:z.sessionsLive,queryFn:or,refetchInterval:1e4}),y=(0,F.useMemo)(()=>Fo(l??[]),[l]),b=(0,F.useMemo)(()=>Io(l??[]),[l]),x=(0,F.useMemo)(()=>Lo(l??[]),[l]),S=(0,F.useMemo)(()=>Ro(l??[]),[l]),C=(0,F.useMemo)(()=>(l??[]).flatMap(e=>e.antiPatterns??[]),[l]),w=Math.max(s?.toolCallCount??0,b),T=(o||u||c)&&!e&&y===0&&s===void 0,E=Math.max(e?.todayTotalUsd??0,s?.totalCostUsd??0,y),D=Math.max(d?.length??0,t.length),O=Math.max(s?.antiPatternCount??0,x+D),k=Math.max(s?.subagentUsd??0,n.usd),A=Math.max(s?.subagentTurnCount??0,n.turns),j=s!==void 0||n.turns>0,[ee,M]=(0,F.useState)(()=>new Date().toLocaleString(void 0,_o));(0,F.useEffect)(()=>{let e=setInterval(()=>M(new Date().toLocaleString(void 0,_o)),6e4);return()=>clearInterval(e)},[]);let te=s?.avgEfficiencyScore??null,ne=te!==null&&Number.isFinite(te)?`${Math.round(te*100)}%`:`—`,N=te===null?`needs more data`:Math.round(te*100)>=80?`strong session`:Math.round(te*100)>=50?`mixed signals`:`needs attention`;return(0,I.jsxs)(`section`,{children:[(0,I.jsx)(to,{}),(0,I.jsxs)(`header`,{className:`flex items-baseline justify-between mb-4`,children:[(0,I.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Today`}),(0,I.jsx)(`span`,{className:`text-xs text-ink-muted`,children:ee})]}),!T&&!c&&!u&&!f&&!m&&!g&&!v&&w===0&&E===0&&O===0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(zi,{index:0,className:`glass-card p-8 mb-4`,children:(0,I.jsx)(ea,{icon:`code`,title:`No activity yet today`,subtitle:`Metrics will appear here once you start a coding session with Claude.`})}),(0,I.jsx)(zi,{index:1,children:(0,I.jsx)(jo,{})})]}):(0,I.jsxs)(I.Fragment,{children:[(r?.watcherDisabledByLock===!0||i?.watcherDisabledByLock===!0)&&(0,I.jsx)(`div`,{className:`rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-amber-300 mb-4`,children:`Subagent watcher is disabled (lock conflict). Subagent costs may be undercounted. Check Settings → Observability health.`}),i?.watcherActive===!1&&n.turns===0&&i?.watcherDisabledReason!==`mode_mismatch`&&(0,I.jsxs)(`div`,{className:`rounded-lg border border-border-subtle bg-surface-5 px-4 py-3 text-sm text-ink-muted mb-4`,children:[`Subagent cost tracking is disabled (`,(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:`NR_AI_ENABLE_SUBAGENT_WATCHER=0`}),`), so spend shown here excludes subagents. Unset that variable (it is on by default) and restart to see full spend.`]}),i?.watcherActive===!1&&n.turns===0&&i?.watcherDisabledReason===`mode_mismatch`&&(0,I.jsxs)(`div`,{className:`rounded-lg border border-border-subtle bg-surface-5 px-4 py-3 text-sm text-ink-muted mb-4`,children:[`This dashboard process isn’t running its own subagent watcher — expected for a background `,(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:`--local`}),` dashboard (the watcher only auto-starts in `,(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:`--stdio`}),` mode). Spend shown here still includes subagent activity from other sessions, read from their persisted totals. To track subagents live from this process too, set`,` `,(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:`NR_AI_WATCHER_MODE=local`}),` and restart.`]}),(0,I.jsx)(zi,{index:0,className:`mb-4`,children:(0,I.jsx)(B,{padding:`lg`,tone:`elevated`,glow:`green`,children:(0,I.jsxs)(`div`,{className:`grid grid-cols-5 gap-4`,children:[(0,I.jsx)(U,{label:`efficiency`,hero:!0,value:ne,sub:N,...te===null?{}:{animate:!0,numericValue:Math.round(te*100),suffix:`%`}}),(0,I.jsx)(U,{label:`spend today`,tone:`good`,value:T?`…`:fi(E),...T?{}:{animate:!0,numericValue:E,format:fi}}),(0,I.jsx)(U,{label:`subagent spend`,value:j?fi(k):`—`,sub:`${A} turns`,...j?{animate:!0,numericValue:k,format:fi}:{}}),(0,I.jsx)(U,{label:`tool calls`,value:String(w),animate:!0,numericValue:w}),(0,I.jsx)(U,{label:`flags`,tone:O>0?`warn`:`neutral`,value:String(O),animate:!0,numericValue:O})]})})}),(0,I.jsxs)(zi,{index:1,className:`grid grid-cols-2 gap-3 mb-3`,children:[(0,I.jsx)(zo,{todayTotal:E,forecastEod:T?null:e?.forecastEodUsd??(a?.forecast?.forecastEndOfDayUsd==null?null:E+a.forecast.forecastEndOfDayUsd-(a.sessionTodayUsd??0)),hourlySpend:S,subagentUsd:k}),p&&p.buckets&&(0,I.jsx)(Ga,{current:p.current,peak:p.peak,allTimePeak:p.allTimePeak,bucketSizeMs:p.bucketSizeMs,startTimestamp:p.startTimestamp,buckets:p.buckets})]}),O>0&&(t.length>0||d&&d.length>0||C.length>0)&&(0,I.jsx)(zi,{index:2,className:`mb-3`,children:(0,I.jsx)(B,{padding:`sm`,tone:`warning`,className:`text-xs`,children:t.length>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(qr,{tone:`warning`,size:`sm`,className:`mr-2`,children:t[0].type}),(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`— `}),(0,I.jsxs)(`span`,{children:[t[0].count,`× on `]}),(0,I.jsx)(`code`,{className:`bg-surface-5 px-1 rounded`,children:t[0].target}),t[0].sessionId&&(0,I.jsxs)(qr,{tone:`neutral`,size:`sm`,className:`ml-2`,children:[`Session: `,Ao(t[0].sessionId,_??[])]})]}):d&&d.length>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(qr,{tone:`warning`,size:`sm`,className:`mr-2`,children:d[0].type}),(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`— `}),(0,I.jsxs)(`span`,{children:[d[0].count??d[0].iterations??d[0].readCount??d[0].repeatCount??d[0].editCount??d[0].agentCount??`?`,`× on`,` `]}),(0,I.jsx)(`code`,{className:`bg-surface-5 px-1 rounded`,children:d[0].file??d[0].command??`unknown`})]}):C.length>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(qr,{tone:`warning`,size:`sm`,className:`mr-2`,children:C[0].type}),(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`— `}),(0,I.jsxs)(`span`,{children:[C[0].count??C[0].iterations??C[0].readCount??C[0].repeatCount??C[0].editCount??C[0].agentCount??`?`,`× on`,` `]}),(0,I.jsx)(`code`,{className:`bg-surface-5 px-1 rounded`,children:C[0].file??C[0].command??`unknown`})]}):null})}),(0,I.jsxs)(zi,{index:3,className:`grid grid-cols-3 gap-3 mb-3`,children:[(0,I.jsx)(So,{}),(0,I.jsx)(Co,{}),(0,I.jsx)(wo,{aggregate:s}),(0,I.jsx)(To,{}),(0,I.jsx)(Do,{aggregate:s})]}),(0,I.jsx)(zi,{index:4,children:(0,I.jsx)(ko,{sessions:l??[],liveSessions:_??[]})}),h&&h.buckets?.length>0&&(0,I.jsx)(zi,{index:5,className:`mb-3`,children:(0,I.jsxs)(B,{padding:`sm`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Activity Today`}),(0,I.jsx)(Za,{variant:`strip`,buckets:h.buckets,maxCount:h.maxCount,bucketSizeMs:h.bucketSizeMs,startTimestamp:h.startTimestamp,ariaLabel:`Today's activity density in 15-minute blocks`})]})}),(0,I.jsx)(zi,{index:6,children:(0,I.jsx)(jo,{})})]})]})}function So(){let{data:e}=L({queryKey:z.qualityProxy,queryFn:yr,refetchInterval:bo});return(0,I.jsxs)(B,{padding:`sm`,className:`h-full`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Quality`}),!e||e.totalSignals===0?(0,I.jsx)(ea,{icon:`checkmark`,title:`Waiting for edits and test runs`,subtitle:`Quality metrics appear after editing files and running tests.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Diff Apply `}),(0,I.jsx)(`span`,{className:ai(e.diffApplyRate),children:e.diffApplyRate===null?`—`:`${(e.diffApplyRate*100).toFixed(0)}%`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Test Pass `}),(0,I.jsx)(`span`,{className:ai(e.testPassRate),children:e.testPassRate===null?`—`:`${(e.testPassRate*100).toFixed(0)}%`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Backtracks `}),(0,I.jsx)(`span`,{className:e.backtrackCount>0?`text-accent-amber`:``,children:e.backtrackCount})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Self-corrections `}),(0,I.jsx)(`span`,{className:`text-ink-subtle`,children:e.selfCorrectionCount})]})]}),e.degradationDetected&&(0,I.jsx)(`div`,{className:`text-accent-amber text-xs mt-2`,children:`⚠ Quality degrading`})]})]})}function Co(){let{data:e}=L({queryKey:z.toolSelectionScore,queryFn:br,refetchInterval:bo});return(0,I.jsxs)(B,{padding:`sm`,className:`h-full`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Tool Selection`}),!e||Array.isArray(e)||e.totalCalls===0?(0,I.jsx)(ea,{icon:`radar`,title:`Waiting for tool calls`,subtitle:`Start a Claude Code session to begin scoring. Resets when the process restarts.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,I.jsx)(`span`,{className:`text-2xl font-semibold tabular-nums ${oi(e.score)}`,children:e.score.toFixed(2)}),(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted`,children:`/ 1.0`})]}),(0,I.jsxs)(`div`,{className:`text-[10px] text-ink-muted mt-1`,children:[e.penalizedCalls,` of `,e.totalCalls,` calls penalized`]}),(e.redundantReadCount>0||e.repeatedFailureCount>0||e.unusedOutputCount>0)&&(0,I.jsxs)(`div`,{className:`text-[10px] text-ink-subtle mt-1 space-x-2`,children:[e.redundantReadCount>0&&(0,I.jsxs)(`span`,{children:[`re-reads: `,e.redundantReadCount]}),e.repeatedFailureCount>0&&(0,I.jsxs)(`span`,{children:[`repeat fails: `,e.repeatedFailureCount]}),e.unusedOutputCount>0&&(0,I.jsxs)(`span`,{children:[`unused output: `,e.unusedOutputCount]})]}),(0,I.jsx)(`div`,{className:`text-[10px] text-ink-subtle/60 mt-2`,children:`Penalizes: reading the same file 3+ times without editing, repeated tool failures, fetching large outputs never referenced.`})]})]})}function wo({aggregate:e}){let t=e?.latency,n=t?.byTool?Object.entries(t.byTool).filter(e=>e[1]!==null&&e[1].count>0).sort((e,t)=>t[1].p95-e[1].p95).slice(0,4):[];return(0,I.jsxs)(B,{padding:`sm`,className:`h-full`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Latency (ms)`}),!t||!t.overall?(0,I.jsx)(ea,{icon:`clock`,title:`Waiting for tool calls`,subtitle:`Latency percentiles appear after tool calls complete.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex gap-4 text-xs mb-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`p50 `}),(0,I.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:t.overall.p50})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`p95 `}),(0,I.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:t.overall.p95})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`p99 `}),(0,I.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:t.overall.p99})]})]}),n.length>0&&(0,I.jsx)(`div`,{className:`space-y-1`,children:n.map(([e,t])=>(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,I.jsx)(`span`,{className:`text-ink-muted truncate w-28 shrink-0`,children:hi(e)}),(0,I.jsxs)(`span`,{className:`tabular-nums text-ink-subtle`,children:[t.p95,`ms p95`]})]},e))})]})]})}function To(){let{data:e}=L({queryKey:z.modelUsage,queryFn:Dr,refetchInterval:bo}),t=e?.byModel?Object.entries(e.byModel).filter(([,e])=>e.requestCount>0).sort((e,t)=>t[1].totalCostUsd-e[1].totalCostUsd).slice(0,4):[];return(0,I.jsxs)(B,{padding:`sm`,className:`h-full`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Model Usage`}),!e||t.length===0?(0,I.jsx)(ea,{icon:`radar`,title:`No model data yet`,subtitle:`Start a Claude Code session to see model cost breakdown. Resets when the process restarts.`}):(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[t.map(([e,t])=>(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs gap-2`,children:[(0,I.jsx)(`span`,{className:`text-ink-muted truncate`,children:e}),(0,I.jsxs)(`div`,{className:`flex gap-3 shrink-0 tabular-nums`,children:[(0,I.jsxs)(`span`,{className:`text-ink-subtle`,children:[t.requestCount,`req`]}),(0,I.jsxs)(`span`,{className:`text-ink-subtle`,children:[pi(t.costPerMillionTokens),`/1M tok`]}),(0,I.jsx)(`span`,{className:`text-ink-base`,children:fi(t.totalCostUsd)})]})]},e)),e?.mostEfficientModel&&(0,I.jsxs)(`div`,{className:`text-[10px] text-accent-green mt-1`,children:[`Most efficient: `,e.mostEfficientModel]})]})]})}function Eo(e,t){let n=t===null?null:`${t}%`;return e===`excellent`?n?`Cache hit rate is ${n}. Cache is well-structured.`:`Cache is well-structured. No changes needed.`:e===`can_improve`?n?`Cache hit rate is ${n}. Placing stable content before variable content in prompts could improve this.`:`Place stable content before variable content in prompts to improve.`:n?`Cache hit rate is ${n}. Restructuring your system prompt so stable context appears at the top could bring this above 60%.`:`Restructure your system prompt so stable context appears at the top.`}function Do({aggregate:e}){let{data:t}=L({queryKey:z.cacheHealth,queryFn:Or,refetchInterval:bo}),n=e?.cacheHealth,r=!n||n.status===`no_cache_activity`||n.cacheHitRatePct==null;return(0,I.jsxs)(B,{padding:`sm`,className:`h-full`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Cache Health`}),r?(0,I.jsx)(ea,{icon:`radar`,title:`No cache data yet`,subtitle:`Appears once token usage with cache reads is reported.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-baseline gap-2 mb-1`,children:[(0,I.jsxs)(`span`,{className:`text-2xl font-semibold tabular-nums ${n.status===`excellent`?`text-accent-green`:n.status===`needs_attention`?`text-accent-amber`:`text-ink-base`}`,children:[n.cacheHitRatePct,`%`]}),(0,I.jsx)(qr,{tone:n.status===`needs_attention`?`warning`:`neutral`,size:`sm`,children:n.status===`excellent`?`excellent`:n.status.replace(`_`,` `)})]}),n.totalSavingsUsd>0&&(0,I.jsxs)(`div`,{className:`text-xs text-accent-green mb-1`,children:[`$`,n.totalSavingsUsd.toFixed(4),` saved`]}),t?.week_over_week_delta_pts!=null&&t.week_over_week_delta_pts!==0&&(0,I.jsxs)(`div`,{className:`text-[10px] font-medium mb-1 ${t.week_over_week_delta_pts>0?`text-accent-green`:`text-accent-amber`}`,children:[t.week_over_week_delta_pts>0?`↑`:`↓`,Math.abs(t.week_over_week_delta_pts),`pts vs last week`]}),(0,I.jsx)(`div`,{className:`text-[10px] text-ink-subtle/70 leading-snug`,children:Eo(n.status,n.cacheHitRatePct)})]})]})}var Oo=3e3;function ko({sessions:e,liveSessions:t}){let[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(null),[,o]=qt(),s=Jn(e=>e.setActiveSession),{data:c}=L({queryKey:z.sessionCurrent,queryFn:rr}),l=(0,F.useMemo)(()=>{let e=new Set;for(let n of t)e.add(n.sessionId);if(e.size===0)if(c?.liveSessions?.length)for(let t of c.liveSessions)e.add(t);else c?.sessionId&&e.add(c.sessionId);return e},[t,c]),u=(t.length>0?t[0].sessionId:null)??(l.size>0?[...l][0]:null),d=n??u,f=d!==null&&l.has(d),p=n!==null&&!l.has(n);(0,F.useEffect)(()=>{s(d)},[d,s]);let{data:m}=L({queryKey:d?z.sessionReplay(d):[`replay`,`none`],queryFn:()=>gr(d),enabled:d!==null,retry:!1,refetchInterval:f?Oo:!1}),{data:h}=L({queryKey:d?z.sessionSubagents(d):[`subagents`,`none`],queryFn:()=>_r(d),enabled:d!==null,retry:!1,refetchInterval:f?Oo:!1}),{data:g}=L({queryKey:z.workflows,queryFn:Pr,refetchInterval:f?1e4:!1}),_=(0,F.useRef)(null);(0,F.useEffect)(()=>{f&&_.current&&(_.current.scrollTop=_.current.scrollHeight)},[m?.timeline.length,f]);let v=(0,F.useMemo)(()=>{let n=Date.now()-360*60*1e3,r=new Map;for(let e of t)r.set(e.sessionId,e);let i=new Map;for(let t of e){if(!t.sessionId)continue;let e=t.startTime!=null&&No(t.startTime),a=r.has(t.sessionId),o=t.startTime!=null&&t.durationMs!=null?t.startTime+t.durationMs:null,s=o!=null&&o>=n&&No(o);(e||a||s)&&i.set(t.sessionId,t)}for(let e of t)e.sessionId&&(i.has(e.sessionId)||i.set(e.sessionId,{sessionId:e.sessionId,sessionName:e.sessionName,startTime:e.startTime,toolCallCount:0,estimatedCostUsd:null}));let a=e=>{let t=r.get(e.sessionId);return t?t.lastActivity:e.startTime!=null&&e.durationMs!=null?e.startTime+e.durationMs:e.startTime??0};return[...i.values()].sort((e,t)=>a(t)-a(e)).slice(0,10)},[e,t]),y=(0,F.useMemo)(()=>m?.timeline??[],[m]),b=(0,F.useMemo)(()=>Array.isArray(h?.agents)?h.agents:[],[h]),x=(0,F.useMemo)(()=>{let e=null,t=null;for(let n of y){let r=n.timestamp+(n.durationMs??50);(e===null||n.timestamp<e)&&(e=n.timestamp),(t===null||r>t)&&(t=r)}let n=h?.window;return n&&Number.isFinite(n.startMs)&&Number.isFinite(n.endMs)&&(e=e===null?n.startMs:Math.min(e,n.startMs),t=t===null?n.endMs:Math.max(t,n.endMs)),e===null||t===null?{startMs:0,endMs:1}:{startMs:e,endMs:t>e?t:e+1}},[y,h]),S=(0,F.useMemo)(()=>{let e={};if(Array.isArray(g))for(let t of g)t&&typeof t.runId==`string`&&typeof t.status==`string`&&t.parentSessionId===d&&(e[t.runId]=t.status);return e},[g,d]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`glass-card mb-3 grid grid-cols-[220px_1fr] overflow-hidden`,style:{height:`320px`},children:[(0,I.jsxs)(`div`,{className:`border-r border-border-subtle overflow-auto`,children:[(0,I.jsx)(V,{className:`p-2 border-b border-border-subtle`,children:`Session Live Tail`}),v.map(e=>{let t=l.has(e.sessionId);return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>r(e.sessionId),className:`block w-full text-left p-2 border-b border-border-subtle text-xs transition-colors duration-150 hover:bg-surface-5 `+(d===e.sessionId?`bg-surface-5`:``),children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`span`,{className:`font-mono text-ink-base`,children:e.sessionName||e.sessionId.slice(0,8)}),t?(0,I.jsx)(Yr,{label:`live`,size:`sm`}):(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted`,title:e.startTime?`Started ${ci(e.startTime)}`:void 0,children:e.startTime?ci(e.startTime+(e.durationMs??0)):``})]}),(0,I.jsxs)(`div`,{className:`flex gap-2 mt-0.5 text-[10px] text-ink-subtle`,children:[(0,I.jsxs)(`span`,{children:[e.toolCallCount??0,` calls`]}),e.estimatedCostUsd!=null&&e.estimatedCostUsd>0?(0,I.jsx)(`span`,{children:fi(e.estimatedCostUsd)}):(0,I.jsx)(`span`,{children:`—`})]})]},e.sessionId)}),l.size===0&&v.length===0&&(0,I.jsx)(ea,{icon:`code`,title:`No sessions today`,subtitle:`Start coding with Claude to see sessions here.`})]}),(0,I.jsxs)(`div`,{className:`flex flex-col overflow-hidden`,children:[d&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1 border-b border-border-subtle shrink-0`,children:[(0,I.jsx)(V,{children:`Trace`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p&&(0,I.jsx)(`span`,{"data-testid":`session-ended-badge`,children:(0,I.jsx)(qr,{tone:`neutral`,size:`sm`,uppercase:!0,children:`Session ended`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>o(`/sessions?id=${d}`),className:`text-[10px] text-accent-cyan hover:underline transition-colors duration-150`,children:`full session →`})]})]}),(0,I.jsxs)(`div`,{ref:_,className:`overflow-auto flex-1 p-2`,children:[!d&&(0,I.jsx)(`div`,{className:`text-ink-muted text-xs p-2`,children:`Select a session to view its timeline.`}),d&&y.length===0&&b.length===0&&(0,I.jsx)(ea,{icon:`timeline`,title:f?`Waiting for tool calls`:`No tool calls`,subtitle:f?`Tool calls will appear here in real time.`:`This session has no recorded tool calls.`}),d&&(y.length>0||b.length>0)&&(0,I.jsx)(ma,{sessionId:d,parentEntries:y,agents:b,window:x,runStatusById:S,parentSegments:m?.segments??[],onSelectRun:e=>a(e)},d)]}),f&&d&&(0,I.jsx)(`div`,{className:`border-t border-bg-line px-3 py-2 shrink-0`,children:(0,I.jsx)(mo,{sessionId:d})})]})]}),i!=null&&(0,I.jsx)(Ra,{runId:i,onClose:()=>a(null)})]})}function Ao(e,t){let n=t.find(t=>t.sessionId===e);return n?.sessionName?n.sessionName:e.slice(0,8)}function jo(){let{data:e,isLoading:t,error:n}=L({queryKey:z.alertsRecent,queryFn:async()=>{try{return await hr()}catch(e){if(e instanceof tr)return null;throw e}},refetchInterval:vo,retry:!1});if(e===null)return null;let r=[...e??[]].sort((e,t)=>t.firedAt-e.firedAt);return(0,I.jsxs)(B,{padding:`sm`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Recent Alerts`}),t&&(0,I.jsx)(ea,{variant:`loading`,title:`Loading...`}),n&&(0,I.jsx)(`div`,{className:`text-accent-red text-xs`,children:`Error loading recent alerts.`}),!t&&!n&&r.length===0&&(0,I.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No alerts in recent history.`}),!t&&!n&&r.length>0&&(0,I.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,I.jsx)(`thead`,{className:`text-ink-muted`,children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{className:`text-left pb-1`,children:`when`}),(0,I.jsx)(`th`,{className:`text-left pb-1`,children:`sev`}),(0,I.jsx)(`th`,{className:`text-left pb-1`,children:`rule`}),(0,I.jsx)(`th`,{className:`text-right pb-1`,children:`value / threshold`}),(0,I.jsx)(`th`,{className:`text-left pb-1 pl-2`,children:`state`})]})}),(0,I.jsx)(`tbody`,{children:r.slice(0,50).map(e=>(0,I.jsxs)(`tr`,{className:`border-t border-border-subtle`,children:[(0,I.jsx)(`td`,{className:`py-1 text-ink-subtle tabular-nums whitespace-nowrap`,children:Mo(e.firedAt)}),(0,I.jsxs)(`td`,{className:`py-1`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:yo[e.severity],children:`●`}),` `,(0,I.jsx)(`span`,{className:`text-ink-subtle uppercase tracking-wider text-[10px]`,children:e.severity})]}),(0,I.jsx)(`td`,{className:`py-1`,children:e.title}),(0,I.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[di(e.value),` / `,di(e.threshold)]}),(0,I.jsx)(`td`,{className:`py-1 pl-2 `+(e.state===`firing`?`text-accent-amber`:`text-ink-muted`),children:e.state})]},`${e.id}-${e.firedAt}-${e.state}`))})]})]})}function Mo(e){let t=Math.max(0,Date.now()-e),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}var No=e=>go(e);function Po(e){let t=e.estimatedCostUsd;if(t==null||t<=0||e.startTime==null)return 0;let n=ho(),r=n+864e5,i=e.startTime,a=typeof e.endTime==`number`?e.endTime:typeof e.durationMs==`number`?e.startTime+e.durationMs:Date.now();return a<n||i>=r?0:i>=n&&a<r?t:t*((Math.min(a,r)-Math.max(i,n))/Math.max(1,a-i))}function Fo(e){let t=0;for(let n of e)t+=Po(n);return t}function Io(e){let t=0;for(let n of e)(n.startTime&&No(n.startTime)||Po(n)>0)&&(t+=n.toolCallCount??0);return t}function Lo(e){let t=0;for(let n of e)(n.startTime&&No(n.startTime)||Po(n)>0)&&(t+=n.antiPatterns?.length??0);return t}function Ro(e){let t=Array(24).fill(0);for(let n of e){if(!n.startTime||!No(n.startTime)||n.estimatedCostUsd==null)continue;let e=new Date(n.startTime).getHours();t[e]+=n.estimatedCostUsd}return t.map((e,t)=>({hour:t,cost:e}))}function zo({todayTotal:e,forecastEod:t,hourlySpend:n,subagentUsd:r=0}){let i=t!==null&&Number.isFinite(t),a=i?Math.max(t,e):0,o=i?a-e:0,s=i&&e>0?o/e*100:0,c=n.some(e=>e.cost>0),l=r>0?Math.max(0,e-r):0;return(0,I.jsxs)(B,{padding:`sm`,className:`mb-3 h-full`,children:[(0,I.jsx)(V,{className:`mb-1.5`,children:`Forecast · End of Day`}),i?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,I.jsx)(`span`,{className:`text-lg font-semibold text-accent-cyan tabular-nums`,children:fi(a)}),(0,I.jsx)(`span`,{className:`text-xs text-ink-muted tabular-nums`,children:o>0?(0,I.jsxs)(I.Fragment,{children:[`+`,fi(o),e>0&&` (+${s.toFixed(0)}%)`,` from now`]}):(0,I.jsx)(I.Fragment,{children:`on pace`})})]}),c&&(0,I.jsxs)(`div`,{className:`mt-2`,children:[(0,I.jsx)(Ki,{hours:n}),r>0&&(0,I.jsxs)(`div`,{className:`flex gap-3 mt-1 text-[10px] text-ink-muted tabular-nums`,children:[(0,I.jsxs)(`span`,{children:[`parent `,fi(l)]}),(0,I.jsx)(`span`,{className:`text-ink-subtle`,children:`·`}),(0,I.jsxs)(`span`,{children:[`subagent `,fi(r)]})]})]})]}):(0,I.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`Insufficient data — forecast appears once burn rate stabilizes.`})]})}function Bo(e,t){let{startMs:n,endMs:r,bucketSizeMs:i}=t,a=Math.max(1,Math.ceil((r-n)/i)),o=Array(a).fill(0);for(let t of e){let e=Math.floor((t.timestamp-n)/i);e>=0&&e<a&&o[e]++}return o}function Vo(e){return e<6e5?3e4:e<36e5?6e4:e<144e5?3e5:9e5}var Ho=50,Uo={thrashing:`Edit/Test Thrashing`,stuck_loop:`Stuck Loop`,blind_editing:`Blind Editing`,re_reading:`Repeated Reads`},Wo={running:{tone:`info`,label:`Running`},completed:{tone:`success`,label:`Completed`},failed:{tone:`danger`,label:`Failed`},cancelled:{tone:`warning`,label:`Cancelled`},unknown:{tone:`neutral`,label:`Unknown`}},Go=[{value:`today`,label:`Today`},{value:`7d`,label:`7 days`},{value:`30d`,label:`30 days`},{value:`all`,label:`All`}],Ko=[{value:`all`,label:`All sources`},{value:`script`,label:`Script`},{value:`agent_tool`,label:`Agent tool`}],qo=[{value:`all`,label:`All`},{value:`running`,label:`Running`},{value:`completed`,label:`Completed`},{value:`failed`,label:`Failed`},{value:`cancelled`,label:`Cancelled`}];function Jo(e,t){if(t===`all`||e==null)return!0;let n=typeof e==`number`?e:Date.parse(e);if(!Number.isFinite(n))return!0;let r=Date.now();return n>={today:new Date().setHours(0,0,0,0),"7d":r-10080*60*1e3,"30d":r-720*60*60*1e3}[t]}function Yo(e){let t;try{let n=new URLSearchParams(e);t=n.get(`session`)??n.get(`id`)}catch{return null}if(t==null)return null;let n=t.trim();return n.length===0||n.length>256?null:n}function Xo(e){return typeof e.startTime==`number`?e.startTime:new Date(e.startTime??0).getTime()}function Zo(e){return Xo(e)+(e.durationMs??0)}function Qo(e,t){let n=[...e];switch(t){case`date`:n.sort((e,t)=>Xo(t)-Xo(e));break;case`lastActive`:n.sort((e,t)=>Zo(t)-Zo(e));break;case`cost`:n.sort((e,t)=>(t.estimatedCostUsd??0)-(e.estimatedCostUsd??0));break;case`calls`:n.sort((e,t)=>(t.toolCallCount??0)-(e.toolCallCount??0));break}return n}function $o(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function es(){let e=Jt(),[t,n]=(0,F.useState)(()=>Yo(window.location.search)),[r,i]=(0,F.useState)(`date`),[a,o]=(0,F.useState)(`all`),[s,c]=(0,F.useState)(`all`),[l,u]=(0,F.useState)(`all`),[d,f]=(0,F.useState)(null),[p,m]=(0,F.useState)(()=>new Set),[h,g]=(0,F.useState)(()=>new Set),_=(0,F.useMemo)(()=>Yo(e),[e]);(0,F.useEffect)(()=>{_&&n(_)},[_]);let v=L({queryKey:z.sessionsList(Ho),queryFn:()=>ir(Ho),refetchInterval:1e4}),{data:y}=L({queryKey:z.workflows,queryFn:Pr,refetchInterval:1e4}),b=L({queryKey:z.sessionCurrent,queryFn:rr,refetchInterval:1e4}),x=(0,F.useMemo)(()=>{let e=new Set;if(b.data?.liveSessions?.length)for(let t of b.data.liveSessions)e.add(t);else b.data?.sessionId&&e.add(b.data.sessionId);return e},[b.data]),S=L({queryKey:t?z.sessionDetail(t):[`session`,`none`],queryFn:()=>sr(t),enabled:t!==null,refetchInterval:b.isLoading||t&&x.has(t)?1e4:!1}),C=(0,F.useMemo)(()=>Qo(v.data??[],r),[v.data,r]),w=(0,F.useMemo)(()=>Array.isArray(y)?y:[],[y]),T=(0,F.useMemo)(()=>w.filter(e=>!(!Jo(e.startedAt,a)||s!==`all`&&e.runSource!==s||l!==`all`&&e.status!==l)),[w,a,s,l]),E=(0,F.useMemo)(()=>{let e=T.length,t=T.reduce((e,t)=>e+(t.agentCount??0),0),n=T.map(e=>e.totalUsd).filter(e=>e!=null),r=n.length>0?n.reduce((e,t)=>e+t,0):null,i=T.map(e=>e.durationMs).filter(e=>e!=null);return{totalRuns:e,totalAgents:t,totalSpend:r,avgDurationMs:i.length>0?i.reduce((e,t)=>e+t,0)/i.length:null}},[T]),D=(0,F.useMemo)(()=>{let e=new Map;for(let t of T){let n=t.parentSessionId;if(typeof n!=`string`)continue;let r=e.get(n);r?r.push(t):e.set(n,[t])}return e},[T]),O=a!==`all`||s!==`all`||l!==`all`,k=(0,F.useMemo)(()=>O?C.filter(e=>D.has(e.sessionId)):C,[O,C,D]);(0,F.useEffect)(()=>{if(t)return;let e=x.size>0?[...x][0]:null;e?n(e):C.length>0&&n(C[0].sessionId)},[x,C,t]);let A=e=>{n(e)},j=(0,F.useCallback)(e=>{m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ee=(0,F.useCallback)(e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),M=(0,F.useCallback)(e=>{f(e)},[]);return(0,I.jsxs)(`section`,{className:`flex flex-col h-full`,children:[(0,I.jsx)(`div`,{className:`h-8 overflow-hidden rounded-lg mb-2 shrink-0`,children:(0,I.jsx)(to,{theme:`sessions`})}),(0,I.jsx)(`h1`,{className:`text-lg font-semibold gradient-text mb-2 shrink-0`,children:`Sessions`}),(0,I.jsx)(B,{tone:`static`,padding:`sm`,className:`mb-2 shrink-0`,children:(0,I.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-4 divide-x divide-border-subtle`,children:[(0,I.jsx)(`div`,{className:`px-3 first:pl-0`,children:(0,I.jsx)(U,{label:`Workflow runs`,value:String(E.totalRuns),numericValue:E.totalRuns,animate:!0})}),(0,I.jsx)(`div`,{className:`px-3`,children:(0,I.jsx)(U,{label:`Subagents`,value:String(E.totalAgents),numericValue:E.totalAgents,animate:!0})}),(0,I.jsx)(`div`,{className:`px-3`,children:(0,I.jsx)(U,{label:`Workflow spend`,value:pi(E.totalSpend),tone:E.totalSpend===null?`neutral`:`warn`})}),(0,I.jsx)(`div`,{className:`px-3`,children:(0,I.jsx)(U,{label:`Avg duration`,value:E.avgDurationMs===null?`—`:ui(E.avgDurationMs)})})]})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap mb-2 shrink-0`,children:[(0,I.jsx)(Qr,{value:a,onChange:o,options:Go,ariaLabel:`Time window`}),(0,I.jsx)(`div`,{className:`h-4 w-px bg-border-subtle`,"aria-hidden":`true`}),(0,I.jsx)(`div`,{className:`flex items-center gap-1.5`,role:`group`,"aria-label":`Run source filter`,children:Ko.map(e=>(0,I.jsx)(`button`,{type:`button`,"aria-pressed":s===e.value,onClick:()=>c(e.value),className:[`px-2.5 py-1 rounded-full text-[11px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,s===e.value?`bg-accent-cyan/20 text-accent-cyan font-medium`:`text-ink-muted hover:text-ink-subtle`].join(` `),children:e.label},e.value))}),(0,I.jsx)(`div`,{className:`h-4 w-px bg-border-subtle`,"aria-hidden":`true`}),(0,I.jsx)(`div`,{className:`flex items-center gap-1.5`,role:`group`,"aria-label":`Status filter`,children:qo.map(e=>{let t=l===e.value;return(0,I.jsx)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>u(e.value),className:[`px-2.5 py-1 rounded-full text-[11px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,t?`bg-accent-green/20 text-accent-green font-medium`:`text-ink-muted hover:text-ink-subtle`].join(` `),children:e.label},e.value)})}),O&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>{o(`all`),c(`all`),u(`all`)},className:`text-[10px] text-ink-muted hover:text-ink-subtle underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,children:`Clear filters`})]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-[260px_1fr] gap-3 flex-1 min-h-0`,children:[(0,I.jsxs)(B,{padding:`none`,tone:`static`,className:`overflow-hidden flex flex-col`,children:[(0,I.jsx)(`header`,{className:`p-2 border-b border-border-subtle`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(V,{as:`h2`,children:`List`}),(0,I.jsxs)(`select`,{value:r,onChange:e=>i(e.target.value),className:`text-[10px] bg-surface-5 border border-border-medium rounded-md px-1.5 py-0.5 text-ink-subtle`,children:[(0,I.jsx)(`option`,{value:`date`,children:`Newest`}),(0,I.jsx)(`option`,{value:`lastActive`,children:`Last active`}),(0,I.jsx)(`option`,{value:`cost`,children:`Cost`}),(0,I.jsx)(`option`,{value:`calls`,children:`Calls`})]})]})}),(0,I.jsxs)(`div`,{className:`overflow-auto`,children:[v.isLoading&&(0,I.jsx)(ea,{variant:`loading`,icon:`timeline`,title:`Loading sessions`}),!v.isLoading&&k.length===0&&x.size===0&&(0,I.jsx)(ea,{icon:`code`,title:O?`No matching sessions`:`No sessions yet`,subtitle:O?`No sessions own a workflow run matching these filters.`:`Start coding with Claude to see your sessions here.`}),k.map(e=>(0,I.jsx)(ts,{row:e,isLive:x.has(e.sessionId),isSelected:t===e.sessionId,isExpanded:p.has(e.sessionId),sortKey:r,runs:D.get(e.sessionId)??[],expandedRuns:h,onSelect:A,onToggleSession:j,onToggleRun:ee,onOpenRun:M},e.sessionId)),C.length>=Ho&&(0,I.jsxs)(`div`,{className:`p-2 text-[10px] text-ink-muted text-center border-t border-border-subtle`,children:[`Showing `,Ho,` most recent sessions.`]})]})]}),(0,I.jsxs)(`div`,{className:`glass-card glass-card-static p-4 overflow-auto`,children:[!t&&(0,I.jsx)(ea,{icon:`timeline`,title:`Loading sessions`,subtitle:`Selecting the most recent session…`}),t&&S.isLoading&&(0,I.jsx)(ea,{variant:`loading`,icon:`timeline`,title:`Loading detail`}),t&&S.data&&(0,I.jsx)(is,{data:S.data,isLive:!!t&&x.has(t),onOpenRun:M})]})]}),d!=null&&(0,I.jsx)(Ra,{runId:d,onClose:()=>f(null)})]})}function ts({row:e,isLive:t,isSelected:n,isExpanded:r,sortKey:i,runs:a,expandedRuns:o,onSelect:s,onToggleSession:c,onToggleRun:l,onOpenRun:u}){return(0,I.jsxs)(`div`,{className:`border-b border-border-subtle`,children:[(0,I.jsxs)(`div`,{className:`flex items-stretch text-xs transition-colors duration-150 hover:bg-surface-5 `+(n?`bg-surface-5`:``),children:[(0,I.jsx)(`button`,{type:`button`,"aria-label":r?`Collapse workflows`:`Expand workflows`,"aria-expanded":r,onClick:t=>{t.stopPropagation(),c(e.sessionId)},className:`shrink-0 flex items-center justify-center w-6 text-ink-muted hover:text-ink-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:r?(0,I.jsx)(vn,{size:13,"aria-hidden":`true`}):(0,I.jsx)(yn,{size:13,"aria-hidden":`true`})}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>s(e.sessionId),className:`flex-1 min-w-0 text-left py-2 pr-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,I.jsx)(`span`,{className:`font-mono text-ink-base truncate`,children:e.sessionName||e.sessionId.slice(0,8)}),t&&(0,I.jsx)(Yr,{size:`sm`,label:`live`,className:`shrink-0`})]}),(0,I.jsxs)(`div`,{className:`flex justify-between mt-1 text-ink-subtle text-[11px] tabular-nums`,children:[(0,I.jsxs)(`span`,{children:[e.toolCallCount??0,` calls`]}),(0,I.jsx)(`span`,{className:`text-ink-muted`,title:i===`lastActive`&&e.startTime?`Started ${si(e.startTime)}`:void 0,children:e.startTime?si(i===`lastActive`?Zo(e):e.startTime):`—`}),(0,I.jsx)(`span`,{children:pi(e.estimatedCostUsd)})]})]})]}),r&&(0,I.jsx)(`div`,{className:`pl-3 border-l border-border-subtle ml-3 mb-1`,children:a.length===0?(0,I.jsx)(`div`,{className:`py-1.5 pl-1 text-[10px] text-ink-muted`,children:`No workflows in this session.`}):a.map(e=>(0,I.jsx)(ns,{run:e,isExpanded:o.has(e.runId),onToggleRun:l,onOpenRun:u},e.runId))})]})}function ns({run:e,isExpanded:t,onToggleRun:n,onOpenRun:r}){let{data:i}=L({queryKey:z.workflowDetail(e.runId),queryFn:()=>Fr(e.runId),enabled:t}),a=(0,F.useMemo)(()=>i?.agents??[],[i]),o=Wo[e.status]??Wo.unknown;return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`flex items-stretch hover:bg-surface-5 rounded transition-colors`,children:[(0,I.jsx)(`button`,{type:`button`,"aria-label":t?`Collapse agents`:`Expand agents`,"aria-expanded":t,onClick:t=>{t.stopPropagation(),n(e.runId)},className:`shrink-0 flex items-center justify-center w-5 text-ink-muted hover:text-ink-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:t?(0,I.jsx)(vn,{size:12,"aria-hidden":`true`}):(0,I.jsx)(yn,{size:12,"aria-hidden":`true`})}),(0,I.jsxs)(`button`,{type:`button`,"aria-label":`View workflow run ${e.workflowName??e.runId}`,onClick:()=>r(e.runId),className:`flex-1 min-w-0 flex items-center gap-1.5 text-left py-1.5 pr-1 text-[10px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded`,children:[(0,I.jsx)(`span`,{className:`flex-1 min-w-0 font-medium text-ink-base truncate`,children:e.workflowName??e.runId}),(0,I.jsxs)(`span`,{className:`text-ink-muted tabular-nums shrink-0`,children:[e.agentCount==null?0:e.agentCount,`a`]}),(0,I.jsx)(`span`,{className:`text-ink-muted tabular-nums shrink-0`,children:pi(e.totalUsd)}),(0,I.jsx)(qr,{tone:o.tone,size:`sm`,bordered:!0,children:o.label})]})]}),t&&(0,I.jsx)(`div`,{className:`pl-3 border-l border-border-subtle ml-2.5`,children:a.length===0?(0,I.jsx)(`div`,{className:`py-1 pl-1 text-[10px] text-ink-muted`,children:`No agents recorded.`}):a.map(t=>(0,I.jsxs)(`button`,{type:`button`,"aria-label":`View agent ${t.label} in run ${e.workflowName??e.runId}`,onClick:()=>r(e.runId),className:`flex w-full items-center gap-1.5 text-left py-1 pr-1 text-[10px] hover:bg-surface-5 rounded transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:[(0,I.jsx)(`span`,{className:`flex-1 min-w-0 text-ink-subtle truncate`,title:t.label,children:t.label}),(0,I.jsx)(`span`,{className:`font-mono text-ink-muted truncate max-w-[72px] shrink-0`,title:t.model,children:t.model}),(0,I.jsx)(`span`,{className:`text-ink-muted tabular-nums shrink-0`,children:$o(t.tokens)})]},t.agentId))})]})}function rs(e){return e===`Read`?`bg-accent-blue/80`:e===`Edit`||e===`Write`?`bg-accent-green/80`:e===`Bash`?`bg-accent-purple/80`:e===`Agent`?`bg-accent-teal/80`:`bg-ink-subtle/80`}function is({data:e,isLive:t,onOpenRun:n}){let r=e.toolBreakdown??{},i=Object.entries(r).sort((e,t)=>t[1]-e[1]),a=e.toolCallCount??0,o=e.durationMs==null?null:ui(e.durationMs),s=e.timeline??[],c=s.length>0?s[0].timestamp:0;return s.length===0&&i.length===0?(0,I.jsx)(ea,{icon:`timeline`,title:`No tool calls`,subtitle:`This session has no recorded tool calls.`}):(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`flex items-baseline justify-between mb-3`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h2`,{className:`text-xs tracking-wider text-ink-muted flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`font-mono text-ink-base ${e.sessionName?`font-medium`:`uppercase`}`,children:e.sessionName||e.sessionId.slice(0,8)}),(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsxs)(`span`,{className:`uppercase`,children:[a,` calls`]}),o&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsx)(`span`,{className:`tabular-nums`,children:o})]}),t&&(0,I.jsx)(Yr,{size:`sm`,label:`live`})]}),c>0&&(0,I.jsx)(`div`,{className:`text-[11px] text-ink-subtle mt-0.5`,children:new Date(c).toLocaleString(void 0,{weekday:`short`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})})]})}),(0,I.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 mb-4 text-xs`,children:[e.model&&(0,I.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,I.jsx)(V,{children:`Model`}),(0,I.jsx)(`div`,{className:`font-mono`,children:e.model})]}),e.estimatedCostUsd!=null&&(0,I.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,I.jsx)(V,{children:`Cost`}),(0,I.jsx)(`div`,{className:`tabular-nums`,children:fi(e.estimatedCostUsd)})]}),e.outcome&&(0,I.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,I.jsx)(V,{children:`Status`}),(0,I.jsx)(`div`,{className:`capitalize`,children:e.outcome})]})]}),(e.antiPatterns?.length??0)>0&&(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsx)(V,{className:`mb-1`,children:`Anti-Patterns`}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.antiPatterns.map(({type:e,count:t})=>(0,I.jsxs)(qr,{tone:`warning`,size:`sm`,bordered:!0,children:[Uo[e]??e,(0,I.jsxs)(`span`,{className:`opacity-70`,children:[`× `,t]})]},e))})]}),(e.qualityProxy||e.toolSelectionScore)&&(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 mb-4`,children:[e.qualityProxy&&(0,I.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-3`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Session Quality`}),(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Diff Apply `}),(0,I.jsx)(`span`,{className:ai(e.qualityProxy.diffApplyRate),children:e.qualityProxy.diffApplyRate===null?`—`:`${(e.qualityProxy.diffApplyRate*100).toFixed(0)}%`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Test Pass `}),(0,I.jsx)(`span`,{className:ai(e.qualityProxy.testPassRate),children:e.qualityProxy.testPassRate===null?`—`:`${(e.qualityProxy.testPassRate*100).toFixed(0)}%`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Backtracks `}),(0,I.jsx)(`span`,{className:e.qualityProxy.backtrackCount>0?`text-accent-amber`:``,children:e.qualityProxy.backtrackCount})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Self-corrections `}),(0,I.jsx)(`span`,{className:`text-ink-subtle`,children:e.qualityProxy.selfCorrectionCount})]})]})]}),e.toolSelectionScore&&(0,I.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-3`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Tool Selection`}),(0,I.jsx)(`div`,{className:`text-2xl font-semibold tabular-nums ${oi(e.toolSelectionScore.score)}`,children:e.toolSelectionScore.score.toFixed(2)}),(0,I.jsxs)(`div`,{className:`text-[10px] text-ink-muted mt-1`,children:[`re-reads: `,e.toolSelectionScore.redundantReadCount,` · repeat fails:`,` `,e.toolSelectionScore.repeatedFailureCount,` · unused:`,` `,e.toolSelectionScore.unusedOutputCount]})]})]}),t&&(0,I.jsx)(`div`,{className:`mb-4`,children:(0,I.jsx)(mo,{sessionId:e.sessionId})}),i.length>0&&(0,I.jsx)(os,{breakdownEntries:i,totalCalls:a,isLive:t,sessionId:e.sessionId}),(0,I.jsx)(cs,{timeline:s}),(e.filesRead?.length??0)>0&&(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsx)(V,{className:`mb-1`,children:`Files Read`}),(0,I.jsx)(`ul`,{className:`text-[11px] text-ink-subtle space-y-0.5`,children:e.filesRead.map(e=>(0,I.jsx)(`li`,{className:`font-mono truncate`,children:e.split(`/`).slice(-2).join(`/`)},e))})]}),(e.filesModified?.length??0)>0&&(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsx)(V,{className:`mb-1`,children:`Files Modified`}),(0,I.jsx)(`ul`,{className:`text-[11px] text-ink-subtle space-y-0.5`,children:e.filesModified.map(e=>(0,I.jsx)(`li`,{className:`font-mono truncate`,children:e.split(`/`).slice(-2).join(`/`)},e))})]}),(0,I.jsx)(as,{sessionId:e.sessionId,isLive:t,parentEntries:s,onOpenRun:n},e.sessionId)]})}function as({sessionId:e,isLive:t,parentEntries:n,onOpenRun:r}){let{data:i,isLoading:a,isError:o}=L({queryKey:z.sessionSubagents(e),queryFn:()=>_r(e),retry:!1,refetchInterval:t?1e4:!1}),{data:s}=L({queryKey:z.workflows,queryFn:Pr,refetchInterval:t?1e4:3e4}),c=(0,F.useMemo)(()=>{let t={};if(!Array.isArray(s))return t;for(let n of s)n.parentSessionId===e&&(t[n.runId]=n.status);return t},[s,e]),l=(0,F.useMemo)(()=>i?.agents??[],[i]),u=(0,F.useMemo)(()=>{let e=i!==void 0&&(i.agents?.length??0)>0,t=e?i.window.startMs:null,r=e?i.window.endMs:null,a=null,o=null;for(let e of n){let t=e.timestamp,n=e.timestamp+(e.durationMs??50);(a===null||t<a)&&(a=t),(o===null||n>o)&&(o=n)}let s=[a,t].filter(e=>e!==null),c=[o,r].filter(e=>e!==null);return s.length===0||c.length===0?null:{startMs:Math.min(...s),endMs:Math.max(...c)}},[i,n]),d=(0,F.useMemo)(()=>n.map(e=>({timestamp:e.timestamp,toolName:e.toolName,durationMs:e.durationMs,success:e.success,filePath:e.filePath,command:e.command})),[n]);return(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Session trace`}),(0,I.jsx)(B,{tone:`static`,padding:`sm`,children:a?(0,I.jsx)(ea,{variant:`loading`,icon:`radar`,title:`Loading subagents`}):o||i===void 0?(0,I.jsx)(ma,{sessionId:e,parentEntries:d,agents:[],window:u??{startMs:0,endMs:1},onSelectRun:r,runStatusById:c}):(0,I.jsx)(ma,{sessionId:e,parentEntries:d,agents:l,window:u??i.window,onSelectRun:r,runStatusById:c})})]})}function os({breakdownEntries:e,totalCalls:t,isLive:n,sessionId:r}){let[i,a]=(0,F.useState)(`calls`),o=`/api/context?sessionId=${encodeURIComponent(r)}`,{data:s}=L({queryKey:[`context`,r],queryFn:()=>fetch(o).then(e=>e.ok?e.json():null),refetchInterval:1e4,enabled:n&&i===`context`}),c=s?.toolContributions??[],l=c.length>0?c[0].estimatedTokens:0;return(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,I.jsx)(V,{children:`Tools`}),n&&(0,I.jsx)(Qr,{value:i,onChange:a,options:[{value:`calls`,label:`Calls`},{value:`context`,label:`Context`}],size:`sm`,tone:`cyan`,ariaLabel:`Tools view`})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i===`calls`&&e.map(([e,n])=>{let r=t>0?n/t*100:0;return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,I.jsx)(`span`,{className:`w-28 text-ink-subtle truncate`,title:e,children:hi(e)}),(0,I.jsx)(`div`,{className:`flex-1 h-3 bg-surface-3 relative rounded`,children:(0,I.jsx)(`div`,{className:`h-3 rounded ${rs(e)}`,style:{width:`${r}%`}})}),(0,I.jsx)(`span`,{className:`w-10 text-right text-ink-muted tabular-nums`,children:n})]},e)}),i===`context`&&c.map(e=>{let t=l>0?e.estimatedTokens/l*100:0;return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,I.jsx)(`span`,{className:`w-28 text-ink-subtle truncate`,title:e.tool,children:hi(e.tool)}),(0,I.jsx)(`div`,{className:`flex-1 h-3 bg-surface-3 relative rounded`,children:(0,I.jsx)(`div`,{className:`h-3 rounded bg-accent-amber/80`,style:{width:`${t}%`}})}),(0,I.jsxs)(`span`,{className:`w-16 text-right text-ink-muted tabular-nums text-[10px]`,children:[`~`,ss(e.estimatedTokens)]})]},e.tool)}),i===`context`&&c.length===0&&(0,I.jsx)(`div`,{className:`text-[11px] text-ink-muted`,children:`No context data available yet`})]})]})}function ss(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function cs({timeline:e}){let t=(0,F.useMemo)(()=>{if(e.length<2)return null;let t=e[0].timestamp,n=e[e.length-1].timestamp,r=n-t;if(r<1e3)return null;let i=Vo(r),a=Bo(e,{startMs:t,endMs:n+i,bucketSizeMs:i});return{buckets:a,maxCount:Math.max(...a,1),bucketSizeMs:i,startMs:t}},[e]);return t?(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsx)(V,{className:`mb-1`,children:`Activity Density`}),(0,I.jsx)(Za,{variant:`strip`,buckets:t.buckets,maxCount:t.maxCount,bucketSizeMs:t.bucketSizeMs,startTimestamp:t.startMs,ariaLabel:`Session activity density`})]}):null}function ls(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ls(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function us(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ls(e))&&(r&&(r+=` `),r+=t);return r}var ds=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function fs(e){return typeof e==`string`&&ds.includes(e)}var ps=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function ms(e){return typeof e==`string`&&ps.has(e)}function hs(e){return typeof e==`string`&&e.startsWith(`data-`)}function gs(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(ms(n)||hs(n))&&(t[n]=e[n]);return t}function _s(e){if(e==null)return null;if((0,F.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return gs(t)}return typeof e==`object`&&!Array.isArray(e)?gs(e):null}function vs(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(ms(n)||hs(n)||fs(n))&&(t[n]=e[n]);return t}function ys(e){return e==null?null:(0,F.isValidElement)(e)?vs(e.props):typeof e==`object`&&!Array.isArray(e)?vs(e):null}var bs=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function xs(){return xs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xs.apply(null,arguments)}function Ss(e,t){if(e==null)return{};var n,r,i=Cs(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Cs(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ws=(0,F.forwardRef)((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,l=e.desc,u=Ss(e,bs),d=a||{width:r,height:i,x:0,y:0},f=us(`recharts-surface`,o);return F.createElement(`svg`,xs({},vs(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),F.createElement(`title`,null,c),F.createElement(`desc`,null,l),n)}),Ts=[`children`,`className`];function Es(){return Es=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Es.apply(null,arguments)}function Ds(e,t){if(e==null)return{};var n,r,i=Os(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Os(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ks=F.forwardRef((e,t)=>{var n=e.children,r=e.className,i=Ds(e,Ts),a=us(`recharts-layer`,r);return F.createElement(`g`,Es({className:a},vs(i),{ref:t}),n)}),As=o((e=>{function t(e){return e===`__proto__`}e.isUnsafeProperty=t})),js=o((e=>{function t(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}e.isDeepKey=t})),Ms=o((e=>{function t(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}e.toKey=t})),Ns=o((e=>{function t(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(t).join(`,`);let n=String(e);return n===`0`&&Object.is(Number(e),-0)?`-0`:n}e.toString=t})),Ps=o((e=>{var t=Ms(),n=Ns();function r(e){if(Array.isArray(e))return e.map(t.toKey);if(typeof e==`symbol`)return[e];e=n.toString(e);let r=[],i=e.length;if(i===0)return r;let a=0,o=``,s=``,c=!1;for(e.charCodeAt(0)===46&&(r.push(``),a++);a<i;){let t=e[a];s?t===`\\`&&a+1<i?(a++,o+=e[a]):t===s?s=``:o+=t:c?t===`"`||t===`'`?s=t:t===`]`?(c=!1,r.push(o),o=``):o+=t:t===`[`?(c=!0,o&&=(r.push(o),``)):t===`.`?o&&=(r.push(o),``):o+=t,a++}return o&&r.push(o),r}e.toPath=r})),Fs=o((e=>{var t=As(),n=js(),r=Ms(),i=Ps();function a(e,s,c){if(e==null)return c;switch(typeof s){case`string`:{if(t.isUnsafeProperty(s))return c;let r=e[s];return r===void 0?n.isDeepKey(s)?a(e,i.toPath(s),c):c:r}case`number`:case`symbol`:{typeof s==`number`&&(s=r.toKey(s));let t=e[s];return t===void 0?c:t}default:{if(Array.isArray(s))return o(e,s,c);if(s=Object.is(s?.valueOf(),-0)?`-0`:String(s),t.isUnsafeProperty(s))return c;let n=e[s];return n===void 0?c:n}}}function o(e,n,r){if(n.length===0)return r;let i=e;for(let e=0;e<n.length;e++){if(i==null||t.isUnsafeProperty(n[e]))return r;i=i[n[e]]}return i===void 0?r:i}e.get=a})),Is=o(((e,t)=>{t.exports=Fs().get})),Ls=4;function Rs(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ls),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function zs(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+Rs(i)+n},``)}var Bs=l(Is()),Vs=e=>e===0?0:e>0?1:-1,Hs=e=>typeof e==`number`&&e!=+e,Us=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,G=e=>(typeof e==`number`||e instanceof Number)&&!Hs(e),Ws=e=>G(e)||typeof e==`string`,Gs=0,Ks=e=>{var t=++Gs;return`${e||``}${t}`},qs=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!G(e)&&typeof e!=`string`)return n;var i;if(Us(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return Hs(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},Js=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Ys(e,t,n){return G(e)&&G(t)?Rs(e+n*(t-e)):t}function Xs(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):(0,Bs.default)(e,t))===n)}var Zs=e=>e==null,Qs=e=>Zs(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function $s(e){return e!=null}function ec(){}function tc(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function nc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nc(Object(n),!0).forEach(function(t){ic(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ic(e,t,n){return(t=ac(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ac(e){var t=oc(e,`string`);return typeof t==`symbol`?t:t+``}function oc(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var sc=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=tc(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var O={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(O.height=Math.max(E.y+E.height-(l+u),0),O.width=f),O}if(n===`left`){var k={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(k.x-E.x,0),k.height=u),k}if(n===`right`){var A={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(A.width=Math.max(E.x+E.width-A.x,0),A.height=u),A}var j=o&&E?{width:g,height:u}:{};return n===`insideLeft`?rc({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},j):n===`insideRight`?rc({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},j):n===`insideTop`?rc({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},j):n===`insideBottom`?rc({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},j):n===`insideTopLeft`?rc({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},j):n===`insideTopRight`?rc({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},j):n===`insideBottomLeft`?rc({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},j):n===`insideBottomRight`?rc({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},j):n&&typeof n==`object`&&(G(n.x)||Us(n.x))&&(G(n.y)||Us(n.y))?rc({x:c+qs(n.x,g),y:l+qs(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},j):rc({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},j)},cc=[`top`,`left`,`right`,`bottom`];function lc(e){return e==null?!1:typeof e==`object`||cc.includes(e)}var uc=(0,F.createContext)(null);function dc(e){return function(){return e}}var fc=Math.PI,pc=2*fc,mc=1e-6,hc=pc-mc;function gc(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function _c(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return gc;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var vc=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?gc:_c(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>mc)if(!(Math.abs(u*s-c*l)>mc)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((fc-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>mc&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>mc||Math.abs(this._y1-l)>mc)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%pc+pc),d>hc?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>mc&&this._append`A${n},${n},0,${+(d>=fc)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function yc(){return new vc}yc.prototype=vc.prototype;function bc(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new vc(t)}Array.prototype.slice;function xc(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Sc(e){this._context=e}Sc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Cc(e){return new Sc(e)}function wc(e){return e[0]}function Tc(e){return e[1]}function Ec(e,t){var n=dc(!0),r=null,i=Cc,a=null,o=bc(s);e=typeof e==`function`?e:e===void 0?wc:dc(e),t=typeof t==`function`?t:t===void 0?Tc:dc(t);function s(s){var c,l=(s=xc(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:dc(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:dc(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:dc(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function Dc(e,t,n){var r=null,i=dc(!0),a=null,o=Cc,s=null,c=bc(l);e=typeof e==`function`?e:e===void 0?wc:dc(+e),t=typeof t==`function`?t:dc(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Tc:dc(+n);function l(l){var u,d,f,p=(l=xc(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Ec().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:dc(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:dc(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:dc(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:dc(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:dc(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:dc(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:dc(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var Oc=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function kc(e){return new Oc(e,!0)}function Ac(e){return new Oc(e,!1)}function jc(){}function Mc(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Nc(e){this._context=e}Nc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Mc(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Mc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Pc(e){return new Nc(e)}function Fc(e){this._context=e}Fc.prototype={areaStart:jc,areaEnd:jc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Mc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ic(e){return new Fc(e)}function Lc(e){this._context=e}Lc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Mc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rc(e){return new Lc(e)}function zc(e){this._context=e}zc.prototype={areaStart:jc,areaEnd:jc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Bc(e){return new zc(e)}function Vc(e){return e<0?-1:1}function Hc(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Vc(a)+Vc(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Uc(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Wc(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function Gc(e){this._context=e}Gc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Wc(this,this._t0,Uc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Wc(this,Uc(this,n=Hc(this,e,t)),n);break;default:Wc(this,this._t0,n=Hc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Kc(e){this._context=new qc(e)}(Kc.prototype=Object.create(Gc.prototype)).point=function(e,t){Gc.prototype.point.call(this,t,e)};function qc(e){this._context=e}qc.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Jc(e){return new Gc(e)}function Yc(e){return new Kc(e)}function Xc(e){this._context=e}Xc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Zc(e),i=Zc(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Zc(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Qc(e){return new Xc(e)}function $c(e,t){this._context=e,this._t=t}$c.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function el(e){return new $c(e,.5)}function tl(e){return new $c(e,0)}function nl(e){return new $c(e,1)}function rl(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function il(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function al(e,t){return e[t]}function ol(e){let t=[];return t.key=e,t}function sl(){var e=dc([]),t=il,n=rl,r=al;function i(i){var a=Array.from(e.apply(this,arguments),ol),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=xc(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:dc(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:dc(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?il:typeof e==`function`?e:dc(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??rl,i):n},i}function cl(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}rl(e,t)}}function ll(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}rl(e,t)}}function ul(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,rl(e,t)}}var dl=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,fl=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,F.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{fs(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},pl=(e,t,n)=>r=>(e(t,n,r),null),ml=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];fs(i)&&typeof a==`function`&&(r||={},r[i]=pl(a,t,n))}),r};function hl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hl(Object(n),!0).forEach(function(t){_l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _l(e,t,n){return(t=vl(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vl(e){var t=yl(e,`string`);return typeof t==`symbol`?t:t+``}function yl(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function bl(e,t){var n=gl({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}var xl=o((e=>{function t(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}e.uniqBy=t})),Sl=o((e=>{function t(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}e.ary=t})),Cl=o((e=>{function t(e){return e}e.identity=t})),wl=o((e=>{var t=Fs();function n(e){return function(n){return t.get(n,e)}}e.property=n})),Tl=o((e=>{function t(e){return e==null||typeof e!=`object`&&typeof e!=`function`}e.isPrimitive=t})),El=o((e=>{function t(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}e.isTypedArray=t})),Dl=o((e=>{function t(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}e.getSymbols=t})),Ol=o((e=>{function t(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}e.getTag=t})),kl=o((e=>{e.argumentsTag=`[object Arguments]`,e.arrayBufferTag=`[object ArrayBuffer]`,e.arrayTag=`[object Array]`,e.bigInt64ArrayTag=`[object BigInt64Array]`,e.bigUint64ArrayTag=`[object BigUint64Array]`,e.booleanTag=`[object Boolean]`,e.dataViewTag=`[object DataView]`,e.dateTag=`[object Date]`,e.errorTag=`[object Error]`,e.float32ArrayTag=`[object Float32Array]`,e.float64ArrayTag=`[object Float64Array]`,e.functionTag=`[object Function]`,e.int16ArrayTag=`[object Int16Array]`,e.int32ArrayTag=`[object Int32Array]`,e.int8ArrayTag=`[object Int8Array]`,e.mapTag=`[object Map]`,e.numberTag=`[object Number]`,e.objectTag=`[object Object]`,e.regexpTag=`[object RegExp]`,e.setTag=`[object Set]`,e.stringTag=`[object String]`,e.symbolTag=`[object Symbol]`,e.uint16ArrayTag=`[object Uint16Array]`,e.uint32ArrayTag=`[object Uint32Array]`,e.uint8ArrayTag=`[object Uint8Array]`,e.uint8ClampedArrayTag=`[object Uint8ClampedArray]`})),Al=o((e=>{e.globalThis_=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})()||Function(`return this`)()})),jl=o((e=>{var t=Al();function n(e){return t.globalThis_.Buffer!==void 0&&t.globalThis_.Buffer.isBuffer(e)}e.isBuffer=n})),Ml=o((e=>{var t=Tl(),n=El(),r=Dl(),i=Ol(),a=kl(),o=jl();function s(e,t){return c(e,void 0,e,new Map,t)}function c(e,r,i,a=new Map,s=void 0){let d=s?.(e,r,i,a);if(d!==void 0)return d;if(t.isPrimitive(e))return e;if(a.has(e))return a.get(e);if(Array.isArray(e)){let t=Array(e.length);a.set(e,t);for(let n=0;n<e.length;n++)t[n]=c(e[n],n,i,a,s);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;a.set(e,t);for(let[n,r]of e)t.set(n,c(r,n,i,a,s));return t}if(e instanceof Set){let t=new Set;a.set(e,t);for(let n of e)t.add(c(n,void 0,i,a,s));return t}if(o.isBuffer(e))return e.subarray();if(n.isTypedArray(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);a.set(e,t);for(let n=0;n<e.length;n++)t[n]=c(e[n],n,i,a,s);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return a.set(e,t),l(t,e,i,a,s),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return a.set(e,t),l(t,e,i,a,s),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return a.set(e,t),l(t,e,i,a,s),t}if(e instanceof Error){let t=structuredClone(e);return a.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,l(t,e,i,a,s),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return a.set(e,t),l(t,e,i,a,s),t}if(e instanceof Number){let t=new Number(e.valueOf());return a.set(e,t),l(t,e,i,a,s),t}if(e instanceof String){let t=new String(e.valueOf());return a.set(e,t),l(t,e,i,a,s),t}if(typeof e==`object`&&u(e)){let t=Object.create(Object.getPrototypeOf(e));return a.set(e,t),l(t,e,i,a,s),t}return e}function l(e,t,n=e,i,a){let o=[...Object.keys(t),...r.getSymbols(t)];for(let r=0;r<o.length;r++){let s=o[r],l=Object.getOwnPropertyDescriptor(e,s);(l==null||l.writable)&&(e[s]=c(t[s],s,n,i,a))}}function u(e){switch(i.getTag(e)){case a.argumentsTag:case a.arrayTag:case a.arrayBufferTag:case a.dataViewTag:case a.booleanTag:case a.dateTag:case a.float32ArrayTag:case a.float64ArrayTag:case a.int8ArrayTag:case a.int16ArrayTag:case a.int32ArrayTag:case a.mapTag:case a.numberTag:case a.objectTag:case a.regexpTag:case a.setTag:case a.stringTag:case a.symbolTag:case a.uint8ArrayTag:case a.uint8ClampedArrayTag:case a.uint16ArrayTag:case a.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=s,e.cloneDeepWithImpl=c,e.copyProperties=l})),Nl=o((e=>{var t=Ml();function n(e){return t.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}e.cloneDeep=n})),Pl=o((e=>{function t(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}e.isEqualsSameValueZero=t})),Fl=o((()=>{Pl()})),Il=o((e=>{function t(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}e.isObject=t})),Ll=o((e=>{var t=Tl(),n=Pl();Fl();var r=Il();function i(e,t,n){return typeof n==`function`?a(e,t,function e(t,r,i,o,s,c){let l=n(t,r,i,o,s,c);return l===void 0?a(t,r,e,c):!!l},new Map):i(e,t,()=>void 0)}function a(e,t,i,s){if(t===e)return!0;switch(typeof t){case`object`:return o(e,t,i,s);case`function`:return Object.keys(t).length>0?a(e,{...t},i,s):n.isEqualsSameValueZero(e,t);default:return r.isObject(e)?typeof t!=`string`||t===``:n.isEqualsSameValueZero(e,t)}}function o(e,n,r,i){if(n==null)return!0;if(Array.isArray(n))return c(e,n,r,i);if(n instanceof Map)return s(e,n,r,i);if(n instanceof Set)return l(e,n,r,i);let a=Object.keys(n);if(e==null||t.isPrimitive(e))return a.length===0;if(a.length===0)return!0;if(i?.has(n))return i.get(n)===e;i?.set(n,e);try{for(let o=0;o<a.length;o++){let s=a[o];if(!t.isPrimitive(e)&&!(s in e)||n[s]===void 0&&e[s]!==void 0||n[s]===null&&e[s]!==null||!r(e[s],n[s],s,e,n,i))return!1}return!0}finally{i?.delete(n)}}function s(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function c(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function l(e,t,n,r){return t.size===0||e instanceof Set&&c([...e],[...t],n,r)}e.isMatchWith=i})),Rl=o((e=>{var t=Ll();function n(e,n){return t.isMatchWith(e,n,()=>void 0)}e.isMatch=n})),zl=o((e=>{var t=Nl(),n=Rl();function r(e){return e=t.cloneDeep(e),t=>n.isMatch(t,e)}e.matches=r})),Bl=o((e=>{var t=Ol(),n=kl(),r=Ml();function i(e,i){return r.cloneDeepWith(e,(a,o,s,c)=>{let l=i?.(a,o,s,c);if(l!==void 0)return l;if(typeof e==`object`){if(t.getTag(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return c.set(e,t),r.copyProperties(t,e,s,c),t}switch(Object.prototype.toString.call(e)){case n.numberTag:case n.stringTag:case n.booleanTag:{let t=new e.constructor(e?.valueOf());return r.copyProperties(t,e),t}case n.argumentsTag:{let t={};return r.copyProperties(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}e.cloneDeepWith=i})),K=o((e=>{var t=Bl();function n(e){return t.cloneDeepWith(e)}e.cloneDeep=n})),q=o((e=>{var t=/^(?:0|[1-9]\d*)$/;function n(e,n=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<n;case`symbol`:return!1;case`string`:return t.test(e)}}e.isIndex=n})),Vl=o((e=>{var t=Ol();function n(e){return typeof e==`object`&&!!e&&t.getTag(e)===`[object Arguments]`}e.isArguments=n})),Hl=o((e=>{var t=js(),n=Ps(),r=q(),i=Vl();function a(e,a){let o;if(o=Array.isArray(a)?a:typeof a==`string`&&t.isDeepKey(a)&&e?.[a]==null?n.toPath(a):[a],o.length===0)return!1;let s=e;for(let e=0;e<o.length;e++){let t=o[e];if((s==null||!Object.hasOwn(s,t))&&!((Array.isArray(s)||i.isArguments(s))&&r.isIndex(t)&&t<s.length))return!1;s=s[t]}return!0}e.has=a})),Ul=o((e=>{var t=Ms(),n=Fs(),r=Rl(),i=K(),a=Hl();function o(e,o){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=t.toKey(e);break}return o=i.cloneDeep(o),function(t){let i=n.get(t,e);return i===void 0?a.has(t,e):o===void 0?i===void 0:r.isMatch(i,o)}}e.matchesProperty=o})),Wl=o((e=>{var t=Cl(),n=wl(),r=zl(),i=Ul();function a(e){if(e==null)return t.identity;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?i.matchesProperty(e[0],e[1]):r.matches(e);case`string`:case`symbol`:case`number`:return n.property(e)}}e.iteratee=a})),Gl=o((e=>{function t(e){return Number.isSafeInteger(e)&&e>=0}e.isLength=t})),Kl=o((e=>{var t=Gl();function n(e){return e!=null&&typeof e!=`function`&&t.isLength(e.length)}e.isArrayLike=n})),ql=o((e=>{function t(e){return typeof e==`object`&&!!e}e.isObjectLike=t})),Jl=o((e=>{var t=Kl(),n=ql();function r(e){return n.isObjectLike(e)&&t.isArrayLike(e)}e.isArrayLikeObject=r})),Yl=o((e=>{var t=xl(),n=Sl(),r=Cl(),i=Wl(),a=Jl();function o(e,o=r.identity){return a.isArrayLikeObject(e)?t.uniqBy(Array.from(e),n.ary(i.iteratee(o),1)):[]}e.uniqBy=o})),Xl=l(o(((e,t)=>{t.exports=Yl().uniqBy}))());function Zl(e,t,n){return t===!0?(0,Xl.default)(e,n):typeof t==`function`?(0,Xl.default)(e,t):e}var Ql=o((e=>{var t=d(),n=mt();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),$l=o(((e,t)=>{t.exports=Ql()})),eu=(0,F.createContext)(null),tu=$l(),nu=e=>e,ru=()=>{var e=(0,F.useContext)(eu);return e?e.store.dispatch:nu},iu=()=>{},au=()=>iu,ou=(e,t)=>e===t;function J(e){var t=(0,F.useContext)(eu),n=(0,F.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:iu,[t,e]);return(0,tu.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:au,t?t.store.getState:iu,t?t.store.getState:iu,n,ou)}function su(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function cu(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var lu=e=>Array.isArray(e)?e:[e];function uu(e){let t=Array.isArray(e[0])?e[0]:e;return cu(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function du(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var fu=class{constructor(e){this.value=e}deref(){return this.value}},pu=typeof WeakRef>`u`?fu:WeakRef,mu=0,hu=1;function gu(){return{s:mu,v:void 0,o:null,p:null}}function _u(e){return e instanceof pu?e.deref():e}function vu(e,t={}){let n=gu(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=gu(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=gu(),e.set(n,t)):t=r}}let s=t,c;if(t.s===hu)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=_u(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new pu(c):c}return s.s=hu,s.v=c,c}return o.clearCache=()=>{n=gu(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function yu(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),su(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=vu,argsMemoizeOptions:u=[]}={...n,...a},d=lu(c),f=lu(u),p=uu(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=du(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var Y=yu(vu),bu=o((e=>{function t(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}e.flatten=t})),xu=o((e=>{var t=Pl();Fl();var n=Kl(),r=Il(),i=q();function a(e,a,o){return r.isObject(o)&&(typeof a==`number`&&n.isArrayLike(o)&&i.isIndex(a)&&a<o.length||typeof a==`string`&&a in o)?t.isEqualsSameValueZero(o[a],e):!1}e.isIterateeCall=a})),Su=o((e=>{function t(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}e.compareValues=(e,n,r)=>{if(e!==n){let i=t(e),a=t(n);if(i===a&&i===0){if(e<n)return r===`desc`?1:-1;if(e>n)return r===`desc`?-1:1}return r===`desc`?a-i:i-a}return 0}})),Cu=o((e=>{function t(e){return typeof e==`symbol`||e instanceof Symbol}e.isSymbol=t})),wu=o((e=>{var t=Cu(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(e,i){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||t.isSymbol(e)?!0:typeof e==`string`&&(r.test(e)||!n.test(e))||i!=null&&Object.hasOwn(i,e)}e.isKey=i})),Tu=o((e=>{var t=Ps(),n=Su(),r=wu();function i(e,i,a,o){if(e==null)return[];a=o?void 0:a,Array.isArray(e)||(e=Object.values(e)),Array.isArray(i)||(i=i==null?[null]:[i]),i.length===0&&(i=[null]),Array.isArray(a)||(a=a==null?[]:[a]),a=a.map(e=>String(e));let s=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},c=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:s(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?s(t,e):typeof t==`object`?t[e]:t,l=i.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||r.isKey(e)?e:{key:e,path:t.toPath(e)}));return e.map(e=>({original:e,criteria:l.map(t=>c(t,e))})).slice().sort((e,t)=>{for(let r=0;r<l.length;r++){let i=n.compareValues(e.criteria[r],t.criteria[r],a[r]);if(i!==0)return i}return 0}).map(e=>e.original)}e.orderBy=i})),Eu=o((e=>{var t=bu(),n=xu(),r=Tu();function i(e,...i){let a=i.length;return a>1&&n.isIterateeCall(e,i[0],i[1])?i=[]:a>2&&n.isIterateeCall(i[0],i[1],i[2])&&(i=[i[0]]),r.orderBy(e,t.flatten(i),[`asc`])}e.sortBy=i})),Du=l(o(((e,t)=>{t.exports=Eu().sortBy}))()),Ou=e=>e.legend.settings,ku=e=>e.legend.size;Y([e=>e.legend.payload,Ou],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?(0,Du.default)(r,n):r});function Au(e,t){return Fu(e)||Pu(e,t)||Mu(e,t)||ju()}function ju(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
9
|
+
`).replace(Md,``)}function Pd(e,t){return t=Nd(t),Nd(e)===t}function Fd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Fd(e,t,`name`,a.name,a,null),Fd(e,t,`formEncType`,a.formEncType,a,null),Fd(e,t,`formMethod`,a.formMethod,a,null),Fd(e,t,`formTarget`,a.formTarget,a,null)):(Fd(e,t,`encType`,a.encType,a,null),Fd(e,t,`method`,a.method,a,null),Fd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));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=$t(``+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`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`:X(`beforetoggle`,e),X(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,kt(e,n,r))}}function Id(e,t,n,r,a,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[lt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function Ld(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:X(`error`,e),X(`load`,e);var r=!1,a=!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`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Fd(e,t,o,s,n,null)}}a&&Fd(e,t,`srcSet`,n.srcSet,n,null),r&&Fd(e,t,`src`,n.src,n,null);return;case`input`:X(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=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(i(137,t));break;default:Fd(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in X(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Fd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in X(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Fd(e,t,s,c,n,null)}Gt(e,r,a,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:Fd(e,t,l,r,n,null)}return;case`dialog`:X(`beforetoggle`,e),X(`toggle`,e),X(`cancel`,e),X(`close`,e);break;case`iframe`:case`object`:X(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)X(yd[r],e);break;case`image`:X(`error`,e),X(`load`,e);break;case`details`:X(`toggle`,e);break;case`embed`:case`source`:case`link`:X(`error`,e),X(`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(i(137,t));default:Fd(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Id(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Fd(e,t,c,r,n,null))}function Rd(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 a=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)||Fd(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Fd(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,o,a);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)||Fd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Fd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Fd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Fd(e,t,s,a,r,o)}Wt(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:Fd(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`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Fd(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)&&Fd(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(i(137,t));break;default:Fd(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Id(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||Id(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Fd(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||Fd(e,t,f,p,r,m)}function zd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Bd(){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&&zd(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&&zd(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 Vd=null,Hd=null;function Ud(e){return e.nodeType===9?e:e.ownerDocument}function Wd(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 Gd(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 Kd(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 qd=null;function Jd(){var e=window.event;return e&&e.type===`popstate`?e===qd?!1:(qd=e,!0):(qd=null,!1)}var Yd=typeof setTimeout==`function`?setTimeout:void 0,Xd=typeof clearTimeout==`function`?clearTimeout:void 0,Zd=typeof Promise==`function`?Promise:void 0,Qd=typeof queueMicrotask==`function`?queueMicrotask:Zd===void 0?Yd:function(e){return Zd.resolve(null).then(e).catch($d)};function $d(e){setTimeout(function(){throw e})}function ef(e){return e===`head`}function tf(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),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)gf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,gf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&gf(e.ownerDocument.body);n=i}while(n);Fp(t)}function nf(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 rf(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`:rf(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function af(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[mt])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=df(e.nextSibling),e===null)break}return null}function of(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=df(e.nextSibling),e===null))return null;return e}function sf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=df(e.nextSibling),e===null))return null;return e}function cf(e){return e.data===`$?`||e.data===`$~`}function lf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function uf(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 df(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 ff=null;function pf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return df(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mf(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 hf(e,t,n){switch(t=Ud(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var _f=new Map,vf=new Set;function Z(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=P.d;P.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=xu();return e||t}function xf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?Ts(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ld(t,`link`,e),bt(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}_f.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Ld(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!_f.has(a)&&(e=m({rel:`modulepreload`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Ld(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=yt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=_f.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);bt(c),Ld(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,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=yt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0},t),(t=_f.get(i))&&Vf(e,t),a=n.createElement(`script`),bt(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=yt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=_f.get(i))&&Vf(e,t),a=n.createElement(`script`),bt(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=de.current)?Z(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=yt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Mf(n.href);var o=yt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),_f.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_f.set(e,n),o||Ff(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=If(n),n=yt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Mf(e){return`href="`+zt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ld(t,`link`,n),bt(t),e.head.appendChild(t))}function If(e){return`[src="`+zt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Ld(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Pf(n),(a=_f.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ld(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,bt(a),a):(r=n,(a=_f.get(o))&&(r=m({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),Ld(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,zf(r,n.precedence,e));return t.instance}function zf(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 Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,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[mt]||a[ct]||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 Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(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 Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(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=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Pf(r),(i=_f.get(i))&&Bf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ld(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*Bd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function tp(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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ai(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},La(a),e}function rp(e){return e?(e=ri,e):ri}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ba(e,r,t),n!==null&&(_u(n,e,t),Va(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&_u(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=hu();t=rt(t);var n=ei(e,t);n!==null&&_u(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,fp(e,t,n,r)}finally{P.p=a,N.T=i}}function dp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,fp(e,t,n,r)}finally{P.p=a,N.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Ed(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=F(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ve(o);s.entanglements[1]|=c,o&=~c}ad(a),!(zl&6)&&(iu=ke()+500,od(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&_u(s,a,2),xu(),op(a,2)}if(a=pp(r),a===null&&Ed(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ed(e,t,r,null,n)}}function pp(e){return e=nn(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=gt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 mp=e,null}function gp(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`resize`: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`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`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ae()){case je:return 2;case Me:return 8;case Ne:case Pe:return 32;case Fe:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=_t(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=gt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ot(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){cp(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 kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=_t(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=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(hp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,Cs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[lt]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){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 Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,hu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),xu(),t[L]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.8`)throw Error(i(527,zp,`19.2.8`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Q=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Q.isDisabled&&Q.supportsFiber)try{Re=Q.inject(Bp),ze=Q}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[L]=t.current,wd(e),new Lp(t)}})),_=o(((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=g()})),v=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},y=new class extends v{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},b={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},x=new class{#e=b;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function S(e){setTimeout(e,0)}var C=typeof window>`u`||`Deno`in globalThis;function w(){}function T(e,t){return typeof e==`function`?e(t):e}function E(e){return typeof e==`number`&&e>=0&&e!==1/0}function D(e,t){return Math.max(e+(t||0)-Date.now(),0)}function O(e,t){return typeof e==`function`?e(t):e}function k(e,t){return typeof e==`function`?e(t):e}function A(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ee(o,t.options))return!1}else if(!te(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function j(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(M(t.options.mutationKey)!==M(a))return!1}else if(!te(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ee(e,t){return(t?.queryKeyHashFn||M)(e)}function M(e){return JSON.stringify(e,(e,t)=>ie(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function te(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!te(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!te(e[r],t[r]))return!1;return!0}return!1}var ne=Object.prototype.hasOwnProperty;function N(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=re(e)&&re(t);if(!r&&!(ie(e)&&ie(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ne.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=N(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function P(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function re(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ie(e){if(!ae(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ae(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ae(e){return Object.prototype.toString.call(e)===`[object Object]`}function oe(e){return new Promise(t=>{x.setTimeout(t,e)})}function se(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:N(e,t)}function ce(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function le(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ue=Symbol();function de(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ue?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fe(e,t){return typeof e==`function`?e(...t):!!e}function pe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var me=(()=>{let e=()=>C;return{isServer(){return e()},setIsServer(t){e=t}}})();function he(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ge=S;function _e(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ge,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ve=_e(),ye=new class extends v{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function be(e){return Math.min(1e3*2**e,3e4)}function xe(e){return(e??`online`)!==`online`||ye.isOnline()}var Se=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ce(e){let t=!1,n=0,r,i=he(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Se(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>y.isFocused()&&(e.networkMode===`always`||ye.isOnline())&&e.canRun(),u=()=>xe(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(me.isServer()?0:3),o=e.retryDelay??be,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),oe(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var we=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),E(this.gcTime)&&(this.#e=x.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(me.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(x.clearTimeout(this.#e),this.#e=void 0)}};function Te(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{pe(e,()=>t.signal,()=>n=!0)},u=de(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?le:ce;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?De:Ee,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ee(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Ee(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function De(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Oe=class extends we{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=je(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=je(this.options);e.data!==void 0&&(this.setState(Ae(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=se(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(w).catch(w):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>k(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ue||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>O(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!D(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=de(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Te(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Ce({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Se&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Se){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ke(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ae(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ve.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ke(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ae(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function je(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Me=class extends v{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=he(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Pe(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fe(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof k(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!P(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ie(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||O(this.options.staleTime,this.#t)!==O(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Re(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(w)),t}#g(){this.#b();let e=O(this.options.staleTime,this.#t);if(me.isServer()||this.#r.isStale||!E(e))return;let t=D(this.#r.dataUpdatedAt,e)+1;this.#d=x.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(me.isServer()||k(this.options.enabled,this.#t)===!1||!E(this.#p)||this.#p===0)&&(this.#f=x.setInterval(()=>{(this.options.refetchIntervalInBackground||y.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(x.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(x.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Pe(e,t),o=i&&Ie(e,n,t,r);(a||o)&&(l={...l,...ke(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=se(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=se(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Le(e,t),refetch:this.refetch,promise:this.#o,isEnabled:k(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=he();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!P(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){ve.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ne(e,t){return k(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&k(t.retryOnMount,e)===!1)}function Pe(e,t){return Ne(e,t)||e.state.data!==void 0&&Fe(e,t,t.refetchOnMount)}function Fe(e,t,n){if(k(t.enabled,e)!==!1&&O(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Le(e,t)}return!1}function Ie(e,t,n,r){return(e!==t||k(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Le(e,n)}function Le(e,t){return k(t.enabled,e)!==!1&&e.isStaleByTime(O(t.staleTime,e))}function Re(e,t){return!P(e.getCurrentResult(),t)}var ze=class extends we{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Be(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Ce({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ve.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Be(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ve=class extends v{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new ze({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=He(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=He(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=He(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=He(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ve.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>j(t,e))}findAll(e={}){return this.getAll().filter(t=>j(e,t))}notify(e){ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ve.batch(()=>Promise.all(e.map(e=>e.continue().catch(w))))}};function He(e){return e.options.scope?.id}var Ue=class extends v{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),P(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&M(t.mutationKey)!==M(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Be();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ve.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},We=class extends v{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ee(r,t),a=this.get(i);return a||(a=new Oe({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ve.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>A(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>A(e,t)):t}notify(e){ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ve.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ve.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ge=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new We,this.#t=e.mutationCache||new Ve,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=y.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ye.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(O(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=T(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ve.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ve.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ve.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=ve.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(w).catch(w)}invalidateQueries(e,t={}){return ve.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ve.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(w)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(w)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(O(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(w).catch(w)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(w).catch(w)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ye.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(M(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{te(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(M(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{te(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ee(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ue&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ke=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),qe=o(((e,t)=>{t.exports=Ke()})),F=l(d(),1),I=qe(),Je=F.createContext(void 0),Ye=e=>{let t=F.useContext(Je);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Xe=({client:e,children:t})=>(F.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(Je.Provider,{value:e,children:t})),Ze=F.createContext(!1),Qe=()=>F.useContext(Ze);Ze.Provider;function $e(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var et=F.createContext($e()),tt=()=>F.useContext(et),nt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?fe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},rt=e=>{F.useEffect(()=>{e.clearReset()},[e])},it=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||fe(n,[e.error,r])),at=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ot=(e,t)=>e.isLoading&&e.isFetching&&!t,st=(e,t)=>e?.suspense&&t.isPending,ct=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function lt(e,t,n){let r=Qe(),i=tt(),a=Ye(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,at(o),nt(o,i,s),rt(i);let l=!a.getQueryCache().get(o.queryHash),[u]=F.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(F.useSyncExternalStore(F.useCallback(e=>{let t=f?u.subscribe(ve.batchCalls(e)):w;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),F.useEffect(()=>{u.setOptions(o)},[o,u]),st(o,d))throw ct(o,u,i);if(it({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!me.isServer()&&ot(d,r)&&(l?ct(o,u,i):s?.promise)?.catch(w).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function L(e,t){return lt(e,Me,t)}function ut(e,t){let n=Ye(t),[r]=F.useState(()=>new Ue(n,e));F.useEffect(()=>{r.setOptions(e)},[r,e]);let i=F.useSyncExternalStore(F.useCallback(e=>r.subscribe(ve.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=F.useCallback((e,t)=>{r.mutate(e,t).catch(w)},[r]);if(i.error&&fe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var dt=_();function ft(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var pt=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),mt=o(((e,t)=>{t.exports=pt()})),ht=mt(),gt=F.useInsertionEffect,_t=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?F.useLayoutEffect:F.useEffect,vt=gt||_t,yt=e=>{let t=F.useRef([e,(...e)=>t[0](...e)]).current;return vt(()=>{t[0]=e}),t[1]},bt=`popstate`,xt=`pushState`,St=`replaceState`,Ct=[bt,xt,St,`hashchange`],wt=e=>{for(let t of Ct)addEventListener(t,e);return()=>{for(let t of Ct)removeEventListener(t,e)}},Tt=(e,t)=>(0,ht.useSyncExternalStore)(wt,e,t),Et=()=>location.search,Dt=({ssrSearch:e}={})=>Tt(Et,e==null?Et:()=>e),Ot=()=>location.pathname,kt=({ssrPath:e}={})=>Tt(Ot,e==null?Ot:()=>e),At=(e,{replace:t=!1,state:n=null}={})=>history[t?St:xt](n,``,e),jt=(e={})=>[kt(e),At],Mt=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[Mt]===void 0){for(let e of[xt,St]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,Mt,{value:!0})}var Nt=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?`~`+t:t.slice(e.length)||`/`,Pt=(e=``)=>e===`/`?``:e,Ft=(e,t)=>e[0]===`~`?e.slice(1):Pt(t)+e,It=(e=``,t)=>Nt(Rt(Pt(e)),Rt(t)),Lt=e=>e[0]===`?`?e.slice(1):e,Rt=e=>{try{return decodeURI(e)}catch{return e}},zt=e=>Rt(Lt(e)),Bt={hook:jt,searchHook:Dt,parser:ft,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},Vt=(0,F.createContext)(Bt),Ht=()=>(0,F.useContext)(Vt),Ut={},Wt=(0,F.createContext)(Ut),Gt=()=>(0,F.useContext)(Wt),Kt=e=>{let[t,n]=e.hook(e);return[It(e.base,t),yt((t,r)=>e.aroundNav(n,Ft(t,e.base),r))]},qt=()=>Kt(Ht()),Jt=()=>{let e=Ht();return zt(e.searchHook(e))},Yt=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||`*`,r),o=i.exec(n)||[],[s,...c]=o;return s===void 0?[!1,null]:[!0,(()=>{let e=a===!1?o.groups:Object.fromEntries(a.map((e,t)=>[e,c[t]])),t={...c};return e&&Object.assign(t,e),t})(),...r?[s]:[]]},Xt=({children:e,...t})=>{let n=Ht(),r=t.hook?Bt:n,i=r,[a,o=t.ssrSearch??``]=t.ssrPath?.split(`?`)??[];a&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let s=(0,F.useRef)({}),c=s.current,l=c;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];c===l&&n!==l[e]&&(s.current=l={...l}),l[e]=n,(n!==r[e]||n!==i[e])&&(i=l)}return(0,F.createElement)(Vt.Provider,{value:i,children:e})},Zt=({children:e,component:t},n)=>t?(0,F.createElement)(t,{params:n}):typeof e==`function`?e(n):e,Qt=e=>{let t=(0,F.useRef)(Ut),n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([e,t])=>t!==n[e])?e:n},$t=({path:e,nest:t,match:n,...r})=>{let i=Ht(),[a]=Kt(i),[o,s,c]=n??Yt(i.parser,e,a,t),l=Qt({...Gt(),...s});if(!o)return null;let u=c?(0,F.createElement)(Xt,{base:c},Zt(r,l)):Zt(r,l);return(0,F.createElement)(Wt.Provider,{value:l,children:u})},en=(0,F.forwardRef)((e,t)=>{let n=Ht(),[r,i]=Kt(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e,h=yt(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),g=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n);return c&&(0,F.isValidElement)(l)?(0,F.cloneElement)(l,{onClick:h,href:g}):(0,F.createElement)(`a`,{...m,onClick:h,href:g,className:u?.call?u(r===o):u,children:l,ref:t})}),tn=e=>Array.isArray(e)?e.flatMap(e=>tn(e&&e.type===F.Fragment?e.props.children:e)):[e],nn=({children:e,location:t})=>{let n=Ht(),[r]=Kt(n);for(let i of tn(e)){let e=0;if((0,F.isValidElement)(i)&&(e=Yt(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,F.cloneElement)(i,{match:e})}return null},rn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),an=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),on=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),sn=e=>{let t=on(e);return t.charAt(0).toUpperCase()+t.slice(1)},cn={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ln=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},un=(0,F.createContext)({}),dn=()=>(0,F.useContext)(un),fn=(0,F.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=dn()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,F.createElement)(`svg`,{ref:c,...cn,width:t??l??cn.width,height:t??l??cn.height,stroke:e??f,strokeWidth:m,className:rn(`lucide`,p,i),...!a&&!ln(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,F.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),pn=(e,t)=>{let n=(0,F.forwardRef)(({className:n,...r},i)=>(0,F.createElement)(fn,{ref:i,iconNode:t,className:rn(`lucide-${an(sn(e))}`,`lucide-${e}`,n),...r}));return n.displayName=sn(e),n},mn=pn(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),hn=pn(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),gn=pn(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),_n=pn(`bell`,[[`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`}]]),vn=pn(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),yn=pn(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),bn=pn(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),xn=pn(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Sn=pn(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Cn=pn(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),wn=pn(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Tn=pn(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),En=pn(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Dn=pn(`moon`,[[`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`}]]),On=pn(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),kn=pn(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),An=pn(`sun`,[[`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`}]]),jn=pn(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),Mn=pn(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Nn=e=>Symbol.iterator in e,Pn=e=>`entries`in e,Fn=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},In=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function Ln(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Nn(e)&&Nn(t)?Pn(e)&&Pn(t)?Fn(e,t):In(e,t):Fn({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Rn(e){let t=F.useRef(void 0);return n=>{let r=e(n);return Ln(t.current,r)?t.current:t.current=r}}var zn=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Bn=(e=>e?zn(e):zn),Vn=e=>e;function Hn(e,t=Vn){let n=F.useSyncExternalStore(e.subscribe,F.useCallback(()=>t(e.getState()),[e,t]),F.useCallback(()=>t(e.getInitialState()),[e,t]));return F.useDebugValue(n),n}var Un=e=>{let t=Bn(e),n=e=>Hn(t,e);return Object.assign(n,t),n},Wn=(e=>e?Un(e):Un),Gn=20,Kn=10,qn=50,Jn=Wn(e=>({connected:!1,recentToolCalls:[],cost:null,antiPatterns:[],contextBySession:new Map,firingAlerts:new Map,dismissedAlerts:new Set,activeSessionId:null,todaySubagentUsd:0,todaySubagentTurnCount:0,recentWorkflowRuns:[],observabilityHealth:null,setConnected:t=>e({connected:t}),setActiveSession:t=>e(e=>{if(e.activeSessionId===t)return{};let n=e=>t===null?e===void 0:e===t;return{activeSessionId:t,recentToolCalls:e.recentToolCalls.filter(e=>n(e.sessionId)),antiPatterns:e.antiPatterns.filter(e=>n(e.sessionId)),cost:e.cost&&n(e.cost.sessionId)?e.cost:null}}),pushToolCall:t=>e(e=>{if(e.recentToolCalls.some(e=>e.id===t.id))return{};let n=[...e.recentToolCalls,t];return{recentToolCalls:n.length>Gn?n.slice(n.length-Gn):n}}),setCost:t=>e({cost:t}),setContext:t=>e(e=>{let n=new Map(e.contextBySession);return n.set(t.sessionId,t),{contextBySession:n}}),pushAntiPattern:t=>e(e=>{let n=[...e.antiPatterns,t];return{antiPatterns:n.length>Kn?n.slice(n.length-Kn):n}}),addOrUpdateAlert:t=>e(e=>{let n=new Map(e.firingAlerts);if(t.state===`firing`)n.set(t.id,t);else if(n.delete(t.id),e.dismissedAlerts.has(t.id)){let r=new Set(e.dismissedAlerts);return r.delete(t.id),{firingAlerts:n,dismissedAlerts:r}}return{firingAlerts:n}}),clearAlert:t=>e(e=>{if(!e.firingAlerts.has(t))return e;let n=new Map(e.firingAlerts);return n.delete(t),{firingAlerts:n}}),dismissAlert:t=>e(e=>{if(e.dismissedAlerts.has(t))return e;let n=new Set(e.dismissedAlerts);return n.add(t),{dismissedAlerts:n}}),addSubagentTurn:t=>e(e=>({todaySubagentTurnCount:e.todaySubagentTurnCount+1,todaySubagentUsd:t==null?e.todaySubagentUsd:e.todaySubagentUsd+t})),upsertWorkflowRun:t=>e(e=>{let n=[...e.recentWorkflowRuns.filter(e=>e.workflowRunId!==t.workflowRunId),t];return{recentWorkflowRuns:n.length>qn?n.slice(n.length-qn):n}}),setObservabilityHealth:t=>e({observabilityHealth:t})})),Yn={info:0,warning:1,critical:2};function Xn(e){let t=[];for(let n of e.firingAlerts.values())e.dismissedAlerts.has(n.id)||t.push(n);return t.sort((e,t)=>{let n=Yn[t.severity]-Yn[e.severity];return n===0?e.firedAt-t.firedAt:n}),t}function Zn(e){let t=null;for(let n of e.firingAlerts.values())e.dismissedAlerts.has(n.id)||(t===null||Yn[n.severity]>Yn[t])&&(t=n.severity);return t}var Qn=()=>Jn(Rn(e=>({usd:e.todaySubagentUsd,turns:e.todaySubagentTurnCount}))),$n=()=>Jn(e=>e.observabilityHealth);function er(){let e=Jn(Rn(Xn)),t=Jn(Zn),n=Jn(e=>e.dismissAlert);return{alerts:e,maxSeverity:t,count:e.length,dismiss:n}}var tr=class extends Error{constructor(e){super(`Not found: ${e}`),this.name=`NotFoundError`}};async function R(e){let t=await fetch(e);if(t.status===404)throw new tr(e);if(!t.ok)throw Error(`${t.status} ${t.statusText} for ${e}`);return await t.json()}var nr=()=>R(`/api/health`),rr=()=>R(`/api/session/current`),ir=(e=50)=>R(`/api/sessions?limit=${e}`),ar=()=>R(`/api/sessions/today/aggregate`),or=()=>R(`/api/sessions/live`),sr=e=>R(`/api/sessions/${encodeURIComponent(e)}`),cr=()=>R(`/api/cost`),lr=()=>R(`/api/anti-patterns`),ur=()=>R(`/api/audit`),dr=()=>R(`/api/weekly`),fr=()=>R(`/api/budget`),pr=(e=30)=>R(`/api/cost-per-outcome?days=${e}`),mr=()=>R(`/api/personal-coach`),hr=()=>R(`/api/alerts/recent`),gr=e=>R(`/api/sessions/${encodeURIComponent(e)}/replay`),_r=e=>R(`/api/sessions/${encodeURIComponent(e)}/subagents`),vr=(e,t)=>R(`/api/sessions/${encodeURIComponent(e)}/subagents/${encodeURIComponent(t)}/calls`),yr=()=>R(`/api/quality-proxy`),br=()=>R(`/api/tool-selection-score`),xr=()=>R(`/api/git-efficiency`),Sr=()=>R(`/api/git-efficiency/repos`),Cr=()=>R(`/api/concurrency`),wr=(e=30)=>R(`/api/concurrency?view=history&days=${e}`);function Tr(e,t){return R(`/api/activity-heatmap?view=${encodeURIComponent(e)}${t?`&weeks=${t}`:``}`)}var Er=e=>R(e?`/api/context?sessionId=${encodeURIComponent(e)}`:`/api/context`),Dr=()=>R(`/api/model-usage`),Or=()=>R(`/api/cache-health`),kr=()=>R(`/api/settings`),Ar=()=>R(`/api/diagnostics`),jr=e=>fetch(`/api/settings`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}).then(async e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`);return await e.json()}),Mr=()=>fetch(`/api/digest/send`,{method:`POST`}).then(async e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`);return await e.json()}),Nr=()=>R(`/api/observability-health`),Pr=()=>R(`/api/workflows`),Fr=e=>R(`/api/workflows/${encodeURIComponent(e)}`),z={sessionCurrent:[`session`,`current`],sessionsList:e=>[`sessions`,`list`,e],sessionDetail:e=>[`session`,e],cost:[`cost`],antiPatterns:[`anti-patterns`],audit:[`audit`],weekly:[`weekly`],budget:[`budget`],latency:[`latency`],costPerOutcome:e=>[`cost-per-outcome`,e],personalCoach:[`personal-coach`],alertsRecent:[`alerts`,`recent`],sessionReplay:e=>[`session`,e,`replay`],sessionSubagents:e=>[`session`,e,`subagents`],agentCalls:(e,t)=>[`session`,e,`subagent`,t,`calls`],qualityProxy:[`quality-proxy`],toolSelectionScore:[`tool-selection-score`],gitEfficiency:[`git-efficiency`],gitEfficiencyRepos:[`git-efficiency-repos`],concurrency:[`concurrency`],concurrencyHistory:e=>[`concurrency`,`history`,e],activityHeatmap:e=>[`activity-heatmap`,e],context:[`context`],modelUsage:[`model-usage`],cacheHealth:[`cache-health`],settings:[`settings`],sessionsLive:[`sessions`,`live`],sessionsTodayAggregate:[`sessions`,`today`,`aggregate`],workflows:[`workflows`],workflowDetail:e=>[`workflow`,e],diagnostics:[`diagnostics`]},Ir={installed:null,latest:null,updateAvailable:!1};function Lr(){let[e,t]=(0,F.useState)(Ir);return(0,F.useEffect)(()=>{let e=!0;return nr().then(n=>{e&&t({installed:n.version,latest:n.latestVersion,updateAvailable:n.updateAvailable})}).catch(()=>{}),()=>{e=!1}},[]),e}var Rr={none:``,sm:`p-3`,md:`p-4`,lg:`p-5`},zr={default:`glass-card`,elevated:`glass-card bg-surface-5`,static:`glass-card glass-card-static`,danger:`glass-card glass-card-static border border-accent-red/60`,warning:`glass-card glass-card-static border border-accent-amber/40`},Br={none:``,green:`glow-green`,purple:`glow-purple`};function B({children:e,padding:t=`md`,tone:n=`default`,glow:r=`none`,className:i=``}){return(0,I.jsx)(`div`,{className:[zr[n],Rr[t],Br[r],i].filter(Boolean).join(` `),children:e})}var Vr={primary:`bg-accent-green/10 border border-accent-green/40 text-accent-green hover:bg-accent-green/20`,secondary:`bg-surface-5 border border-border-medium text-ink-subtle hover:border-border-strong hover:text-ink-base`,ghost:`bg-transparent border border-transparent text-ink-muted hover:text-ink-base hover:bg-surface-5`,danger:`bg-surface-5 border border-border-subtle text-ink-muted hover:border-accent-red hover:text-accent-red`},Hr={sm:`px-2 py-1 text-xs`,md:`px-3 py-1.5 text-xs`};function Ur({children:e,variant:t=`secondary`,size:n=`md`,disabled:r=!1,loading:i=!1,type:a=`button`,className:o=``,...s}){let c=r||i,l=[`inline-flex items-center justify-center gap-1.5 rounded-md transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 focus-visible:ring-offset-1 focus-visible:ring-offset-bg-deep`,Vr[t],Hr[n],c?`opacity-50 cursor-not-allowed`:``,o].filter(Boolean).join(` `);return(0,I.jsx)(`button`,{type:a,disabled:c,"aria-busy":i||void 0,className:l,...s,children:e})}var Wr={neutral:`bg-surface-5 text-ink-subtle`,info:`bg-accent-blue/15 text-accent-blue`,success:`bg-accent-green/15 text-accent-green`,warning:`bg-accent-amber/20 text-accent-amber`,danger:`bg-accent-red/20 text-accent-red`},Gr={neutral:`border border-border-medium`,info:`border border-accent-blue/30`,success:`border border-accent-green/30`,warning:`border border-accent-amber/30`,danger:`border border-accent-red/30`},Kr={sm:`px-1.5 py-0.5 text-[10px]`,md:`px-2 py-0.5 text-[11px]`};function qr({children:e,tone:t=`neutral`,size:n=`md`,uppercase:r=!1,bordered:i=!1,className:a=``,...o}){return(0,I.jsx)(`span`,{className:[`inline-flex items-center gap-1 rounded-full`,Wr[t],Kr[n],i?Gr[t]:``,r?`uppercase tracking-wider font-semibold`:``,a].filter(Boolean).join(` `),...o,children:e})}var Jr={sm:`text-[9px]`,md:`text-[10px]`};function Yr({label:e=`LIVE`,pulse:t=!0,size:n=`md`,className:r=``}){return(0,I.jsxs)(`span`,{className:[`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full`,`bg-accent-cyan/15 text-accent-cyan uppercase tracking-wider font-semibold`,Jr[n],r].filter(Boolean).join(` `),children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`w-1.5 h-1.5 rounded-full bg-accent-cyan ${t?`animate-pulse`:``}`}),e]})}var Xr={sm:`px-2 py-0.5 text-[10px] rounded-md`,md:`px-3 py-1 text-xs rounded-md`},Zr={green:`bg-accent-green/20 text-accent-green font-medium`,cyan:`bg-accent-cyan/20 text-accent-cyan font-medium`};function Qr({value:e,onChange:t,options:n,size:r=`md`,tone:i=`green`,ariaLabel:a,className:o=``}){return(0,I.jsx)(`div`,{role:`tablist`,"aria-label":a,className:[`inline-flex items-center gap-1`,o].filter(Boolean).join(` `),children:n.map(n=>{let a=n.value===e;return(0,I.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a,onClick:()=>t(n.value),className:[`transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 focus-visible:ring-offset-1 focus-visible:ring-offset-bg-deep`,Xr[r],a?Zr[i]:`text-ink-muted hover:text-ink-base`].join(` `),children:n.label},n.value)})})}function V({children:e,as:t=`div`,className:n=``}){let r=[`text-[10px] text-ink-muted uppercase tracking-wider font-medium`,n].filter(Boolean).join(` `);return t===`h2`?(0,I.jsx)(`h2`,{className:r,children:e}):t===`h3`?(0,I.jsx)(`h3`,{className:r,children:e}):(0,I.jsx)(`div`,{className:r,children:e})}function $r({title:e,subtitle:t,action:n,className:r=``}){return(0,I.jsxs)(`div`,{className:[`flex items-start justify-between gap-3 mb-3`,r].filter(Boolean).join(` `),children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium text-ink-base`,children:e}),t!=null&&(0,I.jsx)(`div`,{className:`text-xs text-ink-muted`,children:t})]}),n!=null&&(0,I.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:n})]})}var ei=[{path:`/`,label:`Today`,Icon:Tn},{path:`/sessions`,label:`Sessions`,Icon:Sn}],ti=[{path:`/history`,label:`History`,Icon:jn},{path:`/git`,label:`Git`,Icon:wn},{path:`/audit`,label:`Audit`,Icon:kn}],ni=[{path:`/settings`,label:`Settings`,Icon:On},{path:`/alerts`,label:`Alerts`,Icon:_n}],ri={info:`neutral`,warning:`warning`,critical:`danger`};function ii({currentPath:e,onNavigate:t,connected:n,theme:r,onToggleTheme:i}){let{count:a,maxSeverity:o}=er(),s=Lr();function c({path:n,label:r,Icon:i}){let s=e===n,c=n===`/`&&a>0,l=o??`info`;return(0,I.jsxs)(`button`,{type:`button`,"aria-current":s?`page`:void 0,onClick:()=>t(n),className:`flex items-center gap-2.5 px-3 py-2 rounded-lg text-xs text-left transition-colors duration-150 `+(s?`border-l-[3px] border-l-accent-green bg-accent-green/8 text-ink-base font-medium pl-2.5`:`border-l-[3px] border-l-transparent text-ink-subtle hover:text-ink-base hover:bg-surface-3`),children:[(0,I.jsx)(i,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,I.jsx)(`span`,{children:r}),c&&(0,I.jsx)(qr,{tone:ri[l],size:`sm`,className:`ml-auto font-semibold tabular-nums`,"data-testid":`alert-badge`,"data-severity":l,"aria-label":`${a>99?`99+`:a} firing ${a===1?`alert`:`alerts`}`,children:a>99?`99+`:a})]},n)}return(0,I.jsxs)(`aside`,{className:`w-52 bg-bg-deep border-r border-border-subtle p-4 flex flex-col`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,I.jsxs)(`svg`,{width:`22`,height:`22`,viewBox:`0 0 128 128`,"aria-hidden":`true`,children:[(0,I.jsx)(`rect`,{width:`128`,height:`128`,rx:`24`,fill:`url(#preflightGrad)`}),(0,I.jsx)(`path`,{d:`M21.1599 74.0495L29.1148 66.0946L45.3429 68.9583L56.7981 57.5032L21.1599 42.2297L30.7058 32.6838L73.9808 40.3205L87.9815 26.3198C89.7316 24.5697 91.8529 23.6947 94.3454 23.6947C96.838 23.6947 98.9593 24.5697 100.709 26.3198C102.459 28.0699 103.335 30.1912 103.335 32.6838C103.335 35.1763 102.459 37.2976 100.709 39.0477L86.7087 53.0484L94.3454 96.3234L84.7995 105.869L69.526 70.2311L58.0709 81.6863L60.9346 97.9144L52.9797 105.869L41.8428 85.1864L21.1599 74.0495Z`,fill:`#080F11`}),(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`preflightGrad`,x1:`64`,y1:`0`,x2:`64`,y2:`128`,gradientUnits:`userSpaceOnUse`,children:[(0,I.jsx)(`stop`,{offset:`0.12`,stopColor:`#D2FA37`}),(0,I.jsx)(`stop`,{offset:`0.88`,stopColor:`#1CE783`})]})})]}),(0,I.jsx)(`span`,{className:`font-semibold text-sm tracking-tight brand-text`,children:`Preflight`}),(0,I.jsx)(`span`,{className:`text-ink-muted text-[10px] leading-none select-none`,children:`|`}),(0,I.jsx)(`span`,{className:`text-ink-muted text-[9px] leading-none`,children:`by`}),(0,I.jsxs)(`svg`,{width:`46`,height:`9`,viewBox:`0 0 819.12 159.36`,"aria-label":`New Relic`,fill:`currentColor`,className:`text-ink-subtle flex-shrink-0`,children:[(0,I.jsx)(`polygon`,{points:`68.85 .18 8.05 35.28 34.54 50.57 68.85 30.76 111.21 55.22 111.21 104.14 76.9 123.95 76.9 154.53 137.7 119.43 137.7 39.93 68.85 .18`}),(0,I.jsx)(`polygon`,{points:`42.36 94.97 42.36 143.89 68.85 159.18 68.85 79.68 0 39.93 0 70.51 42.36 94.97`}),(0,I.jsx)(`path`,{d:`M232.21,39.81c-14.82,0-21.84,9.36-21.84,9.36h-.78l-1.56-7.8h-17.94v79.57h19.5v-46.03c0-10.14,7.02-17.16,17.16-17.16s17.16,7.02,17.16,17.16v46.03h19.5v-47.59c0-20.28-13.26-33.55-31.21-33.55Z`}),(0,I.jsx)(`polygon`,{points:`442.54 93.64 441.42 93.64 428.15 41.38 408.31 41.38 395.05 93.64 393.93 93.64 380.67 41.38 360.39 41.38 380.67 120.95 404.41 120.95 417.67 69.46 418.79 69.46 432.06 120.95 455.8 120.95 476.08 41.38 455.8 41.38 442.54 93.64`}),(0,I.jsx)(`path`,{d:`M535.8,48.4h-.78l-1.56-7.02h-16.38v79.57h19.5v-46.02c0-10.14,4.68-14.82,14.82-14.82h10.04v-18.72h-11.6c-9.36,0-14.04,7.02-14.04,7.02Z`}),(0,I.jsx)(`path`,{d:`M604.56,39.82c-23.4,0-40.56,17.16-40.56,41.34s16.19,41.34,40.56,41.34c19.73,0,31.61-11.61,36.56-20.15l-17.9-6.38c-1.78,3.24-8.91,9.47-18.66,9.47-11.37,0-19.5-7.12-21.06-18.04h59.29s.78-3.12.78-7.8c0-22.62-17.16-39.78-39-39.78ZM583.5,74.14c2.34-10.14,9.36-17.94,21.06-17.94,10.92,0,17.94,7.8,19.5,17.94h-40.56Z`}),(0,I.jsx)(`path`,{d:`M316.44,39.82c-23.4,0-40.56,17.16-40.56,41.34s16.19,41.34,40.56,41.34c19.73,0,31.61-11.61,36.56-20.15l-17.9-6.38c-1.78,3.24-8.91,9.47-18.66,9.47-11.37,0-19.5-7.12-21.06-18.04h59.29s.78-3.12.78-7.8c0-22.62-17.16-39.78-39-39.78ZM295.38,74.14c2.34-10.14,9.36-17.94,21.06-17.94,10.92,0,17.94,7.8,19.5,17.94h-40.56Z`}),(0,I.jsx)(`rect`,{x:`692.24`,y:`9.96`,width:`19.5`,height:`19.5`}),(0,I.jsx)(`path`,{d:`M765.56,104.56c-11.7,0-21.06-9.36-21.06-23.4s9.36-23.4,21.06-23.4,16.38,7.8,17.94,12.48l17.66-6.28c-4.27-11.11-14.77-24.14-35.6-24.14-23.4,0-40.56,17.16-40.56,41.34s17.16,41.34,40.56,41.34c21,0,31.5-13.25,35.71-24.88l-17.77-6.32c-1.56,5.46-6.24,13.26-17.94,13.26Z`}),(0,I.jsx)(`polygon`,{points:`645.72 27.3 656.79 27.3 656.79 120.95 676.3 120.95 676.3 9.96 645.72 9.96 645.72 27.3`}),(0,I.jsx)(`rect`,{x:`692.24`,y:`41.38`,width:`19.5`,height:`79.57`}),(0,I.jsx)(`path`,{d:`M811.7,105.65c-4.28,0-7.42,3.24-7.42,7.52s3.13,7.52,7.42,7.52,7.42-3.24,7.42-7.52-3.13-7.52-7.42-7.52ZM811.7,119.54c-3.66,0-6.27-2.72-6.27-6.37s2.61-6.37,6.27-6.37,6.27,2.72,6.27,6.37-2.61,6.37-6.27,6.37Z`}),(0,I.jsx)(`path`,{d:`M814.94,111.81c0-1.46-1.15-2.61-2.82-2.61h-3.34v7.83h1.15v-2.72h1.04l2.72,2.72h1.46l-2.72-2.72c1.46-.1,2.51-1.15,2.51-2.51ZM809.93,113.17v-2.82h2.19c1.04,0,1.67.63,1.67,1.46s-.52,1.36-1.67,1.36h-2.19Z`})]})]}),(0,I.jsx)(`div`,{className:`text-ink-muted text-[10px] tracking-wide mb-6`,children:`local · single-user`}),(0,I.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Observe`}),(0,I.jsx)(`nav`,{"aria-label":`Observe`,className:`flex flex-col gap-0.5 mb-4`,children:ei.map(e=>c(e))}),(0,I.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Analyze`}),(0,I.jsx)(`nav`,{"aria-label":`Analyze`,className:`flex flex-col gap-0.5 mb-4`,children:ti.map(e=>c(e))}),(0,I.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Configure`}),(0,I.jsx)(`nav`,{"aria-label":`Configure`,className:`flex flex-col gap-0.5`,children:ni.map(e=>c(e))}),(0,I.jsxs)(`div`,{className:`mt-auto`,children:[(0,I.jsxs)(`a`,{href:`https://newrelic.com/platform/ai-observability`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 px-2.5 py-2 rounded-md text-ink-subtle border border-accent-green/20 bg-accent-green/5 hover:bg-accent-green/10 hover:border-accent-green/50 hover:text-ink-base hover:shadow-[0_0_8px_rgba(28,231,131,0.35),0_0_20px_rgba(28,231,131,0.15)] transition-all duration-300 group/cta mb-2`,children:[(0,I.jsxs)(`svg`,{width:`11`,height:`13`,viewBox:`0 0 138 160`,fill:`currentColor`,"aria-hidden":`true`,className:`flex-shrink-0 text-accent-green opacity-75 group-hover/cta:opacity-100 transition-opacity`,children:[(0,I.jsx)(`polygon`,{points:`68.85 .18 8.05 35.28 34.54 50.57 68.85 30.76 111.21 55.22 111.21 104.14 76.9 123.95 76.9 154.53 137.7 119.43 137.7 39.93 68.85 .18`}),(0,I.jsx)(`polygon`,{points:`42.36 94.97 42.36 143.89 68.85 159.18 68.85 79.68 0 39.93 0 70.51 42.36 94.97`})]}),(0,I.jsx)(`span`,{className:`text-xs flex-1 leading-tight`,children:`Try AI Observability`}),(0,I.jsxs)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`flex-shrink-0 opacity-50 group-hover/cta:opacity-80 transition-opacity`,children:[(0,I.jsx)(`polyline`,{points:`15 3 21 3 21 9`}),(0,I.jsx)(`line`,{x1:`10`,y1:`14`,x2:`21`,y2:`3`})]})]}),(0,I.jsx)(`div`,{className:`pt-3 border-t border-border-subtle`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1.5 rounded-md bg-surface-3 transition-colors duration-150`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`span`,{className:`w-2 h-2 rounded-full ${n?`bg-accent-green animate-pulse`:`bg-accent-amber`}`}),(0,I.jsx)(`span`,{className:`text-[10px] text-ink-subtle tracking-wide`,children:n?`live`:`reconnecting`})]}),(0,I.jsx)(Ur,{variant:`ghost`,size:`sm`,onClick:i,"aria-label":r===`dark`?`Switch to light mode`:`Switch to dark mode`,className:`px-1 py-1`,children:r===`dark`?(0,I.jsx)(An,{size:12}):(0,I.jsx)(Dn,{size:12})})]})}),s.installed!==null&&(0,I.jsxs)(`div`,{className:`mt-2 px-2 flex items-center gap-1.5`,children:[(0,I.jsxs)(`span`,{className:`text-[10px] text-ink-muted`,children:[`v`,s.installed]}),(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted`,"aria-hidden":`true`,children:`·`}),(0,I.jsxs)(`a`,{href:`https://github.com/newrelic-experimental/preflight`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View Preflight on GitHub`,className:`text-[10px] text-ink-subtle hover:text-ink-base transition-colors duration-150 flex items-center gap-0.5`,children:[`GitHub`,(0,I.jsx)(Cn,{size:8,"aria-hidden":`true`})]})]}),s.updateAvailable&&s.latest!==null&&(0,I.jsx)(`div`,{className:`mt-0.5 px-2`,children:(0,I.jsxs)(`span`,{className:`text-[10px] text-accent-amber`,children:[`v`,s.latest,` available`]})})]})]})}function ai(e,t=.8,n=.5){return e===null?`text-ink-muted`:e>=t?`text-accent-green`:e>=n?`text-accent-amber`:`text-accent-red`}function oi(e){return e>=.8?`text-accent-cyan`:e>=.5?`text-accent-amber`:`text-accent-red`}function si(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function ci(e){return new Date(e).toLocaleString(void 0,{hour:`numeric`,minute:`2-digit`})}function li(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}function ui(e){if(!Number.isFinite(e)||e<0)return`—`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60){let e=t%60;return e>0?`${n}m ${e}s`:`${n}m`}let r=Math.floor(n/60);if(r<24){let e=n%60;return e>0?`${r}h ${e}m`:`${r}h`}let i=Math.floor(r/24),a=r%24;return a>0?`${i}d ${a}h`:`${i}d`}function di(e){return Number.isFinite(e)?Math.abs(e)>=100?e.toFixed(0):Math.abs(e)>=10?e.toFixed(1):Number.isInteger(e)?String(e):e.toFixed(2):`—`}function fi(e){if(!Number.isFinite(e))return`$0.00`;let t=Math.abs(e)>0&&Math.abs(e)<1?4:2;return`$${e.toFixed(t)}`}function pi(e){return e==null||!Number.isFinite(e)?`—`:fi(e)}function mi(e){if(!Number.isFinite(e))return`—`;let t=Math.abs(e);return t>=1e6?`${(e/1e6).toFixed(1)}M`:t>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function hi(e){let t=e.split(`__`);return t.length>=3&&t[0]===`mcp`?t.slice(2).join(`__`):e}var gi={info:`bg-surface-3 border-surface-8`,warning:`bg-accent-amber/5 border-accent-amber/40`,critical:`bg-accent-red/5 border-accent-red/50`},_i={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},vi={info:`INFO`,warning:`WARN`,critical:`CRIT`};function yi(e){return e===`critical`?`alert`:`status`}function bi({alert:e,onDismiss:t}){let n=n=>{n.key===`Escape`&&(n.preventDefault(),t(e.id))},r=`alert-title-${String(e.id).replace(/[^a-zA-Z0-9-_]/g,`_`)}`;return(0,I.jsxs)(`div`,{role:yi(e.severity),"aria-labelledby":r,tabIndex:0,"data-alert-id":e.id,"data-severity":e.severity,onKeyDown:n,className:`flex items-center gap-3 px-3 py-2 border-b text-xs focus:outline-none focus:ring-2 focus:ring-accent-cyan/40 ${gi[e.severity]}`,children:[(0,I.jsxs)(`span`,{"aria-hidden":`true`,className:`shrink-0 font-semibold tracking-wider ${_i[e.severity]}`,children:[`● `,vi[e.severity]]}),(0,I.jsx)(`span`,{id:r,className:`font-medium text-ink-base shrink-0`,children:e.title}),(0,I.jsx)(`span`,{className:`text-ink-muted truncate`,children:e.description}),(0,I.jsxs)(`span`,{className:`ml-auto shrink-0 text-ink-subtle tabular-nums whitespace-nowrap`,children:[di(e.value),` / `,di(e.threshold)]}),(0,I.jsx)(`button`,{type:`button`,"aria-label":`Dismiss alert`,onClick:()=>t(e.id),className:`shrink-0 ml-1 p-1 rounded-md text-ink-subtle hover:text-ink-base hover:bg-surface-5 transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:(0,I.jsx)(Mn,{size:14,"aria-hidden":`true`,focusable:`false`})})]})}var xi=5,Si={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},Ci={info:`border-bg-line`,warning:`border-accent-amber/50`,critical:`border-accent-red/60`};function wi(){let{alerts:e,maxSeverity:t,count:n,dismiss:r}=er(),[i,a]=(0,F.useState)(!1);if((0,F.useEffect)(()=>{n<xi&&a(!1)},[n]),n===0)return null;let o=n>=xi&&!i,s=t??`info`;return o?(0,I.jsx)(`div`,{className:`bg-bg-panel border-b`,"data-collapsed-stack":`true`,children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>a(!0),"aria-expanded":`false`,"aria-label":`${n} alerts firing — expand`,className:`w-full flex items-center gap-2 px-3 py-2 text-xs text-left border-b ${Ci[s]} transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:[(0,I.jsx)(yn,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,I.jsxs)(`span`,{className:`font-semibold ${Si[s]}`,children:[`● `,n,` alerts firing`]}),(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`— click to expand`})]})}):(0,I.jsxs)(`div`,{"data-stack":`true`,children:[n>=xi&&(0,I.jsxs)(`button`,{type:`button`,onClick:()=>a(!1),"aria-expanded":`true`,"aria-label":`${n} alerts firing — collapse`,className:`w-full flex items-center gap-2 px-3 py-2 text-xs text-left bg-bg-panel border-b ${Ci[s]} transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:[(0,I.jsx)(vn,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,I.jsxs)(`span`,{className:`font-semibold ${Si[s]}`,children:[`● `,n,` alerts firing`]}),(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`— click to collapse`})]}),e.map(e=>(0,I.jsx)(bi,{alert:e,onDismiss:r},e.id))]})}var Ti=class extends F.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught a render error`,{error:e,info:t})}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}handleReload=()=>{window.location.reload()};handleDismiss=()=>{this.setState({error:null})};render(){let{error:e}=this.state;return e?(0,I.jsx)(`div`,{role:`alert`,className:`flex justify-center p-8`,children:(0,I.jsx)(`div`,{className:`max-w-2xl w-full`,children:(0,I.jsxs)(B,{padding:`lg`,tone:`danger`,className:`space-y-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-accent-red font-semibold uppercase text-xs tracking-wider mb-1`,children:`Render error`}),(0,I.jsx)(`div`,{className:`text-ink-base text-base font-mono break-all`,children:e.message})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(Ur,{variant:`secondary`,size:`md`,onClick:this.handleReload,children:`Reload page`}),(0,I.jsx)(Ur,{variant:`ghost`,size:`md`,onClick:this.handleDismiss,children:`Dismiss`})]}),e.stack&&(0,I.jsxs)(`details`,{className:`text-xs text-ink-muted`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer select-none`,children:`Stack trace`}),(0,I.jsx)(`pre`,{className:`mt-2 p-2 bg-bg-line/30 rounded overflow-x-auto whitespace-pre-wrap break-all`,children:e.stack})]})]})})}):this.props.children}},Ei=[{keys:[`?`],description:`Show this help`},{keys:[`t`],description:`Toggle light/dark mode`},{keys:[`g`,`h`],description:`Go to Today`},{keys:[`g`,`s`],description:`Go to Sessions`},{keys:[`g`,`i`],description:`Go to History`},{keys:[`g`,`a`],description:`Go to Audit`},{keys:[`g`,`v`],description:`Go to Git Efficiency`},{keys:[`g`,`e`],description:`Go to Settings`},{keys:[`g`,`l`],description:`Go to Alerts`},{keys:[`Esc`],description:`Close overlay`}];function Di({open:e,onClose:t}){return(0,F.useEffect)(()=>{if(!e)return;function n(e){e.key===`Escape`&&(e.preventDefault(),t())}return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),e?(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:t,children:(0,I.jsxs)(`div`,{className:`glass-card animate-overlay-enter max-w-sm w-full mx-4 p-5`,onClick:e=>e.stopPropagation(),children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-semibold text-ink-base`,children:`Keyboard Shortcuts`}),(0,I.jsx)(Ur,{variant:`ghost`,size:`sm`,onClick:t,"aria-label":`Close keyboard shortcuts`,className:`px-1 py-1`,children:(0,I.jsx)(Mn,{size:16})})]}),(0,I.jsx)(`div`,{className:`space-y-2`,children:Ei.map(e=>(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,I.jsx)(`span`,{className:`text-ink-subtle`,children:e.description}),(0,I.jsx)(`span`,{className:`flex gap-1`,children:e.keys.map(e=>(0,I.jsx)(`kbd`,{className:`inline-block px-1.5 py-0.5 text-[11px] font-mono bg-bg-elevated rounded-md border border-border-subtle text-ink-base`,children:e},e))})]},e.description))})]})}):null}var Oi=75e3,ki=1e4;function Ai(e){let t=Jn.getState();fetch(`/api/session/current`,{signal:e}).then(e=>e.ok?e.json():null).then(e=>{if(e?.toolCallTimeline)for(let n of e.toolCallTimeline)t.pushToolCall({id:`${n.timestamp}-${n.toolName}`,tool:n.toolName,durationMs:n.durationMs??0,costUsd:0,ts:n.timestamp,sessionId:e.sessionId})}).catch(()=>{}),fetch(`/api/anti-patterns`,{signal:e}).then(e=>e.ok?e.json():null).then(e=>{if(Array.isArray(e))for(let n of e)n&&typeof n==`object`&&`type`in n&&t.pushAntiPattern({type:n.type,target:n.file??n.command??`unknown`,count:n.iterations??n.readCount??n.repeatCount??n.editCount??n.agentCount??0})}).catch(()=>{})}function ji(e=`/sse`){(0,F.useEffect)(()=>{let t=new AbortController;Ai(t.signal);let n=Date.now(),r=null,i=()=>{r||t.signal.aborted||(r=new EventSource(e),r.onopen=()=>{n=Date.now(),Jn.getState().setConnected(!0)},r.onerror=()=>Jn.getState().setConnected(!1),r.addEventListener(`tool-call`,a),r.addEventListener(`cost-update`,o),r.addEventListener(`anti-pattern`,s),r.addEventListener(`alert`,c),r.addEventListener(`context-update`,l),r.addEventListener(`heartbeat`,u))},a=e=>{try{Jn.getState().pushToolCall(JSON.parse(e.data))}catch{}},o=e=>{try{Jn.getState().setCost(JSON.parse(e.data))}catch{}},s=e=>{try{Jn.getState().pushAntiPattern(JSON.parse(e.data))}catch{}},c=e=>{try{Jn.getState().addOrUpdateAlert(JSON.parse(e.data))}catch{}},l=e=>{try{Jn.getState().setContext(JSON.parse(e.data))}catch{}},u=()=>{n=Date.now();let e=Jn.getState();e.connected||e.setConnected(!0)};typeof document<`u`&&document.readyState===`complete`?i():typeof window<`u`?window.addEventListener(`load`,i,{once:!0}):i();let d=setInterval(()=>{if(Date.now()-n>Oi){let e=Jn.getState();e.connected&&e.setConnected(!1)}},ki);return()=>{t.abort(),clearInterval(d),typeof window<`u`&&window.removeEventListener(`load`,i),r&&(r.removeEventListener(`tool-call`,a),r.removeEventListener(`cost-update`,o),r.removeEventListener(`anti-pattern`,s),r.removeEventListener(`alert`,c),r.removeEventListener(`context-update`,l),r.removeEventListener(`heartbeat`,u),r.close())}},[e])}function H({navigate:e,onToggleHelp:t,onToggleTheme:n}){let r=(0,F.useRef)(null),i=(0,F.useRef)(null);(0,F.useEffect)(()=>{function a(a){let o=a.target?.tagName;if(o===`INPUT`||o===`TEXTAREA`||o===`SELECT`||a.target?.isContentEditable||a.metaKey||a.ctrlKey||a.altKey)return;let s=a.key;if(r.current===`g`){if(s===`g`){i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=null},500);return}r.current=null,i.current&&=(clearTimeout(i.current),null);let t={h:`/`,s:`/sessions`,i:`/history`,a:`/audit`,v:`/git`,e:`/settings`,l:`/alerts`};t[s]&&(a.preventDefault(),e(t[s]));return}if(s===`g`){r.current=`g`,i.current=setTimeout(()=>{r.current=null},500);return}s===`?`&&(a.preventDefault(),t()),s===`t`&&n&&(a.preventDefault(),n())}return document.addEventListener(`keydown`,a),()=>{document.removeEventListener(`keydown`,a),i.current&&clearTimeout(i.current)}},[e,t,n])}var Mi=`preflight-theme`;function Ni(){try{let e=localStorage.getItem(Mi);if(e===`light`||e===`dark`)return e}catch{}try{if(window.matchMedia(`(prefers-color-scheme: light)`).matches)return`light`}catch{}return`dark`}function Pi(e){document.documentElement.classList.toggle(`light`,e===`light`)}function Fi(){let[e,t]=(0,F.useState)(Ni),n=(0,F.useRef)(!1);return(0,F.useLayoutEffect)(()=>{Pi(e)},[e]),(0,F.useEffect)(()=>{if(!n.current){n.current=!0;return}try{localStorage.setItem(Mi,e)}catch{}},[e]),{theme:e,toggleTheme:(0,F.useCallback)(()=>{t(e=>e===`dark`?`light`:`dark`)},[])}}function Ii(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Li(e,t={}){let{duration:n=800,decimals:r=0,enabled:i=!0,format:a}=t,o=i&&Ii(),[s,c]=(0,F.useState)(()=>o?0:e),l=(0,F.useRef)(0);return(0,F.useEffect)(()=>{if(!o){c(e);return}let t=performance.now();function r(i){let a=i-t,o=Math.min(a/n,1),s=1-(1-o)**3;c(s*e),o<1&&(l.current=requestAnimationFrame(r))}return l.current=requestAnimationFrame(r),()=>{l.current&&cancelAnimationFrame(l.current)}},[e,n,o]),a?a(s):s.toFixed(r)}var Ri={neutral:`text-ink-base`,good:`text-accent-green`,warn:`text-accent-amber`,bad:`text-accent-red`};function U({label:e,value:t,sub:n,tone:r=`neutral`,hero:i=!1,animate:a=!1,numericValue:o,prefix:s=``,suffix:c=``,decimals:l=0,format:u}){let d=Li(o??0,{decimals:l,enabled:a&&o!==void 0,format:u}),f=a&&o!==void 0?u?d:`${s}${d}${c}`:t,p=i?`text-3xl font-bold mt-1 tabular-nums gradient-text`:`text-3xl font-bold mt-1 tabular-nums ${Ri[r]}`;return(0,I.jsxs)(`div`,{className:`px-1`,children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider font-medium`,children:e}),(0,I.jsx)(`div`,{className:p,children:f}),n&&(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted mt-0.5`,children:n})]})}function zi({children:e,index:t=0,className:n=``}){let r=`${t*120}ms`;return(0,I.jsx)(`div`,{className:`animate-card-enter ${n}`,style:{animationDelay:r},children:e})}var Bi=6,Vi=5,Hi=[.01,.02,.05,.1,.25,.5,1,2,5,10,25,50,100,250,500,1e3];function Ui(e){if(e<=0)return .01;for(let t of Hi)if(t>=e)return t;return Hi[Hi.length-1]}function Wi(e){return e===0?`12am`:e<12?`${e}am`:e===12?`12pm`:`${e-12}pm`}function Gi(e){let t=e.reduce((e,t)=>e+t.cost,0),n=e.reduce((e,t)=>Math.max(e,t.cost),0),r=e.find(e=>e.cost===n);return r===void 0||n===0?`Hourly spend today: no activity yet.`:`Hourly spend today: ${fi(t)} total, peak ${fi(n)} at ${Wi(r.hour)}`}function Ki({hours:e,formatValue:t,ariaLabel:n}){let[r,i]=(0,F.useState)(null),a=e.reduce((e,t)=>Math.max(e,t.cost),0);if(a===0)return null;let o=Ui(a/Vi),s=e.map(e=>Math.max(0,Math.round(e.cost/o))),c=s.reduce((e,t)=>Math.max(e,t),0);if(c===0)return null;let l=c*7,u=t??(e=>fi(e)),d=n??Gi(e),f=r===null?null:e[r],p=f?`${Wi(f.hour)}: ${u(f.cost)} (start hour)`:``,m=r===null?0:(r+.5)/e.length*100;return(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`div`,{role:`img`,"aria-label":d,className:`flex w-full`,style:{height:l},onMouseLeave:()=>i(null),children:e.map((e,t)=>{let n=s[t],r=e.cost>0&&e.cost===a,o=[];for(let e=0;e<n;e++)o.push((0,I.jsx)(`span`,{className:`absolute rounded-sm heatmap-cell`,style:{bottom:e*7,left:`50%`,marginLeft:-6/2,width:Bi,height:Bi,backgroundColor:r?`var(--color-chart-block-peak)`:`var(--color-chart-block)`,animationDelay:`${t*12+e*6}ms`}},e));return(0,I.jsx)(`div`,{className:`relative flex-1 h-full`,onMouseEnter:()=>i(t),children:o},t)})}),f&&(0,I.jsx)(`div`,{className:`absolute -top-7 px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:`${m}%`,transform:`translateX(-50%)`},role:`tooltip`,children:p})]})}function qi(){return(0,I.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`13`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`6`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,I.jsx)(`line`,{x1:`24`,y1:`24`,x2:`24`,y2:`4`,stroke:`var(--color-accent-green)`,strokeWidth:`1.5`,strokeLinecap:`round`,className:`animate-radar-sweep`}),(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`2`,fill:`var(--color-accent-green)`})]})}function Ji(){return(0,I.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{d:`M16 14 L6 24 L16 34`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`path`,{d:`M32 14 L42 24 L32 34`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`line`,{x1:`24`,y1:`18`,x2:`24`,y2:`30`,stroke:`var(--color-accent-green)`,strokeWidth:`2`,strokeLinecap:`round`,opacity:`0.8`})]})}function Yi(){return(0,I.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`line`,{x1:`4`,y1:`24`,x2:`44`,y2:`24`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.4`}),(0,I.jsx)(`circle`,{cx:`12`,cy:`24`,r:`3`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`}),(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`3`,stroke:`var(--color-accent-green)`,strokeWidth:`1.5`}),(0,I.jsx)(`circle`,{cx:`36`,cy:`24`,r:`3`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`}),(0,I.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12`,y2:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.5`}),(0,I.jsx)(`line`,{x1:`24`,y1:`16`,x2:`24`,y2:`20`,stroke:`var(--color-accent-green)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.7`}),(0,I.jsx)(`line`,{x1:`36`,y1:`16`,x2:`36`,y2:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.5`})]})}function Xi(){return(0,I.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`18`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,I.jsx)(`path`,{d:`M16 24 L22 30 L34 18`,stroke:`var(--color-accent-green)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Zi(){return(0,I.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`24`,cy:`24`,r:`18`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,I.jsx)(`path`,{d:`M24 14 L24 24 L31 28`,stroke:`var(--color-ink-subtle)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}var Qi={radar:qi,code:Ji,timeline:Yi,checkmark:Xi,clock:Zi};function $i(){return(0,I.jsx)(`div`,{className:`flex items-center justify-center`,style:{width:48,height:48},"aria-hidden":`true`,children:(0,I.jsx)(`span`,{className:`rounded-full animate-pulse`,style:{width:10,height:10,backgroundColor:`var(--color-accent-green)`,boxShadow:`0 0 0 4px color-mix(in srgb, var(--color-accent-green) 15%, transparent)`}})})}function ea({icon:e,title:t,subtitle:n,variant:r=`empty`}){let i=e===void 0?void 0:Qi[e];return(0,I.jsxs)(`div`,{className:`py-8 flex flex-col items-center justify-center gap-3`,children:[r===`loading`?(0,I.jsx)($i,{}):i&&(0,I.jsx)(i,{}),(0,I.jsx)(`span`,{className:`text-sm font-medium text-ink-subtle`,children:t}),n&&(0,I.jsx)(`span`,{className:`text-xs text-ink-muted text-center max-w-[240px]`,children:n})]})}function ta(e){return e===`Read`?`bg-accent-blue`:e===`Edit`||e===`Write`?`bg-accent-green`:e===`Bash`?`bg-accent-purple`:e===`Agent`?`bg-accent-teal`:`bg-ink-subtle`}var na={thrashing:`Edit/Test Thrashing`,stuck_loop:`Stuck Loop`,blind_editing:`Blind Editing`,re_reading:`Repeated Reads`};function ra(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}function ia({entries:e,segments:t,windowStartMs:n,windowEndMs:r,showTicks:i=!0,gutterClass:a=`w-24`}){let[o,s]=(0,F.useState)(null),c=(0,F.useMemo)(()=>e.map((e,t)=>({entry:e,originalIdx:t})).sort((e,t)=>e.entry.timestamp-t.entry.timestamp),[e]),l=(0,F.useMemo)(()=>{let n=new Map;for(let e=0;e<c.length;e++)n.set(c[e].originalIdx,e);let r=Array(c.length).fill(null);for(let i of t){let t=Math.max(0,i.startIndex),a=Math.min(i.endIndex,e.length-1);for(let e=t;e<=a;e++){let t=n.get(e);t!==void 0&&(r[t]===null||i.severity===`critical`&&r[t].severity!==`critical`)&&(r[t]=i)}}return r},[c,t,e.length]);if(e.length===0)return(0,I.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No tool calls recorded.`});let u=n!==void 0&&r!==void 0,d=u?n:c[0].entry.timestamp,f=c.reduce((e,{entry:t})=>Math.max(e,t.timestamp+(t.durationMs??50)),0),p=Math.max(u?r-n:f-d,1),m=[1e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5].find(e=>p/e<=8)??Math.ceil(p/8),h=[];for(let e=m;e<p;e+=m)h.push(e);let g=Math.min(30,800/Math.max(e.length,1));return(0,I.jsxs)(`div`,{className:`p-2 overflow-x-hidden`,children:[i&&(0,I.jsxs)(`div`,{className:`flex`,children:[(0,I.jsx)(`div`,{className:`${a} shrink-0`}),(0,I.jsx)(`div`,{className:`relative flex-1 h-5 border-b border-bg-line overflow-x-auto`,children:h.map(e=>(0,I.jsx)(`span`,{className:`absolute top-0 text-[9px] text-ink-muted tabular-nums -translate-x-1/2`,style:{left:`${e/p*100}%`},children:ra(e)},e))})]}),(0,I.jsx)(`div`,{className:i?`mt-1`:``,children:c.map(({entry:e,originalIdx:t},n)=>{let r=e.timestamp-d,i=e.durationMs??50,u=r/p*100,f=i/p*100,m=l[n];return(0,I.jsxs)(`div`,{className:`flex items-center h-7 ${m?m.severity===`critical`?`border-l-2 border-l-accent-red`:`border-l-2 border-l-accent-amber`:`border-l-2 border-l-transparent`}`,children:[(0,I.jsx)(`div`,{className:`${a} shrink-0 truncate text-[11px] text-ink-subtle pr-2 text-right`,title:e.toolName,children:hi(e.toolName)}),(0,I.jsxs)(`div`,{className:`relative flex-1 h-full flex items-center`,children:[(0,I.jsx)(`div`,{role:`img`,"aria-label":`${e.toolName} · ${e.durationMs==null?`unknown`:`${e.durationMs}ms`} · ${e.success?`success`:`failed`}`,className:`gantt-bar absolute h-5 rounded-sm opacity-80 ${ta(hi(e.toolName))} ${e.success?``:`ring-1 ring-accent-red/60`}`,style:{left:`${u}%`,width:`${f}%`,minWidth:`4px`,animationDelay:`${Math.round(n*g)}ms`},onMouseEnter:()=>s(n),onMouseLeave:()=>s(null)}),o===n&&(0,I.jsxs)(`div`,{className:`absolute z-50 px-2 py-1.5 rounded-lg bg-bg-elevated border border-bg-line text-[11px] text-ink-base shadow-lg whitespace-nowrap pointer-events-none ${n>=3&&n>c.length-4?`bottom-full mb-1`:`top-full mt-1`}`,style:u>=50?{right:`${Math.max(0,100-u-f)}%`}:{left:`${u}%`},children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.toolName}),(e.filePath??e.command)&&(0,I.jsx)(`div`,{className:`text-ink-subtle truncate max-w-[200px]`,children:e.filePath??e.command}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[e.durationMs==null?`unknown`:`${e.durationMs}ms`,` ·`,` `,e.success?`success`:`failed`]}),m&&(0,I.jsx)(`div`,{className:`mt-0.5 font-medium ${m.severity===`critical`?`text-accent-red`:`text-accent-amber`}`,children:na[m.type]??m.type})]})]})]},`${t}-${e.timestamp}`)})})]})}function aa(e){let t=new Map;for(let n of e){let e=n.workflowRunId,r=t.get(e);r?r.push(n):t.set(e,[n])}let n=[];for(let[e,r]of t){let t=[...r].sort((e,t)=>e.startMs-t.startMs),i=t.reduce((e,t)=>Math.min(e,t.startMs),1/0),a=e===null?`Ad-hoc subagents`:r[0]?.workflowName??`Workflow run`;n.push({runId:e,name:a,earliestStartMs:i,agents:t})}return n.sort((e,t)=>e.earliestStartMs-t.earliestStartMs),n}var oa=[`bg-series-1`,`bg-series-2`,`bg-series-3`,`bg-series-4`,`bg-series-5`,`bg-series-6`],sa=`__parent__`,ca=`__adhoc__`;function la(e){return e===null?ca:`run:${e}`}function ua(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}var da=15,fa=`w-44`;function pa({status:e}){return e===`completed`?(0,I.jsx)(bn,{size:12,className:`shrink-0 text-accent-green`,"aria-label":`completed`,role:`img`}):e===`failed`?(0,I.jsx)(xn,{size:12,className:`shrink-0 text-accent-red`,"aria-label":`failed`,role:`img`}):e===`running`?(0,I.jsx)(En,{size:12,className:`shrink-0 text-accent-cyan animate-spin`,"aria-label":`running`,role:`img`}):e===`cancelled`?(0,I.jsx)(Sn,{size:12,className:`shrink-0 text-accent-amber`,"aria-label":`cancelled`,role:`img`}):null}function ma({sessionId:e,parentEntries:t,agents:n,window:r,onSelectRun:i,runStatusById:a,parentSegments:o}){let[s,c]=(0,F.useState)(`gantt`),l=(0,F.useMemo)(()=>aa(n),[n]),u=(0,F.useMemo)(()=>{let e=[];t.length>0&&e.push(sa);for(let t of l)e.push(la(t.runId));return e},[l,t.length]),d=(0,F.useMemo)(()=>n.map(e=>e.agentId),[n]),[f,p]=(0,F.useState)(()=>{let e=new Set;for(let t of l)t.agents.length>da&&e.add(la(t.runId));return e}),[m,h]=(0,F.useState)(()=>new Set),g=e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},_=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},v=e=>{e===`collapsed`?(p(new Set(u)),h(new Set)):e===`agents`?(p(t.length>0?new Set([sa]):new Set),h(new Set)):(p(new Set),h(new Set(d)))},y=(0,F.useMemo)(()=>{let e=t.length>0,n=u.filter(e=>e!==sa),r=!e||f.has(`__parent__`),i=f.size===0,a=u.length>0&&u.every(e=>f.has(e)),o=n.every(e=>!f.has(e)),s=m.size===0,c=d.length>0?d.every(e=>m.has(e)):m.size===0;return a&&s?`collapsed`:i&&c?`expanded`:r&&o&&s?`agents`:null},[f,m,u,d,t.length]),b=t.length,x=(0,F.useMemo)(()=>[...t],[t]);return t.length===0&&n.length===0?(0,I.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No activity recorded.`}):(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(Qr,{value:s,onChange:c,options:[{value:`gantt`,label:`Gantt`},{value:`list`,label:`List`}],size:`sm`,tone:`green`,ariaLabel:`Session trace view mode`}),(0,I.jsx)(`div`,{className:`h-4 w-px bg-border-subtle`,"aria-hidden":`true`}),(0,I.jsx)(ha,{active:y,onSelect:v})]}),(0,I.jsxs)(`span`,{className:`text-[10px] uppercase tracking-wider text-ink-muted tabular-nums`,children:[b,` parent call`,b===1?``:`s`,` · `,n.length,` agent`,n.length===1?``:`s`]})]}),s===`gantt`?(0,I.jsx)(_a,{parentRows:x,groups:l,window:r,sessionId:e,onSelectRun:i,runStatusById:a,parentSegments:o,collapsedGroups:f,toggleGroup:g,expandedAgents:m,toggleAgent:_}):(0,I.jsx)(xa,{parentRows:x,groups:l,window:r,sessionId:e,onSelectRun:i,runStatusById:a,collapsedGroups:f,toggleGroup:g,expandedAgents:m,toggleAgent:_})]})}function ha({active:e,onSelect:t}){return(0,I.jsx)(`div`,{role:`group`,"aria-label":`Trace expand level`,className:`inline-flex items-center gap-1`,children:[{value:`collapsed`,label:`Collapsed`},{value:`agents`,label:`Agents`},{value:`expanded`,label:`Expand all`}].map(n=>{let r=e===n.value;return(0,I.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>t(n.value),className:`px-2 py-0.5 text-[10px] rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 `+(r?`bg-accent-cyan/20 text-accent-cyan font-medium`:`text-ink-muted hover:text-ink-subtle`),children:n.label},n.value)})})}function ga({window:e}){let t=Math.max(e.endMs-e.startMs,1),n=(0,F.useMemo)(()=>{let e=[1e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5].find(e=>t/e<=8)??Math.ceil(t/8),n=[];for(let r=e;r<t;r+=e)n.push(r);return n},[t]);return(0,I.jsxs)(`div`,{className:`flex px-2`,children:[(0,I.jsx)(`div`,{className:`${fa} shrink-0`}),(0,I.jsx)(`div`,{className:`relative flex-1 h-5 border-b border-bg-line overflow-x-auto`,children:n.map(e=>(0,I.jsx)(`span`,{className:`absolute top-0 text-[9px] text-ink-muted tabular-nums -translate-x-1/2`,style:{left:`${e/t*100}%`},children:ua(e)},e))})]})}function _a({parentRows:e,groups:t,window:n,sessionId:r,onSelectRun:i,runStatusById:a,parentSegments:o,collapsedGroups:s,toggleGroup:c,expandedAgents:l,toggleAgent:u}){let d=s.has(sa),f=e.length>0;return(0,I.jsxs)(`div`,{className:`overflow-x-hidden`,children:[(0,I.jsx)(ga,{window:n}),f&&(0,I.jsxs)(`div`,{className:`mb-2 mt-1`,children:[(0,I.jsx)(Ea,{collapsed:d,onToggle:()=>c(`__parent__`),label:`Parent`,count:`${e.length} tool call${e.length===1?``:`s`}`}),!d&&(0,I.jsx)(ia,{entries:e,segments:o?[...o]:[],windowStartMs:n.startMs,windowEndMs:n.endMs,showTicks:!1,gutterClass:fa})]}),t.map((e,t)=>{let o=oa[t%oa.length],d=la(e.runId),f=s.has(d),p=e.runId===null?void 0:a?.[e.runId],m=e.runId!==null&&i?()=>i(e.runId):void 0,h=e.agents.map(e=>e.usd).filter(e=>e!=null),g=h.length>0?h.reduce((e,t)=>e+t,0):null,_=e.agents.reduce((e,t)=>Math.max(e,t.endMs),0),v=_-e.earliestStartMs,y=`${e.agents.length} agent${e.agents.length===1?``:`s`} · ${pi(g)} · ${ua(Math.max(0,v))} span`;return(0,I.jsx)(`div`,{className:`mb-2`,children:f?(0,I.jsx)(va,{onToggle:()=>c(d),label:e.name,summary:y,barColor:o,window:n,startMs:e.earliestStartMs,endMs:_,status:p,onOpenRun:m}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Ea,{collapsed:!1,onToggle:()=>c(d),label:e.name,swatchColor:o,count:`${e.agents.length} agent${e.agents.length===1?``:`s`}`,status:p,onOpenRun:m}),e.agents.map(e=>(0,I.jsx)(ya,{agent:e,barColor:o,window:n,sessionId:r,onSelectRun:i,expanded:l.has(e.agentId),onToggle:()=>u(e.agentId)},e.agentId))]})},e.runId??`__adhoc__`)})]})}function va({onToggle:e,label:t,summary:n,barColor:r,window:i,startMs:a,endMs:o,status:s,onOpenRun:c}){let l=Math.max(i.endMs-i.startMs,1),u=a-i.startMs,d=Math.max(0,u/l*100),f=Math.max(0,o-a)/l*100,p=`${t} · ${n}`,m=s===`failed`,h=`absolute inset-y-0 my-auto h-4 rounded-sm opacity-85 ${r}`+(m?` ring-1 ring-accent-red/60`:``);return(0,I.jsxs)(`div`,{className:`flex items-center h-7 px-2`,children:[(0,I.jsxs)(`div`,{className:`${fa} shrink-0 flex items-center gap-1.5 pr-2`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:e,"aria-expanded":!1,className:`shrink-0 flex items-center gap-1.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,title:n,children:[(0,I.jsx)(yn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm shrink-0 ${r}`,"aria-hidden":`true`})]}),c?(0,I.jsx)(`span`,{role:`button`,tabIndex:0,title:`${t} · open run`,onClick:e=>{e.stopPropagation(),c()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),c())},className:`text-[11px] font-medium text-ink-subtle truncate cursor-pointer hover:text-accent-cyan hover:underline underline-offset-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:t}):(0,I.jsx)(`span`,{className:`text-[11px] font-medium text-ink-subtle truncate`,title:t,children:t}),(0,I.jsx)(pa,{status:s})]}),(0,I.jsx)(`div`,{className:`relative flex-1 h-full flex items-center`,children:(0,I.jsx)(`div`,{role:`img`,"aria-label":p,title:p,className:h,style:{left:`${d}%`,width:`${f}%`,minWidth:`4px`}})})]})}function ya({agent:e,barColor:t,window:n,sessionId:r,onSelectRun:i,expanded:a,onToggle:o}){let[s,c]=(0,F.useState)(!1),l=Math.max(n.endMs-n.startMs,1),u=e.startMs-n.startMs,d=Math.max(0,u/l*100),f=e.durationMs/l*100,p=e.workflowRunId!==null&&i!==void 0,m=e.workflowRunId,h=d>=50?{right:`${Math.max(0,100-d-f)}%`}:{left:`${d}%`},g=`${e.label} · ${e.model} · ${e.turnCount} turns · ${mi(e.totalTokens)} tokens · ${pi(e.usd)} · ${ui(e.durationMs)}`+(p?` · open workflow run`:``),_=`absolute inset-y-0 my-auto h-5 rounded-sm opacity-85 ${t} `+(p?`cursor-pointer hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`:`cursor-default`);return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`flex items-center h-7 px-2`,children:[(0,I.jsxs)(`div`,{className:`${fa} shrink-0 flex items-center gap-1 pl-4 pr-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:o,"aria-expanded":a,"aria-label":`${a?`Collapse`:`Expand`} calls for ${e.label}`,className:`shrink-0 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:a?(0,I.jsx)(vn,{size:11,className:`text-ink-muted`,"aria-hidden":`true`}):(0,I.jsx)(yn,{size:11,className:`text-ink-muted`,"aria-hidden":`true`})}),(0,I.jsx)(`span`,{className:`truncate text-[11px] text-ink-subtle`,title:e.label,children:e.label})]}),(0,I.jsxs)(`div`,{className:`relative flex-1 h-full flex items-center`,children:[p?(0,I.jsx)(`button`,{type:`button`,"aria-label":g,className:_,style:{left:`${d}%`,width:`${f}%`,minWidth:`4px`},onClick:()=>i(m),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocus:()=>c(!0),onBlur:()=>c(!1)}):(0,I.jsx)(`div`,{role:`img`,"aria-label":g,className:_,style:{left:`${d}%`,width:`${f}%`,minWidth:`4px`},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)}),s&&(0,I.jsxs)(`div`,{className:`absolute z-50 top-full mt-1 px-2 py-1.5 rounded-lg bg-bg-elevated border border-bg-line text-[11px] text-ink-base shadow-lg whitespace-nowrap pointer-events-none`,style:h,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.label}),(0,I.jsx)(`div`,{className:`text-ink-subtle font-mono`,children:e.model}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[e.turnCount,` turn`,e.turnCount===1?``:`s`,` ·`,` `,mi(e.totalTokens),` tokens`]}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[pi(e.usd),` · `,ui(e.durationMs)]})]})]})]}),a&&(0,I.jsx)(ba,{agentId:e.agentId,sessionId:r,window:n})]})}function ba({agentId:e,sessionId:t,window:n}){let{data:r,isLoading:i,isError:a}=L({queryKey:z.agentCalls(t,e),queryFn:()=>vr(t,e),retry:!1});if(i)return(0,I.jsx)(`div`,{className:`pl-6 py-1 text-[10px] text-ink-muted`,children:`Loading calls…`});if(a)return(0,I.jsx)(`div`,{className:`pl-6 py-1 text-[10px] text-accent-red`,children:`Failed to load calls.`});let o=r?.calls??[];return o.length===0?(0,I.jsx)(`div`,{className:`pl-6 py-1 text-[10px] text-ink-muted`,children:`No calls recorded.`}):(0,I.jsx)(`div`,{className:`pl-3 border-l border-bg-line ml-3`,children:(0,I.jsx)(ia,{entries:[...o],segments:[],windowStartMs:n.startMs,windowEndMs:n.endMs,showTicks:!1,gutterClass:fa})})}function xa({parentRows:e,groups:t,window:n,sessionId:r,onSelectRun:i,runStatusById:a,collapsedGroups:o,toggleGroup:s,expandedAgents:c,toggleAgent:l}){let u=n.startMs,d=o.has(sa),f=(0,F.useMemo)(()=>{let t=1/0,n=0;for(let r of e){r.timestamp<t&&(t=r.timestamp);let e=r.timestamp+(r.durationMs??50);e>n&&(n=e)}return Number.isFinite(t)?Math.max(0,n-t):0},[e]);return(0,I.jsxs)(`div`,{className:`text-[11px]`,children:[e.length>0&&(0,I.jsxs)(`div`,{className:`mb-3`,children:[(0,I.jsx)(Ea,{collapsed:d,onToggle:()=>s(`__parent__`),label:`Parent`,count:`${e.length} tool call${e.length===1?``:`s`}`,trailing:(0,I.jsx)(Ta,{durationMs:f})}),!d&&(0,I.jsx)(`div`,{className:`flex flex-col`,children:[...e].sort((e,t)=>e.timestamp-t.timestamp).map((e,t)=>(0,I.jsx)(Sa,{entry:e,firstTs:u,detail:e.filePath??e.command??``},`${t}-${e.timestamp}`))})]}),t.map((e,t)=>{let u=oa[t%oa.length],d=la(e.runId),f=o.has(d),p=e.runId===null?void 0:a?.[e.runId],m=e.runId!==null&&i?()=>i(e.runId):void 0,h=e.agents.reduce((e,t)=>e+t.turnCount,0),g=e.agents.reduce((e,t)=>e+t.totalTokens,0),_=e.agents.map(e=>e.usd).filter(e=>e!=null),v=_.length>0?_.reduce((e,t)=>e+t,0):null,y=Math.max(0,e.agents.reduce((e,t)=>Math.max(e,t.endMs),0)-e.earliestStartMs);return(0,I.jsxs)(`div`,{className:`mb-3`,children:[(0,I.jsx)(Ea,{collapsed:f,onToggle:()=>s(d),label:e.name,swatchColor:u,count:`${e.agents.length} agent${e.agents.length===1?``:`s`}`,status:p,onOpenRun:m,trailing:(0,I.jsx)(Ta,{turns:h,tokens:g,usd:v,durationMs:y})}),!f&&(0,I.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:e.agents.map(e=>(0,I.jsx)(Ca,{agent:e,window:n,sessionId:r,onSelectRun:i,expanded:c.has(e.agentId),onToggle:()=>l(e.agentId)},e.agentId))})]},e.runId??`__adhoc__`)})]})}function Sa({entry:e,firstTs:t,detail:n}){return(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5`,children:[(0,I.jsxs)(`span`,{className:`w-10 text-ink-muted tabular-nums shrink-0`,children:[`+`,li(Math.max(0,e.timestamp-t))]}),(0,I.jsx)(`span`,{className:`w-28 truncate font-medium text-ink-base shrink-0`,title:e.toolName,children:hi(e.toolName)}),(0,I.jsx)(`span`,{className:`flex-1 truncate font-mono text-ink-subtle min-w-0`,title:n??``,children:n??``}),(0,I.jsx)(`span`,{className:`w-14 text-right tabular-nums text-ink-muted shrink-0`,children:e.durationMs==null?`—`:`${e.durationMs}ms`}),(0,I.jsx)(`span`,{className:`w-3 text-center shrink-0 ${e.success?`text-accent-green`:`text-accent-red`}`,"aria-label":e.success?`success`:`failed`,children:e.success?`✓`:`✗`})]})}function Ca({agent:e,window:t,sessionId:n,onSelectRun:r,expanded:i,onToggle:a}){let o=e.workflowRunId!==null&&r!==void 0,s=e.workflowRunId;return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:a,"aria-expanded":i,"aria-label":`${i?`Collapse`:`Expand`} calls for ${e.label}`,className:`shrink-0 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:i?(0,I.jsx)(vn,{size:11,className:`text-ink-muted`,"aria-hidden":`true`}):(0,I.jsx)(yn,{size:11,className:`text-ink-muted`,"aria-hidden":`true`})}),o?(0,I.jsx)(`button`,{type:`button`,onClick:()=>r(s),className:`truncate font-medium text-accent-cyan hover:underline text-left shrink-0 max-w-[160px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,title:`${e.label} · open workflow run`,children:e.label}):(0,I.jsx)(`span`,{className:`truncate font-medium text-ink-base shrink-0 max-w-[160px]`,title:e.label,children:e.label}),(0,I.jsx)(`span`,{className:`font-mono text-ink-muted truncate min-w-0 flex-1`,title:e.model,children:e.model}),(0,I.jsxs)(`span`,{className:`text-ink-muted tabular-nums shrink-0`,children:[e.turnCount,` turn`,e.turnCount===1?``:`s`]}),(0,I.jsxs)(`span`,{className:`text-ink-muted tabular-nums shrink-0`,children:[mi(e.totalTokens),` tok`]}),(0,I.jsx)(`span`,{className:`text-accent-amber tabular-nums shrink-0 w-12 text-right`,children:pi(e.usd)}),(0,I.jsx)(`span`,{className:`text-ink-muted tabular-nums shrink-0 w-12 text-right`,children:ui(e.durationMs)})]}),i&&(0,I.jsx)(wa,{agentId:e.agentId,sessionId:n,firstTs:t.startMs})]})}function wa({agentId:e,sessionId:t,firstTs:n}){let{data:r,isLoading:i,isError:a}=L({queryKey:z.agentCalls(t,e),queryFn:()=>vr(t,e),retry:!1});if(i)return(0,I.jsx)(`div`,{className:`pl-9 py-1 text-[10px] text-ink-muted`,children:`Loading calls…`});if(a)return(0,I.jsx)(`div`,{className:`pl-9 py-1 text-[10px] text-accent-red`,children:`Failed to load calls.`});let o=r?.calls??[];return o.length===0?(0,I.jsx)(`div`,{className:`pl-9 py-1 text-[10px] text-ink-muted`,children:`No calls recorded.`}):(0,I.jsx)(`div`,{className:`pl-6 border-l border-bg-line ml-3 flex flex-col`,children:[...o].sort((e,t)=>e.timestamp-t.timestamp).map((e,t)=>(0,I.jsx)(Sa,{entry:e,firstTs:n},`${t}-${e.timestamp}`))})}function Ta({turns:e,tokens:t,usd:n,durationMs:r}){return(0,I.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[10px] tabular-nums shrink-0 pl-2`,children:[e!=null&&(0,I.jsxs)(`span`,{className:`text-ink-muted`,children:[e,` turn`,e===1?``:`s`]}),t!=null&&(0,I.jsxs)(`span`,{className:`text-ink-muted`,children:[mi(t),` tok`]}),n!=null&&(0,I.jsx)(`span`,{className:`text-accent-amber`,children:fi(n)}),r!=null&&(0,I.jsx)(`span`,{className:`text-ink-muted`,children:ui(r)})]})}function Ea({collapsed:e,onToggle:t,label:n,count:r,swatchColor:i,status:a,trailing:o,onOpenRun:s}){return(0,I.jsxs)(`div`,{className:`flex w-full items-center gap-1.5 mb-0.5 px-2 text-left`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:t,"aria-expanded":!e,className:`flex items-center gap-1.5 shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,children:[e?(0,I.jsx)(yn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}):(0,I.jsx)(vn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}),i!=null&&(0,I.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm shrink-0 ${i}`,"aria-hidden":`true`})]}),s?(0,I.jsx)(`span`,{role:`button`,tabIndex:0,title:`${n} · open run`,onClick:e=>{e.stopPropagation(),s()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),s())},className:`text-[11px] font-medium text-ink-subtle truncate min-w-0 cursor-pointer hover:text-accent-cyan hover:underline underline-offset-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:n}):(0,I.jsx)(`span`,{className:`text-[11px] font-medium text-ink-subtle truncate min-w-0`,title:n,children:n}),(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted tabular-nums truncate shrink-0`,children:r}),(0,I.jsx)(pa,{status:a}),o]})}function Da(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Oa(e,t=16){return e.length<=t?e:`${e.slice(0,6)}…${e.slice(-6)}`}function ka({column:e,sortKey:t,sortDir:n}){return e===t?n===`asc`?(0,I.jsx)(gn,{className:`w-3 h-3 text-accent-amber`,"aria-hidden":`true`}):(0,I.jsx)(mn,{className:`w-3 h-3 text-accent-amber`,"aria-hidden":`true`}):(0,I.jsx)(hn,{className:`w-3 h-3 opacity-30`,"aria-hidden":`true`})}function Aa({column:e,label:t,sortKey:n,sortDir:r,onSort:i,className:a=``}){return(0,I.jsx)(`th`,{scope:`col`,"aria-sort":e===n?r===`asc`?`ascending`:`descending`:`none`,className:`px-3 py-2 text-left text-[10px] uppercase tracking-wider text-ink-muted font-semibold whitespace-nowrap select-none ${a}`,children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>i(e),className:`inline-flex items-center gap-1 cursor-pointer hover:text-ink-subtle transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,children:[t,(0,I.jsx)(ka,{column:e,sortKey:n,sortDir:r})]})})}function ja({agents:e}){let[t,n]=(0,F.useState)(`tokens`),[r,i]=(0,F.useState)(`desc`),[a,o]=(0,F.useState)(null);function s(e){e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`desc`))}async function c(e){try{await navigator.clipboard.writeText(e),o(e),setTimeout(()=>o(null),1500)}catch{}}let l=[...e].sort((e,n)=>{let i=e[t]??-1/0,a=n[t]??-1/0;if(typeof i==`string`&&typeof a==`string`)return r===`asc`?i.localeCompare(a):a.localeCompare(i);let o=i,s=a;return r===`asc`?o-s:s-o});return e.length===0?(0,I.jsx)(`div`,{className:`py-6 text-center text-xs text-ink-muted`,children:`No agent data recorded for this run.`}):(0,I.jsx)(`div`,{className:`overflow-x-auto rounded-lg border border-border-subtle`,children:(0,I.jsxs)(`table`,{className:`w-full text-xs`,"aria-label":`Agent activity`,children:[(0,I.jsx)(`thead`,{className:`bg-surface-5 border-b border-border-subtle`,children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(Aa,{column:`label`,label:`Agent`,sortKey:t,sortDir:r,onSort:s}),(0,I.jsx)(Aa,{column:`model`,label:`Model`,sortKey:t,sortDir:r,onSort:s}),(0,I.jsx)(Aa,{column:`state`,label:`State`,sortKey:t,sortDir:r,onSort:s}),(0,I.jsx)(Aa,{column:`tokens`,label:`Tokens`,sortKey:t,sortDir:r,onSort:s,className:`text-right`}),(0,I.jsx)(Aa,{column:`toolCalls`,label:`Tool Calls`,sortKey:t,sortDir:r,onSort:s,className:`text-right`}),(0,I.jsx)(Aa,{column:`durationMs`,label:`Duration`,sortKey:t,sortDir:r,onSort:s,className:`text-right`})]})}),(0,I.jsx)(`tbody`,{className:`divide-y divide-border-subtle`,children:l.map(e=>(0,I.jsxs)(`tr`,{className:`hover:bg-surface-5 transition-colors`,children:[(0,I.jsx)(`td`,{className:`px-3 py-2 min-w-0`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,I.jsx)(`button`,{type:`button`,title:e.agentId,"aria-label":`Copy agent ID ${e.agentId}`,onClick:()=>void c(e.agentId),className:`text-left text-ink-base font-medium truncate hover:text-accent-cyan transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded`,children:a===e.agentId?(0,I.jsx)(`span`,{className:`text-accent-green`,children:`Copied!`}):e.label||Oa(e.agentId)}),e.phaseTitle&&(0,I.jsxs)(`span`,{className:`text-[10px] text-ink-muted truncate`,children:[e.phaseTitle,e.attempt>1?` · attempt ${e.attempt}`:``]})]})}),(0,I.jsx)(`td`,{className:`px-3 py-2`,children:(0,I.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] bg-surface-5 text-ink-subtle font-mono`,children:e.model||`—`})}),(0,I.jsx)(`td`,{className:`px-3 py-2`,children:(0,I.jsx)(`span`,{className:`text-ink-subtle`,children:e.state||`—`})}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-right tabular-nums text-ink-base font-medium`,children:e.tokens>0?Da(e.tokens):(0,I.jsx)(`span`,{className:`text-ink-muted opacity-40`,children:`—`})}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-right tabular-nums text-ink-muted`,children:e.toolCalls>0?e.toolCalls.toLocaleString():(0,I.jsx)(`span`,{className:`text-ink-muted opacity-40`,children:`—`})}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-right tabular-nums text-ink-muted`,children:e.durationMs==null?(0,I.jsx)(`span`,{className:`text-ink-muted opacity-40`,children:`—`}):ui(e.durationMs)})]},e.agentId))})]})})}function Ma(e){return e===`Read`?`bg-accent-blue`:e===`Edit`||e===`Write`?`bg-accent-green`:e===`Bash`?`bg-accent-purple`:e===`Agent`?`bg-accent-teal`:`bg-ink-subtle`}var Na=15;function Pa({agents:e,window:t,parentEntries:n,onSelectRun:r}){let[i,a]=(0,F.useState)(null),o=Math.max(t.endMs-t.startMs,1),s=(0,F.useMemo)(()=>{let e=[1e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5].find(e=>o/e<=8)??Math.ceil(o/8),t=[];for(let n=e;n<o;n+=e)t.push(n);return t},[o]),c=(0,F.useMemo)(()=>aa(e),[e]),l=(0,F.useMemo)(()=>n?[...n].sort((e,t)=>e.timestamp-t.timestamp):[],[n]),u=n!==void 0,d=(0,F.useMemo)(()=>c.reduce((e,t)=>e+t.agents.length,0),[c])+ +!!u,[f,p]=(0,F.useState)(()=>{let e=new Set;for(let t of c)t.agents.length>Na&&e.add(la(t.runId));return e}),m=e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};if(e.length===0&&!u)return(0,I.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No subagents ran in this session.`});let h=-1,g=e=>e>=3&&e>d-4?`bottom-full mb-1`:`top-full mt-1`,_=f.has(sa);return(0,I.jsxs)(`div`,{className:`p-2 overflow-x-hidden`,children:[(0,I.jsxs)(`div`,{className:`flex`,children:[(0,I.jsx)(`div`,{className:`w-24 shrink-0`}),(0,I.jsx)(`div`,{className:`relative flex-1 h-5 border-b border-bg-line overflow-x-auto`,children:s.map(e=>(0,I.jsx)(`span`,{className:`absolute top-0 text-[9px] text-ink-muted tabular-nums -translate-x-1/2`,style:{left:`${e/o*100}%`},children:ua(e)},e))})]}),(0,I.jsxs)(`div`,{className:`mt-1`,children:[u&&(0,I.jsxs)(`div`,{className:`mb-2`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>m(`__parent__`),"aria-expanded":!_,className:`flex w-full items-center gap-1.5 mb-0.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,children:[_?(0,I.jsx)(yn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}):(0,I.jsx)(vn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-[11px] font-medium text-ink-subtle truncate`,children:`Parent activity`}),(0,I.jsxs)(`span`,{className:`text-[10px] text-ink-muted tabular-nums`,children:[l.length,` tool call`,l.length===1?``:`s`]})]}),!_&&(()=>{h+=1;let e=h;return(0,I.jsxs)(`div`,{className:`flex items-center h-7`,children:[(0,I.jsx)(`div`,{className:`w-24 shrink-0 truncate text-[11px] text-ink-subtle pr-2 text-right`,children:`Parent`}),(0,I.jsx)(`div`,{className:`relative flex-1 h-full flex items-center`,children:l.map((n,r)=>{let s=n.timestamp-t.startMs,c=Math.max(0,s/o*100),l=(n.durationMs??50)/o*100,u=`parent:${r}`,d=hi(n.toolName),f=c>=50?{right:`${Math.max(0,100-c-l)}%`}:{left:`${c}%`};return(0,I.jsxs)(`div`,{className:`contents`,children:[(0,I.jsx)(`div`,{role:`img`,"aria-label":`${n.toolName} · ${n.durationMs==null?`unknown`:`${n.durationMs}ms`} · ${n.success?`success`:`failed`}`,className:`absolute inset-y-0 my-auto h-5 rounded-sm opacity-80 cursor-default ${Ma(d)} `+(n.success?``:`ring-1 ring-accent-red/60`),style:{left:`${c}%`,width:`${l}%`,minWidth:`4px`},onMouseEnter:()=>a(u),onMouseLeave:()=>a(null)}),i===u&&(0,I.jsxs)(`div`,{className:`absolute z-50 ${g(e)} px-2 py-1.5 rounded-lg bg-bg-elevated border border-bg-line text-[11px] text-ink-base shadow-lg whitespace-nowrap pointer-events-none`,style:f,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:n.toolName}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[n.durationMs==null?`unknown`:`${n.durationMs}ms`,` `,`· `,n.success?`success`:`failed`]})]})]},u)})})]})})()]}),c.map((e,n)=>{let s=oa[n%oa.length],c=la(e.runId),l=f.has(c),u=e.agents.map(e=>e.usd).filter(e=>e!=null),d=u.length>0?u.reduce((e,t)=>e+t,0):null,p=e.agents.reduce((e,t)=>Math.max(e,t.endMs),0)-e.earliestStartMs,_=`${e.agents.length} agent${e.agents.length===1?``:`s`} · ${pi(d)} · ${ua(Math.max(0,p))} span`;return(0,I.jsxs)(`div`,{className:`mb-2`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>m(c),"aria-expanded":!l,className:`flex w-full items-center gap-1.5 mb-0.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,children:[l?(0,I.jsx)(yn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}):(0,I.jsx)(vn,{size:13,className:`shrink-0 text-ink-muted`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm shrink-0 ${s}`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-[11px] font-medium text-ink-subtle truncate`,title:e.name,children:e.name}),l?(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted tabular-nums truncate`,children:_}):(0,I.jsxs)(`span`,{className:`text-[10px] text-ink-muted tabular-nums`,children:[e.agents.length,` agent`,e.agents.length===1?``:`s`]})]}),!l&&e.agents.map(e=>{h+=1;let c=h,l=e.startMs-t.startMs,u=Math.max(0,l/o*100),d=e.durationMs/o*100,f=`${n}:${e.agentId}`,p=e.workflowRunId!==null&&r!==void 0,m=e.workflowRunId,_=u>=50?{right:`${Math.max(0,100-u-d)}%`}:{left:`${u}%`},v=`${e.label} · ${e.model} · ${e.turnCount} turns · ${di(e.totalTokens)} tokens · ${pi(e.usd)} · ${ui(e.durationMs)}`+(p?` · open workflow run`:``),y=`absolute inset-y-0 my-auto h-5 rounded-sm opacity-85 ${s} `+(p?`cursor-pointer hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`:`cursor-default`);return(0,I.jsxs)(`div`,{className:`flex items-center h-7`,children:[(0,I.jsx)(`div`,{className:`w-24 shrink-0 truncate text-[11px] text-ink-subtle pr-2 text-right`,title:e.label,children:e.label}),(0,I.jsxs)(`div`,{className:`relative flex-1 h-full flex items-center`,children:[p?(0,I.jsx)(`button`,{type:`button`,"aria-label":v,className:y,style:{left:`${u}%`,width:`${d}%`,minWidth:`4px`},onClick:()=>r(m),onMouseEnter:()=>a(f),onMouseLeave:()=>a(null),onFocus:()=>a(f),onBlur:()=>a(null)}):(0,I.jsx)(`div`,{role:`img`,"aria-label":v,className:y,style:{left:`${u}%`,width:`${d}%`,minWidth:`4px`},onMouseEnter:()=>a(f),onMouseLeave:()=>a(null)}),i===f&&(0,I.jsxs)(`div`,{className:`absolute z-50 ${g(c)} px-2 py-1.5 rounded-lg bg-bg-elevated border border-bg-line text-[11px] text-ink-base shadow-lg whitespace-nowrap pointer-events-none`,style:_,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.label}),(0,I.jsx)(`div`,{className:`text-ink-subtle font-mono`,children:e.model}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[e.turnCount,` turn`,e.turnCount===1?``:`s`,` ·`,` `,di(e.totalTokens),` tokens`]}),(0,I.jsxs)(`div`,{className:`text-ink-muted`,children:[pi(e.usd),` ·`,` `,ui(e.durationMs)]})]})]})]},f)})]},e.runId??`__adhoc__`)})]})]})}var Fa={running:{tone:`info`,label:`Running`},completed:{tone:`success`,label:`Completed`},failed:{tone:`danger`,label:`Failed`},cancelled:{tone:`warning`,label:`Cancelled`},unknown:{tone:`neutral`,label:`Unknown`}};function Ia({status:e}){switch(e){case`completed`:return(0,I.jsx)(bn,{className:`w-4 h-4 text-accent-green`,"aria-hidden":`true`});case`failed`:return(0,I.jsx)(xn,{className:`w-4 h-4 text-accent-red`,"aria-hidden":`true`});case`running`:return(0,I.jsx)(En,{className:`w-4 h-4 text-accent-cyan animate-spin`,"aria-hidden":`true`});case`cancelled`:return(0,I.jsx)(Sn,{className:`w-4 h-4 text-accent-amber`,"aria-hidden":`true`});default:return(0,I.jsx)(Sn,{className:`w-4 h-4 text-ink-muted`,"aria-hidden":`true`})}}function La(e,t,n){let r=[];for(let i of e){if(i.startedAt==null)continue;let e=i.durationMs??0;r.push({agentId:i.agentId,workflowRunId:t,workflowName:n,label:i.label||i.agentId,model:i.model,startMs:i.startedAt,endMs:i.startedAt+e,durationMs:e,turnCount:i.toolCalls,totalTokens:i.tokens,usd:null})}return r}function Ra({runId:e,onClose:t}){let n=(0,F.useRef)(null),r=(0,F.useRef)(null);(0,F.useEffect)(()=>{function e(e){if(e.key===`Escape`){t();return}if(e.key===`Tab`&&n.current){let t=n.current.querySelectorAll(`button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`),r=t[0],i=t[t.length-1];!e.shiftKey&&document.activeElement===i?(e.preventDefault(),r?.focus()):e.shiftKey&&document.activeElement===r&&(e.preventDefault(),i?.focus())}}return document.addEventListener(`keydown`,e),r.current?.focus(),()=>document.removeEventListener(`keydown`,e)},[t]);let{data:i,isLoading:a,isError:o}=L({queryKey:z.workflowDetail(e),queryFn:()=>Fr(e),refetchInterval:5e3}),s=i?.run,c=(0,F.useMemo)(()=>i?.agents??[],[i?.agents]),l=i?.topology??null,u=s==null?null:Fa[s.status]??Fa.unknown,d=s!=null&&(s.status===`failed`||s.status===`cancelled`)&&typeof s.errorReason==`string`&&s.errorReason.trim()!==``?s.errorReason:null,f=c.reduce((e,t)=>e+(t.tokens??0),0),p=s?.totalTokens??null,m=p==null?null:p-f,h=(0,F.useMemo)(()=>s==null?[]:La(c,s.runId,s.workflowName??null),[c,s]),g=(0,F.useMemo)(()=>{if(h.length===0)return{startMs:0,endMs:1};let e=1/0,t=-1/0;for(let n of h)n.startMs<e&&(e=n.startMs),n.endMs>t&&(t=n.endMs);return{startMs:e,endMs:t>e?t:e+1}},[h]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,"aria-hidden":`true`,onClick:t}),(0,I.jsxs)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-label":`Workflow run details: ${s?.workflowName??e}`,className:`fixed right-0 top-0 bottom-0 z-50 w-[640px] max-w-full flex flex-col bg-bg-panel border-l border-border-medium shadow-2xl overflow-hidden`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3 px-5 py-4 border-b border-border-subtle shrink-0`,children:[(0,I.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[a&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-ink-muted`,children:[(0,I.jsx)(En,{className:`w-4 h-4 animate-spin`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-sm`,children:`Loading run details…`})]}),o&&(0,I.jsx)(`span`,{className:`text-sm text-accent-red`,children:`Failed to load run details.`}),s!=null&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(Ia,{status:s.status}),(0,I.jsx)(`h2`,{className:`text-sm font-semibold text-ink-base truncate`,children:s.workflowName}),u!=null&&(0,I.jsx)(qr,{tone:u.tone,size:`sm`,bordered:!0,children:u.label}),s.runSource!=null&&(0,I.jsx)(qr,{tone:`neutral`,size:`sm`,children:s.runSource})]}),(0,I.jsxs)(`div`,{className:`mt-1 flex items-center gap-3 text-[10px] text-ink-muted flex-wrap`,children:[(0,I.jsx)(`span`,{className:`font-mono`,children:e}),s.startedAt!=null&&(0,I.jsx)(`span`,{children:new Date(s.startedAt).toLocaleString()}),s.durationMs!=null&&(0,I.jsx)(`span`,{children:ui(s.durationMs)}),s.defaultModel&&(0,I.jsx)(`span`,{className:`font-mono`,children:s.defaultModel})]})]})]}),(0,I.jsx)(`button`,{ref:r,type:`button`,"aria-label":`Close run details`,onClick:t,className:`shrink-0 p-1.5 rounded-md text-ink-muted hover:text-ink-base hover:bg-surface-5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:(0,I.jsx)(Mn,{className:`w-4 h-4`,"aria-hidden":`true`})})]}),(0,I.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-4 space-y-5`,children:s!=null&&(0,I.jsxs)(I.Fragment,{children:[d!=null&&(0,I.jsxs)(B,{tone:`static`,padding:`sm`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Failure reason`}),(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(xn,{className:`w-4 h-4 text-accent-red shrink-0 mt-0.5`,"aria-hidden":`true`}),(0,I.jsx)(`p`,{className:`text-xs text-accent-red font-mono break-words`,children:d})]})]}),(s.totalTokens!=null||p!=null)&&(0,I.jsxs)(B,{tone:`static`,padding:`sm`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Token Reconciliation`}),(0,I.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Rollup`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums text-ink-base mt-0.5`,children:p==null?`—`:p.toLocaleString()})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Agent Sum`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums text-ink-base mt-0.5`,children:f.toLocaleString()})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Delta`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums mt-0.5 ${m===null?`text-ink-muted`:m===0?`text-accent-green`:`text-accent-amber`}`,children:m===null?`—`:m===0?`0`:`${m>0?`+`:``}${m.toLocaleString()}`})]})]}),s.totalUsd!=null&&(0,I.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border-subtle flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Total Cost`}),(0,I.jsx)(`span`,{className:`text-xs font-bold text-accent-amber tabular-nums`,children:fi(s.totalUsd)})]})]}),l!=null&&(0,I.jsxs)(B,{tone:`static`,padding:`sm`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Topology`}),(0,I.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Declared Phases`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums text-ink-base mt-0.5`,children:l.declaredPhases==null?`—`:l.declaredPhases})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Observed Phases`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums text-ink-base mt-0.5`,children:s.observedPhases==null?`—`:s.observedPhases})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Declared Agents`}),(0,I.jsx)(`div`,{className:`text-sm font-bold tabular-nums text-ink-base mt-0.5`,children:l.declaredAgents==null?`—`:l.declaredAgents})]})]}),l.declaredParallelWidths!=null&&l.declaredParallelWidths.length>0&&(0,I.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border-subtle flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted uppercase tracking-wider`,children:`Parallel Widths`}),l.declaredParallelWidths.map((e,t)=>(0,I.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] bg-surface-5 text-ink-subtle font-mono`,children:e},`${e}-${t}`))]})]}),h.length>0&&(0,I.jsxs)(`section`,{"aria-label":`Agent fan-out timeline`,children:[(0,I.jsx)(V,{className:`mb-3`,children:`Fan-out timeline`}),(0,I.jsx)(B,{tone:`static`,padding:`sm`,children:(0,I.jsx)(Pa,{agents:h,window:g})})]}),c.length>0?(0,I.jsxs)(`section`,{"aria-label":`Agent activity`,children:[(0,I.jsxs)(V,{className:`mb-3`,children:[`Agents (`,c.length,`)`]}),(0,I.jsx)(ja,{agents:c})]}):(0,I.jsx)(`div`,{className:`py-6 text-center text-xs text-ink-muted`,children:`No agent data recorded for this run.`})]})})]})]})}var za=`var(--color-chart-block)`,Ba=`var(--color-chart-block-peak)`,Va=10,Ha=13;function Ua({data:e,maxCount:t,ariaLabel:n}){let r=(0,F.useRef)(null),[i,a]=(0,F.useState)(null);if(e.length===0||e.every(e=>e.count===0))return null;let o=Math.max(t??0,...e.map(e=>e.count),1),s=o*12;return(0,I.jsxs)(`div`,{ref:r,className:`relative`,children:[(0,I.jsx)(`svg`,{width:`100%`,height:s,role:`img`,"aria-label":n,viewBox:`0 0 ${e.length*Ha} ${s}`,preserveAspectRatio:`xMidYMax meet`,onMouseLeave:()=>a(null),children:e.map((e,t)=>{let n=[];for(let r=0;r<e.count;r++){let i=e.count===o;n.push((0,I.jsx)(`rect`,{x:t*Ha,y:s-(r+1)*12,width:Va,height:Va,rx:1,fill:i?Ba:za,className:`heatmap-cell`,style:{animationDelay:`${t*20+r*10}ms`}},`${t}-${r}`))}return(0,I.jsxs)(`g`,{onMouseEnter:t=>{let n=r.current;if(!n)return;let i=n.getBoundingClientRect(),o=t.currentTarget,s=o.querySelectorAll(`rect.heatmap-cell`),c=(s[s.length-1]??o).getBoundingClientRect();a({x:c.left-i.left+c.width/2,y:c.top-i.top,text:e.tooltip})},children:[(0,I.jsx)(`rect`,{x:t*Ha,y:0,width:Ha,height:s,fill:`transparent`}),n]},t)})}),i&&(0,I.jsx)(`div`,{className:`absolute px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:i.x,top:i.y,transform:`translate(-50%, calc(-100% - 4px))`},children:i.text})]})}var Wa=`nr-observe-peak-concurrent`;function Ga({current:e,peak:t,allTimePeak:n,buckets:r}){let[i,a]=(0,F.useState)(!1),o=(0,F.useRef)(null),s=r.some(e=>e.count>0);(0,F.useEffect)(()=>{let e=n??t;if(e<=0)return;let r=parseInt(localStorage.getItem(Wa)??`0`,10);if(o.current===null&&(o.current=r),e>o.current){localStorage.setItem(Wa,String(e)),o.current=e,a(!0);let t=setTimeout(()=>a(!1),3e3);return()=>clearTimeout(t)}},[t,n]);let c=r.map(e=>{let t=new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`});return{count:e.count,tooltip:`${t} — ${e.count} concurrent`}});return(0,I.jsxs)(B,{padding:`sm`,className:`relative overflow-hidden${i?` new-peak-glow`:``}`,children:[i&&(0,I.jsx)(Ka,{}),(0,I.jsx)(V,{className:`mb-1.5`,children:`Concurrent Sessions`}),(0,I.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,I.jsx)(`span`,{className:`text-lg font-semibold text-accent-teal tabular-nums`,children:e}),(0,I.jsxs)(`span`,{className:`text-xs text-ink-muted tabular-nums`,children:[`today peak `,t,n&&n>t?` · all-time ${n}`:``]}),i&&(0,I.jsx)(`span`,{className:`text-[10px] text-accent-green font-semibold animate-bounce`,children:`NEW RECORD!`})]}),s&&(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Ua,{data:c,ariaLabel:`Concurrency over time, peak ${t}`})})]})}function Ka(){return(0,I.jsx)(I.Fragment,{children:Array.from({length:12},(e,t)=>{let n=t/12*360,r=40+Math.random()*30;return(0,I.jsx)(`span`,{className:`absolute w-1.5 h-1.5 rounded-full`,style:{left:`50%`,top:`50%`,backgroundColor:t%3==0?`#1CE783`:t%3==1?`#00D4AA`:`#9945FF`,animation:`particle-burst 1s ease-out forwards`,animationDelay:`${t*40}ms`,transform:`translate(-50%, -50%) rotate(${n}deg) translateY(-${r}px)`,opacity:0}},t)})})}var qa=5,Ja=[`var(--color-heatmap-0)`,`var(--color-heatmap-1)`,`var(--color-heatmap-2)`,`var(--color-heatmap-3)`,`var(--color-heatmap-4)`];function Ya(e,t){if(e===0)return Ja[0];let n=e/t;return Ja[Math.min(Math.ceil(n*(qa-1)),qa-1)]}function Xa(e,t,n){let r=e+n*t;return new Date(r).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}function Za({variant:e,buckets:t,maxCount:n,bucketSizeMs:r,startTimestamp:i,width:a,height:o,ariaLabel:s,days:c}){return e===`grid`&&c?(0,I.jsx)(eo,{days:c,maxCount:n,width:a,height:o,ariaLabel:s}):(0,I.jsx)(Qa,{buckets:t,maxCount:n,bucketSizeMs:r,startTimestamp:i,width:a,height:o,ariaLabel:s})}function Qa({buckets:e,maxCount:t,bucketSizeMs:n=9e5,startTimestamp:r=0,width:i,height:a=24,ariaLabel:o}){let[s,c]=(0,F.useState)(null),l=Math.max(4,Math.min(12,i?(i-e.length*1)/e.length:8)),u=i??e.length*(l+1);return(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`svg`,{width:u,height:a,role:`img`,"aria-label":o??`Activity heatmap: ${e.length} time buckets`,className:`w-full`,style:{maxWidth:u},viewBox:`0 0 ${u} ${a}`,preserveAspectRatio:`none`,onMouseLeave:()=>c(null),children:e.map((e,i)=>(0,I.jsx)(`rect`,{x:i*(l+1),y:0,width:l,height:a,rx:2,fill:Ya(e,t),className:`heatmap-cell`,style:{animationDelay:`${Math.min(i*8,400)}ms`},onMouseEnter:t=>{let a=Xa(r,n,i);c({x:t.currentTarget.x.baseVal.value,text:`${a}: ${e} calls`})}},i))}),s&&(0,I.jsx)(`div`,{className:`absolute -top-7 px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:s.x},children:s.text})]})}var $a=[`Mon`,``,`Wed`,``,`Fri`,``,`Sun`];function eo({days:e,maxCount:t,ariaLabel:n}){let[r,i]=(0,F.useState)(null),a=(0,F.useMemo)(()=>{if(e.length===0)return{weeks:0,cells:[]};let t=(new Date(e[0].date).getUTCDay()+6)%7,n=[];for(let r=0;r<e.length;r++){let i=r+t,a=i%7,o=Math.floor(i/7);n.push({...e[r],row:a,col:o})}return{weeks:n.length>0?n[n.length-1].col+1:0,cells:n}},[e]),o=28+a.weeks*12,s=(0,F.useMemo)(()=>{let e=[],t=``;for(let n of a.cells){if(n.row!==0)continue;let r=new Date(n.date).toLocaleString(void 0,{month:`short`,timeZone:`UTC`});r!==t&&(e.push({text:r,col:n.col}),t=r)}return e},[a.cells]);return(0,I.jsxs)(`div`,{className:`relative flex justify-center`,children:[(0,I.jsxs)(`svg`,{width:`100%`,height:98,role:`img`,"aria-label":n??`Activity grid: ${e.length} days`,viewBox:`0 0 ${o} 98`,preserveAspectRatio:`xMidYMid meet`,onMouseLeave:()=>i(null),children:[$a.map((e,t)=>e?(0,I.jsx)(`text`,{x:0,y:14+t*12+10-2,className:`fill-ink-muted`,fontSize:10,children:e},t):null),s.map(({text:e,col:t})=>(0,I.jsx)(`text`,{x:28+t*12,y:10,className:`fill-ink-muted`,fontSize:10,children:e},`${e}-${t}`)),a.cells.map((e,n)=>(0,I.jsx)(`rect`,{x:28+e.col*12,y:14+e.row*12,width:10,height:10,rx:2,fill:Ya(e.count,t),className:`heatmap-cell`,style:{animationDelay:`${Math.min(n*3,300)}ms`},onMouseEnter:t=>{let n=t.currentTarget;i({x:n.x.baseVal.value,y:n.y.baseVal.value-16,text:`${e.date}: ${e.count} calls`})}},n))]}),r&&(0,I.jsx)(`div`,{className:`absolute px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:r.x,top:r.y},children:r.text}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1 mt-1.5 text-[10px] text-ink-muted`,children:[(0,I.jsx)(`span`,{children:`Less`}),Ja.map((e,t)=>(0,I.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm`,style:{backgroundColor:e}},t)),(0,I.jsx)(`span`,{children:`More`})]})]})}function to({theme:e=`observatory`}){return(0,I.jsxs)(`div`,{className:`geo-banner`,"aria-hidden":`true`,children:[e===`observatory`&&(0,I.jsx)(no,{}),e===`sessions`&&(0,I.jsx)(ro,{}),e===`history`&&(0,I.jsx)(io,{}),e===`audit`&&(0,I.jsx)(ao,{}),e===`git`&&(0,I.jsx)(oo,{})]})}function no(){return(0,I.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`obsSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,I.jsx)(`stop`,{offset:`0%`,stopColor:`#1a3a5c`}),(0,I.jsx)(`stop`,{offset:`40%`,stopColor:`#2d5a7b`}),(0,I.jsx)(`stop`,{offset:`70%`,stopColor:`#e8834a`}),(0,I.jsx)(`stop`,{offset:`100%`,stopColor:`#f4a261`})]})}),(0,I.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#obsSky)`}),(0,I.jsx)(`polygon`,{points:`0,80 0,45 80,38 160,48 240,30 340,42 420,25 500,38 580,32 660,40 740,28 800,35 800,80`,fill:`#1a3a5c`,opacity:`0.7`}),(0,I.jsx)(`polygon`,{points:`0,80 0,55 60,48 140,58 220,42 300,52 380,40 460,50 520,38 600,48 680,42 760,52 800,48 800,80`,fill:`#234e6f`}),(0,I.jsx)(`polygon`,{points:`0,80 0,62 100,58 200,65 300,55 400,60 500,54 600,62 700,56 800,60 800,80`,fill:`#2a6b4a`,opacity:`0.8`}),(0,I.jsx)(`circle`,{cx:`680`,cy:`28`,r:`14`,fill:`#f4a261`,opacity:`0.6`}),(0,I.jsx)(`circle`,{cx:`680`,cy:`28`,r:`8`,fill:`#ffd166`,opacity:`0.5`}),(0,I.jsx)(`ellipse`,{cx:`150`,cy:`56`,rx:`18`,ry:`10`,fill:`#1a3a5c`}),(0,I.jsx)(`line`,{x1:`150`,y1:`46`,x2:`172`,y2:`34`,stroke:`#5ce0d8`,strokeWidth:`1.5`,opacity:`0.8`})]})}function ro(){return(0,I.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`seaSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,I.jsx)(`stop`,{offset:`0%`,stopColor:`#4aa8c7`}),(0,I.jsx)(`stop`,{offset:`60%`,stopColor:`#3a8fb7`}),(0,I.jsx)(`stop`,{offset:`100%`,stopColor:`#2d7a9e`})]})}),(0,I.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#seaSky)`}),(0,I.jsx)(`polygon`,{points:`600,48 640,35 680,48`,fill:`#2d7a4a`,opacity:`0.4`}),(0,I.jsx)(`polygon`,{points:`700,50 730,40 760,50`,fill:`#3d9b5b`,opacity:`0.3`}),(0,I.jsx)(`polygon`,{points:`0,80 0,15 40,12 80,20 120,18 160,25 180,30 180,80`,fill:`#c05a3c`}),(0,I.jsx)(`polygon`,{points:`0,80 0,25 30,22 60,28 100,25 140,30 160,35 160,80`,fill:`#e8834a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`20,20 35,8 50,20`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`60,22 72,12 84,24`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`100,20 115,10 130,22`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`140,28 150,18 160,28`,fill:`#4aad6b`,opacity:`0.8`}),(0,I.jsx)(`rect`,{x:`120`,y:`30`,width:`8`,height:`50`,fill:`#87ceeb`,opacity:`0.5`}),(0,I.jsx)(`rect`,{x:`122`,y:`30`,width:`4`,height:`50`,fill:`#fff`,opacity:`0.3`}),(0,I.jsx)(`polygon`,{points:`620,80 620,30 660,25 700,32 740,28 780,35 800,30 800,80`,fill:`#c05a3c`,opacity:`0.8`}),(0,I.jsx)(`polygon`,{points:`650,30 665,18 680,30`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`720,32 732,22 744,32`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`180,80 180,55 250,52 350,56 450,52 550,55 620,52 620,80`,fill:`#2d7a9e`,opacity:`0.6`}),(0,I.jsx)(`line`,{x1:`200`,y1:`60`,x2:`280`,y2:`58`,stroke:`#5ce0d8`,strokeWidth:`0.8`,opacity:`0.3`}),(0,I.jsx)(`line`,{x1:`350`,y1:`56`,x2:`450`,y2:`55`,stroke:`#5ce0d8`,strokeWidth:`0.8`,opacity:`0.25`}),(0,I.jsx)(`line`,{x1:`480`,y1:`58`,x2:`580`,y2:`56`,stroke:`#87ceeb`,strokeWidth:`0.8`,opacity:`0.3`})]})}function io(){return(0,I.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`histSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,I.jsx)(`stop`,{offset:`0%`,stopColor:`#3a7ca5`}),(0,I.jsx)(`stop`,{offset:`60%`,stopColor:`#5bb8d4`}),(0,I.jsx)(`stop`,{offset:`100%`,stopColor:`#8ed4c0`})]})}),(0,I.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#histSky)`}),(0,I.jsx)(`polygon`,{points:`100,50 140,20 180,50`,fill:`#e8834a`,opacity:`0.7`}),(0,I.jsx)(`polygon`,{points:`160,50 210,15 260,50`,fill:`#d4694a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`550,50 600,18 650,50`,fill:`#e8834a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`620,50 660,22 700,50`,fill:`#c05a3c`,opacity:`0.5`}),(0,I.jsx)(`polygon`,{points:`350,50 370,12 390,50`,fill:`#5ce0d8`,opacity:`0.4`}),(0,I.jsx)(`polygon`,{points:`380,50 395,20 410,50`,fill:`#87ceeb`,opacity:`0.3`}),(0,I.jsx)(`polygon`,{points:`700,50 715,25 730,50`,fill:`#5ce0d8`,opacity:`0.35`}),(0,I.jsx)(`polygon`,{points:`300,80 380,50 420,50 500,80`,fill:`#2a5a6b`,opacity:`0.6`}),(0,I.jsx)(`line`,{x1:`390`,y1:`52`,x2:`350`,y2:`78`,stroke:`#f4a261`,strokeWidth:`1`,opacity:`0.4`}),(0,I.jsx)(`line`,{x1:`410`,y1:`52`,x2:`450`,y2:`78`,stroke:`#f4a261`,strokeWidth:`1`,opacity:`0.4`}),(0,I.jsx)(`polygon`,{points:`0,80 0,55 80,52 160,58 240,50 320,55 500,52 580,56 660,50 740,55 800,52 800,80`,fill:`#2d8a4a`,opacity:`0.5`}),(0,I.jsx)(`polygon`,{points:`0,80 0,65 60,62 140,68 220,60 400,65 500,62 600,66 700,60 800,65 800,80`,fill:`#1e6b3a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`30,65 42,42 54,65`,fill:`#3d9b5b`,opacity:`0.8`}),(0,I.jsx)(`polygon`,{points:`50,65 60,48 70,65`,fill:`#2d8a4a`,opacity:`0.7`}),(0,I.jsx)(`polygon`,{points:`720,65 732,45 744,65`,fill:`#3d9b5b`,opacity:`0.7`}),(0,I.jsx)(`polygon`,{points:`760,65 770,50 780,65`,fill:`#2d8a4a`,opacity:`0.8`})]})}function ao(){return(0,I.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`auditSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,I.jsx)(`stop`,{offset:`0%`,stopColor:`#1a5c3a`}),(0,I.jsx)(`stop`,{offset:`50%`,stopColor:`#2d7a4a`}),(0,I.jsx)(`stop`,{offset:`100%`,stopColor:`#3d9b5b`})]})}),(0,I.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#auditSky)`}),(0,I.jsx)(`polygon`,{points:`200,0 210,80 220,0`,fill:`#ffd166`,opacity:`0.08`}),(0,I.jsx)(`polygon`,{points:`500,0 510,80 520,0`,fill:`#ffd166`,opacity:`0.06`}),(0,I.jsx)(`polygon`,{points:`650,0 660,80 670,0`,fill:`#fff`,opacity:`0.05`}),(0,I.jsx)(`rect`,{x:`80`,y:`20`,width:`6`,height:`60`,fill:`#1a4a2e`}),(0,I.jsx)(`rect`,{x:`180`,y:`10`,width:`7`,height:`70`,fill:`#1a4a2e`}),(0,I.jsx)(`rect`,{x:`320`,y:`15`,width:`6`,height:`65`,fill:`#1a4a2e`}),(0,I.jsx)(`rect`,{x:`500`,y:`8`,width:`7`,height:`72`,fill:`#1a4a2e`}),(0,I.jsx)(`rect`,{x:`620`,y:`18`,width:`6`,height:`62`,fill:`#1a4a2e`}),(0,I.jsx)(`rect`,{x:`740`,y:`12`,width:`7`,height:`68`,fill:`#1a4a2e`}),(0,I.jsx)(`polygon`,{points:`55,25 83,5 111,25`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`60,35 83,15 106,35`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`155,15 183,0 211,18`,fill:`#5bc47a`}),(0,I.jsx)(`polygon`,{points:`160,28 183,8 206,28`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`295,20 323,2 351,22`,fill:`#5bc47a`}),(0,I.jsx)(`polygon`,{points:`300,32 323,12 346,32`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`475,12 503,0 531,15`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`480,25 503,5 526,25`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`595,22 623,5 651,22`,fill:`#5bc47a`}),(0,I.jsx)(`polygon`,{points:`600,34 623,14 646,34`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`715,16 743,0 771,18`,fill:`#5bc47a`}),(0,I.jsx)(`polygon`,{points:`720,30 743,10 766,30`,fill:`#3d9b5b`}),(0,I.jsx)(`polygon`,{points:`0,80 0,68 100,65 200,70 300,64 400,68 500,63 600,67 700,64 800,68 800,80`,fill:`#1e6b3a`}),(0,I.jsx)(`polygon`,{points:`250,80 258,65 266,80`,fill:`#e8834a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`450,80 456,68 462,80`,fill:`#f4a261`,opacity:`0.5`}),(0,I.jsx)(`polygon`,{points:`650,80 656,66 662,80`,fill:`#e8834a`,opacity:`0.55`})]})}function oo(){return(0,I.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:`gitSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,I.jsx)(`stop`,{offset:`0%`,stopColor:`#2d5a7b`}),(0,I.jsx)(`stop`,{offset:`60%`,stopColor:`#3a8fb7`}),(0,I.jsx)(`stop`,{offset:`100%`,stopColor:`#5bb8d4`})]})}),(0,I.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#gitSky)`}),(0,I.jsx)(`polygon`,{points:`0,80 0,20 60,25 120,18 180,28 220,22 260,30 260,80`,fill:`#2d7a4a`,opacity:`0.7`}),(0,I.jsx)(`polygon`,{points:`540,80 540,22 600,28 660,20 720,25 780,18 800,22 800,80`,fill:`#2d7a4a`,opacity:`0.7`}),(0,I.jsx)(`path`,{d:`M 260,50 Q 320,48 400,45 Q 480,42 540,50`,fill:`none`,stroke:`#5ce0d8`,strokeWidth:`4`,opacity:`0.5`}),(0,I.jsx)(`path`,{d:`M 350,45 Q 370,35 400,28`,fill:`none`,stroke:`#87ceeb`,strokeWidth:`2`,opacity:`0.4`}),(0,I.jsx)(`path`,{d:`M 420,44 Q 440,52 470,60`,fill:`none`,stroke:`#87ceeb`,strokeWidth:`2`,opacity:`0.4`}),(0,I.jsx)(`path`,{d:`M 400,28 Q 430,25 460,30`,fill:`none`,stroke:`#5ce0d8`,strokeWidth:`1.5`,opacity:`0.35`}),(0,I.jsx)(`circle`,{cx:`400`,cy:`45`,r:`3`,fill:`#5ce0d8`,opacity:`0.6`}),(0,I.jsx)(`circle`,{cx:`350`,cy:`45`,r:`2`,fill:`#1ce783`,opacity:`0.5`}),(0,I.jsx)(`circle`,{cx:`460`,cy:`44`,r:`2`,fill:`#1ce783`,opacity:`0.5`}),(0,I.jsx)(`polygon`,{points:`300,65 310,55 320,65`,fill:`#3a6b4a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`480,62 492,52 504,62`,fill:`#3a6b4a`,opacity:`0.6`}),(0,I.jsx)(`polygon`,{points:`240,35 250,18 260,35`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`540,35 550,20 560,35`,fill:`#4aad6b`}),(0,I.jsx)(`polygon`,{points:`270,50 278,38 286,50`,fill:`#3d9b5b`,opacity:`0.8`}),(0,I.jsx)(`polygon`,{points:`520,48 528,36 536,48`,fill:`#3d9b5b`,opacity:`0.8`})]})}var so=[`system`,`tools`,`user`,`assistant`],co={system:`bg-accent-indigo`,tools:`bg-accent-amber`,user:`bg-accent-blue`,assistant:`bg-accent-green`},W={system:`shadow-[0_0_8px_rgba(99,102,241,0.4)]`,tools:`shadow-[0_0_8px_rgba(255,178,36,0.4)]`,user:`shadow-[0_0_8px_rgba(0,149,255,0.4)]`,assistant:`shadow-[0_0_8px_rgba(28,231,131,0.4)]`},lo={system:`bg-accent-indigo`,tools:`bg-accent-amber`,user:`bg-accent-blue`,assistant:`bg-accent-green`},uo={system:`System`,tools:`Tools`,user:`User`,assistant:`Assistant`};function fo(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function po(e,t=``){return{sessionId:t,turnNumber:e.turnCount,totalTokens:e.growth.currentTokens,fillPercent:e.fillPercent,contextWindow:e.contextWindow,breakdown:e.currentBreakdown,growth:{startTokens:e.growth.startTokens,currentTokens:e.growth.currentTokens,delta:e.growth.deltaTokens},topTools:e.toolContributions.map(e=>({tool:e.tool,estimatedTokens:e.estimatedTokens}))}}function mo({data:e,sessionId:t}){let n=Jn(e=>e.contextBySession),r=t?n.get(t)??null:null,[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)(!1),c=(0,F.useRef)(0),l=(0,F.useRef)(0),{data:u}=L({queryKey:t?[`context`,t]:z.context,queryFn:()=>Er(t??void 0),refetchInterval:1e4,enabled:!e}),d=e??u,f=t??``,p=e?po(e,f):r??(d?po(d,f):null),m=p?.growth.currentTokens??0,h=Math.min(p?.fillPercent??0,100),g=l.current>0&&h>c.current;if((0,F.useEffect)(()=>{if(l.current>0&&m<l.current*.7){s(!0);let e=setTimeout(()=>s(!1),1e3);return l.current=m,c.current=h,()=>clearTimeout(e)}l.current=m,c.current=h},[h,m]),!p||p.totalTokens===0)return null;let{breakdown:_,growth:v,fillPercent:y,totalTokens:b}=p,x=y>=100,S=p.contextWindow;return(0,I.jsxs)(`div`,{className:`group`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(V,{children:`Context`}),x&&(0,I.jsx)(qr,{tone:`danger`,size:`sm`,uppercase:!0,className:`animate-pulse motion-reduce:animate-none`,children:`at capacity`})]}),(0,I.jsxs)(`div`,{className:`text-[11px] text-ink-subtle tabular-nums`,children:[fo(v.currentTokens),S&&S>0&&(0,I.jsx)(`span`,{className:`text-ink-muted`,children:` / ${fo(S)}`}),v.delta>0&&(0,I.jsxs)(`span`,{className:`text-accent-amber ml-1`,children:[`+`,fo(v.delta)]}),v.delta<0&&(0,I.jsx)(`span`,{className:`text-accent-cyan ml-1`,children:`compacted`})]})]}),(0,I.jsxs)(`div`,{className:`relative`,children:[o&&(0,I.jsx)(`div`,{className:`absolute inset-0 rounded-full bg-accent-cyan/20 animate-compact-flash pointer-events-none`}),(0,I.jsx)(`div`,{className:`w-full h-3 bg-surface-3 rounded-full overflow-hidden flex transition-colors duration-150 ${g?`shadow-[0_0_12px_rgba(255,178,36,0.3)]`:``} ${o?`animate-compact`:``}`,children:so.map(e=>{let t=_[e];if(t<=0)return null;let n=Math.round(t/b*100),r=i===e;return(0,I.jsx)(`div`,{className:`${co[e]} transition-all duration-500 ease-out cursor-default relative ${r?`brightness-125 ${W[e]}`:``}`,style:{width:`${t/b*h}%`},title:`${uo[e]}: ${fo(t)} (${n}%)`,onMouseEnter:()=>a(e),onMouseLeave:()=>a(null)},e)})})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 mt-1.5 text-[10px] text-ink-muted`,children:[so.map(e=>{let t=_[e],n=i===e;return(0,I.jsxs)(`span`,{className:`flex items-center gap-1 transition-colors duration-200 cursor-default ${n?`text-ink-base`:``}`,onMouseEnter:()=>a(e),onMouseLeave:()=>a(null),children:[(0,I.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full ${lo[e]} ${n?`scale-150`:``} transition-transform duration-200`}),uo[e],n&&t>0&&(0,I.jsx)(`span`,{className:`text-ink-subtle ml-0.5`,children:fo(t)})]},e)}),(0,I.jsxs)(`span`,{className:`ml-auto tabular-nums ${x?`text-accent-red`:h>=75?`text-accent-amber`:``}`,children:[h.toFixed(0),`%`]})]})]})}function ho(e){let t=e==null?new Date:new Date(e);return t.setHours(0,0,0,0),t.getTime()}function go(e,t){let n=new Date(e),r=t==null?new Date:new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}var _o={weekday:`short`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`},vo=3e4,yo={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},bo=1e4;function xo(){let e=Jn(e=>e.cost),t=Jn(e=>e.antiPatterns),n=Qn(),r=$n(),{data:i}=L({queryKey:[`observability-health`],queryFn:Nr,refetchInterval:3e4}),{isPending:a}=L({queryKey:z.cost,queryFn:cr}),{data:o,isPending:s}=L({queryKey:z.sessionsTodayAggregate,queryFn:ar,refetchInterval:1e4}),{data:c,isPending:l}=L({queryKey:z.sessionsList(200),queryFn:()=>ir(200),refetchInterval:1e4}),{data:u,isPending:d}=L({queryKey:z.antiPatterns,queryFn:lr}),{data:f,isPending:p}=L({queryKey:z.concurrency,queryFn:Cr,refetchInterval:1e4}),{data:m,isPending:h}=L({queryKey:z.activityHeatmap(`today`),queryFn:()=>Tr(`today`),refetchInterval:3e4}),{data:g,isPending:_}=L({queryKey:z.sessionsLive,queryFn:or,refetchInterval:1e4}),v=(0,F.useMemo)(()=>Fo(c??[]),[c]),y=(0,F.useMemo)(()=>Io(c??[]),[c]),b=(0,F.useMemo)(()=>Lo(c??[]),[c]),x=(0,F.useMemo)(()=>Ro(c??[]),[c]),S=(0,F.useMemo)(()=>(c??[]).flatMap(e=>e.antiPatterns??[]),[c]),C=Math.max(o?.toolCallCount??0,y),w=(a||l||s)&&!e&&v===0&&o===void 0,T=Math.max(e?.todayTotalUsd??0,o?.totalCostUsd??0,v),E=Math.max(u?.length??0,t.length),D=Math.max(o?.antiPatternCount??0,b+E),O=Math.max(o?.subagentUsd??0,n.usd),k=Math.max(o?.subagentTurnCount??0,n.turns),A=o!==void 0||n.turns>0,[j,ee]=(0,F.useState)(()=>new Date().toLocaleString(void 0,_o));(0,F.useEffect)(()=>{let e=setInterval(()=>ee(new Date().toLocaleString(void 0,_o)),6e4);return()=>clearInterval(e)},[]);let M=o?.avgEfficiencyScore??null,te=M!==null&&Number.isFinite(M)?`${Math.round(M*100)}%`:`—`,ne=M===null?`needs more data`:Math.round(M*100)>=80?`strong session`:Math.round(M*100)>=50?`mixed signals`:`needs attention`;return(0,I.jsxs)(`section`,{children:[(0,I.jsx)(to,{}),(0,I.jsxs)(`header`,{className:`flex items-baseline justify-between mb-4`,children:[(0,I.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Today`}),(0,I.jsx)(`span`,{className:`text-xs text-ink-muted`,children:j})]}),!w&&!s&&!l&&!d&&!p&&!h&&!_&&C===0&&T===0&&D===0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(zi,{index:0,className:`glass-card p-8 mb-4`,children:(0,I.jsx)(ea,{icon:`code`,title:`No activity yet today`,subtitle:`Metrics will appear here once you start a coding session with Claude.`})}),(0,I.jsx)(zi,{index:1,children:(0,I.jsx)(jo,{})})]}):(0,I.jsxs)(I.Fragment,{children:[(r?.watcherDisabledByLock===!0||i?.watcherDisabledByLock===!0)&&(0,I.jsx)(`div`,{className:`rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-amber-300 mb-4`,children:`Subagent watcher is disabled (lock conflict). Subagent costs may be undercounted. Check Settings → Observability health.`}),i?.watcherActive===!1&&n.turns===0&&i?.watcherDisabledReason!==`mode_mismatch`&&(0,I.jsxs)(`div`,{className:`rounded-lg border border-border-subtle bg-surface-5 px-4 py-3 text-sm text-ink-muted mb-4`,children:[`Subagent cost tracking is disabled (`,(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:`NR_AI_ENABLE_SUBAGENT_WATCHER=0`}),`), so spend shown here excludes subagents. Unset that variable (it is on by default) and restart to see full spend.`]}),i?.watcherActive===!1&&n.turns===0&&i?.watcherDisabledReason===`mode_mismatch`&&(0,I.jsxs)(`div`,{className:`rounded-lg border border-border-subtle bg-surface-5 px-4 py-3 text-sm text-ink-muted mb-4`,children:[`This dashboard process isn’t running its own subagent watcher — expected for a background `,(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:`--local`}),` dashboard (the watcher only auto-starts in `,(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:`--stdio`}),` mode). Spend shown here still includes subagent activity from other sessions, read from their persisted totals. To track subagents live from this process too, set`,` `,(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:`NR_AI_WATCHER_MODE=local`}),` and restart.`]}),(0,I.jsx)(zi,{index:0,className:`mb-4`,children:(0,I.jsx)(B,{padding:`lg`,tone:`elevated`,glow:`green`,children:(0,I.jsxs)(`div`,{className:`grid grid-cols-5 gap-4`,children:[(0,I.jsx)(U,{label:`efficiency`,hero:!0,value:te,sub:ne,...M===null?{}:{animate:!0,numericValue:Math.round(M*100),suffix:`%`}}),(0,I.jsx)(U,{label:`spend today`,tone:`good`,value:w?`…`:fi(T),...w?{}:{animate:!0,numericValue:T,format:fi}}),(0,I.jsx)(U,{label:`subagent spend`,value:A?fi(O):`—`,sub:`${k} turns`,...A?{animate:!0,numericValue:O,format:fi}:{}}),(0,I.jsx)(U,{label:`tool calls`,value:String(C),animate:!0,numericValue:C}),(0,I.jsx)(U,{label:`flags`,tone:D>0?`warn`:`neutral`,value:String(D),animate:!0,numericValue:D})]})})}),(0,I.jsxs)(zi,{index:1,className:`grid grid-cols-2 gap-3 mb-3`,children:[(0,I.jsx)(zo,{todayTotal:T,forecastEod:w?null:e?.forecastEodUsd??o?.forecastEndOfDayUsd??null,hourlySpend:x,subagentUsd:O}),f&&f.buckets&&(0,I.jsx)(Ga,{current:f.current,peak:f.peak,allTimePeak:f.allTimePeak,bucketSizeMs:f.bucketSizeMs,startTimestamp:f.startTimestamp,buckets:f.buckets})]}),D>0&&(t.length>0||u&&u.length>0||S.length>0)&&(0,I.jsx)(zi,{index:2,className:`mb-3`,children:(0,I.jsx)(B,{padding:`sm`,tone:`warning`,className:`text-xs`,children:t.length>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(qr,{tone:`warning`,size:`sm`,className:`mr-2`,children:t[0].type}),(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`— `}),(0,I.jsxs)(`span`,{children:[t[0].count,`× on `]}),(0,I.jsx)(`code`,{className:`bg-surface-5 px-1 rounded`,children:t[0].target}),t[0].sessionId&&(0,I.jsxs)(qr,{tone:`neutral`,size:`sm`,className:`ml-2`,children:[`Session: `,Ao(t[0].sessionId,g??[])]})]}):u&&u.length>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(qr,{tone:`warning`,size:`sm`,className:`mr-2`,children:u[0].type}),(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`— `}),(0,I.jsxs)(`span`,{children:[u[0].count??u[0].iterations??u[0].readCount??u[0].repeatCount??u[0].editCount??u[0].agentCount??`?`,`× on`,` `]}),(0,I.jsx)(`code`,{className:`bg-surface-5 px-1 rounded`,children:u[0].file??u[0].command??`unknown`})]}):S.length>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(qr,{tone:`warning`,size:`sm`,className:`mr-2`,children:S[0].type}),(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`— `}),(0,I.jsxs)(`span`,{children:[S[0].count??S[0].iterations??S[0].readCount??S[0].repeatCount??S[0].editCount??S[0].agentCount??`?`,`× on`,` `]}),(0,I.jsx)(`code`,{className:`bg-surface-5 px-1 rounded`,children:S[0].file??S[0].command??`unknown`})]}):null})}),(0,I.jsxs)(zi,{index:3,className:`grid grid-cols-3 gap-3 mb-3`,children:[(0,I.jsx)(So,{}),(0,I.jsx)(Co,{}),(0,I.jsx)(wo,{aggregate:o}),(0,I.jsx)(To,{}),(0,I.jsx)(Do,{aggregate:o})]}),(0,I.jsx)(zi,{index:4,children:(0,I.jsx)(ko,{sessions:c??[],liveSessions:g??[]})}),m&&m.buckets?.length>0&&(0,I.jsx)(zi,{index:5,className:`mb-3`,children:(0,I.jsxs)(B,{padding:`sm`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Activity Today`}),(0,I.jsx)(Za,{variant:`strip`,buckets:m.buckets,maxCount:m.maxCount,bucketSizeMs:m.bucketSizeMs,startTimestamp:m.startTimestamp,ariaLabel:`Today's activity density in 15-minute blocks`})]})}),(0,I.jsx)(zi,{index:6,children:(0,I.jsx)(jo,{})})]})]})}function So(){let{data:e}=L({queryKey:z.qualityProxy,queryFn:yr,refetchInterval:bo});return(0,I.jsxs)(B,{padding:`sm`,className:`h-full`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Quality`}),!e||e.totalSignals===0?(0,I.jsx)(ea,{icon:`checkmark`,title:`Waiting for edits and test runs`,subtitle:`Quality metrics appear after editing files and running tests.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Diff Apply `}),(0,I.jsx)(`span`,{className:ai(e.diffApplyRate),children:e.diffApplyRate===null?`—`:`${(e.diffApplyRate*100).toFixed(0)}%`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Test Pass `}),(0,I.jsx)(`span`,{className:ai(e.testPassRate),children:e.testPassRate===null?`—`:`${(e.testPassRate*100).toFixed(0)}%`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Backtracks `}),(0,I.jsx)(`span`,{className:e.backtrackCount>0?`text-accent-amber`:``,children:e.backtrackCount})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Self-corrections `}),(0,I.jsx)(`span`,{className:`text-ink-subtle`,children:e.selfCorrectionCount})]})]}),e.degradationDetected&&(0,I.jsx)(`div`,{className:`text-accent-amber text-xs mt-2`,children:`⚠ Quality degrading`})]})]})}function Co(){let{data:e}=L({queryKey:z.toolSelectionScore,queryFn:br,refetchInterval:bo});return(0,I.jsxs)(B,{padding:`sm`,className:`h-full`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Tool Selection`}),!e||Array.isArray(e)||e.totalCalls===0?(0,I.jsx)(ea,{icon:`radar`,title:`Waiting for tool calls`,subtitle:`Start a Claude Code session to begin scoring. Reflects today's activity across all sessions.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,I.jsx)(`span`,{className:`text-2xl font-semibold tabular-nums ${oi(e.score)}`,children:e.score.toFixed(2)}),(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted`,children:`/ 1.0`})]}),(0,I.jsxs)(`div`,{className:`text-[10px] text-ink-muted mt-1`,children:[e.penalizedCalls,` of `,e.totalCalls,` calls penalized`]}),(e.redundantReadCount>0||e.repeatedFailureCount>0||e.unusedOutputCount>0)&&(0,I.jsxs)(`div`,{className:`text-[10px] text-ink-subtle mt-1 space-x-2`,children:[e.redundantReadCount>0&&(0,I.jsxs)(`span`,{children:[`re-reads: `,e.redundantReadCount]}),e.repeatedFailureCount>0&&(0,I.jsxs)(`span`,{children:[`repeat fails: `,e.repeatedFailureCount]}),e.unusedOutputCount>0&&(0,I.jsxs)(`span`,{children:[`unused output: `,e.unusedOutputCount]})]}),(0,I.jsx)(`div`,{className:`text-[10px] text-ink-subtle/60 mt-2`,children:`Penalizes: reading the same file 3+ times without editing, repeated tool failures, fetching large outputs never referenced.`})]})]})}function wo({aggregate:e}){let t=e?.latency,n=t?.byTool?Object.entries(t.byTool).filter(e=>e[1]!==null&&e[1].count>0).sort((e,t)=>t[1].p95-e[1].p95).slice(0,4):[];return(0,I.jsxs)(B,{padding:`sm`,className:`h-full`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Latency (ms)`}),!t||!t.overall?(0,I.jsx)(ea,{icon:`clock`,title:`Waiting for tool calls`,subtitle:`Latency percentiles appear after tool calls complete.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex gap-4 text-xs mb-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`p50 `}),(0,I.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:t.overall.p50})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`p95 `}),(0,I.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:t.overall.p95})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`p99 `}),(0,I.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:t.overall.p99})]})]}),n.length>0&&(0,I.jsx)(`div`,{className:`space-y-1`,children:n.map(([e,t])=>(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,I.jsx)(`span`,{className:`text-ink-muted truncate w-28 shrink-0`,children:hi(e)}),(0,I.jsxs)(`span`,{className:`tabular-nums text-ink-subtle`,children:[t.p95,`ms p95`]})]},e))})]})]})}function To(){let{data:e}=L({queryKey:z.modelUsage,queryFn:Dr,refetchInterval:bo}),t=e?.byModel?Object.entries(e.byModel).filter(([,e])=>e.requestCount>0).sort((e,t)=>t[1].totalCostUsd-e[1].totalCostUsd).slice(0,4):[];return(0,I.jsxs)(B,{padding:`sm`,className:`h-full`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Model Usage`}),!e||t.length===0?(0,I.jsx)(ea,{icon:`radar`,title:`No model data yet`,subtitle:`Start a Claude Code session to see model cost breakdown. Resets when the process restarts.`}):(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[t.map(([e,t])=>(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs gap-2`,children:[(0,I.jsx)(`span`,{className:`text-ink-muted truncate`,children:e}),(0,I.jsxs)(`div`,{className:`flex gap-3 shrink-0 tabular-nums`,children:[(0,I.jsxs)(`span`,{className:`text-ink-subtle`,children:[t.requestCount,`req`]}),(0,I.jsxs)(`span`,{className:`text-ink-subtle`,children:[pi(t.costPerMillionTokens),`/1M tok`]}),(0,I.jsx)(`span`,{className:`text-ink-base`,children:fi(t.totalCostUsd)})]})]},e)),e?.mostEfficientModel&&(0,I.jsxs)(`div`,{className:`text-[10px] text-accent-green mt-1`,children:[`Most efficient: `,e.mostEfficientModel]})]})]})}function Eo(e,t){let n=t===null?null:`${t}%`;return e===`excellent`?n?`Cache hit rate is ${n}. Cache is well-structured.`:`Cache is well-structured. No changes needed.`:e===`can_improve`?n?`Cache hit rate is ${n}. Placing stable content before variable content in prompts could improve this.`:`Place stable content before variable content in prompts to improve.`:n?`Cache hit rate is ${n}. Restructuring your system prompt so stable context appears at the top could bring this above 60%.`:`Restructure your system prompt so stable context appears at the top.`}function Do({aggregate:e}){let{data:t}=L({queryKey:z.cacheHealth,queryFn:Or,refetchInterval:bo}),n=e?.cacheHealth,r=!n||n.status===`no_cache_activity`||n.cacheHitRatePct==null;return(0,I.jsxs)(B,{padding:`sm`,className:`h-full`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Cache Health`}),r?(0,I.jsx)(ea,{icon:`radar`,title:`No cache data yet`,subtitle:`Appears once token usage with cache reads is reported.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-baseline gap-2 mb-1`,children:[(0,I.jsxs)(`span`,{className:`text-2xl font-semibold tabular-nums ${n.status===`excellent`?`text-accent-green`:n.status===`needs_attention`?`text-accent-amber`:`text-ink-base`}`,children:[n.cacheHitRatePct,`%`]}),(0,I.jsx)(qr,{tone:n.status===`needs_attention`?`warning`:`neutral`,size:`sm`,children:n.status===`excellent`?`excellent`:n.status.replace(`_`,` `)})]}),n.totalSavingsUsd>0&&(0,I.jsxs)(`div`,{className:`text-xs text-accent-green mb-1`,children:[`$`,n.totalSavingsUsd.toFixed(4),` saved`]}),t?.week_over_week_delta_pts!=null&&t.week_over_week_delta_pts!==0&&(0,I.jsxs)(`div`,{className:`text-[10px] font-medium mb-1 ${t.week_over_week_delta_pts>0?`text-accent-green`:`text-accent-amber`}`,children:[t.week_over_week_delta_pts>0?`↑`:`↓`,Math.abs(t.week_over_week_delta_pts),`pts vs last week`]}),(0,I.jsx)(`div`,{className:`text-[10px] text-ink-subtle/70 leading-snug`,children:Eo(n.status,n.cacheHitRatePct)})]})]})}var Oo=3e3;function ko({sessions:e,liveSessions:t}){let[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(null),[,o]=qt(),s=Jn(e=>e.setActiveSession),{data:c}=L({queryKey:z.sessionCurrent,queryFn:rr}),l=(0,F.useMemo)(()=>{let e=new Set;for(let n of t)e.add(n.sessionId);if(e.size===0)if(c?.liveSessions?.length)for(let t of c.liveSessions)e.add(t);else c?.sessionId&&e.add(c.sessionId);return e},[t,c]),u=(t.length>0?t[0].sessionId:null)??(l.size>0?[...l][0]:null),d=n??u,f=d!==null&&l.has(d),p=n!==null&&!l.has(n);(0,F.useEffect)(()=>{s(d)},[d,s]);let{data:m}=L({queryKey:d?z.sessionReplay(d):[`replay`,`none`],queryFn:()=>gr(d),enabled:d!==null,retry:!1,refetchInterval:f?Oo:!1}),{data:h}=L({queryKey:d?z.sessionSubagents(d):[`subagents`,`none`],queryFn:()=>_r(d),enabled:d!==null,retry:!1,refetchInterval:f?Oo:!1}),{data:g}=L({queryKey:z.workflows,queryFn:Pr,refetchInterval:f?1e4:!1}),_=(0,F.useRef)(null);(0,F.useEffect)(()=>{f&&_.current&&(_.current.scrollTop=_.current.scrollHeight)},[m?.timeline.length,f]);let v=(0,F.useMemo)(()=>{let n=Date.now()-360*60*1e3,r=new Map;for(let e of t)r.set(e.sessionId,e);let i=new Map;for(let t of e){if(!t.sessionId)continue;let e=t.startTime!=null&&No(t.startTime),a=r.has(t.sessionId),o=t.startTime!=null&&t.durationMs!=null?t.startTime+t.durationMs:null,s=o!=null&&o>=n&&No(o);(e||a||s)&&i.set(t.sessionId,t)}for(let e of t)e.sessionId&&(i.has(e.sessionId)||i.set(e.sessionId,{sessionId:e.sessionId,sessionName:e.sessionName,startTime:e.startTime,toolCallCount:0,estimatedCostUsd:null}));let a=e=>{let t=r.get(e.sessionId);return t?t.lastActivity:e.startTime!=null&&e.durationMs!=null?e.startTime+e.durationMs:e.startTime??0};return[...i.values()].sort((e,t)=>a(t)-a(e)).slice(0,10)},[e,t]),y=(0,F.useMemo)(()=>m?.timeline??[],[m]),b=(0,F.useMemo)(()=>Array.isArray(h?.agents)?h.agents:[],[h]),x=(0,F.useMemo)(()=>{let e=null,t=null;for(let n of y){let r=n.timestamp+(n.durationMs??50);(e===null||n.timestamp<e)&&(e=n.timestamp),(t===null||r>t)&&(t=r)}let n=h?.window;return n&&Number.isFinite(n.startMs)&&Number.isFinite(n.endMs)&&(e=e===null?n.startMs:Math.min(e,n.startMs),t=t===null?n.endMs:Math.max(t,n.endMs)),e===null||t===null?{startMs:0,endMs:1}:{startMs:e,endMs:t>e?t:e+1}},[y,h]),S=(0,F.useMemo)(()=>{let e={};if(Array.isArray(g))for(let t of g)t&&typeof t.runId==`string`&&typeof t.status==`string`&&t.parentSessionId===d&&(e[t.runId]=t.status);return e},[g,d]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`glass-card mb-3 grid grid-cols-[220px_1fr] overflow-hidden`,style:{height:`320px`},children:[(0,I.jsxs)(`div`,{className:`border-r border-border-subtle overflow-auto`,children:[(0,I.jsx)(V,{className:`p-2 border-b border-border-subtle`,children:`Session Live Tail`}),v.map(e=>{let t=l.has(e.sessionId);return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>r(e.sessionId),className:`block w-full text-left p-2 border-b border-border-subtle text-xs transition-colors duration-150 hover:bg-surface-5 `+(d===e.sessionId?`bg-surface-5`:``),children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`span`,{className:`font-mono text-ink-base`,children:e.sessionName||e.sessionId.slice(0,8)}),t?(0,I.jsx)(Yr,{label:`live`,size:`sm`}):(0,I.jsx)(`span`,{className:`text-[10px] text-ink-muted`,title:e.startTime?`Started ${ci(e.startTime)}`:void 0,children:e.startTime?ci(e.startTime+(e.durationMs??0)):``})]}),(0,I.jsxs)(`div`,{className:`flex gap-2 mt-0.5 text-[10px] text-ink-subtle`,children:[(0,I.jsxs)(`span`,{children:[e.toolCallCount??0,` calls`]}),e.estimatedCostUsd!=null&&e.estimatedCostUsd>0?(0,I.jsx)(`span`,{children:fi(e.estimatedCostUsd)}):(0,I.jsx)(`span`,{children:`—`})]})]},e.sessionId)}),l.size===0&&v.length===0&&(0,I.jsx)(ea,{icon:`code`,title:`No sessions today`,subtitle:`Start coding with Claude to see sessions here.`})]}),(0,I.jsxs)(`div`,{className:`flex flex-col overflow-hidden`,children:[d&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1 border-b border-border-subtle shrink-0`,children:[(0,I.jsx)(V,{children:`Trace`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p&&(0,I.jsx)(`span`,{"data-testid":`session-ended-badge`,children:(0,I.jsx)(qr,{tone:`neutral`,size:`sm`,uppercase:!0,children:`Session ended`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>o(`/sessions?id=${d}`),className:`text-[10px] text-accent-cyan hover:underline transition-colors duration-150`,children:`full session →`})]})]}),(0,I.jsxs)(`div`,{ref:_,className:`overflow-auto flex-1 p-2`,children:[!d&&(0,I.jsx)(`div`,{className:`text-ink-muted text-xs p-2`,children:`Select a session to view its timeline.`}),d&&y.length===0&&b.length===0&&(0,I.jsx)(ea,{icon:`timeline`,title:f?`Waiting for tool calls`:`No tool calls`,subtitle:f?`Tool calls will appear here in real time.`:`This session has no recorded tool calls.`}),d&&(y.length>0||b.length>0)&&(0,I.jsx)(ma,{sessionId:d,parentEntries:y,agents:b,window:x,runStatusById:S,parentSegments:m?.segments??[],onSelectRun:e=>a(e)},d)]}),f&&d&&(0,I.jsx)(`div`,{className:`border-t border-bg-line px-3 py-2 shrink-0`,children:(0,I.jsx)(mo,{sessionId:d})})]})]}),i!=null&&(0,I.jsx)(Ra,{runId:i,onClose:()=>a(null)})]})}function Ao(e,t){let n=t.find(t=>t.sessionId===e);return n?.sessionName?n.sessionName:e.slice(0,8)}function jo(){let{data:e,isLoading:t,error:n}=L({queryKey:z.alertsRecent,queryFn:async()=>{try{return await hr()}catch(e){if(e instanceof tr)return null;throw e}},refetchInterval:vo,retry:!1});if(e===null)return null;let r=[...e??[]].sort((e,t)=>t.firedAt-e.firedAt);return(0,I.jsxs)(B,{padding:`sm`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Recent Alerts`}),t&&(0,I.jsx)(ea,{variant:`loading`,title:`Loading...`}),n&&(0,I.jsx)(`div`,{className:`text-accent-red text-xs`,children:`Error loading recent alerts.`}),!t&&!n&&r.length===0&&(0,I.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No alerts in recent history.`}),!t&&!n&&r.length>0&&(0,I.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,I.jsx)(`thead`,{className:`text-ink-muted`,children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{className:`text-left pb-1`,children:`when`}),(0,I.jsx)(`th`,{className:`text-left pb-1`,children:`sev`}),(0,I.jsx)(`th`,{className:`text-left pb-1`,children:`rule`}),(0,I.jsx)(`th`,{className:`text-right pb-1`,children:`value / threshold`}),(0,I.jsx)(`th`,{className:`text-left pb-1 pl-2`,children:`state`})]})}),(0,I.jsx)(`tbody`,{children:r.slice(0,50).map(e=>(0,I.jsxs)(`tr`,{className:`border-t border-border-subtle`,children:[(0,I.jsx)(`td`,{className:`py-1 text-ink-subtle tabular-nums whitespace-nowrap`,children:Mo(e.firedAt)}),(0,I.jsxs)(`td`,{className:`py-1`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:yo[e.severity],children:`●`}),` `,(0,I.jsx)(`span`,{className:`text-ink-subtle uppercase tracking-wider text-[10px]`,children:e.severity})]}),(0,I.jsx)(`td`,{className:`py-1`,children:e.title}),(0,I.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[di(e.value),` / `,di(e.threshold)]}),(0,I.jsx)(`td`,{className:`py-1 pl-2 `+(e.state===`firing`?`text-accent-amber`:`text-ink-muted`),children:e.state})]},`${e.id}-${e.firedAt}-${e.state}`))})]})]})}function Mo(e){let t=Math.max(0,Date.now()-e),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}var No=e=>go(e);function Po(e){let t=e.estimatedCostUsd;if(t==null||t<=0||e.startTime==null)return 0;let n=ho(),r=n+864e5,i=e.startTime,a=typeof e.endTime==`number`?e.endTime:typeof e.durationMs==`number`?e.startTime+e.durationMs:Date.now();return a<n||i>=r?0:i>=n&&a<r?t:t*((Math.min(a,r)-Math.max(i,n))/Math.max(1,a-i))}function Fo(e){let t=0;for(let n of e)t+=Po(n);return t}function Io(e){let t=0;for(let n of e)(n.startTime&&No(n.startTime)||Po(n)>0)&&(t+=n.toolCallCount??0);return t}function Lo(e){let t=0;for(let n of e)(n.startTime&&No(n.startTime)||Po(n)>0)&&(t+=n.antiPatterns?.length??0);return t}function Ro(e){let t=Array(24).fill(0);for(let n of e){if(!n.startTime||!No(n.startTime)||n.estimatedCostUsd==null)continue;let e=new Date(n.startTime).getHours();t[e]+=n.estimatedCostUsd}return t.map((e,t)=>({hour:t,cost:e}))}function zo({todayTotal:e,forecastEod:t,hourlySpend:n,subagentUsd:r=0}){let i=t!==null&&Number.isFinite(t),a=i?Math.max(t,e):0,o=i?a-e:0,s=i&&e>0?o/e*100:0,c=n.some(e=>e.cost>0),l=r>0?Math.max(0,e-r):0;return(0,I.jsxs)(B,{padding:`sm`,className:`mb-3 h-full`,children:[(0,I.jsx)(V,{className:`mb-1.5`,children:`Forecast · End of Day`}),i?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,I.jsx)(`span`,{className:`text-lg font-semibold text-accent-cyan tabular-nums`,children:fi(a)}),(0,I.jsx)(`span`,{className:`text-xs text-ink-muted tabular-nums`,children:o>0?(0,I.jsxs)(I.Fragment,{children:[`+`,fi(o),e>0&&` (+${s.toFixed(0)}%)`,` from now`]}):(0,I.jsx)(I.Fragment,{children:`on pace`})})]}),c&&(0,I.jsxs)(`div`,{className:`mt-2`,children:[(0,I.jsx)(Ki,{hours:n}),r>0&&(0,I.jsxs)(`div`,{className:`flex gap-3 mt-1 text-[10px] text-ink-muted tabular-nums`,children:[(0,I.jsxs)(`span`,{children:[`parent `,fi(l)]}),(0,I.jsx)(`span`,{className:`text-ink-subtle`,children:`·`}),(0,I.jsxs)(`span`,{children:[`subagent `,fi(r)]})]})]})]}):(0,I.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`Insufficient data — forecast appears once burn rate stabilizes.`})]})}function Bo(e,t){let{startMs:n,endMs:r,bucketSizeMs:i}=t,a=Math.max(1,Math.ceil((r-n)/i)),o=Array(a).fill(0);for(let t of e){let e=Math.floor((t.timestamp-n)/i);e>=0&&e<a&&o[e]++}return o}function Vo(e){return e<6e5?3e4:e<36e5?6e4:e<144e5?3e5:9e5}var Ho=50,Uo={thrashing:`Edit/Test Thrashing`,stuck_loop:`Stuck Loop`,blind_editing:`Blind Editing`,re_reading:`Repeated Reads`},Wo={running:{tone:`info`,label:`Running`},completed:{tone:`success`,label:`Completed`},failed:{tone:`danger`,label:`Failed`},cancelled:{tone:`warning`,label:`Cancelled`},unknown:{tone:`neutral`,label:`Unknown`}},Go=[{value:`today`,label:`Today`},{value:`7d`,label:`7 days`},{value:`30d`,label:`30 days`},{value:`all`,label:`All`}],Ko=[{value:`all`,label:`All sources`},{value:`script`,label:`Script`},{value:`agent_tool`,label:`Agent tool`}],qo=[{value:`all`,label:`All`},{value:`running`,label:`Running`},{value:`completed`,label:`Completed`},{value:`failed`,label:`Failed`},{value:`cancelled`,label:`Cancelled`}];function Jo(e,t){if(t===`all`||e==null)return!0;let n=typeof e==`number`?e:Date.parse(e);if(!Number.isFinite(n))return!0;let r=Date.now();return n>={today:new Date().setHours(0,0,0,0),"7d":r-10080*60*1e3,"30d":r-720*60*60*1e3}[t]}function Yo(e){let t;try{let n=new URLSearchParams(e);t=n.get(`session`)??n.get(`id`)}catch{return null}if(t==null)return null;let n=t.trim();return n.length===0||n.length>256?null:n}function Xo(e){return typeof e.startTime==`number`?e.startTime:new Date(e.startTime??0).getTime()}function Zo(e){return Xo(e)+(e.durationMs??0)}function Qo(e,t){let n=[...e];switch(t){case`date`:n.sort((e,t)=>Xo(t)-Xo(e));break;case`lastActive`:n.sort((e,t)=>Zo(t)-Zo(e));break;case`cost`:n.sort((e,t)=>(t.estimatedCostUsd??0)-(e.estimatedCostUsd??0));break;case`calls`:n.sort((e,t)=>(t.toolCallCount??0)-(e.toolCallCount??0));break}return n}function $o(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function es(){let e=Jt(),[t,n]=(0,F.useState)(()=>Yo(window.location.search)),[r,i]=(0,F.useState)(`date`),[a,o]=(0,F.useState)(`all`),[s,c]=(0,F.useState)(`all`),[l,u]=(0,F.useState)(`all`),[d,f]=(0,F.useState)(null),[p,m]=(0,F.useState)(()=>new Set),[h,g]=(0,F.useState)(()=>new Set),_=(0,F.useMemo)(()=>Yo(e),[e]);(0,F.useEffect)(()=>{_&&n(_)},[_]);let v=L({queryKey:z.sessionsList(Ho),queryFn:()=>ir(Ho),refetchInterval:1e4}),{data:y}=L({queryKey:z.workflows,queryFn:Pr,refetchInterval:1e4}),b=L({queryKey:z.sessionCurrent,queryFn:rr,refetchInterval:1e4}),x=(0,F.useMemo)(()=>{let e=new Set;if(b.data?.liveSessions?.length)for(let t of b.data.liveSessions)e.add(t);else b.data?.sessionId&&e.add(b.data.sessionId);return e},[b.data]),S=L({queryKey:t?z.sessionDetail(t):[`session`,`none`],queryFn:()=>sr(t),enabled:t!==null,refetchInterval:b.isLoading||t&&x.has(t)?1e4:!1}),C=(0,F.useMemo)(()=>Qo(v.data??[],r),[v.data,r]),w=(0,F.useMemo)(()=>Array.isArray(y)?y:[],[y]),T=(0,F.useMemo)(()=>w.filter(e=>!(!Jo(e.startedAt,a)||s!==`all`&&e.runSource!==s||l!==`all`&&e.status!==l)),[w,a,s,l]),E=(0,F.useMemo)(()=>{let e=T.length,t=T.reduce((e,t)=>e+(t.agentCount??0),0),n=T.map(e=>e.totalUsd).filter(e=>e!=null),r=n.length>0?n.reduce((e,t)=>e+t,0):null,i=T.map(e=>e.durationMs).filter(e=>e!=null);return{totalRuns:e,totalAgents:t,totalSpend:r,avgDurationMs:i.length>0?i.reduce((e,t)=>e+t,0)/i.length:null}},[T]),D=(0,F.useMemo)(()=>{let e=new Map;for(let t of T){let n=t.parentSessionId;if(typeof n!=`string`)continue;let r=e.get(n);r?r.push(t):e.set(n,[t])}return e},[T]),O=a!==`all`||s!==`all`||l!==`all`,k=(0,F.useMemo)(()=>O?C.filter(e=>D.has(e.sessionId)):C,[O,C,D]);(0,F.useEffect)(()=>{if(t)return;let e=x.size>0?[...x][0]:null;e?n(e):C.length>0&&n(C[0].sessionId)},[x,C,t]);let A=e=>{n(e)},j=(0,F.useCallback)(e=>{m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ee=(0,F.useCallback)(e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),M=(0,F.useCallback)(e=>{f(e)},[]);return(0,I.jsxs)(`section`,{className:`flex flex-col h-full`,children:[(0,I.jsx)(`div`,{className:`h-8 overflow-hidden rounded-lg mb-2 shrink-0`,children:(0,I.jsx)(to,{theme:`sessions`})}),(0,I.jsx)(`h1`,{className:`text-lg font-semibold gradient-text mb-2 shrink-0`,children:`Sessions`}),(0,I.jsx)(B,{tone:`static`,padding:`sm`,className:`mb-2 shrink-0`,children:(0,I.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-4 divide-x divide-border-subtle`,children:[(0,I.jsx)(`div`,{className:`px-3 first:pl-0`,children:(0,I.jsx)(U,{label:`Workflow runs`,value:String(E.totalRuns),numericValue:E.totalRuns,animate:!0})}),(0,I.jsx)(`div`,{className:`px-3`,children:(0,I.jsx)(U,{label:`Subagents`,value:String(E.totalAgents),numericValue:E.totalAgents,animate:!0})}),(0,I.jsx)(`div`,{className:`px-3`,children:(0,I.jsx)(U,{label:`Workflow spend`,value:pi(E.totalSpend),tone:E.totalSpend===null?`neutral`:`warn`})}),(0,I.jsx)(`div`,{className:`px-3`,children:(0,I.jsx)(U,{label:`Avg duration`,value:E.avgDurationMs===null?`—`:ui(E.avgDurationMs)})})]})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap mb-2 shrink-0`,children:[(0,I.jsx)(Qr,{value:a,onChange:o,options:Go,ariaLabel:`Time window`}),(0,I.jsx)(`div`,{className:`h-4 w-px bg-border-subtle`,"aria-hidden":`true`}),(0,I.jsx)(`div`,{className:`flex items-center gap-1.5`,role:`group`,"aria-label":`Run source filter`,children:Ko.map(e=>(0,I.jsx)(`button`,{type:`button`,"aria-pressed":s===e.value,onClick:()=>c(e.value),className:[`px-2.5 py-1 rounded-full text-[11px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,s===e.value?`bg-accent-cyan/20 text-accent-cyan font-medium`:`text-ink-muted hover:text-ink-subtle`].join(` `),children:e.label},e.value))}),(0,I.jsx)(`div`,{className:`h-4 w-px bg-border-subtle`,"aria-hidden":`true`}),(0,I.jsx)(`div`,{className:`flex items-center gap-1.5`,role:`group`,"aria-label":`Status filter`,children:qo.map(e=>{let t=l===e.value;return(0,I.jsx)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>u(e.value),className:[`px-2.5 py-1 rounded-full text-[11px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,t?`bg-accent-green/20 text-accent-green font-medium`:`text-ink-muted hover:text-ink-subtle`].join(` `),children:e.label},e.value)})}),O&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>{o(`all`),c(`all`),u(`all`)},className:`text-[10px] text-ink-muted hover:text-ink-subtle underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded-sm`,children:`Clear filters`})]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-[260px_1fr] gap-3 flex-1 min-h-0`,children:[(0,I.jsxs)(B,{padding:`none`,tone:`static`,className:`overflow-hidden flex flex-col`,children:[(0,I.jsx)(`header`,{className:`p-2 border-b border-border-subtle`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(V,{as:`h2`,children:`List`}),(0,I.jsxs)(`select`,{value:r,onChange:e=>i(e.target.value),className:`text-[10px] bg-surface-5 border border-border-medium rounded-md px-1.5 py-0.5 text-ink-subtle`,children:[(0,I.jsx)(`option`,{value:`date`,children:`Newest`}),(0,I.jsx)(`option`,{value:`lastActive`,children:`Last active`}),(0,I.jsx)(`option`,{value:`cost`,children:`Cost`}),(0,I.jsx)(`option`,{value:`calls`,children:`Calls`})]})]})}),(0,I.jsxs)(`div`,{className:`overflow-auto`,children:[v.isLoading&&(0,I.jsx)(ea,{variant:`loading`,icon:`timeline`,title:`Loading sessions`}),!v.isLoading&&k.length===0&&x.size===0&&(0,I.jsx)(ea,{icon:`code`,title:O?`No matching sessions`:`No sessions yet`,subtitle:O?`No sessions own a workflow run matching these filters.`:`Start coding with Claude to see your sessions here.`}),k.map(e=>(0,I.jsx)(ts,{row:e,isLive:x.has(e.sessionId),isSelected:t===e.sessionId,isExpanded:p.has(e.sessionId),sortKey:r,runs:D.get(e.sessionId)??[],expandedRuns:h,onSelect:A,onToggleSession:j,onToggleRun:ee,onOpenRun:M},e.sessionId)),C.length>=Ho&&(0,I.jsxs)(`div`,{className:`p-2 text-[10px] text-ink-muted text-center border-t border-border-subtle`,children:[`Showing `,Ho,` most recent sessions.`]})]})]}),(0,I.jsxs)(`div`,{className:`glass-card glass-card-static p-4 overflow-auto`,children:[!t&&(0,I.jsx)(ea,{icon:`timeline`,title:`Loading sessions`,subtitle:`Selecting the most recent session…`}),t&&S.isLoading&&(0,I.jsx)(ea,{variant:`loading`,icon:`timeline`,title:`Loading detail`}),t&&S.data&&(0,I.jsx)(is,{data:S.data,isLive:!!t&&x.has(t),onOpenRun:M})]})]}),d!=null&&(0,I.jsx)(Ra,{runId:d,onClose:()=>f(null)})]})}function ts({row:e,isLive:t,isSelected:n,isExpanded:r,sortKey:i,runs:a,expandedRuns:o,onSelect:s,onToggleSession:c,onToggleRun:l,onOpenRun:u}){return(0,I.jsxs)(`div`,{className:`border-b border-border-subtle`,children:[(0,I.jsxs)(`div`,{className:`flex items-stretch text-xs transition-colors duration-150 hover:bg-surface-5 `+(n?`bg-surface-5`:``),children:[(0,I.jsx)(`button`,{type:`button`,"aria-label":r?`Collapse workflows`:`Expand workflows`,"aria-expanded":r,onClick:t=>{t.stopPropagation(),c(e.sessionId)},className:`shrink-0 flex items-center justify-center w-6 text-ink-muted hover:text-ink-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:r?(0,I.jsx)(vn,{size:13,"aria-hidden":`true`}):(0,I.jsx)(yn,{size:13,"aria-hidden":`true`})}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>s(e.sessionId),className:`flex-1 min-w-0 text-left py-2 pr-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,I.jsx)(`span`,{className:`font-mono text-ink-base truncate`,children:e.sessionName||e.sessionId.slice(0,8)}),t&&(0,I.jsx)(Yr,{size:`sm`,label:`live`,className:`shrink-0`})]}),(0,I.jsxs)(`div`,{className:`flex justify-between mt-1 text-ink-subtle text-[11px] tabular-nums`,children:[(0,I.jsxs)(`span`,{children:[e.toolCallCount??0,` calls`]}),(0,I.jsx)(`span`,{className:`text-ink-muted`,title:i===`lastActive`&&e.startTime?`Started ${si(e.startTime)}`:void 0,children:e.startTime?si(i===`lastActive`?Zo(e):e.startTime):`—`}),(0,I.jsx)(`span`,{children:pi(e.estimatedCostUsd)})]})]})]}),r&&(0,I.jsx)(`div`,{className:`pl-3 border-l border-border-subtle ml-3 mb-1`,children:a.length===0?(0,I.jsx)(`div`,{className:`py-1.5 pl-1 text-[10px] text-ink-muted`,children:`No workflows in this session.`}):a.map(e=>(0,I.jsx)(ns,{run:e,isExpanded:o.has(e.runId),onToggleRun:l,onOpenRun:u},e.runId))})]})}function ns({run:e,isExpanded:t,onToggleRun:n,onOpenRun:r}){let{data:i}=L({queryKey:z.workflowDetail(e.runId),queryFn:()=>Fr(e.runId),enabled:t}),a=(0,F.useMemo)(()=>i?.agents??[],[i]),o=Wo[e.status]??Wo.unknown;return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`flex items-stretch hover:bg-surface-5 rounded transition-colors`,children:[(0,I.jsx)(`button`,{type:`button`,"aria-label":t?`Collapse agents`:`Expand agents`,"aria-expanded":t,onClick:t=>{t.stopPropagation(),n(e.runId)},className:`shrink-0 flex items-center justify-center w-5 text-ink-muted hover:text-ink-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:t?(0,I.jsx)(vn,{size:12,"aria-hidden":`true`}):(0,I.jsx)(yn,{size:12,"aria-hidden":`true`})}),(0,I.jsxs)(`button`,{type:`button`,"aria-label":`View workflow run ${e.workflowName??e.runId}`,onClick:()=>r(e.runId),className:`flex-1 min-w-0 flex items-center gap-1.5 text-left py-1.5 pr-1 text-[10px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 rounded`,children:[(0,I.jsx)(`span`,{className:`flex-1 min-w-0 font-medium text-ink-base truncate`,children:e.workflowName??e.runId}),(0,I.jsxs)(`span`,{className:`text-ink-muted tabular-nums shrink-0`,children:[e.agentCount==null?0:e.agentCount,`a`]}),(0,I.jsx)(`span`,{className:`text-ink-muted tabular-nums shrink-0`,children:pi(e.totalUsd)}),(0,I.jsx)(qr,{tone:o.tone,size:`sm`,bordered:!0,children:o.label})]})]}),t&&(0,I.jsx)(`div`,{className:`pl-3 border-l border-border-subtle ml-2.5`,children:a.length===0?(0,I.jsx)(`div`,{className:`py-1 pl-1 text-[10px] text-ink-muted`,children:`No agents recorded.`}):a.map(t=>(0,I.jsxs)(`button`,{type:`button`,"aria-label":`View agent ${t.label} in run ${e.workflowName??e.runId}`,onClick:()=>r(e.runId),className:`flex w-full items-center gap-1.5 text-left py-1 pr-1 text-[10px] hover:bg-surface-5 rounded transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40`,children:[(0,I.jsx)(`span`,{className:`flex-1 min-w-0 text-ink-subtle truncate`,title:t.label,children:t.label}),(0,I.jsx)(`span`,{className:`font-mono text-ink-muted truncate max-w-[72px] shrink-0`,title:t.model,children:t.model}),(0,I.jsx)(`span`,{className:`text-ink-muted tabular-nums shrink-0`,children:$o(t.tokens)})]},t.agentId))})]})}function rs(e){return e===`Read`?`bg-accent-blue/80`:e===`Edit`||e===`Write`?`bg-accent-green/80`:e===`Bash`?`bg-accent-purple/80`:e===`Agent`?`bg-accent-teal/80`:`bg-ink-subtle/80`}function is({data:e,isLive:t,onOpenRun:n}){let r=e.toolBreakdown??{},i=Object.entries(r).sort((e,t)=>t[1]-e[1]),a=e.toolCallCount??0,o=e.durationMs==null?null:ui(e.durationMs),s=e.timeline??[],c=s.length>0?s[0].timestamp:0;return s.length===0&&i.length===0?(0,I.jsx)(ea,{icon:`timeline`,title:`No tool calls`,subtitle:`This session has no recorded tool calls.`}):(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`flex items-baseline justify-between mb-3`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h2`,{className:`text-xs tracking-wider text-ink-muted flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`font-mono text-ink-base ${e.sessionName?`font-medium`:`uppercase`}`,children:e.sessionName||e.sessionId.slice(0,8)}),(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsxs)(`span`,{className:`uppercase`,children:[a,` calls`]}),o&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsx)(`span`,{className:`tabular-nums`,children:o})]}),t&&(0,I.jsx)(Yr,{size:`sm`,label:`live`})]}),c>0&&(0,I.jsx)(`div`,{className:`text-[11px] text-ink-subtle mt-0.5`,children:new Date(c).toLocaleString(void 0,{weekday:`short`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})})]})}),(0,I.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 mb-4 text-xs`,children:[e.model&&(0,I.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,I.jsx)(V,{children:`Model`}),(0,I.jsx)(`div`,{className:`font-mono`,children:e.model})]}),e.estimatedCostUsd!=null&&(0,I.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,I.jsx)(V,{children:`Cost`}),(0,I.jsx)(`div`,{className:`tabular-nums`,children:fi(e.estimatedCostUsd)})]}),e.outcome&&(0,I.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,I.jsx)(V,{children:`Status`}),(0,I.jsx)(`div`,{className:`capitalize`,children:e.outcome})]})]}),(e.antiPatterns?.length??0)>0&&(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsx)(V,{className:`mb-1`,children:`Anti-Patterns`}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.antiPatterns.map(({type:e,count:t})=>(0,I.jsxs)(qr,{tone:`warning`,size:`sm`,bordered:!0,children:[Uo[e]??e,(0,I.jsxs)(`span`,{className:`opacity-70`,children:[`× `,t]})]},e))})]}),(e.qualityProxy||e.toolSelectionScore)&&(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 mb-4`,children:[e.qualityProxy&&(0,I.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-3`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Session Quality`}),(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Diff Apply `}),(0,I.jsx)(`span`,{className:ai(e.qualityProxy.diffApplyRate),children:e.qualityProxy.diffApplyRate===null?`—`:`${(e.qualityProxy.diffApplyRate*100).toFixed(0)}%`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Test Pass `}),(0,I.jsx)(`span`,{className:ai(e.qualityProxy.testPassRate),children:e.qualityProxy.testPassRate===null?`—`:`${(e.qualityProxy.testPassRate*100).toFixed(0)}%`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Backtracks `}),(0,I.jsx)(`span`,{className:e.qualityProxy.backtrackCount>0?`text-accent-amber`:``,children:e.qualityProxy.backtrackCount})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-ink-muted`,children:`Self-corrections `}),(0,I.jsx)(`span`,{className:`text-ink-subtle`,children:e.qualityProxy.selfCorrectionCount})]})]})]}),e.toolSelectionScore&&(0,I.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-3`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Tool Selection`}),(0,I.jsx)(`div`,{className:`text-2xl font-semibold tabular-nums ${oi(e.toolSelectionScore.score)}`,children:e.toolSelectionScore.score.toFixed(2)}),(0,I.jsxs)(`div`,{className:`text-[10px] text-ink-muted mt-1`,children:[`re-reads: `,e.toolSelectionScore.redundantReadCount,` · repeat fails:`,` `,e.toolSelectionScore.repeatedFailureCount,` · unused:`,` `,e.toolSelectionScore.unusedOutputCount]})]})]}),t&&(0,I.jsx)(`div`,{className:`mb-4`,children:(0,I.jsx)(mo,{sessionId:e.sessionId})}),i.length>0&&(0,I.jsx)(os,{breakdownEntries:i,totalCalls:a,isLive:t,sessionId:e.sessionId}),(0,I.jsx)(cs,{timeline:s}),(e.filesRead?.length??0)>0&&(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsx)(V,{className:`mb-1`,children:`Files Read`}),(0,I.jsx)(`ul`,{className:`text-[11px] text-ink-subtle space-y-0.5`,children:e.filesRead.map(e=>(0,I.jsx)(`li`,{className:`font-mono truncate`,children:e.split(`/`).slice(-2).join(`/`)},e))})]}),(e.filesModified?.length??0)>0&&(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsx)(V,{className:`mb-1`,children:`Files Modified`}),(0,I.jsx)(`ul`,{className:`text-[11px] text-ink-subtle space-y-0.5`,children:e.filesModified.map(e=>(0,I.jsx)(`li`,{className:`font-mono truncate`,children:e.split(`/`).slice(-2).join(`/`)},e))})]}),(0,I.jsx)(as,{sessionId:e.sessionId,isLive:t,parentEntries:s,onOpenRun:n},e.sessionId)]})}function as({sessionId:e,isLive:t,parentEntries:n,onOpenRun:r}){let{data:i,isLoading:a,isError:o}=L({queryKey:z.sessionSubagents(e),queryFn:()=>_r(e),retry:!1,refetchInterval:t?1e4:!1}),{data:s}=L({queryKey:z.workflows,queryFn:Pr,refetchInterval:t?1e4:3e4}),c=(0,F.useMemo)(()=>{let t={};if(!Array.isArray(s))return t;for(let n of s)n.parentSessionId===e&&(t[n.runId]=n.status);return t},[s,e]),l=(0,F.useMemo)(()=>i?.agents??[],[i]),u=(0,F.useMemo)(()=>{let e=i!==void 0&&(i.agents?.length??0)>0,t=e?i.window.startMs:null,r=e?i.window.endMs:null,a=null,o=null;for(let e of n){let t=e.timestamp,n=e.timestamp+(e.durationMs??50);(a===null||t<a)&&(a=t),(o===null||n>o)&&(o=n)}let s=[a,t].filter(e=>e!==null),c=[o,r].filter(e=>e!==null);return s.length===0||c.length===0?null:{startMs:Math.min(...s),endMs:Math.max(...c)}},[i,n]),d=(0,F.useMemo)(()=>n.map(e=>({timestamp:e.timestamp,toolName:e.toolName,durationMs:e.durationMs,success:e.success,filePath:e.filePath,command:e.command})),[n]);return(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsx)(V,{className:`mb-2`,children:`Session trace`}),(0,I.jsx)(B,{tone:`static`,padding:`sm`,children:a?(0,I.jsx)(ea,{variant:`loading`,icon:`radar`,title:`Loading subagents`}):o||i===void 0?(0,I.jsx)(ma,{sessionId:e,parentEntries:d,agents:[],window:u??{startMs:0,endMs:1},onSelectRun:r,runStatusById:c}):(0,I.jsx)(ma,{sessionId:e,parentEntries:d,agents:l,window:u??i.window,onSelectRun:r,runStatusById:c})})]})}function os({breakdownEntries:e,totalCalls:t,isLive:n,sessionId:r}){let[i,a]=(0,F.useState)(`calls`),o=`/api/context?sessionId=${encodeURIComponent(r)}`,{data:s}=L({queryKey:[`context`,r],queryFn:()=>fetch(o).then(e=>e.ok?e.json():null),refetchInterval:1e4,enabled:n&&i===`context`}),c=s?.toolContributions??[],l=c.length>0?c[0].estimatedTokens:0;return(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,I.jsx)(V,{children:`Tools`}),n&&(0,I.jsx)(Qr,{value:i,onChange:a,options:[{value:`calls`,label:`Calls`},{value:`context`,label:`Context`}],size:`sm`,tone:`cyan`,ariaLabel:`Tools view`})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i===`calls`&&e.map(([e,n])=>{let r=t>0?n/t*100:0;return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,I.jsx)(`span`,{className:`w-28 text-ink-subtle truncate`,title:e,children:hi(e)}),(0,I.jsx)(`div`,{className:`flex-1 h-3 bg-surface-3 relative rounded`,children:(0,I.jsx)(`div`,{className:`h-3 rounded ${rs(e)}`,style:{width:`${r}%`}})}),(0,I.jsx)(`span`,{className:`w-10 text-right text-ink-muted tabular-nums`,children:n})]},e)}),i===`context`&&c.map(e=>{let t=l>0?e.estimatedTokens/l*100:0;return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,I.jsx)(`span`,{className:`w-28 text-ink-subtle truncate`,title:e.tool,children:hi(e.tool)}),(0,I.jsx)(`div`,{className:`flex-1 h-3 bg-surface-3 relative rounded`,children:(0,I.jsx)(`div`,{className:`h-3 rounded bg-accent-amber/80`,style:{width:`${t}%`}})}),(0,I.jsxs)(`span`,{className:`w-16 text-right text-ink-muted tabular-nums text-[10px]`,children:[`~`,ss(e.estimatedTokens)]})]},e.tool)}),i===`context`&&c.length===0&&(0,I.jsx)(`div`,{className:`text-[11px] text-ink-muted`,children:`No context data available yet`})]})]})}function ss(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function cs({timeline:e}){let t=(0,F.useMemo)(()=>{if(e.length<2)return null;let t=e[0].timestamp,n=e[e.length-1].timestamp,r=n-t;if(r<1e3)return null;let i=Vo(r),a=Bo(e,{startMs:t,endMs:n+i,bucketSizeMs:i});return{buckets:a,maxCount:Math.max(...a,1),bucketSizeMs:i,startMs:t}},[e]);return t?(0,I.jsxs)(`div`,{className:`mb-4`,children:[(0,I.jsx)(V,{className:`mb-1`,children:`Activity Density`}),(0,I.jsx)(Za,{variant:`strip`,buckets:t.buckets,maxCount:t.maxCount,bucketSizeMs:t.bucketSizeMs,startTimestamp:t.startMs,ariaLabel:`Session activity density`})]}):null}function ls(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ls(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function us(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ls(e))&&(r&&(r+=` `),r+=t);return r}var ds=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function fs(e){return typeof e==`string`&&ds.includes(e)}var ps=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function ms(e){return typeof e==`string`&&ps.has(e)}function hs(e){return typeof e==`string`&&e.startsWith(`data-`)}function gs(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(ms(n)||hs(n))&&(t[n]=e[n]);return t}function _s(e){if(e==null)return null;if((0,F.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return gs(t)}return typeof e==`object`&&!Array.isArray(e)?gs(e):null}function vs(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(ms(n)||hs(n)||fs(n))&&(t[n]=e[n]);return t}function ys(e){return e==null?null:(0,F.isValidElement)(e)?vs(e.props):typeof e==`object`&&!Array.isArray(e)?vs(e):null}var bs=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function xs(){return xs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xs.apply(null,arguments)}function Ss(e,t){if(e==null)return{};var n,r,i=Cs(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Cs(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ws=(0,F.forwardRef)((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,l=e.desc,u=Ss(e,bs),d=a||{width:r,height:i,x:0,y:0},f=us(`recharts-surface`,o);return F.createElement(`svg`,xs({},vs(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),F.createElement(`title`,null,c),F.createElement(`desc`,null,l),n)}),Ts=[`children`,`className`];function Es(){return Es=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Es.apply(null,arguments)}function Ds(e,t){if(e==null)return{};var n,r,i=Os(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Os(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ks=F.forwardRef((e,t)=>{var n=e.children,r=e.className,i=Ds(e,Ts),a=us(`recharts-layer`,r);return F.createElement(`g`,Es({className:a},vs(i),{ref:t}),n)}),As=o((e=>{function t(e){return e===`__proto__`}e.isUnsafeProperty=t})),js=o((e=>{function t(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}e.isDeepKey=t})),Ms=o((e=>{function t(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}e.toKey=t})),Ns=o((e=>{function t(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(t).join(`,`);let n=String(e);return n===`0`&&Object.is(Number(e),-0)?`-0`:n}e.toString=t})),Ps=o((e=>{var t=Ms(),n=Ns();function r(e){if(Array.isArray(e))return e.map(t.toKey);if(typeof e==`symbol`)return[e];e=n.toString(e);let r=[],i=e.length;if(i===0)return r;let a=0,o=``,s=``,c=!1;for(e.charCodeAt(0)===46&&(r.push(``),a++);a<i;){let t=e[a];s?t===`\\`&&a+1<i?(a++,o+=e[a]):t===s?s=``:o+=t:c?t===`"`||t===`'`?s=t:t===`]`?(c=!1,r.push(o),o=``):o+=t:t===`[`?(c=!0,o&&=(r.push(o),``)):t===`.`?o&&=(r.push(o),``):o+=t,a++}return o&&r.push(o),r}e.toPath=r})),Fs=o((e=>{var t=As(),n=js(),r=Ms(),i=Ps();function a(e,s,c){if(e==null)return c;switch(typeof s){case`string`:{if(t.isUnsafeProperty(s))return c;let r=e[s];return r===void 0?n.isDeepKey(s)?a(e,i.toPath(s),c):c:r}case`number`:case`symbol`:{typeof s==`number`&&(s=r.toKey(s));let t=e[s];return t===void 0?c:t}default:{if(Array.isArray(s))return o(e,s,c);if(s=Object.is(s?.valueOf(),-0)?`-0`:String(s),t.isUnsafeProperty(s))return c;let n=e[s];return n===void 0?c:n}}}function o(e,n,r){if(n.length===0)return r;let i=e;for(let e=0;e<n.length;e++){if(i==null||t.isUnsafeProperty(n[e]))return r;i=i[n[e]]}return i===void 0?r:i}e.get=a})),Is=o(((e,t)=>{t.exports=Fs().get})),Ls=4;function Rs(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ls),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function zs(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+Rs(i)+n},``)}var Bs=l(Is()),Vs=e=>e===0?0:e>0?1:-1,Hs=e=>typeof e==`number`&&e!=+e,Us=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,G=e=>(typeof e==`number`||e instanceof Number)&&!Hs(e),Ws=e=>G(e)||typeof e==`string`,Gs=0,Ks=e=>{var t=++Gs;return`${e||``}${t}`},qs=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!G(e)&&typeof e!=`string`)return n;var i;if(Us(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return Hs(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},Js=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Ys(e,t,n){return G(e)&&G(t)?Rs(e+n*(t-e)):t}function Xs(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):(0,Bs.default)(e,t))===n)}var Zs=e=>e==null,Qs=e=>Zs(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function $s(e){return e!=null}function ec(){}function tc(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function nc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nc(Object(n),!0).forEach(function(t){ic(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ic(e,t,n){return(t=ac(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ac(e){var t=oc(e,`string`);return typeof t==`symbol`?t:t+``}function oc(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var sc=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=tc(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var O={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(O.height=Math.max(E.y+E.height-(l+u),0),O.width=f),O}if(n===`left`){var k={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(k.x-E.x,0),k.height=u),k}if(n===`right`){var A={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(A.width=Math.max(E.x+E.width-A.x,0),A.height=u),A}var j=o&&E?{width:g,height:u}:{};return n===`insideLeft`?rc({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},j):n===`insideRight`?rc({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},j):n===`insideTop`?rc({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},j):n===`insideBottom`?rc({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},j):n===`insideTopLeft`?rc({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},j):n===`insideTopRight`?rc({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},j):n===`insideBottomLeft`?rc({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},j):n===`insideBottomRight`?rc({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},j):n&&typeof n==`object`&&(G(n.x)||Us(n.x))&&(G(n.y)||Us(n.y))?rc({x:c+qs(n.x,g),y:l+qs(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},j):rc({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},j)},cc=[`top`,`left`,`right`,`bottom`];function lc(e){return e==null?!1:typeof e==`object`||cc.includes(e)}var uc=(0,F.createContext)(null);function dc(e){return function(){return e}}var fc=Math.PI,pc=2*fc,mc=1e-6,hc=pc-mc;function gc(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function _c(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return gc;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var vc=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?gc:_c(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>mc)if(!(Math.abs(u*s-c*l)>mc)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((fc-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>mc&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>mc||Math.abs(this._y1-l)>mc)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%pc+pc),d>hc?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>mc&&this._append`A${n},${n},0,${+(d>=fc)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function yc(){return new vc}yc.prototype=vc.prototype;function bc(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new vc(t)}Array.prototype.slice;function xc(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Sc(e){this._context=e}Sc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Cc(e){return new Sc(e)}function wc(e){return e[0]}function Tc(e){return e[1]}function Ec(e,t){var n=dc(!0),r=null,i=Cc,a=null,o=bc(s);e=typeof e==`function`?e:e===void 0?wc:dc(e),t=typeof t==`function`?t:t===void 0?Tc:dc(t);function s(s){var c,l=(s=xc(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:dc(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:dc(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:dc(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function Dc(e,t,n){var r=null,i=dc(!0),a=null,o=Cc,s=null,c=bc(l);e=typeof e==`function`?e:e===void 0?wc:dc(+e),t=typeof t==`function`?t:dc(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Tc:dc(+n);function l(l){var u,d,f,p=(l=xc(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Ec().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:dc(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:dc(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:dc(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:dc(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:dc(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:dc(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:dc(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var Oc=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function kc(e){return new Oc(e,!0)}function Ac(e){return new Oc(e,!1)}function jc(){}function Mc(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Nc(e){this._context=e}Nc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Mc(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Mc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Pc(e){return new Nc(e)}function Fc(e){this._context=e}Fc.prototype={areaStart:jc,areaEnd:jc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Mc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ic(e){return new Fc(e)}function Lc(e){this._context=e}Lc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Mc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rc(e){return new Lc(e)}function zc(e){this._context=e}zc.prototype={areaStart:jc,areaEnd:jc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Bc(e){return new zc(e)}function Vc(e){return e<0?-1:1}function Hc(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Vc(a)+Vc(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Uc(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Wc(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function Gc(e){this._context=e}Gc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Wc(this,this._t0,Uc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Wc(this,Uc(this,n=Hc(this,e,t)),n);break;default:Wc(this,this._t0,n=Hc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Kc(e){this._context=new qc(e)}(Kc.prototype=Object.create(Gc.prototype)).point=function(e,t){Gc.prototype.point.call(this,t,e)};function qc(e){this._context=e}qc.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Jc(e){return new Gc(e)}function Yc(e){return new Kc(e)}function Xc(e){this._context=e}Xc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Zc(e),i=Zc(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Zc(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Qc(e){return new Xc(e)}function $c(e,t){this._context=e,this._t=t}$c.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function el(e){return new $c(e,.5)}function tl(e){return new $c(e,0)}function nl(e){return new $c(e,1)}function rl(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function il(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function al(e,t){return e[t]}function ol(e){let t=[];return t.key=e,t}function sl(){var e=dc([]),t=il,n=rl,r=al;function i(i){var a=Array.from(e.apply(this,arguments),ol),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=xc(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:dc(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:dc(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?il:typeof e==`function`?e:dc(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??rl,i):n},i}function cl(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}rl(e,t)}}function ll(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}rl(e,t)}}function ul(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,rl(e,t)}}var dl=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,fl=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,F.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{fs(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},pl=(e,t,n)=>r=>(e(t,n,r),null),ml=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];fs(i)&&typeof a==`function`&&(r||={},r[i]=pl(a,t,n))}),r};function hl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hl(Object(n),!0).forEach(function(t){_l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _l(e,t,n){return(t=vl(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vl(e){var t=yl(e,`string`);return typeof t==`symbol`?t:t+``}function yl(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function bl(e,t){var n=gl({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}var xl=o((e=>{function t(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}e.uniqBy=t})),Sl=o((e=>{function t(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}e.ary=t})),Cl=o((e=>{function t(e){return e}e.identity=t})),wl=o((e=>{var t=Fs();function n(e){return function(n){return t.get(n,e)}}e.property=n})),Tl=o((e=>{function t(e){return e==null||typeof e!=`object`&&typeof e!=`function`}e.isPrimitive=t})),El=o((e=>{function t(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}e.isTypedArray=t})),Dl=o((e=>{function t(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}e.getSymbols=t})),Ol=o((e=>{function t(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}e.getTag=t})),kl=o((e=>{e.argumentsTag=`[object Arguments]`,e.arrayBufferTag=`[object ArrayBuffer]`,e.arrayTag=`[object Array]`,e.bigInt64ArrayTag=`[object BigInt64Array]`,e.bigUint64ArrayTag=`[object BigUint64Array]`,e.booleanTag=`[object Boolean]`,e.dataViewTag=`[object DataView]`,e.dateTag=`[object Date]`,e.errorTag=`[object Error]`,e.float32ArrayTag=`[object Float32Array]`,e.float64ArrayTag=`[object Float64Array]`,e.functionTag=`[object Function]`,e.int16ArrayTag=`[object Int16Array]`,e.int32ArrayTag=`[object Int32Array]`,e.int8ArrayTag=`[object Int8Array]`,e.mapTag=`[object Map]`,e.numberTag=`[object Number]`,e.objectTag=`[object Object]`,e.regexpTag=`[object RegExp]`,e.setTag=`[object Set]`,e.stringTag=`[object String]`,e.symbolTag=`[object Symbol]`,e.uint16ArrayTag=`[object Uint16Array]`,e.uint32ArrayTag=`[object Uint32Array]`,e.uint8ArrayTag=`[object Uint8Array]`,e.uint8ClampedArrayTag=`[object Uint8ClampedArray]`})),Al=o((e=>{e.globalThis_=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})()||Function(`return this`)()})),jl=o((e=>{var t=Al();function n(e){return t.globalThis_.Buffer!==void 0&&t.globalThis_.Buffer.isBuffer(e)}e.isBuffer=n})),Ml=o((e=>{var t=Tl(),n=El(),r=Dl(),i=Ol(),a=kl(),o=jl();function s(e,t){return c(e,void 0,e,new Map,t)}function c(e,r,i,a=new Map,s=void 0){let d=s?.(e,r,i,a);if(d!==void 0)return d;if(t.isPrimitive(e))return e;if(a.has(e))return a.get(e);if(Array.isArray(e)){let t=Array(e.length);a.set(e,t);for(let n=0;n<e.length;n++)t[n]=c(e[n],n,i,a,s);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;a.set(e,t);for(let[n,r]of e)t.set(n,c(r,n,i,a,s));return t}if(e instanceof Set){let t=new Set;a.set(e,t);for(let n of e)t.add(c(n,void 0,i,a,s));return t}if(o.isBuffer(e))return e.subarray();if(n.isTypedArray(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);a.set(e,t);for(let n=0;n<e.length;n++)t[n]=c(e[n],n,i,a,s);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return a.set(e,t),l(t,e,i,a,s),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return a.set(e,t),l(t,e,i,a,s),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return a.set(e,t),l(t,e,i,a,s),t}if(e instanceof Error){let t=structuredClone(e);return a.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,l(t,e,i,a,s),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return a.set(e,t),l(t,e,i,a,s),t}if(e instanceof Number){let t=new Number(e.valueOf());return a.set(e,t),l(t,e,i,a,s),t}if(e instanceof String){let t=new String(e.valueOf());return a.set(e,t),l(t,e,i,a,s),t}if(typeof e==`object`&&u(e)){let t=Object.create(Object.getPrototypeOf(e));return a.set(e,t),l(t,e,i,a,s),t}return e}function l(e,t,n=e,i,a){let o=[...Object.keys(t),...r.getSymbols(t)];for(let r=0;r<o.length;r++){let s=o[r],l=Object.getOwnPropertyDescriptor(e,s);(l==null||l.writable)&&(e[s]=c(t[s],s,n,i,a))}}function u(e){switch(i.getTag(e)){case a.argumentsTag:case a.arrayTag:case a.arrayBufferTag:case a.dataViewTag:case a.booleanTag:case a.dateTag:case a.float32ArrayTag:case a.float64ArrayTag:case a.int8ArrayTag:case a.int16ArrayTag:case a.int32ArrayTag:case a.mapTag:case a.numberTag:case a.objectTag:case a.regexpTag:case a.setTag:case a.stringTag:case a.symbolTag:case a.uint8ArrayTag:case a.uint8ClampedArrayTag:case a.uint16ArrayTag:case a.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=s,e.cloneDeepWithImpl=c,e.copyProperties=l})),Nl=o((e=>{var t=Ml();function n(e){return t.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}e.cloneDeep=n})),Pl=o((e=>{function t(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}e.isEqualsSameValueZero=t})),Fl=o((()=>{Pl()})),Il=o((e=>{function t(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}e.isObject=t})),Ll=o((e=>{var t=Tl(),n=Pl();Fl();var r=Il();function i(e,t,n){return typeof n==`function`?a(e,t,function e(t,r,i,o,s,c){let l=n(t,r,i,o,s,c);return l===void 0?a(t,r,e,c):!!l},new Map):i(e,t,()=>void 0)}function a(e,t,i,s){if(t===e)return!0;switch(typeof t){case`object`:return o(e,t,i,s);case`function`:return Object.keys(t).length>0?a(e,{...t},i,s):n.isEqualsSameValueZero(e,t);default:return r.isObject(e)?typeof t!=`string`||t===``:n.isEqualsSameValueZero(e,t)}}function o(e,n,r,i){if(n==null)return!0;if(Array.isArray(n))return c(e,n,r,i);if(n instanceof Map)return s(e,n,r,i);if(n instanceof Set)return l(e,n,r,i);let a=Object.keys(n);if(e==null||t.isPrimitive(e))return a.length===0;if(a.length===0)return!0;if(i?.has(n))return i.get(n)===e;i?.set(n,e);try{for(let o=0;o<a.length;o++){let s=a[o];if(!t.isPrimitive(e)&&!(s in e)||n[s]===void 0&&e[s]!==void 0||n[s]===null&&e[s]!==null||!r(e[s],n[s],s,e,n,i))return!1}return!0}finally{i?.delete(n)}}function s(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function c(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function l(e,t,n,r){return t.size===0||e instanceof Set&&c([...e],[...t],n,r)}e.isMatchWith=i})),Rl=o((e=>{var t=Ll();function n(e,n){return t.isMatchWith(e,n,()=>void 0)}e.isMatch=n})),zl=o((e=>{var t=Nl(),n=Rl();function r(e){return e=t.cloneDeep(e),t=>n.isMatch(t,e)}e.matches=r})),Bl=o((e=>{var t=Ol(),n=kl(),r=Ml();function i(e,i){return r.cloneDeepWith(e,(a,o,s,c)=>{let l=i?.(a,o,s,c);if(l!==void 0)return l;if(typeof e==`object`){if(t.getTag(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return c.set(e,t),r.copyProperties(t,e,s,c),t}switch(Object.prototype.toString.call(e)){case n.numberTag:case n.stringTag:case n.booleanTag:{let t=new e.constructor(e?.valueOf());return r.copyProperties(t,e),t}case n.argumentsTag:{let t={};return r.copyProperties(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}e.cloneDeepWith=i})),K=o((e=>{var t=Bl();function n(e){return t.cloneDeepWith(e)}e.cloneDeep=n})),q=o((e=>{var t=/^(?:0|[1-9]\d*)$/;function n(e,n=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<n;case`symbol`:return!1;case`string`:return t.test(e)}}e.isIndex=n})),Vl=o((e=>{var t=Ol();function n(e){return typeof e==`object`&&!!e&&t.getTag(e)===`[object Arguments]`}e.isArguments=n})),Hl=o((e=>{var t=js(),n=Ps(),r=q(),i=Vl();function a(e,a){let o;if(o=Array.isArray(a)?a:typeof a==`string`&&t.isDeepKey(a)&&e?.[a]==null?n.toPath(a):[a],o.length===0)return!1;let s=e;for(let e=0;e<o.length;e++){let t=o[e];if((s==null||!Object.hasOwn(s,t))&&!((Array.isArray(s)||i.isArguments(s))&&r.isIndex(t)&&t<s.length))return!1;s=s[t]}return!0}e.has=a})),Ul=o((e=>{var t=Ms(),n=Fs(),r=Rl(),i=K(),a=Hl();function o(e,o){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=t.toKey(e);break}return o=i.cloneDeep(o),function(t){let i=n.get(t,e);return i===void 0?a.has(t,e):o===void 0?i===void 0:r.isMatch(i,o)}}e.matchesProperty=o})),Wl=o((e=>{var t=Cl(),n=wl(),r=zl(),i=Ul();function a(e){if(e==null)return t.identity;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?i.matchesProperty(e[0],e[1]):r.matches(e);case`string`:case`symbol`:case`number`:return n.property(e)}}e.iteratee=a})),Gl=o((e=>{function t(e){return Number.isSafeInteger(e)&&e>=0}e.isLength=t})),Kl=o((e=>{var t=Gl();function n(e){return e!=null&&typeof e!=`function`&&t.isLength(e.length)}e.isArrayLike=n})),ql=o((e=>{function t(e){return typeof e==`object`&&!!e}e.isObjectLike=t})),Jl=o((e=>{var t=Kl(),n=ql();function r(e){return n.isObjectLike(e)&&t.isArrayLike(e)}e.isArrayLikeObject=r})),Yl=o((e=>{var t=xl(),n=Sl(),r=Cl(),i=Wl(),a=Jl();function o(e,o=r.identity){return a.isArrayLikeObject(e)?t.uniqBy(Array.from(e),n.ary(i.iteratee(o),1)):[]}e.uniqBy=o})),Xl=l(o(((e,t)=>{t.exports=Yl().uniqBy}))());function Zl(e,t,n){return t===!0?(0,Xl.default)(e,n):typeof t==`function`?(0,Xl.default)(e,t):e}var Ql=o((e=>{var t=d(),n=mt();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),$l=o(((e,t)=>{t.exports=Ql()})),eu=(0,F.createContext)(null),tu=$l(),nu=e=>e,ru=()=>{var e=(0,F.useContext)(eu);return e?e.store.dispatch:nu},iu=()=>{},au=()=>iu,ou=(e,t)=>e===t;function J(e){var t=(0,F.useContext)(eu),n=(0,F.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:iu,[t,e]);return(0,tu.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:au,t?t.store.getState:iu,t?t.store.getState:iu,n,ou)}function su(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function cu(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var lu=e=>Array.isArray(e)?e:[e];function uu(e){let t=Array.isArray(e[0])?e[0]:e;return cu(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function du(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var fu=class{constructor(e){this.value=e}deref(){return this.value}},pu=typeof WeakRef>`u`?fu:WeakRef,mu=0,hu=1;function gu(){return{s:mu,v:void 0,o:null,p:null}}function _u(e){return e instanceof pu?e.deref():e}function vu(e,t={}){let n=gu(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=gu(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=gu(),e.set(n,t)):t=r}}let s=t,c;if(t.s===hu)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=_u(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new pu(c):c}return s.s=hu,s.v=c,c}return o.clearCache=()=>{n=gu(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function yu(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),su(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=vu,argsMemoizeOptions:u=[]}={...n,...a},d=lu(c),f=lu(u),p=uu(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=du(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var Y=yu(vu),bu=o((e=>{function t(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}e.flatten=t})),xu=o((e=>{var t=Pl();Fl();var n=Kl(),r=Il(),i=q();function a(e,a,o){return r.isObject(o)&&(typeof a==`number`&&n.isArrayLike(o)&&i.isIndex(a)&&a<o.length||typeof a==`string`&&a in o)?t.isEqualsSameValueZero(o[a],e):!1}e.isIterateeCall=a})),Su=o((e=>{function t(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}e.compareValues=(e,n,r)=>{if(e!==n){let i=t(e),a=t(n);if(i===a&&i===0){if(e<n)return r===`desc`?1:-1;if(e>n)return r===`desc`?-1:1}return r===`desc`?a-i:i-a}return 0}})),Cu=o((e=>{function t(e){return typeof e==`symbol`||e instanceof Symbol}e.isSymbol=t})),wu=o((e=>{var t=Cu(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(e,i){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||t.isSymbol(e)?!0:typeof e==`string`&&(r.test(e)||!n.test(e))||i!=null&&Object.hasOwn(i,e)}e.isKey=i})),Tu=o((e=>{var t=Ps(),n=Su(),r=wu();function i(e,i,a,o){if(e==null)return[];a=o?void 0:a,Array.isArray(e)||(e=Object.values(e)),Array.isArray(i)||(i=i==null?[null]:[i]),i.length===0&&(i=[null]),Array.isArray(a)||(a=a==null?[]:[a]),a=a.map(e=>String(e));let s=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},c=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:s(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?s(t,e):typeof t==`object`?t[e]:t,l=i.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||r.isKey(e)?e:{key:e,path:t.toPath(e)}));return e.map(e=>({original:e,criteria:l.map(t=>c(t,e))})).slice().sort((e,t)=>{for(let r=0;r<l.length;r++){let i=n.compareValues(e.criteria[r],t.criteria[r],a[r]);if(i!==0)return i}return 0}).map(e=>e.original)}e.orderBy=i})),Eu=o((e=>{var t=bu(),n=xu(),r=Tu();function i(e,...i){let a=i.length;return a>1&&n.isIterateeCall(e,i[0],i[1])?i=[]:a>2&&n.isIterateeCall(i[0],i[1],i[2])&&(i=[i[0]]),r.orderBy(e,t.flatten(i),[`asc`])}e.sortBy=i})),Du=l(o(((e,t)=>{t.exports=Eu().sortBy}))()),Ou=e=>e.legend.settings,ku=e=>e.legend.size;Y([e=>e.legend.payload,Ou],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?(0,Du.default)(r,n):r});function Au(e,t){return Fu(e)||Pu(e,t)||Mu(e,t)||ju()}function ju(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
10
10
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mu(e,t){if(e){if(typeof e==`string`)return Nu(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nu(e,t):void 0}}function Nu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Pu(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Fu(e){if(Array.isArray(e))return e}var Iu=1;function Lu(e,t){return Math.abs(e.height-t.height)>Iu||Math.abs(e.left-t.left)>Iu||Math.abs(e.top-t.top)>Iu||Math.abs(e.width-t.width)>Iu}function Ru(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function zu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=Au((0,F.useState)({height:0,left:0,top:0,width:0}),2),n=t[0],r=t[1],i=(0,F.useRef)(null),a=(0,F.useRef)(n);a.current=n;var o=(0,F.useCallback)(e=>{if(i.current!=null&&(i.current.disconnect(),i.current=null),e!=null){var t=Ru(e);if(Lu(t,a.current)&&r(t),typeof ResizeObserver<`u`){var n=new ResizeObserver(()=>{var t=Ru(e);Lu(t,a.current)&&r(t)});n.observe(e),i.current=n}}},[...e]);return(0,F.useEffect)(()=>()=>{var e;(e=i.current)==null||e.disconnect()},[]),[n,o]}function Bu(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Vu=typeof Symbol==`function`&&Symbol.observable||`@@observable`,Hu=()=>Math.random().toString(36).substring(7).split(``).join(`.`),Uu={INIT:`@@redux/INIT${Hu()}`,REPLACE:`@@redux/REPLACE${Hu()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Hu()}`};function Wu(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Gu(e,t,n){if(typeof e!=`function`)throw Error(Bu(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(Bu(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(Bu(1));return n(Gu)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(Bu(3));return i}function d(e){if(typeof e!=`function`)throw Error(Bu(4));if(c)throw Error(Bu(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(Bu(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!Wu(e))throw Error(Bu(7));if(e.type===void 0)throw Error(Bu(8));if(typeof e.type!=`string`)throw Error(Bu(17));if(c)throw Error(Bu(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(Bu(10));r=e,f({type:Uu.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(Bu(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Vu](){return this}}}return f({type:Uu.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[Vu]:m}}function Ku(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:Uu.INIT})===void 0)throw Error(Bu(12));if(n(void 0,{type:Uu.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(Bu(13))})}function qu(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{Ku(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(Bu(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function Ju(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Yu(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(Bu(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=Ju(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function Xu(e){return Wu(e)&&`type`in e&&typeof e.type==`string`}var Zu=Symbol.for(`immer-nothing`),Qu=Symbol.for(`immer-draftable`),$u=Symbol.for(`immer-state`);function ed(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var td=Object,nd=td.getPrototypeOf,rd=`constructor`,id=`prototype`,ad=`configurable`,od=`enumerable`,sd=`writable`,cd=`value`,ld=e=>!!e&&!!e[$u];function ud(e){return e?pd(e)||bd(e)||!!e[Qu]||!!e[rd]?.[Qu]||xd(e)||X(e):!1}var dd=td[id][rd].toString(),fd=new WeakMap;function pd(e){if(!e||!Sd(e))return!1;let t=nd(e);if(t===null||t===td[id])return!0;let n=td.hasOwnProperty.call(t,rd)&&t[rd];if(n===Object)return!0;if(!Cd(n))return!1;let r=fd.get(n);return r===void 0&&(r=Function.toString.call(n),fd.set(n,r)),r===dd}function md(e,t,n=!0){hd(e)===0?(n?Reflect.ownKeys(e):td.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function hd(e){let t=e[$u];return t?t.type_:bd(e)?1:xd(e)?2:X(e)?3:0}var gd=(e,t,n=hd(e))=>n===2?e.has(t):td[id].hasOwnProperty.call(e,t),_d=(e,t,n=hd(e))=>n===2?e.get(t):e[t],vd=(e,t,n,r=hd(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function yd(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var bd=Array.isArray,xd=e=>e instanceof Map,X=e=>e instanceof Set,Sd=e=>typeof e==`object`,Cd=e=>typeof e==`function`,wd=e=>typeof e==`boolean`;function Td(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Ed=e=>e.copy_||e.base_,Dd=e=>e.modified_?e.copy_:e.base_;function Od(e,t){if(xd(e))return new Map(e);if(X(e))return new Set(e);if(bd(e))return Array[id].slice.call(e);let n=pd(e);if(t===!0||t===`class_only`&&!n){let t=td.getOwnPropertyDescriptors(e);delete t[$u];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[sd]===!1&&(a[sd]=!0,a[ad]=!0),(a.get||a.set)&&(t[i]={[ad]:!0,[sd]:!0,[od]:a[od],[cd]:e[i]})}return td.create(nd(e),t)}else{let t=nd(e);if(t!==null&&n)return{...e};let r=td.create(t);return td.assign(r,e)}}function kd(e,t=!1){return Md(e)||ld(e)||!ud(e)?e:(hd(e)>1&&td.defineProperties(e,{set:jd,add:jd,clear:jd,delete:jd}),td.freeze(e),t&&md(e,(e,t)=>{kd(t,!0)},!1),e)}function Ad(){ed(2)}var jd={[cd]:Ad};function Md(e){return e===null||!Sd(e)||td.isFrozen(e)}var Nd=`MapSet`,Pd=`Patches`,Fd=`ArrayMethods`,Id={};function Ld(e){let t=Id[e];return t||ed(0,e),t}var Rd=e=>!!Id[e],zd,Bd=()=>zd,Vd=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Rd(Nd)?Ld(Nd):void 0,arrayMethodsPlugin_:Rd(Fd)?Ld(Fd):void 0});function Hd(e,t){t&&(e.patchPlugin_=Ld(Pd),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ud(e){Wd(e),e.drafts_.forEach(Kd),e.drafts_=null}function Wd(e){e===zd&&(zd=e.parent_)}var Gd=e=>zd=Vd(zd,e);function Kd(e){let t=e[$u];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function qd(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[$u].modified_&&(Ud(t),ed(4)),ud(e)&&(e=Jd(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[$u].base_,e,t)}else e=Jd(t,n);return Yd(t,e,!0),Ud(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Zu?void 0:e}function Jd(e,t){if(Md(t))return t;let n=t[$u];if(!n)return rf(t,e.handledSet_,e);if(!Zd(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);tf(n,e)}return n.copy_}function Yd(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&kd(t,n)}function Xd(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Zd=(e,t)=>e.scope_===t,Qd=[];function $d(e,t,n,r){let i=Ed(e),a=e.type_;if(r!==void 0&&_d(i,r,a)===t){vd(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;md(i,(e,n)=>{if(ld(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??Qd;for(let e of o)vd(i,e,n,a)}function ef(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!Zd(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Dd(i);$d(e,i.draft_??i,a,n),tf(i,r)})}function tf(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Xd(e)}}function nf(e,t,n){let{scope_:r}=e;if(ld(n)){let i=n[$u];Zd(i,r)&&i.callbacks_.push(function(){pf(e),$d(e,n,Dd(i),t)})}else ud(n)&&e.callbacks_.push(function(){let i=Ed(e);e.type_===3?i.has(n)&&rf(n,r.handledSet_,r):_d(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&rf(_d(e.copy_,t,e.type_),r.handledSet_,r)})}function rf(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ld(e)||t.has(e)||!ud(e)||Md(e)?e:(t.add(e),md(e,(r,i)=>{if(ld(i)){let t=i[$u];Zd(t,n)&&(vd(e,r,Dd(t),e.type_),Xd(t))}else ud(i)&&rf(i,t,n)}),e)}function af(e,t){let n=bd(e),r={type_:+!!n,scope_:t?t.scope_:Bd(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=of;n&&(i=[r],a=sf);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var of={get(e,t){if(t===$u)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=Ed(e);if(!gd(i,t,e.type_))return uf(e,i,t);let a=i[t];if(e.finalized_||!ud(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Td(t))return a;if(a===cf(e.base_,t)||lf(e,t,a)){pf(e);let n=e.type_===1?+t:t,r=hf(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in Ed(e)},ownKeys(e){return Reflect.ownKeys(Ed(e))},set(e,t,n){let r=df(Ed(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=cf(Ed(e),t),i=r?.[$u];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(yd(n,r)&&(n!==void 0||gd(e.base_,t,e.type_)))return!0;pf(e),ff(e)}return e.copy_[t]===n&&(n!==void 0||gd(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),nf(e,t,n),!0)},deleteProperty(e,t){return pf(e),cf(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),ff(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Ed(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[sd]:!0,[ad]:e.type_!==1||t!==`length`,[od]:r[od],[cd]:n[t]}},defineProperty(){ed(11)},getPrototypeOf(e){return nd(e.base_)},setPrototypeOf(){ed(12)}},sf={};for(let e in of){let t=of[e];sf[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}sf.deleteProperty=function(e,t){return sf.set.call(this,e,t,void 0)},sf.set=function(e,t,n){return of.set.call(this,e[0],t,n,e[0])};function cf(e,t){let n=e[$u];return(n?Ed(n):e)[t]}function lf(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!ud(n)||n[$u]?!1:e.baseRefs_.has(n)}function uf(e,t,n){let r=df(t,n);return r?cd in r?r[cd]:r.get?.call(e.draft_):void 0}function df(e,t){if(!(t in e))return;let n=nd(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=nd(n)}}function ff(e){e.modified_||(e.modified_=!0,e.parent_&&ff(e.parent_))}function pf(e){e.copy_||=(e.assigned_=new Map,Od(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var mf=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Cd(e)&&!Cd(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Cd(t)||ed(6),n!==void 0&&!Cd(n)&&ed(7);let r;if(ud(e)){let i=Gd(this),a=hf(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?Ud(i):Wd(i)}return Hd(i,n),qd(r,i)}else if(!e||!Sd(e)){if(r=t(e),r===void 0&&(r=e),r===Zu&&(r=void 0),this.autoFreeze_&&kd(r,!0),n){let t=[],i=[];Ld(Pd).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else ed(1,e)},this.produceWithPatches=(e,t)=>{if(Cd(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},wd(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),wd(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),wd(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ud(e)||ed(8),ld(e)&&(e=gf(e));let t=Gd(this),n=hf(t,e,void 0);return n[$u].isManual_=!0,Wd(t),n}finishDraft(e,t){let n=e&&e[$u];(!n||!n.isManual_)&&ed(9);let{scope_:r}=n;return Hd(r,t),qd(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Ld(Pd).applyPatches_;return ld(e)?r(e,t):this.produce(e,e=>r(e,t))}};function hf(e,t,n,r){let[i,a]=xd(t)?Ld(Nd).proxyMap_(t,n):X(t)?Ld(Nd).proxySet_(t,n):af(t,n);return(n?.scope_??Bd()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?ef(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function gf(e){return ld(e)||ed(10,e),_f(e)}function _f(e){if(!ud(e)||Md(e))return e;let t=e[$u],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Od(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Od(e,!0);return md(n,(e,t)=>{vd(n,e,_f(t))},r),t&&(t.finalized_=!1),n}var vf=new mf().produce,Z=e=>e;function yf(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var bf=yf(),xf=yf,Sf=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?Ju:Ju.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Cf(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(Mp(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>Xu(t)&&t.type===e,n}var wf=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Tf(e){return ud(e)?vf(e,()=>{}):e}function Ef(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Df(e){return typeof e==`boolean`}var Of=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new wf;return t&&(Df(t)?a.push(bf):a.push(xf(t.extraArgument))),a},kf=`RTK_autoBatch`,Af=()=>e=>({payload:e,meta:{[kf]:!0}}),jf=e=>t=>{setTimeout(t,e)},Mf=(e,t)=>n=>{let r=!1,i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(o),n())},a=e(i),o=setTimeout(i,t)},Nf=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?Mf(window.requestAnimationFrame,100):jf(10):e.type===`callback`?e.queueNotification:jf(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[kf],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},Pf=e=>function(t){let{autoBatch:n=!0}=t??{},r=new wf(e);return n&&r.push(Nf(typeof n==`object`?n:void 0)),r};function Ff(e){let t=Of(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(Wu(n))c=qu(n);else throw Error(Mp(1));let l;l=typeof r==`function`?r(t):t();let u=Ju;i&&(u=Sf({trace:!1,...typeof i==`object`&&i}));let d=Pf(Yu(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return Gu(c,o,p)}function If(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(Mp(28));if(r in t)throw Error(Mp(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function Lf(e){return typeof e==`function`}function Rf(e,t){let[n,r,i]=If(t),a;if(Lf(e))a=()=>Tf(e());else{let t=Tf(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n)if(ld(e)){let r=n(e,t);return r===void 0?e:r}else if(ud(e))return vf(e,e=>n(e,t));else{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}return e},e)}return o.getInitialState=a,o}var zf=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,Bf=(e=21)=>{let t=``,n=e;for(;n--;)t+=zf[Math.random()*64|0];return t},Vf=Symbol.for(`rtk-slice-createasyncthunk`);function Hf(e,t){return`${e}/${t}`}function Uf({creators:e}={}){let t=e?.asyncThunk?.[Vf];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(Mp(11));let i=(typeof e.reducers==`function`?e.reducers(Kf()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(Mp(12));if(n in o.sliceCaseReducersByType)throw Error(Mp(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:Hf(n,r),createNotation:typeof e.reducers==`function`};Jf(a)?Xf(o,a,s,t):qf(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?If(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Rf(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=Ef(d,r,m)),i}function i(t=l){return Ef(Ef(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=Wf(a,t,()=>Ef(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function Wf(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var Gf=Uf();function Kf(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function qf({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!Yf(r))throw Error(Mp(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Cf(e,o):Cf(e))}function Jf(e){return e._reducerDefinitionType===`asyncThunk`}function Yf(e){return e._reducerDefinitionType===`reducerWithPrepare`}function Xf({type:e,reducerName:t},n,r,i){if(!i)throw Error(Mp(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||Zf,pending:s||Zf,rejected:c||Zf,settled:l||Zf})}function Zf(){}var Qf=`task`,$f=`listener`,ep=`completed`,tp=`cancelled`,np=`task-${tp}`,rp=`task-${ep}`,ip=`${$f}-${tp}`,ap=`${$f}-${ep}`,op=class{constructor(e){this.code=e,this.message=`${Qf} ${tp} (reason: ${e})`}code;name=`TaskAbortError`;message},sp=(e,t)=>{if(typeof e!=`function`)throw TypeError(Mp(32))},cp=()=>{},lp=(e,t=cp)=>(e.catch(t),e),up=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),dp=e=>{if(e.aborted)throw new op(e.reason)};function fp(e,t){let n=cp;return new Promise((r,i)=>{let a=()=>i(new op(e.reason));if(e.aborted){a();return}n=up(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=cp})}var pp=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof op?`cancelled`:`rejected`,error:e}}finally{t?.()}},mp=e=>t=>lp(fp(e,t).then(t=>(dp(e),t))),hp=e=>{let t=mp(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:gp}=Object,_p={},vp=`listenerMiddleware`,yp=(e,t)=>{let n=t=>up(e,()=>t.abort(e.reason));return(r,i)=>{sp(r,`taskExecutor`);let a=new AbortController;n(a);let o=pp(async()=>{dp(e),dp(a.signal);let t=await r({pause:mp(a.signal),delay:hp(a.signal),signal:a.signal});return dp(a.signal),t},()=>a.abort(rp));return i?.autoJoin&&t.push(o.catch(cp)),{result:mp(e)(o),cancel(){a.abort(np)}}}},bp=(e,t)=>{let n=async(n,r)=>{dp(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await fp(t,Promise.race(a));return dp(t),e}finally{i()}};return((e,t)=>lp(n(e,t)))},xp=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Cf(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(Mp(21));return sp(a,`options.listener`),{predicate:i,type:t,effect:a}},Sp=gp(e=>{let{type:t,predicate:n,effect:r}=xp(e);return{id:Bf(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(Mp(22))}}},{withTypes:()=>Sp}),Cp=(e,t)=>{let{type:n,effect:r,predicate:i}=xp(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},wp=e=>{e.pending.forEach(e=>{e.abort(ip)})},Tp=(e,t)=>()=>{for(let e of t.keys())wp(e);e.clear()},Ep=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},Dp=gp(Cf(`${vp}/add`),{withTypes:()=>Dp}),Op=Cf(`${vp}/removeAll`),kp=gp(Cf(`${vp}/remove`),{withTypes:()=>kp}),Ap=(...e)=>{console.error(`${vp}/error`,...e)},jp=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=Ap}=e;sp(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&wp(e)}),c=(e=>{let n=Cp(t,e)??Sp(e);return s(n)});gp(c,{withTypes:()=>c});let l=e=>{let n=Cp(t,e);return n&&(n.unsubscribe(),e.cancelActive&&wp(n)),!!n};gp(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=bp(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,gp({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:hp(u.signal),pause:mp(u.signal),extra:a,signal:u.signal,fork:yp(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(ip),n.delete(e))})},cancel:()=>{u.abort(ip),e.pending.delete(u)},throwIfCancelled:()=>{dp(u.signal)}})))}catch(e){e instanceof op||Ep(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(ap),i(e),e.pending.delete(u)}},d=Tp(t,n);return{middleware:e=>n=>r=>{if(!Xu(r))return n(r);if(Dp.match(r))return c(r.payload);if(Op.match(r)){d();return}if(kp.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===_p)throw Error(Mp(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,Ep(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=_p}return s},startListening:c,stopListening:l,clearListeners:d}};function Mp(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Np=Gf({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),Pp=Np.actions,Fp=Pp.setMargin,Ip=Pp.setLayout,Lp=Pp.setChartSize,Rp=Pp.setScale,zp=Np.reducer;function Bp(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Q(e){return Number.isFinite(e)}function Vp(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function Hp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Up(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Hp(Object(n),!0).forEach(function(t){Wp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Wp(e,t,n){return(t=Gp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gp(e){var t=Kp(e,`string`);return typeof t==`symbol`?t:t+``}function Kp(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qp(e,t,n){return Zs(e)||Zs(t)?n:Ws(t)?(0,Bs.default)(e,t,n):typeof t==`function`?t(e):n}var Jp=(e,t,n)=>{if(t&&n){var r=n.width,i=n.height,a=t.align,o=t.verticalAlign,s=t.layout,c=t.position,l=t.offset,u=l===void 0?0:l;if(c!=null){if(lc(c)){if(c===`top`&&G(e.top))return Up(Up({},e),{},{top:e.top+(i||0)+u});if(c===`bottom`&&G(e.bottom))return Up(Up({},e),{},{bottom:e.bottom+(i||0)+u});if(c===`left`&&G(e.left))return Up(Up({},e),{},{left:e.left+(r||0)+u});if(c===`right`&&G(e.right))return Up(Up({},e),{},{right:e.right+(r||0)+u})}return e}if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&G(e[a]))return Up(Up({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&G(e[o]))return Up(Up({},e),{},{[o]:e[o]+(i||0)})}return e},Yp=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,Xp=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},Zp=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,o=e.scale,s=e.realScaleType,c=e.isCategorical,l=e.categoricalDomain,u=e.tickCount,d=e.ticks,f=e.niceTicks,p=e.axisType;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?Vs(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return Q(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter($s):c&&l?l.map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter($s):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter($s):o.domain().map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter($s)},Qp=(e,t)=>{if(!t||t.length!==2||!G(t[0])||!G(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!G(e[0])||e[0]<n)&&(i[0]=n),(!G(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},$p={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=Hs(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:cl,none:rl,silhouette:ll,wiggle:ul,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;++a){var o=e[a]?.[r];if(o!=null){var s=Hs(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},em=(e,t,n)=>{var r=$p[n]??rl,i=sl().keys(t).value((e,t)=>Number(qp(e,t,0))).order(il).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=qp(e[i],t[r],0);Array.isArray(a)&&a.length===2&&G(a[0])&&G(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function tm(e){return e==null?void 0:String(e)}function nm(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!Zs(i[t.dataKey])){var s=Xs(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=qp(i,Zs(o)?t.dataKey:o),l=t.scale.map(c);return G(l)?l:null}var rm=e=>{var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,o=e.index;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=qp(a,t.dataKey,t.scale.domain()[o]);if(Zs(s))return null;var c=t.scale.map(s);return G(c)?c-i/2+r:null},im=e=>{var t=e.numericAxis,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},am=e=>{var t=e.flat(2).filter(G);return[Math.min(...t),Math.max(...t)]},om=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],sm=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return om(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var o=a.stackedData.reduce((e,r)=>{var i=am(Bp(r,t,n));return!Q(i[0])||!Q(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},cm=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,lm=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,um=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,Du.default)(t,e=>e.coordinate),a=[],o=0,s=1,c=i.length;s<c;s++){var l=(i[s]?.coordinate||0)-(i[s-1]?.coordinate||0);a.push(l),o=Math.max(l,o)}var u=o*1e-4,d=1/0;for(var f of a)f>u&&(d=Math.min(f,d));return d===1/0?0:d}return n?void 0:0};function dm(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return Up(Up({},t),{},{dataKey:n,payload:r,value:i,name:a})}function fm(e,t){if(e!=null)return String(e);if(typeof t==`string`)return t}var pm=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},mm=(e,t)=>t===`centric`?e.angle:e.radius,hm=e=>e.layout.width,gm=e=>e.layout.height,_m=e=>e.layout.scale,vm=e=>e.layout.margin,ym=Y(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),bm=Y(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),xm=`data-recharts-item-index`;function Sm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Cm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Sm(Object(n),!0).forEach(function(t){wm(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sm(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wm(e,t,n){return(t=Tm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tm(e){var t=Em(e,`string`);return typeof t==`symbol`?t:t+``}function Em(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Dm=e=>e.brush.height;function Om(e){return bm(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function km(e){return bm(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Am(e){return ym(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}function jm(e){return ym(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}var Mm=Y([hm,gm,vm,Dm,Om,km,Am,jm,Ou,ku],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=Cm(Cm({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=Jp(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return Cm(Cm({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),Nm=Y(Mm,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Pm=Y(hm,gm,(e,t)=>({x:0,y:0,width:e,height:t})),Fm=(0,F.createContext)(null),Im=()=>(0,F.useContext)(Fm)!=null,Lm=e=>e.brush,Rm=Y([Lm,Mm,vm],(e,t,n)=>({height:e.height,x:G(e.x)?e.x:t.left,y:G(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:G(e.width)?e.width:t.width})),zm=o((e=>{function t(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}e.debounce=t})),Bm=o((e=>{var t=zm();function n(e,n=0,r={}){typeof r!=`object`&&(r={});let{leading:i=!1,trailing:a=!0,maxWait:o}=r,s=[,,];i&&(s[0]=`leading`),a&&(s[1]=`trailing`);let c,l=null,u=t.debounce(function(...t){c=e.apply(this,t),l=null},n,{edges:s}),d=function(...t){return o!=null&&(l===null&&(l=Date.now()),Date.now()-l>=o)?(c=e.apply(this,t),l=Date.now(),u.cancel(),u.schedule(),c):(u.apply(this,t),c)};return d.cancel=u.cancel,d.flush=()=>(u.flush(),c),d}e.debounce=n})),Vm=o((e=>{var t=Bm();function n(e,n=0,r={}){let{leading:i=!0,trailing:a=!0}=r;return t.debounce(e,n,{leading:i,maxWait:n,trailing:a})}e.throttle=n})),Hm=o(((e,t)=>{t.exports=Vm().throttle})),Um=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}},Wm={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Gm=(e,t,n)=>{var r=n.width,i=r===void 0?Wm.width:r,a=n.height,o=a===void 0?Wm.height:a,s=n.aspect,c=n.maxHeight,l=Us(i)?e:Number(i),u=Us(o)?t:Number(o);return s&&s>0&&(l?u=l/s:u&&(l=u*s),c&&u!=null&&u>c&&(u=c)),{calculatedWidth:l,calculatedHeight:u}},Km={width:0,height:0,overflow:`visible`},qm={width:0,overflowX:`visible`},Jm={height:0,overflowY:`visible`},Ym={},Xm=e=>{var t=e.width,n=e.height,r=Us(t),i=Us(n);return r&&i?Km:r?qm:i?Jm:Ym};function Zm(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Wm.width,a=Wm.height):i===void 0?i=r&&r>0?void 0:Wm.width:a===void 0&&(a=r&&r>0?void 0:Wm.height),{width:i,height:a}}var Qm=l(Hm()),$m=[`aspect`,`initialDimension`,`width`,`height`,`minWidth`,`minHeight`,`maxHeight`,`children`,`debounce`,`id`,`className`,`onResize`,`style`];function eh(){return eh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eh.apply(null,arguments)}function th(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?th(Object(n),!0).forEach(function(t){rh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):th(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rh(e,t,n){return(t=ih(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ih(e){var t=ah(e,`string`);return typeof t==`symbol`?t:t+``}function ah(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function oh(e,t){return dh(e)||uh(e,t)||ch(e,t)||sh()}function sh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
11
11
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ch(e,t){if(e){if(typeof e==`string`)return lh(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lh(e,t):void 0}}function lh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uh(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function dh(e){if(Array.isArray(e))return e}function fh(e,t){if(e==null)return{};var n,r,i=ph(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ph(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var mh=(0,F.createContext)(Wm.initialDimension);function hh(e){return Vp(e.width)&&Vp(e.height)}function gh(e){var t=e.children,n=e.width,r=e.height,i=(0,F.useMemo)(()=>({width:n,height:r}),[n,r]);return hh(i)?F.createElement(mh.Provider,{value:i},t):null}var _h=()=>(0,F.useContext)(mh),vh=(0,F.forwardRef)((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Wm.initialDimension:r,a=e.width,o=e.height,s=e.minWidth,c=s===void 0?Wm.minWidth:s,l=e.minHeight,u=e.maxHeight,d=e.children,f=e.debounce,p=f===void 0?Wm.debounce:f,m=e.id,h=e.className,g=e.onResize,_=e.style,v=_===void 0?{}:_,y=fh(e,$m),b=(0,F.useRef)(null),x=(0,F.useRef)();x.current=g,(0,F.useImperativeHandle)(t,()=>b.current);var S=oh((0,F.useState)({containerWidth:i.width,containerHeight:i.height}),2),C=S[0],w=S[1],T=(0,F.useCallback)((e,t)=>{w(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,F.useEffect)(()=>{if(b.current==null||typeof ResizeObserver>`u`)return ec;var e=e=>{var t,n=e[0];if(n!=null){var r=n.contentRect,i=r.width,a=r.height;T(i,a),(t=x.current)==null||t.call(x,i,a)}};p>0&&(e=(0,Qm.default)(e,p,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=b.current.getBoundingClientRect(),r=n.width,i=n.height;return T(r,i),t.observe(b.current),()=>{t.disconnect()}},[T,p]);var E=C.containerWidth,D=C.containerHeight;Um(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var O=Gm(E,D,{width:a,height:o,aspect:n,maxHeight:u}),k=O.calculatedWidth,A=O.calculatedHeight;return Um(E<0||D<0||k!=null&&k>0||A!=null&&A>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
12
12
|
please check the style of container, or the props width(%s) and height(%s),
|