free-coding-models 0.5.39 → 0.5.41
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.
|
@@ -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{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(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 De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(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 Qe(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=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(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 $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(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 tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(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-We(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&&at(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function at(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function st(e,t){var n=t&-t;return n=n&42?1:ct(n),(n&(e.suspendedLanes|t))===0?n:0}function ct(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 lt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ut(){var e=k.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function dt(e,t){var n=k.p;try{return k.p=e,t()}finally{k.p=n}}var ft=Math.random().toString(36).slice(2),pt=`__reactFiber$`+ft,mt=`__reactProps$`+ft,M=`__reactContainer$`+ft,ht=`__reactEvents$`+ft,gt=`__reactListeners$`+ft,_t=`__reactHandles$`+ft,vt=`__reactResources$`+ft,yt=`__reactMarker$`+ft;function bt(e){delete e[pt],delete e[mt],delete e[ht],delete e[gt],delete e[_t]}function xt(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[M]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[pt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function St(e){if(e=e[pt]||e[M]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ct(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function wt(e){var t=e[vt];return t||=e[vt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Tt(e){e[yt]=!0}var Et=new Set,Dt={};function Ot(e,t){kt(e,t),kt(e+`Capture`,t)}function kt(e,t){for(Dt[e]=t,e=0;e<t.length;e++)Et.add(t[e])}var At=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]*$`),jt={},Mt={};function Nt(e){return De.call(Mt,e)?!0:De.call(jt,e)?!1:At.test(e)?Mt[e]=!0:(jt[e]=!0,!1)}function Pt(e,t,n){if(Nt(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 Ft(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 It(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 Lt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Rt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function zt(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 Bt(e){if(!e._valueTracker){var t=Rt(e)?`checked`:`value`;e._valueTracker=zt(e,t,``+e[t])}}function Vt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Rt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ht(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 Ut=/[\n"\\]/g;function Wt(e){return e.replace(Ut,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Gt(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=``+Lt(t)):e.value!==``+Lt(t)&&(e.value=``+Lt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):qt(e,o,Lt(n)):qt(e,o,Lt(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=``+Lt(s):e.removeAttribute(`name`)}function Kt(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)){Bt(e);return}n=n==null?``:``+Lt(n),t=t==null?n:``+Lt(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),Bt(e)}function qt(e,t,n){t===`number`&&Ht(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Jt(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=``+Lt(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 Yt(e,t,n){if(t!=null&&(t=``+Lt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Lt(n)}function Xt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(se(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Lt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Bt(e)}function Zt(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 $t(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 en(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&&$t(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&$t(e,o,t[o])}function tn(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 nn=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`]]),rn=/^[\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 an(e){return rn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function on(){}var sn=null;function cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ln=null,un=null;function dn(e){var t=St(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Gt(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="`+Wt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[mt]||null;if(!a)throw Error(i(90));Gt(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&&Vt(r)}break a;case`textarea`:Yt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Jt(e,!!n.multiple,t,!1)}}}var fn=!1;function pn(e,t,n){if(fn)return e(t,n);fn=!0;try{return e(t)}finally{if(fn=!1,(ln!==null||un!==null)&&(vu(),ln&&(t=ln,e=un,un=ln=null,dn(t),e)))for(t=0;t<e.length;t++)dn(e[t])}}function mn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||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 hn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),gn=!1;if(hn)try{var _n={};Object.defineProperty(_n,"passive",{get:function(){gn=!0}}),window.addEventListener(`test`,_n,_n),window.removeEventListener(`test`,_n,_n)}catch{gn=!1}var vn=null,yn=null,bn=null;function xn(){if(bn)return bn;var e,t=yn,n=t.length,r,i=`value`in vn?vn.value:vn.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 bn=i.slice(e,1<r?1-r:void 0)}function Sn(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 Cn(){return!0}function wn(){return!1}function Tn(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)?Cn:wn,this.isPropagationStopped=wn,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=Cn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Cn)},persist:function(){},isPersistent:Cn}),t}var En={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dn=Tn(En),On=m({},En,{view:0,detail:0}),kn=Tn(On),An,jn,Mn,Nn=m({},On,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Un,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!==Mn&&(Mn&&e.type===`mousemove`?(An=e.screenX-Mn.screenX,jn=e.screenY-Mn.screenY):jn=An=0,Mn=e),An)},movementY:function(e){return`movementY`in e?e.movementY:jn}}),Pn=Tn(Nn),Fn=Tn(m({},Nn,{dataTransfer:0})),In=Tn(m({},On,{relatedTarget:0})),Ln=Tn(m({},En,{animationName:0,elapsedTime:0,pseudoElement:0})),Rn=Tn(m({},En,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),N=Tn(m({},En,{data:0})),zn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Bn={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`},Vn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Hn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vn[e])?!!t[e]:!1}function Un(){return Hn}var Wn=Tn(m({},On,{key:function(e){if(e.key){var t=zn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Sn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Bn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Un,charCode:function(e){return e.type===`keypress`?Sn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Sn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Gn=Tn(m({},Nn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Kn=Tn(m({},On,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Un})),qn=Tn(m({},En,{propertyName:0,elapsedTime:0,pseudoElement:0})),Jn=Tn(m({},Nn,{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})),Yn=Tn(m({},En,{newState:0,oldState:0})),Xn=[9,13,27,32],Zn=hn&&`CompositionEvent`in window,Qn=null;hn&&`documentMode`in document&&(Qn=document.documentMode);var $n=hn&&`TextEvent`in window&&!Qn,er=hn&&(!Zn||Qn&&8<Qn&&11>=Qn),tr=` `,nr=!1;function rr(e,t){switch(e){case`keyup`:return Xn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ir(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ar=!1;function or(e,t){switch(e){case`compositionend`:return ir(t);case`keypress`:return t.which===32?(nr=!0,tr):null;case`textInput`:return e=t.data,e===tr&&nr?null:e;default:return null}}function sr(e,t){if(ar)return e===`compositionend`||!Zn&&rr(e,t)?(e=xn(),bn=yn=vn=null,ar=!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 er&&t.locale!==`ko`?null:t.data;default:return null}}var cr={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 lr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!cr[e.type]:t===`textarea`}function ur(e,t,n,r){ln?un?un.push(r):un=[r]:ln=r,t=Td(t,`onChange`),0<t.length&&(n=new Dn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var dr=null,fr=null;function pr(e){vd(e,0)}function mr(e){if(Vt(Ct(e)))return e}function hr(e,t){if(e===`change`)return t}var gr=!1;if(hn){var _r;if(hn){var vr=`oninput`in document;if(!vr){var yr=document.createElement(`div`);yr.setAttribute(`oninput`,`return;`),vr=typeof yr.oninput==`function`}_r=vr}else _r=!1;gr=_r&&(!document.documentMode||9<document.documentMode)}function br(){dr&&(dr.detachEvent(`onpropertychange`,xr),fr=dr=null)}function xr(e){if(e.propertyName===`value`&&mr(fr)){var t=[];ur(t,fr,e,cn(e)),pn(pr,t)}}function Sr(e,t,n){e===`focusin`?(br(),dr=t,fr=n,dr.attachEvent(`onpropertychange`,xr)):e===`focusout`&&br()}function Cr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return mr(fr)}function wr(e,t){if(e===`click`)return mr(t)}function Tr(e,t){if(e===`input`||e===`change`)return mr(t)}function Er(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Dr=typeof Object.is==`function`?Object.is:Er;function Or(e,t){if(Dr(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(!De.call(t,i)||!Dr(e[i],t[i]))return!1}return!0}function kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ar(e,t){var n=kr(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=kr(n)}}function jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ht(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=Ht(e.document)}return t}function Nr(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 Pr=hn&&`documentMode`in document&&11>=document.documentMode,Fr=null,Ir=null,Lr=null,Rr=!1;function zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rr||Fr==null||Fr!==Ht(r)||(r=Fr,`selectionStart`in r&&Nr(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}),Lr&&Or(Lr,r)||(Lr=r,r=Td(Ir,`onSelect`),0<r.length&&(t=new Dn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Fr)))}function Br(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Vr={animationend:Br(`Animation`,`AnimationEnd`),animationiteration:Br(`Animation`,`AnimationIteration`),animationstart:Br(`Animation`,`AnimationStart`),transitionrun:Br(`Transition`,`TransitionRun`),transitionstart:Br(`Transition`,`TransitionStart`),transitioncancel:Br(`Transition`,`TransitionCancel`),transitionend:Br(`Transition`,`TransitionEnd`)},Hr={},Ur={};hn&&(Ur=document.createElement(`div`).style,`AnimationEvent`in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),`TransitionEvent`in window||delete Vr.transitionend.transition);function Wr(e){if(Hr[e])return Hr[e];if(!Vr[e])return e;var t=Vr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ur)return Hr[e]=t[n];return e}var Gr=Wr(`animationend`),Kr=Wr(`animationiteration`),qr=Wr(`animationstart`),Jr=Wr(`transitionrun`),Yr=Wr(`transitionstart`),Xr=Wr(`transitioncancel`),Zr=Wr(`transitionend`),Qr=new Map,$r=`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(` `);$r.push(`scrollEnd`);function ei(e,t){Qr.set(e,t),Ot(t,[e])}var P=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)},ti=[],F=0,ni=0;function ri(){for(var e=F,t=ni=F=0;t<e;){var n=ti[t];ti[t++]=null;var r=ti[t];ti[t++]=null;var i=ti[t];ti[t++]=null;var a=ti[t];if(ti[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&&si(n,i,a)}}function ii(e,t,n,r){ti[F++]=e,ti[F++]=t,ti[F++]=n,ti[F++]=r,ni|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ai(e,t,n,r){return ii(e,t,n,r),ci(e)}function oi(e,t){return ii(e,null,null,t),ci(e)}function si(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-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ci(e){if(50<lu)throw lu=0,uu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var li={};function ui(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 di(e,t,n,r){return new ui(e,t,n,r)}function fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pi(e,t){var n=e.alternate;return n===null?(n=di(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 mi(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 hi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)fi(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,pe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case te:return e=di(31,n,t,a),e.elementType=te,e.lanes=o,e;case y:return gi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=di(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case ee:return e=di(13,n,t,a),e.elementType=ee,e.lanes=o,e;case T:return e=di(19,n,t,a),e.elementType=T,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 E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function gi(e,t,n,r){return e=di(7,e,r,t),e.lanes=n,e}function _i(e,t,n){return e=di(6,e,null,t),e.lanes=n,e}function vi(e){var t=di(18,null,null,0);return t.stateNode=e,t}function yi(e,t,n){return t=di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bi=new WeakMap;function xi(e,t){if(typeof e==`object`&&e){var n=bi.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},bi.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var Si=[],Ci=0,wi=null,Ti=0,Ei=[],Di=0,Oi=null,ki=1,Ai=``;function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=wi,wi=e,Ti=t}function Mi(e,t,n){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,Oi=e;var r=ki;e=Ai;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ki=1<<32-We(t)+i|n<<i|r,Ai=a+e}else ki=1<<a|n<<i|r,Ai=e}function Ni(e){e.return!==null&&(ji(e,1),Mi(e,1,0))}function Pi(e){for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null;for(;e===Oi;)Oi=Ei[--Di],Ei[Di]=null,Ai=Ei[--Di],Ei[Di]=null,ki=Ei[--Di],Ei[Di]=null}function Fi(e,t){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,ki=t.id,Ai=t.overflow,Oi=e}var Ii=null,Li=null,I=!1,Ri=null,zi=!1,Bi=Error(i(519));function Vi(e){throw qi(xi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Bi}function Hi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Xt(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||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=on),t=!0):t=!1,t||Vi(e,!0)}function Ui(e){for(Ii=e.return;Ii;)switch(Ii.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Ii=Ii.return}}function Wi(e){if(e!==Ii)return!1;if(!I)return Ui(e),I=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&Li&&Vi(e),Ui(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=uf(e)}else t===27?(t=Li,Zd(e.type)?(e=lf,lf=null,Li=e):Li=t):Li=Ii?cf(e.stateNode.nextSibling):null;return!0}function Gi(){Li=Ii=null,I=!1}function Ki(){var e=Ri;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),Ri=null),e}function qi(e){Ri===null?Ri=[e]:Ri.push(e)}var Ji=A(null),Yi=null,Xi=null;function Zi(e,t,n){fe(Ji,t._currentValue),t._currentValue=n}function Qi(e){e._currentValue=Ji.current,de(Ji)}function L(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 $i(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),L(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),L(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 ea(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;Dr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ge.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&$i(t,e,n,r),t.flags|=262144}function ta(e){for(e=e.firstContext;e!==null;){if(!Dr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function na(e){Yi=e,Xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ra(e){return aa(Yi,e)}function ia(e,t){return Yi===null&&na(e),aa(e,t)}function aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xi===null){if(e===null)throw Error(i(308));Xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xi=Xi.next=t;return n}var oa=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()})}},sa=t.unstable_scheduleCallback,ca=t.unstable_NormalPriority,la={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ua(){return{controller:new oa,data:new Map,refCount:0}}function da(e){e.refCount--,e.refCount===0&&sa(ca,function(){e.controller.abort()})}var fa=null,pa=0,R=0,z=null;function ma(e,t){if(fa===null){var n=fa=[];pa=0,R=ud(),z={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return pa++,t.then(ha,ha),t}function ha(){if(--pa===0&&fa!==null){z!==null&&(z.status=`fulfilled`);var e=fa;fa=null,R=0,z=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(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 _a=O.S;O.S=function(e,t){Ql=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=A(null);function ya(){var e=va.current;return e===null?Fl.pooledCache:e}function ba(e,t){t===null?fe(va,va.current):fe(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:la._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(on,on),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(on,on);else{if(e=Fl,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,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(i(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(i(483))}var Ma=null,Na=0;function Pa(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ia(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 La(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=pi(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=_i(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===D&&Oa(i)===t.type)?(t=a(t,n.props),Fa(t,n),t.return=e,t):(t=hi(n.type,n.key,n.props,null,e.mode,r),Fa(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=yi(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=gi(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=_i(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=hi(t.type,t.key,t.props,null,e.mode,n),Fa(n,t),n.return=e,n;case v:return t=yi(t,e.mode,n),t.return=e,t;case D:return t=Oa(t),f(e,t,n)}if(se(t)||ie(t))return t=gi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Pa(t),n);if(t.$$typeof===C)return f(e,ia(e,t),n);Ia(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 D:return n=Oa(n),p(e,t,n,r)}if(se(n)||ie(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Pa(n),r);if(n.$$typeof===C)return p(e,t,ia(e,n),r);Ia(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 D:return r=Oa(r),m(e,t,n,r,i)}if(se(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Pa(r),i);if(r.$$typeof===C)return m(e,t,n,ia(t,r),i);Ia(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),I&&ji(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 I&&ji(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)}),I&&ji(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),I&&ji(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 I&&ji(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)}),I&&ji(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===D&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=gi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=hi(o.type,o.key,o.props,null,e.mode,c),Fa(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=yi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Oa(o),b(e,r,o,c)}if(se(o))return h(e,r,o,c);if(ie(o)){if(l=ie(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,Pa(o),c);if(o.$$typeof===C)return b(e,r,ia(e,o),c);Ia(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=_i(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(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 Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ci(e),si(e,null,n),t}return ii(e,r,t,n),ci(e)}function Ga(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,ot(e,n)}}function Ka(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 qa=!1;function Ja(){if(qa){var e=z;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!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===R&&(qa=!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:Ba=!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),Ul|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xa(n[e],t)}var Qa=A(null),$a=A(0);function eo(e,t){e=Vl,fe($a,e),fe(Qa,t),Vl=e|t.baseLanes}function to(){fe($a,Vl),fe(Qa,Qa.current)}function no(){Vl=$a.current,de(Qa),de($a)}var ro=A(null),io=null;function ao(e){var t=e.alternate;fe(uo,uo.current&1),fe(ro,e),io===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(io=e)}function oo(e){fe(uo,uo.current),fe(ro,e),io===null&&(io=e)}function so(e){e.tag===22?(fe(uo,uo.current),fe(ro,e),io===null&&(io=e)):co(e)}function co(){fe(uo,uo.current),fe(ro,ro.current)}function lo(e){de(ro),io===e&&(io=null),de(uo)}var uo=A(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(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 po=0,B=null,mo=null,ho=null,go=!1,_o=!1,vo=!1,yo=0,bo=0,xo=null,So=0;function Co(){throw Error(i(321))}function wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dr(e[n],t[n]))return!1;return!0}function To(e,t,n,r,i,a){return po=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Hs:Us,vo=!1,a=n(r,i),vo=!1,_o&&(a=Do(t,n,r,i)),Eo(e),a}function Eo(e){O.H=Vs;var t=mo!==null&&mo.next!==null;if(po=0,ho=mo=B=null,go=!1,bo=0,xo=null,t)throw Error(i(300));e===null||rc||(e=e.dependencies,e!==null&&ta(e)&&(rc=!0))}function Do(e,t,n,r){B=e;var a=0;do{if(_o&&(xo=null),bo=0,_o=!1,25<=a)throw Error(i(301));if(a+=1,ho=mo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=Ws,o=t(n,r)}while(_o);return o}function Oo(){var e=O.H,t=e.useState()[0];return t=typeof t.then==`function`?Fo(t):t,e=e.useState()[0],(mo===null?null:mo.memoizedState)!==e&&(B.flags|=1024),t}function ko(){var e=yo!==0;return yo=0,e}function Ao(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function jo(e){if(go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}go=!1}po=0,ho=mo=B=null,_o=!1,bo=yo=0,xo=null}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ho===null?B.memoizedState=ho=e:ho=ho.next=e,ho}function No(){if(mo===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=mo.next;var t=ho===null?B.memoizedState:ho.next;if(t!==null)ho=t,mo=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));mo=e,e={memoizedState:mo.memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},ho===null?B.memoizedState=ho=e:ho=ho.next=e}return ho}function Po(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(e){var t=bo;return bo+=1,xo===null&&(xo=[]),e=Da(xo,e,t),t=B,(ho===null?t.memoizedState:ho.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Hs:Us),e}function Io(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Fo(e);if(e.$$typeof===C)return ra(e)}throw Error(i(438,String(e)))}function Lo(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.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=Po(),B.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]=ne;return t.index++,n}function Ro(e,t){return typeof t==`function`?t(e):t}function zo(e){return Bo(No(),mo,e)}function Bo(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?(po&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===R&&(d=!0);else if((po&p)===p){u=u.next,p===R&&(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,B.lanes|=p,Ul|=p;f=u.action,vo&&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,B.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Dr(o,e.memoizedState)&&(rc=!0,d&&(n=z,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 Vo(e){var t=No(),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);Dr(o,t.memoizedState)||(rc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ho(e,t,n){var r=B,a=No(),o=I;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Dr((mo||a).memoizedState,n);if(s&&(a.memoizedState=n,rc=!0),a=a.queue,ps(Go.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ho!==null&&ho.memoizedState.tag&1){if(r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||po&127||Uo(r,t,n)}return n}function Uo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=Po(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wo(e,t,n,r){t.value=n,t.getSnapshot=r,Ko(t)&&qo(e)}function Go(e,t,n){return n(function(){Ko(t)&&qo(e)})}function Ko(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dr(e,n)}catch{return!0}}function qo(e){var t=oi(e,2);t!==null&&pu(t,e,2)}function Jo(e){var t=Mo();if(typeof e==`function`){var n=e;if(e=n(),vo){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:e},t}function Yo(e,t,n,r){return e.baseState=n,Bo(e,mo,typeof r==`function`?r:Ro)}function Xo(e,t,n,r,a){if(Rs(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)}};O.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Zo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Zo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=O.T,o={};O.T=o;try{var s=n(i,r),c=O.S;c!==null&&c(o,s),Qo(e,t,s)}catch(n){es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),O.T=a}}else try{a=n(i,r),Qo(e,t,a)}catch(n){es(e,t,n)}}function Qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){$o(e,t,n)},function(n){return es(e,t,n)}):$o(e,t,n)}function $o(e,t,n){t.status=`fulfilled`,t.value=n,ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Zo(e,n)))}function es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ts(t),t=t.next;while(t!==r)}e.action=null}function ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ns(e,t){return t}function rs(e,t){if(I){var n=Fl.formState;if(n!==null){a:{var r=B;if(I){if(Li){b:{for(var i=Li,a=zi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Li=cf(i.nextSibling),r=i.data===`F!`;break a}}Vi(r)}r=!1}r&&(t=n[0])}}return n=Mo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:t},n.queue=r,n=Fs.bind(null,B,r),r.dispatch=n,r=Jo(!1),a=Ls.bind(null,B,!1,r.queue),r=Mo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Xo.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function is(e){return as(No(),mo,e)}function as(e,t,n){if(t=Bo(e,t,ns)[0],e=zo(Ro)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Fo(t)}catch(e){throw e===Sa?wa:e}else r=t;t=No();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,cs(9,{destroy:void 0},os.bind(null,i,n),null)),[r,a,e]}function os(e,t){e.action=t}function ss(e){var t=No(),n=mo;if(n!==null)return as(t,n,e);No(),t=t.memoizedState,n=No();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function cs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=Po(),B.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 ls(){return No().memoizedState}function us(e,t,n,r){var i=Mo();B.flags|=e,i.memoizedState=cs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ds(e,t,n,r){var i=No();r=r===void 0?null:r;var a=i.memoizedState.inst;mo!==null&&r!==null&&wo(r,mo.memoizedState.deps)?i.memoizedState=cs(t,a,n,r):(B.flags|=e,i.memoizedState=cs(1|t,a,n,r))}function fs(e,t){us(8390656,8,e,t)}function ps(e,t){ds(2048,8,e,t)}function ms(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=Po(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function hs(e){var t=No().memoizedState;return ms({ref:t,nextImpl:e}),function(){if(X&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function gs(e,t){return ds(4,2,e,t)}function _s(e,t){return ds(4,4,e,t)}function vs(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 ys(e,t,n){n=n==null?null:n.concat([e]),ds(4,4,vs.bind(null,t,e),n)}function bs(){}function xs(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ss(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&wo(t,r[1]))return r[0];if(r=e(),vo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function Cs(e,t,n){return n===void 0||po&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),B.lanes|=e,Ul|=e,n)}function ws(e,t,n,r){return Dr(n,t)?n:Qa.current===null?!(po&42)||po&1073741824&&!(Q&261930)?(rc=!0,e.memoizedState=n):(e=fu(),B.lanes|=e,Ul|=e,t):(e=Cs(e,n,r),Dr(e,t)||(rc=!0),e)}function Ts(e,t,n,r,i){var a=k.p;k.p=a!==0&&8>a?a:8;var o=O.T,s={};O.T=s,Ls(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Is(e,t,ga(c,r),du(e)):Is(e,t,r,du(e))}catch(n){Is(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{k.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function Es(){}function Ds(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Os(e).queue;Ts(e,a,t,ce,n===null?Es:function(){return ks(e),n(r)})}function Os(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ks(e){var t=Os(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},du())}function As(){return ra(Qf)}function js(){return No().memoizedState}function Ms(){return No().memoizedState}function Ns(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Ua(n);var r=Wa(t,e,n);r!==null&&(pu(r,t,n),Ga(r,t,n)),t={cache:ua()},e.payload=t;return}t=t.return}}function Ps(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?zs(t,n):(n=ai(e,t,n,r),n!==null&&(pu(n,e,r),Bs(n,t,r)))}function Fs(e,t,n){Is(e,t,n,du())}function Is(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))zs(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,Dr(s,o))return ii(e,t,i,0),Fl===null&&ri(),!1}catch{}if(n=ai(e,t,i,r),n!==null)return pu(n,e,r),Bs(n,t,r),!0}return!1}function Ls(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(i(479))}else t=ai(e,n,r,2),t!==null&&pu(t,e,2)}function Rs(e){var t=e.alternate;return e===B||t!==null&&t===B}function zs(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Vs={readContext:ra,use:Io,useCallback:Co,useContext:Co,useEffect:Co,useImperativeHandle:Co,useLayoutEffect:Co,useInsertionEffect:Co,useMemo:Co,useReducer:Co,useRef:Co,useState:Co,useDebugValue:Co,useDeferredValue:Co,useTransition:Co,useSyncExternalStore:Co,useId:Co,useHostTransitionStatus:Co,useFormState:Co,useActionState:Co,useOptimistic:Co,useMemoCache:Co,useCacheRefresh:Co};Vs.useEffectEvent=Co;var Hs={readContext:ra,use:Io,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:ra,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(vo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var i=n(t);if(vo){Ue(!0);try{n(t)}finally{Ue(!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=Ps.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Fs.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(Mo(),e,t)},useTransition:function(){var e=Jo(!1);return e=Ts.bind(null,B,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=Mo();if(I){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Q&127||Uo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,fs(Go.bind(null,r,o,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,o,n,t),null),n},useId:function(){var e=Mo(),t=Fl.identifierPrefix;if(I){var n=Ai,r=ki;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=So++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:As,useFormState:rs,useActionState:rs,useOptimistic:function(e){var t=Mo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ls.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:Lo,useCacheRefresh:function(){return Mo().memoizedState=Ns.bind(null,B)},useEffectEvent:function(e){var t=Mo(),n={impl:e};return t.memoizedState=n,function(){if(X&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Us={readContext:ra,use:Io,useCallback:xs,useContext:ra,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:zo,useRef:ls,useState:function(){return zo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){return ws(No(),mo.memoizedState,e,t)},useTransition:function(){var e=zo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:is,useActionState:is,useOptimistic:function(e,t){return Yo(No(),mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Us.useEffectEvent=hs;var Ws={readContext:ra,use:Io,useCallback:xs,useContext:ra,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:Vo,useRef:ls,useState:function(){return Vo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){var n=No();return mo===null?Cs(n,e,t):ws(n,mo.memoizedState,e,t)},useTransition:function(){var e=Vo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){var n=No();return mo===null?(n.baseState=e,[e,n.queue.dispatch]):Yo(n,mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Ws.useEffectEvent=hs;function Gs(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 Ks={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ua(r);i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(pu(t,e,r),Ga(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ua(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(pu(t,e,r),Ga(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=Wa(e,r,n),t!==null&&(pu(t,e,n),Ga(t,e,n))}};function V(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?!Or(n,r)||!Or(i,a):!0}function qs(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&&Ks.enqueueReplaceState(t,t.state,null)}function Js(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 Ys(e){P(e)}function Xs(e){console.error(e)}function Zs(e){P(e)}function H(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Qs(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 $s(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){H(e,t)},n}function U(e){return e=Ua(e),e.tag=3,e}function ec(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(){Qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Qs(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ea(t,n,a,!0),n=ro.current,n!==null){switch(n.tag){case 31:case 13:return io===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===Ta?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)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Tu(),!1}if(I)return t=ro.current,t===null?(r!==Bi&&(t=Error(i(423),{cause:r}),qi(xi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=xi(r,n),a=$s(e.stateNode,r,a),Ka(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Bi&&(e=Error(i(422),{cause:r}),qi(xi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=xi(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=xi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=$s(n.stateNode,r,e),Ka(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`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=U(a),ec(a,e,n,r),Ka(n,a),!1}n=n.return}while(n!==null);return!1}var nc=Error(i(461)),rc=!1;function ic(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function ac(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 na(t),r=To(e,t,n,o,a,i),s=ko(),e!==null&&!rc?(Ao(e,t,i),Dc(e,t,i)):(I&&s&&Ni(t),t.flags|=1,ic(e,t,r,i),t.child)}function oc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,sc(e,t,a,r,i)):(e=hi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!K(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Or:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function sc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Or(a,r)&&e.ref===t.ref)if(rc=!1,t.pendingProps=r=a,K(e,i))e.flags&131072&&(rc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return hc(e,t,n,r,i)}function cc(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 uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?to():eo(t,a),so(t);else return r=t.lanes=536870912,uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),to(),co(t)):(ba(t,a.cachePool),eo(t,a),co(t),t.memoizedState=null);return ic(e,t,i,n),t.child}function lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function uc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:la._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),to(),so(t),e!==null&&ea(e,t,r,!0),t.childLanes=i,null}function dc(e,t){return t=Cc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fc(e,t,n){return Ra(t,e.child,null,n),e=dc(t,t.pendingProps),e.flags|=2,lo(t),t.memoizedState=null,e}function pc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(I){if(r.mode===`hidden`)return e=dc(t,r),t.lanes=536870912,lc(null,e);if(oo(t),(e=Li)?(e=rf(e,zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return dc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(oo(t),a)if(t.flags&256)t.flags&=-257,t=fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(rc||ea(e,t,n,!1),a=(n&e.childLanes)!==0,rc||a){if(r=Fl,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,oi(e,s),pu(r,e,s),nc;Tu(),t=fc(e,t,n)}else e=o.treeContext,Li=cf(s.nextSibling),Ii=t,I=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=dc(t,r),t.flags|=4096;return t}return e=pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mc(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 hc(e,t,n,r,i){return na(t),n=To(e,t,n,r,void 0,i),r=ko(),e!==null&&!rc?(Ao(e,t,i),Dc(e,t,i)):(I&&r&&Ni(t),t.flags|=1,ic(e,t,n,i),t.child)}function gc(e,t,n,r,i,a){return na(t),t.updateQueue=null,n=Do(t,r,n,i),Eo(e),r=ko(),e!==null&&!rc?(Ao(e,t,a),Dc(e,t,a)):(I&&r&&Ni(t),t.flags|=1,ic(e,t,n,a),t.child)}function _c(e,t,n,r,i){if(na(t),t.stateNode===null){var a=li,o=n.contextType;typeof o==`object`&&o&&(a=ra(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ks,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Va(t),o=n.contextType,a.context=typeof o==`object`&&o?ra(o):li,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Gs(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&&Ks.enqueueReplaceState(a,a.state,null),Ya(t,r,a,i),Ja(),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=Js(n,s);a.props=c;var l=a.context,u=n.contextType;o=li,typeof u==`object`&&u&&(o=ra(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)&&qs(t,a,r,o),Ba=!1;var f=t.memoizedState;a.state=f,Ya(t,r,a,i),Ja(),l=t.memoizedState,s||f!==l||Ba?(typeof d==`function`&&(Gs(t,n,d,r),l=t.memoizedState),(c=Ba||V(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,Ha(e,t),o=t.memoizedProps,u=Js(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=li,typeof l==`object`&&l&&(c=ra(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)&&qs(t,a,r,c),Ba=!1,f=t.memoizedState,a.state=f,Ya(t,r,a,i),Ja();var p=t.memoizedState;o!==d||f!==p||Ba||e!==null&&e.dependencies!==null&&ta(e.dependencies)?(typeof s==`function`&&(Gs(t,n,s,r),p=t.memoizedState),(u=Ba||V(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ta(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,mc(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=Ra(t,e.child,null,i),t.child=Ra(t,null,n,i)):ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function vc(e,t,n,r){return Gi(),t.flags|=256,ic(e,t,n,r),t.child}var yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bc(e){return{baseLanes:e,cachePool:xa()}}function xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function W(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:(uo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(I){if(a?ao(t):co(t),(e=Li)?(e=rf(e,zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(co(t),a=t.mode,c=Cc({mode:`hidden`,children:c},a),r=gi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(null,r)):(ao(t),Sc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ao(t),t.flags&=-257,t=wc(e,t,n)):t.memoizedState===null?(co(t),c=r.fallback,a=t.mode,r=Cc({mode:`visible`,children:r.children},a),c=gi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ra(t,e.child,null,n),r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,t=lc(null,r)):(co(t),t.child=e.child,t.flags|=128,t=null);else if(ao(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,qi({value:r,source:null,stack:null}),t=wc(e,t,n)}else if(rc||ea(e,t,n,!1),s=(n&e.childLanes)!==0,rc||s){if(s=Fl,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,oi(e,r),pu(s,e,r),nc;af(c)||Tu(),t=wc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Li=cf(c.nextSibling),Ii=t,I=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=Sc(t,r.children),t.flags|=4096);return t}return a?(co(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=pi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=gi(c,a,n,null),c.flags|=2):c=pi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,lc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=bc(n):(a=c.cachePool,a===null?a=xa():(l=la._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(e.child,r)):(ao(t),n=e.child,e=n.sibling,n=pi(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 Sc(e,t){return t=Cc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Cc(e,t){return e=di(22,e,null,t),e.lanes=0,e}function wc(e,t,n){return Ra(t,e.child,null,n),e=Sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),L(e.return,t,n)}function G(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=uo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,fe(uo,o),ic(e,t,r,n),r=I?Ti:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tc(e,n,t);else if(e.tag===19)Tc(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&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),G(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&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}G(t,!0,n,null,a,r);break;case`together`:G(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),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ea(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=pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function K(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ta(e))):!0}function Oc(e,t,n){switch(t.tag){case 3:_e(t,t.stateNode.containerInfo),Zi(t,la,e.memoizedState.cache),Gi();break;case 27:case 5:ye(t);break;case 4:_e(t,t.stateNode.containerInfo);break;case 10:Zi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ao(t),e=Dc(e,t,n),e===null?null:e.sibling):W(e,t,n):(ao(t),t.flags|=128,null);ao(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ea(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),fe(uo,uo.current),r)break;return null;case 22:return t.lanes=0,cc(e,t,n,t.pendingProps);case 24:Zi(t,la,e.memoizedState.cache)}return Dc(e,t,n)}function kc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)rc=!0;else{if(!K(e,n)&&!(t.flags&128))return rc=!1,Oc(e,t,n);rc=!!(e.flags&131072)}else rc=!1,I&&t.flags&1048576&&Mi(t,Ti,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)fi(e)?(r=Js(e,r),t.tag=1,t=_c(null,t,e,r,n)):(t.tag=0,t=hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ac(null,t,e,r,n);break a}else if(a===E){t.tag=14,t=oc(null,t,e,r,n);break a}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Js(r,t.pendingProps),_c(e,t,r,a,n);case 3:a:{if(_e(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ha(e,t),Ya(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Zi(t,la,r),r!==o.cache&&$i(t,[la],n,!0),Ja(),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=vc(e,t,r,n);break a}else if(r!==a){a=xi(Error(i(424)),t),qi(a),t=vc(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(Li=cf(e.firstChild),Ii=t,I=!0,Ri=null,zi=!0,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Gi(),r===a){t=Dc(e,t,n);break a}ic(e,t,r,n)}t=t.child}return t;case 26:return mc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:I||(n=t.type,e=t.pendingProps,r=Bd(he.current).createElement(n),r[pt]=t,r[mt]=e,Pd(r,n,e),Tt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ye(t),e===null&&I&&(r=t.stateNode=ff(t.type,t.pendingProps,he.current),Ii=t,zi=!0,a=Li,Zd(t.type)?(lf=a,Li=cf(r.firstChild)):Li=a),ic(e,t,t.pendingProps.children,n),mc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&I&&((a=r=Li)&&(r=tf(r,t.type,t.pendingProps,zi),r===null?a=!1:(t.stateNode=r,Ii=t,Li=cf(r.firstChild),zi=!1,a=!0)),a||Vi(t)),ye(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=To(e,t,Oo,null,null,n),Qf._currentValue=a),mc(e,t),ic(e,t,r,n),t.child;case 6:return e===null&&I&&((e=n=Li)&&(n=nf(n,t.pendingProps,zi),n===null?e=!1:(t.stateNode=n,Ii=t,Li=null,e=!0)),e||Vi(t)),null;case 13:return W(e,t,n);case 4:return _e(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,n):ic(e,t,r,n),t.child;case 11:return ac(e,t,t.type,t.pendingProps,n);case 7:return ic(e,t,t.pendingProps,n),t.child;case 8:return ic(e,t,t.pendingProps.children,n),t.child;case 12:return ic(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Zi(t,t.type,r.value),ic(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,na(t),a=ra(a),r=r(a),t.flags|=1,ic(e,t,r,n),t.child;case 14:return oc(e,t,t.type,t.pendingProps,n);case 15:return sc(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return pc(e,t,n);case 22:return cc(e,t,n,t.pendingProps);case 24:return na(t),r=ra(la),e===null?(a=ya(),a===null&&(a=Fl,o=ua(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Va(t),Zi(t,la,a)):((e.lanes&n)!==0&&(Ha(e,t),Ya(t,null,null,n),Ja()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Zi(t,la,r),r!==a.cache&&$i(t,[la],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Zi(t,la,r))),ic(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ac(e){e.flags|=4}function jc(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(Su())e.flags|=8192;else throw ka=Ta,Ca}else e.flags&=-16777217}function Mc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw ka=Ta,Ca}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,ql|=t)}function Pc(e,t){if(!I)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 Fc(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 Ic(e,t,n){var r=t.pendingProps;switch(Pi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qi(la),ve(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ki())),Fc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ac(t),o===null?(Fc(t),jc(t,a,null,r,n)):(Fc(t),Mc(t,o))):o?o===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,o)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,a,e,r,n)),null;case 27:if(j(t),n=he.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}e=pe.current,Wi(t)?Hi(t,e):(e=ff(a,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(j(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}if(o=pe.current,Wi(t))Hi(t,o);else{var s=Bd(he.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[pt]=t,o[mt]=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(Pd(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&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=he.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ii,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Vi(t,!0)}else e=Bd(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Fc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(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[pt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return Fc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Wi(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[pt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),a=!1}else a=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(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),Nc(t,t.updateQueue),Fc(t),null);case 4:return ve(),e===null&&xd(t.stateNode.containerInfo),Fc(t),null;case 10:return Qi(t.type),Fc(t),null;case 19:if(de(uo),r=t.memoizedState,r===null)return Fc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Pc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,Pc(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)mi(n,e),n=n.sibling;return fe(uo,uo.current&1|2),I&&ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>$l&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!I)return Fc(t),null}else 2*Me()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,Pc(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?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=uo.current,fe(uo,a?n&1|2:n&1),I&&ji(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(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&&de(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qi(la),Fc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Lc(e,t){switch(Pi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(la),ve(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return j(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(uo),null;case 4:return ve(),null;case 10:return Qi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&de(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qi(la),null;case 25:return null;default:return null}}function Rc(e,t){switch(Pi(t),t.tag){case 3:Qi(la),ve();break;case 26:case 27:case 5:j(t);break;case 4:ve();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:de(uo);break;case 10:Qi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&de(va);break;case 24:Qi(la)}}function zc(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){Uu(t,t.return,e)}}function Bc(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){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){Uu(e,e.return,t)}}}function Hc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Uc(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){Uu(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(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){Uu(e,t,n)}else n.current=null}function Gc(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){Uu(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[mt]=t}catch(t){Uu(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(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&&Zd(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 Yc(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=on));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(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&&Zd(e.type)&&(n=e.stateNode),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){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[pt]=e,t[mt]=n}catch(t){Uu(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Rd=sp,e=Mr(e),Nr(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(zd={focusedElem:e,selectionRange:n},sp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,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=Js(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(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,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&zc(5,n);break;case 1:if(vl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Js(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(vl(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{Za(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ul(e,n);break;case 13:vl(e,n),r&4&&dl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?bl(e,n,(n.subtreeFlags&8772)!=0):vl(e,n),Qc=i,$c=a}break;case 30:break;default:vl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bt(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 ol=null,sl=!1;function cl(e,t,n){for(n=n.child;n!==null;)ll(e,t,n),n=n.sibling}function ll(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(Ve,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,i=sl;Zd(n.type)&&(ol=n.stateNode,sl=!1),cl(e,t,n),pf(n.stateNode),ol=r,sl=i;break;case 5:$c||Wc(n,t);case 6:if(r=ol,i=sl,ol=null,cl(e,t,n),ol=r,sl=i,ol!==null)if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===`HTML`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:ol!==null&&(sl?(e=ol,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,cl(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),cl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),cl(e,t,n);break;case 21:cl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,cl(e,t,n),$c=r;break;default:cl(e,t,n)}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function fl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(i(435,e.tag))}}function pl(e,t){var n=fl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function ml(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(Zd(c.type)){ol=c.stateNode,sl=!1;break a}break;case 5:ol=c.stateNode,sl=!1;break a;case 3:case 4:ol=c.stateNode.containerInfo,sl=!0;break a}c=c.return}if(ol===null)throw Error(i(160));ll(o,s,a),ol=null,sl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)q(t,e),t=t.sibling}var hl=null;function q(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ml(t,e),gl(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:ml(t,e),gl(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(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=hl;if(ml(t,e),gl(e),r&512&&($c||n===null||Wc(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[yt]||o[pt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[pt]=e,Tt(o),r=o;break a;case`link`:var s=Vf(`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),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`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),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[pt]=e,Tt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:ml(t,e),gl(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ml(t,e),gl(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){a=e.stateNode;try{Zt(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Kc(e,a,n===null?a:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(ml(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=hl,hl=gf(t.containerInfo),ml(t,e),hl=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}el&&(el=!1,_l(e));break;case 4:r=hl,hl=gf(e.stateNode.containerInfo),ml(t,e),gl(e),hl=r;break;case 12:ml(t,e),gl(e);break;case 31:ml(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 13:ml(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||a,$c=d||l,ml(t,e),$c=d,Qc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Qc||$c||yl(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){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(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,pl(e,n))));break;case 19:ml(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 30:break;case 21:break;default:ml(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Xc(e,Jc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Zt(o,``),n.flags&=-33),Xc(e,Jc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Yc(e,Jc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),yl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),yl(t);break;case 27:pf(t.stateNode);case 26:case 5:Wc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(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:bl(i,a,n),zc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(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++)Xa(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ul(i,a);break;case 13:bl(i,a,n),n&&o&4&&dl(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Uc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(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&&da(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&da(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&zc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(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&&da(e)));break;case 12:if(i&2048){Cl(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){Uu(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Cl(e,t,n,r):J(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(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:Tl(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):J(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function J(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:J(n,r),i&2048&&xl(r.alternate,r);break;case 24:J(n,r),i&2048&&Sl(r.alternate,r);break;default:J(n,r)}t=t.sibling}}var El=8192;function Dl(e,t,n){if(e.subtreeFlags&El)for(e=e.child;e!==null;)Ol(e,t,n),e=e.sibling}function Ol(e,t,n){switch(e.tag){case 26:Dl(e,t,n),e.flags&El&&e.memoizedState!==null&&Gf(n,hl,e.memoizedState,e.memoizedProps);break;case 5:Dl(e,t,n);break;case 3:case 4:var r=hl;hl=gf(e.stateNode.containerInfo),Dl(e,t,n),hl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=El,El=16777216,Dl(e,t,n),El=r):Dl(e,t,n));break;default:Dl(e,t,n)}}function kl(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 Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Ml(r,e)}kl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jl(e),e=e.sibling}function jl(e){switch(e.tag){case 0:case 11:case 15:Al(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:Al(e);break;case 12:Al(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Y(e)):Al(e);break;default:Al(e)}}function Y(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Ml(r,e)}kl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Y(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Y(t));break;default:Y(t)}e=e.sibling}}function Ml(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(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:da(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Nl={getCacheForType:function(e){var t=ra(la),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ra(la).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,X=0,Fl=null,Z=null,Q=0,Il=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return X&2&&Q!==0?Q&-Q:O.T===null?ut():ud()}function fu(){if(Kl===0)if(!(Q&536870912)||I){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),Kl=e}else Kl=536870912;return e=ro.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Fl&&(Il===2||Il===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Q,Kl,!1)),rt(e,n),(!(X&2)||e!==Fl)&&(e===Fl&&(!(X&2)&&(Wl|=n),Hl===4&&_u(e,Q,Kl,!1)),nd(e))}function mu(e,t,n){if(X&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||$e(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){zl&&!r&&_u(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!gu(n)){a=Eu(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=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,a=4;break a}o=Yl,Yl=a,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(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:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Zl+300-Me(),10<a)){if(_u(r,t,Kl,!Rl),Qe(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),a);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}}break}while(1);nd(e)}function hu(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:on},Ol(t,a,d);var m=(a&62914560)===a?Zl-Me():(a&4194048)===a?Ql-Me():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(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(!Dr(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 _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&at(e,n,t)}function vu(){return X&6?!0:(rd(0,!1),!1)}function yu(){if(Z!==null){if(Il===0)var e=Z.return;else e=Z,Xi=Yi=null,jo(e),Ma=null,Na=0,e=Z;for(;e!==null;)Rc(e.alternate,e),e=e.return;Z=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Fl=e,Z=n=pi(e.current,null),Q=t,Il=0,Ll=null,Rl=!1,zl=$e(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-We(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,ri(),n}function xu(e,t){B=null,O.H=Vs,t===Sa||t===wa?(t=Aa(),Il=3):t===Ca?(t=Aa(),Il=4):Il=t===nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Z===null&&(Hl=1,H(e,xi(t,e.current)))}function Su(){var e=ro.current;return e===null?!0:(Q&4194048)===Q?io===null:(Q&62914560)===Q||Q&536870912?e===io:!1}function Cu(){var e=O.H;return O.H=Vs,e===null?Vs:e}function wu(){var e=O.A;return O.A=Nl,e}function Tu(){Hl=4,Rl||(Q&4194048)!==Q&&ro.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Fl===null||_u(Fl,Q,Kl,!1)}function Eu(e,t,n){var r=X;X|=2;var i=Cu(),a=wu();(Fl!==e||Q!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Il!==0&&Z!==null){var s=Z,c=Ll;switch(Il){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:ro.current===null&&(t=!0);var l=Il;if(Il=0,Ll=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Il,Il=0,Ll=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Xi=Yi=null,X=r,O.H=i,O.A=a,Z===null&&(Fl=null,Q=0,ri()),o}function Du(){for(;Z!==null;)Au(Z)}function Ou(e,t){var n=X;X|=2;var r=Cu(),a=wu();Fl!==e||Q!==t?(eu=null,$l=Me()+500,bu(e,t)):zl=$e(e,t);a:do try{if(Il!==0&&Z!==null){t=Z;var o=Ll;b:switch(Il){case 1:Il=0,Ll=null,Mu(e,t,o,1);break;case 2:case 9:if(Ea(o)){Il=0,Ll=null,ju(t);break}t=function(){Il!==2&&Il!==9||Fl!==e||(Il=7),nd(e)},o.then(t,t);break a;case 3:Il=7;break a;case 4:Il=5;break a;case 7:Ea(o)?(Il=0,Ll=null,ju(t)):(Il=0,Ll=null,Mu(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Wf(s):c.stateNode.complete){Il=0,Ll=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Nu(u))}break b}}Il=0,Ll=null,Mu(e,t,o,5);break;case 6:Il=0,Ll=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return Xi=Yi=null,O.H=r,O.A=a,X=n,Z===null?(Fl=null,Q=0,ri(),Hl):0}function ku(){for(;Z!==null&&!Ae();)Au(Z)}function Au(e){var t=kc(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=gc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=gc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:jo(t);default:Rc(n,t),t=Z=mi(t,Vl),t=kc(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function Mu(e,t,n,r){Xi=Yi=null,jo(t),Ma=null,Na=0;var i=t.return;try{if(tc(e,i,t,n,Q)){Hl=1,H(e,xi(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Hl=1,H(e,xi(n,e.current)),Z=null;return}t.flags&32768?(I||r===1?e=!0:zl||Q&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ro.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Ic(t.alternate,t,Vl);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);Hl=6,Z=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(X&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ni,it(e,n,o,s,c,l),e===Fl&&(Z=Fl=null,Q=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(Ie,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=O.T,O.T=null,a=k.p,k.p=2,s=X,X|=4;try{rl(e,t,n)}finally{X=s,k.p=a,O.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=X;X|=4;try{q(t,e);var a=zd,o=Mr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&jr(s.ownerDocument.documentElement,s)){if(c!==null&&Nr(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 _=Ar(s,h),v=Ar(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}}sp=!!Rd,zd=Rd=null}finally{X=i,k.p=r,O.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=X;X|=4;try{il(e,t.alternate,t)}finally{X=i,k.p=r,O.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,je();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),lt(n),t=t.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=O.T,i=k.p,k.p=2,O.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{O.T=t,k.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,da(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=lt(au),r=O.T,a=k.p;try{k.p=32>n?32:n,O.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,X&6)throw Error(i(331));var c=X;if(X|=4,jl(o.current),wl(o,o.current,s,n),X=c,rd(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{k.p=a,O.T=r,zu(e,t)}}function Hu(e,t,n){t=xi(n,t),t=$s(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(rt(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=xi(n,e),n=U(2),r=Wa(t,n,2),r!==null&&(ec(n,r,t,e),rt(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;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)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Q&n)===n&&(Hl===4||Hl===3&&(Q&62914560)===Q&&300>Me()-Zl?!(X&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=tt()),e=oi(e,t),e!==null&&(rt(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(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),Ku(e,n)}function Yu(e,t){return Oe(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;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-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Q,a=Qe(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=Me(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Q,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Il===2||Il===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),lt(n)){case 2:case 8:n=Fe;break;case 32:n=Ie;break;case 268435456:n=Re;break;default:n=Ie}return r=sd.bind(null,e),n=Oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Q;return r=Qe(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,Me()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){X&6?Oe(Pe,id):ad()})}function ud(){if(td===0){var e=R;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:an(``+e)}function fd(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 pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Dn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);Ds(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),Ds(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<$r.length;md++){var hd=$r[md];ei(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}ei(Gr,`onAnimationEnd`),ei(Kr,`onAnimationIteration`),ei(qr,`onAnimationStart`),ei(`dblclick`,`onDoubleClick`),ei(`focusin`,`onFocus`),ei(`focusout`,`onBlur`),ei(Jr,`onTransitionRun`),ei(Yr,`onTransitionStart`),ei(Xr,`onTransitionCancel`),ei(Zr,`onTransitionEnd`),kt(`onMouseEnter`,[`mouseout`,`mouseover`]),kt(`onMouseLeave`,[`mouseout`,`mouseover`]),kt(`onPointerEnter`,[`pointerout`,`pointerover`]),kt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ot(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ot(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ot(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ot(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`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(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(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){P(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){P(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[ht];n===void 0&&(n=t[ht]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,Et.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!gn||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 Cd(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=xt(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}pn(function(){var r=a,i=cn(n),s=[];a:{var c=Qr.get(e);if(c!==void 0){var l=Dn,u=e;switch(e){case`keypress`:if(Sn(n)===0)break a;case`keydown`:case`keyup`:l=Wn;break;case`focusin`:u=`focus`,l=In;break;case`focusout`:u=`blur`,l=In;break;case`beforeblur`:case`afterblur`:l=In;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=Pn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Fn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Kn;break;case Gr:case Kr:case qr:l=Ln;break;case Zr:l=qn;break;case`scroll`:case`scrollend`:l=kn;break;case`wheel`:l=Jn;break;case`copy`:case`cut`:case`paste`:l=Rn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Gn;break;case`toggle`:case`beforetoggle`:l=Yn}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=mn(m,p),g!=null&&d.push(wd(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!==sn&&(u=n.relatedTarget||n.fromElement)&&(xt(u)||u[M]))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?xt(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=Pn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Gn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:Ct(l),h=u==null?c:Ct(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,xt(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=Ed,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&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?Ct(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=hr;else if(lr(c))if(gr)v=Tr;else{v=Cr;var y=Sr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&tn(r.elementType)&&(v=hr):v=wr;if(v&&=v(e,r)){ur(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&qt(c,`number`,c.value)}switch(y=r?Ct(r):window,e){case`focusin`:(lr(y)||y.contentEditable===`true`)&&(Fr=y,Ir=r,Lr=null);break;case`focusout`:Lr=Ir=Fr=null;break;case`mousedown`:Rr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Rr=!1,zr(s,n,i);break;case`selectionchange`:if(Pr)break;case`keydown`:case`keyup`:zr(s,n,i)}var b;if(Zn)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 ar?rr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(er&&n.locale!==`ko`&&(ar||x!==`onCompositionStart`?x===`onCompositionEnd`&&ar&&(b=xn()):(vn=i,yn=`value`in vn?vn.value:vn.textContent,ar=!0)),y=Td(r,x),0<y.length&&(x=new N(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=ir(n),b!==null&&(x.data=b)))),(b=$n?or(e,n):sr(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new N(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(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=mn(e,n),i!=null&&r.unshift(wd(e,i,a)),i=mn(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(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=mn(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=mn(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
9
|
-
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Zt(e,``+r);break;case`className`:Ft(e,`class`,r);break;case`tabIndex`:Ft(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ft(e,n,r);break;case`style`:en(e,r,o);break;case`data`:if(t!==`object`){Ft(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=an(``+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`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=on);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`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=an(``+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`:$(`beforetoggle`,e),$(`toggle`,e),Pt(e,`popover`,r);break;case`xlinkActuate`:It(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:It(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:It(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:It(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Pt(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=nn.get(n)||n,Pt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:en(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`?Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Zt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=on);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Dt.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[mt]||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,``):Pt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`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:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`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:Md(e,t,r,d,n,null)}}Kt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`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:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Jt(e,!!r,n,!0):Jt(e,!!r,t,!1);return;case`textarea`:for(s in $(`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:Md(e,t,s,c,n,null)}Xt(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:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`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:Md(e,t,u,r,n,null)}return;default:if(tn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(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)||Md(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&&Md(e,t,p,m,r,f)}}Gt(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)||Md(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&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Jt(e,!!n,n?[]:``,!1):Jt(e,!!n,t,!0)):Jt(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:Md(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&&Md(e,t,s,a,r,o)}Yt(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:Md(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:Md(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)&&Md(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:Md(e,t,u,p,r,m)}return;default:if(tn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(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||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(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||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){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&&Id(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&&Id(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 Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(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),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[yt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(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 ef(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`:ef(n),bt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(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[yt])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=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(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 cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(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 pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=k.d;k.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=St(e);t!==null&&t.tag===5&&t.type===`form`?ks(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Wt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Wt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Wt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Wt(n.imageSizes)+`"]`)):i+=`[href="`+Wt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Wt(r)+`"][href="`+Wt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Tt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=wt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Tt(c),Pd(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,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=wt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Tt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=wt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Tt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=he.current)?gf(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=Af(n.href),n=wt(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=Af(n.href);var o=wt(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(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.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},mf.set(e,n),o||Nf(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=Pf(n),n=wt(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 Af(e){return`href="`+Wt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(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}),Pd(t,`link`,n),Tt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Wt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Wt(n.href)+`"]`);if(r)return t.instance=r,Tt(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`),Tt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,Tt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),Tt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,Tt(a),a):(r=n,(a=mf.get(o))&&(r=m({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Tt(a),Pd(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,Lf(r,n.precedence,e));return t.instance}function Lf(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 Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,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[yt]||a[pt]||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 Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(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=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Tt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Tt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(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=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.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=Jf.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 Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function $f(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=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(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 ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=di(3,null,null,t),e.current=a,a.stateNode=e,t=ua(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function tp(e){return e?(e=li,e):li}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(pu(n,e,t),Ga(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=ct(t);var n=oi(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=2,up(e,t,n,r)}finally{k.p=a,O.T=i}}function lp(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=8,up(e,t,n,r)}finally{k.p=a,O.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=St(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}nd(a),!(X&6)&&($l=Me()+500,rd(0,!1))}}break;case 31:case 13:s=oi(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=cn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=xt(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 fp=e,null}function mp(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(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case Le:return 32;case Re:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(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=St(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=xt(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,dt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);sn=r,n.target.dispatchEvent(r),sn=null}else return t=St(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=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(pp(r||n)===null)continue;break}var a=St(n);a!==null&&(e.splice(t,3),t-=3,Ds(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.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[mt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){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 Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[M]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.7`)throw Error(i(527,Lp,`19.2.7`));k.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 Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ve=zp.inject(Rp),He=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ys,s=Xs,c=Zs;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=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[M]=t.current,xd(e),new Fp(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=l(d(),1),y=_(),b=Object.create(null);b.open=`0`,b.close=`1`,b.ping=`2`,b.pong=`3`,b.message=`4`,b.upgrade=`5`,b.noop=`6`;var x=Object.create(null);Object.keys(b).forEach(e=>{x[b[e]]=e});var S={type:`error`,data:`parser error`},C=typeof Blob==`function`||typeof Blob<`u`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`,w=typeof ArrayBuffer==`function`,ee=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,T=({type:e,data:t},n,r)=>C&&t instanceof Blob?n?r(t):E(t,r):w&&(t instanceof ArrayBuffer||ee(t))?n?r(t):E(new Blob([t]),r):r(b[e]+(t||``)),E=(e,t)=>{let n=new FileReader;return n.onload=function(){let e=n.result.split(`,`)[1];t(`b`+(e||``))},n.readAsDataURL(e)};function D(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var te;function ne(e,t){if(C&&e.data instanceof Blob)return e.data.arrayBuffer().then(D).then(t);if(w&&(e.data instanceof ArrayBuffer||ee(e.data)))return t(D(e.data));T(e,!1,e=>{te||=new TextEncoder,t(te.encode(e))})}var re=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,ie=typeof Uint8Array>`u`?[]:new Uint8Array(256);for(let e=0;e<64;e++)ie[re.charCodeAt(e)]=e;var ae=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);let l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=ie[e.charCodeAt(r)],o=ie[e.charCodeAt(r+1)],s=ie[e.charCodeAt(r+2)],c=ie[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},oe=typeof ArrayBuffer==`function`,se=(e,t)=>{if(typeof e!=`string`)return{type:`message`,data:k(e,t)};let n=e.charAt(0);return n===`b`?{type:`message`,data:O(e.substring(1),t)}:x[n]?e.length>1?{type:x[n],data:e.substring(1)}:{type:x[n]}:S},O=(e,t)=>oe?k(ae(e),t):{base64:!0,data:e},k=(e,t)=>{switch(t){case`blob`:return e instanceof Blob?e:new Blob([e]);default:return e instanceof ArrayBuffer?e:e.buffer}},ce=``,le=(e,t)=>{let n=e.length,r=Array(n),i=0;e.forEach((e,a)=>{T(e,!1,e=>{r[a]=e,++i===n&&t(r.join(ce))})})},ue=(e,t)=>{let n=e.split(ce),r=[];for(let e=0;e<n.length;e++){let i=se(n[e],t);if(r.push(i),i.type===`error`)break}return r};function A(){return new TransformStream({transform(e,t){ne(e,n=>{let r=n.length,i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);let e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);let e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!=`string`&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}var de;function fe(e){return e.reduce((e,t)=>e+t.length,0)}function pe(e,t){if(e[0].length===t)return e.shift();let n=new Uint8Array(t),r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function me(e,t){de||=new TextDecoder;let n=[],r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(fe(n)<1)break;let e=pe(n,1);a=(e[0]&128)==128,i=e[0]&127,r=i<126?3:i===126?1:2}else if(r===1){if(fe(n)<2)break;let e=pe(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(r===2){if(fe(n)<8)break;let e=pe(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),a=t.getUint32(0);if(a>2**21-1){s.enqueue(S);break}i=a*2**32+t.getUint32(4),r=3}else{if(fe(n)<i)break;let e=pe(n,i);s.enqueue(se(a?e:de.decode(e),t)),r=0}if(i===0||i>e){s.enqueue(S);break}}}})}function he(e){if(e)return ge(e)}function ge(e){for(var t in he.prototype)e[t]=he.prototype[t];return e}he.prototype.on=he.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},he.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},he.prototype.off=he.prototype.removeListener=he.prototype.removeAllListeners=he.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},he.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},he.prototype.emitReserved=he.prototype.emit,he.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},he.prototype.hasListeners=function(e){return!!this.listeners(e).length};var _e=typeof Promise==`function`&&typeof Promise.resolve==`function`?e=>Promise.resolve().then(e):(e,t)=>t(e,0),ve=typeof self<`u`?self:typeof window<`u`?window:Function(`return this`)(),ye=`arraybuffer`;function j(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}var be=ve.setTimeout,xe=ve.clearTimeout;function Se(e,t){t.useNativeTimers?(e.setTimeoutFn=be.bind(ve),e.clearTimeoutFn=xe.bind(ve)):(e.setTimeoutFn=ve.setTimeout.bind(ve),e.clearTimeoutFn=ve.clearTimeout.bind(ve))}var Ce=1.33;function we(e){return typeof e==`string`?Te(e):Math.ceil((e.byteLength||e.size)*Ce)}function Te(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Ee(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function De(e){let t=``;for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+=`&`),t+=encodeURIComponent(n)+`=`+encodeURIComponent(e[n]));return t}function Oe(e){let t={},n=e.split(`&`);for(let e=0,r=n.length;e<r;e++){let r=n[e].split(`=`);t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}var ke=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type=`TransportError`}},Ae=class extends he{constructor(e){super(),this.writable=!1,Se(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved(`error`,new ke(e,t,n)),this}open(){return this.readyState=`opening`,this.doOpen(),this}close(){return(this.readyState===`opening`||this.readyState===`open`)&&(this.doClose(),this.onClose()),this}send(e){this.readyState===`open`&&this.write(e)}onOpen(){this.readyState=`open`,this.writable=!0,super.emitReserved(`open`)}onData(e){let t=se(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved(`packet`,e)}onClose(e){this.readyState=`closed`,super.emitReserved(`close`,e)}pause(e){}createUri(e,t={}){return e+`://`+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(`:`)===-1?e:`[`+e+`]`}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?`:`+this.opts.port:``}_query(e){let t=De(e);return t.length?`?`+t:``}},je=class extends Ae{constructor(){super(...arguments),this._polling=!1}get name(){return`polling`}doOpen(){this._poll()}pause(e){this.readyState=`pausing`;let t=()=>{this.readyState=`paused`,e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once(`pollComplete`,function(){--e||t()})),this.writable||(e++,this.once(`drain`,function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved(`poll`)}onData(e){ue(e,this.socket.binaryType).forEach(e=>{if(this.readyState===`opening`&&e.type===`open`&&this.onOpen(),e.type===`close`)return this.onClose({description:`transport closed by the server`}),!1;this.onPacket(e)}),this.readyState!==`closed`&&(this._polling=!1,this.emitReserved(`pollComplete`),this.readyState===`open`&&this._poll())}doClose(){let e=()=>{this.write([{type:`close`}])};this.readyState===`open`?e():this.once(`open`,e)}write(e){this.writable=!1,le(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved(`drain`)})})}uri(){let e=this.opts.secure?`https`:`http`,t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=Ee()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},Me=!1;try{Me=typeof XMLHttpRequest<`u`&&`withCredentials`in new XMLHttpRequest}catch{}var Ne=Me;function Pe(){}var Fe=class extends je{constructor(e){if(super(e),typeof location<`u`){let t=location.protocol===`https:`,n=location.port;n||=t?`443`:`80`,this.xd=typeof location<`u`&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:`POST`,data:e});n.on(`success`,t),n.on(`error`,(e,t)=>{this.onError(`xhr post error`,e,t)})}doPoll(){let e=this.request();e.on(`data`,this.onData.bind(this)),e.on(`error`,(e,t)=>{this.onError(`xhr poll error`,e,t)}),this.pollXhr=e}},Ie=class e extends he{constructor(e,t,n){super(),this.createRequest=e,Se(this,n),this._opts=n,this._method=n.method||`GET`,this._uri=t,this._data=n.data===void 0?null:n.data,this._create()}_create(){var t;let n=j(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);n.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch{}if(this._method===`POST`)try{r.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch{}try{r.setRequestHeader(`Accept`,`*/*`)}catch{}(t=this._opts.cookieJar)==null||t.addCookies(r),`withCredentials`in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;r.readyState===3&&((e=this._opts.cookieJar)==null||e.parseCookies(r.getResponseHeader(`set-cookie`))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status==`number`?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}typeof document<`u`&&(this._index=e.requestsCount++,e.requests[this._index]=this)}_onError(e){this.emitReserved(`error`,e,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(this._xhr===void 0||this._xhr===null)){if(this._xhr.onreadystatechange=Pe,t)try{this._xhr.abort()}catch{}typeof document<`u`&&delete e.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved(`data`,e),this.emitReserved(`success`),this._cleanup())}abort(){this._cleanup()}};if(Ie.requestsCount=0,Ie.requests={},typeof document<`u`){if(typeof attachEvent==`function`)attachEvent(`onunload`,Le);else if(typeof addEventListener==`function`){let e=`onpagehide`in ve?`pagehide`:`unload`;addEventListener(e,Le,!1)}}function Le(){for(let e in Ie.requests)Ie.requests.hasOwnProperty(e)&&Ie.requests[e].abort()}var Re=(function(){let e=Be({xdomain:!1});return e&&e.responseType!==null})(),ze=class extends Fe{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Re&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Ie(Be,this.uri(),e)}};function Be(e){let t=e.xdomain;try{if(typeof XMLHttpRequest<`u`&&(!t||Ne))return new XMLHttpRequest}catch{}if(!t)try{return new ve[[`Active`,`Object`].join(`X`)](`Microsoft.XMLHTTP`)}catch{}}var Ve=typeof navigator<`u`&&typeof navigator.product==`string`&&navigator.product.toLowerCase()===`reactnative`,He=class extends Ae{get name(){return`websocket`}doOpen(){let e=this.uri(),t=this.opts.protocols,n=Ve?{}:j(this.opts,`agent`,`perMessageDeflate`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`localAddress`,`protocolVersion`,`origin`,`maxPayload`,`family`,`checkServerIdentity`);this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(e){return this.emitReserved(`error`,e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:`websocket connection closed`,context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError(`websocket error`,e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;T(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch{}r&&_e(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){this.ws!==void 0&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?`wss`:`ws`,t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Ee()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Ue=ve.WebSocket||ve.MozWebSocket,We={websocket:class extends He{createSocket(e,t,n){return Ve?new Ue(e,t,n):t?new Ue(e,t):new Ue(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends Ae{get name(){return`webtransport`}doOpen(){try{this._transport=new WebTransport(this.createUri(`https`),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved(`error`,e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError(`webtransport error`,e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=me(2**53-1,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=A();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),i())}).catch(e=>{})};i();let a={type:`open`};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&_e(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)==null||e.close()}},polling:ze},Ge=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ke=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function qe(e){if(e.length>8e3)throw`URI too long`;let t=e,n=e.indexOf(`[`),r=e.indexOf(`]`);n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,`;`)+e.substring(r,e.length));let i=Ge.exec(e||``),a={},o=14;for(;o--;)a[Ke[o]]=i[o]||``;return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,`:`),a.authority=a.authority.replace(`[`,``).replace(`]`,``).replace(/;/g,`:`),a.ipv6uri=!0),a.pathNames=Je(a,a.path),a.queryKey=Ye(a,a.query),a}function Je(e,t){let n=t.replace(/\/{2,9}/g,`/`).split(`/`);return(t.slice(0,1)==`/`||t.length===0)&&n.splice(0,1),t.slice(-1)==`/`&&n.splice(n.length-1,1),n}function Ye(e,t){let n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var Xe=typeof addEventListener==`function`&&typeof removeEventListener==`function`,Ze=[];Xe&&addEventListener(`offline`,()=>{Ze.forEach(e=>e())},!1);var Qe=class e extends he{constructor(e,t){if(super(),this.binaryType=ye,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e==`object`&&(t=e,e=null),e){let n=qe(e);t.hostname=n.host,t.secure=n.protocol===`https`||n.protocol===`wss`,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=qe(t.host).host);Se(this,t),this.secure=t.secure==null?typeof location<`u`&&location.protocol===`https:`:t.secure,t.hostname&&!t.port&&(t.port=this.secure?`443`:`80`),this.hostname=t.hostname||(typeof location<`u`?location.hostname:`localhost`),this.port=t.port||(typeof location<`u`&&location.port?location.port:this.secure?`443`:`80`),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:`/engine.io`,agent:!1,withCredentials:!1,upgrade:!0,timestampParam:`t`,rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,``)+(this.opts.addTrailingSlash?`/`:``),typeof this.opts.query==`string`&&(this.opts.query=Oe(this.opts.query)),Xe&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener(`beforeunload`,this._beforeunloadEventListener,!1)),this.hostname!==`localhost`&&(this._offlineEventListener=()=>{this._onClose(`transport close`,{description:`network connection lost`})},Ze.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}let t=this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;let n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on(`drain`,this._onDrain.bind(this)).on(`packet`,this._onPacket.bind(this)).on(`error`,this._onError.bind(this)).on(`close`,e=>this._onClose(`transport close`,e))}onOpen(){this.readyState=`open`,e.priorWebsocketSuccess=this.transport.name===`websocket`,this.emitReserved(`open`),this.flush()}_onPacket(e){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`)switch(this.emitReserved(`packet`,e),this.emitReserved(`heartbeat`),e.type){case`open`:this.onHandshake(JSON.parse(e.data));break;case`ping`:this._sendPacket(`pong`),this.emitReserved(`ping`),this.emitReserved(`pong`),this._resetPingTimeout();break;case`error`:let t=Error(`server error`);t.code=e.data,this._onError(t);break;case`message`:this.emitReserved(`data`,e.data),this.emitReserved(`message`,e.data);break}}onHandshake(e){this.emitReserved(`handshake`,e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!==`closed`&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose(`ping timeout`)},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved(`drain`):this.flush()}flush(){if(this.readyState!==`closed`&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved(`flush`)}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name===`polling`&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let n=this.writeBuffer[t].data;if(n&&(e+=we(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,_e(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket(`message`,e,t,n),this}send(e,t,n){return this._sendPacket(`message`,e,t,n),this}_sendPacket(e,t,n,r){if(typeof t==`function`&&(r=t,t=void 0),typeof n==`function`&&(r=n,n=null),this.readyState===`closing`||this.readyState===`closed`)return;n||={},n.compress=!1!==n.compress;let i={type:e,data:t,options:n};this.emitReserved(`packetCreate`,i),this.writeBuffer.push(i),r&&this.once(`flush`,r),this.flush()}close(){let e=()=>{this._onClose(`forced close`),this.transport.close()},t=()=>{this.off(`upgrade`,t),this.off(`upgradeError`,t),e()},n=()=>{this.once(`upgrade`,t),this.once(`upgradeError`,t)};return(this.readyState===`opening`||this.readyState===`open`)&&(this.readyState=`closing`,this.writeBuffer.length?this.once(`drain`,()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(t){if(e.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState===`opening`)return this.transports.shift(),this._open();this.emitReserved(`error`,t),this._onClose(`transport error`,t)}_onClose(e,t){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners(`close`),this.transport.close(),this.transport.removeAllListeners(),Xe&&(this._beforeunloadEventListener&&removeEventListener(`beforeunload`,this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=Ze.indexOf(this._offlineEventListener);e!==-1&&Ze.splice(e,1)}this.readyState=`closed`,this.id=null,this.emitReserved(`close`,e,t),this.writeBuffer=[],this._prevBufferLen=0}}};Qe.protocol=4;var $e=class extends Qe{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState===`open`&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;Qe.priorWebsocketSuccess=!1;let r=()=>{n||(t.send([{type:`ping`,data:`probe`}]),t.once(`packet`,e=>{if(!n)if(e.type===`pong`&&e.data===`probe`){if(this.upgrading=!0,this.emitReserved(`upgrading`,t),!t)return;Qe.priorWebsocketSuccess=t.name===`websocket`,this.transport.pause(()=>{n||this.readyState!==`closed`&&(l(),this.setTransport(t),t.send([{type:`upgrade`}]),this.emitReserved(`upgrade`,t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error(`probe error`);e.transport=t.name,this.emitReserved(`upgradeError`,e)}}))};function i(){n||(n=!0,l(),t.close(),t=null)}let a=e=>{let n=Error(`probe error: `+e);n.transport=t.name,i(),this.emitReserved(`upgradeError`,n)};function o(){a(`transport closed`)}function s(){a(`socket closed`)}function c(e){t&&e.name!==t.name&&i()}let l=()=>{t.removeListener(`open`,r),t.removeListener(`error`,a),t.removeListener(`close`,o),this.off(`close`,s),this.off(`upgrading`,c)};t.once(`open`,r),t.once(`error`,a),t.once(`close`,o),this.once(`close`,s),this.once(`upgrading`,c),this._upgrades.indexOf(`webtransport`)!==-1&&e!==`webtransport`?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}},et=class extends $e{constructor(e,t={}){let n=typeof e==`object`?e:t;(!n.transports||n.transports&&typeof n.transports[0]==`string`)&&(n.transports=(n.transports||[`polling`,`websocket`,`webtransport`]).map(e=>We[e]).filter(e=>!!e)),super(e,n)}};et.protocol;function tt(e,t=``,n){let r=e;n||=typeof location<`u`&&location,e??=n.protocol+`//`+n.host,typeof e==`string`&&(e.charAt(0)===`/`&&(e=e.charAt(1)===`/`?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=n===void 0?`https://`+e:n.protocol+`//`+e),r=qe(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port=`80`:/^(http|ws)s$/.test(r.protocol)&&(r.port=`443`)),r.path=r.path||`/`;let i=r.host.indexOf(`:`)===-1?r.host:`[`+r.host+`]`;return r.id=r.protocol+`://`+i+`:`+r.port+t,r.href=r.protocol+`://`+i+(n&&n.port===r.port?``:`:`+r.port),r}var nt=typeof ArrayBuffer==`function`,rt=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,it=Object.prototype.toString,at=typeof Blob==`function`||typeof Blob<`u`&&it.call(Blob)===`[object BlobConstructor]`,ot=typeof File==`function`||typeof File<`u`&&it.call(File)===`[object FileConstructor]`;function st(e){return nt&&(e instanceof ArrayBuffer||rt(e))||at&&e instanceof Blob||ot&&e instanceof File}function ct(e,t){if(!e||typeof e!=`object`)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(ct(e[t]))return!0;return!1}if(st(e))return!0;if(e.toJSON&&typeof e.toJSON==`function`&&arguments.length===1)return ct(e.toJSON(),!0);for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&ct(e[t]))return!0;return!1}function lt(e){let t=[],n=e.data,r=e;return r.data=ut(n,t),r.attachments=t.length,{packet:r,buffers:t}}function ut(e,t){if(!e)return e;if(st(e)){let n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=ut(e[r],t);return n}else if(typeof e==`object`&&!(e instanceof Date)){let n={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ut(e[r],t));return n}return e}function dt(e,t){return e.data=ft(e.data,t),delete e.attachments,e}function ft(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num==`number`&&e.num>=0&&e.num<t.length)return t[e.num];throw Error(`illegal attachments`)}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ft(e[n],t);else if(typeof e==`object`)for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ft(e[n],t));return e}var pt=s({Decoder:()=>gt,Encoder:()=>ht,PacketType:()=>M,isPacketValid:()=>Ct,protocol:()=>5}),mt=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`],M;(function(e){e[e.CONNECT=0]=`CONNECT`,e[e.DISCONNECT=1]=`DISCONNECT`,e[e.EVENT=2]=`EVENT`,e[e.ACK=3]=`ACK`,e[e.CONNECT_ERROR=4]=`CONNECT_ERROR`,e[e.BINARY_EVENT=5]=`BINARY_EVENT`,e[e.BINARY_ACK=6]=`BINARY_ACK`})(M||={});var ht=class{constructor(e){this.replacer=e}encode(e){return(e.type===M.EVENT||e.type===M.ACK)&&ct(e)?this.encodeAsBinary({type:e.type===M.EVENT?M.BINARY_EVENT:M.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=``+e.type;return(e.type===M.BINARY_EVENT||e.type===M.BINARY_ACK)&&(t+=e.attachments+`-`),e.nsp&&e.nsp!==`/`&&(t+=e.nsp+`,`),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=lt(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},gt=class e extends he{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e==`function`?{reviver:e}:e)}add(e){let t;if(typeof e==`string`){if(this.reconstructor)throw Error(`got plaintext data when reconstructing a packet`);t=this.decodeString(e);let n=t.type===M.BINARY_EVENT;n||t.type===M.BINARY_ACK?(t.type=n?M.EVENT:M.ACK,this.reconstructor=new _t(t),t.attachments===0&&super.emitReserved(`decoded`,t)):super.emitReserved(`decoded`,t)}else if(st(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved(`decoded`,t));else throw Error(`got binary data when not reconstructing a packet`);else throw Error(`Unknown type: `+e)}decodeString(t){let n=0,r={type:Number(t.charAt(0))};if(M[r.type]===void 0)throw Error(`unknown packet type `+r.type);if(r.type===M.BINARY_EVENT||r.type===M.BINARY_ACK){let e=n+1;for(;t.charAt(++n)!==`-`&&n!=t.length;);let i=t.substring(e,n);if(i!=Number(i)||t.charAt(n)!==`-`)throw Error(`Illegal attachments`);let a=Number(i);if(!yt(a)||a<0)throw Error(`Illegal attachments`);if(a>this.opts.maxAttachments)throw Error(`too many attachments`);r.attachments=a}if(t.charAt(n+1)===`/`){let e=n+1;for(;++n&&!(t.charAt(n)===`,`||n===t.length););r.nsp=t.substring(e,n)}else r.nsp=`/`;let i=t.charAt(n+1);if(i!==``&&Number(i)==i){let e=n+1;for(;++n;){let e=t.charAt(n);if(e==null||Number(e)!=e){--n;break}if(n===t.length)break}r.id=Number(t.substring(e,n+1))}if(t.charAt(++n)){let i=this.tryParse(t.substr(n));if(e.isPayloadValid(r.type,i))r.data=i;else throw Error(`invalid payload`)}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case M.CONNECT:return xt(t);case M.DISCONNECT:return t===void 0;case M.CONNECT_ERROR:return typeof t==`string`||xt(t);case M.EVENT:case M.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&mt.indexOf(t[0])===-1);case M.ACK:case M.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&=(this.reconstructor.finishedReconstruction(),null)}},_t=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let e=dt(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function vt(e){return typeof e==`string`}var yt=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e};function bt(e){return e===void 0||yt(e)}function xt(e){return Object.prototype.toString.call(e)===`[object Object]`}function St(e,t){switch(e){case M.CONNECT:return t===void 0||xt(t);case M.DISCONNECT:return t===void 0;case M.EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&mt.indexOf(t[0])===-1);case M.ACK:return Array.isArray(t);case M.CONNECT_ERROR:return typeof t==`string`||xt(t);default:return!1}}function Ct(e){return vt(e.nsp)&&bt(e.id)&&St(e.type,e.data)}function wt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var Tt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Et=class extends he{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[wt(e,`open`,this.onopen.bind(this)),wt(e,`packet`,this.onpacket.bind(this)),wt(e,`error`,this.onerror.bind(this)),wt(e,`close`,this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState===`open`&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift(`message`),this.emit.apply(this,e),this}emit(e,...t){if(Tt.hasOwnProperty(e))throw Error(`"`+e.toString()+`" is a reserved event name`);if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let n={type:M.EVENT,data:t};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof t[t.length-1]==`function`){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}let r=this.io.engine?.transport?.writable,i=this.connected&&!this.io.engine?._hasPingExpired();return this.flags.volatile&&!r||(i?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){let n=this.flags.timeout??this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error(`operation has timed out`))},n),i=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]==`function`&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],e===null?(this._queue.shift(),t&&t(null,...r)):n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth==`function`?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:M.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved(`connect_error`,e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved(`disconnect`,e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error(`socket has been disconnected`))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case M.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved(`connect_error`,Error(`It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)`));break;case M.EVENT:case M.BINARY_EVENT:this.onevent(e);break;case M.ACK:case M.BINARY_ACK:this.onack(e);break;case M.DISCONNECT:this.ondisconnect();break;case M.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved(`connect_error`,t);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]==`string`&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,n=!1;return function(...r){n||(n=!0,t.packet({type:M.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];typeof t==`function`&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved(`connect`)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose(`io server disconnect`)}destroy(){this.subs&&=(this.subs.forEach(e=>e()),void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:M.DISCONNECT}),this.destroy(),this.connected&&this.onclose(`io client disconnect`),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};function Dt(e){e||={},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Dt.prototype.duration=function(){var e=this.ms*this.factor**+ this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},Dt.prototype.reset=function(){this.attempts=0},Dt.prototype.setMin=function(e){this.ms=e},Dt.prototype.setMax=function(e){this.max=e},Dt.prototype.setJitter=function(e){this.jitter=e};var Ot=class extends he{constructor(e,t){super(),this.nsps={},this.subs=[],e&&typeof e==`object`&&(t=e,e=void 0),t||={},t.path=t.path||`/socket.io`,this.opts=t,Se(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor??.5),this.backoff=new Dt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState=`closed`,this.uri=e;let n=t.parser||pt;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)==null||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)==null||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)==null||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf(`open`))return this;this.engine=new et(this.uri,this.opts);let t=this.engine,n=this;this._readyState=`opening`,this.skipReconnect=!1;let r=wt(t,`open`,function(){n.onopen(),e&&e()}),i=t=>{this.cleanup(),this._readyState=`closed`,this.emitReserved(`error`,t),e?e(t):this.maybeReconnectOnOpen()},a=wt(t,`error`,i);if(!1!==this._timeout){let e=this._timeout,n=this.setTimeoutFn(()=>{r(),i(Error(`timeout`)),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=`open`,this.emitReserved(`open`);let e=this.engine;this.subs.push(wt(e,`ping`,this.onping.bind(this)),wt(e,`data`,this.ondata.bind(this)),wt(e,`error`,this.onerror.bind(this)),wt(e,`close`,this.onclose.bind(this)),wt(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose(`parse error`,e)}}ondecoded(e){_e(()=>{this.emitReserved(`packet`,e)},this.setTimeoutFn)}onerror(e){this.emitReserved(`error`,e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Et(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let e of t)if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose(`forced close`)}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)==null||n.close(),this.backoff.reset(),this._readyState=`closed`,this.emitReserved(`close`,e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved(`reconnect_failed`),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved(`reconnect_attempt`,e.backoff.attempts),!e.skipReconnect&&e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved(`reconnect_error`,t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(`reconnect`,e)}},kt={};function At(e,t){typeof e==`object`&&(t=e,e=void 0),t||={};let n=tt(e,t.path||`/socket.io`),r=n.source,i=n.id,a=n.path,o=kt[i]&&a in kt[i].nsps,s=t.forceNew||t[`force new connection`]||!1===t.multiplex||o,c;return s?c=new Ot(r,t):(kt[i]||(kt[i]=new Ot(r,t)),c=kt[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(At,{Manager:Ot,Socket:Et,io:At,connect:At});var jt=2e3,Mt=4e3,Nt=1e3;function Pt(e){return e?Array.isArray(e)?{models:e}:Array.isArray(e.models)?e:null:null}function Ft(e,t){return t?`${t.replace(/\/$/,``)}${e}`:e}function It(e=``){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(`connecting`),[s,c]=(0,v.useState)(0),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(0),[h,g]=(0,v.useState)(`speed`),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(0),[S,C]=(0,v.useState)(0),[w,ee]=(0,v.useState)(null),T=(0,v.useRef)(null),E=(0,v.useRef)(null),D=(0,v.useRef)(null),te=(0,v.useRef)(0),ne=(0,v.useRef)(0),re=(0,v.useRef)(!1),ie=(0,v.useCallback)((e,t=`unknown`)=>{let r=Pt(e);!r||!re.current||(n(r.models??[]),g(r.pingMode??`speed`),u(r.nextPingAt??null),f(!!r.isPinging),m(Number.isFinite(r.pendingPings)?r.pendingPings:0),y(!!r.globalBenchmarkRunning),x(Number.isFinite(r.globalBenchmarkTotal)?r.globalBenchmarkTotal:0),C(Number.isFinite(r.globalBenchmarkCompleted)?r.globalBenchmarkCompleted:0),ee(r.updateStatus&&r.updateStatus.allowedOutdated?r.updateStatus:null),c(e=>e+1),te.current=Date.now(),t!==`poll`&&(i(!0),o(t)))},[]),ae=(0,v.useCallback)(async()=>{try{let t=await fetch(Ft(`/api/state`,e),{headers:{Accept:`application/json`}});if(t.ok){ie(await t.json(),`poll`),i(!0),o(e=>e===`socket`||e===`sse`?e:`poll`);return}}catch{}try{let t=await fetch(Ft(`/api/models`,e),{headers:{Accept:`application/json`}});if(!t.ok)throw Error(`HTTP ${t.status}`);ie(await t.json(),`poll`),i(!0),o(e=>e===`socket`||e===`sse`?e:`poll`)}catch{i(!1),o(`offline`)}},[ie,e]),oe=(0,v.useCallback)(()=>{if(!(E.current||!re.current))try{let t=new EventSource(Ft(`/api/events`,e));E.current=t,t.onopen=()=>{re.current&&(i(!0),o(`sse`))};let n=e=>{try{ie(JSON.parse(e.data),`sse`)}catch(e){console.warn(`[useSocket] SSE parse error:`,e)}};t.onmessage=n,t.addEventListener(`models`,n),t.onerror=()=>{t.close(),E.current===t&&(E.current=null),T.current?.connected||i(!1)}}catch{E.current=null}},[ie,e]),se=(0,v.useCallback)(()=>{let t=Date.now();if(!(t-ne.current<Nt)){if(ne.current=t,T.current?.connected){T.current.emit(`client:activity`);return}fetch(Ft(`/api/activity`,e),{method:`POST`}).catch(()=>{})}},[e]);return(0,v.useEffect)(()=>{re.current=!0;let t=At(e||void 0,{transports:[`websocket`,`polling`],reconnectionDelay:500,reconnectionDelayMax:2500,timeout:1200});T.current=t,t.on(`connect`,()=>{i(!0),o(`socket`),E.current?.close(),E.current=null,t.emit(`models:refresh`),t.emit(`client:activity`)}),t.on(`disconnect`,()=>{re.current&&(i(!1),oe())}),t.on(`connect_error`,()=>{re.current&&(i(!1),oe())}),t.on(`models:update`,e=>ie(e,`socket`)),D.current=setInterval(()=>{let e=Date.now()-te.current>Mt;(!t.connected||e)&&ae()},jt),ae();let n=[`keydown`,`pointerdown`,`mousemove`,`focus`];for(let e of n)window.addEventListener(e,se,{passive:!0});return()=>{re.current=!1;for(let e of n)window.removeEventListener(e,se);D.current&&clearInterval(D.current),t.disconnect(),E.current?.close(),T.current=null,E.current=null}},[ie,ae,se,e,oe]),{models:t,connected:r,transport:a,updateCount:s,nextPingAt:l,isPinging:d,pendingPings:p,pingMode:h,globalBenchmarkRunning:_,globalBenchmarkTotal:b,globalBenchmarkCompleted:S,updateStatus:w}}var Lt={"S+":0,S:1,"A+":2,A:3,"A-":4,"B+":5,B:6,C:7},Rt={Perfect:0,Normal:1,Slow:2,Spiky:3,"Very Slow":4,Overloaded:5,Unstable:6,"Not Active":7,Pending:8};function zt(e){return Lt[e]??99}function Bt(e){return Rt[e]??99}function Vt(e){return!e||e===`—`?0:parseFloat(e.replace(`%`,``))||0}function Ht(e){let t=Vt(e);return t>=65?`sweHigh`:t>=40?`sweMid`:`sweLow`}function Ut(e){return e==null||e===1/0||e>99e3?{text:`—`,cls:`pingNone`}:{text:`${e}ms`,cls:Wt(e)}}function Wt(e){return e==null||e===1/0?`pingNone`:e<500?`pingFast`:e<1500?`pingMedium`:`pingSlow`}function Gt(e){if(!e||e===`—`)return 0;let t=e.toLowerCase();return t.includes(`m`)?parseFloat(t)*1e3:t.includes(`k`)?parseFloat(t):0}function Kt(e){return!e||e.length<8?`••••••••`:`••••••••`+e.slice(-4)}var qt=[`all`,`S+`,`S`,`A+`,`A`,`A-`,`B+`,`B`,`C`],Jt=[`all`,`up`,`down`,`pending`],Yt=[`all`,`Perfect`,`Normal`,`Spiky`,`Slow`,`Overloaded`,`Down`,`Unstable`,`Pending`],Xt=[`all`,`up`,`timeout`,`down`,`pending`,`noauth`,`auth_error`],Zt=[`normal`,`configured`,`usable`];function Qt(e){return e.idx??9999}function $t(e){return e.pingHistory||e.pings||[]}function en(e){let t=$t(e);return(t.length>0?t[t.length-1]:null)?.ms??null}function tn(e){let t=$t(e).map(e=>e?.ms).filter(e=>typeof e==`number`&&Number.isFinite(e));return t.length<2?null:t[t.length-1]-t[0]}function nn(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function rn(e,t,n){let r=e==null,i=t==null;return r&&i?0:r?1:i?-1:(e-t)*n}function an(e,t,n){let r=typeof e==`string`?e:``,i=typeof t==`string`?t:``,a=r.length===0,o=i.length===0;return a&&o?0:a?1:o?-1:r.localeCompare(i)*n}var on={up:0,pending:1,timeout:2,down:3,noauth:4,auth_error:5};function sn(e){let[t,n]=(0,v.useState)(`all`),[r,i]=(0,v.useState)(`all`),[a,o]=(0,v.useState)(`all`),[s,c]=(0,v.useState)(`all`),[l,u]=(0,v.useState)(`all`),[d,f]=(0,v.useState)(`normal`),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(`avg`),[b,x]=(0,v.useState)(`asc`),S=(0,v.useCallback)((e,t,n)=>{n(t[(t.indexOf(e)+1)%t.length])},[]),C=(0,v.useCallback)(()=>S(t,qt,n),[t,S]),w=(0,v.useCallback)(()=>S(r,Jt,i),[r,S]),ee=(0,v.useCallback)(()=>S(s,Yt,c),[s,S]),T=(0,v.useCallback)(()=>S(l,Xt,u),[l,S]),E=(0,v.useCallback)(()=>S(d,Zt,f),[d,S]),D=(0,v.useCallback)(e=>{if(_!==e){y(e),x(`asc`);return}if(b===`asc`){x(`desc`);return}y(null),x(`asc`)},[_,b]),te=(0,v.useCallback)(()=>{n(`all`),i(`all`),o(`all`),c(`all`),u(`all`),f(`normal`),m(``),g(null),y(`avg`),x(`asc`)},[]);return{filtered:(0,v.useMemo)(()=>{let n=[...e];t!==`all`&&(n=n.filter(e=>e.tier===t)),r!==`all`&&(n=n.filter(e=>r===`up`?e.status===`up`:r===`down`?e.status===`down`||e.status===`timeout`:r===`pending`?e.status===`pending`:!0)),a!==`all`&&(n=n.filter(e=>e.providerKey===a)),s!==`all`&&(n=n.filter(e=>e.verdict===s)),l!==`all`&&(n=n.filter(e=>e.status===l)),d===`configured`?n=n.filter(e=>e.hasApiKey&&e.status!==`noauth`&&e.status!==`auth_error`):d===`usable`&&(n=n.filter(e=>e.status===`up`?[`Perfect`,`Normal`,`Slow`].includes(e.verdict):!1));let i=p.trim().toLowerCase(),o=(h||``).trim().toLowerCase();return i&&(n=n.filter(e=>e.label.toLowerCase().includes(i)||e.modelId.toLowerCase().includes(i)||e.origin.toLowerCase().includes(i)||e.tier.toLowerCase().includes(i)||(e.verdict||``).toLowerCase().includes(i))),o&&(n=n.filter(e=>e.label.toLowerCase().includes(o)||e.modelId.toLowerCase().includes(o)||e.origin.toLowerCase().includes(o)||(e.ctx||``).toLowerCase().includes(o)||(e.providerKey||``).toLowerCase().includes(o))),n.sort((e,t)=>{if(!_)return Qt(e)-Qt(t);let n=b===`desc`?-1:1,r=0;return _===`mood`?r=rn(Bt(e.verdict),Bt(t.verdict),n):_===`idx`?r=rn(Qt(e),Qt(t),n):_===`tier`?r=rn(zt(e.tier),zt(t.tier),n):_===`label`?r=an(e.label,t.label,n):_===`origin`?r=an(e.origin,t.origin,n):_===`sweScore`?r=rn(Vt(e.sweScore),Vt(t.sweScore),n):_===`ctx`?r=rn(Gt(e.ctx),Gt(t.ctx),n):_===`latestPing`?r=rn(en(e),en(t),n):_===`avg`?r=rn(e.avg==null||e.avg===1/0||e.avg>99e3?null:e.avg,t.avg==null||t.avg===1/0||t.avg>99e3?null:t.avg,n):_===`condition`?r=rn(on[e.status]??9,on[t.status]??9,n):_===`verdict`?r=rn(Bt(e.verdict),Bt(t.verdict),n):_===`stability`?r=rn(nn(e.stability),nn(t.stability),n):_===`uptime`?r=rn(nn(e.uptime),nn(t.uptime),n):_===`aiLatency`?r=rn(e.benchmark?.ok?e.benchmark.totalMs:null,t.benchmark?.ok?t.benchmark.totalMs:null,n):_===`tps`?r=rn(e.benchmark?.ok?e.benchmark.tokensPerSecond??0:null,t.benchmark?.ok?t.benchmark.tokensPerSecond??0:null,n):_===`trend`&&(r=rn(tn(e),tn(t),n)),r||Qt(e)-Qt(t)}),n},[e,t,r,a,s,l,d,p,h,_,b]),filterTier:t,setFilterTier:n,cycleTier:C,filterStatus:r,setFilterStatus:i,cycleStatus:w,filterProvider:a,setFilterProvider:o,filterVerdict:s,setFilterVerdict:c,cycleVerdict:ee,filterHealth:l,setFilterHealth:u,cycleHealth:T,visibilityMode:d,setVisibilityMode:f,cycleVisibility:E,searchQuery:p,setSearchQuery:m,customTextFilter:h,setCustomTextFilter:g,sortColumn:_,sortDirection:b,toggleSort:D,resetView:te}}var cn=[`auto`,`dark`,`light`];function ln(){if(typeof window>`u`||typeof window.matchMedia!=`function`)return`dark`;try{return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}function un(){if(typeof document>`u`)return`auto`;let e=document.documentElement.getAttribute(`data-theme`);return e===`auto`||e===`dark`||e===`light`?e:`auto`}function dn(){let[e,t]=(0,v.useState)(un),[n,r]=(0,v.useState)(ln);(0,v.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>r(e.matches?`dark`:`light`);if(typeof e.addEventListener==`function`)return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t);if(typeof e.addListener==`function`)return e.addListener(t),()=>e.removeListener(t)},[]),(0,v.useEffect)(()=>{let t=e===`auto`?n:e;document.documentElement.setAttribute(`data-theme`,t),document.documentElement.setAttribute(`data-theme-preference`,e)},[e,n]);let i=(0,v.useCallback)(()=>{t(e=>cn[(cn.indexOf(e)+1)%cn.length])},[]),a=(0,v.useCallback)(e=>{cn.includes(e)&&t(e)},[]);return{theme:e,resolvedTheme:e===`auto`?n:e,setTheme:a,cycle:i}}var fn=Object.freeze([]);function pn({models:e}={}){let[t,n]=(0,v.useState)(fn),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!0),[s,c]=(0,v.useState)(null),l=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/favorites`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();n(Array.isArray(t.favorites)?t.favorites:[]),i(!!t.pinnedAndSticky),c(null)}catch(e){c(e.message||`Failed to load favorites`),n(fn),i(!1)}finally{o(!1)}},[]);(0,v.useEffect)(()=>{l()},[l]);let u=(0,v.useMemo)(()=>{let e=new Map;return t.forEach((t,n)=>e.set(t,n)),e},[t]),d=(0,v.useCallback)(e=>{if(!e)return!1;let t=`${e.providerKey}/${e.modelId}`;return u.has(t)},[u]),f=(0,v.useCallback)(e=>{if(!e)return 2**53-1;let t=`${e.providerKey}/${e.modelId}`,n=u.get(t);return n===void 0?2**53-1:n},[u]),p=(0,v.useCallback)(e=>e?`${e.providerKey}/${e.modelId}`:null,[]),m=(0,v.useCallback)(async e=>{try{let t=await fetch(`/api/favorites`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({favorites:e})});if(!t.ok)throw Error(`HTTP ${t.status}`);n(e)}catch(e){c(e.message||`Failed to save favorites`)}},[]);return{favorites:t,pinnedAndSticky:r,isFavorite:d,favoriteRank:f,toggle:(0,v.useCallback)(async e=>{let n=p(e);n&&await m(u.has(n)?t.filter(e=>e!==n):[...t,n])},[t,u,p,m]),reorder:(0,v.useCallback)(async(e,n)=>{let r=p(e);if(!r)return;let i=t.indexOf(r);if(i<0)return;let a=n===`up`?i-1:i+1;if(a<0||a>=t.length)return;let o=[...t];[o[i],o[a]]=[o[a],o[i]],await m(o)},[t,p,m]),setPinnedAndSticky:(0,v.useCallback)(async e=>{i(!!e);try{await fetch(`/api/favorites`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pinnedAndSticky:!!e})})}catch(e){c(e.message||`Failed to save display mode`)}},[]),refresh:l,loading:a,error:s}}var mn=[`opencode`,`opencode-desktop`,`opencode-web`,`openclaw`,`crush`,`goose`,`pi`,`aider`,`qwen`,`openhands`,`amp`,`forgecode`,`fcm_router`,`zcode`],hn=`opencode`;function gn(e){return mn.includes(e)?e:hn}function _n({onToast:e}={}){let[t,n]=(0,v.useState)(hn),r=(0,v.useRef)(!1);(0,v.useEffect)(()=>{let t=!1;async function i(){try{let e=await fetch(`/api/tool-mode`),i=await e.json().catch(()=>({}));!t&&!r.current&&e.ok&&n(gn(i.mode))}catch(n){t||e?.(`Tool mode load failed: ${n.message}`,`error`)}}return i(),()=>{t=!0}},[e]);let i=(0,v.useCallback)(async t=>{let i=gn(t);r.current=!0,n(i);try{let e=await fetch(`/api/tool-mode`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({mode:i})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||`HTTP ${e.status}`);return n(gn(t.mode)),{ok:!0,mode:gn(t.mode)}}catch(t){return e?.(`Tool mode save failed: ${t.message}`,`error`),{ok:!1,error:t.message,mode:i}}},[e]),a=(0,v.useCallback)(()=>i(mn[(TOOL_MODE_ORDER.indexOf(t)+1)%mn.length]||hn),[i,t]);return{toolMode:t,tools:(0,v.useMemo)(()=>[...mn],[]),setToolMode:i,cycleToolMode:a}}var vn={opencode:{label:`OpenCode CLI`,emoji:`📦`,flag:`--opencode`,color:[110,214,255]},"opencode-desktop":{label:`OpenCode Desktop`,emoji:`📦`,flag:`--opencode-desktop`,color:[149,205,255]},"opencode-web":{label:`OpenCode Web`,emoji:`📦`,flag:`--opencode-web`,color:[180,220,255]},openclaw:{label:`OpenClaw`,emoji:`🦞`,flag:`--openclaw`,color:[255,129,129]},crush:{label:`Crush`,emoji:`💘`,flag:`--crush`,color:[255,168,209]},goose:{label:`Goose`,emoji:`🪿`,flag:`--goose`,color:[132,235,168]},pi:{label:`Pi`,emoji:`π`,flag:`--pi`,color:[173,216,230]},aider:{label:`Aider`,emoji:`🛠`,flag:`--aider`,color:[255,208,102]},kilo:{label:`Kilo CLI`,emoji:`⚡️`,flag:`--kilo`,color:[255,107,107]},qwen:{label:`Qwen Code`,emoji:`🐉`,flag:`--qwen`,color:[255,213,128]},openhands:{label:`OpenHands`,emoji:`🤲`,flag:`--openhands`,color:[228,191,239]},amp:{label:`Amp`,emoji:`⚡`,flag:`--amp`,color:[255,232,98]},hermes:{label:`Hermes`,emoji:`🔮`,flag:`--hermes`,color:[200,160,255]},continue:{label:`Continue CLI`,emoji:`▶️`,flag:`--continue`,color:[255,100,100]},cline:{label:`Cline`,emoji:`🧠`,flag:`--cline`,color:[100,220,180]},caveman:{label:`Caveman Code`,emoji:`🪨`,flag:`--caveman`,color:[180,130,80]},jcode:{label:`jcode`,emoji:`🪼`,flag:`--jcode`,color:[255,140,0]},xcode:{label:`Xcode Intelligence`,emoji:`🛠️`,flag:`--xcode`,color:[20,126,251]},fcm_router:{label:`FCM Router`,emoji:`🧭`,flag:`--fcm-router`,color:[80,200,120]},copilot:{label:`Copilot CLI`,emoji:`🤖`,flag:`--copilot`,color:[200,220,255]},forgecode:{label:`ForgeCode`,emoji:`🔥`,flag:`--forgecode`,color:[255,120,50]},zcode:{label:`ZCode`,emoji:`🧊`,flag:`--zcode`,color:[60,160,230]}},yn=[`opencode`,`pi`,`jcode`,`opencode-desktop`,`opencode-web`,`openclaw`,`crush`,`goose`,`aider`,`kilo`,`qwen`,`openhands`,`amp`,`hermes`,`continue`,`cline`,`xcode`,`fcm_router`,`caveman`,`copilot`,`forgecode`,`zcode`];function bn(e){return vn[e]||{label:e,emoji:`•`,flag:null}}var xn=Object.keys(vn).filter(e=>!vn[e].cliOnly);function Sn(e){return xn}function Cn(e,t){return Sn(e).includes(t)}function wn(e,t,n,r=3){let i=parseFloat(e)||0;return n.filter(e=>!e.hidden&&Cn(e.providerKey,t)).map(e=>({modelId:e.modelId,label:e.label,tier:e.tier,sweScore:e.sweScore||`-`,providerKey:e.providerKey,sweDelta:Math.abs((parseFloat(e.sweScore)||0)-i)})).sort((e,t)=>e.sweDelta-t.sweDelta).slice(0,r)}var Tn=new Set([`S+`,`S`,`A+`,`A`,`A-`,`B+`,`B`,`C`,`all`]),En=new Set([`up`,`down`,`pending`,`all`]),Dn=new Set([`mood`,`idx`,`tier`,`sweScore`,`ctx`,`label`,`origin`,`latestPing`,`avg`,`condition`,`verdict`,`stability`,`uptime`,`aiLatency`,`tps`,`trend`]),On=new Set([`dashboard`,`settings`,`analytics`,`recommend`,`router`,`help`,`changelog`,`playground`,`install-endpoints`,`installed-models`]),kn=new Set([`asc`,`desc`]),An=new Set(yn);function jn(){if(typeof window>`u`)return null;let e=new URLSearchParams(window.location.search),t={},n=window.location.pathname.replace(/^\/|\/$/g,``);return n&&On.has(n)?t.view=n:e.has(`view`)&&On.has(e.get(`view`))?t.view=e.get(`view`):t.view=`dashboard`,e.has(`tier`)&&Tn.has(e.get(`tier`))&&(t.tier=e.get(`tier`)),e.has(`status`)&&En.has(e.get(`status`))&&(t.status=e.get(`status`)),e.has(`provider`)&&(t.provider=e.get(`provider`)),e.has(`verdict`)&&(t.verdict=e.get(`verdict`)),e.has(`health`)&&(t.health=e.get(`health`)),e.has(`sort`)&&Dn.has(e.get(`sort`))&&(t.sort=e.get(`sort`)),e.has(`dir`)&&kn.has(e.get(`dir`))&&(t.dir=e.get(`dir`)),e.has(`q`)&&(t.q=e.get(`q`)),e.has(`toolMode`)&&An.has(e.get(`toolMode`))&&(t.toolMode=e.get(`toolMode`)),e.has(`recommend`)&&[`1`,`true`,`open`].includes(e.get(`recommend`))&&(t.view=`recommend`),e.has(`palette`)&&e.get(`palette`)===`open`&&(t.palette=`open`),t}function Mn(e){let t=new URLSearchParams;return e?(e.currentView&&e.currentView!==`dashboard`&&t.set(`view`,e.currentView),e.filterTier&&e.filterTier!==`all`&&t.set(`tier`,e.filterTier),e.filterStatus&&e.filterStatus!==`all`&&t.set(`status`,e.filterStatus),e.filterProvider&&e.filterProvider!==`all`&&t.set(`provider`,e.filterProvider),e.filterVerdict&&e.filterVerdict!==`all`&&t.set(`verdict`,e.filterVerdict),e.filterHealth&&e.filterHealth!==`all`&&t.set(`health`,e.filterHealth),e.sortColumn&&(t.set(`sort`,e.sortColumn),e.sortDirection&&t.set(`dir`,e.sortDirection)),e.searchQuery&&t.set(`q`,e.searchQuery),e.toolMode&&t.set(`toolMode`,e.toolMode),e.paletteOpen&&t.set(`palette`,`open`),t):t}function Nn(e){if(typeof window>`u`)return;let t=Mn(e),n=t.get(`view`)||`dashboard`;t.delete(`view`);let r=t.toString(),i=n===`dashboard`?`/`:`/${n}`,a=r?`${i}?${r}${window.location.hash}`:`${i}${window.location.hash}`;window.history.replaceState({},``,a)}function Pn({currentView:e,setCurrentView:t,filterState:n=null,paletteOpen:r=!1,setPaletteOpen:i=()=>{},toolMode:a=null,setToolMode:o=()=>{}}){let s=(0,v.useRef)(null),c=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(c.current)return;c.current=!0;let r=jn();r&&(r.view&&t&&r.view!==e&&t(r.view),r.tier&&n?.setFilterTier&&n.setFilterTier(r.tier),r.status&&n?.setFilterStatus&&n.setFilterStatus(r.status),r.provider&&n?.setFilterProvider&&n.setFilterProvider(r.provider),r.verdict&&n?.setFilterVerdict&&n.setFilterVerdict(r.verdict),r.health&&n?.setFilterHealth&&n.setFilterHealth(r.health),r.sort&&n?.toggleSort&&(n.setSortColumn&&n.setSortColumn(r.sort),r.dir&&n.setSortDirection&&n.setSortDirection(r.dir)),r.q!==void 0&&n?.setSearchQuery&&n.setSearchQuery(r.q),r.toolMode&&o&&o(r.toolMode),r.palette===`open`&&i&&i(!0))},[]),(0,v.useEffect)(()=>{if(c.current)return s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{Nn({currentView:e,filterTier:n?.filterTier,filterStatus:n?.filterStatus,filterProvider:n?.filterProvider,filterVerdict:n?.filterVerdict,filterHealth:n?.filterHealth,sortColumn:n?.sortColumn,sortDirection:n?.sortDirection,searchQuery:n?.searchQuery,toolMode:a,paletteOpen:r})},80),()=>{s.current&&clearTimeout(s.current)}},[e,r,a,n?.filterTier,n?.filterStatus,n?.filterProvider,n?.filterVerdict,n?.filterHealth,n?.sortColumn,n?.sortDirection,n?.searchQuery])}var Fn=5*6e4;function In(e,t){if(!e||!t)return 0;let n=e.replace(/^v/,``).split(`.`).map(Number),r=t.replace(/^v/,``).split(`.`).map(Number);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e]||0,i=r[e]||0;if(i!==t)return i-t}return 0}function Ln({onToast:e}={}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),d=(0,v.useRef)(null),f=(0,v.useCallback)(async()=>{u(!0);try{let e=await fetch(`/api/version`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();n(t.local??null),i(t.latest??null),o(t.lastReleaseDate??null),c(t.error??null)}catch(e){c(e.message||`update check failed`)}finally{u(!1)}},[]);(0,v.useEffect)(()=>(f(),d.current=setInterval(f,Fn),()=>{d.current&&clearInterval(d.current)}),[f]);let p=!!(r&&t&&In(r,t)>0);return{localVersion:t,latestVersion:r,lastReleaseDate:a,updateAvailable:p,checkNow:f,runUpdate:(0,v.useCallback)(async()=>{if(!p){e?.(`No update available.`,`info`);return}try{let t=await fetch(`/api/update/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({version:r})}),n=await t.json().catch(()=>({}));t.ok&&n?.started?e?.(`Update to v${r} started — restart the dashboard to apply.`,`success`):e?.(n?.error||n?.message||`Update failed`,`error`)}catch(t){e?.(t.message||`Update request failed`,`error`)}},[p,r,e]),loading:l,error:s}}var Rn={outline:{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`},filled:{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`currentColor`,stroke:`none`}},N=(e,t,n,r)=>{let i=(0,v.forwardRef)(({color:n=`currentColor`,size:i=24,stroke:a=2,title:o,className:s,children:c,...l},u)=>(0,v.createElement)(`svg`,{ref:u,...Rn[e],width:i,height:i,className:[`tabler-icon`,`tabler-icon-${t}`,s].join(` `),...e===`filled`?{fill:n}:{strokeWidth:a,stroke:n},...l},[o&&(0,v.createElement)(`title`,{key:`svg-title`},o),...r.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(c)?c:[c]]));return i.displayName=`${n}`,i},zn=N(`outline`,`activity`,`Activity`,[[`path`,{d:`M3 12h4l3 8l4 -16l3 8h4`,key:`svg-0`}]]),Bn=N(`outline`,`alert-octagon`,`AlertOctagon`,[[`path`,{d:`M12.802 2.165l5.575 2.389c.48 .206 .863 .589 1.07 1.07l2.388 5.574c.22 .512 .22 1.092 0 1.604l-2.389 5.575c-.206 .48 -.589 .863 -1.07 1.07l-5.574 2.388c-.512 .22 -1.092 .22 -1.604 0l-5.575 -2.389a2.036 2.036 0 0 1 -1.07 -1.07l-2.388 -5.574a2.036 2.036 0 0 1 0 -1.604l2.389 -5.575c.206 -.48 .589 -.863 1.07 -1.07l5.574 -2.388a2.036 2.036 0 0 1 1.604 0`,key:`svg-0`}],[`path`,{d:`M12 8v4`,key:`svg-1`}],[`path`,{d:`M12 16h.01`,key:`svg-2`}]]),Vn=N(`outline`,`alert-triangle`,`AlertTriangle`,[[`path`,{d:`M12 9v4`,key:`svg-0`}],[`path`,{d:`M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0`,key:`svg-1`}],[`path`,{d:`M12 16h.01`,key:`svg-2`}]]),Hn=N(`outline`,`arrow-down`,`ArrowDown`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 13l-6 6`,key:`svg-1`}],[`path`,{d:`M6 13l6 6`,key:`svg-2`}]]),Un=N(`outline`,`arrow-left`,`ArrowLeft`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}],[`path`,{d:`M5 12l6 6`,key:`svg-1`}],[`path`,{d:`M5 12l6 -6`,key:`svg-2`}]]),Wn=N(`outline`,`arrow-right`,`ArrowRight`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}],[`path`,{d:`M13 18l6 -6`,key:`svg-1`}],[`path`,{d:`M13 6l6 6`,key:`svg-2`}]]),Gn=N(`outline`,`arrow-up`,`ArrowUp`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 11l-6 -6`,key:`svg-1`}],[`path`,{d:`M6 11l6 -6`,key:`svg-2`}]]),Kn=N(`outline`,`ban`,`Ban`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M5.7 5.7l12.6 12.6`,key:`svg-1`}]]),qn=N(`outline`,`bolt`,`Bolt`,[[`path`,{d:`M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11`,key:`svg-0`}]]),Jn=N(`outline`,`braces`,`Braces`,[[`path`,{d:`M7 4a2 2 0 0 0 -2 2v3a2 3 0 0 1 -2 3a2 3 0 0 1 2 3v3a2 2 0 0 0 2 2`,key:`svg-0`}],[`path`,{d:`M17 4a2 2 0 0 1 2 2v3a2 3 0 0 0 2 3a2 3 0 0 0 -2 3v3a2 2 0 0 1 -2 2`,key:`svg-1`}]]),Yn=N(`outline`,`check`,`Check`,[[`path`,{d:`M5 12l5 5l10 -10`,key:`svg-0`}]]),Xn=N(`outline`,`checks`,`Checks`,[[`path`,{d:`M7 12l5 5l10 -10`,key:`svg-0`}],[`path`,{d:`M2 12l5 5m5 -5l5 -5`,key:`svg-1`}]]),Zn=N(`outline`,`chevron-down`,`ChevronDown`,[[`path`,{d:`M6 9l6 6l6 -6`,key:`svg-0`}]]),Qn=N(`outline`,`chevron-left`,`ChevronLeft`,[[`path`,{d:`M15 6l-6 6l6 6`,key:`svg-0`}]]),$n=N(`outline`,`chevron-right`,`ChevronRight`,[[`path`,{d:`M9 6l6 6l-6 6`,key:`svg-0`}]]),er=N(`outline`,`chevron-up`,`ChevronUp`,[[`path`,{d:`M6 15l6 -6l6 6`,key:`svg-0`}]]),tr=N(`outline`,`circle-check`,`CircleCheck`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M9 12l2 2l4 -4`,key:`svg-1`}]]),nr=N(`outline`,`circle-dotted`,`CircleDotted`,[[`path`,{d:`M7.5 4.21l0 .01`,key:`svg-0`}],[`path`,{d:`M4.21 7.5l0 .01`,key:`svg-1`}],[`path`,{d:`M3 12l0 .01`,key:`svg-2`}],[`path`,{d:`M4.21 16.5l0 .01`,key:`svg-3`}],[`path`,{d:`M7.5 19.79l0 .01`,key:`svg-4`}],[`path`,{d:`M12 21l0 .01`,key:`svg-5`}],[`path`,{d:`M16.5 19.79l0 .01`,key:`svg-6`}],[`path`,{d:`M19.79 16.5l0 .01`,key:`svg-7`}],[`path`,{d:`M21 12l0 .01`,key:`svg-8`}],[`path`,{d:`M19.79 7.5l0 .01`,key:`svg-9`}],[`path`,{d:`M16.5 4.21l0 .01`,key:`svg-10`}],[`path`,{d:`M12 3l0 .01`,key:`svg-11`}]]),rr=N(`outline`,`clipboard`,`Clipboard`,[[`path`,{d:`M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2`,key:`svg-0`}],[`path`,{d:`M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2`,key:`svg-1`}]]),ir=N(`outline`,`clock`,`Clock`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0`,key:`svg-0`}],[`path`,{d:`M12 7v5l3 3`,key:`svg-1`}]]),ar=N(`outline`,`cloud-off`,`CloudOff`,[[`path`,{d:`M9.58 5.548c.24 -.11 .492 -.207 .752 -.286c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 .957 -.383 1.824 -1.003 2.454m-2.997 1.033h-11.343c-2.572 -.004 -4.657 -2.011 -4.657 -4.487c0 -2.475 2.085 -4.482 4.657 -4.482c.13 -.582 .37 -1.128 .7 -1.62`,key:`svg-0`}],[`path`,{d:`M3 3l18 18`,key:`svg-1`}]]),or=N(`outline`,`command`,`Command`,[[`path`,{d:`M7 9a2 2 0 1 1 2 -2v10a2 2 0 1 1 -2 -2h10a2 2 0 1 1 -2 2v-10a2 2 0 1 1 2 2h-10`,key:`svg-0`}]]),sr=N(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),cr=N(`outline`,`dots`,`Dots`,[[`path`,{d:`M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}]]),lr=N(`outline`,`download`,`Download`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 11l5 5l5 -5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),ur=N(`outline`,`error-404`,`Error404`,[[`path`,{d:`M3 8v3a1 1 0 0 0 1 1h3`,key:`svg-0`}],[`path`,{d:`M7 8v8`,key:`svg-1`}],[`path`,{d:`M17 8v3a1 1 0 0 0 1 1h3`,key:`svg-2`}],[`path`,{d:`M21 8v8`,key:`svg-3`}],[`path`,{d:`M10 10v4a2 2 0 1 0 4 0v-4a2 2 0 1 0 -4 0`,key:`svg-4`}]]),dr=N(`outline`,`external-link`,`ExternalLink`,[[`path`,{d:`M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6`,key:`svg-0`}],[`path`,{d:`M11 13l9 -9`,key:`svg-1`}],[`path`,{d:`M15 4h5v5`,key:`svg-2`}]]),fr=N(`outline`,`eye-off`,`EyeOff`,[[`path`,{d:`M10.585 10.587a2 2 0 0 0 2.829 2.828`,key:`svg-0`}],[`path`,{d:`M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87`,key:`svg-1`}],[`path`,{d:`M3 3l18 18`,key:`svg-2`}]]),pr=N(`outline`,`eye`,`Eye`,[[`path`,{d:`M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6`,key:`svg-1`}]]),mr=N(`outline`,`file-spreadsheet`,`FileSpreadsheet`,[[`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`,key:`svg-0`}],[`path`,{d:`M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2`,key:`svg-1`}],[`path`,{d:`M8 11h8v7h-8l0 -7`,key:`svg-2`}],[`path`,{d:`M8 15h8`,key:`svg-3`}],[`path`,{d:`M11 11v7`,key:`svg-4`}]]),hr=N(`outline`,`filter`,`Filter`,[[`path`,{d:`M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227`,key:`svg-0`}]]),gr=N(`outline`,`flame`,`Flame`,[[`path`,{d:`M12 10.941c2.333 -3.308 .167 -7.823 -1 -8.941c0 3.395 -2.235 5.299 -3.667 6.706c-1.43 1.408 -2.333 3.294 -2.333 5.588c0 3.704 3.134 6.706 7 6.706c3.866 0 7 -3.002 7 -6.706c0 -1.712 -1.232 -4.403 -2.333 -5.588c-2.084 3.353 -3.257 3.353 -4.667 2.235`,key:`svg-0`}]]),_r=N(`outline`,`folders`,`Folders`,[[`path`,{d:`M9 3h3l2 2h5a2 2 0 0 1 2 2v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2`,key:`svg-0`}],[`path`,{d:`M17 16v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2h2`,key:`svg-1`}]]),vr=N(`outline`,`grip-vertical`,`GripVertical`,[[`path`,{d:`M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}],[`path`,{d:`M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-5`}]]),yr=N(`outline`,`history`,`History`,[[`path`,{d:`M12 8l0 4l2 2`,key:`svg-0`}],[`path`,{d:`M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5`,key:`svg-1`}]]),br=N(`outline`,`hourglass-off`,`HourglassOff`,[[`path`,{d:`M18 18v2a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1v-2a6 6 0 0 1 6 -6`,key:`svg-0`}],[`path`,{d:`M6 6a6 6 0 0 0 6 6m3.13 -.88a6 6 0 0 0 2.87 -5.12v-2a1 1 0 0 0 -1 -1h-10`,key:`svg-1`}],[`path`,{d:`M3 3l18 18`,key:`svg-2`}]]),xr=N(`outline`,`hourglass`,`Hourglass`,[[`path`,{d:`M6.5 7h11`,key:`svg-0`}],[`path`,{d:`M6.5 17h11`,key:`svg-1`}],[`path`,{d:`M6 20v-2a6 6 0 1 1 12 0v2a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1`,key:`svg-2`}],[`path`,{d:`M6 4v2a6 6 0 1 0 12 0v-2a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1`,key:`svg-3`}]]),Sr=N(`outline`,`key`,`Key`,[[`path`,{d:`M16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1 -4.069 0l-.301 -.301l-6.558 6.558a2 2 0 0 1 -1.239 .578l-.175 .008h-1.172a1 1 0 0 1 -.993 -.883l-.007 -.117v-1.172a2 2 0 0 1 .467 -1.284l.119 -.13l.414 -.414h2v-2h2v-2l2.144 -2.144l-.301 -.301a2.877 2.877 0 0 1 0 -4.069l2.643 -2.643a2.877 2.877 0 0 1 4.069 0`,key:`svg-0`}],[`path`,{d:`M15 9h.01`,key:`svg-1`}]]),Cr=N(`outline`,`layout-dashboard`,`LayoutDashboard`,[[`path`,{d:`M5 4h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1`,key:`svg-0`}],[`path`,{d:`M5 16h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1`,key:`svg-1`}],[`path`,{d:`M15 12h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1`,key:`svg-2`}],[`path`,{d:`M15 4h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1`,key:`svg-3`}]]),wr=N(`outline`,`list`,`List`,[[`path`,{d:`M9 6l11 0`,key:`svg-0`}],[`path`,{d:`M9 12l11 0`,key:`svg-1`}],[`path`,{d:`M9 18l11 0`,key:`svg-2`}],[`path`,{d:`M5 6l0 .01`,key:`svg-3`}],[`path`,{d:`M5 12l0 .01`,key:`svg-4`}],[`path`,{d:`M5 18l0 .01`,key:`svg-5`}]]),Tr=N(`outline`,`loader`,`Loader`,[[`path`,{d:`M12 6l0 -3`,key:`svg-0`}],[`path`,{d:`M16.25 7.75l2.15 -2.15`,key:`svg-1`}],[`path`,{d:`M18 12l3 0`,key:`svg-2`}],[`path`,{d:`M16.25 16.25l2.15 2.15`,key:`svg-3`}],[`path`,{d:`M12 18l0 3`,key:`svg-4`}],[`path`,{d:`M7.75 16.25l-2.15 2.15`,key:`svg-5`}],[`path`,{d:`M6 12l-3 0`,key:`svg-6`}],[`path`,{d:`M7.75 7.75l-2.15 -2.15`,key:`svg-7`}]]),Er=N(`outline`,`lock`,`Lock`,[[`path`,{d:`M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6`,key:`svg-0`}],[`path`,{d:`M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 11v-4a4 4 0 1 1 8 0v4`,key:`svg-2`}]]),Dr=N(`outline`,`menu-2`,`Menu2`,[[`path`,{d:`M4 6l16 0`,key:`svg-0`}],[`path`,{d:`M4 12l16 0`,key:`svg-1`}],[`path`,{d:`M4 18l16 0`,key:`svg-2`}]]),Or=N(`outline`,`message-chatbot`,`MessageChatbot`,[[`path`,{d:`M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12`,key:`svg-0`}],[`path`,{d:`M9.5 9h.01`,key:`svg-1`}],[`path`,{d:`M14.5 9h.01`,key:`svg-2`}],[`path`,{d:`M9.5 13a3.5 3.5 0 0 0 5 0`,key:`svg-3`}]]),kr=N(`outline`,`moon`,`Moon`,[[`path`,{d:`M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454l0 .008`,key:`svg-0`}]]),Ar=N(`outline`,`player-play`,`PlayerPlay`,[[`path`,{d:`M7 4v16l13 -8l-13 -8`,key:`svg-0`}]]),jr=N(`outline`,`player-stop`,`PlayerStop`,[[`path`,{d:`M5 7a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -10`,key:`svg-0`}]]),Mr=N(`outline`,`plug-connected`,`PlugConnected`,[[`path`,{d:`M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5`,key:`svg-0`}],[`path`,{d:`M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5`,key:`svg-1`}],[`path`,{d:`M3 21l2.5 -2.5`,key:`svg-2`}],[`path`,{d:`M18.5 5.5l2.5 -2.5`,key:`svg-3`}],[`path`,{d:`M10 11l-2 2`,key:`svg-4`}],[`path`,{d:`M13 14l-2 2`,key:`svg-5`}]]),Nr=N(`outline`,`plug`,`Plug`,[[`path`,{d:`M9.785 6l8.215 8.215l-2.054 2.054a5.81 5.81 0 1 1 -8.215 -8.215l2.054 -2.054`,key:`svg-0`}],[`path`,{d:`M4 20l3.5 -3.5`,key:`svg-1`}],[`path`,{d:`M15 4l-3.5 3.5`,key:`svg-2`}],[`path`,{d:`M20 9l-3.5 3.5`,key:`svg-3`}]]),Pr=N(`outline`,`plus`,`Plus`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M5 12l14 0`,key:`svg-1`}]]),Fr=N(`outline`,`question-mark`,`QuestionMark`,[[`path`,{d:`M8 8a3.5 3 0 0 1 3.5 -3h1a3.5 3 0 0 1 3.5 3a3 3 0 0 1 -2 3a3 4 0 0 0 -2 4`,key:`svg-0`}],[`path`,{d:`M12 19l0 .01`,key:`svg-1`}]]),Ir=N(`outline`,`refresh`,`Refresh`,[[`path`,{d:`M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4`,key:`svg-0`}],[`path`,{d:`M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4`,key:`svg-1`}]]),Lr=N(`outline`,`route`,`Route`,[[`path`,{d:`M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4`,key:`svg-1`}],[`path`,{d:`M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5`,key:`svg-2`}]]),Rr=N(`outline`,`search`,`Search`,[[`path`,{d:`M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0`,key:`svg-0`}],[`path`,{d:`M21 21l-6 -6`,key:`svg-1`}]]),zr=N(`outline`,`send`,`Send`,[[`path`,{d:`M10 14l11 -11`,key:`svg-0`}],[`path`,{d:`M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5`,key:`svg-1`}]]),Br=N(`outline`,`settings`,`Settings`,[[`path`,{d:`M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065`,key:`svg-0`}],[`path`,{d:`M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0`,key:`svg-1`}]]),Vr=N(`outline`,`sparkles`,`Sparkles`,[[`path`,{d:`M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6`,key:`svg-0`}]]),Hr=N(`outline`,`star`,`Star`,[[`path`,{d:`M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245`,key:`svg-0`}]]),Ur=N(`outline`,`sun`,`Sun`,[[`path`,{d:`M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0`,key:`svg-0`}],[`path`,{d:`M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7`,key:`svg-1`}]]),Wr=N(`outline`,`tool`,`Tool`,[[`path`,{d:`M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5`,key:`svg-0`}]]),Gr=N(`outline`,`trash`,`Trash`,[[`path`,{d:`M4 7l16 0`,key:`svg-0`}],[`path`,{d:`M10 11l0 6`,key:`svg-1`}],[`path`,{d:`M14 11l0 6`,key:`svg-2`}],[`path`,{d:`M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12`,key:`svg-3`}],[`path`,{d:`M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3`,key:`svg-4`}]]),Kr=N(`outline`,`trophy`,`Trophy`,[[`path`,{d:`M8 21l8 0`,key:`svg-0`}],[`path`,{d:`M12 17l0 4`,key:`svg-1`}],[`path`,{d:`M7 4l10 0`,key:`svg-2`}],[`path`,{d:`M17 4v8a5 5 0 0 1 -10 0v-8`,key:`svg-3`}],[`path`,{d:`M3 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-4`}],[`path`,{d:`M17 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-5`}]]),qr=N(`outline`,`upload`,`Upload`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 9l5 -5l5 5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),Jr=N(`outline`,`wand`,`Wand`,[[`path`,{d:`M6 21l15 -15l-3 -3l-15 15l3 3`,key:`svg-0`}],[`path`,{d:`M15 6l3 3`,key:`svg-1`}],[`path`,{d:`M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2`,key:`svg-2`}],[`path`,{d:`M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2`,key:`svg-3`}]]),Yr=N(`outline`,`x`,`X`,[[`path`,{d:`M18 6l-12 12`,key:`svg-0`}],[`path`,{d:`M6 6l12 12`,key:`svg-1`}]]),Xr=N(`filled`,`circle-check-filled`,`CircleCheckFilled`,[[`path`,{d:`M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z`,key:`svg-0`}]]),Zr=N(`filled`,`player-play-filled`,`PlayerPlayFilled`,[[`path`,{d:`M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z`,key:`svg-0`}]]),Qr=N(`filled`,`star-filled`,`StarFilled`,[[`path`,{d:`M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z`,key:`svg-0`}]]),$r={wrap:`_wrap_18gb2_5`,trigger:`_trigger_18gb2_11`,cycle:`_cycle_18gb2_30`,emoji:`_emoji_18gb2_53`,label:`_label_18gb2_54`,menu:`_menu_18gb2_55`,item:`_item_18gb2_69`,itemActive:`_itemActive_18gb2_83`,itemEmoji:`_itemEmoji_18gb2_87`,itemText:`_itemText_18gb2_88`,activeDot:`_activeDot_18gb2_91`,compact:`_compact_18gb2_92`},ei=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})),P=o(((e,t)=>{t.exports=ei()}))();function ti({toolMode:e=`opencode`,onSetToolMode:t,onCycleToolMode:n,compact:r=!1,tools:i=mn}){let[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=bn(e);return(0,v.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]),(0,P.jsxs)(`div`,{className:`${$r.wrap} ${r?$r.compact:``}`,ref:s,children:[(0,P.jsxs)(`button`,{type:`button`,className:$r.trigger,onClick:()=>o(e=>!e),"aria-haspopup":`listbox`,"aria-expanded":a,title:`Install endpoint into: ${c.label}`,children:[(0,P.jsx)(`span`,{className:$r.emoji,children:c.emoji}),(0,P.jsx)(`span`,{className:$r.label,children:r?c.label.replace(/ CLI$/,``):c.label}),(0,P.jsx)(Zn,{size:13,stroke:1.7})]}),(0,P.jsx)(`button`,{type:`button`,className:$r.cycle,onClick:n,title:`Cycle endpoint target`,"aria-label":`Cycle endpoint target`,children:(0,P.jsx)(Ir,{size:13,stroke:1.7})}),a&&(0,P.jsx)(`div`,{className:$r.menu,role:`listbox`,"aria-label":`Endpoint install target`,children:i.map(n=>{let r=vn[n],i=n===e;return(0,P.jsxs)(`button`,{type:`button`,className:`${$r.item} ${i?$r.itemActive:``}`,onClick:()=>{t?.(n),o(!1)},role:`option`,"aria-selected":i,children:[(0,P.jsx)(`span`,{className:$r.itemEmoji,children:r.emoji}),(0,P.jsxs)(`span`,{className:$r.itemText,children:[(0,P.jsx)(`strong`,{children:r.label}),(0,P.jsx)(`small`,{children:r.flag})]}),i&&(0,P.jsx)(`span`,{className:$r.activeDot,children:`●`})]},n)})})]})}var F={header:`_header_xml3p_11`,left:`_left_xml3p_28`,center:`_center_xml3p_35`,right:`_right_xml3p_41`,logo:`_logo_xml3p_49`,logoIconSvg:`_logoIconSvg_xml3p_50`,logoText:`_logoText_xml3p_56`,logoTextHighlight:`_logoTextHighlight_xml3p_64`,version:`_version_xml3p_65`,nav:`_nav_xml3p_72`,navBtn:`_navBtn_xml3p_82`,navBtnActive:`_navBtnActive_xml3p_106`,comingBadge:`_comingBadge_xml3p_121`,menuWrap:`_menuWrap_xml3p_137`,menuTrigger:`_menuTrigger_xml3p_138`,menuPopover:`_menuPopover_xml3p_143`,menuItem:`_menuItem_xml3p_158`,menuItemActive:`_menuItemActive_xml3p_175`,searchBar:`_searchBar_xml3p_183`,searchIcon:`_searchIcon_xml3p_193`,searchInput:`_searchInput_xml3p_194`,iconBtn:`_iconBtn_xml3p_202`,cmdkBtn:`_cmdkBtn_xml3p_212`,cmdkLabel:`_cmdkLabel_xml3p_225`,benchmarkBtn:`_benchmarkBtn_xml3p_228`,benchmarkActive:`_benchmarkActive_xml3p_238`,benchmarkRunning:`_benchmarkRunning_xml3p_243`,spinner:`_spinner_xml3p_245`,spin:`_spin_xml3p_245`,hamburgerBtn:`_hamburgerBtn_xml3p_278`,mobileNav:`_mobileNav_xml3p_300`,mobileNavItem:`_mobileNavItem_xml3p_315`,mobileNavActive:`_mobileNavActive_xml3p_332`,mobileNavDivider:`_mobileNavDivider_xml3p_337`},ni=[{id:`dashboard`,label:`Dashboard`,icon:Cr},{id:`router`,label:`Router`,icon:Lr},{id:`playground`,label:`Playground`,icon:Or},{id:`help`,label:`Help`,icon:Fr},{id:`install-endpoints`,label:`Install Endpoints`,icon:Nr}],ri=[{id:`analytics`,label:`Analytics`,icon:zn},{id:`recommend`,label:`Recommend`,icon:Vr},{id:`changelog`,label:`Changelog`,icon:yr},{id:`installed-models`,label:`Installed Models`,icon:_r}];function ii({searchQuery:e,onSearchChange:t,currentView:n,onNavigate:r,onToggleTheme:i,onOpenExport:a,onOpenCommandPalette:o,onBenchmark:s,benchmarkRunning:c,benchmarkTotal:l,benchmarkCompleted:u,modelsCount:d,theme:f,onToast:p,toolMode:m=`opencode`,onSetToolMode:h,onCycleToolMode:g,updateSlot:_=null}){let[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(!1),C=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!y&&!x)return;let e=e=>{C.current&&!C.current.contains(e.target)&&b(!1)},t=e=>{e.key===`Escape`&&(b(!1),S(!1))};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[y,x]);let w=e=>{if(e.comingIn){p?.(`${e.label} arrives in milestone ${e.comingIn}.`,`info`);return}r(e.id),S(!1)},ee=e=>{if(b(!1),e.comingIn){p?.(`${e.label} arrives in milestone ${e.comingIn}.`,`info`);return}r(e.id)};return(0,P.jsxs)(`header`,{className:F.header,children:[(0,P.jsxs)(`div`,{className:F.left,children:[(0,P.jsxs)(`div`,{className:F.logo,onClick:()=>r(`dashboard`),style:{cursor:`pointer`},children:[(0,P.jsxs)(`svg`,{className:F.logoIconSvg,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,P.jsx)(`path`,{d:`M4 5L11 12L4 19`,stroke:`var(--color-brand)`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,P.jsx)(`path`,{d:`M14 5V19M14 5H21M14 11H18`,stroke:`var(--color-brand)`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,P.jsxs)(`span`,{className:F.logoText,children:[(0,P.jsx)(`span`,{className:F.logoTextHighlight,children:`free`}),(0,P.jsx)(`span`,{children:`-coding-models`}),(0,P.jsx)(`span`,{className:F.logoTextHighlight,children:`_`})]})]}),(0,P.jsxs)(`span`,{className:F.version,children:[`v`,`0.5.39`]}),(0,P.jsx)(`button`,{className:F.hamburgerBtn,onClick:()=>S(e=>!e),"aria-label":`Navigation menu`,"aria-expanded":x,"aria-haspopup":`true`,children:(0,P.jsx)(Dr,{size:18,stroke:1.5})}),x&&(0,P.jsxs)(`div`,{className:F.mobileNav,role:`menu`,children:[ni.map(e=>{let t=e.icon;return(0,P.jsxs)(`button`,{className:`${F.mobileNavItem} ${n===e.id?F.mobileNavActive:``}`,onClick:()=>w(e),role:`menuitem`,children:[(0,P.jsx)(t,{size:16,stroke:1.5}),(0,P.jsx)(`span`,{children:e.label})]},e.id)}),(0,P.jsx)(`div`,{className:F.mobileNavDivider}),ri.map(e=>{let t=e.icon;return(0,P.jsxs)(`button`,{className:F.mobileNavItem,onClick:()=>ee(e),role:`menuitem`,children:[(0,P.jsx)(t,{size:16,stroke:1.5}),(0,P.jsx)(`span`,{children:e.label})]},e.id)})]}),(0,P.jsxs)(`nav`,{className:F.nav,"aria-label":`Primary`,children:[ni.map(e=>{let t=e.icon,r=n===e.id;return(0,P.jsxs)(`button`,{className:`${F.navBtn} ${r?F.navBtnActive:``}`,onClick:()=>w(e),title:e.comingIn?`${e.label} — coming in ${e.comingIn}`:e.label,"aria-current":r?`page`:void 0,children:[(0,P.jsx)(t,{size:14,stroke:1.5}),(0,P.jsx)(`span`,{children:e.label}),e.comingIn&&(0,P.jsx)(`span`,{className:F.comingBadge,children:e.comingIn})]},e.id)}),(0,P.jsxs)(`div`,{className:F.menuWrap,ref:C,children:[(0,P.jsx)(`button`,{className:`${F.navBtn} ${F.menuTrigger} ${ri.some(e=>e.id===n)?F.navBtnActive:``}`,onClick:()=>b(e=>!e),title:`More features`,"aria-label":`More features`,"aria-haspopup":`true`,"aria-expanded":y,children:(0,P.jsx)(cr,{size:16,stroke:1.5})}),y&&(0,P.jsx)(`div`,{className:F.menuPopover,role:`menu`,children:ri.map(e=>{let t=e.icon,r=n===e.id;return(0,P.jsxs)(`button`,{className:`${F.menuItem} ${r?F.menuItemActive:``}`,onClick:()=>ee(e),role:`menuitem`,"aria-current":r?`page`:void 0,children:[(0,P.jsx)(t,{size:14,stroke:1.5}),(0,P.jsx)(`span`,{children:e.label}),e.comingIn&&(0,P.jsx)(`span`,{className:F.comingBadge,children:e.comingIn})]},e.id)})})]})]})]}),(0,P.jsxs)(`div`,{className:F.right,children:[(0,P.jsxs)(`button`,{className:`${F.navBtn} ${n===`settings`?F.navBtnActive:``}`,onClick:()=>r(`settings`),title:`Settings`,"aria-current":n===`settings`?`page`:void 0,style:{marginRight:`2px`},children:[(0,P.jsx)(Br,{size:14,stroke:1.5}),(0,P.jsx)(`span`,{children:`Settings`})]}),(0,P.jsx)(ti,{toolMode:m,onSetToolMode:h,onCycleToolMode:g}),(0,P.jsxs)(`button`,{className:F.cmdkBtn,onClick:o,title:`Command palette (⌘K / Ctrl+P)`,"aria-label":`Open command palette (⌘K)`,children:[(0,P.jsx)(or,{size:14,stroke:1.5}),(0,P.jsx)(`span`,{className:F.cmdkLabel,children:`⌘K`})]}),(0,P.jsxs)(`button`,{className:`${F.benchmarkBtn} ${c?F.benchmarkActive:``}`,onClick:s,disabled:c,title:c?`AI Speed Test running — ${u}/${l}`:`Run AI Latency benchmark on ${d} visible models`,"aria-label":c?`AI Speed Test running — ${u} of ${l} complete`:`AI Latency benchmark`,children:[(0,P.jsx)(Ar,{size:14,stroke:1.5}),c?(0,P.jsxs)(`span`,{className:F.benchmarkRunning,children:[(0,P.jsx)(`span`,{className:F.spinner}),`RUN `,u,`/`,l]}):(0,P.jsx)(`span`,{children:`AI Latency`})]}),_,(0,P.jsx)(`button`,{className:F.iconBtn,onClick:i,title:`Theme: ${f} (click to cycle auto / dark / light)`,"aria-label":`Theme: ${f}. Click to cycle.`,children:f===`light`?(0,P.jsx)(kr,{size:16,stroke:1.5}):(0,P.jsx)(Ur,{size:16,stroke:1.5})}),(0,P.jsx)(`button`,{className:F.iconBtn,onClick:a,title:`Export Data`,"aria-label":`Export model data`,children:(0,P.jsx)(lr,{size:16,stroke:1.5})})]})]})}var ai={footer:`_footer_1uw54_1`,left:`_left_1uw54_8`,right:`_right_1uw54_8`};function oi(){return(0,P.jsxs)(`footer`,{className:ai.footer,children:[(0,P.jsxs)(`div`,{className:ai.left,children:[`by `,(0,P.jsx)(`a`,{href:`https://vavanessa.dev`,target:`_blank`,rel:`noopener`,children:`Vava-Nessa`})]}),(0,P.jsxs)(`div`,{className:ai.right,children:[(0,P.jsx)(`a`,{href:`https://github.com/vava-nessa/free-coding-models`,target:`_blank`,rel:`noopener`,children:`GitHub`}),(0,P.jsx)(`a`,{href:`https://discord.gg/ZTNFHvvCkU`,target:`_blank`,rel:`noopener`,children:`Discord`})]})]})}var si=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 181 24" xmlns="http://www.w3.org/2000/svg"><title>Google AI Studio</title><path d="M172.721 19.07c-1.172 0-2.221-.266-3.149-.798a5.779 5.779 0 01-2.169-2.237c-.517-.943-.775-1.993-.775-3.15 0-1.155.258-2.205.775-3.149a5.619 5.619 0 012.169-2.213c.928-.548 1.977-.822 3.149-.822 1.171 0 2.221.274 3.149.822a5.777 5.777 0 012.168 2.236c.518.944.776 1.986.776 3.127 0 1.156-.258 2.206-.776 3.15a5.776 5.776 0 01-2.168 2.236c-.928.532-1.978.799-3.149.799zm0-2.304c.639 0 1.232-.153 1.78-.457.548-.32.981-.768 1.301-1.346.335-.594.502-1.286.502-2.077 0-.791-.167-1.476-.502-2.054a3.304 3.304 0 00-1.301-1.324 3.472 3.472 0 00-1.78-.479c-.639 0-1.232.16-1.78.48a3.458 3.458 0 00-1.324 1.323c-.319.578-.479 1.263-.479 2.054 0 .791.16 1.483.479 2.077a3.629 3.629 0 001.324 1.346 3.606 3.606 0 001.78.457zM162.999 5.378a1.69 1.69 0 01-1.21-.48 1.69 1.69 0 01-.479-1.21c0-.47.16-.866.479-1.186a1.65 1.65 0 011.21-.502c.471 0 .867.167 1.186.502.335.32.503.715.503 1.187 0 .471-.168.875-.503 1.21a1.61 1.61 0 01-1.186.479zm-1.255 1.688h2.51v11.64h-2.51V7.066zM152.429 19.07c-1.05 0-2.001-.266-2.853-.798-.852-.533-1.529-1.263-2.031-2.191-.487-.944-.73-2.008-.73-3.195 0-1.187.243-2.244.73-3.172.502-.944 1.179-1.682 2.031-2.214.852-.533 1.803-.799 2.853-.799.821 0 1.559.183 2.213.548.655.365 1.149.814 1.484 1.346h.114l-.114-1.643V2.365h2.51v16.34h-2.396V17.2h-.114c-.335.517-.829.959-1.484 1.324-.654.365-1.392.547-2.213.547zm.365-2.305c.608 0 1.171-.16 1.689-.479.532-.32.958-.776 1.278-1.37.319-.592.479-1.27.479-2.03 0-.76-.16-1.43-.479-2.008-.32-.594-.746-1.05-1.278-1.37a3.158 3.158 0 00-1.689-.48c-.609 0-1.179.16-1.712.48-.532.32-.958.776-1.278 1.37-.319.578-.479 1.247-.479 2.008 0 .76.16 1.438.479 2.03.32.594.746 1.05 1.278 1.37.533.32 1.103.48 1.712.48zM138.527 19.07c-1.415 0-2.495-.418-3.241-1.255-.73-.852-1.095-2.03-1.095-3.537V7.066h2.51v6.87c0 .943.221 1.65.662 2.122.456.472 1.05.707 1.78.707.593 0 1.118-.152 1.575-.456.456-.32.806-.738 1.049-1.255a3.856 3.856 0 00.366-1.666V7.066h2.51v11.64h-2.373v-1.507h-.137c-.32.548-.814.997-1.484 1.346a4.517 4.517 0 01-2.122.525zM130.115 18.888a4.208 4.208 0 01-1.461-.251c-.457-.167-.829-.388-1.118-.662-.655-.654-.982-1.544-.982-2.67V9.28h-2.031V7.066h2.031V3.78h2.511v3.286h2.83V9.28h-2.83v5.477c0 .624.121 1.065.365 1.324.228.304.624.456 1.187.456.258 0 .486-.03.684-.09.198-.077.411-.191.639-.343v2.442c-.502.228-1.11.342-1.825.342zM117.888 19.07a6.03 6.03 0 01-3.652-1.186c-1.08-.791-1.825-1.902-2.236-3.332l2.419-.981c.243.897.669 1.635 1.278 2.213.624.563 1.369.845 2.236.845.807 0 1.491-.206 2.054-.617.563-.426.845-1.004.845-1.734 0-.67-.251-1.217-.753-1.643-.487-.441-1.347-.883-2.579-1.324l-1.027-.365c-1.096-.38-2.016-.928-2.762-1.643-.745-.715-1.118-1.658-1.118-2.83 0-.806.221-1.552.662-2.236.441-.685 1.05-1.225 1.826-1.62.791-.412 1.681-.617 2.67-.617 1.43 0 2.571.35 3.423 1.05.852.684 1.423 1.46 1.712 2.328l-2.305.981c-.168-.517-.487-.974-.959-1.37-.471-.395-1.08-.593-1.826-.593-.745 0-1.376.19-1.894.57-.502.381-.753.868-.753 1.461 0 .563.228 1.027.685 1.393.456.365 1.171.715 2.145 1.05l1.027.342c1.4.487 2.48 1.126 3.241 1.917.776.776 1.164 1.818 1.164 3.126 0 1.065-.274 1.963-.822 2.693a4.978 4.978 0 01-2.1 1.598 6.677 6.677 0 01-2.601.525zM102.221 2.365h2.556v16.34h-2.556V2.365zM90.94 2.365h2.922L100 18.705h-2.83l-1.46-4.176h-6.596l-1.484 4.176h-2.83l6.14-16.34zm3.903 9.79l-1.734-4.86-.64-1.895h-.136l-.64 1.894-1.734 4.862h4.884zM73.43 19.07c-1.141 0-2.168-.266-3.081-.798a5.758 5.758 0 01-2.123-2.191c-.502-.943-.753-2-.753-3.172 0-1.111.244-2.138.73-3.081a5.898 5.898 0 012.078-2.282c.882-.563 1.886-.845 3.012-.845 1.171 0 2.183.259 3.035.776A4.985 4.985 0 0178.291 9.6c.456.897.684 1.909.684 3.035 0 .213-.022.48-.068.799h-8.923c.091 1.08.471 1.917 1.14 2.51a3.57 3.57 0 002.374.867c.715 0 1.332-.16 1.849-.48a3.745 3.745 0 001.278-1.345l2.122 1.004c-.547.958-1.263 1.711-2.145 2.259-.882.548-1.94.822-3.172.822zm2.99-7.553a2.82 2.82 0 00-.389-1.21c-.228-.41-.578-.753-1.05-1.027-.456-.274-1.019-.41-1.688-.41-.806 0-1.491.243-2.054.73-.548.471-.928 1.11-1.141 1.917h6.322zM62.763 2.365h2.51v16.34h-2.51V2.365zM54.016 24c-1.43 0-2.616-.327-3.56-.981-.928-.654-1.552-1.43-1.871-2.328l2.35-.981a3.148 3.148 0 001.164 1.46c.548.38 1.187.57 1.917.57 1.065 0 1.895-.319 2.488-.958.609-.624.913-1.506.913-2.647v-1.073h-.137c-.38.548-.89.982-1.53 1.301-.623.304-1.346.457-2.167.457a5.185 5.185 0 01-2.716-.754c-.837-.502-1.506-1.21-2.008-2.122-.487-.928-.73-1.986-.73-3.172 0-1.187.243-2.237.73-3.15.502-.928 1.171-1.643 2.008-2.145a5.07 5.07 0 012.716-.776c.806 0 1.529.16 2.168.48.639.319 1.149.753 1.529 1.3h.137V7.066h2.396v11c0 1.263-.243 2.336-.73 3.218a4.81 4.81 0 01-2.054 2.031c-.867.457-1.872.685-3.013.685zm.023-7.463c.609 0 1.172-.144 1.69-.433a3.281 3.281 0 001.231-1.301c.305-.578.457-1.255.457-2.031 0-1.187-.327-2.107-.982-2.762-.639-.67-1.437-1.004-2.396-1.004-.623 0-1.194.152-1.711.457-.518.289-.928.715-1.233 1.278-.304.563-.456 1.24-.456 2.03 0 .792.152 1.469.456 2.032a3.28 3.28 0 001.233 1.3c.517.29 1.087.434 1.711.434zM40.36 19.07c-1.172 0-2.222-.266-3.15-.798a5.778 5.778 0 01-2.168-2.237c-.517-.943-.776-1.993-.776-3.15 0-1.155.259-2.205.776-3.149a5.618 5.618 0 012.168-2.213c.928-.548 1.978-.822 3.15-.822 1.17 0 2.22.274 3.149.822a5.778 5.778 0 012.168 2.236c.517.944.776 1.986.776 3.127 0 1.156-.259 2.206-.776 3.15a5.778 5.778 0 01-2.168 2.236c-.928.532-1.978.799-3.15.799zm0-2.304c.638 0 1.232-.153 1.78-.457.547-.32.98-.768 1.3-1.346.335-.594.502-1.286.502-2.077 0-.791-.167-1.476-.502-2.054a3.303 3.303 0 00-1.3-1.324 3.472 3.472 0 00-1.78-.479c-.64 0-1.233.16-1.78.48a3.458 3.458 0 00-1.324 1.323c-.32.578-.48 1.263-.48 2.054 0 .791.16 1.483.48 2.077a3.629 3.629 0 001.323 1.346 3.606 3.606 0 001.78.457zM26.497 19.07c-1.172 0-2.221-.266-3.15-.798a5.778 5.778 0 01-2.168-2.237c-.517-.943-.775-1.993-.775-3.15 0-1.155.258-2.205.776-3.149a5.618 5.618 0 012.168-2.213c.928-.548 1.977-.822 3.149-.822s2.221.274 3.15.822a5.779 5.779 0 012.167 2.236c.518.944.776 1.986.776 3.127 0 1.156-.258 2.206-.776 3.15a5.778 5.778 0 01-2.168 2.236c-.928.532-1.977.799-3.149.799zm0-2.304c.639 0 1.232-.153 1.78-.457.548-.32.981-.768 1.3-1.346.336-.594.503-1.286.503-2.077 0-.791-.167-1.476-.502-2.054a3.303 3.303 0 00-1.3-1.324 3.472 3.472 0 00-1.781-.479c-.639 0-1.232.16-1.78.48a3.456 3.456 0 00-1.324 1.323c-.32.578-.479 1.263-.479 2.054 0 .791.16 1.483.48 2.077a3.627 3.627 0 001.323 1.346 3.606 3.606 0 001.78.457zM10.558 19.07c-1.552 0-2.982-.372-4.29-1.118a8.49 8.49 0 01-3.127-3.058C2.381 13.586 2 12.133 2 10.535c0-1.597.38-3.043 1.141-4.336a8.435 8.435 0 013.127-3.08C7.576 2.372 9.006 2 10.558 2c1.232 0 2.381.22 3.446.662 1.065.441 1.955 1.057 2.67 1.848l-1.78 1.78a5.401 5.401 0 00-1.917-1.369c-.73-.32-1.544-.48-2.442-.48-1.05 0-2.03.252-2.944.754a5.702 5.702 0 00-2.19 2.145c-.548.928-.822 1.993-.822 3.195 0 1.202.274 2.267.821 3.195a5.702 5.702 0 002.191 2.146 6.057 6.057 0 002.967.753c.974 0 1.788-.145 2.442-.434a6.2 6.2 0 001.757-1.164c.335-.335.617-.753.845-1.255.243-.502.403-1.05.479-1.643h-5.546V9.85H18.5c.076.426.114.867.114 1.323 0 1.035-.16 2.032-.479 2.99a6.294 6.294 0 01-1.53 2.465c-1.536 1.628-3.552 2.442-6.047 2.442z"></path></svg>`,ci=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Google AI Studio</title><path d="M9.921 4.196H6.328A2.705 2.705 0 003.623 6.9v11.362a2.705 2.705 0 002.705 2.705h11.363a2.705 2.705 0 002.705-2.705v-4.756l1.623-1.113v5.87a4.329 4.329 0 01-4.328 4.328H6.328A4.329 4.329 0 012 18.263V6.901a4.328 4.328 0 014.328-4.329h4.545l-.952 1.624z"></path><path d="M17.82 0c.145 0 .268.104.299.246a7 7 0 001.9 3.484 7 7 0 003.485 1.901c.142.031.246.154.246.3a.308.308 0 01-.246.298A7 7 0 0020.02 8.13a7 7 0 00-1.912 3.535.297.297 0 01-.288.238.297.297 0 01-.288-.238A7 7 0 0015.62 8.13a7 7 0 00-3.535-1.912.297.297 0 01-.238-.288c0-.14.1-.26.238-.288A7 7 0 0015.62 3.73 7.001 7.001 0 0017.521.246.308.308 0 0117.82 0z"></path></svg>`,li=`<svg fill="currentColor" height="1em" style="flex:none;line-height:1" viewBox="0 0 53 24" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M13 2.701A9.299 9.299 0 0013 21.3V22.7C7.09 22.701 2.299 17.91 2.299 12S7.09 1.299 13 1.299V2.7zm4.752 3.677a7.353 7.353 0 00-9.453 11.265l-.901 1.074A8.755 8.755 0 1118.652 5.304l-.901 1.074zm-2.256.844a5.407 5.407 0 00-5.049 9.563l-.654 1.24a6.81 6.81 0 016.358-12.043l-.655 1.24zM13 8.539a3.461 3.461 0 000 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd"></path><path d="M14.286 10.836a2.242 2.242 0 00-.51-.409 1.085 1.085 0 00-.545-.152c-.254 0-.482.047-.683.14a1.582 1.582 0 00-.841.912 1.848 1.848 0 000 1.262 1.595 1.595 0 00.841.913c.2.093.429.14.683.14.217 0 .418-.046.603-.135.187-.09.35-.225.475-.392l.927 1.006c-.139.14-.3.261-.481.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.316 3.316 0 01-1.182-.21 2.826 2.826 0 01-.962-.597 2.813 2.813 0 01-.643-.929 2.986 2.986 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.277-.261.604-.464.962-.596a3.316 3.316 0 011.181-.21c.355 0 .713.068 1.072.204.362.138.686.36.945.649l-.962.97z"></path><path d="M19.338 11.397c-.008-.414-.136-.738-.383-.976-.247-.237-.59-.356-1.03-.356-.418 0-.749.12-.991.362-.244.242-.393.565-.447.97h2.85zm-2.85 1.052c.045.42.208.748.486.982.278.234.614.351 1.008.351.348 0 .639-.072.875-.217a2.42 2.42 0 00.62-.543l.997.76c-.325.405-.689.694-1.09.865a3.32 3.32 0 01-2.445.047 2.821 2.821 0 01-.962-.597 2.829 2.829 0 01-.643-.929 2.992 2.992 0 01-.237-1.21c0-.444.079-.847.238-1.21.15-.35.368-.666.642-.929.278-.261.605-.464.962-.596a3.32 3.32 0 011.182-.21c.386 0 .74.067 1.06.204.32.136.595.333.823.59.228.258.405.575.533.953.128.379.19.812.19 1.303v.386h-4.24zm4.843-3.296h1.39v.888h.023c.155-.327.375-.58.661-.76a1.812 1.812 0 011.234-.246c.081.016.164.036.25.06v1.355a3.912 3.912 0 00-.343-.076c-.109-.02-.22-.03-.33-.03-.324 0-.585.06-.782.182a1.38 1.38 0 00-.66.883 1.76 1.76 0 00-.053.35v3.005h-1.39V9.152zm7.797 2.244c-.008-.414-.135-.738-.383-.976-.246-.237-.59-.356-1.03-.356-.417 0-.748.12-.99.362-.245.242-.393.565-.447.97h2.85zm-2.85 1.052c.046.42.208.748.487.982.277.234.613.351 1.007.351.348 0 .64-.072.875-.217.236-.144.446-.328.62-.543l.997.76c-.325.405-.688.694-1.09.865a3.319 3.319 0 01-2.445.047 2.823 2.823 0 01-.961-.597 2.829 2.829 0 01-.643-.929 2.984 2.984 0 01-.238-1.21c0-.444.08-.847.238-1.21.158-.362.373-.672.643-.929a2.84 2.84 0 01.962-.596 3.318 3.318 0 011.181-.21c.387 0 .74.067 1.06.204.321.136.596.333.823.59.228.258.406.575.533.953.128.379.192.812.192 1.303v.386h-4.241zm9.225-.49a1.84 1.84 0 00-.11-.632 1.603 1.603 0 00-.84-.912 1.607 1.607 0 00-.684-.14 1.587 1.587 0 00-1.524 1.052 1.83 1.83 0 00-.11.631c0 .218.036.429.11.632a1.583 1.583 0 001.524 1.052 1.591 1.591 0 001.524-1.052c.073-.203.11-.414.11-.632zM30.89 5.925h1.391v3.94h.035a1.99 1.99 0 01.266-.287 2.327 2.327 0 01.927-.485c.201-.054.433-.081.696-.081a2.55 2.55 0 011.94.853c.236.264.42.577.55.935.132.358.198.744.198 1.157 0 .413-.062.8-.186 1.158a2.673 2.673 0 01-.544.935c-.243.267-.539.48-.869.625-.34.152-.723.229-1.147.229a2.613 2.613 0 01-1.1-.235 1.785 1.785 0 01-.812-.748h-.023v.841H30.89V5.927zm6.604 3.227h1.39v.888h.023c.155-.327.376-.58.661-.76a1.815 1.815 0 011.234-.246c.081.016.164.036.25.06v1.355a3.893 3.893 0 00-.343-.076c-.109-.02-.22-.03-.33-.03-.325 0-.585.06-.782.182a1.43 1.43 0 00-.452.415 1.39 1.39 0 00-.209.468 1.788 1.788 0 00-.051.35v3.005h-1.391V9.152zm7.207 3.097h-.29c-.193 0-.409.008-.649.024a3.384 3.384 0 00-.677.11c-.213.06-.393.146-.54.258a.564.564 0 00-.22.473c0 .133.03.244.087.333.058.09.134.166.226.229a.933.933 0 00.313.134c.117.027.232.04.348.04.48 0 .832-.114 1.06-.344.228-.23.342-.544.342-.94v-.317zm.082 1.743h-.036c-.2.32-.456.551-.764.695-.32.146-.668.22-1.02.216-.253 0-.504-.035-.748-.104a2.03 2.03 0 01-.649-.317 1.616 1.616 0 01-.457-.526 1.501 1.501 0 01-.174-.736c0-.305.054-.563.163-.777.103-.21.252-.393.434-.539a2.19 2.19 0 01.632-.344c.242-.087.492-.152.747-.193.258-.043.52-.07.782-.082.247-.011.495-.017.742-.018h.347v-.151c0-.351-.12-.614-.36-.79-.238-.175-.544-.262-.914-.262a2.129 2.129 0 00-1.483.585l-.73-.738a2.7 2.7 0 011.083-.69c.412-.14.845-.21 1.28-.21.394 0 .726.046.997.135.27.09.494.205.672.345.177.14.314.302.411.485.096.183.166.368.21.555.041.187.066.368.074.544.008.175.012.33.012.461v3.227h-1.252v-.771zm5.018-3.286c-.27-.382-.634-.573-1.09-.573a1.16 1.16 0 00-.544.14.478.478 0 00-.266.456c0 .172.073.297.22.375.147.078.332.144.556.198.224.055.465.111.724.17.259.058.5.148.724.268.224.122.41.287.556.498.147.21.22.498.22.864 0 .336-.071.619-.214.848-.139.226-.33.417-.556.556a2.456 2.456 0 01-.77.303c-.282.062-.57.094-.858.094-.432 0-.83-.062-1.194-.187a2.27 2.27 0 01-.973-.678l.928-.877c.177.203.368.368.573.497.204.129.454.193.747.193.101 0 .205-.012.313-.035a.992.992 0 00.301-.117.71.71 0 00.226-.204.482.482 0 00.087-.287c0-.194-.073-.34-.22-.432a1.966 1.966 0 00-.556-.229c-.24-.062-.481-.116-.724-.164a2.794 2.794 0 01-.725-.245 1.523 1.523 0 01-.556-.473c-.146-.203-.22-.483-.22-.841 0-.312.064-.583.191-.813a1.69 1.69 0 01.504-.567c.217-.152.461-.263.719-.327a3.256 3.256 0 011.923.087c.356.123.664.354.881.66l-.927.842z"></path></svg>`,ui=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 53 24" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M13 2.701A9.299 9.299 0 0013 21.3V22.7C7.09 22.701 2.299 17.91 2.299 12S7.09 1.299 13 1.299V2.7zm4.752 3.677a7.353 7.353 0 00-9.453 11.265l-.901 1.074A8.755 8.755 0 1118.652 5.304l-.901 1.074zm-2.256.844a5.407 5.407 0 00-5.049 9.563l-.654 1.24a6.81 6.81 0 016.358-12.043l-.655 1.24zM13 8.539a3.461 3.461 0 000 6.922v1.402a4.863 4.863 0 010-9.726v1.402z"></path><path d="M14.286 10.836a2.242 2.242 0 00-.51-.409 1.085 1.085 0 00-.545-.152c-.254 0-.482.047-.683.14a1.582 1.582 0 00-.841.912 1.848 1.848 0 000 1.262 1.595 1.595 0 00.841.913c.2.093.429.14.683.14.217 0 .418-.046.603-.135.187-.09.35-.225.475-.392l.927 1.006c-.139.14-.3.261-.481.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.316 3.316 0 01-1.182-.21 2.826 2.826 0 01-.962-.597 2.813 2.813 0 01-.643-.929 2.986 2.986 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.277-.261.604-.464.962-.596a3.316 3.316 0 011.181-.21c.355 0 .713.068 1.072.204.362.138.686.36.945.649l-.962.97z"></path><path d="M19.338 11.397c-.008-.414-.136-.738-.383-.976-.247-.237-.59-.356-1.03-.356-.418 0-.749.12-.991.362-.244.242-.393.565-.447.97h2.85zm-2.85 1.052c.045.42.208.748.486.982.278.234.614.351 1.008.351.348 0 .639-.072.875-.217a2.42 2.42 0 00.62-.543l.997.76c-.325.405-.689.694-1.09.865a3.32 3.32 0 01-2.445.047 2.821 2.821 0 01-.962-.597 2.829 2.829 0 01-.643-.929 2.992 2.992 0 01-.237-1.21c0-.444.079-.847.238-1.21.15-.35.368-.666.642-.929.278-.261.605-.464.962-.596a3.32 3.32 0 011.182-.21c.386 0 .74.067 1.06.204.32.136.595.333.823.59.228.258.405.575.533.953.128.379.19.812.19 1.303v.386h-4.24zm4.843-3.296h1.39v.888h.023c.155-.327.375-.58.661-.76a1.812 1.812 0 011.234-.246c.081.016.164.036.25.06v1.355a3.912 3.912 0 00-.343-.076c-.109-.02-.22-.03-.33-.03-.324 0-.585.06-.782.182a1.38 1.38 0 00-.66.883 1.76 1.76 0 00-.053.35v3.005h-1.39V9.152zm7.797 2.244c-.008-.414-.135-.738-.383-.976-.246-.237-.59-.356-1.03-.356-.417 0-.748.12-.99.362-.245.242-.393.565-.447.97h2.85zm-2.85 1.052c.046.42.208.748.487.982.277.234.613.351 1.007.351.348 0 .64-.072.875-.217.236-.144.446-.328.62-.543l.997.76c-.325.405-.688.694-1.09.865a3.319 3.319 0 01-2.445.047 2.823 2.823 0 01-.961-.597 2.829 2.829 0 01-.643-.929 2.984 2.984 0 01-.238-1.21c0-.444.08-.847.238-1.21.158-.362.373-.672.643-.929a2.84 2.84 0 01.962-.596 3.318 3.318 0 011.181-.21c.387 0 .74.067 1.06.204.321.136.596.333.823.59.228.258.406.575.533.953.128.379.192.812.192 1.303v.386h-4.241zm9.225-.49a1.84 1.84 0 00-.11-.632 1.603 1.603 0 00-.84-.912 1.607 1.607 0 00-.684-.14 1.587 1.587 0 00-1.524 1.052 1.83 1.83 0 00-.11.631c0 .218.036.429.11.632a1.583 1.583 0 001.524 1.052 1.591 1.591 0 001.524-1.052c.073-.203.11-.414.11-.632zM30.89 5.925h1.391v3.94h.035a1.99 1.99 0 01.266-.287 2.327 2.327 0 01.927-.485c.201-.054.433-.081.696-.081a2.55 2.55 0 011.94.853c.236.264.42.577.55.935.132.358.198.744.198 1.157 0 .413-.062.8-.186 1.158a2.673 2.673 0 01-.544.935c-.243.267-.539.48-.869.625-.34.152-.723.229-1.147.229a2.613 2.613 0 01-1.1-.235 1.785 1.785 0 01-.812-.748h-.023v.841H30.89V5.927zm6.604 3.227h1.39v.888h.023c.155-.327.376-.58.661-.76a1.815 1.815 0 011.234-.246c.081.016.164.036.25.06v1.355a3.893 3.893 0 00-.343-.076c-.109-.02-.22-.03-.33-.03-.325 0-.585.06-.782.182a1.43 1.43 0 00-.452.415 1.39 1.39 0 00-.209.468 1.788 1.788 0 00-.051.35v3.005h-1.391V9.152zm7.207 3.097h-.29c-.193 0-.409.008-.649.024a3.384 3.384 0 00-.677.11c-.213.06-.393.146-.54.258a.564.564 0 00-.22.473c0 .133.03.244.087.333.058.09.134.166.226.229a.933.933 0 00.313.134c.117.027.232.04.348.04.48 0 .832-.114 1.06-.344.228-.23.342-.544.342-.94v-.317zm.082 1.743h-.036c-.2.32-.456.551-.764.695-.32.146-.668.22-1.02.216-.253 0-.504-.035-.748-.104a2.03 2.03 0 01-.649-.317 1.616 1.616 0 01-.457-.526 1.501 1.501 0 01-.174-.736c0-.305.054-.563.163-.777.103-.21.252-.393.434-.539a2.19 2.19 0 01.632-.344c.242-.087.492-.152.747-.193.258-.043.52-.07.782-.082.247-.011.495-.017.742-.018h.347v-.151c0-.351-.12-.614-.36-.79-.238-.175-.544-.262-.914-.262a2.129 2.129 0 00-1.483.585l-.73-.738a2.7 2.7 0 011.083-.69c.412-.14.845-.21 1.28-.21.394 0 .726.046.997.135.27.09.494.205.672.345.177.14.314.302.411.485.096.183.166.368.21.555.041.187.066.368.074.544.008.175.012.33.012.461v3.227h-1.252v-.771zm5.018-3.286c-.27-.382-.634-.573-1.09-.573a1.16 1.16 0 00-.544.14.478.478 0 00-.266.456c0 .172.073.297.22.375.147.078.332.144.556.198.224.055.465.111.724.17.259.058.5.148.724.268.224.122.41.287.556.498.147.21.22.498.22.864 0 .336-.071.619-.214.848-.139.226-.33.417-.556.556a2.456 2.456 0 01-.77.303c-.282.062-.57.094-.858.094-.432 0-.83-.062-1.194-.187a2.27 2.27 0 01-.973-.678l.928-.877c.177.203.368.368.573.497.204.129.454.193.747.193.101 0 .205-.012.313-.035a.992.992 0 00.301-.117.71.71 0 00.226-.204.482.482 0 00.087-.287c0-.194-.073-.34-.22-.432a1.966 1.966 0 00-.556-.229c-.24-.062-.481-.116-.724-.164a2.794 2.794 0 01-.725-.245 1.523 1.523 0 01-.556-.473c-.146-.203-.22-.483-.22-.841 0-.312.064-.583.191-.813a1.69 1.69 0 01.504-.567c.217-.152.461-.263.719-.327a3.256 3.256 0 011.923.087c.356.123.664.354.881.66l-.927.842z"></path></svg>`,di=`<svg fill="currentColor" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd"></path><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z"></path></svg>`,fi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 95 24" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M17.075 16.717c-.62-.52-.982-1.25-1.085-2.187l9.446.001v-.86c0-1.094-.14-2.06-.425-2.904-.283-.842-.68-1.549-1.188-2.12a5.049 5.049 0 00-1.832-1.317c-.713-.304-1.5-.456-2.361-.456a7.396 7.396 0 00-2.633.469 6.325 6.325 0 00-2.143 1.328 6.309 6.309 0 00-1.431 2.07c-.354.808-.53 1.706-.53 2.696 0 .99.176 1.888.529 2.695.333.78.82 1.483 1.432 2.07a6.288 6.288 0 002.142 1.328 7.396 7.396 0 002.633.469 7.101 7.101 0 002.814-.573c.894-.381 1.704-1.025 2.427-1.926l-2.22-1.693c-.388.48-.855.888-1.381 1.21-.526.322-1.175.483-1.95.483-.877 0-1.625-.261-2.244-.783zm4.413-6.705c.55.53.836 1.254.852 2.175h-6.35c.12-.903.452-1.623.995-2.162.54-.537 1.278-.807 2.207-.807.98 0 1.745.266 2.296.794z"></path><path d="M29.878 7.187H26.78v12.499h3.098v-6.693c0-.172.038-.433.116-.78.077-.348.232-.694.465-1.043.233-.346.568-.654 1.006-.923.44-.27 1.02-.405 1.742-.405.247 0 .493.023.736.066.256.045.51.101.761.169v-3.02a7.03 7.03 0 00-.554-.131 2.962 2.962 0 00-.555-.05c-.827 0-1.559.198-2.194.597-.636.4-1.129.964-1.473 1.693h-.05V7.187z"></path><path clip-rule="evenodd" d="M37.8 14.531c.102.937.465 1.666 1.084 2.186.619.522 1.367.783 2.245.783.775 0 1.424-.161 1.95-.483.525-.322.992-.73 1.38-1.21l2.22 1.693c-.722.901-1.532 1.545-2.426 1.926-.89.38-1.848.576-2.815.573a7.39 7.39 0 01-2.632-.469 6.287 6.287 0 01-2.142-1.328 6.302 6.302 0 01-1.432-2.07c-.353-.807-.53-1.705-.53-2.696 0-.989.177-1.887.53-2.695a6.3 6.3 0 011.432-2.07 6.325 6.325 0 012.142-1.328 7.39 7.39 0 012.633-.469c.86 0 1.648.152 2.361.456a5.05 5.05 0 011.833 1.316c.507.572.904 1.279 1.188 2.121.285.844.426 1.81.426 2.903v.861H37.8zm5.497-4.519c.55.53.834 1.254.852 2.175H37.8c.121-.903.452-1.623.995-2.162.54-.537 1.278-.807 2.207-.807.98 0 1.746.266 2.296.794zM51.173 0h-3.098v19.686h2.944V17.81h.051c.447.765 1.048 1.32 1.808 1.667.77.35 1.606.528 2.45.522.947 0 1.8-.17 2.557-.509a5.714 5.714 0 001.935-1.393 5.954 5.954 0 001.213-2.082 7.835 7.835 0 00.413-2.58c0-.92-.146-1.778-.44-2.576a6.398 6.398 0 00-1.225-2.085 5.68 5.68 0 00-1.896-1.394 5.772 5.772 0 00-2.426-.506 5.93 5.93 0 00-1.55.182 5.18 5.18 0 00-1.187.47c-.344.19-.636.394-.878.61-.241.219-.439.43-.593.638h-.078V0zm6.931 12.031c.163.45.245.92.245 1.405 0 .487-.082.956-.246 1.407a3.545 3.545 0 01-1.87 2.03 3.574 3.574 0 01-1.524.314 3.525 3.525 0 01-3.394-2.343 4.098 4.098 0 01-.245-1.407c-.001-.48.081-.955.245-1.406A3.533 3.533 0 0153.186 10a3.584 3.584 0 011.523-.312c.568 0 1.076.104 1.523.312.434.2.825.482 1.15.833.317.349.557.746.722 1.2z"></path><path d="M65.882 7.187h-3.097v12.499h3.098v-6.693c0-.172.038-.433.115-.78.078-.348.233-.694.466-1.043.232-.346.567-.654 1.006-.923.439-.27 1.019-.405 1.742-.405.246 0 .492.023.735.066.257.045.512.101.763.169v-3.02a7.065 7.065 0 00-.556-.131 2.942 2.942 0 00-.554-.05c-.825 0-1.558.198-2.194.597-.636.4-1.128.964-1.473 1.693h-.051V7.187z"></path><path clip-rule="evenodd" d="M78.943 17.969h.079l-.002 1.718h2.788v-7.188c0-.294-.008-.638-.026-1.028a6.951 6.951 0 00-.166-1.21 5.142 5.142 0 00-.466-1.238 3.4 3.4 0 00-.916-1.08c-.397-.312-.895-.569-1.497-.77-.603-.198-1.343-.299-2.22-.299a8.83 8.83 0 00-2.853.469 6.012 6.012 0 00-2.413 1.536l1.626 1.642a4.743 4.743 0 013.304-1.303c.826 0 1.506.196 2.039.587.533.39.8.976.8 1.757v.338h-.773c-.551.001-1.103.014-1.654.039-.584.026-1.165.088-1.741.182a9.606 9.606 0 00-1.665.43 4.88 4.88 0 00-1.407.768 3.555 3.555 0 00-.967 1.199c-.241.478-.363 1.053-.363 1.731 0 .625.13 1.173.388 1.64.25.461.598.861 1.019 1.173.436.32.925.558 1.446.704a6.019 6.019 0 001.665.233 5.307 5.307 0 002.271-.481c.688-.321 1.257-.838 1.704-1.55zm-.749-3.881h.645v.703c0 .884-.254 1.584-.76 2.096-.51.513-1.295.768-2.362.768-.259 0-.516-.03-.775-.091a2.083 2.083 0 01-.698-.3 1.769 1.769 0 01-.503-.507c-.129-.2-.193-.447-.193-.742 0-.451.164-.803.49-1.055a3.465 3.465 0 011.202-.573 7.534 7.534 0 011.508-.247 22.752 22.752 0 011.446-.052z"></path><path d="M87.774 9.374c1.015 0 1.825.425 2.426 1.276l2.066-1.875a4.013 4.013 0 00-1.963-1.47 7.302 7.302 0 00-2.452-.43c-.618-.001-1.234.078-1.833.234a4.82 4.82 0 00-1.6.73c-.464.33-.839.75-1.123 1.262-.284.512-.425 1.116-.425 1.81 0 .798.163 1.424.49 1.876.322.446.747.807 1.239 1.052a6.22 6.22 0 001.614.547c.54.106 1.079.227 1.613.365.499.131.91.3 1.238.51.328.207.491.529.491.961 0 .245-.065.458-.194.64a1.578 1.578 0 01-.504.454c-.206.122-.429.21-.67.26a3.24 3.24 0 01-.697.079c-.654 0-1.21-.143-1.665-.428a5.852 5.852 0 01-1.277-1.11l-2.066 1.955c.637.729 1.36 1.232 2.168 1.51.81.278 1.696.417 2.66.417.642-.001 1.282-.07 1.91-.209a5.473 5.473 0 001.716-.676 3.78 3.78 0 001.238-1.238c.319-.51.477-1.14.477-1.888 0-.816-.163-1.458-.49-1.926a3.527 3.527 0 00-1.238-1.108 6.356 6.356 0 00-1.613-.598c-.577-.13-1.115-.256-1.614-.378-.5-.121-.911-.269-1.238-.442-.327-.173-.49-.452-.49-.834 0-.47.197-.806.593-1.016.396-.208.8-.312 1.213-.312zM9.95 10.026c.422.246.805.553 1.137.911l2.142-2.162a5.428 5.428 0 00-2.104-1.446 6.713 6.713 0 00-2.388-.455 7.386 7.386 0 00-2.632.468 6.316 6.316 0 00-2.142 1.329 6.266 6.266 0 00-1.432 2.07C2.177 11.55 2 12.449 2 13.437c0 .99.177 1.887.53 2.695.333.78.82 1.484 1.433 2.07a6.294 6.294 0 002.142 1.33 7.384 7.384 0 002.632.467c.276 0 .603-.03.982-.09a7.502 7.502 0 002.413-.846 4.813 4.813 0 001.072-.808l-2.066-2.24c-.278.37-.64.67-1.058.873-.413.198-.86.3-1.343.3-.567 0-1.075-.105-1.521-.312a3.553 3.553 0 01-1.873-2.032 4.107 4.107 0 01-.246-1.407c0-.48.082-.955.245-1.405a3.52 3.52 0 01.724-1.198c.32-.349.701-.625 1.15-.835.446-.207.954-.311 1.521-.311.428.003.846.12 1.214.339z"></path></svg>`,pi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z"></path><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z"></path></svg>`,mi=`<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cloudflare</title><path d="M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437" fill="#F38020"></path><path d="M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777" fill="#FCAD32"></path></svg>`,hi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 242 24" xmlns="http://www.w3.org/2000/svg"><title>Cloudflare</title><path d="M28.4 2.395h5.386v14.606h9.326v4.736H28.4V2.395zM16.71 14.369c-.787 1.71-2.363 2.894-4.465 2.894-2.89 0-4.86-2.368-4.86-5.263 0-2.764 1.97-5.132 4.86-5.132 2.232 0 3.81 1.316 4.597 3.158h5.647C21.571 5.421 17.5 2 12.377 2 6.467 2 2 6.474 2 12s4.335 10 10.377 10c5.122 0 9.062-3.289 10.112-7.763H16.71v.132zM224.37 2.395h15.499v4.606h-10.114v2.894h9.194v4.21h-9.194v3.027H240v4.605h-15.63V2.395zm-24.693 0h9.062c2.89 0 4.991.79 6.305 2.105 1.182 1.052 1.708 2.632 1.708 4.474 0 2.894-1.576 4.868-3.94 5.921l4.596 6.71h-6.174l-3.939-5.79h-2.365v5.79h-5.386V2.395h.133zm8.8 9.211c1.838 0 2.889-.921 2.889-2.238 0-1.579-1.05-2.237-2.89-2.237l-3.546.001v4.605h3.547v-.13zm-29.028-9.343h5.122l8.144 19.474h-5.78l-1.444-3.421h-7.486l-1.315 3.42h-5.516l8.275-19.473zm4.598 11.842l-2.103-5.526-2.232 5.526h4.335zm-33.232-11.71h5.386v14.606h9.325v4.736h-14.711V2.395zm-22.854 0h15.367v4.737h-9.981v3.158h9.062v4.474h-9.062v6.973h-5.386V2.395zm-26.007 0h7.488c6.829 0 10.9 3.947 10.9 9.473 0 5.526-4.071 9.737-11.032 9.737h-7.356V2.395zm7.488 14.606c3.151 0 5.253-1.712 5.253-4.87 0-3.025-2.102-4.868-5.253-4.868h-2.233v9.87h2.233V17zm-33.625-3.816V2.395H81.2v10.658c0 2.763 1.445 4.078 3.547 4.078 2.101 0 3.547-1.315 3.547-3.946V2.263h5.385v10.659c0 6.183-3.548 8.946-9.063 8.946-5.386.132-8.8-2.63-8.8-8.683zm-27.19-1.053C48.628 6.474 53.095 2 59.006 2c5.91 0 10.375 4.474 10.375 10s-4.465 10-10.375 10c-6.042 0-10.377-4.342-10.377-9.868zm15.237 0c0-2.896-1.97-5.264-4.99-5.264-2.891 0-4.861 2.368-4.861 5.132s1.97 5.263 4.86 5.263c3.02 0 4.99-2.368 4.99-5.131z"></path></svg>`,gi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cloudflare</title><path d="M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437"></path><path d="M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777"></path></svg>`,_i=`<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemini</title><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="#3186FF"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-0-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-1-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-0-_R_0_" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"></stop><stop offset="1" stop-color="#08B962" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-1-_R_0_" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"></stop><stop offset="1" stop-color="#F94543" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-2-_R_0_" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"></stop><stop offset=".46" stop-color="#FABC12" stop-opacity="0"></stop></linearGradient></defs></svg>`,vi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 98 24" xmlns="http://www.w3.org/2000/svg"><title>Gemini</title><path d="M21.186 12.67c0 2.649-.786 4.759-2.359 6.33-1.766 1.87-4.09 2.806-6.969 2.806-2.756 0-5.088-.953-6.996-2.86C2.954 17.04 2 14.693 2 11.904c0-2.789.954-5.137 2.862-7.043C6.77 2.953 9.102 2 11.858 2c1.396 0 2.712.247 3.949.741 1.236.495 2.252 1.192 3.047 2.092l-1.749 1.748c-.583-.706-1.338-1.258-2.266-1.655a7.49 7.49 0 00-2.981-.596c-2.067 0-3.816.715-5.247 2.145-1.413 1.448-2.12 3.257-2.12 5.428s.707 3.98 2.12 5.428c1.431 1.43 3.18 2.145 5.247 2.145 1.89 0 3.463-.53 4.717-1.588 1.254-1.06 1.979-2.516 2.173-4.37h-6.89v-2.277h9.196c.088.495.132.971.132 1.43m7.652-4.633c1.946 0 3.494.629 4.645 1.886 1.15 1.257 1.726 3.018 1.726 5.282l-.027.268H24.877c.036 1.284.464 2.318 1.285 3.102.82.785 1.802 1.177 2.944 1.177 1.57 0 2.802-.784 3.694-2.354l2.195 1.07a6.54 6.54 0 01-2.45 2.595C31.503 21.688 30.32 22 29 22c-1.927 0-3.516-.66-4.765-1.98-1.249-1.319-1.873-2.986-1.873-5.001 0-1.997.606-3.66 1.82-4.988 1.213-1.329 2.766-1.993 4.657-1.993m-.053 2.247c-.928 0-1.727.285-2.396.856-.67.57-1.11 1.337-1.325 2.3h7.522c-.071-.91-.442-1.663-1.111-2.26-.67-.598-1.566-.896-2.69-.896M39.247 21.53h-2.455V8.465h2.348v1.813h.107c.374-.64.947-1.173 1.721-1.6.774-.427 1.544-.64 2.309-.64.96 0 1.806.222 2.535.667a3.931 3.931 0 011.601 1.84c1.085-1.671 2.589-2.507 4.51-2.507 1.513 0 2.678.462 3.496 1.387.819.924 1.228 2.24 1.228 3.946v8.16h-2.455v-7.786c0-1.227-.223-2.112-.668-2.654-.444-.542-1.192-.813-2.241-.813-.943 0-1.735.4-2.375 1.2-.64.8-.961 1.742-.961 2.826v7.227h-2.455v-7.786c0-1.227-.223-2.112-.668-2.654-.444-.542-1.191-.813-2.241-.813-.943 0-1.735.4-2.375 1.2-.64.8-.961 1.742-.961 2.826v7.227zM61.911 3.93c0 .48-.17.89-.508 1.228a1.675 1.675 0 01-1.23.508c-.48 0-.89-.17-1.229-.508a1.673 1.673 0 01-.508-1.228c0-.481.17-.89.508-1.229a1.675 1.675 0 011.23-.508c.48 0 .89.17 1.23.508.338.338.507.748.507 1.228m-.11 4.514v13.088h-2.857V8.443h2.857zM80 3.93c0 .48-.17.89-.508 1.228a1.675 1.675 0 01-1.23.508c-.48 0-.89-.17-1.229-.508a1.673 1.673 0 01-.508-1.228c0-.481.17-.89.508-1.229a1.675 1.675 0 011.23-.508c.48 0 .89.17 1.23.508.338.338.507.748.507 1.228m-.11 4.514v13.088h-2.857V8.443h2.857zm-16.343.022h2.349v1.813h.107c.373-.64.947-1.173 1.721-1.6a4.935 4.935 0 012.415-.64c1.601 0 2.833.458 3.696 1.373.863.916 1.294 2.218 1.294 3.907v8.213h-2.455v-8.053c-.053-2.133-1.13-3.2-3.229-3.2-.978 0-1.797.395-2.455 1.187-.658.79-.987 1.737-.987 2.84v7.226h-2.456V8.465z"></path></svg>`,yi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemini</title><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"></path></svg>`,bi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 78 24" xmlns="http://www.w3.org/2000/svg"><title>Github</title><path d="M16.598 10.836v9.48c0 .066-.017.181-.1.214 0 0-2.07 1.47-5.484 1.47C6.888 22 2 20.712 2 12.223 2 3.734 6.275 1.983 10.45 2c3.613 0 5.07.81 5.303.958.066.083.1.149.1.231l-.697 2.94c0 .149-.149.33-.331.28-.597-.18-1.491-.544-3.596-.544-2.435 0-5.053.693-5.053 6.16 0 5.466 2.485 6.11 4.275 6.11 1.524 0 2.07-.181 2.07-.181v-3.799h-2.435c-.182 0-.315-.132-.315-.28v-3.04c0-.148.133-.28.315-.28h6.197c.182 0 .315.132.315.28zM76 14.684c0 5.664-1.84 7.283-5.054 7.283-2.717 0-4.175-1.37-4.175-1.37s-.067.759-.15.858c-.05.1-.132.132-.231.132h-2.453c-.165 0-.315-.132-.315-.28l.034-18.349a.29.29 0 01.281-.28h3.53a.29.29 0 01.281.28v6.226s1.359-.875 3.347-.875l-.016-.033c1.988 0 4.921.743 4.921 6.408zM47.865 2.71a.29.29 0 01.281.281V21.34a.29.29 0 01-.281.281h-3.53a.29.29 0 01-.281-.28l.033-7.845h-5.485v7.844a.29.29 0 01-.281.281h-3.53c-.132 0-.281-.132-.281-.28V2.99a.29.29 0 01.281-.28h3.53a.29.29 0 01.281.28v6.755h5.485V2.99a.29.29 0 01.282-.28h3.496zM61.55 8.722c.183 0 .315.132.315.28l-.033 12.337c0 .149-.1.281-.282.281h-2.22c-.116 0-.232-.066-.265-.148-.05-.1-.133-.744-.133-.744S57.061 22 54.758 22c-2.8 0-4.839-.908-4.839-4.542V9.02a.29.29 0 01.282-.28h3.546a.29.29 0 01.282.28v7.845c0 1.238.364 1.8 1.607 1.8 1.243 0 2.154-.644 2.154-.644V9.036c0-.182.1-.314.282-.314h3.48zm-28.84 9.861h.007c.14.029.239.154.234.296v2.477c0 .116-.05.231-.149.264-.166.083-1.226.363-2.104.363-1.922 0-4.74-.412-4.74-4.442v-5.417H24.12c-.149 0-.281-.132-.281-.314V9.564c0-.132.083-.248.215-.28.116-.017 1.922-.463 1.922-.463V5.237c0-.132.083-.215.232-.215h3.58c.148 0 .231.083.231.215v3.485h2.635c.132 0 .265.132.265.28v2.808c0 .182-.116.314-.265.314h-2.635v5.17c0 .777.448 1.372 1.74 1.372.41 0 .797-.081.951-.083zM22.28 8.705a.29.29 0 01.282.281v12.172c0 .297-.083.446-.414.446h-3.182c-.281 0-.497-.116-.497-.446V9.036c0-.182.133-.33.282-.33h3.53zm49.693 6.243c0-2.99-1.21-3.386-2.486-3.253-.994.066-1.79.561-1.79.561v5.813s.813.562 2.022.595c1.707.05 2.254-.562 2.254-3.716zM20.54 3.123a2.26 2.26 0 012.254 2.28A2.26 2.26 0 0120.54 7.68a2.266 2.266 0 01-2.286-2.279c0-1.271 1.01-2.279 2.286-2.279z"></path></svg>`,xi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Github</title><path d="M12 0c6.63 0 12 5.276 12 11.79-.001 5.067-3.29 9.567-8.175 11.187-.6.118-.825-.25-.825-.56 0-.398.015-1.665.015-3.242 0-1.105-.375-1.813-.81-2.181 2.67-.295 5.475-1.297 5.475-5.822 0-1.297-.465-2.344-1.23-3.169.12-.295.54-1.503-.12-3.125 0 0-1.005-.324-3.3 1.209a11.32 11.32 0 00-3-.398c-1.02 0-2.04.133-3 .398-2.295-1.518-3.3-1.209-3.3-1.209-.66 1.622-.24 2.83-.12 3.125-.765.825-1.23 1.887-1.23 3.169 0 4.51 2.79 5.527 5.46 5.822-.345.294-.66.81-.765 1.577-.69.31-2.415.81-3.495-.973-.225-.354-.9-1.223-1.845-1.209-1.005.015-.405.56.015.781.51.28 1.095 1.327 1.23 1.666.24.663 1.02 1.93 4.035 1.385 0 .988.015 1.916.015 2.196 0 .31-.225.664-.825.56C3.303 21.374-.003 16.867 0 11.791 0 5.276 5.37 0 12 0z"></path></svg>`,Si=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 64 24" xmlns="http://www.w3.org/2000/svg"><title>Groq</title><path d="M37.925 2.039c4.142 0 7.509 3.368 7.509 7.528l-.004.244c-.128 4.047-3.437 7.284-7.505 7.284-4.15 0-7.509-3.368-7.509-7.528s3.36-7.528 7.509-7.528zm-11.144-.023c.26 0 .522.015.775.046l.015-.008a7.464 7.464 0 012.922.969L29.09 5.468a4.619 4.619 0 00-2.309-.6h-.253l-.253.016c-.338.03-.66.092-.982.177-.621.169-1.196.469-1.703.869a4.062 4.062 0 00-1.418 2.322l-.04.234-.03.235c-.007.077-.023.161-.023.238l-.014 2.713v2.593l-.016 2.522h-2.815l-.03-4.973V8.852c0-.139.015-.262.022-.392.023-.262.062-.523.115-.777.1-.523.269-1.03.491-1.515a6.998 6.998 0 011.948-2.484 7.465 7.465 0 012.754-1.391c.49-.131.99-.216 1.495-.254.123-.008.253-.023.376-.023h.376zM37.925 4.86a4.7 4.7 0 00-4.694 4.706 4.7 4.7 0 004.694 4.706 4.7 4.7 0 004.694-4.706l-.005-.216a4.7 4.7 0 00-4.689-4.49zM9.578 2C5.428 1.96 2.038 5.298 2 9.458c-.038 4.16 3.29 7.559 7.44 7.597h2.608v-2.822h-2.47c-2.592.031-4.717-2.053-4.748-4.652a4.7 4.7 0 014.64-4.76h.108c2.52 0 4.577 1.992 4.696 4.49l.005.216v6.936c0 2.576-2.093 4.676-4.655 4.706a4.663 4.663 0 01-3.267-1.376l-1.994 2A7.46 7.46 0 009.57 24h.1c4.096-.062 7.386-3.391 7.409-7.497V9.35c-.1-4.09-3.428-7.35-7.501-7.35zm44.929.038c-4.15 0-7.509 3.368-7.509 7.528s3.36 7.528 7.509 7.528h2.57v-2.822h-2.57a4.7 4.7 0 01-4.694-4.706 4.7 4.7 0 014.694-4.706A4.707 4.707 0 0159.16 8.94l.024.22v14.456H62V9.566c-.008-4.152-3.352-7.527-7.493-7.527z"></path></svg>`,Ci=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Groq</title><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></svg>`,wi=`<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Mistral</title><path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path></svg>`,Ti=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 134 24" xmlns="http://www.w3.org/2000/svg"><title>Mistral</title><path d="M2 22.638V1h6.55l3.933 14.76L16.37 1h6.565v21.638H18.87V5.605l-4.302 17.033h-4.214L6.066 5.605v17.033H2zm25.011-17.8V1.002h4.155V4.84h-4.155zm0 17.801V6.964h4.155V22.64h-4.155zm6.707-4.473l4.17-.635c.177.807.536 1.42 1.079 1.838.986.864 3.753.796 4.702.036.588-.404.753-1.367.25-1.89-.206-.196-.67-.378-1.389-.545-3.351-.738-5.475-1.412-6.372-2.022-2.418-1.526-2.465-5.18-.252-6.952 1.76-1.8 7.852-1.78 9.788-.34 1.045.699 1.764 1.732 2.159 3.1l-3.918.723c-.413-1.402-1.417-1.886-2.957-1.89-1.094 0-1.878.154-2.35.458-.591.383-.651 1.179-.06 1.595.374.275 1.668.664 3.88 1.165 2.213.502 3.759 1.117 4.636 1.845 1.993 1.694 1.615 5.13-.503 6.79-2.087 2.01-8.091 2.034-10.416.25-1.247-.865-2.063-2.04-2.447-3.527zm31.88 4.472h-4.154V6.963h3.86v2.229c.66-1.053 1.253-1.747 1.78-2.081 1.374-.857 3.144-.536 4.532.28l-1.286 3.617c-1.877-1.247-3.849-.81-4.384 1.535-.468 1.352-.329 7.76-.347 10.096zm10.67-10.892l-3.77-.679c1.014-3.408 3.08-4.43 6.801-4.457 2.81.037 4.804.362 6.055 2.324.37.674.554 1.912.554 3.713.013 1.729-.178 6.48.155 7.889.133.654.382 1.355.747 2.103H82.7c-.124-.272-.411-1.286-.547-1.712-1.378 1.335-2.97 2.066-4.865 2.067-2.945.058-5.22-1.756-5.219-4.635-.011-1.72.87-3.225 2.418-3.963.764-.37 1.865-.691 3.304-.967 1.942-.364 3.287-.703 4.037-1.018v-.413c0-.797-.197-1.366-.591-1.705-.57-.582-3.147-.744-3.963-.074-.414.29-.75.8-1.006 1.527zm5.56 3.365c-.757.315-4.139.86-4.79 1.358-1.077.707-1.038 2.141-.163 2.967 1.017.987 2.672.733 3.8-.103 1.374-.983 1.117-2.455 1.153-4.221zm7.933 7.527V1h4.155v21.638H89.76zm35.917 0h-4.761l-1.892-4.915h-8.665l-1.789 4.915h-4.643L112.371 1h4.627l8.679 21.638h.001zm-8.058-8.56l-2.987-8.03-2.927 8.03h5.914zm10.004 8.56V1H132v21.638h-4.376zM58.98 6.964v3.307H56.14v6.317l.081 2.236c.434 1.136 1.612.712 2.743.332l.355 3.218c-2.416 1.02-6.87 1.14-7.215-2.346-.096-.537-.123-1.89-.133-3.44v-6.317h-1.908V6.965h1.908V3.85l4.17-2.42v5.535h2.838z"></path></svg>`,Ei=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Mistral</title><path clip-rule="evenodd" d="M3.428 3.4h3.429v3.428h3.429v3.429h-.002 3.431V6.828h3.427V3.4h3.43v13.714H24v3.429H13.714v-3.428h-3.428v-3.429h-3.43v3.428h3.43v3.429H0v-3.429h3.428V3.4zm10.286 13.715h3.428v-3.429h-3.427v3.429z"></path></svg>`,Di=`<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Nvidia</title><path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z" fill="#74B71B" fill-rule="nonzero"></path></svg>`,Oi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 111 24" xmlns="http://www.w3.org/2000/svg"><title>Nvidia</title><path d="M46.495 2.027v19.965h5.656V2.027h-5.656zM2 2v19.992h5.706V6.48l4.452.015a4.088 4.088 0 013.183 1.101c.894.951 1.26 2.483 1.26 5.287V22h5.529V10.949c0-7.883-5.035-8.946-9.972-8.946L2 2zm53.604.027v19.965h9.174c4.882 0 6.482-.81 8.208-2.626a11.156 11.156 0 002.008-7.136c.109-2.423-.53-4.82-1.831-6.869-2.095-2.788-5.114-3.332-9.621-3.332l-7.938-.002zm5.61 4.347h2.432c3.527 0 5.81 1.58 5.81 5.678 0 4.097-2.289 5.679-5.81 5.679h-2.432V6.374zM38.34 2.027L33.62 17.845 29.096 2.027h-6.102l6.46 19.965h8.151l6.51-19.965h-5.774zm39.285 19.965h5.657V2.03h-5.659l.002 19.963zm15.86-19.957l-7.898 19.95h5.578l1.25-3.526h9.346l1.183 3.526H109l-7.958-19.952-7.555.002zm3.673 3.64l3.427 9.346h-6.96l3.533-9.346z"></path></svg>`,ki=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Nvidia</title><path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z"></path></svg>`,Ai=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 138 24" xmlns="http://www.w3.org/2000/svg"><title>opencode</title><path d="M12.429 17.143H5.57v-6.857h6.858v6.857z" fill-opacity=".25"></path><path d="M12.428 6.857H5.571v10.286h6.857V6.857zm3.43 13.715H2.142V3.429h13.714v17.143z" fill-opacity=".75"></path><path d="M29.571 17.143h-6.857v-6.857h6.857v6.857z" fill-opacity=".25"></path><path d="M22.714 17.143h6.858V6.857h-6.858v10.286zM33 20.572H22.714V24h-3.428V3.43H33v17.143z" fill-opacity=".75"></path><path d="M50.143 13.714v3.429H39.857v-3.429h10.286z" fill-opacity=".25"></path><path d="M50.143 13.714H39.857v3.429h10.286v3.429H36.429V3.429h13.714v10.285zm-10.286-3.428h6.857V6.857h-6.857v3.429z" fill-opacity=".75"></path><path d="M63.857 20.571H57V10.286h6.857V20.57z" fill-opacity=".25"></path><path d="M63.857 6.857H57v13.715h-3.429V3.429h10.286v3.428zm3.429 13.715h-3.429V6.857h3.429v13.715z" fill-opacity=".75"></path><path d="M84.428 17.143H74.144v-6.857h10.285v6.857z" fill-opacity=".25"></path><path d="M84.428 6.857H74.144v10.286h10.285v3.429H70.715V3.429H84.43v3.428z"></path><path d="M98.143 17.143h-6.857v-6.857h6.857v6.857z" fill-opacity=".25"></path><path d="M98.143 6.857h-6.857v10.286h6.857V6.857zm3.428 13.715H87.857V3.429h13.714v17.143z"></path><path d="M115.286 17.143h-6.857v-6.857h6.857v6.857z" fill-opacity=".25"></path><path d="M115.286 6.857h-6.857v10.286h6.857V6.857zm3.428 13.714H105V3.43h10.286V0h3.428v20.571z"></path><path d="M135.857 13.714v3.429h-10.286v-3.429h10.286z" fill-opacity=".25"></path><path d="M125.571 6.857v3.429h6.858V6.857h-6.858zm10.286 6.857h-10.286v3.429h10.286v3.429h-13.714V3.429h13.714v10.285z"></path></svg>`,ji=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>opencode</title><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></svg>`,Mi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenRouter</title><path d="M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z"></path></svg>`,Ni=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 143 24" xmlns="http://www.w3.org/2000/svg"><title>OpenRouter</title><path d="M9.623 2c1.46 0 2.763.35 3.91 1.05 1.149.699 2.053 1.7 2.714 3.002.66 1.303.991 2.861.991 4.675 0 1.814-.33 3.372-.991 4.675-.66 1.302-1.565 2.303-2.713 3.003-1.148.7-2.452 1.049-3.91 1.049-1.465 0-2.772-.35-3.92-1.05-1.148-.699-2.052-1.701-2.713-3.007-.66-1.305-.991-2.862-.991-4.67 0-1.814.33-3.372.991-4.675.66-1.302 1.565-2.303 2.713-3.003C6.852 2.35 8.16 2 9.624 2zm0 2.34c-.974 0-1.844.244-2.61.734-.765.489-1.37 1.208-1.813 2.156-.443.949-.664 2.114-.664 3.497s.221 2.548.664 3.497c.444.948 1.048 1.667 1.813 2.156.766.49 1.636.735 2.61.735.97 0 1.838-.245 2.606-.735.768-.489 1.374-1.208 1.817-2.156.443-.949.665-2.114.665-3.497s-.222-2.548-.665-3.497c-.443-.948-1.049-1.667-1.817-2.156-.768-.49-1.637-.735-2.606-.735zm16.32 1.974c1.024 0 1.938.26 2.742.78s1.436 1.269 1.896 2.248c.46.979.69 2.156.69 3.534 0 1.377-.23 2.556-.686 3.538-.457.981-1.085 1.736-1.883 2.264-.799.529-1.71.793-2.734.793-.771 0-1.4-.13-1.887-.39-.488-.26-.869-.564-1.144-.913a6.908 6.908 0 01-.636-.929h-.149V24h-2.47V6.48h2.412v2.065h.207c.143-.265.35-.572.62-.92.27-.349.643-.655 1.123-.917.479-.263 1.112-.394 1.9-.394zm-.528 2.107c-.716 0-1.32.185-1.813.556-.493.37-.866.887-1.12 1.55-.253.665-.38 1.439-.38 2.324 0 .896.13 1.68.389 2.356.259.674.633 1.201 1.123 1.58s1.09.568 1.8.568c.738 0 1.355-.198 1.85-.593.496-.395.872-.933 1.128-1.613.256-.68.384-1.447.384-2.298 0-.84-.125-1.596-.376-2.265-.25-.67-.625-1.197-1.123-1.584-.498-.388-1.12-.581-1.862-.581zm13.387-2.107c.716 0 1.41.119 2.082.356a5.037 5.037 0 011.809 1.12c.534.51.955 1.169 1.263 1.979.309.81.463 1.793.463 2.949v.88l-9.016-.001.002.105c.03.732.178 1.364.445 1.895.3.597.72 1.052 1.26 1.364.539.313 1.17.469 1.89.469.469 0 .895-.068 1.28-.203a2.716 2.716 0 001-.61c.281-.271.496-.606.644-1.004l2.338.423a4.247 4.247 0 01-1.004 1.813c-.482.517-1.084.918-1.808 1.203-.725.284-1.549.427-2.474.427-1.25 0-2.325-.27-3.225-.809-.9-.54-1.594-1.3-2.082-2.281-.487-.982-.73-2.134-.73-3.455 0-1.306.243-2.456.73-3.451.488-.996 1.17-1.773 2.049-2.331.878-.559 1.906-.838 3.084-.838zm.017 2.049c-.694 0-1.298.17-1.813.51-.515.34-.911.782-1.19 1.327a3.778 3.778 0 00-.39 1.303l-.02.236h6.593c0-.653-.132-1.232-.397-1.738a3.022 3.022 0 00-1.11-1.199c-.477-.293-1.034-.44-1.673-.44zm10.29 3.293v7.566H46.64V6.48h2.37v2.074h.158a3.63 3.63 0 011.375-1.626c.625-.41 1.413-.614 2.366-.614.864 0 1.622.18 2.271.543.65.362 1.154.9 1.512 1.614.358.713.537 1.595.537 2.646v8.105h-2.47v-7.806c0-.924-.24-1.647-.718-2.17-.48-.522-1.137-.784-1.974-.784-.573 0-1.081.125-1.524.374a2.65 2.65 0 00-1.05 1.09c-.255.479-.383 1.055-.383 1.73zm17.122-9.424c1.31 0 2.4.227 3.266.68.868.454 1.516 1.08 1.945 1.88.43.799.645 1.72.645 2.766 0 1.04-.216 1.954-.649 2.742-.432.788-1.082 1.4-1.949 1.837a5.1 5.1 0 01-.501.22l3.743 6.865h-2.907l-3.436-6.43h-3.634v6.43h-2.552V2.232h6.029zm-.273 2.199h-3.204v6.155h3.237c.826 0 1.5-.119 2.02-.357s.901-.583 1.144-1.037c.242-.453.363-.998.363-1.634 0-.641-.122-1.197-.367-1.667-.246-.47-.628-.831-1.148-1.083-.52-.252-1.202-.377-2.045-.377zM79.66 6.314c1.19 0 2.227.273 3.114.821.886.548 1.575 1.316 2.065 2.306s.735 2.146.735 3.468c0 1.316-.245 2.466-.735 3.45-.49.985-1.179 1.751-2.065 2.299-.887.547-1.924.82-3.114.82s-2.227-.273-3.113-.82c-.887-.548-1.575-1.314-2.065-2.298-.49-.985-.735-2.135-.735-3.451 0-1.322.245-2.478.735-3.468.49-.99 1.178-1.758 2.065-2.306.886-.548 1.924-.821 3.113-.821zm.008 2.074c-.776 0-1.419.207-1.928.622-.51.415-.887.963-1.132 1.646a6.602 6.602 0 00-.367 2.244c0 .819.122 1.568.367 2.249.245.68.623 1.225 1.132 1.634.51.41 1.152.614 1.928.614.771 0 1.41-.205 1.917-.614.506-.41.882-.954 1.127-1.634.245-.68.367-1.43.367-2.249 0-.813-.122-1.56-.367-2.244-.245-.683-.62-1.231-1.127-1.646-.507-.415-1.146-.622-1.917-.622zm16.164 5.55V6.48h2.477v12.742h-2.428v-2.207h-.132a3.956 3.956 0 01-1.4 1.697c-.641.45-1.438.676-2.391.676-.815 0-1.535-.181-2.16-.544-.625-.362-1.115-.9-1.47-1.613-.355-.714-.533-1.596-.533-2.647V6.48h2.47v7.806c0 .868.24 1.56.718 2.074.48.514 1.102.771 1.867.771.462 0 .924-.116 1.383-.348.46-.232.843-.584 1.148-1.054.306-.47.456-1.067.45-1.792zm8.58-10.511v3.052h2.602v1.992h-2.602v7.01c0 .48.072.841.215 1.082.144.24.33.404.558.49.228.085.478.128.747.128.199 0 .372-.014.52-.041l.348-.067.446 2.05a4.42 4.42 0 01-.612.17c-.264.057-.594.09-.99.095a4.331 4.331 0 01-1.818-.349 3.12 3.12 0 01-1.362-1.128c-.347-.509-.52-1.148-.52-1.916l-.002-7.525h-1.857V6.48h1.857l.001-3.053h2.47zm9.961 2.887c.716 0 1.41.119 2.081.356a5.037 5.037 0 011.81 1.12c.533.51.954 1.169 1.263 1.979.308.81.462 1.793.462 2.949v.88l-9.016-.001.003.105c.03.732.178 1.364.445 1.895.3.597.72 1.052 1.259 1.364.54.313 1.17.469 1.891.469.468 0 .895-.068 1.28-.203a2.716 2.716 0 001-.61c.28-.271.495-.606.644-1.004l2.337.423a4.247 4.247 0 01-1.003 1.813c-.482.517-1.085.918-1.809 1.203-.724.284-1.548.427-2.473.427-1.25 0-2.325-.27-3.226-.809-.9-.54-1.594-1.3-2.08-2.281-.488-.982-.732-2.134-.732-3.455 0-1.306.244-2.456.731-3.451.487-.996 1.17-1.773 2.048-2.331.879-.559 1.907-.838 3.085-.838zm.017 2.049c-.694 0-1.298.17-1.813.51-.515.34-.911.782-1.19 1.327a3.778 3.778 0 00-.39 1.303l-.02.236h6.592c0-.653-.132-1.232-.396-1.738a3.022 3.022 0 00-1.11-1.199c-.477-.293-1.035-.44-1.673-.44zm7.821 10.859V6.48h2.387v2.024h.132a3.092 3.092 0 011.227-1.622 3.485 3.485 0 011.994-.593l.396.01.153.006c.212.011.379.025.5.042v2.372c-.1-.027-.275-.059-.529-.095a5.4 5.4 0 00-.76-.054c-.583 0-1.102.123-1.556.37a2.799 2.799 0 00-1.078 1.02 2.79 2.79 0 00-.397 1.48v7.782h-2.469z"></path></svg>`,Pi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenRouter</title><path d="M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z"></path></svg>`,Fi=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 298.03 47.18" fill="currentColor" role="img" aria-label="OVHcloud">
|
|
9
|
+
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Zt(e,``+r);break;case`className`:Ft(e,`class`,r);break;case`tabIndex`:Ft(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ft(e,n,r);break;case`style`:en(e,r,o);break;case`data`:if(t!==`object`){Ft(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=an(``+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`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=on);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`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=an(``+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`:$(`beforetoggle`,e),$(`toggle`,e),Pt(e,`popover`,r);break;case`xlinkActuate`:It(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:It(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:It(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:It(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Pt(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=nn.get(n)||n,Pt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:en(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`?Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Zt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=on);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Dt.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[mt]||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,``):Pt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`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:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`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:Md(e,t,r,d,n,null)}}Kt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`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:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Jt(e,!!r,n,!0):Jt(e,!!r,t,!1);return;case`textarea`:for(s in $(`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:Md(e,t,s,c,n,null)}Xt(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:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`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:Md(e,t,u,r,n,null)}return;default:if(tn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(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)||Md(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&&Md(e,t,p,m,r,f)}}Gt(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)||Md(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&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Jt(e,!!n,n?[]:``,!1):Jt(e,!!n,t,!0)):Jt(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:Md(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&&Md(e,t,s,a,r,o)}Yt(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:Md(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:Md(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)&&Md(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:Md(e,t,u,p,r,m)}return;default:if(tn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(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||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(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||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){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&&Id(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&&Id(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 Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(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),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[yt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(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 ef(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`:ef(n),bt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(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[yt])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=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(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 cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(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 pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=k.d;k.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=St(e);t!==null&&t.tag===5&&t.type===`form`?ks(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Wt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Wt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Wt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Wt(n.imageSizes)+`"]`)):i+=`[href="`+Wt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Wt(r)+`"][href="`+Wt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Tt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=wt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Tt(c),Pd(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,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=wt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Tt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=wt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Tt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=he.current)?gf(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=Af(n.href),n=wt(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=Af(n.href);var o=wt(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(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.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},mf.set(e,n),o||Nf(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=Pf(n),n=wt(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 Af(e){return`href="`+Wt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(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}),Pd(t,`link`,n),Tt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Wt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Wt(n.href)+`"]`);if(r)return t.instance=r,Tt(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`),Tt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,Tt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),Tt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,Tt(a),a):(r=n,(a=mf.get(o))&&(r=m({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Tt(a),Pd(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,Lf(r,n.precedence,e));return t.instance}function Lf(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 Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,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[yt]||a[pt]||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 Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(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=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Tt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Tt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(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=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.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=Jf.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 Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function $f(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=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(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 ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=di(3,null,null,t),e.current=a,a.stateNode=e,t=ua(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function tp(e){return e?(e=li,e):li}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(pu(n,e,t),Ga(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=ct(t);var n=oi(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=2,up(e,t,n,r)}finally{k.p=a,O.T=i}}function lp(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=8,up(e,t,n,r)}finally{k.p=a,O.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=St(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}nd(a),!(X&6)&&($l=Me()+500,rd(0,!1))}}break;case 31:case 13:s=oi(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=cn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=xt(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 fp=e,null}function mp(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(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case Le:return 32;case Re:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(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=St(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=xt(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,dt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);sn=r,n.target.dispatchEvent(r),sn=null}else return t=St(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=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(pp(r||n)===null)continue;break}var a=St(n);a!==null&&(e.splice(t,3),t-=3,Ds(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.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[mt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){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 Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[M]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.7`)throw Error(i(527,Lp,`19.2.7`));k.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 Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ve=zp.inject(Rp),He=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ys,s=Xs,c=Zs;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=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[M]=t.current,xd(e),new Fp(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=l(d(),1),y=_(),b=Object.create(null);b.open=`0`,b.close=`1`,b.ping=`2`,b.pong=`3`,b.message=`4`,b.upgrade=`5`,b.noop=`6`;var x=Object.create(null);Object.keys(b).forEach(e=>{x[b[e]]=e});var S={type:`error`,data:`parser error`},C=typeof Blob==`function`||typeof Blob<`u`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`,w=typeof ArrayBuffer==`function`,ee=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,T=({type:e,data:t},n,r)=>C&&t instanceof Blob?n?r(t):E(t,r):w&&(t instanceof ArrayBuffer||ee(t))?n?r(t):E(new Blob([t]),r):r(b[e]+(t||``)),E=(e,t)=>{let n=new FileReader;return n.onload=function(){let e=n.result.split(`,`)[1];t(`b`+(e||``))},n.readAsDataURL(e)};function D(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var te;function ne(e,t){if(C&&e.data instanceof Blob)return e.data.arrayBuffer().then(D).then(t);if(w&&(e.data instanceof ArrayBuffer||ee(e.data)))return t(D(e.data));T(e,!1,e=>{te||=new TextEncoder,t(te.encode(e))})}var re=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,ie=typeof Uint8Array>`u`?[]:new Uint8Array(256);for(let e=0;e<64;e++)ie[re.charCodeAt(e)]=e;var ae=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);let l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=ie[e.charCodeAt(r)],o=ie[e.charCodeAt(r+1)],s=ie[e.charCodeAt(r+2)],c=ie[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},oe=typeof ArrayBuffer==`function`,se=(e,t)=>{if(typeof e!=`string`)return{type:`message`,data:k(e,t)};let n=e.charAt(0);return n===`b`?{type:`message`,data:O(e.substring(1),t)}:x[n]?e.length>1?{type:x[n],data:e.substring(1)}:{type:x[n]}:S},O=(e,t)=>oe?k(ae(e),t):{base64:!0,data:e},k=(e,t)=>{switch(t){case`blob`:return e instanceof Blob?e:new Blob([e]);default:return e instanceof ArrayBuffer?e:e.buffer}},ce=``,le=(e,t)=>{let n=e.length,r=Array(n),i=0;e.forEach((e,a)=>{T(e,!1,e=>{r[a]=e,++i===n&&t(r.join(ce))})})},ue=(e,t)=>{let n=e.split(ce),r=[];for(let e=0;e<n.length;e++){let i=se(n[e],t);if(r.push(i),i.type===`error`)break}return r};function A(){return new TransformStream({transform(e,t){ne(e,n=>{let r=n.length,i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);let e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);let e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!=`string`&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}var de;function fe(e){return e.reduce((e,t)=>e+t.length,0)}function pe(e,t){if(e[0].length===t)return e.shift();let n=new Uint8Array(t),r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function me(e,t){de||=new TextDecoder;let n=[],r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(fe(n)<1)break;let e=pe(n,1);a=(e[0]&128)==128,i=e[0]&127,r=i<126?3:i===126?1:2}else if(r===1){if(fe(n)<2)break;let e=pe(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(r===2){if(fe(n)<8)break;let e=pe(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),a=t.getUint32(0);if(a>2**21-1){s.enqueue(S);break}i=a*2**32+t.getUint32(4),r=3}else{if(fe(n)<i)break;let e=pe(n,i);s.enqueue(se(a?e:de.decode(e),t)),r=0}if(i===0||i>e){s.enqueue(S);break}}}})}function he(e){if(e)return ge(e)}function ge(e){for(var t in he.prototype)e[t]=he.prototype[t];return e}he.prototype.on=he.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},he.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},he.prototype.off=he.prototype.removeListener=he.prototype.removeAllListeners=he.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},he.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},he.prototype.emitReserved=he.prototype.emit,he.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},he.prototype.hasListeners=function(e){return!!this.listeners(e).length};var _e=typeof Promise==`function`&&typeof Promise.resolve==`function`?e=>Promise.resolve().then(e):(e,t)=>t(e,0),ve=typeof self<`u`?self:typeof window<`u`?window:Function(`return this`)(),ye=`arraybuffer`;function j(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}var be=ve.setTimeout,xe=ve.clearTimeout;function Se(e,t){t.useNativeTimers?(e.setTimeoutFn=be.bind(ve),e.clearTimeoutFn=xe.bind(ve)):(e.setTimeoutFn=ve.setTimeout.bind(ve),e.clearTimeoutFn=ve.clearTimeout.bind(ve))}var Ce=1.33;function we(e){return typeof e==`string`?Te(e):Math.ceil((e.byteLength||e.size)*Ce)}function Te(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Ee(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function De(e){let t=``;for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+=`&`),t+=encodeURIComponent(n)+`=`+encodeURIComponent(e[n]));return t}function Oe(e){let t={},n=e.split(`&`);for(let e=0,r=n.length;e<r;e++){let r=n[e].split(`=`);t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}var ke=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type=`TransportError`}},Ae=class extends he{constructor(e){super(),this.writable=!1,Se(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved(`error`,new ke(e,t,n)),this}open(){return this.readyState=`opening`,this.doOpen(),this}close(){return(this.readyState===`opening`||this.readyState===`open`)&&(this.doClose(),this.onClose()),this}send(e){this.readyState===`open`&&this.write(e)}onOpen(){this.readyState=`open`,this.writable=!0,super.emitReserved(`open`)}onData(e){let t=se(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved(`packet`,e)}onClose(e){this.readyState=`closed`,super.emitReserved(`close`,e)}pause(e){}createUri(e,t={}){return e+`://`+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(`:`)===-1?e:`[`+e+`]`}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?`:`+this.opts.port:``}_query(e){let t=De(e);return t.length?`?`+t:``}},je=class extends Ae{constructor(){super(...arguments),this._polling=!1}get name(){return`polling`}doOpen(){this._poll()}pause(e){this.readyState=`pausing`;let t=()=>{this.readyState=`paused`,e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once(`pollComplete`,function(){--e||t()})),this.writable||(e++,this.once(`drain`,function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved(`poll`)}onData(e){ue(e,this.socket.binaryType).forEach(e=>{if(this.readyState===`opening`&&e.type===`open`&&this.onOpen(),e.type===`close`)return this.onClose({description:`transport closed by the server`}),!1;this.onPacket(e)}),this.readyState!==`closed`&&(this._polling=!1,this.emitReserved(`pollComplete`),this.readyState===`open`&&this._poll())}doClose(){let e=()=>{this.write([{type:`close`}])};this.readyState===`open`?e():this.once(`open`,e)}write(e){this.writable=!1,le(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved(`drain`)})})}uri(){let e=this.opts.secure?`https`:`http`,t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=Ee()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},Me=!1;try{Me=typeof XMLHttpRequest<`u`&&`withCredentials`in new XMLHttpRequest}catch{}var Ne=Me;function Pe(){}var Fe=class extends je{constructor(e){if(super(e),typeof location<`u`){let t=location.protocol===`https:`,n=location.port;n||=t?`443`:`80`,this.xd=typeof location<`u`&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:`POST`,data:e});n.on(`success`,t),n.on(`error`,(e,t)=>{this.onError(`xhr post error`,e,t)})}doPoll(){let e=this.request();e.on(`data`,this.onData.bind(this)),e.on(`error`,(e,t)=>{this.onError(`xhr poll error`,e,t)}),this.pollXhr=e}},Ie=class e extends he{constructor(e,t,n){super(),this.createRequest=e,Se(this,n),this._opts=n,this._method=n.method||`GET`,this._uri=t,this._data=n.data===void 0?null:n.data,this._create()}_create(){var t;let n=j(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);n.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch{}if(this._method===`POST`)try{r.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch{}try{r.setRequestHeader(`Accept`,`*/*`)}catch{}(t=this._opts.cookieJar)==null||t.addCookies(r),`withCredentials`in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;r.readyState===3&&((e=this._opts.cookieJar)==null||e.parseCookies(r.getResponseHeader(`set-cookie`))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status==`number`?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}typeof document<`u`&&(this._index=e.requestsCount++,e.requests[this._index]=this)}_onError(e){this.emitReserved(`error`,e,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(this._xhr===void 0||this._xhr===null)){if(this._xhr.onreadystatechange=Pe,t)try{this._xhr.abort()}catch{}typeof document<`u`&&delete e.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved(`data`,e),this.emitReserved(`success`),this._cleanup())}abort(){this._cleanup()}};if(Ie.requestsCount=0,Ie.requests={},typeof document<`u`){if(typeof attachEvent==`function`)attachEvent(`onunload`,Le);else if(typeof addEventListener==`function`){let e=`onpagehide`in ve?`pagehide`:`unload`;addEventListener(e,Le,!1)}}function Le(){for(let e in Ie.requests)Ie.requests.hasOwnProperty(e)&&Ie.requests[e].abort()}var Re=(function(){let e=Be({xdomain:!1});return e&&e.responseType!==null})(),ze=class extends Fe{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Re&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Ie(Be,this.uri(),e)}};function Be(e){let t=e.xdomain;try{if(typeof XMLHttpRequest<`u`&&(!t||Ne))return new XMLHttpRequest}catch{}if(!t)try{return new ve[[`Active`,`Object`].join(`X`)](`Microsoft.XMLHTTP`)}catch{}}var Ve=typeof navigator<`u`&&typeof navigator.product==`string`&&navigator.product.toLowerCase()===`reactnative`,He=class extends Ae{get name(){return`websocket`}doOpen(){let e=this.uri(),t=this.opts.protocols,n=Ve?{}:j(this.opts,`agent`,`perMessageDeflate`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`localAddress`,`protocolVersion`,`origin`,`maxPayload`,`family`,`checkServerIdentity`);this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(e){return this.emitReserved(`error`,e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:`websocket connection closed`,context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError(`websocket error`,e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;T(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch{}r&&_e(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){this.ws!==void 0&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?`wss`:`ws`,t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Ee()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Ue=ve.WebSocket||ve.MozWebSocket,We={websocket:class extends He{createSocket(e,t,n){return Ve?new Ue(e,t,n):t?new Ue(e,t):new Ue(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends Ae{get name(){return`webtransport`}doOpen(){try{this._transport=new WebTransport(this.createUri(`https`),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved(`error`,e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError(`webtransport error`,e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=me(2**53-1,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=A();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),i())}).catch(e=>{})};i();let a={type:`open`};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&_e(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)==null||e.close()}},polling:ze},Ge=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ke=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function qe(e){if(e.length>8e3)throw`URI too long`;let t=e,n=e.indexOf(`[`),r=e.indexOf(`]`);n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,`;`)+e.substring(r,e.length));let i=Ge.exec(e||``),a={},o=14;for(;o--;)a[Ke[o]]=i[o]||``;return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,`:`),a.authority=a.authority.replace(`[`,``).replace(`]`,``).replace(/;/g,`:`),a.ipv6uri=!0),a.pathNames=Je(a,a.path),a.queryKey=Ye(a,a.query),a}function Je(e,t){let n=t.replace(/\/{2,9}/g,`/`).split(`/`);return(t.slice(0,1)==`/`||t.length===0)&&n.splice(0,1),t.slice(-1)==`/`&&n.splice(n.length-1,1),n}function Ye(e,t){let n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var Xe=typeof addEventListener==`function`&&typeof removeEventListener==`function`,Ze=[];Xe&&addEventListener(`offline`,()=>{Ze.forEach(e=>e())},!1);var Qe=class e extends he{constructor(e,t){if(super(),this.binaryType=ye,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e==`object`&&(t=e,e=null),e){let n=qe(e);t.hostname=n.host,t.secure=n.protocol===`https`||n.protocol===`wss`,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=qe(t.host).host);Se(this,t),this.secure=t.secure==null?typeof location<`u`&&location.protocol===`https:`:t.secure,t.hostname&&!t.port&&(t.port=this.secure?`443`:`80`),this.hostname=t.hostname||(typeof location<`u`?location.hostname:`localhost`),this.port=t.port||(typeof location<`u`&&location.port?location.port:this.secure?`443`:`80`),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:`/engine.io`,agent:!1,withCredentials:!1,upgrade:!0,timestampParam:`t`,rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,``)+(this.opts.addTrailingSlash?`/`:``),typeof this.opts.query==`string`&&(this.opts.query=Oe(this.opts.query)),Xe&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener(`beforeunload`,this._beforeunloadEventListener,!1)),this.hostname!==`localhost`&&(this._offlineEventListener=()=>{this._onClose(`transport close`,{description:`network connection lost`})},Ze.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}let t=this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;let n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on(`drain`,this._onDrain.bind(this)).on(`packet`,this._onPacket.bind(this)).on(`error`,this._onError.bind(this)).on(`close`,e=>this._onClose(`transport close`,e))}onOpen(){this.readyState=`open`,e.priorWebsocketSuccess=this.transport.name===`websocket`,this.emitReserved(`open`),this.flush()}_onPacket(e){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`)switch(this.emitReserved(`packet`,e),this.emitReserved(`heartbeat`),e.type){case`open`:this.onHandshake(JSON.parse(e.data));break;case`ping`:this._sendPacket(`pong`),this.emitReserved(`ping`),this.emitReserved(`pong`),this._resetPingTimeout();break;case`error`:let t=Error(`server error`);t.code=e.data,this._onError(t);break;case`message`:this.emitReserved(`data`,e.data),this.emitReserved(`message`,e.data);break}}onHandshake(e){this.emitReserved(`handshake`,e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!==`closed`&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose(`ping timeout`)},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved(`drain`):this.flush()}flush(){if(this.readyState!==`closed`&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved(`flush`)}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name===`polling`&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let n=this.writeBuffer[t].data;if(n&&(e+=we(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,_e(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket(`message`,e,t,n),this}send(e,t,n){return this._sendPacket(`message`,e,t,n),this}_sendPacket(e,t,n,r){if(typeof t==`function`&&(r=t,t=void 0),typeof n==`function`&&(r=n,n=null),this.readyState===`closing`||this.readyState===`closed`)return;n||={},n.compress=!1!==n.compress;let i={type:e,data:t,options:n};this.emitReserved(`packetCreate`,i),this.writeBuffer.push(i),r&&this.once(`flush`,r),this.flush()}close(){let e=()=>{this._onClose(`forced close`),this.transport.close()},t=()=>{this.off(`upgrade`,t),this.off(`upgradeError`,t),e()},n=()=>{this.once(`upgrade`,t),this.once(`upgradeError`,t)};return(this.readyState===`opening`||this.readyState===`open`)&&(this.readyState=`closing`,this.writeBuffer.length?this.once(`drain`,()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(t){if(e.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState===`opening`)return this.transports.shift(),this._open();this.emitReserved(`error`,t),this._onClose(`transport error`,t)}_onClose(e,t){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners(`close`),this.transport.close(),this.transport.removeAllListeners(),Xe&&(this._beforeunloadEventListener&&removeEventListener(`beforeunload`,this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=Ze.indexOf(this._offlineEventListener);e!==-1&&Ze.splice(e,1)}this.readyState=`closed`,this.id=null,this.emitReserved(`close`,e,t),this.writeBuffer=[],this._prevBufferLen=0}}};Qe.protocol=4;var $e=class extends Qe{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState===`open`&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;Qe.priorWebsocketSuccess=!1;let r=()=>{n||(t.send([{type:`ping`,data:`probe`}]),t.once(`packet`,e=>{if(!n)if(e.type===`pong`&&e.data===`probe`){if(this.upgrading=!0,this.emitReserved(`upgrading`,t),!t)return;Qe.priorWebsocketSuccess=t.name===`websocket`,this.transport.pause(()=>{n||this.readyState!==`closed`&&(l(),this.setTransport(t),t.send([{type:`upgrade`}]),this.emitReserved(`upgrade`,t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error(`probe error`);e.transport=t.name,this.emitReserved(`upgradeError`,e)}}))};function i(){n||(n=!0,l(),t.close(),t=null)}let a=e=>{let n=Error(`probe error: `+e);n.transport=t.name,i(),this.emitReserved(`upgradeError`,n)};function o(){a(`transport closed`)}function s(){a(`socket closed`)}function c(e){t&&e.name!==t.name&&i()}let l=()=>{t.removeListener(`open`,r),t.removeListener(`error`,a),t.removeListener(`close`,o),this.off(`close`,s),this.off(`upgrading`,c)};t.once(`open`,r),t.once(`error`,a),t.once(`close`,o),this.once(`close`,s),this.once(`upgrading`,c),this._upgrades.indexOf(`webtransport`)!==-1&&e!==`webtransport`?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}},et=class extends $e{constructor(e,t={}){let n=typeof e==`object`?e:t;(!n.transports||n.transports&&typeof n.transports[0]==`string`)&&(n.transports=(n.transports||[`polling`,`websocket`,`webtransport`]).map(e=>We[e]).filter(e=>!!e)),super(e,n)}};et.protocol;function tt(e,t=``,n){let r=e;n||=typeof location<`u`&&location,e??=n.protocol+`//`+n.host,typeof e==`string`&&(e.charAt(0)===`/`&&(e=e.charAt(1)===`/`?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=n===void 0?`https://`+e:n.protocol+`//`+e),r=qe(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port=`80`:/^(http|ws)s$/.test(r.protocol)&&(r.port=`443`)),r.path=r.path||`/`;let i=r.host.indexOf(`:`)===-1?r.host:`[`+r.host+`]`;return r.id=r.protocol+`://`+i+`:`+r.port+t,r.href=r.protocol+`://`+i+(n&&n.port===r.port?``:`:`+r.port),r}var nt=typeof ArrayBuffer==`function`,rt=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,it=Object.prototype.toString,at=typeof Blob==`function`||typeof Blob<`u`&&it.call(Blob)===`[object BlobConstructor]`,ot=typeof File==`function`||typeof File<`u`&&it.call(File)===`[object FileConstructor]`;function st(e){return nt&&(e instanceof ArrayBuffer||rt(e))||at&&e instanceof Blob||ot&&e instanceof File}function ct(e,t){if(!e||typeof e!=`object`)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(ct(e[t]))return!0;return!1}if(st(e))return!0;if(e.toJSON&&typeof e.toJSON==`function`&&arguments.length===1)return ct(e.toJSON(),!0);for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&ct(e[t]))return!0;return!1}function lt(e){let t=[],n=e.data,r=e;return r.data=ut(n,t),r.attachments=t.length,{packet:r,buffers:t}}function ut(e,t){if(!e)return e;if(st(e)){let n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=ut(e[r],t);return n}else if(typeof e==`object`&&!(e instanceof Date)){let n={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ut(e[r],t));return n}return e}function dt(e,t){return e.data=ft(e.data,t),delete e.attachments,e}function ft(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num==`number`&&e.num>=0&&e.num<t.length)return t[e.num];throw Error(`illegal attachments`)}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ft(e[n],t);else if(typeof e==`object`)for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ft(e[n],t));return e}var pt=s({Decoder:()=>gt,Encoder:()=>ht,PacketType:()=>M,isPacketValid:()=>Ct,protocol:()=>5}),mt=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`],M;(function(e){e[e.CONNECT=0]=`CONNECT`,e[e.DISCONNECT=1]=`DISCONNECT`,e[e.EVENT=2]=`EVENT`,e[e.ACK=3]=`ACK`,e[e.CONNECT_ERROR=4]=`CONNECT_ERROR`,e[e.BINARY_EVENT=5]=`BINARY_EVENT`,e[e.BINARY_ACK=6]=`BINARY_ACK`})(M||={});var ht=class{constructor(e){this.replacer=e}encode(e){return(e.type===M.EVENT||e.type===M.ACK)&&ct(e)?this.encodeAsBinary({type:e.type===M.EVENT?M.BINARY_EVENT:M.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=``+e.type;return(e.type===M.BINARY_EVENT||e.type===M.BINARY_ACK)&&(t+=e.attachments+`-`),e.nsp&&e.nsp!==`/`&&(t+=e.nsp+`,`),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=lt(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},gt=class e extends he{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e==`function`?{reviver:e}:e)}add(e){let t;if(typeof e==`string`){if(this.reconstructor)throw Error(`got plaintext data when reconstructing a packet`);t=this.decodeString(e);let n=t.type===M.BINARY_EVENT;n||t.type===M.BINARY_ACK?(t.type=n?M.EVENT:M.ACK,this.reconstructor=new _t(t),t.attachments===0&&super.emitReserved(`decoded`,t)):super.emitReserved(`decoded`,t)}else if(st(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved(`decoded`,t));else throw Error(`got binary data when not reconstructing a packet`);else throw Error(`Unknown type: `+e)}decodeString(t){let n=0,r={type:Number(t.charAt(0))};if(M[r.type]===void 0)throw Error(`unknown packet type `+r.type);if(r.type===M.BINARY_EVENT||r.type===M.BINARY_ACK){let e=n+1;for(;t.charAt(++n)!==`-`&&n!=t.length;);let i=t.substring(e,n);if(i!=Number(i)||t.charAt(n)!==`-`)throw Error(`Illegal attachments`);let a=Number(i);if(!yt(a)||a<0)throw Error(`Illegal attachments`);if(a>this.opts.maxAttachments)throw Error(`too many attachments`);r.attachments=a}if(t.charAt(n+1)===`/`){let e=n+1;for(;++n&&!(t.charAt(n)===`,`||n===t.length););r.nsp=t.substring(e,n)}else r.nsp=`/`;let i=t.charAt(n+1);if(i!==``&&Number(i)==i){let e=n+1;for(;++n;){let e=t.charAt(n);if(e==null||Number(e)!=e){--n;break}if(n===t.length)break}r.id=Number(t.substring(e,n+1))}if(t.charAt(++n)){let i=this.tryParse(t.substr(n));if(e.isPayloadValid(r.type,i))r.data=i;else throw Error(`invalid payload`)}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case M.CONNECT:return xt(t);case M.DISCONNECT:return t===void 0;case M.CONNECT_ERROR:return typeof t==`string`||xt(t);case M.EVENT:case M.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&mt.indexOf(t[0])===-1);case M.ACK:case M.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&=(this.reconstructor.finishedReconstruction(),null)}},_t=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let e=dt(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function vt(e){return typeof e==`string`}var yt=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e};function bt(e){return e===void 0||yt(e)}function xt(e){return Object.prototype.toString.call(e)===`[object Object]`}function St(e,t){switch(e){case M.CONNECT:return t===void 0||xt(t);case M.DISCONNECT:return t===void 0;case M.EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&mt.indexOf(t[0])===-1);case M.ACK:return Array.isArray(t);case M.CONNECT_ERROR:return typeof t==`string`||xt(t);default:return!1}}function Ct(e){return vt(e.nsp)&&bt(e.id)&&St(e.type,e.data)}function wt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var Tt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Et=class extends he{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[wt(e,`open`,this.onopen.bind(this)),wt(e,`packet`,this.onpacket.bind(this)),wt(e,`error`,this.onerror.bind(this)),wt(e,`close`,this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState===`open`&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift(`message`),this.emit.apply(this,e),this}emit(e,...t){if(Tt.hasOwnProperty(e))throw Error(`"`+e.toString()+`" is a reserved event name`);if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let n={type:M.EVENT,data:t};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof t[t.length-1]==`function`){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}let r=this.io.engine?.transport?.writable,i=this.connected&&!this.io.engine?._hasPingExpired();return this.flags.volatile&&!r||(i?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){let n=this.flags.timeout??this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error(`operation has timed out`))},n),i=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]==`function`&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],e===null?(this._queue.shift(),t&&t(null,...r)):n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth==`function`?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:M.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved(`connect_error`,e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved(`disconnect`,e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error(`socket has been disconnected`))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case M.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved(`connect_error`,Error(`It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)`));break;case M.EVENT:case M.BINARY_EVENT:this.onevent(e);break;case M.ACK:case M.BINARY_ACK:this.onack(e);break;case M.DISCONNECT:this.ondisconnect();break;case M.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved(`connect_error`,t);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]==`string`&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,n=!1;return function(...r){n||(n=!0,t.packet({type:M.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];typeof t==`function`&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved(`connect`)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose(`io server disconnect`)}destroy(){this.subs&&=(this.subs.forEach(e=>e()),void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:M.DISCONNECT}),this.destroy(),this.connected&&this.onclose(`io client disconnect`),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};function Dt(e){e||={},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Dt.prototype.duration=function(){var e=this.ms*this.factor**+ this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},Dt.prototype.reset=function(){this.attempts=0},Dt.prototype.setMin=function(e){this.ms=e},Dt.prototype.setMax=function(e){this.max=e},Dt.prototype.setJitter=function(e){this.jitter=e};var Ot=class extends he{constructor(e,t){super(),this.nsps={},this.subs=[],e&&typeof e==`object`&&(t=e,e=void 0),t||={},t.path=t.path||`/socket.io`,this.opts=t,Se(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor??.5),this.backoff=new Dt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState=`closed`,this.uri=e;let n=t.parser||pt;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)==null||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)==null||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)==null||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf(`open`))return this;this.engine=new et(this.uri,this.opts);let t=this.engine,n=this;this._readyState=`opening`,this.skipReconnect=!1;let r=wt(t,`open`,function(){n.onopen(),e&&e()}),i=t=>{this.cleanup(),this._readyState=`closed`,this.emitReserved(`error`,t),e?e(t):this.maybeReconnectOnOpen()},a=wt(t,`error`,i);if(!1!==this._timeout){let e=this._timeout,n=this.setTimeoutFn(()=>{r(),i(Error(`timeout`)),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=`open`,this.emitReserved(`open`);let e=this.engine;this.subs.push(wt(e,`ping`,this.onping.bind(this)),wt(e,`data`,this.ondata.bind(this)),wt(e,`error`,this.onerror.bind(this)),wt(e,`close`,this.onclose.bind(this)),wt(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose(`parse error`,e)}}ondecoded(e){_e(()=>{this.emitReserved(`packet`,e)},this.setTimeoutFn)}onerror(e){this.emitReserved(`error`,e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Et(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let e of t)if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose(`forced close`)}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)==null||n.close(),this.backoff.reset(),this._readyState=`closed`,this.emitReserved(`close`,e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved(`reconnect_failed`),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved(`reconnect_attempt`,e.backoff.attempts),!e.skipReconnect&&e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved(`reconnect_error`,t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(`reconnect`,e)}},kt={};function At(e,t){typeof e==`object`&&(t=e,e=void 0),t||={};let n=tt(e,t.path||`/socket.io`),r=n.source,i=n.id,a=n.path,o=kt[i]&&a in kt[i].nsps,s=t.forceNew||t[`force new connection`]||!1===t.multiplex||o,c;return s?c=new Ot(r,t):(kt[i]||(kt[i]=new Ot(r,t)),c=kt[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(At,{Manager:Ot,Socket:Et,io:At,connect:At});var jt=2e3,Mt=4e3,Nt=1e3;function Pt(e){return e?Array.isArray(e)?{models:e}:Array.isArray(e.models)?e:null:null}function Ft(e,t){return t?`${t.replace(/\/$/,``)}${e}`:e}function It(e=``){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(`connecting`),[s,c]=(0,v.useState)(0),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(0),[h,g]=(0,v.useState)(`speed`),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(0),[S,C]=(0,v.useState)(0),[w,ee]=(0,v.useState)(null),T=(0,v.useRef)(null),E=(0,v.useRef)(null),D=(0,v.useRef)(null),te=(0,v.useRef)(0),ne=(0,v.useRef)(0),re=(0,v.useRef)(!1),ie=(0,v.useCallback)((e,t=`unknown`)=>{let r=Pt(e);!r||!re.current||(n(r.models??[]),g(r.pingMode??`speed`),u(r.nextPingAt??null),f(!!r.isPinging),m(Number.isFinite(r.pendingPings)?r.pendingPings:0),y(!!r.globalBenchmarkRunning),x(Number.isFinite(r.globalBenchmarkTotal)?r.globalBenchmarkTotal:0),C(Number.isFinite(r.globalBenchmarkCompleted)?r.globalBenchmarkCompleted:0),ee(r.updateStatus&&r.updateStatus.allowedOutdated?r.updateStatus:null),c(e=>e+1),te.current=Date.now(),t!==`poll`&&(i(!0),o(t)))},[]),ae=(0,v.useCallback)(async()=>{try{let t=await fetch(Ft(`/api/state`,e),{headers:{Accept:`application/json`}});if(t.ok){ie(await t.json(),`poll`),i(!0),o(e=>e===`socket`||e===`sse`?e:`poll`);return}}catch{}try{let t=await fetch(Ft(`/api/models`,e),{headers:{Accept:`application/json`}});if(!t.ok)throw Error(`HTTP ${t.status}`);ie(await t.json(),`poll`),i(!0),o(e=>e===`socket`||e===`sse`?e:`poll`)}catch{i(!1),o(`offline`)}},[ie,e]),oe=(0,v.useCallback)(()=>{if(!(E.current||!re.current))try{let t=new EventSource(Ft(`/api/events`,e));E.current=t,t.onopen=()=>{re.current&&(i(!0),o(`sse`))};let n=e=>{try{ie(JSON.parse(e.data),`sse`)}catch(e){console.warn(`[useSocket] SSE parse error:`,e)}};t.onmessage=n,t.addEventListener(`models`,n),t.onerror=()=>{t.close(),E.current===t&&(E.current=null),T.current?.connected||i(!1)}}catch{E.current=null}},[ie,e]),se=(0,v.useCallback)(()=>{let t=Date.now();if(!(t-ne.current<Nt)){if(ne.current=t,T.current?.connected){T.current.emit(`client:activity`);return}fetch(Ft(`/api/activity`,e),{method:`POST`}).catch(()=>{})}},[e]);return(0,v.useEffect)(()=>{re.current=!0;let t=At(e||void 0,{transports:[`websocket`,`polling`],reconnectionDelay:500,reconnectionDelayMax:2500,timeout:1200});T.current=t,t.on(`connect`,()=>{i(!0),o(`socket`),E.current?.close(),E.current=null,t.emit(`models:refresh`),t.emit(`client:activity`)}),t.on(`disconnect`,()=>{re.current&&(i(!1),oe())}),t.on(`connect_error`,()=>{re.current&&(i(!1),oe())}),t.on(`models:update`,e=>ie(e,`socket`)),D.current=setInterval(()=>{let e=Date.now()-te.current>Mt;(!t.connected||e)&&ae()},jt),ae();let n=[`keydown`,`pointerdown`,`mousemove`,`focus`];for(let e of n)window.addEventListener(e,se,{passive:!0});return()=>{re.current=!1;for(let e of n)window.removeEventListener(e,se);D.current&&clearInterval(D.current),t.disconnect(),E.current?.close(),T.current=null,E.current=null}},[ie,ae,se,e,oe]),{models:t,connected:r,transport:a,updateCount:s,nextPingAt:l,isPinging:d,pendingPings:p,pingMode:h,globalBenchmarkRunning:_,globalBenchmarkTotal:b,globalBenchmarkCompleted:S,updateStatus:w}}var Lt={"S+":0,S:1,"A+":2,A:3,"A-":4,"B+":5,B:6,C:7},Rt={Perfect:0,Normal:1,Slow:2,Spiky:3,"Very Slow":4,Overloaded:5,Unstable:6,"Not Active":7,Pending:8};function zt(e){return Lt[e]??99}function Bt(e){return Rt[e]??99}function Vt(e){return!e||e===`—`?0:parseFloat(e.replace(`%`,``))||0}function Ht(e){let t=Vt(e);return t>=65?`sweHigh`:t>=40?`sweMid`:`sweLow`}function Ut(e){return e==null||e===1/0||e>99e3?{text:`—`,cls:`pingNone`}:{text:`${e}ms`,cls:Wt(e)}}function Wt(e){return e==null||e===1/0?`pingNone`:e<500?`pingFast`:e<1500?`pingMedium`:`pingSlow`}function Gt(e){if(!e||e===`—`)return 0;let t=e.toLowerCase();return t.includes(`m`)?parseFloat(t)*1e3:t.includes(`k`)?parseFloat(t):0}function Kt(e){return!e||e.length<8?`••••••••`:`••••••••`+e.slice(-4)}var qt=[`all`,`S+`,`S`,`A+`,`A`,`A-`,`B+`,`B`,`C`],Jt=[`all`,`up`,`down`,`pending`],Yt=[`all`,`Perfect`,`Normal`,`Spiky`,`Slow`,`Overloaded`,`Down`,`Unstable`,`Pending`],Xt=[`all`,`up`,`timeout`,`down`,`pending`,`noauth`,`auth_error`],Zt=[`normal`,`configured`,`usable`];function Qt(e){return e.idx??9999}function $t(e){return e.pingHistory||e.pings||[]}function en(e){let t=$t(e);return(t.length>0?t[t.length-1]:null)?.ms??null}function tn(e){let t=$t(e).map(e=>e?.ms).filter(e=>typeof e==`number`&&Number.isFinite(e));return t.length<2?null:t[t.length-1]-t[0]}function nn(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function rn(e,t,n){let r=e==null,i=t==null;return r&&i?0:r?1:i?-1:(e-t)*n}function an(e,t,n){let r=typeof e==`string`?e:``,i=typeof t==`string`?t:``,a=r.length===0,o=i.length===0;return a&&o?0:a?1:o?-1:r.localeCompare(i)*n}var on={up:0,pending:1,timeout:2,down:3,noauth:4,auth_error:5};function sn(e){let[t,n]=(0,v.useState)(`all`),[r,i]=(0,v.useState)(`all`),[a,o]=(0,v.useState)(`all`),[s,c]=(0,v.useState)(`all`),[l,u]=(0,v.useState)(`all`),[d,f]=(0,v.useState)(`normal`),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(`avg`),[b,x]=(0,v.useState)(`asc`),S=(0,v.useCallback)((e,t,n)=>{n(t[(t.indexOf(e)+1)%t.length])},[]),C=(0,v.useCallback)(()=>S(t,qt,n),[t,S]),w=(0,v.useCallback)(()=>S(r,Jt,i),[r,S]),ee=(0,v.useCallback)(()=>S(s,Yt,c),[s,S]),T=(0,v.useCallback)(()=>S(l,Xt,u),[l,S]),E=(0,v.useCallback)(()=>S(d,Zt,f),[d,S]),D=(0,v.useCallback)(e=>{if(_!==e){y(e),x(`asc`);return}if(b===`asc`){x(`desc`);return}y(null),x(`asc`)},[_,b]),te=(0,v.useCallback)(()=>{n(`all`),i(`all`),o(`all`),c(`all`),u(`all`),f(`normal`),m(``),g(null),y(`avg`),x(`asc`)},[]);return{filtered:(0,v.useMemo)(()=>{let n=[...e];t!==`all`&&(n=n.filter(e=>e.tier===t)),r!==`all`&&(n=n.filter(e=>r===`up`?e.status===`up`:r===`down`?e.status===`down`||e.status===`timeout`:r===`pending`?e.status===`pending`:!0)),a!==`all`&&(n=n.filter(e=>e.providerKey===a)),s!==`all`&&(n=n.filter(e=>e.verdict===s)),l!==`all`&&(n=n.filter(e=>e.status===l)),d===`configured`?n=n.filter(e=>e.hasApiKey&&e.status!==`noauth`&&e.status!==`auth_error`):d===`usable`&&(n=n.filter(e=>e.status===`up`?[`Perfect`,`Normal`,`Slow`].includes(e.verdict):!1));let i=p.trim().toLowerCase(),o=(h||``).trim().toLowerCase();return i&&(n=n.filter(e=>e.label.toLowerCase().includes(i)||e.modelId.toLowerCase().includes(i)||e.origin.toLowerCase().includes(i)||e.tier.toLowerCase().includes(i)||(e.verdict||``).toLowerCase().includes(i))),o&&(n=n.filter(e=>e.label.toLowerCase().includes(o)||e.modelId.toLowerCase().includes(o)||e.origin.toLowerCase().includes(o)||(e.ctx||``).toLowerCase().includes(o)||(e.providerKey||``).toLowerCase().includes(o))),n.sort((e,t)=>{if(!_)return Qt(e)-Qt(t);let n=b===`desc`?-1:1,r=0;return _===`mood`?r=rn(Bt(e.verdict),Bt(t.verdict),n):_===`idx`?r=rn(Qt(e),Qt(t),n):_===`tier`?r=rn(zt(e.tier),zt(t.tier),n):_===`label`?r=an(e.label,t.label,n):_===`origin`?r=an(e.origin,t.origin,n):_===`sweScore`?r=rn(Vt(e.sweScore),Vt(t.sweScore),n):_===`ctx`?r=rn(Gt(e.ctx),Gt(t.ctx),n):_===`latestPing`?r=rn(en(e),en(t),n):_===`avg`?r=rn(e.avg==null||e.avg===1/0||e.avg>99e3?null:e.avg,t.avg==null||t.avg===1/0||t.avg>99e3?null:t.avg,n):_===`condition`?r=rn(on[e.status]??9,on[t.status]??9,n):_===`verdict`?r=rn(Bt(e.verdict),Bt(t.verdict),n):_===`stability`?r=rn(nn(e.stability),nn(t.stability),n):_===`uptime`?r=rn(nn(e.uptime),nn(t.uptime),n):_===`aiLatency`?r=rn(e.benchmark?.ok?e.benchmark.totalMs:null,t.benchmark?.ok?t.benchmark.totalMs:null,n):_===`tps`?r=rn(e.benchmark?.ok?e.benchmark.tokensPerSecond??0:null,t.benchmark?.ok?t.benchmark.tokensPerSecond??0:null,n):_===`trend`&&(r=rn(tn(e),tn(t),n)),r||Qt(e)-Qt(t)}),n},[e,t,r,a,s,l,d,p,h,_,b]),filterTier:t,setFilterTier:n,cycleTier:C,filterStatus:r,setFilterStatus:i,cycleStatus:w,filterProvider:a,setFilterProvider:o,filterVerdict:s,setFilterVerdict:c,cycleVerdict:ee,filterHealth:l,setFilterHealth:u,cycleHealth:T,visibilityMode:d,setVisibilityMode:f,cycleVisibility:E,searchQuery:p,setSearchQuery:m,customTextFilter:h,setCustomTextFilter:g,sortColumn:_,sortDirection:b,toggleSort:D,resetView:te}}var cn=[`auto`,`dark`,`light`];function ln(){if(typeof window>`u`||typeof window.matchMedia!=`function`)return`dark`;try{return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}function un(){if(typeof document>`u`)return`auto`;let e=document.documentElement.getAttribute(`data-theme`);return e===`auto`||e===`dark`||e===`light`?e:`auto`}function dn(){let[e,t]=(0,v.useState)(un),[n,r]=(0,v.useState)(ln);(0,v.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>r(e.matches?`dark`:`light`);if(typeof e.addEventListener==`function`)return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t);if(typeof e.addListener==`function`)return e.addListener(t),()=>e.removeListener(t)},[]),(0,v.useEffect)(()=>{let t=e===`auto`?n:e;document.documentElement.setAttribute(`data-theme`,t),document.documentElement.setAttribute(`data-theme-preference`,e)},[e,n]);let i=(0,v.useCallback)(()=>{t(e=>cn[(cn.indexOf(e)+1)%cn.length])},[]),a=(0,v.useCallback)(e=>{cn.includes(e)&&t(e)},[]);return{theme:e,resolvedTheme:e===`auto`?n:e,setTheme:a,cycle:i}}var fn=Object.freeze([]);function pn({models:e}={}){let[t,n]=(0,v.useState)(fn),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!0),[s,c]=(0,v.useState)(null),l=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/favorites`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();n(Array.isArray(t.favorites)?t.favorites:[]),i(!!t.pinnedAndSticky),c(null)}catch(e){c(e.message||`Failed to load favorites`),n(fn),i(!1)}finally{o(!1)}},[]);(0,v.useEffect)(()=>{l()},[l]);let u=(0,v.useMemo)(()=>{let e=new Map;return t.forEach((t,n)=>e.set(t,n)),e},[t]),d=(0,v.useCallback)(e=>{if(!e)return!1;let t=`${e.providerKey}/${e.modelId}`;return u.has(t)},[u]),f=(0,v.useCallback)(e=>{if(!e)return 2**53-1;let t=`${e.providerKey}/${e.modelId}`,n=u.get(t);return n===void 0?2**53-1:n},[u]),p=(0,v.useCallback)(e=>e?`${e.providerKey}/${e.modelId}`:null,[]),m=(0,v.useCallback)(async e=>{try{let t=await fetch(`/api/favorites`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({favorites:e})});if(!t.ok)throw Error(`HTTP ${t.status}`);n(e)}catch(e){c(e.message||`Failed to save favorites`)}},[]);return{favorites:t,pinnedAndSticky:r,isFavorite:d,favoriteRank:f,toggle:(0,v.useCallback)(async e=>{let n=p(e);n&&await m(u.has(n)?t.filter(e=>e!==n):[...t,n])},[t,u,p,m]),reorder:(0,v.useCallback)(async(e,n)=>{let r=p(e);if(!r)return;let i=t.indexOf(r);if(i<0)return;let a=n===`up`?i-1:i+1;if(a<0||a>=t.length)return;let o=[...t];[o[i],o[a]]=[o[a],o[i]],await m(o)},[t,p,m]),setPinnedAndSticky:(0,v.useCallback)(async e=>{i(!!e);try{await fetch(`/api/favorites`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pinnedAndSticky:!!e})})}catch(e){c(e.message||`Failed to save display mode`)}},[]),refresh:l,loading:a,error:s}}var mn=[`opencode`,`opencode-desktop`,`opencode-web`,`openclaw`,`crush`,`goose`,`pi`,`aider`,`qwen`,`openhands`,`amp`,`forgecode`,`fcm_router`,`zcode`],hn=`opencode`;function gn(e){return mn.includes(e)?e:hn}function _n({onToast:e}={}){let[t,n]=(0,v.useState)(hn),r=(0,v.useRef)(!1);(0,v.useEffect)(()=>{let t=!1;async function i(){try{let e=await fetch(`/api/tool-mode`),i=await e.json().catch(()=>({}));!t&&!r.current&&e.ok&&n(gn(i.mode))}catch(n){t||e?.(`Tool mode load failed: ${n.message}`,`error`)}}return i(),()=>{t=!0}},[e]);let i=(0,v.useCallback)(async t=>{let i=gn(t);r.current=!0,n(i);try{let e=await fetch(`/api/tool-mode`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({mode:i})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||`HTTP ${e.status}`);return n(gn(t.mode)),{ok:!0,mode:gn(t.mode)}}catch(t){return e?.(`Tool mode save failed: ${t.message}`,`error`),{ok:!1,error:t.message,mode:i}}},[e]),a=(0,v.useCallback)(()=>i(mn[(TOOL_MODE_ORDER.indexOf(t)+1)%mn.length]||hn),[i,t]);return{toolMode:t,tools:(0,v.useMemo)(()=>[...mn],[]),setToolMode:i,cycleToolMode:a}}var vn={opencode:{label:`OpenCode CLI`,emoji:`📦`,flag:`--opencode`,color:[110,214,255]},"opencode-desktop":{label:`OpenCode Desktop`,emoji:`📦`,flag:`--opencode-desktop`,color:[149,205,255]},"opencode-web":{label:`OpenCode Web`,emoji:`📦`,flag:`--opencode-web`,color:[180,220,255]},openclaw:{label:`OpenClaw`,emoji:`🦞`,flag:`--openclaw`,color:[255,129,129]},crush:{label:`Crush`,emoji:`💘`,flag:`--crush`,color:[255,168,209]},goose:{label:`Goose`,emoji:`🪿`,flag:`--goose`,color:[132,235,168]},pi:{label:`Pi`,emoji:`π`,flag:`--pi`,color:[173,216,230]},aider:{label:`Aider`,emoji:`🛠`,flag:`--aider`,color:[255,208,102]},kilo:{label:`Kilo CLI`,emoji:`⚡️`,flag:`--kilo`,color:[255,107,107]},qwen:{label:`Qwen Code`,emoji:`🐉`,flag:`--qwen`,color:[255,213,128]},openhands:{label:`OpenHands`,emoji:`🤲`,flag:`--openhands`,color:[228,191,239]},amp:{label:`Amp`,emoji:`⚡`,flag:`--amp`,color:[255,232,98]},hermes:{label:`Hermes`,emoji:`🔮`,flag:`--hermes`,color:[200,160,255]},continue:{label:`Continue CLI`,emoji:`▶️`,flag:`--continue`,color:[255,100,100]},cline:{label:`Cline`,emoji:`🧠`,flag:`--cline`,color:[100,220,180]},caveman:{label:`Caveman Code`,emoji:`🪨`,flag:`--caveman`,color:[180,130,80]},jcode:{label:`jcode`,emoji:`🪼`,flag:`--jcode`,color:[255,140,0]},xcode:{label:`Xcode Intelligence`,emoji:`🛠️`,flag:`--xcode`,color:[20,126,251]},fcm_router:{label:`FCM Router`,emoji:`🧭`,flag:`--fcm-router`,color:[80,200,120]},copilot:{label:`Copilot CLI`,emoji:`🤖`,flag:`--copilot`,color:[200,220,255]},forgecode:{label:`ForgeCode`,emoji:`🔥`,flag:`--forgecode`,color:[255,120,50]},zcode:{label:`ZCode`,emoji:`🧊`,flag:`--zcode`,color:[60,160,230]}},yn=[`opencode`,`pi`,`jcode`,`opencode-desktop`,`opencode-web`,`openclaw`,`crush`,`goose`,`aider`,`kilo`,`qwen`,`openhands`,`amp`,`hermes`,`continue`,`cline`,`xcode`,`fcm_router`,`caveman`,`copilot`,`forgecode`,`zcode`];function bn(e){return vn[e]||{label:e,emoji:`•`,flag:null}}var xn=Object.keys(vn).filter(e=>!vn[e].cliOnly);function Sn(e){return xn}function Cn(e,t){return Sn(e).includes(t)}function wn(e,t,n,r=3){let i=parseFloat(e)||0;return n.filter(e=>!e.hidden&&Cn(e.providerKey,t)).map(e=>({modelId:e.modelId,label:e.label,tier:e.tier,sweScore:e.sweScore||`-`,providerKey:e.providerKey,sweDelta:Math.abs((parseFloat(e.sweScore)||0)-i)})).sort((e,t)=>e.sweDelta-t.sweDelta).slice(0,r)}var Tn=new Set([`S+`,`S`,`A+`,`A`,`A-`,`B+`,`B`,`C`,`all`]),En=new Set([`up`,`down`,`pending`,`all`]),Dn=new Set([`mood`,`idx`,`tier`,`sweScore`,`ctx`,`label`,`origin`,`latestPing`,`avg`,`condition`,`verdict`,`stability`,`uptime`,`aiLatency`,`tps`,`trend`]),On=new Set([`dashboard`,`settings`,`analytics`,`recommend`,`router`,`help`,`changelog`,`playground`,`install-endpoints`,`installed-models`]),kn=new Set([`asc`,`desc`]),An=new Set(yn);function jn(){if(typeof window>`u`)return null;let e=new URLSearchParams(window.location.search),t={},n=window.location.pathname.replace(/^\/|\/$/g,``);return n&&On.has(n)?t.view=n:e.has(`view`)&&On.has(e.get(`view`))?t.view=e.get(`view`):t.view=`dashboard`,e.has(`tier`)&&Tn.has(e.get(`tier`))&&(t.tier=e.get(`tier`)),e.has(`status`)&&En.has(e.get(`status`))&&(t.status=e.get(`status`)),e.has(`provider`)&&(t.provider=e.get(`provider`)),e.has(`verdict`)&&(t.verdict=e.get(`verdict`)),e.has(`health`)&&(t.health=e.get(`health`)),e.has(`sort`)&&Dn.has(e.get(`sort`))&&(t.sort=e.get(`sort`)),e.has(`dir`)&&kn.has(e.get(`dir`))&&(t.dir=e.get(`dir`)),e.has(`q`)&&(t.q=e.get(`q`)),e.has(`toolMode`)&&An.has(e.get(`toolMode`))&&(t.toolMode=e.get(`toolMode`)),e.has(`recommend`)&&[`1`,`true`,`open`].includes(e.get(`recommend`))&&(t.view=`recommend`),e.has(`palette`)&&e.get(`palette`)===`open`&&(t.palette=`open`),t}function Mn(e){let t=new URLSearchParams;return e?(e.currentView&&e.currentView!==`dashboard`&&t.set(`view`,e.currentView),e.filterTier&&e.filterTier!==`all`&&t.set(`tier`,e.filterTier),e.filterStatus&&e.filterStatus!==`all`&&t.set(`status`,e.filterStatus),e.filterProvider&&e.filterProvider!==`all`&&t.set(`provider`,e.filterProvider),e.filterVerdict&&e.filterVerdict!==`all`&&t.set(`verdict`,e.filterVerdict),e.filterHealth&&e.filterHealth!==`all`&&t.set(`health`,e.filterHealth),e.sortColumn&&(t.set(`sort`,e.sortColumn),e.sortDirection&&t.set(`dir`,e.sortDirection)),e.searchQuery&&t.set(`q`,e.searchQuery),e.toolMode&&t.set(`toolMode`,e.toolMode),e.paletteOpen&&t.set(`palette`,`open`),t):t}function Nn(e){if(typeof window>`u`)return;let t=Mn(e),n=t.get(`view`)||`dashboard`;t.delete(`view`);let r=t.toString(),i=n===`dashboard`?`/`:`/${n}`,a=r?`${i}?${r}${window.location.hash}`:`${i}${window.location.hash}`;window.history.replaceState({},``,a)}function Pn({currentView:e,setCurrentView:t,filterState:n=null,paletteOpen:r=!1,setPaletteOpen:i=()=>{},toolMode:a=null,setToolMode:o=()=>{}}){let s=(0,v.useRef)(null),c=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(c.current)return;c.current=!0;let r=jn();r&&(r.view&&t&&r.view!==e&&t(r.view),r.tier&&n?.setFilterTier&&n.setFilterTier(r.tier),r.status&&n?.setFilterStatus&&n.setFilterStatus(r.status),r.provider&&n?.setFilterProvider&&n.setFilterProvider(r.provider),r.verdict&&n?.setFilterVerdict&&n.setFilterVerdict(r.verdict),r.health&&n?.setFilterHealth&&n.setFilterHealth(r.health),r.sort&&n?.toggleSort&&(n.setSortColumn&&n.setSortColumn(r.sort),r.dir&&n.setSortDirection&&n.setSortDirection(r.dir)),r.q!==void 0&&n?.setSearchQuery&&n.setSearchQuery(r.q),r.toolMode&&o&&o(r.toolMode),r.palette===`open`&&i&&i(!0))},[]),(0,v.useEffect)(()=>{if(c.current)return s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{Nn({currentView:e,filterTier:n?.filterTier,filterStatus:n?.filterStatus,filterProvider:n?.filterProvider,filterVerdict:n?.filterVerdict,filterHealth:n?.filterHealth,sortColumn:n?.sortColumn,sortDirection:n?.sortDirection,searchQuery:n?.searchQuery,toolMode:a,paletteOpen:r})},80),()=>{s.current&&clearTimeout(s.current)}},[e,r,a,n?.filterTier,n?.filterStatus,n?.filterProvider,n?.filterVerdict,n?.filterHealth,n?.sortColumn,n?.sortDirection,n?.searchQuery])}var Fn=5*6e4;function In(e,t){if(!e||!t)return 0;let n=e.replace(/^v/,``).split(`.`).map(Number),r=t.replace(/^v/,``).split(`.`).map(Number);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e]||0,i=r[e]||0;if(i!==t)return i-t}return 0}function Ln({onToast:e}={}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),d=(0,v.useRef)(null),f=(0,v.useCallback)(async()=>{u(!0);try{let e=await fetch(`/api/version`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();n(t.local??null),i(t.latest??null),o(t.lastReleaseDate??null),c(t.error??null)}catch(e){c(e.message||`update check failed`)}finally{u(!1)}},[]);(0,v.useEffect)(()=>(f(),d.current=setInterval(f,Fn),()=>{d.current&&clearInterval(d.current)}),[f]);let p=!!(r&&t&&In(r,t)>0);return{localVersion:t,latestVersion:r,lastReleaseDate:a,updateAvailable:p,checkNow:f,runUpdate:(0,v.useCallback)(async()=>{if(!p){e?.(`No update available.`,`info`);return}try{let t=await fetch(`/api/update/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({version:r})}),n=await t.json().catch(()=>({}));t.ok&&n?.started?e?.(`Update to v${r} started — restart the dashboard to apply.`,`success`):e?.(n?.error||n?.message||`Update failed`,`error`)}catch(t){e?.(t.message||`Update request failed`,`error`)}},[p,r,e]),loading:l,error:s}}var Rn={outline:{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`},filled:{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`currentColor`,stroke:`none`}},N=(e,t,n,r)=>{let i=(0,v.forwardRef)(({color:n=`currentColor`,size:i=24,stroke:a=2,title:o,className:s,children:c,...l},u)=>(0,v.createElement)(`svg`,{ref:u,...Rn[e],width:i,height:i,className:[`tabler-icon`,`tabler-icon-${t}`,s].join(` `),...e===`filled`?{fill:n}:{strokeWidth:a,stroke:n},...l},[o&&(0,v.createElement)(`title`,{key:`svg-title`},o),...r.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(c)?c:[c]]));return i.displayName=`${n}`,i},zn=N(`outline`,`activity`,`Activity`,[[`path`,{d:`M3 12h4l3 8l4 -16l3 8h4`,key:`svg-0`}]]),Bn=N(`outline`,`alert-octagon`,`AlertOctagon`,[[`path`,{d:`M12.802 2.165l5.575 2.389c.48 .206 .863 .589 1.07 1.07l2.388 5.574c.22 .512 .22 1.092 0 1.604l-2.389 5.575c-.206 .48 -.589 .863 -1.07 1.07l-5.574 2.388c-.512 .22 -1.092 .22 -1.604 0l-5.575 -2.389a2.036 2.036 0 0 1 -1.07 -1.07l-2.388 -5.574a2.036 2.036 0 0 1 0 -1.604l2.389 -5.575c.206 -.48 .589 -.863 1.07 -1.07l5.574 -2.388a2.036 2.036 0 0 1 1.604 0`,key:`svg-0`}],[`path`,{d:`M12 8v4`,key:`svg-1`}],[`path`,{d:`M12 16h.01`,key:`svg-2`}]]),Vn=N(`outline`,`alert-triangle`,`AlertTriangle`,[[`path`,{d:`M12 9v4`,key:`svg-0`}],[`path`,{d:`M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0`,key:`svg-1`}],[`path`,{d:`M12 16h.01`,key:`svg-2`}]]),Hn=N(`outline`,`arrow-down`,`ArrowDown`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 13l-6 6`,key:`svg-1`}],[`path`,{d:`M6 13l6 6`,key:`svg-2`}]]),Un=N(`outline`,`arrow-left`,`ArrowLeft`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}],[`path`,{d:`M5 12l6 6`,key:`svg-1`}],[`path`,{d:`M5 12l6 -6`,key:`svg-2`}]]),Wn=N(`outline`,`arrow-right`,`ArrowRight`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}],[`path`,{d:`M13 18l6 -6`,key:`svg-1`}],[`path`,{d:`M13 6l6 6`,key:`svg-2`}]]),Gn=N(`outline`,`arrow-up`,`ArrowUp`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 11l-6 -6`,key:`svg-1`}],[`path`,{d:`M6 11l6 -6`,key:`svg-2`}]]),Kn=N(`outline`,`ban`,`Ban`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M5.7 5.7l12.6 12.6`,key:`svg-1`}]]),qn=N(`outline`,`bolt`,`Bolt`,[[`path`,{d:`M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11`,key:`svg-0`}]]),Jn=N(`outline`,`braces`,`Braces`,[[`path`,{d:`M7 4a2 2 0 0 0 -2 2v3a2 3 0 0 1 -2 3a2 3 0 0 1 2 3v3a2 2 0 0 0 2 2`,key:`svg-0`}],[`path`,{d:`M17 4a2 2 0 0 1 2 2v3a2 3 0 0 0 2 3a2 3 0 0 0 -2 3v3a2 2 0 0 1 -2 2`,key:`svg-1`}]]),Yn=N(`outline`,`check`,`Check`,[[`path`,{d:`M5 12l5 5l10 -10`,key:`svg-0`}]]),Xn=N(`outline`,`checks`,`Checks`,[[`path`,{d:`M7 12l5 5l10 -10`,key:`svg-0`}],[`path`,{d:`M2 12l5 5m5 -5l5 -5`,key:`svg-1`}]]),Zn=N(`outline`,`chevron-down`,`ChevronDown`,[[`path`,{d:`M6 9l6 6l6 -6`,key:`svg-0`}]]),Qn=N(`outline`,`chevron-left`,`ChevronLeft`,[[`path`,{d:`M15 6l-6 6l6 6`,key:`svg-0`}]]),$n=N(`outline`,`chevron-right`,`ChevronRight`,[[`path`,{d:`M9 6l6 6l-6 6`,key:`svg-0`}]]),er=N(`outline`,`chevron-up`,`ChevronUp`,[[`path`,{d:`M6 15l6 -6l6 6`,key:`svg-0`}]]),tr=N(`outline`,`circle-check`,`CircleCheck`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M9 12l2 2l4 -4`,key:`svg-1`}]]),nr=N(`outline`,`circle-dotted`,`CircleDotted`,[[`path`,{d:`M7.5 4.21l0 .01`,key:`svg-0`}],[`path`,{d:`M4.21 7.5l0 .01`,key:`svg-1`}],[`path`,{d:`M3 12l0 .01`,key:`svg-2`}],[`path`,{d:`M4.21 16.5l0 .01`,key:`svg-3`}],[`path`,{d:`M7.5 19.79l0 .01`,key:`svg-4`}],[`path`,{d:`M12 21l0 .01`,key:`svg-5`}],[`path`,{d:`M16.5 19.79l0 .01`,key:`svg-6`}],[`path`,{d:`M19.79 16.5l0 .01`,key:`svg-7`}],[`path`,{d:`M21 12l0 .01`,key:`svg-8`}],[`path`,{d:`M19.79 7.5l0 .01`,key:`svg-9`}],[`path`,{d:`M16.5 4.21l0 .01`,key:`svg-10`}],[`path`,{d:`M12 3l0 .01`,key:`svg-11`}]]),rr=N(`outline`,`clipboard`,`Clipboard`,[[`path`,{d:`M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2`,key:`svg-0`}],[`path`,{d:`M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2`,key:`svg-1`}]]),ir=N(`outline`,`clock`,`Clock`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0`,key:`svg-0`}],[`path`,{d:`M12 7v5l3 3`,key:`svg-1`}]]),ar=N(`outline`,`cloud-off`,`CloudOff`,[[`path`,{d:`M9.58 5.548c.24 -.11 .492 -.207 .752 -.286c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 .957 -.383 1.824 -1.003 2.454m-2.997 1.033h-11.343c-2.572 -.004 -4.657 -2.011 -4.657 -4.487c0 -2.475 2.085 -4.482 4.657 -4.482c.13 -.582 .37 -1.128 .7 -1.62`,key:`svg-0`}],[`path`,{d:`M3 3l18 18`,key:`svg-1`}]]),or=N(`outline`,`command`,`Command`,[[`path`,{d:`M7 9a2 2 0 1 1 2 -2v10a2 2 0 1 1 -2 -2h10a2 2 0 1 1 -2 2v-10a2 2 0 1 1 2 2h-10`,key:`svg-0`}]]),sr=N(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),cr=N(`outline`,`dots`,`Dots`,[[`path`,{d:`M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}]]),lr=N(`outline`,`download`,`Download`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 11l5 5l5 -5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),ur=N(`outline`,`error-404`,`Error404`,[[`path`,{d:`M3 8v3a1 1 0 0 0 1 1h3`,key:`svg-0`}],[`path`,{d:`M7 8v8`,key:`svg-1`}],[`path`,{d:`M17 8v3a1 1 0 0 0 1 1h3`,key:`svg-2`}],[`path`,{d:`M21 8v8`,key:`svg-3`}],[`path`,{d:`M10 10v4a2 2 0 1 0 4 0v-4a2 2 0 1 0 -4 0`,key:`svg-4`}]]),dr=N(`outline`,`external-link`,`ExternalLink`,[[`path`,{d:`M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6`,key:`svg-0`}],[`path`,{d:`M11 13l9 -9`,key:`svg-1`}],[`path`,{d:`M15 4h5v5`,key:`svg-2`}]]),fr=N(`outline`,`eye-off`,`EyeOff`,[[`path`,{d:`M10.585 10.587a2 2 0 0 0 2.829 2.828`,key:`svg-0`}],[`path`,{d:`M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87`,key:`svg-1`}],[`path`,{d:`M3 3l18 18`,key:`svg-2`}]]),pr=N(`outline`,`eye`,`Eye`,[[`path`,{d:`M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6`,key:`svg-1`}]]),mr=N(`outline`,`file-spreadsheet`,`FileSpreadsheet`,[[`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`,key:`svg-0`}],[`path`,{d:`M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2`,key:`svg-1`}],[`path`,{d:`M8 11h8v7h-8l0 -7`,key:`svg-2`}],[`path`,{d:`M8 15h8`,key:`svg-3`}],[`path`,{d:`M11 11v7`,key:`svg-4`}]]),hr=N(`outline`,`filter`,`Filter`,[[`path`,{d:`M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227`,key:`svg-0`}]]),gr=N(`outline`,`flame`,`Flame`,[[`path`,{d:`M12 10.941c2.333 -3.308 .167 -7.823 -1 -8.941c0 3.395 -2.235 5.299 -3.667 6.706c-1.43 1.408 -2.333 3.294 -2.333 5.588c0 3.704 3.134 6.706 7 6.706c3.866 0 7 -3.002 7 -6.706c0 -1.712 -1.232 -4.403 -2.333 -5.588c-2.084 3.353 -3.257 3.353 -4.667 2.235`,key:`svg-0`}]]),_r=N(`outline`,`folders`,`Folders`,[[`path`,{d:`M9 3h3l2 2h5a2 2 0 0 1 2 2v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2`,key:`svg-0`}],[`path`,{d:`M17 16v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2h2`,key:`svg-1`}]]),vr=N(`outline`,`grip-vertical`,`GripVertical`,[[`path`,{d:`M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}],[`path`,{d:`M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-5`}]]),yr=N(`outline`,`history`,`History`,[[`path`,{d:`M12 8l0 4l2 2`,key:`svg-0`}],[`path`,{d:`M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5`,key:`svg-1`}]]),br=N(`outline`,`hourglass-off`,`HourglassOff`,[[`path`,{d:`M18 18v2a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1v-2a6 6 0 0 1 6 -6`,key:`svg-0`}],[`path`,{d:`M6 6a6 6 0 0 0 6 6m3.13 -.88a6 6 0 0 0 2.87 -5.12v-2a1 1 0 0 0 -1 -1h-10`,key:`svg-1`}],[`path`,{d:`M3 3l18 18`,key:`svg-2`}]]),xr=N(`outline`,`hourglass`,`Hourglass`,[[`path`,{d:`M6.5 7h11`,key:`svg-0`}],[`path`,{d:`M6.5 17h11`,key:`svg-1`}],[`path`,{d:`M6 20v-2a6 6 0 1 1 12 0v2a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1`,key:`svg-2`}],[`path`,{d:`M6 4v2a6 6 0 1 0 12 0v-2a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1`,key:`svg-3`}]]),Sr=N(`outline`,`key`,`Key`,[[`path`,{d:`M16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1 -4.069 0l-.301 -.301l-6.558 6.558a2 2 0 0 1 -1.239 .578l-.175 .008h-1.172a1 1 0 0 1 -.993 -.883l-.007 -.117v-1.172a2 2 0 0 1 .467 -1.284l.119 -.13l.414 -.414h2v-2h2v-2l2.144 -2.144l-.301 -.301a2.877 2.877 0 0 1 0 -4.069l2.643 -2.643a2.877 2.877 0 0 1 4.069 0`,key:`svg-0`}],[`path`,{d:`M15 9h.01`,key:`svg-1`}]]),Cr=N(`outline`,`layout-dashboard`,`LayoutDashboard`,[[`path`,{d:`M5 4h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1`,key:`svg-0`}],[`path`,{d:`M5 16h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1`,key:`svg-1`}],[`path`,{d:`M15 12h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1`,key:`svg-2`}],[`path`,{d:`M15 4h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1`,key:`svg-3`}]]),wr=N(`outline`,`list`,`List`,[[`path`,{d:`M9 6l11 0`,key:`svg-0`}],[`path`,{d:`M9 12l11 0`,key:`svg-1`}],[`path`,{d:`M9 18l11 0`,key:`svg-2`}],[`path`,{d:`M5 6l0 .01`,key:`svg-3`}],[`path`,{d:`M5 12l0 .01`,key:`svg-4`}],[`path`,{d:`M5 18l0 .01`,key:`svg-5`}]]),Tr=N(`outline`,`loader`,`Loader`,[[`path`,{d:`M12 6l0 -3`,key:`svg-0`}],[`path`,{d:`M16.25 7.75l2.15 -2.15`,key:`svg-1`}],[`path`,{d:`M18 12l3 0`,key:`svg-2`}],[`path`,{d:`M16.25 16.25l2.15 2.15`,key:`svg-3`}],[`path`,{d:`M12 18l0 3`,key:`svg-4`}],[`path`,{d:`M7.75 16.25l-2.15 2.15`,key:`svg-5`}],[`path`,{d:`M6 12l-3 0`,key:`svg-6`}],[`path`,{d:`M7.75 7.75l-2.15 -2.15`,key:`svg-7`}]]),Er=N(`outline`,`lock`,`Lock`,[[`path`,{d:`M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6`,key:`svg-0`}],[`path`,{d:`M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 11v-4a4 4 0 1 1 8 0v4`,key:`svg-2`}]]),Dr=N(`outline`,`menu-2`,`Menu2`,[[`path`,{d:`M4 6l16 0`,key:`svg-0`}],[`path`,{d:`M4 12l16 0`,key:`svg-1`}],[`path`,{d:`M4 18l16 0`,key:`svg-2`}]]),Or=N(`outline`,`message-chatbot`,`MessageChatbot`,[[`path`,{d:`M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12`,key:`svg-0`}],[`path`,{d:`M9.5 9h.01`,key:`svg-1`}],[`path`,{d:`M14.5 9h.01`,key:`svg-2`}],[`path`,{d:`M9.5 13a3.5 3.5 0 0 0 5 0`,key:`svg-3`}]]),kr=N(`outline`,`moon`,`Moon`,[[`path`,{d:`M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454l0 .008`,key:`svg-0`}]]),Ar=N(`outline`,`player-play`,`PlayerPlay`,[[`path`,{d:`M7 4v16l13 -8l-13 -8`,key:`svg-0`}]]),jr=N(`outline`,`player-stop`,`PlayerStop`,[[`path`,{d:`M5 7a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -10`,key:`svg-0`}]]),Mr=N(`outline`,`plug-connected`,`PlugConnected`,[[`path`,{d:`M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5`,key:`svg-0`}],[`path`,{d:`M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5`,key:`svg-1`}],[`path`,{d:`M3 21l2.5 -2.5`,key:`svg-2`}],[`path`,{d:`M18.5 5.5l2.5 -2.5`,key:`svg-3`}],[`path`,{d:`M10 11l-2 2`,key:`svg-4`}],[`path`,{d:`M13 14l-2 2`,key:`svg-5`}]]),Nr=N(`outline`,`plug`,`Plug`,[[`path`,{d:`M9.785 6l8.215 8.215l-2.054 2.054a5.81 5.81 0 1 1 -8.215 -8.215l2.054 -2.054`,key:`svg-0`}],[`path`,{d:`M4 20l3.5 -3.5`,key:`svg-1`}],[`path`,{d:`M15 4l-3.5 3.5`,key:`svg-2`}],[`path`,{d:`M20 9l-3.5 3.5`,key:`svg-3`}]]),Pr=N(`outline`,`plus`,`Plus`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M5 12l14 0`,key:`svg-1`}]]),Fr=N(`outline`,`question-mark`,`QuestionMark`,[[`path`,{d:`M8 8a3.5 3 0 0 1 3.5 -3h1a3.5 3 0 0 1 3.5 3a3 3 0 0 1 -2 3a3 4 0 0 0 -2 4`,key:`svg-0`}],[`path`,{d:`M12 19l0 .01`,key:`svg-1`}]]),Ir=N(`outline`,`refresh`,`Refresh`,[[`path`,{d:`M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4`,key:`svg-0`}],[`path`,{d:`M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4`,key:`svg-1`}]]),Lr=N(`outline`,`route`,`Route`,[[`path`,{d:`M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4`,key:`svg-1`}],[`path`,{d:`M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5`,key:`svg-2`}]]),Rr=N(`outline`,`search`,`Search`,[[`path`,{d:`M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0`,key:`svg-0`}],[`path`,{d:`M21 21l-6 -6`,key:`svg-1`}]]),zr=N(`outline`,`send`,`Send`,[[`path`,{d:`M10 14l11 -11`,key:`svg-0`}],[`path`,{d:`M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5`,key:`svg-1`}]]),Br=N(`outline`,`settings`,`Settings`,[[`path`,{d:`M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065`,key:`svg-0`}],[`path`,{d:`M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0`,key:`svg-1`}]]),Vr=N(`outline`,`sparkles`,`Sparkles`,[[`path`,{d:`M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6`,key:`svg-0`}]]),Hr=N(`outline`,`star`,`Star`,[[`path`,{d:`M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245`,key:`svg-0`}]]),Ur=N(`outline`,`sun`,`Sun`,[[`path`,{d:`M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0`,key:`svg-0`}],[`path`,{d:`M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7`,key:`svg-1`}]]),Wr=N(`outline`,`tool`,`Tool`,[[`path`,{d:`M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5`,key:`svg-0`}]]),Gr=N(`outline`,`trash`,`Trash`,[[`path`,{d:`M4 7l16 0`,key:`svg-0`}],[`path`,{d:`M10 11l0 6`,key:`svg-1`}],[`path`,{d:`M14 11l0 6`,key:`svg-2`}],[`path`,{d:`M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12`,key:`svg-3`}],[`path`,{d:`M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3`,key:`svg-4`}]]),Kr=N(`outline`,`trophy`,`Trophy`,[[`path`,{d:`M8 21l8 0`,key:`svg-0`}],[`path`,{d:`M12 17l0 4`,key:`svg-1`}],[`path`,{d:`M7 4l10 0`,key:`svg-2`}],[`path`,{d:`M17 4v8a5 5 0 0 1 -10 0v-8`,key:`svg-3`}],[`path`,{d:`M3 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-4`}],[`path`,{d:`M17 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-5`}]]),qr=N(`outline`,`upload`,`Upload`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 9l5 -5l5 5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),Jr=N(`outline`,`wand`,`Wand`,[[`path`,{d:`M6 21l15 -15l-3 -3l-15 15l3 3`,key:`svg-0`}],[`path`,{d:`M15 6l3 3`,key:`svg-1`}],[`path`,{d:`M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2`,key:`svg-2`}],[`path`,{d:`M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2`,key:`svg-3`}]]),Yr=N(`outline`,`x`,`X`,[[`path`,{d:`M18 6l-12 12`,key:`svg-0`}],[`path`,{d:`M6 6l12 12`,key:`svg-1`}]]),Xr=N(`filled`,`circle-check-filled`,`CircleCheckFilled`,[[`path`,{d:`M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z`,key:`svg-0`}]]),Zr=N(`filled`,`player-play-filled`,`PlayerPlayFilled`,[[`path`,{d:`M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z`,key:`svg-0`}]]),Qr=N(`filled`,`star-filled`,`StarFilled`,[[`path`,{d:`M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z`,key:`svg-0`}]]),$r={wrap:`_wrap_18gb2_5`,trigger:`_trigger_18gb2_11`,cycle:`_cycle_18gb2_30`,emoji:`_emoji_18gb2_53`,label:`_label_18gb2_54`,menu:`_menu_18gb2_55`,item:`_item_18gb2_69`,itemActive:`_itemActive_18gb2_83`,itemEmoji:`_itemEmoji_18gb2_87`,itemText:`_itemText_18gb2_88`,activeDot:`_activeDot_18gb2_91`,compact:`_compact_18gb2_92`},ei=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})),P=o(((e,t)=>{t.exports=ei()}))();function ti({toolMode:e=`opencode`,onSetToolMode:t,onCycleToolMode:n,compact:r=!1,tools:i=mn}){let[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=bn(e);return(0,v.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]),(0,P.jsxs)(`div`,{className:`${$r.wrap} ${r?$r.compact:``}`,ref:s,children:[(0,P.jsxs)(`button`,{type:`button`,className:$r.trigger,onClick:()=>o(e=>!e),"aria-haspopup":`listbox`,"aria-expanded":a,title:`Install endpoint into: ${c.label}`,children:[(0,P.jsx)(`span`,{className:$r.emoji,children:c.emoji}),(0,P.jsx)(`span`,{className:$r.label,children:r?c.label.replace(/ CLI$/,``):c.label}),(0,P.jsx)(Zn,{size:13,stroke:1.7})]}),(0,P.jsx)(`button`,{type:`button`,className:$r.cycle,onClick:n,title:`Cycle endpoint target`,"aria-label":`Cycle endpoint target`,children:(0,P.jsx)(Ir,{size:13,stroke:1.7})}),a&&(0,P.jsx)(`div`,{className:$r.menu,role:`listbox`,"aria-label":`Endpoint install target`,children:i.map(n=>{let r=vn[n],i=n===e;return(0,P.jsxs)(`button`,{type:`button`,className:`${$r.item} ${i?$r.itemActive:``}`,onClick:()=>{t?.(n),o(!1)},role:`option`,"aria-selected":i,children:[(0,P.jsx)(`span`,{className:$r.itemEmoji,children:r.emoji}),(0,P.jsxs)(`span`,{className:$r.itemText,children:[(0,P.jsx)(`strong`,{children:r.label}),(0,P.jsx)(`small`,{children:r.flag})]}),i&&(0,P.jsx)(`span`,{className:$r.activeDot,children:`●`})]},n)})})]})}var F={header:`_header_xml3p_11`,left:`_left_xml3p_28`,center:`_center_xml3p_35`,right:`_right_xml3p_41`,logo:`_logo_xml3p_49`,logoIconSvg:`_logoIconSvg_xml3p_50`,logoText:`_logoText_xml3p_56`,logoTextHighlight:`_logoTextHighlight_xml3p_64`,version:`_version_xml3p_65`,nav:`_nav_xml3p_72`,navBtn:`_navBtn_xml3p_82`,navBtnActive:`_navBtnActive_xml3p_106`,comingBadge:`_comingBadge_xml3p_121`,menuWrap:`_menuWrap_xml3p_137`,menuTrigger:`_menuTrigger_xml3p_138`,menuPopover:`_menuPopover_xml3p_143`,menuItem:`_menuItem_xml3p_158`,menuItemActive:`_menuItemActive_xml3p_175`,searchBar:`_searchBar_xml3p_183`,searchIcon:`_searchIcon_xml3p_193`,searchInput:`_searchInput_xml3p_194`,iconBtn:`_iconBtn_xml3p_202`,cmdkBtn:`_cmdkBtn_xml3p_212`,cmdkLabel:`_cmdkLabel_xml3p_225`,benchmarkBtn:`_benchmarkBtn_xml3p_228`,benchmarkActive:`_benchmarkActive_xml3p_238`,benchmarkRunning:`_benchmarkRunning_xml3p_243`,spinner:`_spinner_xml3p_245`,spin:`_spin_xml3p_245`,hamburgerBtn:`_hamburgerBtn_xml3p_278`,mobileNav:`_mobileNav_xml3p_300`,mobileNavItem:`_mobileNavItem_xml3p_315`,mobileNavActive:`_mobileNavActive_xml3p_332`,mobileNavDivider:`_mobileNavDivider_xml3p_337`},ni=[{id:`dashboard`,label:`Dashboard`,icon:Cr},{id:`router`,label:`Router`,icon:Lr},{id:`playground`,label:`Playground`,icon:Or},{id:`help`,label:`Help`,icon:Fr},{id:`install-endpoints`,label:`Install Endpoints`,icon:Nr}],ri=[{id:`analytics`,label:`Analytics`,icon:zn},{id:`recommend`,label:`Recommend`,icon:Vr},{id:`changelog`,label:`Changelog`,icon:yr},{id:`installed-models`,label:`Installed Models`,icon:_r}];function ii({searchQuery:e,onSearchChange:t,currentView:n,onNavigate:r,onToggleTheme:i,onOpenExport:a,onOpenCommandPalette:o,onBenchmark:s,benchmarkRunning:c,benchmarkTotal:l,benchmarkCompleted:u,modelsCount:d,theme:f,onToast:p,toolMode:m=`opencode`,onSetToolMode:h,onCycleToolMode:g,updateSlot:_=null}){let[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(!1),C=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!y&&!x)return;let e=e=>{C.current&&!C.current.contains(e.target)&&b(!1)},t=e=>{e.key===`Escape`&&(b(!1),S(!1))};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[y,x]);let w=e=>{if(e.comingIn){p?.(`${e.label} arrives in milestone ${e.comingIn}.`,`info`);return}r(e.id),S(!1)},ee=e=>{if(b(!1),e.comingIn){p?.(`${e.label} arrives in milestone ${e.comingIn}.`,`info`);return}r(e.id)};return(0,P.jsxs)(`header`,{className:F.header,children:[(0,P.jsxs)(`div`,{className:F.left,children:[(0,P.jsxs)(`div`,{className:F.logo,onClick:()=>r(`dashboard`),style:{cursor:`pointer`},children:[(0,P.jsxs)(`svg`,{className:F.logoIconSvg,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,P.jsx)(`path`,{d:`M4 5L11 12L4 19`,stroke:`var(--color-brand)`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,P.jsx)(`path`,{d:`M14 5V19M14 5H21M14 11H18`,stroke:`var(--color-brand)`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,P.jsxs)(`span`,{className:F.logoText,children:[(0,P.jsx)(`span`,{className:F.logoTextHighlight,children:`free`}),(0,P.jsx)(`span`,{children:`-coding-models`}),(0,P.jsx)(`span`,{className:F.logoTextHighlight,children:`_`})]})]}),(0,P.jsxs)(`span`,{className:F.version,children:[`v`,`0.5.41`]}),(0,P.jsx)(`button`,{className:F.hamburgerBtn,onClick:()=>S(e=>!e),"aria-label":`Navigation menu`,"aria-expanded":x,"aria-haspopup":`true`,children:(0,P.jsx)(Dr,{size:18,stroke:1.5})}),x&&(0,P.jsxs)(`div`,{className:F.mobileNav,role:`menu`,children:[ni.map(e=>{let t=e.icon;return(0,P.jsxs)(`button`,{className:`${F.mobileNavItem} ${n===e.id?F.mobileNavActive:``}`,onClick:()=>w(e),role:`menuitem`,children:[(0,P.jsx)(t,{size:16,stroke:1.5}),(0,P.jsx)(`span`,{children:e.label})]},e.id)}),(0,P.jsx)(`div`,{className:F.mobileNavDivider}),ri.map(e=>{let t=e.icon;return(0,P.jsxs)(`button`,{className:F.mobileNavItem,onClick:()=>ee(e),role:`menuitem`,children:[(0,P.jsx)(t,{size:16,stroke:1.5}),(0,P.jsx)(`span`,{children:e.label})]},e.id)})]}),(0,P.jsxs)(`nav`,{className:F.nav,"aria-label":`Primary`,children:[ni.map(e=>{let t=e.icon,r=n===e.id;return(0,P.jsxs)(`button`,{className:`${F.navBtn} ${r?F.navBtnActive:``}`,onClick:()=>w(e),title:e.comingIn?`${e.label} — coming in ${e.comingIn}`:e.label,"aria-current":r?`page`:void 0,children:[(0,P.jsx)(t,{size:14,stroke:1.5}),(0,P.jsx)(`span`,{children:e.label}),e.comingIn&&(0,P.jsx)(`span`,{className:F.comingBadge,children:e.comingIn})]},e.id)}),(0,P.jsxs)(`div`,{className:F.menuWrap,ref:C,children:[(0,P.jsx)(`button`,{className:`${F.navBtn} ${F.menuTrigger} ${ri.some(e=>e.id===n)?F.navBtnActive:``}`,onClick:()=>b(e=>!e),title:`More features`,"aria-label":`More features`,"aria-haspopup":`true`,"aria-expanded":y,children:(0,P.jsx)(cr,{size:16,stroke:1.5})}),y&&(0,P.jsx)(`div`,{className:F.menuPopover,role:`menu`,children:ri.map(e=>{let t=e.icon,r=n===e.id;return(0,P.jsxs)(`button`,{className:`${F.menuItem} ${r?F.menuItemActive:``}`,onClick:()=>ee(e),role:`menuitem`,"aria-current":r?`page`:void 0,children:[(0,P.jsx)(t,{size:14,stroke:1.5}),(0,P.jsx)(`span`,{children:e.label}),e.comingIn&&(0,P.jsx)(`span`,{className:F.comingBadge,children:e.comingIn})]},e.id)})})]})]})]}),(0,P.jsxs)(`div`,{className:F.right,children:[(0,P.jsxs)(`button`,{className:`${F.navBtn} ${n===`settings`?F.navBtnActive:``}`,onClick:()=>r(`settings`),title:`Settings`,"aria-current":n===`settings`?`page`:void 0,style:{marginRight:`2px`},children:[(0,P.jsx)(Br,{size:14,stroke:1.5}),(0,P.jsx)(`span`,{children:`Settings`})]}),(0,P.jsx)(ti,{toolMode:m,onSetToolMode:h,onCycleToolMode:g}),(0,P.jsxs)(`button`,{className:F.cmdkBtn,onClick:o,title:`Command palette (⌘K / Ctrl+P)`,"aria-label":`Open command palette (⌘K)`,children:[(0,P.jsx)(or,{size:14,stroke:1.5}),(0,P.jsx)(`span`,{className:F.cmdkLabel,children:`⌘K`})]}),(0,P.jsxs)(`button`,{className:`${F.benchmarkBtn} ${c?F.benchmarkActive:``}`,onClick:s,disabled:c,title:c?`AI Speed Test running — ${u}/${l}`:`Run AI Latency benchmark on ${d} visible models`,"aria-label":c?`AI Speed Test running — ${u} of ${l} complete`:`AI Latency benchmark`,children:[(0,P.jsx)(Ar,{size:14,stroke:1.5}),c?(0,P.jsxs)(`span`,{className:F.benchmarkRunning,children:[(0,P.jsx)(`span`,{className:F.spinner}),`RUN `,u,`/`,l]}):(0,P.jsx)(`span`,{children:`AI Latency`})]}),_,(0,P.jsx)(`button`,{className:F.iconBtn,onClick:i,title:`Theme: ${f} (click to cycle auto / dark / light)`,"aria-label":`Theme: ${f}. Click to cycle.`,children:f===`light`?(0,P.jsx)(kr,{size:16,stroke:1.5}):(0,P.jsx)(Ur,{size:16,stroke:1.5})}),(0,P.jsx)(`button`,{className:F.iconBtn,onClick:a,title:`Export Data`,"aria-label":`Export model data`,children:(0,P.jsx)(lr,{size:16,stroke:1.5})})]})]})}var ai={footer:`_footer_1uw54_1`,left:`_left_1uw54_8`,right:`_right_1uw54_8`};function oi(){return(0,P.jsxs)(`footer`,{className:ai.footer,children:[(0,P.jsxs)(`div`,{className:ai.left,children:[`by `,(0,P.jsx)(`a`,{href:`https://vavanessa.dev`,target:`_blank`,rel:`noopener`,children:`Vava-Nessa`})]}),(0,P.jsxs)(`div`,{className:ai.right,children:[(0,P.jsx)(`a`,{href:`https://github.com/vava-nessa/free-coding-models`,target:`_blank`,rel:`noopener`,children:`GitHub`}),(0,P.jsx)(`a`,{href:`https://discord.gg/ZTNFHvvCkU`,target:`_blank`,rel:`noopener`,children:`Discord`})]})]})}var si=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 181 24" xmlns="http://www.w3.org/2000/svg"><title>Google AI Studio</title><path d="M172.721 19.07c-1.172 0-2.221-.266-3.149-.798a5.779 5.779 0 01-2.169-2.237c-.517-.943-.775-1.993-.775-3.15 0-1.155.258-2.205.775-3.149a5.619 5.619 0 012.169-2.213c.928-.548 1.977-.822 3.149-.822 1.171 0 2.221.274 3.149.822a5.777 5.777 0 012.168 2.236c.518.944.776 1.986.776 3.127 0 1.156-.258 2.206-.776 3.15a5.776 5.776 0 01-2.168 2.236c-.928.532-1.978.799-3.149.799zm0-2.304c.639 0 1.232-.153 1.78-.457.548-.32.981-.768 1.301-1.346.335-.594.502-1.286.502-2.077 0-.791-.167-1.476-.502-2.054a3.304 3.304 0 00-1.301-1.324 3.472 3.472 0 00-1.78-.479c-.639 0-1.232.16-1.78.48a3.458 3.458 0 00-1.324 1.323c-.319.578-.479 1.263-.479 2.054 0 .791.16 1.483.479 2.077a3.629 3.629 0 001.324 1.346 3.606 3.606 0 001.78.457zM162.999 5.378a1.69 1.69 0 01-1.21-.48 1.69 1.69 0 01-.479-1.21c0-.47.16-.866.479-1.186a1.65 1.65 0 011.21-.502c.471 0 .867.167 1.186.502.335.32.503.715.503 1.187 0 .471-.168.875-.503 1.21a1.61 1.61 0 01-1.186.479zm-1.255 1.688h2.51v11.64h-2.51V7.066zM152.429 19.07c-1.05 0-2.001-.266-2.853-.798-.852-.533-1.529-1.263-2.031-2.191-.487-.944-.73-2.008-.73-3.195 0-1.187.243-2.244.73-3.172.502-.944 1.179-1.682 2.031-2.214.852-.533 1.803-.799 2.853-.799.821 0 1.559.183 2.213.548.655.365 1.149.814 1.484 1.346h.114l-.114-1.643V2.365h2.51v16.34h-2.396V17.2h-.114c-.335.517-.829.959-1.484 1.324-.654.365-1.392.547-2.213.547zm.365-2.305c.608 0 1.171-.16 1.689-.479.532-.32.958-.776 1.278-1.37.319-.592.479-1.27.479-2.03 0-.76-.16-1.43-.479-2.008-.32-.594-.746-1.05-1.278-1.37a3.158 3.158 0 00-1.689-.48c-.609 0-1.179.16-1.712.48-.532.32-.958.776-1.278 1.37-.319.578-.479 1.247-.479 2.008 0 .76.16 1.438.479 2.03.32.594.746 1.05 1.278 1.37.533.32 1.103.48 1.712.48zM138.527 19.07c-1.415 0-2.495-.418-3.241-1.255-.73-.852-1.095-2.03-1.095-3.537V7.066h2.51v6.87c0 .943.221 1.65.662 2.122.456.472 1.05.707 1.78.707.593 0 1.118-.152 1.575-.456.456-.32.806-.738 1.049-1.255a3.856 3.856 0 00.366-1.666V7.066h2.51v11.64h-2.373v-1.507h-.137c-.32.548-.814.997-1.484 1.346a4.517 4.517 0 01-2.122.525zM130.115 18.888a4.208 4.208 0 01-1.461-.251c-.457-.167-.829-.388-1.118-.662-.655-.654-.982-1.544-.982-2.67V9.28h-2.031V7.066h2.031V3.78h2.511v3.286h2.83V9.28h-2.83v5.477c0 .624.121 1.065.365 1.324.228.304.624.456 1.187.456.258 0 .486-.03.684-.09.198-.077.411-.191.639-.343v2.442c-.502.228-1.11.342-1.825.342zM117.888 19.07a6.03 6.03 0 01-3.652-1.186c-1.08-.791-1.825-1.902-2.236-3.332l2.419-.981c.243.897.669 1.635 1.278 2.213.624.563 1.369.845 2.236.845.807 0 1.491-.206 2.054-.617.563-.426.845-1.004.845-1.734 0-.67-.251-1.217-.753-1.643-.487-.441-1.347-.883-2.579-1.324l-1.027-.365c-1.096-.38-2.016-.928-2.762-1.643-.745-.715-1.118-1.658-1.118-2.83 0-.806.221-1.552.662-2.236.441-.685 1.05-1.225 1.826-1.62.791-.412 1.681-.617 2.67-.617 1.43 0 2.571.35 3.423 1.05.852.684 1.423 1.46 1.712 2.328l-2.305.981c-.168-.517-.487-.974-.959-1.37-.471-.395-1.08-.593-1.826-.593-.745 0-1.376.19-1.894.57-.502.381-.753.868-.753 1.461 0 .563.228 1.027.685 1.393.456.365 1.171.715 2.145 1.05l1.027.342c1.4.487 2.48 1.126 3.241 1.917.776.776 1.164 1.818 1.164 3.126 0 1.065-.274 1.963-.822 2.693a4.978 4.978 0 01-2.1 1.598 6.677 6.677 0 01-2.601.525zM102.221 2.365h2.556v16.34h-2.556V2.365zM90.94 2.365h2.922L100 18.705h-2.83l-1.46-4.176h-6.596l-1.484 4.176h-2.83l6.14-16.34zm3.903 9.79l-1.734-4.86-.64-1.895h-.136l-.64 1.894-1.734 4.862h4.884zM73.43 19.07c-1.141 0-2.168-.266-3.081-.798a5.758 5.758 0 01-2.123-2.191c-.502-.943-.753-2-.753-3.172 0-1.111.244-2.138.73-3.081a5.898 5.898 0 012.078-2.282c.882-.563 1.886-.845 3.012-.845 1.171 0 2.183.259 3.035.776A4.985 4.985 0 0178.291 9.6c.456.897.684 1.909.684 3.035 0 .213-.022.48-.068.799h-8.923c.091 1.08.471 1.917 1.14 2.51a3.57 3.57 0 002.374.867c.715 0 1.332-.16 1.849-.48a3.745 3.745 0 001.278-1.345l2.122 1.004c-.547.958-1.263 1.711-2.145 2.259-.882.548-1.94.822-3.172.822zm2.99-7.553a2.82 2.82 0 00-.389-1.21c-.228-.41-.578-.753-1.05-1.027-.456-.274-1.019-.41-1.688-.41-.806 0-1.491.243-2.054.73-.548.471-.928 1.11-1.141 1.917h6.322zM62.763 2.365h2.51v16.34h-2.51V2.365zM54.016 24c-1.43 0-2.616-.327-3.56-.981-.928-.654-1.552-1.43-1.871-2.328l2.35-.981a3.148 3.148 0 001.164 1.46c.548.38 1.187.57 1.917.57 1.065 0 1.895-.319 2.488-.958.609-.624.913-1.506.913-2.647v-1.073h-.137c-.38.548-.89.982-1.53 1.301-.623.304-1.346.457-2.167.457a5.185 5.185 0 01-2.716-.754c-.837-.502-1.506-1.21-2.008-2.122-.487-.928-.73-1.986-.73-3.172 0-1.187.243-2.237.73-3.15.502-.928 1.171-1.643 2.008-2.145a5.07 5.07 0 012.716-.776c.806 0 1.529.16 2.168.48.639.319 1.149.753 1.529 1.3h.137V7.066h2.396v11c0 1.263-.243 2.336-.73 3.218a4.81 4.81 0 01-2.054 2.031c-.867.457-1.872.685-3.013.685zm.023-7.463c.609 0 1.172-.144 1.69-.433a3.281 3.281 0 001.231-1.301c.305-.578.457-1.255.457-2.031 0-1.187-.327-2.107-.982-2.762-.639-.67-1.437-1.004-2.396-1.004-.623 0-1.194.152-1.711.457-.518.289-.928.715-1.233 1.278-.304.563-.456 1.24-.456 2.03 0 .792.152 1.469.456 2.032a3.28 3.28 0 001.233 1.3c.517.29 1.087.434 1.711.434zM40.36 19.07c-1.172 0-2.222-.266-3.15-.798a5.778 5.778 0 01-2.168-2.237c-.517-.943-.776-1.993-.776-3.15 0-1.155.259-2.205.776-3.149a5.618 5.618 0 012.168-2.213c.928-.548 1.978-.822 3.15-.822 1.17 0 2.22.274 3.149.822a5.778 5.778 0 012.168 2.236c.517.944.776 1.986.776 3.127 0 1.156-.259 2.206-.776 3.15a5.778 5.778 0 01-2.168 2.236c-.928.532-1.978.799-3.15.799zm0-2.304c.638 0 1.232-.153 1.78-.457.547-.32.98-.768 1.3-1.346.335-.594.502-1.286.502-2.077 0-.791-.167-1.476-.502-2.054a3.303 3.303 0 00-1.3-1.324 3.472 3.472 0 00-1.78-.479c-.64 0-1.233.16-1.78.48a3.458 3.458 0 00-1.324 1.323c-.32.578-.48 1.263-.48 2.054 0 .791.16 1.483.48 2.077a3.629 3.629 0 001.323 1.346 3.606 3.606 0 001.78.457zM26.497 19.07c-1.172 0-2.221-.266-3.15-.798a5.778 5.778 0 01-2.168-2.237c-.517-.943-.775-1.993-.775-3.15 0-1.155.258-2.205.776-3.149a5.618 5.618 0 012.168-2.213c.928-.548 1.977-.822 3.149-.822s2.221.274 3.15.822a5.779 5.779 0 012.167 2.236c.518.944.776 1.986.776 3.127 0 1.156-.258 2.206-.776 3.15a5.778 5.778 0 01-2.168 2.236c-.928.532-1.977.799-3.149.799zm0-2.304c.639 0 1.232-.153 1.78-.457.548-.32.981-.768 1.3-1.346.336-.594.503-1.286.503-2.077 0-.791-.167-1.476-.502-2.054a3.303 3.303 0 00-1.3-1.324 3.472 3.472 0 00-1.781-.479c-.639 0-1.232.16-1.78.48a3.456 3.456 0 00-1.324 1.323c-.32.578-.479 1.263-.479 2.054 0 .791.16 1.483.48 2.077a3.627 3.627 0 001.323 1.346 3.606 3.606 0 001.78.457zM10.558 19.07c-1.552 0-2.982-.372-4.29-1.118a8.49 8.49 0 01-3.127-3.058C2.381 13.586 2 12.133 2 10.535c0-1.597.38-3.043 1.141-4.336a8.435 8.435 0 013.127-3.08C7.576 2.372 9.006 2 10.558 2c1.232 0 2.381.22 3.446.662 1.065.441 1.955 1.057 2.67 1.848l-1.78 1.78a5.401 5.401 0 00-1.917-1.369c-.73-.32-1.544-.48-2.442-.48-1.05 0-2.03.252-2.944.754a5.702 5.702 0 00-2.19 2.145c-.548.928-.822 1.993-.822 3.195 0 1.202.274 2.267.821 3.195a5.702 5.702 0 002.191 2.146 6.057 6.057 0 002.967.753c.974 0 1.788-.145 2.442-.434a6.2 6.2 0 001.757-1.164c.335-.335.617-.753.845-1.255.243-.502.403-1.05.479-1.643h-5.546V9.85H18.5c.076.426.114.867.114 1.323 0 1.035-.16 2.032-.479 2.99a6.294 6.294 0 01-1.53 2.465c-1.536 1.628-3.552 2.442-6.047 2.442z"></path></svg>`,ci=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Google AI Studio</title><path d="M9.921 4.196H6.328A2.705 2.705 0 003.623 6.9v11.362a2.705 2.705 0 002.705 2.705h11.363a2.705 2.705 0 002.705-2.705v-4.756l1.623-1.113v5.87a4.329 4.329 0 01-4.328 4.328H6.328A4.329 4.329 0 012 18.263V6.901a4.328 4.328 0 014.328-4.329h4.545l-.952 1.624z"></path><path d="M17.82 0c.145 0 .268.104.299.246a7 7 0 001.9 3.484 7 7 0 003.485 1.901c.142.031.246.154.246.3a.308.308 0 01-.246.298A7 7 0 0020.02 8.13a7 7 0 00-1.912 3.535.297.297 0 01-.288.238.297.297 0 01-.288-.238A7 7 0 0015.62 8.13a7 7 0 00-3.535-1.912.297.297 0 01-.238-.288c0-.14.1-.26.238-.288A7 7 0 0015.62 3.73 7.001 7.001 0 0017.521.246.308.308 0 0117.82 0z"></path></svg>`,li=`<svg fill="currentColor" height="1em" style="flex:none;line-height:1" viewBox="0 0 53 24" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M13 2.701A9.299 9.299 0 0013 21.3V22.7C7.09 22.701 2.299 17.91 2.299 12S7.09 1.299 13 1.299V2.7zm4.752 3.677a7.353 7.353 0 00-9.453 11.265l-.901 1.074A8.755 8.755 0 1118.652 5.304l-.901 1.074zm-2.256.844a5.407 5.407 0 00-5.049 9.563l-.654 1.24a6.81 6.81 0 016.358-12.043l-.655 1.24zM13 8.539a3.461 3.461 0 000 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd"></path><path d="M14.286 10.836a2.242 2.242 0 00-.51-.409 1.085 1.085 0 00-.545-.152c-.254 0-.482.047-.683.14a1.582 1.582 0 00-.841.912 1.848 1.848 0 000 1.262 1.595 1.595 0 00.841.913c.2.093.429.14.683.14.217 0 .418-.046.603-.135.187-.09.35-.225.475-.392l.927 1.006c-.139.14-.3.261-.481.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.316 3.316 0 01-1.182-.21 2.826 2.826 0 01-.962-.597 2.813 2.813 0 01-.643-.929 2.986 2.986 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.277-.261.604-.464.962-.596a3.316 3.316 0 011.181-.21c.355 0 .713.068 1.072.204.362.138.686.36.945.649l-.962.97z"></path><path d="M19.338 11.397c-.008-.414-.136-.738-.383-.976-.247-.237-.59-.356-1.03-.356-.418 0-.749.12-.991.362-.244.242-.393.565-.447.97h2.85zm-2.85 1.052c.045.42.208.748.486.982.278.234.614.351 1.008.351.348 0 .639-.072.875-.217a2.42 2.42 0 00.62-.543l.997.76c-.325.405-.689.694-1.09.865a3.32 3.32 0 01-2.445.047 2.821 2.821 0 01-.962-.597 2.829 2.829 0 01-.643-.929 2.992 2.992 0 01-.237-1.21c0-.444.079-.847.238-1.21.15-.35.368-.666.642-.929.278-.261.605-.464.962-.596a3.32 3.32 0 011.182-.21c.386 0 .74.067 1.06.204.32.136.595.333.823.59.228.258.405.575.533.953.128.379.19.812.19 1.303v.386h-4.24zm4.843-3.296h1.39v.888h.023c.155-.327.375-.58.661-.76a1.812 1.812 0 011.234-.246c.081.016.164.036.25.06v1.355a3.912 3.912 0 00-.343-.076c-.109-.02-.22-.03-.33-.03-.324 0-.585.06-.782.182a1.38 1.38 0 00-.66.883 1.76 1.76 0 00-.053.35v3.005h-1.39V9.152zm7.797 2.244c-.008-.414-.135-.738-.383-.976-.246-.237-.59-.356-1.03-.356-.417 0-.748.12-.99.362-.245.242-.393.565-.447.97h2.85zm-2.85 1.052c.046.42.208.748.487.982.277.234.613.351 1.007.351.348 0 .64-.072.875-.217.236-.144.446-.328.62-.543l.997.76c-.325.405-.688.694-1.09.865a3.319 3.319 0 01-2.445.047 2.823 2.823 0 01-.961-.597 2.829 2.829 0 01-.643-.929 2.984 2.984 0 01-.238-1.21c0-.444.08-.847.238-1.21.158-.362.373-.672.643-.929a2.84 2.84 0 01.962-.596 3.318 3.318 0 011.181-.21c.387 0 .74.067 1.06.204.321.136.596.333.823.59.228.258.406.575.533.953.128.379.192.812.192 1.303v.386h-4.241zm9.225-.49a1.84 1.84 0 00-.11-.632 1.603 1.603 0 00-.84-.912 1.607 1.607 0 00-.684-.14 1.587 1.587 0 00-1.524 1.052 1.83 1.83 0 00-.11.631c0 .218.036.429.11.632a1.583 1.583 0 001.524 1.052 1.591 1.591 0 001.524-1.052c.073-.203.11-.414.11-.632zM30.89 5.925h1.391v3.94h.035a1.99 1.99 0 01.266-.287 2.327 2.327 0 01.927-.485c.201-.054.433-.081.696-.081a2.55 2.55 0 011.94.853c.236.264.42.577.55.935.132.358.198.744.198 1.157 0 .413-.062.8-.186 1.158a2.673 2.673 0 01-.544.935c-.243.267-.539.48-.869.625-.34.152-.723.229-1.147.229a2.613 2.613 0 01-1.1-.235 1.785 1.785 0 01-.812-.748h-.023v.841H30.89V5.927zm6.604 3.227h1.39v.888h.023c.155-.327.376-.58.661-.76a1.815 1.815 0 011.234-.246c.081.016.164.036.25.06v1.355a3.893 3.893 0 00-.343-.076c-.109-.02-.22-.03-.33-.03-.325 0-.585.06-.782.182a1.43 1.43 0 00-.452.415 1.39 1.39 0 00-.209.468 1.788 1.788 0 00-.051.35v3.005h-1.391V9.152zm7.207 3.097h-.29c-.193 0-.409.008-.649.024a3.384 3.384 0 00-.677.11c-.213.06-.393.146-.54.258a.564.564 0 00-.22.473c0 .133.03.244.087.333.058.09.134.166.226.229a.933.933 0 00.313.134c.117.027.232.04.348.04.48 0 .832-.114 1.06-.344.228-.23.342-.544.342-.94v-.317zm.082 1.743h-.036c-.2.32-.456.551-.764.695-.32.146-.668.22-1.02.216-.253 0-.504-.035-.748-.104a2.03 2.03 0 01-.649-.317 1.616 1.616 0 01-.457-.526 1.501 1.501 0 01-.174-.736c0-.305.054-.563.163-.777.103-.21.252-.393.434-.539a2.19 2.19 0 01.632-.344c.242-.087.492-.152.747-.193.258-.043.52-.07.782-.082.247-.011.495-.017.742-.018h.347v-.151c0-.351-.12-.614-.36-.79-.238-.175-.544-.262-.914-.262a2.129 2.129 0 00-1.483.585l-.73-.738a2.7 2.7 0 011.083-.69c.412-.14.845-.21 1.28-.21.394 0 .726.046.997.135.27.09.494.205.672.345.177.14.314.302.411.485.096.183.166.368.21.555.041.187.066.368.074.544.008.175.012.33.012.461v3.227h-1.252v-.771zm5.018-3.286c-.27-.382-.634-.573-1.09-.573a1.16 1.16 0 00-.544.14.478.478 0 00-.266.456c0 .172.073.297.22.375.147.078.332.144.556.198.224.055.465.111.724.17.259.058.5.148.724.268.224.122.41.287.556.498.147.21.22.498.22.864 0 .336-.071.619-.214.848-.139.226-.33.417-.556.556a2.456 2.456 0 01-.77.303c-.282.062-.57.094-.858.094-.432 0-.83-.062-1.194-.187a2.27 2.27 0 01-.973-.678l.928-.877c.177.203.368.368.573.497.204.129.454.193.747.193.101 0 .205-.012.313-.035a.992.992 0 00.301-.117.71.71 0 00.226-.204.482.482 0 00.087-.287c0-.194-.073-.34-.22-.432a1.966 1.966 0 00-.556-.229c-.24-.062-.481-.116-.724-.164a2.794 2.794 0 01-.725-.245 1.523 1.523 0 01-.556-.473c-.146-.203-.22-.483-.22-.841 0-.312.064-.583.191-.813a1.69 1.69 0 01.504-.567c.217-.152.461-.263.719-.327a3.256 3.256 0 011.923.087c.356.123.664.354.881.66l-.927.842z"></path></svg>`,ui=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 53 24" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M13 2.701A9.299 9.299 0 0013 21.3V22.7C7.09 22.701 2.299 17.91 2.299 12S7.09 1.299 13 1.299V2.7zm4.752 3.677a7.353 7.353 0 00-9.453 11.265l-.901 1.074A8.755 8.755 0 1118.652 5.304l-.901 1.074zm-2.256.844a5.407 5.407 0 00-5.049 9.563l-.654 1.24a6.81 6.81 0 016.358-12.043l-.655 1.24zM13 8.539a3.461 3.461 0 000 6.922v1.402a4.863 4.863 0 010-9.726v1.402z"></path><path d="M14.286 10.836a2.242 2.242 0 00-.51-.409 1.085 1.085 0 00-.545-.152c-.254 0-.482.047-.683.14a1.582 1.582 0 00-.841.912 1.848 1.848 0 000 1.262 1.595 1.595 0 00.841.913c.2.093.429.14.683.14.217 0 .418-.046.603-.135.187-.09.35-.225.475-.392l.927 1.006c-.139.14-.3.261-.481.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.316 3.316 0 01-1.182-.21 2.826 2.826 0 01-.962-.597 2.813 2.813 0 01-.643-.929 2.986 2.986 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.277-.261.604-.464.962-.596a3.316 3.316 0 011.181-.21c.355 0 .713.068 1.072.204.362.138.686.36.945.649l-.962.97z"></path><path d="M19.338 11.397c-.008-.414-.136-.738-.383-.976-.247-.237-.59-.356-1.03-.356-.418 0-.749.12-.991.362-.244.242-.393.565-.447.97h2.85zm-2.85 1.052c.045.42.208.748.486.982.278.234.614.351 1.008.351.348 0 .639-.072.875-.217a2.42 2.42 0 00.62-.543l.997.76c-.325.405-.689.694-1.09.865a3.32 3.32 0 01-2.445.047 2.821 2.821 0 01-.962-.597 2.829 2.829 0 01-.643-.929 2.992 2.992 0 01-.237-1.21c0-.444.079-.847.238-1.21.15-.35.368-.666.642-.929.278-.261.605-.464.962-.596a3.32 3.32 0 011.182-.21c.386 0 .74.067 1.06.204.32.136.595.333.823.59.228.258.405.575.533.953.128.379.19.812.19 1.303v.386h-4.24zm4.843-3.296h1.39v.888h.023c.155-.327.375-.58.661-.76a1.812 1.812 0 011.234-.246c.081.016.164.036.25.06v1.355a3.912 3.912 0 00-.343-.076c-.109-.02-.22-.03-.33-.03-.324 0-.585.06-.782.182a1.38 1.38 0 00-.66.883 1.76 1.76 0 00-.053.35v3.005h-1.39V9.152zm7.797 2.244c-.008-.414-.135-.738-.383-.976-.246-.237-.59-.356-1.03-.356-.417 0-.748.12-.99.362-.245.242-.393.565-.447.97h2.85zm-2.85 1.052c.046.42.208.748.487.982.277.234.613.351 1.007.351.348 0 .64-.072.875-.217.236-.144.446-.328.62-.543l.997.76c-.325.405-.688.694-1.09.865a3.319 3.319 0 01-2.445.047 2.823 2.823 0 01-.961-.597 2.829 2.829 0 01-.643-.929 2.984 2.984 0 01-.238-1.21c0-.444.08-.847.238-1.21.158-.362.373-.672.643-.929a2.84 2.84 0 01.962-.596 3.318 3.318 0 011.181-.21c.387 0 .74.067 1.06.204.321.136.596.333.823.59.228.258.406.575.533.953.128.379.192.812.192 1.303v.386h-4.241zm9.225-.49a1.84 1.84 0 00-.11-.632 1.603 1.603 0 00-.84-.912 1.607 1.607 0 00-.684-.14 1.587 1.587 0 00-1.524 1.052 1.83 1.83 0 00-.11.631c0 .218.036.429.11.632a1.583 1.583 0 001.524 1.052 1.591 1.591 0 001.524-1.052c.073-.203.11-.414.11-.632zM30.89 5.925h1.391v3.94h.035a1.99 1.99 0 01.266-.287 2.327 2.327 0 01.927-.485c.201-.054.433-.081.696-.081a2.55 2.55 0 011.94.853c.236.264.42.577.55.935.132.358.198.744.198 1.157 0 .413-.062.8-.186 1.158a2.673 2.673 0 01-.544.935c-.243.267-.539.48-.869.625-.34.152-.723.229-1.147.229a2.613 2.613 0 01-1.1-.235 1.785 1.785 0 01-.812-.748h-.023v.841H30.89V5.927zm6.604 3.227h1.39v.888h.023c.155-.327.376-.58.661-.76a1.815 1.815 0 011.234-.246c.081.016.164.036.25.06v1.355a3.893 3.893 0 00-.343-.076c-.109-.02-.22-.03-.33-.03-.325 0-.585.06-.782.182a1.43 1.43 0 00-.452.415 1.39 1.39 0 00-.209.468 1.788 1.788 0 00-.051.35v3.005h-1.391V9.152zm7.207 3.097h-.29c-.193 0-.409.008-.649.024a3.384 3.384 0 00-.677.11c-.213.06-.393.146-.54.258a.564.564 0 00-.22.473c0 .133.03.244.087.333.058.09.134.166.226.229a.933.933 0 00.313.134c.117.027.232.04.348.04.48 0 .832-.114 1.06-.344.228-.23.342-.544.342-.94v-.317zm.082 1.743h-.036c-.2.32-.456.551-.764.695-.32.146-.668.22-1.02.216-.253 0-.504-.035-.748-.104a2.03 2.03 0 01-.649-.317 1.616 1.616 0 01-.457-.526 1.501 1.501 0 01-.174-.736c0-.305.054-.563.163-.777.103-.21.252-.393.434-.539a2.19 2.19 0 01.632-.344c.242-.087.492-.152.747-.193.258-.043.52-.07.782-.082.247-.011.495-.017.742-.018h.347v-.151c0-.351-.12-.614-.36-.79-.238-.175-.544-.262-.914-.262a2.129 2.129 0 00-1.483.585l-.73-.738a2.7 2.7 0 011.083-.69c.412-.14.845-.21 1.28-.21.394 0 .726.046.997.135.27.09.494.205.672.345.177.14.314.302.411.485.096.183.166.368.21.555.041.187.066.368.074.544.008.175.012.33.012.461v3.227h-1.252v-.771zm5.018-3.286c-.27-.382-.634-.573-1.09-.573a1.16 1.16 0 00-.544.14.478.478 0 00-.266.456c0 .172.073.297.22.375.147.078.332.144.556.198.224.055.465.111.724.17.259.058.5.148.724.268.224.122.41.287.556.498.147.21.22.498.22.864 0 .336-.071.619-.214.848-.139.226-.33.417-.556.556a2.456 2.456 0 01-.77.303c-.282.062-.57.094-.858.094-.432 0-.83-.062-1.194-.187a2.27 2.27 0 01-.973-.678l.928-.877c.177.203.368.368.573.497.204.129.454.193.747.193.101 0 .205-.012.313-.035a.992.992 0 00.301-.117.71.71 0 00.226-.204.482.482 0 00.087-.287c0-.194-.073-.34-.22-.432a1.966 1.966 0 00-.556-.229c-.24-.062-.481-.116-.724-.164a2.794 2.794 0 01-.725-.245 1.523 1.523 0 01-.556-.473c-.146-.203-.22-.483-.22-.841 0-.312.064-.583.191-.813a1.69 1.69 0 01.504-.567c.217-.152.461-.263.719-.327a3.256 3.256 0 011.923.087c.356.123.664.354.881.66l-.927.842z"></path></svg>`,di=`<svg fill="currentColor" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd"></path><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z"></path></svg>`,fi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 95 24" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M17.075 16.717c-.62-.52-.982-1.25-1.085-2.187l9.446.001v-.86c0-1.094-.14-2.06-.425-2.904-.283-.842-.68-1.549-1.188-2.12a5.049 5.049 0 00-1.832-1.317c-.713-.304-1.5-.456-2.361-.456a7.396 7.396 0 00-2.633.469 6.325 6.325 0 00-2.143 1.328 6.309 6.309 0 00-1.431 2.07c-.354.808-.53 1.706-.53 2.696 0 .99.176 1.888.529 2.695.333.78.82 1.483 1.432 2.07a6.288 6.288 0 002.142 1.328 7.396 7.396 0 002.633.469 7.101 7.101 0 002.814-.573c.894-.381 1.704-1.025 2.427-1.926l-2.22-1.693c-.388.48-.855.888-1.381 1.21-.526.322-1.175.483-1.95.483-.877 0-1.625-.261-2.244-.783zm4.413-6.705c.55.53.836 1.254.852 2.175h-6.35c.12-.903.452-1.623.995-2.162.54-.537 1.278-.807 2.207-.807.98 0 1.745.266 2.296.794z"></path><path d="M29.878 7.187H26.78v12.499h3.098v-6.693c0-.172.038-.433.116-.78.077-.348.232-.694.465-1.043.233-.346.568-.654 1.006-.923.44-.27 1.02-.405 1.742-.405.247 0 .493.023.736.066.256.045.51.101.761.169v-3.02a7.03 7.03 0 00-.554-.131 2.962 2.962 0 00-.555-.05c-.827 0-1.559.198-2.194.597-.636.4-1.129.964-1.473 1.693h-.05V7.187z"></path><path clip-rule="evenodd" d="M37.8 14.531c.102.937.465 1.666 1.084 2.186.619.522 1.367.783 2.245.783.775 0 1.424-.161 1.95-.483.525-.322.992-.73 1.38-1.21l2.22 1.693c-.722.901-1.532 1.545-2.426 1.926-.89.38-1.848.576-2.815.573a7.39 7.39 0 01-2.632-.469 6.287 6.287 0 01-2.142-1.328 6.302 6.302 0 01-1.432-2.07c-.353-.807-.53-1.705-.53-2.696 0-.989.177-1.887.53-2.695a6.3 6.3 0 011.432-2.07 6.325 6.325 0 012.142-1.328 7.39 7.39 0 012.633-.469c.86 0 1.648.152 2.361.456a5.05 5.05 0 011.833 1.316c.507.572.904 1.279 1.188 2.121.285.844.426 1.81.426 2.903v.861H37.8zm5.497-4.519c.55.53.834 1.254.852 2.175H37.8c.121-.903.452-1.623.995-2.162.54-.537 1.278-.807 2.207-.807.98 0 1.746.266 2.296.794zM51.173 0h-3.098v19.686h2.944V17.81h.051c.447.765 1.048 1.32 1.808 1.667.77.35 1.606.528 2.45.522.947 0 1.8-.17 2.557-.509a5.714 5.714 0 001.935-1.393 5.954 5.954 0 001.213-2.082 7.835 7.835 0 00.413-2.58c0-.92-.146-1.778-.44-2.576a6.398 6.398 0 00-1.225-2.085 5.68 5.68 0 00-1.896-1.394 5.772 5.772 0 00-2.426-.506 5.93 5.93 0 00-1.55.182 5.18 5.18 0 00-1.187.47c-.344.19-.636.394-.878.61-.241.219-.439.43-.593.638h-.078V0zm6.931 12.031c.163.45.245.92.245 1.405 0 .487-.082.956-.246 1.407a3.545 3.545 0 01-1.87 2.03 3.574 3.574 0 01-1.524.314 3.525 3.525 0 01-3.394-2.343 4.098 4.098 0 01-.245-1.407c-.001-.48.081-.955.245-1.406A3.533 3.533 0 0153.186 10a3.584 3.584 0 011.523-.312c.568 0 1.076.104 1.523.312.434.2.825.482 1.15.833.317.349.557.746.722 1.2z"></path><path d="M65.882 7.187h-3.097v12.499h3.098v-6.693c0-.172.038-.433.115-.78.078-.348.233-.694.466-1.043.232-.346.567-.654 1.006-.923.439-.27 1.019-.405 1.742-.405.246 0 .492.023.735.066.257.045.512.101.763.169v-3.02a7.065 7.065 0 00-.556-.131 2.942 2.942 0 00-.554-.05c-.825 0-1.558.198-2.194.597-.636.4-1.128.964-1.473 1.693h-.051V7.187z"></path><path clip-rule="evenodd" d="M78.943 17.969h.079l-.002 1.718h2.788v-7.188c0-.294-.008-.638-.026-1.028a6.951 6.951 0 00-.166-1.21 5.142 5.142 0 00-.466-1.238 3.4 3.4 0 00-.916-1.08c-.397-.312-.895-.569-1.497-.77-.603-.198-1.343-.299-2.22-.299a8.83 8.83 0 00-2.853.469 6.012 6.012 0 00-2.413 1.536l1.626 1.642a4.743 4.743 0 013.304-1.303c.826 0 1.506.196 2.039.587.533.39.8.976.8 1.757v.338h-.773c-.551.001-1.103.014-1.654.039-.584.026-1.165.088-1.741.182a9.606 9.606 0 00-1.665.43 4.88 4.88 0 00-1.407.768 3.555 3.555 0 00-.967 1.199c-.241.478-.363 1.053-.363 1.731 0 .625.13 1.173.388 1.64.25.461.598.861 1.019 1.173.436.32.925.558 1.446.704a6.019 6.019 0 001.665.233 5.307 5.307 0 002.271-.481c.688-.321 1.257-.838 1.704-1.55zm-.749-3.881h.645v.703c0 .884-.254 1.584-.76 2.096-.51.513-1.295.768-2.362.768-.259 0-.516-.03-.775-.091a2.083 2.083 0 01-.698-.3 1.769 1.769 0 01-.503-.507c-.129-.2-.193-.447-.193-.742 0-.451.164-.803.49-1.055a3.465 3.465 0 011.202-.573 7.534 7.534 0 011.508-.247 22.752 22.752 0 011.446-.052z"></path><path d="M87.774 9.374c1.015 0 1.825.425 2.426 1.276l2.066-1.875a4.013 4.013 0 00-1.963-1.47 7.302 7.302 0 00-2.452-.43c-.618-.001-1.234.078-1.833.234a4.82 4.82 0 00-1.6.73c-.464.33-.839.75-1.123 1.262-.284.512-.425 1.116-.425 1.81 0 .798.163 1.424.49 1.876.322.446.747.807 1.239 1.052a6.22 6.22 0 001.614.547c.54.106 1.079.227 1.613.365.499.131.91.3 1.238.51.328.207.491.529.491.961 0 .245-.065.458-.194.64a1.578 1.578 0 01-.504.454c-.206.122-.429.21-.67.26a3.24 3.24 0 01-.697.079c-.654 0-1.21-.143-1.665-.428a5.852 5.852 0 01-1.277-1.11l-2.066 1.955c.637.729 1.36 1.232 2.168 1.51.81.278 1.696.417 2.66.417.642-.001 1.282-.07 1.91-.209a5.473 5.473 0 001.716-.676 3.78 3.78 0 001.238-1.238c.319-.51.477-1.14.477-1.888 0-.816-.163-1.458-.49-1.926a3.527 3.527 0 00-1.238-1.108 6.356 6.356 0 00-1.613-.598c-.577-.13-1.115-.256-1.614-.378-.5-.121-.911-.269-1.238-.442-.327-.173-.49-.452-.49-.834 0-.47.197-.806.593-1.016.396-.208.8-.312 1.213-.312zM9.95 10.026c.422.246.805.553 1.137.911l2.142-2.162a5.428 5.428 0 00-2.104-1.446 6.713 6.713 0 00-2.388-.455 7.386 7.386 0 00-2.632.468 6.316 6.316 0 00-2.142 1.329 6.266 6.266 0 00-1.432 2.07C2.177 11.55 2 12.449 2 13.437c0 .99.177 1.887.53 2.695.333.78.82 1.484 1.433 2.07a6.294 6.294 0 002.142 1.33 7.384 7.384 0 002.632.467c.276 0 .603-.03.982-.09a7.502 7.502 0 002.413-.846 4.813 4.813 0 001.072-.808l-2.066-2.24c-.278.37-.64.67-1.058.873-.413.198-.86.3-1.343.3-.567 0-1.075-.105-1.521-.312a3.553 3.553 0 01-1.873-2.032 4.107 4.107 0 01-.246-1.407c0-.48.082-.955.245-1.405a3.52 3.52 0 01.724-1.198c.32-.349.701-.625 1.15-.835.446-.207.954-.311 1.521-.311.428.003.846.12 1.214.339z"></path></svg>`,pi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cerebras</title><path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z"></path><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z"></path></svg>`,mi=`<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cloudflare</title><path d="M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437" fill="#F38020"></path><path d="M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777" fill="#FCAD32"></path></svg>`,hi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 242 24" xmlns="http://www.w3.org/2000/svg"><title>Cloudflare</title><path d="M28.4 2.395h5.386v14.606h9.326v4.736H28.4V2.395zM16.71 14.369c-.787 1.71-2.363 2.894-4.465 2.894-2.89 0-4.86-2.368-4.86-5.263 0-2.764 1.97-5.132 4.86-5.132 2.232 0 3.81 1.316 4.597 3.158h5.647C21.571 5.421 17.5 2 12.377 2 6.467 2 2 6.474 2 12s4.335 10 10.377 10c5.122 0 9.062-3.289 10.112-7.763H16.71v.132zM224.37 2.395h15.499v4.606h-10.114v2.894h9.194v4.21h-9.194v3.027H240v4.605h-15.63V2.395zm-24.693 0h9.062c2.89 0 4.991.79 6.305 2.105 1.182 1.052 1.708 2.632 1.708 4.474 0 2.894-1.576 4.868-3.94 5.921l4.596 6.71h-6.174l-3.939-5.79h-2.365v5.79h-5.386V2.395h.133zm8.8 9.211c1.838 0 2.889-.921 2.889-2.238 0-1.579-1.05-2.237-2.89-2.237l-3.546.001v4.605h3.547v-.13zm-29.028-9.343h5.122l8.144 19.474h-5.78l-1.444-3.421h-7.486l-1.315 3.42h-5.516l8.275-19.473zm4.598 11.842l-2.103-5.526-2.232 5.526h4.335zm-33.232-11.71h5.386v14.606h9.325v4.736h-14.711V2.395zm-22.854 0h15.367v4.737h-9.981v3.158h9.062v4.474h-9.062v6.973h-5.386V2.395zm-26.007 0h7.488c6.829 0 10.9 3.947 10.9 9.473 0 5.526-4.071 9.737-11.032 9.737h-7.356V2.395zm7.488 14.606c3.151 0 5.253-1.712 5.253-4.87 0-3.025-2.102-4.868-5.253-4.868h-2.233v9.87h2.233V17zm-33.625-3.816V2.395H81.2v10.658c0 2.763 1.445 4.078 3.547 4.078 2.101 0 3.547-1.315 3.547-3.946V2.263h5.385v10.659c0 6.183-3.548 8.946-9.063 8.946-5.386.132-8.8-2.63-8.8-8.683zm-27.19-1.053C48.628 6.474 53.095 2 59.006 2c5.91 0 10.375 4.474 10.375 10s-4.465 10-10.375 10c-6.042 0-10.377-4.342-10.377-9.868zm15.237 0c0-2.896-1.97-5.264-4.99-5.264-2.891 0-4.861 2.368-4.861 5.132s1.97 5.263 4.86 5.263c3.02 0 4.99-2.368 4.99-5.131z"></path></svg>`,gi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cloudflare</title><path d="M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437"></path><path d="M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777"></path></svg>`,_i=`<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemini</title><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="#3186FF"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-0-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-1-_R_0_)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#lobe-icons-gemini-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-0-_R_0_" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"></stop><stop offset="1" stop-color="#08B962" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-1-_R_0_" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"></stop><stop offset="1" stop-color="#F94543" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-2-_R_0_" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"></stop><stop offset=".46" stop-color="#FABC12" stop-opacity="0"></stop></linearGradient></defs></svg>`,vi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 98 24" xmlns="http://www.w3.org/2000/svg"><title>Gemini</title><path d="M21.186 12.67c0 2.649-.786 4.759-2.359 6.33-1.766 1.87-4.09 2.806-6.969 2.806-2.756 0-5.088-.953-6.996-2.86C2.954 17.04 2 14.693 2 11.904c0-2.789.954-5.137 2.862-7.043C6.77 2.953 9.102 2 11.858 2c1.396 0 2.712.247 3.949.741 1.236.495 2.252 1.192 3.047 2.092l-1.749 1.748c-.583-.706-1.338-1.258-2.266-1.655a7.49 7.49 0 00-2.981-.596c-2.067 0-3.816.715-5.247 2.145-1.413 1.448-2.12 3.257-2.12 5.428s.707 3.98 2.12 5.428c1.431 1.43 3.18 2.145 5.247 2.145 1.89 0 3.463-.53 4.717-1.588 1.254-1.06 1.979-2.516 2.173-4.37h-6.89v-2.277h9.196c.088.495.132.971.132 1.43m7.652-4.633c1.946 0 3.494.629 4.645 1.886 1.15 1.257 1.726 3.018 1.726 5.282l-.027.268H24.877c.036 1.284.464 2.318 1.285 3.102.82.785 1.802 1.177 2.944 1.177 1.57 0 2.802-.784 3.694-2.354l2.195 1.07a6.54 6.54 0 01-2.45 2.595C31.503 21.688 30.32 22 29 22c-1.927 0-3.516-.66-4.765-1.98-1.249-1.319-1.873-2.986-1.873-5.001 0-1.997.606-3.66 1.82-4.988 1.213-1.329 2.766-1.993 4.657-1.993m-.053 2.247c-.928 0-1.727.285-2.396.856-.67.57-1.11 1.337-1.325 2.3h7.522c-.071-.91-.442-1.663-1.111-2.26-.67-.598-1.566-.896-2.69-.896M39.247 21.53h-2.455V8.465h2.348v1.813h.107c.374-.64.947-1.173 1.721-1.6.774-.427 1.544-.64 2.309-.64.96 0 1.806.222 2.535.667a3.931 3.931 0 011.601 1.84c1.085-1.671 2.589-2.507 4.51-2.507 1.513 0 2.678.462 3.496 1.387.819.924 1.228 2.24 1.228 3.946v8.16h-2.455v-7.786c0-1.227-.223-2.112-.668-2.654-.444-.542-1.192-.813-2.241-.813-.943 0-1.735.4-2.375 1.2-.64.8-.961 1.742-.961 2.826v7.227h-2.455v-7.786c0-1.227-.223-2.112-.668-2.654-.444-.542-1.191-.813-2.241-.813-.943 0-1.735.4-2.375 1.2-.64.8-.961 1.742-.961 2.826v7.227zM61.911 3.93c0 .48-.17.89-.508 1.228a1.675 1.675 0 01-1.23.508c-.48 0-.89-.17-1.229-.508a1.673 1.673 0 01-.508-1.228c0-.481.17-.89.508-1.229a1.675 1.675 0 011.23-.508c.48 0 .89.17 1.23.508.338.338.507.748.507 1.228m-.11 4.514v13.088h-2.857V8.443h2.857zM80 3.93c0 .48-.17.89-.508 1.228a1.675 1.675 0 01-1.23.508c-.48 0-.89-.17-1.229-.508a1.673 1.673 0 01-.508-1.228c0-.481.17-.89.508-1.229a1.675 1.675 0 011.23-.508c.48 0 .89.17 1.23.508.338.338.507.748.507 1.228m-.11 4.514v13.088h-2.857V8.443h2.857zm-16.343.022h2.349v1.813h.107c.373-.64.947-1.173 1.721-1.6a4.935 4.935 0 012.415-.64c1.601 0 2.833.458 3.696 1.373.863.916 1.294 2.218 1.294 3.907v8.213h-2.455v-8.053c-.053-2.133-1.13-3.2-3.229-3.2-.978 0-1.797.395-2.455 1.187-.658.79-.987 1.737-.987 2.84v7.226h-2.456V8.465z"></path></svg>`,yi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemini</title><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"></path></svg>`,bi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 78 24" xmlns="http://www.w3.org/2000/svg"><title>Github</title><path d="M16.598 10.836v9.48c0 .066-.017.181-.1.214 0 0-2.07 1.47-5.484 1.47C6.888 22 2 20.712 2 12.223 2 3.734 6.275 1.983 10.45 2c3.613 0 5.07.81 5.303.958.066.083.1.149.1.231l-.697 2.94c0 .149-.149.33-.331.28-.597-.18-1.491-.544-3.596-.544-2.435 0-5.053.693-5.053 6.16 0 5.466 2.485 6.11 4.275 6.11 1.524 0 2.07-.181 2.07-.181v-3.799h-2.435c-.182 0-.315-.132-.315-.28v-3.04c0-.148.133-.28.315-.28h6.197c.182 0 .315.132.315.28zM76 14.684c0 5.664-1.84 7.283-5.054 7.283-2.717 0-4.175-1.37-4.175-1.37s-.067.759-.15.858c-.05.1-.132.132-.231.132h-2.453c-.165 0-.315-.132-.315-.28l.034-18.349a.29.29 0 01.281-.28h3.53a.29.29 0 01.281.28v6.226s1.359-.875 3.347-.875l-.016-.033c1.988 0 4.921.743 4.921 6.408zM47.865 2.71a.29.29 0 01.281.281V21.34a.29.29 0 01-.281.281h-3.53a.29.29 0 01-.281-.28l.033-7.845h-5.485v7.844a.29.29 0 01-.281.281h-3.53c-.132 0-.281-.132-.281-.28V2.99a.29.29 0 01.281-.28h3.53a.29.29 0 01.281.28v6.755h5.485V2.99a.29.29 0 01.282-.28h3.496zM61.55 8.722c.183 0 .315.132.315.28l-.033 12.337c0 .149-.1.281-.282.281h-2.22c-.116 0-.232-.066-.265-.148-.05-.1-.133-.744-.133-.744S57.061 22 54.758 22c-2.8 0-4.839-.908-4.839-4.542V9.02a.29.29 0 01.282-.28h3.546a.29.29 0 01.282.28v7.845c0 1.238.364 1.8 1.607 1.8 1.243 0 2.154-.644 2.154-.644V9.036c0-.182.1-.314.282-.314h3.48zm-28.84 9.861h.007c.14.029.239.154.234.296v2.477c0 .116-.05.231-.149.264-.166.083-1.226.363-2.104.363-1.922 0-4.74-.412-4.74-4.442v-5.417H24.12c-.149 0-.281-.132-.281-.314V9.564c0-.132.083-.248.215-.28.116-.017 1.922-.463 1.922-.463V5.237c0-.132.083-.215.232-.215h3.58c.148 0 .231.083.231.215v3.485h2.635c.132 0 .265.132.265.28v2.808c0 .182-.116.314-.265.314h-2.635v5.17c0 .777.448 1.372 1.74 1.372.41 0 .797-.081.951-.083zM22.28 8.705a.29.29 0 01.282.281v12.172c0 .297-.083.446-.414.446h-3.182c-.281 0-.497-.116-.497-.446V9.036c0-.182.133-.33.282-.33h3.53zm49.693 6.243c0-2.99-1.21-3.386-2.486-3.253-.994.066-1.79.561-1.79.561v5.813s.813.562 2.022.595c1.707.05 2.254-.562 2.254-3.716zM20.54 3.123a2.26 2.26 0 012.254 2.28A2.26 2.26 0 0120.54 7.68a2.266 2.266 0 01-2.286-2.279c0-1.271 1.01-2.279 2.286-2.279z"></path></svg>`,xi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Github</title><path d="M12 0c6.63 0 12 5.276 12 11.79-.001 5.067-3.29 9.567-8.175 11.187-.6.118-.825-.25-.825-.56 0-.398.015-1.665.015-3.242 0-1.105-.375-1.813-.81-2.181 2.67-.295 5.475-1.297 5.475-5.822 0-1.297-.465-2.344-1.23-3.169.12-.295.54-1.503-.12-3.125 0 0-1.005-.324-3.3 1.209a11.32 11.32 0 00-3-.398c-1.02 0-2.04.133-3 .398-2.295-1.518-3.3-1.209-3.3-1.209-.66 1.622-.24 2.83-.12 3.125-.765.825-1.23 1.887-1.23 3.169 0 4.51 2.79 5.527 5.46 5.822-.345.294-.66.81-.765 1.577-.69.31-2.415.81-3.495-.973-.225-.354-.9-1.223-1.845-1.209-1.005.015-.405.56.015.781.51.28 1.095 1.327 1.23 1.666.24.663 1.02 1.93 4.035 1.385 0 .988.015 1.916.015 2.196 0 .31-.225.664-.825.56C3.303 21.374-.003 16.867 0 11.791 0 5.276 5.37 0 12 0z"></path></svg>`,Si=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 64 24" xmlns="http://www.w3.org/2000/svg"><title>Groq</title><path d="M37.925 2.039c4.142 0 7.509 3.368 7.509 7.528l-.004.244c-.128 4.047-3.437 7.284-7.505 7.284-4.15 0-7.509-3.368-7.509-7.528s3.36-7.528 7.509-7.528zm-11.144-.023c.26 0 .522.015.775.046l.015-.008a7.464 7.464 0 012.922.969L29.09 5.468a4.619 4.619 0 00-2.309-.6h-.253l-.253.016c-.338.03-.66.092-.982.177-.621.169-1.196.469-1.703.869a4.062 4.062 0 00-1.418 2.322l-.04.234-.03.235c-.007.077-.023.161-.023.238l-.014 2.713v2.593l-.016 2.522h-2.815l-.03-4.973V8.852c0-.139.015-.262.022-.392.023-.262.062-.523.115-.777.1-.523.269-1.03.491-1.515a6.998 6.998 0 011.948-2.484 7.465 7.465 0 012.754-1.391c.49-.131.99-.216 1.495-.254.123-.008.253-.023.376-.023h.376zM37.925 4.86a4.7 4.7 0 00-4.694 4.706 4.7 4.7 0 004.694 4.706 4.7 4.7 0 004.694-4.706l-.005-.216a4.7 4.7 0 00-4.689-4.49zM9.578 2C5.428 1.96 2.038 5.298 2 9.458c-.038 4.16 3.29 7.559 7.44 7.597h2.608v-2.822h-2.47c-2.592.031-4.717-2.053-4.748-4.652a4.7 4.7 0 014.64-4.76h.108c2.52 0 4.577 1.992 4.696 4.49l.005.216v6.936c0 2.576-2.093 4.676-4.655 4.706a4.663 4.663 0 01-3.267-1.376l-1.994 2A7.46 7.46 0 009.57 24h.1c4.096-.062 7.386-3.391 7.409-7.497V9.35c-.1-4.09-3.428-7.35-7.501-7.35zm44.929.038c-4.15 0-7.509 3.368-7.509 7.528s3.36 7.528 7.509 7.528h2.57v-2.822h-2.57a4.7 4.7 0 01-4.694-4.706 4.7 4.7 0 014.694-4.706A4.707 4.707 0 0159.16 8.94l.024.22v14.456H62V9.566c-.008-4.152-3.352-7.527-7.493-7.527z"></path></svg>`,Ci=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Groq</title><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></svg>`,wi=`<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Mistral</title><path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path></svg>`,Ti=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 134 24" xmlns="http://www.w3.org/2000/svg"><title>Mistral</title><path d="M2 22.638V1h6.55l3.933 14.76L16.37 1h6.565v21.638H18.87V5.605l-4.302 17.033h-4.214L6.066 5.605v17.033H2zm25.011-17.8V1.002h4.155V4.84h-4.155zm0 17.801V6.964h4.155V22.64h-4.155zm6.707-4.473l4.17-.635c.177.807.536 1.42 1.079 1.838.986.864 3.753.796 4.702.036.588-.404.753-1.367.25-1.89-.206-.196-.67-.378-1.389-.545-3.351-.738-5.475-1.412-6.372-2.022-2.418-1.526-2.465-5.18-.252-6.952 1.76-1.8 7.852-1.78 9.788-.34 1.045.699 1.764 1.732 2.159 3.1l-3.918.723c-.413-1.402-1.417-1.886-2.957-1.89-1.094 0-1.878.154-2.35.458-.591.383-.651 1.179-.06 1.595.374.275 1.668.664 3.88 1.165 2.213.502 3.759 1.117 4.636 1.845 1.993 1.694 1.615 5.13-.503 6.79-2.087 2.01-8.091 2.034-10.416.25-1.247-.865-2.063-2.04-2.447-3.527zm31.88 4.472h-4.154V6.963h3.86v2.229c.66-1.053 1.253-1.747 1.78-2.081 1.374-.857 3.144-.536 4.532.28l-1.286 3.617c-1.877-1.247-3.849-.81-4.384 1.535-.468 1.352-.329 7.76-.347 10.096zm10.67-10.892l-3.77-.679c1.014-3.408 3.08-4.43 6.801-4.457 2.81.037 4.804.362 6.055 2.324.37.674.554 1.912.554 3.713.013 1.729-.178 6.48.155 7.889.133.654.382 1.355.747 2.103H82.7c-.124-.272-.411-1.286-.547-1.712-1.378 1.335-2.97 2.066-4.865 2.067-2.945.058-5.22-1.756-5.219-4.635-.011-1.72.87-3.225 2.418-3.963.764-.37 1.865-.691 3.304-.967 1.942-.364 3.287-.703 4.037-1.018v-.413c0-.797-.197-1.366-.591-1.705-.57-.582-3.147-.744-3.963-.074-.414.29-.75.8-1.006 1.527zm5.56 3.365c-.757.315-4.139.86-4.79 1.358-1.077.707-1.038 2.141-.163 2.967 1.017.987 2.672.733 3.8-.103 1.374-.983 1.117-2.455 1.153-4.221zm7.933 7.527V1h4.155v21.638H89.76zm35.917 0h-4.761l-1.892-4.915h-8.665l-1.789 4.915h-4.643L112.371 1h4.627l8.679 21.638h.001zm-8.058-8.56l-2.987-8.03-2.927 8.03h5.914zm10.004 8.56V1H132v21.638h-4.376zM58.98 6.964v3.307H56.14v6.317l.081 2.236c.434 1.136 1.612.712 2.743.332l.355 3.218c-2.416 1.02-6.87 1.14-7.215-2.346-.096-.537-.123-1.89-.133-3.44v-6.317h-1.908V6.965h1.908V3.85l4.17-2.42v5.535h2.838z"></path></svg>`,Ei=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Mistral</title><path clip-rule="evenodd" d="M3.428 3.4h3.429v3.428h3.429v3.429h-.002 3.431V6.828h3.427V3.4h3.43v13.714H24v3.429H13.714v-3.428h-3.428v-3.429h-3.43v3.428h3.43v3.429H0v-3.429h3.428V3.4zm10.286 13.715h3.428v-3.429h-3.427v3.429z"></path></svg>`,Di=`<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Nvidia</title><path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z" fill="#74B71B" fill-rule="nonzero"></path></svg>`,Oi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 111 24" xmlns="http://www.w3.org/2000/svg"><title>Nvidia</title><path d="M46.495 2.027v19.965h5.656V2.027h-5.656zM2 2v19.992h5.706V6.48l4.452.015a4.088 4.088 0 013.183 1.101c.894.951 1.26 2.483 1.26 5.287V22h5.529V10.949c0-7.883-5.035-8.946-9.972-8.946L2 2zm53.604.027v19.965h9.174c4.882 0 6.482-.81 8.208-2.626a11.156 11.156 0 002.008-7.136c.109-2.423-.53-4.82-1.831-6.869-2.095-2.788-5.114-3.332-9.621-3.332l-7.938-.002zm5.61 4.347h2.432c3.527 0 5.81 1.58 5.81 5.678 0 4.097-2.289 5.679-5.81 5.679h-2.432V6.374zM38.34 2.027L33.62 17.845 29.096 2.027h-6.102l6.46 19.965h8.151l6.51-19.965h-5.774zm39.285 19.965h5.657V2.03h-5.659l.002 19.963zm15.86-19.957l-7.898 19.95h5.578l1.25-3.526h9.346l1.183 3.526H109l-7.958-19.952-7.555.002zm3.673 3.64l3.427 9.346h-6.96l3.533-9.346z"></path></svg>`,ki=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Nvidia</title><path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z"></path></svg>`,Ai=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 138 24" xmlns="http://www.w3.org/2000/svg"><title>opencode</title><path d="M12.429 17.143H5.57v-6.857h6.858v6.857z" fill-opacity=".25"></path><path d="M12.428 6.857H5.571v10.286h6.857V6.857zm3.43 13.715H2.142V3.429h13.714v17.143z" fill-opacity=".75"></path><path d="M29.571 17.143h-6.857v-6.857h6.857v6.857z" fill-opacity=".25"></path><path d="M22.714 17.143h6.858V6.857h-6.858v10.286zM33 20.572H22.714V24h-3.428V3.43H33v17.143z" fill-opacity=".75"></path><path d="M50.143 13.714v3.429H39.857v-3.429h10.286z" fill-opacity=".25"></path><path d="M50.143 13.714H39.857v3.429h10.286v3.429H36.429V3.429h13.714v10.285zm-10.286-3.428h6.857V6.857h-6.857v3.429z" fill-opacity=".75"></path><path d="M63.857 20.571H57V10.286h6.857V20.57z" fill-opacity=".25"></path><path d="M63.857 6.857H57v13.715h-3.429V3.429h10.286v3.428zm3.429 13.715h-3.429V6.857h3.429v13.715z" fill-opacity=".75"></path><path d="M84.428 17.143H74.144v-6.857h10.285v6.857z" fill-opacity=".25"></path><path d="M84.428 6.857H74.144v10.286h10.285v3.429H70.715V3.429H84.43v3.428z"></path><path d="M98.143 17.143h-6.857v-6.857h6.857v6.857z" fill-opacity=".25"></path><path d="M98.143 6.857h-6.857v10.286h6.857V6.857zm3.428 13.715H87.857V3.429h13.714v17.143z"></path><path d="M115.286 17.143h-6.857v-6.857h6.857v6.857z" fill-opacity=".25"></path><path d="M115.286 6.857h-6.857v10.286h6.857V6.857zm3.428 13.714H105V3.43h10.286V0h3.428v20.571z"></path><path d="M135.857 13.714v3.429h-10.286v-3.429h10.286z" fill-opacity=".25"></path><path d="M125.571 6.857v3.429h6.858V6.857h-6.858zm10.286 6.857h-10.286v3.429h10.286v3.429h-13.714V3.429h13.714v10.285z"></path></svg>`,ji=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>opencode</title><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></svg>`,Mi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenRouter</title><path d="M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z"></path></svg>`,Ni=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 143 24" xmlns="http://www.w3.org/2000/svg"><title>OpenRouter</title><path d="M9.623 2c1.46 0 2.763.35 3.91 1.05 1.149.699 2.053 1.7 2.714 3.002.66 1.303.991 2.861.991 4.675 0 1.814-.33 3.372-.991 4.675-.66 1.302-1.565 2.303-2.713 3.003-1.148.7-2.452 1.049-3.91 1.049-1.465 0-2.772-.35-3.92-1.05-1.148-.699-2.052-1.701-2.713-3.007-.66-1.305-.991-2.862-.991-4.67 0-1.814.33-3.372.991-4.675.66-1.302 1.565-2.303 2.713-3.003C6.852 2.35 8.16 2 9.624 2zm0 2.34c-.974 0-1.844.244-2.61.734-.765.489-1.37 1.208-1.813 2.156-.443.949-.664 2.114-.664 3.497s.221 2.548.664 3.497c.444.948 1.048 1.667 1.813 2.156.766.49 1.636.735 2.61.735.97 0 1.838-.245 2.606-.735.768-.489 1.374-1.208 1.817-2.156.443-.949.665-2.114.665-3.497s-.222-2.548-.665-3.497c-.443-.948-1.049-1.667-1.817-2.156-.768-.49-1.637-.735-2.606-.735zm16.32 1.974c1.024 0 1.938.26 2.742.78s1.436 1.269 1.896 2.248c.46.979.69 2.156.69 3.534 0 1.377-.23 2.556-.686 3.538-.457.981-1.085 1.736-1.883 2.264-.799.529-1.71.793-2.734.793-.771 0-1.4-.13-1.887-.39-.488-.26-.869-.564-1.144-.913a6.908 6.908 0 01-.636-.929h-.149V24h-2.47V6.48h2.412v2.065h.207c.143-.265.35-.572.62-.92.27-.349.643-.655 1.123-.917.479-.263 1.112-.394 1.9-.394zm-.528 2.107c-.716 0-1.32.185-1.813.556-.493.37-.866.887-1.12 1.55-.253.665-.38 1.439-.38 2.324 0 .896.13 1.68.389 2.356.259.674.633 1.201 1.123 1.58s1.09.568 1.8.568c.738 0 1.355-.198 1.85-.593.496-.395.872-.933 1.128-1.613.256-.68.384-1.447.384-2.298 0-.84-.125-1.596-.376-2.265-.25-.67-.625-1.197-1.123-1.584-.498-.388-1.12-.581-1.862-.581zm13.387-2.107c.716 0 1.41.119 2.082.356a5.037 5.037 0 011.809 1.12c.534.51.955 1.169 1.263 1.979.309.81.463 1.793.463 2.949v.88l-9.016-.001.002.105c.03.732.178 1.364.445 1.895.3.597.72 1.052 1.26 1.364.539.313 1.17.469 1.89.469.469 0 .895-.068 1.28-.203a2.716 2.716 0 001-.61c.281-.271.496-.606.644-1.004l2.338.423a4.247 4.247 0 01-1.004 1.813c-.482.517-1.084.918-1.808 1.203-.725.284-1.549.427-2.474.427-1.25 0-2.325-.27-3.225-.809-.9-.54-1.594-1.3-2.082-2.281-.487-.982-.73-2.134-.73-3.455 0-1.306.243-2.456.73-3.451.488-.996 1.17-1.773 2.049-2.331.878-.559 1.906-.838 3.084-.838zm.017 2.049c-.694 0-1.298.17-1.813.51-.515.34-.911.782-1.19 1.327a3.778 3.778 0 00-.39 1.303l-.02.236h6.593c0-.653-.132-1.232-.397-1.738a3.022 3.022 0 00-1.11-1.199c-.477-.293-1.034-.44-1.673-.44zm10.29 3.293v7.566H46.64V6.48h2.37v2.074h.158a3.63 3.63 0 011.375-1.626c.625-.41 1.413-.614 2.366-.614.864 0 1.622.18 2.271.543.65.362 1.154.9 1.512 1.614.358.713.537 1.595.537 2.646v8.105h-2.47v-7.806c0-.924-.24-1.647-.718-2.17-.48-.522-1.137-.784-1.974-.784-.573 0-1.081.125-1.524.374a2.65 2.65 0 00-1.05 1.09c-.255.479-.383 1.055-.383 1.73zm17.122-9.424c1.31 0 2.4.227 3.266.68.868.454 1.516 1.08 1.945 1.88.43.799.645 1.72.645 2.766 0 1.04-.216 1.954-.649 2.742-.432.788-1.082 1.4-1.949 1.837a5.1 5.1 0 01-.501.22l3.743 6.865h-2.907l-3.436-6.43h-3.634v6.43h-2.552V2.232h6.029zm-.273 2.199h-3.204v6.155h3.237c.826 0 1.5-.119 2.02-.357s.901-.583 1.144-1.037c.242-.453.363-.998.363-1.634 0-.641-.122-1.197-.367-1.667-.246-.47-.628-.831-1.148-1.083-.52-.252-1.202-.377-2.045-.377zM79.66 6.314c1.19 0 2.227.273 3.114.821.886.548 1.575 1.316 2.065 2.306s.735 2.146.735 3.468c0 1.316-.245 2.466-.735 3.45-.49.985-1.179 1.751-2.065 2.299-.887.547-1.924.82-3.114.82s-2.227-.273-3.113-.82c-.887-.548-1.575-1.314-2.065-2.298-.49-.985-.735-2.135-.735-3.451 0-1.322.245-2.478.735-3.468.49-.99 1.178-1.758 2.065-2.306.886-.548 1.924-.821 3.113-.821zm.008 2.074c-.776 0-1.419.207-1.928.622-.51.415-.887.963-1.132 1.646a6.602 6.602 0 00-.367 2.244c0 .819.122 1.568.367 2.249.245.68.623 1.225 1.132 1.634.51.41 1.152.614 1.928.614.771 0 1.41-.205 1.917-.614.506-.41.882-.954 1.127-1.634.245-.68.367-1.43.367-2.249 0-.813-.122-1.56-.367-2.244-.245-.683-.62-1.231-1.127-1.646-.507-.415-1.146-.622-1.917-.622zm16.164 5.55V6.48h2.477v12.742h-2.428v-2.207h-.132a3.956 3.956 0 01-1.4 1.697c-.641.45-1.438.676-2.391.676-.815 0-1.535-.181-2.16-.544-.625-.362-1.115-.9-1.47-1.613-.355-.714-.533-1.596-.533-2.647V6.48h2.47v7.806c0 .868.24 1.56.718 2.074.48.514 1.102.771 1.867.771.462 0 .924-.116 1.383-.348.46-.232.843-.584 1.148-1.054.306-.47.456-1.067.45-1.792zm8.58-10.511v3.052h2.602v1.992h-2.602v7.01c0 .48.072.841.215 1.082.144.24.33.404.558.49.228.085.478.128.747.128.199 0 .372-.014.52-.041l.348-.067.446 2.05a4.42 4.42 0 01-.612.17c-.264.057-.594.09-.99.095a4.331 4.331 0 01-1.818-.349 3.12 3.12 0 01-1.362-1.128c-.347-.509-.52-1.148-.52-1.916l-.002-7.525h-1.857V6.48h1.857l.001-3.053h2.47zm9.961 2.887c.716 0 1.41.119 2.081.356a5.037 5.037 0 011.81 1.12c.533.51.954 1.169 1.263 1.979.308.81.462 1.793.462 2.949v.88l-9.016-.001.003.105c.03.732.178 1.364.445 1.895.3.597.72 1.052 1.259 1.364.54.313 1.17.469 1.891.469.468 0 .895-.068 1.28-.203a2.716 2.716 0 001-.61c.28-.271.495-.606.644-1.004l2.337.423a4.247 4.247 0 01-1.003 1.813c-.482.517-1.085.918-1.809 1.203-.724.284-1.548.427-2.473.427-1.25 0-2.325-.27-3.226-.809-.9-.54-1.594-1.3-2.08-2.281-.488-.982-.732-2.134-.732-3.455 0-1.306.244-2.456.731-3.451.487-.996 1.17-1.773 2.048-2.331.879-.559 1.907-.838 3.085-.838zm.017 2.049c-.694 0-1.298.17-1.813.51-.515.34-.911.782-1.19 1.327a3.778 3.778 0 00-.39 1.303l-.02.236h6.592c0-.653-.132-1.232-.396-1.738a3.022 3.022 0 00-1.11-1.199c-.477-.293-1.035-.44-1.673-.44zm7.821 10.859V6.48h2.387v2.024h.132a3.092 3.092 0 011.227-1.622 3.485 3.485 0 011.994-.593l.396.01.153.006c.212.011.379.025.5.042v2.372c-.1-.027-.275-.059-.529-.095a5.4 5.4 0 00-.76-.054c-.583 0-1.102.123-1.556.37a2.799 2.799 0 00-1.078 1.02 2.79 2.79 0 00-.397 1.48v7.782h-2.469z"></path></svg>`,Pi=`<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenRouter</title><path d="M16.804 1.957l7.22 4.105v.087L16.73 10.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147 1.352L8.345 11.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314 1.17.796 2.701 1.866 1.11.775 2.083 1.177 3.147 1.352l.3.045c.694.091 1.375.094 2.825.033l.022-2.159 7.22 4.105v.087L16.589 22l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997 21.997 0 00-.755-.498l-.467-.28a55.927 55.927 0 00-.76-.43C2.908 14.73.563 14.116 0 14.116V9.888l.14.004c.564-.007 2.91-.622 3.809-1.124l1.016-.58.438-.274c.428-.28 1.072-.726 2.686-1.853 1.621-1.133 3.186-1.78 4.881-2.059 1.152-.19 1.974-.213 3.814-.138l.02-1.907z"></path></svg>`,Fi=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 298.03 47.18" fill="currentColor" role="img" aria-label="OVHcloud">
|
|
10
10
|
<title>OVHcloud</title>
|
|
11
11
|
<path fill="currentColor" d="M110.11,40.31a40.1,40.1,0,0,1-3.74,44.49H84.93l6.6-11.67H82.8L93.09,55h8.78l8.24-14.67ZM67.77,84.8H45.91a39.59,39.59,0,0,1-3.79-44.59L56.3,64.84,71.93,37.62h23L67.78,84.78h0v0Z" transform="translate(-36.97 -37.62)"/>
|
|
12
12
|
<path fill="currentColor" d="M128.18,62.9c0-12.59,6.27-18.64,16.57-18.64s16.56,6.05,16.56,18.64S155,81.47,144.75,81.47,128.18,75.37,128.18,62.9Zm3.72,0c0,10.35,4.72,15.28,12.85,15.28s12.84-4.93,12.84-15.28-4.72-15.35-12.84-15.35S131.9,52.49,131.9,62.9Z" transform="translate(-36.97 -37.62)"/>
|
|
@@ -37,4 +37,4 @@ Error generating stack: `+e.message+`
|
|
|
37
37
|
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return i}}function z(e,t,n,r){return{debug:()=>e?.debugAll??e[t],key:!1,onChange:r}}function ma(e,t,n,r){let i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>i.getValue()??e.options.renderFallbackValue,getContext:R(()=>[e,n,t,i],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),z(e.options,`debugCells`,`cell.getContext`))};return e._features.forEach(r=>{r.createCell==null||r.createCell(i,n,t,e)},{}),i}function ha(e,t,n,r){let i={...e._getDefaultColumnDef(),...t},a=i.accessorKey,o=i.id??(a?typeof String.prototype.replaceAll==`function`?a.replaceAll(`.`,`_`):a.replace(/\./g,`_`):void 0)??(typeof i.header==`string`?i.header:void 0),s;if(i.accessorFn?s=i.accessorFn:a&&(s=a.includes(`.`)?e=>{let t=e;for(let e of a.split(`.`))t=t?.[e];return t}:e=>e[i.accessorKey]),!o)throw Error();let c={id:`${String(o)}`,accessorFn:s,parent:r,depth:n,columnDef:i,columns:[],getFlatColumns:R(()=>[!0],()=>[c,...c.columns?.flatMap(e=>e.getFlatColumns())],z(e.options,`debugColumns`,`column.getFlatColumns`)),getLeafColumns:R(()=>[e._getOrderColumnsFn()],e=>{var t;return(t=c.columns)!=null&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},z(e.options,`debugColumns`,`column.getLeafColumns`))};for(let t of e._features)t.createColumn==null||t.createColumn(c,e);return c}var ga=`debugHeaders`;function _a(e,t,n){let r={id:n.id??t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{t.createHeader==null||t.createHeader(r,e)}),r}var va={createTable:e=>{e.getHeaderGroups=R(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{let a=r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],o=i?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],s=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id)));return ya(t,[...a,...s,...o],e)},z(e.options,ga,`getHeaderGroups`)),e.getCenterHeaderGroups=R(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id))),ya(t,n,e,`center`)),z(e.options,ga,`getCenterHeaderGroups`)),e.getLeftHeaderGroups=R(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>ya(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`left`),z(e.options,ga,`getLeftHeaderGroups`)),e.getRightHeaderGroups=R(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>ya(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`right`),z(e.options,ga,`getRightHeaderGroups`)),e.getFooterGroups=R(()=>[e.getHeaderGroups()],e=>[...e].reverse(),z(e.options,ga,`getFooterGroups`)),e.getLeftFooterGroups=R(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),z(e.options,ga,`getLeftFooterGroups`)),e.getCenterFooterGroups=R(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),z(e.options,ga,`getCenterFooterGroups`)),e.getRightFooterGroups=R(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),z(e.options,ga,`getRightFooterGroups`)),e.getFlatHeaders=R(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),z(e.options,ga,`getFlatHeaders`)),e.getLeftFlatHeaders=R(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),z(e.options,ga,`getLeftFlatHeaders`)),e.getCenterFlatHeaders=R(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),z(e.options,ga,`getCenterFlatHeaders`)),e.getRightFlatHeaders=R(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),z(e.options,ga,`getRightFlatHeaders`)),e.getCenterLeafHeaders=R(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),z(e.options,ga,`getCenterLeafHeaders`)),e.getLeftLeafHeaders=R(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),z(e.options,ga,`getLeftLeafHeaders`)),e.getRightLeafHeaders=R(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),z(e.options,ga,`getRightLeafHeaders`)),e.getLeafHeaders=R(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>[...e[0]?.headers??[],...t[0]?.headers??[],...n[0]?.headers??[]].map(e=>e.getLeafHeaders()).flat(),z(e.options,ga,`getLeafHeaders`))}};function ya(e,t,n,r){let i=0,a=function(e,t){t===void 0&&(t=1),i=Math.max(i,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;(n=e.columns)!=null&&n.length&&a(e.columns,t+1)},0)};a(e);let o=[],s=(e,t)=>{let i={depth:t,id:[r,`${t}`].filter(Boolean).join(`_`),headers:[]},a=[];e.forEach(e=>{let o=[...a].reverse()[0],s=e.column.depth===i.depth,c,l=!1;if(s&&e.column.parent?c=e.column.parent:(c=e.column,l=!0),o&&o?.column===c)o.subHeaders.push(e);else{let i=_a(n,c,{id:[r,t,c.id,e?.id].filter(Boolean).join(`_`),isPlaceholder:l,placeholderId:l?`${a.filter(e=>e.column===c).length}`:void 0,depth:t,index:a.length});i.subHeaders.push(e),a.push(i)}i.headers.push(e),e.headerGroup=i}),o.push(i),t>0&&s(a,t-1)};s(t.map((e,t)=>_a(n,e,{depth:i,index:t})),i-1),o.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];e.subHeaders&&e.subHeaders.length?(r=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,r.push(i)})):t=1;let i=Math.min(...r);return n+=i,e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(o[0]?.headers??[]),o}var ba=(e,t,n,r,i,a,o)=>{let s={id:t,index:r,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return s._valuesCache[t]=n.accessorFn(s.original,r),s._valuesCache[t]},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return n.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t])},renderValue:t=>s.getValue(t)??e.options.renderFallbackValue,subRows:a??[],getLeafRows:()=>pa(s.subRows,e=>e.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:R(()=>[e.getAllLeafColumns()],t=>t.map(t=>ma(e,s,t,t.id)),z(e.options,`debugRows`,`getAllCells`)),_getAllCellsByColumnId:R(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),z(e.options,`debugRows`,`getAllCellsByColumnId`))};for(let t=0;t<e._features.length;t++){let n=e._features[t];n==null||n.createRow==null||n.createRow(s,e)}return s},xa={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Sa=(e,t,n)=>{var r,i;let a=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(a))};Sa.autoRemove=e=>Ma(e);var Ca=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Ca.autoRemove=e=>Ma(e);var wa=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};wa.autoRemove=e=>Ma(e);var Ta=(e,t,n)=>e.getValue(t)?.includes(n);Ta.autoRemove=e=>Ma(e);var Ea=(e,t,n)=>!n.some(n=>{var r;return!((r=e.getValue(t))!=null&&r.includes(n))});Ea.autoRemove=e=>Ma(e)||!(e!=null&&e.length);var Da=(e,t,n)=>n.some(n=>e.getValue(t)?.includes(n));Da.autoRemove=e=>Ma(e)||!(e!=null&&e.length);var Oa=(e,t,n)=>e.getValue(t)===n;Oa.autoRemove=e=>Ma(e);var ka=(e,t,n)=>e.getValue(t)==n;ka.autoRemove=e=>Ma(e);var Aa=(e,t,n)=>{let[r,i]=n,a=e.getValue(t);return a>=r&&a<=i};Aa.resolveFilterValue=e=>{let[t,n]=e,r=typeof t==`number`?t:parseFloat(t),i=typeof n==`number`?n:parseFloat(n),a=t===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(i)?1/0:i;if(a>o){let e=a;a=o,o=e}return[a,o]},Aa.autoRemove=e=>Ma(e)||Ma(e[0])&&Ma(e[1]);var ja={includesString:Sa,includesStringSensitive:Ca,equalsString:wa,arrIncludes:Ta,arrIncludesAll:Ea,arrIncludesSome:Da,equals:Oa,weakEquals:ka,inNumberRange:Aa};function Ma(e){return e==null||e===``}var Na={getDefaultColumnDef:()=>({filterFn:`auto`}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:ua(`columnFilters`,e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);return typeof n==`string`?ja.includesString:typeof n==`number`?ja.inNumberRange:typeof n==`boolean`||typeof n==`object`&&n?ja.equals:Array.isArray(n)?ja.arrIncludes:ja.weakEquals},e.getFilterFn=()=>da(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn===`auto`?e.getAutoFilterFn():t.options.filterFns?.[e.columnDef.filterFn]??ja[e.columnDef.filterFn],e.getCanFilter=()=>(e.columnDef.enableColumnFilter??!0)&&(t.options.enableColumnFilters??!0)&&(t.options.enableFilters??!0)&&!!e.accessorFn,e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(t=>t.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>t.getState().columnFilters?.findIndex(t=>t.id===e.id)??-1,e.setFilterValue=n=>{t.setColumnFilters(t=>{let r=e.getFilterFn(),i=t?.find(t=>t.id===e.id),a=la(n,i?i.value:void 0);if(Pa(r,a,e))return t?.filter(t=>t.id!==e.id)??[];let o={id:e.id,value:a};return i?t?.map(t=>t.id===e.id?o:t)??[]:t!=null&&t.length?[...t,o]:[o]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(e=>la(t,e)?.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&Pa(t.getFilterFn(),e.value,t))}))},e.resetColumnFilters=t=>{e.setColumnFilters(t?[]:e.initialState?.columnFilters??[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Pa(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||t===void 0||typeof t==`string`&&!t}var Fa={sum:(e,t,n)=>n.reduce((t,n)=>{let r=n.getValue(e);return t+(typeof r==`number`?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r>n||r===void 0&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r<n||r===void 0&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r===void 0?n>=n&&(r=i=n):(r>n&&(r=n),i<n&&(i=n)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let i=t.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!fa(n))return;if(n.length===1)return n[0];let r=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2==0?(i[r-1]+i[r])/2:i[r]},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},Ia={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return((t=e.getValue())==null||t.toString==null?void 0:t.toString())??null},aggregationFn:`auto`}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:ua(`grouping`,e),groupedColumnMode:`reorder`}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(t=>t!==e.id):[...t??[],e.id])},e.getCanGroup=()=>(e.columnDef.enableGrouping??!0)&&(t.options.enableGrouping??!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue),e.getIsGrouped=()=>t.getState().grouping?.includes(e.id),e.getGroupedIndex=()=>t.getState().grouping?.indexOf(e.id),e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);if(typeof n==`number`)return Fa.sum;if(Object.prototype.toString.call(n)===`[object Date]`)return Fa.extent},e.getAggregationFn=()=>{if(!e)throw Error();return da(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn===`auto`?e.getAutoAggregationFn():t.options.aggregationFns?.[e.columnDef.aggregationFn]??Fa[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{e.setGrouping(t?[]:e.initialState?.grouping??[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((t=n.subRows)!=null&&t.length)}}};function La(e,t,n){if(!(t!=null&&t.length)||!n)return e;let r=e.filter(e=>!t.includes(e.id));return n===`remove`?r:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...r]}var Ra={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:ua(`columnOrder`,e)}),createColumn:(e,t)=>{e.getIndex=R(e=>[Ya(t,e)],t=>t.findIndex(t=>t.id===e.id),z(t.options,`debugColumns`,`getIndex`)),e.getIsFirstColumn=n=>Ya(t,n)[0]?.id===e.id,e.getIsLastColumn=n=>{let r=Ya(t,n);return r[r.length-1]?.id===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},e._getOrderColumnsFn=R(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let i=[];if(!(e!=null&&e.length))i=r;else{let t=[...e],n=[...r];for(;n.length&&t.length;){let e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&i.push(n.splice(r,1)[0])}i=[...i,...n]}return La(i,t,n)},z(e.options,`debugTable`,`_getOrderColumnsFn`))}},za=()=>({left:[],right:[]}),Ba={getInitialState:e=>({columnPinning:za(),...e}),getDefaultOptions:e=>({onColumnPinningChange:ua(`columnPinning`,e)}),createColumn:(e,t)=>{e.pin=n=>{let r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>n===`right`?{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:[...(e?.right??[]).filter(e=>!(r!=null&&r.includes(e))),...r]}:n===`left`?{left:[...(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),...r],right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))}:{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))})},e.getCanPin=()=>e.getLeafColumns().some(e=>(e.columnDef.enablePinning??!0)&&(t.options.enableColumnPinning??t.options.enablePinning??!0)),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:r,right:i}=t.getState().columnPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`left`:o?`right`:!1},e.getPinnedIndex=()=>{var n;let r=e.getIsPinned();return r?((n=t.getState().columnPinning)==null||(n=n[r])==null?void 0:n.indexOf(e.id))??-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=R(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.column.id))},z(t.options,`debugRows`,`getCenterVisibleCells`)),e.getLeftVisibleCells=R(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`left`})),z(t.options,`debugRows`,`getLeftVisibleCells`)),e.getRightVisibleCells=R(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`right`})),z(t.options,`debugRows`,`getRightVisibleCells`))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>e.setColumnPinning(t?za():e.initialState?.columnPinning??za()),e.getIsSomeColumnsPinned=t=>{let n=e.getState().columnPinning;return t?!!n[t]?.length:!!(n.left?.length||n.right?.length)},e.getLeftLeafColumns=R(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),z(e.options,`debugColumns`,`getLeftLeafColumns`)),e.getRightLeafColumns=R(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),z(e.options,`debugColumns`,`getRightLeafColumns`)),e.getCenterLeafColumns=R(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.id))},z(e.options,`debugColumns`,`getCenterLeafColumns`))}};function Va(e){return e||(typeof document<`u`?document:null)}var Ha={size:150,minSize:20,maxSize:2**53-1},Ua=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Wa={getDefaultColumnDef:()=>Ha,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ua(),...e}),getDefaultOptions:e=>({columnResizeMode:`onEnd`,columnResizeDirection:`ltr`,onColumnSizingChange:ua(`columnSizing`,e),onColumnSizingInfoChange:ua(`columnSizingInfo`,e)}),createColumn:(e,t)=>{e.getSize=()=>{let n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??Ha.minSize,n??e.columnDef.size??Ha.size),e.columnDef.maxSize??Ha.maxSize)},e.getStart=R(e=>[e,Ya(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),z(t.options,`debugColumns`,`getStart`)),e.getAfter=R(e=>[e,Ya(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),z(t.options,`debugColumns`,`getAfter`)),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let r=t.getColumn(e.column.id),i=r?.getCanResize();return a=>{if(!r||!i||(a.persist==null||a.persist(),qa(a)&&a.touches&&a.touches.length>1))return;let o=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],c=qa(a)?Math.round(a.touches[0].clientX):a.clientX,l={},u=(e,n)=>{typeof n==`number`&&(t.setColumnSizingInfo(e=>{let r=t.options.columnResizeDirection===`rtl`?-1:1,i=(n-(e?.startOffset??0))*r,a=Math.max(i/(e?.startSize??0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;l[t]=Math.round(Math.max(n+n*a,0)*100)/100}),{...e,deltaOffset:i,deltaPercentage:a}}),(t.options.columnResizeMode===`onChange`||e===`end`)&&t.setColumnSizing(e=>({...e,...l})))},d=e=>u(`move`,e),f=e=>{u(`end`,e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=Va(n),m={moveHandler:e=>d(e.clientX),upHandler:e=>{p?.removeEventListener(`mousemove`,m.moveHandler),p?.removeEventListener(`mouseup`,m.upHandler),f(e.clientX)}},h={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{p?.removeEventListener(`touchmove`,h.moveHandler),p?.removeEventListener(`touchend`,h.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0]?.clientX)}},g=Ka()?{passive:!1}:!1;qa(a)?(p?.addEventListener(`touchmove`,h.moveHandler,g),p?.addEventListener(`touchend`,h.upHandler,g)):(p?.addEventListener(`mousemove`,m.moveHandler,g),p?.addEventListener(`mouseup`,m.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},e.resetHeaderSizeInfo=t=>{e.setColumnSizingInfo(t?Ua():e.initialState.columnSizingInfo??Ua())},e.getTotalSize=()=>e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getLeftTotalSize=()=>e.getLeftHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getCenterTotalSize=()=>e.getCenterHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getRightTotalSize=()=>e.getRightHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0}},Ga=null;function Ka(){if(typeof Ga==`boolean`)return Ga;let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener(`test`,n,t),window.removeEventListener(`test`,n)}catch{e=!1}return Ga=e,Ga}function qa(e){return e.type===`touchstart`}var Ja={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:ua(`columnVisibility`,e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{let n=e.columns;return(n.length?n.some(e=>e.getIsVisible()):t.getState().columnVisibility?.[e.id])??!0},e.getCanHide=()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=R(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),z(t.options,`debugRows`,`_getAllVisibleCells`)),e.getVisibleCells=R(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],z(t.options,`debugRows`,`getVisibleCells`))},createTable:e=>{let t=(t,n)=>R(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join(`_`)],e=>e.filter(e=>e.getIsVisible==null?void 0:e.getIsVisible()),z(e.options,`debugColumns`,t));e.getVisibleFlatColumns=t(`getVisibleFlatColumns`,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(`getVisibleLeafColumns`,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(`getLeftVisibleLeafColumns`,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(`getRightVisibleLeafColumns`,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(`getCenterVisibleLeafColumns`,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},e.toggleAllColumnsVisible=t=>{t??=!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(n.getCanHide!=null&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(e.getIsVisible!=null&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>e.getIsVisible==null?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{e.toggleAllColumnsVisible(t.target?.checked)}}};function Ya(e,t){return t?t===`center`?e.getCenterVisibleLeafColumns():t===`left`?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}var Xa={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,`__global__`),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,`__global__`),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,`__global__`),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Za={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:ua(`globalFilter`,e),globalFilterFn:`auto`,getColumnCanGlobalFilter:t=>{var n;let r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r==`string`||typeof r==`number`}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>(e.columnDef.enableGlobalFilter??!0)&&(t.options.enableGlobalFilter??!0)&&(t.options.enableFilters??!0)&&((t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn},createTable:e=>{e.getGlobalAutoFilterFn=()=>ja.includesString,e.getGlobalFilterFn=()=>{let{globalFilterFn:t}=e.options;return da(t)?t:t===`auto`?e.getGlobalAutoFilterFn():e.options.filterFns?.[t]??ja[t]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Qa={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:ua(`expanded`,e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{e.setExpanded(t?{}:e.initialState?.expanded??{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{t.persist==null||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return t===!0||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return typeof t==`boolean`?t===!0:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(`.`);t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{let i=r===!0?!0:!!(r!=null&&r[e.id]),a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=r,n??=!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){let{[e.id]:t,...n}=a;return n}return r})},e.getIsExpanded=()=>{let n=t.getState().expanded;return!!((t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))??(n===!0||n?.[e.id]))},e.getCanExpand=()=>{var n;return(t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!!((n=e.subRows)!=null&&n.length))},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},$a=0,eo=10,to=()=>({pageIndex:$a,pageSize:eo}),no={getInitialState:e=>({...e,pagination:{...to(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:ua(`pagination`,e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(e=>la(t,e)),e.resetPagination=t=>{e.setPagination(t?to():e.initialState.pagination??to())},e.setPageIndex=t=>{e.setPagination(n=>{let r=la(t,n.pageIndex),i=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n;e.setPageIndex(t?$a:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageIndex)??$a)},e.resetPageSize=t=>{var n;e.setPageSize(t?eo:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageSize)??eo)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,la(t,e.pageSize)),r=e.pageSize*e.pageIndex,i=Math.floor(r/n);return{...e,pageIndex:i,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{let r=la(t,e.options.pageCount??-1);return typeof r==`number`&&(r=Math.max(-1,r)),{...n,pageCount:r}}),e.getPageOptions=R(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},z(e.options,`debugTable`,`getPageOptions`)),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return n===-1?!0:n===0?!1:t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>e.options.pageCount??Math.ceil(e.getRowCount()/e.getState().pagination.pageSize),e.getRowCount=()=>e.options.rowCount??e.getPrePaginationRowModel().rows.length}},ro=()=>({top:[],bottom:[]}),io={getInitialState:e=>({rowPinning:ro(),...e}),getDefaultOptions:e=>({onRowPinningChange:ua(`rowPinning`,e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{let a=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],o=i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...o,e.id,...a]);t.setRowPinning(e=>n===`bottom`?{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:[...(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)]}:n===`top`?{top:[...(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)],bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))}:{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))})},e.getCanPin=()=>{let{enableRowPinning:n,enablePinning:r}=t.options;return typeof n==`function`?n(e):n??r??!0},e.getIsPinned=()=>{let n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`top`:o?`bottom`:!1},e.getPinnedIndex=()=>{let n=e.getIsPinned();return n?((n===`top`?t.getTopRows():t.getBottomRows())?.map(e=>{let{id:t}=e;return t}))?.indexOf(e.id)??-1:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>e.setRowPinning(t?ro():e.initialState?.rowPinning??ro()),e.getIsSomeRowsPinned=t=>{let n=e.getState().rowPinning;return t?!!n[t]?.length:!!(n.top?.length||n.bottom?.length)},e._getPinnedRows=(t,n,r)=>(e.options.keepPinnedRows??!0?(n??[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(n??[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r})),e.getTopRows=R(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,`top`),z(e.options,`debugRows`,`getTopRows`)),e.getBottomRows=R(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,`bottom`),z(e.options,`debugRows`,`getBottomRows`)),e.getCenterRows=R(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let r=new Set([...t??[],...n??[]]);return e.filter(e=>!r.has(e.id))},z(e.options,`debugRows`,`getCenterRows`))}},ao={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:ua(`rowSelection`,e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=t===void 0?!e.getIsAllRowsSelected():t;let r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):i.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let r=t===void 0?!e.getIsAllPageRowsSelected():t,i={...n};return e.getRowModel().rows.forEach(t=>{oo(i,t.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=R(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?so(e,n):{rows:[],flatRows:[],rowsById:{}},z(e.options,`debugTable`,`getSelectedRowModel`)),e.getFilteredSelectedRowModel=R(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?so(e,n):{rows:[],flatRows:[],rowsById:{}},z(e.options,`debugTable`,`getFilteredSelectedRowModel`)),e.getGroupedSelectedRowModel=R(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?so(e,n):{rows:[],flatRows:[],rowsById:{}},z(e.options,`debugTable`,`getGroupedSelectedRowModel`)),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),r=!!(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{let t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{let i=e.getIsSelected();t.setRowSelection(a=>{if(n=n===void 0?!i:n,e.getCanSelect()&&i===n)return a;let o={...a};return oo(o,e.id,n,r?.selectChildren??!0,t),o})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return co(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return lo(e,n)===`some`},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return lo(e,n)===`all`},e.getCanSelect=()=>typeof t.options.enableRowSelection==`function`?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,e.getCanSelectSubRows=()=>typeof t.options.enableSubRowSelection==`function`?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,e.getCanMultiSelect=()=>typeof t.options.enableMultiRowSelection==`function`?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{t&&e.toggleSelected(n.target?.checked)}}}},oo=(e,t,n,r,i)=>{var a;let o=i.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(a=o.subRows)!=null&&a.length&&o.getCanSelectSubRows()&&o.subRows.forEach(t=>oo(e,t.id,n,r,i))};function so(e,t){let n=e.getState().rowSelection,r=[],i={},a=function(e,t){return e.map(e=>{var t;let o=co(e,n);if(o&&(r.push(e),i[e.id]=e),(t=e.subRows)!=null&&t.length&&(e={...e,subRows:a(e.subRows)}),o)return e}).filter(Boolean)};return{rows:a(t.rows),flatRows:r,rowsById:i}}function co(e,t){return t[e.id]??!1}function lo(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,a=!1;return e.subRows.forEach(e=>{if(!(a&&!i)&&(e.getCanSelect()&&(co(e,t)?a=!0:i=!1),e.subRows&&e.subRows.length)){let n=lo(e,t);n===`all`?a=!0:(n===`some`&&(a=!0),i=!1)}}),i?`all`:a?`some`:!1}var uo=/([0-9]+)/gm,fo=(e,t,n)=>yo(vo(e.getValue(n)).toLowerCase(),vo(t.getValue(n)).toLowerCase()),po=(e,t,n)=>yo(vo(e.getValue(n)),vo(t.getValue(n))),B=(e,t,n)=>_o(vo(e.getValue(n)).toLowerCase(),vo(t.getValue(n)).toLowerCase()),mo=(e,t,n)=>_o(vo(e.getValue(n)),vo(t.getValue(n))),ho=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},go=(e,t,n)=>_o(e.getValue(n),t.getValue(n));function _o(e,t){return e===t?0:e>t?1:-1}function vo(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function yo(e,t){let n=e.split(uo).filter(Boolean),r=t.split(uo).filter(Boolean);for(;n.length&&r.length;){let e=n.shift(),t=r.shift(),i=parseInt(e,10),a=parseInt(t,10),o=[i,a].sort();if(isNaN(o[0])){if(e>t)return 1;if(t>e)return-1;continue}if(isNaN(o[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}var bo={alphanumeric:fo,alphanumericCaseSensitive:po,text:B,textCaseSensitive:mo,datetime:ho,basic:go},xo=[va,Ja,Ra,Ba,xa,Na,Xa,Za,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:`auto`,sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:ua(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),r=!1;for(let t of n){let n=t?.getValue(e.id);if(Object.prototype.toString.call(n)===`[object Date]`)return bo.datetime;if(typeof n==`string`&&(r=!0,n.split(uo).length>1))return bo.alphanumeric}return r?bo.text:bo.basic},e.getAutoSortDir=()=>typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id)==`string`?`asc`:`desc`,e.getSortingFn=()=>{if(!e)throw Error();return da(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn===`auto`?e.getAutoSortingFn():t.options.sortingFns?.[e.columnDef.sortingFn]??bo[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{let i=e.getNextSortingOrder(),a=n!=null;t.setSorting(o=>{let s=o?.find(t=>t.id===e.id),c=o?.findIndex(t=>t.id===e.id),l=[],u,d=a?n:i===`desc`;return u=o!=null&&o.length&&e.getCanMultiSort()&&r?s?`toggle`:`add`:o!=null&&o.length&&c!==o.length-1?`replace`:s?`toggle`:`replace`,u===`toggle`&&(a||i||(u=`remove`)),u===`add`?(l=[...o,{id:e.id,desc:d}],l.splice(0,l.length-(t.options.maxMultiSortColCount??2**53-1))):l=u===`toggle`?o.map(t=>t.id===e.id?{...t,desc:d}:t):u===`remove`?o.filter(t=>t.id!==e.id):[{id:e.id,desc:d}],l})},e.getFirstSortDir=()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??e.getAutoSortDir()===`desc`?`desc`:`asc`,e.getNextSortingOrder=n=>{let r=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==r&&(t.options.enableSortingRemoval??!0)&&(!n||(t.options.enableMultiRemove??!0))?!1:i===`desc`?`asc`:`desc`:r},e.getCanSort=()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,e.getCanMultiSort=()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,e.getIsSorted=()=>{let n=t.getState().sorting?.find(t=>t.id===e.id);return n?n.desc?`desc`:`asc`:!1},e.getSortIndex=()=>t.getState().sorting?.findIndex(t=>t.id===e.id)??-1,e.clearSorting=()=>{t.setSorting(t=>t!=null&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{e.setSorting(t?[]:e.initialState?.sorting??[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Ia,Qa,no,io,ao,Wa];function So(e){let t=[...xo,...e._features??[]],n={_features:t},r=n._features.reduce((e,t)=>Object.assign(e,t.getDefaultOptions==null?void 0:t.getDefaultOptions(n)),{}),i=e=>n.options.mergeOptions?n.options.mergeOptions(r,e):{...r,...e},a={...e.initialState??{}};n._features.forEach(e=>{a=(e.getInitialState==null?void 0:e.getInitialState(a))??a});let o=[],s=!1,c={_features:t,options:{...r,...e},initialState:a,_queue:e=>{o.push(e),s||(s=!0,Promise.resolve().then(()=>{for(;o.length;)o.shift()();s=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{n.options=i(la(e,n.options))},getState:()=>n.options.state,setState:e=>{n.options.onStateChange==null||n.options.onStateChange(e)},_getRowId:(e,t,r)=>(n.options.getRowId==null?void 0:n.options.getRowId(e,t,r))??`${r?[r.id,t].join(`.`):t}`,getCoreRowModel:()=>(n._getCoreRowModel||=n.options.getCoreRowModel(n),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?n.getPrePaginationRowModel():n.getRowModel()).rowsById[e];if(!r&&(r=n.getCoreRowModel().rowsById[e],!r))throw Error();return r},_getDefaultColumnDef:R(()=>[n.options.defaultColumn],e=>(e??={},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return((t=e.renderValue())==null||t.toString==null?void 0:t.toString())??null},...n._features.reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef==null?void 0:t.getDefaultColumnDef()),{}),...e}),z(e,`debugColumns`,`_getDefaultColumnDef`)),_getColumnDefs:()=>n.options.columns,getAllColumns:R(()=>[n._getColumnDefs()],e=>{let t=function(e,r,i){return i===void 0&&(i=0),e.map(e=>{let a=ha(n,e,i,r),o=e;return a.columns=o.columns?t(o.columns,a,i+1):[],a})};return t(e)},z(e,`debugColumns`,`getAllColumns`)),getAllFlatColumns:R(()=>[n.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),z(e,`debugColumns`,`getAllFlatColumns`)),_getAllFlatColumnsById:R(()=>[n.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),z(e,`debugColumns`,`getAllFlatColumnsById`)),getAllLeafColumns:R(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),z(e,`debugColumns`,`getAllLeafColumns`)),getColumn:e=>n._getAllFlatColumnsById()[e]};Object.assign(n,c);for(let e=0;e<n._features.length;e++){let t=n._features[e];t==null||t.createTable==null||t.createTable(n)}return n}function Co(){return e=>R(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},r=function(t,i,a){i===void 0&&(i=0);let o=[];for(let c=0;c<t.length;c++){let l=ba(e,e._getRowId(t[c],c,a),t[c],c,i,void 0,a?.id);if(n.flatRows.push(l),n.rowsById[l.id]=l,o.push(l),e.options.getSubRows){var s;l.originalSubRows=e.options.getSubRows(t[c],c),(s=l.originalSubRows)!=null&&s.length&&(l.subRows=r(l.originalSubRows,i+1,l))}}return o};return n.rows=r(t),n},z(e.options,`debugTable`,`getRowModel`,()=>e._autoResetPageIndex()))}function wo(e,t){return e?To(e)?v.createElement(e,t):e:null}function To(e){return Eo(e)||typeof e==`function`||Do(e)}function Eo(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Do(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function Oo(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=v.useState(()=>({current:So(t)})),[r,i]=v.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),e.onStateChange==null||e.onStateChange(t)}})),n.current}var ko=h();function Ao(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function jo(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function Mo(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var No=(e,t)=>Math.abs(e-t)<1.01,Po=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Fo,Io=()=>{if(Fo!==void 0)return Fo;if(typeof navigator>`u`)return Fo=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Fo=!0;let e=navigator.maxTouchPoints;return Fo=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Lo=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Ro=e=>e,zo=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},Bo=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Lo(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Lo(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Vo={passive:!0},Ho=typeof window>`u`?!0:`onscrollend`in window,Uo=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Ho,o=0,s=a?null:Po(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Vo),a&&r.addEventListener(`scrollend`,u,Vo),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},Wo=(e,t)=>Uo(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Go=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Ko=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},qo=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ro,rangeExtractor:zo,onChange:()=>{},measureElement:Go,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=jo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!Io()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,Vo),e.addEventListener(`touchend`,n,Vo),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(Io()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=jo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=jo(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=Ao(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=jo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?Yo({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:r===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=jo(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=jo(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return Mo(t[Jo(0,t.length-1,r?e=>n[e*2]:e=>Mo(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(Io()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&No(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},Jo=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Yo({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){let a=e.length-1,o=i?e=>i[e*2]:t=>e[t].start,s=i?e=>i[e*2]+i[e*2+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:a};let c=Jo(0,a,o,n),l=c;if(r===1)for(;l<a&&s(l)<n+t;)l++;else if(r>1){let i=Array(r).fill(0);for(;l<a&&i.some(e=>e<n+t);){let t=e[l];i[t.lane]=t.end,l++}let o=Array(r).fill(n+t);for(;c>=0&&o.some(e=>e>=n);){let t=e[c];o[t.lane]=t.start,c--}c=Math.max(0,c-c%r),l=Math.min(a,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}var Xo=typeof document<`u`?v.useLayoutEffect:v.useEffect;function Zo({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=v.useReducer(e=>e+1,0)[1],a=v.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}let r=!!e.options.horizontal,i=t.mode===`transform`,o=r?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let n of c){let a=n.start-s,c=e.elementsCache.get(n.key);c&&t.lastPositions.get(c)!==a&&(t.lastPositions.set(c,a),i?c.style.transform=r?`translate3d(${a}px, 0, 0)`:`translate3d(0, ${a}px, 0)`:c.style[o]=`${a}px`)}},s={...r,onChange:(t,n)=>{var s;let c=a.current,l=!0;if(c.enabled){o(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,ko.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[c]=v.useState(()=>{let e=new qo(s);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return c.setOptions(s),Xo(()=>c._didMount(),[]),Xo(()=>c._willUpdate()),Xo(()=>{o(c)}),c}function Qo(e){return Zo({observeElementRect:Bo,observeElementOffset:Wo,scrollToFn:Ko,...e})}var $o=`fcm.columnSizing.v1`,es=1200;function ts(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e))typeof r==`number`&&Number.isFinite(r)&&r>0&&(t[n]=r);return t}function ns(e,t=24,n=es){let r={};for(let[i,a]of Object.entries(e||{}))typeof a!=`number`||!Number.isFinite(a)||(r[i]=Math.max(t,Math.min(n,Math.round(a))));return r}function rs(e,t,n){return{...e||{},...t||{},...n||{}}}function is(e,t){if(!e||!t)return!1;for(let n of Object.keys(e))if(e[n]!==t[n])return!0;return!1}function as(e,t,n={}){if(!e||typeof e.getItem!=`function`)return n;let r;try{r=e.getItem(t)}catch{return n}if(!r)return n;let i;try{i=JSON.parse(r)}catch{return n}return ts(i)}function os(e,t,n){if(!e||typeof e.setItem!=`function`)return!1;try{return e.setItem(t,JSON.stringify(n)),!0}catch{return!1}}function ss(e,t){if(!e||typeof e.removeItem!=`function`)return!1;try{return e.removeItem(t),!0}catch{return!1}}function cs(e){let t=(0,v.useRef)(e);t.current=e;let[n,r]=(0,v.useState)(()=>typeof window>`u`?{...e}:rs(e,as(window.localStorage,$o,{}),{})),i=(0,v.useRef)(n);return i.current=n,(0,v.useEffect)(()=>{if(!(typeof window>`u`||!window.localStorage)){if(!is(n,t.current)){ss(window.localStorage,$o);return}os(window.localStorage,$o,n)}},[n]),(0,v.useEffect)(()=>{if(typeof window>`u`||!window.addEventListener)return;let e=e=>{if(e.key!==`fcm.columnSizing.v1`)return;let n=as(window.localStorage,$o,{});r(e=>rs(t.current,n,e))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),{columnSizing:n,setColumnSizing:(0,v.useCallback)(e=>{r(t=>{let n=typeof e==`function`?e(t):e;return{...t,...ns(n)}})},[]),resetColumnSizing:(0,v.useCallback)(()=>{r({...t.current})},[]),hasCustomSizing:is(n,t.current)}}var ls={mood:`_mood_f9he5_1`},us={Perfect:`🟩`,Normal:`🟢`,Spiky:`🟡`,Slow:`🟠`,"Very Slow":`🔴`,Overloaded:`🔥`,Unstable:`🟥`,"Not Active":`⚫`,Pending:`⏳`,Usable:`🟠`};function ds({verdict:e}){let t=us[e]||`❔`;return(0,P.jsx)(`span`,{className:ls.mood,children:t})}var fs={badge:`_badge_5yv5w_1`,tier_splus:`_tier_splus_5yv5w_11`,tier_s:`_tier_s_5yv5w_11`,tier_aplus:`_tier_aplus_5yv5w_13`,tier_a:`_tier_a_5yv5w_13`,tier_aminus:`_tier_aminus_5yv5w_15`,tier_bplus:`_tier_bplus_5yv5w_16`,tier_b:`_tier_b_5yv5w_16`,tier_c:`_tier_c_5yv5w_18`};function ps({tier:e}){let t=e.replace(`+`,`plus`).replace(`-`,`minus`).toLowerCase();return(0,P.jsx)(`span`,{className:`${fs.badge} ${fs[`tier_${t}`]}`,children:e})}var ms={dot:`_dot_729ui_1`,up:`_up_729ui_9`,down:`_down_729ui_10`,timeout:`_timeout_729ui_11`,pending:`_pending_729ui_12`,pulse:`_pulse_729ui_1`,notInSet:`_notInSet_729ui_16`};function hs({status:e,inRouterSet:t=!0}){let n=e===`up`?ms.up:e===`timeout`?ms.timeout:e===`down`?ms.down:e===`pending`&&!t?ms.notInSet:ms.pending;return(0,P.jsx)(`span`,{className:`${ms.dot} ${n}`})}var gs={cell:`_cell_ptyq8_1`,value:`_value_ptyq8_10`,fast:`_fast_ptyq8_11`,medium:`_medium_ptyq8_12`,slow:`_slow_ptyq8_13`,none:`_none_ptyq8_14`,spinner:`_spinner_ptyq8_26`,pingRing:`_pingRing_ptyq8_1`,pingPulse:`_pingPulse_ptyq8_1`};function _s(e){return e==null||e===1/0?gs.none:e<500?gs.fast:e<1500?gs.medium:gs.slow}function vs({ms:e,isPinging:t}){return e==null?(0,P.jsx)(`span`,{className:`${gs.cell} ${gs.none}`,children:t?(0,P.jsx)(`span`,{className:gs.spinner,title:`Testing…`}):`—`}):(0,P.jsxs)(`span`,{className:`${gs.cell} ${_s(e)}`,children:[(0,P.jsx)(`span`,{className:gs.value,children:e}),t&&(0,P.jsx)(`span`,{className:gs.spinner})]})}var ys={wrapper:`_wrapper_1t2v0_7`,key:`_key_1t2v0_17`,slash:`_slash_1t2v0_24`};function bs({size:e=14,title:t=`No API key configured`}){let n=Math.max(1,Math.round(e*.07));return(0,P.jsxs)(`span`,{className:ys.wrapper,style:{width:`${e}px`,height:`${e}px`},role:`img`,"aria-label":t,title:t,children:[(0,P.jsx)(Sr,{size:e,stroke:1.5,className:ys.key}),(0,P.jsx)(`svg`,{className:ys.slash,width:e+n*2,height:e+n*2,viewBox:`0 0 ${e+n*2} ${e+n*2}`,"aria-hidden":`true`,focusable:`false`,children:(0,P.jsx)(`line`,{x1:n+1,y1:n+1,x2:n+e-1,y2:n+e-1,stroke:`var(--color-danger, #ff4444)`,strokeWidth:`1.1`,strokeLinecap:`round`})})]})}var xs={cell:`_cell_8296g_7`,up:`_up_8296g_19`,warning:`_warning_8296g_20`,error:`_error_8296g_21`,errorBold:`_errorBold_8296g_22`,dim:`_dim_8296g_23`,notInSet:`_notInSet_8296g_26`,noKey:`_noKey_8296g_33`,noKeyText:`_noKeyText_8296g_43`},Ss=12,Cs=1.8,ws={success:`var(--color-success, #00ff88)`,warning:`var(--color-warning, #ffaa00)`,danger:`var(--color-danger, #ff4444)`,dim:`var(--color-text-dim, #444)`},Ts={404:`404 NOT FOUND`,410:`410 GONE`,429:`429 TRY LATER`,500:`500 ERROR`,502:`502 ERROR`,503:`503 ERROR`,504:`504 TIMEOUT`},Es={429:{Icon:gr,color:ws.danger},404:{Icon:ur,color:ws.danger},500:{Icon:Bn,color:ws.danger},502:{Icon:Nr,color:ws.danger},503:{Icon:ar,color:ws.danger},504:{Icon:ir,color:ws.danger}};function Ds(e,t,n){return e===`noauth`?`NO KEY`:e===`auth_error`?`AUTH FAIL`:e===`pending`?n?`wait`:`NOT IN SET`:e===`timeout`?`TIMEOUT`:e===`down`?Ts[t]||t||`ERROR`:e===`up`?`UP`:`?`}function Os(e,t){return e===`noauth`?xs.noKey:e===`up`?xs.up:e===`down`?xs.error:e===`timeout`?xs.warning:e===`auth_error`?xs.errorBold:e===`pending`?t?xs.warning:xs.notInSet:xs.dim}function ks({status:e,httpCode:t,inRouterSet:n=!0}){let r=Ds(e,t,n),i=Os(e,n),a=e===`noauth`,o=e===`pending`&&!n,s=null,c=null;return e===`up`?(s=Xn,c=ws.success):e===`timeout`?(s=br,c=ws.warning):o?(s=nr,c=ws.dim):e===`pending`?(s=xr,c=ws.warning):e===`auth_error`?(s=Er,c=ws.danger):e===`down`&&Es[t]?(s=Es[t].Icon,c=Es[t].color):e===`down`&&(s=Kn,c=ws.danger),(0,P.jsxs)(`span`,{className:`${xs.cell} ${i}`,children:[a?(0,P.jsx)(bs,{size:15,title:`No API key configured for this provider`}):s?(0,P.jsx)(s,{size:Ss,stroke:Cs,style:{color:c,flexShrink:0},"aria-hidden":`true`}):null,(0,P.jsx)(`span`,{className:a?xs.noKeyText:void 0,children:r})]})}var As={cell:`_cell_18ls4_1`,bar:`_bar_18ls4_2`,fill:`_fill_18ls4_3`,high:`_high_18ls4_4`,mid:`_mid_18ls4_5`,low:`_low_18ls4_6`,value:`_value_18ls4_7`,none:`_none_18ls4_8`};function js({score:e}){if(e==null||e<0)return(0,P.jsx)(`span`,{className:As.none,children:`—`});let t=e>=70?`high`:e>=40?`mid`:`low`;return(0,P.jsxs)(`div`,{className:As.cell,children:[(0,P.jsx)(`div`,{className:As.bar,children:(0,P.jsx)(`div`,{className:`${As.fill} ${As[t]}`,style:{width:`${e}%`}})}),(0,P.jsx)(`span`,{className:As.value,children:e})]})}var Ms={badge:`_badge_5z8g9_5`,emoji:`_emoji_5z8g9_16`,text:`_text_5z8g9_17`,perfect:`_perfect_5z8g9_20`,normal:`_normal_5z8g9_21`,slow:`_slow_5z8g9_22`,spiky:`_spiky_5z8g9_23`,veryslow:`_veryslow_5z8g9_24`,overloaded:`_overloaded_5z8g9_25`,unstable:`_unstable_5z8g9_26`,notactive:`_notactive_5z8g9_27`,pending:`_pending_5z8g9_28`},Ns={Perfect:{emoji:`🟩`,text:`Perfect`,cls:`perfect`},Normal:{emoji:`🟢`,text:`Normal`,cls:`normal`},Spiky:{emoji:`🟡`,text:`Spiky`,cls:`spiky`},Slow:{emoji:`🟠`,text:`Slow`,cls:`slow`},"Very Slow":{emoji:`🔴`,text:`Very Slow`,cls:`veryslow`},Overloaded:{emoji:`🔥`,text:`Overloaded`,cls:`overloaded`},Unstable:{emoji:`🟥`,text:`Unstable`,cls:`unstable`},"Not Active":{emoji:`⚫`,text:`Not Active`,cls:`notactive`},Pending:{emoji:`⏳`,text:`Pending`,cls:`pending`}},Ps={emoji:`❔`,text:`Pending`,cls:`pending`};function Fs({verdict:e,httpCode:t}){let n=e?Ns[e]||{emoji:`❔`,text:e,cls:`pending`}:Ps;return(0,P.jsxs)(`span`,{className:`${Ms.badge} ${Ms[n.cls]}`,children:[(0,P.jsx)(`span`,{className:Ms.emoji,children:n.emoji}),(0,P.jsx)(`span`,{className:Ms.text,children:n.text})]})}function Is(e,t){return typeof window>`u`||!window.document?.documentElement?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function Ls(e){return e<500?Is(`--color-success`,`#00ff88`):e<1500?Is(`--color-warning`,`#ffaa00`):Is(`--color-danger`,`#ff4444`)}function Rs({history:e}){return(0,v.useMemo)(()=>{if(!e||e.length<2)return null;let t=e.filter(e=>e.code===`200`||e.code===`401`);if(t.length<2)return null;let n=t.map(e=>e.ms),r=Math.max(...n,1),i=Math.min(...n,0),a=r-i||1,o=80/(n.length-1),s=n.map((e,t)=>{let n=t*o,r=22-(e-i)/a*18-2;return`${n.toFixed(1)},${r.toFixed(1)}`}).join(` `),c=n[n.length-1],l=Ls(c),u=((n.length-1)*o).toFixed(1),d=(22-(c-i)/a*18-2).toFixed(1);return(0,P.jsxs)(`svg`,{className:`sparkline-svg`,width:80,height:22,viewBox:`0 0 80 22`,children:[(0,P.jsx)(`polyline`,{fill:`none`,stroke:l,strokeWidth:`1.5`,strokeLinejoin:`round`,strokeLinecap:`round`,points:s,opacity:`0.85`}),(0,P.jsx)(`circle`,{cx:u,cy:d,r:`2.5`,fill:l})]})},[e])||null}var zs={cell:`_cell_c8a3q_1`,value:`_value_c8a3q_13`,fast:`_fast_c8a3q_14`,medium:`_medium_c8a3q_15`,slow:`_slow_c8a3q_16`,dim:`_dim_c8a3q_17`,running:`_running_c8a3q_18`,badge:`_badge_c8a3q_19`,runningCell:`_runningCell_c8a3q_22`,benchmarkSpinner:`_benchmarkSpinner_c8a3q_34`,benchSpin:`_benchSpin_c8a3q_1`,benchPulse:`_benchPulse_c8a3q_1`};function Bs(e,t){if(t)return{text:`RUN`,badge:``};if(!e||!e.ok)return{text:e?.code||`—`,badge:``};let n=e.totalMs/1e3,r=e.retries>0?`↻${e.retries}`:``;return{text:n>=10?`${n.toFixed(0)}s`:`${n.toFixed(1)}s`,badge:r}}function Vs({result:e,isRunning:t}){let{text:n,badge:r}=Bs(e,t),i=e?.ok?zs.fast:e?zs.slow:zs.dim;return(0,P.jsx)(`span`,{className:`${zs.cell} ${t?zs.runningCell:``}`,children:t?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:zs.benchmarkSpinner}),(0,P.jsx)(`span`,{className:`${zs.value} ${zs.running}`,children:n})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`${zs.value} ${i}`,children:n}),r&&(0,P.jsx)(`span`,{className:zs.badge,children:r})]})})}var Hs={cell:`_cell_1bcec_1`,value:`_value_1bcec_13`,fast:`_fast_1bcec_14`,slow:`_slow_1bcec_15`,dim:`_dim_1bcec_16`,running:`_running_1bcec_17`,badge:`_badge_1bcec_18`,runningCell:`_runningCell_1bcec_21`,miniSpinner:`_miniSpinner_1bcec_29`,miniSpin:`_miniSpin_1bcec_29`};function Us(e,t){if(t)return{text:`…`,badge:``};if(!e||!e.ok)return{text:`—`,badge:``};let n=e.retries>0?`↻${e.retries}`:``;return{text:String(Math.round(e.tokensPerSecond??0)),badge:n}}function Ws({result:e,isRunning:t}){let{text:n,badge:r}=Us(e,t),i=e?.ok?Hs.fast:e?Hs.slow:Hs.dim;return(0,P.jsx)(`span`,{className:`${Hs.cell} ${t?Hs.runningCell:``}`,children:t?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:Hs.miniSpinner}),(0,P.jsx)(`span`,{className:`${Hs.value} ${Hs.running}`,children:n})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`${Hs.value} ${i}`,children:n}),r&&(0,P.jsx)(`span`,{className:Hs.badge,children:r})]})})}var Gs={button:`_button_5uv8q_2`,icon:`_icon_5uv8q_24`};function Ks({model:e,toolMode:t=`opencode`,onLaunch:n,variant:r=`default`,disabled:i=!1}){let a=bn(t),o=r===`icon`?`Install endpoint`:`Install endpoint in ${a.emoji} ${a.label}`;return(0,P.jsxs)(`button`,{type:`button`,className:`${Gs.button} ${Gs[r]||``}`,disabled:i||!e,onClick:t=>{t.stopPropagation(),e&&n?.(e)},title:e?`Install ${e.label} endpoint in ${a.label}`:`Select a model first`,"aria-label":e?`Install ${e.label} endpoint in ${a.label}`:`Install selected model endpoint`,children:[(0,P.jsx)(Mr,{size:r===`icon`?13:14,stroke:1.8}),r!==`icon`&&(0,P.jsx)(`span`,{children:o})]})}var V={root:`_root_1fq95_12`,transcript:`_transcript_1fq95_21`,full:`_full_1fq95_30`,mini:`_mini_1fq95_34`,empty:`_empty_1fq95_40`,emptyIcon:`_emptyIcon_1fq95_57`,emptyTitle:`_emptyTitle_1fq95_62`,emptyHint:`_emptyHint_1fq95_72`,suggestions:`_suggestions_1fq95_93`,message:`_message_1fq95_102`,msgIn:`_msgIn_1fq95_1`,user:`_user_1fq95_120`,assistant:`_assistant_1fq95_125`,bubbleRow:`_bubbleRow_1fq95_130`,role:`_role_1fq95_137`,copyBtn:`_copyBtn_1fq95_145`,bubble:`_bubble_1fq95_130`,typing:`_typing_1fq95_192`,codeBlock:`_codeBlock_1fq95_198`,cursor:`_cursor_1fq95_211`,blink:`_blink_1fq95_1`,meta:`_meta_1fq95_227`,metaChip:`_metaChip_1fq95_242`,target:`_target_1fq95_255`,modelChip:`_modelChip_1fq95_261`,latencyChip:`_latencyChip_1fq95_266`,tpsChip:`_tpsChip_1fq95_271`,errorChip:`_errorChip_1fq95_276`,inputBar:`_inputBar_1fq95_282`,input:`_input_1fq95_282`,sendBtn:`_sendBtn_1fq95_333`,stopBtn:`_stopBtn_1fq95_334`,spin:`_spin_1fq95_376`};function qs(e){if(!e)return null;let t=e.indexOf(`/`);return t<=0?{provider:e,model:``}:{provider:e.slice(0,t),model:e.slice(t+1)}}function Js(e){return!e||typeof e!=`object`?typeof e==`string`?e:null:typeof e.error==`string`?e.error:e.error&&typeof e.error==`object`&&typeof e.error.message==`string`?e.error.message:typeof e.message==`string`?e.message:null}function Ys(e){return e?e.split(/(```[\s\S]*?```)/g).map((e,t)=>{let n=e.match(/^```([a-zA-Z0-9_-]+)?\n?([\s\S]*?)```$/);return n?(0,P.jsx)(`pre`,{className:V.codeBlock,children:(0,P.jsx)(`code`,{children:n[2].replace(/\n$/,``)})},t):(0,P.jsx)(`span`,{children:e},t)}):null}function Xs(e){return Number.isFinite(e)?(Math.round(e*10)/10).toFixed(1):`—`}var Zs=(0,v.forwardRef)(function({model:e,disabled:t=!1,variant:n=`mini`,stream:r=!0,placeholder:i,targetLabel:a,suggestions:o=[],emptyTitle:s,emptyHint:c,emptyIcon:l,children:u,onTurnComplete:d},f){let[p,m]=(0,v.useState)([]),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(null),S=(0,v.useRef)(null),C=(0,v.useRef)(null),w=(0,v.useRef)(null),ee=(0,v.useRef)([]);(0,v.useImperativeHandle)(f,()=>({clear:()=>{S.current&&=(S.current.abort(),null),y(!1),m([])},focus:()=>C.current?.focus(),getMessages:()=>ee.current}),[]),(0,v.useEffect)(()=>{ee.current=p},[p]),(0,v.useEffect)(()=>{if(typeof d!=`function`)return;let e=p[p.length-1];if(!e||e.pending||!(e.role===`assistant`&&(e.meta||e.error||e.aborted)))return;let t=p.reduce((e,t)=>e+(t.meta?.tokens||0),0);d({count:p.length,totalTokens:t,lastMeta:e.meta})},[p,d]),(0,v.useEffect)(()=>{let e=w.current;e&&(e.scrollTop=e.scrollHeight)},[p,_]);let T=(0,v.useCallback)(()=>{S.current&&=(S.current.abort(),null),y(!1)},[]),E=(0,v.useCallback)(async n=>{let i=(typeof n==`string`?n:h).trim();if(!i||_||t)return;g(``);let o=a||(e===`fcm`?`fcm`:e),s={id:`u-${Date.now()}`,role:`user`,content:i,ts:Date.now(),target:o},c=`a-${Date.now()}`,l={id:c,role:`assistant`,content:``,pending:!0},u=[...p,s];m([...u,l]),y(!0);let d=new AbortController;S.current=d;let f=Date.now(),v=e=>m(t=>t.map(t=>t.id===c?{...t,...e}:t)),b=null,x=t=>(b=t.headers.get(`x-fcm-router-model`)||(e===`fcm`?null:e),qs(b)||{provider:e,model:``}),C={model:e||`fcm`,messages:u.map(({role:e,content:t})=>({role:e,content:t})),stream:r,temperature:.7};try{let e=await fetch(`/api/playground/chat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(C),signal:d.signal});if(!e.ok){v({pending:!1,error:Js(await e.json().catch(()=>null))||`Request failed (${e.status})`});return}if(r){let t=e.body?.getReader();if(!t)throw Error(`No stream reader available`);let n=new TextDecoder,r=``,i=``,a=x(e),o=0,s=!!b;for(;;){let{value:e,done:c}=await t.read();if(c)break;r+=n.decode(e,{stream:!0});let l=r.split(/\n\n/);r=l.pop()||``;for(let e of l){let t=e.split(/\n/);for(let e of t){if(!e.startsWith(`data:`))continue;let t=e.slice(5).trim();if(t!==`[DONE]`)try{let e=JSON.parse(t),n=e?.choices?.[0]?.delta?.content;typeof n==`string`&&n&&(i+=n,v({content:i,pending:!1}));let r=e?.usage;r&&(typeof r.completion_tokens==`number`?o=r.completion_tokens:typeof r.total_tokens==`number`&&(o=r.total_tokens)),!s&&e?.x_routed_via&&(a={provider:e.x_routed_via,model:e.x_routed_model||``},s=!0)}catch{}}}}let c=Date.now()-f,l=o>0&&c>0?o/(c/1e3):null;v({pending:!1,meta:{provider:a.provider,model:a.model,latencyMs:c,tokens:o,tps:l}})}else{let t=await e.json().catch(()=>null),n=t?.choices?.[0]?.message?.content||``,r=t?.usage||{},i=typeof r.completion_tokens==`number`?r.completion_tokens:r.total_tokens||0,a=x(e),o=Date.now()-f,s=i>0&&o>0?i/(o/1e3):null;v({pending:!1,content:n,meta:{provider:a.provider,model:a.model,latencyMs:o,tokens:i,tps:s}})}}catch(e){e?.name===`AbortError`?v({pending:!1,aborted:!0}):v({pending:!1,error:e?.message||String(e)})}finally{y(!1),S.current=null}},[h,_,t,p,e,r,a,d]),D=(0,v.useCallback)(e=>{(e.key===`Enter`&&!e.shiftKey&&n===`full`||e.key===`Enter`&&n===`mini`)&&(e.preventDefault(),E())},[E,n]),te=(0,v.useCallback)(async(e,t)=>{try{await navigator.clipboard.writeText(t||``),x(e),setTimeout(()=>x(null),1500)}catch{}},[]),ne=(0,v.useCallback)(e=>{if(g(e.target.value),n===`full`){let t=e.target;t.style.height=`auto`,t.style.height=`${Math.min(t.scrollHeight,180)}px`}},[n]),re=n===`full`?V.full:V.mini;return(0,P.jsxs)(`div`,{className:`${V.root} ${re}`,children:[u,(0,P.jsx)(`div`,{className:V.transcript,ref:w,children:p.length===0?(0,P.jsxs)(`div`,{className:V.empty,children:[l&&(0,P.jsx)(`div`,{className:V.emptyIcon,children:l}),s&&(0,P.jsx)(`div`,{className:V.emptyTitle,children:s}),c&&(0,P.jsx)(`div`,{className:V.emptyHint,children:c}),o.length>0&&(0,P.jsx)(`div`,{className:V.suggestions,children:o.map(e=>(0,P.jsx)(`button`,{className:V.chip,onClick:()=>void E(e),type:`button`,children:e},e))})]}):p.map((e,t)=>(0,P.jsxs)(`div`,{className:`${V.message} ${V[e.role]||``}`,children:[(0,P.jsxs)(`div`,{className:V.bubbleRow,children:[(0,P.jsx)(`span`,{className:V.role,children:e.role}),e.role===`assistant`&&e.content&&(0,P.jsx)(`button`,{className:V.copyBtn,onClick:()=>te(t,e.content),title:`Copy reply`,type:`button`,children:b===t?(0,P.jsx)(Yn,{size:11}):(0,P.jsx)(sr,{size:11})})]}),(0,P.jsx)(`div`,{className:V.bubble,children:e.role===`assistant`?(0,P.jsxs)(P.Fragment,{children:[e.content?Ys(e.content):null,_&&t===p.length-1&&e.pending&&!e.aborted&&(0,P.jsx)(`span`,{className:V.cursor}),!e.content&&e.pending&&(0,P.jsx)(`span`,{className:V.typing,children:`…`})]}):e.content}),e.role===`user`&&e.target&&(0,P.jsx)(`div`,{className:V.meta,children:(0,P.jsxs)(`span`,{className:`${V.metaChip} ${V.target}`,title:`Addressed model`,children:[(0,P.jsx)(qn,{size:11}),e.target]})}),e.role===`assistant`&&!e.pending&&e.meta&&(0,P.jsxs)(`div`,{className:V.meta,children:[e.meta.provider&&(0,P.jsxs)(`span`,{className:`${V.metaChip} ${V.modelChip}`,title:`Model that served this reply`,children:[(0,P.jsx)(qn,{size:11}),e.meta.provider,e.meta.model?`/${e.meta.model}`:``]}),e.meta.latencyMs!=null&&(0,P.jsxs)(`span`,{className:`${V.metaChip} ${V.latencyChip}`,title:`Response time (send → end)`,children:[(0,P.jsx)(ir,{size:11}),Math.round(e.meta.latencyMs),`ms`]}),e.meta.tokens>0&&(0,P.jsxs)(`span`,{className:V.metaChip,title:`Completion tokens`,children:[e.meta.tokens,` tok`]}),e.meta.tps!=null&&e.meta.tps>0&&(0,P.jsxs)(`span`,{className:`${V.metaChip} ${V.tpsChip}`,title:`Tokens per second`,children:[(0,P.jsx)(Ir,{size:11}),Xs(e.meta.tps),` t/s`]})]}),e.role===`assistant`&&e.error&&(0,P.jsx)(`div`,{className:V.meta,children:(0,P.jsxs)(`span`,{className:`${V.metaChip} ${V.errorChip}`,title:`Error`,children:[(0,P.jsx)(Vn,{size:11}),e.error]})}),e.role===`assistant`&&e.aborted&&!e.error&&(0,P.jsx)(`div`,{className:V.meta,children:(0,P.jsx)(`span`,{className:V.metaChip,children:`stopped`})})]},e.id||t))}),(0,P.jsxs)(`div`,{className:V.inputBar,children:[(0,P.jsx)(`textarea`,{ref:C,className:V.input,placeholder:i||(n===`full`?`Ask anything. Enter to send, Shift+Enter for a newline.`:`Send a message…`),value:h,onChange:ne,onKeyDown:D,disabled:t,rows:1}),_?(0,P.jsxs)(`button`,{className:V.stopBtn,onClick:T,title:`Stop generating`,type:`button`,children:[(0,P.jsx)(Tr,{size:14,className:V.spin}),n===`full`?`Stop`:``]}):(0,P.jsxs)(`button`,{className:V.sendBtn,onClick:()=>void E(),disabled:t||!h.trim(),title:`Send`,type:`button`,children:[(0,P.jsx)(zr,{size:14}),n===`full`?`Send`:``]})]})]})}),H={row:`_row_15axt_10`,slideDown:`_slideDown_15axt_1`,grid:`_grid_15axt_29`,col:`_col_15axt_37`,colTitle:`_colTitle_15axt_43`,statGrid:`_statGrid_15axt_53`,statItem:`_statItem_15axt_59`,statLabel:`_statLabel_15axt_65`,statValue:`_statValue_15axt_73`,infoActions:`_infoActions_15axt_82`,favBtn:`_favBtn_15axt_90`,favBtnActive:`_favBtnActive_15axt_109`,playgroundHeader:`_playgroundHeader_15axt_119`,playgroundWrap:`_playgroundWrap_15axt_128`,inputRow:`_inputRow_15axt_135`,inputField:`_inputField_15axt_140`,sendBtn:`_sendBtn_15axt_163`,responseArea:`_responseArea_15axt_188`,responsePlaceholder:`_responsePlaceholder_15axt_205`,benchBtn:`_benchBtn_15axt_211`,metricsGrid:`_metricsGrid_15axt_244`,metricCard:`_metricCard_15axt_250`,metricLabel:`_metricLabel_15axt_260`,metricValue:`_metricValue_15axt_268`,streamText:`_streamText_15axt_275`,progressBar:`_progressBar_15axt_291`,progressFill:`_progressFill_15axt_299`,sweHigh:`_sweHigh_15axt_307`,sweMid:`_sweMid_15axt_308`,sweLow:`_sweLow_15axt_309`,pingFast:`_pingFast_15axt_314`,pingMedium:`_pingMedium_15axt_315`,pingSlow:`_pingSlow_15axt_316`,pingNone:`_pingNone_15axt_317`,noKeyBanner:`_noKeyBanner_15axt_323`,noKeyIcon:`_noKeyIcon_15axt_336`,spinning:`_spinning_15axt_342`,spin:`_spin_15axt_342`};function Qs({label:e,children:t}){return(0,P.jsxs)(`div`,{className:H.statItem,children:[(0,P.jsx)(`span`,{className:H.statLabel,children:e}),(0,P.jsx)(`span`,{className:H.statValue,children:t})]})}function $s({model:e,favorites:t,onBenchmark:n,onLaunch:r,onToast:i,toolMode:a=`opencode`,onSetToolMode:o,onCycleToolMode:s,onOpenFallback:c}){let[l,u]=(0,v.useState)(`idle`),[d,f]=(0,v.useState)({latency:null,tokens:null,tps:null}),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(0),_=(0,v.useRef)(null);if(!e)return null;let y=t?.isFavorite(e)??!1,b=Ut(e.avg),x=b.cls||Wt(e.avg),S=(0,v.useCallback)(async()=>{if(l===`running`)return;u(`running`),f({latency:null,tokens:null,tps:null}),m(``),g(0),_.current&&_.current.abort();let t=new AbortController;_.current=t;try{let n=await fetch(`/api/benchmark-stream`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({providerKey:e.providerKey,modelId:e.modelId}),signal:t.signal});if(!n.ok){let e=await n.text().catch(()=>`HTTP ${n.status}`);u(`error`),m(`Error: ${e}`);return}let r=n.body.getReader(),i=new TextDecoder,a=``,o=``;for(;;){let{done:e,value:t}=await r.read();if(e)break;a+=i.decode(t,{stream:!0});let n=a.split(`
|
|
38
38
|
`);a=n.pop()||``;for(let e of n){let t=e.trim();if(t&&!t.startsWith(`event: `)&&t.startsWith(`data: `)){let e=t.slice(6).trim();try{let t=JSON.parse(e),n=t.type||t.event;n===`token`||t.token!==void 0?(t.text&&(o+=t.text,m(o)),t.totalMs!=null&&f(e=>({...e,latency:(t.totalMs/1e3).toFixed(2)})),t.tokens!=null&&(f(e=>({...e,tokens:t.tokens})),g(Math.min(100,Math.round(t.tokens/140*100)))),t.tps!=null&&f(e=>({...e,tps:t.tps.toFixed(1)}))):n===`done`?(t.totalMs!=null&&f(e=>({...e,latency:(t.totalMs/1e3).toFixed(2)})),t.outputTokens!=null&&f(e=>({...e,tokens:t.outputTokens})),t.tokensPerSecond!=null&&f(e=>({...e,tps:t.tokensPerSecond.toFixed(1)})),g(100),u(`done`)):n===`error`&&(u(`error`),m(t.message||t.error||`Unknown error`))}catch{}}}}}catch(e){e.name!==`AbortError`&&(u(`error`),m(`Error: ${e.message}`))}finally{l===`running`&&u(`done`),_.current=null}},[l,e.providerKey,e.modelId]);return e.hasApiKey?(0,P.jsx)(`div`,{className:H.row,children:(0,P.jsxs)(`div`,{className:H.grid,children:[(0,P.jsxs)(`div`,{className:H.col,children:[(0,P.jsx)(`div`,{className:H.colTitle,children:`📊 Model Info`}),(0,P.jsxs)(`div`,{className:H.statGrid,children:[(0,P.jsx)(Qs,{label:`Tier`,children:(0,P.jsx)(ps,{tier:e.tier})}),(0,P.jsx)(Qs,{label:`SWE-bench`,children:(0,P.jsx)(`span`,{className:H[Ht(e.sweScore)],children:e.sweScore||`—`})}),(0,P.jsx)(Qs,{label:`Context`,children:e.ctx||`—`}),(0,P.jsx)(Qs,{label:`Provider`,children:e.origin}),(0,P.jsxs)(Qs,{label:`Status`,children:[(0,P.jsx)(hs,{status:e.status}),(0,P.jsx)(`span`,{style:{fontSize:11},children:e.status})]}),(0,P.jsx)(Qs,{label:`Avg Ping`,children:(0,P.jsx)(`span`,{className:H[x],children:b.text})}),(0,P.jsx)(Qs,{label:`Stability`,children:(0,P.jsx)(js,{score:e.stability})}),(0,P.jsx)(Qs,{label:`Verdict`,children:(0,P.jsx)(Fs,{verdict:e.verdict,httpCode:e.httpCode})}),(0,P.jsx)(Qs,{label:`Uptime`,children:e.uptime>0?`${e.uptime}%`:`—`})]}),(0,P.jsxs)(`div`,{className:H.infoActions,children:[t&&(0,P.jsxs)(`button`,{className:`${H.favBtn} ${y?H.favBtnActive:``}`,onClick:()=>t.toggle(e),title:y?`Unfavorite ${e.label}`:`Favorite ${e.label}`,children:[y?(0,P.jsx)(Qr,{size:13,stroke:1.5}):(0,P.jsx)(Hr,{size:13,stroke:1.5}),(0,P.jsx)(`span`,{children:y?`Favorited`:`Favorite`})]}),r&&(0,P.jsx)(Ks,{model:e,toolMode:a,onLaunch:r,variant:`default`})]})]}),(0,P.jsxs)(`div`,{className:H.col,children:[(0,P.jsxs)(`div`,{className:H.playgroundHeader,children:[`💬 Mini Playground — `,e.label]}),(0,P.jsx)(`div`,{className:H.playgroundWrap,children:(0,P.jsx)(Zs,{model:`${e.providerKey}/${e.modelId}`,variant:`mini`,disabled:!e.hasApiKey,placeholder:`Type a message…`,emptyTitle:`Test ${e.label}`,emptyHint:`Send a message to test this model. Responses stream in real time with latency + TPS.`})})]}),(0,P.jsxs)(`div`,{className:H.col,children:[(0,P.jsxs)(`button`,{className:H.benchBtn,onClick:S,disabled:l===`running`,title:l===`running`?`Running benchmark…`:`Test AI Latency`,children:[l===`running`?(0,P.jsx)(Tr,{size:13,stroke:1.8,className:H.spinning}):(0,P.jsx)(Zr,{size:13,stroke:1.8}),(0,P.jsx)(`span`,{children:l===`running`?`Running…`:`Test AI Latency`})]}),(0,P.jsxs)(`div`,{className:H.metricsGrid,children:[(0,P.jsxs)(`div`,{className:H.metricCard,children:[(0,P.jsx)(`span`,{className:H.metricLabel,children:`Latency`}),(0,P.jsx)(`span`,{className:H.metricValue,children:d.latency==null?`—`:`${d.latency}s`})]}),(0,P.jsxs)(`div`,{className:H.metricCard,children:[(0,P.jsx)(`span`,{className:H.metricLabel,children:`Tokens`}),(0,P.jsx)(`span`,{className:H.metricValue,children:d.tokens==null?`—`:d.tokens})]}),(0,P.jsxs)(`div`,{className:H.metricCard,children:[(0,P.jsx)(`span`,{className:H.metricLabel,children:`TPS`}),(0,P.jsx)(`span`,{className:H.metricValue,children:d.tps==null?`—`:d.tps})]}),(0,P.jsxs)(`div`,{className:H.metricCard,children:[(0,P.jsx)(`span`,{className:H.metricLabel,children:`Status`}),(0,P.jsxs)(`span`,{className:H.metricValue,children:[l===`idle`&&`⏳`,l===`running`&&`⚡`,l===`done`&&`✅`,l===`error`&&`❌`]})]})]}),(0,P.jsx)(`div`,{className:H.progressBar,children:(0,P.jsx)(`div`,{className:H.progressFill,style:{width:`${h}%`}})}),(0,P.jsx)(`div`,{className:H.streamText,children:p||(0,P.jsx)(`span`,{className:H.responsePlaceholder,children:`Generated text will appear here…`})})]})]})}):(0,P.jsx)(`div`,{className:H.row,children:(0,P.jsxs)(`div`,{className:H.noKeyBanner,children:[(0,P.jsx)(`span`,{className:H.noKeyIcon,children:`🔒`}),(0,P.jsxs)(`span`,{children:[`No API key configured for `,e.origin,`. Open Settings (P) to add one.`]})]})})}var U={container:`_container_hv3x6_8`,scrollInner:`_scrollInner_hv3x6_19`,table:`_table_hv3x6_41`,th:`_th_hv3x6_50`,thInner:`_thInner_hv3x6_79`,thLabel:`_thLabel_hv3x6_87`,resizeHandle:`_resizeHandle_hv3x6_101`,resizeHandleActive:`_resizeHandleActive_hv3x6_126`,resizeToolbar:`_resizeToolbar_hv3x6_147`,resizeToolbarHint:`_resizeToolbarHint_hv3x6_159`,resizeResetButton:`_resizeResetButton_hv3x6_170`,sortIcon:`_sortIcon_hv3x6_199`,sortIconActive:`_sortIconActive_hv3x6_200`,td:`_td_hv3x6_203`,rank1:`_rank1_hv3x6_227`,rank2:`_rank2_hv3x6_228`,rank3:`_rank3_hv3x6_229`,rankNum:`_rankNum_hv3x6_232`,swe:`_swe_hv3x6_240`,sweHigh:`_sweHigh_hv3x6_241`,sweMid:`_sweMid_hv3x6_242`,sweLow:`_sweLow_hv3x6_243`,ctx:`_ctx_hv3x6_245`,ping:`_ping_hv3x6_247`,pingFast:`_pingFast_hv3x6_248`,pingMedium:`_pingMedium_hv3x6_249`,pingSlow:`_pingSlow_hv3x6_250`,pingNone:`_pingNone_hv3x6_251`,uptime:`_uptime_hv3x6_260`,modelCell:`_modelCell_hv3x6_263`,modelMeta:`_modelMeta_hv3x6_264`,modelHeader:`_modelHeader_hv3x6_265`,modelName:`_modelName_hv3x6_266`,modelId:`_modelId_hv3x6_267`,benchRow:`_benchRow_hv3x6_278`,benchRowPulse:`_benchRowPulse_hv3x6_1`,empty:`_empty_hv3x6_296`,favBtn:`_favBtn_hv3x6_299`,favBtnActive:`_favBtnActive_hv3x6_314`,aiLatencyWrap:`_aiLatencyWrap_hv3x6_326`,aiLatencyRunning:`_aiLatencyRunning_hv3x6_337`,aiLatencyPlay:`_aiLatencyPlay_hv3x6_339`,incompatible:`_incompatible_hv3x6_348`,unusable:`_unusable_hv3x6_366`,notInSetRow:`_notInSetRow_hv3x6_375`,launchCell:`_launchCell_hv3x6_383`,expandedRow:`_expandedRow_hv3x6_396`,expandRowWrapper:`_expandRowWrapper_hv3x6_425`,expandRowCell:`_expandRowCell_hv3x6_428`},ec=ca(),tc=new Set([`mood`,`idx`,`tier`,`sweScore`,`ctx`,`label`,`origin`,`latestPing`,`avg`,`condition`,`verdict`,`stability`,`uptime`,`aiLatency`,`tps`,`trend`]);function nc({row:e}){return(0,P.jsx)(ds,{verdict:e.original.verdict})}function rc({row:e}){let t=e.original,n=!t.hasApiKey&&!t.cliOnly;return(0,P.jsxs)(`div`,{className:U.modelCell,children:[(0,P.jsx)(hs,{status:t.status,inRouterSet:t.inRouterSet}),(0,P.jsxs)(`div`,{className:U.modelMeta,children:[(0,P.jsxs)(`div`,{className:U.modelHeader,children:[(0,P.jsx)(`span`,{className:U.modelName,children:t.label}),n&&(0,P.jsx)(bs,{size:14,title:`No API key configured — health will stay in 'NO KEY' state`})]}),(0,P.jsx)(`div`,{className:U.modelId,children:t.modelId})]})]})}function ic({row:e}){let t=e.original,n=Ht(t.sweScore);return(0,P.jsx)(`span`,{className:`${U.swe} ${U[n]}`,children:t.sweScore||`—`})}function ac({row:e}){return(0,P.jsx)(`span`,{className:U.ctx,children:e.original.ctx||`—`})}function oc({row:e}){return(0,P.jsx)(Ji,{providerKey:e.original.providerKey,origin:e.original.origin})}function sc({row:e}){let t=e.original,n=t.pingHistory||t.pings||[];return(0,P.jsx)(vs,{ms:(n.length>0?n[n.length-1]:null)?.ms??null,isPinging:!!t.isPinging})}function cc({row:e}){let t=e.original,n=Wt(t.avg);return(0,P.jsx)(`span`,{className:`${U.ping} ${U[n]}`,children:t.avg==null||t.avg===1/0||t.avg>99e3?`—`:t.avg})}function lc({row:e}){let t=e.original;return(0,P.jsx)(ks,{status:t.status,httpCode:t.httpCode,inRouterSet:t.inRouterSet})}function uc({row:e}){let t=e.original;return(0,P.jsx)(Fs,{verdict:t.verdict,httpCode:t.httpCode})}function dc({row:e}){return(0,P.jsx)(js,{score:e.original.stability})}function fc({row:e}){let t=e.original;return(0,P.jsx)(`span`,{className:U.uptime,children:t.uptime>0?`${t.uptime}%`:`—`})}function pc({row:e}){let t=e.original,n=!!t.isBenchmarking;return(0,P.jsxs)(`div`,{className:`${U.aiLatencyWrap} ${n?U.aiLatencyRunning:``}`,onClick:e=>{e.stopPropagation();let n=window.__fcmRowBenchmarkHandler;typeof n==`function`&&n(t)},title:n?`Benchmarking…`:`Click to run AI Speed Test (TUI: Ctrl+A)`,children:[(0,P.jsx)(Vs,{result:t.benchmark||null,isRunning:n}),!n&&(0,P.jsx)(`span`,{className:U.aiLatencyPlay,"aria-hidden":`true`,children:(0,P.jsx)(Zr,{size:10,stroke:1.5})})]})}function mc({row:e}){let t=e.original;return(0,P.jsx)(Ws,{result:t.benchmark||null,isRunning:!!t.isBenchmarking})}function hc({row:e}){return(0,P.jsx)(Rs,{history:e.original.pingHistory})}var gc=({favorites:e,onBenchmarkRow:t,onSelectModel:n,onLaunch:r,toolMode:i})=>[ec.display({id:`fav`,header:`BOOKMARKS`,size:104,enableSorting:!1,cell:({row:t})=>{let n=t.original,r=e.isFavorite(n);return(0,P.jsx)(`button`,{className:`${U.favBtn} ${r?U.favBtnActive:``}`,onClick:t=>{t.stopPropagation(),e.toggle(n)},title:r?`Unfavorite ${n.label} (TUI: F)`:`Favorite ${n.label} (TUI: F)`,"aria-label":r?`Unfavorite ${n.label}`:`Favorite ${n.label}`,"aria-pressed":r,children:r?(0,P.jsx)(Qr,{size:14,stroke:1.5}):(0,P.jsx)(Hr,{size:14,stroke:1.5})})}}),ec.display({id:`mood`,header:`❔`,size:28,cell:nc,enableSorting:!0}),ec.accessor(`idx`,{header:`#`,size:36,enableSorting:!0,cell:({getValue:e,row:t})=>(0,P.jsx)(`span`,{className:U.rankNum,children:e()??t.index+1})}),ec.accessor(`tier`,{header:`Tier`,size:48,enableSorting:!0,cell:({getValue:e})=>(0,P.jsx)(ps,{tier:e()})}),ec.accessor(`sweScore`,{header:`SWE%`,size:52,enableSorting:!0,cell:ic}),ec.accessor(`ctx`,{header:`CTX`,size:48,enableSorting:!0,cell:ac}),ec.accessor(`label`,{header:`Model`,size:200,enableSorting:!0,cell:rc}),ec.accessor(`origin`,{header:`Provider`,size:150,enableSorting:!0,cell:oc}),ec.display({id:`latestPing`,header:`Last Ping`,size:80,cell:sc,enableSorting:!0}),ec.accessor(`avg`,{header:`Avg`,size:72,enableSorting:!0,cell:cc}),ec.accessor(`status`,{id:`condition`,header:`Health`,size:120,enableSorting:!0,cell:lc}),ec.accessor(`verdict`,{header:`Verdict`,size:100,enableSorting:!0,cell:uc}),ec.accessor(`stability`,{header:`Stability`,size:90,enableSorting:!0,cell:dc}),ec.accessor(`uptime`,{header:`Up%`,size:48,enableSorting:!0,cell:fc}),ec.display({id:`aiLatency`,header:`AI Lat.`,size:80,cell:pc,enableSorting:!0}),ec.display({id:`tps`,header:`TPS`,size:48,cell:mc,enableSorting:!0}),ec.display({id:`trend`,header:`Trend`,size:96,cell:hc,enableSorting:!0}),ec.display({id:`launch`,header:`🔌`,size:42,enableSorting:!1,cell:({row:e})=>(0,P.jsx)(`div`,{className:U.launchCell,children:(0,P.jsx)(Ks,{model:e.original,toolMode:i,onLaunch:r,variant:`icon`})})})],_c=gc({favorites:{isFavorite:()=>!1,toggle:()=>{}},onBenchmarkRow:null,onSelectModel:null,onLaunch:null,toolMode:`opencode`}).reduce((e,t)=>(t.id&&(e[t.id]=t.size??80),e),{});function vc({filtered:e,onSelectModel:t,onBenchmarkRow:n,onLaunch:r,favorites:i,sortColumn:a,sortDirection:o,onSort:s,toolMode:c=null,onToast:l,onSetToolMode:u,onCycleToolMode:d,onOpenFallback:f}){let[p,m]=(0,v.useState)(null),h=(0,v.useRef)(null),g=(0,v.useCallback)(e=>{let t=`${e.providerKey}/${e.modelId}`;m(e=>e===t?null:t)},[]),_=(0,v.useMemo)(()=>{let t=e.filter(e=>e.status===`up`&&e.avg!=null&&e.avg!==1/0&&e.avg<99e3);return new Set([...t].sort((e,t)=>e.avg-t.avg).slice(0,3).map(e=>e.modelId))},[e]);(0,v.useEffect)(()=>{if(typeof n!=`function`){window.__fcmRowBenchmarkHandler=null;return}return window.__fcmRowBenchmarkHandler=n,()=>{window.__fcmRowBenchmarkHandler===n&&(window.__fcmRowBenchmarkHandler=null)}},[n]);let y=(0,v.useMemo)(()=>gc({favorites:i,onBenchmarkRow:n,onSelectModel:t,onLaunch:r,toolMode:c}),[i,n,t,r,c]),{columnSizing:b,setColumnSizing:x,resetColumnSizing:S,hasCustomSizing:C}=cs(_c),w=Oo({data:e,columns:y,defaultColumn:{enableSorting:!0},getCoreRowModel:Co(),columnResizeMode:`onChange`,state:{columnSizing:b},onColumnSizingChange:x}),ee=w.getRowModel().rows,T=(0,v.useMemo)(()=>{let e=[];for(let t of ee){let n=t.original,r=`${n.providerKey}/${n.modelId}`;e.push({type:`row`,row:t,key:r}),p===r&&e.push({type:`expand`,row:t,key:`${r}__expand`})}return e},[ee,p]),E=Qo({count:T.length,getScrollElement:()=>h.current,estimateSize:e=>T[e]?.type===`expand`?260:47,overscan:10,getItemKey:e=>T[e].key}),D=E.getVirtualItems(),te=E.getTotalSize(),ne=D.length?Math.max(0,D[0].start):0,re=D.length?D[D.length-1]:null,ie=re?Math.max(0,te-re.end):0,ae=(0,v.useMemo)(()=>w.getAllColumns().reduce((e,t)=>e+t.getSize(),0),[b]),oe=!!w.getState().columnSizingInfo?.isResizingColumn;return(0,v.useEffect)(()=>{if(!(typeof document>`u`))return oe?document.body.classList.add(`col-resizing`):document.body.classList.remove(`col-resizing`),()=>{document.body.classList.remove(`col-resizing`)}},[oe]),ee.length===0?(0,P.jsx)(`div`,{className:U.empty,children:`No models match your filters`}):(0,P.jsxs)(`div`,{className:U.container,children:[C&&(0,P.jsxs)(`div`,{className:U.resizeToolbar,children:[(0,P.jsxs)(`span`,{className:U.resizeToolbarHint,children:[`📐 Custom column widths · total `,(0,P.jsxs)(`strong`,{children:[Math.round(ae),`px`]})]}),(0,P.jsx)(`button`,{type:`button`,className:U.resizeResetButton,onClick:S,title:`Restore the default column widths`,children:`↺ Reset columns`})]}),(0,P.jsx)(`div`,{className:U.scrollInner,ref:h,children:(0,P.jsxs)(`table`,{className:U.table,style:C?{minWidth:`${ae}px`}:void 0,children:[(0,P.jsx)(`thead`,{children:w.getHeaderGroups().map(e=>(0,P.jsx)(`tr`,{children:e.headers.map(e=>{let t=e.column,n=tc.has(t.id),r=t.getIsResizing?.()===!0,i=`${e.getSize()}px`;return(0,P.jsx)(`th`,{className:U.th,onClick:n?()=>s(e.id):void 0,style:{width:i,minWidth:i,maxWidth:i,cursor:n?`pointer`:`default`},title:`Sort ${t.columnDef.header}: asc → desc → reset`,children:(0,P.jsxs)(`div`,{className:U.thInner,children:[(0,P.jsxs)(`span`,{className:U.thLabel,children:[wo(t.columnDef.header,e.getContext()),n&&(0,P.jsx)(`span`,{className:a===t.id?U.sortIconActive:U.sortIcon,children:a===t.id?o===`asc`?`↑`:`↓`:`⇅`})]}),(0,P.jsx)(`span`,{className:`${U.resizeHandle} ${r?U.resizeHandleActive:``}`,onClick:e=>e.stopPropagation(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),onDoubleClick:()=>{x(e=>({...e,[t.id]:_c[t.id]}))},title:`Drag to resize ${t.columnDef.header} (double-click to reset this column)`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize ${t.columnDef.header} column`})]})},e.id)})},e.id))}),(0,P.jsxs)(`tbody`,{children:[ne>0&&(0,P.jsx)(`tr`,{"aria-hidden":`true`,style:{height:ne},children:(0,P.jsx)(`td`,{style:{height:ne,padding:0,border:0}})}),D.map(e=>{let t=T[e.index];if(t.type===`expand`)return(0,P.jsx)(`tr`,{className:U.expandRowWrapper,"data-index":e.index,ref:E.measureElement,children:(0,P.jsx)(`td`,{colSpan:t.row.getVisibleCells().length,className:U.expandRowCell,children:(0,P.jsx)($s,{model:t.row.original,favorites:i,onBenchmark:n,onLaunch:r,onToast:l,toolMode:c,onSetToolMode:u,onCycleToolMode:d,onOpenFallback:f})})},t.key);let a=t.row,o=a.original,s=p===t.key,m=[..._].indexOf(o.modelId),h=[];return m>=0&&h.push(U[`rank${m+1}`]),o.isBenchmarking&&h.push(U.benchRow),s&&h.push(U.expandedRow),c&&(Sn(o.providerKey).includes(c)||h.push(U.incompatible)),(o.status===`noauth`||o.status===`auth_error`)&&h.push(U.unusable),o.status===`pending`&&o.inRouterSet===!1&&h.push(U.notInSetRow),(0,P.jsx)(`tr`,{className:h.join(` `),onClick:()=>g(o),"data-index":e.index,ref:E.measureElement,children:a.getVisibleCells().map(e=>{let t=`${e.column.getSize()}px`;return(0,P.jsx)(`td`,{className:U.td,style:{width:t,minWidth:t,maxWidth:t},children:wo(e.column.columnDef.cell,e.getContext())},e.id)})},t.key)}),ie>0&&(0,P.jsx)(`tr`,{"aria-hidden":`true`,style:{height:ie},children:(0,P.jsx)(`td`,{style:{height:ie,padding:0,border:0}})})]})]})})]})}function yc(e,t,n){let r=new Blob([e],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,a.click(),URL.revokeObjectURL(i)}var bc={overlay:`_overlay_1e3f5_1`,fadeIn:`_fadeIn_1e3f5_1`,modal:`_modal_1e3f5_18`,modalSlideIn:`_modalSlideIn_1e3f5_1`,modalHeader:`_modalHeader_1e3f5_33`,modalTitle:`_modalTitle_1e3f5_40`,modalClose:`_modalClose_1e3f5_45`,modalBody:`_modalBody_1e3f5_57`,options:`_options_1e3f5_60`,option:`_option_1e3f5_60`,optionIcon:`_optionIcon_1e3f5_84`,optionText:`_optionText_1e3f5_88`,optionLabel:`_optionLabel_1e3f5_89`,optionDesc:`_optionDesc_1e3f5_94`};function xc({models:e,onClose:t,onToast:n}){return e?(0,P.jsx)(`div`,{className:bc.overlay,onClick:e=>e.target===e.currentTarget&&t(),children:(0,P.jsxs)(`div`,{className:bc.modal,children:[(0,P.jsxs)(`div`,{className:bc.modalHeader,children:[(0,P.jsxs)(`h2`,{className:bc.modalTitle,children:[(0,P.jsx)(qr,{size:20,stroke:1.5,style:{marginRight:8,verticalAlign:`middle`}}),`Export Data`]}),(0,P.jsx)(`button`,{className:bc.modalClose,onClick:t,children:`×`})]}),(0,P.jsx)(`div`,{className:bc.modalBody,children:(0,P.jsxs)(`div`,{className:bc.options,children:[(0,P.jsxs)(`button`,{className:bc.option,onClick:()=>{yc(JSON.stringify(e,null,2),`free-coding-models-export.json`,`application/json`),n?.(`Exported as JSON`,`success`),t()},children:[(0,P.jsx)(`span`,{className:bc.optionIcon,children:(0,P.jsx)(Jn,{size:20,stroke:1.5})}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:bc.optionLabel,children:`Export as JSON`}),(0,P.jsx)(`span`,{className:bc.optionDesc,children:`Full model data with all metrics`})]})]}),(0,P.jsxs)(`button`,{className:bc.option,onClick:()=>{let r=[`Rank`,`Tier`,`Model`,`Provider`,`SWE%`,`Context`,`LatestPing`,`AvgPing`,`Stability`,`Verdict`,`Uptime`],i=e.map((e,t)=>[t+1,e.tier,e.label,e.origin,e.sweScore||``,e.ctx||``,e.latestPing||``,e.avg===1/0?``:e.avg,e.stability||``,e.verdict||``,e.uptime||``].join(`,`));yc([r.join(`,`),...i].join(`
|
|
39
39
|
`),`free-coding-models-export.csv`,`text/csv`),n?.(`Exported as CSV`,`success`),t()},children:[(0,P.jsx)(`span`,{className:bc.optionIcon,children:(0,P.jsx)(mr,{size:20,stroke:1.5})}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:bc.optionLabel,children:`Export as CSV`}),(0,P.jsx)(`span`,{className:bc.optionDesc,children:`Spreadsheet-compatible format`})]})]}),(0,P.jsxs)(`button`,{className:bc.option,onClick:async()=>{let r=e.filter(e=>e.status===`up`),i=`free-coding-models Dashboard Export\nTotal: ${e.length} | Online: ${r.length}\n\n`+r.slice(0,20).map((e,t)=>`${t+1}. ${e.label} [${e.tier}] — ${e.avg===1/0?`N/A`:e.avg+`ms`} (${e.origin})`).join(`
|
|
40
|
-
`);await navigator.clipboard.writeText(i),n?.(`Copied to clipboard`,`success`),t()},children:[(0,P.jsx)(`span`,{className:bc.optionIcon,children:(0,P.jsx)(rr,{size:20,stroke:1.5})}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:bc.optionLabel,children:`Copy to Clipboard`}),(0,P.jsx)(`span`,{className:bc.optionDesc,children:`Copy model summary as text`})]})]})]})})]})}):null}var W={page:`_page_1847y_1`,pageHeader:`_pageHeader_1847y_5`,pageTitle:`_pageTitle_1847y_9`,pageSubtitle:`_pageSubtitle_1847y_15`,loading:`_loading_1847y_30`,featureSection:`_featureSection_1847y_37`,sectionHeading:`_sectionHeading_1847y_44`,featureGrid:`_featureGrid_1847y_52`,featureRow:`_featureRow_1847y_57`,featureLabel:`_featureLabel_1847y_67`,featureTitle:`_featureTitle_1847y_79`,featureDesc:`_featureDesc_1847y_85`,featureActions:`_featureActions_1847y_91`,select:`_select_1847y_96`,toggleSwitch:`_toggleSwitch_1847y_110`,toggleSlider:`_toggleSlider_1847y_122`,smallBtn:`_smallBtn_1847y_148`,notice:`_notice_1847y_166`,testBadge:`_testBadge_1847y_178`,test_ok:`_test_ok_1847y_191`,test_auth_error:`_test_auth_error_1847y_192`,test_rate_limited:`_test_rate_limited_1847y_193`,test_no_callable_model:`_test_no_callable_model_1847y_194`,test_fail:`_test_fail_1847y_195`,test_missing_key:`_test_missing_key_1847y_196`,test_pending:`_test_pending_1847y_197`,testSpinner:`_testSpinner_1847y_199`,spin:`_spin_1847y_1`,toolbar:`_toolbar_1847y_210`,toolbarSearch:`_toolbarSearch_1847y_218`,toolbarActions:`_toolbarActions_1847y_250`,toolbarBtn:`_toolbarBtn_1847y_255`,providers:`_providers_1847y_276`,card:`_card_1847y_282`,cardHeader:`_cardHeader_1847y_295`,cardIcon:`_cardIcon_1847y_308`,cardInfo:`_cardInfo_1847y_320`,cardName:`_cardName_1847y_325`,cardMeta:`_cardMeta_1847y_330`,cardStatus:`_cardStatus_1847y_336`,statusConfigured:`_statusConfigured_1847y_344`,statusMissing:`_statusMissing_1847y_349`,toggleIcon:`_toggleIcon_1847y_354`,toggleIconExpanded:`_toggleIconExpanded_1847y_361`,cardBody:`_cardBody_1847y_365`,cardExpanded:`_cardExpanded_1847y_372`,cardContent:`_cardContent_1847y_377`,keyGroup:`_keyGroup_1847y_381`,keyLabel:`_keyLabel_1847y_385`,keyDisplay:`_keyDisplay_1847y_395`,keyDisplayValue:`_keyDisplayValue_1847y_406`,keyDisplayActions:`_keyDisplayActions_1847y_414`,actionBtn:`_actionBtn_1847y_420`,actionBtnDanger:`_actionBtnDanger_1847y_438`,keyInputRow:`_keyInputRow_1847y_448`,keyInput:`_keyInput_1847y_448`,saveBtn:`_saveBtn_1847y_475`,enabledRow:`_enabledRow_1847y_495`,enabledLabel:`_enabledLabel_1847y_504`},Sc={ok:{label:`OK`,icon:Xr,className:`testOk`},auth_error:{label:`Auth error`,icon:Sr,className:`testErr`},rate_limited:{label:`Rate limited`,icon:Ir,className:`testWarn`},no_callable_model:{label:`No callable model`,icon:Sr,className:`testWarn`},fail:{label:`Failed`,icon:Sr,className:`testErr`},missing_key:{label:`Missing key`,icon:Sr,className:`testNeutral`}};function Cc({onToast:e,onOpenChangelog:t,onCheckForUpdate:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(new Set),[l,u]=(0,v.useState)(new Set),[d,f]=(0,v.useState)({}),[p,m]=(0,v.useState)({}),[h,g]=(0,v.useState)(new Set),[_,y]=(0,v.useState)(null),b=(0,v.useCallback)(async()=>{try{i(await(await fetch(`/api/config`)).json())}catch{e?.(`Failed to load settings`,`error`)}},[e]);(0,v.useEffect)(()=>{b()},[b]);let x=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},S=()=>{r&&c(new Set(Object.keys(r.providers)))},C=()=>c(new Set),w=async t=>{if(l.has(t)){u(e=>{let n=new Set(e);return n.delete(t),n});return}try{(await(await fetch(`/api/key/${t}`)).json()).key&&u(e=>new Set(e).add(t))}catch{e?.(`Failed to reveal key`,`error`)}},ee=async t=>{try{let n=await(await fetch(`/api/key/${t}`)).json();n.key?(await navigator.clipboard.writeText(n.key),e?.(`API key copied to clipboard`,`success`)):e?.(`No key to copy`,`warning`)}catch{e?.(`Failed to copy key`,`error`)}},T=async t=>{let n=d[t]?.trim();if(!n){e?.(`Please enter an API key`,`warning`);return}try{let r=await(await fetch(`/api/settings`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({apiKeys:{[t]:n}})})).json();r.success?(e?.(`API key for ${t} saved successfully!`,`success`),f(e=>({...e,[t]:``})),u(e=>{let n=new Set(e);return n.delete(t),n}),await b(),c(e=>new Set(e).add(t))):e?.(r.error||`Failed to save`,`error`)}catch{e?.(`Network error while saving`,`error`)}},E=async t=>{if(confirm(`Are you sure you want to delete the API key for "${t}"?`))try{let n=await(await fetch(`/api/settings`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({apiKeys:{[t]:``}})})).json();n.success?(e?.(`API key for ${t} deleted`,`info`),u(e=>{let n=new Set(e);return n.delete(t),n}),await b()):e?.(n.error||`Failed to delete`,`error`)}catch{e?.(`Network error while deleting`,`error`)}},D=async(t,n)=>{try{let r=await(await fetch(`/api/settings`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({providers:{[t]:{enabled:n}}})})).json();r.success?e?.(`${t} ${n?`enabled`:`disabled`}`,`success`):e?.(r.error||`Failed to toggle`,`error`)}catch{e?.(`Network error`,`error`)}},te=(0,v.useCallback)(async t=>{if(!h.has(t)){g(e=>new Set(e).add(t)),m(e=>({...e,[t]:{outcome:`pending`}}));try{let n=await fetch(`/api/key/${encodeURIComponent(t)}/test`,{method:`POST`}),r=await n.json().catch(()=>({}));if(n.ok){m(e=>({...e,[t]:r}));let n=Sc[r.outcome]||Sc.fail;e?.(`${t} test: ${n.label}${r.code?` (HTTP ${r.code})`:``}`,r.outcome===`ok`?`success`:`info`)}else m(e=>({...e,[t]:{outcome:`fail`,detail:r.error||`HTTP `+n.status}})),e?.(`${t} test failed: ${r.error||n.statusText}`,`error`)}catch(n){m(e=>({...e,[t]:{outcome:`fail`,detail:n.message}})),e?.(`${t} test failed: ${n.message}`,`error`)}finally{g(e=>{let n=new Set(e);return n.delete(t),n})}}},[h,e]),ne=(0,v.useCallback)(async(t,n)=>{try{let r=await(await fetch(`/api/settings/feature`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n===void 0?{feature:t}:{feature:t,value:n})})).json();r.success?(await b(),e?.(`${t} updated`,`success`)):e?.(r.error||`Failed to update feature`,`error`)}catch{e?.(`Network error`,`error`)}},[e]),re=(0,v.useCallback)(async t=>{try{let n=await(await fetch(`/api/shell-env/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:t})})).json();n.success?(await b(),e?.(`Shell env export ${n.enabled?`enabled`:`disabled`} — restart your shell to apply.`,`success`)):e?.(n.error||`Failed to toggle shell env`,`error`)}catch{e?.(`Network error`,`error`)}},[e]),ie=(0,v.useCallback)(async()=>{if(confirm(`Remove discontinued proxy config leftovers? This is safe to run.`))try{let t=await(await fetch(`/api/legacy-cleanup`,{method:`POST`})).json(),n=(t.removedFiles?.length||0)+(t.updatedFiles?.length||0);t.changed?(y(`Cleaned ${n} legacy file(s). ${t.errors.length} error(s).`),e?.(`Legacy proxy cleanup: ${n} file(s) cleaned.`,`success`)):(y(`No discontinued proxy config was found. You are on the stable direct-provider setup.`),e?.(`No legacy proxy config found — already on stable setup.`,`info`)),await b()}catch(t){e?.(`Legacy cleanup failed: ${t.message}`,`error`)}},[e]),ae=(0,v.useCallback)(()=>{n?.()},[n]);if(!r)return(0,P.jsx)(`div`,{className:W.page,children:(0,P.jsx)(`div`,{className:W.loading,children:`Loading settings...`})});let oe=Object.entries(r.providers).filter(([,e])=>{if(!a)return!0;let t=a.toLowerCase();return`${e.name} ${e.displayName||``} ${e.billingNote||``}`.toLowerCase().includes(t)}).sort((e,t)=>e[1].name.localeCompare(t[1].name));return(0,P.jsxs)(`div`,{className:W.page,children:[(0,P.jsxs)(`div`,{className:W.pageHeader,children:[(0,P.jsxs)(`h1`,{className:W.pageTitle,children:[(0,P.jsx)(Br,{size:24,stroke:1.5,style:{marginRight:8,verticalAlign:`middle`}}),`Settings`]}),(0,P.jsxs)(`p`,{className:W.pageSubtitle,children:[`API keys, theme, favorites mode, shell env, and update controls. All settings are stored locally in `,(0,P.jsx)(`code`,{children:`~/.free-coding-models.json`}),`and shared with the TUI.`]})]}),r&&(0,P.jsxs)(`section`,{className:W.featureSection,children:[(0,P.jsx)(`h2`,{className:W.sectionHeading,children:`⚙️ Global settings`}),(0,P.jsxs)(`div`,{className:W.featureGrid,children:[(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(Ur,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Theme`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`Tri-state cycle. Auto follows your OS.`})]})]}),(0,P.jsxs)(`select`,{className:W.select,value:r.settings?.theme||`auto`,onChange:e=>ne(`theme`,e.target.value),children:[(0,P.jsx)(`option`,{value:`auto`,children:`Auto (OS)`}),(0,P.jsx)(`option`,{value:`dark`,children:`Dark`}),(0,P.jsx)(`option`,{value:`light`,children:`Light`})]})]}),(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(Hr,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Favorites pinned + always visible`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`Favorites bypass filters and stay on top (TUI: Y key).`})]})]}),(0,P.jsxs)(`label`,{className:W.toggleSwitch,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:!!r.settings?.favoritesPinnedAndSticky,onChange:e=>ne(`favoritesPinnedAndSticky`,e.target.checked)}),(0,P.jsx)(`span`,{className:W.toggleSlider})]})]}),(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(qn,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Run AI Speed Test on startup`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`Auto-fire the global benchmark right after launch (TUI: U → 'Enable').`})]})]}),(0,P.jsxs)(`label`,{className:W.toggleSwitch,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:!!r.settings?.runAiSpeedTestOnStartup,onChange:e=>ne(`runAiSpeedTestOnStartup`,e.target.checked)}),(0,P.jsx)(`span`,{className:W.toggleSlider})]})]}),(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(tr,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Export API keys to shell rc`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`Write NVIDIA_API_KEY / GROQ_API_KEY / … to your shell rc file.`})]})]}),(0,P.jsxs)(`label`,{className:W.toggleSwitch,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:!!r.settings?.shellEnvEnabled,onChange:e=>re(e.target.checked)}),(0,P.jsx)(`span`,{className:W.toggleSlider})]})]}),(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(lr,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Check for updates`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`The header chip turns green when a newer npm version is available. Use the 'Update now' button to install.`})]})]}),(0,P.jsxs)(`div`,{className:W.featureActions,children:[(0,P.jsx)(`button`,{className:W.smallBtn,onClick:ae,children:`Check now`}),(0,P.jsxs)(`button`,{className:W.smallBtn,onClick:()=>t?.(null),children:[(0,P.jsx)(yr,{size:13,stroke:1.5}),` Changelog`]})]})]}),(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(Ir,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Cleanup discontinued proxy artifacts`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`Remove old config / env / service leftovers from the old multi-tool proxy.`})]})]}),(0,P.jsx)(`button`,{className:W.smallBtn,onClick:ie,children:`Run cleanup`})]})]}),_&&(0,P.jsx)(`div`,{className:W.notice,children:_})]}),(0,P.jsxs)(`div`,{className:W.toolbar,children:[(0,P.jsxs)(`div`,{className:W.toolbarSearch,children:[(0,P.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,P.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,P.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,P.jsx)(`input`,{type:`text`,placeholder:`Search providers...`,value:a,onChange:e=>o(e.target.value),autoComplete:`off`})]}),(0,P.jsxs)(`div`,{className:W.toolbarActions,children:[(0,P.jsx)(`button`,{className:W.toolbarBtn,onClick:S,children:`Expand All`}),(0,P.jsx)(`button`,{className:W.toolbarBtn,onClick:C,children:`Collapse All`})]})]}),(0,P.jsx)(`div`,{className:W.providers,children:oe.map(([e,t])=>{let n=s.has(e),r=l.has(e);return(0,P.jsxs)(`div`,{className:`${W.card} ${n?W.cardExpanded:``}`,children:[(0,P.jsxs)(`div`,{className:W.cardHeader,onClick:()=>x(e),children:[(0,P.jsx)(`div`,{className:W.cardIcon,children:(0,P.jsx)(Nr,{size:20,stroke:1.5})}),(0,P.jsxs)(`div`,{className:W.cardInfo,children:[(0,P.jsx)(`div`,{className:W.cardName,children:t.displayName||t.name}),(0,P.jsxs)(`div`,{className:W.cardMeta,children:[t.modelCount,` models · `,e,t.billingNote?` · ${t.billingNote}`:``]})]}),(0,P.jsx)(`span`,{className:`${W.cardStatus} ${t.hasKey?W.statusConfigured:W.statusMissing}`,children:t.hasKey?(0,P.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,P.jsx)(tr,{size:14,stroke:1.5}),` Active`]}):(0,P.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,P.jsx)(Sr,{size:14,stroke:1.5}),` No Key`]})}),(0,P.jsx)(`span`,{className:`${W.toggleIcon} ${n?W.toggleIconExpanded:``}`,children:`▼`})]}),(0,P.jsx)(`div`,{className:W.cardBody,children:(0,P.jsxs)(`div`,{className:W.cardContent,children:[t.hasKey&&p[e]&&(0,P.jsx)(`div`,{className:`${W.testBadge} ${W[`test_${p[e].outcome}`]||``}`,children:(()=>{let t=Sc[p[e].outcome]||Sc.fail,n=t.icon;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(n,{size:12,stroke:1.5}),(0,P.jsxs)(`span`,{children:[`Last test: `,t.label,p[e].code?` (HTTP ${p[e].code})`:``]})]})})()}),t.hasKey&&(0,P.jsxs)(`div`,{className:W.keyGroup,children:[(0,P.jsx)(`label`,{className:W.keyLabel,children:`Current API Key`}),(0,P.jsxs)(`div`,{className:W.keyDisplay,children:[(0,P.jsx)(`span`,{className:W.keyDisplayValue,children:r?t.maskedKey||`••••••••`:Kt(t.maskedKey||``)}),(0,P.jsxs)(`div`,{className:W.keyDisplayActions,children:[(0,P.jsx)(`button`,{className:W.actionBtn,onClick:()=>w(e),title:r?`Hide`:`Reveal`,children:r?(0,P.jsx)(fr,{size:14,stroke:1.5}):(0,P.jsx)(pr,{size:14,stroke:1.5})}),(0,P.jsx)(`button`,{className:W.actionBtn,onClick:()=>ee(e),title:`Copy`,children:(0,P.jsx)(sr,{size:14,stroke:1.5})}),(0,P.jsxs)(`button`,{className:W.actionBtn,onClick:()=>te(e),disabled:h.has(e),title:`Test this key against the provider (TUI: T key in Settings)`,"aria-label":`Test key for ${e}`,children:[h.has(e)?(0,P.jsx)(`span`,{className:W.testSpinner}):(0,P.jsx)(qn,{size:14,stroke:1.5}),h.has(e)?`Testing…`:`Test`]}),(0,P.jsx)(`button`,{className:`${W.actionBtn} ${W.actionBtnDanger}`,onClick:()=>E(e),title:`Delete Key`,children:(0,P.jsx)(Gr,{size:14,stroke:1.5})})]})]})]}),(0,P.jsxs)(`div`,{className:W.keyGroup,children:[(0,P.jsxs)(`label`,{className:W.keyLabel,children:[t.hasKey?`Update API Key`:`Add API Key`,t.billingNote?` 💰 ${t.billingNote}`:``]}),(0,P.jsxs)(`div`,{className:W.keyInputRow,children:[(0,P.jsx)(`input`,{type:`password`,className:W.keyInput,placeholder:`Enter your API key...`,value:d[e]||``,onChange:t=>f(n=>({...n,[e]:t.target.value})),autoComplete:`off`}),(0,P.jsx)(`button`,{className:W.saveBtn,onClick:()=>T(e),children:t.hasKey?`Update`:`Save`})]})]}),(0,P.jsxs)(`div`,{className:W.enabledRow,children:[(0,P.jsx)(`span`,{className:W.enabledLabel,children:`Provider Enabled`}),(0,P.jsxs)(`label`,{className:W.toggleSwitch,children:[(0,P.jsx)(`input`,{type:`checkbox`,defaultChecked:t.enabled!==!1,onChange:t=>D(e,t.target.checked)}),(0,P.jsx)(`span`,{className:W.toggleSlider})]})]})]})})]},e)})})]})}function wc(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!0),i=(0,v.useCallback)(async()=>{r(!0);try{t(Tc(await(await fetch(`/api/router/tokens`)).json()))}catch{t(null)}finally{r(!1)}},[]);return(0,v.useEffect)(()=>{i()},[i]),{data:e,loading:n,refresh:i}}function Tc(e){if(!e)return null;let t=e.daily||{},n=e.all_time||{},r=[],i=new Date;for(let e=6;e>=0;e--){let n=new Date(i);n.setDate(n.getDate()-e);let a=n.toISOString().slice(0,10),o=t[a]||{total_tokens:0,requests:0};r.push({date:a,label:n.toLocaleDateString(`en`,{weekday:`short`}),totalTokens:o.total_tokens||0,requests:o.requests||0})}let a={};for(let e of Object.values(t)){let t=e.by_model||{};for(let[e,n]of Object.entries(t))a[e]||(a[e]={total:0,requests:0}),a[e].total+=n.total||0,a[e].requests+=n.requests||0}let o=Object.entries(a).sort((e,t)=>t[1].total-e[1].total).slice(0,10).map(([e,t])=>({key:e,...t})),s={};for(let[e,t]of Object.entries(a)){let n=e.split(`/`)[0];s[n]||(s[n]={total:0,requests:0}),s[n].total+=t.total,s[n].requests+=t.requests}let c=Object.entries(s).sort((e,t)=>t[1].total-e[1].total).slice(0,10).map(([e,t])=>({key:e,...t})),l=t[i.toISOString().slice(0,10)]||{};return{today:{totalTokens:l.total_tokens||0,promptTokens:l.prompt_tokens||0,completionTokens:l.completion_tokens||0,requests:l.requests||0},allTime:{totalTokens:n.total_tokens||0,promptTokens:n.prompt_tokens||0,completionTokens:n.completion_tokens||0,requests:n.requests||0},sevenDays:r,topModels:o,topProviders:c,hasData:n.total_tokens>0||Object.keys(t).length>0}}var G={card:`_card_1m2zx_1`,cardTitle:`_cardTitle_1m2zx_5`,empty:`_empty_1m2zx_14`,summaryGrid:`_summaryGrid_1m2zx_22`,summaryCard:`_summaryCard_1m2zx_29`,summaryLabel:`_summaryLabel_1m2zx_39`,summaryValue:`_summaryValue_1m2zx_47`,summarySub:`_summarySub_1m2zx_53`,chart:`_chart_1m2zx_59`,chartBar:`_chartBar_1m2zx_67`,chartFill:`_chartFill_1m2zx_77`,chartLabel:`_chartLabel_1m2zx_85`,topList:`_topList_1m2zx_92`,topRow:`_topRow_1m2zx_98`,topKey:`_topKey_1m2zx_106`,topVal:`_topVal_1m2zx_115`,topReq:`_topReq_1m2zx_121`};function Ec(e){return typeof e!=`number`||!Number.isFinite(e)?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}function Dc(){let{data:e,loading:t}=wc();if(t)return(0,P.jsxs)(`div`,{className:G.card,children:[(0,P.jsx)(`h3`,{className:G.cardTitle,children:`Token Usage`}),(0,P.jsx)(`div`,{className:G.empty,children:`Loading…`})]});if(!e||!e.hasData)return(0,P.jsxs)(`div`,{className:G.card,children:[(0,P.jsx)(`h3`,{className:G.cardTitle,children:`Token Usage`}),(0,P.jsx)(`div`,{className:G.empty,children:`No token data yet. Start the router and send requests to track usage.`})]});let n=Math.max(...e.sevenDays.map(e=>e.totalTokens),1);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:G.summaryGrid,children:[(0,P.jsxs)(`div`,{className:G.summaryCard,children:[(0,P.jsx)(`span`,{className:G.summaryLabel,children:`Today`}),(0,P.jsx)(`span`,{className:G.summaryValue,children:Ec(e.today.totalTokens)}),(0,P.jsxs)(`span`,{className:G.summarySub,children:[e.today.requests,` requests`]})]}),(0,P.jsxs)(`div`,{className:G.summaryCard,children:[(0,P.jsx)(`span`,{className:G.summaryLabel,children:`All Time`}),(0,P.jsx)(`span`,{className:G.summaryValue,children:Ec(e.allTime.totalTokens)}),(0,P.jsxs)(`span`,{className:G.summarySub,children:[e.allTime.requests,` requests`]})]})]}),(0,P.jsxs)(`div`,{className:G.card,children:[(0,P.jsx)(`h3`,{className:G.cardTitle,children:`7-Day Usage`}),(0,P.jsx)(`div`,{className:G.chart,children:e.sevenDays.map(e=>(0,P.jsxs)(`div`,{className:G.chartBar,children:[(0,P.jsx)(`div`,{className:G.chartFill,style:{height:`${Math.max(2,e.totalTokens/n*100)}%`},title:`${e.date}: ${Ec(e.totalTokens)} tokens`}),(0,P.jsx)(`span`,{className:G.chartLabel,children:e.label})]},e.date))})]}),e.topModels.length>0&&(0,P.jsxs)(`div`,{className:G.card,children:[(0,P.jsx)(`h3`,{className:G.cardTitle,children:`Top Models`}),(0,P.jsx)(`div`,{className:G.topList,children:e.topModels.map(e=>(0,P.jsxs)(`div`,{className:G.topRow,children:[(0,P.jsx)(`span`,{className:G.topKey,children:e.key}),(0,P.jsxs)(`span`,{className:G.topVal,children:[Ec(e.total),` tokens`]}),(0,P.jsxs)(`span`,{className:G.topReq,children:[e.requests,` req`]})]},e.key))})]}),e.topProviders.length>0&&(0,P.jsxs)(`div`,{className:G.card,children:[(0,P.jsx)(`h3`,{className:G.cardTitle,children:`Top Providers`}),(0,P.jsx)(`div`,{className:G.topList,children:e.topProviders.map(e=>(0,P.jsxs)(`div`,{className:G.topRow,children:[(0,P.jsx)(`span`,{className:G.topKey,children:e.key}),(0,P.jsxs)(`span`,{className:G.topVal,children:[Ec(e.total),` tokens`]}),(0,P.jsxs)(`span`,{className:G.topReq,children:[e.requests,` req`]})]},e.key))})]})]})}var K={page:`_page_1n8f8_1`,pageHeader:`_pageHeader_1n8f8_5`,pageTitle:`_pageTitle_1n8f8_9`,pageSubtitle:`_pageSubtitle_1n8f8_15`,grid:`_grid_1n8f8_21`,card:`_card_1n8f8_27`,cardWide:`_cardWide_1n8f8_36`,cardTitle:`_cardTitle_1n8f8_40`,cardBody:`_cardBody_1n8f8_46`,empty:`_empty_1n8f8_49`,healthItem:`_healthItem_1n8f8_55`,healthName:`_healthName_1n8f8_67`,healthBar:`_healthBar_1n8f8_74`,healthFill:`_healthFill_1n8f8_82`,healthPct:`_healthPct_1n8f8_89`,pctFast:`_pctFast_1n8f8_97`,pctMedium:`_pctMedium_1n8f8_98`,pctSlow:`_pctSlow_1n8f8_99`,leaderItem:`_leaderItem_1n8f8_105`,leaderRank:`_leaderRank_1n8f8_117`,rank1:`_rank1_1n8f8_131`,rank2:`_rank2_1n8f8_132`,rank3:`_rank3_1n8f8_133`,leaderName:`_leaderName_1n8f8_135`,leaderLatency:`_leaderLatency_1n8f8_145`,tierItem:`_tierItem_1n8f8_153`,tierBadge:`_tierBadge_1n8f8_160`,tierBar:`_tierBar_1n8f8_165`,tierFill:`_tierFill_1n8f8_173`,tierCount:`_tierCount_1n8f8_179`};function Oc(e,t){return typeof window>`u`||!window.document?.documentElement?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}var kc={"S+":`--tier-splus`,S:`--tier-s`,"A+":`--tier-aplus`,A:`--tier-a`,"A-":`--tier-aminus`,"B+":`--tier-bplus`,B:`--tier-b`,C:`--tier-c`},Ac={"S+":`#ffd700`,S:`#ff8c00`,"A+":`#00c8ff`,A:`#3ddc84`,"A-":`#7ecf7e`,"B+":`#a8a8c8`,B:`#808098`,C:`#606078`};function jc(e){return Oc(kc[e],Ac[e])}var Mc=[`S+`,`S`,`A+`,`A`,`A-`,`B+`,`B`,`C`];function Nc({models:e}){let t=(0,v.useMemo)(()=>{let t={};return e.forEach(e=>{t[e.origin]||(t[e.origin]={total:0,online:0,key:e.providerKey}),t[e.origin].total++,e.status===`up`&&t[e.origin].online++}),Object.entries(t).sort((e,t)=>t[1].online/t[1].total-e[1].online/e[1].total)},[e]),n=(0,v.useMemo)(()=>[...e.filter(e=>e.status===`up`&&e.avg!==1/0&&e.avg<99e3)].sort((e,t)=>e.avg-t.avg).slice(0,10),[e]),r=(0,v.useMemo)(()=>{let t={};e.forEach(e=>{t[e.tier]=(t[e.tier]||0)+1});let n=Math.max(...Object.values(t),1);return Mc.map(e=>({tier:e,count:t[e]||0,pct:(t[e]||0)/n*100}))},[e]);return(0,P.jsxs)(`div`,{className:K.page,children:[(0,P.jsxs)(`div`,{className:K.pageHeader,children:[(0,P.jsxs)(`h1`,{className:K.pageTitle,children:[(0,P.jsx)(zn,{size:24,stroke:1.5,style:{marginRight:8,verticalAlign:`middle`}}),`Analytics`]}),(0,P.jsx)(`p`,{className:K.pageSubtitle,children:`Real-time insights across all providers and models`})]}),(0,P.jsxs)(`div`,{className:K.grid,children:[(0,P.jsxs)(`div`,{className:`${K.card} ${K.cardWide}`,children:[(0,P.jsx)(`h3`,{className:K.cardTitle,children:`Provider Health Overview`}),(0,P.jsx)(`div`,{className:K.cardBody,children:t.length===0?(0,P.jsx)(`div`,{className:K.empty,children:`Waiting for data...`}):t.map(([e,t])=>{let n=t.total>0?Math.round(t.online/t.total*100):0,r=n>70?K.pctFast:n>30?K.pctMedium:K.pctSlow;return(0,P.jsxs)(`div`,{className:K.healthItem,children:[(0,P.jsx)(`span`,{className:K.healthName,children:e}),(0,P.jsx)(`div`,{className:K.healthBar,children:(0,P.jsx)(`div`,{className:K.healthFill,style:{width:`${n}%`}})}),(0,P.jsxs)(`span`,{className:`${K.healthPct} ${r}`,children:[n,`%`]})]},e)})})]}),(0,P.jsxs)(`div`,{className:K.card,children:[(0,P.jsxs)(`h3`,{className:K.cardTitle,style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,P.jsx)(Kr,{size:16,stroke:1.5}),`Fastest Models`]}),(0,P.jsx)(`div`,{className:K.cardBody,children:n.length===0?(0,P.jsx)(`div`,{className:K.empty,children:`Waiting for ping data...`}):n.map((e,t)=>{let n=t<3?K[`rank${t+1}`]:``;return(0,P.jsxs)(`div`,{className:K.leaderItem,children:[(0,P.jsx)(`div`,{className:`${K.leaderRank} ${n}`,children:t+1}),(0,P.jsx)(`span`,{className:K.leaderName,children:e.label}),(0,P.jsxs)(`span`,{className:K.leaderLatency,children:[e.avg,`ms`]})]},e.modelId)})})]}),(0,P.jsxs)(`div`,{className:K.card,children:[(0,P.jsx)(`h3`,{className:K.cardTitle,children:`Tier Distribution`}),(0,P.jsx)(`div`,{className:K.cardBody,children:r.map(({tier:e,count:t,pct:n})=>(0,P.jsxs)(`div`,{className:K.tierItem,children:[(0,P.jsx)(`div`,{className:K.tierBadge,children:(0,P.jsx)(ps,{tier:e})}),(0,P.jsx)(`div`,{className:K.tierBar,children:(0,P.jsx)(`div`,{className:K.tierFill,style:{width:`${n}%`,background:jc(e)}})}),(0,P.jsx)(`span`,{className:K.tierCount,children:t})]},e))})]})]}),(0,P.jsx)(Dc,{})]})}var Pc={nvidia:{name:`NVIDIA NIM`,url:`https://integrate.api.nvidia.com/v1/chat/completions`,models:[[`minimaxai/minimax-m2.7`,`MiniMax M2.7`,`S+`,`80.2%`,`200k`],[`z-ai/glm-5.1`,`GLM 5.1`,`S+`,`77.8%`,`128k`],[`moonshotai/kimi-k2.6`,`Kimi K2.6`,`S+`,`76.8%`,`256k`],[`deepseek-ai/deepseek-v4-pro`,`DeepSeek V4 Pro`,`S+`,`73.1%`,`1M`],[`deepseek-ai/deepseek-v4-flash`,`DeepSeek V4 Flash`,`S+`,`72.0%`,`1M`],[`stepfun-ai/step-3.5-flash`,`Step 3.5 Flash`,`S+`,`74.4%`,`256k`],[`stepfun-ai/step-3.7-flash`,`Step 3.7 Flash`,`S+`,`74.4%`,`256k`],[`nvidia/nemotron-3-ultra-550b-a55b`,`Nemotron 3 Ultra`,`S+`,`-`,`1M`],[`qwen/qwen3-next-80b-a3b-instruct`,`Qwen3 80B Instruct`,`S`,`65.0%`,`128k`],[`qwen/qwen3.5-397b-a17b`,`Qwen3.5 400B VLM`,`S`,`68.0%`,`128k`],[`openai/gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`128k`],[`meta/llama-4-maverick-17b-128e-instruct`,`Llama 4 Maverick`,`S`,`62.0%`,`1M`],[`mistralai/mistral-medium-3.5-128b`,`Mistral Medium 3.5`,`S`,`66.0%`,`128k`],[`mistralai/mistral-small-4-119b-2603`,`Mistral Small 4`,`S`,`60.0%`,`256k`],[`qwen/qwen3.5-122b-a10b`,`Qwen3.5 122B`,`S`,`64.0%`,`128k`],[`minimaxai/minimax-m3`,`MiniMax M3`,`S`,`59.0%`,`1M`],[`mistralai/mistral-large-3-675b-instruct-2512`,`Mistral Large 675B`,`A+`,`58.0%`,`256k`],[`nvidia/nemotron-3-super-120b-a12b`,`Nemotron 3 Super`,`A+`,`56.0%`,`128k`],[`nvidia/nemotron-3-nano-omni-30b-a3b-reasoning`,`Nemotron 3 Omni`,`A+`,`52.0%`,`128k`],[`nvidia/nemotron-3-nano-30b-a3b`,`Nemotron Nano 30B`,`A`,`43.0%`,`128k`],[`openai/gpt-oss-20b`,`GPT OSS 20B`,`A`,`42.0%`,`128k`],[`google/gemma-4-31b-it`,`Gemma 4 31B`,`A`,`45.0%`,`256k`],[`bytedance/seed-oss-36b-instruct`,`Seed OSS 36B`,`A-`,`38.0%`,`32k`],[`stockmark/stockmark-2-100b-instruct`,`Stockmark 100B`,`A-`,`36.0%`,`32k`],[`mistralai/ministral-14b-instruct-2512`,`Ministral 14B`,`B+`,`34.0%`,`32k`],[`meta/llama-3.2-11b-vision-instruct`,`Llama 3.2 11B Vision`,`B`,`28.0%`,`128k`],[`microsoft/phi-4-mini-instruct`,`Phi 4 Mini`,`C`,`14.0%`,`128k`]]},groq:{name:`Groq`,url:`https://api.groq.com/openai/v1/chat/completions`,models:[[`llama-3.3-70b-versatile`,`Llama 3.3 70B`,`A-`,`39.5%`,`131k`],[`meta-llama/llama-4-scout-17b-16e-instruct`,`Llama 4 Scout`,`A`,`44.0%`,`131k`],[`llama-3.1-8b-instant`,`Llama 3.1 8B`,`B`,`28.8%`,`131k`],[`openai/gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`131k`],[`openai/gpt-oss-20b`,`GPT OSS 20B`,`A`,`42.0%`,`131k`],[`qwen/qwen3-32b`,`Qwen3 32B`,`A+`,`50.0%`,`131k`],[`qwen/qwen3.6-27b`,`Qwen3.6 27B`,`A`,`-`,`131k`],[`groq/compound`,`Groq Compound`,`A`,`45.0%`,`131k`],[`groq/compound-mini`,`Groq Compound Mini`,`B+`,`32.0%`,`131k`]]},cerebras:{name:`Cerebras`,url:`https://api.cerebras.ai/v1/chat/completions`,models:[[`gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`131k`],[`zai-glm-4.7`,`GLM 4.7`,`S+`,`73.8%`,`131k`]]},googleai:{name:`Google AI`,url:`https://generativelanguage.googleapis.com/v1beta/openai/chat/completions`,models:[[`gemini-3.5-flash`,`Gemini 3.5 Flash`,`S+`,`-`,`1M`],[`gemini-3.1-pro-preview`,`Gemini 3.1 Pro Preview`,`S+`,`78.0%`,`1M`],[`gemini-3-flash-preview`,`Gemini 3 Flash Preview`,`S`,`65.0%`,`1M`],[`gemini-3.1-flash-lite`,`Gemini 3.1 Flash Lite`,`A+`,`55.0%`,`1M`],[`gemini-2.5-pro`,`Gemini 2.5 Pro`,`S+`,`63.2%`,`1M`],[`gemini-2.5-flash`,`Gemini 2.5 Flash`,`A+`,`50.0%`,`1M`],[`gemini-2.5-flash-lite`,`Gemini 2.5 Flash Lite`,`A`,`42.0%`,`1M`]]},"github-models":{name:`GitHub Models`,url:`https://models.github.ai/inference/chat/completions`,models:[[`openai/gpt-4.1`,`GPT-4.1`,`S+`,`-`,`1M`],[`openai/gpt-4.1-mini`,`GPT-4.1 Mini`,`S`,`-`,`1M`],[`openai/gpt-4.1-nano`,`GPT-4.1 Nano`,`A`,`-`,`1M`],[`deepseek/deepseek-v3-0324`,`DeepSeek V3 0324`,`S`,`62.0%`,`128k`],[`meta/meta-llama-3.1-405b-instruct`,`Llama 3.1 405B`,`A`,`44.0%`,`128k`],[`meta/llama-4-maverick-17b-128e-instruct-fp8`,`Llama 4 Maverick`,`S`,`62.0%`,`1M`],[`meta/llama-4-scout-17b-16e-instruct`,`Llama 4 Scout`,`A`,`44.0%`,`1M`],[`meta/llama-3.3-70b-instruct`,`Llama 3.3 70B`,`A-`,`39.5%`,`128k`],[`meta/llama-3.2-90b-vision-instruct`,`Llama 3.2 90B Vision`,`A-`,`-`,`128k`],[`meta/llama-3.2-11b-vision-instruct`,`Llama 3.2 11B Vision`,`B`,`-`,`128k`],[`meta/meta-llama-3.1-8b-instruct`,`Llama 3.1 8B`,`B`,`28.8%`,`128k`],[`mistral-ai/codestral-2501`,`Codestral 2501`,`B+`,`34.0%`,`256k`],[`mistral-ai/mistral-medium-2505`,`Mistral Medium 2505`,`A`,`48.0%`,`128k`],[`mistral-ai/mistral-small-2503`,`Mistral Small 2503`,`B+`,`30.0%`,`128k`],[`mistral-ai/ministral-3b`,`Ministral 3B`,`C`,`-`,`128k`]]},mistral:{name:`Mistral LP`,url:`https://api.mistral.ai/v1/chat/completions`,models:[[`mistral-large-2512`,`Mistral Large 3`,`S+`,`70.0%`,`256k`],[`mistral-medium-3-5`,`Mistral Medium 3.5`,`S+`,`77.6%`,`256k`],[`devstral-2512`,`Devstral 2`,`S+`,`72.2%`,`256k`],[`magistral-medium-2509`,`Magistral Medium 1.2`,`A+`,`52.0%`,`128k`],[`mistral-small-2603`,`Mistral Small 4`,`A`,`48.0%`,`256k`]]},cloudflare:{name:`Cloudflare AI`,url:`https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/v1/chat/completions`,models:[[`@cf/moonshotai/kimi-k2.6`,`Kimi K2.6`,`S+`,`76.8%`,`262k`],[`@cf/moonshotai/kimi-k2.7-code`,`Kimi K2.7 Code`,`S+`,`-`,`262k`],[`@cf/zai-org/glm-4.7-flash`,`GLM-4.7-Flash`,`S`,`59.2%`,`131k`],[`@cf/openai/gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`128k`],[`@cf/nvidia/nemotron-3-120b-a12b`,`Nemotron 3 Super`,`A+`,`56.0%`,`128k`],[`@cf/zai-org/glm-5.2`,`GLM-5.2`,`S+`,`-`,`262k`],[`@cf/moonshotai/kimi-k2.5`,`Kimi K2.5`,`S+`,`-`,`256k`],[`@cf/meta/llama-4-scout-17b-16e-instruct`,`Llama 4 Scout`,`A`,`44.0%`,`131k`],[`@cf/mistralai/mistral-7b-instruct-v0.2`,`Mistral 7B v0.2`,`A`,`38.0%`,`128k`],[`@cf/qwen/qwen3-30b-a3b-fp8`,`Qwen3 30B MoE`,`A`,`45.0%`,`128k`],[`@cf/qwen/qwen2.5-coder-32b-instruct`,`Qwen2.5 Coder 32B`,`A`,`46.0%`,`128k`],[`@cf/openai/gpt-oss-20b`,`GPT OSS 20B`,`A`,`42.0%`,`128k`],[`@cf/meta/llama-3.3-70b-instruct-fp8-fast`,`Llama 3.3 70B`,`A-`,`39.5%`,`128k`],[`@cf/google/gemma-4-26b-a4b-it`,`Gemma 4 26B MoE`,`A-`,`38.0%`,`128k`],[`@cf/mistralai/mistral-small-3.1-24b-instruct`,`Mistral Small 3.1`,`B+`,`30.0%`,`128k`],[`@cf/ibm/granite-4.0-h-micro`,`Granite 4.0 Micro`,`B+`,`30.0%`,`128k`]]},openrouter:{name:`OpenRouter`,url:`https://openrouter.ai/api/v1/chat/completions`,models:[[`nvidia/nemotron-3-ultra-550b-a55b:free`,`Nemotron 3 Ultra`,`S+`,`-`,`1M`],[`poolside/laguna-m.1:free`,`Poolside Laguna M.1`,`S+`,`-`,`262k`],[`poolside/laguna-xs.2:free`,`Poolside Laguna XS.2`,`S+`,`-`,`262k`],[`openai/gpt-oss-120b:free`,`GPT OSS 120B`,`S`,`60.0%`,`131k`],[`cohere/north-mini-code:free`,`North Mini Code`,`S`,`-`,`256k`],[`nvidia/nemotron-3-super-120b-a12b:free`,`Nemotron 3 Super`,`A+`,`56.0%`,`1M`],[`nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free`,`Nemotron 3 Omni`,`A+`,`52.0%`,`256k`],[`openrouter/owl-alpha`,`Owl Alpha`,`A+`,`-`,`1M`],[`openai/gpt-oss-20b:free`,`GPT OSS 20B`,`A`,`42.0%`,`131k`],[`nvidia/nemotron-nano-30b-a3b:free`,`Nemotron Nano 30B`,`A`,`43.0%`,`256k`],[`nvidia/nemotron-nano-12b-v2-vl:free`,`Nemotron Nano 12B VL`,`A`,`20.0%`,`128k`],[`google/gemma-4-31b-it:free`,`Gemma 4 31B`,`A`,`45.0%`,`262k`],[`google/gemma-4-26b-a4b-it:free`,`Gemma 4 26B MoE`,`A`,`38.0%`,`262k`],[`nvidia/nemotron-nano-9b-v2:free`,`Nemotron Nano 9B`,`B+`,`18.0%`,`128k`],[`openrouter/free`,`OpenRouter Free`,`B`,`-`,`200k`]]},sambanova:{name:`SambaNova`,url:`https://api.sambanova.ai/v1/chat/completions`,models:[[`MiniMax-M2.7`,`MiniMax M2.7`,`S+`,`56.2%`,`192k`],[`DeepSeek-V3.1`,`DeepSeek V3.1`,`S`,`62.0%`,`128k`],[`DeepSeek-V3.2`,`DeepSeek V3.2`,`S+`,`70.0%`,`32k`],[`gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`128k`],[`gemma-4-31B-it`,`Gemma 4 31B`,`A`,`45.0%`,`128k`],[`Meta-Llama-3.3-70B-Instruct`,`Llama 3.3 70B`,`A-`,`39.5%`,`128k`]]},ovhcloud:{name:`OVHcloud AI`,url:`https://oai.endpoints.kepler.ai.cloud.ovh.net/v1/chat/completions`,models:[[`Qwen3.5-397B-A17B`,`Qwen3.5 397B MoE`,`S`,`-`,`262k`],[`Qwen3.6-27B`,`Qwen3.6 27B`,`A`,`-`,`262k`],[`Qwen3-Coder-30B-A3B-Instruct`,`Qwen3 Coder 30B MoE`,`A+`,`55.0%`,`256k`],[`gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`131k`],[`gpt-oss-20b`,`GPT OSS 20B`,`A`,`42.0%`,`131k`],[`Meta-Llama-3_3-70B-Instruct`,`Llama 3.3 70B`,`A-`,`39.5%`,`131k`],[`Qwen3-32B`,`Qwen3 32B`,`A+`,`50.0%`,`32k`],[`Mistral-Small-3.2-24B-Instruct-2506`,`Mistral Small 3.2`,`B+`,`34.0%`,`128k`],[`Mistral-7B-Instruct-v0.3`,`Mistral 7B Instruct`,`B`,`25.0%`,`127k`],[`Mistral-Nemo-Instruct-2407`,`Mistral Nemo`,`B+`,`30.0%`,`118k`],[`Qwen3.5-9B`,`Qwen3.5 9B`,`B+`,`30.0%`,`262k`],[`Qwen3-Embedding-8B`,`Qwen3 Embedding 8B`,`B`,`-`,`-`],[`bge-m3`,`BGE M3`,`B`,`-`,`-`],[`bge-multilingual-gemma2`,`BGE Multilingual Gemma2`,`B`,`-`,`-`]]},codestral:{name:`Codestral`,url:`https://api.mistral.ai/v1/chat/completions`,models:[[`codestral-2508`,`Codestral`,`B+`,`34.0%`,`128k`]]},zai:{name:`ZAI`,url:`https://api.z.ai/api/coding/paas/v4/chat/completions`,models:[[`zai/glm-4.7-flash`,`GLM-4.7-Flash`,`S`,`59.2%`,`200k`],[`zai/glm-4.5-flash`,`GLM-4.5-Flash`,`S`,`59.2%`,`128k`]]},scaleway:{name:`Scaleway`,url:`https://api.scaleway.ai/v1/chat/completions`,models:[[`devstral-2-123b-instruct-2512`,`Devstral 2 123B`,`S+`,`72.2%`,`200k`],[`qwen3.5-397b-a17b`,`Qwen3.5 400B VLM`,`S`,`68.0%`,`250k`],[`mistral/mistral-large-3-675b-instruct-2512`,`Mistral Large 675B`,`A+`,`58.0%`,`250k`],[`qwen3-235b-a22b-instruct-2507`,`Qwen3 235B`,`S+`,`70.0%`,`250k`],[`gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`128k`],[`qwen3-coder-30b-a3b-instruct`,`Qwen3 Coder 30B`,`A+`,`55.0%`,`128k`],[`qwen3.6-35b-a3b`,`Qwen3.6 35B MoE`,`A+`,`-`,`256k`],[`holo2-30b-a3b`,`Holo2 30B`,`A+`,`52.0%`,`22k`],[`llama-3.3-70b-instruct`,`Llama 3.3 70B`,`A-`,`39.5%`,`100k`],[`mistral-small-3.2-24b-instruct-2506`,`Mistral Small 3.2`,`B+`,`30.0%`,`128k`],[`gemma-3-27b-it`,`Gemma 3 27B`,`B`,`22.0%`,`40k`]]},qwen:{name:`Alibaba DashScope`,url:`https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions`,models:[[`qwen3.7-max`,`Qwen3.7 Max`,`S+`,`80.0%`,`1M`],[`qwen3-max`,`Qwen3 Max`,`S+`,`78.8%`,`256k`],[`qwen3.6-plus`,`Qwen3.6 Plus`,`S+`,`72.0%`,`1M`],[`qwen3-235b-a22b`,`Qwen3 235B`,`S+`,`70.0%`,`256k`],[`qwen3.5-plus`,`Qwen3.5 Plus`,`S`,`68.0%`,`1M`],[`qwen3-coder-plus`,`Qwen3 Coder Plus`,`S`,`69.6%`,`1M`],[`qwen3-coder-next`,`Qwen3 Coder Next`,`S`,`65.0%`,`256k`],[`qwen3.6-flash`,`Qwen3.6 Flash`,`A+`,`60.0%`,`1M`],[`qwen3.5-flash`,`Qwen3.5 Flash`,`A+`,`55.0%`,`1M`],[`qwen3-coder-flash`,`Qwen3 Coder Flash`,`A+`,`55.0%`,`1M`],[`qwen3-32b`,`Qwen3 32B`,`A+`,`50.0%`,`256k`]]},"opencode-zen":{name:`OpenCode Zen`,url:`https://opencode.ai/zen/v1/chat/completions`,models:[[`big-pickle`,`Big Pickle`,`S+`,`72.0%`,`200k`],[`deepseek-v4-flash-free`,`DeepSeek V4 Flash Free`,`S+`,`79.0%`,`200k`],[`mimo-v2.5-free`,`MiMo-V2.5 Free`,`S+`,`-`,`200k`],[`nemotron-3-ultra-free`,`Nemotron 3 Ultra Free`,`A+`,`-`,`200k`],[`north-mini-code-free`,`North Mini Code Free`,`B+`,`-`,`200k`]],zenOnly:!0},kilo:{name:`Kilo`,url:`https://api.kilo.ai/api/gateway/chat/completions`,models:[[`kilo-auto/free`,`Kilo Auto Free`,`A+`,`-`,`256k`]],noKeyNeeded:!0},llm7:{name:`LLM7`,url:`https://api.llm7.io/v1/chat/completions`,models:[[`deepseek-v4-flash`,`DeepSeek V4 Flash`,`S+`,`-`,`128k`],[`kimi-k2.6`,`Kimi K2.6`,`S+`,`-`,`256k`],[`qwen3-235b`,`Qwen3 235B`,`S+`,`70.0%`,`240k`],[`devstral-small-2:24b`,`Devstral Small 2`,`A`,`-`,`128k`],[`mistral-small-3.2`,`Mistral Small 3.2`,`B+`,`34.0%`,`128k`],[`codestral-latest`,`Codestral Latest`,`B+`,`34.0%`,`32k`]],noKeyNeeded:!0},routeway:{name:`Routeway`,url:`https://api.routeway.ai/v1/chat/completions`,models:[[`deepseek-v4-flash:free`,`DeepSeek V4 Flash`,`S+`,`72.0%`,`1M`],[`step-3.5-flash:free`,`Step 3.5 Flash`,`S+`,`74.4%`,`256k`],[`ling-2.6-flash:free`,`Ling 2.6 Flash`,`S`,`-`,`262k`],[`gpt-oss-120b:free`,`GPT OSS 120B`,`S`,`60.0%`,`131k`],[`minimax-m2:free`,`MiniMax M2`,`S`,`-`,`197k`],[`laguna-m.1:free`,`Poolside Laguna M.1`,`S+`,`-`,`131k`],[`laguna-xs.2:free`,`Poolside Laguna XS.2`,`S+`,`-`,`131k`],[`gemma-4-31b-it:free`,`Gemma 4 31B`,`A`,`45.0%`,`262k`],[`nemotron-3-nano-30b-a3b:free`,`Nemotron Nano 30B`,`A`,`43.0%`,`256k`],[`llama-3.3-70b-instruct:free`,`Llama 3.3 70B`,`A-`,`39.5%`,`131k`],[`mistral-nemo-instruct:free`,`Mistral Nemo`,`B+`,`30.0%`,`16k`],[`nemotron-nano-9b-v2:free`,`Nemotron Nano 9B`,`B+`,`18.0%`,`128k`],[`llama-3.1-8b-instruct:free`,`Llama 3.1 8B`,`B`,`28.8%`,`16k`],[`llama-3.2-3b-instruct:free`,`Llama 3.2 3B`,`B`,`20.0%`,`16k`],[`llama-3.2-1b-instruct:free`,`Llama 3.2 1B`,`C`,`-`,`16k`]]},novita:{name:`Novita AI`,url:`https://api.novita.ai/openai/v1/chat/completions`,models:[[`qwen/qwen3.6-plus`,`Qwen3.6 Plus`,`S+`,`72.0%`,`1M`],[`qwen/qwen3.5-plus`,`Qwen3.5 Plus`,`S`,`68.0%`,`1M`],[`nex-agi/nex-n2-pro`,`Nex N2 Pro`,`S`,`-`,`262k`],[`minimax/m2-her`,`MiniMax M2 HER`,`S`,`-`,`32k`]]},"ollama-cloud":{name:`Ollama Cloud`,url:`https://ollama.com/v1/chat/completions`,models:[[`minimax-m2.7`,`MiniMax M2.7`,`S+`,`80.2%`,`200k`],[`glm-5.1`,`GLM 5.1`,`S+`,`77.8%`,`203k`],[`kimi-k2.6`,`Kimi K2.6`,`S+`,`76.8%`,`131k`],[`deepseek-v4-pro`,`DeepSeek V4 Pro`,`S+`,`73.1%`,`1M`],[`deepseek-v4-flash`,`DeepSeek V4 Flash`,`S+`,`72.0%`,`1M`],[`devstral-2:123b`,`Devstral 2 123B`,`S+`,`72.2%`,`200k`],[`qwen3-coder:480b`,`Qwen3 Coder 480B`,`S+`,`70.6%`,`256k`],[`nemotron-3-ultra`,`Nemotron 3 Ultra`,`S+`,`-`,`1M`],[`glm-4.7`,`GLM 4.7`,`S+`,`73.8%`,`128k`],[`qwen3.5:397b`,`Qwen3.5 397B`,`S`,`68.0%`,`128k`],[`qwen3-coder-next`,`Qwen3 Coder Next`,`S`,`65.0%`,`256k`],[`gpt-oss:120b`,`GPT OSS 120B`,`S`,`60.0%`,`128k`],[`minimax-m3`,`MiniMax M3`,`S`,`59.0%`,`1M`],[`mistral-large-3:675b`,`Mistral Large 3`,`A+`,`58.0%`,`256k`],[`nemotron-3-super`,`Nemotron 3 Super`,`A+`,`56.0%`,`128k`],[`gemma4:31b`,`Gemma 4 31B`,`A`,`45.0%`,`256k`],[`gpt-oss:20b`,`GPT OSS 20B`,`A`,`42.0%`,`128k`]]}},Fc=[];for(let[e,t]of Object.entries(Pc))if(!(!t||!t.models))for(let n of t.models){let[t,r,i,a,o,s]=n;Fc.push([t,r,i,a,o,e,s||null])}var Ic=Object.entries(Pc).map(([e,t])=>{let n=t?.name||e;return{id:`filter-provider-${e.replace(/[^a-z0-9]+/gi,`-`)}`,label:n,providerKey:e,description:`${n} models`,keywords:[`filter`,`provider`,`origin`,e,n.toLowerCase()]}}),Lc={opencode:`Launch in OpenCode CLI with the selected model.`,"opencode-desktop":`Set model in shared config, then open OpenCode Desktop.`,"opencode-web":`Set model in shared config, then open OpenCode WebUI.`,openclaw:`Set default model in OpenClaw and launch it.`,crush:`Launch Crush with this provider/model pair.`,goose:`Launch Goose and preselect the active model.`,pi:`Launch Pi with model/provider flags.`,aider:`Launch Aider configured on the selected model.`,kilo:`Set model in shared config, then launch Kilo CLI.`,qwen:`Launch Qwen Code using the selected provider model.`,openhands:`Launch OpenHands with the selected model endpoint.`,amp:`Launch Amp with this model as active target.`,hermes:`Launch Hermes Agent with the selected model.`,continue:`Launch Continue CLI with the selected model.`,cline:`Launch Cline CLI with the selected model.`,caveman:`Caveman Code — token-efficient coding agent (launch with Caveman tool only).`,jcode:`Launch jcode coding agent with the selected model.`},Rc=yn.map(e=>{let t=vn[e]||{label:e,emoji:`🧰`};return{id:`action-set-tool-${e}`,label:t.label,toolMode:e,icon:t.emoji,description:Lc[e]||`Set this as the active launch target.`,keywords:[`tool`,`target`,`mode`,e,t.label.toLowerCase()]}}),zc=[{id:`action-cycle-ping-mode`,label:`Cycle ping mode`,shortcut:`W`,icon:`⚡`,description:`Rotate speed → normal → slow → forced.`,keywords:[`ping`,`mode`,`cycle`,`speed`,`normal`,`slow`,`forced`]},{id:`action-set-ping-speed`,label:`Speed mode (2s)`,pingMode:`speed`,description:`Fast 2s bursts for short live checks.`,keywords:[`ping`,`mode`,`speed`,`2s`,`fast`]},{id:`action-set-ping-normal`,label:`Normal mode (10s)`,pingMode:`normal`,description:`Balanced default cadence for daily use.`,keywords:[`ping`,`mode`,`normal`,`10s`,`default`]},{id:`action-set-ping-slow`,label:`Slow mode (30s)`,pingMode:`slow`,description:`Lower refresh cost when you are mostly idle.`,keywords:[`ping`,`mode`,`slow`,`30s`,`idle`]},{id:`action-set-ping-forced`,label:`Forced mode (4s)`,pingMode:`forced`,description:`Keeps 4s cadence until manually changed.`,keywords:[`ping`,`mode`,`forced`,`4s`,`manual`]}],Bc=[{id:`filters`,label:`Filters`,icon:`🔍`,children:[{id:`filter-tier`,label:`Filter by tier`,icon:`📊`,children:[{id:`filter-tier-all`,label:`All tiers`,tier:null,shortcut:`T`,description:`Show all models`,keywords:[`filter`,`tier`,`all`]},{id:`filter-tier-splus`,label:`S+ tier`,tier:`S+`,description:`Best coding models`,keywords:[`filter`,`tier`,`s+`]},{id:`filter-tier-s`,label:`S tier`,tier:`S`,description:`Excellent models`,keywords:[`filter`,`tier`,`s`]},{id:`filter-tier-aplus`,label:`A+ tier`,tier:`A+`,description:`Very good models`,keywords:[`filter`,`tier`,`a+`]},{id:`filter-tier-a`,label:`A tier`,tier:`A`,description:`Good models`,keywords:[`filter`,`tier`,`a`]},{id:`filter-tier-aminus`,label:`A- tier`,tier:`A-`,description:`Solid models`,keywords:[`filter`,`tier`,`a-`]},{id:`filter-tier-bplus`,label:`B+ tier`,tier:`B+`,description:`Fair models`,keywords:[`filter`,`tier`,`b+`]},{id:`filter-tier-b`,label:`B tier`,tier:`B`,description:`Basic models`,keywords:[`filter`,`tier`,`b`]},{id:`filter-tier-c`,label:`C tier`,tier:`C`,description:`Limited models`,keywords:[`filter`,`tier`,`c`]}]},{id:`filter-provider`,label:`Filter by provider`,icon:`🏢`,children:[{id:`filter-provider-cycle`,label:`Cycle provider`,shortcut:`D`,description:`Switch between providers`,keywords:[`filter`,`provider`,`origin`]},{id:`filter-provider-all`,label:`All providers`,providerKey:null,description:`Show all providers`,keywords:[`filter`,`provider`,`all`]},...Ic]},{id:`filter-model`,label:`Filter by model`,icon:`🤖`,children:[]},{id:`filter-other`,label:`Other filters`,icon:`⚙️`,children:[{id:`filter-configured-toggle`,label:`Show only configured & working`,shortcut:`E`,description:`Show only configured providers that are responding (not noauth/auth error)`,keywords:[`filter`,`configured`,`keys`,`working`,`active`]}]}]},{id:`sort`,label:`Sort`,icon:`📶`,children:[{id:`sort-rank`,label:`Sort by rank`,shortcut:`R`,description:`Rank by SWE score`,keywords:[`sort`,`rank`]},{id:`sort-tier`,label:`Sort by tier`,description:`Group by quality tier`,keywords:[`sort`,`tier`]},{id:`sort-provider`,label:`Sort by provider`,shortcut:`O`,description:`Group by provider`,keywords:[`sort`,`origin`,`provider`]},{id:`sort-model`,label:`Sort by model`,shortcut:`M`,description:`Alphabetical order`,keywords:[`sort`,`model`,`name`]},{id:`sort-latest-ping`,label:`Sort by latest ping`,shortcut:`L`,description:`Recent response time`,keywords:[`sort`,`latest`,`ping`]},{id:`sort-avg-ping`,label:`Sort by avg ping`,shortcut:`A`,description:`Average response time`,keywords:[`sort`,`avg`,`average`,`ping`]},{id:`sort-swe`,label:`Sort by SWE score`,shortcut:`S`,description:`Coding ability score`,keywords:[`sort`,`swe`,`score`]},{id:`sort-ctx`,label:`Sort by context`,shortcut:`C`,description:`Context window size`,keywords:[`sort`,`context`,`ctx`]},{id:`sort-health`,label:`Sort by health`,shortcut:`H`,description:`Current model status`,keywords:[`sort`,`health`,`condition`]},{id:`sort-verdict`,label:`Sort by verdict`,shortcut:`V`,description:`Overall assessment`,keywords:[`sort`,`verdict`]},{id:`sort-stability`,label:`Sort by stability`,shortcut:`B`,description:`Reliability score`,keywords:[`sort`,`stability`]},{id:`sort-uptime`,label:`Sort by uptime`,shortcut:`U`,description:`Success rate`,keywords:[`sort`,`uptime`]}]},{id:`actions`,label:`Actions`,icon:`⚙️`,children:[{id:`action-target-tool`,label:`Target tool`,icon:`🧰`,children:[{id:`action-cycle-tool-mode`,label:`Cycle target tool`,shortcut:`Z`,icon:`🔄`,description:`Rotate through every launcher mode.`,keywords:[`tool`,`mode`,`cycle`,`target`]},...Rc]},{id:`action-ping-mode`,label:`Ping mode`,icon:`📶`,children:zc},{id:`action-favorites-mode`,label:`Favorites mode`,icon:`⭐`,children:[{id:`action-toggle-favorite-mode`,label:`Toggle favorites mode`,shortcut:`Y`,icon:`⭐`,description:`Switch pinned+sticky ↔ normal list behavior.`,keywords:[`favorite`,`favorites`,`mode`,`toggle`,`y`]},{id:`action-favorites-mode-pinned`,label:`Pinned + always visible`,favoritesPinned:!0,description:`Favorites stay on top and bypass current filters.`,keywords:[`favorite`,`favorites`,`pinned`,`sticky`,`always visible`]},{id:`action-favorites-mode-normal`,label:`Normal rows (starred only)`,favoritesPinned:!1,description:`Favorites keep ⭐ but follow active filters and sort.`,keywords:[`favorite`,`favorites`,`normal`,`sort`,`filter`]},{id:`action-toggle-favorite`,label:`Toggle favorite on selected row`,shortcut:`F`,icon:`⭐`,description:`Star/unstar the highlighted model.`,keywords:[`favorite`,`star`,`toggle`]}]},{id:`action-cycle-theme`,label:`Cycle theme`,shortcut:`G`,icon:`🌗`,description:`Switch dark/light/auto`,keywords:[`theme`,`dark`,`light`,`auto`]},{id:`action-reset-view`,label:`Reset view`,shortcut:`N`,icon:`🔄`,description:`Reset filters and sort`,keywords:[`reset`,`view`,`sort`,`filters`]},{id:`action-probe-404`,label:`Probe 404 Models`,shortcut:`Ctrl+Shift+P`,icon:`🔍`,description:`Test all configured models for 404/410 errors. Auto-hides broken models.`,keywords:[`probe`,`404`,`broken`,`dead`,`health`,`check`,`test`,`verify`]},{id:`action-toggle-auto-hide-broken`,label:`Toggle Auto-hide Broken Models`,icon:`🚩`,description:`Enable/disable auto-hiding of 404/410 models. Unhides all when disabled.`,keywords:[`auto`,`hide`,`broken`,`404`,`models`,`toggle`,`probe`]}]},{id:`open-settings`,label:`Settings`,shortcut:`P`,icon:`⚙️`,type:`page`,description:`API keys and preferences`,keywords:[`settings`,`config`,`api key`]},{id:`open-help`,label:`Help`,shortcut:`K`,icon:`❓`,type:`page`,description:`Show all shortcuts`,keywords:[`help`,`shortcuts`,`hotkeys`]},{id:`open-changelog`,label:`Changelog`,icon:`📋`,type:`page`,description:`Version history`,keywords:[`changelog`,`release`]},{id:`open-recommend`,label:`Smart recommend`,shortcut:`Q`,icon:`🎯`,type:`page`,description:`Find best model for task`,keywords:[`recommend`,`best model`]},{id:`open-playground`,label:`Playground`,shortcut:`;`,icon:`💬`,type:`page`,description:`Chat with the FCM router`,keywords:[`playground`,`chat`,`try`,`prompt`,`router`]},{id:`open-install-endpoints`,label:`Install endpoints`,icon:`🔌`,type:`page`,description:`Install provider catalogs`,keywords:[`install`,`endpoints`,`providers`]},{id:`open-installed-models`,label:`Installed models`,icon:`🗂️`,type:`page`,description:`View models configured in tools`,keywords:[`installed`,`models`,`configured`,`tools`,`manager`,`goose`,`crush`,`aider`]}];function Vc(e=[]){let t=JSON.parse(JSON.stringify(Bc)),n=t.find(e=>e.id===`filters`)?.children.find(e=>e.id===`filter-model`);if(n&&Array.isArray(e)&&e.length>0){let t=e.filter(e=>!e.hidden&&e.status!==`noauth`).slice(0,20);for(let e of t)n.children.push({id:`filter-model-${e.providerKey}-${e.modelId}`,label:e.label,modelId:e.modelId,providerKey:e.providerKey,keywords:[`filter`,`model`,e.label.toLowerCase(),e.modelId.toLowerCase()]})}return t}function Hc(e,t=new Set){let n=[];function r(e,i=0){for(let a of e){if(a.type===`page`||a.type===`action`){n.push({...a,type:a.type,depth:0,hasChildren:!1,isExpanded:!1});continue}let e=t.has(a.id),o=Array.isArray(a.children)&&a.children.length>0;o?(n.push({...a,type:i===0?`category`:`subcategory`,depth:i,hasChildren:o,isExpanded:e}),e&&r(a.children,i+1)):n.push({...a,type:`command`,depth:i,hasChildren:!1,isExpanded:!1})}}return r(e),n}function Uc(e=[]){let t=Vc(e),n=new Set;function r(e){for(let t of e)n.add(t.id),Array.isArray(t.children)&&r(t.children)}return r(t),Hc(t,n).map(e=>{let t={...e};return e.tier!==void 0&&(t.tierValue=e.tier),t})}function Wc(e,t){let n=(e||``).trim().toLowerCase(),r=(t||``).toLowerCase();if(!n)return{matched:!0,score:0,positions:[]};if(!r)return{matched:!1,score:0,positions:[]};let i=0,a=[];for(let e=0;e<r.length&&i<n.length;e++)n[i]===r[e]&&(a.push(e),i++);if(i!==n.length)return{matched:!1,score:0,positions:[]};let o=n.length*10;for(let e=1;e<a.length;e++)a[e]===a[e-1]+1&&(o+=5);for(let e of a)if(e===0)o+=8;else{let t=r[e-1];(t===` `||t===`:`||t===`-`||t===`/`)&&(o+=6)}return o-=Math.max(0,r.length-n.length),{matched:!0,score:o,positions:a}}function Gc(e,t){let n=(t||``).trim();if(!n)return e;let r=[];for(let t of e){let e=Wc(n,t.label),i=e.score,a=e.positions,o=e.matched;if(!o&&Array.isArray(t.keywords))for(let e of t.keywords){let t=Wc(n,e);if(!t.matched)continue;o=!0;let r=Math.max(1,t.score-7);r>i&&(i=r,a=[])}o&&r.push({...t,score:i,matchPositions:a})}let i=[],a=new Set;for(let e of r)e.type===`command`&&e.matchPositions&&i.find(t=>t.id===e.id)&&a.add(e.parentId);return r.sort((e,t)=>t.score===e.score?e.depth===t.depth?e.label.localeCompare(t.label):e.depth-t.depth:t.score-e.score),r}var Kc={backdrop:`_backdrop_162pr_6`,modal:`_modal_162pr_19`,searchRow:`_searchRow_162pr_31`,searchIcon:`_searchIcon_162pr_38`,input:`_input_162pr_39`,kbd:`_kbd_162pr_49`,list:`_list_162pr_62`,item:`_item_162pr_70`,itemActive:`_itemActive_162pr_82`,itemDisabled:`_itemDisabled_162pr_83`,itemIcon:`_itemIcon_162pr_88`,itemLabel:`_itemLabel_162pr_89`,itemEnter:`_itemEnter_162pr_90`,empty:`_empty_162pr_96`,footer:`_footer_162pr_103`},qc={filter:{icon:`🔍`,label:`Filter`},sort:{icon:`📶`,label:`Sort`},action:{icon:`⚙️`,label:`Action`},page:{icon:`📄`,label:`Page`},update:{icon:`⬆️`,label:`Update`},tool:{icon:`🧰`,label:`Tool`}},Jc=[`speed`,`normal`,`slow`,`forced`];function Yc(e){let{onCycleTheme:t,onResetView:n,onSetPingMode:r,theme:i,pingMode:a,modelsCount:o,onExport:s,onNavigate:c}=e;return[{id:`page.help`,section:`page`,label:`Open Help`,keywords:[`help`,`shortcuts`,`reference`],run:()=>c?.(`help`)},{id:`page.changelog`,section:`page`,label:`Open Changelog`,keywords:[`changelog`,`release`,`history`,`version`],run:()=>c?.(`changelog`)},{id:`page.playground`,section:`page`,label:`Open Playground`,keywords:[`playground`,`chat`,`try`,`prompt`,`router`],run:()=>c?.(`playground`)},{id:`page.install-endpoints`,section:`page`,label:`Open Install Endpoints`,keywords:[`install`,`endpoint`,`tool`,`configure`],run:()=>c?.(`install-endpoints`)},{id:`page.installed-models`,section:`page`,label:`Open Installed Models`,keywords:[`installed`,`models`,`tools`],run:()=>c?.(`installed-models`)},{id:`action.theme.cycle`,section:`action`,label:`Cycle theme (current: ${i})`,keywords:[`theme`,`dark`,`light`,`auto`],run:t},{id:`action.reset.view`,section:`action`,label:`Reset view (filters + sort)`,keywords:[`reset`,`view`,`clear`,`filters`,`sort`],run:n},{id:`action.ping.speed`,section:`action`,label:`Ping mode → Speed (2s)`,keywords:[`ping`,`mode`,`speed`,`fast`,`2s`],run:()=>r?.(`speed`)},{id:`action.ping.normal`,section:`action`,label:`Ping mode → Normal (10s)`,keywords:[`ping`,`mode`,`normal`,`10s`,`default`],run:()=>r?.(`normal`)},{id:`action.ping.slow`,section:`action`,label:`Ping mode → Slow (30s)`,keywords:[`ping`,`mode`,`slow`,`30s`,`idle`],run:()=>r?.(`slow`)},{id:`action.ping.forced`,section:`action`,label:`Ping mode → Forced (4s)`,keywords:[`ping`,`mode`,`forced`,`4s`],run:()=>r?.(`forced`)},{id:`action.export`,section:`action`,label:`Export models…`,keywords:[`export`,`download`,`json`,`csv`,`clipboard`],run:s}]}function Xc({onClose:e,onNavigate:t,onCycleTheme:n,onResetView:r,onSetPingMode:i,onOpenHelp:a,onOpenChangelog:o,onOpenCommandPalette:s,onToast:c,onExport:l,currentView:u,theme:d,pingMode:f,models:p,updateAvailable:m,latestVersion:h,onRunUpdate:g}){let[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(0),S=(0,v.useRef)(null),C=(0,v.useRef)(null),w=(0,v.useMemo)(()=>{let e=Uc(p||[]).map(e=>{let t=`action`;return e.id.startsWith(`filter-`)?t=`filter`:e.id.startsWith(`sort-`)?t=`sort`:e.id.startsWith(`action-`)?t=`action`:e.id.startsWith(`action-set-tool-`)?t=`tool`:(e.id.startsWith(`page-`)||e.id===`open-settings`||e.id===`open-help`||e.id===`open-changelog`)&&(t=`page`),{...e,section:t}}),a=Yc({onCycleTheme:n,onResetView:r,onSetPingMode:i,theme:d,pingMode:f,modelsCount:p?.length??0,onExport:l,onNavigate:t}),o=[];return m&&h&&o.push({id:`action.update.run`,section:`update`,label:`⬆️ UPDATE NOW — v${h} available (recommended!)`,keywords:[`update`,`upgrade`,`version`,`install`,`new`],run:()=>g?.()}),[...o,...e,...a]},[p,d,f,n,r,i,o,a,l,m,h,g]),ee=(0,v.useMemo)(()=>_.trim()?Gc(w,_):w,[w,_]),T=(0,v.useMemo)(()=>{let e=new Map;for(let t of ee)e.has(t.section)||e.set(t.section,[]),e.get(t.section).push(t);return Array.from(e.entries())},[ee]),E=(0,v.useMemo)(()=>T.flatMap(([,e])=>e),[T]);(0,v.useEffect)(()=>{S.current?.focus()},[]),(0,v.useEffect)(()=>{b>=E.length&&x(0)},[E,b]),(0,v.useEffect)(()=>{let t=t=>{if(t.key===`Escape`){t.preventDefault(),e();return}if(t.key===`ArrowDown`){t.preventDefault(),x(e=>Math.min(E.length-1,e+1));return}if(t.key===`ArrowUp`){t.preventDefault(),x(e=>Math.max(0,e-1));return}if(t.key===`Enter`){t.preventDefault();let e=E[b];if(!e)return;if(e.disabled){c?.(`${e.label} is not available yet.`,`info`);return}D(e)}};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[E,b,e,c]);let D=(0,v.useCallback)(a=>{let o=a.id;if(o===`open-settings`){t?.(`settings`),e();return}if(o===`open-help`){t?.(`help`),e();return}if(o===`open-changelog`){t?.(`changelog`),e();return}if(o===`open-recommend`){t?.(`recommend`),e();return}if(o===`open-router-dashboard`){t?.(`router`),e();return}if(o===`open-installed-models`){t?.(`installed-models`),e();return}if(o===`open-install-endpoints`){t?.(`install-endpoints`),e();return}if(o===`action-update-now`){g?.(),e();return}if(o===`action-cycle-theme`){n?.(),e();return}if(o===`action-reset-view`){r?.(),e();return}if(o===`action-cycle-ping-mode`){let t=Jc.indexOf(f);i?.(Jc[(t+1)%Jc.length]),e();return}if(o===`action-cycle-tool-mode`){c?.(`Tool mode picker arrives in M3`,`info`),e();return}if(o===`action-toggle-favorite`){c?.(`Press F on a model row in the table.`,`info`),e();return}if(o===`action-toggle-favorite-mode`){c?.(`Set the favorites display mode in Settings (M2).`,`info`),e();return}if(o===`action-export`){l?.(),e();return}if(o===`action-benchmark-row`){c?.(`Click any AI Lat. cell to benchmark the highlighted row.`,`info`),e();return}if(o===`filter-provider-cycle`){c?.(`Use the Provider dropdown in the FilterBar.`,`info`),e();return}if(o.startsWith(`filter-tier-`)){c?.(`Tier filter — use the Tier chip row in the FilterBar.`,`info`),e();return}if(o.startsWith(`filter-provider-`)){c?.(`Provider filter — use the Provider dropdown.`,`info`),e();return}if(o===`filter-configured-toggle`){c?.(`Use the Visibility dropdown in the FilterBar.`,`info`),e();return}if(o.startsWith(`sort-`)){c?.(`Sort — click the column header in the table.`,`info`),e();return}if(o===`action-set-ping-speed`){i?.(`speed`),e();return}if(o===`action-set-ping-normal`){i?.(`normal`),e();return}if(o===`action-set-ping-slow`){i?.(`slow`),e();return}if(o===`action-set-ping-forced`){i?.(`forced`),e();return}if(typeof a.run==`function`){a.run(),e();return}c?.(`${a.label} is not wired on the Web yet.`,`info`),e()},[t,e,c,n,r,i,a,o,g,l,f]);return(0,v.useEffect)(()=>{if(!C.current)return;let e=C.current.querySelector(`[data-cmd-index="${b}"]`);e&&e.scrollIntoView({block:`nearest`})},[b]),(0,P.jsx)(`div`,{className:Kc.backdrop,onClick:e,children:(0,P.jsxs)(`div`,{className:Kc.modal,onClick:e=>e.stopPropagation(),children:[(0,P.jsxs)(`div`,{className:Kc.searchRow,children:[(0,P.jsx)(Rr,{size:16,stroke:1.5,className:Kc.searchIcon}),(0,P.jsx)(`input`,{ref:S,className:Kc.input,placeholder:`Type a command… (filters, sorts, tools, theme, ping, export)`,value:_,onChange:e=>y(e.target.value),autoComplete:`off`}),(0,P.jsxs)(`span`,{className:Kc.kbd,children:[(0,P.jsx)(or,{size:10,stroke:1.5}),`K`]})]}),(0,P.jsxs)(`div`,{className:Kc.list,ref:C,role:`listbox`,children:[E.length===0&&(0,P.jsx)(`div`,{className:Kc.empty,children:`No matching command.`}),T.map(([e,t])=>{let n=qc[e]||{icon:`•`,label:e};return(0,P.jsxs)(`div`,{className:Kc.section,children:[(0,P.jsxs)(`div`,{className:Kc.sectionHeader,children:[(0,P.jsx)(`span`,{className:Kc.sectionIcon,children:n.icon}),(0,P.jsx)(`span`,{children:n.label})]}),t.map(e=>{let t=E.indexOf(e),n=t===b;return(0,P.jsxs)(`button`,{"data-cmd-index":t,className:`${Kc.item} ${n?Kc.itemActive:``} ${e.disabled?Kc.itemDisabled:``}`,onClick:()=>D(e),onMouseEnter:()=>x(t),role:`option`,"aria-selected":n,"aria-disabled":e.disabled?`true`:void 0,children:[(0,P.jsxs)(`span`,{className:Kc.itemLabel,children:[e.label,e.shortcut&&(0,P.jsx)(`span`,{className:Kc.shortcut,children:e.shortcut})]}),e.description&&(0,P.jsx)(`span`,{className:Kc.itemDesc,children:e.description}),n&&(0,P.jsx)(`span`,{className:Kc.itemEnter,children:`↵`})]},e.id)})]},e)})]}),(0,P.jsxs)(`div`,{className:Kc.footer,children:[(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`kbd`,{children:`↑↓`}),` navigate`]}),(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`kbd`,{children:`↵`}),` select`]}),(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`kbd`,{children:`Esc`}),` close`]}),(0,P.jsxs)(`span`,{className:Kc.footerRight,children:[`Powered by the TUI command registry — 1:1 parity`,(0,P.jsx)(dr,{size:10,stroke:1.5,style:{marginLeft:4}})]})]})]})})}var Zc={backdrop:`_backdrop_1xl3j_6`,modal:`_modal_1xl3j_15`,header:`_header_1xl3j_30`,titleRow:`_titleRow_1xl3j_35`,title:`_title_1xl3j_35`,closeBtn:`_closeBtn_1xl3j_49`,searchBar:`_searchBar_1xl3j_62`,searchIcon:`_searchIcon_1xl3j_77`,searchInput:`_searchInput_1xl3j_78`,note:`_note_1xl3j_89`,body:`_body_1xl3j_105`,section:`_section_1xl3j_111`,sectionTitle:`_sectionTitle_1xl3j_112`,itemList:`_itemList_1xl3j_121`,item:`_item_1xl3j_121`,itemKey:`_itemKey_1xl3j_140`,itemDesc:`_itemDesc_1xl3j_146`,empty:`_empty_1xl3j_151`},Qc=[{id:`navigation`,title:`🧭 Navigation`,items:[{key:`↑ / ↓`,desc:`Navigate rows in the main table (planned — currently mouse-only)`},{key:`Enter`,desc:`Open the detail panel for the focused row`},{key:`Esc`,desc:`Close any open modal or detail panel`}]},{id:`filters`,title:`🔍 Filters`,items:[{key:`Tier chip`,desc:`Click to cycle: All → S+ → S → A+ → A → A- → B+ → B → C → All`},{key:`Status chip`,desc:`Click to cycle: All → Up → Down → Pending`},{key:`Verdict chip`,desc:`Click to cycle: All → Perfect → Normal → Spiky → Slow → Overloaded → Down → Unstable → Pending`},{key:`Health chip`,desc:`Click to cycle: All → Up → Timeout → Down → Pending → No key → Auth err`},{key:`Visibility`,desc:`Normal (all) / Configured only (hide no-key) / Usable only (UP + good verdict)`},{key:`Provider dropdown`,desc:`Filter by provider`},{key:`Custom text filter`,desc:"Apply via ⌘K palette or `Apply text filter` — clear with the X chip"},{key:`Reset button`,desc:`Clears every active filter + sort back to defaults`}]},{id:`sort`,title:`📶 Sort`,items:[{key:`Click any column header`,desc:`Sort asc → desc → reset (no sort, default order)`},{key:`Resizable columns`,desc:`Drag the right edge of any header to resize. Double-click resets one column.`}]},{id:`favorites`,title:`⭐ Favorites`,items:[{key:`Star button (per row)`,desc:`Click to favorite / unfavorite the model (TUI: F key)`},{key:`Detail panel`,desc:`Favorite + Up/Down reorder + current priority rank (TUI: Shift+↑/↓)`},{key:`Pinned mode`,desc:`In the Settings view, toggle "Pinned + always visible" (TUI: Y key)`},{key:`Shared with TUI`,desc:`Favorites are persisted in the same ~/.free-coding-models.json the TUI uses`}]},{id:`benchmark`,title:`🤖 AI Speed Test (benchmark)`,items:[{key:`Header button`,desc:`Run a global AI Speed Test on every visible model`},{key:`AI Lat. cell`,desc:`Click any AI Lat. cell to benchmark just that model (TUI: Ctrl+A)`},{key:`Detail panel`,desc:`Dedicated "AI Speed Test" button (TUI: Ctrl+A)`},{key:`TPS column`,desc:`Tokens per second for the model — appears after a benchmark run`},{key:`Latency column`,desc:`Real completion latency (not just ping) for the model`}]},{id:`tools`,title:`🧰 Tool mode (M3)`,items:[{key:`M3 shipped`,desc:`Endpoint target picker, per-row Install Endpoint button, and incompatible-target fallback modal`}]},{id:`palette`,title:`⚡ Command palette`,items:[{key:`⌘K / Ctrl+P`,desc:`The Web's only global keyboard shortcut — toggles the command palette`},{key:`Type to search`,desc:`Fuzzy match across all filters, sorts, tools, pages, and theme / ping / reset actions`},{key:`↑ / ↓ + Enter`,desc:`Navigate the results and execute the highlighted command`},{key:`Esc`,desc:`Close the palette without running anything`}]},{id:`theme`,title:`🌗 Theme`,items:[{key:`Theme button (header)`,desc:`Click to cycle: auto → dark → light (TUI: G key)`},{key:`Auto mode`,desc:`Follows the OS prefers-color-scheme preference and updates live`}]},{id:`ping`,title:`⚡ Ping mode`,items:[{key:`Speed / Normal / Slow / Forced`,desc:`Ping cadence (2s / 10s / 30s / 4s) — TUI: W key`},{key:`next ping in Xs`,desc:`Live countdown shown in the FilterBar (TUI footer style)`}]},{id:`url`,title:`🔗 URL deep-linking`,items:[{key:`?tier=S+&sort=verdict&origin=groq&view=dashboard`,desc:`Every filter / sort / view is reflected in the URL — share pre-filtered links`}]},{id:`cli`,title:`⌨️ CLI parity`,items:[{key:`Same storage`,desc:`The Web reads + writes the same ~/.free-coding-models.json as the TUI`},{key:`Same engine`,desc:`All model parsing, ping, and benchmark code is shared with the TUI`}]},{id:`how-router-works`,title:`🌐 How the FCM Router works`,items:[{key:`Smart router`,desc:`Point any OpenAI client at http://localhost:19280/v1 with model: "fcm". The daemon picks the healthiest model in the active set and forwards the request with automatic failover.`},{key:`Pre-prompt`,desc:`A first-class system message is injected on every proxied request. The default introduces the assistant as the FCM routing agent. Edit from Settings.`},{key:`Probes`,desc:`Every 10s/30s/120s (eco/balanced/aggressive) the daemon sends a 1-token chat-completion ping to every model in the active set. The probe measures latency + status code, not just URL reachability — so a wrong API key is caught and the circuit opens.`},{key:`Circuit breaker`,desc:`Per-model state. Healthy (green) = last probe 2xx, route here. Down (red) = last 3 probes failed, skip until cooldown. Recovering (yellow) = cooldown expired, retrying. Auth error (orange) = 401/403, your key is wrong. Deprecated (gray) = removed from catalog, will be replaced by auto-heal.`},{key:`Failover order`,desc:`Models are tried in priority order. A model in Recovering/Down/Auth error is skipped — the request goes to the next healthy one. If ALL fail, you get 503 with the "models_tried" list in the error body.`},{key:`Auto-heal`,desc:`On daemon start, every Auth-error / Deprecated model in the active set is swapped for a working alternative (same provider first, then cross-provider). The first time you add/remove/reorder a model, auto-heal switches off.`},{key:`Rate limits`,desc:`Each provider has its own quota. Common free-tier limits: Groq 14 400 RPD, Mistral 1 RPS, NVIDIA ~40 RPM, OpenRouter 50 RPD. When a provider returns 429, the router fails over. When daily quota is exhausted, the model goes Auth error and auto-heal swaps it out next start.`}]}];function $c({onClose:e}){let[t,n]=(0,v.useState)(``),r=(0,v.useMemo)(()=>{let e=t.trim().toLowerCase();return e?Qc.map(t=>({...t,items:t.items.filter(t=>t.key.toLowerCase().includes(e)||t.desc.toLowerCase().includes(e))})).filter(e=>e.items.length>0):Qc},[t]);return(0,P.jsx)(`div`,{className:Zc.backdrop,onClick:e,children:(0,P.jsxs)(`div`,{className:Zc.modal,onClick:e=>e.stopPropagation(),children:[(0,P.jsxs)(`div`,{className:Zc.header,children:[(0,P.jsxs)(`div`,{className:Zc.titleRow,children:[(0,P.jsx)(`h2`,{className:Zc.title,children:`❓ Help & Keyboard Shortcuts`}),(0,P.jsx)(`button`,{className:Zc.closeBtn,onClick:e,"aria-label":`Close help`,children:(0,P.jsx)(Yr,{size:18,stroke:1.5})})]}),(0,P.jsxs)(`div`,{className:Zc.searchBar,children:[(0,P.jsx)(Rr,{size:14,stroke:1.5,className:Zc.searchIcon}),(0,P.jsx)(`input`,{className:Zc.searchInput,placeholder:`Search help (filters, hotkeys, TUI parity)…`,value:t,onChange:e=>n(e.target.value),autoFocus:!0})]}),(0,P.jsxs)(`p`,{className:Zc.note,children:[`The Web Dashboard is mouse-first. The only global keyboard shortcut is`,` `,(0,P.jsx)(`kbd`,{children:`⌘K`}),` / `,(0,P.jsx)(`kbd`,{children:`Ctrl+P`}),` for the command palette — everything else lives here, in the header menu, or in modals.`]})]}),(0,P.jsx)(`div`,{className:Zc.body,children:r.length===0?(0,P.jsxs)(`div`,{className:Zc.empty,children:[`No help matches "`,t,`".`]}):r.map(e=>(0,P.jsxs)(`section`,{className:Zc.section,children:[(0,P.jsx)(`h3`,{className:Zc.sectionTitle,children:e.title}),(0,P.jsx)(`ul`,{className:Zc.itemList,children:e.items.map(e=>(0,P.jsxs)(`li`,{className:Zc.item,children:[(0,P.jsx)(`span`,{className:Zc.itemKey,children:e.key}),(0,P.jsx)(`span`,{className:Zc.itemDesc,children:e.desc})]},e.key+e.desc))})]},e.id))})]})})}function el(){let[e,t]=(0,v.useState)({}),[n,r]=(0,v.useState)(!0),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/changelog`);if(!e.ok)throw Error(`HTTP ${e.status}`);t((await e.json())?.versions??{}),a(null)}catch(e){a(e.message||`Failed to load changelog`)}finally{r(!1)}},[]);return(0,v.useEffect)(()=>{o()},[o]),{versions:e,sortedVersions:(0,v.useMemo)(()=>Object.keys(e).sort((e,t)=>{let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e]||0,i=r[e]||0;if(i!==t)return i-t}return 0}),[e]),getVersion:(0,v.useCallback)(t=>e[t]??null,[e]),loading:n,error:i,refresh:o}}var tl={backdrop:`_backdrop_1vsoi_6`,modal:`_modal_1vsoi_15`,header:`_header_1vsoi_30`,titleRow:`_titleRow_1vsoi_35`,title:`_title_1vsoi_35`,backBtn:`_backBtn_1vsoi_50`,closeBtn:`_closeBtn_1vsoi_67`,body:`_body_1vsoi_81`,indexWrap:`_indexWrap_1vsoi_87`,indexHint:`_indexHint_1vsoi_88`,versionList:`_versionList_1vsoi_94`,versionBtn:`_versionBtn_1vsoi_102`,versionLabel:`_versionLabel_1vsoi_118`,versionSummary:`_versionSummary_1vsoi_124`,details:`_details_1vsoi_129`,section:`_section_1vsoi_130`,sectionTitle:`_sectionTitle_1vsoi_131`,itemList:`_itemList_1vsoi_139`,item:`_item_1vsoi_139`,empty:`_empty_1vsoi_154`},nl=[{key:`added`,label:`✨ Added`,icon:`✨`},{key:`fixed`,label:`🐛 Fixed`,icon:`🐛`},{key:`changed`,label:`🔄 Changed`,icon:`🔄`},{key:`updated`,label:`📝 Updated`,icon:`📝`}];function rl({onClose:e,defaultVersion:t=null}){let{sortedVersions:n,getVersion:r,loading:i,error:a}=el(),[o,s]=(0,v.useState)(t?`details`:`index`),[c,l]=(0,v.useState)(t),u=e=>{l(e),s(`details`)},d=()=>{l(null),s(`index`)},f=c?r(c):null;return(0,P.jsx)(`div`,{className:tl.backdrop,onClick:e,children:(0,P.jsxs)(`div`,{className:tl.modal,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(`div`,{className:tl.header,children:(0,P.jsxs)(`div`,{className:tl.titleRow,children:[(0,P.jsx)(`h2`,{className:tl.title,children:o===`index`?`📋 Changelog`:`📋 v${c}`}),o===`details`&&(0,P.jsxs)(`button`,{className:tl.backBtn,onClick:d,title:`Back to index (TUI: B)`,children:[(0,P.jsx)(Un,{size:14,stroke:1.5}),` Index`]}),(0,P.jsx)(`button`,{className:tl.closeBtn,onClick:e,"aria-label":`Close changelog`,children:(0,P.jsx)(Yr,{size:18,stroke:1.5})})]})}),(0,P.jsxs)(`div`,{className:tl.body,children:[i&&(0,P.jsx)(`div`,{className:tl.empty,children:`Loading changelog…`}),a&&!i&&(0,P.jsxs)(`div`,{className:tl.empty,children:[`Failed to load changelog: `,a]}),!i&&!a&&o===`index`&&(0,P.jsxs)(`div`,{className:tl.indexWrap,children:[(0,P.jsxs)(`p`,{className:tl.indexHint,children:[n.length,` versions. Click any to read the release notes.`]}),(0,P.jsx)(`ul`,{className:tl.versionList,children:n.map(e=>{let t=r(e),n=[];return t?.added?.length&&n.push(`${t.added.length} added`),t?.fixed?.length&&n.push(`${t.fixed.length} fixed`),t?.changed?.length&&n.push(`${t.changed.length} changed`),(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{className:tl.versionBtn,onClick:()=>u(e),children:[(0,P.jsxs)(`span`,{className:tl.versionLabel,children:[`v`,e]}),(0,P.jsx)(`span`,{className:tl.versionSummary,children:n.length>0?n.join(` · `):`—`})]})},e)})})]}),!i&&!a&&o===`details`&&f&&(0,P.jsxs)(`div`,{className:tl.details,children:[nl.map(({key:e,label:t})=>{let n=f[e];return!n||n.length===0?null:(0,P.jsxs)(`section`,{className:tl.section,children:[(0,P.jsx)(`h3`,{className:tl.sectionTitle,children:t}),(0,P.jsx)(`ul`,{className:tl.itemList,children:n.map((e,t)=>(0,P.jsx)(`li`,{className:tl.item,children:il(e)},t))})]},e)}),nl.every(({key:e})=>!f[e]?.length)&&(0,P.jsxs)(`div`,{className:tl.empty,children:[`No release notes for v`,c,`.`]})]}),!i&&!a&&o===`details`&&!f&&(0,P.jsxs)(`div`,{className:tl.empty,children:[`No notes for v`,c,`.`]})]})]})})}function il(e){return e.replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/`([^`]+)`/g,`$1`).trim()}var al={wrap:`_wrap_10lrt_6`,chip:`_chip_10lrt_11`,checking:`_checking_10lrt_34`,dot:`_dot_10lrt_42`,pulse:`_pulse_10lrt_1`,popover:`_popover_10lrt_54`,popoverHeader:`_popoverHeader_10lrt_67`,popoverTitle:`_popoverTitle_10lrt_74`,popoverClose:`_popoverClose_10lrt_82`,popoverBody:`_popoverBody_10lrt_95`,popoverActions:`_popoverActions_10lrt_107`,primaryAction:`_primaryAction_10lrt_113`,secondaryAction:`_secondaryAction_10lrt_114`};function ol({updateAvailable:e,latestVersion:t,onRunUpdate:n,onOpenChangelog:r,checking:i}){let[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]),e?(0,P.jsxs)(`div`,{className:al.wrap,ref:s,children:[(0,P.jsxs)(`button`,{className:al.chip,onClick:()=>o(e=>!e),title:`Update available: v${t}. Click to install.`,"aria-expanded":a,"aria-haspopup":`dialog`,children:[(0,P.jsx)(lr,{size:13,stroke:1.5}),(0,P.jsxs)(`span`,{children:[`v`,t]})]}),a&&(0,P.jsxs)(`div`,{className:al.popover,role:`dialog`,"aria-label":`Update available`,children:[(0,P.jsxs)(`div`,{className:al.popoverHeader,children:[(0,P.jsxs)(`div`,{className:al.popoverTitle,children:[(0,P.jsx)(lr,{size:14,stroke:1.5}),(0,P.jsx)(`span`,{children:`Update available`})]}),(0,P.jsx)(`button`,{className:al.popoverClose,onClick:()=>o(!1),"aria-label":`Close`,children:(0,P.jsx)(Yr,{size:14,stroke:1.5})})]}),(0,P.jsxs)(`p`,{className:al.popoverBody,children:[`A newer version (`,(0,P.jsxs)(`strong`,{children:[`v`,t]}),`) is available on npm. After updating, restart the dashboard to pick up the changes.`]}),(0,P.jsxs)(`div`,{className:al.popoverActions,children:[(0,P.jsxs)(`button`,{className:al.primaryAction,onClick:()=>{o(!1),n?.()},children:[(0,P.jsx)(lr,{size:13,stroke:1.5}),(0,P.jsx)(`span`,{children:`Update now`})]}),(0,P.jsxs)(`button`,{className:al.secondaryAction,onClick:()=>{o(!1),r?.(t)},children:[(0,P.jsx)(yr,{size:13,stroke:1.5}),(0,P.jsx)(`span`,{children:`What's new`})]})]})]})]}):i?(0,P.jsx)(`span`,{className:al.checking,title:`Checking for updates…`,children:(0,P.jsx)(`span`,{className:al.dot})}):null}var sl={quickfix:{label:`Quick Fix`,sweWeight:.2,speedWeight:.5,ctxWeight:.1,stabilityWeight:.2},refactor:{label:`Deep Refactor`,sweWeight:.4,speedWeight:.1,ctxWeight:.3,stabilityWeight:.2},review:{label:`Code Review`,sweWeight:.35,speedWeight:.2,ctxWeight:.25,stabilityWeight:.2},testgen:{label:`Test Generation`,sweWeight:.35,speedWeight:.15,ctxWeight:.2,stabilityWeight:.3}},cl={speed:{label:`Speed`,speedMultiplier:1.5,sweMultiplier:.7},quality:{label:`Quality`,speedMultiplier:.7,sweMultiplier:1.5},balanced:{label:`Balanced`,speedMultiplier:1,sweMultiplier:1}},ll={small:{label:`Small file (<4K)`,minCtx:0,idealCtx:32},medium:{label:`Medium project (<32K)`,minCtx:32,idealCtx:128},large:{label:`Large codebase (>32K)`,minCtx:128,idealCtx:256}};function ul({onToast:e}={}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(null),l=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>{l.current&&clearInterval(l.current)},[]),{recommend:(0,v.useCallback)(async t=>{l.current&&clearInterval(l.current),n(!0),i(0),o([]),c(null);let r=Date.now();l.current=setInterval(()=>{i(Math.min(98,Math.round((Date.now()-r)/1e4*100)))},250);try{await new Promise(e=>setTimeout(e,1e4));let e=await fetch(`/api/recommend`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({answers:t})}),n=await e.json().catch(()=>({}));if(!e.ok)throw Error(n.error||`HTTP ${e.status}`);return o(Array.isArray(n.top3)?n.top3:[]),i(100),{ok:!0,top3:n.top3||[]}}catch(t){return c(t.message),e?.(`Recommend failed: ${t.message}`,`error`),{ok:!1,error:t.message}}finally{l.current&&clearInterval(l.current),l.current=null,n(!1)}},[e]),loading:t,progress:r,results:a,error:s,reset:(0,v.useCallback)(()=>{l.current&&clearInterval(l.current),l.current=null,n(!1),i(0),o([]),c(null)},[])}}var dl={backdrop:`_backdrop_gpeci_2`,modal:`_modal_gpeci_10`,header:`_header_gpeci_25`,footer:`_footer_gpeci_26`,eyebrow:`_eyebrow_gpeci_29`,summary:`_summary_gpeci_30`,muted:`_muted_gpeci_31`,close:`_close_gpeci_32`,secondary:`_secondary_gpeci_33`,body:`_body_gpeci_37`,steps:`_steps_gpeci_38`,options:`_options_gpeci_40`,option:`_option_gpeci_40`,progress:`_progress_gpeci_45`,percent:`_percent_gpeci_47`,results:`_results_gpeci_48`,resultCard:`_resultCard_gpeci_49`,medal:`_medal_gpeci_50`,resultMain:`_resultMain_gpeci_51`,score:`_score_gpeci_55`,error:`_error_gpeci_56`},fl=[{key:`taskType`,title:`What are you working on?`,options:sl},{key:`priority`,title:`What matters most?`,options:cl},{key:`contextBudget`,title:`How big is your context?`,options:ll}];function pl({onClose:e,onLaunch:t,onPinAndLaunch:n,toolMode:r,onToast:i}){let[a,o]=(0,v.useState)(0),[s,c]=(0,v.useState)({taskType:null,priority:null,contextBudget:null}),{recommend:l,loading:u,progress:d,results:f,error:p,reset:m}=ul({onToast:i}),h=fl[a],g=f.length>0,_=(0,v.useMemo)(()=>fl.map(e=>e.options[s[e.key]]?.label).filter(Boolean).join(` · `),[s]);async function y(e){let t={...s,[h.key]:e};if(c(t),a<fl.length-1){o(a+1);return}await l(t)}function b(){if(g||u){m(),o(0),c({taskType:null,priority:null,contextBudget:null});return}o(e=>Math.max(0,e-1))}return(0,P.jsx)(`div`,{className:dl.backdrop,onClick:e,children:(0,P.jsxs)(`div`,{className:dl.modal,onClick:e=>e.stopPropagation(),children:[(0,P.jsxs)(`header`,{className:dl.header,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:dl.eyebrow,children:`Smart Recommend`}),(0,P.jsxs)(`h2`,{children:[(0,P.jsx)(Vr,{size:20}),` Find the best model for this task`]}),_&&(0,P.jsx)(`p`,{className:dl.summary,children:_})]}),(0,P.jsx)(`button`,{className:dl.close,onClick:e,"aria-label":`Close`,children:(0,P.jsx)(Yr,{size:18})})]}),!u&&!g&&(0,P.jsxs)(`main`,{className:dl.body,children:[(0,P.jsxs)(`div`,{className:dl.steps,children:[`Question `,a+1,` / `,fl.length]}),(0,P.jsx)(`h3`,{children:h.title}),(0,P.jsx)(`div`,{className:dl.options,children:Object.entries(h.options).map(([e,t])=>(0,P.jsxs)(`button`,{className:dl.option,onClick:()=>y(e),children:[(0,P.jsx)(`strong`,{children:t.label}),(0,P.jsx)(`span`,{children:e})]},e))})]}),u&&(0,P.jsxs)(`main`,{className:dl.body,children:[(0,P.jsx)(`h3`,{children:`Analyzing live catalog…`}),(0,P.jsx)(`p`,{className:dl.muted,children:`10 seconds · roughly 2 checks/sec · same scoring as the TUI.`}),(0,P.jsx)(`div`,{className:dl.progress,children:(0,P.jsx)(`span`,{style:{width:`${d}%`}})}),(0,P.jsxs)(`p`,{className:dl.percent,children:[d,`%`]})]}),g&&(0,P.jsxs)(`main`,{className:dl.body,children:[(0,P.jsx)(`h3`,{children:`Top 3 recommendations`}),(0,P.jsx)(`div`,{className:dl.results,children:f.map((e,t)=>(0,P.jsxs)(`article`,{className:dl.resultCard,children:[(0,P.jsx)(`div`,{className:dl.medal,children:[`🥇`,`🥈`,`🥉`][t]}),(0,P.jsxs)(`div`,{className:dl.resultMain,children:[(0,P.jsx)(`strong`,{children:e.result.label}),(0,P.jsxs)(`span`,{children:[e.result.origin,` · `,e.result.tier,` · `,e.result.ctx]}),(0,P.jsx)(`p`,{children:e.reason})]}),(0,P.jsx)(`div`,{className:dl.score,children:e.score}),(0,P.jsx)(Ks,{model:e.result,toolMode:r,onLaunch:()=>n?.(e.result)})]},`${e.result.providerKey}/${e.result.modelId}`))})]}),p&&(0,P.jsx)(`p`,{className:dl.error,children:p}),(0,P.jsxs)(`footer`,{className:dl.footer,children:[(0,P.jsxs)(`button`,{className:dl.secondary,onClick:b,disabled:a===0&&!u&&!g,children:[(0,P.jsx)(Un,{size:14}),` `,g||u?`Restart`:`Back`]}),(0,P.jsx)(`button`,{className:dl.secondary,onClick:e,children:`Close`})]})]})})}var ml={backdrop:`_backdrop_8r8li_2`,modal:`_modal_8r8li_13`,modalWide:`_modalWide_8r8li_14`,header:`_header_8r8li_25`,eyebrow:`_eyebrow_8r8li_40`,close:`_close_8r8li_48`,body:`_body_8r8li_61`,command:`_command_8r8li_62`,note:`_note_8r8li_72`,muted:`_muted_8r8li_73`,docs:`_docs_8r8li_74`,error:`_error_8r8li_75`,footer:`_footer_8r8li_76`,primary:`_primary_8r8li_83`,secondary:`_secondary_8r8li_84`,option:`_option_8r8li_85`,grid:`_grid_8r8li_103`,card:`_card_8r8li_104`,stack:`_stack_8r8li_111`};function hl({request:e,models:t=[],onClose:n,onSwitchToolLaunch:r,onLaunchSimilar:i}){if(!e?.model)return null;let{model:a,toolMode:o}=e,s=bn(o),c=Sn(a.providerKey),l=wn(a.sweScore,o,t,3).filter(e=>e.modelId!==a.modelId||e.providerKey!==a.providerKey);return(0,P.jsx)(`div`,{className:ml.backdrop,onClick:n,children:(0,P.jsxs)(`div`,{className:ml.modalWide,onClick:e=>e.stopPropagation(),children:[(0,P.jsxs)(`div`,{className:ml.header,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:ml.eyebrow,children:`Incompatible model`}),(0,P.jsxs)(`h2`,{children:[(0,P.jsx)(Vn,{size:18}),` `,a.label,` cannot be installed in `,s.emoji,` `,s.label]})]}),(0,P.jsx)(`button`,{className:ml.close,onClick:n,"aria-label":`Close`,children:(0,P.jsx)(Yr,{size:18})})]}),(0,P.jsxs)(`div`,{className:ml.grid,children:[(0,P.jsxs)(`section`,{className:ml.card,children:[(0,P.jsxs)(`h3`,{children:[(0,P.jsx)(Wr,{size:15}),` Switch tool`]}),(0,P.jsx)(`p`,{className:ml.muted,children:`This provider can be configured in these tools. Pick one and FCM installs the endpoint.`}),(0,P.jsx)(`div`,{className:ml.stack,children:c.map(e=>{let t=bn(e);return(0,P.jsxs)(`button`,{className:ml.option,onClick:()=>r?.(e,a),children:[(0,P.jsx)(`span`,{children:t.emoji}),(0,P.jsx)(`strong`,{children:t.label})]},e)})})]}),(0,P.jsxs)(`section`,{className:ml.card,children:[(0,P.jsxs)(`h3`,{children:[(0,P.jsx)(Mr,{size:15}),` Similar models`]}),(0,P.jsxs)(`p`,{className:ml.muted,children:[`Or keep `,s.label,` and install a compatible model close to the same SWE score.`]}),(0,P.jsxs)(`div`,{className:ml.stack,children:[l.length===0&&(0,P.jsx)(`p`,{className:ml.muted,children:`No close compatible alternative found yet.`}),l.map(e=>(0,P.jsxs)(`button`,{className:ml.option,onClick:()=>i?.(e),children:[(0,P.jsx)(`span`,{children:e.tier}),(0,P.jsx)(`strong`,{children:e.label}),(0,P.jsxs)(`small`,{children:[e.providerKey,` · `,e.sweScore]})]},`${e.providerKey}/${e.modelId}`))]})]})]})]})})}var q={overlay:`_overlay_uatt9_1`,modal:`_modal_uatt9_10`,header:`_header_uatt9_24`,title:`_title_uatt9_32`,closeBtn:`_closeBtn_uatt9_42`,body:`_body_uatt9_53`,heroCard:`_heroCard_uatt9_60`,heroRunning:`_heroRunning_uatt9_69`,heroStopped:`_heroStopped_uatt9_74`,heroLeft:`_heroLeft_uatt9_79`,heroStatus:`_heroStatus_uatt9_85`,statusDot:`_statusDot_uatt9_91`,dotGreen:`_dotGreen_uatt9_98`,dotGray:`_dotGray_uatt9_103`,heroLabel:`_heroLabel_uatt9_107`,heroMeta:`_heroMeta_uatt9_113`,heroActions:`_heroActions_uatt9_121`,startBtn:`_startBtn_uatt9_127`,startBtnBig:`_startBtnBig_uatt9_144`,stopBtn:`_stopBtn_uatt9_150`,refreshBtn:`_refreshBtn_uatt9_166`,quickSetup:`_quickSetup_uatt9_181`,quickSetupHero:`_quickSetupHero_uatt9_186`,copyAllBtn:`_copyAllBtn_uatt9_195`,sectionTitle:`_sectionTitle_uatt9_212`,quickRows:`_quickRows_uatt9_224`,quickRow:`_quickRow_uatt9_224`,quickLabel:`_quickLabel_uatt9_240`,quickValue:`_quickValue_uatt9_248`,copyBtn:`_copyBtn_uatt9_258`,section:`_section_uatt9_212`,probeModes:`_probeModes_uatt9_273`,probeBtn:`_probeBtn_uatt9_278`,probeActive:`_probeActive_uatt9_290`,modelList:`_modelList_uatt9_298`,modelRow:`_modelRow_uatt9_304`,modelPriority:`_modelPriority_uatt9_314`,modelName:`_modelName_uatt9_320`,modelScore:`_modelScore_uatt9_329`,modelLatency:`_modelLatency_uatt9_335`,circuitBadge:`_circuitBadge_uatt9_341`,circuitClosed:`_circuitClosed_uatt9_352`,circuitOpen:`_circuitOpen_uatt9_353`,circuitHalfOpen:`_circuitHalfOpen_uatt9_354`,circuitAuth:`_circuitAuth_uatt9_355`,circuitUnknown:`_circuitUnknown_uatt9_356`,logList:`_logList_uatt9_359`,logRow:`_logRow_uatt9_365`,logOk:`_logOk_uatt9_374`,logErr:`_logErr_uatt9_375`,logModel:`_logModel_uatt9_376`,logLatency:`_logLatency_uatt9_377`,logTokens:`_logTokens_uatt9_378`,logFailover:`_logFailover_uatt9_379`,logEmpty:`_logEmpty_uatt9_388`,setMeta:`_setMeta_uatt9_405`,setMetaName:`_setMetaName_uatt9_414`,setActions:`_setActions_uatt9_420`,smallBtn:`_smallBtn_uatt9_426`,primaryBtn:`_primaryBtn_uatt9_443`,setList:`_setList_uatt9_460`,setEmpty:`_setEmpty_uatt9_467`,setEmptyTitle:`_setEmptyTitle_uatt9_477`,setEmptyHint:`_setEmptyHint_uatt9_484`,setRow:`_setRow_uatt9_494`,setRowDragging:`_setRowDragging_uatt9_513`,setRowDropTarget:`_setRowDropTarget_uatt9_519`,setRowDropTargetAbove:`_setRowDropTargetAbove_uatt9_524`,setRowDropTargetBelow:`_setRowDropTargetBelow_uatt9_528`,setDragHandle:`_setDragHandle_uatt9_532`,setPriority:`_setPriority_uatt9_543`,setKey:`_setKey_uatt9_552`,setTier:`_setTier_uatt9_562`,setPriorityPrimary:`_setPriorityPrimary_uatt9_577`,setPriorityFallback:`_setPriorityFallback_uatt9_589`,setRowNext:`_setRowNext_uatt9_597`,priorityLegend:`_priorityLegend_uatt9_604`,legendPrimary:`_legendPrimary_uatt9_618`,legendFallback:`_legendFallback_uatt9_626`,legendSeparator:`_legendSeparator_uatt9_631`,legendNext:`_legendNext_uatt9_636`,setRowBtns:`_setRowBtns_uatt9_647`,iconBtn:`_iconBtn_uatt9_652`,removeBtn:`_removeBtn_uatt9_666`,pickerPanel:`_pickerPanel_uatt9_669`,pickerHeader:`_pickerHeader_uatt9_680`,pickerSearch:`_pickerSearch_uatt9_689`,pickerInput:`_pickerInput_uatt9_694`,pickerSelect:`_pickerSelect_uatt9_707`,pickerList:`_pickerList_uatt9_720`,pickerItem:`_pickerItem_uatt9_728`,pickerItemAdded:`_pickerItemAdded_uatt9_741`,pickerProvider:`_pickerProvider_uatt9_747`,pickerModel:`_pickerModel_uatt9_752`,pickerBadge:`_pickerBadge_uatt9_759`,pickerBadgeOk:`_pickerBadgeOk_uatt9_769`,pickerEmpty:`_pickerEmpty_uatt9_774`,saveStatus:`_saveStatus_uatt9_781`,saveStatusOk:`_saveStatusOk_uatt9_791`,saveStatusErr:`_saveStatusErr_uatt9_792`,autoHealBanner:`_autoHealBanner_uatt9_796`,autoHealLeft:`_autoHealLeft_uatt9_808`,autoHealIcon:`_autoHealIcon_uatt9_816`,autoHealTitle:`_autoHealTitle_uatt9_823`,autoHealHint:`_autoHealHint_uatt9_830`,autoHealActions:`_autoHealActions_uatt9_840`,probeBtnActive:`_probeBtnActive_uatt9_852`,probeProgress:`_probeProgress_uatt9_859`,probeProgressLabel:`_probeProgressLabel_uatt9_870`,probeProgressCount:`_probeProgressCount_uatt9_879`,probeProgressBar:`_probeProgressBar_uatt9_886`,probeProgressFill:`_probeProgressFill_uatt9_893`,aiLatencyCell:`_aiLatencyCell_uatt9_904`,aiLatencyMs:`_aiLatencyMs_uatt9_914`,aiLatencyTps:`_aiLatencyTps_uatt9_919`,aiLatencySpin:`_aiLatencySpin_uatt9_924`,probeSpin:`_probeSpin_uatt9_1`,aiLatencyErr:`_aiLatencyErr_uatt9_936`,aiLatencyNone:`_aiLatencyNone_uatt9_941`,miniPgHint:`_miniPgHint_uatt9_950`,miniPg:`_miniPg_uatt9_950`,miniPgEmpty:`_miniPgEmpty_uatt9_976`,miniPgMsg:`_miniPgMsg_uatt9_983`,miniPgUser:`_miniPgUser_uatt9_990`,miniPgAssistant:`_miniPgAssistant_uatt9_995`,miniPgBubble:`_miniPgBubble_uatt9_1000`,miniPgTyping:`_miniPgTyping_uatt9_1022`,miniPgError:`_miniPgError_uatt9_1028`,miniPgAborted:`_miniPgAborted_uatt9_1035`,miniPgTarget:`_miniPgTarget_uatt9_1047`,miniPgRouted:`_miniPgRouted_uatt9_1045`,miniPgInputRow:`_miniPgInputRow_uatt9_1074`,miniPgInput:`_miniPgInput_uatt9_1074`,miniPgSendBtn:`_miniPgSendBtn_uatt9_1101`,miniPgStopBtn:`_miniPgStopBtn_uatt9_1102`,fadeIn:`_fadeIn_uatt9_1`};function gl(e){if(!e||e<=0)return`—`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return t>0?`${t}h ${n}m`:n>0?`${n}m ${r}s`:`${r}s`}function _l(e){return typeof e!=`number`||!Number.isFinite(e)?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}var vl={CLOSED:{label:`Healthy`,cls:`circuitClosed`},OPEN:{label:`Down`,cls:`circuitOpen`},HALF_OPEN:{label:`Recovering`,cls:`circuitHalfOpen`},AUTH_ERROR:{label:`Auth error`,cls:`circuitAuth`},STALE:{label:`Deprecated`,cls:`circuitUnknown`},UNSUPPORTED:{label:`Unsupported`,cls:`circuitUnknown`},UNKNOWN:{label:`Unknown`,cls:`circuitUnknown`}};function yl({state:e}){let t=vl[e]||vl.UNKNOWN;return(0,P.jsx)(`span`,{className:`${q.circuitBadge} ${q[t.cls]}`,children:t.label})}var bl={kind:`idle`},xl={kind:`saving`},Sl={kind:`saved`},Cl=e=>({kind:`error`,message:e});function wl({onClose:e,onToast:t,favorites:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)({activeSet:null,sets:{}}),[b,x]=(0,v.useState)([]),[S,C]=(0,v.useState)(!1),[w,ee]=(0,v.useState)(``),[T,E]=(0,v.useState)(``),[D,te]=(0,v.useState)(bl),ne=(0,v.useRef)(null),re=(0,v.useRef)(!1),[ie,ae]=(0,v.useState)(!1),oe=(0,v.useCallback)(async()=>{try{let e=await(await fetch(`/api/router/status`)).json();if(i(e),e?.ok){let e=await(await fetch(`/api/router/stats`)).json();e.ok&&o(e)}}catch{}},[]),se=(0,v.useCallback)(async()=>{try{let e=await(await fetch(`/api/router/sets`)).json();e&&e.sets&&y(e)}catch{}},[]),O=(0,v.useCallback)(async()=>{try{let e=await(await fetch(`/api/router/catalog`)).json();Array.isArray(e?.models)&&x(e.models)}catch{}},[]);(0,v.useEffect)(()=>{oe(),se(),O(),fetch(`/api/router/quick-setup`).then(e=>e.json()).then(c).catch(()=>{});let e=setInterval(()=>{oe(),se()},5e3);return()=>clearInterval(e)},[oe,se,O]),(0,v.useEffect)(()=>{if(!ie)return;let e=setInterval(()=>{oe()},1200);return()=>clearInterval(e)},[ie,oe]),(0,v.useEffect)(()=>{ie&&a?.globalBenchmark&&!a.globalBenchmark.running&&ae(!1)},[a?.globalBenchmark,ie]),(0,v.useEffect)(()=>{if(D.kind===`saved`)return ne.current=setTimeout(()=>te(bl),1500),()=>{ne.current&&clearTimeout(ne.current)}},[D]);let k=async()=>{u(!0);try{let e=await(await fetch(`/api/router/start`,{method:`POST`})).json();e.ok||e.alreadyRunning?(t?.(`Router daemon started.`,`success`),await oe(),await se()):t?.(`Failed to start: ${e.error||e.message||`unknown`}`,`error`)}catch(e){let n=e.name===`TypeError`&&e.message?.includes(`fetch`)?`Cannot reach daemon — it may not be installed or the port is blocked`:e.message;t?.(`Start failed: ${n}`,`error`)}finally{u(!1)}},ce=async()=>{u(!0);try{let e=await(await fetch(`/api/router/stop`,{method:`POST`})).json();e.ok?(t?.(`Router daemon stopped.`,`success`),i({ok:!1,running:!1}),o(null)):t?.(`Failed to stop: ${e.error||`unknown`}`,`error`)}catch(e){t?.(`Stop failed: ${e.message}`,`error`)}finally{u(!1)}},le=(e,t)=>{navigator.clipboard.writeText(e).then(()=>{m(t),setTimeout(()=>m(null),1500)})},ue=async e=>{try{await fetch(`/api/router/probe-mode`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({probeMode:e})}),t?.(`Probe mode set to ${e}.`,`info`),await oe()}catch{}},A=_?.activeSet||r?.activeSet||`fast-coding`,de=_?.sets?.[A]||{models:[]},fe=Array.isArray(de.models)?de.models:[],pe=async e=>{try{await fetch(`/api/router/sets/${encodeURIComponent(e)}/activate`,{method:`POST`}),t?.(`Active set: ${e}`,`info`),await se(),await oe()}catch(e){t?.(`Failed to activate: ${e.message}`,`error`)}},me=async()=>{if(A){te(xl),t?.(`Probing models with your keys…`,`info`);try{let e=await fetch(`/api/router/sets/${encodeURIComponent(A)}/sync`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`HTTP ${e.status}`)}let n=await e.json(),r=n.selected?.length||0,i=n.probeCount||0;t?.(`Synced ${A}: ${r} working model${r===1?``:`s`} from ${i} probes.`,`success`),await se(),await oe(),te(Sl)}catch(e){te(Cl(e.message||String(e))),t?.(`Sync failed: ${e.message}`,`error`)}}},he=async()=>{if(!A)return;let e=n?.favorites||[];if(e.length===0){t?.(`You do not have any favorite models yet. Star some models first!`,`info`);return}let r=e.map((e,t)=>{let n=e.split(`/`);return{provider:n[0],model:n.slice(1).join(`/`),priority:t+1}});te(xl);try{let n=await fetch(`/api/router/sets/${encodeURIComponent(A)}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({models:r})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`HTTP ${n.status}`)}let i=await n.json();i?.sets?.[A]?y(e=>({...e,sets:i.sets})):await se(),te(Sl),t?.(`Replaced active set with ${e.length} favorite model${e.length===1?``:`s`}.`,`success`),await oe()}catch(e){te(Cl(e.message||String(e))),t?.(`Failed to replace set: ${e.message}`,`error`)}},ge=(0,v.useCallback)(async e=>{if(A){te(xl);try{let t=e.map(e=>`${e.provider}/${e.model}`),n=await fetch(`/api/router/sets/${encodeURIComponent(A)}/reorder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({order:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`HTTP ${n.status}`)}let r=await n.json();r?.sets?.[A]?y(e=>({...e,sets:r.sets})):await se(),te(Sl)}catch(e){te(Cl(e.message||String(e))),t?.(`Reorder failed: ${e.message}`,`error`)}}},[A,se,t]),_e=(0,v.useCallback)(async(e,n)=>{if(A){te(xl);try{let r=await fetch(`/api/router/sets/${encodeURIComponent(A)}/models`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e,model:n})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||`HTTP ${r.status}`)}let i=await r.json();i?.sets?.[A]?y(e=>({...e,sets:i.sets})):await se(),te(Sl),t?.(`Added ${e}/${n} to ${A}.`,`success`)}catch(e){te(Cl(e.message||String(e))),t?.(`Add failed: ${e.message}`,`error`)}}},[A,se,t]),ve=(0,v.useCallback)(async(e,n)=>{if(A){te(xl);try{let t=await fetch(`/api/router/sets/${encodeURIComponent(A)}/models`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e,model:n})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`HTTP ${t.status}`)}let r=await t.json();r?.sets?.[A]?y(e=>({...e,sets:r.sets})):await se(),te(Sl)}catch(e){te(Cl(e.message||String(e))),t?.(`Remove failed: ${e.message}`,`error`)}}},[A,se,t]),ye=async()=>{if(!(!A||ie)){if(j.length===0){t?.(`Add models to the set first, then probe.`,`info`);return}try{let e=j.map(e=>({providerKey:e.provider,modelId:e.model})),n=await fetch(`/api/router/probe-all`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({models:e})}),r=await n.json().catch(()=>null);if(!n.ok||!n.status||n.status===409)throw Error(r?.error||`Probe already running`);ae(!0);let i=r?.total??j.length;t?.(`Probing ${i} model${i===1?``:`s`} for AI Latency…`,`info`),await oe()}catch(e){t?.(`Probe failed: ${e.message}`,`error`),ae(!1)}}},[j,be]=(0,v.useState)(fe);(0,v.useEffect)(()=>{be(fe)},[fe]);let[xe,Se]=(0,v.useState)(null),[Ce,we]=(0,v.useState)(null),Te=(0,v.useCallback)(async(e,t)=>{let n=[...j],r=t===`up`?e-1:e+1;if(r<0||r>=n.length)return;let[i]=n.splice(e,1);n.splice(r,0,i),be(n),await ge(n)},[j,ge]),Ee=(0,v.useCallback)(async e=>{let t=j[e];t&&(be(j.filter((t,n)=>n!==e)),await ve(t.provider,t.model))},[j,ve]),De=(e,t)=>{let n=j[t];n&&(Se(`${n.provider}/${n.model}`),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,`${n.provider}/${n.model}`))},Oe=(e,t)=>{if(xe==null)return;e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=j[t];if(!n)return;let r=`${n.provider}/${n.model}`;if(r===xe)return;let i=e.currentTarget.getBoundingClientRect();we({key:r,side:e.clientY<i.top+i.height/2?`above`:`below`})},ke=e=>{e.currentTarget.contains(e.relatedTarget)},Ae=async(e,t)=>{if(e.preventDefault(),xe==null)return;let n=j.findIndex(e=>`${e.provider}/${e.model}`===xe);if(n<0){Se(null),we(null);return}if(!j[t]){Se(null),we(null);return}let r=e.currentTarget.getBoundingClientRect(),i=(e.clientY<r.top+r.height/2?`above`:`below`)==`above`?t:t+1;if(n<i&&--i,i===n){Se(null),we(null);return}let a=[...j],[o]=a.splice(n,1);a.splice(i,0,o),be(a),Se(null),we(null),await ge(a)},je=()=>{Se(null),we(null)},Me=(0,v.useMemo)(()=>{let e=new Set(b.map(e=>e.provider));return Array.from(e).sort()},[b]),Ne=(0,v.useMemo)(()=>{let e=w.trim().toLowerCase();return b.filter(t=>T&&t.provider!==T?!1:e?t.key.toLowerCase().includes(e)||(t.label||``).toLowerCase().includes(e)||t.provider.toLowerCase().includes(e):!0).slice(0,200)},[b,w,T]),Pe=(e,t)=>j.some(n=>n.provider===e&&n.model===t),Fe=r?.ok,Ie=a?.circuitBreakers||{},Le=a?.requestLog||[],Re=a?.routingOrder||[],ze=Re.length>0?Re[0].key:null,Be=new Map;for(let e of a?.models||[])e&&typeof e.key==`string`&&Be.set(e.key,e);let Ve=a?.globalBenchmark||null,He=!!Ve?.running||ie;(0,v.useEffect)(()=>{Le.length>0&&!re.current&&(re.current=!0,f(!0))},[Le.length]);let Ue=Fe&&s?.baseUrl?s.baseUrl:`http://localhost:19280/v1`,We=s?.model||`fcm`,Ge=`fcm-local`,Ke=`Base URL: ${Ue}\nModel: ${We}\nAPI Key: ${Ge}`,qe=_?.sets||{},Je=Object.keys(qe).sort();return(0,P.jsx)(`div`,{className:q.overlay,onClick:t=>t.target===t.currentTarget&&e(),children:(0,P.jsxs)(`div`,{className:q.modal,children:[(0,P.jsxs)(`div`,{className:q.header,children:[(0,P.jsxs)(`h2`,{className:q.title,children:[(0,P.jsx)(Lr,{size:20,stroke:1.5}),`Router Dashboard`]}),(0,P.jsx)(`button`,{className:q.closeBtn,onClick:e,"aria-label":`Close`,children:`✕`})]}),(0,P.jsxs)(`div`,{className:q.body,children:[Fe&&r?.brokenModelCount>0&&!h&&(0,P.jsxs)(`div`,{className:q.autoHealBanner,children:[(0,P.jsxs)(`div`,{className:q.autoHealLeft,children:[(0,P.jsx)(`span`,{className:q.autoHealIcon,children:`⚠`}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:q.autoHealTitle,children:[r.brokenModelCount,` model`,r.brokenModelCount===1?``:`s`,` in the active set are not responding`]}),(0,P.jsxs)(`div`,{className:q.autoHealHint,children:[`Auto-heal ran on startup but the replacement may also be broken. Click `,(0,P.jsx)(`strong`,{children:`Sync best`}),` below to re-probe with your current keys, or click `,(0,P.jsx)(`strong`,{children:`Fix now`}),` to manually replace the broken entries.`]})]})]}),(0,P.jsxs)(`div`,{className:q.autoHealActions,children:[(0,P.jsxs)(`button`,{className:q.smallBtn,onClick:me,children:[(0,P.jsx)(Jr,{size:11}),`Fix now`]}),(0,P.jsx)(`button`,{className:q.iconBtn,onClick:()=>g(!0),"aria-label":`Dismiss`,children:(0,P.jsx)(Yr,{size:12})})]})]}),(0,P.jsxs)(`div`,{className:`${q.quickSetup} ${Fe?q.quickSetupHero:``}`,children:[(0,P.jsxs)(`h3`,{className:q.sectionTitle,children:[(0,P.jsx)(sr,{size:14}),`Quick Setup`,(0,P.jsxs)(`button`,{className:q.copyAllBtn,onClick:()=>le(Ke,`all`),children:[p===`all`?(0,P.jsx)(Yn,{size:12}):(0,P.jsx)(sr,{size:12}),p===`all`?`Copied!`:`Copy all`]})]}),(0,P.jsxs)(`div`,{className:q.quickRows,children:[(0,P.jsxs)(`div`,{className:q.quickRow,children:[(0,P.jsx)(`span`,{className:q.quickLabel,children:`Base URL`}),(0,P.jsx)(`code`,{className:q.quickValue,children:Ue}),(0,P.jsx)(`button`,{className:q.copyBtn,onClick:()=>le(Ue,`url`),children:p===`url`?(0,P.jsx)(Yn,{size:12}):(0,P.jsx)(sr,{size:12})})]}),(0,P.jsxs)(`div`,{className:q.quickRow,children:[(0,P.jsx)(`span`,{className:q.quickLabel,children:`Model`}),(0,P.jsx)(`code`,{className:q.quickValue,children:We}),(0,P.jsx)(`button`,{className:q.copyBtn,onClick:()=>le(We,`model`),children:p===`model`?(0,P.jsx)(Yn,{size:12}):(0,P.jsx)(sr,{size:12})})]}),(0,P.jsxs)(`div`,{className:q.quickRow,children:[(0,P.jsx)(`span`,{className:q.quickLabel,children:`API Key`}),(0,P.jsx)(`code`,{className:q.quickValue,children:Ge}),(0,P.jsx)(`button`,{className:q.copyBtn,onClick:()=>le(Ge,`key`),children:p===`key`?(0,P.jsx)(Yn,{size:12}):(0,P.jsx)(sr,{size:12})})]})]})]}),(0,P.jsxs)(`div`,{className:`${q.heroCard} ${Fe?q.heroRunning:q.heroStopped}`,children:[(0,P.jsxs)(`div`,{className:q.heroLeft,children:[(0,P.jsxs)(`div`,{className:q.heroStatus,children:[(0,P.jsx)(`span`,{className:`${q.statusDot} ${Fe?q.dotGreen:q.dotGray}`}),(0,P.jsx)(`span`,{className:q.heroLabel,children:Fe?`Running`:`Stopped`})]}),Fe&&(0,P.jsxs)(`div`,{className:q.heroMeta,children:[(0,P.jsxs)(`span`,{children:[`Port `,r.port]}),(0,P.jsx)(`span`,{children:`·`}),(0,P.jsxs)(`span`,{children:[`Uptime `,gl(r.uptimeSeconds)]}),(0,P.jsx)(`span`,{children:`·`}),(0,P.jsxs)(`span`,{children:[r.requestsRouted,` requests`]})]}),!Fe&&(0,P.jsx)(`div`,{className:q.heroMeta,children:`Smart failover router — start to route requests to the healthiest model.`})]}),(0,P.jsxs)(`div`,{className:q.heroActions,children:[Fe?(0,P.jsxs)(`button`,{className:q.stopBtn,onClick:ce,disabled:l,children:[(0,P.jsx)(jr,{size:14}),l?`Stopping…`:`Stop`]}):(0,P.jsxs)(`button`,{className:`${q.startBtn} ${q.startBtnBig}`,onClick:k,disabled:l,children:[(0,P.jsx)(Ar,{size:16}),l?`Starting…`:`Start Router`]}),(0,P.jsx)(`button`,{className:q.refreshBtn,onClick:oe,title:`Refresh`,children:(0,P.jsx)(Ir,{size:14})})]})]}),Fe&&(0,P.jsxs)(`div`,{className:q.section,children:[(0,P.jsxs)(`h3`,{className:q.sectionTitle,children:[(0,P.jsx)(wr,{size:14}),`Active Set (`,j.length,` models)`]}),(0,P.jsxs)(`div`,{className:q.setMeta,children:[(0,P.jsxs)(`div`,{className:q.setActions,children:[(0,P.jsx)(`span`,{className:q.setMetaName,children:A}),Je.length>1&&(0,P.jsx)(`select`,{className:q.pickerSelect,value:A,onChange:e=>pe(e.target.value),title:`Switch the active set`,children:Je.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))})]}),(0,P.jsxs)(`div`,{className:q.setActions,children:[(0,P.jsx)(Tl,{status:D}),(0,P.jsxs)(`button`,{className:q.smallBtn,onClick:me,disabled:D.kind===`saving`,title:`Probe your API keys and rebuild the set with only models that actually work`,children:[(0,P.jsx)(Jr,{size:11}),`Sync best`]}),n&&(0,P.jsxs)(`button`,{className:q.smallBtn,onClick:he,disabled:D.kind===`saving`,title:`Replace current router models with your favorite models`,children:[(0,P.jsx)(wr,{size:11}),`Use favorites`]}),(0,P.jsxs)(`button`,{className:`${q.smallBtn} ${He?q.probeBtnActive:``}`,onClick:ye,disabled:He||D.kind===`saving`||j.length===0,title:`Benchmark AI Latency + TPS on every model in this set`,children:[(0,P.jsx)(qn,{size:11}),He?`Probing…`:`Probe all`]}),(0,P.jsxs)(`button`,{className:q.primaryBtn,onClick:()=>C(e=>!e),disabled:D.kind===`saving`,children:[S?(0,P.jsx)(Yr,{size:11}):(0,P.jsx)(Pr,{size:11}),S?`Close`:`Add model`]})]})]}),He&&Ve&&(0,P.jsxs)(`div`,{className:q.probeProgress,children:[(0,P.jsxs)(`div`,{className:q.probeProgressLabel,children:[(0,P.jsx)(qn,{size:11}),`AI Latency probe`,(0,P.jsxs)(`span`,{className:q.probeProgressCount,children:[Ve.completed,` / `,Ve.total||j.length]})]}),(0,P.jsx)(`div`,{className:q.probeProgressBar,children:(0,P.jsx)(`div`,{className:q.probeProgressFill,style:{width:`${Math.min(100,(Ve.completed||0)/Math.max(1,Ve.total||j.length)*100)}%`}})})]}),j.length===0?(0,P.jsxs)(`div`,{className:q.setEmpty,children:[(0,P.jsx)(`div`,{className:q.setEmptyTitle,children:`No models in the active set`}),(0,P.jsxs)(`div`,{className:q.setEmptyHint,children:[`Add models from the picker below, or click `,(0,P.jsx)(`strong`,{children:`Sync best`}),` above to auto-pick working models.`]})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:q.priorityLegend,children:[(0,P.jsxs)(`span`,{className:q.legendPrimary,children:[(0,P.jsx)(Wn,{size:11}),` Primary`]}),(0,P.jsx)(`span`,{className:q.legendSeparator,children:`tries first`}),(0,P.jsx)(`span`,{className:q.legendFallback,children:`Fallback`}),(0,P.jsx)(`span`,{className:q.legendSeparator,children:`on failure / rate-limit`}),Fe&&ze&&(0,P.jsxs)(`span`,{className:q.legendNext,children:[`Next up: `,(0,P.jsx)(`code`,{children:ze})]})]}),(0,P.jsx)(`div`,{className:q.setList,onDragLeave:ke,children:j.map((e,t)=>{let n=`${e.provider}/${e.model}`,r=Ie[n]||{},i=Be.get(n),a=i?.benchmark||null,o=!!i?.isBenchmarking,s=xe===n,c=Ce?.key===n&&Ce.side===`above`,l=Ce?.key===n&&Ce.side===`below`,u=t===0,d=Fe&&ze===n;return(0,P.jsxs)(`div`,{className:`${q.setRow} ${s?q.setRowDragging:``} ${d?q.setRowNext:``} ${c?`${q.setRowDropTarget} ${q.setRowDropTargetAbove}`:``} ${l?`${q.setRowDropTarget} ${q.setRowDropTargetBelow}`:``}`,draggable:!0,onDragStart:e=>De(e,t),onDragOver:e=>Oe(e,t),onDrop:e=>Ae(e,t),onDragEnd:je,title:n,children:[(0,P.jsx)(`span`,{className:q.setDragHandle,"aria-hidden":!0,children:(0,P.jsx)(vr,{size:14})}),(0,P.jsx)(`span`,{className:`${q.setPriority} ${u?q.setPriorityPrimary:q.setPriorityFallback}`,title:u?`Primary model — tried first on every request`:`Fallback #${t+1} — used when higher-priority models fail or rate-limit`,children:u?`Primary`:`#${t+1}`}),(0,P.jsx)(`span`,{className:q.setKey,children:n}),e.tier&&(0,P.jsx)(`span`,{className:q.setTier,children:e.tier}),(0,P.jsx)(yl,{state:r.state||e.state}),(0,P.jsx)(`span`,{className:q.aiLatencyCell,title:a?`AI Latency: ${Math.round(a.totalMs)}ms · TPS: ${(a.tokensPerSecond??0).toFixed(1)}`:`Run Probe all to measure AI Latency`,children:o?(0,P.jsx)(`span`,{className:q.aiLatencySpin,children:`···`}):a?.ok?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{className:q.aiLatencyMs,children:[Math.round(a.totalMs),`ms`]}),a.tokensPerSecond!=null&&a.tokensPerSecond>0&&(0,P.jsxs)(`span`,{className:q.aiLatencyTps,children:[a.tokensPerSecond.toFixed(1),` t/s`]})]}):a&&!a.ok?(0,P.jsx)(`span`,{className:q.aiLatencyErr,children:`fail`}):(0,P.jsx)(`span`,{className:q.aiLatencyNone,children:`—`})}),(0,P.jsxs)(`div`,{className:q.setRowBtns,children:[(0,P.jsx)(`button`,{className:q.iconBtn,onClick:()=>Te(t,`up`),disabled:t===0||D.kind===`saving`,title:`Move up`,"aria-label":`Move ${n} up`,children:(0,P.jsx)(Gn,{size:12})}),(0,P.jsx)(`button`,{className:q.iconBtn,onClick:()=>Te(t,`down`),disabled:t===j.length-1||D.kind===`saving`,title:`Move down`,"aria-label":`Move ${n} down`,children:(0,P.jsx)(Hn,{size:12})}),(0,P.jsx)(`button`,{className:`${q.iconBtn} ${q.removeBtn}`,onClick:()=>Ee(t),disabled:D.kind===`saving`,title:`Remove from set`,"aria-label":`Remove ${n}`,children:(0,P.jsx)(Gr,{size:12})})]})]},n)})})]}),S&&(0,P.jsxs)(`div`,{className:q.pickerPanel,children:[(0,P.jsxs)(`div`,{className:q.pickerHeader,children:[(0,P.jsxs)(`span`,{children:[`Add a model to `,(0,P.jsx)(`code`,{children:A})]}),(0,P.jsxs)(`span`,{style:{color:`var(--text-muted, #888)`},children:[Ne.length,` of `,b.length]})]}),(0,P.jsxs)(`div`,{className:q.pickerSearch,children:[(0,P.jsx)(`input`,{className:q.pickerInput,placeholder:`Search by provider, model, or label…`,value:w,onChange:e=>ee(e.target.value),autoFocus:!0}),(0,P.jsxs)(`select`,{className:q.pickerSelect,value:T,onChange:e=>E(e.target.value),children:[(0,P.jsx)(`option`,{value:``,children:`All providers`}),Me.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]})]}),(0,P.jsx)(`div`,{className:q.pickerList,children:Ne.length===0?(0,P.jsx)(`div`,{className:q.pickerEmpty,children:`No models match your filter.`}):Ne.map(e=>{let t=Pe(e.provider,e.model);return(0,P.jsxs)(`div`,{className:`${q.pickerItem} ${t?q.pickerItemAdded:``}`,onClick:()=>{t||_e(e.provider,e.model)},title:t?`Already in set`:`Add ${e.key}`,children:[(0,P.jsx)(`span`,{className:q.pickerProvider,children:e.provider}),(0,P.jsx)(`span`,{className:q.pickerModel,children:e.label||e.model}),e.tier&&(0,P.jsx)(`span`,{className:q.setTier,children:e.tier}),e.hasKey?(0,P.jsx)(`span`,{className:`${q.pickerBadge} ${q.pickerBadgeOk}`,children:`key`}):(0,P.jsx)(`span`,{className:q.pickerBadge,children:`no key`})]},e.key)})})]})]}),Fe&&(0,P.jsxs)(`div`,{className:q.section,children:[(0,P.jsxs)(`h3`,{className:q.sectionTitle,children:[(0,P.jsx)(zn,{size:14}),`Probe Mode`]}),(0,P.jsx)(`div`,{className:q.probeModes,children:[`eco`,`balanced`,`aggressive`].map(e=>(0,P.jsx)(`button`,{className:`${q.probeBtn} ${r?.probeMode===e?q.probeActive:``}`,onClick:()=>ue(e),children:e},e))})]}),Fe&&(0,P.jsxs)(`div`,{className:q.section,children:[(0,P.jsxs)(`h3`,{className:q.sectionTitle,onClick:()=>f(!d),style:{cursor:`pointer`},children:[(0,P.jsx)(zn,{size:14}),`Request Log (`,Le.length,`)`,d?(0,P.jsx)(er,{size:12}):(0,P.jsx)(Zn,{size:12})]}),d&&(Le.length===0?(0,P.jsx)(`div`,{className:q.logEmpty,children:`No requests yet. Start coding to see traffic here.`}):(0,P.jsx)(`div`,{className:q.logList,children:Le.map((e,t)=>(0,P.jsxs)(`div`,{className:q.logRow,children:[(0,P.jsx)(`span`,{className:e.error?q.logErr:q.logOk,children:e.status||`—`}),(0,P.jsx)(`span`,{className:q.logModel,children:e.model}),(0,P.jsx)(`span`,{className:q.logLatency,children:e.latency_ms==null?`—`:`${e.latency_ms}ms`}),(0,P.jsx)(`span`,{className:q.logTokens,children:e.tokens>0?_l(e.tokens)+` tok`:``}),e.failover&&(0,P.jsx)(`span`,{className:q.logFailover,children:`failover`})]},t))}))]}),Fe&&(0,P.jsxs)(`div`,{className:q.section,children:[(0,P.jsxs)(`h3`,{className:q.sectionTitle,children:[(0,P.jsx)(zr,{size:14}),`Test Router`,(0,P.jsxs)(`span`,{className:q.miniPgHint,children:[`routes through `,(0,P.jsx)(`code`,{children:`fcm`}),` — try the fallback chain`]})]}),(0,P.jsx)(Zs,{model:`fcm`,variant:`mini`,disabled:!Fe,targetLabel:ze||`fcm`,placeholder:`Test the router… (e.g. write a haiku about TypeScript)`,emptyHint:`Send a message to see which model the router picks, with latency + TPS.`})]}),(0,P.jsx)(`div`,{className:q.section,style:{marginBottom:0,marginTop:16},children:(0,P.jsx)(`span`,{className:q.saveStatus,children:a?.tokenStats?`${_l(a.tokenStats.all_time?.total_tokens||0)} tokens routed lifetime`:``})})]})]})})}function Tl({status:e}){return!e||e.kind===`idle`?null:e.kind===`saving`?(0,P.jsx)(`span`,{className:q.saveStatus,children:`saving…`}):e.kind===`saved`?(0,P.jsx)(`span`,{className:`${q.saveStatus} ${q.saveStatusOk}`,children:`✓ saved`}):e.kind===`error`?(0,P.jsxs)(`span`,{className:`${q.saveStatus} ${q.saveStatusErr}`,title:e.message,children:[`⚠ `,e.message?.slice(0,40)||`error`]}):null}var J={overlay:`_overlay_1kxet_7`,modal:`_modal_1kxet_16`,header:`_header_1kxet_40`,headerLeft:`_headerLeft_1kxet_49`,headerTitle:`_headerTitle_1kxet_56`,headerSubtitle:`_headerSubtitle_1kxet_64`,headerActions:`_headerActions_1kxet_70`,iconBtn:`_iconBtn_1kxet_76`,modelBar:`_modelBar_1kxet_94`,modelLabel:`_modelLabel_1kxet_105`,modelSelect:`_modelSelect_1kxet_110`,presetChip:`_presetChip_1kxet_128`,prePromptToggle:`_prePromptToggle_1kxet_145`,transcript:`_transcript_1kxet_158`,chatBody:`_chatBody_1kxet_171`,empty:`_empty_1kxet_178`,emptyTitle:`_emptyTitle_1kxet_190`,emptyHint:`_emptyHint_1kxet_196`,message:`_message_1kxet_202`,msgIn:`_msgIn_1kxet_1`,user:`_user_1kxet_215`,assistant:`_assistant_1kxet_219`,system:`_system_1kxet_223`,messageRole:`_messageRole_1kxet_228`,bubble:`_bubble_1kxet_237`,codeBlock:`_codeBlock_1kxet_268`,meta:`_meta_1kxet_280`,metaChip:`_metaChip_1kxet_289`,provider:`_provider_1kxet_300`,error:`_error_1kxet_305`,cursor:`_cursor_1kxet_310`,blink:`_blink_1kxet_1`,inputBar:`_inputBar_1kxet_325`,textarea:`_textarea_1kxet_335`,sendBtn:`_sendBtn_1kxet_360`,errorBar:`_errorBar_1kxet_385`,stopBar:`_stopBar_1kxet_397`,stopBtn:`_stopBtn_1kxet_409`,daemonStartPanel:`_daemonStartPanel_1kxet_426`,daemonStartTitle:`_daemonStartTitle_1kxet_438`,daemonStartHint:`_daemonStartHint_1kxet_444`,daemonStartBtn:`_daemonStartBtn_1kxet_451`,daemonStartAlt:`_daemonStartAlt_1kxet_483`,spin:`_spin_1kxet_497`,spinAnim:`_spinAnim_1kxet_1`,fadeIn:`_fadeIn_1kxet_1`,slideUp:`_slideUp_1kxet_1`},El=[`Write a Python fizzbuzz with type hints`,`Explain Big O notation with three examples`,`Refactor a deeply nested for-loop into map/filter`,`Write a tiny Express endpoint that returns JSON`];function Dl({routerStatus:e,daemonRunning:t}){return t===!0?(0,P.jsxs)(`span`,{className:J.metaChip,children:[(0,P.jsx)(qn,{size:11}),`Router online`]}):t===!1?(0,P.jsxs)(`span`,{className:`${J.metaChip} ${J.error}`,children:[(0,P.jsx)(Vn,{size:11}),`Router offline`]}):(0,P.jsxs)(`span`,{className:J.metaChip,children:[(0,P.jsx)(Tr,{size:11,className:J.spin}),`Checking router…`]})}function Ol({onClose:e,onToast:t,models:n,routerStatus:r}){let[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!0),[c,l]=(0,v.useState)(!0),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(r?.running===!0?!0:null),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(5),y=(0,v.useRef)(null),b=(0,v.useRef)(null),x=(0,v.useRef)(!1),[S,C]=(0,v.useState)({count:0,totalTokens:0}),w=(0,v.useRef)(null);(0,v.useEffect)(()=>{fetch(`/api/router/preprompt`).then(e=>e.json()).then(e=>{e&&typeof e==`object`&&(l(e.enabled===!0),typeof e.text==`string`&&d(e.text))}).catch(()=>{})},[]),(0,v.useEffect)(()=>{if(i!==null)return;let e=(Array.isArray(n)?n:[]).filter(e=>e.status===`up`&&e.hasApiKey&&!e.isPinging);if(e.length>0){let t={"S+":0,S:1,"A+":2,A:3,"A-":4,"B+":5,B:6,C:7};e.sort((e,n)=>{let r=t[e.tier]??99,i=t[n.tier]??99;return r===i?(typeof e.avg==`number`?e.avg:99999)-(typeof n.avg==`number`?n.avg:99999):r-i}),a(`${e[0].providerKey}/${e[0].modelId}`);return}a(`fcm`)},[n,i]),(0,v.useEffect)(()=>{let e=!0;async function t(){try{let t=await(await fetch(`/api/router/status`)).json();if(!e)return;p(t?.running===!0)}catch{e&&p(!1)}}return t(),()=>{e=!1,y.current&&clearInterval(y.current),b.current&&clearInterval(b.current)}},[]);let ee=(0,v.useCallback)(async()=>{if(!m){y.current&&=(clearInterval(y.current),null),x.current=!0,h(!0);try{await fetch(`/api/router/start`,{method:`POST`});let e=0;await new Promise(t=>{b.current=setInterval(async()=>{e+=1;try{(await(await fetch(`/api/router/status`)).json())?.running&&(clearInterval(b.current),p(!0),h(!1),t())}catch{}e>=30&&(clearInterval(b.current),h(!1),t())},1e3)})}catch{h(!1)}}},[m]);(0,v.useEffect)(()=>{if(f!==!1||i!==`fcm`||x.current)return;let e=5;return _(5),y.current=setInterval(()=>{--e,_(e),e<=0&&(clearInterval(y.current),x.current=!0,ee())},1e3),()=>{y.current&&clearInterval(y.current)}},[f,i,ee]);let T=(0,v.useMemo)(()=>{let e=[{value:`fcm`,label:`fcm — auto router (recommended)`}];if(Array.isArray(n))for(let t of n.slice(0,200)){let n=t.modelId||t.id;if(!n)continue;let r=t.label||n;e.push({value:`${t.providerKey}/${n}`,label:`${t.providerKey}/${n} (${r})`})}return e},[n]),E=(0,v.useCallback)(e=>{C({count:e.count,totalTokens:e.totalTokens})},[]),D=(0,v.useCallback)(()=>{w.current?.clear(),C({count:0,totalTokens:0})},[]),te=!(i===`fcm`&&f!==!0),ne=S.count>0,re=i===`fcm`&&!ne&&f===!1&&!m,ie=i===`fcm`&&!ne&&m,ae=!re&&!ie;return(0,P.jsx)(`div`,{className:J.overlay,onClick:t=>{t.target===t.currentTarget&&e()},children:(0,P.jsxs)(`div`,{className:J.modal,role:`dialog`,"aria-label":`Free Coding Models Playground`,children:[(0,P.jsxs)(`div`,{className:J.header,children:[(0,P.jsxs)(`div`,{className:J.headerLeft,children:[(0,P.jsxs)(`div`,{className:J.headerTitle,children:[(0,P.jsx)(Or,{size:18}),`Playground`]}),(0,P.jsxs)(`div`,{className:J.headerSubtitle,children:[`Chat with the FCM router · `,S.count,` message`,S.count===1?``:`s`,` · `,S.totalTokens,` tokens`]})]}),(0,P.jsxs)(`div`,{className:J.headerActions,children:[(0,P.jsx)(`button`,{className:J.iconBtn,onClick:D,title:`Clear conversation`,disabled:!ne,children:(0,P.jsx)(Gr,{size:16})}),(0,P.jsx)(`button`,{className:J.iconBtn,onClick:e,title:`Close (Esc)`,children:(0,P.jsx)(Yr,{size:16})})]})]}),(0,P.jsxs)(`div`,{className:J.modelBar,children:[(0,P.jsx)(`span`,{className:J.modelLabel,children:`Model:`}),(0,P.jsx)(`select`,{className:J.modelSelect,value:i??`fcm`,onChange:e=>a(e.target.value),disabled:!ae,children:T.map(e=>(0,P.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,P.jsx)(`button`,{className:J.presetChip,onClick:()=>s(e=>!e),title:`Toggle streaming`,children:o?`⚡ Streaming`:`🐢 One-shot`}),(0,P.jsxs)(`label`,{className:J.prePromptToggle,title:`Router persona injected as the first system message`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked)}),`Pre-prompt`]}),(0,P.jsx)(Dl,{routerStatus:r,daemonRunning:f})]}),c&&u&&(0,P.jsxs)(`div`,{className:J.modelBar,style:{borderTop:`none`,background:`transparent`,paddingTop:4,paddingBottom:8,fontSize:11},children:[(0,P.jsx)(`span`,{className:J.modelLabel,style:{flexShrink:0},children:`Persona:`}),(0,P.jsx)(`span`,{style:{opacity:.7,fontStyle:`italic`},children:u.length>160?`${u.slice(0,160)}…`:u})]}),(0,P.jsxs)(`div`,{className:J.chatBody,children:[re?(0,P.jsxs)(`div`,{className:J.daemonStartPanel,children:[(0,P.jsx)(Vn,{size:32,style:{color:`#fbbf24`,opacity:.8}}),(0,P.jsx)(`div`,{className:J.daemonStartTitle,children:`Router daemon is not running`}),(0,P.jsx)(`div`,{className:J.daemonStartHint,children:`The playground routes your chats through the FCM router daemon. Start it to begin chatting with free coding models, or pick a specific model above.`}),(0,P.jsx)(`button`,{className:J.daemonStartBtn,onClick:ee,title:`Start the router daemon`,children:m?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Tr,{size:14,className:J.spin}),` Starting…`]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ar,{size:14}),` Start Router`,g>0&&!x.current?` (auto in ${g}s)`:``]})}),(0,P.jsxs)(`div`,{className:J.daemonStartAlt,children:[`Or run `,(0,P.jsx)(`code`,{children:`free-coding-models --daemon-bg`}),` in your terminal`]})]}):ie?(0,P.jsxs)(`div`,{className:J.daemonStartPanel,children:[(0,P.jsx)(Tr,{size:32,className:J.spin,style:{color:`var(--accent, #22c55e)`}}),(0,P.jsx)(`div`,{className:J.daemonStartTitle,children:`Starting router daemon…`}),(0,P.jsx)(`div`,{className:J.daemonStartHint,children:`The daemon is being launched. This usually takes a few seconds. You'll be able to chat as soon as it's ready.`})]}):null,ae&&(0,P.jsx)(Zs,{ref:w,model:i||`fcm`,variant:`full`,stream:o,disabled:!te,onTurnComplete:E,suggestions:El,emptyTitle:`Try the FCM router in 10 seconds`,emptyHint:`Each request is auto-routed to the healthiest free coding model in your active set, or sent directly to the model you picked. Every reply shows the served model, latency, and TPS below it.`,emptyIcon:(0,P.jsx)(Or,{size:42,style:{opacity:.5}}),placeholder:`Ask anything. Enter to send, Shift+Enter for a newline.`})]})]})})}function kl(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!0),i=(0,v.useCallback)(async()=>{r(!0);try{t((await(await fetch(`/api/installed-models`)).json()).results||[])}catch{t([])}finally{r(!1)}},[]);return(0,v.useEffect)(()=>{i()},[i]),{results:e,loading:n,refresh:i,disableModel:(0,v.useCallback)(async(e,t)=>{let n=await(await fetch(`/api/installed-models/${encodeURIComponent(e)}/${encodeURIComponent(t)}/disable`,{method:`POST`})).json();return n.success&&await i(),n},[i])}}var Al={overlay:`_overlay_rvjv7_1`,modal:`_modal_rvjv7_10`,header:`_header_rvjv7_24`,title:`_title_rvjv7_32`,count:`_count_rvjv7_42`,headerActions:`_headerActions_rvjv7_51`,refreshBtn:`_refreshBtn_rvjv7_57`,closeBtn:`_closeBtn_rvjv7_71`,body:`_body_rvjv7_82`,empty:`_empty_rvjv7_88`,hint:`_hint_rvjv7_96`,toolGroup:`_toolGroup_rvjv7_102`,toolHeader:`_toolHeader_rvjv7_106`,toolEmoji:`_toolEmoji_rvjv7_113`,toolLabel:`_toolLabel_rvjv7_117`,toolCount:`_toolCount_rvjv7_123`,toolMissing:`_toolMissing_rvjv7_128`,modelList:`_modelList_rvjv7_139`,modelRow:`_modelRow_rvjv7_146`,modelIcon:`_modelIcon_rvjv7_157`,modelName:`_modelName_rvjv7_161`,modelTier:`_modelTier_rvjv7_166`,modelId:`_modelId_rvjv7_175`,disableBtn:`_disableBtn_rvjv7_185`,fadeIn:`_fadeIn_rvjv7_1`};function jl({onClose:e,onToast:t}){let{results:n,loading:r,refresh:i,disableModel:a}=kl(),o=async(e,n)=>{try{let r=await a(e,n);r.success?t?.(`Disabled ${n} in ${e}.`,`success`):t?.(`Failed: ${r.error||`unknown error`}`,`error`)}catch(e){t?.(`Error: ${e.message}`,`error`)}},s=n.reduce((e,t)=>e+t.models.length,0);return(0,P.jsx)(`div`,{className:Al.overlay,onClick:t=>t.target===t.currentTarget&&e(),children:(0,P.jsxs)(`div`,{className:Al.modal,children:[(0,P.jsxs)(`div`,{className:Al.header,children:[(0,P.jsxs)(`h2`,{className:Al.title,children:[(0,P.jsx)(_r,{size:20,stroke:1.5}),`Installed Models`,!r&&(0,P.jsx)(`span`,{className:Al.count,children:s})]}),(0,P.jsxs)(`div`,{className:Al.headerActions,children:[(0,P.jsx)(`button`,{className:Al.refreshBtn,onClick:i,title:`Refresh`,children:(0,P.jsx)(Ir,{size:14})}),(0,P.jsx)(`button`,{className:Al.closeBtn,onClick:e,"aria-label":`Close`,children:`✕`})]})]}),(0,P.jsxs)(`div`,{className:Al.body,children:[r&&(0,P.jsx)(`div`,{className:Al.empty,children:`Scanning tool configs…`}),!r&&s===0&&(0,P.jsxs)(`div`,{className:Al.empty,children:[`No models found in tool configs.`,(0,P.jsx)(`br`,{}),(0,P.jsx)(`span`,{className:Al.hint,children:`Use "Install Endpoints" to configure models for your tools.`})]}),!r&&n.map(e=>(0,P.jsxs)(`div`,{className:Al.toolGroup,children:[(0,P.jsxs)(`div`,{className:Al.toolHeader,children:[(0,P.jsx)(`span`,{className:Al.toolEmoji,children:e.toolEmoji}),(0,P.jsx)(`span`,{className:Al.toolLabel,children:e.toolLabel}),(0,P.jsxs)(`span`,{className:Al.toolCount,children:[e.models.length,` model`,e.models.length===1?``:`s`]}),!e.isValid&&(0,P.jsx)(`span`,{className:Al.toolMissing,children:`Not installed`})]}),e.models.length>0&&(0,P.jsx)(`div`,{className:Al.modelList,children:e.models.map(t=>(0,P.jsxs)(`div`,{className:Al.modelRow,children:[(0,P.jsx)(`span`,{className:Al.modelIcon,children:t.isExternal?`🔗`:`✅`}),(0,P.jsx)(`span`,{className:Al.modelName,children:t.label}),t.tier&&t.tier!==`-`&&(0,P.jsx)(`span`,{className:Al.modelTier,children:t.tier}),(0,P.jsx)(`span`,{className:Al.modelId,title:t.modelId,children:t.modelId}),(0,P.jsx)(`button`,{className:Al.disableBtn,onClick:()=>o(e.toolMode,t.modelId),title:`Remove model from config (backup saved)`,children:(0,P.jsx)(Gr,{size:12})})]},`${e.toolMode}-${t.modelId}`))})]},e.toolMode))]})]})})}var Y={overlay:`_overlay_1nrgq_1`,modal:`_modal_1nrgq_10`,header:`_header_1nrgq_24`,title:`_title_1nrgq_32`,closeBtn:`_closeBtn_1nrgq_42`,steps:`_steps_1nrgq_54`,step:`_step_1nrgq_54`,stepActive:`_stepActive_1nrgq_71`,stepDone:`_stepDone_1nrgq_76`,stepNum:`_stepNum_1nrgq_80`,stepLabel:`_stepLabel_1nrgq_105`,body:`_body_1nrgq_111`,stepContent:`_stepContent_1nrgq_118`,stepDesc:`_stepDesc_1nrgq_120`,loading:`_loading_1nrgq_126`,empty:`_empty_1nrgq_126`,grid:`_grid_1nrgq_134`,pickCard:`_pickCard_1nrgq_140`,pickActive:`_pickActive_1nrgq_156`,pickEmoji:`_pickEmoji_1nrgq_162`,pickLabel:`_pickLabel_1nrgq_166`,pickMeta:`_pickMeta_1nrgq_171`,scopeToggle:`_scopeToggle_1nrgq_177`,scopeBtn:`_scopeBtn_1nrgq_183`,scopeActive:`_scopeActive_1nrgq_194`,modelGrid:`_modelGrid_1nrgq_202`,modelCard:`_modelCard_1nrgq_210`,modelSelected:`_modelSelected_1nrgq_224`,modelName:`_modelName_1nrgq_230`,modelTier:`_modelTier_1nrgq_236`,allNotice:`_allNotice_1nrgq_247`,installingState:`_installingState_1nrgq_255`,installingLabel:`_installingLabel_1nrgq_265`,installingSub:`_installingSub_1nrgq_271`,spinner:`_spinner_1nrgq_276`,spin:`_spin_1nrgq_276`,doneState:`_doneState_1nrgq_280`,doneFadeIn:`_doneFadeIn_1nrgq_1`,doneTitle:`_doneTitle_1nrgq_290`,doneSub:`_doneSub_1nrgq_296`,checkCircle:`_checkCircle_1nrgq_308`,checkPop:`_checkPop_1nrgq_1`,errorDot:`_errorDot_1nrgq_320`,installPath:`_installPath_1nrgq_334`,footer:`_footer_1nrgq_363`,backBtn:`_backBtn_1nrgq_370`,nextBtn:`_nextBtn_1nrgq_384`,doneBtn:`_doneBtn_1nrgq_401`,donePop:`_donePop_1nrgq_1`,fadeIn:`_fadeIn_1nrgq_1`},Ml=[`Provider`,`Tool`,`Models`,`Install`];function Nl({onClose:e,onToast:t}){let[n,r]=(0,v.useState)(0),[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)([]),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)([]),[m,h]=(0,v.useState)(`all`),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(!0),C=[{id:`opencode`,label:`OpenCode CLI`,emoji:`💻`},{id:`opencode-desktop`,label:`OpenCode Desktop`,emoji:`🖥️`},{id:`openclaw`,label:`OpenClaw`,emoji:`🦞`},{id:`crush`,label:`Crush`,emoji:`💘`},{id:`goose`,label:`Goose`,emoji:`🪿`},{id:`pi`,label:`Pi`,emoji:`π`},{id:`aider`,label:`Aider`,emoji:`🛠`},{id:`qwen`,label:`Qwen`,emoji:`🐉`},{id:`openhands`,label:`OpenHands`,emoji:`🤲`},{id:`amp`,label:`Amp`,emoji:`⚡`},{id:`forgecode`,label:`ForgeCode`,emoji:`🔥`},{id:`zcode`,label:`ZCode`,emoji:`🧊`},{id:`fcm_router`,label:`FCM Router`,emoji:`🔄`}];(0,v.useEffect)(()=>{fetch(`/api/install-endpoints/providers`).then(e=>e.json()).then(e=>{a(e.providers||[]),S(!1)}).catch(()=>S(!1))},[]),(0,v.useEffect)(()=>{o&&fetch(`/api/install-endpoints/catalog?provider=${o.providerKey}`).then(e=>e.json()).then(e=>l(e.models||[])).catch(()=>l([]))},[o]);let w=(0,v.useCallback)(e=>{p(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),ee=(0,v.useCallback)(()=>{p(c.map(e=>e.modelId)),h(`all`)},[c]);(0,v.useCallback)(()=>{p([]),h(`selected`)},[]);let T=()=>n===0?!!o:n===1?!!u:n===2?m===`all`||f.length>0:!0,E=async()=>{r(3),_(!0),b(null);try{let e=await(await fetch(`/api/install-endpoints/wizard`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({providerKey:o.providerKey,toolMode:u,scope:m,modelIds:m===`selected`?f:[]})})).json();e.success?(b(e),t?.(`Installed ${e.modelCount} models for ${o.label} into ${C.find(e=>e.id===u)?.label||u}.`,`success`)):(b(null),t?.(`Install failed: ${e.error||`unknown`}`,`error`),r(2))}catch(e){b(null),t?.(`Install error: ${e.message}`,`error`),r(2)}finally{_(!1)}};return(0,P.jsx)(`div`,{className:Y.overlay,onClick:t=>t.target===t.currentTarget&&e(),children:(0,P.jsxs)(`div`,{className:Y.modal,children:[(0,P.jsxs)(`div`,{className:Y.header,children:[(0,P.jsxs)(`h2`,{className:Y.title,children:[(0,P.jsx)(Nr,{size:20,stroke:1.5}),`Install Endpoints`]}),(0,P.jsx)(`button`,{className:Y.closeBtn,onClick:e,"aria-label":`Close`,children:`✕`})]}),(0,P.jsx)(`div`,{className:Y.steps,children:Ml.map((e,t)=>(0,P.jsxs)(`div`,{className:`${Y.step} ${t===n?Y.stepActive:t<n?Y.stepDone:``}`,children:[(0,P.jsx)(`span`,{className:Y.stepNum,children:t<n?(0,P.jsx)(Yn,{size:12}):t+1}),(0,P.jsx)(`span`,{className:Y.stepLabel,children:e})]},t))}),(0,P.jsxs)(`div`,{className:Y.body,children:[n===0&&(0,P.jsxs)(`div`,{className:Y.stepContent,children:[(0,P.jsx)(`p`,{className:Y.stepDesc,children:`Choose a provider with a configured API key.`}),x&&(0,P.jsx)(`div`,{className:Y.loading,children:`Loading providers…`}),!x&&i.length===0&&(0,P.jsx)(`div`,{className:Y.empty,children:`No configured providers found. Add API keys in Settings first.`}),(0,P.jsx)(`div`,{className:Y.grid,children:i.map(e=>(0,P.jsxs)(`button`,{className:`${Y.pickCard} ${o?.providerKey===e.providerKey?Y.pickActive:``}`,onClick:()=>{s(e),r(1)},children:[(0,P.jsx)(`span`,{className:Y.pickLabel,children:e.label}),(0,P.jsxs)(`span`,{className:Y.pickMeta,children:[e.modelCount,` models`]})]},e.providerKey))})]}),n===1&&(0,P.jsxs)(`div`,{className:Y.stepContent,children:[(0,P.jsxs)(`p`,{className:Y.stepDesc,children:[`Install `,(0,P.jsx)(`strong`,{children:o?.label}),` models into which tool?`]}),(0,P.jsx)(`div`,{className:Y.grid,children:C.map(e=>(0,P.jsxs)(`button`,{className:`${Y.pickCard} ${u===e.id?Y.pickActive:``}`,onClick:()=>{d(e.id),r(2)},children:[(0,P.jsx)(`span`,{className:Y.pickEmoji,children:e.emoji}),(0,P.jsx)(`span`,{className:Y.pickLabel,children:e.label})]},e.id))})]}),n===2&&(0,P.jsxs)(`div`,{className:Y.stepContent,children:[(0,P.jsxs)(`p`,{className:Y.stepDesc,children:[`Choose models to install from `,(0,P.jsx)(`strong`,{children:o?.label}),` into `,(0,P.jsx)(`strong`,{children:C.find(e=>e.id===u)?.label}),`.`]}),(0,P.jsxs)(`div`,{className:Y.scopeToggle,children:[(0,P.jsx)(`button`,{className:`${Y.scopeBtn} ${m===`all`?Y.scopeActive:``}`,onClick:()=>{h(`all`),ee()},children:`All Models`}),(0,P.jsx)(`button`,{className:`${Y.scopeBtn} ${m===`selected`?Y.scopeActive:``}`,onClick:()=>h(`selected`),children:`Select Models`})]}),m===`selected`&&(0,P.jsx)(`div`,{className:Y.modelGrid,children:c.map(e=>(0,P.jsxs)(`button`,{className:`${Y.modelCard} ${f.includes(e.modelId)?Y.modelSelected:``}`,onClick:()=>w(e.modelId),children:[(0,P.jsx)(`span`,{className:Y.modelName,children:e.label}),(0,P.jsx)(`span`,{className:Y.modelTier,children:e.tier})]},e.modelId))}),m===`all`&&(0,P.jsxs)(`div`,{className:Y.allNotice,children:[`All `,c.length,` models from `,o?.label,` will be installed.`]})]}),n===3&&(0,P.jsxs)(`div`,{className:Y.stepContent,children:[g&&(0,P.jsxs)(`div`,{className:Y.installingState,children:[(0,P.jsx)(Tr,{size:32,className:Y.spinner}),(0,P.jsxs)(`span`,{className:Y.installingLabel,children:[`Installing `,m===`all`?`all`:f.length,` model`,m===`all`&&c.length!==1?`s`:f.length===1?``:`s`,`…`]}),(0,P.jsxs)(`span`,{className:Y.installingSub,children:[`Writing config for `,C.find(e=>e.id===u)?.label]})]}),!g&&y&&(0,P.jsxs)(`div`,{className:Y.doneState,children:[(0,P.jsx)(`div`,{className:Y.checkCircle,children:(0,P.jsx)(Yn,{size:36})}),(0,P.jsx)(`h3`,{className:Y.doneTitle,children:`Installed!`}),(0,P.jsxs)(`p`,{className:Y.doneSub,children:[y.modelCount,` model`,y.modelCount===1?``:`s`,` from `,(0,P.jsx)(`strong`,{children:o?.label}),` → `,(0,P.jsx)(`strong`,{children:y.toolLabel})]}),(0,P.jsx)(`code`,{className:Y.installPath,children:y.path})]}),!g&&!y&&(0,P.jsxs)(`div`,{className:Y.doneState,children:[(0,P.jsx)(`span`,{className:Y.errorDot,children:`✕`}),(0,P.jsx)(`h3`,{className:Y.doneTitle,children:`Install failed`}),(0,P.jsx)(`p`,{className:Y.doneSub,children:`Check the toast for details. You can go back and retry.`})]})]})]}),(0,P.jsxs)(`div`,{className:Y.footer,children:[n>0&&n<3&&(0,P.jsxs)(`button`,{className:Y.backBtn,onClick:()=>{r(e=>Math.max(e-1,0))},children:[(0,P.jsx)(Qn,{size:14}),`Back`]}),n===3&&!g&&!y&&(0,P.jsxs)(`button`,{className:Y.backBtn,onClick:()=>r(2),children:[(0,P.jsx)(Qn,{size:14}),`Back`]}),n<3&&(0,P.jsx)(`button`,{className:Y.nextBtn,onClick:()=>{if(n===2){E();return}r(e=>Math.min(e+1,3))},disabled:!T(),children:n===2?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Nr,{size:14}),`Install`]}):(0,P.jsxs)(P.Fragment,{children:[`Next`,(0,P.jsx)($n,{size:14})]})}),n===3&&!g&&y&&(0,P.jsxs)(`button`,{className:Y.doneBtn,onClick:e,children:[(0,P.jsx)(Yn,{size:14}),`Done`]})]})]})})}var Pl={container:`_container_18l8h_1`},X={toast:`_toast_73ezc_1`,slideIn:`_slideIn_73ezc_1`,success:`_success_73ezc_17`,error:`_error_73ezc_18`,warning:`_warning_73ezc_19`,info:`_info_73ezc_20`,icon:`_icon_73ezc_27`,message:`_message_73ezc_28`,close:`_close_73ezc_29`,exiting:`_exiting_73ezc_38`,slideOut:`_slideOut_73ezc_1`},Fl={success:`✅`,error:`❌`,warning:`⚠️`,info:`ℹ️`};function Z({message:e,type:t=`info`,duration:n=3500,onDismiss:r}){let i=(0,v.useRef)(null);return(0,v.useEffect)(()=>(i.current=setTimeout(r,n),()=>clearTimeout(i.current)),[n,r]),(0,P.jsxs)(`div`,{className:`${X.toast} ${X[t]}`,children:[(0,P.jsx)(`span`,{className:X.icon,children:Fl[t]||`📌`}),(0,P.jsx)(`span`,{className:X.message,children:e}),(0,P.jsx)(`button`,{className:X.close,onClick:r,children:`×`})]})}function Q({toasts:e,dismissToast:t}){return(0,P.jsx)(`div`,{className:Pl.container,children:e.map(e=>(0,P.jsx)(Z,{message:e.message,type:e.type,onDismiss:()=>t(e.id)},e.id))})}var Il=0;function Ll(){let{models:e,connected:t,nextPingAt:n,isPinging:r,pingMode:i,globalBenchmarkRunning:a,globalBenchmarkTotal:o,globalBenchmarkCompleted:s}=It(),{theme:c,cycle:l}=dn(),[u,d]=(0,v.useState)(`dashboard`),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(null),[C,w]=(0,v.useState)([]),ee=(0,v.useRef)(Date.now());(0,v.useEffect)(()=>{try{typeof window<`u`&&window.posthog?.capture&&window.posthog.capture(`app_web_start`,{version:`0.5.39`,timestamp:new Date().toISOString()})}catch{}},[]),(0,v.useEffect)(()=>{if(u===`router`)try{typeof window<`u`&&window.posthog?.capture&&window.posthog.capture(`app_router_start`,{version:`0.5.39`,timestamp:new Date().toISOString()})}catch{}},[u]);let T=(0,v.useCallback)((e,t=`info`)=>{let n=++Il;w(r=>[...r,{id:n,message:e,type:t}]),setTimeout(()=>{w(e=>e.filter(e=>e.id!==n))},4e3)},[]),E=(0,v.useCallback)(e=>{w(t=>t.filter(t=>t.id!==e))},[]),{filtered:D,filterTier:te,setFilterTier:ne,filterStatus:re,setFilterStatus:ie,filterProvider:ae,setFilterProvider:oe,filterVerdict:se,setFilterVerdict:O,filterHealth:k,setFilterHealth:ce,visibilityMode:le,setVisibilityMode:ue,searchQuery:A,setSearchQuery:de,customTextFilter:fe,setCustomTextFilter:pe,sortColumn:me,sortDirection:he,setSortColumn:ge,setSortDirection:_e,toggleSort:ve,resetView:ye}=sn(e),{toolMode:j,setToolMode:be,cycleToolMode:xe}=_n({onToast:T});Pn({currentView:u,setCurrentView:d,filterState:{filterTier:te,setFilterTier:ne,filterStatus:re,setFilterStatus:ie,filterProvider:ae,setFilterProvider:oe,filterVerdict:se,setFilterVerdict:O,filterHealth:k,setFilterHealth:ce,sortColumn:me,sortDirection:he,setSortColumn:ge,setSortDirection:_e,toggleSort:ve,setSearchQuery:de,filterState:null,searchQuery:A},paletteOpen:g,setPaletteOpen:_,toolMode:j,setToolMode:be});let Se=pn({models:e}),Ce=(0,v.useCallback)(async(e,t=null)=>{let n=t||j||`opencode`;if(e){if(!Cn(e.providerKey,n)){S({model:e,toolMode:n});return}try{let t=await fetch(`/api/install-endpoint`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({providerKey:e.providerKey,modelId:e.modelId,toolMode:n})}),r=await t.json().catch(()=>({}));if(t.status===422&&r.code===`incompatible_model`){S({model:e,toolMode:n});return}if(!t.ok)throw Error(r.error||`HTTP ${t.status}`);T(`Endpoint installed for ${e.label} in ${n}. Start the tool yourself.`,`success`)}catch(e){T(`Endpoint install failed: ${e.message}`,`error`)}}},[T,j]),we=(0,v.useCallback)(async(e,t)=>{await be(e),S(null),await Ce(t,e)},[Ce,be]),Te=(0,v.useCallback)(async e=>{Se.isFavorite(e)||await Se.toggle(e),await Ce(e)},[Se,Ce]),{localVersion:Ee,latestVersion:De,updateAvailable:Oe,runUpdate:ke,checkNow:Ae,error:je}=Ln({onToast:T}),Me=(0,v.useMemo)(()=>{let t={};return e.forEach(e=>{t[e.providerKey]||(t[e.providerKey]={key:e.providerKey,name:e.origin,count:0,hasKey:!1,anyUp:!1}),t[e.providerKey].count++,e.hasApiKey&&(t[e.providerKey].hasKey=!0),e.status===`up`&&(t[e.providerKey].anyUp=!0)}),Object.values(t).sort((e,t)=>e.name.localeCompare(t.name))},[e]),Ne=(0,v.useCallback)(async()=>{if(!a)try{await fetch(`/api/global-benchmark`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({models:D.map(e=>({providerKey:e.providerKey,modelId:e.modelId}))})})}catch(e){console.error(`[Benchmark] Failed to start global benchmark:`,e.message)}},[D,a]),Pe=(0,v.useCallback)(async e=>{try{let t=await fetch(`/api/benchmark`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({providerKey:e.providerKey,modelId:e.modelId})});!t.ok&&t.status!==202&&T(`Benchmark failed: ${(await t.json().catch(()=>({})))?.error||t.statusText}`,`error`)}catch(e){console.error(`[Benchmark] per-row failed:`,e.message)}},[T]),Fe=(0,v.useCallback)(e=>{p(e),ee.current=Date.now()},[]);(0,v.useCallback)(()=>p(null),[]);let Ie=(0,v.useCallback)(async e=>{try{await fetch(`/api/ping-mode?action=${e}`,{method:`POST`})}catch{}},[]),Le=(0,v.useCallback)(e=>{e===`changelog`&&b(null),d(e),ee.current=Date.now()},[]),Re=(0,v.useCallback)(()=>{ye(),de(``),T(`View reset to defaults.`,`info`)},[T,ye,de]),ze=(0,v.useCallback)(e=>{b(e),d(`changelog`)},[]);return(0,v.useEffect)(()=>{let e=e=>{let t=e.metaKey||e.ctrlKey;if(t&&(e.key===`k`||e.key===`K`)){e.preventDefault(),_(e=>!e);return}if(t&&(e.key===`p`||e.key===`P`)&&!e.shiftKey){e.preventDefault(),_(e=>!e);return}if(e.key===`Escape`){if(g){_(!1);return}if(x){S(null);return}if(f){p(null);return}if(m){h(!1);return}}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g,x,f,m]),(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`app-shell`,children:[(0,P.jsx)(ii,{searchQuery:A,onSearchChange:de,currentView:u,onNavigate:Le,onToggleTheme:l,onOpenExport:()=>h(!0),onOpenCommandPalette:()=>_(!0),onBenchmark:Ne,benchmarkRunning:a,benchmarkTotal:o,benchmarkCompleted:s,modelsCount:D.length,theme:c,onToast:T,toolMode:j,onSetToolMode:be,onCycleToolMode:xe,updateSlot:(0,P.jsx)(ol,{updateAvailable:Oe,latestVersion:De,onRunUpdate:ke,onOpenChangelog:ze})}),(0,P.jsxs)(`div`,{className:`app-content`,children:[u===`dashboard`&&(0,P.jsxs)(`main`,{className:`view dashboardView`,children:[(0,P.jsx)(sa,{filterTier:te,setFilterTier:ne,filterStatus:re,setFilterStatus:ie,filterProvider:ae,setFilterProvider:oe,filterVerdict:se,setFilterVerdict:O,filterHealth:k,setFilterHealth:ce,visibilityMode:le,setVisibilityMode:ue,customTextFilter:fe,setCustomTextFilter:pe,searchQuery:A,onSearchChange:de,onResetView:Re,providers:Me,pingMode:i,setPingMode:Ie,nextPingAt:n,isPinging:r,globalBenchmarkRunning:a,globalBenchmarkTotal:o,globalBenchmarkCompleted:s,toolMode:j}),(0,P.jsx)(vc,{filtered:D,onSelectModel:Fe,onBenchmarkRow:Pe,onLaunch:Ce,favorites:Se,sortColumn:me,sortDirection:he,onSort:ve,toolMode:j,onToast:T,onSetToolMode:be,onCycleToolMode:xe,onOpenFallback:e=>S({model:e,toolMode:j})})]}),u===`settings`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(Cc,{onToast:T,onOpenChangelog:e=>{b(e),Le(`changelog`)},onCheckForUpdate:()=>{Ae(),T?.(`Checking for updates…`,`info`)}})}),u===`analytics`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(Nc,{models:e})}),u===`router`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(wl,{onClose:()=>Le(`dashboard`),onToast:T,favorites:Se})}),u===`playground`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(Ol,{onClose:()=>Le(`dashboard`),onToast:T,models:e,routerStatus:null})}),u===`help`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)($c,{onClose:()=>Le(`dashboard`)})}),u===`changelog`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(rl,{onClose:()=>Le(`dashboard`),defaultVersion:y})}),u===`installed-models`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(jl,{onClose:()=>Le(`dashboard`),onToast:T})}),u===`install-endpoints`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(Nl,{onClose:()=>Le(`dashboard`),onToast:T})}),u===`recommend`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(pl,{onClose:()=>Le(`dashboard`),toolMode:j,onLaunch:Ce,onPinAndLaunch:Te,onToast:T})}),(0,P.jsx)(oi,{})]})]}),m&&(0,P.jsx)(xc,{models:D,onClose:()=>h(!1),onToast:T}),g&&(0,P.jsx)(Xc,{onClose:()=>_(!1),onNavigate:Le,onCycleTheme:l,onResetView:Re,onSetPingMode:Ie,onOpenHelp:()=>Le(`help`),onOpenChangelog:()=>{b(null),Le(`changelog`)},onOpenPlayground:()=>Le(`playground`),onExport:()=>h(!0),onRunUpdate:ke,currentView:u,theme:c,pingMode:i,models:e,updateAvailable:Oe,latestVersion:De,onToast:T}),x&&(0,P.jsx)(hl,{request:x,models:e,onClose:()=>S(null),onSwitchToolLaunch:we,onLaunchSimilar:t=>{S(null),Ce(e.find(e=>e.providerKey===t.providerKey&&e.modelId===t.modelId)||t)}}),(0,P.jsx)(Q,{toasts:C,dismissToast:E})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,P.jsx)(v.StrictMode,{children:(0,P.jsx)(Ll,{})}));
|
|
40
|
+
`);await navigator.clipboard.writeText(i),n?.(`Copied to clipboard`,`success`),t()},children:[(0,P.jsx)(`span`,{className:bc.optionIcon,children:(0,P.jsx)(rr,{size:20,stroke:1.5})}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:bc.optionLabel,children:`Copy to Clipboard`}),(0,P.jsx)(`span`,{className:bc.optionDesc,children:`Copy model summary as text`})]})]})]})})]})}):null}var W={page:`_page_1847y_1`,pageHeader:`_pageHeader_1847y_5`,pageTitle:`_pageTitle_1847y_9`,pageSubtitle:`_pageSubtitle_1847y_15`,loading:`_loading_1847y_30`,featureSection:`_featureSection_1847y_37`,sectionHeading:`_sectionHeading_1847y_44`,featureGrid:`_featureGrid_1847y_52`,featureRow:`_featureRow_1847y_57`,featureLabel:`_featureLabel_1847y_67`,featureTitle:`_featureTitle_1847y_79`,featureDesc:`_featureDesc_1847y_85`,featureActions:`_featureActions_1847y_91`,select:`_select_1847y_96`,toggleSwitch:`_toggleSwitch_1847y_110`,toggleSlider:`_toggleSlider_1847y_122`,smallBtn:`_smallBtn_1847y_148`,notice:`_notice_1847y_166`,testBadge:`_testBadge_1847y_178`,test_ok:`_test_ok_1847y_191`,test_auth_error:`_test_auth_error_1847y_192`,test_rate_limited:`_test_rate_limited_1847y_193`,test_no_callable_model:`_test_no_callable_model_1847y_194`,test_fail:`_test_fail_1847y_195`,test_missing_key:`_test_missing_key_1847y_196`,test_pending:`_test_pending_1847y_197`,testSpinner:`_testSpinner_1847y_199`,spin:`_spin_1847y_1`,toolbar:`_toolbar_1847y_210`,toolbarSearch:`_toolbarSearch_1847y_218`,toolbarActions:`_toolbarActions_1847y_250`,toolbarBtn:`_toolbarBtn_1847y_255`,providers:`_providers_1847y_276`,card:`_card_1847y_282`,cardHeader:`_cardHeader_1847y_295`,cardIcon:`_cardIcon_1847y_308`,cardInfo:`_cardInfo_1847y_320`,cardName:`_cardName_1847y_325`,cardMeta:`_cardMeta_1847y_330`,cardStatus:`_cardStatus_1847y_336`,statusConfigured:`_statusConfigured_1847y_344`,statusMissing:`_statusMissing_1847y_349`,toggleIcon:`_toggleIcon_1847y_354`,toggleIconExpanded:`_toggleIconExpanded_1847y_361`,cardBody:`_cardBody_1847y_365`,cardExpanded:`_cardExpanded_1847y_372`,cardContent:`_cardContent_1847y_377`,keyGroup:`_keyGroup_1847y_381`,keyLabel:`_keyLabel_1847y_385`,keyDisplay:`_keyDisplay_1847y_395`,keyDisplayValue:`_keyDisplayValue_1847y_406`,keyDisplayActions:`_keyDisplayActions_1847y_414`,actionBtn:`_actionBtn_1847y_420`,actionBtnDanger:`_actionBtnDanger_1847y_438`,keyInputRow:`_keyInputRow_1847y_448`,keyInput:`_keyInput_1847y_448`,saveBtn:`_saveBtn_1847y_475`,enabledRow:`_enabledRow_1847y_495`,enabledLabel:`_enabledLabel_1847y_504`},Sc={ok:{label:`OK`,icon:Xr,className:`testOk`},auth_error:{label:`Auth error`,icon:Sr,className:`testErr`},rate_limited:{label:`Rate limited`,icon:Ir,className:`testWarn`},no_callable_model:{label:`No callable model`,icon:Sr,className:`testWarn`},fail:{label:`Failed`,icon:Sr,className:`testErr`},missing_key:{label:`Missing key`,icon:Sr,className:`testNeutral`}};function Cc({onToast:e,onOpenChangelog:t,onCheckForUpdate:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(new Set),[l,u]=(0,v.useState)(new Set),[d,f]=(0,v.useState)({}),[p,m]=(0,v.useState)({}),[h,g]=(0,v.useState)(new Set),[_,y]=(0,v.useState)(null),b=(0,v.useCallback)(async()=>{try{i(await(await fetch(`/api/config`)).json())}catch{e?.(`Failed to load settings`,`error`)}},[e]);(0,v.useEffect)(()=>{b()},[b]);let x=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},S=()=>{r&&c(new Set(Object.keys(r.providers)))},C=()=>c(new Set),w=async t=>{if(l.has(t)){u(e=>{let n=new Set(e);return n.delete(t),n});return}try{(await(await fetch(`/api/key/${t}`)).json()).key&&u(e=>new Set(e).add(t))}catch{e?.(`Failed to reveal key`,`error`)}},ee=async t=>{try{let n=await(await fetch(`/api/key/${t}`)).json();n.key?(await navigator.clipboard.writeText(n.key),e?.(`API key copied to clipboard`,`success`)):e?.(`No key to copy`,`warning`)}catch{e?.(`Failed to copy key`,`error`)}},T=async t=>{let n=d[t]?.trim();if(!n){e?.(`Please enter an API key`,`warning`);return}try{let r=await(await fetch(`/api/settings`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({apiKeys:{[t]:n}})})).json();r.success?(e?.(`API key for ${t} saved successfully!`,`success`),f(e=>({...e,[t]:``})),u(e=>{let n=new Set(e);return n.delete(t),n}),await b(),c(e=>new Set(e).add(t))):e?.(r.error||`Failed to save`,`error`)}catch{e?.(`Network error while saving`,`error`)}},E=async t=>{if(confirm(`Are you sure you want to delete the API key for "${t}"?`))try{let n=await(await fetch(`/api/settings`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({apiKeys:{[t]:``}})})).json();n.success?(e?.(`API key for ${t} deleted`,`info`),u(e=>{let n=new Set(e);return n.delete(t),n}),await b()):e?.(n.error||`Failed to delete`,`error`)}catch{e?.(`Network error while deleting`,`error`)}},D=async(t,n)=>{try{let r=await(await fetch(`/api/settings`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({providers:{[t]:{enabled:n}}})})).json();r.success?e?.(`${t} ${n?`enabled`:`disabled`}`,`success`):e?.(r.error||`Failed to toggle`,`error`)}catch{e?.(`Network error`,`error`)}},te=(0,v.useCallback)(async t=>{if(!h.has(t)){g(e=>new Set(e).add(t)),m(e=>({...e,[t]:{outcome:`pending`}}));try{let n=await fetch(`/api/key/${encodeURIComponent(t)}/test`,{method:`POST`}),r=await n.json().catch(()=>({}));if(n.ok){m(e=>({...e,[t]:r}));let n=Sc[r.outcome]||Sc.fail;e?.(`${t} test: ${n.label}${r.code?` (HTTP ${r.code})`:``}`,r.outcome===`ok`?`success`:`info`)}else m(e=>({...e,[t]:{outcome:`fail`,detail:r.error||`HTTP `+n.status}})),e?.(`${t} test failed: ${r.error||n.statusText}`,`error`)}catch(n){m(e=>({...e,[t]:{outcome:`fail`,detail:n.message}})),e?.(`${t} test failed: ${n.message}`,`error`)}finally{g(e=>{let n=new Set(e);return n.delete(t),n})}}},[h,e]),ne=(0,v.useCallback)(async(t,n)=>{try{let r=await(await fetch(`/api/settings/feature`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n===void 0?{feature:t}:{feature:t,value:n})})).json();r.success?(await b(),e?.(`${t} updated`,`success`)):e?.(r.error||`Failed to update feature`,`error`)}catch{e?.(`Network error`,`error`)}},[e]),re=(0,v.useCallback)(async t=>{try{let n=await(await fetch(`/api/shell-env/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:t})})).json();n.success?(await b(),e?.(`Shell env export ${n.enabled?`enabled`:`disabled`} — restart your shell to apply.`,`success`)):e?.(n.error||`Failed to toggle shell env`,`error`)}catch{e?.(`Network error`,`error`)}},[e]),ie=(0,v.useCallback)(async()=>{if(confirm(`Remove discontinued proxy config leftovers? This is safe to run.`))try{let t=await(await fetch(`/api/legacy-cleanup`,{method:`POST`})).json(),n=(t.removedFiles?.length||0)+(t.updatedFiles?.length||0);t.changed?(y(`Cleaned ${n} legacy file(s). ${t.errors.length} error(s).`),e?.(`Legacy proxy cleanup: ${n} file(s) cleaned.`,`success`)):(y(`No discontinued proxy config was found. You are on the stable direct-provider setup.`),e?.(`No legacy proxy config found — already on stable setup.`,`info`)),await b()}catch(t){e?.(`Legacy cleanup failed: ${t.message}`,`error`)}},[e]),ae=(0,v.useCallback)(()=>{n?.()},[n]);if(!r)return(0,P.jsx)(`div`,{className:W.page,children:(0,P.jsx)(`div`,{className:W.loading,children:`Loading settings...`})});let oe=Object.entries(r.providers).filter(([,e])=>{if(!a)return!0;let t=a.toLowerCase();return`${e.name} ${e.displayName||``} ${e.billingNote||``}`.toLowerCase().includes(t)}).sort((e,t)=>e[1].name.localeCompare(t[1].name));return(0,P.jsxs)(`div`,{className:W.page,children:[(0,P.jsxs)(`div`,{className:W.pageHeader,children:[(0,P.jsxs)(`h1`,{className:W.pageTitle,children:[(0,P.jsx)(Br,{size:24,stroke:1.5,style:{marginRight:8,verticalAlign:`middle`}}),`Settings`]}),(0,P.jsxs)(`p`,{className:W.pageSubtitle,children:[`API keys, theme, favorites mode, shell env, and update controls. All settings are stored locally in `,(0,P.jsx)(`code`,{children:`~/.free-coding-models.json`}),`and shared with the TUI.`]})]}),r&&(0,P.jsxs)(`section`,{className:W.featureSection,children:[(0,P.jsx)(`h2`,{className:W.sectionHeading,children:`⚙️ Global settings`}),(0,P.jsxs)(`div`,{className:W.featureGrid,children:[(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(Ur,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Theme`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`Tri-state cycle. Auto follows your OS.`})]})]}),(0,P.jsxs)(`select`,{className:W.select,value:r.settings?.theme||`auto`,onChange:e=>ne(`theme`,e.target.value),children:[(0,P.jsx)(`option`,{value:`auto`,children:`Auto (OS)`}),(0,P.jsx)(`option`,{value:`dark`,children:`Dark`}),(0,P.jsx)(`option`,{value:`light`,children:`Light`})]})]}),(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(Hr,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Favorites pinned + always visible`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`Favorites bypass filters and stay on top (TUI: Y key).`})]})]}),(0,P.jsxs)(`label`,{className:W.toggleSwitch,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:!!r.settings?.favoritesPinnedAndSticky,onChange:e=>ne(`favoritesPinnedAndSticky`,e.target.checked)}),(0,P.jsx)(`span`,{className:W.toggleSlider})]})]}),(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(qn,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Run AI Speed Test on startup`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`Auto-fire the global benchmark right after launch (TUI: U → 'Enable').`})]})]}),(0,P.jsxs)(`label`,{className:W.toggleSwitch,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:!!r.settings?.runAiSpeedTestOnStartup,onChange:e=>ne(`runAiSpeedTestOnStartup`,e.target.checked)}),(0,P.jsx)(`span`,{className:W.toggleSlider})]})]}),(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(tr,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Export API keys to shell rc`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`Write NVIDIA_API_KEY / GROQ_API_KEY / … to your shell rc file.`})]})]}),(0,P.jsxs)(`label`,{className:W.toggleSwitch,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:!!r.settings?.shellEnvEnabled,onChange:e=>re(e.target.checked)}),(0,P.jsx)(`span`,{className:W.toggleSlider})]})]}),(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(lr,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Check for updates`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`The header chip turns green when a newer npm version is available. Use the 'Update now' button to install.`})]})]}),(0,P.jsxs)(`div`,{className:W.featureActions,children:[(0,P.jsx)(`button`,{className:W.smallBtn,onClick:ae,children:`Check now`}),(0,P.jsxs)(`button`,{className:W.smallBtn,onClick:()=>t?.(null),children:[(0,P.jsx)(yr,{size:13,stroke:1.5}),` Changelog`]})]})]}),(0,P.jsxs)(`div`,{className:W.featureRow,children:[(0,P.jsxs)(`div`,{className:W.featureLabel,children:[(0,P.jsx)(Ir,{size:16,stroke:1.5}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:W.featureTitle,children:`Cleanup discontinued proxy artifacts`}),(0,P.jsx)(`div`,{className:W.featureDesc,children:`Remove old config / env / service leftovers from the old multi-tool proxy.`})]})]}),(0,P.jsx)(`button`,{className:W.smallBtn,onClick:ie,children:`Run cleanup`})]})]}),_&&(0,P.jsx)(`div`,{className:W.notice,children:_})]}),(0,P.jsxs)(`div`,{className:W.toolbar,children:[(0,P.jsxs)(`div`,{className:W.toolbarSearch,children:[(0,P.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,P.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,P.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,P.jsx)(`input`,{type:`text`,placeholder:`Search providers...`,value:a,onChange:e=>o(e.target.value),autoComplete:`off`})]}),(0,P.jsxs)(`div`,{className:W.toolbarActions,children:[(0,P.jsx)(`button`,{className:W.toolbarBtn,onClick:S,children:`Expand All`}),(0,P.jsx)(`button`,{className:W.toolbarBtn,onClick:C,children:`Collapse All`})]})]}),(0,P.jsx)(`div`,{className:W.providers,children:oe.map(([e,t])=>{let n=s.has(e),r=l.has(e);return(0,P.jsxs)(`div`,{className:`${W.card} ${n?W.cardExpanded:``}`,children:[(0,P.jsxs)(`div`,{className:W.cardHeader,onClick:()=>x(e),children:[(0,P.jsx)(`div`,{className:W.cardIcon,children:(0,P.jsx)(Nr,{size:20,stroke:1.5})}),(0,P.jsxs)(`div`,{className:W.cardInfo,children:[(0,P.jsx)(`div`,{className:W.cardName,children:t.displayName||t.name}),(0,P.jsxs)(`div`,{className:W.cardMeta,children:[t.modelCount,` models · `,e,t.billingNote?` · ${t.billingNote}`:``]})]}),(0,P.jsx)(`span`,{className:`${W.cardStatus} ${t.hasKey?W.statusConfigured:W.statusMissing}`,children:t.hasKey?(0,P.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,P.jsx)(tr,{size:14,stroke:1.5}),` Active`]}):(0,P.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,P.jsx)(Sr,{size:14,stroke:1.5}),` No Key`]})}),(0,P.jsx)(`span`,{className:`${W.toggleIcon} ${n?W.toggleIconExpanded:``}`,children:`▼`})]}),(0,P.jsx)(`div`,{className:W.cardBody,children:(0,P.jsxs)(`div`,{className:W.cardContent,children:[t.hasKey&&p[e]&&(0,P.jsx)(`div`,{className:`${W.testBadge} ${W[`test_${p[e].outcome}`]||``}`,children:(()=>{let t=Sc[p[e].outcome]||Sc.fail,n=t.icon;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(n,{size:12,stroke:1.5}),(0,P.jsxs)(`span`,{children:[`Last test: `,t.label,p[e].code?` (HTTP ${p[e].code})`:``]})]})})()}),t.hasKey&&(0,P.jsxs)(`div`,{className:W.keyGroup,children:[(0,P.jsx)(`label`,{className:W.keyLabel,children:`Current API Key`}),(0,P.jsxs)(`div`,{className:W.keyDisplay,children:[(0,P.jsx)(`span`,{className:W.keyDisplayValue,children:r?t.maskedKey||`••••••••`:Kt(t.maskedKey||``)}),(0,P.jsxs)(`div`,{className:W.keyDisplayActions,children:[(0,P.jsx)(`button`,{className:W.actionBtn,onClick:()=>w(e),title:r?`Hide`:`Reveal`,children:r?(0,P.jsx)(fr,{size:14,stroke:1.5}):(0,P.jsx)(pr,{size:14,stroke:1.5})}),(0,P.jsx)(`button`,{className:W.actionBtn,onClick:()=>ee(e),title:`Copy`,children:(0,P.jsx)(sr,{size:14,stroke:1.5})}),(0,P.jsxs)(`button`,{className:W.actionBtn,onClick:()=>te(e),disabled:h.has(e),title:`Test this key against the provider (TUI: T key in Settings)`,"aria-label":`Test key for ${e}`,children:[h.has(e)?(0,P.jsx)(`span`,{className:W.testSpinner}):(0,P.jsx)(qn,{size:14,stroke:1.5}),h.has(e)?`Testing…`:`Test`]}),(0,P.jsx)(`button`,{className:`${W.actionBtn} ${W.actionBtnDanger}`,onClick:()=>E(e),title:`Delete Key`,children:(0,P.jsx)(Gr,{size:14,stroke:1.5})})]})]})]}),(0,P.jsxs)(`div`,{className:W.keyGroup,children:[(0,P.jsxs)(`label`,{className:W.keyLabel,children:[t.hasKey?`Update API Key`:`Add API Key`,t.billingNote?` 💰 ${t.billingNote}`:``]}),(0,P.jsxs)(`div`,{className:W.keyInputRow,children:[(0,P.jsx)(`input`,{type:`password`,className:W.keyInput,placeholder:`Enter your API key...`,value:d[e]||``,onChange:t=>f(n=>({...n,[e]:t.target.value})),autoComplete:`off`}),(0,P.jsx)(`button`,{className:W.saveBtn,onClick:()=>T(e),children:t.hasKey?`Update`:`Save`})]})]}),(0,P.jsxs)(`div`,{className:W.enabledRow,children:[(0,P.jsx)(`span`,{className:W.enabledLabel,children:`Provider Enabled`}),(0,P.jsxs)(`label`,{className:W.toggleSwitch,children:[(0,P.jsx)(`input`,{type:`checkbox`,defaultChecked:t.enabled!==!1,onChange:t=>D(e,t.target.checked)}),(0,P.jsx)(`span`,{className:W.toggleSlider})]})]})]})})]},e)})})]})}function wc(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!0),i=(0,v.useCallback)(async()=>{r(!0);try{t(Tc(await(await fetch(`/api/router/tokens`)).json()))}catch{t(null)}finally{r(!1)}},[]);return(0,v.useEffect)(()=>{i()},[i]),{data:e,loading:n,refresh:i}}function Tc(e){if(!e)return null;let t=e.daily||{},n=e.all_time||{},r=[],i=new Date;for(let e=6;e>=0;e--){let n=new Date(i);n.setDate(n.getDate()-e);let a=n.toISOString().slice(0,10),o=t[a]||{total_tokens:0,requests:0};r.push({date:a,label:n.toLocaleDateString(`en`,{weekday:`short`}),totalTokens:o.total_tokens||0,requests:o.requests||0})}let a={};for(let e of Object.values(t)){let t=e.by_model||{};for(let[e,n]of Object.entries(t))a[e]||(a[e]={total:0,requests:0}),a[e].total+=n.total||0,a[e].requests+=n.requests||0}let o=Object.entries(a).sort((e,t)=>t[1].total-e[1].total).slice(0,10).map(([e,t])=>({key:e,...t})),s={};for(let[e,t]of Object.entries(a)){let n=e.split(`/`)[0];s[n]||(s[n]={total:0,requests:0}),s[n].total+=t.total,s[n].requests+=t.requests}let c=Object.entries(s).sort((e,t)=>t[1].total-e[1].total).slice(0,10).map(([e,t])=>({key:e,...t})),l=t[i.toISOString().slice(0,10)]||{};return{today:{totalTokens:l.total_tokens||0,promptTokens:l.prompt_tokens||0,completionTokens:l.completion_tokens||0,requests:l.requests||0},allTime:{totalTokens:n.total_tokens||0,promptTokens:n.prompt_tokens||0,completionTokens:n.completion_tokens||0,requests:n.requests||0},sevenDays:r,topModels:o,topProviders:c,hasData:n.total_tokens>0||Object.keys(t).length>0}}var G={card:`_card_1m2zx_1`,cardTitle:`_cardTitle_1m2zx_5`,empty:`_empty_1m2zx_14`,summaryGrid:`_summaryGrid_1m2zx_22`,summaryCard:`_summaryCard_1m2zx_29`,summaryLabel:`_summaryLabel_1m2zx_39`,summaryValue:`_summaryValue_1m2zx_47`,summarySub:`_summarySub_1m2zx_53`,chart:`_chart_1m2zx_59`,chartBar:`_chartBar_1m2zx_67`,chartFill:`_chartFill_1m2zx_77`,chartLabel:`_chartLabel_1m2zx_85`,topList:`_topList_1m2zx_92`,topRow:`_topRow_1m2zx_98`,topKey:`_topKey_1m2zx_106`,topVal:`_topVal_1m2zx_115`,topReq:`_topReq_1m2zx_121`};function Ec(e){return typeof e!=`number`||!Number.isFinite(e)?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}function Dc(){let{data:e,loading:t}=wc();if(t)return(0,P.jsxs)(`div`,{className:G.card,children:[(0,P.jsx)(`h3`,{className:G.cardTitle,children:`Token Usage`}),(0,P.jsx)(`div`,{className:G.empty,children:`Loading…`})]});if(!e||!e.hasData)return(0,P.jsxs)(`div`,{className:G.card,children:[(0,P.jsx)(`h3`,{className:G.cardTitle,children:`Token Usage`}),(0,P.jsx)(`div`,{className:G.empty,children:`No token data yet. Start the router and send requests to track usage.`})]});let n=Math.max(...e.sevenDays.map(e=>e.totalTokens),1);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:G.summaryGrid,children:[(0,P.jsxs)(`div`,{className:G.summaryCard,children:[(0,P.jsx)(`span`,{className:G.summaryLabel,children:`Today`}),(0,P.jsx)(`span`,{className:G.summaryValue,children:Ec(e.today.totalTokens)}),(0,P.jsxs)(`span`,{className:G.summarySub,children:[e.today.requests,` requests`]})]}),(0,P.jsxs)(`div`,{className:G.summaryCard,children:[(0,P.jsx)(`span`,{className:G.summaryLabel,children:`All Time`}),(0,P.jsx)(`span`,{className:G.summaryValue,children:Ec(e.allTime.totalTokens)}),(0,P.jsxs)(`span`,{className:G.summarySub,children:[e.allTime.requests,` requests`]})]})]}),(0,P.jsxs)(`div`,{className:G.card,children:[(0,P.jsx)(`h3`,{className:G.cardTitle,children:`7-Day Usage`}),(0,P.jsx)(`div`,{className:G.chart,children:e.sevenDays.map(e=>(0,P.jsxs)(`div`,{className:G.chartBar,children:[(0,P.jsx)(`div`,{className:G.chartFill,style:{height:`${Math.max(2,e.totalTokens/n*100)}%`},title:`${e.date}: ${Ec(e.totalTokens)} tokens`}),(0,P.jsx)(`span`,{className:G.chartLabel,children:e.label})]},e.date))})]}),e.topModels.length>0&&(0,P.jsxs)(`div`,{className:G.card,children:[(0,P.jsx)(`h3`,{className:G.cardTitle,children:`Top Models`}),(0,P.jsx)(`div`,{className:G.topList,children:e.topModels.map(e=>(0,P.jsxs)(`div`,{className:G.topRow,children:[(0,P.jsx)(`span`,{className:G.topKey,children:e.key}),(0,P.jsxs)(`span`,{className:G.topVal,children:[Ec(e.total),` tokens`]}),(0,P.jsxs)(`span`,{className:G.topReq,children:[e.requests,` req`]})]},e.key))})]}),e.topProviders.length>0&&(0,P.jsxs)(`div`,{className:G.card,children:[(0,P.jsx)(`h3`,{className:G.cardTitle,children:`Top Providers`}),(0,P.jsx)(`div`,{className:G.topList,children:e.topProviders.map(e=>(0,P.jsxs)(`div`,{className:G.topRow,children:[(0,P.jsx)(`span`,{className:G.topKey,children:e.key}),(0,P.jsxs)(`span`,{className:G.topVal,children:[Ec(e.total),` tokens`]}),(0,P.jsxs)(`span`,{className:G.topReq,children:[e.requests,` req`]})]},e.key))})]})]})}var K={page:`_page_1n8f8_1`,pageHeader:`_pageHeader_1n8f8_5`,pageTitle:`_pageTitle_1n8f8_9`,pageSubtitle:`_pageSubtitle_1n8f8_15`,grid:`_grid_1n8f8_21`,card:`_card_1n8f8_27`,cardWide:`_cardWide_1n8f8_36`,cardTitle:`_cardTitle_1n8f8_40`,cardBody:`_cardBody_1n8f8_46`,empty:`_empty_1n8f8_49`,healthItem:`_healthItem_1n8f8_55`,healthName:`_healthName_1n8f8_67`,healthBar:`_healthBar_1n8f8_74`,healthFill:`_healthFill_1n8f8_82`,healthPct:`_healthPct_1n8f8_89`,pctFast:`_pctFast_1n8f8_97`,pctMedium:`_pctMedium_1n8f8_98`,pctSlow:`_pctSlow_1n8f8_99`,leaderItem:`_leaderItem_1n8f8_105`,leaderRank:`_leaderRank_1n8f8_117`,rank1:`_rank1_1n8f8_131`,rank2:`_rank2_1n8f8_132`,rank3:`_rank3_1n8f8_133`,leaderName:`_leaderName_1n8f8_135`,leaderLatency:`_leaderLatency_1n8f8_145`,tierItem:`_tierItem_1n8f8_153`,tierBadge:`_tierBadge_1n8f8_160`,tierBar:`_tierBar_1n8f8_165`,tierFill:`_tierFill_1n8f8_173`,tierCount:`_tierCount_1n8f8_179`};function Oc(e,t){return typeof window>`u`||!window.document?.documentElement?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}var kc={"S+":`--tier-splus`,S:`--tier-s`,"A+":`--tier-aplus`,A:`--tier-a`,"A-":`--tier-aminus`,"B+":`--tier-bplus`,B:`--tier-b`,C:`--tier-c`},Ac={"S+":`#ffd700`,S:`#ff8c00`,"A+":`#00c8ff`,A:`#3ddc84`,"A-":`#7ecf7e`,"B+":`#a8a8c8`,B:`#808098`,C:`#606078`};function jc(e){return Oc(kc[e],Ac[e])}var Mc=[`S+`,`S`,`A+`,`A`,`A-`,`B+`,`B`,`C`];function Nc({models:e}){let t=(0,v.useMemo)(()=>{let t={};return e.forEach(e=>{t[e.origin]||(t[e.origin]={total:0,online:0,key:e.providerKey}),t[e.origin].total++,e.status===`up`&&t[e.origin].online++}),Object.entries(t).sort((e,t)=>t[1].online/t[1].total-e[1].online/e[1].total)},[e]),n=(0,v.useMemo)(()=>[...e.filter(e=>e.status===`up`&&e.avg!==1/0&&e.avg<99e3)].sort((e,t)=>e.avg-t.avg).slice(0,10),[e]),r=(0,v.useMemo)(()=>{let t={};e.forEach(e=>{t[e.tier]=(t[e.tier]||0)+1});let n=Math.max(...Object.values(t),1);return Mc.map(e=>({tier:e,count:t[e]||0,pct:(t[e]||0)/n*100}))},[e]);return(0,P.jsxs)(`div`,{className:K.page,children:[(0,P.jsxs)(`div`,{className:K.pageHeader,children:[(0,P.jsxs)(`h1`,{className:K.pageTitle,children:[(0,P.jsx)(zn,{size:24,stroke:1.5,style:{marginRight:8,verticalAlign:`middle`}}),`Analytics`]}),(0,P.jsx)(`p`,{className:K.pageSubtitle,children:`Real-time insights across all providers and models`})]}),(0,P.jsxs)(`div`,{className:K.grid,children:[(0,P.jsxs)(`div`,{className:`${K.card} ${K.cardWide}`,children:[(0,P.jsx)(`h3`,{className:K.cardTitle,children:`Provider Health Overview`}),(0,P.jsx)(`div`,{className:K.cardBody,children:t.length===0?(0,P.jsx)(`div`,{className:K.empty,children:`Waiting for data...`}):t.map(([e,t])=>{let n=t.total>0?Math.round(t.online/t.total*100):0,r=n>70?K.pctFast:n>30?K.pctMedium:K.pctSlow;return(0,P.jsxs)(`div`,{className:K.healthItem,children:[(0,P.jsx)(`span`,{className:K.healthName,children:e}),(0,P.jsx)(`div`,{className:K.healthBar,children:(0,P.jsx)(`div`,{className:K.healthFill,style:{width:`${n}%`}})}),(0,P.jsxs)(`span`,{className:`${K.healthPct} ${r}`,children:[n,`%`]})]},e)})})]}),(0,P.jsxs)(`div`,{className:K.card,children:[(0,P.jsxs)(`h3`,{className:K.cardTitle,style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,P.jsx)(Kr,{size:16,stroke:1.5}),`Fastest Models`]}),(0,P.jsx)(`div`,{className:K.cardBody,children:n.length===0?(0,P.jsx)(`div`,{className:K.empty,children:`Waiting for ping data...`}):n.map((e,t)=>{let n=t<3?K[`rank${t+1}`]:``;return(0,P.jsxs)(`div`,{className:K.leaderItem,children:[(0,P.jsx)(`div`,{className:`${K.leaderRank} ${n}`,children:t+1}),(0,P.jsx)(`span`,{className:K.leaderName,children:e.label}),(0,P.jsxs)(`span`,{className:K.leaderLatency,children:[e.avg,`ms`]})]},e.modelId)})})]}),(0,P.jsxs)(`div`,{className:K.card,children:[(0,P.jsx)(`h3`,{className:K.cardTitle,children:`Tier Distribution`}),(0,P.jsx)(`div`,{className:K.cardBody,children:r.map(({tier:e,count:t,pct:n})=>(0,P.jsxs)(`div`,{className:K.tierItem,children:[(0,P.jsx)(`div`,{className:K.tierBadge,children:(0,P.jsx)(ps,{tier:e})}),(0,P.jsx)(`div`,{className:K.tierBar,children:(0,P.jsx)(`div`,{className:K.tierFill,style:{width:`${n}%`,background:jc(e)}})}),(0,P.jsx)(`span`,{className:K.tierCount,children:t})]},e))})]})]}),(0,P.jsx)(Dc,{})]})}var Pc={nvidia:{name:`NVIDIA NIM`,url:`https://integrate.api.nvidia.com/v1/chat/completions`,models:[[`minimaxai/minimax-m2.7`,`MiniMax M2.7`,`S+`,`80.2%`,`200k`],[`z-ai/glm-5.1`,`GLM 5.1`,`S+`,`77.8%`,`128k`],[`moonshotai/kimi-k2.6`,`Kimi K2.6`,`S+`,`76.8%`,`256k`],[`deepseek-ai/deepseek-v4-pro`,`DeepSeek V4 Pro`,`S+`,`73.1%`,`1M`],[`deepseek-ai/deepseek-v4-flash`,`DeepSeek V4 Flash`,`S+`,`72.0%`,`1M`],[`stepfun-ai/step-3.5-flash`,`Step 3.5 Flash`,`S+`,`74.4%`,`256k`],[`stepfun-ai/step-3.7-flash`,`Step 3.7 Flash`,`S+`,`74.4%`,`256k`],[`nvidia/nemotron-3-ultra-550b-a55b`,`Nemotron 3 Ultra`,`S+`,`-`,`1M`],[`qwen/qwen3-next-80b-a3b-instruct`,`Qwen3 80B Instruct`,`S`,`65.0%`,`128k`],[`qwen/qwen3.5-397b-a17b`,`Qwen3.5 400B VLM`,`S`,`68.0%`,`128k`],[`openai/gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`128k`],[`meta/llama-4-maverick-17b-128e-instruct`,`Llama 4 Maverick`,`S`,`62.0%`,`1M`],[`mistralai/mistral-medium-3.5-128b`,`Mistral Medium 3.5`,`S`,`66.0%`,`128k`],[`mistralai/mistral-small-4-119b-2603`,`Mistral Small 4`,`S`,`60.0%`,`256k`],[`qwen/qwen3.5-122b-a10b`,`Qwen3.5 122B`,`S`,`64.0%`,`128k`],[`minimaxai/minimax-m3`,`MiniMax M3`,`S`,`59.0%`,`1M`],[`mistralai/mistral-large-3-675b-instruct-2512`,`Mistral Large 675B`,`A+`,`58.0%`,`256k`],[`nvidia/nemotron-3-super-120b-a12b`,`Nemotron 3 Super`,`A+`,`56.0%`,`128k`],[`nvidia/nemotron-3-nano-omni-30b-a3b-reasoning`,`Nemotron 3 Omni`,`A+`,`52.0%`,`128k`],[`nvidia/nemotron-3-nano-30b-a3b`,`Nemotron Nano 30B`,`A`,`43.0%`,`128k`],[`openai/gpt-oss-20b`,`GPT OSS 20B`,`A`,`42.0%`,`128k`],[`google/gemma-4-31b-it`,`Gemma 4 31B`,`A`,`45.0%`,`256k`],[`bytedance/seed-oss-36b-instruct`,`Seed OSS 36B`,`A-`,`38.0%`,`32k`],[`stockmark/stockmark-2-100b-instruct`,`Stockmark 100B`,`A-`,`36.0%`,`32k`],[`mistralai/ministral-14b-instruct-2512`,`Ministral 14B`,`B+`,`34.0%`,`32k`],[`meta/llama-3.2-11b-vision-instruct`,`Llama 3.2 11B Vision`,`B`,`28.0%`,`128k`],[`microsoft/phi-4-mini-instruct`,`Phi 4 Mini`,`C`,`14.0%`,`128k`]]},groq:{name:`Groq`,url:`https://api.groq.com/openai/v1/chat/completions`,models:[[`llama-3.3-70b-versatile`,`Llama 3.3 70B`,`A-`,`39.5%`,`131k`],[`meta-llama/llama-4-scout-17b-16e-instruct`,`Llama 4 Scout`,`A`,`44.0%`,`131k`],[`llama-3.1-8b-instant`,`Llama 3.1 8B`,`B`,`28.8%`,`131k`],[`openai/gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`131k`],[`openai/gpt-oss-20b`,`GPT OSS 20B`,`A`,`42.0%`,`131k`],[`qwen/qwen3-32b`,`Qwen3 32B`,`A+`,`50.0%`,`131k`],[`qwen/qwen3.6-27b`,`Qwen3.6 27B`,`A`,`-`,`131k`],[`groq/compound`,`Groq Compound`,`A`,`45.0%`,`131k`],[`groq/compound-mini`,`Groq Compound Mini`,`B+`,`32.0%`,`131k`]]},cerebras:{name:`Cerebras`,url:`https://api.cerebras.ai/v1/chat/completions`,models:[[`gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`8k`],[`zai-glm-4.7`,`GLM 4.7`,`S+`,`73.8%`,`8k`]]},googleai:{name:`Google AI`,url:`https://generativelanguage.googleapis.com/v1beta/openai/chat/completions`,models:[[`gemini-3.5-flash`,`Gemini 3.5 Flash`,`S+`,`-`,`1M`],[`gemini-3.1-pro-preview`,`Gemini 3.1 Pro Preview`,`S+`,`78.0%`,`1M`],[`gemini-3-flash-preview`,`Gemini 3 Flash Preview`,`S`,`65.0%`,`1M`],[`gemini-3.1-flash-lite`,`Gemini 3.1 Flash Lite`,`A+`,`55.0%`,`1M`],[`gemini-2.5-pro`,`Gemini 2.5 Pro`,`S+`,`63.2%`,`1M`],[`gemini-2.5-flash`,`Gemini 2.5 Flash`,`A+`,`50.0%`,`1M`],[`gemini-2.5-flash-lite`,`Gemini 2.5 Flash Lite`,`A`,`42.0%`,`1M`]]},"github-models":{name:`GitHub Models`,url:`https://models.github.ai/inference/chat/completions`,models:[[`openai/gpt-4.1`,`GPT-4.1`,`S+`,`-`,`1M`],[`openai/gpt-4.1-mini`,`GPT-4.1 Mini`,`S`,`-`,`1M`],[`openai/gpt-4.1-nano`,`GPT-4.1 Nano`,`A`,`-`,`1M`],[`deepseek/deepseek-v3-0324`,`DeepSeek V3 0324`,`S`,`62.0%`,`128k`],[`meta/meta-llama-3.1-405b-instruct`,`Llama 3.1 405B`,`A`,`44.0%`,`128k`],[`meta/llama-4-maverick-17b-128e-instruct-fp8`,`Llama 4 Maverick`,`S`,`62.0%`,`1M`],[`meta/llama-4-scout-17b-16e-instruct`,`Llama 4 Scout`,`A`,`44.0%`,`1M`],[`meta/llama-3.3-70b-instruct`,`Llama 3.3 70B`,`A-`,`39.5%`,`128k`],[`meta/llama-3.2-90b-vision-instruct`,`Llama 3.2 90B Vision`,`A-`,`-`,`128k`],[`meta/llama-3.2-11b-vision-instruct`,`Llama 3.2 11B Vision`,`B`,`-`,`128k`],[`meta/meta-llama-3.1-8b-instruct`,`Llama 3.1 8B`,`B`,`28.8%`,`128k`],[`mistral-ai/codestral-2501`,`Codestral 2501`,`B+`,`34.0%`,`256k`],[`mistral-ai/mistral-medium-2505`,`Mistral Medium 2505`,`A`,`48.0%`,`128k`],[`mistral-ai/mistral-small-2503`,`Mistral Small 2503`,`B+`,`30.0%`,`128k`],[`mistral-ai/ministral-3b`,`Ministral 3B`,`C`,`-`,`128k`]]},mistral:{name:`Mistral LP`,url:`https://api.mistral.ai/v1/chat/completions`,models:[[`mistral-large-2512`,`Mistral Large 3`,`S+`,`70.0%`,`256k`],[`mistral-medium-3-5`,`Mistral Medium 3.5`,`S+`,`77.6%`,`256k`],[`devstral-2512`,`Devstral 2`,`S+`,`72.2%`,`256k`],[`magistral-medium-2509`,`Magistral Medium 1.2`,`A+`,`52.0%`,`128k`],[`mistral-small-2603`,`Mistral Small 4`,`A`,`48.0%`,`256k`]]},cloudflare:{name:`Cloudflare AI`,url:`https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/v1/chat/completions`,models:[[`@cf/moonshotai/kimi-k2.6`,`Kimi K2.6`,`S+`,`76.8%`,`262k`],[`@cf/moonshotai/kimi-k2.7-code`,`Kimi K2.7 Code`,`S+`,`-`,`262k`],[`@cf/zai-org/glm-4.7-flash`,`GLM-4.7-Flash`,`S`,`59.2%`,`131k`],[`@cf/openai/gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`128k`],[`@cf/nvidia/nemotron-3-120b-a12b`,`Nemotron 3 Super`,`A+`,`56.0%`,`128k`],[`@cf/zai-org/glm-5.2`,`GLM-5.2`,`S+`,`-`,`262k`],[`@cf/moonshotai/kimi-k2.5`,`Kimi K2.5`,`S+`,`-`,`256k`],[`@cf/meta/llama-4-scout-17b-16e-instruct`,`Llama 4 Scout`,`A`,`44.0%`,`131k`],[`@cf/mistralai/mistral-7b-instruct-v0.2`,`Mistral 7B v0.2`,`A`,`38.0%`,`128k`],[`@cf/qwen/qwen3-30b-a3b-fp8`,`Qwen3 30B MoE`,`A`,`45.0%`,`128k`],[`@cf/qwen/qwen2.5-coder-32b-instruct`,`Qwen2.5 Coder 32B`,`A`,`46.0%`,`128k`],[`@cf/openai/gpt-oss-20b`,`GPT OSS 20B`,`A`,`42.0%`,`128k`],[`@cf/meta/llama-3.3-70b-instruct-fp8-fast`,`Llama 3.3 70B`,`A-`,`39.5%`,`128k`],[`@cf/google/gemma-4-26b-a4b-it`,`Gemma 4 26B MoE`,`A-`,`38.0%`,`128k`],[`@cf/mistralai/mistral-small-3.1-24b-instruct`,`Mistral Small 3.1`,`B+`,`30.0%`,`128k`],[`@cf/ibm/granite-4.0-h-micro`,`Granite 4.0 Micro`,`B+`,`30.0%`,`128k`]]},openrouter:{name:`OpenRouter`,url:`https://openrouter.ai/api/v1/chat/completions`,models:[[`nvidia/nemotron-3-ultra-550b-a55b:free`,`Nemotron 3 Ultra`,`S+`,`-`,`1M`],[`poolside/laguna-m.1:free`,`Poolside Laguna M.1`,`S+`,`-`,`262k`],[`poolside/laguna-xs.2:free`,`Poolside Laguna XS.2`,`S+`,`-`,`262k`],[`openai/gpt-oss-120b:free`,`GPT OSS 120B`,`S`,`60.0%`,`131k`],[`cohere/north-mini-code:free`,`North Mini Code`,`S`,`-`,`256k`],[`nvidia/nemotron-3-super-120b-a12b:free`,`Nemotron 3 Super`,`A+`,`56.0%`,`1M`],[`nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free`,`Nemotron 3 Omni`,`A+`,`52.0%`,`256k`],[`openrouter/owl-alpha`,`Owl Alpha`,`A+`,`-`,`1M`],[`openai/gpt-oss-20b:free`,`GPT OSS 20B`,`A`,`42.0%`,`131k`],[`nvidia/nemotron-nano-30b-a3b:free`,`Nemotron Nano 30B`,`A`,`43.0%`,`256k`],[`nvidia/nemotron-nano-12b-v2-vl:free`,`Nemotron Nano 12B VL`,`A`,`20.0%`,`128k`],[`google/gemma-4-31b-it:free`,`Gemma 4 31B`,`A`,`45.0%`,`262k`],[`google/gemma-4-26b-a4b-it:free`,`Gemma 4 26B MoE`,`A`,`38.0%`,`262k`],[`nvidia/nemotron-nano-9b-v2:free`,`Nemotron Nano 9B`,`B+`,`18.0%`,`128k`],[`openrouter/free`,`OpenRouter Free`,`B`,`-`,`200k`]]},sambanova:{name:`SambaNova`,url:`https://api.sambanova.ai/v1/chat/completions`,models:[[`MiniMax-M2.7`,`MiniMax M2.7`,`S+`,`56.2%`,`192k`],[`DeepSeek-V3.1`,`DeepSeek V3.1`,`S`,`62.0%`,`128k`],[`DeepSeek-V3.2`,`DeepSeek V3.2`,`S+`,`70.0%`,`32k`],[`gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`128k`],[`gemma-4-31B-it`,`Gemma 4 31B`,`A`,`45.0%`,`128k`],[`Meta-Llama-3.3-70B-Instruct`,`Llama 3.3 70B`,`A-`,`39.5%`,`128k`]]},ovhcloud:{name:`OVHcloud AI`,url:`https://oai.endpoints.kepler.ai.cloud.ovh.net/v1/chat/completions`,models:[[`Qwen3.5-397B-A17B`,`Qwen3.5 397B MoE`,`S`,`-`,`262k`],[`Qwen3.6-27B`,`Qwen3.6 27B`,`A`,`-`,`262k`],[`Qwen3-Coder-30B-A3B-Instruct`,`Qwen3 Coder 30B MoE`,`A+`,`55.0%`,`256k`],[`gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`131k`],[`gpt-oss-20b`,`GPT OSS 20B`,`A`,`42.0%`,`131k`],[`Meta-Llama-3_3-70B-Instruct`,`Llama 3.3 70B`,`A-`,`39.5%`,`131k`],[`Qwen3-32B`,`Qwen3 32B`,`A+`,`50.0%`,`32k`],[`Mistral-Small-3.2-24B-Instruct-2506`,`Mistral Small 3.2`,`B+`,`34.0%`,`128k`],[`Mistral-7B-Instruct-v0.3`,`Mistral 7B Instruct`,`B`,`25.0%`,`127k`],[`Mistral-Nemo-Instruct-2407`,`Mistral Nemo`,`B+`,`30.0%`,`118k`],[`Qwen3.5-9B`,`Qwen3.5 9B`,`B+`,`30.0%`,`262k`],[`Qwen3-Embedding-8B`,`Qwen3 Embedding 8B`,`B`,`-`,`-`],[`bge-m3`,`BGE M3`,`B`,`-`,`-`],[`bge-multilingual-gemma2`,`BGE Multilingual Gemma2`,`B`,`-`,`-`]]},codestral:{name:`Codestral`,url:`https://api.mistral.ai/v1/chat/completions`,models:[[`codestral-2508`,`Codestral`,`B+`,`34.0%`,`128k`]]},zai:{name:`ZAI`,url:`https://api.z.ai/api/coding/paas/v4/chat/completions`,models:[[`zai/glm-4.7-flash`,`GLM-4.7-Flash`,`S`,`59.2%`,`200k`],[`zai/glm-4.5-flash`,`GLM-4.5-Flash`,`S`,`59.2%`,`128k`]]},scaleway:{name:`Scaleway`,url:`https://api.scaleway.ai/v1/chat/completions`,models:[[`devstral-2-123b-instruct-2512`,`Devstral 2 123B`,`S+`,`72.2%`,`200k`],[`qwen3.5-397b-a17b`,`Qwen3.5 400B VLM`,`S`,`68.0%`,`250k`],[`mistral/mistral-large-3-675b-instruct-2512`,`Mistral Large 675B`,`A+`,`58.0%`,`250k`],[`qwen3-235b-a22b-instruct-2507`,`Qwen3 235B`,`S+`,`70.0%`,`250k`],[`gpt-oss-120b`,`GPT OSS 120B`,`S`,`60.0%`,`128k`],[`qwen3-coder-30b-a3b-instruct`,`Qwen3 Coder 30B`,`A+`,`55.0%`,`128k`],[`qwen3.6-35b-a3b`,`Qwen3.6 35B MoE`,`A+`,`-`,`256k`],[`holo2-30b-a3b`,`Holo2 30B`,`A+`,`52.0%`,`22k`],[`llama-3.3-70b-instruct`,`Llama 3.3 70B`,`A-`,`39.5%`,`100k`],[`mistral-small-3.2-24b-instruct-2506`,`Mistral Small 3.2`,`B+`,`30.0%`,`128k`],[`gemma-3-27b-it`,`Gemma 3 27B`,`B`,`22.0%`,`40k`]]},qwen:{name:`Alibaba DashScope`,url:`https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions`,models:[[`qwen3.7-max`,`Qwen3.7 Max`,`S+`,`80.0%`,`1M`],[`qwen3-max`,`Qwen3 Max`,`S+`,`78.8%`,`256k`],[`qwen3.6-plus`,`Qwen3.6 Plus`,`S+`,`72.0%`,`1M`],[`qwen3-235b-a22b`,`Qwen3 235B`,`S+`,`70.0%`,`256k`],[`qwen3.5-plus`,`Qwen3.5 Plus`,`S`,`68.0%`,`1M`],[`qwen3-coder-plus`,`Qwen3 Coder Plus`,`S`,`69.6%`,`1M`],[`qwen3-coder-next`,`Qwen3 Coder Next`,`S`,`65.0%`,`256k`],[`qwen3.6-flash`,`Qwen3.6 Flash`,`A+`,`60.0%`,`1M`],[`qwen3.5-flash`,`Qwen3.5 Flash`,`A+`,`55.0%`,`1M`],[`qwen3-coder-flash`,`Qwen3 Coder Flash`,`A+`,`55.0%`,`1M`],[`qwen3-32b`,`Qwen3 32B`,`A+`,`50.0%`,`256k`]]},"opencode-zen":{name:`OpenCode Zen`,url:`https://opencode.ai/zen/v1/chat/completions`,models:[[`big-pickle`,`Big Pickle`,`S+`,`72.0%`,`200k`],[`deepseek-v4-flash-free`,`DeepSeek V4 Flash Free`,`S+`,`79.0%`,`200k`],[`mimo-v2.5-free`,`MiMo-V2.5 Free`,`S+`,`-`,`200k`],[`nemotron-3-ultra-free`,`Nemotron 3 Ultra Free`,`A+`,`-`,`200k`],[`north-mini-code-free`,`North Mini Code Free`,`B+`,`-`,`200k`]],zenOnly:!0},kilo:{name:`Kilo`,url:`https://api.kilo.ai/api/gateway/chat/completions`,models:[[`kilo-auto/free`,`Kilo Auto Free`,`A+`,`-`,`256k`]],noKeyNeeded:!0},llm7:{name:`LLM7`,url:`https://api.llm7.io/v1/chat/completions`,models:[[`deepseek-v4-flash`,`DeepSeek V4 Flash`,`S+`,`-`,`128k`],[`kimi-k2.6`,`Kimi K2.6`,`S+`,`-`,`256k`],[`qwen3-235b`,`Qwen3 235B`,`S+`,`70.0%`,`240k`],[`devstral-small-2:24b`,`Devstral Small 2`,`A`,`-`,`128k`],[`mistral-small-3.2`,`Mistral Small 3.2`,`B+`,`34.0%`,`128k`],[`codestral-latest`,`Codestral Latest`,`B+`,`34.0%`,`32k`]],noKeyNeeded:!0},routeway:{name:`Routeway`,url:`https://api.routeway.ai/v1/chat/completions`,models:[[`deepseek-v4-flash:free`,`DeepSeek V4 Flash`,`S+`,`72.0%`,`1M`],[`step-3.5-flash:free`,`Step 3.5 Flash`,`S+`,`74.4%`,`256k`],[`ling-2.6-flash:free`,`Ling 2.6 Flash`,`S`,`-`,`262k`],[`gpt-oss-120b:free`,`GPT OSS 120B`,`S`,`60.0%`,`131k`],[`minimax-m2:free`,`MiniMax M2`,`S`,`-`,`197k`],[`laguna-m.1:free`,`Poolside Laguna M.1`,`S+`,`-`,`131k`],[`laguna-xs.2:free`,`Poolside Laguna XS.2`,`S+`,`-`,`131k`],[`gemma-4-31b-it:free`,`Gemma 4 31B`,`A`,`45.0%`,`262k`],[`nemotron-3-nano-30b-a3b:free`,`Nemotron Nano 30B`,`A`,`43.0%`,`256k`],[`llama-3.3-70b-instruct:free`,`Llama 3.3 70B`,`A-`,`39.5%`,`131k`],[`mistral-nemo-instruct:free`,`Mistral Nemo`,`B+`,`30.0%`,`16k`],[`nemotron-nano-9b-v2:free`,`Nemotron Nano 9B`,`B+`,`18.0%`,`128k`],[`llama-3.1-8b-instruct:free`,`Llama 3.1 8B`,`B`,`28.8%`,`16k`],[`llama-3.2-3b-instruct:free`,`Llama 3.2 3B`,`B`,`20.0%`,`16k`],[`llama-3.2-1b-instruct:free`,`Llama 3.2 1B`,`C`,`-`,`16k`]]},novita:{name:`Novita AI`,url:`https://api.novita.ai/openai/v1/chat/completions`,models:[[`qwen/qwen3.6-plus`,`Qwen3.6 Plus`,`S+`,`72.0%`,`1M`],[`qwen/qwen3.5-plus`,`Qwen3.5 Plus`,`S`,`68.0%`,`1M`],[`nex-agi/nex-n2-pro`,`Nex N2 Pro`,`S`,`-`,`262k`],[`minimax/m2-her`,`MiniMax M2 HER`,`S`,`-`,`32k`]]},"ollama-cloud":{name:`Ollama Cloud`,url:`https://ollama.com/v1/chat/completions`,models:[[`minimax-m2.7`,`MiniMax M2.7`,`S+`,`80.2%`,`200k`],[`glm-5.1`,`GLM 5.1`,`S+`,`77.8%`,`203k`],[`kimi-k2.6`,`Kimi K2.6`,`S+`,`76.8%`,`131k`],[`deepseek-v4-pro`,`DeepSeek V4 Pro`,`S+`,`73.1%`,`1M`],[`deepseek-v4-flash`,`DeepSeek V4 Flash`,`S+`,`72.0%`,`1M`],[`devstral-2:123b`,`Devstral 2 123B`,`S+`,`72.2%`,`200k`],[`qwen3-coder:480b`,`Qwen3 Coder 480B`,`S+`,`70.6%`,`256k`],[`nemotron-3-ultra`,`Nemotron 3 Ultra`,`S+`,`-`,`1M`],[`glm-4.7`,`GLM 4.7`,`S+`,`73.8%`,`128k`],[`qwen3.5:397b`,`Qwen3.5 397B`,`S`,`68.0%`,`128k`],[`qwen3-coder-next`,`Qwen3 Coder Next`,`S`,`65.0%`,`256k`],[`gpt-oss:120b`,`GPT OSS 120B`,`S`,`60.0%`,`128k`],[`minimax-m3`,`MiniMax M3`,`S`,`59.0%`,`1M`],[`mistral-large-3:675b`,`Mistral Large 3`,`A+`,`58.0%`,`256k`],[`nemotron-3-super`,`Nemotron 3 Super`,`A+`,`56.0%`,`128k`],[`gemma4:31b`,`Gemma 4 31B`,`A`,`45.0%`,`256k`],[`gpt-oss:20b`,`GPT OSS 20B`,`A`,`42.0%`,`128k`]]}},Fc=[];for(let[e,t]of Object.entries(Pc))if(!(!t||!t.models))for(let n of t.models){let[t,r,i,a,o,s]=n;Fc.push([t,r,i,a,o,e,s||null])}var Ic=Object.entries(Pc).map(([e,t])=>{let n=t?.name||e;return{id:`filter-provider-${e.replace(/[^a-z0-9]+/gi,`-`)}`,label:n,providerKey:e,description:`${n} models`,keywords:[`filter`,`provider`,`origin`,e,n.toLowerCase()]}}),Lc={opencode:`Launch in OpenCode CLI with the selected model.`,"opencode-desktop":`Set model in shared config, then open OpenCode Desktop.`,"opencode-web":`Set model in shared config, then open OpenCode WebUI.`,openclaw:`Set default model in OpenClaw and launch it.`,crush:`Launch Crush with this provider/model pair.`,goose:`Launch Goose and preselect the active model.`,pi:`Launch Pi with model/provider flags.`,aider:`Launch Aider configured on the selected model.`,kilo:`Set model in shared config, then launch Kilo CLI.`,qwen:`Launch Qwen Code using the selected provider model.`,openhands:`Launch OpenHands with the selected model endpoint.`,amp:`Launch Amp with this model as active target.`,hermes:`Launch Hermes Agent with the selected model.`,continue:`Launch Continue CLI with the selected model.`,cline:`Launch Cline CLI with the selected model.`,caveman:`Caveman Code — token-efficient coding agent (launch with Caveman tool only).`,jcode:`Launch jcode coding agent with the selected model.`},Rc=yn.map(e=>{let t=vn[e]||{label:e,emoji:`🧰`};return{id:`action-set-tool-${e}`,label:t.label,toolMode:e,icon:t.emoji,description:Lc[e]||`Set this as the active launch target.`,keywords:[`tool`,`target`,`mode`,e,t.label.toLowerCase()]}}),zc=[{id:`action-cycle-ping-mode`,label:`Cycle ping mode`,shortcut:`W`,icon:`⚡`,description:`Rotate speed → normal → slow → forced.`,keywords:[`ping`,`mode`,`cycle`,`speed`,`normal`,`slow`,`forced`]},{id:`action-set-ping-speed`,label:`Speed mode (2s)`,pingMode:`speed`,description:`Fast 2s bursts for short live checks.`,keywords:[`ping`,`mode`,`speed`,`2s`,`fast`]},{id:`action-set-ping-normal`,label:`Normal mode (10s)`,pingMode:`normal`,description:`Balanced default cadence for daily use.`,keywords:[`ping`,`mode`,`normal`,`10s`,`default`]},{id:`action-set-ping-slow`,label:`Slow mode (30s)`,pingMode:`slow`,description:`Lower refresh cost when you are mostly idle.`,keywords:[`ping`,`mode`,`slow`,`30s`,`idle`]},{id:`action-set-ping-forced`,label:`Forced mode (4s)`,pingMode:`forced`,description:`Keeps 4s cadence until manually changed.`,keywords:[`ping`,`mode`,`forced`,`4s`,`manual`]}],Bc=[{id:`filters`,label:`Filters`,icon:`🔍`,children:[{id:`filter-tier`,label:`Filter by tier`,icon:`📊`,children:[{id:`filter-tier-all`,label:`All tiers`,tier:null,shortcut:`T`,description:`Show all models`,keywords:[`filter`,`tier`,`all`]},{id:`filter-tier-splus`,label:`S+ tier`,tier:`S+`,description:`Best coding models`,keywords:[`filter`,`tier`,`s+`]},{id:`filter-tier-s`,label:`S tier`,tier:`S`,description:`Excellent models`,keywords:[`filter`,`tier`,`s`]},{id:`filter-tier-aplus`,label:`A+ tier`,tier:`A+`,description:`Very good models`,keywords:[`filter`,`tier`,`a+`]},{id:`filter-tier-a`,label:`A tier`,tier:`A`,description:`Good models`,keywords:[`filter`,`tier`,`a`]},{id:`filter-tier-aminus`,label:`A- tier`,tier:`A-`,description:`Solid models`,keywords:[`filter`,`tier`,`a-`]},{id:`filter-tier-bplus`,label:`B+ tier`,tier:`B+`,description:`Fair models`,keywords:[`filter`,`tier`,`b+`]},{id:`filter-tier-b`,label:`B tier`,tier:`B`,description:`Basic models`,keywords:[`filter`,`tier`,`b`]},{id:`filter-tier-c`,label:`C tier`,tier:`C`,description:`Limited models`,keywords:[`filter`,`tier`,`c`]}]},{id:`filter-provider`,label:`Filter by provider`,icon:`🏢`,children:[{id:`filter-provider-cycle`,label:`Cycle provider`,shortcut:`D`,description:`Switch between providers`,keywords:[`filter`,`provider`,`origin`]},{id:`filter-provider-all`,label:`All providers`,providerKey:null,description:`Show all providers`,keywords:[`filter`,`provider`,`all`]},...Ic]},{id:`filter-model`,label:`Filter by model`,icon:`🤖`,children:[]},{id:`filter-other`,label:`Other filters`,icon:`⚙️`,children:[{id:`filter-configured-toggle`,label:`Show only configured & working`,shortcut:`E`,description:`Show only configured providers that are responding (not noauth/auth error)`,keywords:[`filter`,`configured`,`keys`,`working`,`active`]}]}]},{id:`sort`,label:`Sort`,icon:`📶`,children:[{id:`sort-rank`,label:`Sort by rank`,shortcut:`R`,description:`Rank by SWE score`,keywords:[`sort`,`rank`]},{id:`sort-tier`,label:`Sort by tier`,description:`Group by quality tier`,keywords:[`sort`,`tier`]},{id:`sort-provider`,label:`Sort by provider`,shortcut:`O`,description:`Group by provider`,keywords:[`sort`,`origin`,`provider`]},{id:`sort-model`,label:`Sort by model`,shortcut:`M`,description:`Alphabetical order`,keywords:[`sort`,`model`,`name`]},{id:`sort-latest-ping`,label:`Sort by latest ping`,shortcut:`L`,description:`Recent response time`,keywords:[`sort`,`latest`,`ping`]},{id:`sort-avg-ping`,label:`Sort by avg ping`,shortcut:`A`,description:`Average response time`,keywords:[`sort`,`avg`,`average`,`ping`]},{id:`sort-swe`,label:`Sort by SWE score`,shortcut:`S`,description:`Coding ability score`,keywords:[`sort`,`swe`,`score`]},{id:`sort-ctx`,label:`Sort by context`,shortcut:`C`,description:`Context window size`,keywords:[`sort`,`context`,`ctx`]},{id:`sort-health`,label:`Sort by health`,shortcut:`H`,description:`Current model status`,keywords:[`sort`,`health`,`condition`]},{id:`sort-verdict`,label:`Sort by verdict`,shortcut:`V`,description:`Overall assessment`,keywords:[`sort`,`verdict`]},{id:`sort-stability`,label:`Sort by stability`,shortcut:`B`,description:`Reliability score`,keywords:[`sort`,`stability`]},{id:`sort-uptime`,label:`Sort by uptime`,shortcut:`U`,description:`Success rate`,keywords:[`sort`,`uptime`]}]},{id:`actions`,label:`Actions`,icon:`⚙️`,children:[{id:`action-target-tool`,label:`Target tool`,icon:`🧰`,children:[{id:`action-cycle-tool-mode`,label:`Cycle target tool`,shortcut:`Z`,icon:`🔄`,description:`Rotate through every launcher mode.`,keywords:[`tool`,`mode`,`cycle`,`target`]},...Rc]},{id:`action-ping-mode`,label:`Ping mode`,icon:`📶`,children:zc},{id:`action-favorites-mode`,label:`Favorites mode`,icon:`⭐`,children:[{id:`action-toggle-favorite-mode`,label:`Toggle favorites mode`,shortcut:`Y`,icon:`⭐`,description:`Switch pinned+sticky ↔ normal list behavior.`,keywords:[`favorite`,`favorites`,`mode`,`toggle`,`y`]},{id:`action-favorites-mode-pinned`,label:`Pinned + always visible`,favoritesPinned:!0,description:`Favorites stay on top and bypass current filters.`,keywords:[`favorite`,`favorites`,`pinned`,`sticky`,`always visible`]},{id:`action-favorites-mode-normal`,label:`Normal rows (starred only)`,favoritesPinned:!1,description:`Favorites keep ⭐ but follow active filters and sort.`,keywords:[`favorite`,`favorites`,`normal`,`sort`,`filter`]},{id:`action-toggle-favorite`,label:`Toggle favorite on selected row`,shortcut:`F`,icon:`⭐`,description:`Star/unstar the highlighted model.`,keywords:[`favorite`,`star`,`toggle`]}]},{id:`action-cycle-theme`,label:`Cycle theme`,shortcut:`G`,icon:`🌗`,description:`Switch dark/light/auto`,keywords:[`theme`,`dark`,`light`,`auto`]},{id:`action-reset-view`,label:`Reset view`,shortcut:`N`,icon:`🔄`,description:`Reset filters and sort`,keywords:[`reset`,`view`,`sort`,`filters`]},{id:`action-probe-404`,label:`Probe 404 Models`,shortcut:`Ctrl+Shift+P`,icon:`🔍`,description:`Test all configured models for 404/410 errors. Auto-hides broken models.`,keywords:[`probe`,`404`,`broken`,`dead`,`health`,`check`,`test`,`verify`]},{id:`action-toggle-auto-hide-broken`,label:`Toggle Auto-hide Broken Models`,icon:`🚩`,description:`Enable/disable auto-hiding of 404/410 models. Unhides all when disabled.`,keywords:[`auto`,`hide`,`broken`,`404`,`models`,`toggle`,`probe`]}]},{id:`open-settings`,label:`Settings`,shortcut:`P`,icon:`⚙️`,type:`page`,description:`API keys and preferences`,keywords:[`settings`,`config`,`api key`]},{id:`open-help`,label:`Help`,shortcut:`K`,icon:`❓`,type:`page`,description:`Show all shortcuts`,keywords:[`help`,`shortcuts`,`hotkeys`]},{id:`open-changelog`,label:`Changelog`,icon:`📋`,type:`page`,description:`Version history`,keywords:[`changelog`,`release`]},{id:`open-recommend`,label:`Smart recommend`,shortcut:`Q`,icon:`🎯`,type:`page`,description:`Find best model for task`,keywords:[`recommend`,`best model`]},{id:`open-playground`,label:`Playground`,shortcut:`;`,icon:`💬`,type:`page`,description:`Chat with the FCM router`,keywords:[`playground`,`chat`,`try`,`prompt`,`router`]},{id:`open-install-endpoints`,label:`Install endpoints`,icon:`🔌`,type:`page`,description:`Install provider catalogs`,keywords:[`install`,`endpoints`,`providers`]},{id:`open-installed-models`,label:`Installed models`,icon:`🗂️`,type:`page`,description:`View models configured in tools`,keywords:[`installed`,`models`,`configured`,`tools`,`manager`,`goose`,`crush`,`aider`]}];function Vc(e=[]){let t=JSON.parse(JSON.stringify(Bc)),n=t.find(e=>e.id===`filters`)?.children.find(e=>e.id===`filter-model`);if(n&&Array.isArray(e)&&e.length>0){let t=e.filter(e=>!e.hidden&&e.status!==`noauth`).slice(0,20);for(let e of t)n.children.push({id:`filter-model-${e.providerKey}-${e.modelId}`,label:e.label,modelId:e.modelId,providerKey:e.providerKey,keywords:[`filter`,`model`,e.label.toLowerCase(),e.modelId.toLowerCase()]})}return t}function Hc(e,t=new Set){let n=[];function r(e,i=0){for(let a of e){if(a.type===`page`||a.type===`action`){n.push({...a,type:a.type,depth:0,hasChildren:!1,isExpanded:!1});continue}let e=t.has(a.id),o=Array.isArray(a.children)&&a.children.length>0;o?(n.push({...a,type:i===0?`category`:`subcategory`,depth:i,hasChildren:o,isExpanded:e}),e&&r(a.children,i+1)):n.push({...a,type:`command`,depth:i,hasChildren:!1,isExpanded:!1})}}return r(e),n}function Uc(e=[]){let t=Vc(e),n=new Set;function r(e){for(let t of e)n.add(t.id),Array.isArray(t.children)&&r(t.children)}return r(t),Hc(t,n).map(e=>{let t={...e};return e.tier!==void 0&&(t.tierValue=e.tier),t})}function Wc(e,t){let n=(e||``).trim().toLowerCase(),r=(t||``).toLowerCase();if(!n)return{matched:!0,score:0,positions:[]};if(!r)return{matched:!1,score:0,positions:[]};let i=0,a=[];for(let e=0;e<r.length&&i<n.length;e++)n[i]===r[e]&&(a.push(e),i++);if(i!==n.length)return{matched:!1,score:0,positions:[]};let o=n.length*10;for(let e=1;e<a.length;e++)a[e]===a[e-1]+1&&(o+=5);for(let e of a)if(e===0)o+=8;else{let t=r[e-1];(t===` `||t===`:`||t===`-`||t===`/`)&&(o+=6)}return o-=Math.max(0,r.length-n.length),{matched:!0,score:o,positions:a}}function Gc(e,t){let n=(t||``).trim();if(!n)return e;let r=[];for(let t of e){let e=Wc(n,t.label),i=e.score,a=e.positions,o=e.matched;if(!o&&Array.isArray(t.keywords))for(let e of t.keywords){let t=Wc(n,e);if(!t.matched)continue;o=!0;let r=Math.max(1,t.score-7);r>i&&(i=r,a=[])}o&&r.push({...t,score:i,matchPositions:a})}let i=[],a=new Set;for(let e of r)e.type===`command`&&e.matchPositions&&i.find(t=>t.id===e.id)&&a.add(e.parentId);return r.sort((e,t)=>t.score===e.score?e.depth===t.depth?e.label.localeCompare(t.label):e.depth-t.depth:t.score-e.score),r}var Kc={backdrop:`_backdrop_162pr_6`,modal:`_modal_162pr_19`,searchRow:`_searchRow_162pr_31`,searchIcon:`_searchIcon_162pr_38`,input:`_input_162pr_39`,kbd:`_kbd_162pr_49`,list:`_list_162pr_62`,item:`_item_162pr_70`,itemActive:`_itemActive_162pr_82`,itemDisabled:`_itemDisabled_162pr_83`,itemIcon:`_itemIcon_162pr_88`,itemLabel:`_itemLabel_162pr_89`,itemEnter:`_itemEnter_162pr_90`,empty:`_empty_162pr_96`,footer:`_footer_162pr_103`},qc={filter:{icon:`🔍`,label:`Filter`},sort:{icon:`📶`,label:`Sort`},action:{icon:`⚙️`,label:`Action`},page:{icon:`📄`,label:`Page`},update:{icon:`⬆️`,label:`Update`},tool:{icon:`🧰`,label:`Tool`}},Jc=[`speed`,`normal`,`slow`,`forced`];function Yc(e){let{onCycleTheme:t,onResetView:n,onSetPingMode:r,theme:i,pingMode:a,modelsCount:o,onExport:s,onNavigate:c}=e;return[{id:`page.help`,section:`page`,label:`Open Help`,keywords:[`help`,`shortcuts`,`reference`],run:()=>c?.(`help`)},{id:`page.changelog`,section:`page`,label:`Open Changelog`,keywords:[`changelog`,`release`,`history`,`version`],run:()=>c?.(`changelog`)},{id:`page.playground`,section:`page`,label:`Open Playground`,keywords:[`playground`,`chat`,`try`,`prompt`,`router`],run:()=>c?.(`playground`)},{id:`page.install-endpoints`,section:`page`,label:`Open Install Endpoints`,keywords:[`install`,`endpoint`,`tool`,`configure`],run:()=>c?.(`install-endpoints`)},{id:`page.installed-models`,section:`page`,label:`Open Installed Models`,keywords:[`installed`,`models`,`tools`],run:()=>c?.(`installed-models`)},{id:`action.theme.cycle`,section:`action`,label:`Cycle theme (current: ${i})`,keywords:[`theme`,`dark`,`light`,`auto`],run:t},{id:`action.reset.view`,section:`action`,label:`Reset view (filters + sort)`,keywords:[`reset`,`view`,`clear`,`filters`,`sort`],run:n},{id:`action.ping.speed`,section:`action`,label:`Ping mode → Speed (2s)`,keywords:[`ping`,`mode`,`speed`,`fast`,`2s`],run:()=>r?.(`speed`)},{id:`action.ping.normal`,section:`action`,label:`Ping mode → Normal (10s)`,keywords:[`ping`,`mode`,`normal`,`10s`,`default`],run:()=>r?.(`normal`)},{id:`action.ping.slow`,section:`action`,label:`Ping mode → Slow (30s)`,keywords:[`ping`,`mode`,`slow`,`30s`,`idle`],run:()=>r?.(`slow`)},{id:`action.ping.forced`,section:`action`,label:`Ping mode → Forced (4s)`,keywords:[`ping`,`mode`,`forced`,`4s`],run:()=>r?.(`forced`)},{id:`action.export`,section:`action`,label:`Export models…`,keywords:[`export`,`download`,`json`,`csv`,`clipboard`],run:s}]}function Xc({onClose:e,onNavigate:t,onCycleTheme:n,onResetView:r,onSetPingMode:i,onOpenHelp:a,onOpenChangelog:o,onOpenCommandPalette:s,onToast:c,onExport:l,currentView:u,theme:d,pingMode:f,models:p,updateAvailable:m,latestVersion:h,onRunUpdate:g}){let[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(0),S=(0,v.useRef)(null),C=(0,v.useRef)(null),w=(0,v.useMemo)(()=>{let e=Uc(p||[]).map(e=>{let t=`action`;return e.id.startsWith(`filter-`)?t=`filter`:e.id.startsWith(`sort-`)?t=`sort`:e.id.startsWith(`action-`)?t=`action`:e.id.startsWith(`action-set-tool-`)?t=`tool`:(e.id.startsWith(`page-`)||e.id===`open-settings`||e.id===`open-help`||e.id===`open-changelog`)&&(t=`page`),{...e,section:t}}),a=Yc({onCycleTheme:n,onResetView:r,onSetPingMode:i,theme:d,pingMode:f,modelsCount:p?.length??0,onExport:l,onNavigate:t}),o=[];return m&&h&&o.push({id:`action.update.run`,section:`update`,label:`⬆️ UPDATE NOW — v${h} available (recommended!)`,keywords:[`update`,`upgrade`,`version`,`install`,`new`],run:()=>g?.()}),[...o,...e,...a]},[p,d,f,n,r,i,o,a,l,m,h,g]),ee=(0,v.useMemo)(()=>_.trim()?Gc(w,_):w,[w,_]),T=(0,v.useMemo)(()=>{let e=new Map;for(let t of ee)e.has(t.section)||e.set(t.section,[]),e.get(t.section).push(t);return Array.from(e.entries())},[ee]),E=(0,v.useMemo)(()=>T.flatMap(([,e])=>e),[T]);(0,v.useEffect)(()=>{S.current?.focus()},[]),(0,v.useEffect)(()=>{b>=E.length&&x(0)},[E,b]),(0,v.useEffect)(()=>{let t=t=>{if(t.key===`Escape`){t.preventDefault(),e();return}if(t.key===`ArrowDown`){t.preventDefault(),x(e=>Math.min(E.length-1,e+1));return}if(t.key===`ArrowUp`){t.preventDefault(),x(e=>Math.max(0,e-1));return}if(t.key===`Enter`){t.preventDefault();let e=E[b];if(!e)return;if(e.disabled){c?.(`${e.label} is not available yet.`,`info`);return}D(e)}};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[E,b,e,c]);let D=(0,v.useCallback)(a=>{let o=a.id;if(o===`open-settings`){t?.(`settings`),e();return}if(o===`open-help`){t?.(`help`),e();return}if(o===`open-changelog`){t?.(`changelog`),e();return}if(o===`open-recommend`){t?.(`recommend`),e();return}if(o===`open-router-dashboard`){t?.(`router`),e();return}if(o===`open-installed-models`){t?.(`installed-models`),e();return}if(o===`open-install-endpoints`){t?.(`install-endpoints`),e();return}if(o===`action-update-now`){g?.(),e();return}if(o===`action-cycle-theme`){n?.(),e();return}if(o===`action-reset-view`){r?.(),e();return}if(o===`action-cycle-ping-mode`){let t=Jc.indexOf(f);i?.(Jc[(t+1)%Jc.length]),e();return}if(o===`action-cycle-tool-mode`){c?.(`Tool mode picker arrives in M3`,`info`),e();return}if(o===`action-toggle-favorite`){c?.(`Press F on a model row in the table.`,`info`),e();return}if(o===`action-toggle-favorite-mode`){c?.(`Set the favorites display mode in Settings (M2).`,`info`),e();return}if(o===`action-export`){l?.(),e();return}if(o===`action-benchmark-row`){c?.(`Click any AI Lat. cell to benchmark the highlighted row.`,`info`),e();return}if(o===`filter-provider-cycle`){c?.(`Use the Provider dropdown in the FilterBar.`,`info`),e();return}if(o.startsWith(`filter-tier-`)){c?.(`Tier filter — use the Tier chip row in the FilterBar.`,`info`),e();return}if(o.startsWith(`filter-provider-`)){c?.(`Provider filter — use the Provider dropdown.`,`info`),e();return}if(o===`filter-configured-toggle`){c?.(`Use the Visibility dropdown in the FilterBar.`,`info`),e();return}if(o.startsWith(`sort-`)){c?.(`Sort — click the column header in the table.`,`info`),e();return}if(o===`action-set-ping-speed`){i?.(`speed`),e();return}if(o===`action-set-ping-normal`){i?.(`normal`),e();return}if(o===`action-set-ping-slow`){i?.(`slow`),e();return}if(o===`action-set-ping-forced`){i?.(`forced`),e();return}if(typeof a.run==`function`){a.run(),e();return}c?.(`${a.label} is not wired on the Web yet.`,`info`),e()},[t,e,c,n,r,i,a,o,g,l,f]);return(0,v.useEffect)(()=>{if(!C.current)return;let e=C.current.querySelector(`[data-cmd-index="${b}"]`);e&&e.scrollIntoView({block:`nearest`})},[b]),(0,P.jsx)(`div`,{className:Kc.backdrop,onClick:e,children:(0,P.jsxs)(`div`,{className:Kc.modal,onClick:e=>e.stopPropagation(),children:[(0,P.jsxs)(`div`,{className:Kc.searchRow,children:[(0,P.jsx)(Rr,{size:16,stroke:1.5,className:Kc.searchIcon}),(0,P.jsx)(`input`,{ref:S,className:Kc.input,placeholder:`Type a command… (filters, sorts, tools, theme, ping, export)`,value:_,onChange:e=>y(e.target.value),autoComplete:`off`}),(0,P.jsxs)(`span`,{className:Kc.kbd,children:[(0,P.jsx)(or,{size:10,stroke:1.5}),`K`]})]}),(0,P.jsxs)(`div`,{className:Kc.list,ref:C,role:`listbox`,children:[E.length===0&&(0,P.jsx)(`div`,{className:Kc.empty,children:`No matching command.`}),T.map(([e,t])=>{let n=qc[e]||{icon:`•`,label:e};return(0,P.jsxs)(`div`,{className:Kc.section,children:[(0,P.jsxs)(`div`,{className:Kc.sectionHeader,children:[(0,P.jsx)(`span`,{className:Kc.sectionIcon,children:n.icon}),(0,P.jsx)(`span`,{children:n.label})]}),t.map(e=>{let t=E.indexOf(e),n=t===b;return(0,P.jsxs)(`button`,{"data-cmd-index":t,className:`${Kc.item} ${n?Kc.itemActive:``} ${e.disabled?Kc.itemDisabled:``}`,onClick:()=>D(e),onMouseEnter:()=>x(t),role:`option`,"aria-selected":n,"aria-disabled":e.disabled?`true`:void 0,children:[(0,P.jsxs)(`span`,{className:Kc.itemLabel,children:[e.label,e.shortcut&&(0,P.jsx)(`span`,{className:Kc.shortcut,children:e.shortcut})]}),e.description&&(0,P.jsx)(`span`,{className:Kc.itemDesc,children:e.description}),n&&(0,P.jsx)(`span`,{className:Kc.itemEnter,children:`↵`})]},e.id)})]},e)})]}),(0,P.jsxs)(`div`,{className:Kc.footer,children:[(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`kbd`,{children:`↑↓`}),` navigate`]}),(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`kbd`,{children:`↵`}),` select`]}),(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`kbd`,{children:`Esc`}),` close`]}),(0,P.jsxs)(`span`,{className:Kc.footerRight,children:[`Powered by the TUI command registry — 1:1 parity`,(0,P.jsx)(dr,{size:10,stroke:1.5,style:{marginLeft:4}})]})]})]})})}var Zc={backdrop:`_backdrop_1xl3j_6`,modal:`_modal_1xl3j_15`,header:`_header_1xl3j_30`,titleRow:`_titleRow_1xl3j_35`,title:`_title_1xl3j_35`,closeBtn:`_closeBtn_1xl3j_49`,searchBar:`_searchBar_1xl3j_62`,searchIcon:`_searchIcon_1xl3j_77`,searchInput:`_searchInput_1xl3j_78`,note:`_note_1xl3j_89`,body:`_body_1xl3j_105`,section:`_section_1xl3j_111`,sectionTitle:`_sectionTitle_1xl3j_112`,itemList:`_itemList_1xl3j_121`,item:`_item_1xl3j_121`,itemKey:`_itemKey_1xl3j_140`,itemDesc:`_itemDesc_1xl3j_146`,empty:`_empty_1xl3j_151`},Qc=[{id:`navigation`,title:`🧭 Navigation`,items:[{key:`↑ / ↓`,desc:`Navigate rows in the main table (planned — currently mouse-only)`},{key:`Enter`,desc:`Open the detail panel for the focused row`},{key:`Esc`,desc:`Close any open modal or detail panel`}]},{id:`filters`,title:`🔍 Filters`,items:[{key:`Tier chip`,desc:`Click to cycle: All → S+ → S → A+ → A → A- → B+ → B → C → All`},{key:`Status chip`,desc:`Click to cycle: All → Up → Down → Pending`},{key:`Verdict chip`,desc:`Click to cycle: All → Perfect → Normal → Spiky → Slow → Overloaded → Down → Unstable → Pending`},{key:`Health chip`,desc:`Click to cycle: All → Up → Timeout → Down → Pending → No key → Auth err`},{key:`Visibility`,desc:`Normal (all) / Configured only (hide no-key) / Usable only (UP + good verdict)`},{key:`Provider dropdown`,desc:`Filter by provider`},{key:`Custom text filter`,desc:"Apply via ⌘K palette or `Apply text filter` — clear with the X chip"},{key:`Reset button`,desc:`Clears every active filter + sort back to defaults`}]},{id:`sort`,title:`📶 Sort`,items:[{key:`Click any column header`,desc:`Sort asc → desc → reset (no sort, default order)`},{key:`Resizable columns`,desc:`Drag the right edge of any header to resize. Double-click resets one column.`}]},{id:`favorites`,title:`⭐ Favorites`,items:[{key:`Star button (per row)`,desc:`Click to favorite / unfavorite the model (TUI: F key)`},{key:`Detail panel`,desc:`Favorite + Up/Down reorder + current priority rank (TUI: Shift+↑/↓)`},{key:`Pinned mode`,desc:`In the Settings view, toggle "Pinned + always visible" (TUI: Y key)`},{key:`Shared with TUI`,desc:`Favorites are persisted in the same ~/.free-coding-models.json the TUI uses`}]},{id:`benchmark`,title:`🤖 AI Speed Test (benchmark)`,items:[{key:`Header button`,desc:`Run a global AI Speed Test on every visible model`},{key:`AI Lat. cell`,desc:`Click any AI Lat. cell to benchmark just that model (TUI: Ctrl+A)`},{key:`Detail panel`,desc:`Dedicated "AI Speed Test" button (TUI: Ctrl+A)`},{key:`TPS column`,desc:`Tokens per second for the model — appears after a benchmark run`},{key:`Latency column`,desc:`Real completion latency (not just ping) for the model`}]},{id:`tools`,title:`🧰 Tool mode (M3)`,items:[{key:`M3 shipped`,desc:`Endpoint target picker, per-row Install Endpoint button, and incompatible-target fallback modal`}]},{id:`palette`,title:`⚡ Command palette`,items:[{key:`⌘K / Ctrl+P`,desc:`The Web's only global keyboard shortcut — toggles the command palette`},{key:`Type to search`,desc:`Fuzzy match across all filters, sorts, tools, pages, and theme / ping / reset actions`},{key:`↑ / ↓ + Enter`,desc:`Navigate the results and execute the highlighted command`},{key:`Esc`,desc:`Close the palette without running anything`}]},{id:`theme`,title:`🌗 Theme`,items:[{key:`Theme button (header)`,desc:`Click to cycle: auto → dark → light (TUI: G key)`},{key:`Auto mode`,desc:`Follows the OS prefers-color-scheme preference and updates live`}]},{id:`ping`,title:`⚡ Ping mode`,items:[{key:`Speed / Normal / Slow / Forced`,desc:`Ping cadence (2s / 10s / 30s / 4s) — TUI: W key`},{key:`next ping in Xs`,desc:`Live countdown shown in the FilterBar (TUI footer style)`}]},{id:`url`,title:`🔗 URL deep-linking`,items:[{key:`?tier=S+&sort=verdict&origin=groq&view=dashboard`,desc:`Every filter / sort / view is reflected in the URL — share pre-filtered links`}]},{id:`cli`,title:`⌨️ CLI parity`,items:[{key:`Same storage`,desc:`The Web reads + writes the same ~/.free-coding-models.json as the TUI`},{key:`Same engine`,desc:`All model parsing, ping, and benchmark code is shared with the TUI`}]},{id:`how-router-works`,title:`🌐 How the FCM Router works`,items:[{key:`Smart router`,desc:`Point any OpenAI client at http://localhost:19280/v1 with model: "fcm". The daemon picks the healthiest model in the active set and forwards the request with automatic failover.`},{key:`Pre-prompt`,desc:`A first-class system message is injected on every proxied request. The default introduces the assistant as the FCM routing agent. Edit from Settings.`},{key:`Probes`,desc:`Every 10s/30s/120s (eco/balanced/aggressive) the daemon sends a 1-token chat-completion ping to every model in the active set. The probe measures latency + status code, not just URL reachability — so a wrong API key is caught and the circuit opens.`},{key:`Circuit breaker`,desc:`Per-model state. Healthy (green) = last probe 2xx, route here. Down (red) = last 3 probes failed, skip until cooldown. Recovering (yellow) = cooldown expired, retrying. Auth error (orange) = 401/403, your key is wrong. Deprecated (gray) = removed from catalog, will be replaced by auto-heal.`},{key:`Failover order`,desc:`Models are tried in priority order. A model in Recovering/Down/Auth error is skipped — the request goes to the next healthy one. If ALL fail, you get 503 with the "models_tried" list in the error body.`},{key:`Auto-heal`,desc:`On daemon start, every Auth-error / Deprecated model in the active set is swapped for a working alternative (same provider first, then cross-provider). The first time you add/remove/reorder a model, auto-heal switches off.`},{key:`Rate limits`,desc:`Each provider has its own quota. Common free-tier limits: Groq 14 400 RPD, Mistral 1 RPS, NVIDIA ~40 RPM, OpenRouter 50 RPD. When a provider returns 429, the router fails over. When daily quota is exhausted, the model goes Auth error and auto-heal swaps it out next start.`}]}];function $c({onClose:e}){let[t,n]=(0,v.useState)(``),r=(0,v.useMemo)(()=>{let e=t.trim().toLowerCase();return e?Qc.map(t=>({...t,items:t.items.filter(t=>t.key.toLowerCase().includes(e)||t.desc.toLowerCase().includes(e))})).filter(e=>e.items.length>0):Qc},[t]);return(0,P.jsx)(`div`,{className:Zc.backdrop,onClick:e,children:(0,P.jsxs)(`div`,{className:Zc.modal,onClick:e=>e.stopPropagation(),children:[(0,P.jsxs)(`div`,{className:Zc.header,children:[(0,P.jsxs)(`div`,{className:Zc.titleRow,children:[(0,P.jsx)(`h2`,{className:Zc.title,children:`❓ Help & Keyboard Shortcuts`}),(0,P.jsx)(`button`,{className:Zc.closeBtn,onClick:e,"aria-label":`Close help`,children:(0,P.jsx)(Yr,{size:18,stroke:1.5})})]}),(0,P.jsxs)(`div`,{className:Zc.searchBar,children:[(0,P.jsx)(Rr,{size:14,stroke:1.5,className:Zc.searchIcon}),(0,P.jsx)(`input`,{className:Zc.searchInput,placeholder:`Search help (filters, hotkeys, TUI parity)…`,value:t,onChange:e=>n(e.target.value),autoFocus:!0})]}),(0,P.jsxs)(`p`,{className:Zc.note,children:[`The Web Dashboard is mouse-first. The only global keyboard shortcut is`,` `,(0,P.jsx)(`kbd`,{children:`⌘K`}),` / `,(0,P.jsx)(`kbd`,{children:`Ctrl+P`}),` for the command palette — everything else lives here, in the header menu, or in modals.`]})]}),(0,P.jsx)(`div`,{className:Zc.body,children:r.length===0?(0,P.jsxs)(`div`,{className:Zc.empty,children:[`No help matches "`,t,`".`]}):r.map(e=>(0,P.jsxs)(`section`,{className:Zc.section,children:[(0,P.jsx)(`h3`,{className:Zc.sectionTitle,children:e.title}),(0,P.jsx)(`ul`,{className:Zc.itemList,children:e.items.map(e=>(0,P.jsxs)(`li`,{className:Zc.item,children:[(0,P.jsx)(`span`,{className:Zc.itemKey,children:e.key}),(0,P.jsx)(`span`,{className:Zc.itemDesc,children:e.desc})]},e.key+e.desc))})]},e.id))})]})})}function el(){let[e,t]=(0,v.useState)({}),[n,r]=(0,v.useState)(!0),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/changelog`);if(!e.ok)throw Error(`HTTP ${e.status}`);t((await e.json())?.versions??{}),a(null)}catch(e){a(e.message||`Failed to load changelog`)}finally{r(!1)}},[]);return(0,v.useEffect)(()=>{o()},[o]),{versions:e,sortedVersions:(0,v.useMemo)(()=>Object.keys(e).sort((e,t)=>{let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e]||0,i=r[e]||0;if(i!==t)return i-t}return 0}),[e]),getVersion:(0,v.useCallback)(t=>e[t]??null,[e]),loading:n,error:i,refresh:o}}var tl={backdrop:`_backdrop_1vsoi_6`,modal:`_modal_1vsoi_15`,header:`_header_1vsoi_30`,titleRow:`_titleRow_1vsoi_35`,title:`_title_1vsoi_35`,backBtn:`_backBtn_1vsoi_50`,closeBtn:`_closeBtn_1vsoi_67`,body:`_body_1vsoi_81`,indexWrap:`_indexWrap_1vsoi_87`,indexHint:`_indexHint_1vsoi_88`,versionList:`_versionList_1vsoi_94`,versionBtn:`_versionBtn_1vsoi_102`,versionLabel:`_versionLabel_1vsoi_118`,versionSummary:`_versionSummary_1vsoi_124`,details:`_details_1vsoi_129`,section:`_section_1vsoi_130`,sectionTitle:`_sectionTitle_1vsoi_131`,itemList:`_itemList_1vsoi_139`,item:`_item_1vsoi_139`,empty:`_empty_1vsoi_154`},nl=[{key:`added`,label:`✨ Added`,icon:`✨`},{key:`fixed`,label:`🐛 Fixed`,icon:`🐛`},{key:`changed`,label:`🔄 Changed`,icon:`🔄`},{key:`updated`,label:`📝 Updated`,icon:`📝`}];function rl({onClose:e,defaultVersion:t=null}){let{sortedVersions:n,getVersion:r,loading:i,error:a}=el(),[o,s]=(0,v.useState)(t?`details`:`index`),[c,l]=(0,v.useState)(t),u=e=>{l(e),s(`details`)},d=()=>{l(null),s(`index`)},f=c?r(c):null;return(0,P.jsx)(`div`,{className:tl.backdrop,onClick:e,children:(0,P.jsxs)(`div`,{className:tl.modal,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(`div`,{className:tl.header,children:(0,P.jsxs)(`div`,{className:tl.titleRow,children:[(0,P.jsx)(`h2`,{className:tl.title,children:o===`index`?`📋 Changelog`:`📋 v${c}`}),o===`details`&&(0,P.jsxs)(`button`,{className:tl.backBtn,onClick:d,title:`Back to index (TUI: B)`,children:[(0,P.jsx)(Un,{size:14,stroke:1.5}),` Index`]}),(0,P.jsx)(`button`,{className:tl.closeBtn,onClick:e,"aria-label":`Close changelog`,children:(0,P.jsx)(Yr,{size:18,stroke:1.5})})]})}),(0,P.jsxs)(`div`,{className:tl.body,children:[i&&(0,P.jsx)(`div`,{className:tl.empty,children:`Loading changelog…`}),a&&!i&&(0,P.jsxs)(`div`,{className:tl.empty,children:[`Failed to load changelog: `,a]}),!i&&!a&&o===`index`&&(0,P.jsxs)(`div`,{className:tl.indexWrap,children:[(0,P.jsxs)(`p`,{className:tl.indexHint,children:[n.length,` versions. Click any to read the release notes.`]}),(0,P.jsx)(`ul`,{className:tl.versionList,children:n.map(e=>{let t=r(e),n=[];return t?.added?.length&&n.push(`${t.added.length} added`),t?.fixed?.length&&n.push(`${t.fixed.length} fixed`),t?.changed?.length&&n.push(`${t.changed.length} changed`),(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{className:tl.versionBtn,onClick:()=>u(e),children:[(0,P.jsxs)(`span`,{className:tl.versionLabel,children:[`v`,e]}),(0,P.jsx)(`span`,{className:tl.versionSummary,children:n.length>0?n.join(` · `):`—`})]})},e)})})]}),!i&&!a&&o===`details`&&f&&(0,P.jsxs)(`div`,{className:tl.details,children:[nl.map(({key:e,label:t})=>{let n=f[e];return!n||n.length===0?null:(0,P.jsxs)(`section`,{className:tl.section,children:[(0,P.jsx)(`h3`,{className:tl.sectionTitle,children:t}),(0,P.jsx)(`ul`,{className:tl.itemList,children:n.map((e,t)=>(0,P.jsx)(`li`,{className:tl.item,children:il(e)},t))})]},e)}),nl.every(({key:e})=>!f[e]?.length)&&(0,P.jsxs)(`div`,{className:tl.empty,children:[`No release notes for v`,c,`.`]})]}),!i&&!a&&o===`details`&&!f&&(0,P.jsxs)(`div`,{className:tl.empty,children:[`No notes for v`,c,`.`]})]})]})})}function il(e){return e.replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/`([^`]+)`/g,`$1`).trim()}var al={wrap:`_wrap_10lrt_6`,chip:`_chip_10lrt_11`,checking:`_checking_10lrt_34`,dot:`_dot_10lrt_42`,pulse:`_pulse_10lrt_1`,popover:`_popover_10lrt_54`,popoverHeader:`_popoverHeader_10lrt_67`,popoverTitle:`_popoverTitle_10lrt_74`,popoverClose:`_popoverClose_10lrt_82`,popoverBody:`_popoverBody_10lrt_95`,popoverActions:`_popoverActions_10lrt_107`,primaryAction:`_primaryAction_10lrt_113`,secondaryAction:`_secondaryAction_10lrt_114`};function ol({updateAvailable:e,latestVersion:t,onRunUpdate:n,onOpenChangelog:r,checking:i}){let[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]),e?(0,P.jsxs)(`div`,{className:al.wrap,ref:s,children:[(0,P.jsxs)(`button`,{className:al.chip,onClick:()=>o(e=>!e),title:`Update available: v${t}. Click to install.`,"aria-expanded":a,"aria-haspopup":`dialog`,children:[(0,P.jsx)(lr,{size:13,stroke:1.5}),(0,P.jsxs)(`span`,{children:[`v`,t]})]}),a&&(0,P.jsxs)(`div`,{className:al.popover,role:`dialog`,"aria-label":`Update available`,children:[(0,P.jsxs)(`div`,{className:al.popoverHeader,children:[(0,P.jsxs)(`div`,{className:al.popoverTitle,children:[(0,P.jsx)(lr,{size:14,stroke:1.5}),(0,P.jsx)(`span`,{children:`Update available`})]}),(0,P.jsx)(`button`,{className:al.popoverClose,onClick:()=>o(!1),"aria-label":`Close`,children:(0,P.jsx)(Yr,{size:14,stroke:1.5})})]}),(0,P.jsxs)(`p`,{className:al.popoverBody,children:[`A newer version (`,(0,P.jsxs)(`strong`,{children:[`v`,t]}),`) is available on npm. After updating, restart the dashboard to pick up the changes.`]}),(0,P.jsxs)(`div`,{className:al.popoverActions,children:[(0,P.jsxs)(`button`,{className:al.primaryAction,onClick:()=>{o(!1),n?.()},children:[(0,P.jsx)(lr,{size:13,stroke:1.5}),(0,P.jsx)(`span`,{children:`Update now`})]}),(0,P.jsxs)(`button`,{className:al.secondaryAction,onClick:()=>{o(!1),r?.(t)},children:[(0,P.jsx)(yr,{size:13,stroke:1.5}),(0,P.jsx)(`span`,{children:`What's new`})]})]})]})]}):i?(0,P.jsx)(`span`,{className:al.checking,title:`Checking for updates…`,children:(0,P.jsx)(`span`,{className:al.dot})}):null}var sl={quickfix:{label:`Quick Fix`,sweWeight:.2,speedWeight:.5,ctxWeight:.1,stabilityWeight:.2},refactor:{label:`Deep Refactor`,sweWeight:.4,speedWeight:.1,ctxWeight:.3,stabilityWeight:.2},review:{label:`Code Review`,sweWeight:.35,speedWeight:.2,ctxWeight:.25,stabilityWeight:.2},testgen:{label:`Test Generation`,sweWeight:.35,speedWeight:.15,ctxWeight:.2,stabilityWeight:.3}},cl={speed:{label:`Speed`,speedMultiplier:1.5,sweMultiplier:.7},quality:{label:`Quality`,speedMultiplier:.7,sweMultiplier:1.5},balanced:{label:`Balanced`,speedMultiplier:1,sweMultiplier:1}},ll={small:{label:`Small file (<4K)`,minCtx:0,idealCtx:32},medium:{label:`Medium project (<32K)`,minCtx:32,idealCtx:128},large:{label:`Large codebase (>32K)`,minCtx:128,idealCtx:256}};function ul({onToast:e}={}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(null),l=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>{l.current&&clearInterval(l.current)},[]),{recommend:(0,v.useCallback)(async t=>{l.current&&clearInterval(l.current),n(!0),i(0),o([]),c(null);let r=Date.now();l.current=setInterval(()=>{i(Math.min(98,Math.round((Date.now()-r)/1e4*100)))},250);try{await new Promise(e=>setTimeout(e,1e4));let e=await fetch(`/api/recommend`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({answers:t})}),n=await e.json().catch(()=>({}));if(!e.ok)throw Error(n.error||`HTTP ${e.status}`);return o(Array.isArray(n.top3)?n.top3:[]),i(100),{ok:!0,top3:n.top3||[]}}catch(t){return c(t.message),e?.(`Recommend failed: ${t.message}`,`error`),{ok:!1,error:t.message}}finally{l.current&&clearInterval(l.current),l.current=null,n(!1)}},[e]),loading:t,progress:r,results:a,error:s,reset:(0,v.useCallback)(()=>{l.current&&clearInterval(l.current),l.current=null,n(!1),i(0),o([]),c(null)},[])}}var dl={backdrop:`_backdrop_gpeci_2`,modal:`_modal_gpeci_10`,header:`_header_gpeci_25`,footer:`_footer_gpeci_26`,eyebrow:`_eyebrow_gpeci_29`,summary:`_summary_gpeci_30`,muted:`_muted_gpeci_31`,close:`_close_gpeci_32`,secondary:`_secondary_gpeci_33`,body:`_body_gpeci_37`,steps:`_steps_gpeci_38`,options:`_options_gpeci_40`,option:`_option_gpeci_40`,progress:`_progress_gpeci_45`,percent:`_percent_gpeci_47`,results:`_results_gpeci_48`,resultCard:`_resultCard_gpeci_49`,medal:`_medal_gpeci_50`,resultMain:`_resultMain_gpeci_51`,score:`_score_gpeci_55`,error:`_error_gpeci_56`},fl=[{key:`taskType`,title:`What are you working on?`,options:sl},{key:`priority`,title:`What matters most?`,options:cl},{key:`contextBudget`,title:`How big is your context?`,options:ll}];function pl({onClose:e,onLaunch:t,onPinAndLaunch:n,toolMode:r,onToast:i}){let[a,o]=(0,v.useState)(0),[s,c]=(0,v.useState)({taskType:null,priority:null,contextBudget:null}),{recommend:l,loading:u,progress:d,results:f,error:p,reset:m}=ul({onToast:i}),h=fl[a],g=f.length>0,_=(0,v.useMemo)(()=>fl.map(e=>e.options[s[e.key]]?.label).filter(Boolean).join(` · `),[s]);async function y(e){let t={...s,[h.key]:e};if(c(t),a<fl.length-1){o(a+1);return}await l(t)}function b(){if(g||u){m(),o(0),c({taskType:null,priority:null,contextBudget:null});return}o(e=>Math.max(0,e-1))}return(0,P.jsx)(`div`,{className:dl.backdrop,onClick:e,children:(0,P.jsxs)(`div`,{className:dl.modal,onClick:e=>e.stopPropagation(),children:[(0,P.jsxs)(`header`,{className:dl.header,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:dl.eyebrow,children:`Smart Recommend`}),(0,P.jsxs)(`h2`,{children:[(0,P.jsx)(Vr,{size:20}),` Find the best model for this task`]}),_&&(0,P.jsx)(`p`,{className:dl.summary,children:_})]}),(0,P.jsx)(`button`,{className:dl.close,onClick:e,"aria-label":`Close`,children:(0,P.jsx)(Yr,{size:18})})]}),!u&&!g&&(0,P.jsxs)(`main`,{className:dl.body,children:[(0,P.jsxs)(`div`,{className:dl.steps,children:[`Question `,a+1,` / `,fl.length]}),(0,P.jsx)(`h3`,{children:h.title}),(0,P.jsx)(`div`,{className:dl.options,children:Object.entries(h.options).map(([e,t])=>(0,P.jsxs)(`button`,{className:dl.option,onClick:()=>y(e),children:[(0,P.jsx)(`strong`,{children:t.label}),(0,P.jsx)(`span`,{children:e})]},e))})]}),u&&(0,P.jsxs)(`main`,{className:dl.body,children:[(0,P.jsx)(`h3`,{children:`Analyzing live catalog…`}),(0,P.jsx)(`p`,{className:dl.muted,children:`10 seconds · roughly 2 checks/sec · same scoring as the TUI.`}),(0,P.jsx)(`div`,{className:dl.progress,children:(0,P.jsx)(`span`,{style:{width:`${d}%`}})}),(0,P.jsxs)(`p`,{className:dl.percent,children:[d,`%`]})]}),g&&(0,P.jsxs)(`main`,{className:dl.body,children:[(0,P.jsx)(`h3`,{children:`Top 3 recommendations`}),(0,P.jsx)(`div`,{className:dl.results,children:f.map((e,t)=>(0,P.jsxs)(`article`,{className:dl.resultCard,children:[(0,P.jsx)(`div`,{className:dl.medal,children:[`🥇`,`🥈`,`🥉`][t]}),(0,P.jsxs)(`div`,{className:dl.resultMain,children:[(0,P.jsx)(`strong`,{children:e.result.label}),(0,P.jsxs)(`span`,{children:[e.result.origin,` · `,e.result.tier,` · `,e.result.ctx]}),(0,P.jsx)(`p`,{children:e.reason})]}),(0,P.jsx)(`div`,{className:dl.score,children:e.score}),(0,P.jsx)(Ks,{model:e.result,toolMode:r,onLaunch:()=>n?.(e.result)})]},`${e.result.providerKey}/${e.result.modelId}`))})]}),p&&(0,P.jsx)(`p`,{className:dl.error,children:p}),(0,P.jsxs)(`footer`,{className:dl.footer,children:[(0,P.jsxs)(`button`,{className:dl.secondary,onClick:b,disabled:a===0&&!u&&!g,children:[(0,P.jsx)(Un,{size:14}),` `,g||u?`Restart`:`Back`]}),(0,P.jsx)(`button`,{className:dl.secondary,onClick:e,children:`Close`})]})]})})}var ml={backdrop:`_backdrop_8r8li_2`,modal:`_modal_8r8li_13`,modalWide:`_modalWide_8r8li_14`,header:`_header_8r8li_25`,eyebrow:`_eyebrow_8r8li_40`,close:`_close_8r8li_48`,body:`_body_8r8li_61`,command:`_command_8r8li_62`,note:`_note_8r8li_72`,muted:`_muted_8r8li_73`,docs:`_docs_8r8li_74`,error:`_error_8r8li_75`,footer:`_footer_8r8li_76`,primary:`_primary_8r8li_83`,secondary:`_secondary_8r8li_84`,option:`_option_8r8li_85`,grid:`_grid_8r8li_103`,card:`_card_8r8li_104`,stack:`_stack_8r8li_111`};function hl({request:e,models:t=[],onClose:n,onSwitchToolLaunch:r,onLaunchSimilar:i}){if(!e?.model)return null;let{model:a,toolMode:o}=e,s=bn(o),c=Sn(a.providerKey),l=wn(a.sweScore,o,t,3).filter(e=>e.modelId!==a.modelId||e.providerKey!==a.providerKey);return(0,P.jsx)(`div`,{className:ml.backdrop,onClick:n,children:(0,P.jsxs)(`div`,{className:ml.modalWide,onClick:e=>e.stopPropagation(),children:[(0,P.jsxs)(`div`,{className:ml.header,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:ml.eyebrow,children:`Incompatible model`}),(0,P.jsxs)(`h2`,{children:[(0,P.jsx)(Vn,{size:18}),` `,a.label,` cannot be installed in `,s.emoji,` `,s.label]})]}),(0,P.jsx)(`button`,{className:ml.close,onClick:n,"aria-label":`Close`,children:(0,P.jsx)(Yr,{size:18})})]}),(0,P.jsxs)(`div`,{className:ml.grid,children:[(0,P.jsxs)(`section`,{className:ml.card,children:[(0,P.jsxs)(`h3`,{children:[(0,P.jsx)(Wr,{size:15}),` Switch tool`]}),(0,P.jsx)(`p`,{className:ml.muted,children:`This provider can be configured in these tools. Pick one and FCM installs the endpoint.`}),(0,P.jsx)(`div`,{className:ml.stack,children:c.map(e=>{let t=bn(e);return(0,P.jsxs)(`button`,{className:ml.option,onClick:()=>r?.(e,a),children:[(0,P.jsx)(`span`,{children:t.emoji}),(0,P.jsx)(`strong`,{children:t.label})]},e)})})]}),(0,P.jsxs)(`section`,{className:ml.card,children:[(0,P.jsxs)(`h3`,{children:[(0,P.jsx)(Mr,{size:15}),` Similar models`]}),(0,P.jsxs)(`p`,{className:ml.muted,children:[`Or keep `,s.label,` and install a compatible model close to the same SWE score.`]}),(0,P.jsxs)(`div`,{className:ml.stack,children:[l.length===0&&(0,P.jsx)(`p`,{className:ml.muted,children:`No close compatible alternative found yet.`}),l.map(e=>(0,P.jsxs)(`button`,{className:ml.option,onClick:()=>i?.(e),children:[(0,P.jsx)(`span`,{children:e.tier}),(0,P.jsx)(`strong`,{children:e.label}),(0,P.jsxs)(`small`,{children:[e.providerKey,` · `,e.sweScore]})]},`${e.providerKey}/${e.modelId}`))]})]})]})]})})}var q={overlay:`_overlay_uatt9_1`,modal:`_modal_uatt9_10`,header:`_header_uatt9_24`,title:`_title_uatt9_32`,closeBtn:`_closeBtn_uatt9_42`,body:`_body_uatt9_53`,heroCard:`_heroCard_uatt9_60`,heroRunning:`_heroRunning_uatt9_69`,heroStopped:`_heroStopped_uatt9_74`,heroLeft:`_heroLeft_uatt9_79`,heroStatus:`_heroStatus_uatt9_85`,statusDot:`_statusDot_uatt9_91`,dotGreen:`_dotGreen_uatt9_98`,dotGray:`_dotGray_uatt9_103`,heroLabel:`_heroLabel_uatt9_107`,heroMeta:`_heroMeta_uatt9_113`,heroActions:`_heroActions_uatt9_121`,startBtn:`_startBtn_uatt9_127`,startBtnBig:`_startBtnBig_uatt9_144`,stopBtn:`_stopBtn_uatt9_150`,refreshBtn:`_refreshBtn_uatt9_166`,quickSetup:`_quickSetup_uatt9_181`,quickSetupHero:`_quickSetupHero_uatt9_186`,copyAllBtn:`_copyAllBtn_uatt9_195`,sectionTitle:`_sectionTitle_uatt9_212`,quickRows:`_quickRows_uatt9_224`,quickRow:`_quickRow_uatt9_224`,quickLabel:`_quickLabel_uatt9_240`,quickValue:`_quickValue_uatt9_248`,copyBtn:`_copyBtn_uatt9_258`,section:`_section_uatt9_212`,probeModes:`_probeModes_uatt9_273`,probeBtn:`_probeBtn_uatt9_278`,probeActive:`_probeActive_uatt9_290`,modelList:`_modelList_uatt9_298`,modelRow:`_modelRow_uatt9_304`,modelPriority:`_modelPriority_uatt9_314`,modelName:`_modelName_uatt9_320`,modelScore:`_modelScore_uatt9_329`,modelLatency:`_modelLatency_uatt9_335`,circuitBadge:`_circuitBadge_uatt9_341`,circuitClosed:`_circuitClosed_uatt9_352`,circuitOpen:`_circuitOpen_uatt9_353`,circuitHalfOpen:`_circuitHalfOpen_uatt9_354`,circuitAuth:`_circuitAuth_uatt9_355`,circuitUnknown:`_circuitUnknown_uatt9_356`,logList:`_logList_uatt9_359`,logRow:`_logRow_uatt9_365`,logOk:`_logOk_uatt9_374`,logErr:`_logErr_uatt9_375`,logModel:`_logModel_uatt9_376`,logLatency:`_logLatency_uatt9_377`,logTokens:`_logTokens_uatt9_378`,logFailover:`_logFailover_uatt9_379`,logEmpty:`_logEmpty_uatt9_388`,setMeta:`_setMeta_uatt9_405`,setMetaName:`_setMetaName_uatt9_414`,setActions:`_setActions_uatt9_420`,smallBtn:`_smallBtn_uatt9_426`,primaryBtn:`_primaryBtn_uatt9_443`,setList:`_setList_uatt9_460`,setEmpty:`_setEmpty_uatt9_467`,setEmptyTitle:`_setEmptyTitle_uatt9_477`,setEmptyHint:`_setEmptyHint_uatt9_484`,setRow:`_setRow_uatt9_494`,setRowDragging:`_setRowDragging_uatt9_513`,setRowDropTarget:`_setRowDropTarget_uatt9_519`,setRowDropTargetAbove:`_setRowDropTargetAbove_uatt9_524`,setRowDropTargetBelow:`_setRowDropTargetBelow_uatt9_528`,setDragHandle:`_setDragHandle_uatt9_532`,setPriority:`_setPriority_uatt9_543`,setKey:`_setKey_uatt9_552`,setTier:`_setTier_uatt9_562`,setPriorityPrimary:`_setPriorityPrimary_uatt9_577`,setPriorityFallback:`_setPriorityFallback_uatt9_589`,setRowNext:`_setRowNext_uatt9_597`,priorityLegend:`_priorityLegend_uatt9_604`,legendPrimary:`_legendPrimary_uatt9_618`,legendFallback:`_legendFallback_uatt9_626`,legendSeparator:`_legendSeparator_uatt9_631`,legendNext:`_legendNext_uatt9_636`,setRowBtns:`_setRowBtns_uatt9_647`,iconBtn:`_iconBtn_uatt9_652`,removeBtn:`_removeBtn_uatt9_666`,pickerPanel:`_pickerPanel_uatt9_669`,pickerHeader:`_pickerHeader_uatt9_680`,pickerSearch:`_pickerSearch_uatt9_689`,pickerInput:`_pickerInput_uatt9_694`,pickerSelect:`_pickerSelect_uatt9_707`,pickerList:`_pickerList_uatt9_720`,pickerItem:`_pickerItem_uatt9_728`,pickerItemAdded:`_pickerItemAdded_uatt9_741`,pickerProvider:`_pickerProvider_uatt9_747`,pickerModel:`_pickerModel_uatt9_752`,pickerBadge:`_pickerBadge_uatt9_759`,pickerBadgeOk:`_pickerBadgeOk_uatt9_769`,pickerEmpty:`_pickerEmpty_uatt9_774`,saveStatus:`_saveStatus_uatt9_781`,saveStatusOk:`_saveStatusOk_uatt9_791`,saveStatusErr:`_saveStatusErr_uatt9_792`,autoHealBanner:`_autoHealBanner_uatt9_796`,autoHealLeft:`_autoHealLeft_uatt9_808`,autoHealIcon:`_autoHealIcon_uatt9_816`,autoHealTitle:`_autoHealTitle_uatt9_823`,autoHealHint:`_autoHealHint_uatt9_830`,autoHealActions:`_autoHealActions_uatt9_840`,probeBtnActive:`_probeBtnActive_uatt9_852`,probeProgress:`_probeProgress_uatt9_859`,probeProgressLabel:`_probeProgressLabel_uatt9_870`,probeProgressCount:`_probeProgressCount_uatt9_879`,probeProgressBar:`_probeProgressBar_uatt9_886`,probeProgressFill:`_probeProgressFill_uatt9_893`,aiLatencyCell:`_aiLatencyCell_uatt9_904`,aiLatencyMs:`_aiLatencyMs_uatt9_914`,aiLatencyTps:`_aiLatencyTps_uatt9_919`,aiLatencySpin:`_aiLatencySpin_uatt9_924`,probeSpin:`_probeSpin_uatt9_1`,aiLatencyErr:`_aiLatencyErr_uatt9_936`,aiLatencyNone:`_aiLatencyNone_uatt9_941`,miniPgHint:`_miniPgHint_uatt9_950`,miniPg:`_miniPg_uatt9_950`,miniPgEmpty:`_miniPgEmpty_uatt9_976`,miniPgMsg:`_miniPgMsg_uatt9_983`,miniPgUser:`_miniPgUser_uatt9_990`,miniPgAssistant:`_miniPgAssistant_uatt9_995`,miniPgBubble:`_miniPgBubble_uatt9_1000`,miniPgTyping:`_miniPgTyping_uatt9_1022`,miniPgError:`_miniPgError_uatt9_1028`,miniPgAborted:`_miniPgAborted_uatt9_1035`,miniPgTarget:`_miniPgTarget_uatt9_1047`,miniPgRouted:`_miniPgRouted_uatt9_1045`,miniPgInputRow:`_miniPgInputRow_uatt9_1074`,miniPgInput:`_miniPgInput_uatt9_1074`,miniPgSendBtn:`_miniPgSendBtn_uatt9_1101`,miniPgStopBtn:`_miniPgStopBtn_uatt9_1102`,fadeIn:`_fadeIn_uatt9_1`};function gl(e){if(!e||e<=0)return`—`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return t>0?`${t}h ${n}m`:n>0?`${n}m ${r}s`:`${r}s`}function _l(e){return typeof e!=`number`||!Number.isFinite(e)?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}var vl={CLOSED:{label:`Healthy`,cls:`circuitClosed`},OPEN:{label:`Down`,cls:`circuitOpen`},HALF_OPEN:{label:`Recovering`,cls:`circuitHalfOpen`},AUTH_ERROR:{label:`Auth error`,cls:`circuitAuth`},STALE:{label:`Deprecated`,cls:`circuitUnknown`},UNSUPPORTED:{label:`Unsupported`,cls:`circuitUnknown`},UNKNOWN:{label:`Unknown`,cls:`circuitUnknown`}};function yl({state:e}){let t=vl[e]||vl.UNKNOWN;return(0,P.jsx)(`span`,{className:`${q.circuitBadge} ${q[t.cls]}`,children:t.label})}var bl={kind:`idle`},xl={kind:`saving`},Sl={kind:`saved`},Cl=e=>({kind:`error`,message:e});function wl({onClose:e,onToast:t,favorites:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)({activeSet:null,sets:{}}),[b,x]=(0,v.useState)([]),[S,C]=(0,v.useState)(!1),[w,ee]=(0,v.useState)(``),[T,E]=(0,v.useState)(``),[D,te]=(0,v.useState)(bl),ne=(0,v.useRef)(null),re=(0,v.useRef)(!1),[ie,ae]=(0,v.useState)(!1),oe=(0,v.useCallback)(async()=>{try{let e=await(await fetch(`/api/router/status`)).json();if(i(e),e?.ok){let e=await(await fetch(`/api/router/stats`)).json();e.ok&&o(e)}}catch{}},[]),se=(0,v.useCallback)(async()=>{try{let e=await(await fetch(`/api/router/sets`)).json();e&&e.sets&&y(e)}catch{}},[]),O=(0,v.useCallback)(async()=>{try{let e=await(await fetch(`/api/router/catalog`)).json();Array.isArray(e?.models)&&x(e.models)}catch{}},[]);(0,v.useEffect)(()=>{oe(),se(),O(),fetch(`/api/router/quick-setup`).then(e=>e.json()).then(c).catch(()=>{});let e=setInterval(()=>{oe(),se()},5e3);return()=>clearInterval(e)},[oe,se,O]),(0,v.useEffect)(()=>{if(!ie)return;let e=setInterval(()=>{oe()},1200);return()=>clearInterval(e)},[ie,oe]),(0,v.useEffect)(()=>{ie&&a?.globalBenchmark&&!a.globalBenchmark.running&&ae(!1)},[a?.globalBenchmark,ie]),(0,v.useEffect)(()=>{if(D.kind===`saved`)return ne.current=setTimeout(()=>te(bl),1500),()=>{ne.current&&clearTimeout(ne.current)}},[D]);let k=async()=>{u(!0);try{let e=await(await fetch(`/api/router/start`,{method:`POST`})).json();e.ok||e.alreadyRunning?(t?.(`Router daemon started.`,`success`),await oe(),await se()):t?.(`Failed to start: ${e.error||e.message||`unknown`}`,`error`)}catch(e){let n=e.name===`TypeError`&&e.message?.includes(`fetch`)?`Cannot reach daemon — it may not be installed or the port is blocked`:e.message;t?.(`Start failed: ${n}`,`error`)}finally{u(!1)}},ce=async()=>{u(!0);try{let e=await(await fetch(`/api/router/stop`,{method:`POST`})).json();e.ok?(t?.(`Router daemon stopped.`,`success`),i({ok:!1,running:!1}),o(null)):t?.(`Failed to stop: ${e.error||`unknown`}`,`error`)}catch(e){t?.(`Stop failed: ${e.message}`,`error`)}finally{u(!1)}},le=(e,t)=>{navigator.clipboard.writeText(e).then(()=>{m(t),setTimeout(()=>m(null),1500)})},ue=async e=>{try{await fetch(`/api/router/probe-mode`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({probeMode:e})}),t?.(`Probe mode set to ${e}.`,`info`),await oe()}catch{}},A=_?.activeSet||r?.activeSet||`fast-coding`,de=_?.sets?.[A]||{models:[]},fe=Array.isArray(de.models)?de.models:[],pe=async e=>{try{await fetch(`/api/router/sets/${encodeURIComponent(e)}/activate`,{method:`POST`}),t?.(`Active set: ${e}`,`info`),await se(),await oe()}catch(e){t?.(`Failed to activate: ${e.message}`,`error`)}},me=async()=>{if(A){te(xl),t?.(`Probing models with your keys…`,`info`);try{let e=await fetch(`/api/router/sets/${encodeURIComponent(A)}/sync`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`HTTP ${e.status}`)}let n=await e.json(),r=n.selected?.length||0,i=n.probeCount||0;t?.(`Synced ${A}: ${r} working model${r===1?``:`s`} from ${i} probes.`,`success`),await se(),await oe(),te(Sl)}catch(e){te(Cl(e.message||String(e))),t?.(`Sync failed: ${e.message}`,`error`)}}},he=async()=>{if(!A)return;let e=n?.favorites||[];if(e.length===0){t?.(`You do not have any favorite models yet. Star some models first!`,`info`);return}let r=e.map((e,t)=>{let n=e.split(`/`);return{provider:n[0],model:n.slice(1).join(`/`),priority:t+1}});te(xl);try{let n=await fetch(`/api/router/sets/${encodeURIComponent(A)}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({models:r})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`HTTP ${n.status}`)}let i=await n.json();i?.sets?.[A]?y(e=>({...e,sets:i.sets})):await se(),te(Sl),t?.(`Replaced active set with ${e.length} favorite model${e.length===1?``:`s`}.`,`success`),await oe()}catch(e){te(Cl(e.message||String(e))),t?.(`Failed to replace set: ${e.message}`,`error`)}},ge=(0,v.useCallback)(async e=>{if(A){te(xl);try{let t=e.map(e=>`${e.provider}/${e.model}`),n=await fetch(`/api/router/sets/${encodeURIComponent(A)}/reorder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({order:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`HTTP ${n.status}`)}let r=await n.json();r?.sets?.[A]?y(e=>({...e,sets:r.sets})):await se(),te(Sl)}catch(e){te(Cl(e.message||String(e))),t?.(`Reorder failed: ${e.message}`,`error`)}}},[A,se,t]),_e=(0,v.useCallback)(async(e,n)=>{if(A){te(xl);try{let r=await fetch(`/api/router/sets/${encodeURIComponent(A)}/models`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e,model:n})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||`HTTP ${r.status}`)}let i=await r.json();i?.sets?.[A]?y(e=>({...e,sets:i.sets})):await se(),te(Sl),t?.(`Added ${e}/${n} to ${A}.`,`success`)}catch(e){te(Cl(e.message||String(e))),t?.(`Add failed: ${e.message}`,`error`)}}},[A,se,t]),ve=(0,v.useCallback)(async(e,n)=>{if(A){te(xl);try{let t=await fetch(`/api/router/sets/${encodeURIComponent(A)}/models`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e,model:n})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`HTTP ${t.status}`)}let r=await t.json();r?.sets?.[A]?y(e=>({...e,sets:r.sets})):await se(),te(Sl)}catch(e){te(Cl(e.message||String(e))),t?.(`Remove failed: ${e.message}`,`error`)}}},[A,se,t]),ye=async()=>{if(!(!A||ie)){if(j.length===0){t?.(`Add models to the set first, then probe.`,`info`);return}try{let e=j.map(e=>({providerKey:e.provider,modelId:e.model})),n=await fetch(`/api/router/probe-all`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({models:e})}),r=await n.json().catch(()=>null);if(!n.ok||!n.status||n.status===409)throw Error(r?.error||`Probe already running`);ae(!0);let i=r?.total??j.length;t?.(`Probing ${i} model${i===1?``:`s`} for AI Latency…`,`info`),await oe()}catch(e){t?.(`Probe failed: ${e.message}`,`error`),ae(!1)}}},[j,be]=(0,v.useState)(fe);(0,v.useEffect)(()=>{be(fe)},[fe]);let[xe,Se]=(0,v.useState)(null),[Ce,we]=(0,v.useState)(null),Te=(0,v.useCallback)(async(e,t)=>{let n=[...j],r=t===`up`?e-1:e+1;if(r<0||r>=n.length)return;let[i]=n.splice(e,1);n.splice(r,0,i),be(n),await ge(n)},[j,ge]),Ee=(0,v.useCallback)(async e=>{let t=j[e];t&&(be(j.filter((t,n)=>n!==e)),await ve(t.provider,t.model))},[j,ve]),De=(e,t)=>{let n=j[t];n&&(Se(`${n.provider}/${n.model}`),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,`${n.provider}/${n.model}`))},Oe=(e,t)=>{if(xe==null)return;e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=j[t];if(!n)return;let r=`${n.provider}/${n.model}`;if(r===xe)return;let i=e.currentTarget.getBoundingClientRect();we({key:r,side:e.clientY<i.top+i.height/2?`above`:`below`})},ke=e=>{e.currentTarget.contains(e.relatedTarget)},Ae=async(e,t)=>{if(e.preventDefault(),xe==null)return;let n=j.findIndex(e=>`${e.provider}/${e.model}`===xe);if(n<0){Se(null),we(null);return}if(!j[t]){Se(null),we(null);return}let r=e.currentTarget.getBoundingClientRect(),i=(e.clientY<r.top+r.height/2?`above`:`below`)==`above`?t:t+1;if(n<i&&--i,i===n){Se(null),we(null);return}let a=[...j],[o]=a.splice(n,1);a.splice(i,0,o),be(a),Se(null),we(null),await ge(a)},je=()=>{Se(null),we(null)},Me=(0,v.useMemo)(()=>{let e=new Set(b.map(e=>e.provider));return Array.from(e).sort()},[b]),Ne=(0,v.useMemo)(()=>{let e=w.trim().toLowerCase();return b.filter(t=>T&&t.provider!==T?!1:e?t.key.toLowerCase().includes(e)||(t.label||``).toLowerCase().includes(e)||t.provider.toLowerCase().includes(e):!0).slice(0,200)},[b,w,T]),Pe=(e,t)=>j.some(n=>n.provider===e&&n.model===t),Fe=r?.ok,Ie=a?.circuitBreakers||{},Le=a?.requestLog||[],Re=a?.routingOrder||[],ze=Re.length>0?Re[0].key:null,Be=new Map;for(let e of a?.models||[])e&&typeof e.key==`string`&&Be.set(e.key,e);let Ve=a?.globalBenchmark||null,He=!!Ve?.running||ie;(0,v.useEffect)(()=>{Le.length>0&&!re.current&&(re.current=!0,f(!0))},[Le.length]);let Ue=Fe&&s?.baseUrl?s.baseUrl:`http://localhost:19280/v1`,We=s?.model||`fcm`,Ge=`fcm-local`,Ke=`Base URL: ${Ue}\nModel: ${We}\nAPI Key: ${Ge}`,qe=_?.sets||{},Je=Object.keys(qe).sort();return(0,P.jsx)(`div`,{className:q.overlay,onClick:t=>t.target===t.currentTarget&&e(),children:(0,P.jsxs)(`div`,{className:q.modal,children:[(0,P.jsxs)(`div`,{className:q.header,children:[(0,P.jsxs)(`h2`,{className:q.title,children:[(0,P.jsx)(Lr,{size:20,stroke:1.5}),`Router Dashboard`]}),(0,P.jsx)(`button`,{className:q.closeBtn,onClick:e,"aria-label":`Close`,children:`✕`})]}),(0,P.jsxs)(`div`,{className:q.body,children:[Fe&&r?.brokenModelCount>0&&!h&&(0,P.jsxs)(`div`,{className:q.autoHealBanner,children:[(0,P.jsxs)(`div`,{className:q.autoHealLeft,children:[(0,P.jsx)(`span`,{className:q.autoHealIcon,children:`⚠`}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:q.autoHealTitle,children:[r.brokenModelCount,` model`,r.brokenModelCount===1?``:`s`,` in the active set are not responding`]}),(0,P.jsxs)(`div`,{className:q.autoHealHint,children:[`Auto-heal ran on startup but the replacement may also be broken. Click `,(0,P.jsx)(`strong`,{children:`Sync best`}),` below to re-probe with your current keys, or click `,(0,P.jsx)(`strong`,{children:`Fix now`}),` to manually replace the broken entries.`]})]})]}),(0,P.jsxs)(`div`,{className:q.autoHealActions,children:[(0,P.jsxs)(`button`,{className:q.smallBtn,onClick:me,children:[(0,P.jsx)(Jr,{size:11}),`Fix now`]}),(0,P.jsx)(`button`,{className:q.iconBtn,onClick:()=>g(!0),"aria-label":`Dismiss`,children:(0,P.jsx)(Yr,{size:12})})]})]}),(0,P.jsxs)(`div`,{className:`${q.quickSetup} ${Fe?q.quickSetupHero:``}`,children:[(0,P.jsxs)(`h3`,{className:q.sectionTitle,children:[(0,P.jsx)(sr,{size:14}),`Quick Setup`,(0,P.jsxs)(`button`,{className:q.copyAllBtn,onClick:()=>le(Ke,`all`),children:[p===`all`?(0,P.jsx)(Yn,{size:12}):(0,P.jsx)(sr,{size:12}),p===`all`?`Copied!`:`Copy all`]})]}),(0,P.jsxs)(`div`,{className:q.quickRows,children:[(0,P.jsxs)(`div`,{className:q.quickRow,children:[(0,P.jsx)(`span`,{className:q.quickLabel,children:`Base URL`}),(0,P.jsx)(`code`,{className:q.quickValue,children:Ue}),(0,P.jsx)(`button`,{className:q.copyBtn,onClick:()=>le(Ue,`url`),children:p===`url`?(0,P.jsx)(Yn,{size:12}):(0,P.jsx)(sr,{size:12})})]}),(0,P.jsxs)(`div`,{className:q.quickRow,children:[(0,P.jsx)(`span`,{className:q.quickLabel,children:`Model`}),(0,P.jsx)(`code`,{className:q.quickValue,children:We}),(0,P.jsx)(`button`,{className:q.copyBtn,onClick:()=>le(We,`model`),children:p===`model`?(0,P.jsx)(Yn,{size:12}):(0,P.jsx)(sr,{size:12})})]}),(0,P.jsxs)(`div`,{className:q.quickRow,children:[(0,P.jsx)(`span`,{className:q.quickLabel,children:`API Key`}),(0,P.jsx)(`code`,{className:q.quickValue,children:Ge}),(0,P.jsx)(`button`,{className:q.copyBtn,onClick:()=>le(Ge,`key`),children:p===`key`?(0,P.jsx)(Yn,{size:12}):(0,P.jsx)(sr,{size:12})})]})]})]}),(0,P.jsxs)(`div`,{className:`${q.heroCard} ${Fe?q.heroRunning:q.heroStopped}`,children:[(0,P.jsxs)(`div`,{className:q.heroLeft,children:[(0,P.jsxs)(`div`,{className:q.heroStatus,children:[(0,P.jsx)(`span`,{className:`${q.statusDot} ${Fe?q.dotGreen:q.dotGray}`}),(0,P.jsx)(`span`,{className:q.heroLabel,children:Fe?`Running`:`Stopped`})]}),Fe&&(0,P.jsxs)(`div`,{className:q.heroMeta,children:[(0,P.jsxs)(`span`,{children:[`Port `,r.port]}),(0,P.jsx)(`span`,{children:`·`}),(0,P.jsxs)(`span`,{children:[`Uptime `,gl(r.uptimeSeconds)]}),(0,P.jsx)(`span`,{children:`·`}),(0,P.jsxs)(`span`,{children:[r.requestsRouted,` requests`]})]}),!Fe&&(0,P.jsx)(`div`,{className:q.heroMeta,children:`Smart failover router — start to route requests to the healthiest model.`})]}),(0,P.jsxs)(`div`,{className:q.heroActions,children:[Fe?(0,P.jsxs)(`button`,{className:q.stopBtn,onClick:ce,disabled:l,children:[(0,P.jsx)(jr,{size:14}),l?`Stopping…`:`Stop`]}):(0,P.jsxs)(`button`,{className:`${q.startBtn} ${q.startBtnBig}`,onClick:k,disabled:l,children:[(0,P.jsx)(Ar,{size:16}),l?`Starting…`:`Start Router`]}),(0,P.jsx)(`button`,{className:q.refreshBtn,onClick:oe,title:`Refresh`,children:(0,P.jsx)(Ir,{size:14})})]})]}),Fe&&(0,P.jsxs)(`div`,{className:q.section,children:[(0,P.jsxs)(`h3`,{className:q.sectionTitle,children:[(0,P.jsx)(wr,{size:14}),`Active Set (`,j.length,` models)`]}),(0,P.jsxs)(`div`,{className:q.setMeta,children:[(0,P.jsxs)(`div`,{className:q.setActions,children:[(0,P.jsx)(`span`,{className:q.setMetaName,children:A}),Je.length>1&&(0,P.jsx)(`select`,{className:q.pickerSelect,value:A,onChange:e=>pe(e.target.value),title:`Switch the active set`,children:Je.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))})]}),(0,P.jsxs)(`div`,{className:q.setActions,children:[(0,P.jsx)(Tl,{status:D}),(0,P.jsxs)(`button`,{className:q.smallBtn,onClick:me,disabled:D.kind===`saving`,title:`Probe your API keys and rebuild the set with only models that actually work`,children:[(0,P.jsx)(Jr,{size:11}),`Sync best`]}),n&&(0,P.jsxs)(`button`,{className:q.smallBtn,onClick:he,disabled:D.kind===`saving`,title:`Replace current router models with your favorite models`,children:[(0,P.jsx)(wr,{size:11}),`Use favorites`]}),(0,P.jsxs)(`button`,{className:`${q.smallBtn} ${He?q.probeBtnActive:``}`,onClick:ye,disabled:He||D.kind===`saving`||j.length===0,title:`Benchmark AI Latency + TPS on every model in this set`,children:[(0,P.jsx)(qn,{size:11}),He?`Probing…`:`Probe all`]}),(0,P.jsxs)(`button`,{className:q.primaryBtn,onClick:()=>C(e=>!e),disabled:D.kind===`saving`,children:[S?(0,P.jsx)(Yr,{size:11}):(0,P.jsx)(Pr,{size:11}),S?`Close`:`Add model`]})]})]}),He&&Ve&&(0,P.jsxs)(`div`,{className:q.probeProgress,children:[(0,P.jsxs)(`div`,{className:q.probeProgressLabel,children:[(0,P.jsx)(qn,{size:11}),`AI Latency probe`,(0,P.jsxs)(`span`,{className:q.probeProgressCount,children:[Ve.completed,` / `,Ve.total||j.length]})]}),(0,P.jsx)(`div`,{className:q.probeProgressBar,children:(0,P.jsx)(`div`,{className:q.probeProgressFill,style:{width:`${Math.min(100,(Ve.completed||0)/Math.max(1,Ve.total||j.length)*100)}%`}})})]}),j.length===0?(0,P.jsxs)(`div`,{className:q.setEmpty,children:[(0,P.jsx)(`div`,{className:q.setEmptyTitle,children:`No models in the active set`}),(0,P.jsxs)(`div`,{className:q.setEmptyHint,children:[`Add models from the picker below, or click `,(0,P.jsx)(`strong`,{children:`Sync best`}),` above to auto-pick working models.`]})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:q.priorityLegend,children:[(0,P.jsxs)(`span`,{className:q.legendPrimary,children:[(0,P.jsx)(Wn,{size:11}),` Primary`]}),(0,P.jsx)(`span`,{className:q.legendSeparator,children:`tries first`}),(0,P.jsx)(`span`,{className:q.legendFallback,children:`Fallback`}),(0,P.jsx)(`span`,{className:q.legendSeparator,children:`on failure / rate-limit`}),Fe&&ze&&(0,P.jsxs)(`span`,{className:q.legendNext,children:[`Next up: `,(0,P.jsx)(`code`,{children:ze})]})]}),(0,P.jsx)(`div`,{className:q.setList,onDragLeave:ke,children:j.map((e,t)=>{let n=`${e.provider}/${e.model}`,r=Ie[n]||{},i=Be.get(n),a=i?.benchmark||null,o=!!i?.isBenchmarking,s=xe===n,c=Ce?.key===n&&Ce.side===`above`,l=Ce?.key===n&&Ce.side===`below`,u=t===0,d=Fe&&ze===n;return(0,P.jsxs)(`div`,{className:`${q.setRow} ${s?q.setRowDragging:``} ${d?q.setRowNext:``} ${c?`${q.setRowDropTarget} ${q.setRowDropTargetAbove}`:``} ${l?`${q.setRowDropTarget} ${q.setRowDropTargetBelow}`:``}`,draggable:!0,onDragStart:e=>De(e,t),onDragOver:e=>Oe(e,t),onDrop:e=>Ae(e,t),onDragEnd:je,title:n,children:[(0,P.jsx)(`span`,{className:q.setDragHandle,"aria-hidden":!0,children:(0,P.jsx)(vr,{size:14})}),(0,P.jsx)(`span`,{className:`${q.setPriority} ${u?q.setPriorityPrimary:q.setPriorityFallback}`,title:u?`Primary model — tried first on every request`:`Fallback #${t+1} — used when higher-priority models fail or rate-limit`,children:u?`Primary`:`#${t+1}`}),(0,P.jsx)(`span`,{className:q.setKey,children:n}),e.tier&&(0,P.jsx)(`span`,{className:q.setTier,children:e.tier}),(0,P.jsx)(yl,{state:r.state||e.state}),(0,P.jsx)(`span`,{className:q.aiLatencyCell,title:a?`AI Latency: ${Math.round(a.totalMs)}ms · TPS: ${(a.tokensPerSecond??0).toFixed(1)}`:`Run Probe all to measure AI Latency`,children:o?(0,P.jsx)(`span`,{className:q.aiLatencySpin,children:`···`}):a?.ok?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{className:q.aiLatencyMs,children:[Math.round(a.totalMs),`ms`]}),a.tokensPerSecond!=null&&a.tokensPerSecond>0&&(0,P.jsxs)(`span`,{className:q.aiLatencyTps,children:[a.tokensPerSecond.toFixed(1),` t/s`]})]}):a&&!a.ok?(0,P.jsx)(`span`,{className:q.aiLatencyErr,children:`fail`}):(0,P.jsx)(`span`,{className:q.aiLatencyNone,children:`—`})}),(0,P.jsxs)(`div`,{className:q.setRowBtns,children:[(0,P.jsx)(`button`,{className:q.iconBtn,onClick:()=>Te(t,`up`),disabled:t===0||D.kind===`saving`,title:`Move up`,"aria-label":`Move ${n} up`,children:(0,P.jsx)(Gn,{size:12})}),(0,P.jsx)(`button`,{className:q.iconBtn,onClick:()=>Te(t,`down`),disabled:t===j.length-1||D.kind===`saving`,title:`Move down`,"aria-label":`Move ${n} down`,children:(0,P.jsx)(Hn,{size:12})}),(0,P.jsx)(`button`,{className:`${q.iconBtn} ${q.removeBtn}`,onClick:()=>Ee(t),disabled:D.kind===`saving`,title:`Remove from set`,"aria-label":`Remove ${n}`,children:(0,P.jsx)(Gr,{size:12})})]})]},n)})})]}),S&&(0,P.jsxs)(`div`,{className:q.pickerPanel,children:[(0,P.jsxs)(`div`,{className:q.pickerHeader,children:[(0,P.jsxs)(`span`,{children:[`Add a model to `,(0,P.jsx)(`code`,{children:A})]}),(0,P.jsxs)(`span`,{style:{color:`var(--text-muted, #888)`},children:[Ne.length,` of `,b.length]})]}),(0,P.jsxs)(`div`,{className:q.pickerSearch,children:[(0,P.jsx)(`input`,{className:q.pickerInput,placeholder:`Search by provider, model, or label…`,value:w,onChange:e=>ee(e.target.value),autoFocus:!0}),(0,P.jsxs)(`select`,{className:q.pickerSelect,value:T,onChange:e=>E(e.target.value),children:[(0,P.jsx)(`option`,{value:``,children:`All providers`}),Me.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]})]}),(0,P.jsx)(`div`,{className:q.pickerList,children:Ne.length===0?(0,P.jsx)(`div`,{className:q.pickerEmpty,children:`No models match your filter.`}):Ne.map(e=>{let t=Pe(e.provider,e.model);return(0,P.jsxs)(`div`,{className:`${q.pickerItem} ${t?q.pickerItemAdded:``}`,onClick:()=>{t||_e(e.provider,e.model)},title:t?`Already in set`:`Add ${e.key}`,children:[(0,P.jsx)(`span`,{className:q.pickerProvider,children:e.provider}),(0,P.jsx)(`span`,{className:q.pickerModel,children:e.label||e.model}),e.tier&&(0,P.jsx)(`span`,{className:q.setTier,children:e.tier}),e.hasKey?(0,P.jsx)(`span`,{className:`${q.pickerBadge} ${q.pickerBadgeOk}`,children:`key`}):(0,P.jsx)(`span`,{className:q.pickerBadge,children:`no key`})]},e.key)})})]})]}),Fe&&(0,P.jsxs)(`div`,{className:q.section,children:[(0,P.jsxs)(`h3`,{className:q.sectionTitle,children:[(0,P.jsx)(zn,{size:14}),`Probe Mode`]}),(0,P.jsx)(`div`,{className:q.probeModes,children:[`eco`,`balanced`,`aggressive`].map(e=>(0,P.jsx)(`button`,{className:`${q.probeBtn} ${r?.probeMode===e?q.probeActive:``}`,onClick:()=>ue(e),children:e},e))})]}),Fe&&(0,P.jsxs)(`div`,{className:q.section,children:[(0,P.jsxs)(`h3`,{className:q.sectionTitle,onClick:()=>f(!d),style:{cursor:`pointer`},children:[(0,P.jsx)(zn,{size:14}),`Request Log (`,Le.length,`)`,d?(0,P.jsx)(er,{size:12}):(0,P.jsx)(Zn,{size:12})]}),d&&(Le.length===0?(0,P.jsx)(`div`,{className:q.logEmpty,children:`No requests yet. Start coding to see traffic here.`}):(0,P.jsx)(`div`,{className:q.logList,children:Le.map((e,t)=>(0,P.jsxs)(`div`,{className:q.logRow,children:[(0,P.jsx)(`span`,{className:e.error?q.logErr:q.logOk,children:e.status||`—`}),(0,P.jsx)(`span`,{className:q.logModel,children:e.model}),(0,P.jsx)(`span`,{className:q.logLatency,children:e.latency_ms==null?`—`:`${e.latency_ms}ms`}),(0,P.jsx)(`span`,{className:q.logTokens,children:e.tokens>0?_l(e.tokens)+` tok`:``}),e.failover&&(0,P.jsx)(`span`,{className:q.logFailover,children:`failover`})]},t))}))]}),Fe&&(0,P.jsxs)(`div`,{className:q.section,children:[(0,P.jsxs)(`h3`,{className:q.sectionTitle,children:[(0,P.jsx)(zr,{size:14}),`Test Router`,(0,P.jsxs)(`span`,{className:q.miniPgHint,children:[`routes through `,(0,P.jsx)(`code`,{children:`fcm`}),` — try the fallback chain`]})]}),(0,P.jsx)(Zs,{model:`fcm`,variant:`mini`,disabled:!Fe,targetLabel:ze||`fcm`,placeholder:`Test the router… (e.g. write a haiku about TypeScript)`,emptyHint:`Send a message to see which model the router picks, with latency + TPS.`})]}),(0,P.jsx)(`div`,{className:q.section,style:{marginBottom:0,marginTop:16},children:(0,P.jsx)(`span`,{className:q.saveStatus,children:a?.tokenStats?`${_l(a.tokenStats.all_time?.total_tokens||0)} tokens routed lifetime`:``})})]})]})})}function Tl({status:e}){return!e||e.kind===`idle`?null:e.kind===`saving`?(0,P.jsx)(`span`,{className:q.saveStatus,children:`saving…`}):e.kind===`saved`?(0,P.jsx)(`span`,{className:`${q.saveStatus} ${q.saveStatusOk}`,children:`✓ saved`}):e.kind===`error`?(0,P.jsxs)(`span`,{className:`${q.saveStatus} ${q.saveStatusErr}`,title:e.message,children:[`⚠ `,e.message?.slice(0,40)||`error`]}):null}var J={overlay:`_overlay_1kxet_7`,modal:`_modal_1kxet_16`,header:`_header_1kxet_40`,headerLeft:`_headerLeft_1kxet_49`,headerTitle:`_headerTitle_1kxet_56`,headerSubtitle:`_headerSubtitle_1kxet_64`,headerActions:`_headerActions_1kxet_70`,iconBtn:`_iconBtn_1kxet_76`,modelBar:`_modelBar_1kxet_94`,modelLabel:`_modelLabel_1kxet_105`,modelSelect:`_modelSelect_1kxet_110`,presetChip:`_presetChip_1kxet_128`,prePromptToggle:`_prePromptToggle_1kxet_145`,transcript:`_transcript_1kxet_158`,chatBody:`_chatBody_1kxet_171`,empty:`_empty_1kxet_178`,emptyTitle:`_emptyTitle_1kxet_190`,emptyHint:`_emptyHint_1kxet_196`,message:`_message_1kxet_202`,msgIn:`_msgIn_1kxet_1`,user:`_user_1kxet_215`,assistant:`_assistant_1kxet_219`,system:`_system_1kxet_223`,messageRole:`_messageRole_1kxet_228`,bubble:`_bubble_1kxet_237`,codeBlock:`_codeBlock_1kxet_268`,meta:`_meta_1kxet_280`,metaChip:`_metaChip_1kxet_289`,provider:`_provider_1kxet_300`,error:`_error_1kxet_305`,cursor:`_cursor_1kxet_310`,blink:`_blink_1kxet_1`,inputBar:`_inputBar_1kxet_325`,textarea:`_textarea_1kxet_335`,sendBtn:`_sendBtn_1kxet_360`,errorBar:`_errorBar_1kxet_385`,stopBar:`_stopBar_1kxet_397`,stopBtn:`_stopBtn_1kxet_409`,daemonStartPanel:`_daemonStartPanel_1kxet_426`,daemonStartTitle:`_daemonStartTitle_1kxet_438`,daemonStartHint:`_daemonStartHint_1kxet_444`,daemonStartBtn:`_daemonStartBtn_1kxet_451`,daemonStartAlt:`_daemonStartAlt_1kxet_483`,spin:`_spin_1kxet_497`,spinAnim:`_spinAnim_1kxet_1`,fadeIn:`_fadeIn_1kxet_1`,slideUp:`_slideUp_1kxet_1`},El=[`Write a Python fizzbuzz with type hints`,`Explain Big O notation with three examples`,`Refactor a deeply nested for-loop into map/filter`,`Write a tiny Express endpoint that returns JSON`];function Dl({routerStatus:e,daemonRunning:t}){return t===!0?(0,P.jsxs)(`span`,{className:J.metaChip,children:[(0,P.jsx)(qn,{size:11}),`Router online`]}):t===!1?(0,P.jsxs)(`span`,{className:`${J.metaChip} ${J.error}`,children:[(0,P.jsx)(Vn,{size:11}),`Router offline`]}):(0,P.jsxs)(`span`,{className:J.metaChip,children:[(0,P.jsx)(Tr,{size:11,className:J.spin}),`Checking router…`]})}function Ol({onClose:e,onToast:t,models:n,routerStatus:r}){let[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!0),[c,l]=(0,v.useState)(!0),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(r?.running===!0?!0:null),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(5),y=(0,v.useRef)(null),b=(0,v.useRef)(null),x=(0,v.useRef)(!1),[S,C]=(0,v.useState)({count:0,totalTokens:0}),w=(0,v.useRef)(null);(0,v.useEffect)(()=>{fetch(`/api/router/preprompt`).then(e=>e.json()).then(e=>{e&&typeof e==`object`&&(l(e.enabled===!0),typeof e.text==`string`&&d(e.text))}).catch(()=>{})},[]),(0,v.useEffect)(()=>{if(i!==null)return;let e=(Array.isArray(n)?n:[]).filter(e=>e.status===`up`&&e.hasApiKey&&!e.isPinging);if(e.length>0){let t={"S+":0,S:1,"A+":2,A:3,"A-":4,"B+":5,B:6,C:7};e.sort((e,n)=>{let r=t[e.tier]??99,i=t[n.tier]??99;return r===i?(typeof e.avg==`number`?e.avg:99999)-(typeof n.avg==`number`?n.avg:99999):r-i}),a(`${e[0].providerKey}/${e[0].modelId}`);return}a(`fcm`)},[n,i]),(0,v.useEffect)(()=>{let e=!0;async function t(){try{let t=await(await fetch(`/api/router/status`)).json();if(!e)return;p(t?.running===!0)}catch{e&&p(!1)}}return t(),()=>{e=!1,y.current&&clearInterval(y.current),b.current&&clearInterval(b.current)}},[]);let ee=(0,v.useCallback)(async()=>{if(!m){y.current&&=(clearInterval(y.current),null),x.current=!0,h(!0);try{await fetch(`/api/router/start`,{method:`POST`});let e=0;await new Promise(t=>{b.current=setInterval(async()=>{e+=1;try{(await(await fetch(`/api/router/status`)).json())?.running&&(clearInterval(b.current),p(!0),h(!1),t())}catch{}e>=30&&(clearInterval(b.current),h(!1),t())},1e3)})}catch{h(!1)}}},[m]);(0,v.useEffect)(()=>{if(f!==!1||i!==`fcm`||x.current)return;let e=5;return _(5),y.current=setInterval(()=>{--e,_(e),e<=0&&(clearInterval(y.current),x.current=!0,ee())},1e3),()=>{y.current&&clearInterval(y.current)}},[f,i,ee]);let T=(0,v.useMemo)(()=>{let e=[{value:`fcm`,label:`fcm — auto router (recommended)`}];if(Array.isArray(n))for(let t of n.slice(0,200)){let n=t.modelId||t.id;if(!n)continue;let r=t.label||n;e.push({value:`${t.providerKey}/${n}`,label:`${t.providerKey}/${n} (${r})`})}return e},[n]),E=(0,v.useCallback)(e=>{C({count:e.count,totalTokens:e.totalTokens})},[]),D=(0,v.useCallback)(()=>{w.current?.clear(),C({count:0,totalTokens:0})},[]),te=!(i===`fcm`&&f!==!0),ne=S.count>0,re=i===`fcm`&&!ne&&f===!1&&!m,ie=i===`fcm`&&!ne&&m,ae=!re&&!ie;return(0,P.jsx)(`div`,{className:J.overlay,onClick:t=>{t.target===t.currentTarget&&e()},children:(0,P.jsxs)(`div`,{className:J.modal,role:`dialog`,"aria-label":`Free Coding Models Playground`,children:[(0,P.jsxs)(`div`,{className:J.header,children:[(0,P.jsxs)(`div`,{className:J.headerLeft,children:[(0,P.jsxs)(`div`,{className:J.headerTitle,children:[(0,P.jsx)(Or,{size:18}),`Playground`]}),(0,P.jsxs)(`div`,{className:J.headerSubtitle,children:[`Chat with the FCM router · `,S.count,` message`,S.count===1?``:`s`,` · `,S.totalTokens,` tokens`]})]}),(0,P.jsxs)(`div`,{className:J.headerActions,children:[(0,P.jsx)(`button`,{className:J.iconBtn,onClick:D,title:`Clear conversation`,disabled:!ne,children:(0,P.jsx)(Gr,{size:16})}),(0,P.jsx)(`button`,{className:J.iconBtn,onClick:e,title:`Close (Esc)`,children:(0,P.jsx)(Yr,{size:16})})]})]}),(0,P.jsxs)(`div`,{className:J.modelBar,children:[(0,P.jsx)(`span`,{className:J.modelLabel,children:`Model:`}),(0,P.jsx)(`select`,{className:J.modelSelect,value:i??`fcm`,onChange:e=>a(e.target.value),disabled:!ae,children:T.map(e=>(0,P.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,P.jsx)(`button`,{className:J.presetChip,onClick:()=>s(e=>!e),title:`Toggle streaming`,children:o?`⚡ Streaming`:`🐢 One-shot`}),(0,P.jsxs)(`label`,{className:J.prePromptToggle,title:`Router persona injected as the first system message`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked)}),`Pre-prompt`]}),(0,P.jsx)(Dl,{routerStatus:r,daemonRunning:f})]}),c&&u&&(0,P.jsxs)(`div`,{className:J.modelBar,style:{borderTop:`none`,background:`transparent`,paddingTop:4,paddingBottom:8,fontSize:11},children:[(0,P.jsx)(`span`,{className:J.modelLabel,style:{flexShrink:0},children:`Persona:`}),(0,P.jsx)(`span`,{style:{opacity:.7,fontStyle:`italic`},children:u.length>160?`${u.slice(0,160)}…`:u})]}),(0,P.jsxs)(`div`,{className:J.chatBody,children:[re?(0,P.jsxs)(`div`,{className:J.daemonStartPanel,children:[(0,P.jsx)(Vn,{size:32,style:{color:`#fbbf24`,opacity:.8}}),(0,P.jsx)(`div`,{className:J.daemonStartTitle,children:`Router daemon is not running`}),(0,P.jsx)(`div`,{className:J.daemonStartHint,children:`The playground routes your chats through the FCM router daemon. Start it to begin chatting with free coding models, or pick a specific model above.`}),(0,P.jsx)(`button`,{className:J.daemonStartBtn,onClick:ee,title:`Start the router daemon`,children:m?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Tr,{size:14,className:J.spin}),` Starting…`]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ar,{size:14}),` Start Router`,g>0&&!x.current?` (auto in ${g}s)`:``]})}),(0,P.jsxs)(`div`,{className:J.daemonStartAlt,children:[`Or run `,(0,P.jsx)(`code`,{children:`free-coding-models --daemon-bg`}),` in your terminal`]})]}):ie?(0,P.jsxs)(`div`,{className:J.daemonStartPanel,children:[(0,P.jsx)(Tr,{size:32,className:J.spin,style:{color:`var(--accent, #22c55e)`}}),(0,P.jsx)(`div`,{className:J.daemonStartTitle,children:`Starting router daemon…`}),(0,P.jsx)(`div`,{className:J.daemonStartHint,children:`The daemon is being launched. This usually takes a few seconds. You'll be able to chat as soon as it's ready.`})]}):null,ae&&(0,P.jsx)(Zs,{ref:w,model:i||`fcm`,variant:`full`,stream:o,disabled:!te,onTurnComplete:E,suggestions:El,emptyTitle:`Try the FCM router in 10 seconds`,emptyHint:`Each request is auto-routed to the healthiest free coding model in your active set, or sent directly to the model you picked. Every reply shows the served model, latency, and TPS below it.`,emptyIcon:(0,P.jsx)(Or,{size:42,style:{opacity:.5}}),placeholder:`Ask anything. Enter to send, Shift+Enter for a newline.`})]})]})})}function kl(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!0),i=(0,v.useCallback)(async()=>{r(!0);try{t((await(await fetch(`/api/installed-models`)).json()).results||[])}catch{t([])}finally{r(!1)}},[]);return(0,v.useEffect)(()=>{i()},[i]),{results:e,loading:n,refresh:i,disableModel:(0,v.useCallback)(async(e,t)=>{let n=await(await fetch(`/api/installed-models/${encodeURIComponent(e)}/${encodeURIComponent(t)}/disable`,{method:`POST`})).json();return n.success&&await i(),n},[i])}}var Al={overlay:`_overlay_rvjv7_1`,modal:`_modal_rvjv7_10`,header:`_header_rvjv7_24`,title:`_title_rvjv7_32`,count:`_count_rvjv7_42`,headerActions:`_headerActions_rvjv7_51`,refreshBtn:`_refreshBtn_rvjv7_57`,closeBtn:`_closeBtn_rvjv7_71`,body:`_body_rvjv7_82`,empty:`_empty_rvjv7_88`,hint:`_hint_rvjv7_96`,toolGroup:`_toolGroup_rvjv7_102`,toolHeader:`_toolHeader_rvjv7_106`,toolEmoji:`_toolEmoji_rvjv7_113`,toolLabel:`_toolLabel_rvjv7_117`,toolCount:`_toolCount_rvjv7_123`,toolMissing:`_toolMissing_rvjv7_128`,modelList:`_modelList_rvjv7_139`,modelRow:`_modelRow_rvjv7_146`,modelIcon:`_modelIcon_rvjv7_157`,modelName:`_modelName_rvjv7_161`,modelTier:`_modelTier_rvjv7_166`,modelId:`_modelId_rvjv7_175`,disableBtn:`_disableBtn_rvjv7_185`,fadeIn:`_fadeIn_rvjv7_1`};function jl({onClose:e,onToast:t}){let{results:n,loading:r,refresh:i,disableModel:a}=kl(),o=async(e,n)=>{try{let r=await a(e,n);r.success?t?.(`Disabled ${n} in ${e}.`,`success`):t?.(`Failed: ${r.error||`unknown error`}`,`error`)}catch(e){t?.(`Error: ${e.message}`,`error`)}},s=n.reduce((e,t)=>e+t.models.length,0);return(0,P.jsx)(`div`,{className:Al.overlay,onClick:t=>t.target===t.currentTarget&&e(),children:(0,P.jsxs)(`div`,{className:Al.modal,children:[(0,P.jsxs)(`div`,{className:Al.header,children:[(0,P.jsxs)(`h2`,{className:Al.title,children:[(0,P.jsx)(_r,{size:20,stroke:1.5}),`Installed Models`,!r&&(0,P.jsx)(`span`,{className:Al.count,children:s})]}),(0,P.jsxs)(`div`,{className:Al.headerActions,children:[(0,P.jsx)(`button`,{className:Al.refreshBtn,onClick:i,title:`Refresh`,children:(0,P.jsx)(Ir,{size:14})}),(0,P.jsx)(`button`,{className:Al.closeBtn,onClick:e,"aria-label":`Close`,children:`✕`})]})]}),(0,P.jsxs)(`div`,{className:Al.body,children:[r&&(0,P.jsx)(`div`,{className:Al.empty,children:`Scanning tool configs…`}),!r&&s===0&&(0,P.jsxs)(`div`,{className:Al.empty,children:[`No models found in tool configs.`,(0,P.jsx)(`br`,{}),(0,P.jsx)(`span`,{className:Al.hint,children:`Use "Install Endpoints" to configure models for your tools.`})]}),!r&&n.map(e=>(0,P.jsxs)(`div`,{className:Al.toolGroup,children:[(0,P.jsxs)(`div`,{className:Al.toolHeader,children:[(0,P.jsx)(`span`,{className:Al.toolEmoji,children:e.toolEmoji}),(0,P.jsx)(`span`,{className:Al.toolLabel,children:e.toolLabel}),(0,P.jsxs)(`span`,{className:Al.toolCount,children:[e.models.length,` model`,e.models.length===1?``:`s`]}),!e.isValid&&(0,P.jsx)(`span`,{className:Al.toolMissing,children:`Not installed`})]}),e.models.length>0&&(0,P.jsx)(`div`,{className:Al.modelList,children:e.models.map(t=>(0,P.jsxs)(`div`,{className:Al.modelRow,children:[(0,P.jsx)(`span`,{className:Al.modelIcon,children:t.isExternal?`🔗`:`✅`}),(0,P.jsx)(`span`,{className:Al.modelName,children:t.label}),t.tier&&t.tier!==`-`&&(0,P.jsx)(`span`,{className:Al.modelTier,children:t.tier}),(0,P.jsx)(`span`,{className:Al.modelId,title:t.modelId,children:t.modelId}),(0,P.jsx)(`button`,{className:Al.disableBtn,onClick:()=>o(e.toolMode,t.modelId),title:`Remove model from config (backup saved)`,children:(0,P.jsx)(Gr,{size:12})})]},`${e.toolMode}-${t.modelId}`))})]},e.toolMode))]})]})})}var Y={overlay:`_overlay_1nrgq_1`,modal:`_modal_1nrgq_10`,header:`_header_1nrgq_24`,title:`_title_1nrgq_32`,closeBtn:`_closeBtn_1nrgq_42`,steps:`_steps_1nrgq_54`,step:`_step_1nrgq_54`,stepActive:`_stepActive_1nrgq_71`,stepDone:`_stepDone_1nrgq_76`,stepNum:`_stepNum_1nrgq_80`,stepLabel:`_stepLabel_1nrgq_105`,body:`_body_1nrgq_111`,stepContent:`_stepContent_1nrgq_118`,stepDesc:`_stepDesc_1nrgq_120`,loading:`_loading_1nrgq_126`,empty:`_empty_1nrgq_126`,grid:`_grid_1nrgq_134`,pickCard:`_pickCard_1nrgq_140`,pickActive:`_pickActive_1nrgq_156`,pickEmoji:`_pickEmoji_1nrgq_162`,pickLabel:`_pickLabel_1nrgq_166`,pickMeta:`_pickMeta_1nrgq_171`,scopeToggle:`_scopeToggle_1nrgq_177`,scopeBtn:`_scopeBtn_1nrgq_183`,scopeActive:`_scopeActive_1nrgq_194`,modelGrid:`_modelGrid_1nrgq_202`,modelCard:`_modelCard_1nrgq_210`,modelSelected:`_modelSelected_1nrgq_224`,modelName:`_modelName_1nrgq_230`,modelTier:`_modelTier_1nrgq_236`,allNotice:`_allNotice_1nrgq_247`,installingState:`_installingState_1nrgq_255`,installingLabel:`_installingLabel_1nrgq_265`,installingSub:`_installingSub_1nrgq_271`,spinner:`_spinner_1nrgq_276`,spin:`_spin_1nrgq_276`,doneState:`_doneState_1nrgq_280`,doneFadeIn:`_doneFadeIn_1nrgq_1`,doneTitle:`_doneTitle_1nrgq_290`,doneSub:`_doneSub_1nrgq_296`,checkCircle:`_checkCircle_1nrgq_308`,checkPop:`_checkPop_1nrgq_1`,errorDot:`_errorDot_1nrgq_320`,installPath:`_installPath_1nrgq_334`,footer:`_footer_1nrgq_363`,backBtn:`_backBtn_1nrgq_370`,nextBtn:`_nextBtn_1nrgq_384`,doneBtn:`_doneBtn_1nrgq_401`,donePop:`_donePop_1nrgq_1`,fadeIn:`_fadeIn_1nrgq_1`},Ml=[`Provider`,`Tool`,`Models`,`Install`];function Nl({onClose:e,onToast:t}){let[n,r]=(0,v.useState)(0),[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)([]),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)([]),[m,h]=(0,v.useState)(`all`),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(!0),C=[{id:`opencode`,label:`OpenCode CLI`,emoji:`💻`},{id:`opencode-desktop`,label:`OpenCode Desktop`,emoji:`🖥️`},{id:`openclaw`,label:`OpenClaw`,emoji:`🦞`},{id:`crush`,label:`Crush`,emoji:`💘`},{id:`goose`,label:`Goose`,emoji:`🪿`},{id:`pi`,label:`Pi`,emoji:`π`},{id:`aider`,label:`Aider`,emoji:`🛠`},{id:`qwen`,label:`Qwen`,emoji:`🐉`},{id:`openhands`,label:`OpenHands`,emoji:`🤲`},{id:`amp`,label:`Amp`,emoji:`⚡`},{id:`forgecode`,label:`ForgeCode`,emoji:`🔥`},{id:`zcode`,label:`ZCode`,emoji:`🧊`},{id:`fcm_router`,label:`FCM Router`,emoji:`🔄`}];(0,v.useEffect)(()=>{fetch(`/api/install-endpoints/providers`).then(e=>e.json()).then(e=>{a(e.providers||[]),S(!1)}).catch(()=>S(!1))},[]),(0,v.useEffect)(()=>{o&&fetch(`/api/install-endpoints/catalog?provider=${o.providerKey}`).then(e=>e.json()).then(e=>l(e.models||[])).catch(()=>l([]))},[o]);let w=(0,v.useCallback)(e=>{p(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),ee=(0,v.useCallback)(()=>{p(c.map(e=>e.modelId)),h(`all`)},[c]);(0,v.useCallback)(()=>{p([]),h(`selected`)},[]);let T=()=>n===0?!!o:n===1?!!u:n===2?m===`all`||f.length>0:!0,E=async()=>{r(3),_(!0),b(null);try{let e=await(await fetch(`/api/install-endpoints/wizard`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({providerKey:o.providerKey,toolMode:u,scope:m,modelIds:m===`selected`?f:[]})})).json();e.success?(b(e),t?.(`Installed ${e.modelCount} models for ${o.label} into ${C.find(e=>e.id===u)?.label||u}.`,`success`)):(b(null),t?.(`Install failed: ${e.error||`unknown`}`,`error`),r(2))}catch(e){b(null),t?.(`Install error: ${e.message}`,`error`),r(2)}finally{_(!1)}};return(0,P.jsx)(`div`,{className:Y.overlay,onClick:t=>t.target===t.currentTarget&&e(),children:(0,P.jsxs)(`div`,{className:Y.modal,children:[(0,P.jsxs)(`div`,{className:Y.header,children:[(0,P.jsxs)(`h2`,{className:Y.title,children:[(0,P.jsx)(Nr,{size:20,stroke:1.5}),`Install Endpoints`]}),(0,P.jsx)(`button`,{className:Y.closeBtn,onClick:e,"aria-label":`Close`,children:`✕`})]}),(0,P.jsx)(`div`,{className:Y.steps,children:Ml.map((e,t)=>(0,P.jsxs)(`div`,{className:`${Y.step} ${t===n?Y.stepActive:t<n?Y.stepDone:``}`,children:[(0,P.jsx)(`span`,{className:Y.stepNum,children:t<n?(0,P.jsx)(Yn,{size:12}):t+1}),(0,P.jsx)(`span`,{className:Y.stepLabel,children:e})]},t))}),(0,P.jsxs)(`div`,{className:Y.body,children:[n===0&&(0,P.jsxs)(`div`,{className:Y.stepContent,children:[(0,P.jsx)(`p`,{className:Y.stepDesc,children:`Choose a provider with a configured API key.`}),x&&(0,P.jsx)(`div`,{className:Y.loading,children:`Loading providers…`}),!x&&i.length===0&&(0,P.jsx)(`div`,{className:Y.empty,children:`No configured providers found. Add API keys in Settings first.`}),(0,P.jsx)(`div`,{className:Y.grid,children:i.map(e=>(0,P.jsxs)(`button`,{className:`${Y.pickCard} ${o?.providerKey===e.providerKey?Y.pickActive:``}`,onClick:()=>{s(e),r(1)},children:[(0,P.jsx)(`span`,{className:Y.pickLabel,children:e.label}),(0,P.jsxs)(`span`,{className:Y.pickMeta,children:[e.modelCount,` models`]})]},e.providerKey))})]}),n===1&&(0,P.jsxs)(`div`,{className:Y.stepContent,children:[(0,P.jsxs)(`p`,{className:Y.stepDesc,children:[`Install `,(0,P.jsx)(`strong`,{children:o?.label}),` models into which tool?`]}),(0,P.jsx)(`div`,{className:Y.grid,children:C.map(e=>(0,P.jsxs)(`button`,{className:`${Y.pickCard} ${u===e.id?Y.pickActive:``}`,onClick:()=>{d(e.id),r(2)},children:[(0,P.jsx)(`span`,{className:Y.pickEmoji,children:e.emoji}),(0,P.jsx)(`span`,{className:Y.pickLabel,children:e.label})]},e.id))})]}),n===2&&(0,P.jsxs)(`div`,{className:Y.stepContent,children:[(0,P.jsxs)(`p`,{className:Y.stepDesc,children:[`Choose models to install from `,(0,P.jsx)(`strong`,{children:o?.label}),` into `,(0,P.jsx)(`strong`,{children:C.find(e=>e.id===u)?.label}),`.`]}),(0,P.jsxs)(`div`,{className:Y.scopeToggle,children:[(0,P.jsx)(`button`,{className:`${Y.scopeBtn} ${m===`all`?Y.scopeActive:``}`,onClick:()=>{h(`all`),ee()},children:`All Models`}),(0,P.jsx)(`button`,{className:`${Y.scopeBtn} ${m===`selected`?Y.scopeActive:``}`,onClick:()=>h(`selected`),children:`Select Models`})]}),m===`selected`&&(0,P.jsx)(`div`,{className:Y.modelGrid,children:c.map(e=>(0,P.jsxs)(`button`,{className:`${Y.modelCard} ${f.includes(e.modelId)?Y.modelSelected:``}`,onClick:()=>w(e.modelId),children:[(0,P.jsx)(`span`,{className:Y.modelName,children:e.label}),(0,P.jsx)(`span`,{className:Y.modelTier,children:e.tier})]},e.modelId))}),m===`all`&&(0,P.jsxs)(`div`,{className:Y.allNotice,children:[`All `,c.length,` models from `,o?.label,` will be installed.`]})]}),n===3&&(0,P.jsxs)(`div`,{className:Y.stepContent,children:[g&&(0,P.jsxs)(`div`,{className:Y.installingState,children:[(0,P.jsx)(Tr,{size:32,className:Y.spinner}),(0,P.jsxs)(`span`,{className:Y.installingLabel,children:[`Installing `,m===`all`?`all`:f.length,` model`,m===`all`&&c.length!==1?`s`:f.length===1?``:`s`,`…`]}),(0,P.jsxs)(`span`,{className:Y.installingSub,children:[`Writing config for `,C.find(e=>e.id===u)?.label]})]}),!g&&y&&(0,P.jsxs)(`div`,{className:Y.doneState,children:[(0,P.jsx)(`div`,{className:Y.checkCircle,children:(0,P.jsx)(Yn,{size:36})}),(0,P.jsx)(`h3`,{className:Y.doneTitle,children:`Installed!`}),(0,P.jsxs)(`p`,{className:Y.doneSub,children:[y.modelCount,` model`,y.modelCount===1?``:`s`,` from `,(0,P.jsx)(`strong`,{children:o?.label}),` → `,(0,P.jsx)(`strong`,{children:y.toolLabel})]}),(0,P.jsx)(`code`,{className:Y.installPath,children:y.path})]}),!g&&!y&&(0,P.jsxs)(`div`,{className:Y.doneState,children:[(0,P.jsx)(`span`,{className:Y.errorDot,children:`✕`}),(0,P.jsx)(`h3`,{className:Y.doneTitle,children:`Install failed`}),(0,P.jsx)(`p`,{className:Y.doneSub,children:`Check the toast for details. You can go back and retry.`})]})]})]}),(0,P.jsxs)(`div`,{className:Y.footer,children:[n>0&&n<3&&(0,P.jsxs)(`button`,{className:Y.backBtn,onClick:()=>{r(e=>Math.max(e-1,0))},children:[(0,P.jsx)(Qn,{size:14}),`Back`]}),n===3&&!g&&!y&&(0,P.jsxs)(`button`,{className:Y.backBtn,onClick:()=>r(2),children:[(0,P.jsx)(Qn,{size:14}),`Back`]}),n<3&&(0,P.jsx)(`button`,{className:Y.nextBtn,onClick:()=>{if(n===2){E();return}r(e=>Math.min(e+1,3))},disabled:!T(),children:n===2?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Nr,{size:14}),`Install`]}):(0,P.jsxs)(P.Fragment,{children:[`Next`,(0,P.jsx)($n,{size:14})]})}),n===3&&!g&&y&&(0,P.jsxs)(`button`,{className:Y.doneBtn,onClick:e,children:[(0,P.jsx)(Yn,{size:14}),`Done`]})]})]})})}var Pl={container:`_container_18l8h_1`},X={toast:`_toast_73ezc_1`,slideIn:`_slideIn_73ezc_1`,success:`_success_73ezc_17`,error:`_error_73ezc_18`,warning:`_warning_73ezc_19`,info:`_info_73ezc_20`,icon:`_icon_73ezc_27`,message:`_message_73ezc_28`,close:`_close_73ezc_29`,exiting:`_exiting_73ezc_38`,slideOut:`_slideOut_73ezc_1`},Fl={success:`✅`,error:`❌`,warning:`⚠️`,info:`ℹ️`};function Z({message:e,type:t=`info`,duration:n=3500,onDismiss:r}){let i=(0,v.useRef)(null);return(0,v.useEffect)(()=>(i.current=setTimeout(r,n),()=>clearTimeout(i.current)),[n,r]),(0,P.jsxs)(`div`,{className:`${X.toast} ${X[t]}`,children:[(0,P.jsx)(`span`,{className:X.icon,children:Fl[t]||`📌`}),(0,P.jsx)(`span`,{className:X.message,children:e}),(0,P.jsx)(`button`,{className:X.close,onClick:r,children:`×`})]})}function Q({toasts:e,dismissToast:t}){return(0,P.jsx)(`div`,{className:Pl.container,children:e.map(e=>(0,P.jsx)(Z,{message:e.message,type:e.type,onDismiss:()=>t(e.id)},e.id))})}var Il=0;function Ll(){let{models:e,connected:t,nextPingAt:n,isPinging:r,pingMode:i,globalBenchmarkRunning:a,globalBenchmarkTotal:o,globalBenchmarkCompleted:s}=It(),{theme:c,cycle:l}=dn(),[u,d]=(0,v.useState)(`dashboard`),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(null),[C,w]=(0,v.useState)([]),ee=(0,v.useRef)(Date.now());(0,v.useEffect)(()=>{try{typeof window<`u`&&window.posthog?.capture&&window.posthog.capture(`app_web_start`,{version:`0.5.41`,timestamp:new Date().toISOString()})}catch{}},[]),(0,v.useEffect)(()=>{if(u===`router`)try{typeof window<`u`&&window.posthog?.capture&&window.posthog.capture(`app_router_start`,{version:`0.5.41`,timestamp:new Date().toISOString()})}catch{}},[u]);let T=(0,v.useCallback)((e,t=`info`)=>{let n=++Il;w(r=>[...r,{id:n,message:e,type:t}]),setTimeout(()=>{w(e=>e.filter(e=>e.id!==n))},4e3)},[]),E=(0,v.useCallback)(e=>{w(t=>t.filter(t=>t.id!==e))},[]),{filtered:D,filterTier:te,setFilterTier:ne,filterStatus:re,setFilterStatus:ie,filterProvider:ae,setFilterProvider:oe,filterVerdict:se,setFilterVerdict:O,filterHealth:k,setFilterHealth:ce,visibilityMode:le,setVisibilityMode:ue,searchQuery:A,setSearchQuery:de,customTextFilter:fe,setCustomTextFilter:pe,sortColumn:me,sortDirection:he,setSortColumn:ge,setSortDirection:_e,toggleSort:ve,resetView:ye}=sn(e),{toolMode:j,setToolMode:be,cycleToolMode:xe}=_n({onToast:T});Pn({currentView:u,setCurrentView:d,filterState:{filterTier:te,setFilterTier:ne,filterStatus:re,setFilterStatus:ie,filterProvider:ae,setFilterProvider:oe,filterVerdict:se,setFilterVerdict:O,filterHealth:k,setFilterHealth:ce,sortColumn:me,sortDirection:he,setSortColumn:ge,setSortDirection:_e,toggleSort:ve,setSearchQuery:de,filterState:null,searchQuery:A},paletteOpen:g,setPaletteOpen:_,toolMode:j,setToolMode:be});let Se=pn({models:e}),Ce=(0,v.useCallback)(async(e,t=null)=>{let n=t||j||`opencode`;if(e){if(!Cn(e.providerKey,n)){S({model:e,toolMode:n});return}try{let t=await fetch(`/api/install-endpoint`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({providerKey:e.providerKey,modelId:e.modelId,toolMode:n})}),r=await t.json().catch(()=>({}));if(t.status===422&&r.code===`incompatible_model`){S({model:e,toolMode:n});return}if(!t.ok)throw Error(r.error||`HTTP ${t.status}`);T(`Endpoint installed for ${e.label} in ${n}. Start the tool yourself.`,`success`)}catch(e){T(`Endpoint install failed: ${e.message}`,`error`)}}},[T,j]),we=(0,v.useCallback)(async(e,t)=>{await be(e),S(null),await Ce(t,e)},[Ce,be]),Te=(0,v.useCallback)(async e=>{Se.isFavorite(e)||await Se.toggle(e),await Ce(e)},[Se,Ce]),{localVersion:Ee,latestVersion:De,updateAvailable:Oe,runUpdate:ke,checkNow:Ae,error:je}=Ln({onToast:T}),Me=(0,v.useMemo)(()=>{let t={};return e.forEach(e=>{t[e.providerKey]||(t[e.providerKey]={key:e.providerKey,name:e.origin,count:0,hasKey:!1,anyUp:!1}),t[e.providerKey].count++,e.hasApiKey&&(t[e.providerKey].hasKey=!0),e.status===`up`&&(t[e.providerKey].anyUp=!0)}),Object.values(t).sort((e,t)=>e.name.localeCompare(t.name))},[e]),Ne=(0,v.useCallback)(async()=>{if(!a)try{await fetch(`/api/global-benchmark`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({models:D.map(e=>({providerKey:e.providerKey,modelId:e.modelId}))})})}catch(e){console.error(`[Benchmark] Failed to start global benchmark:`,e.message)}},[D,a]),Pe=(0,v.useCallback)(async e=>{try{let t=await fetch(`/api/benchmark`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({providerKey:e.providerKey,modelId:e.modelId})});!t.ok&&t.status!==202&&T(`Benchmark failed: ${(await t.json().catch(()=>({})))?.error||t.statusText}`,`error`)}catch(e){console.error(`[Benchmark] per-row failed:`,e.message)}},[T]),Fe=(0,v.useCallback)(e=>{p(e),ee.current=Date.now()},[]);(0,v.useCallback)(()=>p(null),[]);let Ie=(0,v.useCallback)(async e=>{try{await fetch(`/api/ping-mode?action=${e}`,{method:`POST`})}catch{}},[]),Le=(0,v.useCallback)(e=>{e===`changelog`&&b(null),d(e),ee.current=Date.now()},[]),Re=(0,v.useCallback)(()=>{ye(),de(``),T(`View reset to defaults.`,`info`)},[T,ye,de]),ze=(0,v.useCallback)(e=>{b(e),d(`changelog`)},[]);return(0,v.useEffect)(()=>{let e=e=>{let t=e.metaKey||e.ctrlKey;if(t&&(e.key===`k`||e.key===`K`)){e.preventDefault(),_(e=>!e);return}if(t&&(e.key===`p`||e.key===`P`)&&!e.shiftKey){e.preventDefault(),_(e=>!e);return}if(e.key===`Escape`){if(g){_(!1);return}if(x){S(null);return}if(f){p(null);return}if(m){h(!1);return}}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g,x,f,m]),(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`app-shell`,children:[(0,P.jsx)(ii,{searchQuery:A,onSearchChange:de,currentView:u,onNavigate:Le,onToggleTheme:l,onOpenExport:()=>h(!0),onOpenCommandPalette:()=>_(!0),onBenchmark:Ne,benchmarkRunning:a,benchmarkTotal:o,benchmarkCompleted:s,modelsCount:D.length,theme:c,onToast:T,toolMode:j,onSetToolMode:be,onCycleToolMode:xe,updateSlot:(0,P.jsx)(ol,{updateAvailable:Oe,latestVersion:De,onRunUpdate:ke,onOpenChangelog:ze})}),(0,P.jsxs)(`div`,{className:`app-content`,children:[u===`dashboard`&&(0,P.jsxs)(`main`,{className:`view dashboardView`,children:[(0,P.jsx)(sa,{filterTier:te,setFilterTier:ne,filterStatus:re,setFilterStatus:ie,filterProvider:ae,setFilterProvider:oe,filterVerdict:se,setFilterVerdict:O,filterHealth:k,setFilterHealth:ce,visibilityMode:le,setVisibilityMode:ue,customTextFilter:fe,setCustomTextFilter:pe,searchQuery:A,onSearchChange:de,onResetView:Re,providers:Me,pingMode:i,setPingMode:Ie,nextPingAt:n,isPinging:r,globalBenchmarkRunning:a,globalBenchmarkTotal:o,globalBenchmarkCompleted:s,toolMode:j}),(0,P.jsx)(vc,{filtered:D,onSelectModel:Fe,onBenchmarkRow:Pe,onLaunch:Ce,favorites:Se,sortColumn:me,sortDirection:he,onSort:ve,toolMode:j,onToast:T,onSetToolMode:be,onCycleToolMode:xe,onOpenFallback:e=>S({model:e,toolMode:j})})]}),u===`settings`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(Cc,{onToast:T,onOpenChangelog:e=>{b(e),Le(`changelog`)},onCheckForUpdate:()=>{Ae(),T?.(`Checking for updates…`,`info`)}})}),u===`analytics`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(Nc,{models:e})}),u===`router`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(wl,{onClose:()=>Le(`dashboard`),onToast:T,favorites:Se})}),u===`playground`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(Ol,{onClose:()=>Le(`dashboard`),onToast:T,models:e,routerStatus:null})}),u===`help`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)($c,{onClose:()=>Le(`dashboard`)})}),u===`changelog`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(rl,{onClose:()=>Le(`dashboard`),defaultVersion:y})}),u===`installed-models`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(jl,{onClose:()=>Le(`dashboard`),onToast:T})}),u===`install-endpoints`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(Nl,{onClose:()=>Le(`dashboard`),onToast:T})}),u===`recommend`&&(0,P.jsx)(`div`,{className:`view`,children:(0,P.jsx)(pl,{onClose:()=>Le(`dashboard`),toolMode:j,onLaunch:Ce,onPinAndLaunch:Te,onToast:T})}),(0,P.jsx)(oi,{})]})]}),m&&(0,P.jsx)(xc,{models:D,onClose:()=>h(!1),onToast:T}),g&&(0,P.jsx)(Xc,{onClose:()=>_(!1),onNavigate:Le,onCycleTheme:l,onResetView:Re,onSetPingMode:Ie,onOpenHelp:()=>Le(`help`),onOpenChangelog:()=>{b(null),Le(`changelog`)},onOpenPlayground:()=>Le(`playground`),onExport:()=>h(!0),onRunUpdate:ke,currentView:u,theme:c,pingMode:i,models:e,updateAvailable:Oe,latestVersion:De,onToast:T}),x&&(0,P.jsx)(hl,{request:x,models:e,onClose:()=>S(null),onSwitchToolLaunch:we,onLaunchSimilar:t=>{S(null),Ce(e.find(e=>e.providerKey===t.providerKey&&e.modelId===t.modelId)||t)}}),(0,P.jsx)(Q,{toasts:C,dismissToast:E})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,P.jsx)(v.StrictMode,{children:(0,P.jsx)(Ll,{})}));
|