vskill 0.5.21 → 0.5.23

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.
@@ -0,0 +1,73 @@
1
+ (function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const x of document.querySelectorAll('link[rel="modulepreload"]'))u(x);new MutationObserver(x=>{for(const v of x)if(v.type==="childList")for(const p of v.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&u(p)}).observe(document,{childList:!0,subtree:!0});function o(x){const v={};return x.integrity&&(v.integrity=x.integrity),x.referrerPolicy&&(v.referrerPolicy=x.referrerPolicy),x.crossOrigin==="use-credentials"?v.credentials="include":x.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function u(x){if(x.ep)return;x.ep=!0;const v=o(x);fetch(x.href,v)}})();var Uo={exports:{}},as={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var sx;function fh(){if(sx)return as;sx=1;var r=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function o(u,x,v){var p=null;if(v!==void 0&&(p=""+v),x.key!==void 0&&(p=""+x.key),"key"in x){v={};for(var b in x)b!=="key"&&(v[b]=x[b])}else v=x;return x=v.ref,{$$typeof:r,type:u,key:p,ref:x!==void 0?x:null,props:v}}return as.Fragment=c,as.jsx=o,as.jsxs=o,as}var rx;function xh(){return rx||(rx=1,Uo.exports=fh()),Uo.exports}var a=xh(),qo={exports:{}},ge={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ix;function ph(){if(ix)return ge;ix=1;var r=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),p=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),k=Symbol.iterator;function w(S){return S===null||typeof S!="object"?null:(S=k&&S[k]||S["@@iterator"],typeof S=="function"?S:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B=Object.assign,Y={};function G(S,z,I){this.props=S,this.context=z,this.refs=Y,this.updater=I||L}G.prototype.isReactComponent={},G.prototype.setState=function(S,z){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,z,"setState")},G.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function F(){}F.prototype=G.prototype;function le(S,z,I){this.props=S,this.context=z,this.refs=Y,this.updater=I||L}var Q=le.prototype=new F;Q.constructor=le,B(Q,G.prototype),Q.isPureReactComponent=!0;var ne=Array.isArray;function se(){}var U={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function W(S,z,I){var P=I.ref;return{$$typeof:r,type:S,key:z,ref:P!==void 0?P:null,props:I}}function he(S,z){return W(S.type,z,S.props)}function ve(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function ye(S){var z={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(I){return z[I]})}var J=/\/+/g;function te(S,z){return typeof S=="object"&&S!==null&&S.key!=null?ye(""+S.key):z.toString(36)}function me(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(se,se):(S.status="pending",S.then(function(z){S.status==="pending"&&(S.status="fulfilled",S.value=z)},function(z){S.status==="pending"&&(S.status="rejected",S.reason=z)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function T(S,z,I,P,ue){var ae=typeof S;(ae==="undefined"||ae==="boolean")&&(S=null);var be=!1;if(S===null)be=!0;else switch(ae){case"bigint":case"string":case"number":be=!0;break;case"object":switch(S.$$typeof){case r:case c:be=!0;break;case j:return be=S._init,T(be(S._payload),z,I,P,ue)}}if(be)return ue=ue(S),be=P===""?"."+te(S,0):P,ne(ue)?(I="",be!=null&&(I=be.replace(J,"$&/")+"/"),T(ue,z,I,"",function(ut){return ut})):ue!=null&&(ve(ue)&&(ue=he(ue,I+(ue.key==null||S&&S.key===ue.key?"":(""+ue.key).replace(J,"$&/")+"/")+be)),z.push(ue)),1;be=0;var Be=P===""?".":P+":";if(ne(S))for(var Ae=0;Ae<S.length;Ae++)P=S[Ae],ae=Be+te(P,Ae),be+=T(P,z,I,ae,ue);else if(Ae=w(S),typeof Ae=="function")for(S=Ae.call(S),Ae=0;!(P=S.next()).done;)P=P.value,ae=Be+te(P,Ae++),be+=T(P,z,I,ae,ue);else if(ae==="object"){if(typeof S.then=="function")return T(me(S),z,I,P,ue);throw z=String(S),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return be}function _(S,z,I){if(S==null)return S;var P=[],ue=0;return T(S,P,"","",function(ae){return z.call(I,ae,ue++)}),P}function ee(S){if(S._status===-1){var z=S._result;z=z(),z.then(function(I){(S._status===0||S._status===-1)&&(S._status=1,S._result=I)},function(I){(S._status===0||S._status===-1)&&(S._status=2,S._result=I)}),S._status===-1&&(S._status=0,S._result=z)}if(S._status===1)return S._result.default;throw S._result}var O=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},Z={map:_,forEach:function(S,z,I){_(S,function(){z.apply(this,arguments)},I)},count:function(S){var z=0;return _(S,function(){z++}),z},toArray:function(S){return _(S,function(z){return z})||[]},only:function(S){if(!ve(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ge.Activity=g,ge.Children=Z,ge.Component=G,ge.Fragment=o,ge.Profiler=x,ge.PureComponent=le,ge.StrictMode=u,ge.Suspense=y,ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,ge.__COMPILER_RUNTIME={__proto__:null,c:function(S){return U.H.useMemoCache(S)}},ge.cache=function(S){return function(){return S.apply(null,arguments)}},ge.cacheSignal=function(){return null},ge.cloneElement=function(S,z,I){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var P=B({},S.props),ue=S.key;if(z!=null)for(ae in z.key!==void 0&&(ue=""+z.key),z)!$.call(z,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&z.ref===void 0||(P[ae]=z[ae]);var ae=arguments.length-2;if(ae===1)P.children=I;else if(1<ae){for(var be=Array(ae),Be=0;Be<ae;Be++)be[Be]=arguments[Be+2];P.children=be}return W(S.type,ue,P)},ge.createContext=function(S){return S={$$typeof:p,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:v,_context:S},S},ge.createElement=function(S,z,I){var P,ue={},ae=null;if(z!=null)for(P in z.key!==void 0&&(ae=""+z.key),z)$.call(z,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(ue[P]=z[P]);var be=arguments.length-2;if(be===1)ue.children=I;else if(1<be){for(var Be=Array(be),Ae=0;Ae<be;Ae++)Be[Ae]=arguments[Ae+2];ue.children=Be}if(S&&S.defaultProps)for(P in be=S.defaultProps,be)ue[P]===void 0&&(ue[P]=be[P]);return W(S,ae,ue)},ge.createRef=function(){return{current:null}},ge.forwardRef=function(S){return{$$typeof:b,render:S}},ge.isValidElement=ve,ge.lazy=function(S){return{$$typeof:j,_payload:{_status:-1,_result:S},_init:ee}},ge.memo=function(S,z){return{$$typeof:f,type:S,compare:z===void 0?null:z}},ge.startTransition=function(S){var z=U.T,I={};U.T=I;try{var P=S(),ue=U.S;ue!==null&&ue(I,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(se,O)}catch(ae){O(ae)}finally{z!==null&&I.types!==null&&(z.types=I.types),U.T=z}},ge.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},ge.use=function(S){return U.H.use(S)},ge.useActionState=function(S,z,I){return U.H.useActionState(S,z,I)},ge.useCallback=function(S,z){return U.H.useCallback(S,z)},ge.useContext=function(S){return U.H.useContext(S)},ge.useDebugValue=function(){},ge.useDeferredValue=function(S,z){return U.H.useDeferredValue(S,z)},ge.useEffect=function(S,z){return U.H.useEffect(S,z)},ge.useEffectEvent=function(S){return U.H.useEffectEvent(S)},ge.useId=function(){return U.H.useId()},ge.useImperativeHandle=function(S,z,I){return U.H.useImperativeHandle(S,z,I)},ge.useInsertionEffect=function(S,z){return U.H.useInsertionEffect(S,z)},ge.useLayoutEffect=function(S,z){return U.H.useLayoutEffect(S,z)},ge.useMemo=function(S,z){return U.H.useMemo(S,z)},ge.useOptimistic=function(S,z){return U.H.useOptimistic(S,z)},ge.useReducer=function(S,z,I){return U.H.useReducer(S,z,I)},ge.useRef=function(S){return U.H.useRef(S)},ge.useState=function(S){return U.H.useState(S)},ge.useSyncExternalStore=function(S,z,I){return U.H.useSyncExternalStore(S,z,I)},ge.useTransition=function(){return U.H.useTransition()},ge.version="19.2.4",ge}var ox;function ic(){return ox||(ox=1,qo.exports=ph()),qo.exports}var h=ic(),Go={exports:{}},ns={},Yo={exports:{}},Vo={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var cx;function mh(){return cx||(cx=1,(function(r){function c(T,_){var ee=T.length;T.push(_);e:for(;0<ee;){var O=ee-1>>>1,Z=T[O];if(0<x(Z,_))T[O]=_,T[ee]=Z,ee=O;else break e}}function o(T){return T.length===0?null:T[0]}function u(T){if(T.length===0)return null;var _=T[0],ee=T.pop();if(ee!==_){T[0]=ee;e:for(var O=0,Z=T.length,S=Z>>>1;O<S;){var z=2*(O+1)-1,I=T[z],P=z+1,ue=T[P];if(0>x(I,ee))P<Z&&0>x(ue,I)?(T[O]=ue,T[P]=ee,O=P):(T[O]=I,T[z]=ee,O=z);else if(P<Z&&0>x(ue,ee))T[O]=ue,T[P]=ee,O=P;else break e}}return _}function x(T,_){var ee=T.sortIndex-_.sortIndex;return ee!==0?ee:T.id-_.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;r.unstable_now=function(){return v.now()}}else{var p=Date,b=p.now();r.unstable_now=function(){return p.now()-b}}var y=[],f=[],j=1,g=null,k=3,w=!1,L=!1,B=!1,Y=!1,G=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,le=typeof setImmediate<"u"?setImmediate:null;function Q(T){for(var _=o(f);_!==null;){if(_.callback===null)u(f);else if(_.startTime<=T)u(f),_.sortIndex=_.expirationTime,c(y,_);else break;_=o(f)}}function ne(T){if(B=!1,Q(T),!L)if(o(y)!==null)L=!0,se||(se=!0,ye());else{var _=o(f);_!==null&&me(ne,_.startTime-T)}}var se=!1,U=-1,$=5,W=-1;function he(){return Y?!0:!(r.unstable_now()-W<$)}function ve(){if(Y=!1,se){var T=r.unstable_now();W=T;var _=!0;try{e:{L=!1,B&&(B=!1,F(U),U=-1),w=!0;var ee=k;try{t:{for(Q(T),g=o(y);g!==null&&!(g.expirationTime>T&&he());){var O=g.callback;if(typeof O=="function"){g.callback=null,k=g.priorityLevel;var Z=O(g.expirationTime<=T);if(T=r.unstable_now(),typeof Z=="function"){g.callback=Z,Q(T),_=!0;break t}g===o(y)&&u(y),Q(T)}else u(y);g=o(y)}if(g!==null)_=!0;else{var S=o(f);S!==null&&me(ne,S.startTime-T),_=!1}}break e}finally{g=null,k=ee,w=!1}_=void 0}}finally{_?ye():se=!1}}}var ye;if(typeof le=="function")ye=function(){le(ve)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,te=J.port2;J.port1.onmessage=ve,ye=function(){te.postMessage(null)}}else ye=function(){G(ve,0)};function me(T,_){U=G(function(){T(r.unstable_now())},_)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(T){T.callback=null},r.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<T?Math.floor(1e3/T):5},r.unstable_getCurrentPriorityLevel=function(){return k},r.unstable_next=function(T){switch(k){case 1:case 2:case 3:var _=3;break;default:_=k}var ee=k;k=_;try{return T()}finally{k=ee}},r.unstable_requestPaint=function(){Y=!0},r.unstable_runWithPriority=function(T,_){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var ee=k;k=T;try{return _()}finally{k=ee}},r.unstable_scheduleCallback=function(T,_,ee){var O=r.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?O+ee:O):ee=O,T){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=ee+Z,T={id:j++,callback:_,priorityLevel:T,startTime:ee,expirationTime:Z,sortIndex:-1},ee>O?(T.sortIndex=ee,c(f,T),o(y)===null&&T===o(f)&&(B?(F(U),U=-1):B=!0,me(ne,ee-O))):(T.sortIndex=Z,c(y,T),L||w||(L=!0,se||(se=!0,ye()))),T},r.unstable_shouldYield=he,r.unstable_wrapCallback=function(T){var _=k;return function(){var ee=k;k=_;try{return T.apply(this,arguments)}finally{k=ee}}}})(Vo)),Vo}var ux;function hh(){return ux||(ux=1,Yo.exports=mh()),Yo.exports}var Qo={exports:{}},jt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var dx;function vh(){if(dx)return jt;dx=1;var r=ic();function c(y){var f="https://react.dev/errors/"+y;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)f+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+y+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var u={d:{f:o,r:function(){throw Error(c(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},x=Symbol.for("react.portal");function v(y,f,j){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:x,key:g==null?null:""+g,children:y,containerInfo:f,implementation:j}}var p=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(y,f){if(y==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,jt.createPortal=function(y,f){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(c(299));return v(y,f,null,j)},jt.flushSync=function(y){var f=p.T,j=u.p;try{if(p.T=null,u.p=2,y)return y()}finally{p.T=f,u.p=j,u.d.f()}},jt.preconnect=function(y,f){typeof y=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,u.d.C(y,f))},jt.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},jt.preinit=function(y,f){if(typeof y=="string"&&f&&typeof f.as=="string"){var j=f.as,g=b(j,f.crossOrigin),k=typeof f.integrity=="string"?f.integrity:void 0,w=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;j==="style"?u.d.S(y,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:k,fetchPriority:w}):j==="script"&&u.d.X(y,{crossOrigin:g,integrity:k,fetchPriority:w,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},jt.preinitModule=function(y,f){if(typeof y=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var j=b(f.as,f.crossOrigin);u.d.M(y,{crossOrigin:j,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&u.d.M(y)},jt.preload=function(y,f){if(typeof y=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var j=f.as,g=b(j,f.crossOrigin);u.d.L(y,j,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},jt.preloadModule=function(y,f){if(typeof y=="string")if(f){var j=b(f.as,f.crossOrigin);u.d.m(y,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:j,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else u.d.m(y)},jt.requestFormReset=function(y){u.d.r(y)},jt.unstable_batchedUpdates=function(y,f){return y(f)},jt.useFormState=function(y,f,j){return p.H.useFormState(y,f,j)},jt.useFormStatus=function(){return p.H.useHostTransitionStatus()},jt.version="19.2.4",jt}var fx;function yh(){if(fx)return Qo.exports;fx=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(c){console.error(c)}}return r(),Qo.exports=vh(),Qo.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var xx;function gh(){if(xx)return ns;xx=1;var r=hh(),c=ic(),o=yh();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function x(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function v(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function b(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(v(e)!==e)throw Error(u(188))}function f(e){var t=e.alternate;if(!t){if(t=v(e),t===null)throw Error(u(188));return t!==e?null:e}for(var l=e,n=t;;){var s=l.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){l=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===l)return y(s),e;if(i===n)return y(s),t;i=i.sibling}throw Error(u(188))}if(l.return!==n.return)l=s,n=i;else{for(var d=!1,m=s.child;m;){if(m===l){d=!0,l=s,n=i;break}if(m===n){d=!0,n=s,l=i;break}m=m.sibling}if(!d){for(m=i.child;m;){if(m===l){d=!0,l=i,n=s;break}if(m===n){d=!0,n=i,l=s;break}m=m.sibling}if(!d)throw Error(u(189))}}if(l.alternate!==n)throw Error(u(190))}if(l.tag!==3)throw Error(u(188));return l.stateNode.current===l?e:t}function j(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=j(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,k=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),le=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),he=Symbol.for("react.memo_cache_sentinel"),ve=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=ve&&e[ve]||e["@@iterator"],typeof e=="function"?e:null)}var J=Symbol.for("react.client.reference");function te(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===J?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case B:return"Fragment";case G:return"Profiler";case Y:return"StrictMode";case ne:return"Suspense";case se:return"SuspenseList";case W:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case L:return"Portal";case le:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case Q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return t=e.displayName||null,t!==null?t:te(e.type)||"Memo";case $:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var me=Array.isArray,T=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},O=[],Z=-1;function S(e){return{current:e}}function z(e){0>Z||(e.current=O[Z],O[Z]=null,Z--)}function I(e,t){Z++,O[Z]=e.current,e.current=t}var P=S(null),ue=S(null),ae=S(null),be=S(null);function Be(e,t){switch(I(ae,t),I(ue,e),I(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wf(t),e=Af(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}z(P),I(P,e)}function Ae(){z(P),z(ue),z(ae)}function ut(e){e.memoizedState!==null&&I(be,e);var t=P.current,l=Af(t,e.type);t!==l&&(I(ue,e),I(P,l))}function Lt(e){ue.current===e&&(z(P),z(ue)),be.current===e&&(z(be),Pn._currentValue=ee)}var K,re;function ie(e){if(K===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);K=t&&t[1]||"",re=-1<l.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+K+e+re}var fe=!1;function pe(e,t){if(!e||fe)return"";fe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var V=function(){throw Error()};if(Object.defineProperty(V.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(V,[])}catch(D){var M=D}Reflect.construct(e,[],V)}else{try{V.call()}catch(D){M=D}e.call(V.prototype)}}else{try{throw Error()}catch(D){M=D}(V=e())&&typeof V.catch=="function"&&V.catch(function(){})}}catch(D){if(D&&M&&typeof D.stack=="string")return[D.stack,M.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),d=i[0],m=i[1];if(d&&m){var N=d.split(`
44
+ `),R=m.split(`
45
+ `);for(s=n=0;n<N.length&&!N[n].includes("DetermineComponentFrameRoot");)n++;for(;s<R.length&&!R[s].includes("DetermineComponentFrameRoot");)s++;if(n===N.length||s===R.length)for(n=N.length-1,s=R.length-1;1<=n&&0<=s&&N[n]!==R[s];)s--;for(;1<=n&&0<=s;n--,s--)if(N[n]!==R[s]){if(n!==1||s!==1)do if(n--,s--,0>s||N[n]!==R[s]){var H=`
46
+ `+N[n].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=n&&0<=s);break}}}finally{fe=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ie(l):""}function Ve(e,t){switch(e.tag){case 26:case 27:case 5:return ie(e.type);case 16:return ie("Lazy");case 13:return e.child!==t&&t!==null?ie("Suspense Fallback"):ie("Suspense");case 19:return ie("SuspenseList");case 0:case 15:return pe(e.type,!1);case 11:return pe(e.type.render,!1);case 1:return pe(e.type,!0);case 31:return ie("Activity");default:return""}}function dt(e){try{var t="",l=null;do t+=Ve(e,l),l=e,e=e.return;while(e);return t}catch(n){return`
47
+ Error generating stack: `+n.message+`
48
+ `+n.stack}}var Xe=Object.prototype.hasOwnProperty,zt=r.unstable_scheduleCallback,mt=r.unstable_cancelCallback,tl=r.unstable_shouldYield,Qt=r.unstable_requestPaint,We=r.unstable_now,Dt=r.unstable_getCurrentPriorityLevel,X=r.unstable_ImmediatePriority,Le=r.unstable_UserBlockingPriority,at=r.unstable_NormalPriority,Je=r.unstable_LowPriority,Rl=r.unstable_IdlePriority,Ot=r.log,sa=r.unstable_setDisableYieldValue,Et=null,Fe=null;function nt(e){if(typeof Ot=="function"&&sa(e),Fe&&typeof Fe.setStrictMode=="function")try{Fe.setStrictMode(Et,e)}catch{}}var et=Math.clz32?Math.clz32:al,ll=Math.log,Qe=Math.LN2;function al(e){return e>>>=0,e===0?32:31-(ll(e)/Qe|0)|0}var st=256,Ge=262144,_l=4194304;function kt(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 Ea(e,t,l){var n=e.pendingLanes;if(n===0)return 0;var s=0,i=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var m=n&134217727;return m!==0?(n=m&~i,n!==0?s=kt(n):(d&=m,d!==0?s=kt(d):l||(l=m&~e,l!==0&&(s=kt(l))))):(m=n&~i,m!==0?s=kt(m):d!==0?s=kt(d):l||(l=n&~e,l!==0&&(s=kt(l)))),s===0?0:t!==0&&t!==s&&(t&i)===0&&(i=s&-s,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:s}function fn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Px(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 oc(){var e=_l;return _l<<=1,(_l&62914560)===0&&(_l=4194304),e}function Tr(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function xn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ep(e,t,l,n,s,i){var d=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var m=e.entanglements,N=e.expirationTimes,R=e.hiddenUpdates;for(l=d&~l;0<l;){var H=31-et(l),V=1<<H;m[H]=0,N[H]=-1;var M=R[H];if(M!==null)for(R[H]=null,H=0;H<M.length;H++){var D=M[H];D!==null&&(D.lane&=-536870913)}l&=~V}n!==0&&cc(e,n,0),i!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=i&~(d&~t))}function cc(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-et(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|l&261930}function uc(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var n=31-et(l),s=1<<n;s&t|e[n]&t&&(e[n]|=t),l&=~s}}function dc(e,t){var l=t&-t;return l=(l&42)!==0?1:Cr(l),(l&(e.suspendedLanes|t))!==0?0:l}function Cr(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 wr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function fc(){var e=_.p;return e!==0?e:(e=window.event,e===void 0?32:If(e.type))}function xc(e,t){var l=_.p;try{return _.p=e,t()}finally{_.p=l}}var Ml=Math.random().toString(36).slice(2),ht="__reactFiber$"+Ml,Tt="__reactProps$"+Ml,ka="__reactContainer$"+Ml,Ar="__reactEvents$"+Ml,tp="__reactListeners$"+Ml,lp="__reactHandles$"+Ml,pc="__reactResources$"+Ml,pn="__reactMarker$"+Ml;function Rr(e){delete e[ht],delete e[Tt],delete e[Ar],delete e[tp],delete e[lp]}function Ta(e){var t=e[ht];if(t)return t;for(var l=e.parentNode;l;){if(t=l[ka]||l[ht]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Of(e);e!==null;){if(l=e[ht])return l;e=Of(e)}return t}e=l,l=e.parentNode}return null}function Ca(e){if(e=e[ht]||e[ka]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function wa(e){var t=e[pc];return t||(t=e[pc]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xt(e){e[pn]=!0}var mc=new Set,hc={};function ra(e,t){Aa(e,t),Aa(e+"Capture",t)}function Aa(e,t){for(hc[e]=t,e=0;e<t.length;e++)mc.add(t[e])}var ap=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]*$"),vc={},yc={};function np(e){return Xe.call(yc,e)?!0:Xe.call(vc,e)?!1:ap.test(e)?yc[e]=!0:(vc[e]=!0,!1)}function rs(e,t,l){if(np(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function is(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function fl(e,t,l,n){if(n===null)e.removeAttribute(l);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+n)}}function Xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sp(e,t,l){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(d){l=""+d,i.call(this,d)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(d){l=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _r(e){if(!e._valueTracker){var t=gc(e)?"checked":"value";e._valueTracker=sp(e,t,""+e[t])}}function bc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),n="";return e&&(n=gc(e)?e.checked?"true":"false":e.value),e=n,e!==l?(t.setValue(e),!0):!1}function os(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var rp=/[\n"\\]/g;function Kt(e){return e.replace(rp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mr(e,t,l,n,s,i,d,m){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Xt(t)):e.value!==""+Xt(t)&&(e.value=""+Xt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Lr(e,d,Xt(t)):l!=null?Lr(e,d,Xt(l)):n!=null&&e.removeAttribute("value"),s==null&&i!=null&&(e.defaultChecked=!!i),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+Xt(m):e.removeAttribute("name")}function jc(e,t,l,n,s,i,d,m){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){_r(e);return}l=l!=null?""+Xt(l):"",t=t!=null?""+Xt(t):l,m||t===e.value||(e.value=t),e.defaultValue=t}n=n??s,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=m?e.checked:!!n,e.defaultChecked=!!n,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),_r(e)}function Lr(e,t,l){t==="number"&&os(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Ra(e,t,l,n){if(e=e.options,t){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=!0;for(l=0;l<e.length;l++)s=t.hasOwnProperty("$"+e[l].value),e[l].selected!==s&&(e[l].selected=s),s&&n&&(e[l].defaultSelected=!0)}else{for(l=""+Xt(l),t=null,s=0;s<e.length;s++){if(e[s].value===l){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Sc(e,t,l){if(t!=null&&(t=""+Xt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Xt(l):""}function Nc(e,t,l,n){if(t==null){if(n!=null){if(l!=null)throw Error(u(92));if(me(n)){if(1<n.length)throw Error(u(93));n=n[0]}l=n}l==null&&(l=""),t=l}l=Xt(t),e.defaultValue=l,n=e.textContent,n===l&&n!==""&&n!==null&&(e.value=n),_r(e)}function _a(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var ip=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 Ec(e,t,l){var n=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,l):typeof l!="number"||l===0||ip.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function kc(e,t,l){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,l!=null){for(var n in l)!l.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var s in t)n=t[s],t.hasOwnProperty(s)&&l[s]!==n&&Ec(e,s,n)}else for(var i in t)t.hasOwnProperty(i)&&Ec(e,i,t[i])}function zr(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 op=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"]]),cp=/^[\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 cs(e){return cp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function xl(){}var Dr=null;function Or(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ma=null,La=null;function Tc(e){var t=Ca(e);if(t&&(e=t.stateNode)){var l=e[Tt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Mr(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Kt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var n=l[t];if(n!==e&&n.form===e.form){var s=n[Tt]||null;if(!s)throw Error(u(90));Mr(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<l.length;t++)n=l[t],n.form===e.form&&bc(n)}break e;case"textarea":Sc(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Ra(e,!!l.multiple,t,!1)}}}var Br=!1;function Cc(e,t,l){if(Br)return e(t,l);Br=!0;try{var n=e(t);return n}finally{if(Br=!1,(Ma!==null||La!==null)&&(Ws(),Ma&&(t=Ma,e=La,La=Ma=null,Tc(t),e)))for(t=0;t<e.length;t++)Tc(e[t])}}function hn(e,t){var l=e.stateNode;if(l===null)return null;var n=l[Tt]||null;if(n===null)return null;l=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(u(231,t,typeof l));return l}var pl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hr=!1;if(pl)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){Hr=!0}}),window.addEventListener("test",vn,vn),window.removeEventListener("test",vn,vn)}catch{Hr=!1}var Ll=null,Ur=null,us=null;function wc(){if(us)return us;var e,t=Ur,l=t.length,n,s="value"in Ll?Ll.value:Ll.textContent,i=s.length;for(e=0;e<l&&t[e]===s[e];e++);var d=l-e;for(n=1;n<=d&&t[l-n]===s[i-n];n++);return us=s.slice(e,1<n?1-n:void 0)}function ds(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 fs(){return!0}function Ac(){return!1}function Ct(e){function t(l,n,s,i,d){this._reactName=l,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=d,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(l=e[m],this[m]=l?l(i):i[m]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?fs:Ac,this.isPropagationStopped=Ac,this}return g(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=fs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=fs)},persist:function(){},isPersistent:fs}),t}var ia={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xs=Ct(ia),yn=g({},ia,{view:0,detail:0}),up=Ct(yn),qr,Gr,gn,ps=g({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vr,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!==gn&&(gn&&e.type==="mousemove"?(qr=e.screenX-gn.screenX,Gr=e.screenY-gn.screenY):Gr=qr=0,gn=e),qr)},movementY:function(e){return"movementY"in e?e.movementY:Gr}}),Rc=Ct(ps),dp=g({},ps,{dataTransfer:0}),fp=Ct(dp),xp=g({},yn,{relatedTarget:0}),Yr=Ct(xp),pp=g({},ia,{animationName:0,elapsedTime:0,pseudoElement:0}),mp=Ct(pp),hp=g({},ia,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vp=Ct(hp),yp=g({},ia,{data:0}),_c=Ct(yp),gp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bp={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"},jp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jp[e])?!!t[e]:!1}function Vr(){return Sp}var Np=g({},yn,{key:function(e){if(e.key){var t=gp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ds(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vr,charCode:function(e){return e.type==="keypress"?ds(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ds(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ep=Ct(Np),kp=g({},ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mc=Ct(kp),Tp=g({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vr}),Cp=Ct(Tp),wp=g({},ia,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ap=Ct(wp),Rp=g({},ps,{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}),_p=Ct(Rp),Mp=g({},ia,{newState:0,oldState:0}),Lp=Ct(Mp),zp=[9,13,27,32],Qr=pl&&"CompositionEvent"in window,bn=null;pl&&"documentMode"in document&&(bn=document.documentMode);var Dp=pl&&"TextEvent"in window&&!bn,Lc=pl&&(!Qr||bn&&8<bn&&11>=bn),zc=" ",Dc=!1;function Oc(e,t){switch(e){case"keyup":return zp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var za=!1;function Op(e,t){switch(e){case"compositionend":return Bc(t);case"keypress":return t.which!==32?null:(Dc=!0,zc);case"textInput":return e=t.data,e===zc&&Dc?null:e;default:return null}}function Bp(e,t){if(za)return e==="compositionend"||!Qr&&Oc(e,t)?(e=wc(),us=Ur=Ll=null,za=!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 Lc&&t.locale!=="ko"?null:t.data;default:return null}}var Hp={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 Hc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Hp[e.type]:t==="textarea"}function Uc(e,t,l,n){Ma?La?La.push(n):La=[n]:Ma=n,t=ar(t,"onChange"),0<t.length&&(l=new xs("onChange","change",null,l,n),e.push({event:l,listeners:t}))}var jn=null,Sn=null;function Up(e){Sf(e,0)}function ms(e){var t=mn(e);if(bc(t))return e}function qc(e,t){if(e==="change")return t}var Gc=!1;if(pl){var Xr;if(pl){var Kr="oninput"in document;if(!Kr){var Yc=document.createElement("div");Yc.setAttribute("oninput","return;"),Kr=typeof Yc.oninput=="function"}Xr=Kr}else Xr=!1;Gc=Xr&&(!document.documentMode||9<document.documentMode)}function Vc(){jn&&(jn.detachEvent("onpropertychange",Qc),Sn=jn=null)}function Qc(e){if(e.propertyName==="value"&&ms(Sn)){var t=[];Uc(t,Sn,e,Or(e)),Cc(Up,t)}}function qp(e,t,l){e==="focusin"?(Vc(),jn=t,Sn=l,jn.attachEvent("onpropertychange",Qc)):e==="focusout"&&Vc()}function Gp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ms(Sn)}function Yp(e,t){if(e==="click")return ms(t)}function Vp(e,t){if(e==="input"||e==="change")return ms(t)}function Qp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bt=typeof Object.is=="function"?Object.is:Qp;function Nn(e,t){if(Bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),n=Object.keys(t);if(l.length!==n.length)return!1;for(n=0;n<l.length;n++){var s=l[n];if(!Xe.call(t,s)||!Bt(e[s],t[s]))return!1}return!0}function Xc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kc(e,t){var l=Xc(e);e=0;for(var n;l;){if(l.nodeType===3){if(n=e+l.textContent.length,e<=t&&n>=t)return{node:l,offset:t-e};e=n}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Xc(l)}}function Zc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $c(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=os(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=os(e.document)}return t}function Zr(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 Xp=pl&&"documentMode"in document&&11>=document.documentMode,Da=null,$r=null,En=null,Jr=!1;function Jc(e,t,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Jr||Da==null||Da!==os(n)||(n=Da,"selectionStart"in n&&Zr(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),En&&Nn(En,n)||(En=n,n=ar($r,"onSelect"),0<n.length&&(t=new xs("onSelect","select",null,t,l),e.push({event:t,listeners:n}),t.target=Da)))}function oa(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Oa={animationend:oa("Animation","AnimationEnd"),animationiteration:oa("Animation","AnimationIteration"),animationstart:oa("Animation","AnimationStart"),transitionrun:oa("Transition","TransitionRun"),transitionstart:oa("Transition","TransitionStart"),transitioncancel:oa("Transition","TransitionCancel"),transitionend:oa("Transition","TransitionEnd")},Wr={},Wc={};pl&&(Wc=document.createElement("div").style,"AnimationEvent"in window||(delete Oa.animationend.animation,delete Oa.animationiteration.animation,delete Oa.animationstart.animation),"TransitionEvent"in window||delete Oa.transitionend.transition);function ca(e){if(Wr[e])return Wr[e];if(!Oa[e])return e;var t=Oa[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in Wc)return Wr[e]=t[l];return e}var Fc=ca("animationend"),Ic=ca("animationiteration"),Pc=ca("animationstart"),Kp=ca("transitionrun"),Zp=ca("transitionstart"),$p=ca("transitioncancel"),eu=ca("transitionend"),tu=new Map,Fr="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(" ");Fr.push("scrollEnd");function nl(e,t){tu.set(e,t),ra(t,[e])}var hs=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!==null&&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)},Zt=[],Ba=0,Ir=0;function vs(){for(var e=Ba,t=Ir=Ba=0;t<e;){var l=Zt[t];Zt[t++]=null;var n=Zt[t];Zt[t++]=null;var s=Zt[t];Zt[t++]=null;var i=Zt[t];if(Zt[t++]=null,n!==null&&s!==null){var d=n.pending;d===null?s.next=s:(s.next=d.next,d.next=s),n.pending=s}i!==0&&lu(l,s,i)}}function ys(e,t,l,n){Zt[Ba++]=e,Zt[Ba++]=t,Zt[Ba++]=l,Zt[Ba++]=n,Ir|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Pr(e,t,l,n){return ys(e,t,l,n),gs(e)}function ua(e,t){return ys(e,null,null,t),gs(e)}function lu(e,t,l){e.lanes|=l;var n=e.alternate;n!==null&&(n.lanes|=l);for(var s=!1,i=e.return;i!==null;)i.childLanes|=l,n=i.alternate,n!==null&&(n.childLanes|=l),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(s=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,s&&t!==null&&(s=31-et(l),e=i.hiddenUpdates,n=e[s],n===null?e[s]=[t]:n.push(t),t.lane=l|536870912),i):null}function gs(e){if(50<Kn)throw Kn=0,oo=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ha={};function Jp(e,t,l,n){this.tag=e,this.key=l,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,t,l,n){return new Jp(e,t,l,n)}function ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ml(e,t){var l=e.alternate;return l===null?(l=Ht(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function au(e,t){e.flags&=65011714;var l=e.alternate;return l===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=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function bs(e,t,l,n,s,i){var d=0;if(n=e,typeof e=="function")ei(e)&&(d=1);else if(typeof e=="string")d=eh(e,l,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case W:return e=Ht(31,l,t,s),e.elementType=W,e.lanes=i,e;case B:return da(l.children,s,i,t);case Y:d=8,s|=24;break;case G:return e=Ht(12,l,t,s|2),e.elementType=G,e.lanes=i,e;case ne:return e=Ht(13,l,t,s),e.elementType=ne,e.lanes=i,e;case se:return e=Ht(19,l,t,s),e.elementType=se,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case le:d=10;break e;case F:d=9;break e;case Q:d=11;break e;case U:d=14;break e;case $:d=16,n=null;break e}d=29,l=Error(u(130,e===null?"null":typeof e,"")),n=null}return t=Ht(d,l,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function da(e,t,l,n){return e=Ht(7,e,n,t),e.lanes=l,e}function ti(e,t,l){return e=Ht(6,e,null,t),e.lanes=l,e}function nu(e){var t=Ht(18,null,null,0);return t.stateNode=e,t}function li(e,t,l){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var su=new WeakMap;function $t(e,t){if(typeof e=="object"&&e!==null){var l=su.get(e);return l!==void 0?l:(t={value:e,source:t,stack:dt(t)},su.set(e,t),t)}return{value:e,source:t,stack:dt(t)}}var Ua=[],qa=0,js=null,kn=0,Jt=[],Wt=0,zl=null,ol=1,cl="";function hl(e,t){Ua[qa++]=kn,Ua[qa++]=js,js=e,kn=t}function ru(e,t,l){Jt[Wt++]=ol,Jt[Wt++]=cl,Jt[Wt++]=zl,zl=e;var n=ol;e=cl;var s=32-et(n)-1;n&=~(1<<s),l+=1;var i=32-et(t)+s;if(30<i){var d=s-s%5;i=(n&(1<<d)-1).toString(32),n>>=d,s-=d,ol=1<<32-et(t)+s|l<<s|n,cl=i+e}else ol=1<<i|l<<s|n,cl=e}function ai(e){e.return!==null&&(hl(e,1),ru(e,1,0))}function ni(e){for(;e===js;)js=Ua[--qa],Ua[qa]=null,kn=Ua[--qa],Ua[qa]=null;for(;e===zl;)zl=Jt[--Wt],Jt[Wt]=null,cl=Jt[--Wt],Jt[Wt]=null,ol=Jt[--Wt],Jt[Wt]=null}function iu(e,t){Jt[Wt++]=ol,Jt[Wt++]=cl,Jt[Wt++]=zl,ol=t.id,cl=t.overflow,zl=e}var vt=null,Ke=null,we=!1,Dl=null,Ft=!1,si=Error(u(519));function Ol(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tn($t(t,e)),si}function ou(e){var t=e.stateNode,l=e.type,n=e.memoizedProps;switch(t[ht]=e,t[Tt]=n,l){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(l=0;l<$n.length;l++)ke($n[l],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),jc(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),Nc(t,n.value,n.defaultValue,n.children)}l=n.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||n.suppressHydrationWarning===!0||Tf(t.textContent,l)?(n.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),n.onScroll!=null&&ke("scroll",t),n.onScrollEnd!=null&&ke("scrollend",t),n.onClick!=null&&(t.onclick=xl),t=!0):t=!1,t||Ol(e,!0)}function cu(e){for(vt=e.return;vt;)switch(vt.tag){case 5:case 31:case 13:Ft=!1;return;case 27:case 3:Ft=!0;return;default:vt=vt.return}}function Ga(e){if(e!==vt)return!1;if(!we)return cu(e),we=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Eo(e.type,e.memoizedProps)),l=!l),l&&Ke&&Ol(e),cu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ke=Df(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ke=Df(e)}else t===27?(t=Ke,Wl(e.type)?(e=Ao,Ao=null,Ke=e):Ke=t):Ke=vt?Pt(e.stateNode.nextSibling):null;return!0}function fa(){Ke=vt=null,we=!1}function ri(){var e=Dl;return e!==null&&(_t===null?_t=e:_t.push.apply(_t,e),Dl=null),e}function Tn(e){Dl===null?Dl=[e]:Dl.push(e)}var ii=S(null),xa=null,vl=null;function Bl(e,t,l){I(ii,t._currentValue),t._currentValue=l}function yl(e){e._currentValue=ii.current,z(ii)}function oi(e,t,l){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===l)break;e=e.return}}function ci(e,t,l,n){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var i=s.dependencies;if(i!==null){var d=s.child;i=i.firstContext;e:for(;i!==null;){var m=i;i=s;for(var N=0;N<t.length;N++)if(m.context===t[N]){i.lanes|=l,m=i.alternate,m!==null&&(m.lanes|=l),oi(i.return,l,e),n||(d=null);break e}i=m.next}}else if(s.tag===18){if(d=s.return,d===null)throw Error(u(341));d.lanes|=l,i=d.alternate,i!==null&&(i.lanes|=l),oi(d,l,e),d=null}else d=s.child;if(d!==null)d.return=s;else for(d=s;d!==null;){if(d===e){d=null;break}if(s=d.sibling,s!==null){s.return=d.return,d=s;break}d=d.return}s=d}}function Ya(e,t,l,n){e=null;for(var s=t,i=!1;s!==null;){if(!i){if((s.flags&524288)!==0)i=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var d=s.alternate;if(d===null)throw Error(u(387));if(d=d.memoizedProps,d!==null){var m=s.type;Bt(s.pendingProps.value,d.value)||(e!==null?e.push(m):e=[m])}}else if(s===be.current){if(d=s.alternate,d===null)throw Error(u(387));d.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Pn):e=[Pn])}s=s.return}e!==null&&ci(t,e,l,n),t.flags|=262144}function Ss(e){for(e=e.firstContext;e!==null;){if(!Bt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function pa(e){xa=e,vl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function yt(e){return uu(xa,e)}function Ns(e,t){return xa===null&&pa(e),uu(e,t)}function uu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},vl===null){if(e===null)throw Error(u(308));vl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else vl=vl.next=t;return l}var Wp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Fp=r.unstable_scheduleCallback,Ip=r.unstable_NormalPriority,rt={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ui(){return{controller:new Wp,data:new Map,refCount:0}}function Cn(e){e.refCount--,e.refCount===0&&Fp(Ip,function(){e.controller.abort()})}var wn=null,di=0,Va=0,Qa=null;function Pp(e,t){if(wn===null){var l=wn=[];di=0,Va=mo(),Qa={status:"pending",value:void 0,then:function(n){l.push(n)}}}return di++,t.then(du,du),t}function du(){if(--di===0&&wn!==null){Qa!==null&&(Qa.status="fulfilled");var e=wn;wn=null,Va=0,Qa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function em(e,t){var l=[],n={status:"pending",value:null,reason:null,then:function(s){l.push(s)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var s=0;s<l.length;s++)(0,l[s])(t)},function(s){for(n.status="rejected",n.reason=s,s=0;s<l.length;s++)(0,l[s])(void 0)}),n}var fu=T.S;T.S=function(e,t){Jd=We(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Pp(e,t),fu!==null&&fu(e,t)};var ma=S(null);function fi(){var e=ma.current;return e!==null?e:Ye.pooledCache}function Es(e,t){t===null?I(ma,ma.current):I(ma,t.pool)}function xu(){var e=fi();return e===null?null:{parent:rt._currentValue,pool:e}}var Xa=Error(u(460)),xi=Error(u(474)),ks=Error(u(542)),Ts={then:function(){}};function pu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function mu(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(xl,xl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vu(e),e;default:if(typeof t.status=="string")t.then(xl,xl);else{if(e=Ye,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=n}},function(n){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vu(e),e}throw va=t,Xa}}function ha(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(va=l,Xa):l}}var va=null;function hu(){if(va===null)throw Error(u(459));var e=va;return va=null,e}function vu(e){if(e===Xa||e===ks)throw Error(u(483))}var Ka=null,An=0;function Cs(e){var t=An;return An+=1,Ka===null&&(Ka=[]),mu(Ka,e,t)}function Rn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ws(e,t){throw t.$$typeof===k?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function yu(e){function t(C,E){if(e){var A=C.deletions;A===null?(C.deletions=[E],C.flags|=16):A.push(E)}}function l(C,E){if(!e)return null;for(;E!==null;)t(C,E),E=E.sibling;return null}function n(C){for(var E=new Map;C!==null;)C.key!==null?E.set(C.key,C):E.set(C.index,C),C=C.sibling;return E}function s(C,E){return C=ml(C,E),C.index=0,C.sibling=null,C}function i(C,E,A){return C.index=A,e?(A=C.alternate,A!==null?(A=A.index,A<E?(C.flags|=67108866,E):A):(C.flags|=67108866,E)):(C.flags|=1048576,E)}function d(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function m(C,E,A,q){return E===null||E.tag!==6?(E=ti(A,C.mode,q),E.return=C,E):(E=s(E,A),E.return=C,E)}function N(C,E,A,q){var de=A.type;return de===B?H(C,E,A.props.children,q,A.key):E!==null&&(E.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===$&&ha(de)===E.type)?(E=s(E,A.props),Rn(E,A),E.return=C,E):(E=bs(A.type,A.key,A.props,null,C.mode,q),Rn(E,A),E.return=C,E)}function R(C,E,A,q){return E===null||E.tag!==4||E.stateNode.containerInfo!==A.containerInfo||E.stateNode.implementation!==A.implementation?(E=li(A,C.mode,q),E.return=C,E):(E=s(E,A.children||[]),E.return=C,E)}function H(C,E,A,q,de){return E===null||E.tag!==7?(E=da(A,C.mode,q,de),E.return=C,E):(E=s(E,A),E.return=C,E)}function V(C,E,A){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=ti(""+E,C.mode,A),E.return=C,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case w:return A=bs(E.type,E.key,E.props,null,C.mode,A),Rn(A,E),A.return=C,A;case L:return E=li(E,C.mode,A),E.return=C,E;case $:return E=ha(E),V(C,E,A)}if(me(E)||ye(E))return E=da(E,C.mode,A,null),E.return=C,E;if(typeof E.then=="function")return V(C,Cs(E),A);if(E.$$typeof===le)return V(C,Ns(C,E),A);ws(C,E)}return null}function M(C,E,A,q){var de=E!==null?E.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return de!==null?null:m(C,E,""+A,q);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case w:return A.key===de?N(C,E,A,q):null;case L:return A.key===de?R(C,E,A,q):null;case $:return A=ha(A),M(C,E,A,q)}if(me(A)||ye(A))return de!==null?null:H(C,E,A,q,null);if(typeof A.then=="function")return M(C,E,Cs(A),q);if(A.$$typeof===le)return M(C,E,Ns(C,A),q);ws(C,A)}return null}function D(C,E,A,q,de){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return C=C.get(A)||null,m(E,C,""+q,de);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case w:return C=C.get(q.key===null?A:q.key)||null,N(E,C,q,de);case L:return C=C.get(q.key===null?A:q.key)||null,R(E,C,q,de);case $:return q=ha(q),D(C,E,A,q,de)}if(me(q)||ye(q))return C=C.get(A)||null,H(E,C,q,de,null);if(typeof q.then=="function")return D(C,E,A,Cs(q),de);if(q.$$typeof===le)return D(C,E,A,Ns(E,q),de);ws(E,q)}return null}function oe(C,E,A,q){for(var de=null,Re=null,ce=E,Ne=E=0,Ce=null;ce!==null&&Ne<A.length;Ne++){ce.index>Ne?(Ce=ce,ce=null):Ce=ce.sibling;var _e=M(C,ce,A[Ne],q);if(_e===null){ce===null&&(ce=Ce);break}e&&ce&&_e.alternate===null&&t(C,ce),E=i(_e,E,Ne),Re===null?de=_e:Re.sibling=_e,Re=_e,ce=Ce}if(Ne===A.length)return l(C,ce),we&&hl(C,Ne),de;if(ce===null){for(;Ne<A.length;Ne++)ce=V(C,A[Ne],q),ce!==null&&(E=i(ce,E,Ne),Re===null?de=ce:Re.sibling=ce,Re=ce);return we&&hl(C,Ne),de}for(ce=n(ce);Ne<A.length;Ne++)Ce=D(ce,C,Ne,A[Ne],q),Ce!==null&&(e&&Ce.alternate!==null&&ce.delete(Ce.key===null?Ne:Ce.key),E=i(Ce,E,Ne),Re===null?de=Ce:Re.sibling=Ce,Re=Ce);return e&&ce.forEach(function(ta){return t(C,ta)}),we&&hl(C,Ne),de}function xe(C,E,A,q){if(A==null)throw Error(u(151));for(var de=null,Re=null,ce=E,Ne=E=0,Ce=null,_e=A.next();ce!==null&&!_e.done;Ne++,_e=A.next()){ce.index>Ne?(Ce=ce,ce=null):Ce=ce.sibling;var ta=M(C,ce,_e.value,q);if(ta===null){ce===null&&(ce=Ce);break}e&&ce&&ta.alternate===null&&t(C,ce),E=i(ta,E,Ne),Re===null?de=ta:Re.sibling=ta,Re=ta,ce=Ce}if(_e.done)return l(C,ce),we&&hl(C,Ne),de;if(ce===null){for(;!_e.done;Ne++,_e=A.next())_e=V(C,_e.value,q),_e!==null&&(E=i(_e,E,Ne),Re===null?de=_e:Re.sibling=_e,Re=_e);return we&&hl(C,Ne),de}for(ce=n(ce);!_e.done;Ne++,_e=A.next())_e=D(ce,C,Ne,_e.value,q),_e!==null&&(e&&_e.alternate!==null&&ce.delete(_e.key===null?Ne:_e.key),E=i(_e,E,Ne),Re===null?de=_e:Re.sibling=_e,Re=_e);return e&&ce.forEach(function(dh){return t(C,dh)}),we&&hl(C,Ne),de}function qe(C,E,A,q){if(typeof A=="object"&&A!==null&&A.type===B&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case w:e:{for(var de=A.key;E!==null;){if(E.key===de){if(de=A.type,de===B){if(E.tag===7){l(C,E.sibling),q=s(E,A.props.children),q.return=C,C=q;break e}}else if(E.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===$&&ha(de)===E.type){l(C,E.sibling),q=s(E,A.props),Rn(q,A),q.return=C,C=q;break e}l(C,E);break}else t(C,E);E=E.sibling}A.type===B?(q=da(A.props.children,C.mode,q,A.key),q.return=C,C=q):(q=bs(A.type,A.key,A.props,null,C.mode,q),Rn(q,A),q.return=C,C=q)}return d(C);case L:e:{for(de=A.key;E!==null;){if(E.key===de)if(E.tag===4&&E.stateNode.containerInfo===A.containerInfo&&E.stateNode.implementation===A.implementation){l(C,E.sibling),q=s(E,A.children||[]),q.return=C,C=q;break e}else{l(C,E);break}else t(C,E);E=E.sibling}q=li(A,C.mode,q),q.return=C,C=q}return d(C);case $:return A=ha(A),qe(C,E,A,q)}if(me(A))return oe(C,E,A,q);if(ye(A)){if(de=ye(A),typeof de!="function")throw Error(u(150));return A=de.call(A),xe(C,E,A,q)}if(typeof A.then=="function")return qe(C,E,Cs(A),q);if(A.$$typeof===le)return qe(C,E,Ns(C,A),q);ws(C,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,E!==null&&E.tag===6?(l(C,E.sibling),q=s(E,A),q.return=C,C=q):(l(C,E),q=ti(A,C.mode,q),q.return=C,C=q),d(C)):l(C,E)}return function(C,E,A,q){try{An=0;var de=qe(C,E,A,q);return Ka=null,de}catch(ce){if(ce===Xa||ce===ks)throw ce;var Re=Ht(29,ce,null,C.mode);return Re.lanes=q,Re.return=C,Re}finally{}}}var ya=yu(!0),gu=yu(!1),Hl=!1;function pi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mi(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 Ul(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ql(e,t,l){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(ze&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=gs(e),lu(e,null,l),t}return ys(e,n,t,l),gs(e)}function _n(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,uc(e,l)}}function hi(e,t){var l=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var s=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var d={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?s=i=d:i=i.next=d,l=l.next}while(l!==null);i===null?s=i=t:i=i.next=t}else s=i=t;l={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var vi=!1;function Mn(){if(vi){var e=Qa;if(e!==null)throw e}}function Ln(e,t,l,n){vi=!1;var s=e.updateQueue;Hl=!1;var i=s.firstBaseUpdate,d=s.lastBaseUpdate,m=s.shared.pending;if(m!==null){s.shared.pending=null;var N=m,R=N.next;N.next=null,d===null?i=R:d.next=R,d=N;var H=e.alternate;H!==null&&(H=H.updateQueue,m=H.lastBaseUpdate,m!==d&&(m===null?H.firstBaseUpdate=R:m.next=R,H.lastBaseUpdate=N))}if(i!==null){var V=s.baseState;d=0,H=R=N=null,m=i;do{var M=m.lane&-536870913,D=M!==m.lane;if(D?(Te&M)===M:(n&M)===M){M!==0&&M===Va&&(vi=!0),H!==null&&(H=H.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var oe=e,xe=m;M=t;var qe=l;switch(xe.tag){case 1:if(oe=xe.payload,typeof oe=="function"){V=oe.call(qe,V,M);break e}V=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=xe.payload,M=typeof oe=="function"?oe.call(qe,V,M):oe,M==null)break e;V=g({},V,M);break e;case 2:Hl=!0}}M=m.callback,M!==null&&(e.flags|=64,D&&(e.flags|=8192),D=s.callbacks,D===null?s.callbacks=[M]:D.push(M))}else D={lane:M,tag:m.tag,payload:m.payload,callback:m.callback,next:null},H===null?(R=H=D,N=V):H=H.next=D,d|=M;if(m=m.next,m===null){if(m=s.shared.pending,m===null)break;D=m,m=D.next,D.next=null,s.lastBaseUpdate=D,s.shared.pending=null}}while(!0);H===null&&(N=V),s.baseState=N,s.firstBaseUpdate=R,s.lastBaseUpdate=H,i===null&&(s.shared.lanes=0),Xl|=d,e.lanes=d,e.memoizedState=V}}function bu(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function ju(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)bu(l[e],t)}var Za=S(null),As=S(0);function Su(e,t){e=Cl,I(As,e),I(Za,t),Cl=e|t.baseLanes}function yi(){I(As,Cl),I(Za,Za.current)}function gi(){Cl=As.current,z(Za),z(As)}var Ut=S(null),It=null;function Gl(e){var t=e.alternate;I(tt,tt.current&1),I(Ut,e),It===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(It=e)}function bi(e){I(tt,tt.current),I(Ut,e),It===null&&(It=e)}function Nu(e){e.tag===22?(I(tt,tt.current),I(Ut,e),It===null&&(It=e)):Yl()}function Yl(){I(tt,tt.current),I(Ut,Ut.current)}function qt(e){z(Ut),It===e&&(It=null),z(tt)}var tt=S(0);function Rs(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Co(l)||wo(l)))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)!==0)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 gl=0,je=null,He=null,it=null,_s=!1,$a=!1,ga=!1,Ms=0,zn=0,Ja=null,tm=0;function Ie(){throw Error(u(321))}function ji(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Bt(e[l],t[l]))return!1;return!0}function Si(e,t,l,n,s,i){return gl=i,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,T.H=e===null||e.memoizedState===null?rd:Bi,ga=!1,i=l(n,s),ga=!1,$a&&(i=ku(t,l,n,s)),Eu(e),i}function Eu(e){T.H=Bn;var t=He!==null&&He.next!==null;if(gl=0,it=He=je=null,_s=!1,zn=0,Ja=null,t)throw Error(u(300));e===null||ot||(e=e.dependencies,e!==null&&Ss(e)&&(ot=!0))}function ku(e,t,l,n){je=e;var s=0;do{if($a&&(Ja=null),zn=0,$a=!1,25<=s)throw Error(u(301));if(s+=1,it=He=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}T.H=id,i=t(l,n)}while($a);return i}function lm(){var e=T.H,t=e.useState()[0];return t=typeof t.then=="function"?Dn(t):t,e=e.useState()[0],(He!==null?He.memoizedState:null)!==e&&(je.flags|=1024),t}function Ni(){var e=Ms!==0;return Ms=0,e}function Ei(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function ki(e){if(_s){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_s=!1}gl=0,it=He=je=null,$a=!1,zn=Ms=0,Ja=null}function St(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?je.memoizedState=it=e:it=it.next=e,it}function lt(){if(He===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=it===null?je.memoizedState:it.next;if(t!==null)it=t,He=e;else{if(e===null)throw je.alternate===null?Error(u(467)):Error(u(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},it===null?je.memoizedState=it=e:it=it.next=e}return it}function Ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Dn(e){var t=zn;return zn+=1,Ja===null&&(Ja=[]),e=mu(Ja,e,t),t=je,(it===null?t.memoizedState:it.next)===null&&(t=t.alternate,T.H=t===null||t.memoizedState===null?rd:Bi),e}function zs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Dn(e);if(e.$$typeof===le)return yt(e)}throw Error(u(438,String(e)))}function Ti(e){var t=null,l=je.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var n=je.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Ls(),je.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),n=0;n<e;n++)l[n]=he;return t.index++,l}function bl(e,t){return typeof t=="function"?t(e):t}function Ds(e){var t=lt();return Ci(t,He,e)}function Ci(e,t,l){var n=e.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=l;var s=e.baseQueue,i=n.pending;if(i!==null){if(s!==null){var d=s.next;s.next=i.next,i.next=d}t.baseQueue=s=i,n.pending=null}if(i=e.baseState,s===null)e.memoizedState=i;else{t=s.next;var m=d=null,N=null,R=t,H=!1;do{var V=R.lane&-536870913;if(V!==R.lane?(Te&V)===V:(gl&V)===V){var M=R.revertLane;if(M===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),V===Va&&(H=!0);else if((gl&M)===M){R=R.next,M===Va&&(H=!0);continue}else V={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},N===null?(m=N=V,d=i):N=N.next=V,je.lanes|=M,Xl|=M;V=R.action,ga&&l(i,V),i=R.hasEagerState?R.eagerState:l(i,V)}else M={lane:V,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},N===null?(m=N=M,d=i):N=N.next=M,je.lanes|=V,Xl|=V;R=R.next}while(R!==null&&R!==t);if(N===null?d=i:N.next=m,!Bt(i,e.memoizedState)&&(ot=!0,H&&(l=Qa,l!==null)))throw l;e.memoizedState=i,e.baseState=d,e.baseQueue=N,n.lastRenderedState=i}return s===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function wi(e){var t=lt(),l=t.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=e;var n=l.dispatch,s=l.pending,i=t.memoizedState;if(s!==null){l.pending=null;var d=s=s.next;do i=e(i,d.action),d=d.next;while(d!==s);Bt(i,t.memoizedState)||(ot=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),l.lastRenderedState=i}return[i,n]}function Tu(e,t,l){var n=je,s=lt(),i=we;if(i){if(l===void 0)throw Error(u(407));l=l()}else l=t();var d=!Bt((He||s).memoizedState,l);if(d&&(s.memoizedState=l,ot=!0),s=s.queue,_i(Au.bind(null,n,s,e),[e]),s.getSnapshot!==t||d||it!==null&&it.memoizedState.tag&1){if(n.flags|=2048,Wa(9,{destroy:void 0},wu.bind(null,n,s,l,t),null),Ye===null)throw Error(u(349));i||(gl&127)!==0||Cu(n,t,l)}return l}function Cu(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=je.updateQueue,t===null?(t=Ls(),je.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function wu(e,t,l,n){t.value=l,t.getSnapshot=n,Ru(t)&&_u(e)}function Au(e,t,l){return l(function(){Ru(t)&&_u(e)})}function Ru(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Bt(e,l)}catch{return!0}}function _u(e){var t=ua(e,2);t!==null&&Mt(t,e,2)}function Ai(e){var t=St();if(typeof e=="function"){var l=e;if(e=l(),ga){nt(!0);try{l()}finally{nt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bl,lastRenderedState:e},t}function Mu(e,t,l,n){return e.baseState=l,Ci(e,He,typeof n=="function"?n:bl)}function am(e,t,l,n,s){if(Hs(e))throw Error(u(485));if(e=t.action,e!==null){var i={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){i.listeners.push(d)}};T.T!==null?l(!0):i.isTransition=!1,n(i),l=t.pending,l===null?(i.next=t.pending=i,Lu(t,i)):(i.next=l.next,t.pending=l.next=i)}}function Lu(e,t){var l=t.action,n=t.payload,s=e.state;if(t.isTransition){var i=T.T,d={};T.T=d;try{var m=l(s,n),N=T.S;N!==null&&N(d,m),zu(e,t,m)}catch(R){Ri(e,t,R)}finally{i!==null&&d.types!==null&&(i.types=d.types),T.T=i}}else try{i=l(s,n),zu(e,t,i)}catch(R){Ri(e,t,R)}}function zu(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){Du(e,t,n)},function(n){return Ri(e,t,n)}):Du(e,t,l)}function Du(e,t,l){t.status="fulfilled",t.value=l,Ou(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Lu(e,l)))}function Ri(e,t,l){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=l,Ou(t),t=t.next;while(t!==n)}e.action=null}function Ou(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Bu(e,t){return t}function Hu(e,t){if(we){var l=Ye.formState;if(l!==null){e:{var n=je;if(we){if(Ke){t:{for(var s=Ke,i=Ft;s.nodeType!==8;){if(!i){s=null;break t}if(s=Pt(s.nextSibling),s===null){s=null;break t}}i=s.data,s=i==="F!"||i==="F"?s:null}if(s){Ke=Pt(s.nextSibling),n=s.data==="F!";break e}}Ol(n)}n=!1}n&&(t=l[0])}}return l=St(),l.memoizedState=l.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bu,lastRenderedState:t},l.queue=n,l=ad.bind(null,je,n),n.dispatch=l,n=Ai(!1),i=Oi.bind(null,je,!1,n.queue),n=St(),s={state:t,dispatch:null,action:e,pending:null},n.queue=s,l=am.bind(null,je,s,i,l),s.dispatch=l,n.memoizedState=e,[t,l,!1]}function Uu(e){var t=lt();return qu(t,He,e)}function qu(e,t,l){if(t=Ci(e,t,Bu)[0],e=Ds(bl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Dn(t)}catch(d){throw d===Xa?ks:d}else n=t;t=lt();var s=t.queue,i=s.dispatch;return l!==t.memoizedState&&(je.flags|=2048,Wa(9,{destroy:void 0},nm.bind(null,s,l),null)),[n,i,e]}function nm(e,t){e.action=t}function Gu(e){var t=lt(),l=He;if(l!==null)return qu(t,l,e);lt(),t=t.memoizedState,l=lt();var n=l.queue.dispatch;return l.memoizedState=e,[t,n,!1]}function Wa(e,t,l,n){return e={tag:e,create:l,deps:n,inst:t,next:null},t=je.updateQueue,t===null&&(t=Ls(),je.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(n=l.next,l.next=e,e.next=n,t.lastEffect=e),e}function Yu(){return lt().memoizedState}function Os(e,t,l,n){var s=St();je.flags|=e,s.memoizedState=Wa(1|t,{destroy:void 0},l,n===void 0?null:n)}function Bs(e,t,l,n){var s=lt();n=n===void 0?null:n;var i=s.memoizedState.inst;He!==null&&n!==null&&ji(n,He.memoizedState.deps)?s.memoizedState=Wa(t,i,l,n):(je.flags|=e,s.memoizedState=Wa(1|t,i,l,n))}function Vu(e,t){Os(8390656,8,e,t)}function _i(e,t){Bs(2048,8,e,t)}function sm(e){je.flags|=4;var t=je.updateQueue;if(t===null)t=Ls(),je.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Qu(e){var t=lt().memoizedState;return sm({ref:t,nextImpl:e}),function(){if((ze&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Xu(e,t){return Bs(4,2,e,t)}function Ku(e,t){return Bs(4,4,e,t)}function Zu(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $u(e,t,l){l=l!=null?l.concat([e]):null,Bs(4,4,Zu.bind(null,t,e),l)}function Mi(){}function Ju(e,t){var l=lt();t=t===void 0?null:t;var n=l.memoizedState;return t!==null&&ji(t,n[1])?n[0]:(l.memoizedState=[e,t],e)}function Wu(e,t){var l=lt();t=t===void 0?null:t;var n=l.memoizedState;if(t!==null&&ji(t,n[1]))return n[0];if(n=e(),ga){nt(!0);try{e()}finally{nt(!1)}}return l.memoizedState=[n,t],n}function Li(e,t,l){return l===void 0||(gl&1073741824)!==0&&(Te&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Fd(),je.lanes|=e,Xl|=e,l)}function Fu(e,t,l,n){return Bt(l,t)?l:Za.current!==null?(e=Li(e,l,n),Bt(e,t)||(ot=!0),e):(gl&42)===0||(gl&1073741824)!==0&&(Te&261930)===0?(ot=!0,e.memoizedState=l):(e=Fd(),je.lanes|=e,Xl|=e,t)}function Iu(e,t,l,n,s){var i=_.p;_.p=i!==0&&8>i?i:8;var d=T.T,m={};T.T=m,Oi(e,!1,t,l);try{var N=s(),R=T.S;if(R!==null&&R(m,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var H=em(N,n);On(e,t,H,Vt(e))}else On(e,t,n,Vt(e))}catch(V){On(e,t,{then:function(){},status:"rejected",reason:V},Vt())}finally{_.p=i,d!==null&&m.types!==null&&(d.types=m.types),T.T=d}}function rm(){}function zi(e,t,l,n){if(e.tag!==5)throw Error(u(476));var s=Pu(e).queue;Iu(e,s,t,ee,l===null?rm:function(){return ed(e),l(n)})}function Pu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bl,lastRenderedState:ee},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ed(e){var t=Pu(e);t.next===null&&(t=e.alternate.memoizedState),On(e,t.next.queue,{},Vt())}function Di(){return yt(Pn)}function td(){return lt().memoizedState}function ld(){return lt().memoizedState}function im(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Vt();e=Ul(l);var n=ql(t,e,l);n!==null&&(Mt(n,t,l),_n(n,t,l)),t={cache:ui()},e.payload=t;return}t=t.return}}function om(e,t,l){var n=Vt();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Hs(e)?nd(t,l):(l=Pr(e,t,l,n),l!==null&&(Mt(l,e,n),sd(l,t,n)))}function ad(e,t,l){var n=Vt();On(e,t,l,n)}function On(e,t,l,n){var s={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Hs(e))nd(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var d=t.lastRenderedState,m=i(d,l);if(s.hasEagerState=!0,s.eagerState=m,Bt(m,d))return ys(e,t,s,0),Ye===null&&vs(),!1}catch{}finally{}if(l=Pr(e,t,s,n),l!==null)return Mt(l,e,n),sd(l,t,n),!0}return!1}function Oi(e,t,l,n){if(n={lane:2,revertLane:mo(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Hs(e)){if(t)throw Error(u(479))}else t=Pr(e,l,n,2),t!==null&&Mt(t,e,2)}function Hs(e){var t=e.alternate;return e===je||t!==null&&t===je}function nd(e,t){$a=_s=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function sd(e,t,l){if((l&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,uc(e,l)}}var Bn={readContext:yt,use:zs,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useLayoutEffect:Ie,useInsertionEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useSyncExternalStore:Ie,useId:Ie,useHostTransitionStatus:Ie,useFormState:Ie,useActionState:Ie,useOptimistic:Ie,useMemoCache:Ie,useCacheRefresh:Ie};Bn.useEffectEvent=Ie;var rd={readContext:yt,use:zs,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:yt,useEffect:Vu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Os(4194308,4,Zu.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Os(4194308,4,e,t)},useInsertionEffect:function(e,t){Os(4,2,e,t)},useMemo:function(e,t){var l=St();t=t===void 0?null:t;var n=e();if(ga){nt(!0);try{e()}finally{nt(!1)}}return l.memoizedState=[n,t],n},useReducer:function(e,t,l){var n=St();if(l!==void 0){var s=l(t);if(ga){nt(!0);try{l(t)}finally{nt(!1)}}}else s=t;return n.memoizedState=n.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},n.queue=e,e=e.dispatch=om.bind(null,je,e),[n.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:function(e){e=Ai(e);var t=e.queue,l=ad.bind(null,je,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Mi,useDeferredValue:function(e,t){var l=St();return Li(l,e,t)},useTransition:function(){var e=Ai(!1);return e=Iu.bind(null,je,e.queue,!0,!1),St().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var n=je,s=St();if(we){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Ye===null)throw Error(u(349));(Te&127)!==0||Cu(n,t,l)}s.memoizedState=l;var i={value:l,getSnapshot:t};return s.queue=i,Vu(Au.bind(null,n,i,e),[e]),n.flags|=2048,Wa(9,{destroy:void 0},wu.bind(null,n,i,l,t),null),l},useId:function(){var e=St(),t=Ye.identifierPrefix;if(we){var l=cl,n=ol;l=(n&~(1<<32-et(n)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ms++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=tm++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Di,useFormState:Hu,useActionState:Hu,useOptimistic:function(e){var t=St();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Oi.bind(null,je,!0,l),l.dispatch=t,[e,t]},useMemoCache:Ti,useCacheRefresh:function(){return St().memoizedState=im.bind(null,je)},useEffectEvent:function(e){var t=St(),l={impl:e};return t.memoizedState=l,function(){if((ze&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},Bi={readContext:yt,use:zs,useCallback:Ju,useContext:yt,useEffect:_i,useImperativeHandle:$u,useInsertionEffect:Xu,useLayoutEffect:Ku,useMemo:Wu,useReducer:Ds,useRef:Yu,useState:function(){return Ds(bl)},useDebugValue:Mi,useDeferredValue:function(e,t){var l=lt();return Fu(l,He.memoizedState,e,t)},useTransition:function(){var e=Ds(bl)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:Dn(e),t]},useSyncExternalStore:Tu,useId:td,useHostTransitionStatus:Di,useFormState:Uu,useActionState:Uu,useOptimistic:function(e,t){var l=lt();return Mu(l,He,e,t)},useMemoCache:Ti,useCacheRefresh:ld};Bi.useEffectEvent=Qu;var id={readContext:yt,use:zs,useCallback:Ju,useContext:yt,useEffect:_i,useImperativeHandle:$u,useInsertionEffect:Xu,useLayoutEffect:Ku,useMemo:Wu,useReducer:wi,useRef:Yu,useState:function(){return wi(bl)},useDebugValue:Mi,useDeferredValue:function(e,t){var l=lt();return He===null?Li(l,e,t):Fu(l,He.memoizedState,e,t)},useTransition:function(){var e=wi(bl)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:Dn(e),t]},useSyncExternalStore:Tu,useId:td,useHostTransitionStatus:Di,useFormState:Gu,useActionState:Gu,useOptimistic:function(e,t){var l=lt();return He!==null?Mu(l,He,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Ti,useCacheRefresh:ld};id.useEffectEvent=Qu;function Hi(e,t,l,n){t=e.memoizedState,l=l(n,t),l=l==null?t:g({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Ui={enqueueSetState:function(e,t,l){e=e._reactInternals;var n=Vt(),s=Ul(n);s.payload=t,l!=null&&(s.callback=l),t=ql(e,s,n),t!==null&&(Mt(t,e,n),_n(t,e,n))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var n=Vt(),s=Ul(n);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=ql(e,s,n),t!==null&&(Mt(t,e,n),_n(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Vt(),n=Ul(l);n.tag=2,t!=null&&(n.callback=t),t=ql(e,n,l),t!==null&&(Mt(t,e,l),_n(t,e,l))}};function od(e,t,l,n,s,i,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,d):t.prototype&&t.prototype.isPureReactComponent?!Nn(l,n)||!Nn(s,i):!0}function cd(e,t,l,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,n),t.state!==e&&Ui.enqueueReplaceState(t,t.state,null)}function ba(e,t){var l=t;if("ref"in t){l={};for(var n in t)n!=="ref"&&(l[n]=t[n])}if(e=e.defaultProps){l===t&&(l=g({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function ud(e){hs(e)}function dd(e){console.error(e)}function fd(e){hs(e)}function Us(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function xd(e,t,l){try{var n=e.onCaughtError;n(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function qi(e,t,l){return l=Ul(l),l.tag=3,l.payload={element:null},l.callback=function(){Us(e,t)},l}function pd(e){return e=Ul(e),e.tag=3,e}function md(e,t,l,n){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var i=n.value;e.payload=function(){return s(i)},e.callback=function(){xd(t,l,n)}}var d=l.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){xd(t,l,n),typeof s!="function"&&(Kl===null?Kl=new Set([this]):Kl.add(this));var m=n.stack;this.componentDidCatch(n.value,{componentStack:m!==null?m:""})})}function cm(e,t,l,n,s){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=l.alternate,t!==null&&Ya(t,l,s,!0),l=Ut.current,l!==null){switch(l.tag){case 31:case 13:return It===null?Fs():l.alternate===null&&Pe===0&&(Pe=3),l.flags&=-257,l.flags|=65536,l.lanes=s,n===Ts?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([n]):t.add(n),fo(e,n,s)),!1;case 22:return l.flags|=65536,n===Ts?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([n]):l.add(n)),fo(e,n,s)),!1}throw Error(u(435,l.tag))}return fo(e,n,s),Fs(),!1}if(we)return t=Ut.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,n!==si&&(e=Error(u(422),{cause:n}),Tn($t(e,l)))):(n!==si&&(t=Error(u(423),{cause:n}),Tn($t(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,n=$t(n,l),s=qi(e.stateNode,n,s),hi(e,s),Pe!==4&&(Pe=2)),!1;var i=Error(u(520),{cause:n});if(i=$t(i,l),Xn===null?Xn=[i]:Xn.push(i),Pe!==4&&(Pe=2),t===null)return!0;n=$t(n,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=qi(l.stateNode,n,e),hi(l,e),!1;case 1:if(t=l.type,i=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Kl===null||!Kl.has(i))))return l.flags|=65536,s&=-s,l.lanes|=s,s=pd(s),md(s,e,l,n),hi(l,s),!1}l=l.return}while(l!==null);return!1}var Gi=Error(u(461)),ot=!1;function gt(e,t,l,n){t.child=e===null?gu(t,null,l,n):ya(t,e.child,l,n)}function hd(e,t,l,n,s){l=l.render;var i=t.ref;if("ref"in n){var d={};for(var m in n)m!=="ref"&&(d[m]=n[m])}else d=n;return pa(t),n=Si(e,t,l,d,i,s),m=Ni(),e!==null&&!ot?(Ei(e,t,s),jl(e,t,s)):(we&&m&&ai(t),t.flags|=1,gt(e,t,n,s),t.child)}function vd(e,t,l,n,s){if(e===null){var i=l.type;return typeof i=="function"&&!ei(i)&&i.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=i,yd(e,t,i,n,s)):(e=bs(l.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Ji(e,s)){var d=i.memoizedProps;if(l=l.compare,l=l!==null?l:Nn,l(d,n)&&e.ref===t.ref)return jl(e,t,s)}return t.flags|=1,e=ml(i,n),e.ref=t.ref,e.return=t,t.child=e}function yd(e,t,l,n,s){if(e!==null){var i=e.memoizedProps;if(Nn(i,n)&&e.ref===t.ref)if(ot=!1,t.pendingProps=n=i,Ji(e,s))(e.flags&131072)!==0&&(ot=!0);else return t.lanes=e.lanes,jl(e,t,s)}return Yi(e,t,l,n,s)}function gd(e,t,l,n){var s=n.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|l:l,e!==null){for(n=t.child=e.child,s=0;n!==null;)s=s|n.lanes|n.childLanes,n=n.sibling;n=s&~i}else n=0,t.child=null;return bd(e,t,i,l,n)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Es(t,i!==null?i.cachePool:null),i!==null?Su(t,i):yi(),Nu(t);else return n=t.lanes=536870912,bd(e,t,i!==null?i.baseLanes|l:l,l,n)}else i!==null?(Es(t,i.cachePool),Su(t,i),Yl(),t.memoizedState=null):(e!==null&&Es(t,null),yi(),Yl());return gt(e,t,s,l),t.child}function Hn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function bd(e,t,l,n,s){var i=fi();return i=i===null?null:{parent:rt._currentValue,pool:i},t.memoizedState={baseLanes:l,cachePool:i},e!==null&&Es(t,null),yi(),Nu(t),e!==null&&Ya(e,t,n,!0),t.childLanes=s,null}function qs(e,t){return t=Ys({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function jd(e,t,l){return ya(t,e.child,null,l),e=qs(t,t.pendingProps),e.flags|=2,qt(t),t.memoizedState=null,e}function um(e,t,l){var n=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(we){if(n.mode==="hidden")return e=qs(t,n),t.lanes=536870912,Hn(null,e);if(bi(t),(e=Ke)?(e=zf(e,Ft),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zl!==null?{id:ol,overflow:cl}:null,retryLane:536870912,hydrationErrors:null},l=nu(e),l.return=t,t.child=l,vt=t,Ke=null)):e=null,e===null)throw Ol(t);return t.lanes=536870912,null}return qs(t,n)}var i=e.memoizedState;if(i!==null){var d=i.dehydrated;if(bi(t),s)if(t.flags&256)t.flags&=-257,t=jd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(ot||Ya(e,t,l,!1),s=(l&e.childLanes)!==0,ot||s){if(n=Ye,n!==null&&(d=dc(n,l),d!==0&&d!==i.retryLane))throw i.retryLane=d,ua(e,d),Mt(n,e,d),Gi;Fs(),t=jd(e,t,l)}else e=i.treeContext,Ke=Pt(d.nextSibling),vt=t,we=!0,Dl=null,Ft=!1,e!==null&&iu(t,e),t=qs(t,n),t.flags|=4096;return t}return e=ml(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gs(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(u(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Yi(e,t,l,n,s){return pa(t),l=Si(e,t,l,n,void 0,s),n=Ni(),e!==null&&!ot?(Ei(e,t,s),jl(e,t,s)):(we&&n&&ai(t),t.flags|=1,gt(e,t,l,s),t.child)}function Sd(e,t,l,n,s,i){return pa(t),t.updateQueue=null,l=ku(t,n,l,s),Eu(e),n=Ni(),e!==null&&!ot?(Ei(e,t,i),jl(e,t,i)):(we&&n&&ai(t),t.flags|=1,gt(e,t,l,i),t.child)}function Nd(e,t,l,n,s){if(pa(t),t.stateNode===null){var i=Ha,d=l.contextType;typeof d=="object"&&d!==null&&(i=yt(d)),i=new l(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Ui,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},pi(t),d=l.contextType,i.context=typeof d=="object"&&d!==null?yt(d):Ha,i.state=t.memoizedState,d=l.getDerivedStateFromProps,typeof d=="function"&&(Hi(t,l,d,n),i.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(d=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),d!==i.state&&Ui.enqueueReplaceState(i,i.state,null),Ln(t,n,i,s),Mn(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var m=t.memoizedProps,N=ba(l,m);i.props=N;var R=i.context,H=l.contextType;d=Ha,typeof H=="object"&&H!==null&&(d=yt(H));var V=l.getDerivedStateFromProps;H=typeof V=="function"||typeof i.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,H||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(m||R!==d)&&cd(t,i,n,d),Hl=!1;var M=t.memoizedState;i.state=M,Ln(t,n,i,s),Mn(),R=t.memoizedState,m||M!==R||Hl?(typeof V=="function"&&(Hi(t,l,V,n),R=t.memoizedState),(N=Hl||od(t,l,N,n,M,R,d))?(H||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=R),i.props=n,i.state=R,i.context=d,n=N):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,mi(e,t),d=t.memoizedProps,H=ba(l,d),i.props=H,V=t.pendingProps,M=i.context,R=l.contextType,N=Ha,typeof R=="object"&&R!==null&&(N=yt(R)),m=l.getDerivedStateFromProps,(R=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(d!==V||M!==N)&&cd(t,i,n,N),Hl=!1,M=t.memoizedState,i.state=M,Ln(t,n,i,s),Mn();var D=t.memoizedState;d!==V||M!==D||Hl||e!==null&&e.dependencies!==null&&Ss(e.dependencies)?(typeof m=="function"&&(Hi(t,l,m,n),D=t.memoizedState),(H=Hl||od(t,l,H,n,M,D,N)||e!==null&&e.dependencies!==null&&Ss(e.dependencies))?(R||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,D,N),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,D,N)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=D),i.props=n,i.state=D,i.context=N,n=H):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,Gs(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,l=n&&typeof l.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=ya(t,e.child,null,s),t.child=ya(t,null,l,s)):gt(e,t,l,s),t.memoizedState=i.state,e=t.child):e=jl(e,t,s),e}function Ed(e,t,l,n){return fa(),t.flags|=256,gt(e,t,l,n),t.child}var Vi={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qi(e){return{baseLanes:e,cachePool:xu()}}function Xi(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Yt),e}function kd(e,t,l){var n=t.pendingProps,s=!1,i=(t.flags&128)!==0,d;if((d=i)||(d=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),d&&(s=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(we){if(s?Gl(t):Yl(),(e=Ke)?(e=zf(e,Ft),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zl!==null?{id:ol,overflow:cl}:null,retryLane:536870912,hydrationErrors:null},l=nu(e),l.return=t,t.child=l,vt=t,Ke=null)):e=null,e===null)throw Ol(t);return wo(e)?t.lanes=32:t.lanes=536870912,null}var m=n.children;return n=n.fallback,s?(Yl(),s=t.mode,m=Ys({mode:"hidden",children:m},s),n=da(n,s,l,null),m.return=t,n.return=t,m.sibling=n,t.child=m,n=t.child,n.memoizedState=Qi(l),n.childLanes=Xi(e,d,l),t.memoizedState=Vi,Hn(null,n)):(Gl(t),Ki(t,m))}var N=e.memoizedState;if(N!==null&&(m=N.dehydrated,m!==null)){if(i)t.flags&256?(Gl(t),t.flags&=-257,t=Zi(e,t,l)):t.memoizedState!==null?(Yl(),t.child=e.child,t.flags|=128,t=null):(Yl(),m=n.fallback,s=t.mode,n=Ys({mode:"visible",children:n.children},s),m=da(m,s,l,null),m.flags|=2,n.return=t,m.return=t,n.sibling=m,t.child=n,ya(t,e.child,null,l),n=t.child,n.memoizedState=Qi(l),n.childLanes=Xi(e,d,l),t.memoizedState=Vi,t=Hn(null,n));else if(Gl(t),wo(m)){if(d=m.nextSibling&&m.nextSibling.dataset,d)var R=d.dgst;d=R,n=Error(u(419)),n.stack="",n.digest=d,Tn({value:n,source:null,stack:null}),t=Zi(e,t,l)}else if(ot||Ya(e,t,l,!1),d=(l&e.childLanes)!==0,ot||d){if(d=Ye,d!==null&&(n=dc(d,l),n!==0&&n!==N.retryLane))throw N.retryLane=n,ua(e,n),Mt(d,e,n),Gi;Co(m)||Fs(),t=Zi(e,t,l)}else Co(m)?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,Ke=Pt(m.nextSibling),vt=t,we=!0,Dl=null,Ft=!1,e!==null&&iu(t,e),t=Ki(t,n.children),t.flags|=4096);return t}return s?(Yl(),m=n.fallback,s=t.mode,N=e.child,R=N.sibling,n=ml(N,{mode:"hidden",children:n.children}),n.subtreeFlags=N.subtreeFlags&65011712,R!==null?m=ml(R,m):(m=da(m,s,l,null),m.flags|=2),m.return=t,n.return=t,n.sibling=m,t.child=n,Hn(null,n),n=t.child,m=e.child.memoizedState,m===null?m=Qi(l):(s=m.cachePool,s!==null?(N=rt._currentValue,s=s.parent!==N?{parent:N,pool:N}:s):s=xu(),m={baseLanes:m.baseLanes|l,cachePool:s}),n.memoizedState=m,n.childLanes=Xi(e,d,l),t.memoizedState=Vi,Hn(e.child,n)):(Gl(t),l=e.child,e=l.sibling,l=ml(l,{mode:"visible",children:n.children}),l.return=t,l.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=l,t.memoizedState=null,l)}function Ki(e,t){return t=Ys({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ys(e,t){return e=Ht(22,e,null,t),e.lanes=0,e}function Zi(e,t,l){return ya(t,e.child,null,l),e=Ki(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Td(e,t,l){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),oi(e.return,t,l)}function $i(e,t,l,n,s,i){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:l,tailMode:s,treeForkCount:i}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=n,d.tail=l,d.tailMode=s,d.treeForkCount=i)}function Cd(e,t,l){var n=t.pendingProps,s=n.revealOrder,i=n.tail;n=n.children;var d=tt.current,m=(d&2)!==0;if(m?(d=d&1|2,t.flags|=128):d&=1,I(tt,d),gt(e,t,n,l),n=we?kn:0,!m&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Td(e,l,t);else if(e.tag===19)Td(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(l=t.child,s=null;l!==null;)e=l.alternate,e!==null&&Rs(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),$i(t,!1,s,l,i,n);break;case"backwards":case"unstable_legacy-backwards":for(l=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Rs(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}$i(t,!0,l,null,i,n);break;case"together":$i(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function jl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Xl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Ya(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,l=ml(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=ml(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Ji(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ss(e)))}function dm(e,t,l){switch(t.tag){case 3:Be(t,t.stateNode.containerInfo),Bl(t,rt,e.memoizedState.cache),fa();break;case 27:case 5:ut(t);break;case 4:Be(t,t.stateNode.containerInfo);break;case 10:Bl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,bi(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Gl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?kd(e,t,l):(Gl(t),e=jl(e,t,l),e!==null?e.sibling:null);Gl(t);break;case 19:var s=(e.flags&128)!==0;if(n=(l&t.childLanes)!==0,n||(Ya(e,t,l,!1),n=(l&t.childLanes)!==0),s){if(n)return Cd(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),I(tt,tt.current),n)break;return null;case 22:return t.lanes=0,gd(e,t,l,t.pendingProps);case 24:Bl(t,rt,e.memoizedState.cache)}return jl(e,t,l)}function wd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)ot=!0;else{if(!Ji(e,l)&&(t.flags&128)===0)return ot=!1,dm(e,t,l);ot=(e.flags&131072)!==0}else ot=!1,we&&(t.flags&1048576)!==0&&ru(t,kn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=ha(t.elementType),t.type=e,typeof e=="function")ei(e)?(n=ba(e,n),t.tag=1,t=Nd(null,t,e,n,l)):(t.tag=0,t=Yi(null,t,e,n,l));else{if(e!=null){var s=e.$$typeof;if(s===Q){t.tag=11,t=hd(null,t,e,n,l);break e}else if(s===U){t.tag=14,t=vd(null,t,e,n,l);break e}}throw t=te(e)||e,Error(u(306,t,""))}}return t;case 0:return Yi(e,t,t.type,t.pendingProps,l);case 1:return n=t.type,s=ba(n,t.pendingProps),Nd(e,t,n,s,l);case 3:e:{if(Be(t,t.stateNode.containerInfo),e===null)throw Error(u(387));n=t.pendingProps;var i=t.memoizedState;s=i.element,mi(e,t),Ln(t,n,null,l);var d=t.memoizedState;if(n=d.cache,Bl(t,rt,n),n!==i.cache&&ci(t,[rt],l,!0),Mn(),n=d.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Ed(e,t,n,l);break e}else if(n!==s){s=$t(Error(u(424)),t),Tn(s),t=Ed(e,t,n,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ke=Pt(e.firstChild),vt=t,we=!0,Dl=null,Ft=!0,l=gu(t,null,n,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(fa(),n===s){t=jl(e,t,l);break e}gt(e,t,n,l)}t=t.child}return t;case 26:return Gs(e,t),e===null?(l=qf(t.type,null,t.pendingProps,null))?t.memoizedState=l:we||(l=t.type,e=t.pendingProps,n=nr(ae.current).createElement(l),n[ht]=t,n[Tt]=e,bt(n,l,e),xt(n),t.stateNode=n):t.memoizedState=qf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ut(t),e===null&&we&&(n=t.stateNode=Bf(t.type,t.pendingProps,ae.current),vt=t,Ft=!0,s=Ke,Wl(t.type)?(Ao=s,Ke=Pt(n.firstChild)):Ke=s),gt(e,t,t.pendingProps.children,l),Gs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&we&&((s=n=Ke)&&(n=Gm(n,t.type,t.pendingProps,Ft),n!==null?(t.stateNode=n,vt=t,Ke=Pt(n.firstChild),Ft=!1,s=!0):s=!1),s||Ol(t)),ut(t),s=t.type,i=t.pendingProps,d=e!==null?e.memoizedProps:null,n=i.children,Eo(s,i)?n=null:d!==null&&Eo(s,d)&&(t.flags|=32),t.memoizedState!==null&&(s=Si(e,t,lm,null,null,l),Pn._currentValue=s),Gs(e,t),gt(e,t,n,l),t.child;case 6:return e===null&&we&&((e=l=Ke)&&(l=Ym(l,t.pendingProps,Ft),l!==null?(t.stateNode=l,vt=t,Ke=null,e=!0):e=!1),e||Ol(t)),null;case 13:return kd(e,t,l);case 4:return Be(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ya(t,null,n,l):gt(e,t,n,l),t.child;case 11:return hd(e,t,t.type,t.pendingProps,l);case 7:return gt(e,t,t.pendingProps,l),t.child;case 8:return gt(e,t,t.pendingProps.children,l),t.child;case 12:return gt(e,t,t.pendingProps.children,l),t.child;case 10:return n=t.pendingProps,Bl(t,t.type,n.value),gt(e,t,n.children,l),t.child;case 9:return s=t.type._context,n=t.pendingProps.children,pa(t),s=yt(s),n=n(s),t.flags|=1,gt(e,t,n,l),t.child;case 14:return vd(e,t,t.type,t.pendingProps,l);case 15:return yd(e,t,t.type,t.pendingProps,l);case 19:return Cd(e,t,l);case 31:return um(e,t,l);case 22:return gd(e,t,l,t.pendingProps);case 24:return pa(t),n=yt(rt),e===null?(s=fi(),s===null&&(s=Ye,i=ui(),s.pooledCache=i,i.refCount++,i!==null&&(s.pooledCacheLanes|=l),s=i),t.memoizedState={parent:n,cache:s},pi(t),Bl(t,rt,s)):((e.lanes&l)!==0&&(mi(e,t),Ln(t,null,null,l),Mn()),s=e.memoizedState,i=t.memoizedState,s.parent!==n?(s={parent:n,cache:n},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Bl(t,rt,n)):(n=i.cache,Bl(t,rt,n),n!==s.cache&&ci(t,[rt],l,!0))),gt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Sl(e){e.flags|=4}function Wi(e,t,l,n,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(tf())e.flags|=8192;else throw va=Ts,xi}else e.flags&=-16777217}function Ad(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Xf(t))if(tf())e.flags|=8192;else throw va=Ts,xi}function Vs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?oc():536870912,e.lanes|=t,en|=t)}function Un(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var n=null;l!==null;)l.alternate!==null&&(n=l),l=l.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,n=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,n|=s.subtreeFlags&65011712,n|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=l,t}function fm(e,t,l){var n=t.pendingProps;switch(ni(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(t),null;case 3:return l=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),yl(rt),Ae(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ga(t)?Sl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ri())),Ze(t),null;case 26:var s=t.type,i=t.memoizedState;return e===null?(Sl(t),i!==null?(Ze(t),Ad(t,i)):(Ze(t),Wi(t,s,null,n,l))):i?i!==e.memoizedState?(Sl(t),Ze(t),Ad(t,i)):(Ze(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Sl(t),Ze(t),Wi(t,s,e,n,l)),null;case 27:if(Lt(t),l=ae.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Sl(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ze(t),null}e=P.current,Ga(t)?ou(t):(e=Bf(s,n,l),t.stateNode=e,Sl(t))}return Ze(t),null;case 5:if(Lt(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Sl(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ze(t),null}if(i=P.current,Ga(t))ou(t);else{var d=nr(ae.current);switch(i){case 1:i=d.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:i=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":i=d.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":i=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":i=d.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?d.createElement("select",{is:n.is}):d.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?d.createElement(s,{is:n.is}):d.createElement(s)}}i[ht]=t,i[Tt]=n;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=i;e:switch(bt(i,s,n),s){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Sl(t)}}return Ze(t),Wi(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Sl(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(u(166));if(e=ae.current,Ga(t)){if(e=t.stateNode,l=t.memoizedProps,n=null,s=vt,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[ht]=t,e=!!(e.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||Tf(e.nodeValue,l)),e||Ol(t,!0)}else e=nr(e).createTextNode(n),e[ht]=t,t.stateNode=e}return Ze(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(n=Ga(t),l!==null){if(e===null){if(!n)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[ht]=t}else fa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),e=!1}else l=ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(qt(t),t):(qt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ze(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ga(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(u(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[ht]=t}else fa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),s=!1}else s=ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(qt(t),t):(qt(t),null)}return qt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=n!==null,e=e!==null&&e.memoizedState!==null,l&&(n=t.child,s=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(s=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==s&&(n.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Vs(t,t.updateQueue),Ze(t),null);case 4:return Ae(),e===null&&go(t.stateNode.containerInfo),Ze(t),null;case 10:return yl(t.type),Ze(t),null;case 19:if(z(tt),n=t.memoizedState,n===null)return Ze(t),null;if(s=(t.flags&128)!==0,i=n.rendering,i===null)if(s)Un(n,!1);else{if(Pe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Rs(e),i!==null){for(t.flags|=128,Un(n,!1),e=i.updateQueue,t.updateQueue=e,Vs(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)au(l,e),l=l.sibling;return I(tt,tt.current&1|2),we&&hl(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&We()>$s&&(t.flags|=128,s=!0,Un(n,!1),t.lanes=4194304)}else{if(!s)if(e=Rs(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Vs(t,e),Un(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!we)return Ze(t),null}else 2*We()-n.renderingStartTime>$s&&l!==536870912&&(t.flags|=128,s=!0,Un(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=We(),e.sibling=null,l=tt.current,I(tt,s?l&1|2:l&1),we&&hl(t,n.treeForkCount),e):(Ze(t),null);case 22:case 23:return qt(t),gi(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(l&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),l=t.updateQueue,l!==null&&Vs(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==l&&(t.flags|=2048),e!==null&&z(ma),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),yl(rt),Ze(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function xm(e,t){switch(ni(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yl(rt),Ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Lt(t),null;case 31:if(t.memoizedState!==null){if(qt(t),t.alternate===null)throw Error(u(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(qt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(tt),null;case 4:return Ae(),null;case 10:return yl(t.type),null;case 22:case 23:return qt(t),gi(),e!==null&&z(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return yl(rt),null;case 25:return null;default:return null}}function Rd(e,t){switch(ni(t),t.tag){case 3:yl(rt),Ae();break;case 26:case 27:case 5:Lt(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&qt(t);break;case 13:qt(t);break;case 19:z(tt);break;case 10:yl(t.type);break;case 22:case 23:qt(t),gi(),e!==null&&z(ma);break;case 24:yl(rt)}}function qn(e,t){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var s=n.next;l=s;do{if((l.tag&e)===e){n=void 0;var i=l.create,d=l.inst;n=i(),d.destroy=n}l=l.next}while(l!==s)}}catch(m){Oe(t,t.return,m)}}function Vl(e,t,l){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){var d=n.inst,m=d.destroy;if(m!==void 0){d.destroy=void 0,s=t;var N=l,R=m;try{R()}catch(H){Oe(s,N,H)}}}n=n.next}while(n!==i)}}catch(H){Oe(t,t.return,H)}}function _d(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{ju(t,l)}catch(n){Oe(e,e.return,n)}}}function Md(e,t,l){l.props=ba(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(n){Oe(e,t,n)}}function Gn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof l=="function"?e.refCleanup=l(n):l.current=n}}catch(s){Oe(e,t,s)}}function ul(e,t){var l=e.ref,n=e.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(s){Oe(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(s){Oe(e,t,s)}else l.current=null}function Ld(e){var t=e.type,l=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break e;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(s){Oe(e,e.return,s)}}function Fi(e,t,l){try{var n=e.stateNode;Dm(n,e.type,l,t),n[Tt]=t}catch(s){Oe(e,e.return,s)}}function zd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wl(e.type)||e.tag===4}function Ii(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zd(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&&Wl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pi(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=xl));else if(n!==4&&(n===27&&Wl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Pi(e,t,l),e=e.sibling;e!==null;)Pi(e,t,l),e=e.sibling}function Qs(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(n!==4&&(n===27&&Wl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Qs(e,t,l),e=e.sibling;e!==null;)Qs(e,t,l),e=e.sibling}function Dd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);bt(t,n,l),t[ht]=e,t[Tt]=l}catch(i){Oe(e,e.return,i)}}var Nl=!1,ct=!1,eo=!1,Od=typeof WeakSet=="function"?WeakSet:Set,pt=null;function pm(e,t){if(e=e.containerInfo,So=dr,e=$c(e),Zr(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var n=l.getSelection&&l.getSelection();if(n&&n.rangeCount!==0){l=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break e}var d=0,m=-1,N=-1,R=0,H=0,V=e,M=null;t:for(;;){for(var D;V!==l||s!==0&&V.nodeType!==3||(m=d+s),V!==i||n!==0&&V.nodeType!==3||(N=d+n),V.nodeType===3&&(d+=V.nodeValue.length),(D=V.firstChild)!==null;)M=V,V=D;for(;;){if(V===e)break t;if(M===l&&++R===s&&(m=d),M===i&&++H===n&&(N=d),(D=V.nextSibling)!==null)break;V=M,M=V.parentNode}V=D}l=m===-1||N===-1?null:{start:m,end:N}}else l=null}l=l||{start:0,end:0}}else l=null;for(No={focusedElem:e,selectionRange:l},dr=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){switch(t=pt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)s=e[l],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,l=t,s=i.memoizedProps,i=i.memoizedState,n=l.stateNode;try{var oe=ba(l.type,s);e=n.getSnapshotBeforeUpdate(oe,i),n.__reactInternalSnapshotBeforeUpdate=e}catch(xe){Oe(l,l.return,xe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)To(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":To(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}}function Bd(e,t,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:kl(e,l),n&4&&qn(5,l);break;case 1:if(kl(e,l),n&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(d){Oe(l,l.return,d)}else{var s=ba(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Oe(l,l.return,d)}}n&64&&_d(l),n&512&&Gn(l,l.return);break;case 3:if(kl(e,l),n&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{ju(e,t)}catch(d){Oe(l,l.return,d)}}break;case 27:t===null&&n&4&&Dd(l);case 26:case 5:kl(e,l),t===null&&n&4&&Ld(l),n&512&&Gn(l,l.return);break;case 12:kl(e,l);break;case 31:kl(e,l),n&4&&qd(e,l);break;case 13:kl(e,l),n&4&&Gd(e,l),n&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Nm.bind(null,l),Vm(e,l))));break;case 22:if(n=l.memoizedState!==null||Nl,!n){t=t!==null&&t.memoizedState!==null||ct,s=Nl;var i=ct;Nl=n,(ct=t)&&!i?Tl(e,l,(l.subtreeFlags&8772)!==0):kl(e,l),Nl=s,ct=i}break;case 30:break;default:kl(e,l)}}function Hd(e){var t=e.alternate;t!==null&&(e.alternate=null,Hd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Rr(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 $e=null,wt=!1;function El(e,t,l){for(l=l.child;l!==null;)Ud(e,t,l),l=l.sibling}function Ud(e,t,l){if(Fe&&typeof Fe.onCommitFiberUnmount=="function")try{Fe.onCommitFiberUnmount(Et,l)}catch{}switch(l.tag){case 26:ct||ul(l,t),El(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:ct||ul(l,t);var n=$e,s=wt;Wl(l.type)&&($e=l.stateNode,wt=!1),El(e,t,l),Wn(l.stateNode),$e=n,wt=s;break;case 5:ct||ul(l,t);case 6:if(n=$e,s=wt,$e=null,El(e,t,l),$e=n,wt=s,$e!==null)if(wt)try{($e.nodeType===9?$e.body:$e.nodeName==="HTML"?$e.ownerDocument.body:$e).removeChild(l.stateNode)}catch(i){Oe(l,t,i)}else try{$e.removeChild(l.stateNode)}catch(i){Oe(l,t,i)}break;case 18:$e!==null&&(wt?(e=$e,Mf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),cn(e)):Mf($e,l.stateNode));break;case 4:n=$e,s=wt,$e=l.stateNode.containerInfo,wt=!0,El(e,t,l),$e=n,wt=s;break;case 0:case 11:case 14:case 15:Vl(2,l,t),ct||Vl(4,l,t),El(e,t,l);break;case 1:ct||(ul(l,t),n=l.stateNode,typeof n.componentWillUnmount=="function"&&Md(l,t,n)),El(e,t,l);break;case 21:El(e,t,l);break;case 22:ct=(n=ct)||l.memoizedState!==null,El(e,t,l),ct=n;break;default:El(e,t,l)}}function qd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{cn(e)}catch(l){Oe(t,t.return,l)}}}function Gd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{cn(e)}catch(l){Oe(t,t.return,l)}}function mm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Od),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Od),t;default:throw Error(u(435,e.tag))}}function Xs(e,t){var l=mm(e);t.forEach(function(n){if(!l.has(n)){l.add(n);var s=Em.bind(null,e,n);n.then(s,s)}})}function At(e,t){var l=t.deletions;if(l!==null)for(var n=0;n<l.length;n++){var s=l[n],i=e,d=t,m=d;e:for(;m!==null;){switch(m.tag){case 27:if(Wl(m.type)){$e=m.stateNode,wt=!1;break e}break;case 5:$e=m.stateNode,wt=!1;break e;case 3:case 4:$e=m.stateNode.containerInfo,wt=!0;break e}m=m.return}if($e===null)throw Error(u(160));Ud(i,d,s),$e=null,wt=!1,i=s.alternate,i!==null&&(i.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Yd(t,e),t=t.sibling}var sl=null;function Yd(e,t){var l=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:At(t,e),Rt(e),n&4&&(Vl(3,e,e.return),qn(3,e),Vl(5,e,e.return));break;case 1:At(t,e),Rt(e),n&512&&(ct||l===null||ul(l,l.return)),n&64&&Nl&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:var s=sl;if(At(t,e),Rt(e),n&512&&(ct||l===null||ul(l,l.return)),n&4){var i=l!==null?l.memoizedState:null;if(n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null){e:{n=e.type,l=e.memoizedProps,s=s.ownerDocument||s;t:switch(n){case"title":i=s.getElementsByTagName("title")[0],(!i||i[pn]||i[ht]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=s.createElement(n),s.head.insertBefore(i,s.querySelector("head > title"))),bt(i,n,l),i[ht]=e,xt(i),n=i;break e;case"link":var d=Vf("link","href",s).get(n+(l.href||""));if(d){for(var m=0;m<d.length;m++)if(i=d[m],i.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&i.getAttribute("rel")===(l.rel==null?null:l.rel)&&i.getAttribute("title")===(l.title==null?null:l.title)&&i.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){d.splice(m,1);break t}}i=s.createElement(n),bt(i,n,l),s.head.appendChild(i);break;case"meta":if(d=Vf("meta","content",s).get(n+(l.content||""))){for(m=0;m<d.length;m++)if(i=d[m],i.getAttribute("content")===(l.content==null?null:""+l.content)&&i.getAttribute("name")===(l.name==null?null:l.name)&&i.getAttribute("property")===(l.property==null?null:l.property)&&i.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&i.getAttribute("charset")===(l.charSet==null?null:l.charSet)){d.splice(m,1);break t}}i=s.createElement(n),bt(i,n,l),s.head.appendChild(i);break;default:throw Error(u(468,n))}i[ht]=e,xt(i),n=i}e.stateNode=n}else Qf(s,e.type,e.stateNode);else e.stateNode=Yf(s,n,e.memoizedProps);else i!==n?(i===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):i.count--,n===null?Qf(s,e.type,e.stateNode):Yf(s,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Fi(e,e.memoizedProps,l.memoizedProps)}break;case 27:At(t,e),Rt(e),n&512&&(ct||l===null||ul(l,l.return)),l!==null&&n&4&&Fi(e,e.memoizedProps,l.memoizedProps);break;case 5:if(At(t,e),Rt(e),n&512&&(ct||l===null||ul(l,l.return)),e.flags&32){s=e.stateNode;try{_a(s,"")}catch(oe){Oe(e,e.return,oe)}}n&4&&e.stateNode!=null&&(s=e.memoizedProps,Fi(e,s,l!==null?l.memoizedProps:s)),n&1024&&(eo=!0);break;case 6:if(At(t,e),Rt(e),n&4){if(e.stateNode===null)throw Error(u(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n}catch(oe){Oe(e,e.return,oe)}}break;case 3:if(ir=null,s=sl,sl=sr(t.containerInfo),At(t,e),sl=s,Rt(e),n&4&&l!==null&&l.memoizedState.isDehydrated)try{cn(t.containerInfo)}catch(oe){Oe(e,e.return,oe)}eo&&(eo=!1,Vd(e));break;case 4:n=sl,sl=sr(e.stateNode.containerInfo),At(t,e),Rt(e),sl=n;break;case 12:At(t,e),Rt(e);break;case 31:At(t,e),Rt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xs(e,n)));break;case 13:At(t,e),Rt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Zs=We()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xs(e,n)));break;case 22:s=e.memoizedState!==null;var N=l!==null&&l.memoizedState!==null,R=Nl,H=ct;if(Nl=R||s,ct=H||N,At(t,e),ct=H,Nl=R,Rt(e),n&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||N||Nl||ct||ja(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){N=l=t;try{if(i=N.stateNode,s)d=i.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{m=N.stateNode;var V=N.memoizedProps.style,M=V!=null&&V.hasOwnProperty("display")?V.display:null;m.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(oe){Oe(N,N.return,oe)}}}else if(t.tag===6){if(l===null){N=t;try{N.stateNode.nodeValue=s?"":N.memoizedProps}catch(oe){Oe(N,N.return,oe)}}}else if(t.tag===18){if(l===null){N=t;try{var D=N.stateNode;s?Lf(D,!0):Lf(N.stateNode,!1)}catch(oe){Oe(N,N.return,oe)}}}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 e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,Xs(e,l))));break;case 19:At(t,e),Rt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xs(e,n)));break;case 30:break;case 21:break;default:At(t,e),Rt(e)}}function Rt(e){var t=e.flags;if(t&2){try{for(var l,n=e.return;n!==null;){if(zd(n)){l=n;break}n=n.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var s=l.stateNode,i=Ii(e);Qs(e,i,s);break;case 5:var d=l.stateNode;l.flags&32&&(_a(d,""),l.flags&=-33);var m=Ii(e);Qs(e,m,d);break;case 3:case 4:var N=l.stateNode.containerInfo,R=Ii(e);Pi(e,R,N);break;default:throw Error(u(161))}}catch(H){Oe(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Vd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function kl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Bd(e,t.alternate,t),t=t.sibling}function ja(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vl(4,t,t.return),ja(t);break;case 1:ul(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Md(t,t.return,l),ja(t);break;case 27:Wn(t.stateNode);case 26:case 5:ul(t,t.return),ja(t);break;case 22:t.memoizedState===null&&ja(t);break;case 30:ja(t);break;default:ja(t)}e=e.sibling}}function Tl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,s=e,i=t,d=i.flags;switch(i.tag){case 0:case 11:case 15:Tl(s,i,l),qn(4,i);break;case 1:if(Tl(s,i,l),n=i,s=n.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(R){Oe(n,n.return,R)}if(n=i,s=n.updateQueue,s!==null){var m=n.stateNode;try{var N=s.shared.hiddenCallbacks;if(N!==null)for(s.shared.hiddenCallbacks=null,s=0;s<N.length;s++)bu(N[s],m)}catch(R){Oe(n,n.return,R)}}l&&d&64&&_d(i),Gn(i,i.return);break;case 27:Dd(i);case 26:case 5:Tl(s,i,l),l&&n===null&&d&4&&Ld(i),Gn(i,i.return);break;case 12:Tl(s,i,l);break;case 31:Tl(s,i,l),l&&d&4&&qd(s,i);break;case 13:Tl(s,i,l),l&&d&4&&Gd(s,i);break;case 22:i.memoizedState===null&&Tl(s,i,l),Gn(i,i.return);break;case 30:break;default:Tl(s,i,l)}t=t.sibling}}function to(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Cn(l))}function lo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Cn(e))}function rl(e,t,l,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Qd(e,t,l,n),t=t.sibling}function Qd(e,t,l,n){var s=t.flags;switch(t.tag){case 0:case 11:case 15:rl(e,t,l,n),s&2048&&qn(9,t);break;case 1:rl(e,t,l,n);break;case 3:rl(e,t,l,n),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Cn(e)));break;case 12:if(s&2048){rl(e,t,l,n),e=t.stateNode;try{var i=t.memoizedProps,d=i.id,m=i.onPostCommit;typeof m=="function"&&m(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){Oe(t,t.return,N)}}else rl(e,t,l,n);break;case 31:rl(e,t,l,n);break;case 13:rl(e,t,l,n);break;case 23:break;case 22:i=t.stateNode,d=t.alternate,t.memoizedState!==null?i._visibility&2?rl(e,t,l,n):Yn(e,t):i._visibility&2?rl(e,t,l,n):(i._visibility|=2,Fa(e,t,l,n,(t.subtreeFlags&10256)!==0||!1)),s&2048&&to(d,t);break;case 24:rl(e,t,l,n),s&2048&&lo(t.alternate,t);break;default:rl(e,t,l,n)}}function Fa(e,t,l,n,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,d=t,m=l,N=n,R=d.flags;switch(d.tag){case 0:case 11:case 15:Fa(i,d,m,N,s),qn(8,d);break;case 23:break;case 22:var H=d.stateNode;d.memoizedState!==null?H._visibility&2?Fa(i,d,m,N,s):Yn(i,d):(H._visibility|=2,Fa(i,d,m,N,s)),s&&R&2048&&to(d.alternate,d);break;case 24:Fa(i,d,m,N,s),s&&R&2048&&lo(d.alternate,d);break;default:Fa(i,d,m,N,s)}t=t.sibling}}function Yn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,n=t,s=n.flags;switch(n.tag){case 22:Yn(l,n),s&2048&&to(n.alternate,n);break;case 24:Yn(l,n),s&2048&&lo(n.alternate,n);break;default:Yn(l,n)}t=t.sibling}}var Vn=8192;function Ia(e,t,l){if(e.subtreeFlags&Vn)for(e=e.child;e!==null;)Xd(e,t,l),e=e.sibling}function Xd(e,t,l){switch(e.tag){case 26:Ia(e,t,l),e.flags&Vn&&e.memoizedState!==null&&th(l,sl,e.memoizedState,e.memoizedProps);break;case 5:Ia(e,t,l);break;case 3:case 4:var n=sl;sl=sr(e.stateNode.containerInfo),Ia(e,t,l),sl=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Vn,Vn=16777216,Ia(e,t,l),Vn=n):Ia(e,t,l));break;default:Ia(e,t,l)}}function Kd(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 Qn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];pt=n,$d(n,e)}Kd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zd(e),e=e.sibling}function Zd(e){switch(e.tag){case 0:case 11:case 15:Qn(e),e.flags&2048&&Vl(9,e,e.return);break;case 3:Qn(e);break;case 12:Qn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ks(e)):Qn(e);break;default:Qn(e)}}function Ks(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];pt=n,$d(n,e)}Kd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vl(8,t,t.return),Ks(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Ks(t));break;default:Ks(t)}e=e.sibling}}function $d(e,t){for(;pt!==null;){var l=pt;switch(l.tag){case 0:case 11:case 15:Vl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var n=l.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Cn(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,pt=n;else e:for(l=e;pt!==null;){n=pt;var s=n.sibling,i=n.return;if(Hd(n),n===l){pt=null;break e}if(s!==null){s.return=i,pt=s;break e}pt=i}}}var hm={getCacheForType:function(e){var t=yt(rt),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return yt(rt).controller.signal}},vm=typeof WeakMap=="function"?WeakMap:Map,ze=0,Ye=null,Ee=null,Te=0,De=0,Gt=null,Ql=!1,Pa=!1,ao=!1,Cl=0,Pe=0,Xl=0,Sa=0,no=0,Yt=0,en=0,Xn=null,_t=null,so=!1,Zs=0,Jd=0,$s=1/0,Js=null,Kl=null,ft=0,Zl=null,tn=null,wl=0,ro=0,io=null,Wd=null,Kn=0,oo=null;function Vt(){return(ze&2)!==0&&Te!==0?Te&-Te:T.T!==null?mo():fc()}function Fd(){if(Yt===0)if((Te&536870912)===0||we){var e=Ge;Ge<<=1,(Ge&3932160)===0&&(Ge=262144),Yt=e}else Yt=536870912;return e=Ut.current,e!==null&&(e.flags|=32),Yt}function Mt(e,t,l){(e===Ye&&(De===2||De===9)||e.cancelPendingCommit!==null)&&(ln(e,0),$l(e,Te,Yt,!1)),xn(e,l),((ze&2)===0||e!==Ye)&&(e===Ye&&((ze&2)===0&&(Sa|=l),Pe===4&&$l(e,Te,Yt,!1)),dl(e))}function Id(e,t,l){if((ze&6)!==0)throw Error(u(327));var n=!l&&(t&127)===0&&(t&e.expiredLanes)===0||fn(e,t),s=n?bm(e,t):uo(e,t,!0),i=n;do{if(s===0){Pa&&!n&&$l(e,t,0,!1);break}else{if(l=e.current.alternate,i&&!ym(l)){s=uo(e,t,!1),i=!1;continue}if(s===2){if(i=t,e.errorRecoveryDisabledLanes&i)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var m=e;s=Xn;var N=m.current.memoizedState.isDehydrated;if(N&&(ln(m,d).flags|=256),d=uo(m,d,!1),d!==2){if(ao&&!N){m.errorRecoveryDisabledLanes|=i,Sa|=i,s=4;break e}i=_t,_t=s,i!==null&&(_t===null?_t=i:_t.push.apply(_t,i))}s=d}if(i=!1,s!==2)continue}}if(s===1){ln(e,0),$l(e,t,0,!0);break}e:{switch(n=e,i=s,i){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:$l(n,t,Yt,!Ql);break e;case 2:_t=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=Zs+300-We(),10<s)){if($l(n,t,Yt,!Ql),Ea(n,0,!0)!==0)break e;wl=t,n.timeoutHandle=Rf(Pd.bind(null,n,l,_t,Js,so,t,Yt,Sa,en,Ql,i,"Throttled",-0,0),s);break e}Pd(n,l,_t,Js,so,t,Yt,Sa,en,Ql,i,null,-0,0)}}break}while(!0);dl(e)}function Pd(e,t,l,n,s,i,d,m,N,R,H,V,M,D){if(e.timeoutHandle=-1,V=t.subtreeFlags,V&8192||(V&16785408)===16785408){V={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xl},Xd(t,i,V);var oe=(i&62914560)===i?Zs-We():(i&4194048)===i?Jd-We():0;if(oe=lh(V,oe),oe!==null){wl=i,e.cancelPendingCommit=oe(of.bind(null,e,t,i,l,n,s,d,m,N,H,V,null,M,D)),$l(e,i,d,!R);return}}of(e,t,i,l,n,s,d,m,N)}function ym(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var n=0;n<l.length;n++){var s=l[n],i=s.getSnapshot;s=s.value;try{if(!Bt(i(),s))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 $l(e,t,l,n){t&=~no,t&=~Sa,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var s=t;0<s;){var i=31-et(s),d=1<<i;n[i]=-1,s&=~d}l!==0&&cc(e,l,t)}function Ws(){return(ze&6)===0?(Zn(0),!1):!0}function co(){if(Ee!==null){if(De===0)var e=Ee.return;else e=Ee,vl=xa=null,ki(e),Ka=null,An=0,e=Ee;for(;e!==null;)Rd(e.alternate,e),e=e.return;Ee=null}}function ln(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Hm(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),wl=0,co(),Ye=e,Ee=l=ml(e.current,null),Te=t,De=0,Gt=null,Ql=!1,Pa=fn(e,t),ao=!1,en=Yt=no=Sa=Xl=Pe=0,_t=Xn=null,so=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var s=31-et(n),i=1<<s;t|=e[s],n&=~i}return Cl=t,vs(),l}function ef(e,t){je=null,T.H=Bn,t===Xa||t===ks?(t=hu(),De=3):t===xi?(t=hu(),De=4):De=t===Gi?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Gt=t,Ee===null&&(Pe=1,Us(e,$t(t,e.current)))}function tf(){var e=Ut.current;return e===null?!0:(Te&4194048)===Te?It===null:(Te&62914560)===Te||(Te&536870912)!==0?e===It:!1}function lf(){var e=T.H;return T.H=Bn,e===null?Bn:e}function af(){var e=T.A;return T.A=hm,e}function Fs(){Pe=4,Ql||(Te&4194048)!==Te&&Ut.current!==null||(Pa=!0),(Xl&134217727)===0&&(Sa&134217727)===0||Ye===null||$l(Ye,Te,Yt,!1)}function uo(e,t,l){var n=ze;ze|=2;var s=lf(),i=af();(Ye!==e||Te!==t)&&(Js=null,ln(e,t)),t=!1;var d=Pe;e:do try{if(De!==0&&Ee!==null){var m=Ee,N=Gt;switch(De){case 8:co(),d=6;break e;case 3:case 2:case 9:case 6:Ut.current===null&&(t=!0);var R=De;if(De=0,Gt=null,an(e,m,N,R),l&&Pa){d=0;break e}break;default:R=De,De=0,Gt=null,an(e,m,N,R)}}gm(),d=Pe;break}catch(H){ef(e,H)}while(!0);return t&&e.shellSuspendCounter++,vl=xa=null,ze=n,T.H=s,T.A=i,Ee===null&&(Ye=null,Te=0,vs()),d}function gm(){for(;Ee!==null;)nf(Ee)}function bm(e,t){var l=ze;ze|=2;var n=lf(),s=af();Ye!==e||Te!==t?(Js=null,$s=We()+500,ln(e,t)):Pa=fn(e,t);e:do try{if(De!==0&&Ee!==null){t=Ee;var i=Gt;t:switch(De){case 1:De=0,Gt=null,an(e,t,i,1);break;case 2:case 9:if(pu(i)){De=0,Gt=null,sf(t);break}t=function(){De!==2&&De!==9||Ye!==e||(De=7),dl(e)},i.then(t,t);break e;case 3:De=7;break e;case 4:De=5;break e;case 7:pu(i)?(De=0,Gt=null,sf(t)):(De=0,Gt=null,an(e,t,i,7));break;case 5:var d=null;switch(Ee.tag){case 26:d=Ee.memoizedState;case 5:case 27:var m=Ee;if(d?Xf(d):m.stateNode.complete){De=0,Gt=null;var N=m.sibling;if(N!==null)Ee=N;else{var R=m.return;R!==null?(Ee=R,Is(R)):Ee=null}break t}}De=0,Gt=null,an(e,t,i,5);break;case 6:De=0,Gt=null,an(e,t,i,6);break;case 8:co(),Pe=6;break e;default:throw Error(u(462))}}jm();break}catch(H){ef(e,H)}while(!0);return vl=xa=null,T.H=n,T.A=s,ze=l,Ee!==null?0:(Ye=null,Te=0,vs(),Pe)}function jm(){for(;Ee!==null&&!tl();)nf(Ee)}function nf(e){var t=wd(e.alternate,e,Cl);e.memoizedProps=e.pendingProps,t===null?Is(e):Ee=t}function sf(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Sd(l,t,t.pendingProps,t.type,void 0,Te);break;case 11:t=Sd(l,t,t.pendingProps,t.type.render,t.ref,Te);break;case 5:ki(t);default:Rd(l,t),t=Ee=au(t,Cl),t=wd(l,t,Cl)}e.memoizedProps=e.pendingProps,t===null?Is(e):Ee=t}function an(e,t,l,n){vl=xa=null,ki(t),Ka=null,An=0;var s=t.return;try{if(cm(e,s,t,l,Te)){Pe=1,Us(e,$t(l,e.current)),Ee=null;return}}catch(i){if(s!==null)throw Ee=s,i;Pe=1,Us(e,$t(l,e.current)),Ee=null;return}t.flags&32768?(we||n===1?e=!0:Pa||(Te&536870912)!==0?e=!1:(Ql=e=!0,(n===2||n===9||n===3||n===6)&&(n=Ut.current,n!==null&&n.tag===13&&(n.flags|=16384))),rf(t,e)):Is(t)}function Is(e){var t=e;do{if((t.flags&32768)!==0){rf(t,Ql);return}e=t.return;var l=fm(t.alternate,t,Cl);if(l!==null){Ee=l;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);Pe===0&&(Pe=5)}function rf(e,t){do{var l=xm(e.alternate,e);if(l!==null){l.flags&=32767,Ee=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){Ee=e;return}Ee=e=l}while(e!==null);Pe=6,Ee=null}function of(e,t,l,n,s,i,d,m,N){e.cancelPendingCommit=null;do Ps();while(ft!==0);if((ze&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(i=t.lanes|t.childLanes,i|=Ir,ep(e,l,i,d,m,N),e===Ye&&(Ee=Ye=null,Te=0),tn=t,Zl=e,wl=l,ro=i,io=s,Wd=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,km(at,function(){return xf(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=T.T,T.T=null,s=_.p,_.p=2,d=ze,ze|=4;try{pm(e,t,l)}finally{ze=d,_.p=s,T.T=n}}ft=1,cf(),uf(),df()}}function cf(){if(ft===1){ft=0;var e=Zl,t=tn,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=T.T,T.T=null;var n=_.p;_.p=2;var s=ze;ze|=4;try{Yd(t,e);var i=No,d=$c(e.containerInfo),m=i.focusedElem,N=i.selectionRange;if(d!==m&&m&&m.ownerDocument&&Zc(m.ownerDocument.documentElement,m)){if(N!==null&&Zr(m)){var R=N.start,H=N.end;if(H===void 0&&(H=R),"selectionStart"in m)m.selectionStart=R,m.selectionEnd=Math.min(H,m.value.length);else{var V=m.ownerDocument||document,M=V&&V.defaultView||window;if(M.getSelection){var D=M.getSelection(),oe=m.textContent.length,xe=Math.min(N.start,oe),qe=N.end===void 0?xe:Math.min(N.end,oe);!D.extend&&xe>qe&&(d=qe,qe=xe,xe=d);var C=Kc(m,xe),E=Kc(m,qe);if(C&&E&&(D.rangeCount!==1||D.anchorNode!==C.node||D.anchorOffset!==C.offset||D.focusNode!==E.node||D.focusOffset!==E.offset)){var A=V.createRange();A.setStart(C.node,C.offset),D.removeAllRanges(),xe>qe?(D.addRange(A),D.extend(E.node,E.offset)):(A.setEnd(E.node,E.offset),D.addRange(A))}}}}for(V=[],D=m;D=D.parentNode;)D.nodeType===1&&V.push({element:D,left:D.scrollLeft,top:D.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<V.length;m++){var q=V[m];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}dr=!!So,No=So=null}finally{ze=s,_.p=n,T.T=l}}e.current=t,ft=2}}function uf(){if(ft===2){ft=0;var e=Zl,t=tn,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=T.T,T.T=null;var n=_.p;_.p=2;var s=ze;ze|=4;try{Bd(e,t.alternate,t)}finally{ze=s,_.p=n,T.T=l}}ft=3}}function df(){if(ft===4||ft===3){ft=0,Qt();var e=Zl,t=tn,l=wl,n=Wd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ft=5:(ft=0,tn=Zl=null,ff(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Kl=null),wr(l),t=t.stateNode,Fe&&typeof Fe.onCommitFiberRoot=="function")try{Fe.onCommitFiberRoot(Et,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=T.T,s=_.p,_.p=2,T.T=null;try{for(var i=e.onRecoverableError,d=0;d<n.length;d++){var m=n[d];i(m.value,{componentStack:m.stack})}}finally{T.T=t,_.p=s}}(wl&3)!==0&&Ps(),dl(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===oo?Kn++:(Kn=0,oo=e):Kn=0,Zn(0)}}function ff(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Cn(t)))}function Ps(){return cf(),uf(),df(),xf()}function xf(){if(ft!==5)return!1;var e=Zl,t=ro;ro=0;var l=wr(wl),n=T.T,s=_.p;try{_.p=32>l?32:l,T.T=null,l=io,io=null;var i=Zl,d=wl;if(ft=0,tn=Zl=null,wl=0,(ze&6)!==0)throw Error(u(331));var m=ze;if(ze|=4,Zd(i.current),Qd(i,i.current,d,l),ze=m,Zn(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot=="function")try{Fe.onPostCommitFiberRoot(Et,i)}catch{}return!0}finally{_.p=s,T.T=n,ff(e,t)}}function pf(e,t,l){t=$t(l,t),t=qi(e.stateNode,t,2),e=ql(e,t,2),e!==null&&(xn(e,2),dl(e))}function Oe(e,t,l){if(e.tag===3)pf(e,e,l);else for(;t!==null;){if(t.tag===3){pf(t,e,l);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Kl===null||!Kl.has(n))){e=$t(l,e),l=pd(2),n=ql(t,l,2),n!==null&&(md(l,n,t,e),xn(n,2),dl(n));break}}t=t.return}}function fo(e,t,l){var n=e.pingCache;if(n===null){n=e.pingCache=new vm;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(l)||(ao=!0,s.add(l),e=Sm.bind(null,e,t,l),t.then(e,e))}function Sm(e,t,l){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ye===e&&(Te&l)===l&&(Pe===4||Pe===3&&(Te&62914560)===Te&&300>We()-Zs?(ze&2)===0&&ln(e,0):no|=l,en===Te&&(en=0)),dl(e)}function mf(e,t){t===0&&(t=oc()),e=ua(e,t),e!==null&&(xn(e,t),dl(e))}function Nm(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),mf(e,l)}function Em(e,t){var l=0;switch(e.tag){case 31:case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(l=s.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(u(314))}n!==null&&n.delete(t),mf(e,l)}function km(e,t){return zt(e,t)}var er=null,nn=null,xo=!1,tr=!1,po=!1,Jl=0;function dl(e){e!==nn&&e.next===null&&(nn===null?er=nn=e:nn=nn.next=e),tr=!0,xo||(xo=!0,Cm())}function Zn(e,t){if(!po&&tr){po=!0;do for(var l=!1,n=er;n!==null;){if(e!==0){var s=n.pendingLanes;if(s===0)var i=0;else{var d=n.suspendedLanes,m=n.pingedLanes;i=(1<<31-et(42|e)+1)-1,i&=s&~(d&~m),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,gf(n,i))}else i=Te,i=Ea(n,n===Ye?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||fn(n,i)||(l=!0,gf(n,i));n=n.next}while(l);po=!1}}function Tm(){hf()}function hf(){tr=xo=!1;var e=0;Jl!==0&&Bm()&&(e=Jl);for(var t=We(),l=null,n=er;n!==null;){var s=n.next,i=vf(n,t);i===0?(n.next=null,l===null?er=s:l.next=s,s===null&&(nn=l)):(l=n,(e!==0||(i&3)!==0)&&(tr=!0)),n=s}ft!==0&&ft!==5||Zn(e),Jl!==0&&(Jl=0)}function vf(e,t){for(var l=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var d=31-et(i),m=1<<d,N=s[d];N===-1?((m&l)===0||(m&n)!==0)&&(s[d]=Px(m,t)):N<=t&&(e.expiredLanes|=m),i&=~m}if(t=Ye,l=Te,l=Ea(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,l===0||e===t&&(De===2||De===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&mt(n),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||fn(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(n!==null&&mt(n),wr(l)){case 2:case 8:l=Le;break;case 32:l=at;break;case 268435456:l=Rl;break;default:l=at}return n=yf.bind(null,e),l=zt(l,n),e.callbackPriority=t,e.callbackNode=l,t}return n!==null&&n!==null&&mt(n),e.callbackPriority=2,e.callbackNode=null,2}function yf(e,t){if(ft!==0&&ft!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Ps()&&e.callbackNode!==l)return null;var n=Te;return n=Ea(e,e===Ye?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Id(e,n,t),vf(e,We()),e.callbackNode!=null&&e.callbackNode===l?yf.bind(null,e):null)}function gf(e,t){if(Ps())return null;Id(e,t,!0)}function Cm(){Um(function(){(ze&6)!==0?zt(X,Tm):hf()})}function mo(){if(Jl===0){var e=Va;e===0&&(e=st,st<<=1,(st&261888)===0&&(st=256)),Jl=e}return Jl}function bf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:cs(""+e)}function jf(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function wm(e,t,l,n,s){if(t==="submit"&&l&&l.stateNode===s){var i=bf((s[Tt]||null).action),d=n.submitter;d&&(t=(t=d[Tt]||null)?bf(t.formAction):d.getAttribute("formAction"),t!==null&&(i=t,d=null));var m=new xs("action","action",null,n,s);e.push({event:m,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Jl!==0){var N=d?jf(s,d):new FormData(s);zi(l,{pending:!0,data:N,method:s.method,action:i},null,N)}}else typeof i=="function"&&(m.preventDefault(),N=d?jf(s,d):new FormData(s),zi(l,{pending:!0,data:N,method:s.method,action:i},i,N))},currentTarget:s}]})}}for(var ho=0;ho<Fr.length;ho++){var vo=Fr[ho],Am=vo.toLowerCase(),Rm=vo[0].toUpperCase()+vo.slice(1);nl(Am,"on"+Rm)}nl(Fc,"onAnimationEnd"),nl(Ic,"onAnimationIteration"),nl(Pc,"onAnimationStart"),nl("dblclick","onDoubleClick"),nl("focusin","onFocus"),nl("focusout","onBlur"),nl(Kp,"onTransitionRun"),nl(Zp,"onTransitionStart"),nl($p,"onTransitionCancel"),nl(eu,"onTransitionEnd"),Aa("onMouseEnter",["mouseout","mouseover"]),Aa("onMouseLeave",["mouseout","mouseover"]),Aa("onPointerEnter",["pointerout","pointerover"]),Aa("onPointerLeave",["pointerout","pointerover"]),ra("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ra("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ra("onBeforeInput",["compositionend","keypress","textInput","paste"]),ra("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ra("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ra("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $n="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(" "),_m=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($n));function Sf(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var n=e[l],s=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var d=n.length-1;0<=d;d--){var m=n[d],N=m.instance,R=m.currentTarget;if(m=m.listener,N!==i&&s.isPropagationStopped())break e;i=m,s.currentTarget=R;try{i(s)}catch(H){hs(H)}s.currentTarget=null,i=N}else for(d=0;d<n.length;d++){if(m=n[d],N=m.instance,R=m.currentTarget,m=m.listener,N!==i&&s.isPropagationStopped())break e;i=m,s.currentTarget=R;try{i(s)}catch(H){hs(H)}s.currentTarget=null,i=N}}}}function ke(e,t){var l=t[Ar];l===void 0&&(l=t[Ar]=new Set);var n=e+"__bubble";l.has(n)||(Nf(t,e,2,!1),l.add(n))}function yo(e,t,l){var n=0;t&&(n|=4),Nf(l,e,n,t)}var lr="_reactListening"+Math.random().toString(36).slice(2);function go(e){if(!e[lr]){e[lr]=!0,mc.forEach(function(l){l!=="selectionchange"&&(_m.has(l)||yo(l,!1,e),yo(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lr]||(t[lr]=!0,yo("selectionchange",!1,t))}}function Nf(e,t,l,n){switch(If(t)){case 2:var s=sh;break;case 8:s=rh;break;default:s=zo}l=s.bind(null,t,l,e),s=void 0,!Hr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,l,{capture:!0,passive:s}):e.addEventListener(t,l,!0):s!==void 0?e.addEventListener(t,l,{passive:s}):e.addEventListener(t,l,!1)}function bo(e,t,l,n,s){var i=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var d=n.tag;if(d===3||d===4){var m=n.stateNode.containerInfo;if(m===s)break;if(d===4)for(d=n.return;d!==null;){var N=d.tag;if((N===3||N===4)&&d.stateNode.containerInfo===s)return;d=d.return}for(;m!==null;){if(d=Ta(m),d===null)return;if(N=d.tag,N===5||N===6||N===26||N===27){n=i=d;continue e}m=m.parentNode}}n=n.return}Cc(function(){var R=i,H=Or(l),V=[];e:{var M=tu.get(e);if(M!==void 0){var D=xs,oe=e;switch(e){case"keypress":if(ds(l)===0)break e;case"keydown":case"keyup":D=Ep;break;case"focusin":oe="focus",D=Yr;break;case"focusout":oe="blur",D=Yr;break;case"beforeblur":case"afterblur":D=Yr;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":D=Rc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":D=fp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":D=Cp;break;case Fc:case Ic:case Pc:D=mp;break;case eu:D=Ap;break;case"scroll":case"scrollend":D=up;break;case"wheel":D=_p;break;case"copy":case"cut":case"paste":D=vp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":D=Mc;break;case"toggle":case"beforetoggle":D=Lp}var xe=(t&4)!==0,qe=!xe&&(e==="scroll"||e==="scrollend"),C=xe?M!==null?M+"Capture":null:M;xe=[];for(var E=R,A;E!==null;){var q=E;if(A=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||A===null||C===null||(q=hn(E,C),q!=null&&xe.push(Jn(E,q,A))),qe)break;E=E.return}0<xe.length&&(M=new D(M,oe,null,l,H),V.push({event:M,listeners:xe}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",M&&l!==Dr&&(oe=l.relatedTarget||l.fromElement)&&(Ta(oe)||oe[ka]))break e;if((D||M)&&(M=H.window===H?H:(M=H.ownerDocument)?M.defaultView||M.parentWindow:window,D?(oe=l.relatedTarget||l.toElement,D=R,oe=oe?Ta(oe):null,oe!==null&&(qe=v(oe),xe=oe.tag,oe!==qe||xe!==5&&xe!==27&&xe!==6)&&(oe=null)):(D=null,oe=R),D!==oe)){if(xe=Rc,q="onMouseLeave",C="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(xe=Mc,q="onPointerLeave",C="onPointerEnter",E="pointer"),qe=D==null?M:mn(D),A=oe==null?M:mn(oe),M=new xe(q,E+"leave",D,l,H),M.target=qe,M.relatedTarget=A,q=null,Ta(H)===R&&(xe=new xe(C,E+"enter",oe,l,H),xe.target=A,xe.relatedTarget=qe,q=xe),qe=q,D&&oe)t:{for(xe=Mm,C=D,E=oe,A=0,q=C;q;q=xe(q))A++;q=0;for(var de=E;de;de=xe(de))q++;for(;0<A-q;)C=xe(C),A--;for(;0<q-A;)E=xe(E),q--;for(;A--;){if(C===E||E!==null&&C===E.alternate){xe=C;break t}C=xe(C),E=xe(E)}xe=null}else xe=null;D!==null&&Ef(V,M,D,xe,!1),oe!==null&&qe!==null&&Ef(V,qe,oe,xe,!0)}}e:{if(M=R?mn(R):window,D=M.nodeName&&M.nodeName.toLowerCase(),D==="select"||D==="input"&&M.type==="file")var Re=qc;else if(Hc(M))if(Gc)Re=Vp;else{Re=Gp;var ce=qp}else D=M.nodeName,!D||D.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?R&&zr(R.elementType)&&(Re=qc):Re=Yp;if(Re&&(Re=Re(e,R))){Uc(V,Re,l,H);break e}ce&&ce(e,M,R),e==="focusout"&&R&&M.type==="number"&&R.memoizedProps.value!=null&&Lr(M,"number",M.value)}switch(ce=R?mn(R):window,e){case"focusin":(Hc(ce)||ce.contentEditable==="true")&&(Da=ce,$r=R,En=null);break;case"focusout":En=$r=Da=null;break;case"mousedown":Jr=!0;break;case"contextmenu":case"mouseup":case"dragend":Jr=!1,Jc(V,l,H);break;case"selectionchange":if(Xp)break;case"keydown":case"keyup":Jc(V,l,H)}var Ne;if(Qr)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else za?Oc(e,l)&&(Ce="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ce="onCompositionStart");Ce&&(Lc&&l.locale!=="ko"&&(za||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&za&&(Ne=wc()):(Ll=H,Ur="value"in Ll?Ll.value:Ll.textContent,za=!0)),ce=ar(R,Ce),0<ce.length&&(Ce=new _c(Ce,e,null,l,H),V.push({event:Ce,listeners:ce}),Ne?Ce.data=Ne:(Ne=Bc(l),Ne!==null&&(Ce.data=Ne)))),(Ne=Dp?Op(e,l):Bp(e,l))&&(Ce=ar(R,"onBeforeInput"),0<Ce.length&&(ce=new _c("onBeforeInput","beforeinput",null,l,H),V.push({event:ce,listeners:Ce}),ce.data=Ne)),wm(V,e,R,l,H)}Sf(V,t)})}function Jn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function ar(e,t){for(var l=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||i===null||(s=hn(e,l),s!=null&&n.unshift(Jn(e,s,i)),s=hn(e,t),s!=null&&n.push(Jn(e,s,i))),e.tag===3)return n;e=e.return}return[]}function Mm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ef(e,t,l,n,s){for(var i=t._reactName,d=[];l!==null&&l!==n;){var m=l,N=m.alternate,R=m.stateNode;if(m=m.tag,N!==null&&N===n)break;m!==5&&m!==26&&m!==27||R===null||(N=R,s?(R=hn(l,i),R!=null&&d.unshift(Jn(l,R,N))):s||(R=hn(l,i),R!=null&&d.push(Jn(l,R,N)))),l=l.return}d.length!==0&&e.push({event:t,listeners:d})}var Lm=/\r\n?/g,zm=/\u0000|\uFFFD/g;function kf(e){return(typeof e=="string"?e:""+e).replace(Lm,`
49
+ `).replace(zm,"")}function Tf(e,t){return t=kf(t),kf(e)===t}function Ue(e,t,l,n,s,i){switch(l){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||_a(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&_a(e,""+n);break;case"className":is(e,"class",n);break;case"tabIndex":is(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":is(e,l,n);break;case"style":kc(e,n,i);break;case"data":if(t!=="object"){is(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=cs(""+n),e.setAttribute(l,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(l,"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 i=="function"&&(l==="formAction"?(t!=="input"&&Ue(e,t,"name",s.name,s,null),Ue(e,t,"formEncType",s.formEncType,s,null),Ue(e,t,"formMethod",s.formMethod,s,null),Ue(e,t,"formTarget",s.formTarget,s,null)):(Ue(e,t,"encType",s.encType,s,null),Ue(e,t,"method",s.method,s,null),Ue(e,t,"target",s.target,s,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=cs(""+n),e.setAttribute(l,n);break;case"onClick":n!=null&&(e.onclick=xl);break;case"onScroll":n!=null&&ke("scroll",e);break;case"onScrollEnd":n!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(l=n.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}l=cs(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""+n):e.removeAttribute(l);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":n===!0?e.setAttribute(l,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,n):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(l,n):e.removeAttribute(l);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(l):e.setAttribute(l,n);break;case"popover":ke("beforetoggle",e),ke("toggle",e),rs(e,"popover",n);break;case"xlinkActuate":fl(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":fl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":fl(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":fl(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":fl(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":fl(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":fl(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":fl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":fl(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":rs(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=op.get(l)||l,rs(e,l,n))}}function jo(e,t,l,n,s,i){switch(l){case"style":kc(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(l=n.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"children":typeof n=="string"?_a(e,n):(typeof n=="number"||typeof n=="bigint")&&_a(e,""+n);break;case"onScroll":n!=null&&ke("scroll",e);break;case"onScrollEnd":n!=null&&ke("scrollend",e);break;case"onClick":n!=null&&(e.onclick=xl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hc.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),t=l.slice(2,s?l.length-7:void 0),i=e[Tt]||null,i=i!=null?i[l]:null,typeof i=="function"&&e.removeEventListener(t,i,s),typeof n=="function")){typeof i!="function"&&i!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,n,s);break e}l in e?e[l]=n:n===!0?e.setAttribute(l,""):rs(e,l,n)}}}function bt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var n=!1,s=!1,i;for(i in l)if(l.hasOwnProperty(i)){var d=l[i];if(d!=null)switch(i){case"src":n=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ue(e,t,i,d,l,null)}}s&&Ue(e,t,"srcSet",l.srcSet,l,null),n&&Ue(e,t,"src",l.src,l,null);return;case"input":ke("invalid",e);var m=i=d=s=null,N=null,R=null;for(n in l)if(l.hasOwnProperty(n)){var H=l[n];if(H!=null)switch(n){case"name":s=H;break;case"type":d=H;break;case"checked":N=H;break;case"defaultChecked":R=H;break;case"value":i=H;break;case"defaultValue":m=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(u(137,t));break;default:Ue(e,t,n,H,l,null)}}jc(e,i,m,N,R,d,s,!1);return;case"select":ke("invalid",e),n=d=i=null;for(s in l)if(l.hasOwnProperty(s)&&(m=l[s],m!=null))switch(s){case"value":i=m;break;case"defaultValue":d=m;break;case"multiple":n=m;default:Ue(e,t,s,m,l,null)}t=i,l=d,e.multiple=!!n,t!=null?Ra(e,!!n,t,!1):l!=null&&Ra(e,!!n,l,!0);return;case"textarea":ke("invalid",e),i=s=n=null;for(d in l)if(l.hasOwnProperty(d)&&(m=l[d],m!=null))switch(d){case"value":n=m;break;case"defaultValue":s=m;break;case"children":i=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(u(91));break;default:Ue(e,t,d,m,l,null)}Nc(e,n,s,i);return;case"option":for(N in l)if(l.hasOwnProperty(N)&&(n=l[N],n!=null))switch(N){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ue(e,t,N,n,l,null)}return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(n=0;n<$n.length;n++)ke($n[n],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("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(R in l)if(l.hasOwnProperty(R)&&(n=l[R],n!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ue(e,t,R,n,l,null)}return;default:if(zr(t)){for(H in l)l.hasOwnProperty(H)&&(n=l[H],n!==void 0&&jo(e,t,H,n,l,void 0));return}}for(m in l)l.hasOwnProperty(m)&&(n=l[m],n!=null&&Ue(e,t,m,n,l,null))}function Dm(e,t,l,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,i=null,d=null,m=null,N=null,R=null,H=null;for(D in l){var V=l[D];if(l.hasOwnProperty(D)&&V!=null)switch(D){case"checked":break;case"value":break;case"defaultValue":N=V;default:n.hasOwnProperty(D)||Ue(e,t,D,null,n,V)}}for(var M in n){var D=n[M];if(V=l[M],n.hasOwnProperty(M)&&(D!=null||V!=null))switch(M){case"type":i=D;break;case"name":s=D;break;case"checked":R=D;break;case"defaultChecked":H=D;break;case"value":d=D;break;case"defaultValue":m=D;break;case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(137,t));break;default:D!==V&&Ue(e,t,M,D,n,V)}}Mr(e,d,m,N,R,H,i,s);return;case"select":D=d=m=M=null;for(i in l)if(N=l[i],l.hasOwnProperty(i)&&N!=null)switch(i){case"value":break;case"multiple":D=N;default:n.hasOwnProperty(i)||Ue(e,t,i,null,n,N)}for(s in n)if(i=n[s],N=l[s],n.hasOwnProperty(s)&&(i!=null||N!=null))switch(s){case"value":M=i;break;case"defaultValue":m=i;break;case"multiple":d=i;default:i!==N&&Ue(e,t,s,i,n,N)}t=m,l=d,n=D,M!=null?Ra(e,!!l,M,!1):!!n!=!!l&&(t!=null?Ra(e,!!l,t,!0):Ra(e,!!l,l?[]:"",!1));return;case"textarea":D=M=null;for(m in l)if(s=l[m],l.hasOwnProperty(m)&&s!=null&&!n.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Ue(e,t,m,null,n,s)}for(d in n)if(s=n[d],i=l[d],n.hasOwnProperty(d)&&(s!=null||i!=null))switch(d){case"value":M=s;break;case"defaultValue":D=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==i&&Ue(e,t,d,s,n,i)}Sc(e,M,D);return;case"option":for(var oe in l)if(M=l[oe],l.hasOwnProperty(oe)&&M!=null&&!n.hasOwnProperty(oe))switch(oe){case"selected":e.selected=!1;break;default:Ue(e,t,oe,null,n,M)}for(N in n)if(M=n[N],D=l[N],n.hasOwnProperty(N)&&M!==D&&(M!=null||D!=null))switch(N){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:Ue(e,t,N,M,n,D)}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 xe in l)M=l[xe],l.hasOwnProperty(xe)&&M!=null&&!n.hasOwnProperty(xe)&&Ue(e,t,xe,null,n,M);for(R in n)if(M=n[R],D=l[R],n.hasOwnProperty(R)&&M!==D&&(M!=null||D!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(u(137,t));break;default:Ue(e,t,R,M,n,D)}return;default:if(zr(t)){for(var qe in l)M=l[qe],l.hasOwnProperty(qe)&&M!==void 0&&!n.hasOwnProperty(qe)&&jo(e,t,qe,void 0,n,M);for(H in n)M=n[H],D=l[H],!n.hasOwnProperty(H)||M===D||M===void 0&&D===void 0||jo(e,t,H,M,n,D);return}}for(var C in l)M=l[C],l.hasOwnProperty(C)&&M!=null&&!n.hasOwnProperty(C)&&Ue(e,t,C,null,n,M);for(V in n)M=n[V],D=l[V],!n.hasOwnProperty(V)||M===D||M==null&&D==null||Ue(e,t,V,M,n,D)}function Cf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Om(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),n=0;n<l.length;n++){var s=l[n],i=s.transferSize,d=s.initiatorType,m=s.duration;if(i&&m&&Cf(d)){for(d=0,m=s.responseEnd,n+=1;n<l.length;n++){var N=l[n],R=N.startTime;if(R>m)break;var H=N.transferSize,V=N.initiatorType;H&&Cf(V)&&(N=N.responseEnd,d+=H*(N<m?1:(m-R)/(N-R)))}if(--n,t+=8*(i+d)/(s.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 So=null,No=null;function nr(e){return e.nodeType===9?e:e.ownerDocument}function wf(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 Af(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 Eo(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 ko=null;function Bm(){var e=window.event;return e&&e.type==="popstate"?e===ko?!1:(ko=e,!0):(ko=null,!1)}var Rf=typeof setTimeout=="function"?setTimeout:void 0,Hm=typeof clearTimeout=="function"?clearTimeout:void 0,_f=typeof Promise=="function"?Promise:void 0,Um=typeof queueMicrotask=="function"?queueMicrotask:typeof _f<"u"?function(e){return _f.resolve(null).then(e).catch(qm)}:Rf;function qm(e){setTimeout(function(){throw e})}function Wl(e){return e==="head"}function Mf(e,t){var l=t,n=0;do{var s=l.nextSibling;if(e.removeChild(l),s&&s.nodeType===8)if(l=s.data,l==="/$"||l==="/&"){if(n===0){e.removeChild(s),cn(t);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")Wn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Wn(l);for(var i=l.firstChild;i;){var d=i.nextSibling,m=i.nodeName;i[pn]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&i.rel.toLowerCase()==="stylesheet"||l.removeChild(i),i=d}}else l==="body"&&Wn(e.ownerDocument.body);l=s}while(l);cn(t)}function Lf(e,t){var l=e;e=0;do{var n=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),n&&n.nodeType===8)if(l=n.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=n}while(l)}function To(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":To(l),Rr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Gm(e,t,l,n){for(;e.nodeType===1;){var s=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[pn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Pt(e.nextSibling),e===null)break}return null}function Ym(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Pt(e.nextSibling),e===null))return null;return e}function zf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Pt(e.nextSibling),e===null))return null;return e}function Co(e){return e.data==="$?"||e.data==="$~"}function wo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Vm(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var n=function(){t(),l.removeEventListener("DOMContentLoaded",n)};l.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Pt(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 Ao=null;function Df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Pt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Of(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Bf(e,t,l){switch(t=nr(l),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Wn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rr(e)}var el=new Map,Hf=new Set;function sr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Al=_.d;_.d={f:Qm,r:Xm,D:Km,C:Zm,L:$m,m:Jm,X:Fm,S:Wm,M:Im};function Qm(){var e=Al.f(),t=Ws();return e||t}function Xm(e){var t=Ca(e);t!==null&&t.tag===5&&t.type==="form"?ed(t):Al.r(e)}var sn=typeof document>"u"?null:document;function Uf(e,t,l){var n=sn;if(n&&typeof t=="string"&&t){var s=Kt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Hf.has(s)||(Hf.add(s),e={rel:e,crossOrigin:l,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),bt(t,"link",e),xt(t),n.head.appendChild(t)))}}function Km(e){Al.D(e),Uf("dns-prefetch",e,null)}function Zm(e,t){Al.C(e,t),Uf("preconnect",e,t)}function $m(e,t,l){Al.L(e,t,l);var n=sn;if(n&&e&&t){var s='link[rel="preload"][as="'+Kt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Kt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Kt(l.imageSizes)+'"]')):s+='[href="'+Kt(e)+'"]';var i=s;switch(t){case"style":i=rn(e);break;case"script":i=on(e)}el.has(i)||(e=g({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),el.set(i,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(Fn(i))||t==="script"&&n.querySelector(In(i))||(t=n.createElement("link"),bt(t,"link",e),xt(t),n.head.appendChild(t)))}}function Jm(e,t){Al.m(e,t);var l=sn;if(l&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Kt(n)+'"][href="'+Kt(e)+'"]',i=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=on(e)}if(!el.has(i)&&(e=g({rel:"modulepreload",href:e},t),el.set(i,e),l.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(In(i)))return}n=l.createElement("link"),bt(n,"link",e),xt(n),l.head.appendChild(n)}}}function Wm(e,t,l){Al.S(e,t,l);var n=sn;if(n&&e){var s=wa(n).hoistableStyles,i=rn(e);t=t||"default";var d=s.get(i);if(!d){var m={loading:0,preload:null};if(d=n.querySelector(Fn(i)))m.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},l),(l=el.get(i))&&Ro(e,l);var N=d=n.createElement("link");xt(N),bt(N,"link",e),N._p=new Promise(function(R,H){N.onload=R,N.onerror=H}),N.addEventListener("load",function(){m.loading|=1}),N.addEventListener("error",function(){m.loading|=2}),m.loading|=4,rr(d,t,n)}d={type:"stylesheet",instance:d,count:1,state:m},s.set(i,d)}}}function Fm(e,t){Al.X(e,t);var l=sn;if(l&&e){var n=wa(l).hoistableScripts,s=on(e),i=n.get(s);i||(i=l.querySelector(In(s)),i||(e=g({src:e,async:!0},t),(t=el.get(s))&&_o(e,t),i=l.createElement("script"),xt(i),bt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function Im(e,t){Al.M(e,t);var l=sn;if(l&&e){var n=wa(l).hoistableScripts,s=on(e),i=n.get(s);i||(i=l.querySelector(In(s)),i||(e=g({src:e,async:!0,type:"module"},t),(t=el.get(s))&&_o(e,t),i=l.createElement("script"),xt(i),bt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function qf(e,t,l,n){var s=(s=ae.current)?sr(s):null;if(!s)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=rn(l.href),l=wa(s).hoistableStyles,n=l.get(t),n||(n={type:"style",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=rn(l.href);var i=wa(s).hoistableStyles,d=i.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,d),(i=s.querySelector(Fn(e)))&&!i._p&&(d.instance=i,d.state.loading=5),el.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},el.set(e,l),i||Pm(s,e,l,d.state))),t&&n===null)throw Error(u(528,""));return d}if(t&&n!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=on(l),l=wa(s).hoistableScripts,n=l.get(t),n||(n={type:"script",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function rn(e){return'href="'+Kt(e)+'"'}function Fn(e){return'link[rel="stylesheet"]['+e+"]"}function Gf(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Pm(e,t,l,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),bt(t,"link",l),xt(t),e.head.appendChild(t))}function on(e){return'[src="'+Kt(e)+'"]'}function In(e){return"script[async]"+e}function Yf(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Kt(l.href)+'"]');if(n)return t.instance=n,xt(n),n;var s=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),xt(n),bt(n,"style",s),rr(n,l.precedence,e),t.instance=n;case"stylesheet":s=rn(l.href);var i=e.querySelector(Fn(s));if(i)return t.state.loading|=4,t.instance=i,xt(i),i;n=Gf(l),(s=el.get(s))&&Ro(n,s),i=(e.ownerDocument||e).createElement("link"),xt(i);var d=i;return d._p=new Promise(function(m,N){d.onload=m,d.onerror=N}),bt(i,"link",n),t.state.loading|=4,rr(i,l.precedence,e),t.instance=i;case"script":return i=on(l.src),(s=e.querySelector(In(i)))?(t.instance=s,xt(s),s):(n=l,(s=el.get(i))&&(n=g({},l),_o(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),xt(s),bt(s,"link",n),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,rr(n,l.precedence,e));return t.instance}function rr(e,t,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,i=s,d=0;d<n.length;d++){var m=n[d];if(m.dataset.precedence===t)i=m;else if(i!==s)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Ro(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _o(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ir=null;function Vf(e,t,l){if(ir===null){var n=new Map,s=ir=new Map;s.set(l,n)}else s=ir,n=s.get(l),n||(n=new Map,s.set(l,n));if(n.has(e))return n;for(n.set(e,null),l=l.getElementsByTagName(e),s=0;s<l.length;s++){var i=l[s];if(!(i[pn]||i[ht]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var d=i.getAttribute(t)||"";d=e+d;var m=n.get(d);m?m.push(i):n.set(d,[i])}}return n}function Qf(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function eh(e,t,l){if(l===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 Xf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function th(e,t,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var s=rn(n.href),i=t.querySelector(Fn(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=or.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,xt(i);return}i=t.ownerDocument||t,n=Gf(n),(s=el.get(s))&&Ro(n,s),i=i.createElement("link"),xt(i);var d=i;d._p=new Promise(function(m,N){d.onload=m,d.onerror=N}),bt(i,"link",n),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=or.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Mo=0;function lh(e,t){return e.stylesheets&&e.count===0&&ur(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var n=setTimeout(function(){if(e.stylesheets&&ur(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Mo===0&&(Mo=62500*Om());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ur(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Mo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function or(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ur(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var cr=null;function ur(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cr=new Map,t.forEach(ah,e),cr=null,or.call(e))}function ah(e,t){if(!(t.state.loading&4)){var l=cr.get(e);if(l)var n=l.get(null);else{l=new Map,cr.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<s.length;i++){var d=s[i];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(l.set(d.dataset.precedence,d),n=d)}n&&l.set(null,n)}s=t.instance,d=s.getAttribute("data-precedence"),i=l.get(d)||n,i===n&&l.set(null,s),l.set(d,s),this.count++,n=or.bind(this),s.addEventListener("load",n),s.addEventListener("error",n),i?i.parentNode.insertBefore(s,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Pn={$$typeof:le,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function nh(e,t,l,n,s,i,d,m,N){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=Tr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tr(0),this.hiddenUpdates=Tr(null),this.identifierPrefix=n,this.onUncaughtError=s,this.onCaughtError=i,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function Kf(e,t,l,n,s,i,d,m,N,R,H,V){return e=new nh(e,t,l,d,N,R,H,V,m),t=1,i===!0&&(t|=24),i=Ht(3,null,null,t),e.current=i,i.stateNode=e,t=ui(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:l,cache:t},pi(i),e}function Zf(e){return e?(e=Ha,e):Ha}function $f(e,t,l,n,s,i){s=Zf(s),n.context===null?n.context=s:n.pendingContext=s,n=Ul(t),n.payload={element:l},i=i===void 0?null:i,i!==null&&(n.callback=i),l=ql(e,n,t),l!==null&&(Mt(l,e,t),_n(l,e,t))}function Jf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Lo(e,t){Jf(e,t),(e=e.alternate)&&Jf(e,t)}function Wf(e){if(e.tag===13||e.tag===31){var t=ua(e,67108864);t!==null&&Mt(t,e,67108864),Lo(e,67108864)}}function Ff(e){if(e.tag===13||e.tag===31){var t=Vt();t=Cr(t);var l=ua(e,t);l!==null&&Mt(l,e,t),Lo(e,t)}}var dr=!0;function sh(e,t,l,n){var s=T.T;T.T=null;var i=_.p;try{_.p=2,zo(e,t,l,n)}finally{_.p=i,T.T=s}}function rh(e,t,l,n){var s=T.T;T.T=null;var i=_.p;try{_.p=8,zo(e,t,l,n)}finally{_.p=i,T.T=s}}function zo(e,t,l,n){if(dr){var s=Do(n);if(s===null)bo(e,t,n,fr,l),Pf(e,n);else if(oh(s,e,t,l,n))n.stopPropagation();else if(Pf(e,n),t&4&&-1<ih.indexOf(e)){for(;s!==null;){var i=Ca(s);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var d=kt(i.pendingLanes);if(d!==0){var m=i;for(m.pendingLanes|=2,m.entangledLanes|=2;d;){var N=1<<31-et(d);m.entanglements[1]|=N,d&=~N}dl(i),(ze&6)===0&&($s=We()+500,Zn(0))}}break;case 31:case 13:m=ua(i,2),m!==null&&Mt(m,i,2),Ws(),Lo(i,2)}if(i=Do(n),i===null&&bo(e,t,n,fr,l),i===s)break;s=i}s!==null&&n.stopPropagation()}else bo(e,t,n,null,l)}}function Do(e){return e=Or(e),Oo(e)}var fr=null;function Oo(e){if(fr=null,e=Ta(e),e!==null){var t=v(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=p(t),e!==null)return e;e=null}else if(l===31){if(e=b(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fr=e,null}function If(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(Dt()){case X:return 2;case Le:return 8;case at:case Je:return 32;case Rl:return 268435456;default:return 32}default:return 32}}var Bo=!1,Fl=null,Il=null,Pl=null,es=new Map,ts=new Map,ea=[],ih="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 Pf(e,t){switch(e){case"focusin":case"focusout":Fl=null;break;case"dragenter":case"dragleave":Il=null;break;case"mouseover":case"mouseout":Pl=null;break;case"pointerover":case"pointerout":es.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ts.delete(t.pointerId)}}function ls(e,t,l,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:l,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Ca(t),t!==null&&Wf(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function oh(e,t,l,n,s){switch(t){case"focusin":return Fl=ls(Fl,e,t,l,n,s),!0;case"dragenter":return Il=ls(Il,e,t,l,n,s),!0;case"mouseover":return Pl=ls(Pl,e,t,l,n,s),!0;case"pointerover":var i=s.pointerId;return es.set(i,ls(es.get(i)||null,e,t,l,n,s)),!0;case"gotpointercapture":return i=s.pointerId,ts.set(i,ls(ts.get(i)||null,e,t,l,n,s)),!0}return!1}function ex(e){var t=Ta(e.target);if(t!==null){var l=v(t);if(l!==null){if(t=l.tag,t===13){if(t=p(l),t!==null){e.blockedOn=t,xc(e.priority,function(){Ff(l)});return}}else if(t===31){if(t=b(l),t!==null){e.blockedOn=t,xc(e.priority,function(){Ff(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function xr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Do(e.nativeEvent);if(l===null){l=e.nativeEvent;var n=new l.constructor(l.type,l);Dr=n,l.target.dispatchEvent(n),Dr=null}else return t=Ca(l),t!==null&&Wf(t),e.blockedOn=l,!1;t.shift()}return!0}function tx(e,t,l){xr(e)&&l.delete(t)}function ch(){Bo=!1,Fl!==null&&xr(Fl)&&(Fl=null),Il!==null&&xr(Il)&&(Il=null),Pl!==null&&xr(Pl)&&(Pl=null),es.forEach(tx),ts.forEach(tx)}function pr(e,t){e.blockedOn===t&&(e.blockedOn=null,Bo||(Bo=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,ch)))}var mr=null;function lx(e){mr!==e&&(mr=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){mr===e&&(mr=null);for(var t=0;t<e.length;t+=3){var l=e[t],n=e[t+1],s=e[t+2];if(typeof n!="function"){if(Oo(n||l)===null)continue;break}var i=Ca(l);i!==null&&(e.splice(t,3),t-=3,zi(i,{pending:!0,data:s,method:l.method,action:n},n,s))}}))}function cn(e){function t(N){return pr(N,e)}Fl!==null&&pr(Fl,e),Il!==null&&pr(Il,e),Pl!==null&&pr(Pl,e),es.forEach(t),ts.forEach(t);for(var l=0;l<ea.length;l++){var n=ea[l];n.blockedOn===e&&(n.blockedOn=null)}for(;0<ea.length&&(l=ea[0],l.blockedOn===null);)ex(l),l.blockedOn===null&&ea.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(n=0;n<l.length;n+=3){var s=l[n],i=l[n+1],d=s[Tt]||null;if(typeof i=="function")d||lx(l);else if(d){var m=null;if(i&&i.hasAttribute("formAction")){if(s=i,d=i[Tt]||null)m=d.formAction;else if(Oo(s)!==null)continue}else m=d.action;typeof m=="function"?l[n+1]=m:(l.splice(n,3),n-=3),lx(l)}}}function ax(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(d){return s=d})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),n||setTimeout(l,20)}function l(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Ho(e){this._internalRoot=e}hr.prototype.render=Ho.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,n=Vt();$f(l,n,e,t,null,null)},hr.prototype.unmount=Ho.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$f(e.current,2,null,e,null,null),Ws(),t[ka]=null}};function hr(e){this._internalRoot=e}hr.prototype.unstable_scheduleHydration=function(e){if(e){var t=fc();e={blockedOn:null,target:e,priority:t};for(var l=0;l<ea.length&&t!==0&&t<ea[l].priority;l++);ea.splice(l,0,e),l===0&&ex(e)}};var nx=c.version;if(nx!=="19.2.4")throw Error(u(527,nx,"19.2.4"));_.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=f(t),e=e!==null?j(e):null,e=e===null?null:e.stateNode,e};var uh={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vr.isDisabled&&vr.supportsFiber)try{Et=vr.inject(uh),Fe=vr}catch{}}return ns.createRoot=function(e,t){if(!x(e))throw Error(u(299));var l=!1,n="",s=ud,i=dd,d=fd;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Kf(e,1,!1,null,null,l,n,null,s,i,d,ax),e[ka]=t.current,go(e),new Ho(t)},ns.hydrateRoot=function(e,t,l){if(!x(e))throw Error(u(299));var n=!1,s="",i=ud,d=dd,m=fd,N=null;return l!=null&&(l.unstable_strictMode===!0&&(n=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(i=l.onUncaughtError),l.onCaughtError!==void 0&&(d=l.onCaughtError),l.onRecoverableError!==void 0&&(m=l.onRecoverableError),l.formState!==void 0&&(N=l.formState)),t=Kf(e,1,!0,t,l??null,n,s,N,i,d,m,ax),t.context=Zf(null),l=t.current,n=Vt(),n=Cr(n),s=Ul(n),s.callback=null,ql(l,s,n),l=n,t.current.lanes=l,xn(t,l),dl(t),e[ka]=t.current,go(e),new hr(t)},ns.version="19.2.4",ns}var px;function bh(){if(px)return Go.exports;px=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(c){console.error(c)}}return r(),Go.exports=gh(),Go.exports}var jh=bh();const tc="";class Ox extends Error{constructor(c,o){super(c),this.name="ApiError",this.status=o}}async function Me(r,c){const o=await fetch(`${tc}${r}`,c);if(!o.ok){const u=await o.json().catch(()=>({error:o.statusText}));throw new Ox(u.error||`HTTP ${o.status}`,o.status)}return o.json()}const Se={getConfig(){return Me("/api/config")},setConfig(r,c){return Me("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,model:c})})},getSkills(){return Me("/api/skills")},getSkillDetail(r,c){return Me(`/api/skills/${r}/${c}`)},getEvals(r,c){return Me(`/api/skills/${r}/${c}/evals`)},saveEvals(r,c,o){return Me(`/api/skills/${r}/${c}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},generateEvals(r,c){return Me(`/api/skills/${r}/${c}/generate-evals`,{method:"POST"})},async getLatestBenchmark(r,c){const o=await fetch(`${tc}/api/skills/${r}/${c}/benchmark/latest`);if(o.status===404)return null;if(!o.ok){const u=await o.json().catch(()=>({error:o.statusText}));throw new Ox(u.error||`HTTP ${o.status}`,o.status)}return o.json()},getHistory(r,c,o){const u=new URLSearchParams;o!=null&&o.model&&u.set("model",o.model),o!=null&&o.type&&u.set("type",o.type),o!=null&&o.from&&u.set("from",o.from),o!=null&&o.to&&u.set("to",o.to);const x=u.toString();return Me(`/api/skills/${r}/${c}/history${x?"?"+x:""}`)},getHistoryEntry(r,c,o){return Me(`/api/skills/${r}/${c}/history/${encodeURIComponent(o)}`)},compareRuns(r,c,o,u){return Me(`/api/skills/${r}/${c}/history-compare?a=${encodeURIComponent(o)}&b=${encodeURIComponent(u)}`)},getCaseHistory(r,c,o,u){const x=new URLSearchParams;u&&x.set("model",u);const v=x.toString();return Me(`/api/skills/${r}/${c}/history/case/${o}${v?"?"+v:""}`)},deleteHistoryEntry(r,c,o){return Me(`/api/skills/${r}/${c}/history/${encodeURIComponent(o)}`,{method:"DELETE"})},deleteSkill(r,c){return Me(`/api/skills/${r}/${c}`,{method:"DELETE"})},improveSkill(r,c,o){return Me(`/api/skills/${r}/${c}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},instructEdit(r,c,o){return Me(`/api/skills/${r}/${c}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...o})})},applyImprovement(r,c,o){return Me(`/api/skills/${r}/${c}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:o})})},getStats(r,c){return Me(`/api/skills/${r}/${c}/stats`)},getDependencies(r,c){return Me(`/api/skills/${r}/${c}/dependencies`)},getProjectLayout(){return Me("/api/project-layout")},createSkill(r){return Me("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})},saveDraft(r){return Me("/api/skills/save-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})},getSkillCreatorStatus(){return Me("/api/skill-creator-status")},generateSkill(r){return Me("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})},getSkillFiles(r,c){return Me(`/api/skills/${r}/${c}/files`)},getSkillFile(r,c,o){return Me(`/api/skills/${r}/${c}/file?path=${encodeURIComponent(o)}`)},saveSkillFile(r,c,o,u){return Me(`/api/skills/${r}/${c}/file`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:o,content:u})})},getLeaderboard(r,c){return Me(`/api/skills/${r}/${c}/leaderboard`)},getLeaderboardEntry(r,c,o){return Me(`/api/skills/${r}/${c}/leaderboard/${encodeURIComponent(o)}`)},startSweep(r,c,o){const u=`${tc}/api/skills/${r}/${c}/sweep`,x=new EventSource(u);return fetch(u,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(o)}),x},getCredentials(r,c){return Me(`/api/credentials/${r}/${c}`)},setCredential(r,c,o,u){return Me(`/api/credentials/${r}/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:o,value:u})})},getParams(r,c){return Me(`/api/credentials/${r}/${c}/params`)},searchModels(){return Me("/api/openrouter/models")}};function Sh(r){const[c,o]=h.useState(()=>typeof window>"u"?!1:window.matchMedia(r).matches);return h.useEffect(()=>{const u=window.matchMedia(r);o(u.matches);const x=v=>o(v.matches);return u.addEventListener("change",x),()=>u.removeEventListener("change",x)},[r]),c}const Nh={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function Eh(r,c){switch(c.type){case"SELECT_SKILL":return{...r,selectedSkill:c.skill,mode:"browse",mobileView:r.isMobile?"detail":r.mobileView};case"CLEAR_SELECTION":return{...r,selectedSkill:null};case"SET_MODE":return{...r,mode:c.mode,selectedSkill:c.mode==="create"?null:r.selectedSkill};case"SET_SEARCH":return{...r,searchQuery:c.query};case"SET_SKILLS":return{...r,skills:c.skills,skillsLoading:!1,skillsError:null};case"SET_SKILLS_ERROR":return{...r,skillsError:c.error,skillsLoading:!1};case"SET_SKILLS_LOADING":return{...r,skillsLoading:c.loading};case"SET_MOBILE":return{...r,isMobile:c.isMobile};case"SET_MOBILE_VIEW":return{...r,mobileView:c.view};default:return r}}const Bx=h.createContext(null);function na(){const r=h.useContext(Bx);if(!r)throw new Error("useStudio must be used within StudioProvider");return r}function kh({children:r}){const[c,o]=h.useReducer(Eh,Nh),u=Sh("(max-width: 767px)");h.useEffect(()=>{o({type:"SET_MOBILE",isMobile:u})},[u]);const x=h.useCallback(()=>{o({type:"SET_SKILLS_LOADING",loading:!0}),Se.getSkills().then(g=>{o({type:"SET_SKILLS",skills:g});const w=window.location.hash.match(/^#\/skills\/([^/]+)\/([^/?]+)/);if(w){const[,L,B]=w,Y=g.find(G=>G.plugin===L&&G.skill===B);Y&&o({type:"SELECT_SKILL",skill:{plugin:L,skill:B,origin:Y.origin}})}}).catch(g=>o({type:"SET_SKILLS_ERROR",error:g.message}))},[]);h.useEffect(()=>{x()},[x]);const v=h.useCallback(g=>{o({type:"SELECT_SKILL",skill:g}),window.location.hash=`/skills/${g.plugin}/${g.skill}`},[]),p=h.useCallback(()=>{o({type:"CLEAR_SELECTION"}),window.location.hash.startsWith("#/skills/")&&history.replaceState(null,"",window.location.pathname+window.location.search)},[]),b=h.useCallback(g=>{o({type:"SET_MODE",mode:g})},[]),y=h.useCallback(g=>{o({type:"SET_SEARCH",query:g})},[]),f=h.useCallback(g=>{o({type:"SET_MOBILE_VIEW",view:g})},[]),j=h.useMemo(()=>({state:c,selectSkill:v,clearSelection:p,setMode:b,setSearch:y,setMobileView:f,refreshSkills:x}),[c,v,p,b,y,f,x]);return a.jsx(Bx.Provider,{value:j,children:r})}const Th={config:null,loading:!0};function Ch(r,c){switch(c.type){case"SET_CONFIG":return{config:c.config,loading:!1};case"SET_LOADING":return{...r,loading:!0};default:return r}}const Hx=h.createContext(null);function Na(){const r=h.useContext(Hx);if(!r)throw new Error("useConfig must be used within ConfigProvider");return r}function wh({children:r}){const[c,o]=h.useReducer(Ch,Th),u=h.useCallback(()=>{Se.getConfig().then(p=>o({type:"SET_CONFIG",config:p})).catch(()=>{})},[]);h.useEffect(()=>{u()},[u]);const x=h.useCallback(async(p,b)=>{const y=await Se.setConfig(p,b);return o({type:"SET_CONFIG",config:y}),y},[]),v=h.useMemo(()=>({config:c.config,loading:c.loading,updateConfig:x,refreshConfig:u}),[c,x,u]);return a.jsx(Hx.Provider,{value:v,children:r})}function Ah({left:r,right:c}){const{state:o}=na();return o.isMobile?a.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:o.mobileView==="list"?a.jsx("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-1)"},children:r}):a.jsx("div",{style:{height:"100%",overflowY:"auto"},children:c})}):a.jsxs("div",{className:"studio-grid",style:{display:"grid",gridTemplateColumns:"280px 1px 1fr",height:"100vh",overflow:"hidden"},children:[a.jsx("div",{style:{overflowY:"auto",background:"var(--surface-1)"},children:r}),a.jsx("div",{style:{background:"var(--border-subtle)"}}),a.jsx("div",{style:{overflowY:"auto",background:"var(--surface-0)"},children:c})]})}function Rh(){const{state:r,setSearch:c}=na(),[o,u]=h.useState(r.searchQuery),x=h.useRef(null);h.useEffect(()=>(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{c(o)},200),()=>{x.current&&clearTimeout(x.current)}),[o,c]),h.useEffect(()=>{r.searchQuery===""&&o!==""&&u("")},[r.searchQuery]);const v=new Set(r.skills.map(p=>p.plugin)).size;return a.jsxs("div",{className:"px-3 py-2",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)"},children:[a.jsx("circle",{cx:"11",cy:"11",r:"8"}),a.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),a.jsx("input",{type:"text",value:o,onChange:p=>u(p.target.value),placeholder:"Search skills...",className:"w-full py-2 pl-8 pr-3 rounded-lg text-[13px] transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",outline:"none"},onFocus:p=>{p.currentTarget.style.borderColor="var(--accent)"},onBlur:p=>{p.currentTarget.style.borderColor="var(--border-subtle)"}}),o&&a.jsx("button",{onClick:()=>{u(""),c("")},style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:2},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!r.skillsLoading&&a.jsxs("div",{className:"text-[11px] mt-1.5 px-1",style:{color:"var(--text-tertiary)"},children:[r.skills.length," skill",r.skills.length!==1?"s":""," across ",v," plugin",v!==1?"s":""]})]})}const mx={pass:{bg:"var(--green-muted)",text:"var(--green)",dot:"var(--green)",label:"Passing"},fail:{bg:"var(--red-muted)",text:"var(--red)",dot:"var(--red)",label:"Failing"},pending:{bg:"var(--yellow-muted)",text:"var(--yellow)",dot:"var(--yellow)",label:"Pending"},stale:{bg:"var(--orange-muted)",text:"var(--orange)",dot:"var(--orange)",label:"Stale"},missing:{bg:"var(--surface-3)",text:"var(--text-tertiary)",dot:"var(--text-tertiary)",label:"No evals"}};function hx({skill:r,isSelected:c,onSelect:o}){const u=mx[r.benchmarkStatus]||mx.missing,x=r.origin==="installed";return a.jsxs("button",{onClick:o,className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:c?"var(--surface-2)":"transparent",cursor:"pointer",borderTop:"none",borderRight:"none",borderBottom:"1px solid var(--border-subtle)",borderLeft:c?"2px solid var(--accent)":"2px solid transparent",display:"block",opacity:x?.7:1},onMouseEnter:v=>{c||(v.currentTarget.style.background="var(--surface-2)")},onMouseLeave:v=>{c||(v.currentTarget.style.background="transparent")},children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-[13px] font-medium truncate",style:{color:"var(--text-primary)"},children:[x&&a.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),r.skill]}),a.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full flex-shrink-0 ml-2",style:{background:u.bg,color:u.text},children:[a.jsx("span",{className:"rounded-full",style:{width:5,height:5,background:u.dot}}),u.label]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:{color:"var(--text-tertiary)"},children:[a.jsxs("span",{children:[r.evalCount," eval",r.evalCount!==1?"s":""]}),a.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),a.jsxs("span",{children:[r.assertionCount," assert",r.assertionCount!==1?"s":""]}),r.lastBenchmark&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),a.jsx("span",{children:new Date(r.lastBenchmark).toLocaleDateString()})]})]})]})}function vx(r){var o;const c={};for(const u of r)(c[o=u.plugin]||(c[o]=[])).push(u);return c}function _h(){const{state:r,selectSkill:c}=na(),{skills:o,searchQuery:u,selectedSkill:x}=r,[v,p]=h.useState(!1),[b,y]=h.useState(()=>{try{return sessionStorage.getItem("vskill-origin-banner-dismissed")==="1"}catch{return!1}}),{sourceGroups:f,installedGroups:j}=h.useMemo(()=>{const g=u.toLowerCase(),k=g?o.filter(B=>B.skill.toLowerCase().includes(g)||B.plugin.toLowerCase().includes(g)):o,w=k.filter(B=>B.origin==="source"),L=k.filter(B=>B.origin==="installed");return{sourceGroups:Object.entries(vx(w)),installedGroups:Object.entries(vx(L))}},[o,u]);return r.skillsLoading?a.jsx("div",{className:"px-3 py-4 space-y-3",children:[1,2,3].map(g=>a.jsx("div",{className:"skeleton h-14 w-full rounded-lg"},g))}):f.length===0&&j.length===0?a.jsx("div",{className:"px-4 py-8 text-center",children:a.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No skills match your search"})}):a.jsxs("div",{className:"flex-1",children:[f.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Mh,{title:"Your Skills",count:f.reduce((g,[,k])=>g+k.length,0)}),f.map(([g,k])=>a.jsxs("div",{children:[a.jsx(yx,{plugin:g,count:k.length}),k.map(w=>{const L=(x==null?void 0:x.plugin)===w.plugin&&(x==null?void 0:x.skill)===w.skill;return a.jsx(hx,{skill:w,isSelected:L,onSelect:()=>c({plugin:w.plugin,skill:w.skill,origin:w.origin})},`${w.plugin}/${w.skill}`)})]},g))]}),j.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>p(g=>!g),className:"w-full flex items-center gap-2 px-3 py-2.5 text-left",style:{background:"var(--surface-1)",border:"none",borderTop:"1px solid var(--border-subtle)",borderBottom:v?"1px solid var(--border-subtle)":"none",cursor:"pointer"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:v?"rotate(90deg)":"rotate(0deg)",transition:"transform 150ms ease"},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Installed"}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",j.reduce((g,[,k])=>g+k.length,0),")"]}),a.jsx("div",{className:"flex-1"}),a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),v&&a.jsxs(a.Fragment,{children:[!b&&a.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("p",{className:"flex-1 text-[10px] leading-relaxed",style:{color:"var(--text-tertiary)",margin:0},children:"Skills inside agent folders (.claude/, .cursor/, etc.) are installed copies for consuming. Edit skills in your project root instead."}),a.jsx("button",{onClick:()=>{y(!0);try{sessionStorage.setItem("vskill-origin-banner-dismissed","1")}catch{}},className:"flex-shrink-0 mt-0.5",style:{background:"none",border:"none",cursor:"pointer",padding:0,color:"var(--text-tertiary)"},children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),j.map(([g,k])=>a.jsxs("div",{children:[a.jsx(yx,{plugin:g,count:k.length}),k.map(w=>{const L=(x==null?void 0:x.plugin)===w.plugin&&(x==null?void 0:x.skill)===w.skill;return a.jsx(hx,{skill:w,isSelected:L,onSelect:()=>c({plugin:w.plugin,skill:w.skill,origin:w.origin})},`${w.plugin}/${w.skill}`)})]},g))]})]})]})}function Mh({title:r,count:c}){return a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-secondary)"},children:r}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",c,")"]})]})}function yx({plugin:r,count:c}){const[o,u]=h.useState(!1),x=`/images/icons/${r}.webp`;return a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[o?a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}):a.jsx("img",{src:x,width:16,height:16,alt:"",onError:()=>u(!0),style:{objectFit:"contain"}}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:r}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",c,")"]}),a.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border-subtle)"}})]})}function Lh({value:r,onChange:c}){const[o,u]=h.useState([]),[x,v]=h.useState(!1),[p,b]=h.useState(null),[y,f]=h.useState(r),[j,g]=h.useState(!1),k=h.useRef(null),w=h.useRef(void 0);h.useEffect(()=>{v(!0),Se.searchModels().then(G=>u(G.models)).catch(G=>b(G instanceof Error?G.message:String(G))).finally(()=>v(!1))},[]);const L=h.useCallback(G=>{f(G),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>g(!0),300)},[]),B=h.useMemo(()=>{if(!y.trim())return o.slice(0,50);const G=y.toLowerCase();return o.filter(F=>F.id.toLowerCase().includes(G)||F.name.toLowerCase().includes(G)).slice(0,50)},[o,y]);h.useEffect(()=>{function G(F){k.current&&!k.current.contains(F.target)&&g(!1)}return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[]);function Y(G){var Q;const F=(Q=G.pricing)==null?void 0:Q.prompt;return F==null||F===0?"Free":`$${(F*1e6).toFixed(2)}/1M`}return a.jsxs("div",{ref:k,style:{position:"relative"},children:[a.jsx("input",{type:"text",value:y,onChange:G=>L(G.target.value),onFocus:()=>g(!0),placeholder:x?"Loading models...":"Search OpenRouter models...",className:"input-field w-full",style:{fontSize:12}}),j&&!x&&a.jsxs("div",{style:{position:"absolute",top:"100%",left:0,right:0,maxHeight:280,overflowY:"auto",background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:8,marginTop:4,zIndex:20,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:[p&&a.jsxs("div",{className:"px-3 py-2 text-[11px]",style:{color:"var(--red)"},children:["Failed to load models: ",p]}),B.length===0&&!p&&a.jsx("div",{className:"px-3 py-3 text-[11px]",style:{color:"var(--text-tertiary)"},children:"No models found"}),B.map(G=>a.jsxs("button",{onClick:()=>{c(G.id),f(G.id),g(!1)},className:"w-full text-left px-3 py-2 flex items-center justify-between transition-colors duration-100",style:{background:G.id===r?"var(--accent-muted)":"transparent",border:"none",cursor:"pointer",borderBottom:"1px solid var(--border-subtle)"},onMouseEnter:F=>{F.currentTarget.style.background="var(--surface-3)"},onMouseLeave:F=>{F.currentTarget.style.background=G.id===r?"var(--accent-muted)":"transparent"},children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:G.name}),a.jsx("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:G.id})]}),a.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:Y(G)})]},G.id))]})]})}function zh(){const{config:r,updateConfig:c,refreshConfig:o}=Na(),[u,x]=h.useState(!1),[v,p]=h.useState(!1),b=h.useRef(null);h.useEffect(()=>{function g(k){b.current&&!b.current.contains(k.target)&&x(!1)}return u&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[u]);async function y(g,k){p(!0);try{await c(g.id,k.id),x(!1)}catch{o()}finally{p(!1)}}if(!r)return null;const f=Oh(r),j=Dh(r);return a.jsxs("div",{ref:b,className:"relative",children:[a.jsxs("button",{onClick:()=>x(!u),className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] transition-all duration-150",style:{background:u?"var(--surface-3)":"var(--surface-2)",border:`1px solid ${u?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},onMouseEnter:g=>{u||(g.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:g=>{u||(g.currentTarget.style.borderColor="var(--border-subtle)")},children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:j!=null&&j.available?"var(--green)":"var(--text-tertiary)"}}),a.jsx("span",{className:"flex-1 text-left font-medium truncate",style:{color:"var(--text-primary)"},children:f}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:u?"rotate(180deg)":"rotate(0)",transition:"transform 0.15s ease",flexShrink:0},children:a.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),u&&a.jsxs("div",{className:"absolute top-full mt-1 left-0 right-0 rounded-xl shadow-xl z-50 overflow-hidden animate-fade-in",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",minWidth:"240px"},children:[a.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border-subtle)"},children:a.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Select Model"})}),a.jsx("div",{className:"py-1 max-h-72 overflow-y-auto",children:r.providers.map(g=>a.jsxs("div",{children:[a.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:g.available?"var(--green)":"var(--text-tertiary)",opacity:g.available?1:.3}}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",opacity:g.available?1:.5},children:g.label})]}),g.id==="openrouter"&&g.available?a.jsx("div",{className:"px-3 py-1.5",children:a.jsx(Lh,{value:r.provider==="openrouter"?r.model:"",onChange:k=>{v||y(g,{id:k,label:k})}})}):g.models.map(k=>{const w=Ux(r,g.id,k.id),L=!g.available||v;return a.jsxs("button",{onClick:()=>!L&&y(g,k),disabled:L,className:"w-full px-3 py-1.5 flex items-center gap-2.5 text-left transition-all duration-100",style:{background:w?"var(--accent-muted)":"transparent",color:L?"var(--text-tertiary)":"var(--text-primary)",opacity:L?.4:1,cursor:L?"not-allowed":"pointer"},onMouseEnter:B=>{!L&&!w&&(B.currentTarget.style.background="var(--surface-3)")},onMouseLeave:B=>{w||(B.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0 flex items-center justify-center",style:{border:`2px solid ${w?"var(--accent)":"var(--border-subtle)"}`},children:w&&a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}})}),a.jsx("span",{className:"text-[12px]",style:{fontWeight:w?600:400},title:k.id,children:k.label})]},`${g.id}-${k.id}`)})]},g.id))})]})]})}function Ux(r,c,o){return r.provider!==c?!1:c==="claude-cli"?r.model===`claude-${o}`:r.model===o}function Dh(r){return r.providers.find(c=>c.id===r.provider)}function Oh(r){for(const c of r.providers)for(const o of c.models)if(Ux(r,c.id,o.id))return o.label;return r.model}function Bh(){const{state:r,setMode:c}=na(),{config:o}=Na(),[u,x]=h.useState(null),[v,p]=h.useState(!1);return h.useEffect(()=>{Se.getSkillCreatorStatus().then(x).catch(()=>{})},[]),a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"px-4 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"var(--accent-muted)"},children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-[14px] font-semibold truncate",style:{color:"var(--text-primary)",letterSpacing:"-0.01em"},children:"Skill Studio"}),a.jsx("div",{className:"text-[11px] truncate",style:{color:"var(--text-tertiary)"},children:(o==null?void 0:o.projectName)||"vskill"})]})]}),a.jsx("div",{className:"mt-3",children:a.jsx(zh,{})})]}),a.jsx(Rh,{}),a.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:a.jsxs("button",{onClick:()=>c("create"),className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:r.mode==="create"?"var(--accent)":"var(--surface-3)",color:r.mode==="create"?"#fff":"var(--text-secondary)",border:"none",cursor:"pointer"},onMouseEnter:b=>{r.mode!=="create"&&(b.currentTarget.style.background="var(--surface-4)",b.currentTarget.style.color="var(--text-primary)")},onMouseLeave:b=>{r.mode!=="create"&&(b.currentTarget.style.background="var(--surface-3)",b.currentTarget.style.color="var(--text-secondary)")},children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"New Skill"]})}),u&&(()=>{const b=(o==null?void 0:o.provider)==="claude-cli";return u.installed&&b?a.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[a.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--green)"}}),"Skill Creator installed"]})}):u.installed&&!b?a.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)",opacity:.5},children:[a.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--text-tertiary)"}}),"Skill Creator (Claude only)"]})}):!u.installed&&b?a.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:a.jsxs("div",{className:"px-3 py-2 rounded-lg text-[11px]",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",style:{color:"var(--yellow)"},children:[a.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--yellow)"}}),a.jsx("span",{className:"font-medium",children:"Skill Creator not installed"})]}),a.jsx("button",{onClick:()=>{navigator.clipboard.writeText(u.installCommand).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)}).catch(()=>{})},className:"w-full text-left px-2 py-1 rounded text-[10px] font-mono cursor-pointer transition-colors duration-150",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},title:"Click to copy",onMouseEnter:y=>{y.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:y=>{y.currentTarget.style.borderColor="var(--border-subtle)"},children:v?"Copied!":u.installCommand})]})}):null})(),a.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:a.jsx(_h,{})})]})}const Hh="modulepreload",Uh=function(r){return"/"+r},gx={},qh=function(c,o,u){let x=Promise.resolve();if(o&&o.length>0){let p=function(f){return Promise.all(f.map(j=>Promise.resolve(j).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const b=document.querySelector("meta[property=csp-nonce]"),y=(b==null?void 0:b.nonce)||(b==null?void 0:b.getAttribute("nonce"));x=p(o.map(f=>{if(f=Uh(f),f in gx)return;gx[f]=!0;const j=f.endsWith(".css"),g=j?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const k=document.createElement("link");if(k.rel=j?"stylesheet":Hh,j||(k.as="script"),k.crossOrigin="",k.href=f,y&&k.setAttribute("nonce",y),document.head.appendChild(k),j)return new Promise((w,L)=>{k.addEventListener("load",w),k.addEventListener("error",()=>L(new Error(`Unable to preload CSS for ${f}`)))})}))}function v(p){const b=new Event("vite:preloadError",{cancelable:!0});if(b.payload=p,window.dispatchEvent(b),!b.defaultPrevented)throw p}return x.then(p=>{for(const b of p||[])b.status==="rejected"&&v(b.reason);return c().catch(v)})};function Xo(){const[r,c]=h.useState([]),[o,u]=h.useState(!1),[x,v]=h.useState(!1),[p,b]=h.useState(null),y=h.useRef(null),f=h.useCallback(async(g,k)=>{c([]),u(!0),v(!1),b(null);const w=new AbortController;y.current=w;try{const L=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json"},body:k?JSON.stringify(k):void 0,signal:w.signal});if(!L.ok||!L.body){let le=`HTTP ${L.status}`;try{const Q=await L.json();Q.error&&(le=Q.error)}catch{}throw new Error(le)}const B=L.body.getReader(),Y=new TextDecoder;let G="",F="";for(;;){const{done:le,value:Q}=await B.read();if(le)break;G+=Y.decode(Q,{stream:!0});const ne=G.split(`
50
+ `);G=ne.pop()||"";for(const se of ne)if(se.startsWith("event: "))F=se.slice(7).trim();else if(se.startsWith("data: ")){try{const U=JSON.parse(se.slice(6)),$={event:F,data:U};F==="done"?(v(!0),c(W=>[...W,$])):c(W=>[...W,$])}catch{}F=""}}}catch(L){L.name!=="AbortError"&&b(L.message)}finally{u(!1),y.current=null}},[]),j=h.useCallback(()=>{var g;(g=y.current)==null||g.abort()},[]);return{events:r,running:o,done:x,error:p,start:f,stop:j}}function Gh(r){const c=h.useRef(r);c.current=r;const[o,u]=h.useState(new Set),x=h.useRef(new Map),v=h.useCallback(async(f,j,g)=>{var w;(w=x.current.get(f))==null||w.abort();const k=new AbortController;x.current.set(f,k),u(L=>{const B=new Set(L);return B.add(f),B});try{const L=await fetch(j,{method:"POST",headers:{"Content-Type":"application/json"},body:g?JSON.stringify(g):void 0,signal:k.signal});if(!L.ok||!L.body){let le=`HTTP ${L.status}`;try{const Q=await L.json();Q.error&&(le=Q.error)}catch{}throw new Error(le)}const B=L.body.getReader(),Y=new TextDecoder;let G="",F="";for(;;){const{done:le,value:Q}=await B.read();if(le)break;G+=Y.decode(Q,{stream:!0});const ne=G.split(`
51
+ `);G=ne.pop()||"";for(const se of ne)if(se.startsWith("event: "))F=se.slice(7).trim();else if(se.startsWith("data: ")){try{const U=JSON.parse(se.slice(6)),$={event:F,data:U};c.current.onEvent(f,$)}catch{}F=""}}c.current.onDone(f)}catch(L){L.name!=="AbortError"&&c.current.onError(f,L.message)}finally{u(L=>{const B=new Set(L);return B.delete(f),B}),x.current.delete(f)}},[]),p=h.useCallback(f=>{var j;(j=x.current.get(f))==null||j.abort()},[]),b=h.useCallback(()=>{for(const f of x.current.values())f.abort()},[]),y=o.size>0;return{runningSet:o,startCase:v,stopCase:p,stopAll:b,isAnyCaseRunning:y}}const Yh={plugin:"",skill:"",skillContent:"",savedContent:"",isDirty:!1,evals:null,evalsError:null,activePanel:"tests",selectedCaseId:null,caseRunStates:new Map,bulkRunActive:!1,runMode:null,latestBenchmark:null,inlineResults:new Map,improveTarget:null,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null,generateEvalsLoading:!1,generateEvalsProgress:[],generateEvalsError:null,regressions:[],iterationCount:0,activationPrompts:"",activationResults:[],activationSummary:null,activationRunning:!1,activationError:null,activationTotalPrompts:0,activationStartedAt:null,generatingPrompts:!1,generatingPromptsError:null,activationHistory:null,activationHistoryLoading:!1,loading:!0,error:null};function Vh(r,c){var o,u;switch(c.type){case"SET_LOADING":return{...r,loading:c.loading};case"SET_ERROR":return{...r,error:c.error};case"INIT_DATA":{const x=new Map;if(c.benchmark)for(const p of c.benchmark.cases)x.set(p.eval_id,{status:p.status,passRate:p.pass_rate,errorMessage:p.error_message||void 0,durationMs:p.durationMs,tokens:p.tokens,output:p.output,assertions:p.assertions.map(b=>({assertion_id:b.id,text:b.text,pass:b.pass,reasoning:b.reasoning}))});const v=((u=(o=c.evals)==null?void 0:o.evals[0])==null?void 0:u.id)??null;return{...r,skillContent:c.skillContent,savedContent:c.skillContent,isDirty:!1,evals:c.evals,evalsError:c.evalsError??null,latestBenchmark:c.benchmark,inlineResults:x,selectedCaseId:v,loading:!1,error:null}}case"SET_PANEL":return{...r,activePanel:c.panel};case"SET_CONTENT":return{...r,skillContent:c.content,isDirty:c.content!==r.savedContent};case"CONTENT_SAVED":return{...r,savedContent:r.skillContent,isDirty:!1};case"SET_EVALS":return{...r,evals:c.evals};case"SELECT_CASE":return{...r,selectedCaseId:c.caseId};case"CASE_RUN_START":{const x=new Map(r.caseRunStates);return x.set(c.caseId,{status:"running",startedAt:Date.now(),mode:c.mode}),{...r,caseRunStates:x,runMode:c.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const x=new Map(r.caseRunStates),v=x.get(c.caseId);x.set(c.caseId,{status:"complete",mode:v==null?void 0:v.mode});const p=new Map(r.inlineResults);return p.set(c.caseId,c.result),{...r,caseRunStates:x,inlineResults:p}}case"CASE_RUN_ERROR":{const x=new Map(r.caseRunStates),v=x.get(c.caseId);x.set(c.caseId,{status:"error",mode:v==null?void 0:v.mode});const p=new Map(r.inlineResults);return p.set(c.caseId,{status:"error",errorMessage:c.error,assertions:[]}),{...r,caseRunStates:x,inlineResults:p}}case"CASE_RUN_CANCEL":{const x=new Map(r.caseRunStates),v=x.get(c.caseId);return x.set(c.caseId,{status:"cancelled",mode:v==null?void 0:v.mode}),{...r,caseRunStates:x}}case"BULK_RUN_START":{const x=new Map(r.caseRunStates);for(const v of c.caseIds)x.set(v,{status:"queued",mode:c.mode});return{...r,caseRunStates:x,bulkRunActive:!0,runMode:c.mode,activePanel:"run"}}case"BULK_RUN_COMPLETE":return{...r,bulkRunActive:!1,latestBenchmark:c.benchmark??r.latestBenchmark,iterationCount:r.iterationCount+1};case"CANCEL_ALL":{const x=new Map(r.caseRunStates);for(const[v,p]of x)(p.status==="running"||p.status==="queued")&&x.set(v,{status:"cancelled"});return{...r,caseRunStates:x,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const x=new Map(r.inlineResults);return x.set(c.evalId,c.result),{...r,inlineResults:x}}case"OPEN_IMPROVE":return{...r,improveTarget:c.evalId,activePanel:"editor"};case"CLOSE_IMPROVE":return{...r,improveTarget:null};case"OPEN_AI_EDIT":return{...r,aiEditOpen:!0,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"CLOSE_AI_EDIT":return{...r,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"AI_EDIT_LOADING":return{...r,aiEditLoading:!0,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[]};case"AI_EDIT_PROGRESS":return{...r,aiEditProgress:[...r.aiEditProgress,c.entry]};case"AI_EDIT_RESULT":{const x=c.evalChanges??[],v=new Map;for(let p=0;p<x.length;p++)v.set(p,!0);return{...r,aiEditLoading:!1,aiEditResult:{improved:c.improved,reasoning:c.reasoning,evalChanges:x},aiEditEvalChanges:x,aiEditEvalSelections:v}}case"AI_EDIT_ERROR":return{...r,aiEditLoading:!1,aiEditError:c.message,aiEditClassifiedError:c.classified??null};case"GENERATE_EVALS_START":return{...r,generateEvalsLoading:!0,generateEvalsProgress:[],generateEvalsError:null};case"GENERATE_EVALS_PROGRESS":return{...r,generateEvalsProgress:[...r.generateEvalsProgress,c.entry]};case"GENERATE_EVALS_DONE":return{...r,generateEvalsLoading:!1,evals:c.evals};case"GENERATE_EVALS_ERROR":return{...r,generateEvalsLoading:!1,generateEvalsError:c.classified};case"TOGGLE_EVAL_CHANGE":{const x=new Map(r.aiEditEvalSelections);return x.set(c.index,!x.get(c.index)),{...r,aiEditEvalSelections:x}}case"SELECT_ALL_EVAL_CHANGES":{const x=new Map(r.aiEditEvalSelections);for(const v of x.keys())x.set(v,!0);return{...r,aiEditEvalSelections:x}}case"DESELECT_ALL_EVAL_CHANGES":{const x=new Map(r.aiEditEvalSelections);for(const v of x.keys())x.set(v,!1);return{...r,aiEditEvalSelections:x}}case"SET_EVALS_RETRY":return{...r,aiEditEvalsRetry:c.evalsFile};case"SET_REGRESSIONS":return{...r,regressions:c.regressions};case"INCREMENT_ITERATION":return{...r,iterationCount:r.iterationCount+1};case"SET_ACTIVATION_PROMPTS":return{...r,activationPrompts:c.prompts};case"ACTIVATION_START":return{...r,activationRunning:!0,activationResults:[],activationSummary:null,activationError:null,activationStartedAt:Date.now()};case"ACTIVATION_RESULT":return{...r,activationResults:[...r.activationResults,c.result]};case"ACTIVATION_DONE":return{...r,activationRunning:!1,activationSummary:c.summary};case"ACTIVATION_ERROR":return{...r,activationRunning:!1,activationError:c.error};case"ACTIVATION_RESET":return{...r,activationResults:[],activationSummary:null,activationError:null};case"ACTIVATION_TIMEOUT":return{...r,activationRunning:!1,activationError:"Activation test timed out after 120 seconds"};case"ACTIVATION_CANCEL":return{...r,activationRunning:!1};case"GENERATE_PROMPTS_START":return{...r,generatingPrompts:!0,generatingPromptsError:null};case"GENERATE_PROMPTS_DONE":return{...r,generatingPrompts:!1};case"GENERATE_PROMPTS_ERROR":return{...r,generatingPrompts:!1,generatingPromptsError:c.error};case"ACTIVATION_HISTORY_LOADED":return{...r,activationHistory:c.runs,activationHistoryLoading:!1};default:return r}}function Qh(r,c){const o=c.data;if(c.event==="output_ready"&&(r.output=o.output,o.durationMs!=null&&(r.durationMs=o.durationMs),o.tokens!=null&&(r.tokens=o.tokens)),c.event==="outputs_ready"&&(r.output=o.skillOutput,o.skillDurationMs!=null&&(r.durationMs=o.skillDurationMs),o.skillTokens!=null&&(r.tokens=o.skillTokens)),c.event==="assertion_result"){const u={assertion_id:o.assertion_id,text:o.text,pass:o.pass,reasoning:o.reasoning};r.assertions.find(x=>x.assertion_id===u.assertion_id)||r.assertions.push(u)}c.event==="case_complete"&&(r.status=o.status,r.passRate=o.pass_rate,r.errorMessage=o.error_message||void 0,r.classifiedError=o.classified_error||void 0)}const qx=h.createContext(null);function il(){const r=h.useContext(qx);if(!r)throw new Error("useWorkspace must be used within WorkspaceProvider");return r}function Xh({plugin:r,skill:c,origin:o,children:u}){const x=o==="installed",[v,p]=h.useReducer(Vh,{...Yh,plugin:r,skill:c}),b=h.useRef(new Set),y=h.useRef(new Set),f=h.useRef(new Map),j=h.useCallback((K,re)=>{let ie=f.current.get(K);ie||(ie={assertions:[]},f.current.set(K,ie)),Qh(ie,re),p({type:"UPDATE_INLINE_RESULT",evalId:K,result:{...ie,assertions:[...ie.assertions]}})},[]),g=h.useCallback(K=>{if(y.current.has(K))return;y.current.add(K);const re=f.current.get(K)??{assertions:[]};p({type:"CASE_RUN_COMPLETE",caseId:K,result:{...re,assertions:[...re.assertions]}}),b.current.has(K)&&(b.current.delete(K),b.current.size===0&&Se.getLatestBenchmark(r,c).then(ie=>p({type:"BULK_RUN_COMPLETE",benchmark:ie})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null})))},[r,c]),k=h.useCallback((K,re)=>{y.current.has(K)||(y.current.add(K),p({type:"CASE_RUN_ERROR",caseId:K,error:re}),b.current.has(K)&&(b.current.delete(K),b.current.size===0&&Se.getLatestBenchmark(r,c).then(ie=>p({type:"BULK_RUN_COMPLETE",benchmark:ie})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[r,c]),{startCase:w,stopCase:L,stopAll:B}=Gh({onEvent:j,onDone:g,onError:k});h.useEffect(()=>()=>{B()},[B]),h.useEffect(()=>{let K=!1;async function re(){try{const[ie,fe,pe]=await Promise.allSettled([Se.getSkillDetail(r,c),Se.getEvals(r,c),Se.getLatestBenchmark(r,c)]);if(K)return;let Ve=null,dt=null;if(fe.status==="fulfilled")Ve=fe.value;else{const Xe=fe.reason;(Xe==null?void 0:Xe.status)!==404&&(dt=(Xe==null?void 0:Xe.message)??"Failed to load test cases")}p({type:"INIT_DATA",skillContent:ie.status==="fulfilled"?ie.value.skillContent:"",evals:Ve,evalsError:dt,benchmark:pe.status==="fulfilled"?pe.value:null})}catch(ie){K||p({type:"SET_ERROR",error:ie.message})}}return re(),ut(),()=>{K=!0}},[r,c,ut]);const Y=h.useCallback(async()=>{if(!x)try{await Se.applyImprovement(r,c,v.skillContent),p({type:"CONTENT_SAVED"})}catch(K){p({type:"SET_ERROR",error:K.message})}},[x,r,c,v.skillContent]),G=h.useCallback(async K=>{if(!x)try{const re=await Se.saveEvals(r,c,K);p({type:"SET_EVALS",evals:re})}catch(re){p({type:"SET_ERROR",error:re.message})}},[x,r,c]),F=h.useCallback((K,re="benchmark")=>{if(x)return;const ie=v.caseRunStates.get(K);if((ie==null?void 0:ie.status)!=="running")if(f.current.delete(K),y.current.delete(K),p({type:"CASE_RUN_START",caseId:K,mode:re}),re==="comparison"){const fe=`/api/skills/${r}/${c}/compare`;w(K,fe,{eval_ids:[K]})}else{const fe=`/api/skills/${r}/${c}/benchmark/case/${K}`;w(K,fe,re==="baseline"?{baseline_only:!0}:void 0)}},[x,r,c,v.caseRunStates,w]),le=h.useCallback((K="benchmark")=>{var fe;if(x)return;const re=((fe=v.evals)==null?void 0:fe.evals)??[];if(re.length===0)return;const ie=re.map(pe=>pe.id);for(const pe of ie)f.current.delete(pe),y.current.delete(pe);p({type:"BULK_RUN_START",caseIds:ie,mode:K}),b.current=new Set(ie);for(const pe of ie)if(K==="comparison")w(pe,`/api/skills/${r}/${c}/compare`,{eval_ids:[pe]});else{const Ve=`/api/skills/${r}/${c}/benchmark/case/${pe}`;w(pe,Ve,K==="baseline"?{baseline_only:!0}:void 0)}},[x,r,c,v.evals,w]),Q=h.useCallback(K=>{L(K),p({type:"CASE_RUN_CANCEL",caseId:K}),b.current.delete(K),y.current.add(K)},[L]),ne=h.useCallback(()=>{B(),p({type:"CANCEL_ALL"}),b.current.clear()},[B]),se=h.useCallback(async(K,re)=>{p({type:"OPEN_IMPROVE",evalId:K})},[]),U=h.useCallback(async(K,re)=>{try{await Se.applyImprovement(r,c,re),p({type:"SET_CONTENT",content:re}),p({type:"CONTENT_SAVED"}),p({type:"CLOSE_IMPROVE"}),F(K,"benchmark")}catch(ie){p({type:"SET_ERROR",error:ie.message})}},[r,c,F]),$=Xo(),W=h.useRef(null),he=h.useRef(0);h.useEffect(()=>{const K=$.events;for(let re=he.current;re<K.length;re++){const ie=K[re],fe=ie.data;if(ie.event==="progress"&&p({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:fe.phase,message:fe.message}}),ie.event==="done"){const pe=fe.improved,Ve=fe.reasoning,dt=fe.evalChanges??[];p({type:"AI_EDIT_RESULT",improved:pe,reasoning:Ve,evalChanges:dt})}if(ie.event==="error"){const pe=fe;p({type:"AI_EDIT_ERROR",message:pe.description||"Unknown error",classified:pe})}}he.current=K.length},[$.events]),h.useEffect(()=>{$.error&&p({type:"AI_EDIT_ERROR",message:$.error})},[$.error]),h.useEffect(()=>()=>{$.stop()},[$.stop]);const ve=h.useCallback(async(K,re,ie)=>{x||(he.current=0,p({type:"AI_EDIT_LOADING"}),W.current=$.stop,$.start(`/api/skills/${r}/${c}/improve?sse`,{mode:"instruct",instruction:K,content:v.skillContent,evals:v.evals??{skill_name:c,evals:[]},provider:re,model:ie}))},[x,r,c,v.skillContent,v.evals,$]),ye=h.useCallback(()=>{$.stop(),p({type:"AI_EDIT_ERROR",message:"Cancelled"})},[$]),J=h.useCallback(async()=>{const K=v.aiEditResult;if(K!=null&&K.improved)try{if(await Se.applyImprovement(r,c,K.improved),p({type:"SET_CONTENT",content:K.improved}),p({type:"CONTENT_SAVED"}),v.aiEditEvalChanges.length>0&&Array.from(v.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:ie}=await qh(async()=>{const{mergeEvalChanges:Ve}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:Ve}},[]),fe=v.evals??{skill_name:c,evals:[]},pe=ie(fe,v.aiEditEvalChanges,v.aiEditEvalSelections);try{const Ve=await Se.saveEvals(r,c,pe);p({type:"SET_EVALS",evals:Ve})}catch(Ve){p({type:"SET_EVALS_RETRY",evalsFile:pe}),p({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${Ve.message}. You can retry from the AI Edit panel.`});return}}p({type:"CLOSE_AI_EDIT"})}catch(re){p({type:"SET_ERROR",error:re.message})}},[r,c,v.aiEditResult,v.evals,v.aiEditEvalChanges,v.aiEditEvalSelections]),te=h.useCallback(()=>{p({type:"CLOSE_AI_EDIT"})},[]),me=h.useCallback(K=>{p({type:"TOGGLE_EVAL_CHANGE",index:K})},[]),T=h.useCallback(()=>{p({type:"SELECT_ALL_EVAL_CHANGES"})},[]),_=h.useCallback(()=>{p({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),ee=h.useCallback(async()=>{const K=v.aiEditEvalsRetry;if(K)try{const re=await Se.saveEvals(r,c,K);p({type:"SET_EVALS",evals:re}),p({type:"SET_ERROR",error:null}),p({type:"CLOSE_AI_EDIT"})}catch(re){p({type:"SET_ERROR",error:`Retry failed: ${re.message}`})}},[r,c,v.aiEditEvalsRetry]),O=h.useCallback(async()=>{try{const K=await Se.getSkillDetail(r,c);p({type:"SET_CONTENT",content:K.skillContent}),p({type:"CONTENT_SAVED"})}catch{}},[r,c]),{config:Z}=Na(),S=Xo(),z=h.useRef(0);h.useEffect(()=>{const K=S.events;for(let re=z.current;re<K.length;re++){const ie=K[re],fe=ie.data;if(ie.event==="progress"&&p({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:fe.phase,message:fe.message}}),ie.event==="done"){const pe=fe;Se.saveEvals(r,c,pe).then(Ve=>p({type:"GENERATE_EVALS_DONE",evals:Ve})).catch(Ve=>p({type:"SET_ERROR",error:Ve.message}))}ie.event==="error"&&p({type:"GENERATE_EVALS_ERROR",classified:fe})}z.current=K.length},[S.events,r,c]),h.useEffect(()=>{S.error&&p({type:"SET_ERROR",error:S.error})},[S.error]),h.useEffect(()=>()=>{S.stop()},[S.stop]);const I=h.useCallback(async K=>{if(x)return;z.current=0,p({type:"GENERATE_EVALS_START"});const re={};Z!=null&&Z.provider&&(re.provider=Z.provider),Z!=null&&Z.model&&(re.model=Z.model),K!=null&&K.testType&&(re.testType=K.testType),S.start(`/api/skills/${r}/${c}/generate-evals?sse`,Object.keys(re).length>0?re:void 0)},[x,r,c,S,Z]),P=Xo(),ue=h.useRef(0);h.useEffect(()=>()=>{P.stop()},[P.stop]),h.useEffect(()=>{const K=P.events;for(let re=ue.current;re<K.length;re++){const ie=K[re];if(ie.event==="prompt_result"&&p({type:"ACTIVATION_RESULT",result:ie.data}),ie.event==="done"){ae.current&&(clearTimeout(ae.current),ae.current=null);const fe=ie.data;p({type:"ACTIVATION_DONE",summary:fe});const pe={id:`run-${Date.now()}`,timestamp:new Date().toISOString(),model:(Z==null?void 0:Z.model)||"unknown",provider:(Z==null?void 0:Z.provider)||"unknown",promptCount:fe.total,summary:{precision:fe.precision,recall:fe.recall,reliability:fe.reliability,tp:fe.tp,tn:fe.tn,fp:fe.fp,fn:fe.fn}};p({type:"ACTIVATION_HISTORY_LOADED",runs:[pe,...v.activationHistory??[]]})}}ue.current=K.length},[P.events,Z,v.activationHistory]),h.useEffect(()=>{P.error&&(ae.current&&(clearTimeout(ae.current),ae.current=null),p({type:"ACTIVATION_ERROR",error:P.error}))},[P.error]);const ae=h.useRef(null),be=h.useCallback(()=>{ae.current&&(clearTimeout(ae.current),ae.current=null),P.stop(),p({type:"ACTIVATION_CANCEL",totalPrompts:0})},[P]),Be=h.useCallback(K=>{const ie=K.trim().split(`
52
+ `).filter(Boolean).map(pe=>pe.startsWith("!")?{prompt:pe.slice(1).trim(),expected:"should_not_activate"}:pe.startsWith("+")?{prompt:pe.slice(1).trim(),expected:"should_activate"}:{prompt:pe.trim(),expected:"auto"});ue.current=0,p({type:"ACTIVATION_START"}),p({type:"SET_ACTIVATION_PROMPTS",prompts:K});const fe={prompts:ie};Z!=null&&Z.provider&&(fe.provider=Z.provider),Z!=null&&Z.model&&(fe.model=Z.model),P.start(`/api/skills/${r}/${c}/activation-test`,fe),ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{P.stop(),p({type:"ACTIVATION_TIMEOUT"}),ae.current=null},12e4)},[r,c,P,Z]),Ae=h.useCallback(async(K=8)=>{p({type:"GENERATE_PROMPTS_START"});try{const re={count:K};Z!=null&&Z.provider&&(re.provider=Z.provider),Z!=null&&Z.model&&(re.model=Z.model);const ie=await fetch(`/api/skills/${r}/${c}/activation-prompts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(re)});if(!ie.ok){let mt=`HTTP ${ie.status}`;try{const tl=await ie.json();tl.error&&(mt=tl.error)}catch{}throw new Error(mt)}const fe=ie.body.getReader(),pe=new TextDecoder;let Ve="",dt="",Xe=[];for(;;){const{done:mt,value:tl}=await fe.read();if(mt)break;Ve+=pe.decode(tl,{stream:!0});const Qt=Ve.split(`
53
+ `);Ve=Qt.pop()||"";for(const We of Qt)if(We.startsWith("event: "))dt=We.slice(7).trim();else if(We.startsWith("data: ")){try{const Dt=JSON.parse(We.slice(6));if(dt==="done"&&(Xe=Dt.prompts||[]),dt==="error")throw new Error(Dt.message||Dt.description||"Generation failed")}catch(Dt){if(!(Dt instanceof Error&&Dt.message!=="Generation failed"))throw Dt}dt=""}}const zt=Xe.map(mt=>`${mt.expected==="should_activate"?"+":"!"}${mt.prompt}`).join(`
54
+ `);p({type:"SET_ACTIVATION_PROMPTS",prompts:zt}),p({type:"GENERATE_PROMPTS_DONE"})}catch(re){p({type:"GENERATE_PROMPTS_ERROR",error:re.message})}},[r,c,Z]),ut=h.useCallback(async()=>{try{const K=await fetch(`/api/skills/${r}/${c}/activation-history`);if(!K.ok){if(K.status===404){p({type:"ACTIVATION_HISTORY_LOADED",runs:[]});return}return}const re=await K.json();p({type:"ACTIVATION_HISTORY_LOADED",runs:re.runs||[]})}catch{}},[r,c]),Lt=h.useMemo(()=>({state:v,dispatch:p,isReadOnly:x,saveContent:Y,saveEvals:G,runCase:F,runAll:le,cancelCase:Q,cancelAll:ne,improveForCase:se,applyImproveAndRerun:U,refreshSkillContent:O,generateEvals:I,runActivationTest:Be,cancelActivation:be,generateActivationPrompts:Ae,fetchActivationHistory:ut,submitAiEdit:ve,cancelAiEdit:ye,applyAiEdit:J,discardAiEdit:te,toggleEvalChange:me,selectAllEvalChanges:T,deselectAllEvalChanges:_,retryEvalsSave:ee}),[v,x,Y,G,F,le,Q,ne,se,U,O,I,Be,be,Ae,ut,ve,ye,J,te,me,T,_,ee]);return a.jsx(qx.Provider,{value:Lt,children:u})}function Kh(r){return r==null?"var(--text-tertiary)":r>=.7?"var(--green)":r>=.4?"var(--yellow)":"var(--red)"}function Zh(r){return r==null?"var(--surface-3)":r>=.7?"var(--green-muted)":r>=.4?"var(--yellow-muted)":"var(--red-muted)"}function $h({state:r,isReadOnly:c,onDelete:o}){const{plugin:u,skill:x,evals:v,latestBenchmark:p,isDirty:b,caseRunStates:y,regressions:f,iterationCount:j}=r,g=Array.from(y.values()).some(G=>G.status==="running"||G.status==="queued"),k=p==null?void 0:p.overall_pass_rate,w=(v==null?void 0:v.evals.reduce((G,F)=>G+F.assertions.length,0))??0,L=(v==null?void 0:v.evals.length)??0,B=Kh(k),Y=Zh(k);return a.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",flexShrink:0},children:[a.jsxs("div",{className:"flex items-center gap-2 text-[13px]",children:[a.jsx("span",{style:{color:"var(--text-tertiary)"},children:u}),a.jsx(Jh,{}),a.jsx("span",{className:"font-medium",style:{color:"var(--text-primary)"},children:x}),c&&a.jsxs("span",{className:"ml-2 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:[a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"installed"]}),b&&a.jsx("span",{className:"ml-2 text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded",style:{background:"var(--yellow-muted)",color:"var(--yellow)"},children:"unsaved"}),g&&a.jsxs("span",{className:"ml-2 flex items-center gap-1.5 text-[11px]",style:{color:"var(--accent)"},children:[a.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}}),"Running..."]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!c&&o&&a.jsx("button",{disabled:g,onClick:()=>{window.confirm(`Delete skill "${x}"? This cannot be undone.`)&&o()},title:"Delete skill",className:"flex items-center justify-center transition-colors duration-150",style:{background:"none",border:"none",cursor:g?"not-allowed":"pointer",color:"var(--text-tertiary)",padding:4,opacity:g?.4:1,borderRadius:4},onMouseEnter:G=>{g||(G.currentTarget.style.color="var(--red)")},onMouseLeave:G=>{G.currentTarget.style.color="var(--text-tertiary)"},children:a.jsx(Wh,{})}),f.length>0&&a.jsxs("span",{className:"pill",style:{background:"var(--red-muted)",color:"var(--red)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[a.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),a.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),a.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),f.length," regression",f.length>1?"s":""]}),j>0&&a.jsxs("span",{className:"pill",style:{background:"var(--purple-muted)",color:"var(--purple)"},children:["Iter ",j]}),a.jsx("span",{className:"pill",style:{background:Y,color:B},children:k!=null?`${Math.round(k*100)}%`:"--"}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[L," case",L!==1?"s":""," / ",w," assert",w!==1?"s":""]})]})]})}function Jh(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})})}function Wh(){return a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"3 6 5 6 21 6"}),a.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),a.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),a.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}const Fh=[{label:"Build",tabs:[{id:"editor",label:"Editor",shortcut:"1"},{id:"tests",label:"Tests",shortcut:"2"}]},{label:"Evaluate",tabs:[{id:"run",label:"Run",shortcut:"3"},{id:"activation",label:"Activation",shortcut:"4"}]},{label:"Insights",tabs:[{id:"history",label:"History",shortcut:"5"},{id:"leaderboard",label:"Leaderboard",shortcut:"6"},{id:"deps",label:"Deps",shortcut:"7"}]}];function Ih({id:r}){const c={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"};switch(r){case"editor":return a.jsxs("svg",{...c,children:[a.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]});case"tests":return a.jsxs("svg",{...c,children:[a.jsx("path",{d:"M9 11l3 3L22 4"}),a.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]});case"run":return a.jsx("svg",{...c,children:a.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})});case"activation":return a.jsxs("svg",{...c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("circle",{cx:"12",cy:"12",r:"6"}),a.jsx("circle",{cx:"12",cy:"12",r:"2"})]});case"history":return a.jsxs("svg",{...c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]});case"leaderboard":return a.jsxs("svg",{...c,children:[a.jsx("path",{d:"M18 20V10"}),a.jsx("path",{d:"M12 20V4"}),a.jsx("path",{d:"M6 20v-6"})]});case"deps":return a.jsxs("svg",{...c,children:[a.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),a.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}}function Ph({activePanel:r,onPanelChange:c,isDirty:o,isRunning:u,hasRegressions:x,isActivationRunning:v}){return a.jsx("div",{className:"flex items-center gap-0.5 px-3 overflow-x-auto",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",flexShrink:0},children:Fh.map((p,b)=>a.jsxs("div",{className:"flex items-center",children:[b>0&&a.jsx("div",{style:{width:1,height:20,background:"var(--border-subtle)",margin:"0 6px",flexShrink:0}}),p.tabs.map(y=>{const f=r===y.id,j=y.id==="editor"&&o||y.id==="run"&&u||y.id==="activation"&&v||y.id==="history"&&x,g=y.id==="run"||y.id==="activation"?"var(--accent)":y.id==="history"?"var(--red)":"var(--yellow)";return a.jsxs("button",{onClick:()=>c(y.id),title:`${y.label} (Ctrl+${y.shortcut})`,className:"relative flex items-center gap-1.5 px-3 py-2.5 text-[12px] font-medium transition-colors duration-150",style:{background:"transparent",color:f?"var(--text-primary)":"var(--text-tertiary)",borderBottom:f?"2px solid var(--accent)":"2px solid transparent",cursor:"pointer",border:"none",borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:f?"var(--accent)":"transparent",whiteSpace:"nowrap"},onMouseEnter:k=>{f||(k.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:k=>{f||(k.currentTarget.style.color="var(--text-tertiary)")},children:[a.jsx(Ih,{id:y.id}),y.label,j&&a.jsx("span",{className:"absolute top-1.5 right-1 rounded-full",style:{width:5,height:5,background:g}})]},y.id)})]},p.label))})}function ev(r){const c=r.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!c)return{metadata:{},body:r};const o=c[1],u=c[2].trim(),x={},v=o.split(`
55
+ `);let p="",b=!1;for(const y of v){const f=y.match(/^[ \t]+([\w-]+):\s*(.*)$/);if(f&&p&&b){const k=f[1],w=f[2].trim();let L=x[p];if((typeof L!="object"||Array.isArray(L))&&(L={},x[p]=L),!w)L[k]=[];else{const B=w.match(/^\[(.+)\]$/);B?L[k]=B[1].split(",").map(Y=>Y.trim().replace(/^["']|["']$/g,"")).filter(Boolean):L[k]=w.replace(/^["']|["']$/g,"")}continue}const j=y.match(/^\s+-\s+(.+)$/);if(j&&p){b=!1;const k=x[p];Array.isArray(k)?k.push(j[1].trim().replace(/^["']|["']$/g,"")):x[p]=[j[1].trim().replace(/^["']|["']$/g,"")];continue}const g=y.match(/^([\w-]+):\s*(.*)$/);if(g){p=g[1];const k=g[2].trim();if(b=!1,!k){x[p]={},b=!0;continue}const w=k.match(/^\[(.+)\]$/);if(w){x[p]=w[1].split(",").map(L=>L.trim().replace(/^["']|["']$/g,"")).filter(Boolean);continue}x[p]=k.replace(/^["']|["']$/g,"")}}return{metadata:x,body:u}}function Nr(r){if(!r)return"";try{let c=r.replace(/^---\n[\s\S]*?\n---\n?/,""),o=tv(c);return o=o.replace(/```(\w*)\n([\s\S]*?)```/g,'<pre style="background:var(--surface-2);padding:0.75rem;border-radius:6px;overflow-x:auto;font-size:12px;line-height:1.5;margin:0.5rem 0;border:1px solid var(--border-subtle)"><code>$2</code></pre>'),o=o.replace(/^### (.+)$/gm,'<div style="font-weight:600;font-size:14px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),o=o.replace(/^## (.+)$/gm,'<div style="font-weight:700;font-size:15px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),o=o.replace(/^# (.+)$/gm,'<div style="font-weight:700;font-size:1rem;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),o=o.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--accent);text-decoration:underline">$1</a>'),o=o.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),o=o.replace(/\*([^*]+)\*/g,"<em>$1</em>"),o=o.replace(/`([^`]+)`/g,'<code style="background:var(--surface-3);padding:0.1rem 0.3rem;border-radius:3px;font-size:0.85em">$1</code>'),o=o.replace(/^- (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">• $1</div>'),o=o.replace(/^(\d+)\. (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">$1. $2</div>'),o=o.replace(/\n\n/g,'<div style="height:0.5rem"></div>'),o=o.replace(/\n/g,"<br/>"),o}catch{return`<pre style="white-space:pre-wrap;font-size:12px;line-height:1.5">${r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</pre>`}}function tv(r){const c=r.split(`
56
+ `),o=[];let u=0;for(;u<c.length;)if(c[u].trim().startsWith("|")&&u+1<c.length&&c[u+1].trim().startsWith("|")&&/\|[\s-:]+\|/.test(c[u+1])){const x=bx(c[u]);u+=2;const v=[];for(;u<c.length&&c[u].trim().startsWith("|");)v.push(bx(c[u])),u++;const p='style="text-align:left;padding:0.4rem 0.6rem;font-weight:600;font-size:12px;color:var(--text-primary);border-bottom:1px solid var(--border-default)"',b='style="padding:0.4rem 0.6rem;font-size:12px;color:var(--text-secondary);border-bottom:1px solid var(--border-subtle)"';let y='<table style="width:100%;border-collapse:collapse;margin:0.5rem 0;border:1px solid var(--border-subtle);border-radius:6px;overflow:hidden">';y+="<thead><tr>";for(const f of x)y+=`<th ${p}>${f}</th>`;y+="</tr></thead><tbody>";for(const f of v){y+="<tr>";for(const j of f)y+=`<td ${b}>${j}</td>`;y+="</tr>"}y+="</tbody></table>",o.push(y)}else o.push(c[u]),u++;return o.join(`
57
+ `)}function bx(r){return r.split("|").map(c=>c.trim()).filter(c=>c.length>0)}function Er(r,c){const o=r.split(`
58
+ `),u=c.split(`
59
+ `);if(o.length>1e3||u.length>1e3)return[...o.map(j=>({type:"unchanged",content:j}))];const x=o.length,v=u.length,p=Array.from({length:x+1},()=>new Array(v+1).fill(0));for(let j=1;j<=x;j++)for(let g=1;g<=v;g++)o[j-1]===u[g-1]?p[j][g]=p[j-1][g-1]+1:p[j][g]=Math.max(p[j-1][g],p[j][g-1]);const b=[];let y=x,f=v;for(;y>0||f>0;)y>0&&f>0&&o[y-1]===u[f-1]?(b.push({type:"unchanged",content:o[y-1]}),y--,f--):f>0&&(y===0||p[y][f-1]>=p[y-1][f])?(b.push({type:"added",content:u[f-1]}),f--):(b.push({type:"removed",content:o[y-1]}),y--);return b.reverse()}function lv(r,c){if(c&&new Set(["generating","comparing","judging","judging_assertion","preparing","parsing","generating_skill","generating_baseline","scoring","action_items"]).has(r))return a.jsx("div",{className:"spinner",style:{width:10,height:10,flexShrink:0}});const u=new Set(["generating","comparing","preparing","generating_skill","generating_baseline","scoring","action_items"]);return a.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:u.has(r)?"var(--accent)":"var(--green)"}})}function ss({entries:r,isRunning:c}){const[o,u]=h.useState(!1),x=h.useRef(null);return h.useEffect(()=>{x.current&&!o&&(x.current.scrollTop=x.current.scrollHeight)},[r,o]),r.length===0&&!c?null:a.jsxs("div",{className:"mt-2 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[a.jsxs("button",{onClick:()=>u(!o),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:v=>{v.currentTarget.style.color="var(--text-primary)"},onMouseLeave:v=>{v.currentTarget.style.color="var(--text-tertiary)"},children:[a.jsxs("span",{className:"flex items-center gap-2",children:[c&&a.jsx("div",{className:"spinner",style:{width:10,height:10}}),"Progress Log (",r.length,")"]}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{transform:o?"rotate(0)":"rotate(180deg)",transition:"transform 0.2s ease"},children:a.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!o&&a.jsx("div",{ref:x,className:"px-3 pb-3 space-y-1 max-h-48 overflow-y-auto",children:r.map((v,p)=>{const b=p===r.length-1&&c,y=p===0?"0s":`+${((v.timestamp-r[0].timestamp)/1e3).toFixed(1)}s`;return a.jsxs("div",{className:"flex items-center gap-2 text-[11px] animate-fade-in",style:{opacity:b?1:.7},children:[lv(v.phase,b),a.jsx("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)",width:40},children:y}),a.jsx("span",{style:{color:b?"var(--text-primary)":"var(--text-secondary)"},children:v.message}),v.current!=null&&v.total!=null&&a.jsxs("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)"},children:["[",v.current,"/",v.total,"]"]})]},p)})})]})}const jx={rate_limit:{icon:"⏱",color:"var(--amber, #f59e0b)"},context_window:{icon:"⚠",color:"var(--amber, #f59e0b)"},auth:{icon:"🔒",color:"var(--red, #ef4444)"},timeout:{icon:"⌛",color:"var(--amber, #f59e0b)"},provider_unavailable:{icon:"⚡",color:"var(--red, #ef4444)"},parse_error:{icon:"❓",color:"var(--amber, #f59e0b)"},unknown:{icon:"❌",color:"var(--red, #ef4444)"}};function kr({error:r,onRetry:c,onDismiss:o}){const[u,x]=h.useState(null),v=h.useRef(null);h.useEffect(()=>(r.category==="rate_limit"&&r.retryAfterMs?x(Math.ceil(r.retryAfterMs/1e3)):x(null),()=>{v.current&&clearInterval(v.current)}),[r]),h.useEffect(()=>{if(!(u==null||u<=0))return v.current=setInterval(()=>{x(y=>y==null||y<=1?(v.current&&clearInterval(v.current),0):y-1)},1e3),()=>{v.current&&clearInterval(v.current)}},[u!=null&&u>0]);const p=jx[r.category]||jx.unknown,b=u!=null&&u>0;return a.jsxs("div",{className:"rounded-lg overflow-hidden animate-fade-in",style:{border:`1px solid color-mix(in srgb, ${p.color} 30%, transparent)`,background:`color-mix(in srgb, ${p.color} 6%, var(--surface-1))`},children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{style:{fontSize:14},children:p.icon}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:p.color},children:r.title})]}),o&&a.jsx("button",{onClick:o,className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)"},children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsxs("div",{className:"px-3.5 pb-3",children:[a.jsx("p",{className:"text-[11.5px] mb-1.5",style:{color:"var(--text-secondary)"},children:r.description}),a.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:r.hint}),(c||u!=null)&&a.jsx("div",{className:"flex items-center gap-2 mt-2.5",children:c&&a.jsx("button",{onClick:c,disabled:b,className:"btn btn-secondary text-[11px]",style:{padding:"4px 10px",opacity:b?.5:1},children:b?`Retry in ${u}s`:"Retry"})})]})]})}function av({plugin:r,skill:c,skillContent:o,onApplied:u}){const[x,v]=h.useState("closed"),{config:p}=Na(),[b,y]=h.useState("claude-cli"),[f,j]=h.useState("opus"),[g,k]=h.useState([]),[w,L]=h.useState(""),[B,Y]=h.useState(""),[G,F]=h.useState(null),[le,Q]=h.useState(null),[ne,se]=h.useState([]),[U,$]=h.useState(!1),W=h.useRef(null);h.useEffect(()=>{if(!p)return;p.providers.find(_=>_.id==="claude-cli"&&_.available)&&(y("claude-cli"),j("opus"))},[p]),h.useEffect(()=>()=>{var T;(T=W.current)==null||T.abort()},[]);function he(){return p==null?void 0:p.providers.find(T=>T.id===b&&T.available)}const ve=h.useCallback(()=>{var T;(T=W.current)==null||T.abort(),v("open")},[]);async function ye(){v("loading"),F(null),Q(null),se([]);const T=new AbortController;W.current=T;try{const _=await fetch(`/api/skills/${encodeURIComponent(r)}/${encodeURIComponent(c)}/improve?sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,model:f}),signal:T.signal});if(!_.ok||!_.body){let z=`HTTP ${_.status}`;try{const I=await _.json();I.error&&(z=I.error)}catch{}throw new Error(z)}const ee=_.body.getReader(),O=new TextDecoder;let Z="",S="";for(;;){const{done:z,value:I}=await ee.read();if(z)break;Z+=O.decode(I,{stream:!0});const P=Z.split(`
60
+ `);Z=P.pop()||"";for(const ue of P)if(ue.startsWith("event: "))S=ue.slice(7).trim();else if(ue.startsWith("data: ")){try{const ae=JSON.parse(ue.slice(6));S==="progress"?se(be=>[...be,{phase:ae.phase,message:ae.message,timestamp:Date.now()}]):S==="done"||S==="complete"?(L(ae.improved),Y(ae.reasoning||""),k(Er(ae.original||o,ae.improved)),v("diff_shown")):S==="error"&&(F(ae.message||ae.description||"Unknown error"),ae.category&&Q(ae),v("open"))}catch{}S=""}}}catch(_){_.name!=="AbortError"&&(F(_.message),v("open"))}finally{W.current=null}}async function J(){$(!0);try{await Se.applyImprovement(r,c,w),u(w),v("closed")}catch(T){F(T.message)}finally{$(!1)}}function te(){v("closed"),k([]),L(""),Y(""),F(null)}if(x==="closed")return a.jsxs("button",{onClick:()=>v("open"),className:"btn btn-secondary mb-5",disabled:!o,children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),a.jsx("path",{d:"M2 17l10 5 10-5"}),a.jsx("path",{d:"M2 12l10 5 10-5"})]}),"Improve Skill"]});const me=he();return a.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden animate-fade-in",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[a.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),a.jsx("path",{d:"M2 17l10 5 10-5"}),a.jsx("path",{d:"M2 12l10 5 10-5"})]})}),a.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Skill Improvement"})]}),a.jsx("button",{onClick:te,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:T=>{T.currentTarget.style.background="var(--surface-3)"},onMouseLeave:T=>{T.currentTarget.style.background="transparent"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsxs("div",{className:"px-5 py-4",children:[(x==="open"||x==="loading")&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-end gap-3 mb-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),a.jsx("select",{className:"input-field text-[12px] py-1.5",value:b,onChange:T=>{y(T.target.value);const _=p==null?void 0:p.providers.find(ee=>ee.id===T.target.value);_!=null&&_.models[0]&&j(_.models[0].id)},disabled:x==="loading",children:p==null?void 0:p.providers.filter(T=>T.available).map(T=>a.jsx("option",{value:T.id,children:T.label},T.id))})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),a.jsx("select",{className:"input-field text-[12px] py-1.5",value:f,onChange:T=>j(T.target.value),disabled:x==="loading",children:me==null?void 0:me.models.map(T=>a.jsx("option",{value:T.id,children:T.label},T.id))})]}),x==="loading"?a.jsx("button",{onClick:ve,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):a.jsx("button",{onClick:ye,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),x==="loading"&&ne.length>0&&a.jsx("div",{className:"mt-3",children:a.jsx(ss,{entries:ne,isRunning:!0})})]}),G&&a.jsx("div",{className:"mb-4",children:le?a.jsx(kr,{error:le,onRetry:ye,onDismiss:()=>{F(null),Q(null)}}):a.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:G})}),x==="diff_shown"&&a.jsxs(a.Fragment,{children:[B&&a.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg text-[12px]",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:[a.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),B]}),a.jsx("div",{className:"rounded-lg overflow-hidden mb-4",style:{border:"1px solid var(--border-subtle)",maxHeight:"400px",overflowY:"auto"},children:g.map((T,_)=>a.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:T.type==="added"?"rgba(34,197,94,0.1)":T.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:T.type==="added"?"var(--green)":T.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:T.type==="added"?"3px solid var(--green)":T.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[a.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:T.type==="added"?"+":T.type==="removed"?"-":" "}),T.content]},_))}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:J,disabled:U,className:"btn btn-primary",children:U?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"spinner",style:{width:12,height:12}})," Applying..."]}):a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})})," Apply"]})}),a.jsx("button",{onClick:te,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const Sx={remove:{bg:"var(--red-muted)",color:"var(--red)",label:"REMOVE"},modify:{bg:"rgba(251,191,36,0.15)",color:"#fbbf24",label:"MODIFY"},add:{bg:"var(--green-muted)",color:"var(--green)",label:"ADD"}},nv={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function sv({change:r,index:c,selected:o,onToggle:u,originalEval:x}){var g;const[v,p]=h.useState(!1),b=Sx[r.action]??Sx.add,y=nv[r.action]??"var(--border-subtle)",f=r.action==="remove"?(x==null?void 0:x.name)??`Eval #${r.evalId}`:((g=r.eval)==null?void 0:g.name)??"Unnamed",j=h.useCallback(()=>u(c),[u,c]);return a.jsxs("div",{className:"rounded-lg transition-all duration-150",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderLeft:`3px solid ${y}`,opacity:o?1:.5},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[a.jsx("input",{type:"checkbox",checked:o,onChange:j,className:"flex-shrink-0",style:{accentColor:"var(--accent)"}}),a.jsx("span",{className:"pill text-[9px] font-bold flex-shrink-0",style:{background:b.bg,color:b.color,padding:"1px 6px"},children:b.label}),a.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:"var(--text-primary)"},children:f}),a.jsx("span",{className:"text-[11px] truncate flex-1",style:{color:"var(--text-tertiary)"},children:r.reason}),a.jsx("button",{onClick:()=>p(!v),className:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:k=>{k.currentTarget.style.background="var(--surface-3)"},onMouseLeave:k=>{k.currentTarget.style.background="transparent"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:v?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s ease"},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),v&&a.jsxs("div",{className:"px-4 pb-3 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[r.action==="add"&&r.eval&&a.jsx(rv,{evalCase:r.eval}),r.action==="modify"&&r.eval&&x&&a.jsx(iv,{original:x,proposed:r.eval}),r.action==="remove"&&x&&a.jsx(ov,{evalCase:x})]})]})}function rv({evalCase:r}){var c;return a.jsxs("div",{className:"pt-2.5 space-y-2",children:[a.jsx(lc,{label:"Prompt",value:r.prompt}),a.jsx(lc,{label:"Expected",value:r.expected_output}),a.jsxs("div",{children:[a.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((c=r.assertions)==null?void 0:c.length)??0,")"]}),a.jsx("div",{className:"mt-1 space-y-1",children:(r.assertions??[]).map(o=>a.jsxs("div",{className:"text-[11px] flex items-start gap-1.5",style:{color:"var(--text-secondary)"},children:[a.jsx("span",{style:{color:"var(--green)"},children:"+"})," ",o.text]},o.id))})]})]})}function iv({original:r,proposed:c}){const o=[];r.name!==c.name&&o.push({label:"Name",old:r.name,new:c.name}),r.prompt!==c.prompt&&o.push({label:"Prompt",old:r.prompt,new:c.prompt}),r.expected_output!==c.expected_output&&o.push({label:"Expected",old:r.expected_output,new:c.expected_output});const u=r.assertions??[],x=c.assertions??[],v=new Set(u.map(f=>f.text)),p=new Set(x.map(f=>f.text)),b=x.filter(f=>!v.has(f.text)),y=u.filter(f=>!p.has(f.text));return a.jsxs("div",{className:"pt-2.5 space-y-2",children:[o.map(f=>a.jsxs("div",{children:[a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:f.label}),a.jsxs("div",{className:"mt-1 text-[11px] font-mono rounded p-2",style:{background:"var(--surface-1)"},children:[a.jsxs("div",{style:{color:"var(--red)",textDecoration:"line-through"},children:["- ",ac(f.old,120)]}),a.jsxs("div",{style:{color:"var(--green)"},children:["+ ",ac(f.new,120)]})]})]},f.label)),(b.length>0||y.length>0)&&a.jsxs("div",{children:[a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Assertions"}),a.jsxs("div",{className:"mt-1 space-y-0.5",children:[y.map(f=>a.jsxs("div",{className:"text-[11px]",style:{color:"var(--red)"},children:["- ",f.text]},f.id)),b.map(f=>a.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",f.text]},f.id))]})]}),o.length===0&&b.length===0&&y.length===0&&a.jsx("div",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"No visible field changes"})]})}function ov({evalCase:r}){var c;return a.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[a.jsx(lc,{label:"Prompt",value:r.prompt}),a.jsxs("div",{children:[a.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((c=r.assertions)==null?void 0:c.length)??0,")"]}),a.jsx("div",{className:"mt-1 space-y-0.5",children:(r.assertions??[]).map(o=>a.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:o.text},o.id))})]})]})}function lc({label:r,value:c}){return a.jsxs("div",{children:[a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:r}),a.jsx("div",{className:"mt-0.5 text-[11px] p-2 rounded font-mono",style:{background:"var(--surface-1)",color:"var(--text-secondary)",whiteSpace:"pre-wrap"},children:ac(c,300)})]})}function ac(r,c){return r.length>c?r.slice(0,c)+"...":r}const Nx={remove:0,modify:1,add:2};function cv({changes:r,selections:c,currentEvals:o,onToggle:u,onSelectAll:x,onDeselectAll:v}){if(r.length===0)return null;const p=r.map((y,f)=>({change:y,originalIndex:f}));p.sort((y,f)=>(Nx[y.change.action]??2)-(Nx[f.change.action]??2));const b=Array.from(c.values()).filter(Boolean).length;return a.jsxs("div",{className:"mt-3 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Test Case Changes"}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",b,"/",r.length," selected)"]})]}),a.jsxs("div",{className:"flex gap-1.5",children:[a.jsx("button",{onClick:x,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--accent)",background:"transparent"},onMouseEnter:y=>{y.currentTarget.style.background="var(--accent-muted)"},onMouseLeave:y=>{y.currentTarget.style.background="transparent"},children:"Select All"}),a.jsx("button",{onClick:v,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},onMouseEnter:y=>{y.currentTarget.style.background="var(--surface-3)"},onMouseLeave:y=>{y.currentTarget.style.background="transparent"},children:"Deselect All"})]})]}),a.jsx("div",{className:"space-y-1.5 overflow-auto",style:{maxHeight:240},children:p.map(({change:y,originalIndex:f})=>a.jsx(sv,{change:y,index:f,selected:c.get(f)??!1,onToggle:u,originalEval:y.evalId!=null?o.find(j=>j.id===y.evalId):void 0},f))})]})}function uv(){var T;const{state:r,dispatch:c,submitAiEdit:o,applyAiEdit:u,discardAiEdit:x,cancelAiEdit:v,toggleEvalChange:p,selectAllEvalChanges:b,deselectAllEvalChanges:y,retryEvalsSave:f}=il(),{aiEditLoading:j,aiEditResult:g,aiEditError:k,aiEditClassifiedError:w,aiEditProgress:L,aiEditEvalChanges:B,aiEditEvalSelections:Y,aiEditEvalsRetry:G}=r,[F,le]=h.useState(""),{config:Q}=Na(),[ne,se]=h.useState("claude-cli"),[U,$]=h.useState("opus"),W=h.useRef(null);h.useEffect(()=>{var _;(_=W.current)==null||_.focus()},[]),h.useEffect(()=>{if(!Q)return;Q.providers.find(ee=>ee.id==="claude-cli"&&ee.available)&&(se("claude-cli"),$("opus"))},[Q]);const he=Q==null?void 0:Q.providers.find(_=>_.id===ne&&_.available),ve=h.useCallback(()=>{const _=F.trim();!_||j||o(_,ne,U)},[F,j,o,ne,U]),ye=h.useCallback(_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),ve()),_.key==="Escape"&&(_.preventDefault(),j?v():x())},[ve,j,v,x]),J=h.useCallback(()=>{c({type:"CLOSE_AI_EDIT"}),c({type:"OPEN_AI_EDIT"})},[c]),te=g?Er(r.skillContent,g.improved):[],me=((T=r.evals)==null?void 0:T.evals)??[];return a.jsxs("div",{className:"animate-fade-in",style:{background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-2)"},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M15 4V2"}),a.jsx("path",{d:"M15 16v-2"}),a.jsx("path",{d:"M8 9h2"}),a.jsx("path",{d:"M20 9h2"}),a.jsx("path",{d:"M17.8 11.8L19 13"}),a.jsx("path",{d:"M15 9h.01"}),a.jsx("path",{d:"M17.8 6.2L19 5"}),a.jsx("path",{d:"M11 6.2L9.7 5"}),a.jsx("path",{d:"M3 21l9-9"})]})}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Edit"}),a.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:"Describe what to change — Enter to submit, Esc to dismiss"})]}),a.jsx("button",{onClick:x,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:_=>{_.currentTarget.style.background="var(--surface-3)"},onMouseLeave:_=>{_.currentTarget.style.background="transparent"},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsxs("div",{className:"px-4 py-3",children:[!g&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-end gap-2.5",children:[a.jsx("div",{className:"flex-1",children:a.jsx("textarea",{ref:W,value:F,onChange:_=>le(_.target.value),onKeyDown:ye,placeholder:"e.g., Add an error handling section...",disabled:j,rows:1,className:"w-full resize-none outline-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",borderRadius:6,padding:"8px 12px",fontSize:12.5,lineHeight:1.5,fontFamily:"var(--font-mono, 'JetBrains Mono', ui-monospace, monospace)",minHeight:36,maxHeight:96},onInput:_=>{const ee=_.currentTarget;ee.style.height="auto",ee.style.height=Math.min(ee.scrollHeight,96)+"px"}})}),a.jsxs("div",{style:{minWidth:100},children:[a.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),a.jsx("select",{className:"input-field text-[11px] py-1",value:ne,onChange:_=>{se(_.target.value);const ee=Q==null?void 0:Q.providers.find(O=>O.id===_.target.value);ee!=null&&ee.models[0]&&$(ee.models[0].id)},disabled:j,style:{width:"100%"},children:Q==null?void 0:Q.providers.filter(_=>_.available).map(_=>a.jsx("option",{value:_.id,children:_.label},_.id))})]}),a.jsxs("div",{style:{minWidth:80},children:[a.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Model"}),a.jsx("select",{className:"input-field text-[11px] py-1",value:U,onChange:_=>$(_.target.value),disabled:j,style:{width:"100%"},children:he==null?void 0:he.models.map(_=>a.jsx("option",{value:_.id,children:_.label},_.id))})]}),j?a.jsx("button",{onClick:v,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):a.jsx("button",{onClick:ve,disabled:!F.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),j&&L.length>0&&a.jsx("div",{className:"mt-2.5",children:a.jsx(ss,{entries:L,isRunning:!0})})]}),k&&a.jsx("div",{className:"mt-3",children:w?a.jsx(kr,{error:w,onRetry:J,onDismiss:x}):a.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:k})}),g&&a.jsxs("div",{className:"animate-fade-in",children:[g.reasoning&&a.jsxs("div",{className:"mb-3 px-3 py-2.5 rounded-lg text-[11.5px]",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:[a.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),g.reasoning]}),a.jsx("div",{className:"mb-1",children:a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"})}),a.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:300,overflowY:"auto"},children:te.map((_,ee)=>a.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:_.type==="added"?"rgba(34,197,94,0.1)":_.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:_.type==="added"?"var(--green)":_.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:_.type==="added"?"3px solid var(--green)":_.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[a.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:_.type==="added"?"+":_.type==="removed"?"-":" "}),_.content]},ee))}),a.jsx(cv,{changes:B,selections:Y,currentEvals:me,onToggle:p,onSelectAll:b,onDeselectAll:y}),G&&a.jsxs("div",{className:"mt-3 px-3 py-2.5 rounded-lg text-[12px] flex items-center justify-between",style:{background:"rgba(251,191,36,0.12)",border:"1px solid rgba(251,191,36,0.3)",color:"#fbbf24"},children:[a.jsx("span",{children:"Test case save failed. SKILL.md was saved successfully."}),a.jsx("button",{onClick:f,className:"btn text-[11px]",style:{background:"rgba(251,191,36,0.2)",color:"#fbbf24",padding:"3px 10px"},children:"Retry Save"})]}),a.jsxs("div",{className:"flex gap-2 mt-3",children:[a.jsxs("button",{onClick:u,className:"btn btn-primary text-[11px]",style:{padding:"5px 12px"},children:[a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),a.jsx("button",{onClick:x,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),a.jsx("button",{onClick:J,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function dv(r,c){const[o,u]=h.useState([]),[x,v]=h.useState("SKILL.md"),[p,b]=h.useState(null),[y,f]=h.useState(!1),[j,g]=h.useState(null),k=h.useCallback(async()=>{try{const B=await Se.getSkillFiles(r,c);u(B.files)}catch{u([])}},[r,c]);h.useEffect(()=>{v("SKILL.md"),b(null),g(null),k()},[r,c,k]);const w=h.useCallback(async B=>{if(v(B),B==="SKILL.md"){b(null),g(null);return}f(!0),g(null);try{const Y=await Se.getSkillFile(r,c,B);b(Y)}catch(Y){g(`Unable to open file: ${Y.message}`),b(null)}finally{f(!1)}},[r,c]),L=h.useCallback(()=>{k()},[k]);return{files:o,activeFile:x,secondaryContent:p,loading:y,error:j,selectFile:w,refresh:L,isSkillMd:x==="SKILL.md"}}function fv(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}function xv(r){const c=[],o=new Map;for(const u of r){const x=u.path.split("/"),p={name:x[x.length-1],path:u.path,type:u.type,size:u.size,children:[]};o.set(u.path,p)}for(const u of r){const x=u.path.split("/");if(x.length===1){const v=o.get(u.path);v&&c.push(v)}else{const v=x.slice(0,-1).join("/"),p=o.get(v),b=o.get(u.path);p&&b&&p.children.push(b)}}return c}function Gx({expanded:r}){return a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:r?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})})}function Yx(){return a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function pv(){return a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function mv(){return a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"23 4 23 10 17 10"}),a.jsx("polyline",{points:"1 20 1 14 7 14"}),a.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}function Vx({node:r,depth:c,activeFile:o,onSelect:u}){const[x,v]=h.useState(!0),p=r.path===o;return r.type==="dir"?a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>v(!x),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+c*14}px`,paddingTop:2,paddingBottom:2,background:"none",border:"none",cursor:"pointer",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono, monospace)",textAlign:"left"},children:[a.jsx(Gx,{expanded:x}),a.jsx(Yx,{}),a.jsxs("span",{children:[r.name,"/"]})]}),x&&r.children.map(b=>a.jsx(Vx,{node:b,depth:c+1,activeFile:o,onSelect:u},b.path))]}):a.jsxs("button",{onClick:()=>u(r.path),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+c*14}px`,paddingTop:2,paddingBottom:2,background:p?"var(--accent-muted)":"none",border:"none",cursor:"pointer",color:p?"var(--accent)":"var(--text-tertiary)",fontSize:11,fontFamily:"var(--font-mono, monospace)",textAlign:"left",borderRadius:3},children:[a.jsx("span",{style:{width:10}}),a.jsx(pv,{}),a.jsx("span",{style:{flex:1},children:r.name}),a.jsx("span",{style:{fontSize:9,color:"var(--text-tertiary)",marginRight:4,whiteSpace:"nowrap"},children:fv(r.size)})]})}function hv({files:r,activeFile:c,onSelect:o,onRefresh:u}){const[x,v]=h.useState(!1),p=h.useMemo(()=>xv(r),[r]);return a.jsxs("div",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"3px 8px",cursor:"pointer",userSelect:"none"},onClick:()=>v(!x),children:[a.jsx(Gx,{expanded:x}),a.jsx(Yx,{}),a.jsx("span",{style:{fontSize:11,fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c}),a.jsx("button",{onClick:b=>{b.stopPropagation(),u()},style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:"2px 4px",display:"flex",alignItems:"center",borderRadius:3},title:"Refresh file list",children:a.jsx(mv,{})})]}),x&&a.jsx("div",{style:{maxHeight:240,overflowY:"auto",padding:"2px 4px 4px"},children:p.length===0?a.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",padding:"4px 8px"},children:"No files found"}):p.map(b=>a.jsx(Vx,{node:b,depth:0,activeFile:c,onSelect:o},b.path))})]})}function yr(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}function vv(r){try{return JSON.stringify(JSON.parse(r),null,2)}catch{return r}}function yv(r){const c=r.toLowerCase();return c.endsWith(".json")?"json":c.endsWith(".md")?"md":"other"}function Ex({content:r}){return a.jsx("textarea",{readOnly:!0,value:r,style:{flex:1,width:"100%",resize:"none",background:"var(--surface-1)",color:"var(--text-primary)",border:"none",outline:"none",padding:"12px 16px",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6}})}function kx({content:r,fileType:c}){if(c==="json"){const o=vv(r);return a.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:o})}return c==="md"?a.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px 20px",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:13,lineHeight:1.6},dangerouslySetInnerHTML:{__html:Nr(r)}}):a.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:r})}function Tx(r){try{return JSON.stringify(JSON.parse(r),null,2).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"([^"\\]|\\.)*"\s*:/g,o=>`<span style="color:#6383ff">${o}</span>`).replace(/:\s*"([^"\\]|\\.)*"/g,o=>`<span style="color:#22c55e">${o.slice(0,2)}<span style="color:#22c55e">${o.slice(2)}</span></span>`).replace(/:\s*(-?\d+\.?\d*)/g,(o,u)=>`: <span style="color:#fb923c">${u}</span>`).replace(/:\s*(true|false|null)/g,(o,u)=>`: <span style="color:#a855f7">${u}</span>`)}catch{return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}}function gv({file:r,loading:c,error:o,viewMode:u,plugin:x,skill:v,onSaved:p,onDirtyChange:b}){const[y,f]=h.useState(u),[j,g]=h.useState(!1),[k,w]=h.useState(""),[L,B]=h.useState(!1),[Y,G]=h.useState(null),F=u!==y?u:y;h.useEffect(()=>{b==null||b(j)},[j,b]);const le=h.useCallback(()=>{(r==null?void 0:r.content)!=null&&(w(r.content),g(!0))},[r]),Q=h.useCallback(()=>{g(!1)},[]),ne=h.useCallback(async()=>{if(!(!x||!v||!r)){B(!0);try{await Se.saveSkillFile(x,v,r.path,k),G("Saved"),g(!1),p==null||p(),setTimeout(()=>G(null),2e3)}catch($){G(`Save failed: ${$.message}`),setTimeout(()=>G(null),3e3)}finally{B(!1)}}},[x,v,r,k,p]);if(h.useEffect(()=>{if(!j)return;const $=W=>{(W.ctrlKey||W.metaKey)&&W.key==="s"&&(W.preventDefault(),ne())};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[j,ne]),c)return a.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:"Loading…"});if(o)return a.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:a.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"16px 20px",maxWidth:400,textAlign:"center"},children:[a.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",fontWeight:600,marginBottom:6},children:"Unable to open file"}),a.jsx("div",{style:{fontSize:12,color:"var(--text-tertiary)"},children:o})]})});if(!r)return null;if(r.binary)return a.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:["Binary file (",yr(r.size),") — cannot be displayed"]});const se=r.content??"",U=yv(r.path);return a.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[r.truncated&&a.jsxs("div",{style:{padding:"4px 12px",background:"var(--warning-muted, #fef3c7)",borderBottom:"1px solid var(--border-subtle)",fontSize:11,color:"var(--warning-text, #92400e)"},children:["File truncated at ",yr(512*1024)," — ",yr(r.size)," total"]}),a.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[(U==="md"||U==="json")&&["raw","split","preview"].map($=>a.jsx("button",{onClick:()=>f($),style:{padding:"2px 8px",fontSize:11,background:F===$?"var(--accent-muted)":"none",color:F===$?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer",textTransform:"capitalize"},children:$},$)),a.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-tertiary)",display:"flex",alignItems:"center",gap:6},children:[yr(r.size),x&&v&&!r.binary&&!j&&a.jsx("button",{onClick:le,style:{padding:"1px 6px",fontSize:10,background:"var(--accent-muted)",color:"var(--accent)",border:"none",borderRadius:3,cursor:"pointer"},children:"Edit"}),j&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:ne,disabled:L,style:{padding:"1px 6px",fontSize:10,background:"var(--accent)",color:"#fff",border:"none",borderRadius:3,cursor:"pointer",opacity:L?.6:1},children:L?"Saving...":"Save"}),a.jsx("button",{onClick:Q,style:{padding:"1px 6px",fontSize:10,background:"var(--surface-3)",color:"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer"},children:"Cancel"})]})]})]}),Y&&a.jsx("div",{style:{padding:"4px 12px",background:Y.startsWith("Save failed")?"var(--red-muted)":"var(--green-muted)",borderBottom:"1px solid var(--border-subtle)",fontSize:11,color:Y.startsWith("Save failed")?"var(--red)":"var(--green)"},children:Y}),a.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:j?a.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:[a.jsx("textarea",{value:k,onChange:$=>w($.target.value),style:{flex:1,width:"100%",resize:"none",background:"var(--surface-0)",color:"var(--text-primary)",border:"none",outline:"none",padding:"12px 16px",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6}}),a.jsxs("div",{style:{position:"sticky",bottom:0,display:"flex",alignItems:"center",gap:8,padding:"6px 12px",background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)"},children:[a.jsx("span",{style:{flex:1,fontSize:11,color:"var(--text-tertiary)"},children:"Unsaved changes"}),a.jsx("button",{onClick:ne,disabled:L,style:{padding:"3px 12px",fontSize:11,background:"var(--accent)",color:"#fff",border:"none",borderRadius:4,cursor:"pointer",opacity:L?.6:1},children:L?"Saving...":"Save"}),a.jsx("button",{onClick:Q,style:{padding:"3px 12px",fontSize:11,background:"var(--surface-3)",color:"var(--text-tertiary)",border:"none",borderRadius:4,cursor:"pointer"},children:"Cancel"})]})]}):F==="split"&&U!=="other"?a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",borderRight:"1px solid var(--border-subtle)"},children:a.jsx(Ex,{content:se})}),a.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:U==="json"?a.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Tx(se)}}):a.jsx(kx,{content:se,fileType:U})})]}):F==="preview"&&U!=="other"?U==="json"?a.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Tx(se)}}):a.jsx(kx,{content:se,fileType:U}):a.jsx(Ex,{content:se})})]})}function bv({size:r=15}){return a.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"16 18 22 12 16 6"}),a.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function jv({size:r=15}){return a.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3"}),a.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"})]})}function Sv({size:r=15}){return a.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function Nv({size:r=15}){return a.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M15 4V2"}),a.jsx("path",{d:"M15 16v-2"}),a.jsx("path",{d:"M8 9h2"}),a.jsx("path",{d:"M20 9h2"}),a.jsx("path",{d:"M17.8 11.8L19 13"}),a.jsx("path",{d:"M15 9h.01"}),a.jsx("path",{d:"M17.8 6.2L19 5"}),a.jsx("path",{d:"M11 6.2L9.7 5"}),a.jsx("path",{d:"M3 21l9-9"})]})}function Ko({size:r=15}){return a.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M12 3l1.5 5.5L19 10l-5.5 1.5L12 17l-1.5-5.5L5 10l5.5-1.5L12 3z"})})}function Ev(){const{state:r,dispatch:c,saveContent:o,isReadOnly:u}=il(),{plugin:x,skill:v,skillContent:p,isDirty:b,improveTarget:y,aiEditOpen:f}=r,[j,g]=h.useState("split"),[k,w]=h.useState(!1),L=h.useRef(null),[B,Y]=h.useState(!1),[G,F]=h.useState(""),[le,Q]=h.useState(!1),[ne,se]=h.useState(null),[U,$]=h.useState([]),[W,he]=h.useState([]),[ve,ye]=h.useState(null),J=h.useRef(null),{config:te}=Na(),{files:me,activeFile:T,secondaryContent:_,loading:ee,error:O,selectFile:Z,refresh:S,isSkillMd:z}=dv(x??"",v??""),[I,P]=h.useState(!1),ue=h.useCallback(X=>{I&&!window.confirm("You have unsaved changes. Discard?")||Z(X)},[I,Z]);h.useEffect(()=>()=>{var X;(X=J.current)==null||X.abort()},[]);const{metadata:ae,body:be}=ev(p),Be=ae["allowed-tools"],Ae=Array.isArray(Be)?Be:typeof Be=="string"?[Be]:[],ut=ae.name,Lt=ae.description,K=ae.metadata,re=typeof K=="object"&&!Array.isArray(K)?K:null,ie=ae.version||(re==null?void 0:re.version),fe=ae.tags||(re==null?void 0:re.tags),pe=Array.isArray(fe)?fe:typeof fe=="string"?fe.split(",").map(X=>X.trim()).filter(Boolean):[],Ve=new Set(["name","description","metadata","allowed-tools","version","tags"]),dt=Object.entries(ae).filter(([X])=>!Ve.has(X)),Xe=h.useCallback(async()=>{w(!0),await o(),w(!1)},[o]),zt=h.useCallback(X=>{(X.ctrlKey||X.metaKey)&&X.key==="s"&&(X.preventDefault(),X.stopPropagation(),b&&Xe()),(X.ctrlKey||X.metaKey)&&X.key==="k"&&(X.preventDefault(),X.stopPropagation(),c({type:f?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[b,Xe,f,c]),mt=h.useCallback(async()=>{var Le,at;if(!G.trim())return;(Le=J.current)==null||Le.abort();const X=new AbortController;J.current=X,Q(!0),ye(null),he([]),se(null),$([]);try{const Je=(te==null?void 0:te.provider)||"claude-cli",Rl=(te==null?void 0:te.model)||"sonnet",Ot=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:G,provider:Je,model:Rl}),signal:X.signal});if(!Ot.ok||!Ot.body){let et=`HTTP ${Ot.status}`;try{const ll=await Ot.json();ll.error&&(et=ll.error)}catch{}throw new Error(et)}const sa=Ot.body.getReader(),Et=new TextDecoder;let Fe="",nt="";for(;;){const{done:et,value:ll}=await sa.read();if(et)break;Fe+=Et.decode(ll,{stream:!0});const Qe=Fe.split(`
61
+ `);Fe=Qe.pop()||"";for(const al of Qe)if(al.startsWith("event: "))nt=al.slice(7).trim();else if(al.startsWith("data: ")){try{const st=JSON.parse(al.slice(6));if(nt==="progress")he(Ge=>[...Ge,{phase:st.phase,message:st.message,timestamp:Date.now()}]);else if(nt==="done"||nt==="complete"){const Ge=["---"];st.name&&Ge.push(`name: ${st.name}`),st.description&&Ge.push(`description: "${st.description.replace(/"/g,'\\"')}"`),st.model&&Ge.push(`model: ${st.model}`),(at=st.allowedTools)!=null&&at.trim()&&Ge.push(`allowed-tools: ${st.allowedTools.trim()}`),Ge.push("---","",st.body||"");const _l=Ge.join(`
62
+ `);se(_l),$(Er(p,_l)),Q(!1)}else nt==="error"&&(ye(st.message||st.description||"Generation failed"),Q(!1))}catch{}nt=""}}}catch(Je){Je.name!=="AbortError"&&ye(Je.message)}finally{Q(!1),J.current=null}},[G,te,p]),tl=h.useCallback(()=>{ne&&c({type:"SET_CONTENT",content:ne}),Y(!1),se(null),$([]),F(""),he([])},[ne,c]),Qt=h.useCallback(()=>{Y(!1),se(null),$([]),F(""),he([]),ye(null)},[]),We=h.useCallback(()=>{var X;B?((X=J.current)==null||X.abort(),Qt()):(f&&c({type:"CLOSE_AI_EDIT"}),Y(!0))},[B,f,c,Qt]),Dt=[{mode:"raw",icon:a.jsx(bv,{}),label:"Editor"},{mode:"split",icon:a.jsx(jv,{}),label:"Split"},{mode:"preview",icon:a.jsx(Sv,{}),label:"Preview"}];return a.jsxs("div",{className:"flex flex-col h-full",onKeyDown:zt,tabIndex:-1,children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[a.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:Dt.map(({mode:X,icon:Le,label:at})=>a.jsxs("button",{onClick:()=>g(X),title:at,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:j===X?"var(--surface-4)":"transparent",color:j===X?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:j===X?600:400,border:"none",cursor:"pointer"},children:[Le,a.jsx("span",{style:{letterSpacing:"0.01em"},children:at})]},X))}),z?u?a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs("span",{className:"flex items-center gap-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Read-only"]})}):a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>{f?c({type:"CLOSE_AI_EDIT"}):(B&&Qt(),c({type:"OPEN_AI_EDIT"}))},title:"Edit with AI (Ctrl+K)",className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"4px 10px",fontSize:11,fontWeight:f?600:400,border:"none",cursor:"pointer",color:f?"#a855f7":"var(--text-tertiary)",background:f?"rgba(168,85,247,0.12)":"transparent"},children:[a.jsx(Nv,{size:13}),a.jsx("span",{children:"AI Edit"})]}),a.jsxs("button",{onClick:We,title:"Regenerate skill from prompt",className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"4px 10px",fontSize:11,fontWeight:B?600:400,border:"none",cursor:"pointer",color:B?"#a855f7":"var(--text-tertiary)",background:B?"rgba(168,85,247,0.12)":"transparent"},children:[a.jsx(Ko,{size:13}),a.jsx("span",{children:"Regenerate"})]}),a.jsx("div",{style:{width:1,height:16,background:"var(--border-subtle)"}}),b&&a.jsx("button",{onClick:()=>c({type:"SET_CONTENT",content:r.savedContent}),className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Discard"}),a.jsx("button",{onClick:Xe,disabled:!b||k,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:k?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]}):null]}),x&&v&&a.jsx(hv,{files:me,activeFile:T,onSelect:ue,onRefresh:S}),!z&&a.jsx(gv,{file:_,loading:ee,error:O,viewMode:j,plugin:x??void 0,skill:v??void 0,onSaved:()=>{Z(T),S()},onDirtyChange:P}),z&&a.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:j==="raw"||j==="preview"?"1fr":"1fr 1fr"},children:[j!=="preview"&&a.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:j==="split"?"1px solid var(--border-subtle)":"none"},children:a.jsx("textarea",{ref:L,value:p,onChange:X=>{u||c({type:"SET_CONTENT",content:X.target.value})},onKeyDown:zt,spellCheck:!1,readOnly:u,className:"flex-1 w-full resize-none outline-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono, 'JetBrains Mono', ui-monospace, monospace)",fontSize:12.5,lineHeight:1.7,tabSize:2,border:"none",padding:"16px 20px",opacity:u?.7:1}})}),j!=="raw"&&a.jsx("div",{className:"overflow-auto",style:{background:"var(--surface-0)"},children:a.jsxs("div",{className:"animate-fade-in",style:{padding:"20px 24px",maxWidth:720},children:[(ut||ie||Lt)&&a.jsxs("div",{style:{marginBottom:20},children:[a.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[ut&&a.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:ut}),ie&&a.jsxs("span",{style:{fontSize:10,fontWeight:600,color:"var(--accent)",background:"var(--accent-muted)",padding:"2px 7px",borderRadius:4,letterSpacing:"0.03em",fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:["v",ie]})]}),Lt&&a.jsx("p",{style:{fontSize:12.5,lineHeight:1.65,color:"var(--text-secondary)",margin:0,paddingLeft:12,borderLeft:"2px solid var(--accent)",maxWidth:600},children:Lt})]}),pe.length>0&&a.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:pe.map(X=>a.jsx("span",{style:{fontSize:10,fontWeight:500,color:"var(--text-tertiary)",background:"var(--surface-2)",padding:"3px 8px",borderRadius:4,letterSpacing:"0.02em"},children:X},X))}),Ae.length>0&&a.jsx("div",{style:{marginBottom:16},children:a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",marginRight:4},children:"Tools"}),Ae.map(X=>a.jsx("span",{style:{fontSize:10.5,fontFamily:"var(--font-mono, ui-monospace, monospace)",color:"var(--accent)",background:"var(--accent-muted)",padding:"2px 7px",borderRadius:4},children:X},X))]})}),dt.length>0&&a.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:dt.map(([X,Le],at)=>{const Je=Array.isArray(Le)?Le.join(", "):typeof Le=="object"?Object.entries(Le).map(([Rl,Ot])=>`${Rl}: ${Array.isArray(Ot)?Ot.join(", "):Ot}`).join(" | "):Le;return a.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:at>0?"1px solid var(--border-subtle)":"none"},children:[a.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",minWidth:80,flexShrink:0},children:X}),a.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:Je})]},X)})}),(ut||Lt||pe.length>0||Ae.length>0||dt.length>0)&&be&&a.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),be&&a.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Nr(be)}})]})})]}),z&&f&&a.jsx(uv,{}),z&&B&&a.jsx("div",{className:"animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:a.jsxs("div",{className:"px-4 py-3",children:[!ne&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ko,{size:14}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerate Skill"})]}),a.jsx("div",{className:"flex gap-2 mb-2",children:a.jsx("textarea",{value:G,onChange:X=>F(X.target.value),placeholder:"Describe what this skill should do...",rows:2,disabled:le,className:"flex-1 px-3 py-2 rounded-lg text-[12px] resize-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",outline:"none",opacity:le?.5:1},onKeyDown:X=>{X.key==="Enter"&&(X.ctrlKey||X.metaKey)&&G.trim()&&!le&&(X.preventDefault(),mt())}})}),a.jsxs("div",{className:"flex items-center gap-2",children:[le?a.jsx("button",{onClick:()=>{var X;(X=J.current)==null||X.abort(),Q(!1)},className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Cancel"}):a.jsx("button",{onClick:mt,disabled:!G.trim(),className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:"Generate"}),a.jsx("button",{onClick:Qt,className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Close"})]}),le&&W.length>0&&a.jsx("div",{className:"mt-2",children:a.jsx(ss,{entries:W,isRunning:!0})}),ve&&a.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:[ve,a.jsx("button",{onClick:mt,className:"ml-2 underline",style:{color:"var(--red)"},children:"Retry"})]})]}),ne&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Ko,{size:14}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerated — Review Changes"})]}),a.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:"300px",overflowY:"auto"},children:U.map((X,Le)=>a.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:X.type==="added"?"rgba(34,197,94,0.1)":X.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:X.type==="added"?"var(--green)":X.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:X.type==="added"?"3px solid var(--green)":X.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[a.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:X.type==="added"?"+":X.type==="removed"?"-":" "}),X.content]},Le))}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("button",{onClick:tl,className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),a.jsx("button",{onClick:Qt,className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Discard"})]})]})]})}),z&&y!==null&&x&&v&&a.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:a.jsx(av,{plugin:x,skill:v,skillContent:p,onApplied:X=>{c({type:"SET_CONTENT",content:X}),c({type:"CONTENT_SAVED"}),c({type:"CLOSE_IMPROVE"})}})})]})}function un(r){return r.testType==="integration"?"integration":"unit"}function dn(r){return r>=.8?"var(--green)":r>=.5?"var(--yellow)":"var(--red)"}function Qx(r){const c=new Date(r);return c.toLocaleDateString(void 0,{month:"short",day:"numeric"})+", "+c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function Xx(r){return r==null?"--":r>=1e3?`${(r/1e3).toFixed(1)}s`:`${r}ms`}const kv=new Set(["benchmark","comparison","baseline"]);function Cx(r,c,o,u){return r.map(({rate:x,idx:v,total:p})=>{const b=u+v/(p-1)*(c-u*2),y=u+(o-u*2)-x*(o-u*2);return`${b},${y}`})}function Kx({entries:r}){const c=r.filter(g=>kv.has(g.type)).slice().reverse(),o=c.map((g,k,w)=>({rate:g.pass_rate,idx:k,total:w.length})).filter((g,k)=>{const w=c[k].type;return w==="benchmark"||w==="comparison"}),u=c.flatMap((g,k)=>g.type==="baseline"?[{rate:g.pass_rate,idx:k,total:c.length}]:g.type==="comparison"&&g.baselinePassRate!=null?[{rate:g.baselinePassRate,idx:k,total:c.length}]:[]);if(o.length<2&&u.length<2)return null;const x=80,v=24,p=2,b=o.length>=2?Cx(o,x,v,p):[],y=u.length>=2?Cx(u,x,v,p):[],f=b[b.length-1],j=y[y.length-1];return a.jsxs("svg",{width:x,height:v,style:{display:"block",flexShrink:0},children:[y.length>0&&a.jsx("polyline",{points:y.join(" "),fill:"none",stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeLinejoin:"round",strokeDasharray:"3 2"}),b.length>0&&a.jsx("polyline",{points:b.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),j&&a.jsx("circle",{cx:parseFloat(j.split(",")[0]),cy:parseFloat(j.split(",")[1]),r:2.5,fill:"var(--text-tertiary)"}),f&&a.jsx("circle",{cx:parseFloat(f.split(",")[0]),cy:parseFloat(f.split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function Zx(r,c,o){const u=[],x=[],v=[];if((r==="PASS"||r==="EFFECTIVE")&&c>=.7){const y=u.length>0?` Met criteria: ${u.map(f=>f.criterion).join(", ")}.`:"";return{explanation:`${r} (score ${c.toFixed(2)}): evaluation met expectations.${y}`}}if((r==="FAIL"||r==="DEGRADING")&&c<.4){const y=x.length>0?` Failed criteria: ${x.map(j=>j.criterion).join(", ")}.`:"",f=[...x.map(j=>`Improve "${j.criterion}" (score: ${j.score.toFixed(2)})`),...v.map(j=>`Strengthen "${j.criterion}" (score: ${j.score.toFixed(2)})`)];return f.length===0&&f.push("Review prompt instructions and add more specific guidance"),{explanation:`${r} (score ${c.toFixed(2)}): evaluation did not meet expectations.${y}`,recommendations:f}}if(r==="INEFFECTIVE"&&c<.2){const y=[...x.map(f=>`Rework "${f.criterion}" — currently at ${f.score.toFixed(2)}`),"Consider adding examples to your system prompt","Review the rubric criteria for achievability"];return{explanation:`${r} (score ${c.toFixed(2)}): evaluation is significantly below expectations.`,recommendations:y}}const p=u.length>0?` Passing: ${u.map(y=>y.criterion).join(", ")}.`:"",b=v.length>0?` Needs improvement: ${v.map(y=>y.criterion).join(", ")}.`:"";return{explanation:`${r} (score ${c.toFixed(2)}): mixed results.${p}${b}`}}function Tv(r,c,o){const[u,x]=h.useState(null),[v,p]=h.useState(!1),b=h.useRef("");h.useEffect(()=>{const f=`${r}/${c}/${o}`;b.current!==f&&(b.current=f,p(!0),Se.getCaseHistory(r,c,o).then(j=>x(j)).catch(()=>x([])).finally(()=>p(!1)))},[r,c,o]);const y=h.useCallback(()=>{p(!0),b.current="",Se.getCaseHistory(r,c,o).then(f=>x(f)).catch(()=>x([])).finally(()=>p(!1))},[r,c,o]);return{entries:u,loading:v,refetch:y}}function Cv(r,c,o){const u={flaky:!1,nonDiscriminating:!1,regression:!1};if(!o||o.length===0)return u;const v=o.slice(0,10).map(y=>y.assertions.find(f=>f.id===r)).filter(Boolean);if(v.length>=2){const f=v.filter(j=>j.pass).length/v.length;f>=.3&&f<=.7&&(u.flaky=!0)}const p=o.find(y=>y.type==="benchmark"),b=o.find(y=>y.type==="baseline");if(p&&b){const y=p.assertions.find(j=>j.id===r),f=b.assertions.find(j=>j.id===r);y!=null&&y.pass&&(f!=null&&f.pass)&&(u.nonDiscriminating=!0)}if(c&&!c.pass&&o.length>=1){const f=o[0].assertions.find(j=>j.id===r);f!=null&&f.pass&&(u.regression=!0)}return u}function wv(){var ee;const{state:r,dispatch:c,saveEvals:o,runCase:u,runAll:x,cancelCase:v,cancelAll:p,generateEvals:b,isReadOnly:y}=il(),{evals:f,evalsError:j,selectedCaseId:g,inlineResults:k,caseRunStates:w,generateEvalsLoading:L,generateEvalsProgress:B,generateEvalsError:Y}=r,G=h.useMemo(()=>{for(const O of w.values())if(O.status==="running"||O.status==="queued")return!0;return!1},[w]),[F,le]=h.useState(!1),[Q,ne]=h.useState("all"),se={skill_name:r.skill,evals:[]},U=f??se,$=U.evals,W=Q==="all"?$:$.filter(O=>un(O)===Q),he=W.find(O=>O.id===g)??null,[ve,ye]=h.useState([]),J=h.useMemo(()=>$.some(O=>un(O)==="integration"),[$]);h.useEffect(()=>{J&&Se.getCredentials(r.plugin,r.skill).then(O=>ye(O.credentials)).catch(()=>ye([]))},[r.plugin,r.skill,J]);const te=h.useMemo(()=>new Set(ve.filter(O=>O.status==="missing").map(O=>O.name)),[ve]),[me,T]=h.useState(!1),_=h.useCallback(O=>{T(!1),b(O?{testType:O}:void 0)},[b]);return!f||$.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 px-8",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:j?"var(--error-muted, #3f1a1a)":"var(--accent-muted)"},children:j?a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--error, #f87171)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}):a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 11l3 3L22 4"}),a.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}),a.jsx("div",{className:"text-center",children:j?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--error, #f87171)"},children:"Invalid evals.json"}),a.jsx("div",{className:"text-[11px] font-mono px-3 py-2 rounded mt-1 max-w-sm text-left break-words",style:{color:"var(--text-secondary)",background:"var(--surface-2)"},children:j}),a.jsx("div",{className:"text-[12px] mt-2",style:{color:"var(--text-tertiary)"},children:"Fix the evals.json file and reload, or regenerate test cases with AI"})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No test cases yet"}),a.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Create test cases to start evaluating your skill"})]})}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:()=>le(!0),disabled:y,className:"btn btn-primary text-[12px]",children:"Create Test Case"}),a.jsxs("div",{style:{position:"relative"},children:[a.jsxs("div",{className:"flex",children:[a.jsx("button",{onClick:()=>_("unit"),disabled:L||y,className:"btn btn-secondary text-[12px]",style:{borderTopRightRadius:0,borderBottomRightRadius:0},children:L?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate Unit Tests"}),a.jsx("button",{onClick:()=>T(!me),disabled:L||y,className:"btn btn-secondary text-[12px]",style:{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeft:"1px solid var(--border-default)",padding:"4px 6px"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:a.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),me&&a.jsx("div",{className:"absolute right-0 mt-1 rounded-lg py-1 z-50",style:{background:"var(--surface-1)",border:"1px solid var(--border-default)",minWidth:180,boxShadow:"0 4px 12px rgba(0,0,0,0.3)"},children:a.jsx("button",{onClick:()=>_("integration"),className:"w-full text-left px-3 py-2 text-[12px] transition-colors duration-100",style:{color:"var(--text-secondary)",background:"transparent"},onMouseEnter:O=>{O.currentTarget.style.background="var(--surface-2)"},onMouseLeave:O=>{O.currentTarget.style.background="transparent"},children:"Generate Integration Tests"})})]})]}),L&&B.length>0&&a.jsx("div",{className:"w-full max-w-md mt-3",children:a.jsx(ss,{entries:B,isRunning:!0})}),Y&&a.jsx("div",{className:"w-full max-w-md mt-3",children:a.jsx(kr,{error:Y,onRetry:_})}),F&&a.jsx(wx,{evals:U,onSave:O=>{o(O),le(!1)},onCancel:()=>le(!1)})]}):a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"280px 1fr",height:"100%",overflow:"hidden"},children:[a.jsxs("div",{className:"overflow-auto",style:{borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center justify-between",style:{borderBottom:"1px solid var(--border-subtle)"},children:[a.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Test Cases (",W.length,")"]}),a.jsx("div",{className:"flex items-center gap-1.5",children:G?a.jsx("button",{onClick:p,className:"btn text-[10px] px-2 py-0.5",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:"Cancel All"}):a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>x("benchmark"),disabled:W.length===0||y,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),a.jsx("button",{onClick:()=>x("comparison"),disabled:W.length===0||y,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),a.jsx("div",{className:"flex px-3 py-1.5 gap-1",style:{borderBottom:"1px solid var(--border-subtle)"},children:["all","unit","integration"].map(O=>a.jsx("button",{onClick:()=>ne(O),style:{padding:"2px 8px",fontSize:10,fontWeight:Q===O?600:400,background:Q===O?"var(--accent-muted)":"transparent",color:Q===O?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:4,cursor:"pointer",textTransform:"capitalize"},children:O==="all"?`All (${$.length})`:O==="unit"?`Unit (${$.filter(Z=>un(Z)==="unit").length})`:`Integration (${$.filter(Z=>un(Z)==="integration").length})`},O))}),a.jsxs("div",{className:"py-1",children:[W.length===0&&$.length>0&&a.jsxs("div",{className:"flex items-center justify-center py-8 px-3 text-[12px]",style:{color:"var(--text-tertiary)"},children:["No ",Q==="all"?"":Q+" ","tests yet"]}),W.map(O=>{var I;const Z=k.get(O.id),S=g===O.id,z=un(O);return a.jsxs("button",{onClick:()=>c({type:"SELECT_CASE",caseId:O.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:S?"var(--accent-muted)":"transparent",borderLeft:S?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:P=>{S||(P.currentTarget.style.background="var(--surface-2)")},onMouseLeave:P=>{S||(P.currentTarget.style.background="transparent")},children:[a.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[a.jsxs("span",{className:"text-[12px] font-medium truncate flex items-center gap-1.5",style:{color:S?"var(--text-primary)":"var(--text-secondary)"},children:["#",O.id," ",O.name,a.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:9999,background:z==="unit"?"rgba(99,131,255,0.15)":"rgba(251,146,60,0.15)",color:z==="unit"?"#6383ff":"#fb923c",whiteSpace:"nowrap"},children:z==="unit"?"U":"I"}),z==="integration"&&((I=O.requiredCredentials)==null?void 0:I.some(P=>te.has(P)))&&a.jsx("span",{title:"Configure credentials to run",children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#fb923c",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})})]}),a.jsx($x,{result:Z})]}),a.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[O.assertions.length," assertion",O.assertions.length!==1?"s":"",(Z==null?void 0:Z.passRate)!=null&&a.jsx(_v,{passRate:Z.passRate})]})]},O.id)})]}),a.jsx("div",{className:"px-3 py-2",children:!y&&a.jsx("button",{onClick:()=>le(!0),className:"w-full py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{border:"1px dashed var(--border-default)",color:"var(--text-tertiary)",background:"transparent"},onMouseEnter:O=>{O.currentTarget.style.borderColor="var(--accent)",O.currentTarget.style.color="var(--accent)"},onMouseLeave:O=>{O.currentTarget.style.borderColor="var(--border-default)",O.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),a.jsx("div",{className:"overflow-auto",children:he?a.jsx(Av,{evalCase:he,result:k.get(he.id),evals:f,caseStatus:((ee=w.get(he.id))==null?void 0:ee.status)??"idle",onSaveEvals:o,onRun:O=>u(O,"benchmark"),onCompare:O=>u(O,"comparison"),onCancel:O=>v(O),onImprove:O=>c({type:"OPEN_IMPROVE",evalId:O})}):a.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),F&&a.jsx(wx,{evals:U,onSave:O=>{o(O),le(!1)},onCancel:()=>le(!1)})]})}function Av({evalCase:r,result:c,evals:o,caseStatus:u,onSaveEvals:x,onRun:v,onCompare:p,onCancel:b,onImprove:y}){const{state:f,isReadOnly:j}=il(),{plugin:g,skill:k}=f,{entries:w,loading:L}=Tv(g,k,r.id),[B,Y]=h.useState(!1),[G,F]=h.useState(r.prompt),[le,Q]=h.useState(!1),[ne,se]=h.useState(r.expected_output);h.useState(()=>{F(r.prompt),se(r.expected_output)});const U=h.useCallback(O=>{x({...o,evals:o.evals.map(Z=>Z.id===O.id?O:Z)})},[o,x]),$=h.useCallback(()=>{U({...r,prompt:G}),Y(!1)},[r,G,U]),W=h.useCallback(()=>{U({...r,expected_output:ne}),Q(!1)},[r,ne,U]),he=h.useCallback(()=>{U({...r,assertions:[...r.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[r,U]),ve=h.useCallback((O,Z)=>{U({...r,assertions:r.assertions.map(S=>S.id===O?{...S,text:Z}:S)})},[r,U]),ye=h.useCallback(O=>{U({...r,assertions:r.assertions.filter(Z=>Z.id!==O)})},[r,U]),J=h.useCallback(()=>{confirm("Delete this test case?")&&x({...o,evals:o.evals.filter(O=>O.id!==r.id)})},[o,r.id,x]),te=c&&c.assertions.length>0&&c.assertions.every(O=>O.pass),me=c&&c.assertions.some(O=>!O.pass),T=un(r),_=r.requiredCredentials??[],ee=T==="integration"&&_.length>0;return a.jsxs("div",{className:"p-5 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"text-[16px] font-semibold",style:{color:"var(--text-primary)"},children:["#",r.id," ",r.name]}),j?a.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 7px",borderRadius:9999,background:T==="unit"?"rgba(99,131,255,0.15)":"rgba(251,146,60,0.15)",color:T==="unit"?"#6383ff":"#fb923c"},children:T==="unit"?"Unit":"Integration"}):a.jsx("button",{onClick:()=>{if((T==="unit"?"integration":"unit")==="unit"){const{requiredCredentials:Z,requirements:S,cleanup:z,...I}=r;U({...I,testType:"unit"})}else U({...r,testType:"integration"})},title:`Click to switch to ${T==="unit"?"integration":"unit"}`,style:{fontSize:10,fontWeight:600,padding:"2px 7px",borderRadius:9999,background:T==="unit"?"rgba(99,131,255,0.15)":"rgba(251,146,60,0.15)",color:T==="unit"?"#6383ff":"#fb923c",border:"none",cursor:"pointer"},children:T==="unit"?"Unit":"Integration"}),a.jsx($x,{result:c})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"||u==="queued"?a.jsxs("button",{onClick:()=>b(r.id),className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel"]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>v(r.id),disabled:j,className:"btn btn-primary text-[12px]",children:"Run"}),a.jsx("button",{onClick:()=>p(r.id),disabled:j,className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),me&&!j&&u!=="running"&&u!=="queued"&&a.jsx("button",{onClick:()=>y(r.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),!j&&u!=="running"&&u!=="queued"&&a.jsx("button",{onClick:J,className:"btn btn-ghost text-[12px]",style:{color:"var(--red)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("polyline",{points:"3 6 5 6 21 6"}),a.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),j&&T==="integration"&&a.jsxs("div",{"data-testid":"platform-integration-note",className:"mb-4 px-4 py-3 rounded-xl flex items-center gap-3",style:{background:"var(--accent-muted)",border:"1px solid rgba(99,131,255,0.2)"},children:[a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),a.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),a.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--accent)"},children:"Run locally in vSkill Studio"})]}),te&&a.jsxs("div",{className:"mb-4 px-4 py-3 rounded-xl flex items-center gap-3",style:{background:"var(--green-muted)",border:"1px solid rgba(52, 211, 153, 0.2)"},children:[a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",children:[a.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),a.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),a.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--green)"},children:"All assertions passing"})]}),ee&&a.jsxs("div",{className:"mb-4 px-4 py-3 rounded-xl",style:{background:"rgba(251,146,60,0.1)",border:"1px solid rgba(251,146,60,0.2)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#fb923c",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#fb923c"},children:"Required Credentials"})]}),a.jsx("div",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:"This integration test requires the following environment variables:"}),a.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:_.map(O=>a.jsx("span",{style:{fontSize:10,fontFamily:"var(--font-mono, monospace)",padding:"2px 6px",borderRadius:4,background:"rgba(251,146,60,0.15)",color:"#fb923c"},children:O},O))})]}),!j&&T==="integration"&&a.jsx(zv,{evalCase:r,onUpdate:U}),a.jsx(gr,{title:"Prompt",children:B?a.jsxs("div",{children:[a.jsx("textarea",{value:G,onChange:O=>F(O.target.value),className:"input-field w-full",rows:4,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),a.jsxs("div",{className:"flex gap-2 mt-2",children:[a.jsx("button",{onClick:$,className:"btn btn-primary text-[12px]",children:"Save"}),a.jsx("button",{onClick:()=>{F(r.prompt),Y(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):a.jsx("div",{className:"p-3 rounded-lg text-[12px] transition-all duration-150",style:{background:"var(--surface-2)",color:"var(--text-secondary)",fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",border:"1px solid var(--border-subtle)",maxHeight:200,overflowY:"auto",cursor:j?"default":"pointer"},onClick:()=>{j||Y(!0)},onMouseEnter:O=>{j||(O.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:O=>{O.currentTarget.style.borderColor="var(--border-subtle)"},children:r.prompt||a.jsx("span",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:j?"No prompt":"Click to edit prompt..."})})}),a.jsx(gr,{title:"Expected Output",children:le?a.jsxs("div",{children:[a.jsx("textarea",{value:ne,onChange:O=>se(O.target.value),className:"input-field w-full",rows:3,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),a.jsxs("div",{className:"flex gap-2 mt-2",children:[a.jsx("button",{onClick:W,className:"btn btn-primary text-[12px]",children:"Save"}),a.jsx("button",{onClick:()=>{se(r.expected_output),Q(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):a.jsx("div",{className:"p-3 rounded-lg text-[12px] transition-all duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",border:"1px solid var(--border-subtle)",maxHeight:200,overflowY:"auto",cursor:j?"default":"pointer"},onClick:()=>{j||Q(!0)},onMouseEnter:O=>{j||(O.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:O=>{O.currentTarget.style.borderColor="var(--border-subtle)"},children:r.expected_output||a.jsx("span",{style:{fontStyle:"italic"},children:j?"No expected output":"Click to edit expected output..."})})}),a.jsx(gr,{title:`Assertions (${r.assertions.length})`,action:j?void 0:a.jsx("button",{onClick:he,className:"btn btn-ghost text-[11px]",children:"+ Add"}),children:r.assertions.length===0?a.jsx("div",{className:"text-[12px] text-center py-4",style:{color:"var(--text-tertiary)"},children:'No assertions. Click "+ Add" to create one.'}):a.jsx("div",{className:"space-y-2",children:r.assertions.map(O=>{const Z=c==null?void 0:c.assertions.find(z=>z.assertion_id===O.id),S=Cv(O.id,Z,w);return a.jsx(Rv,{assertion:O,result:Z,badges:S,isReadOnly:j,onUpdate:z=>ve(O.id,z),onDelete:()=>ye(O.id)},O.id)})})}),(c==null?void 0:c.output)&&a.jsx(Mv,{output:c.output,durationMs:c.durationMs,tokens:c.tokens}),c&&c.passRate!=null&&c.passRate<.2&&(()=>{const O=Zx("INEFFECTIVE",c.passRate);return O.recommendations&&O.recommendations.length>0?a.jsx(gr,{title:"Recommendations",children:a.jsxs("div",{className:"rounded-xl p-4",style:{background:"rgba(251,146,60,0.08)",border:"1px solid rgba(251,146,60,0.2)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#fb923c",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#fb923c"},children:"This eval is significantly below expectations"})]}),a.jsx("ul",{className:"space-y-1.5 ml-1",children:O.recommendations.map((Z,S)=>a.jsxs("li",{className:"flex items-start gap-2 text-[12px]",style:{color:"var(--text-secondary)"},children:[a.jsx("span",{style:{color:"#fb923c",fontWeight:600,flexShrink:0},children:"•"}),Z]},S))})]})}):null})(),a.jsx(Lv,{evalId:r.id,sharedEntries:w,sharedLoading:L})]},r.id)}function Rv({assertion:r,result:c,badges:o,isReadOnly:u,onUpdate:x,onDelete:v}){const[p,b]=h.useState(!1),[y,f]=h.useState(r.text),[j,g]=h.useState(!1),k=()=>{x(y),b(!1)};return a.jsx("div",{className:"rounded-lg px-3 py-2.5 transition-all duration-150",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:a.jsxs("div",{className:"flex items-start gap-2",children:[c?a.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",background:c.pass?"var(--green-muted)":"var(--red-muted)"},children:c.pass?a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}):a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}):a.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,border:"1.5px dashed var(--text-tertiary)",background:"transparent"},title:"Not run yet"}),(o==null?void 0:o.regression)&&a.jsx("span",{className:"mt-0.5 flex-shrink-0",title:"Regression: was passing, now failing",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:18,color:"var(--red)",fontSize:14,fontWeight:700,lineHeight:1},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.jsx("polyline",{points:"19 12 12 19 5 12"})]})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[a.jsx("span",{className:"text-[10px] font-mono font-semibold",style:{color:"var(--text-tertiary)"},children:r.id}),(o==null?void 0:o.flaky)&&a.jsx("span",{title:"Flaky: 30-70% pass rate across recent runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"rgba(234, 179, 8, 0.15)",color:"#ca8a04",whiteSpace:"nowrap"},children:"Flaky"}),(o==null?void 0:o.nonDiscriminating)&&a.jsx("span",{title:"Non-discriminating: passes on both skill and baseline runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"var(--surface-3)",color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:"Non-Discrim."})]}),p?a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{value:y,onChange:w=>f(w.target.value),onKeyDown:w=>{w.key==="Enter"&&k(),w.key==="Escape"&&b(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),a.jsx("button",{onClick:k,className:"btn btn-primary text-[11px]",children:"Save"})]}):a.jsx("div",{className:"text-[12px]",style:{color:"var(--text-secondary)",cursor:u?"default":"pointer"},onClick:()=>{u||(f(r.text),b(!0))},children:r.text}),(c==null?void 0:c.reasoning)&&a.jsx("button",{onClick:()=>g(!j),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:j?"Hide reasoning":"Show reasoning"}),j&&(c==null?void 0:c.reasoning)&&a.jsx("div",{className:"mt-1 text-[11px] p-2 rounded",style:{background:"var(--surface-1)",color:"var(--text-tertiary)"},children:c.reasoning})]}),!u&&a.jsx("button",{onClick:v,className:"btn btn-ghost p-1 opacity-0 group-hover:opacity-100",style:{color:"var(--text-tertiary)"},onMouseEnter:w=>{w.currentTarget.style.color="var(--red)",w.currentTarget.style.opacity="1"},onMouseLeave:w=>{w.currentTarget.style.color="var(--text-tertiary)",w.currentTarget.style.opacity=""},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})})}function gr({title:r,action:c,children:o}){return a.jsxs("div",{className:"mb-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:r}),c]}),o]})}function $x({result:r}){const[c,o]=h.useState(!1);if(!r||r.status==null)return a.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"--"});const u=r.status==="pass",x=r.passRate??0,p=Zx(u?"PASS":"FAIL",x);return a.jsxs("span",{className:"pill text-[10px]",style:{background:u?"var(--green-muted)":"var(--red-muted)",color:u?"var(--green)":"var(--red)",position:"relative",cursor:"default"},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"aria-describedby":c?"verdict-tooltip":void 0,children:[r.passRate!=null?`${Math.round(r.passRate*100)}%`:r.status,c&&a.jsx("div",{id:"verdict-tooltip",role:"tooltip",style:{position:"absolute",bottom:"calc(100% + 6px)",right:0,padding:"6px 10px",background:"var(--surface-4)",border:"1px solid var(--border-subtle)",borderRadius:6,fontSize:11,color:"var(--text-secondary)",whiteSpace:"nowrap",zIndex:50,maxWidth:300,width:"max-content",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},children:p.explanation})]})}function _v({passRate:r}){const c=Math.round(r*100);return a.jsx("div",{className:"flex items-center gap-1",children:a.jsx("div",{className:"rounded-full overflow-hidden",style:{width:32,height:4,background:"var(--surface-4)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${c}%`,background:c>=80?"var(--green)":c>=50?"var(--yellow)":"var(--red)"}})})})}function Mv({output:r,durationMs:c,tokens:o}){const[u,x]=h.useState(!1);return a.jsxs("div",{className:"mb-5",children:[a.jsxs("button",{onClick:()=>x(!u),className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider mb-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:u?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),"LLM Output",c!=null&&a.jsxs("span",{style:{fontWeight:400},children:["(",(c/1e3).toFixed(1),"s)"]}),o!=null&&a.jsxs("span",{style:{fontWeight:400},children:["(",o," tokens)"]})]}),u&&a.jsx("pre",{className:"text-[12px] p-4 rounded-lg overflow-auto animate-fade-in",style:{background:"var(--surface-1)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:400,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:r})]})}function Zo(r){return r==="baseline"?"right":r==="comparison"?"full":"left"}function $o({entry:r}){return a.jsxs("div",{className:"rounded-lg px-3 py-2.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Qx(r.timestamp)}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:r.model}),a.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:r.type==="benchmark"?"rgba(99,131,255,0.15)":r.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:r.type==="benchmark"?"#6383ff":r.type==="comparison"?"var(--purple)":"#fb923c"},children:r.type}),a.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:dn(r.pass_rate)},children:[Math.round(r.pass_rate*100),"%"]})]}),a.jsxs("div",{className:"flex items-center gap-4 mb-1.5 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[r.durationMs!=null&&a.jsx("span",{children:Xx(r.durationMs)}),r.tokens!=null&&a.jsxs("span",{children:[r.tokens>=1e3?`${(r.tokens/1e3).toFixed(1)}k`:r.tokens," tok"]})]}),r.type==="comparison"&&r.baselinePassRate!=null&&(()=>{const c=r.pass_rate-r.baselinePassRate,o=c>.001?"skill":c<-.001?"baseline":"tie",u=c>0?"+":"",x=o==="skill"?"var(--green)":o==="baseline"?"var(--red)":"var(--text-tertiary)";return a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"vs baseline:"}),a.jsxs("span",{className:"text-[11px] font-semibold",style:{color:c>=0?"var(--green)":"var(--red)"},children:[u,(c*100).toFixed(1),"%"]}),a.jsx("span",{className:"pill text-[9px]",style:{padding:"1px 5px",background:"rgba(0,0,0,0.2)",color:x},children:o})]})})(),a.jsx("div",{className:"space-y-0.5",children:r.assertions.map(c=>a.jsxs("div",{className:"flex items-start gap-1.5",children:[a.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:14,height:14,display:"flex",alignItems:"center",justifyContent:"center",background:c.pass?"var(--green-muted)":"var(--red-muted)"},children:c.pass?a.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}):a.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:c.text})]},c.id))})]})}function Lv({evalId:r,sharedEntries:c,sharedLoading:o}){const{state:u,dispatch:x}=il(),{plugin:v,skill:p}=u,[b,y]=h.useState(!0),f=c??null,j=o??!1,g=h.useCallback(()=>{y(B=>!B)},[]),k=f?f.slice(0,10):[],w=k.some(B=>{const Y=Zo(B.type);return Y==="left"||Y==="full"}),L=k.some(B=>{const Y=Zo(B.type);return Y==="right"||Y==="full"});return a.jsxs("div",{className:"mb-5",children:[a.jsxs("button",{onClick:g,className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider mb-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:b?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),"Execution History",f&&f.length>0&&a.jsxs("span",{style:{fontWeight:400},children:["(",f.length," run",f.length!==1?"s":"",")"]})]}),b&&a.jsx("div",{className:"animate-fade-in",children:j?a.jsxs("div",{className:"flex items-center gap-2 py-3",children:[a.jsx("div",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),a.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):!f||f.length===0?a.jsx("div",{className:"text-[12px] py-3",style:{color:"var(--text-tertiary)"},children:"No history for this case"}):a.jsxs("div",{children:[k.length>=2&&a.jsx("div",{className:"mb-2",children:a.jsx(Kx,{entries:k})}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"1"},children:"Skill"}),a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"2"},children:"Baseline"}),!w&&a.jsx("div",{style:{gridColumn:"1",fontSize:12,color:"var(--text-tertiary)"},children:"No skill runs"}),!L&&a.jsx("div",{style:{gridColumn:"2",fontSize:12,color:"var(--text-tertiary)"},children:"No baseline runs"}),k.map((B,Y)=>{const G=Zo(B.type);return G==="full"?a.jsx("div",{style:{gridColumn:"1 / -1"},children:a.jsx($o,{entry:B})},Y):G==="left"?a.jsxs(h.Fragment,{children:[a.jsx("div",{style:{gridColumn:"1"},children:a.jsx($o,{entry:B})}),a.jsx("div",{style:{gridColumn:"2"}})]},Y):a.jsxs(h.Fragment,{children:[a.jsx("div",{style:{gridColumn:"1"}}),a.jsx("div",{style:{gridColumn:"2"},children:a.jsx($o,{entry:B})})]},Y)})]}),a.jsx("button",{onClick:()=>x({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:B=>{B.currentTarget.style.textDecoration="underline"},onMouseLeave:B=>{B.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function wx({evals:r,onSave:c,onCancel:o}){const[u,x]=h.useState(""),[v,p]=h.useState(""),[b,y]=h.useState(""),[f,j]=h.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),[g,k]=h.useState("unit"),[w,L]=h.useState(""),[B,Y]=h.useState([]),[G,F]=h.useState(""),[le,Q]=h.useState(""),ne=Math.max(0,...r.evals.map(W=>W.id))+1,se=W=>{k(W),W==="unit"&&(Y([]),L(""),F(""),Q(""))},U=()=>{const W=w.trim().toUpperCase();W&&!B.includes(W)&&Y([...B,W]),L("")},$=()=>{if(!u.trim()||!v.trim())return;const W={id:ne,name:u.trim(),prompt:v.trim(),expected_output:b.trim(),files:[],assertions:f.filter(he=>he.text.trim()),...g==="integration"?{testType:"integration",...B.length>0?{requiredCredentials:B}:{},...G||le?{requirements:{...G?{platform:G}:{},...le?{chromeProfile:le}:{}}}:{}}:{}};c({...r,evals:[...r.evals,W]})};return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-overlay-in",style:{background:"rgba(0,0,0,0.6)"},children:a.jsxs("div",{className:"w-full max-w-lg rounded-xl p-6 animate-modal-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",maxHeight:"85vh",overflowY:"auto"},children:[a.jsx("div",{className:"text-[15px] font-semibold mb-4",style:{color:"var(--text-primary)"},children:"New Test Case"}),a.jsxs("div",{className:"mb-3",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1.5 block",style:{color:"var(--text-tertiary)"},children:"Type"}),a.jsx("div",{className:"flex gap-1 p-0.5 rounded-lg",style:{background:"var(--surface-2)",display:"inline-flex"},children:["unit","integration"].map(W=>a.jsx("button",{onClick:()=>se(W),className:"px-3 py-1 rounded-md text-[12px] font-medium transition-all duration-150",style:{background:g===W?W==="unit"?"rgba(99,131,255,0.2)":"rgba(251,146,60,0.2)":"transparent",color:g===W?W==="unit"?"#6383ff":"#fb923c":"var(--text-tertiary)",border:"none",cursor:"pointer",textTransform:"capitalize"},children:W},W))})]}),a.jsxs("label",{className:"block mb-3",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Name"}),a.jsx("input",{value:u,onChange:W=>x(W.target.value),className:"input-field",placeholder:"e.g., auth-check",autoFocus:!0})]}),a.jsxs("label",{className:"block mb-3",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Prompt"}),a.jsx("textarea",{value:v,onChange:W=>p(W.target.value),className:"input-field",rows:3,placeholder:"User prompt to test..."})]}),a.jsxs("label",{className:"block mb-3",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Expected Output"}),a.jsx("textarea",{value:b,onChange:W=>y(W.target.value),className:"input-field",rows:2,placeholder:"Description of expected behavior..."})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Assertions"}),f.map((W,he)=>a.jsxs("div",{className:"flex gap-2 mb-2",children:[a.jsx("input",{value:W.text,onChange:ve=>j(f.map((ye,J)=>J===he?{...ye,text:ve.target.value}:ye)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),f.length>1&&a.jsx("button",{onClick:()=>j(f.filter((ve,ye)=>ye!==he)),className:"btn btn-ghost p-1",style:{color:"var(--text-tertiary)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},W.id)),a.jsx("button",{onClick:()=>j([...f,{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--accent)"},children:"+ Add Assertion"})]}),g==="integration"&&a.jsxs("div",{className:"mb-4 p-3 rounded-lg",style:{background:"rgba(251,146,60,0.06)",border:"1px solid rgba(251,146,60,0.15)"},children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 block",style:{color:"#fb923c"},children:"Integration Settings"}),a.jsxs("div",{className:"mb-3",children:[a.jsx("span",{className:"text-[11px] mb-1 block",style:{color:"var(--text-secondary)"},children:"Required Credentials"}),a.jsx("div",{className:"flex flex-wrap gap-1.5 mb-1.5",children:B.map(W=>a.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-mono",style:{background:"rgba(251,146,60,0.15)",color:"#fb923c"},children:[W,a.jsx("button",{onClick:()=>Y(B.filter(he=>he!==W)),style:{color:"#fb923c",lineHeight:1},children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},W))}),a.jsxs("div",{className:"flex gap-1.5",children:[a.jsx("input",{value:w,onChange:W=>L(W.target.value),onKeyDown:W=>{W.key==="Enter"&&(W.preventDefault(),U())},className:"input-field flex-1 text-[11px] font-mono",placeholder:"e.g., SLACK_BOT_TOKEN"}),a.jsx("button",{onClick:U,className:"btn btn-ghost text-[11px]",style:{color:"#fb923c"},children:"Add"})]})]}),a.jsxs("label",{className:"block mb-3",children:[a.jsx("span",{className:"text-[11px] mb-1 block",style:{color:"var(--text-secondary)"},children:"Platform"}),a.jsx("input",{value:G,onChange:W=>F(W.target.value),className:"input-field text-[11px]",placeholder:"e.g., linkedin, twitter"})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] mb-1 block",style:{color:"var(--text-secondary)"},children:"Chrome Profile"}),a.jsx("input",{value:le,onChange:W=>Q(W.target.value),className:"input-field text-[11px]",placeholder:"e.g., Default"})]})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx("button",{onClick:o,className:"btn btn-secondary text-[12px]",children:"Cancel"}),a.jsx("button",{onClick:$,disabled:!u.trim()||!v.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function zv({evalCase:r,onUpdate:c}){var p,b;const[o,u]=h.useState(""),x=()=>{const y=o.trim().toUpperCase();y&&!(r.requiredCredentials??[]).includes(y)&&c({...r,requiredCredentials:[...r.requiredCredentials??[],y]}),u("")},v=y=>{const f=(r.requiredCredentials??[]).filter(j=>j!==y);c({...r,requiredCredentials:f.length>0?f:void 0})};return a.jsxs("div",{className:"mb-4 p-3 rounded-lg",style:{background:"rgba(251,146,60,0.06)",border:"1px solid rgba(251,146,60,0.15)"},children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 block",style:{color:"#fb923c"},children:"Integration Settings"}),a.jsxs("div",{className:"mb-2.5",children:[a.jsx("span",{className:"text-[10px] mb-1 block",style:{color:"var(--text-secondary)"},children:"Required Credentials"}),a.jsx("div",{className:"flex flex-wrap gap-1.5 mb-1.5",children:(r.requiredCredentials??[]).map(y=>a.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-mono",style:{background:"rgba(251,146,60,0.15)",color:"#fb923c"},children:[y,a.jsx("button",{onClick:()=>v(y),style:{color:"#fb923c",lineHeight:1},children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},y))}),a.jsxs("div",{className:"flex gap-1.5",children:[a.jsx("input",{value:o,onChange:y=>u(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),x())},className:"input-field flex-1 text-[11px] font-mono",placeholder:"e.g., GITHUB_TOKEN"}),a.jsx("button",{onClick:x,className:"btn btn-ghost text-[11px]",style:{color:"#fb923c"},children:"Add"})]})]}),a.jsxs("div",{className:"mb-2.5",children:[a.jsx("span",{className:"text-[10px] mb-1 block",style:{color:"var(--text-secondary)"},children:"Platform"}),a.jsx("input",{value:((p=r.requirements)==null?void 0:p.platform)??"",onChange:y=>c({...r,requirements:{...r.requirements,platform:y.target.value||void 0}}),className:"input-field text-[11px]",placeholder:"e.g., linkedin, twitter"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-[10px] mb-1 block",style:{color:"var(--text-secondary)"},children:"Chrome Profile"}),a.jsx("input",{value:((b=r.requirements)==null?void 0:b.chromeProfile)??"",onChange:y=>c({...r,requirements:{...r.requirements,chromeProfile:y.target.value||void 0}}),className:"input-field text-[11px]",placeholder:"e.g., Default"})]})]})}function Dv(r,c){const o=r+c,u=o*10,x=o*25,v=p=>p>=60?`${Math.round(p/60)}m`:`${p}s`;return`${v(u)}–${v(x)}`}function Ov(){const{state:r,runCase:c,runAll:o,cancelCase:u,cancelAll:x,isReadOnly:v}=il(),{evals:p,caseRunStates:b,bulkRunActive:y,latestBenchmark:f,inlineResults:j}=r,g=(p==null?void 0:p.evals)??[],k=h.useMemo(()=>{for(const Q of b.values())if(Q.status==="running"||Q.status==="queued")return!0;return!1},[b]),w=g.filter(Q=>{const ne=b.get(Q.id);return ne&&(ne.status==="complete"||ne.status==="error"||ne.status==="cancelled")}).length,L=g.filter(Q=>{const ne=b.get(Q.id);return ne&&(ne.status==="running"||ne.status==="queued")}).length,B=h.useRef(null),[Y,G]=h.useState(0);h.useEffect(()=>{if(k&&!B.current&&(B.current=Date.now()),!k){B.current=null,G(0);return}const Q=setInterval(()=>{B.current&&G(Math.round((Date.now()-B.current)/1e3))},1e3);return()=>clearInterval(Q)},[k]);const F=g.reduce((Q,ne)=>Q+ne.assertions.length,0),le=h.useMemo(()=>Dv(g.length,F),[g.length,F]);return a.jsxs("div",{className:"p-5",children:[v&&a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg mb-4 text-[11px]",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Installed skill — benchmarking is disabled. Edit the source skill to run benchmarks."]}),a.jsxs("div",{className:"rounded-xl p-4 mb-5",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Benchmark"}),k&&a.jsxs("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:[L," running"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[k&&a.jsxs("button",{onClick:x,className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel All"]}),a.jsx("button",{onClick:()=>o("comparison"),disabled:g.length===0||k||v,className:"btn btn-primary text-[12px]",children:"Compare All"}),a.jsx("button",{onClick:()=>o("benchmark"),disabled:g.length===0||k||v,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),a.jsx("button",{onClick:()=>o("baseline"),disabled:g.length===0||k||v,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),k&&g.length>0&&a.jsxs("div",{className:"mb-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("span",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:["Progress: ",w,"/",g.length," cases"]}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[Math.round(w/g.length*100),"%"]})]}),a.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:a.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${w/g.length*100}%`,background:"var(--accent)"}})}),a.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Elapsed: ",Y>=60?`${Math.floor(Y/60)}m ${Y%60}s`:`${Y}s`]}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",le]})]})]}),a.jsx("div",{className:"space-y-3 stagger-children",children:g.map(Q=>{const ne=j.get(Q.id),se=b.get(Q.id),U=(se==null?void 0:se.status)??"idle";return a.jsx(Hv,{name:Q.name,evalId:Q.id,result:ne,caseStatus:U,runMode:(se==null?void 0:se.mode)??null,isReadOnly:v,onRun:$=>c($,"benchmark"),onBaseline:$=>c($,"baseline"),onCompare:$=>c($,"comparison"),onCancel:$=>u($)},Q.id)})}),!k&&f&&f.cases.length>0&&a.jsxs("div",{className:"mt-5",children:[a.jsxs("div",{className:"rounded-xl p-4 mb-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall Pass Rate"}),a.jsx("span",{className:"text-[20px] font-bold",style:{color:(f.overall_pass_rate??0)>=.8?"var(--green)":(f.overall_pass_rate??0)>=.5?"var(--yellow)":"var(--red)"},children:f.overall_pass_rate!=null?`${Math.round(f.overall_pass_rate*100)}%`:"--"})]}),f.totalDurationMs!=null&&a.jsxs("div",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:["Total: ",(f.totalDurationMs/1e3).toFixed(1),"s",f.model&&` | Model: ${f.model}`]}),f.overall_pass_rate===1&&!f.comparison&&a.jsx("button",{onClick:()=>o("comparison"),disabled:g.length===0||v,className:"text-[13px] font-semibold mt-3 w-full rounded-lg transition-opacity duration-150",style:{padding:"10px 0",background:"var(--green, #22c55e)",color:"#fff",border:"none",cursor:"pointer",opacity:g.length===0?.5:1},children:"Run Final A/B Comparison"})]}),f.comparison&&a.jsxs("div",{className:"rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"Skill vs Baseline"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Ax,{label:"Skill",value:f.comparison.skillPassRate,color:"var(--accent)"}),a.jsx(Ax,{label:"Baseline",value:f.comparison.baselinePassRate,color:"var(--text-tertiary)"})]}),a.jsxs("div",{className:"mt-3 text-[12px] font-medium",style:{color:f.comparison.delta>0?"var(--green)":f.comparison.delta<0?"var(--red)":"var(--text-tertiary)"},children:["Delta: ",f.comparison.delta>0?"+":"",(f.comparison.delta*100).toFixed(1),"%",f.verdict&&` | ${f.verdict}`]})]})]})]})}const Bv={benchmark:{label:"Skill",bg:"var(--accent-muted)",color:"var(--accent)"},baseline:{label:"Baseline",bg:"var(--surface-3)",color:"var(--text-tertiary)"},comparison:{label:"Compare",bg:"rgba(168,85,247,0.12)",color:"rgb(168,85,247)"}};function Hv({name:r,evalId:c,result:o,caseStatus:u,runMode:x,isReadOnly:v,onRun:p,onBaseline:b,onCompare:y,onCancel:f}){const[j,g]=h.useState(!1),k=u==="running"||u==="queued",w=u==="complete"||u==="error";return a.jsxs("div",{className:"rounded-xl overflow-hidden transition-all duration-200",style:{background:"var(--surface-1)",border:k?"1px solid var(--accent)":"1px solid var(--border-subtle)",boxShadow:k?"0 0 12px rgba(99, 131, 255, 0.15)":"none"},children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"&&a.jsx("span",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),u==="queued"&&a.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--text-tertiary)"},children:"queued"}),a.jsxs("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:["#",c," ",r]}),x&&(k||w)&&(()=>{const L=Bv[x];return L?a.jsx("span",{className:"pill text-[9px] font-semibold",style:{background:L.bg,color:L.color,padding:"1px 6px"},children:L.label}):null})()]}),a.jsxs("div",{className:"flex items-center gap-2",children:[k?a.jsx("button",{onClick:()=>f(c),className:"btn text-[10px] px-2 py-1",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:"Cancel"}):a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>y(c),disabled:v,className:"btn btn-primary text-[10px] px-2 py-1",children:"Compare"}),a.jsx("button",{onClick:()=>p(c),disabled:v,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Skill"}),a.jsx("button",{onClick:()=>b(c),disabled:v,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Base"})]}),o&&o.status!=null&&a.jsx("span",{className:"pill text-[10px]",style:{background:o.status==="pass"?"var(--green-muted)":(o.status==="error","var(--red-muted)"),color:o.status==="pass"?"var(--green)":"var(--red)"},children:o.passRate!=null?`${Math.round(o.passRate*100)}%`:o.status}),u==="cancelled"&&a.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),o&&o.assertions.length>0&&a.jsxs("div",{className:"px-4 pb-3",children:[a.jsx("div",{className:"space-y-1",children:o.assertions.map(L=>a.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[a.jsx("span",{style:{color:L.pass?"var(--green)":"var(--red)"},children:L.pass?"PASS":"FAIL"}),a.jsx("span",{style:{color:"var(--text-secondary)"},children:L.text})]},L.assertion_id))}),o.output&&a.jsx("button",{onClick:()=>g(!j),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:j?"Hide output":"Show output"}),j&&o.output&&a.jsx("pre",{className:"text-[11px] mt-2 p-3 rounded-lg overflow-auto",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:200,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap"},children:o.output})]}),o&&o.errorMessage&&a.jsx(Uv,{errorMessage:o.errorMessage,classifiedError:o.classifiedError})]})}const Jo={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function Uv({errorMessage:r,classifiedError:c}){const[o,u]=h.useState(!1),x=(c==null?void 0:c.title)??"Error",v=c==null?void 0:c.hint,p=c?Jo[c.category]??Jo.unknown:Jo.unknown;return a.jsx("div",{className:"px-4 pb-3",children:a.jsxs("div",{className:"rounded-lg overflow-hidden",style:{background:"var(--red-muted)",border:"1px solid rgba(239,68,68,0.2)"},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[a.jsx("span",{style:{fontSize:12},children:p}),a.jsx("span",{className:"text-[11.5px] font-semibold flex-1",style:{color:"var(--red)"},children:x}),a.jsx("button",{onClick:()=>u(!o),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:o?"Hide details":"Details"})]}),v&&a.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:v}),o&&a.jsx("pre",{className:"text-[10px] px-3 pb-2.5 overflow-auto",style:{color:"var(--text-tertiary)",maxHeight:120,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:r})]})})}function Ax({label:r,value:c,color:o}){return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:r}),a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:o},children:[Math.round(c*100),"%"]})]}),a.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:a.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${c*100}%`,background:o}})})]})}const Rx={TP:{bg:"var(--green-muted)",text:"var(--green)"},TN:{bg:"rgba(52,211,153,0.06)",text:"rgba(52,211,153,0.6)"},FP:{bg:"var(--red-muted)",text:"var(--red)"},FN:{bg:"rgba(248,113,113,0.06)",text:"rgba(248,113,113,0.6)"}};function qv(){const{state:r,dispatch:c,runActivationTest:o,cancelActivation:u,generateActivationPrompts:x}=il(),{plugin:v,skill:p,activationPrompts:b,activationResults:y,activationSummary:f,activationRunning:j,activationError:g,activationStartedAt:k,generatingPrompts:w,generatingPromptsError:L,activationHistory:B}=r,[Y,G]=h.useState(b),[F,le]=h.useState(null),[Q,ne]=h.useState(!1);h.useEffect(()=>{b&&b!==Y&&G(b)},[b]),h.useEffect(()=>{c({type:"SET_ACTIVATION_PROMPTS",prompts:Y})},[Y,c]),h.useEffect(()=>{fetch(`/api/skills/${v}/${p}/description`).then(te=>te.json()).then(te=>le(te.rawContent||te.description||null)).catch(()=>le(null))},[v,p]);function se(){o(Y)}function U(){x(8)}const $=Y.trim().split(`
63
+ `).filter(Boolean).length,W=y.filter(te=>te.classification==="TP"||te.classification==="TN"),he=y.filter(te=>te.classification==="FP"||te.classification==="FN"),ve=(F==null?void 0:F.replace(/^---[\s\S]*?---\s*/,"").trim())??null,ye=Y.trim().length>0,J=ve?Nr(ve):"";return a.jsxs("div",{className:"p-5 space-y-5",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[14px] font-semibold",style:{color:"var(--text-primary)"},children:"Activation Test"}),a.jsx("div",{className:"text-[12px] mt-0.5",style:{color:"var(--text-tertiary)"},children:"Test whether this skill's description activates for relevant prompts and stays silent for irrelevant ones."})]}),a.jsxs("div",{className:"grid grid-cols-[3fr_2fr] gap-4 items-stretch",children:[a.jsxs("div",{className:"glass-card p-4 flex flex-col gap-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Test Prompts"}),a.jsx("div",{className:"flex gap-1.5",children:a.jsx("button",{onClick:U,disabled:w||!ve||j,className:"text-[10px] px-2.5 py-1 rounded-md transition-colors duration-150 flex items-center gap-1.5",style:{background:w?"var(--surface-3)":"var(--surface-2)",color:ve?"var(--accent)":"var(--text-tertiary)",border:"1px solid var(--border-subtle)",opacity:ve?1:.5,cursor:ve?"pointer":"not-allowed"},title:ve?void 0:"No skill description available",onMouseEnter:te=>{ve&&!w&&(te.currentTarget.style.background="var(--surface-3)")},onMouseLeave:te=>{w||(te.currentTarget.style.background="var(--surface-2)")},children:w?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"spinner",style:{borderTopColor:"var(--accent)",borderColor:"var(--border-subtle)",width:10,height:10}}),"Generating..."]}):a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M12 3v3m6.36.64l-2.12 2.12M21 12h-3m-.64 6.36l-2.12-2.12M12 21v-3m-4.24.64l2.12-2.12M3 12h3m.64-6.36l2.12 2.12"})}),ye?"Regenerate":"Generate"," Test Prompts"]})})})]}),L&&a.jsx("div",{className:"text-[11px] px-2 py-1 rounded",style:{color:"var(--red)",background:"var(--red-muted)"},children:L}),a.jsx("textarea",{className:"input-field resize-y font-mono text-[12px]",style:{minHeight:140,height:140},value:Y,onChange:te=>G(te.target.value),placeholder:`How do I write a unit test?
64
+ What edge cases should I test?
65
+ +Deploy this to production
66
+ !What's the weather like today?
67
+ !Write me a poem about flowers`}),a.jsxs("div",{className:"flex items-center flex-wrap gap-x-3 gap-y-1 text-[11px]",style:{color:"var(--text-tertiary)"},children:[a.jsx("span",{children:"One prompt per line"}),a.jsx(br,{}),a.jsx("span",{children:"No prefix = auto-classify"}),a.jsx(br,{}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"+"}),"= must activate"]}),a.jsx(br,{}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"!"}),"= must NOT activate"]}),a.jsx(br,{}),a.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[$," prompt",$!==1?"s":""]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:se,disabled:j||!Y.trim(),className:"btn btn-primary",children:j?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"spinner",style:{borderTopColor:"#fff",borderColor:"rgba(255,255,255,0.2)",width:14,height:14}}),"Testing..."]}):a.jsxs(a.Fragment,{children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("circle",{cx:"12",cy:"12",r:"6"}),a.jsx("circle",{cx:"12",cy:"12",r:"2"})]}),"Run Activation Test"]})}),j&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:u,className:"btn btn-secondary text-[12px]",children:"Cancel"}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[y.length," / ",$," prompts tested",k&&a.jsx(Qv,{startedAt:k})]})]})]})]}),a.jsxs("div",{className:"glass-card flex flex-col overflow-hidden",children:[a.jsx("div",{className:"px-4 pt-3.5 pb-2.5 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Skill Description"})}),a.jsx("div",{className:"flex-1 overflow-auto px-4 py-3",style:{minHeight:0},children:ve?a.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:J}}):a.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No description available"})})]})]}),g&&a.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:g}),j&&y.length===0&&a.jsxs("div",{className:"text-center py-12 animate-fade-in",children:[a.jsx("div",{className:"spinner-lg mx-auto mb-4"}),a.jsx("p",{className:"text-[14px]",style:{color:"var(--text-secondary)"},children:"Testing activation against skill description..."})]}),y.length>0&&a.jsxs("div",{className:"space-y-5",children:[he.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),a.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--red)"},children:["Incorrect (",he.length,")"]}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"— These need attention"})]}),a.jsx("div",{className:"space-y-1.5 stagger-children",children:he.map((te,me)=>a.jsx(_x,{result:te},`incorrect-${me}`))})]}),W.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"16 10 11 15 8 12"})]}),a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--green)"},children:["Correct (",W.length,")"]})]}),a.jsx("div",{className:"space-y-1.5 stagger-children",children:W.map((te,me)=>a.jsx(_x,{result:te},`correct-${me}`))})]})]}),f&&a.jsxs("div",{className:"glass-card p-6 animate-fade-in-scale",style:{borderColor:"var(--border-active)",borderWidth:2},children:[a.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-2",style:{color:"var(--text-tertiary)"},children:"Summary"}),f.autoClassifiedCount!=null&&f.autoClassifiedCount>0&&a.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:[f.autoClassifiedCount," of ",f.total," prompts auto-classified from skill name and tags"]}),a.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-5",children:[a.jsx(Wo,{label:"Precision",value:f.precision,description:"Of all activations, how many were correct?",detail:`${f.tp} true / ${f.tp+f.fp} total activations`}),a.jsx(Wo,{label:"Recall",value:f.recall,description:"Of expected activations, how many fired?",detail:`${f.tp} activated / ${f.tp+f.fn} expected`}),a.jsx(Wo,{label:"Reliability",value:f.reliability,description:"Overall correct classification rate",detail:`${f.tp+f.tn} correct / ${f.total} total`})]}),a.jsxs("div",{className:"pt-4",style:{borderTop:"1px solid var(--border-subtle)"},children:[a.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-3 text-center",style:{color:"var(--text-tertiary)"},children:"Confusion Matrix"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-xs mx-auto",children:[a.jsx(jr,{label:"True Positive",abbr:"TP",count:f.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),a.jsx(jr,{label:"False Positive",abbr:"FP",count:f.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),a.jsx(jr,{label:"False Negative",abbr:"FN",count:f.fn,bg:"rgba(248,113,113,0.06)",color:"rgba(248,113,113,0.6)",description:"Missed activation"}),a.jsx(jr,{label:"True Negative",abbr:"TN",count:f.tn,bg:"rgba(52,211,153,0.06)",color:"rgba(52,211,153,0.6)",description:"Correctly silent"})]})]})]}),a.jsx(Gv,{history:B,expanded:Q,onToggle:()=>ne(!Q)})]})}function Gv({history:r,expanded:c,onToggle:o}){return r===null?null:a.jsxs("div",{className:"glass-card overflow-hidden",children:[a.jsxs("button",{className:"w-full px-4 py-3 flex items-center justify-between text-left",style:{borderBottom:c?"1px solid var(--border-subtle)":"none"},onClick:o,children:[a.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:["Test History",r.length>0&&a.jsxs("span",{className:"ml-2 font-normal",style:{color:"var(--text-tertiary)"},children:["(",r.length," run",r.length!==1?"s":"",")"]})]}),a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:c?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"},children:a.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),c&&a.jsx("div",{className:"px-4 py-3",children:r.length===0?a.jsx("div",{className:"text-[12px] py-4 text-center",style:{color:"var(--text-tertiary)"},children:"No test runs yet"}):a.jsx("div",{className:"space-y-2",children:r.map(u=>a.jsx(Yv,{run:u},u.id))})})]})}function Yv({run:r}){const c=Math.round(r.summary.reliability*100),o=c>=80?"var(--green)":c>=60?"var(--yellow)":"var(--red)",u=c>=80?"Good":c>=60?"Needs Work":"Poor",x=o;return a.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg",style:{background:"var(--surface-1)"},children:[a.jsx("div",{className:"flex-1 min-w-0",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:Vv(r.timestamp)}),a.jsx("span",{className:"pill text-[9px] px-1.5",style:{background:"var(--surface-2)",color:"var(--text-tertiary)"},children:r.model||r.provider}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[r.promptCount," prompts"]})]})}),a.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:o,fontVariantNumeric:"tabular-nums"},children:[c,"%"]}),a.jsx("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded",style:{color:x,background:`color-mix(in srgb, ${x} 10%, transparent)`},children:u})]})]})}function Vv(r){const c=Date.now(),o=new Date(r).getTime(),u=Math.floor((c-o)/1e3);if(u<60)return"just now";const x=Math.floor(u/60);if(x<60)return`${x}m ago`;const v=Math.floor(x/60);if(v<24)return`${v}h ago`;const p=Math.floor(v/24);return p<7?`${p}d ago`:new Date(r).toLocaleDateString()}function br(){return a.jsx("span",{style:{color:"var(--border-subtle)",userSelect:"none"},children:"·"})}function _x({result:r}){const c=Rx[r.classification]||Rx.FN,o=r.classification==="TP"||r.classification==="TN";return a.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl transition-all duration-200",style:{background:c.bg,border:"1px solid transparent"},children:[a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:a.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:`color-mix(in srgb, ${c.text} 20%, transparent)`},children:o?a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:c.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}):a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:c.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"flex items-center gap-2 mb-1",children:a.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:r.prompt})}),a.jsxs("div",{className:"flex items-center gap-3 text-[12px]",children:[a.jsx("span",{className:"pill",style:{background:"rgba(0,0,0,0.1)",color:c.text,fontWeight:700,fontSize:"10px",padding:"1px 6px"},children:r.classification}),a.jsx("span",{style:{color:r.activate?"var(--green)":"var(--text-tertiary)"},children:r.activate?"Activated":"Silent"}),a.jsxs("span",{style:{color:"var(--text-tertiary)"},children:["Expected: ",r.expected==="should_activate"?"activate":"stay silent"]}),a.jsxs("span",{style:{color:"var(--text-tertiary)"},children:[r.confidence," confidence"]}),r.autoClassified&&a.jsx("span",{className:"pill",style:{background:"rgba(139,92,246,0.1)",color:"rgba(139,92,246,0.8)",fontSize:"9px",padding:"1px 5px"},children:"auto"})]}),r.reasoning&&a.jsx("div",{className:"text-[11px] mt-1.5",style:{color:"var(--text-tertiary)"},children:r.reasoning})]})]})}function Wo({label:r,value:c,description:o,detail:u}){const x=Math.round(c*100),v=x>=80?"var(--green)":x>=60?"var(--yellow)":"var(--red)";return a.jsxs("div",{className:"text-center",children:[a.jsxs("div",{className:"text-[28px] font-bold tracking-tight",style:{color:v},children:[x,"%"]}),a.jsx("div",{className:"text-[12px] font-medium mt-0.5",style:{color:"var(--text-secondary)"},children:r}),a.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--text-tertiary)"},children:o}),a.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:u})]})}function jr({abbr:r,count:c,bg:o,color:u,description:x}){return a.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:o},children:[a.jsx("div",{className:"text-[20px] font-bold",style:{color:u},children:c}),a.jsx("div",{className:"text-[11px] font-semibold",style:{color:u},children:r}),a.jsx("div",{className:"text-[9px] mt-0.5",style:{color:"var(--text-tertiary)"},children:x})]})}function Qv({startedAt:r}){const[c,o]=h.useState(0);return h.useEffect(()=>{const u=setInterval(()=>o(Math.floor((Date.now()-r)/1e3)),1e3);return()=>clearInterval(u)},[r]),a.jsxs("span",{className:"ml-2",children:["(",c,"s)"]})}const Fo={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},Mx={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},nc=600,sc=180,Nt=40,Io=nc-Nt*2,la=sc-Nt*2,Xv=[25,50,75,100];function Lx(r){return new Date(r).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Kv(r){return r==null?"--":`${(r/1e3).toFixed(1)}s`}function Zv({entries:r,onPointClick:c}){const[o,u]=h.useState(null),x=h.useMemo(()=>[...r].reverse(),[r]);if(x.length<2)return null;const v=x.length,p=x.map((f,j)=>{const g=Nt+j/(v-1)*Io,k=f.passRate*100,w=Nt+la-k/100*la;return{x:g,y:w,pct:k,entry:f}}),b=p.map(f=>`${f.x},${f.y}`).join(" "),y=Array.from(new Set(x.map(f=>f.type)));return a.jsxs("div",{className:"glass-card p-5 animate-fade-in",style:{position:"relative",overflowX:v>=20?"auto":void 0},children:[a.jsx("div",{className:"text-[13px] font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Pass Rate Trend"}),a.jsx("div",{className:"flex items-center gap-5 mb-3",children:y.map(f=>a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:Fo[f]??"var(--text-tertiary)"}}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:Mx[f]??f})]},f))}),a.jsxs("svg",{width:nc,height:sc,viewBox:`0 0 ${nc} ${sc}`,style:{display:"block",overflow:"visible"},children:[Xv.map(f=>{const j=Nt+la-f/100*la;return a.jsxs("g",{children:[a.jsx("line",{x1:Nt,y1:j,x2:Nt+Io,y2:j,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),a.jsxs("text",{x:Nt-8,y:j+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[f,"%"]})]},f)}),a.jsx("line",{x1:Nt,y1:Nt+la,x2:Nt+Io,y2:Nt+la,stroke:"var(--border-subtle)",strokeWidth:1}),a.jsx("text",{x:Nt-8,y:Nt+la+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:"0%"}),a.jsx("polyline",{points:b,fill:"none",stroke:"var(--border-subtle)",strokeWidth:1.5,strokeLinejoin:"round"}),p.map((f,j)=>a.jsx("circle",{cx:f.x,cy:f.y,r:5,fill:Fo[f.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:g=>{g.currentTarget.setAttribute("r","7"),u({x:f.x,y:f.y,entry:f.entry})},onMouseLeave:g=>{g.currentTarget.setAttribute("r","5"),u(null)},onClick:()=>c==null?void 0:c(f.entry)},j)),$v(v).map(f=>a.jsx("text",{x:p[f].x,y:Nt+la+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:Lx(x[f].timestamp)},f))]}),o&&a.jsxs("div",{style:{position:"absolute",left:o.x,top:o.y-12,transform:"translate(-50%, -100%)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"8px 12px",pointerEvents:"none",zIndex:10,whiteSpace:"nowrap"},children:[a.jsx("div",{className:"text-[11px] font-medium",style:{color:"var(--text-primary)"},children:Lx(o.entry.timestamp)}),a.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-tertiary)"},children:o.entry.model}),a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:Fo[o.entry.type]??"var(--text-tertiary)",color:"#fff"},children:Mx[o.entry.type]??o.entry.type}),a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:[Math.round(o.entry.passRate*100),"%"]})]}),a.jsxs("div",{className:"text-[10px] mt-1.5 flex items-center gap-3",style:{color:"var(--text-tertiary)"},children:[a.jsx("span",{children:Kv(o.entry.totalDurationMs)}),a.jsx("span",{children:o.entry.totalTokens!=null?`${o.entry.totalTokens} tokens`:"--"})]})]})]})}function $v(r){if(r<=3)return Array.from({length:r},(u,x)=>x);if(r<=6)return[0,Math.floor(r/2),r-1];if(r<20)return[0,Math.floor(r/3),Math.floor(2*r/3),r-1];const c=Math.ceil(r/10),o=[0];for(let u=c;u<r-1;u+=c)o.push(u);return o.push(r-1),o}function Sr(r){return r>=.8?"var(--green)":r>=.5?"var(--yellow)":"var(--red)"}function Jv(r){return r>=1e3?`${(r/1e3).toFixed(1)}s`:`${Math.round(r)}ms`}function Wv({rate:r,label:c}){const o=Math.round(r*100);return a.jsx("div",{className:"flex items-center gap-3",children:a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-primary)",maxWidth:"70%"},children:c}),a.jsxs("span",{className:"text-[11px] font-semibold",style:{color:Sr(r)},children:[o,"%"]})]}),a.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:"var(--surface-3)"},children:a.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${o}%`,background:Sr(r)}})})]})})}function Fv({points:r}){if(r.length<2)return null;const c=200,o=48,u=4,x=r.length,v=r.map((y,f)=>{const j=u+f/(x-1)*(c-u*2),g=u+(o-u*2)-y.passRate*(o-u*2);return{x:j,y:g}}),p=`M ${v[0].x},${o-u} `+v.map(y=>`L ${y.x},${y.y}`).join(" ")+` L ${v[v.length-1].x},${o-u} Z`,b=v.map((y,f)=>`${f===0?"M":"L"} ${y.x},${y.y}`).join(" ");return a.jsxs("svg",{width:c,height:o,style:{display:"block"},children:[a.jsx("path",{d:p,fill:"var(--accent-muted)"}),a.jsx("path",{d:b,fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),a.jsx("circle",{cx:v[v.length-1].x,cy:v[v.length-1].y,r:3,fill:"var(--accent)"})]})}function Iv({plugin:r,skill:c}){const[o,u]=h.useState(null),[x,v]=h.useState(!0);if(h.useEffect(()=>{v(!0),Se.getStats(r,c).then(u).catch(()=>u(null)).finally(()=>v(!1))},[r,c]),x)return a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"skeleton h-24 rounded-xl"}),a.jsx("div",{className:"skeleton h-48 rounded-xl"}),a.jsx("div",{className:"skeleton h-36 rounded-xl"})]});if(!o||o.totalRuns===0)return a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mx-auto mb-3",style:{background:"var(--surface-2)"},children:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",children:[a.jsx("path",{d:"M18 20V10"}),a.jsx("path",{d:"M12 20V4"}),a.jsx("path",{d:"M6 20v-6"})]})}),a.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark data yet"}),a.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"Run some benchmarks to see statistics"})]});const p=o.trendPoints.length>0?o.trendPoints[o.trendPoints.length-1].passRate:0,b=o.trendPoints.length>0?o.trendPoints[0].passRate:0,y=p-b,f=o.assertionStats.slice(0,10);return a.jsxs("div",{className:"space-y-4 stagger-children",children:[a.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Total Runs"}),a.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:o.totalRuns})]}),a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Latest Pass Rate"}),a.jsxs("div",{className:"text-[24px] font-bold",style:{color:Sr(p)},children:[Math.round(p*100),"%"]})]}),a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Trend"}),a.jsxs("div",{className:"text-[24px] font-bold",style:{color:y>=0?"var(--green)":"var(--red)"},children:[y>=0?"+":"",Math.round(y*100),"%"]})]}),a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Models Tested"}),a.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:o.modelStats.length})]})]}),o.trendPoints.length>=2&&a.jsxs("div",{className:"glass-card p-5",children:[a.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Pass Rate Over Time"}),a.jsx(Fv,{points:o.trendPoints})]}),o.modelStats.length>0&&a.jsxs("div",{className:"glass-card p-5",children:[a.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Model Performance"}),a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("th",{style:{textAlign:"left",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Model"}),a.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Runs"}),a.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Pass Rate"}),a.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Duration"})]})}),a.jsx("tbody",{children:o.modelStats.map(j=>a.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:j.model}),a.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:j.runs}),a.jsx("td",{style:{padding:"8px",textAlign:"center"},children:a.jsxs("span",{className:"font-semibold",style:{color:Sr(j.avgPassRate)},children:[Math.round(j.avgPassRate*100),"%"]})}),a.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:Jv(j.avgDurationMs)})]},j.model))})]})]}),f.length>0&&a.jsxs("div",{className:"glass-card p-5",children:[a.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Weakest Assertions"}),a.jsx("div",{className:"space-y-3",children:f.map(j=>a.jsxs("button",{className:"block w-full text-left rounded-lg p-2 -mx-2 transition-colors duration-150",style:{background:"transparent"},onMouseEnter:g=>{g.currentTarget.style.background="var(--surface-2)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},onClick:()=>{},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[a.jsxs("span",{className:"text-[10px] font-mono px-1 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",j.evalId]}),a.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:j.evalName}),a.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[j.totalRuns," runs"]})]}),a.jsx(Wv,{rate:j.passRate,label:j.text})]},`${j.evalId}:${j.id}`))})]})]})}function Pv({plugin:r,skill:c}){const[o,u]=h.useState(null),[x,v]=h.useState(null),[p,b]=h.useState({}),[y,f]=h.useState({});h.useEffect(()=>{Se.getEvals(r,c).then(u).catch(()=>u(null))},[r,c]);async function j(g){if(x===g){v(null);return}if(v(g),!p[g]){f(k=>({...k,[g]:!0}));try{const k=await Se.getCaseHistory(r,c,g);b(w=>({...w,[g]:k}))}catch{b(k=>({...k,[g]:[]}))}finally{f(k=>({...k,[g]:!1}))}}}return o?a.jsx("div",{className:"space-y-2 stagger-children",children:o.evals.map(g=>{const k=p[g.id]||[],w=x===g.id,L=y[g.id],B=k.length>0?k[0].pass_rate:null;return a.jsxs("div",{className:"glass-card overflow-hidden",children:[a.jsxs("button",{onClick:()=>j(g.id),className:"w-full text-left p-4 flex items-center gap-3 transition-colors duration-150",style:{background:w?"var(--surface-2)":"transparent"},onMouseEnter:Y=>{w||(Y.currentTarget.style.background="var(--surface-2)")},onMouseLeave:Y=>{w||(Y.currentTarget.style.background="transparent")},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",strokeLinecap:"round",style:{transform:w?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease",flexShrink:0},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),a.jsxs("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",g.id]}),a.jsx("span",{className:"text-[13px] font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:g.name}),k.length>=2&&a.jsx(Kx,{entries:k}),B!=null&&a.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:dn(B)},children:[Math.round(B*100),"%"]}),k.length>0&&a.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[k.length," runs"]})]}),w&&a.jsx("div",{className:"border-t animate-fade-in",style:{borderColor:"var(--border-subtle)"},children:L?a.jsxs("div",{className:"p-4 flex items-center gap-2",children:[a.jsx("div",{className:"spinner",style:{width:14,height:14}}),a.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):k.length===0?a.jsx("div",{className:"p-4",children:a.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No history for this eval case"})}):a.jsx("div",{className:"divide-y",style:{borderColor:"var(--border-subtle)"},children:k.map((Y,G)=>a.jsxs("div",{className:"p-4",style:{background:G===0?"var(--surface-2)":"transparent"},children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Qx(Y.timestamp)}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:Y.model}),a.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:Y.type==="benchmark"?"rgba(99,131,255,0.15)":Y.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:Y.type==="benchmark"?"#6383ff":Y.type==="comparison"?"var(--purple)":"#fb923c"},children:Y.type}),a.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:dn(Y.pass_rate)},children:[Math.round(Y.pass_rate*100),"%"]})]}),a.jsxs("div",{className:"flex items-center gap-4 mb-2 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[Y.durationMs!=null&&a.jsx("span",{children:Xx(Y.durationMs)}),Y.tokens!=null&&a.jsxs("span",{children:[Y.tokens>=1e3?`${(Y.tokens/1e3).toFixed(1)}k`:Y.tokens," tok"]})]}),a.jsx("div",{className:"space-y-1",children:Y.assertions.map(F=>a.jsxs("div",{className:"flex items-start gap-2 py-0.5",children:[a.jsx("div",{className:"w-3.5 h-3.5 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:F.pass?"var(--green)":"var(--red)"},children:a.jsx("svg",{width:"7",height:"7",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",children:F.pass?a.jsx("polyline",{points:"20 6 9 17 4 12"}):a.jsxs(a.Fragment,{children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-[11px]",style:{color:"var(--text-primary)"},children:F.text}),F.reasoning&&a.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:F.reasoning})]})]},F.id))})]},G))})})]},g.id)})}):a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No eval cases found"})})}function e1(){const{state:r,dispatch:c}=il(),{plugin:o,skill:u}=r,[x,v]=h.useState("timeline"),[p,b]=h.useState([]),[y,f]=h.useState(!0),[j,g]=h.useState(""),[k,w]=h.useState(""),[L,B]=h.useState(!1),[Y,G]=h.useState([]),[F,le]=h.useState(null),[Q,ne]=h.useState(!1),[se,U]=h.useState(null),[$,W]=h.useState(!1);h.useEffect(()=>{f(!0),Se.getHistory(o,u,{model:j||void 0,type:k||void 0}).then(J=>{b(J),J.length>=2&&Se.compareRuns(o,u,J[0].timestamp,J[1].timestamp).then(te=>{const me=te.regressions.filter(T=>T.change==="regression");c({type:"SET_REGRESSIONS",regressions:me})}).catch(()=>{})}).catch(()=>{}).finally(()=>f(!1))},[o,u,j,k]);const he=h.useCallback(async J=>{if(L){G(te=>te.includes(J)?te.filter(me=>me!==J):te.length>=2?[te[1],J]:[...te,J]);return}W(!0);try{const te=await Se.getHistoryEntry(o,u,J);U(te)}catch{}finally{W(!1)}},[o,u,L]),ve=h.useCallback(async()=>{if(Y.length===2){ne(!0);try{const J=await Se.compareRuns(o,u,Y[0],Y[1]);le(J)}catch{}finally{ne(!1)}}},[o,u,Y]),ye=[...new Set(p.map(J=>J.model))];return y?a.jsxs("div",{className:"p-5",children:[a.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),a.jsx("div",{className:"skeleton h-48 rounded-xl mb-4"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"skeleton h-12 rounded-lg"}),a.jsx("div",{className:"skeleton h-12 rounded-lg"})]})]}):a.jsxs("div",{className:"p-5",children:[a.jsx("div",{className:"flex items-center gap-1 mb-4",children:["timeline","per-eval","statistics"].map(J=>a.jsx("button",{onClick:()=>v(J),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:x===J?"var(--accent-muted)":"transparent",color:x===J?"var(--accent)":"var(--text-tertiary)"},children:J==="timeline"?"Timeline":J==="per-eval"?"Per Eval":"Statistics"},J))}),x==="timeline"&&a.jsxs("div",{children:[p.length>0&&a.jsx("div",{className:"mb-5 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:a.jsx(Zv,{entries:p,onPointClick:J=>he(J.timestamp)})}),a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsxs("select",{value:j,onChange:J=>g(J.target.value),className:"input-field text-[12px]",style:{width:150},children:[a.jsx("option",{value:"",children:"All Models"}),ye.map(J=>a.jsx("option",{value:J,children:J},J))]}),a.jsxs("select",{value:k,onChange:J=>w(J.target.value),className:"input-field text-[12px]",style:{width:150},children:[a.jsx("option",{value:"",children:"All Types"}),a.jsx("option",{value:"benchmark",children:"Benchmark"}),a.jsx("option",{value:"comparison",children:"Comparison"}),a.jsx("option",{value:"baseline",children:"Baseline"}),a.jsx("option",{value:"model-compare",children:"Model Compare"}),a.jsx("option",{value:"improve",children:"AI Improve"}),a.jsx("option",{value:"instruct",children:"AI Edit"}),a.jsx("option",{value:"ai-generate",children:"AI Generate"}),a.jsx("option",{value:"eval-generate",children:"Eval Generate"})]}),a.jsx("div",{className:"flex-1"}),a.jsx("button",{onClick:()=>{B(!L),G([]),le(null)},className:`btn text-[12px] ${L?"btn-primary":"btn-secondary"}`,children:L?"Exit Compare":"Compare Runs"}),L&&Y.length===2&&a.jsx("button",{onClick:ve,disabled:Q,className:"btn btn-primary text-[12px]",children:Q?"Comparing...":"Compare"})]}),a.jsx("div",{className:"space-y-2",children:p.length===0?a.jsx("div",{className:"text-center py-8 text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark runs yet"}):p.map(J=>{const te=Y.includes(J.timestamp);return a.jsx("button",{onClick:()=>he(J.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:te?"var(--accent-muted)":"var(--surface-1)",border:te?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:me=>{te||(me.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:me=>{te||(me.currentTarget.style.borderColor="var(--border-subtle)")},children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[L&&a.jsx("span",{className:"w-4 h-4 rounded border flex items-center justify-center",style:{borderColor:te?"var(--accent)":"var(--border-default)",background:te?"var(--accent)":"transparent"},children:te&&a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})})}),a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:new Date(J.timestamp).toLocaleString()}),a.jsx("span",{className:"pill text-[9px]",style:{background:J.type==="comparison"?"var(--purple-muted)":J.type==="baseline"?"var(--surface-3)":J.type==="model-compare"?"rgba(56,189,248,0.15)":J.type==="improve"||J.type==="instruct"?"rgba(168,85,247,0.15)":J.type==="ai-generate"?"rgba(34,197,94,0.15)":J.type==="eval-generate"?"rgba(251,146,60,0.15)":"var(--accent-muted)",color:J.type==="comparison"?"var(--purple)":J.type==="baseline"?"var(--text-tertiary)":J.type==="model-compare"?"#38bdf8":J.type==="improve"||J.type==="instruct"?"#a855f7":J.type==="ai-generate"?"#22c55e":J.type==="eval-generate"?"#fb923c":"var(--accent)"},children:J.type==="model-compare"?"model compare":J.type==="improve"?"ai improve":J.type==="instruct"?"ai edit":J.type==="ai-generate"?"ai generate":J.type==="eval-generate"?"eval generate":J.type})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:J.model}),a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:J.passRate>=.8?"var(--green)":J.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(J.passRate*100),"%"]})]})]})},J.timestamp)})}),F&&a.jsx(t1,{result:F}),se&&!L&&a.jsx(l1,{run:se,onClose:()=>U(null)})]}),x==="per-eval"&&a.jsx(Pv,{plugin:o,skill:u}),x==="statistics"&&a.jsx(Iv,{plugin:o,skill:u})]})}function t1({result:r}){const c=r.regressions.filter(u=>u.change==="regression"),o=r.regressions.filter(u=>u.change==="improvement");return a.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Comparison: ",new Date(r.runA.timestamp).toLocaleDateString()," vs ",new Date(r.runB.timestamp).toLocaleDateString()]}),c.length>0&&a.jsxs("div",{className:"mb-3",children:[a.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--red)"},children:["Regressions (",c.length,")"]}),c.map(u=>a.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",a.jsx("span",{style:{color:"var(--red)"},children:u.assertionId})," (was passing, now failing)"]},`${u.evalId}-${u.assertionId}`))]}),o.length>0&&a.jsxs("div",{className:"mb-3",children:[a.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--green)"},children:["Improvements (",o.length,")"]}),o.map(u=>a.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",a.jsx("span",{style:{color:"var(--green)"},children:u.assertionId})," (was failing, now passing)"]},`${u.evalId}-${u.assertionId}`))]}),a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 mt-3",style:{color:"var(--text-tertiary)"},children:"Case Diffs"}),a.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)"},children:a.jsxs("table",{className:"w-full text-[12px]",children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"var(--surface-2)"},children:[a.jsx("th",{className:"text-left px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Case"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run A"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run B"})]})}),a.jsx("tbody",{children:r.caseDiffs.map(u=>a.jsxs("tr",{style:{borderTop:"1px solid var(--border-subtle)"},children:[a.jsxs("td",{className:"px-3 py-2",style:{color:"var(--text-secondary)"},children:["#",u.eval_id," ",u.eval_name]}),a.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateA!=null?u.passRateA>=.8?"var(--green)":u.passRateA>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateA!=null?`${Math.round(u.passRateA*100)}%`:u.statusA}),a.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateB!=null?u.passRateB>=.8?"var(--green)":u.passRateB>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateB!=null?`${Math.round(u.passRateB*100)}%`:u.statusB})]},u.eval_id))})]})})]})}function l1({run:r,onClose:c}){return(r.type==="improve"||r.type==="instruct")&&r.improve?a.jsx(a1,{run:r,onClose:c}):a.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:["Run: ",new Date(r.timestamp).toLocaleString()]}),a.jsx("button",{onClick:c,className:"btn btn-ghost text-[11px]",children:"Close"})]}),a.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:["Model: ",r.model," | Cases: ",r.cases.length," | Pass Rate: ",r.overall_pass_rate!=null?`${Math.round(r.overall_pass_rate*100)}%`:"--"]}),a.jsx("div",{className:"space-y-2",children:r.cases.map(o=>a.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-2)"},children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-[12px]",style:{color:"var(--text-secondary)"},children:["#",o.eval_id," ",o.eval_name]}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:o.status==="pass"?"var(--green)":"var(--red)"},children:o.pass_rate!=null?`${Math.round(o.pass_rate*100)}%`:o.status})]})},o.eval_id))})]})}function a1({run:r,onClose:c}){var v;const o=h.useMemo(()=>r.improve?Er(r.improve.original,r.improve.improved):[],[r.improve]),u=h.useMemo(()=>{const p=o.filter(y=>y.type==="added").length,b=o.filter(y=>y.type==="removed").length;return{added:p,removed:b}},[o]),x=h.useMemo(()=>{let p=0,b=0;return o.map(y=>y.type==="removed"?(p++,{...y,origNum:p,newNum:null}):y.type==="added"?(b++,{...y,origNum:null,newNum:b}):(p++,b++,{...y,origNum:p,newNum:b}))},[o]);return a.jsxs("div",{className:"mt-4 rounded-xl overflow-hidden animate-fade-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),a.jsx("path",{d:"M2 17l10 5 10-5"}),a.jsx("path",{d:"M2 12l10 5 10-5"})]})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"}),a.jsxs("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[new Date(r.timestamp).toLocaleString()," · ",r.model]})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[a.jsxs("span",{style:{color:"var(--green)"},children:["+",u.added]}),a.jsxs("span",{style:{color:"var(--red)"},children:["-",u.removed]})]}),a.jsx("button",{onClick:c,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:p=>{p.currentTarget.style.background="var(--surface-3)"},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),((v=r.improve)==null?void 0:v.reasoning)&&a.jsxs("div",{className:"mx-4 mt-4 px-4 py-3 rounded-lg text-[12px]",style:{background:"rgba(168,85,247,0.06)",border:"1px solid rgba(168,85,247,0.15)",color:"var(--text-secondary)"},children:[a.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),r.improve.reasoning]}),a.jsx("div",{className:"mx-4 my-4 rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)",maxHeight:480,overflowY:"auto"},children:a.jsx("table",{className:"w-full",style:{borderCollapse:"collapse",fontFamily:"var(--font-mono, monospace)"},children:a.jsx("tbody",{children:x.map((p,b)=>a.jsxs("tr",{style:{background:p.type==="added"?"rgba(34,197,94,0.08)":p.type==="removed"?"rgba(239,68,68,0.08)":"transparent"},children:[a.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:p.type==="removed"?"rgba(239,68,68,0.5)":"var(--text-tertiary)",opacity:p.origNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:p.origNum??""}),a.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:p.type==="added"?"rgba(34,197,94,0.5)":"var(--text-tertiary)",opacity:p.newNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:p.newNum??""}),a.jsx("td",{className:"select-none text-center",style:{width:20,fontSize:11,fontWeight:700,color:p.type==="added"?"var(--green)":p.type==="removed"?"var(--red)":"transparent",borderRight:p.type==="added"?"2px solid var(--green)":p.type==="removed"?"2px solid var(--red)":"2px solid transparent"},children:p.type==="added"?"+":p.type==="removed"?"-":" "}),a.jsx("td",{className:"px-3 py-px whitespace-pre-wrap",style:{fontSize:11,lineHeight:1.6,color:p.type==="added"?"var(--green)":p.type==="removed"?"var(--red)":"var(--text-secondary)"},children:p.content||"​"})]},b))})})})]})}function n1({plugin:r,skill:c}){const[o,u]=h.useState([]),[x,v]=h.useState([]),[p,b]=h.useState(!0),[y,f]=h.useState(null);h.useEffect(()=>{Se.getDependencies(r,c).then(g=>{u(g.mcpDependencies),v(g.skillDependencies)}).catch(()=>{}).finally(()=>b(!1))},[r,c]);async function j(g,k){try{await navigator.clipboard.writeText(k),f(g),setTimeout(()=>f(null),2e3)}catch{}}return p?null:o.length===0&&x.length===0?a.jsx("div",{className:"mb-5 px-4 py-3 rounded-lg text-[12px]",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:"No dependencies detected"}):a.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[a.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(234,179,8,0.15)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#eab308",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),a.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),a.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Dependencies"}),a.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:o.length+x.length})]}),a.jsxs("div",{className:"px-5 py-4",children:[o.length>0&&a.jsxs("div",{className:"space-y-3 mb-4",children:[a.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"MCP Servers"}),o.map(g=>a.jsxs("div",{className:"p-3 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:g.server}),a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:g.transport})]}),a.jsx("button",{onClick:()=>j(g.server,g.configSnippet),className:"btn btn-ghost text-[11px] py-1 px-2",style:{color:y===g.server?"var(--green)":"var(--accent)"},children:y===g.server?a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})})," Copied!"]}):a.jsxs(a.Fragment,{children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})," Copy Config"]})})]}),a.jsx("div",{className:"text-[11px] mb-2 font-mono",style:{color:"var(--text-tertiary)"},children:g.url}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.matchedTools.map(k=>a.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:k},k))})]},g.server))]}),x.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--text-tertiary)"},children:"Skill Dependencies"}),a.jsx("div",{className:"space-y-1.5",children:x.map(g=>a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}),a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:g.name}),a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:g.source==="frontmatter"?"frontmatter":"referenced"})]},g.name))})]})]})]})}function zx({plugin:r,skill:c}){const[o,u]=h.useState([]),[x,v]=h.useState(!0),[p,b]=h.useState(null),[y,f]=h.useState(""),[j,g]=h.useState(!1),[k,w]=h.useState(null),[L,B]=h.useState(""),[Y,G]=h.useState(""),[F,le]=h.useState(!1),Q=h.useCallback(()=>{v(!0),Se.getCredentials(r,c).then(U=>u(U.credentials)).catch(()=>u([])).finally(()=>v(!1))},[r,c]);h.useEffect(()=>{Q()},[Q]);const ne=async(U,$)=>{if(!(!U.trim()||!$.trim())){g(!0),w(null);try{await Se.setCredential(r,c,U,$),b(null),f(""),Q()}catch(W){w(W.message)}finally{g(!1)}}},se=async()=>{if(!(!L.trim()||!Y.trim())){g(!0),w(null);try{await Se.setCredential(r,c,L.trim().toUpperCase(),Y),B(""),G(""),le(!1),Q()}catch(U){w(U.message)}finally{g(!1)}}};return x?a.jsxs("div",{className:"mt-6",children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--text-tertiary)"},children:"Parameters & Secrets"}),a.jsx("div",{className:"skeleton h-20 rounded-xl"})]}):a.jsxs("div",{className:"mt-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Parameters & Secrets"}),a.jsx("button",{onClick:()=>le(!F),className:"text-[11px] transition-colors duration-150",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"+ Add Parameter"})]}),k&&a.jsx("div",{className:"mb-2 px-3 py-2 rounded-lg text-[11px]",style:{background:"var(--error-muted, #3f1a1a)",color:"var(--error, #f87171)"},children:k}),o.length===0&&!F?a.jsx("div",{className:"text-[12px] text-center py-6 rounded-xl",style:{color:"var(--text-tertiary)",background:"var(--surface-2)"},children:"No credentials configured for this skill"}):a.jsx("div",{className:"rounded-xl overflow-hidden",style:{border:"1px solid var(--border-subtle)"},children:o.map(U=>a.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[a.jsx("span",{className:"text-[11px] font-mono font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:U.name}),a.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full",style:{background:U.status==="ready"||U.status==="resolved"?"rgba(52,211,153,0.15)":"rgba(251,146,60,0.15)",color:U.status==="ready"||U.status==="resolved"?"var(--green)":"#fb923c"},children:U.status==="ready"||U.status==="resolved"?"ready":"missing"}),U.source&&a.jsx("span",{className:"text-[9px]",style:{color:"var(--text-tertiary)"},children:U.source}),p===U.name?a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("input",{value:y,onChange:$=>f($.target.value),onKeyDown:$=>{$.key==="Enter"&&ne(U.name,y)},className:"input-field text-[11px] font-mono",style:{width:160},placeholder:"Value...",autoFocus:!0}),a.jsx("button",{onClick:()=>ne(U.name,y),disabled:j||!y.trim(),className:"btn btn-primary text-[10px] px-2 py-0.5",children:j?"...":"Save"}),a.jsx("button",{onClick:()=>{b(null),f("")},className:"btn btn-ghost text-[10px] px-1",children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}):a.jsx("button",{onClick:()=>{b(U.name),f("")},className:"btn btn-ghost text-[10px] px-2 py-0.5",style:{color:"var(--accent)"},children:"Edit"})]},U.name))}),F&&a.jsxs("div",{className:"mt-2 p-3 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex gap-2 mb-2",children:[a.jsx("input",{value:L,onChange:U=>B(U.target.value),className:"input-field flex-1 text-[11px] font-mono",placeholder:"KEY_NAME",autoFocus:!0}),a.jsx("input",{value:Y,onChange:U=>G(U.target.value),onKeyDown:U=>{U.key==="Enter"&&se()},className:"input-field flex-1 text-[11px] font-mono",placeholder:"Value",type:"password"})]}),a.jsxs("div",{className:"flex justify-end gap-1.5",children:[a.jsx("button",{onClick:()=>{le(!1),B(""),G("")},className:"btn btn-ghost text-[10px]",children:"Cancel"}),a.jsx("button",{onClick:se,disabled:j||!L.trim()||!Y.trim(),className:"btn btn-primary text-[10px]",children:j?"Saving...":"Save"})]})]})]})}function s1(){const{state:r}=il(),{plugin:c,skill:o}=r,[u,x]=h.useState(null),[v,p]=h.useState(!0);return h.useEffect(()=>{Se.getDependencies(c,o).then(x).catch(()=>{}).finally(()=>p(!1))},[c,o]),v?a.jsxs("div",{className:"p-5",children:[a.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),a.jsx("div",{className:"skeleton h-32 rounded-xl"})]}):u?a.jsxs("div",{className:"p-5 max-w-3xl",children:[a.jsx(n1,{plugin:c,skill:o}),a.jsx(zx,{plugin:c,skill:o})]}):a.jsxs("div",{className:"p-5 max-w-3xl",children:[a.jsx("div",{className:"text-[13px] mb-4",style:{color:"var(--text-tertiary)"},children:"No MCP dependency information available"}),a.jsx(zx,{plugin:c,skill:o})]})}function Jx({data:r}){if(r.length<2)return a.jsx("span",{style:{color:"var(--text-tertiary)",fontSize:10},children:"--"});const c=r.slice(-10),o=80,u=24,x=2,v=o-x*2,p=u-x*2,b=c.length,y=Math.min(...c),j=Math.max(...c)-y||1,g=c.map((L,B)=>{const Y=x+B/(b-1)*v,G=x+p-(L-y)/j*p;return`${Y.toFixed(1)},${G.toFixed(1)}`}),k=c[c.length-1],w=dn(k);return a.jsxs("svg",{width:o,height:u,viewBox:`0 0 ${o} ${u}`,style:{display:"block"},children:[a.jsx("polyline",{points:g.join(" "),fill:"none",stroke:w,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"}),(()=>{const[L,B]=g[g.length-1].split(",");return a.jsx("circle",{cx:L,cy:B,r:2.5,fill:w})})()]})}function r1(){return a.jsxs("span",{className:"pill",style:{background:"rgba(251,191,36,0.15)",color:"#fbbf24",fontSize:9,fontWeight:700,gap:3},children:[a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"#fbbf24",stroke:"none",children:a.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})}),"Best Model"]})}function i1({pct:r}){const c=r>=10?"var(--green)":r>=0?"var(--yellow)":"var(--red)",o=r>=10?"var(--green-muted)":r>=0?"var(--yellow-muted)":"var(--red-muted)",u=r>=0?"+":"";return a.jsxs("span",{className:"pill",style:{background:o,color:c,fontSize:10,fontWeight:600},children:[u,r.toFixed(1),"%"]})}function o1({score:r,rating:c}){const o={excellent:{bg:"var(--green-muted)",fg:"var(--green)"},good:{bg:"var(--green-muted)",fg:"var(--green)"},marginal:{bg:"var(--yellow-muted)",fg:"var(--yellow)"},minimal:{bg:"var(--yellow-muted)",fg:"var(--yellow)"},harmful:{bg:"var(--red-muted)",fg:"var(--red)"}},u=o[c]??o.minimal,x=r>=0?"+":"";return a.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"Skill Quality:"}),a.jsxs("span",{className:"pill",style:{background:u.bg,color:u.fg,fontSize:11,fontWeight:600},children:[x,r.toFixed(1),"% (",c.toUpperCase(),")"]})]})}function c1({warning:r}){return a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg mb-3",style:{background:"var(--yellow-muted)",border:"1px solid rgba(251,191,36,0.3)"},children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--yellow)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),a.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),a.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--yellow)"},children:r})]})}function u1({active:r,onChange:c,hasBaseline:o}){return a.jsxs("div",{className:"flex gap-1 p-0.5 rounded-lg",style:{background:"var(--surface-2)"},children:[a.jsx("button",{onClick:()=>c("rankings"),className:"px-3 py-1 rounded-md text-[11px] font-medium transition-all",style:{background:r==="rankings"?"var(--surface-3)":"transparent",color:r==="rankings"?"var(--text-primary)":"var(--text-tertiary)"},children:"Rankings"}),a.jsx("button",{onClick:()=>c("amplification"),disabled:!o,className:"px-3 py-1 rounded-md text-[11px] font-medium transition-all",style:{background:r==="amplification"?"var(--surface-3)":"transparent",color:o&&r==="amplification"?"var(--text-primary)":"var(--text-tertiary)",opacity:o?1:.5,cursor:o?"pointer":"not-allowed"},title:o?"View skill amplification data":"Run sweep with --baseline to see amplification data",children:"Skill Amplification"})]})}function d1(r){var u,x,v;if(r.length===0)return[];const c=new Map;for(const p of r)for(const b of p.models){if(b.status==="error")continue;const y=`${b.provider}/${b.model}`;c.has(y)||c.set(y,{provider:b.provider,passRates:[],lastRubric:null,lastDuration:0,lastCost:null,lastBaselinePassRate:void 0,lastSkillDelta:void 0,lastAmplificationPct:void 0,lastCompositeScore:void 0,hasBaseline:!1});const f=c.get(y);f.passRates.push(b.passRate.mean),f.lastRubric=((u=b.rubricScore)==null?void 0:u.mean)??null,f.lastDuration=b.duration.mean,f.lastCost=((x=b.cost)==null?void 0:x.total)??null,f.lastCompositeScore=b.compositeScore,b.baselinePassRate!=null&&(f.lastBaselinePassRate=b.baselinePassRate.mean,f.lastSkillDelta=(v=b.skillDelta)==null?void 0:v.mean,f.lastAmplificationPct=b.amplificationPct,f.hasBaseline=!0)}const o=[];for(const[p,b]of c){const[y,...f]=p.split("/");o.push({rank:0,model:f.join("/"),provider:y,passRate:b.passRates[b.passRates.length-1],rubricScore:b.lastRubric,duration:b.lastDuration,cost:b.lastCost,sparklineData:b.passRates,isBest:!1,baselinePassRate:b.lastBaselinePassRate,skillDelta:b.lastSkillDelta,amplificationPct:b.lastAmplificationPct,compositeScore:b.lastCompositeScore,hasBaseline:b.hasBaseline})}return o.sort((p,b)=>{const y=p.compositeScore??p.passRate;return(b.compositeScore??b.passRate)-y}),o.forEach((p,b)=>{p.rank=b+1}),o.length>0&&(o[0].isBest=!0),o}const Wx=(r="left")=>({padding:"10px 12px",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary)",textAlign:r,whiteSpace:"nowrap"});function f1({entries:r}){return a.jsx("div",{className:"glass-card",style:{overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["#","Model","Pass Rate","Rubric","Duration","Cost","Trend"].map(c=>a.jsx("th",{style:Wx(c==="#"?"center":"left"),children:c},c))})}),a.jsx("tbody",{children:r.map(c=>a.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},onMouseEnter:o=>{o.currentTarget.style.background="var(--surface-2)"},onMouseLeave:o=>{o.currentTarget.style.background="transparent"},children:[a.jsx("td",{style:{padding:"10px 12px",textAlign:"center",fontSize:12,fontWeight:600,color:"var(--text-tertiary)",width:40},children:c.rank}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:c.model}),a.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:c.provider}),c.isBest&&a.jsx(r1,{})]})}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsxs("span",{className:"pill",style:{background:c.passRate>=.7?"var(--green-muted)":c.passRate>=.4?"var(--yellow-muted)":"var(--red-muted)",color:dn(c.passRate),fontSize:11,fontWeight:600},children:[Math.round(c.passRate*100),"%"]})}),a.jsx("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-secondary)"},children:c.rubricScore!=null?c.rubricScore.toFixed(1):"--"}),a.jsx("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-secondary)"},children:c.duration<1e3?`${Math.round(c.duration)}ms`:`${(c.duration/1e3).toFixed(1)}s`}),a.jsx("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-secondary)"},children:c.cost!=null?`$${c.cost.toFixed(4)}`:"N/A"}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsx(Jx,{data:c.sparklineData})})]},`${c.provider}/${c.model}`))})]})})}function x1({entries:r}){const c=[...r].filter(o=>o.hasBaseline).sort((o,u)=>(u.amplificationPct??0)-(o.amplificationPct??0));return c.length===0?a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx("div",{className:"text-center",children:a.jsxs("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:["No baseline data available. Run sweep with ",a.jsx("code",{children:"--baseline"})," flag."]})})}):a.jsx("div",{className:"glass-card",style:{overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["#","Model","With Skill","Without Skill","Delta","Amplification","Trend"].map(o=>a.jsx("th",{style:Wx(o==="#"?"center":"left"),children:o},o))})}),a.jsx("tbody",{children:c.map((o,u)=>a.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},onMouseEnter:x=>{x.currentTarget.style.background="var(--surface-2)"},onMouseLeave:x=>{x.currentTarget.style.background="transparent"},children:[a.jsx("td",{style:{padding:"10px 12px",textAlign:"center",fontSize:12,fontWeight:600,color:"var(--text-tertiary)",width:40},children:u+1}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:o.model}),a.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:o.provider})]})}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsxs("span",{className:"pill",style:{background:o.passRate>=.7?"var(--green-muted)":o.passRate>=.4?"var(--yellow-muted)":"var(--red-muted)",color:dn(o.passRate),fontSize:11,fontWeight:600},children:[Math.round(o.passRate*100),"%"]})}),a.jsx("td",{style:{padding:"10px 12px"},children:o.baselinePassRate!=null?a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:[Math.round(o.baselinePassRate*100),"%"]}):"--"}),a.jsx("td",{style:{padding:"10px 12px"},children:o.skillDelta!=null?a.jsxs("span",{className:"text-[11px] font-medium",style:{color:o.skillDelta>=0?"var(--green)":"var(--red)"},children:[o.skillDelta>=0?"+":"",(o.skillDelta*100).toFixed(1),"pp"]}):"--"}),a.jsx("td",{style:{padding:"10px 12px"},children:o.amplificationPct!=null&&isFinite(o.amplificationPct)?a.jsx(i1,{pct:o.amplificationPct}):"--"}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsx(Jx,{data:o.sparklineData})})]},`${o.provider}/${o.model}`))})]})})}function p1(){const{state:r}=il(),{plugin:c,skill:o}=r,[u,x]=h.useState([]),[v,p]=h.useState(!0),[b,y]=h.useState(null),[f,j]=h.useState("rankings");h.useEffect(()=>{p(!0),y(null),j("rankings"),Se.getLeaderboard(c,o).then(B=>x(B.entries)).catch(B=>y(B instanceof Error?B.message:String(B))).finally(()=>p(!1))},[c,o]);const g=h.useMemo(()=>d1(u),[u]),k=g.some(B=>B.hasBaseline),w=u[0],L=w==null?void 0:w.judgeBiasWarning;return v?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("div",{className:"spinner spinner-lg"})}):b?a.jsx("div",{className:"flex items-center justify-center h-full px-8",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--red)"},children:"Failed to load leaderboard"}),a.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:b})]})}):g.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 px-8",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:"var(--accent-muted)"},children:a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M18 20V10"}),a.jsx("path",{d:"M12 20V4"}),a.jsx("path",{d:"M6 20v-6"})]})}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No sweep results yet"}),a.jsx("div",{className:"text-[12px] mb-3",style:{color:"var(--text-tertiary)"},children:"Run your first model sweep to compare performance across models:"}),a.jsx("div",{className:"text-[11px] font-mono px-4 py-3 rounded-lg text-left",style:{background:"var(--surface-2)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},children:'vskill eval sweep --models "anthropic/claude-sonnet-4,openrouter/meta-llama/llama-3.1-70b" --judge "anthropic/claude-sonnet-4"'}),a.jsxs("div",{className:"text-[11px] mt-2",style:{color:"var(--text-tertiary)"},children:["Add ",a.jsx("code",{children:"--baseline"})," to measure skill amplification per model."]})]})]}):a.jsxs("div",{className:"p-5 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"text-[15px] font-semibold",style:{color:"var(--text-primary)"},children:"Model Leaderboard"}),a.jsx(u1,{active:f,onChange:j,hasBaseline:k})]}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[u.length," sweep",u.length!==1?"s":""," · ",g.length," model",g.length!==1?"s":""]})]}),L&&a.jsx(c1,{warning:L}),f==="rankings"?a.jsx(f1,{entries:g}):a.jsx(x1,{entries:g}),f==="amplification"&&(w==null?void 0:w.skillQualityScore)!=null&&(w==null?void 0:w.skillQualityRating)&&a.jsx(o1,{score:w.skillQualityScore,rating:w.skillQualityRating})]})}const m1=["editor","tests","run","activation","history","leaderboard","deps"];function h1(r){return r!=null&&m1.includes(r)}function v1(){const{state:r,dispatch:c,saveContent:o,isReadOnly:u}=il(),{refreshSkills:x,clearSelection:v}=na(),p=h.useCallback(async()=>{try{await Se.deleteSkill(r.plugin,r.skill),x(),v()}catch(f){const j=f instanceof Error?f.message:String(f);c({type:"SET_ERROR",error:`Failed to delete skill: ${j}`})}},[r.plugin,r.skill,x,v,c]);h.useEffect(()=>{const j=new URLSearchParams(window.location.search).get("panel");h1(j)&&j!==r.activePanel&&c({type:"SET_PANEL",panel:j})},[]),h.useEffect(()=>{const f=new URLSearchParams(window.location.search);f.set("panel",r.activePanel);const j=`${window.location.pathname}?${f.toString()}${window.location.hash}`;history.replaceState(null,"",j)},[r.activePanel]);const b=h.useCallback(f=>{const j=f.ctrlKey||f.metaKey;if(j&&f.key>="1"&&f.key<="7"){f.preventDefault(),c({type:"SET_PANEL",panel:["editor","tests","run","activation","history","leaderboard","deps"][parseInt(f.key)-1]});return}if(j&&f.key==="s"&&!f.shiftKey){f.preventDefault(),r.isDirty&&o();return}},[r.isDirty,o,c]);if(h.useEffect(()=>(window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)),[b]),r.loading)return a.jsx("div",{className:"flex items-center justify-center h-full",style:{background:"var(--surface-0)"},children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("div",{className:"spinner spinner-lg"}),a.jsx("span",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"Loading workspace..."})]})});const y=Array.from(r.caseRunStates.values()).some(f=>f.status==="running"||f.status==="queued");return a.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[a.jsx($h,{state:r,isReadOnly:u,onDelete:u?void 0:p}),r.error&&a.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("span",{className:"flex-1",children:r.error}),a.jsx("button",{onClick:()=>c({type:"SET_ERROR",error:null}),style:{background:"none",border:"none",cursor:"pointer",color:"var(--red)",padding:2},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx(Ph,{activePanel:r.activePanel,onPanelChange:f=>c({type:"SET_PANEL",panel:f}),isDirty:r.isDirty,isRunning:y,hasRegressions:r.regressions.length>0,isActivationRunning:r.activationRunning}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{background:"var(--surface-0)"},children:a.jsxs("div",{className:"animate-fade-in",style:{height:"100%",overflow:"auto"},children:[r.activePanel==="editor"&&a.jsx(Ev,{}),r.activePanel==="tests"&&a.jsx(wv,{}),r.activePanel==="run"&&a.jsx(Ov,{}),r.activePanel==="activation"&&a.jsx(qv,{}),r.activePanel==="history"&&a.jsx(e1,{}),r.activePanel==="leaderboard"&&a.jsx(p1,{}),r.activePanel==="deps"&&a.jsx(s1,{})]},r.activePanel)})]})}function rc(r,c=!0){let o=r.toLowerCase().replace(/[^a-z0-9]+/g,"-");return c&&(o=o.replace(/^-+|-+$/g,"")),o}function y1(r,c,o,u){const v=`.../${r.split("/").slice(-2).join("/")}`;switch(c){case 1:return`${v}/${o}/skills/${u}/SKILL.md`;case 2:return`${v}/plugins/${o}/skills/${u}/SKILL.md`;case 3:return`${v}/skills/${u}/SKILL.md`}}function g1({onCreated:r,resolveAiConfigOverride:c}){const[o,u]=h.useState("ai"),[x,v]=h.useState(null),[p,b]=h.useState(!0),{config:y}=Na(),[f,j]=h.useState(""),[g,k]=h.useState(3),[w,L]=h.useState(""),[B,Y]=h.useState(""),[G,F]=h.useState(""),[le,Q]=h.useState(""),[ne,se]=h.useState(""),[U,$]=h.useState(""),[W,he]=h.useState("write"),[ve,ye]=h.useState(!1),[J,te]=h.useState(null),[me,T]=h.useState(""),[_,ee]=h.useState(!1),[O,Z]=h.useState(!1),[S,z]=h.useState(null),[I,P]=h.useState(null),[ue,ae]=h.useState([]),be=h.useRef(null),Be=h.useRef(null),Ae=h.useRef(null),ut=h.useRef(null),[Lt,K]=h.useState(!1),[re,ie]=h.useState(!1);h.useEffect(()=>{Se.getProjectLayout().then(X=>{v(X),k(X.suggestedLayout);const Le=X.detectedLayouts.find(at=>at.layout===X.suggestedLayout);Le!=null&&Le.existingPlugins.length&&L(Le.existingPlugins[0])}).catch(()=>{}).finally(()=>b(!1))},[]),h.useEffect(()=>{var X;o==="ai"&&((X=be.current)==null||X.focus())},[o]),h.useEffect(()=>()=>{var X;(X=Be.current)==null||X.abort()},[]);const fe=h.useMemo(()=>{var X;return x?((X=x.detectedLayouts.find(Le=>Le.layout===g))==null?void 0:X.existingPlugins)||[]:[]},[x,g]),pe=w==="__new__"?B:w,Ve=x?y1(x.root,g,pe||"{plugin}",f||"{skill}"):"",dt=h.useMemo(()=>x?x.detectedLayouts.filter(X=>X.layout!==4):[],[x]),Xe=h.useMemo(()=>{if(!x)return null;const X=x.detectedLayouts.find(Je=>Je.layout===2&&Je.existingPlugins.length>0),Le=x.detectedLayouts.find(Je=>Je.layout===1&&Je.existingPlugins.length>0),at=X||Le;return at?{layout:at.layout,plugins:at.existingPlugins}:null},[x]),zt=h.useCallback(()=>{if(c)return c();if(!y)return{provider:"claude-cli",model:"sonnet"};const X=y.provider||"claude-cli";let Le=y.model||"sonnet";return X==="claude-cli"&&Le.startsWith("claude-")&&(Le=Le.replace("claude-","")),{provider:X,model:Le}},[y,c]),mt=h.useCallback(()=>{var X;(X=Be.current)==null||X.abort(),ee(!1)},[]),tl=h.useCallback(()=>{z(null),P(null)},[]),Qt=h.useCallback(async()=>{if(z(null),P(null),ae([]),Ae.current=null,!me.trim()){z("Describe what your skill should do");return}ee(!0);const X=new AbortController;Be.current=X;const{provider:Le,model:at}=zt();try{const Je=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:me.trim(),provider:Le,model:at}),signal:X.signal});if(!Je.ok||!Je.body){let Fe=`HTTP ${Je.status}`;try{const nt=await Je.json();nt.error&&(Fe=nt.error)}catch{}throw new Error(Fe)}const Rl=Je.body.getReader(),Ot=new TextDecoder;let sa="",Et="";for(;;){const{done:Fe,value:nt}=await Rl.read();if(Fe)break;sa+=Ot.decode(nt,{stream:!0});const et=sa.split(`
68
+ `);sa=et.pop()||"";for(const ll of et)if(ll.startsWith("event: "))Et=ll.slice(7).trim();else if(ll.startsWith("data: ")){try{const Qe=JSON.parse(ll.slice(6));if(Et==="progress")ae(al=>[...al,{phase:Qe.phase,message:Qe.message,timestamp:Date.now()}]);else if(Et==="done"||Et==="complete"){const al={prompt:me.trim(),provider:zt().provider,model:zt().model,reasoning:Qe.reasoning||""};if(j(Qe.name),F(Qe.description),Q(Qe.model||""),se(Qe.allowedTools||""),$(Qe.body),Z(!0),Ae.current=al,u("manual"),Qe.suggestedPlugin&&typeof Qe.suggestedPlugin=="object"&&Qe.suggestedPlugin.plugin){const Ge=Qe.suggestedPlugin;if(((x==null?void 0:x.detectedLayouts.flatMap(kt=>kt.existingPlugins))??[]).includes(Ge.plugin))if(L(Ge.plugin),Ge.layout&&(Ge.layout===1||Ge.layout===2))k(Ge.layout);else{const kt=x==null?void 0:x.detectedLayouts.find(Ea=>Ea.existingPlugins.includes(Ge.plugin));kt&&(kt.layout===1||kt.layout===2)&&k(kt.layout)}else L("__new__"),Y(Ge.plugin)}else g===3&&Xe&&ie(!0);const st={name:Qe.name,plugin:pe||"",layout:g,description:Qe.description,model:Qe.model||void 0,allowedTools:Qe.allowedTools||void 0,body:Qe.body,aiMeta:al};Se.saveDraft(st).then(Ge=>{K(!0),Ge!=null&&Ge.dir&&(ut.current=Ge.dir)}).catch(()=>{})}else Et==="error"&&(z(Qe.message||Qe.description||"Unknown error"),Qe.category&&P(Qe))}catch{}Et=""}}}catch(Je){Je.name!=="AbortError"&&z(Je.message)}finally{ee(!1),Be.current=null}},[me,zt,g,Xe,pe,x]),We=h.useCallback(async()=>{if(te(null),!f.trim()){te("Skill name is required");return}if(!G.trim()){te("Description is required");return}if(g!==3&&!pe.trim()){te("Plugin name is required");return}ye(!0);try{const X=await Se.createSkill({name:rc(f),plugin:pe||"",layout:g,description:G,model:le||void 0,allowedTools:ne||void 0,body:U,aiMeta:Ae.current||void 0,draftDir:ut.current||void 0});ut.current=null,r(X.plugin,X.skill)}catch(X){te(X.message)}finally{ye(!1)}},[f,G,g,pe,le,ne,U,r]),Dt=h.useCallback(()=>{Xe&&(k(Xe.layout),L(Xe.plugins[0]),ie(!1))},[Xe]);return{mode:o,setMode:u,layout:x,layoutLoading:p,selectedLayout:g,setSelectedLayout:k,creatableLayouts:dt,availablePlugins:fe,pathPreview:Ve,plugin:w,setPlugin:L,newPlugin:B,setNewPlugin:Y,effectivePlugin:pe,name:f,setName:j,description:G,setDescription:F,model:le,setModel:Q,allowedTools:ne,setAllowedTools:se,body:U,setBody:$,bodyViewMode:W,setBodyViewMode:he,aiPrompt:me,setAiPrompt:T,generating:_,aiGenerated:O,aiError:S,aiClassifiedError:I,aiProgress:ue,promptRef:be,handleGenerate:Qt,handleCancelGenerate:mt,clearAiError:tl,draftSaved:Lt,showPluginRecommendation:re,setShowPluginRecommendation:ie,pluginLayoutInfo:Xe,applyPluginRecommendation:Dt,creating:ve,error:J,handleCreate:We}}function Fx(){return a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function b1(){return a.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Ix({node:r,depth:c=0}){var o;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",style:{paddingLeft:`${c*16}px`,color:r.type==="dir"?"var(--text-secondary)":"var(--text-tertiary)",fontSize:12,fontFamily:"var(--font-mono, monospace)"},children:[r.type==="dir"?a.jsx(Fx,{}):a.jsx(b1,{}),a.jsxs("span",{children:[r.name,r.type==="dir"?"/":""]})]}),(o=r.children)==null?void 0:o.map(u=>a.jsx(Ix,{node:u,depth:c+1},u.name))]})}function j1(r,c,o){const u=[];c&&u.push({name:"evals.json",type:"file"}),u.push({name:"history",type:"dir"});const x=[{name:"SKILL.md",type:"file"},{name:"evals",type:"dir",children:u}];return o&&x.push({name:"draft.json",type:"file"}),{name:r||"{skill}",type:"dir",children:x}}function S1({skillName:r,hasEvals:c,isDraft:o}){const u=j1(r,c,o);return a.jsxs("div",{className:"glass-card p-4",children:[a.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[a.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"var(--accent-muted)"},children:a.jsx(Fx,{})}),"Skill Structure"]}),a.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-0)",border:"1px solid var(--border-subtle)"},children:a.jsx(Ix,{node:u})})]})}const aa={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Po({size:r=14,color:c="currentColor"}){return a.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M12 3l1.912 5.813a2 2 0 001.275 1.275L21 12l-5.813 1.912a2 2 0 00-1.275 1.275L12 21l-1.912-5.813a2 2 0 00-1.275-1.275L3 12l5.813-1.912a2 2 0 001.275-1.275L12 3z"})})}function N1({onCreated:r,onCancel:c}){const o=g1({onCreated:r});return a.jsxs("div",{className:"px-8 py-6 max-w-4xl animate-fade-in overflow-auto h-full",children:[a.jsxs("div",{className:"mb-5",children:[a.jsx("h2",{className:"text-[20px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),a.jsx("div",{className:"flex items-center justify-between mt-2",children:a.jsxs("div",{className:"inline-flex rounded-lg p-0.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[a.jsx("button",{onClick:()=>o.setMode("ai"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:o.mode==="ai"?"rgba(168,85,247,0.15)":"transparent",color:o.mode==="ai"?"#a855f7":"var(--text-tertiary)",boxShadow:o.mode==="ai"?"0 1px 3px rgba(168,85,247,0.15)":"none",cursor:"pointer",border:"none"},children:a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx(Po,{size:12}),"AI-Assisted"]})}),a.jsx("button",{onClick:()=>o.setMode("manual"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:o.mode==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:o.mode==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:o.mode==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none",cursor:"pointer",border:"none"},children:"Manual"})]})})]}),o.layoutLoading&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),a.jsx("div",{className:"skeleton h-10 w-full rounded-lg"})]}),!o.layoutLoading&&o.layout&&o.mode==="ai"&&a.jsxs("div",{className:"space-y-4 animate-fade-in",children:[a.jsxs("div",{className:"glass-card p-4",children:[a.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[a.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:a.jsx(Po,{size:11,color:"#a855f7"})}),"Describe Your Skill"]}),a.jsx("textarea",{ref:o.promptRef,value:o.aiPrompt,onChange:u=>o.setAiPrompt(u.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
69
+
70
+ Include any specific behaviors, constraints, or output formats you want.`,rows:5,disabled:o.generating,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...aa,minHeight:"120px"},onKeyDown:u=>{u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),o.handleGenerate())}}),a.jsx("p",{className:"text-[11px] mt-2",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]}),o.generating&&o.aiProgress.length>0&&a.jsx(ss,{entries:o.aiProgress,isRunning:!0}),o.aiError&&a.jsx("div",{children:o.aiClassifiedError?a.jsx(kr,{error:o.aiClassifiedError,onRetry:o.handleGenerate,onDismiss:o.clearAiError}):a.jsxs("div",{children:[a.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:o.aiError}),a.jsx("button",{onClick:o.handleGenerate,className:"mt-2 text-[12px] font-medium",style:{color:"#a855f7",background:"none",border:"none",cursor:"pointer"},children:"Retry"})]})}),a.jsxs("div",{className:"flex items-center gap-3",children:[o.generating?a.jsx("button",{onClick:o.handleCancelGenerate,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:"var(--surface-3)",color:"var(--text-secondary)",border:"none",cursor:"pointer"},children:"Cancel Generation"}):a.jsxs("button",{onClick:o.handleGenerate,disabled:!o.aiPrompt.trim(),className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:o.aiPrompt.trim()?"#a855f7":"var(--surface-3)",color:o.aiPrompt.trim()?"#fff":"var(--text-tertiary)",cursor:o.aiPrompt.trim()?"pointer":"not-allowed",border:"none"},children:[a.jsx(Po,{size:14}),"Generate"]}),a.jsx("button",{onClick:c,className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer"},children:"Cancel"}),!o.generating&&a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["or fill in the form manually",a.jsx("button",{onClick:()=>o.setMode("manual"),className:"ml-1 font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"below"})]})]})]}),!o.layoutLoading&&o.layout&&o.mode==="manual"&&a.jsxs("div",{className:"space-y-4 animate-fade-in",children:[a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Location"}),o.creatableLayouts.length>1&&a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Layout"}),a.jsx("div",{className:"flex gap-2",children:o.creatableLayouts.map(u=>a.jsx("button",{onClick:()=>{o.setSelectedLayout(u.layout),o.setPlugin(u.existingPlugins[0]||""),o.setNewPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:o.selectedLayout===u.layout?"var(--accent)":"var(--surface-3)",color:o.selectedLayout===u.layout?"#fff":"var(--text-secondary)",border:`1px solid ${o.selectedLayout===u.layout?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},children:u.label},u.layout))})]}),o.selectedLayout!==3&&a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Plugin"}),a.jsxs("select",{value:o.plugin,onChange:u=>{o.setPlugin(u.target.value),o.setNewPlugin("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:aa,children:[o.availablePlugins.map(u=>a.jsx("option",{value:u,children:u},u)),a.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),o.plugin==="__new__"&&a.jsx("input",{type:"text",value:o.newPlugin,onChange:u=>o.setNewPlugin(rc(u.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:aa})]}),a.jsx("div",{className:"px-3 py-2 rounded-lg text-[11px] font-mono",style:{background:"var(--surface-0)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:o.pathPreview})]}),o.showPluginRecommendation&&o.pluginLayoutInfo&&o.selectedLayout===3&&a.jsxs("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in flex items-center justify-between gap-3",style:{background:"rgba(59,130,246,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(59,130,246,0.2)"},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3b82f6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),a.jsxs("span",{children:["Plugins detected (",a.jsx("strong",{children:o.pluginLayoutInfo.plugins.slice(0,3).join(", ")}),"). Add this skill to a plugin for better organization."]})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[a.jsx("button",{onClick:o.applyPluginRecommendation,className:"px-3 py-1 rounded-md text-[11px] font-medium",style:{background:"#3b82f6",color:"#fff",border:"none",cursor:"pointer"},children:"Use plugin"}),a.jsx("button",{onClick:()=>o.setShowPluginRecommendation(!1),className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Skill Details"}),a.jsxs("div",{className:"mb-3",children:[a.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Name ",a.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),a.jsx("input",{type:"text",value:o.name,onChange:u=>o.setName(rc(u.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:aa})]}),a.jsxs("div",{className:"mb-3",children:[a.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Description ",a.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),a.jsx("textarea",{value:o.description,onChange:u=>o.setDescription(u.target.value),placeholder:"Brief description",rows:3,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-y",style:{...aa,minHeight:"72px"}})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),a.jsxs("select",{value:o.model,onChange:u=>o.setModel(u.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:aa,children:[a.jsx("option",{value:"",children:"Any"}),a.jsx("option",{value:"opus",children:"Opus"}),a.jsx("option",{value:"sonnet",children:"Sonnet"}),a.jsx("option",{value:"haiku",children:"Haiku"})]})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Allowed Tools"}),a.jsx("input",{type:"text",value:o.allowedTools,onChange:u=>o.setAllowedTools(u.target.value),placeholder:"Read, Write, Edit...",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:aa})]})]})]}),a.jsxs("div",{className:"glass-card p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--accent-muted)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),a.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),a.jsxs("div",{children:[a.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md"}),a.jsx("span",{className:"text-[11px] ml-2",style:{color:"var(--text-tertiary)"},children:"Skill Definition"})]})]}),a.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:["write","preview"].map(u=>a.jsxs("button",{onClick:()=>o.setBodyViewMode(u),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:o.bodyViewMode===u?"var(--surface-4)":"transparent",color:o.bodyViewMode===u?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:o.bodyViewMode===u?600:400,border:"none",cursor:"pointer"},children:[u==="write"?a.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"16 18 22 12 16 6"}),a.jsx("polyline",{points:"8 6 2 12 8 18"})]}):a.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),a.jsx("span",{children:u==="write"?"Write":"Preview"})]},u))})]}),o.bodyViewMode==="write"?a.jsx("textarea",{value:o.body,onChange:u=>o.setBody(u.target.value),placeholder:`# /my-skill
71
+
72
+ You are an expert at...
73
+ `,rows:8,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...aa,minHeight:"150px"}}):o.body.trim()?a.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"150px",maxHeight:"400px",overflowY:"auto"},dangerouslySetInnerHTML:{__html:Nr(o.body)}}):a.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"150px",maxHeight:"400px",overflowY:"auto"},children:a.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),a.jsx(S1,{skillName:o.name||"{skill}",hasEvals:!1,isDraft:o.draftSaved}),o.error&&a.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:o.error}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:o.handleCreate,disabled:o.creating||!o.name||!o.description,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:o.creating||!o.name||!o.description?"var(--surface-3)":"var(--accent)",color:o.creating||!o.name||!o.description?"var(--text-tertiary)":"#fff",cursor:o.creating||!o.name||!o.description?"not-allowed":"pointer",border:"none"},children:o.creating?"Creating...":"Create Skill"}),a.jsx("button",{onClick:c,className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer"},children:"Cancel"})]})]})]})}function E1(){return a.jsx("div",{className:"w-16 h-16 rounded-2xl flex items-center justify-center",style:{background:"var(--surface-2)"},children:a.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),a.jsx("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),a.jsx("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]})})}function ec({variant:r,message:c,onRetry:o}){const{setMode:u,setSearch:x}=na(),[v,p]=h.useState(!1);return r==="no-selection"?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:[a.jsx("div",{className:"mb-5",children:v?a.jsx(E1,{}):a.jsx("img",{src:"/images/empty-studio.webp",width:128,height:128,alt:"",onError:()=>p(!0),style:{objectFit:"contain"}})}),a.jsx("p",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-secondary)"},children:"Select a skill to view details"}),a.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Choose a skill from the list to edit, test, and evaluate"})]}):r==="no-skills"?a.jsxs("div",{className:"text-center py-12 px-4 animate-fade-in-scale",children:[a.jsx("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mx-auto mb-4",style:{background:"var(--surface-2)"},children:a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})})}),a.jsx("p",{className:"text-[14px] font-medium",style:{color:"var(--text-secondary)"},children:"No skills found"}),a.jsxs("p",{className:"text-[12px] mt-1 mb-4",style:{color:"var(--text-tertiary)"},children:["Check your ",a.jsx("code",{className:"px-1.5 py-0.5 rounded text-[11px]",style:{background:"var(--surface-2)"},children:"--root"})," directory, or create your first skill"]}),a.jsxs("button",{onClick:()=>u("create"),className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:"var(--accent)",color:"#fff",border:"none",cursor:"pointer"},onMouseEnter:b=>{b.currentTarget.style.opacity="0.9"},onMouseLeave:b=>{b.currentTarget.style.opacity="1"},children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Create Your First Skill"]})]}):r==="error"?a.jsx("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:a.jsxs("div",{className:"px-5 py-4 rounded-lg text-center max-w-sm",style:{background:"var(--red-muted)",border:"1px solid rgba(248,113,113,0.2)"},children:[a.jsx("p",{className:"text-[13px] mb-3",style:{color:"var(--red)"},children:c||"Failed to load skill data"}),o&&a.jsx("button",{onClick:o,className:"px-4 py-2 rounded-lg text-[12px] font-medium",style:{background:"var(--surface-3)",color:"var(--text-primary)",border:"none",cursor:"pointer"},children:"Retry"})]})}):a.jsxs("div",{className:"px-4 py-8 text-center animate-fade-in",children:[a.jsx("p",{className:"text-[13px] mb-2",style:{color:"var(--text-tertiary)"},children:"No skills match your search"}),a.jsx("button",{onClick:()=>x(""),className:"text-[12px] font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear search"})]})}function Dx(){const{state:r,setMobileView:c}=na();return r.isMobile?a.jsxs("button",{onClick:()=>c("list"),className:"flex items-center gap-1.5 px-3 py-2 text-[12px] font-medium",style:{background:"var(--surface-1)",color:"var(--text-secondary)",border:"none",borderBottom:"1px solid var(--border-subtle)",cursor:"pointer",width:"100%"},children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"15 18 9 12 15 6"})}),"Back to skills"]}):null}function k1(){const{state:r,selectSkill:c,setMode:o,refreshSkills:u}=na();if(r.mode==="create")return a.jsxs("div",{className:"h-full overflow-auto animate-fade-in",children:[a.jsx(Dx,{}),a.jsx(N1,{onCreated:(b,y)=>{o("browse"),u(),c({plugin:b,skill:y,origin:"source"})},onCancel:()=>o("browse")})]});if(!r.selectedSkill)return r.skillsError?a.jsx(ec,{variant:"error",message:r.skillsError,onRetry:u}):!r.skillsLoading&&r.skills.length===0?a.jsx(ec,{variant:"no-skills"}):a.jsx(ec,{variant:"no-selection"});const{plugin:x,skill:v,origin:p}=r.selectedSkill;return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsx(Dx,{}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx(Xh,{plugin:x,skill:v,origin:p,children:a.jsx(v1,{})},`${x}/${v}`)})]})}function T1(){return a.jsx(wh,{children:a.jsx(kh,{children:a.jsx(Ah,{left:a.jsx(Bh,{}),right:a.jsx(k1,{})})})})}jh.createRoot(document.getElementById("root")).render(a.jsx(h.StrictMode,{children:a.jsx(T1,{})}));