vskill 0.4.2 → 0.4.4

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,75 @@
1
+ (function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))u(p);new MutationObserver(p=>{for(const h of p)if(h.type==="childList")for(const x of h.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&u(x)}).observe(document,{childList:!0,subtree:!0});function d(p){const h={};return p.integrity&&(h.integrity=p.integrity),p.referrerPolicy&&(h.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?h.credentials="include":p.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function u(p){if(p.ep)return;p.ep=!0;const h=d(p);fetch(p.href,h)}})();var Rc={exports:{}},Jn={};/**
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 Wf;function Jp(){if(Wf)return Jn;Wf=1;var i=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function d(u,p,h){var x=null;if(h!==void 0&&(x=""+h),p.key!==void 0&&(x=""+p.key),"key"in p){h={};for(var b in p)b!=="key"&&(h[b]=p[b])}else h=p;return p=h.ref,{$$typeof:i,type:u,key:x,ref:p!==void 0?p:null,props:h}}return Jn.Fragment=o,Jn.jsx=d,Jn.jsxs=d,Jn}var Ff;function $p(){return Ff||(Ff=1,Rc.exports=Jp()),Rc.exports}var n=$p(),wc={exports:{}},fe={};/**
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 If;function Wp(){if(If)return fe;If=1;var i=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),x=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),A=Symbol.iterator;function z(S){return S===null||typeof S!="object"?null:(S=A&&S[A]||S["@@iterator"],typeof S=="function"?S:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,K={};function te(S,D,Z){this.props=S,this.context=D,this.refs=K,this.updater=Z||B}te.prototype.isReactComponent={},te.prototype.setState=function(S,D){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,D,"setState")},te.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function P(){}P.prototype=te.prototype;function ie(S,D,Z){this.props=S,this.context=D,this.refs=K,this.updater=Z||B}var q=ie.prototype=new P;q.constructor=ie,V(q,te.prototype),q.isPureReactComponent=!0;var W=Array.isArray;function ae(){}var F={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function I(S,D,Z){var w=Z.ref;return{$$typeof:i,type:S,key:D,ref:w!==void 0?w:null,props:Z}}function Te(S,D){return I(S.type,D,S.props)}function ve(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function ye(S){var D={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Z){return D[Z]})}var Q=/\/+/g;function ue(S,D){return typeof S=="object"&&S!==null&&S.key!=null?ye(""+S.key):D.toString(36)}function pe(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(ae,ae):(S.status="pending",S.then(function(D){S.status==="pending"&&(S.status="fulfilled",S.value=D)},function(D){S.status==="pending"&&(S.status="rejected",S.reason=D)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function N(S,D,Z,w,G){var Y=typeof S;(Y==="undefined"||Y==="boolean")&&(S=null);var $=!1;if(S===null)$=!0;else switch(Y){case"bigint":case"string":case"number":$=!0;break;case"object":switch(S.$$typeof){case i:case o:$=!0;break;case T:return $=S._init,N($(S._payload),D,Z,w,G)}}if($)return G=G(S),$=w===""?"."+ue(S,0):w,W(G)?(Z="",$!=null&&(Z=$.replace(Q,"$&/")+"/"),N(G,D,Z,"",function(ct){return ct})):G!=null&&(ve(G)&&(G=Te(G,Z+(G.key==null||S&&S.key===G.key?"":(""+G.key).replace(Q,"$&/")+"/")+$)),D.push(G)),1;$=0;var de=w===""?".":w+":";if(W(S))for(var ge=0;ge<S.length;ge++)w=S[ge],Y=de+ue(w,ge),$+=N(w,D,Z,Y,G);else if(ge=z(S),typeof ge=="function")for(S=ge.call(S),ge=0;!(w=S.next()).done;)w=w.value,Y=de+ue(w,ge++),$+=N(w,D,Z,Y,G);else if(Y==="object"){if(typeof S.then=="function")return N(pe(S),D,Z,w,G);throw D=String(S),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return $}function k(S,D,Z){if(S==null)return S;var w=[],G=0;return N(S,w,"","",function(Y){return D.call(Z,Y,G++)}),w}function J(S){if(S._status===-1){var D=S._result;D=D(),D.then(function(Z){(S._status===0||S._status===-1)&&(S._status=1,S._result=Z)},function(Z){(S._status===0||S._status===-1)&&(S._status=2,S._result=Z)}),S._status===-1&&(S._status=0,S._result=D)}if(S._status===1)return S._result.default;throw S._result}var re=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=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(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},me={map:k,forEach:function(S,D,Z){k(S,function(){D.apply(this,arguments)},Z)},count:function(S){var D=0;return k(S,function(){D++}),D},toArray:function(S){return k(S,function(D){return D})||[]},only:function(S){if(!ve(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return fe.Activity=g,fe.Children=me,fe.Component=te,fe.Fragment=d,fe.Profiler=p,fe.PureComponent=ie,fe.StrictMode=u,fe.Suspense=y,fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,fe.__COMPILER_RUNTIME={__proto__:null,c:function(S){return F.H.useMemoCache(S)}},fe.cache=function(S){return function(){return S.apply(null,arguments)}},fe.cacheSignal=function(){return null},fe.cloneElement=function(S,D,Z){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var w=V({},S.props),G=S.key;if(D!=null)for(Y in D.key!==void 0&&(G=""+D.key),D)!ne.call(D,Y)||Y==="key"||Y==="__self"||Y==="__source"||Y==="ref"&&D.ref===void 0||(w[Y]=D[Y]);var Y=arguments.length-2;if(Y===1)w.children=Z;else if(1<Y){for(var $=Array(Y),de=0;de<Y;de++)$[de]=arguments[de+2];w.children=$}return I(S.type,G,w)},fe.createContext=function(S){return S={$$typeof:x,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:h,_context:S},S},fe.createElement=function(S,D,Z){var w,G={},Y=null;if(D!=null)for(w in D.key!==void 0&&(Y=""+D.key),D)ne.call(D,w)&&w!=="key"&&w!=="__self"&&w!=="__source"&&(G[w]=D[w]);var $=arguments.length-2;if($===1)G.children=Z;else if(1<$){for(var de=Array($),ge=0;ge<$;ge++)de[ge]=arguments[ge+2];G.children=de}if(S&&S.defaultProps)for(w in $=S.defaultProps,$)G[w]===void 0&&(G[w]=$[w]);return I(S,Y,G)},fe.createRef=function(){return{current:null}},fe.forwardRef=function(S){return{$$typeof:b,render:S}},fe.isValidElement=ve,fe.lazy=function(S){return{$$typeof:T,_payload:{_status:-1,_result:S},_init:J}},fe.memo=function(S,D){return{$$typeof:m,type:S,compare:D===void 0?null:D}},fe.startTransition=function(S){var D=F.T,Z={};F.T=Z;try{var w=S(),G=F.S;G!==null&&G(Z,w),typeof w=="object"&&w!==null&&typeof w.then=="function"&&w.then(ae,re)}catch(Y){re(Y)}finally{D!==null&&Z.types!==null&&(D.types=Z.types),F.T=D}},fe.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},fe.use=function(S){return F.H.use(S)},fe.useActionState=function(S,D,Z){return F.H.useActionState(S,D,Z)},fe.useCallback=function(S,D){return F.H.useCallback(S,D)},fe.useContext=function(S){return F.H.useContext(S)},fe.useDebugValue=function(){},fe.useDeferredValue=function(S,D){return F.H.useDeferredValue(S,D)},fe.useEffect=function(S,D){return F.H.useEffect(S,D)},fe.useEffectEvent=function(S){return F.H.useEffectEvent(S)},fe.useId=function(){return F.H.useId()},fe.useImperativeHandle=function(S,D,Z){return F.H.useImperativeHandle(S,D,Z)},fe.useInsertionEffect=function(S,D){return F.H.useInsertionEffect(S,D)},fe.useLayoutEffect=function(S,D){return F.H.useLayoutEffect(S,D)},fe.useMemo=function(S,D){return F.H.useMemo(S,D)},fe.useOptimistic=function(S,D){return F.H.useOptimistic(S,D)},fe.useReducer=function(S,D,Z){return F.H.useReducer(S,D,Z)},fe.useRef=function(S){return F.H.useRef(S)},fe.useState=function(S){return F.H.useState(S)},fe.useSyncExternalStore=function(S,D,Z){return F.H.useSyncExternalStore(S,D,Z)},fe.useTransition=function(){return F.H.useTransition()},fe.version="19.2.4",fe}var Pf;function Wc(){return Pf||(Pf=1,wc.exports=Wp()),wc.exports}var v=Wc(),Mc={exports:{}},$n={},zc={exports:{}},Oc={};/**
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 em;function Fp(){return em||(em=1,(function(i){function o(N,k){var J=N.length;N.push(k);e:for(;0<J;){var re=J-1>>>1,me=N[re];if(0<p(me,k))N[re]=k,N[J]=me,J=re;else break e}}function d(N){return N.length===0?null:N[0]}function u(N){if(N.length===0)return null;var k=N[0],J=N.pop();if(J!==k){N[0]=J;e:for(var re=0,me=N.length,S=me>>>1;re<S;){var D=2*(re+1)-1,Z=N[D],w=D+1,G=N[w];if(0>p(Z,J))w<me&&0>p(G,Z)?(N[re]=G,N[w]=J,re=w):(N[re]=Z,N[D]=J,re=D);else if(w<me&&0>p(G,J))N[re]=G,N[w]=J,re=w;else break e}}return k}function p(N,k){var J=N.sortIndex-k.sortIndex;return J!==0?J:N.id-k.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;i.unstable_now=function(){return h.now()}}else{var x=Date,b=x.now();i.unstable_now=function(){return x.now()-b}}var y=[],m=[],T=1,g=null,A=3,z=!1,B=!1,V=!1,K=!1,te=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,ie=typeof setImmediate<"u"?setImmediate:null;function q(N){for(var k=d(m);k!==null;){if(k.callback===null)u(m);else if(k.startTime<=N)u(m),k.sortIndex=k.expirationTime,o(y,k);else break;k=d(m)}}function W(N){if(V=!1,q(N),!B)if(d(y)!==null)B=!0,ae||(ae=!0,ye());else{var k=d(m);k!==null&&pe(W,k.startTime-N)}}var ae=!1,F=-1,ne=5,I=-1;function Te(){return K?!0:!(i.unstable_now()-I<ne)}function ve(){if(K=!1,ae){var N=i.unstable_now();I=N;var k=!0;try{e:{B=!1,V&&(V=!1,P(F),F=-1),z=!0;var J=A;try{t:{for(q(N),g=d(y);g!==null&&!(g.expirationTime>N&&Te());){var re=g.callback;if(typeof re=="function"){g.callback=null,A=g.priorityLevel;var me=re(g.expirationTime<=N);if(N=i.unstable_now(),typeof me=="function"){g.callback=me,q(N),k=!0;break t}g===d(y)&&u(y),q(N)}else u(y);g=d(y)}if(g!==null)k=!0;else{var S=d(m);S!==null&&pe(W,S.startTime-N),k=!1}}break e}finally{g=null,A=J,z=!1}k=void 0}}finally{k?ye():ae=!1}}}var ye;if(typeof ie=="function")ye=function(){ie(ve)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,ue=Q.port2;Q.port1.onmessage=ve,ye=function(){ue.postMessage(null)}}else ye=function(){te(ve,0)};function pe(N,k){F=te(function(){N(i.unstable_now())},k)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(N){N.callback=null},i.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<N?Math.floor(1e3/N):5},i.unstable_getCurrentPriorityLevel=function(){return A},i.unstable_next=function(N){switch(A){case 1:case 2:case 3:var k=3;break;default:k=A}var J=A;A=k;try{return N()}finally{A=J}},i.unstable_requestPaint=function(){K=!0},i.unstable_runWithPriority=function(N,k){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var J=A;A=N;try{return k()}finally{A=J}},i.unstable_scheduleCallback=function(N,k,J){var re=i.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?re+J:re):J=re,N){case 1:var me=-1;break;case 2:me=250;break;case 5:me=1073741823;break;case 4:me=1e4;break;default:me=5e3}return me=J+me,N={id:T++,callback:k,priorityLevel:N,startTime:J,expirationTime:me,sortIndex:-1},J>re?(N.sortIndex=J,o(m,N),d(y)===null&&N===d(m)&&(V?(P(F),F=-1):V=!0,pe(W,J-re))):(N.sortIndex=me,o(y,N),B||z||(B=!0,ae||(ae=!0,ye()))),N},i.unstable_shouldYield=Te,i.unstable_wrapCallback=function(N){var k=A;return function(){var J=A;A=k;try{return N.apply(this,arguments)}finally{A=J}}}})(Oc)),Oc}var tm;function Ip(){return tm||(tm=1,zc.exports=Fp()),zc.exports}var Dc={exports:{}},it={};/**
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 lm;function Pp(){if(lm)return it;lm=1;var i=Wc();function o(y){var m="https://react.dev/errors/"+y;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)m+="&args[]="+encodeURIComponent(arguments[T])}return"Minified React error #"+y+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var u={d:{f:d,r:function(){throw Error(o(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},p=Symbol.for("react.portal");function h(y,m,T){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:g==null?null:""+g,children:y,containerInfo:m,implementation:T}}var x=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(y,m){if(y==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return it.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,it.createPortal=function(y,m){var T=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(o(299));return h(y,m,null,T)},it.flushSync=function(y){var m=x.T,T=u.p;try{if(x.T=null,u.p=2,y)return y()}finally{x.T=m,u.p=T,u.d.f()}},it.preconnect=function(y,m){typeof y=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,u.d.C(y,m))},it.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},it.preinit=function(y,m){if(typeof y=="string"&&m&&typeof m.as=="string"){var T=m.as,g=b(T,m.crossOrigin),A=typeof m.integrity=="string"?m.integrity:void 0,z=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;T==="style"?u.d.S(y,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:A,fetchPriority:z}):T==="script"&&u.d.X(y,{crossOrigin:g,integrity:A,fetchPriority:z,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},it.preinitModule=function(y,m){if(typeof y=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var T=b(m.as,m.crossOrigin);u.d.M(y,{crossOrigin:T,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&u.d.M(y)},it.preload=function(y,m){if(typeof y=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var T=m.as,g=b(T,m.crossOrigin);u.d.L(y,T,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},it.preloadModule=function(y,m){if(typeof y=="string")if(m){var T=b(m.as,m.crossOrigin);u.d.m(y,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:T,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else u.d.m(y)},it.requestFormReset=function(y){u.d.r(y)},it.unstable_batchedUpdates=function(y,m){return y(m)},it.useFormState=function(y,m,T){return x.H.useFormState(y,m,T)},it.useFormStatus=function(){return x.H.useHostTransitionStatus()},it.version="19.2.4",it}var am;function eh(){if(am)return Dc.exports;am=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(o){console.error(o)}}return i(),Dc.exports=Pp(),Dc.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 nm;function th(){if(nm)return $n;nm=1;var i=Ip(),o=Wc(),d=eh();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 p(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(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 x(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(h(e)!==e)throw Error(u(188))}function m(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(u(188));return t!==e?null:e}for(var l=e,a=t;;){var s=l.return;if(s===null)break;var r=s.alternate;if(r===null){if(a=s.return,a!==null){l=a;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===l)return y(s),e;if(r===a)return y(s),t;r=r.sibling}throw Error(u(188))}if(l.return!==a.return)l=s,a=r;else{for(var c=!1,f=s.child;f;){if(f===l){c=!0,l=s,a=r;break}if(f===a){c=!0,a=s,l=r;break}f=f.sibling}if(!c){for(f=r.child;f;){if(f===l){c=!0,l=r,a=s;break}if(f===a){c=!0,a=r,l=s;break}f=f.sibling}if(!c)throw Error(u(189))}}if(l.alternate!==a)throw Error(u(190))}if(l.tag!==3)throw Error(u(188));return l.stateNode.current===l?e:t}function T(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=T(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,A=Symbol.for("react.element"),z=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),te=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),ie=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),Te=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 Q=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case te:return"Profiler";case K:return"StrictMode";case W:return"Suspense";case ae:return"SuspenseList";case I:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case ie:return e.displayName||"Context";case P: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 F:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var pe=Array.isArray,N=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},re=[],me=-1;function S(e){return{current:e}}function D(e){0>me||(e.current=re[me],re[me]=null,me--)}function Z(e,t){me++,re[me]=e.current,e.current=t}var w=S(null),G=S(null),Y=S(null),$=S(null);function de(e,t){switch(Z(Y,t),Z(G,e),Z(w,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gf(t),e=bf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(w),Z(w,e)}function ge(){D(w),D(G),D(Y)}function ct(e){e.memoizedState!==null&&Z($,e);var t=w.current,l=bf(t,e.type);t!==l&&(Z(G,e),Z(w,l))}function bl(e){G.current===e&&(D(w),D(G)),$.current===e&&(D($),Qn._currentValue=J)}var St,pa;function Mt(e){if(St===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);St=t&&t[1]||"",pa=-1<l.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+St+e+pa}var ee=!1;function Ie(e,t){if(!e||ee)return"";ee=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(O){var M=O}Reflect.construct(e,[],H)}else{try{H.call()}catch(O){M=O}e.call(H.prototype)}}else{try{throw Error()}catch(O){M=O}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(O){if(O&&M&&typeof O.stack=="string")return[O.stack,M.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),c=r[0],f=r[1];if(c&&f){var j=c.split(`
44
+ `),R=f.split(`
45
+ `);for(s=a=0;a<j.length&&!j[a].includes("DetermineComponentFrameRoot");)a++;for(;s<R.length&&!R[s].includes("DetermineComponentFrameRoot");)s++;if(a===j.length||s===R.length)for(a=j.length-1,s=R.length-1;1<=a&&0<=s&&j[a]!==R[s];)s--;for(;1<=a&&0<=s;a--,s--)if(j[a]!==R[s]){if(a!==1||s!==1)do if(a--,s--,0>s||j[a]!==R[s]){var L=`
46
+ `+j[a].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=a&&0<=s);break}}}finally{ee=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Mt(l):""}function dt(e,t){switch(e.tag){case 26:case 27:case 5:return Mt(e.type);case 16:return Mt("Lazy");case 13:return e.child!==t&&t!==null?Mt("Suspense Fallback"):Mt("Suspense");case 19:return Mt("SuspenseList");case 0:case 15:return Ie(e.type,!1);case 11:return Ie(e.type.render,!1);case 1:return Ie(e.type,!0);case 31:return Mt("Activity");default:return""}}function Qt(e){try{var t="",l=null;do t+=dt(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
47
+ Error generating stack: `+a.message+`
48
+ `+a.stack}}var X=Object.prototype.hasOwnProperty,Ce=i.unstable_scheduleCallback,el=i.unstable_cancelCallback,ha=i.unstable_shouldYield,ft=i.unstable_requestPaint,qe=i.unstable_now,jl=i.unstable_getCurrentPriorityLevel,Xt=i.unstable_ImmediatePriority,zt=i.unstable_UserBlockingPriority,mt=i.unstable_NormalPriority,Ze=i.unstable_LowPriority,xt=i.unstable_IdlePriority,tl=i.log,rt=i.unstable_setDisableYieldValue,$l=null,Nt=null;function Sl(e){if(typeof tl=="function"&&rt(e),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode($l,e)}catch{}}var Et=Math.clz32?Math.clz32:Om,Mm=Math.log,zm=Math.LN2;function Om(e){return e>>>=0,e===0?32:31-(Mm(e)/zm|0)|0}var In=256,Pn=262144,es=4194304;function Wl(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 ts(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var f=a&134217727;return f!==0?(a=f&~r,a!==0?s=Wl(a):(c&=f,c!==0?s=Wl(c):l||(l=f&~e,l!==0&&(s=Wl(l))))):(f=a&~r,f!==0?s=Wl(f):c!==0?s=Wl(c):l||(l=a&~e,l!==0&&(s=Wl(l)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,l=t&-t,r>=l||r===32&&(l&4194048)!==0)?t:s}function ln(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Dm(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 Ic(){var e=es;return es<<=1,(es&62914560)===0&&(es=4194304),e}function yr(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function an(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Lm(e,t,l,a,s,r){var c=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 f=e.entanglements,j=e.expirationTimes,R=e.hiddenUpdates;for(l=c&~l;0<l;){var L=31-Et(l),H=1<<L;f[L]=0,j[L]=-1;var M=R[L];if(M!==null)for(R[L]=null,L=0;L<M.length;L++){var O=M[L];O!==null&&(O.lane&=-536870913)}l&=~H}a!==0&&Pc(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(c&~t))}function Pc(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Et(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function eo(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-Et(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function to(e,t){var l=t&-t;return l=(l&42)!==0?1:gr(l),(l&(e.suspendedLanes|t))!==0?0:l}function gr(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 br(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function lo(){var e=k.p;return e!==0?e:(e=window.event,e===void 0?32:Vf(e.type))}function ao(e,t){var l=k.p;try{return k.p=e,t()}finally{k.p=l}}var Nl=Math.random().toString(36).slice(2),tt="__reactFiber$"+Nl,pt="__reactProps$"+Nl,va="__reactContainer$"+Nl,jr="__reactEvents$"+Nl,Bm="__reactListeners$"+Nl,Um="__reactHandles$"+Nl,no="__reactResources$"+Nl,nn="__reactMarker$"+Nl;function Sr(e){delete e[tt],delete e[pt],delete e[jr],delete e[Bm],delete e[Um]}function ya(e){var t=e[tt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[va]||l[tt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=kf(e);e!==null;){if(l=e[tt])return l;e=kf(e)}return t}e=l,l=e.parentNode}return null}function ga(e){if(e=e[tt]||e[va]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function sn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function ba(e){var t=e[no];return t||(t=e[no]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[nn]=!0}var so=new Set,ro={};function Fl(e,t){ja(e,t),ja(e+"Capture",t)}function ja(e,t){for(ro[e]=t,e=0;e<t.length;e++)so.add(t[e])}var Hm=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]*$"),io={},co={};function qm(e){return X.call(co,e)?!0:X.call(io,e)?!1:Hm.test(e)?co[e]=!0:(io[e]=!0,!1)}function ls(e,t,l){if(qm(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function as(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 ll(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function Ot(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function oo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gm(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var s=a.get,r=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(c){l=""+c,r.call(this,c)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Nr(e){if(!e._valueTracker){var t=oo(e)?"checked":"value";e._valueTracker=Gm(e,t,""+e[t])}}function uo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=oo(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function ns(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 Ym=/[\n"\\]/g;function Dt(e){return e.replace(Ym,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Er(e,t,l,a,s,r,c,f){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ot(t)):e.value!==""+Ot(t)&&(e.value=""+Ot(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?Tr(e,c,Ot(t)):l!=null?Tr(e,c,Ot(l)):a!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+Ot(f):e.removeAttribute("name")}function fo(e,t,l,a,s,r,c,f){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||l!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){Nr(e);return}l=l!=null?""+Ot(l):"",t=t!=null?""+Ot(t):l,f||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=f?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),Nr(e)}function Tr(e,t,l){t==="number"&&ns(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Sa(e,t,l,a){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&&a&&(e[l].defaultSelected=!0)}else{for(l=""+Ot(l),t=null,s=0;s<e.length;s++){if(e[s].value===l){e[s].selected=!0,a&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function mo(e,t,l){if(t!=null&&(t=""+Ot(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Ot(l):""}function xo(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(u(92));if(pe(a)){if(1<a.length)throw Error(u(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=Ot(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),Nr(e)}function Na(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Vm=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 po(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||Vm.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function ho(e,t,l){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var s in t)a=t[s],t.hasOwnProperty(s)&&l[s]!==a&&po(e,s,a)}else for(var r in t)t.hasOwnProperty(r)&&po(e,r,t[r])}function Cr(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 Qm=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"]]),Xm=/^[\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 ss(e){return Xm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function al(){}var kr=null;function Ar(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ea=null,Ta=null;function vo(e){var t=ga(e);if(t&&(e=t.stateNode)){var l=e[pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Er(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="'+Dt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var s=a[pt]||null;if(!s)throw Error(u(90));Er(a,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&uo(a)}break e;case"textarea":mo(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Sa(e,!!l.multiple,t,!1)}}}var _r=!1;function yo(e,t,l){if(_r)return e(t,l);_r=!0;try{var a=e(t);return a}finally{if(_r=!1,(Ea!==null||Ta!==null)&&(Zs(),Ea&&(t=Ea,e=Ta,Ta=Ea=null,vo(t),e)))for(t=0;t<e.length;t++)vo(e[t])}}function rn(e,t){var l=e.stateNode;if(l===null)return null;var a=l[pt]||null;if(a===null)return null;l=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(u(231,t,typeof l));return l}var nl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rr=!1;if(nl)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){Rr=!0}}),window.addEventListener("test",cn,cn),window.removeEventListener("test",cn,cn)}catch{Rr=!1}var El=null,wr=null,rs=null;function go(){if(rs)return rs;var e,t=wr,l=t.length,a,s="value"in El?El.value:El.textContent,r=s.length;for(e=0;e<l&&t[e]===s[e];e++);var c=l-e;for(a=1;a<=c&&t[l-a]===s[r-a];a++);return rs=s.slice(e,1<a?1-a:void 0)}function is(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 cs(){return!0}function bo(){return!1}function ht(e){function t(l,a,s,r,c){this._reactName=l,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=c,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(l=e[f],this[f]=l?l(r):r[f]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?cs:bo,this.isPropagationStopped=bo,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=cs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=cs)},persist:function(){},isPersistent:cs}),t}var Il={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},os=ht(Il),on=g({},Il,{view:0,detail:0}),Zm=ht(on),Mr,zr,un,us=g({},on,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dr,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!==un&&(un&&e.type==="mousemove"?(Mr=e.screenX-un.screenX,zr=e.screenY-un.screenY):zr=Mr=0,un=e),Mr)},movementY:function(e){return"movementY"in e?e.movementY:zr}}),jo=ht(us),Km=g({},us,{dataTransfer:0}),Jm=ht(Km),$m=g({},on,{relatedTarget:0}),Or=ht($m),Wm=g({},Il,{animationName:0,elapsedTime:0,pseudoElement:0}),Fm=ht(Wm),Im=g({},Il,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Pm=ht(Im),ex=g({},Il,{data:0}),So=ht(ex),tx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lx={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"},ax={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ax[e])?!!t[e]:!1}function Dr(){return nx}var sx=g({},on,{key:function(e){if(e.key){var t=tx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=is(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?lx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dr,charCode:function(e){return e.type==="keypress"?is(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?is(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rx=ht(sx),ix=g({},us,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),No=ht(ix),cx=g({},on,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dr}),ox=ht(cx),ux=g({},Il,{propertyName:0,elapsedTime:0,pseudoElement:0}),dx=ht(ux),fx=g({},us,{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}),mx=ht(fx),xx=g({},Il,{newState:0,oldState:0}),px=ht(xx),hx=[9,13,27,32],Lr=nl&&"CompositionEvent"in window,dn=null;nl&&"documentMode"in document&&(dn=document.documentMode);var vx=nl&&"TextEvent"in window&&!dn,Eo=nl&&(!Lr||dn&&8<dn&&11>=dn),To=" ",Co=!1;function ko(e,t){switch(e){case"keyup":return hx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ao(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ca=!1;function yx(e,t){switch(e){case"compositionend":return Ao(t);case"keypress":return t.which!==32?null:(Co=!0,To);case"textInput":return e=t.data,e===To&&Co?null:e;default:return null}}function gx(e,t){if(Ca)return e==="compositionend"||!Lr&&ko(e,t)?(e=go(),rs=wr=El=null,Ca=!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 Eo&&t.locale!=="ko"?null:t.data;default:return null}}var bx={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 _o(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!bx[e.type]:t==="textarea"}function Ro(e,t,l,a){Ea?Ta?Ta.push(a):Ta=[a]:Ea=a,t=Ps(t,"onChange"),0<t.length&&(l=new os("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var fn=null,mn=null;function jx(e){mf(e,0)}function ds(e){var t=sn(e);if(uo(t))return e}function wo(e,t){if(e==="change")return t}var Mo=!1;if(nl){var Br;if(nl){var Ur="oninput"in document;if(!Ur){var zo=document.createElement("div");zo.setAttribute("oninput","return;"),Ur=typeof zo.oninput=="function"}Br=Ur}else Br=!1;Mo=Br&&(!document.documentMode||9<document.documentMode)}function Oo(){fn&&(fn.detachEvent("onpropertychange",Do),mn=fn=null)}function Do(e){if(e.propertyName==="value"&&ds(mn)){var t=[];Ro(t,mn,e,Ar(e)),yo(jx,t)}}function Sx(e,t,l){e==="focusin"?(Oo(),fn=t,mn=l,fn.attachEvent("onpropertychange",Do)):e==="focusout"&&Oo()}function Nx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ds(mn)}function Ex(e,t){if(e==="click")return ds(t)}function Tx(e,t){if(e==="input"||e==="change")return ds(t)}function Cx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tt=typeof Object.is=="function"?Object.is:Cx;function xn(e,t){if(Tt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var s=l[a];if(!X.call(t,s)||!Tt(e[s],t[s]))return!1}return!0}function Lo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bo(e,t){var l=Lo(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Lo(l)}}function Uo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ho(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ns(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=ns(e.document)}return t}function Hr(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 kx=nl&&"documentMode"in document&&11>=document.documentMode,ka=null,qr=null,pn=null,Gr=!1;function qo(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Gr||ka==null||ka!==ns(a)||(a=ka,"selectionStart"in a&&Hr(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),pn&&xn(pn,a)||(pn=a,a=Ps(qr,"onSelect"),0<a.length&&(t=new os("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=ka)))}function Pl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Aa={animationend:Pl("Animation","AnimationEnd"),animationiteration:Pl("Animation","AnimationIteration"),animationstart:Pl("Animation","AnimationStart"),transitionrun:Pl("Transition","TransitionRun"),transitionstart:Pl("Transition","TransitionStart"),transitioncancel:Pl("Transition","TransitionCancel"),transitionend:Pl("Transition","TransitionEnd")},Yr={},Go={};nl&&(Go=document.createElement("div").style,"AnimationEvent"in window||(delete Aa.animationend.animation,delete Aa.animationiteration.animation,delete Aa.animationstart.animation),"TransitionEvent"in window||delete Aa.transitionend.transition);function ea(e){if(Yr[e])return Yr[e];if(!Aa[e])return e;var t=Aa[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in Go)return Yr[e]=t[l];return e}var Yo=ea("animationend"),Vo=ea("animationiteration"),Qo=ea("animationstart"),Ax=ea("transitionrun"),_x=ea("transitionstart"),Rx=ea("transitioncancel"),Xo=ea("transitionend"),Zo=new Map,Vr="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(" ");Vr.push("scrollEnd");function Zt(e,t){Zo.set(e,t),Fl(t,[e])}var fs=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)},Lt=[],_a=0,Qr=0;function ms(){for(var e=_a,t=Qr=_a=0;t<e;){var l=Lt[t];Lt[t++]=null;var a=Lt[t];Lt[t++]=null;var s=Lt[t];Lt[t++]=null;var r=Lt[t];if(Lt[t++]=null,a!==null&&s!==null){var c=a.pending;c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s}r!==0&&Ko(l,s,r)}}function xs(e,t,l,a){Lt[_a++]=e,Lt[_a++]=t,Lt[_a++]=l,Lt[_a++]=a,Qr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Xr(e,t,l,a){return xs(e,t,l,a),ps(e)}function ta(e,t){return xs(e,null,null,t),ps(e)}function Ko(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var s=!1,r=e.return;r!==null;)r.childLanes|=l,a=r.alternate,a!==null&&(a.childLanes|=l),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-Et(l),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=l|536870912),r):null}function ps(e){if(50<Bn)throw Bn=0,ec=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ra={};function wx(e,t,l,a){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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ct(e,t,l,a){return new wx(e,t,l,a)}function Zr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sl(e,t){var l=e.alternate;return l===null?(l=Ct(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 Jo(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 hs(e,t,l,a,s,r){var c=0;if(a=e,typeof e=="function")Zr(e)&&(c=1);else if(typeof e=="string")c=Lp(e,l,w.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case I:return e=Ct(31,l,t,s),e.elementType=I,e.lanes=r,e;case V:return la(l.children,s,r,t);case K:c=8,s|=24;break;case te:return e=Ct(12,l,t,s|2),e.elementType=te,e.lanes=r,e;case W:return e=Ct(13,l,t,s),e.elementType=W,e.lanes=r,e;case ae:return e=Ct(19,l,t,s),e.elementType=ae,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ie:c=10;break e;case P:c=9;break e;case q:c=11;break e;case F:c=14;break e;case ne:c=16,a=null;break e}c=29,l=Error(u(130,e===null?"null":typeof e,"")),a=null}return t=Ct(c,l,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function la(e,t,l,a){return e=Ct(7,e,a,t),e.lanes=l,e}function Kr(e,t,l){return e=Ct(6,e,null,t),e.lanes=l,e}function $o(e){var t=Ct(18,null,null,0);return t.stateNode=e,t}function Jr(e,t,l){return t=Ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Wo=new WeakMap;function Bt(e,t){if(typeof e=="object"&&e!==null){var l=Wo.get(e);return l!==void 0?l:(t={value:e,source:t,stack:Qt(t)},Wo.set(e,t),t)}return{value:e,source:t,stack:Qt(t)}}var wa=[],Ma=0,vs=null,hn=0,Ut=[],Ht=0,Tl=null,$t=1,Wt="";function rl(e,t){wa[Ma++]=hn,wa[Ma++]=vs,vs=e,hn=t}function Fo(e,t,l){Ut[Ht++]=$t,Ut[Ht++]=Wt,Ut[Ht++]=Tl,Tl=e;var a=$t;e=Wt;var s=32-Et(a)-1;a&=~(1<<s),l+=1;var r=32-Et(t)+s;if(30<r){var c=s-s%5;r=(a&(1<<c)-1).toString(32),a>>=c,s-=c,$t=1<<32-Et(t)+s|l<<s|a,Wt=r+e}else $t=1<<r|l<<s|a,Wt=e}function $r(e){e.return!==null&&(rl(e,1),Fo(e,1,0))}function Wr(e){for(;e===vs;)vs=wa[--Ma],wa[Ma]=null,hn=wa[--Ma],wa[Ma]=null;for(;e===Tl;)Tl=Ut[--Ht],Ut[Ht]=null,Wt=Ut[--Ht],Ut[Ht]=null,$t=Ut[--Ht],Ut[Ht]=null}function Io(e,t){Ut[Ht++]=$t,Ut[Ht++]=Wt,Ut[Ht++]=Tl,$t=t.id,Wt=t.overflow,Tl=e}var lt=null,Be=null,Ee=!1,Cl=null,qt=!1,Fr=Error(u(519));function kl(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vn(Bt(t,e)),Fr}function Po(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[tt]=e,t[pt]=a,l){case"dialog":je("cancel",t),je("close",t);break;case"iframe":case"object":case"embed":je("load",t);break;case"video":case"audio":for(l=0;l<Hn.length;l++)je(Hn[l],t);break;case"source":je("error",t);break;case"img":case"image":case"link":je("error",t),je("load",t);break;case"details":je("toggle",t);break;case"input":je("invalid",t),fo(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":je("invalid",t);break;case"textarea":je("invalid",t),xo(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||vf(t.textContent,l)?(a.popover!=null&&(je("beforetoggle",t),je("toggle",t)),a.onScroll!=null&&je("scroll",t),a.onScrollEnd!=null&&je("scrollend",t),a.onClick!=null&&(t.onclick=al),t=!0):t=!1,t||kl(e,!0)}function eu(e){for(lt=e.return;lt;)switch(lt.tag){case 5:case 31:case 13:qt=!1;return;case 27:case 3:qt=!0;return;default:lt=lt.return}}function za(e){if(e!==lt)return!1;if(!Ee)return eu(e),Ee=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||pc(e.type,e.memoizedProps)),l=!l),l&&Be&&kl(e),eu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Be=Cf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Be=Cf(e)}else t===27?(t=Be,Gl(e.type)?(e=bc,bc=null,Be=e):Be=t):Be=lt?Yt(e.stateNode.nextSibling):null;return!0}function aa(){Be=lt=null,Ee=!1}function Ir(){var e=Cl;return e!==null&&(bt===null?bt=e:bt.push.apply(bt,e),Cl=null),e}function vn(e){Cl===null?Cl=[e]:Cl.push(e)}var Pr=S(null),na=null,il=null;function Al(e,t,l){Z(Pr,t._currentValue),t._currentValue=l}function cl(e){e._currentValue=Pr.current,D(Pr)}function ei(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function ti(e,t,l,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var c=s.child;r=r.firstContext;e:for(;r!==null;){var f=r;r=s;for(var j=0;j<t.length;j++)if(f.context===t[j]){r.lanes|=l,f=r.alternate,f!==null&&(f.lanes|=l),ei(r.return,l,e),a||(c=null);break e}r=f.next}}else if(s.tag===18){if(c=s.return,c===null)throw Error(u(341));c.lanes|=l,r=c.alternate,r!==null&&(r.lanes|=l),ei(c,l,e),c=null}else c=s.child;if(c!==null)c.return=s;else for(c=s;c!==null;){if(c===e){c=null;break}if(s=c.sibling,s!==null){s.return=c.return,c=s;break}c=c.return}s=c}}function Oa(e,t,l,a){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var c=s.alternate;if(c===null)throw Error(u(387));if(c=c.memoizedProps,c!==null){var f=s.type;Tt(s.pendingProps.value,c.value)||(e!==null?e.push(f):e=[f])}}else if(s===$.current){if(c=s.alternate,c===null)throw Error(u(387));c.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Qn):e=[Qn])}s=s.return}e!==null&&ti(t,e,l,a),t.flags|=262144}function ys(e){for(e=e.firstContext;e!==null;){if(!Tt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function sa(e){na=e,il=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function at(e){return tu(na,e)}function gs(e,t){return na===null&&sa(e),tu(e,t)}function tu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},il===null){if(e===null)throw Error(u(308));il=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else il=il.next=t;return l}var Mx=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},zx=i.unstable_scheduleCallback,Ox=i.unstable_NormalPriority,Ke={$$typeof:ie,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function li(){return{controller:new Mx,data:new Map,refCount:0}}function yn(e){e.refCount--,e.refCount===0&&zx(Ox,function(){e.controller.abort()})}var gn=null,ai=0,Da=0,La=null;function Dx(e,t){if(gn===null){var l=gn=[];ai=0,Da=rc(),La={status:"pending",value:void 0,then:function(a){l.push(a)}}}return ai++,t.then(lu,lu),t}function lu(){if(--ai===0&&gn!==null){La!==null&&(La.status="fulfilled");var e=gn;gn=null,Da=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Lx(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(s){l.push(s)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var s=0;s<l.length;s++)(0,l[s])(t)},function(s){for(a.status="rejected",a.reason=s,s=0;s<l.length;s++)(0,l[s])(void 0)}),a}var au=N.S;N.S=function(e,t){qd=qe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Dx(e,t),au!==null&&au(e,t)};var ra=S(null);function ni(){var e=ra.current;return e!==null?e:Le.pooledCache}function bs(e,t){t===null?Z(ra,ra.current):Z(ra,t.pool)}function nu(){var e=ni();return e===null?null:{parent:Ke._currentValue,pool:e}}var Ba=Error(u(460)),si=Error(u(474)),js=Error(u(542)),Ss={then:function(){}};function su(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ru(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(al,al),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,cu(e),e;default:if(typeof t.status=="string")t.then(al,al);else{if(e=Le,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=a}},function(a){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,cu(e),e}throw ca=t,Ba}}function ia(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ca=l,Ba):l}}var ca=null;function iu(){if(ca===null)throw Error(u(459));var e=ca;return ca=null,e}function cu(e){if(e===Ba||e===js)throw Error(u(483))}var Ua=null,bn=0;function Ns(e){var t=bn;return bn+=1,Ua===null&&(Ua=[]),ru(Ua,e,t)}function jn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Es(e,t){throw t.$$typeof===A?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ou(e){function t(C,E){if(e){var _=C.deletions;_===null?(C.deletions=[E],C.flags|=16):_.push(E)}}function l(C,E){if(!e)return null;for(;E!==null;)t(C,E),E=E.sibling;return null}function a(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=sl(C,E),C.index=0,C.sibling=null,C}function r(C,E,_){return C.index=_,e?(_=C.alternate,_!==null?(_=_.index,_<E?(C.flags|=67108866,E):_):(C.flags|=67108866,E)):(C.flags|=1048576,E)}function c(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function f(C,E,_,U){return E===null||E.tag!==6?(E=Kr(_,C.mode,U),E.return=C,E):(E=s(E,_),E.return=C,E)}function j(C,E,_,U){var ce=_.type;return ce===V?L(C,E,_.props.children,U,_.key):E!==null&&(E.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===ne&&ia(ce)===E.type)?(E=s(E,_.props),jn(E,_),E.return=C,E):(E=hs(_.type,_.key,_.props,null,C.mode,U),jn(E,_),E.return=C,E)}function R(C,E,_,U){return E===null||E.tag!==4||E.stateNode.containerInfo!==_.containerInfo||E.stateNode.implementation!==_.implementation?(E=Jr(_,C.mode,U),E.return=C,E):(E=s(E,_.children||[]),E.return=C,E)}function L(C,E,_,U,ce){return E===null||E.tag!==7?(E=la(_,C.mode,U,ce),E.return=C,E):(E=s(E,_),E.return=C,E)}function H(C,E,_){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=Kr(""+E,C.mode,_),E.return=C,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case z:return _=hs(E.type,E.key,E.props,null,C.mode,_),jn(_,E),_.return=C,_;case B:return E=Jr(E,C.mode,_),E.return=C,E;case ne:return E=ia(E),H(C,E,_)}if(pe(E)||ye(E))return E=la(E,C.mode,_,null),E.return=C,E;if(typeof E.then=="function")return H(C,Ns(E),_);if(E.$$typeof===ie)return H(C,gs(C,E),_);Es(C,E)}return null}function M(C,E,_,U){var ce=E!==null?E.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return ce!==null?null:f(C,E,""+_,U);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case z:return _.key===ce?j(C,E,_,U):null;case B:return _.key===ce?R(C,E,_,U):null;case ne:return _=ia(_),M(C,E,_,U)}if(pe(_)||ye(_))return ce!==null?null:L(C,E,_,U,null);if(typeof _.then=="function")return M(C,E,Ns(_),U);if(_.$$typeof===ie)return M(C,E,gs(C,_),U);Es(C,_)}return null}function O(C,E,_,U,ce){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return C=C.get(_)||null,f(E,C,""+U,ce);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case z:return C=C.get(U.key===null?_:U.key)||null,j(E,C,U,ce);case B:return C=C.get(U.key===null?_:U.key)||null,R(E,C,U,ce);case ne:return U=ia(U),O(C,E,_,U,ce)}if(pe(U)||ye(U))return C=C.get(_)||null,L(E,C,U,ce,null);if(typeof U.then=="function")return O(C,E,_,Ns(U),ce);if(U.$$typeof===ie)return O(C,E,_,gs(E,U),ce);Es(E,U)}return null}function le(C,E,_,U){for(var ce=null,ke=null,se=E,he=E=0,Ne=null;se!==null&&he<_.length;he++){se.index>he?(Ne=se,se=null):Ne=se.sibling;var Ae=M(C,se,_[he],U);if(Ae===null){se===null&&(se=Ne);break}e&&se&&Ae.alternate===null&&t(C,se),E=r(Ae,E,he),ke===null?ce=Ae:ke.sibling=Ae,ke=Ae,se=Ne}if(he===_.length)return l(C,se),Ee&&rl(C,he),ce;if(se===null){for(;he<_.length;he++)se=H(C,_[he],U),se!==null&&(E=r(se,E,he),ke===null?ce=se:ke.sibling=se,ke=se);return Ee&&rl(C,he),ce}for(se=a(se);he<_.length;he++)Ne=O(se,C,he,_[he],U),Ne!==null&&(e&&Ne.alternate!==null&&se.delete(Ne.key===null?he:Ne.key),E=r(Ne,E,he),ke===null?ce=Ne:ke.sibling=Ne,ke=Ne);return e&&se.forEach(function(Zl){return t(C,Zl)}),Ee&&rl(C,he),ce}function oe(C,E,_,U){if(_==null)throw Error(u(151));for(var ce=null,ke=null,se=E,he=E=0,Ne=null,Ae=_.next();se!==null&&!Ae.done;he++,Ae=_.next()){se.index>he?(Ne=se,se=null):Ne=se.sibling;var Zl=M(C,se,Ae.value,U);if(Zl===null){se===null&&(se=Ne);break}e&&se&&Zl.alternate===null&&t(C,se),E=r(Zl,E,he),ke===null?ce=Zl:ke.sibling=Zl,ke=Zl,se=Ne}if(Ae.done)return l(C,se),Ee&&rl(C,he),ce;if(se===null){for(;!Ae.done;he++,Ae=_.next())Ae=H(C,Ae.value,U),Ae!==null&&(E=r(Ae,E,he),ke===null?ce=Ae:ke.sibling=Ae,ke=Ae);return Ee&&rl(C,he),ce}for(se=a(se);!Ae.done;he++,Ae=_.next())Ae=O(se,C,he,Ae.value,U),Ae!==null&&(e&&Ae.alternate!==null&&se.delete(Ae.key===null?he:Ae.key),E=r(Ae,E,he),ke===null?ce=Ae:ke.sibling=Ae,ke=Ae);return e&&se.forEach(function(Kp){return t(C,Kp)}),Ee&&rl(C,he),ce}function De(C,E,_,U){if(typeof _=="object"&&_!==null&&_.type===V&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case z:e:{for(var ce=_.key;E!==null;){if(E.key===ce){if(ce=_.type,ce===V){if(E.tag===7){l(C,E.sibling),U=s(E,_.props.children),U.return=C,C=U;break e}}else if(E.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===ne&&ia(ce)===E.type){l(C,E.sibling),U=s(E,_.props),jn(U,_),U.return=C,C=U;break e}l(C,E);break}else t(C,E);E=E.sibling}_.type===V?(U=la(_.props.children,C.mode,U,_.key),U.return=C,C=U):(U=hs(_.type,_.key,_.props,null,C.mode,U),jn(U,_),U.return=C,C=U)}return c(C);case B:e:{for(ce=_.key;E!==null;){if(E.key===ce)if(E.tag===4&&E.stateNode.containerInfo===_.containerInfo&&E.stateNode.implementation===_.implementation){l(C,E.sibling),U=s(E,_.children||[]),U.return=C,C=U;break e}else{l(C,E);break}else t(C,E);E=E.sibling}U=Jr(_,C.mode,U),U.return=C,C=U}return c(C);case ne:return _=ia(_),De(C,E,_,U)}if(pe(_))return le(C,E,_,U);if(ye(_)){if(ce=ye(_),typeof ce!="function")throw Error(u(150));return _=ce.call(_),oe(C,E,_,U)}if(typeof _.then=="function")return De(C,E,Ns(_),U);if(_.$$typeof===ie)return De(C,E,gs(C,_),U);Es(C,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,E!==null&&E.tag===6?(l(C,E.sibling),U=s(E,_),U.return=C,C=U):(l(C,E),U=Kr(_,C.mode,U),U.return=C,C=U),c(C)):l(C,E)}return function(C,E,_,U){try{bn=0;var ce=De(C,E,_,U);return Ua=null,ce}catch(se){if(se===Ba||se===js)throw se;var ke=Ct(29,se,null,C.mode);return ke.lanes=U,ke.return=C,ke}finally{}}}var oa=ou(!0),uu=ou(!1),_l=!1;function ri(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ii(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 Rl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(_e&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=ps(e),Ko(e,null,l),t}return xs(e,a,t,l),ps(e)}function Sn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,eo(e,l)}}function ci(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var s=null,r=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};r===null?s=r=c:r=r.next=c,l=l.next}while(l!==null);r===null?s=r=t:r=r.next=t}else s=r=t;l={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var oi=!1;function Nn(){if(oi){var e=La;if(e!==null)throw e}}function En(e,t,l,a){oi=!1;var s=e.updateQueue;_l=!1;var r=s.firstBaseUpdate,c=s.lastBaseUpdate,f=s.shared.pending;if(f!==null){s.shared.pending=null;var j=f,R=j.next;j.next=null,c===null?r=R:c.next=R,c=j;var L=e.alternate;L!==null&&(L=L.updateQueue,f=L.lastBaseUpdate,f!==c&&(f===null?L.firstBaseUpdate=R:f.next=R,L.lastBaseUpdate=j))}if(r!==null){var H=s.baseState;c=0,L=R=j=null,f=r;do{var M=f.lane&-536870913,O=M!==f.lane;if(O?(Se&M)===M:(a&M)===M){M!==0&&M===Da&&(oi=!0),L!==null&&(L=L.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var le=e,oe=f;M=t;var De=l;switch(oe.tag){case 1:if(le=oe.payload,typeof le=="function"){H=le.call(De,H,M);break e}H=le;break e;case 3:le.flags=le.flags&-65537|128;case 0:if(le=oe.payload,M=typeof le=="function"?le.call(De,H,M):le,M==null)break e;H=g({},H,M);break e;case 2:_l=!0}}M=f.callback,M!==null&&(e.flags|=64,O&&(e.flags|=8192),O=s.callbacks,O===null?s.callbacks=[M]:O.push(M))}else O={lane:M,tag:f.tag,payload:f.payload,callback:f.callback,next:null},L===null?(R=L=O,j=H):L=L.next=O,c|=M;if(f=f.next,f===null){if(f=s.shared.pending,f===null)break;O=f,f=O.next,O.next=null,s.lastBaseUpdate=O,s.shared.pending=null}}while(!0);L===null&&(j=H),s.baseState=j,s.firstBaseUpdate=R,s.lastBaseUpdate=L,r===null&&(s.shared.lanes=0),Ll|=c,e.lanes=c,e.memoizedState=H}}function du(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function fu(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)du(l[e],t)}var Ha=S(null),Ts=S(0);function mu(e,t){e=vl,Z(Ts,e),Z(Ha,t),vl=e|t.baseLanes}function ui(){Z(Ts,vl),Z(Ha,Ha.current)}function di(){vl=Ts.current,D(Ha),D(Ts)}var kt=S(null),Gt=null;function Ml(e){var t=e.alternate;Z(Ve,Ve.current&1),Z(kt,e),Gt===null&&(t===null||Ha.current!==null||t.memoizedState!==null)&&(Gt=e)}function fi(e){Z(Ve,Ve.current),Z(kt,e),Gt===null&&(Gt=e)}function xu(e){e.tag===22?(Z(Ve,Ve.current),Z(kt,e),Gt===null&&(Gt=e)):zl()}function zl(){Z(Ve,Ve.current),Z(kt,kt.current)}function At(e){D(kt),Gt===e&&(Gt=null),D(Ve)}var Ve=S(0);function Cs(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||yc(l)||gc(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 ol=0,xe=null,ze=null,Je=null,ks=!1,qa=!1,ua=!1,As=0,Tn=0,Ga=null,Bx=0;function Ge(){throw Error(u(321))}function mi(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Tt(e[l],t[l]))return!1;return!0}function xi(e,t,l,a,s,r){return ol=r,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Fu:_i,ua=!1,r=l(a,s),ua=!1,qa&&(r=hu(t,l,a,s)),pu(e),r}function pu(e){N.H=An;var t=ze!==null&&ze.next!==null;if(ol=0,Je=ze=xe=null,ks=!1,Tn=0,Ga=null,t)throw Error(u(300));e===null||$e||(e=e.dependencies,e!==null&&ys(e)&&($e=!0))}function hu(e,t,l,a){xe=e;var s=0;do{if(qa&&(Ga=null),Tn=0,qa=!1,25<=s)throw Error(u(301));if(s+=1,Je=ze=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}N.H=Iu,r=t(l,a)}while(qa);return r}function Ux(){var e=N.H,t=e.useState()[0];return t=typeof t.then=="function"?Cn(t):t,e=e.useState()[0],(ze!==null?ze.memoizedState:null)!==e&&(xe.flags|=1024),t}function pi(){var e=As!==0;return As=0,e}function hi(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function vi(e){if(ks){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ks=!1}ol=0,Je=ze=xe=null,qa=!1,Tn=As=0,Ga=null}function ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?xe.memoizedState=Je=e:Je=Je.next=e,Je}function Qe(){if(ze===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=ze.next;var t=Je===null?xe.memoizedState:Je.next;if(t!==null)Je=t,ze=e;else{if(e===null)throw xe.alternate===null?Error(u(467)):Error(u(310));ze=e,e={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},Je===null?xe.memoizedState=Je=e:Je=Je.next=e}return Je}function _s(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Cn(e){var t=Tn;return Tn+=1,Ga===null&&(Ga=[]),e=ru(Ga,e,t),t=xe,(Je===null?t.memoizedState:Je.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Fu:_i),e}function Rs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Cn(e);if(e.$$typeof===ie)return at(e)}throw Error(u(438,String(e)))}function yi(e){var t=null,l=xe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=xe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=_s(),xe.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=Te;return t.index++,l}function ul(e,t){return typeof t=="function"?t(e):t}function ws(e){var t=Qe();return gi(t,ze,e)}function gi(e,t,l){var a=e.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=l;var s=e.baseQueue,r=a.pending;if(r!==null){if(s!==null){var c=s.next;s.next=r.next,r.next=c}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var f=c=null,j=null,R=t,L=!1;do{var H=R.lane&-536870913;if(H!==R.lane?(Se&H)===H:(ol&H)===H){var M=R.revertLane;if(M===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),H===Da&&(L=!0);else if((ol&M)===M){R=R.next,M===Da&&(L=!0);continue}else H={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},j===null?(f=j=H,c=r):j=j.next=H,xe.lanes|=M,Ll|=M;H=R.action,ua&&l(r,H),r=R.hasEagerState?R.eagerState:l(r,H)}else M={lane:H,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},j===null?(f=j=M,c=r):j=j.next=M,xe.lanes|=H,Ll|=H;R=R.next}while(R!==null&&R!==t);if(j===null?c=r:j.next=f,!Tt(r,e.memoizedState)&&($e=!0,L&&(l=La,l!==null)))throw l;e.memoizedState=r,e.baseState=c,e.baseQueue=j,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function bi(e){var t=Qe(),l=t.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=e;var a=l.dispatch,s=l.pending,r=t.memoizedState;if(s!==null){l.pending=null;var c=s=s.next;do r=e(r,c.action),c=c.next;while(c!==s);Tt(r,t.memoizedState)||($e=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),l.lastRenderedState=r}return[r,a]}function vu(e,t,l){var a=xe,s=Qe(),r=Ee;if(r){if(l===void 0)throw Error(u(407));l=l()}else l=t();var c=!Tt((ze||s).memoizedState,l);if(c&&(s.memoizedState=l,$e=!0),s=s.queue,Ni(bu.bind(null,a,s,e),[e]),s.getSnapshot!==t||c||Je!==null&&Je.memoizedState.tag&1){if(a.flags|=2048,Ya(9,{destroy:void 0},gu.bind(null,a,s,l,t),null),Le===null)throw Error(u(349));r||(ol&127)!==0||yu(a,t,l)}return l}function yu(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=xe.updateQueue,t===null?(t=_s(),xe.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function gu(e,t,l,a){t.value=l,t.getSnapshot=a,ju(t)&&Su(e)}function bu(e,t,l){return l(function(){ju(t)&&Su(e)})}function ju(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Tt(e,l)}catch{return!0}}function Su(e){var t=ta(e,2);t!==null&&jt(t,e,2)}function ji(e){var t=ot();if(typeof e=="function"){var l=e;if(e=l(),ua){Sl(!0);try{l()}finally{Sl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:e},t}function Nu(e,t,l,a){return e.baseState=l,gi(e,ze,typeof a=="function"?a:ul)}function Hx(e,t,l,a,s){if(Os(e))throw Error(u(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(c){r.listeners.push(c)}};N.T!==null?l(!0):r.isTransition=!1,a(r),l=t.pending,l===null?(r.next=t.pending=r,Eu(t,r)):(r.next=l.next,t.pending=l.next=r)}}function Eu(e,t){var l=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=N.T,c={};N.T=c;try{var f=l(s,a),j=N.S;j!==null&&j(c,f),Tu(e,t,f)}catch(R){Si(e,t,R)}finally{r!==null&&c.types!==null&&(r.types=c.types),N.T=r}}else try{r=l(s,a),Tu(e,t,r)}catch(R){Si(e,t,R)}}function Tu(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Cu(e,t,a)},function(a){return Si(e,t,a)}):Cu(e,t,l)}function Cu(e,t,l){t.status="fulfilled",t.value=l,ku(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Eu(e,l)))}function Si(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,ku(t),t=t.next;while(t!==a)}e.action=null}function ku(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Au(e,t){return t}function _u(e,t){if(Ee){var l=Le.formState;if(l!==null){e:{var a=xe;if(Ee){if(Be){t:{for(var s=Be,r=qt;s.nodeType!==8;){if(!r){s=null;break t}if(s=Yt(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Be=Yt(s.nextSibling),a=s.data==="F!";break e}}kl(a)}a=!1}a&&(t=l[0])}}return l=ot(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Au,lastRenderedState:t},l.queue=a,l=Ju.bind(null,xe,a),a.dispatch=l,a=ji(!1),r=Ai.bind(null,xe,!1,a.queue),a=ot(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,l=Hx.bind(null,xe,s,r,l),s.dispatch=l,a.memoizedState=e,[t,l,!1]}function Ru(e){var t=Qe();return wu(t,ze,e)}function wu(e,t,l){if(t=gi(e,t,Au)[0],e=ws(ul)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Cn(t)}catch(c){throw c===Ba?js:c}else a=t;t=Qe();var s=t.queue,r=s.dispatch;return l!==t.memoizedState&&(xe.flags|=2048,Ya(9,{destroy:void 0},qx.bind(null,s,l),null)),[a,r,e]}function qx(e,t){e.action=t}function Mu(e){var t=Qe(),l=ze;if(l!==null)return wu(t,l,e);Qe(),t=t.memoizedState,l=Qe();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function Ya(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=xe.updateQueue,t===null&&(t=_s(),xe.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function zu(){return Qe().memoizedState}function Ms(e,t,l,a){var s=ot();xe.flags|=e,s.memoizedState=Ya(1|t,{destroy:void 0},l,a===void 0?null:a)}function zs(e,t,l,a){var s=Qe();a=a===void 0?null:a;var r=s.memoizedState.inst;ze!==null&&a!==null&&mi(a,ze.memoizedState.deps)?s.memoizedState=Ya(t,r,l,a):(xe.flags|=e,s.memoizedState=Ya(1|t,r,l,a))}function Ou(e,t){Ms(8390656,8,e,t)}function Ni(e,t){zs(2048,8,e,t)}function Gx(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=_s(),xe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Du(e){var t=Qe().memoizedState;return Gx({ref:t,nextImpl:e}),function(){if((_e&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Lu(e,t){return zs(4,2,e,t)}function Bu(e,t){return zs(4,4,e,t)}function Uu(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 Hu(e,t,l){l=l!=null?l.concat([e]):null,zs(4,4,Uu.bind(null,t,e),l)}function Ei(){}function qu(e,t){var l=Qe();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&mi(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function Gu(e,t){var l=Qe();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&mi(t,a[1]))return a[0];if(a=e(),ua){Sl(!0);try{e()}finally{Sl(!1)}}return l.memoizedState=[a,t],a}function Ti(e,t,l){return l===void 0||(ol&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Yd(),xe.lanes|=e,Ll|=e,l)}function Yu(e,t,l,a){return Tt(l,t)?l:Ha.current!==null?(e=Ti(e,l,a),Tt(e,t)||($e=!0),e):(ol&42)===0||(ol&1073741824)!==0&&(Se&261930)===0?($e=!0,e.memoizedState=l):(e=Yd(),xe.lanes|=e,Ll|=e,t)}function Vu(e,t,l,a,s){var r=k.p;k.p=r!==0&&8>r?r:8;var c=N.T,f={};N.T=f,Ai(e,!1,t,l);try{var j=s(),R=N.S;if(R!==null&&R(f,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var L=Lx(j,a);kn(e,t,L,wt(e))}else kn(e,t,a,wt(e))}catch(H){kn(e,t,{then:function(){},status:"rejected",reason:H},wt())}finally{k.p=r,c!==null&&f.types!==null&&(c.types=f.types),N.T=c}}function Yx(){}function Ci(e,t,l,a){if(e.tag!==5)throw Error(u(476));var s=Qu(e).queue;Vu(e,s,t,J,l===null?Yx:function(){return Xu(e),l(a)})}function Qu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:J},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Xu(e){var t=Qu(e);t.next===null&&(t=e.alternate.memoizedState),kn(e,t.next.queue,{},wt())}function ki(){return at(Qn)}function Zu(){return Qe().memoizedState}function Ku(){return Qe().memoizedState}function Vx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=wt();e=Rl(l);var a=wl(t,e,l);a!==null&&(jt(a,t,l),Sn(a,t,l)),t={cache:li()},e.payload=t;return}t=t.return}}function Qx(e,t,l){var a=wt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Os(e)?$u(t,l):(l=Xr(e,t,l,a),l!==null&&(jt(l,e,a),Wu(l,t,a)))}function Ju(e,t,l){var a=wt();kn(e,t,l,a)}function kn(e,t,l,a){var s={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Os(e))$u(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var c=t.lastRenderedState,f=r(c,l);if(s.hasEagerState=!0,s.eagerState=f,Tt(f,c))return xs(e,t,s,0),Le===null&&ms(),!1}catch{}finally{}if(l=Xr(e,t,s,a),l!==null)return jt(l,e,a),Wu(l,t,a),!0}return!1}function Ai(e,t,l,a){if(a={lane:2,revertLane:rc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Os(e)){if(t)throw Error(u(479))}else t=Xr(e,l,a,2),t!==null&&jt(t,e,2)}function Os(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function $u(e,t){qa=ks=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Wu(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,eo(e,l)}}var An={readContext:at,use:Rs,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useLayoutEffect:Ge,useInsertionEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useSyncExternalStore:Ge,useId:Ge,useHostTransitionStatus:Ge,useFormState:Ge,useActionState:Ge,useOptimistic:Ge,useMemoCache:Ge,useCacheRefresh:Ge};An.useEffectEvent=Ge;var Fu={readContext:at,use:Rs,useCallback:function(e,t){return ot().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:Ou,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Ms(4194308,4,Uu.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Ms(4194308,4,e,t)},useInsertionEffect:function(e,t){Ms(4,2,e,t)},useMemo:function(e,t){var l=ot();t=t===void 0?null:t;var a=e();if(ua){Sl(!0);try{e()}finally{Sl(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=ot();if(l!==void 0){var s=l(t);if(ua){Sl(!0);try{l(t)}finally{Sl(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=Qx.bind(null,xe,e),[a.memoizedState,e]},useRef:function(e){var t=ot();return e={current:e},t.memoizedState=e},useState:function(e){e=ji(e);var t=e.queue,l=Ju.bind(null,xe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Ei,useDeferredValue:function(e,t){var l=ot();return Ti(l,e,t)},useTransition:function(){var e=ji(!1);return e=Vu.bind(null,xe,e.queue,!0,!1),ot().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=xe,s=ot();if(Ee){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Le===null)throw Error(u(349));(Se&127)!==0||yu(a,t,l)}s.memoizedState=l;var r={value:l,getSnapshot:t};return s.queue=r,Ou(bu.bind(null,a,r,e),[e]),a.flags|=2048,Ya(9,{destroy:void 0},gu.bind(null,a,r,l,t),null),l},useId:function(){var e=ot(),t=Le.identifierPrefix;if(Ee){var l=Wt,a=$t;l=(a&~(1<<32-Et(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=As++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Bx++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ki,useFormState:_u,useActionState:_u,useOptimistic:function(e){var t=ot();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Ai.bind(null,xe,!0,l),l.dispatch=t,[e,t]},useMemoCache:yi,useCacheRefresh:function(){return ot().memoizedState=Vx.bind(null,xe)},useEffectEvent:function(e){var t=ot(),l={impl:e};return t.memoizedState=l,function(){if((_e&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},_i={readContext:at,use:Rs,useCallback:qu,useContext:at,useEffect:Ni,useImperativeHandle:Hu,useInsertionEffect:Lu,useLayoutEffect:Bu,useMemo:Gu,useReducer:ws,useRef:zu,useState:function(){return ws(ul)},useDebugValue:Ei,useDeferredValue:function(e,t){var l=Qe();return Yu(l,ze.memoizedState,e,t)},useTransition:function(){var e=ws(ul)[0],t=Qe().memoizedState;return[typeof e=="boolean"?e:Cn(e),t]},useSyncExternalStore:vu,useId:Zu,useHostTransitionStatus:ki,useFormState:Ru,useActionState:Ru,useOptimistic:function(e,t){var l=Qe();return Nu(l,ze,e,t)},useMemoCache:yi,useCacheRefresh:Ku};_i.useEffectEvent=Du;var Iu={readContext:at,use:Rs,useCallback:qu,useContext:at,useEffect:Ni,useImperativeHandle:Hu,useInsertionEffect:Lu,useLayoutEffect:Bu,useMemo:Gu,useReducer:bi,useRef:zu,useState:function(){return bi(ul)},useDebugValue:Ei,useDeferredValue:function(e,t){var l=Qe();return ze===null?Ti(l,e,t):Yu(l,ze.memoizedState,e,t)},useTransition:function(){var e=bi(ul)[0],t=Qe().memoizedState;return[typeof e=="boolean"?e:Cn(e),t]},useSyncExternalStore:vu,useId:Zu,useHostTransitionStatus:ki,useFormState:Mu,useActionState:Mu,useOptimistic:function(e,t){var l=Qe();return ze!==null?Nu(l,ze,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:yi,useCacheRefresh:Ku};Iu.useEffectEvent=Du;function Ri(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:g({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var wi={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=wt(),s=Rl(a);s.payload=t,l!=null&&(s.callback=l),t=wl(e,s,a),t!==null&&(jt(t,e,a),Sn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=wt(),s=Rl(a);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=wl(e,s,a),t!==null&&(jt(t,e,a),Sn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=wt(),a=Rl(l);a.tag=2,t!=null&&(a.callback=t),t=wl(e,a,l),t!==null&&(jt(t,e,l),Sn(t,e,l))}};function Pu(e,t,l,a,s,r,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,c):t.prototype&&t.prototype.isPureReactComponent?!xn(l,a)||!xn(s,r):!0}function ed(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&wi.enqueueReplaceState(t,t.state,null)}function da(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}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 td(e){fs(e)}function ld(e){console.error(e)}function ad(e){fs(e)}function Ds(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function nd(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Mi(e,t,l){return l=Rl(l),l.tag=3,l.payload={element:null},l.callback=function(){Ds(e,t)},l}function sd(e){return e=Rl(e),e.tag=3,e}function rd(e,t,l,a){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var r=a.value;e.payload=function(){return s(r)},e.callback=function(){nd(t,l,a)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){nd(t,l,a),typeof s!="function"&&(Bl===null?Bl=new Set([this]):Bl.add(this));var f=a.stack;this.componentDidCatch(a.value,{componentStack:f!==null?f:""})})}function Xx(e,t,l,a,s){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&Oa(t,l,s,!0),l=kt.current,l!==null){switch(l.tag){case 31:case 13:return Gt===null?Ks():l.alternate===null&&Ye===0&&(Ye=3),l.flags&=-257,l.flags|=65536,l.lanes=s,a===Ss?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),ac(e,a,s)),!1;case 22:return l.flags|=65536,a===Ss?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),ac(e,a,s)),!1}throw Error(u(435,l.tag))}return ac(e,a,s),Ks(),!1}if(Ee)return t=kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==Fr&&(e=Error(u(422),{cause:a}),vn(Bt(e,l)))):(a!==Fr&&(t=Error(u(423),{cause:a}),vn(Bt(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Bt(a,l),s=Mi(e.stateNode,a,s),ci(e,s),Ye!==4&&(Ye=2)),!1;var r=Error(u(520),{cause:a});if(r=Bt(r,l),Ln===null?Ln=[r]:Ln.push(r),Ye!==4&&(Ye=2),t===null)return!0;a=Bt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=Mi(l.stateNode,a,e),ci(l,e),!1;case 1:if(t=l.type,r=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Bl===null||!Bl.has(r))))return l.flags|=65536,s&=-s,l.lanes|=s,s=sd(s),rd(s,e,l,a),ci(l,s),!1}l=l.return}while(l!==null);return!1}var zi=Error(u(461)),$e=!1;function nt(e,t,l,a){t.child=e===null?uu(t,null,l,a):oa(t,e.child,l,a)}function id(e,t,l,a,s){l=l.render;var r=t.ref;if("ref"in a){var c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}else c=a;return sa(t),a=xi(e,t,l,c,r,s),f=pi(),e!==null&&!$e?(hi(e,t,s),dl(e,t,s)):(Ee&&f&&$r(t),t.flags|=1,nt(e,t,a,s),t.child)}function cd(e,t,l,a,s){if(e===null){var r=l.type;return typeof r=="function"&&!Zr(r)&&r.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=r,od(e,t,r,a,s)):(e=hs(l.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!Gi(e,s)){var c=r.memoizedProps;if(l=l.compare,l=l!==null?l:xn,l(c,a)&&e.ref===t.ref)return dl(e,t,s)}return t.flags|=1,e=sl(r,a),e.ref=t.ref,e.return=t,t.child=e}function od(e,t,l,a,s){if(e!==null){var r=e.memoizedProps;if(xn(r,a)&&e.ref===t.ref)if($e=!1,t.pendingProps=a=r,Gi(e,s))(e.flags&131072)!==0&&($e=!0);else return t.lanes=e.lanes,dl(e,t,s)}return Oi(e,t,l,a,s)}function ud(e,t,l,a){var s=a.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|l:l,e!==null){for(a=t.child=e.child,s=0;a!==null;)s=s|a.lanes|a.childLanes,a=a.sibling;a=s&~r}else a=0,t.child=null;return dd(e,t,r,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bs(t,r!==null?r.cachePool:null),r!==null?mu(t,r):ui(),xu(t);else return a=t.lanes=536870912,dd(e,t,r!==null?r.baseLanes|l:l,l,a)}else r!==null?(bs(t,r.cachePool),mu(t,r),zl(),t.memoizedState=null):(e!==null&&bs(t,null),ui(),zl());return nt(e,t,s,l),t.child}function _n(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dd(e,t,l,a,s){var r=ni();return r=r===null?null:{parent:Ke._currentValue,pool:r},t.memoizedState={baseLanes:l,cachePool:r},e!==null&&bs(t,null),ui(),xu(t),e!==null&&Oa(e,t,a,!0),t.childLanes=s,null}function Ls(e,t){return t=Us({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fd(e,t,l){return oa(t,e.child,null,l),e=Ls(t,t.pendingProps),e.flags|=2,At(t),t.memoizedState=null,e}function Zx(e,t,l){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ee){if(a.mode==="hidden")return e=Ls(t,a),t.lanes=536870912,_n(null,e);if(fi(t),(e=Be)?(e=Tf(e,qt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Tl!==null?{id:$t,overflow:Wt}:null,retryLane:536870912,hydrationErrors:null},l=$o(e),l.return=t,t.child=l,lt=t,Be=null)):e=null,e===null)throw kl(t);return t.lanes=536870912,null}return Ls(t,a)}var r=e.memoizedState;if(r!==null){var c=r.dehydrated;if(fi(t),s)if(t.flags&256)t.flags&=-257,t=fd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if($e||Oa(e,t,l,!1),s=(l&e.childLanes)!==0,$e||s){if(a=Le,a!==null&&(c=to(a,l),c!==0&&c!==r.retryLane))throw r.retryLane=c,ta(e,c),jt(a,e,c),zi;Ks(),t=fd(e,t,l)}else e=r.treeContext,Be=Yt(c.nextSibling),lt=t,Ee=!0,Cl=null,qt=!1,e!==null&&Io(t,e),t=Ls(t,a),t.flags|=4096;return t}return e=sl(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Bs(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 Oi(e,t,l,a,s){return sa(t),l=xi(e,t,l,a,void 0,s),a=pi(),e!==null&&!$e?(hi(e,t,s),dl(e,t,s)):(Ee&&a&&$r(t),t.flags|=1,nt(e,t,l,s),t.child)}function md(e,t,l,a,s,r){return sa(t),t.updateQueue=null,l=hu(t,a,l,s),pu(e),a=pi(),e!==null&&!$e?(hi(e,t,r),dl(e,t,r)):(Ee&&a&&$r(t),t.flags|=1,nt(e,t,l,r),t.child)}function xd(e,t,l,a,s){if(sa(t),t.stateNode===null){var r=Ra,c=l.contextType;typeof c=="object"&&c!==null&&(r=at(c)),r=new l(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=wi,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},ri(t),c=l.contextType,r.context=typeof c=="object"&&c!==null?at(c):Ra,r.state=t.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(Ri(t,l,c,a),r.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(c=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),c!==r.state&&wi.enqueueReplaceState(r,r.state,null),En(t,a,r,s),Nn(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var f=t.memoizedProps,j=da(l,f);r.props=j;var R=r.context,L=l.contextType;c=Ra,typeof L=="object"&&L!==null&&(c=at(L));var H=l.getDerivedStateFromProps;L=typeof H=="function"||typeof r.getSnapshotBeforeUpdate=="function",f=t.pendingProps!==f,L||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f||R!==c)&&ed(t,r,a,c),_l=!1;var M=t.memoizedState;r.state=M,En(t,a,r,s),Nn(),R=t.memoizedState,f||M!==R||_l?(typeof H=="function"&&(Ri(t,l,H,a),R=t.memoizedState),(j=_l||Pu(t,l,j,a,M,R,c))?(L||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=R),r.props=a,r.state=R,r.context=c,a=j):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,ii(e,t),c=t.memoizedProps,L=da(l,c),r.props=L,H=t.pendingProps,M=r.context,R=l.contextType,j=Ra,typeof R=="object"&&R!==null&&(j=at(R)),f=l.getDerivedStateFromProps,(R=typeof f=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(c!==H||M!==j)&&ed(t,r,a,j),_l=!1,M=t.memoizedState,r.state=M,En(t,a,r,s),Nn();var O=t.memoizedState;c!==H||M!==O||_l||e!==null&&e.dependencies!==null&&ys(e.dependencies)?(typeof f=="function"&&(Ri(t,l,f,a),O=t.memoizedState),(L=_l||Pu(t,l,L,a,M,O,j)||e!==null&&e.dependencies!==null&&ys(e.dependencies))?(R||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,O,j),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,O,j)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||c===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=O),r.props=a,r.state=O,r.context=j,a=L):(typeof r.componentDidUpdate!="function"||c===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,Bs(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=oa(t,e.child,null,s),t.child=oa(t,null,l,s)):nt(e,t,l,s),t.memoizedState=r.state,e=t.child):e=dl(e,t,s),e}function pd(e,t,l,a){return aa(),t.flags|=256,nt(e,t,l,a),t.child}var Di={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Li(e){return{baseLanes:e,cachePool:nu()}}function Bi(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Rt),e}function hd(e,t,l){var a=t.pendingProps,s=!1,r=(t.flags&128)!==0,c;if((c=r)||(c=e!==null&&e.memoizedState===null?!1:(Ve.current&2)!==0),c&&(s=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(s?Ml(t):zl(),(e=Be)?(e=Tf(e,qt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Tl!==null?{id:$t,overflow:Wt}:null,retryLane:536870912,hydrationErrors:null},l=$o(e),l.return=t,t.child=l,lt=t,Be=null)):e=null,e===null)throw kl(t);return gc(e)?t.lanes=32:t.lanes=536870912,null}var f=a.children;return a=a.fallback,s?(zl(),s=t.mode,f=Us({mode:"hidden",children:f},s),a=la(a,s,l,null),f.return=t,a.return=t,f.sibling=a,t.child=f,a=t.child,a.memoizedState=Li(l),a.childLanes=Bi(e,c,l),t.memoizedState=Di,_n(null,a)):(Ml(t),Ui(t,f))}var j=e.memoizedState;if(j!==null&&(f=j.dehydrated,f!==null)){if(r)t.flags&256?(Ml(t),t.flags&=-257,t=Hi(e,t,l)):t.memoizedState!==null?(zl(),t.child=e.child,t.flags|=128,t=null):(zl(),f=a.fallback,s=t.mode,a=Us({mode:"visible",children:a.children},s),f=la(f,s,l,null),f.flags|=2,a.return=t,f.return=t,a.sibling=f,t.child=a,oa(t,e.child,null,l),a=t.child,a.memoizedState=Li(l),a.childLanes=Bi(e,c,l),t.memoizedState=Di,t=_n(null,a));else if(Ml(t),gc(f)){if(c=f.nextSibling&&f.nextSibling.dataset,c)var R=c.dgst;c=R,a=Error(u(419)),a.stack="",a.digest=c,vn({value:a,source:null,stack:null}),t=Hi(e,t,l)}else if($e||Oa(e,t,l,!1),c=(l&e.childLanes)!==0,$e||c){if(c=Le,c!==null&&(a=to(c,l),a!==0&&a!==j.retryLane))throw j.retryLane=a,ta(e,a),jt(c,e,a),zi;yc(f)||Ks(),t=Hi(e,t,l)}else yc(f)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Be=Yt(f.nextSibling),lt=t,Ee=!0,Cl=null,qt=!1,e!==null&&Io(t,e),t=Ui(t,a.children),t.flags|=4096);return t}return s?(zl(),f=a.fallback,s=t.mode,j=e.child,R=j.sibling,a=sl(j,{mode:"hidden",children:a.children}),a.subtreeFlags=j.subtreeFlags&65011712,R!==null?f=sl(R,f):(f=la(f,s,l,null),f.flags|=2),f.return=t,a.return=t,a.sibling=f,t.child=a,_n(null,a),a=t.child,f=e.child.memoizedState,f===null?f=Li(l):(s=f.cachePool,s!==null?(j=Ke._currentValue,s=s.parent!==j?{parent:j,pool:j}:s):s=nu(),f={baseLanes:f.baseLanes|l,cachePool:s}),a.memoizedState=f,a.childLanes=Bi(e,c,l),t.memoizedState=Di,_n(e.child,a)):(Ml(t),l=e.child,e=l.sibling,l=sl(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=l,t.memoizedState=null,l)}function Ui(e,t){return t=Us({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Us(e,t){return e=Ct(22,e,null,t),e.lanes=0,e}function Hi(e,t,l){return oa(t,e.child,null,l),e=Ui(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vd(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),ei(e.return,t,l)}function qi(e,t,l,a,s,r){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:s,treeForkCount:r}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=a,c.tail=l,c.tailMode=s,c.treeForkCount=r)}function yd(e,t,l){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var c=Ve.current,f=(c&2)!==0;if(f?(c=c&1|2,t.flags|=128):c&=1,Z(Ve,c),nt(e,t,a,l),a=Ee?hn:0,!f&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vd(e,l,t);else if(e.tag===19)vd(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&&Cs(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),qi(t,!1,s,l,r,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Cs(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}qi(t,!0,l,null,r,a);break;case"together":qi(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function dl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Ll|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Oa(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=sl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=sl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Gi(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ys(e)))}function Kx(e,t,l){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Al(t,Ke,e.memoizedState.cache),aa();break;case 27:case 5:ct(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Al(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,fi(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Ml(t),t.flags|=128,null):(l&t.child.childLanes)!==0?hd(e,t,l):(Ml(t),e=dl(e,t,l),e!==null?e.sibling:null);Ml(t);break;case 19:var s=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(Oa(e,t,l,!1),a=(l&t.childLanes)!==0),s){if(a)return yd(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Z(Ve,Ve.current),a)break;return null;case 22:return t.lanes=0,ud(e,t,l,t.pendingProps);case 24:Al(t,Ke,e.memoizedState.cache)}return dl(e,t,l)}function gd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)$e=!0;else{if(!Gi(e,l)&&(t.flags&128)===0)return $e=!1,Kx(e,t,l);$e=(e.flags&131072)!==0}else $e=!1,Ee&&(t.flags&1048576)!==0&&Fo(t,hn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ia(t.elementType),t.type=e,typeof e=="function")Zr(e)?(a=da(e,a),t.tag=1,t=xd(null,t,e,a,l)):(t.tag=0,t=Oi(null,t,e,a,l));else{if(e!=null){var s=e.$$typeof;if(s===q){t.tag=11,t=id(null,t,e,a,l);break e}else if(s===F){t.tag=14,t=cd(null,t,e,a,l);break e}}throw t=ue(e)||e,Error(u(306,t,""))}}return t;case 0:return Oi(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,s=da(a,t.pendingProps),xd(e,t,a,s,l);case 3:e:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,ii(e,t),En(t,a,null,l);var c=t.memoizedState;if(a=c.cache,Al(t,Ke,a),a!==r.cache&&ti(t,[Ke],l,!0),Nn(),a=c.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=pd(e,t,a,l);break e}else if(a!==s){s=Bt(Error(u(424)),t),vn(s),t=pd(e,t,a,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(Be=Yt(e.firstChild),lt=t,Ee=!0,Cl=null,qt=!0,l=uu(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(aa(),a===s){t=dl(e,t,l);break e}nt(e,t,a,l)}t=t.child}return t;case 26:return Bs(e,t),e===null?(l=wf(t.type,null,t.pendingProps,null))?t.memoizedState=l:Ee||(l=t.type,e=t.pendingProps,a=er(Y.current).createElement(l),a[tt]=t,a[pt]=e,st(a,l,e),Pe(a),t.stateNode=a):t.memoizedState=wf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ct(t),e===null&&Ee&&(a=t.stateNode=Af(t.type,t.pendingProps,Y.current),lt=t,qt=!0,s=Be,Gl(t.type)?(bc=s,Be=Yt(a.firstChild)):Be=s),nt(e,t,t.pendingProps.children,l),Bs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((s=a=Be)&&(a=Np(a,t.type,t.pendingProps,qt),a!==null?(t.stateNode=a,lt=t,Be=Yt(a.firstChild),qt=!1,s=!0):s=!1),s||kl(t)),ct(t),s=t.type,r=t.pendingProps,c=e!==null?e.memoizedProps:null,a=r.children,pc(s,r)?a=null:c!==null&&pc(s,c)&&(t.flags|=32),t.memoizedState!==null&&(s=xi(e,t,Ux,null,null,l),Qn._currentValue=s),Bs(e,t),nt(e,t,a,l),t.child;case 6:return e===null&&Ee&&((e=l=Be)&&(l=Ep(l,t.pendingProps,qt),l!==null?(t.stateNode=l,lt=t,Be=null,e=!0):e=!1),e||kl(t)),null;case 13:return hd(e,t,l);case 4:return de(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=oa(t,null,a,l):nt(e,t,a,l),t.child;case 11:return id(e,t,t.type,t.pendingProps,l);case 7:return nt(e,t,t.pendingProps,l),t.child;case 8:return nt(e,t,t.pendingProps.children,l),t.child;case 12:return nt(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,Al(t,t.type,a.value),nt(e,t,a.children,l),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,sa(t),s=at(s),a=a(s),t.flags|=1,nt(e,t,a,l),t.child;case 14:return cd(e,t,t.type,t.pendingProps,l);case 15:return od(e,t,t.type,t.pendingProps,l);case 19:return yd(e,t,l);case 31:return Zx(e,t,l);case 22:return ud(e,t,l,t.pendingProps);case 24:return sa(t),a=at(Ke),e===null?(s=ni(),s===null&&(s=Le,r=li(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=l),s=r),t.memoizedState={parent:a,cache:s},ri(t),Al(t,Ke,s)):((e.lanes&l)!==0&&(ii(e,t),En(t,null,null,l),Nn()),s=e.memoizedState,r=t.memoizedState,s.parent!==a?(s={parent:a,cache:a},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Al(t,Ke,a)):(a=r.cache,Al(t,Ke,a),a!==s.cache&&ti(t,[Ke],l,!0))),nt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function fl(e){e.flags|=4}function Yi(e,t,l,a,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(Zd())e.flags|=8192;else throw ca=Ss,si}else e.flags&=-16777217}function bd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Lf(t))if(Zd())e.flags|=8192;else throw ca=Ss,si}function Hs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ic():536870912,e.lanes|=t,Za|=t)}function Rn(e,t){if(!Ee)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 a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Ue(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags&65011712,a|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags,a|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function Jx(e,t,l){var a=t.pendingProps;switch(Wr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return Ue(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),cl(Ke),ge(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(za(t)?fl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ir())),Ue(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(fl(t),r!==null?(Ue(t),bd(t,r)):(Ue(t),Yi(t,s,null,a,l))):r?r!==e.memoizedState?(fl(t),Ue(t),bd(t,r)):(Ue(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&fl(t),Ue(t),Yi(t,s,e,a,l)),null;case 27:if(bl(t),l=Y.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&fl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Ue(t),null}e=w.current,za(t)?Po(t):(e=Af(s,a,l),t.stateNode=e,fl(t))}return Ue(t),null;case 5:if(bl(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&fl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Ue(t),null}if(r=w.current,za(t))Po(t);else{var c=er(Y.current);switch(r){case 1:r=c.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=c.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=c.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?c.createElement(s,{is:a.is}):c.createElement(s)}}r[tt]=t,r[pt]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)r.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=r;e:switch(st(r,s,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&fl(t)}}return Ue(t),Yi(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&fl(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=Y.current,za(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=lt,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[tt]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||vf(e.nodeValue,l)),e||kl(t,!0)}else e=er(e).createTextNode(a),e[tt]=t,t.stateNode=e}return Ue(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=za(t),l!==null){if(e===null){if(!a)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[tt]=t}else aa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ue(t),e=!1}else l=Ir(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(At(t),t):(At(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ue(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=za(t),a!==null&&a.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[tt]=t}else aa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ue(t),s=!1}else s=Ir(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(At(t),t):(At(t),null)}return At(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Hs(t,t.updateQueue),Ue(t),null);case 4:return ge(),e===null&&uc(t.stateNode.containerInfo),Ue(t),null;case 10:return cl(t.type),Ue(t),null;case 19:if(D(Ve),a=t.memoizedState,a===null)return Ue(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)Rn(a,!1);else{if(Ye!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Cs(e),r!==null){for(t.flags|=128,Rn(a,!1),e=r.updateQueue,t.updateQueue=e,Hs(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Jo(l,e),l=l.sibling;return Z(Ve,Ve.current&1|2),Ee&&rl(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&qe()>Qs&&(t.flags|=128,s=!0,Rn(a,!1),t.lanes=4194304)}else{if(!s)if(e=Cs(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Hs(t,e),Rn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!Ee)return Ue(t),null}else 2*qe()-a.renderingStartTime>Qs&&l!==536870912&&(t.flags|=128,s=!0,Rn(a,!1),t.lanes=4194304);a.isBackwards?(r.sibling=t.child,t.child=r):(e=a.last,e!==null?e.sibling=r:t.child=r,a.last=r)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=qe(),e.sibling=null,l=Ve.current,Z(Ve,s?l&1|2:l&1),Ee&&rl(t,a.treeForkCount),e):(Ue(t),null);case 22:case 23:return At(t),di(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),l=t.updateQueue,l!==null&&Hs(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&D(ra),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),cl(Ke),Ue(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function $x(e,t){switch(Wr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cl(Ke),ge(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return bl(t),null;case 31:if(t.memoizedState!==null){if(At(t),t.alternate===null)throw Error(u(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(At(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(Ve),null;case 4:return ge(),null;case 10:return cl(t.type),null;case 22:case 23:return At(t),di(),e!==null&&D(ra),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return cl(Ke),null;case 25:return null;default:return null}}function jd(e,t){switch(Wr(t),t.tag){case 3:cl(Ke),ge();break;case 26:case 27:case 5:bl(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&At(t);break;case 13:At(t);break;case 19:D(Ve);break;case 10:cl(t.type);break;case 22:case 23:At(t),di(),e!==null&&D(ra);break;case 24:cl(Ke)}}function wn(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var s=a.next;l=s;do{if((l.tag&e)===e){a=void 0;var r=l.create,c=l.inst;a=r(),c.destroy=a}l=l.next}while(l!==s)}}catch(f){Me(t,t.return,f)}}function Ol(e,t,l){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var r=s.next;a=r;do{if((a.tag&e)===e){var c=a.inst,f=c.destroy;if(f!==void 0){c.destroy=void 0,s=t;var j=l,R=f;try{R()}catch(L){Me(s,j,L)}}}a=a.next}while(a!==r)}}catch(L){Me(t,t.return,L)}}function Sd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{fu(t,l)}catch(a){Me(e,e.return,a)}}}function Nd(e,t,l){l.props=da(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Me(e,t,a)}}function Mn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(s){Me(e,t,s)}}function Ft(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(s){Me(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){Me(e,t,s)}else l.current=null}function Ed(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(s){Me(e,e.return,s)}}function Vi(e,t,l){try{var a=e.stateNode;vp(a,e.type,l,t),a[pt]=t}catch(s){Me(e,e.return,s)}}function Td(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Gl(e.type)||e.tag===4}function Qi(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Td(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&&Gl(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 Xi(e,t,l){var a=e.tag;if(a===5||a===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=al));else if(a!==4&&(a===27&&Gl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Xi(e,t,l),e=e.sibling;e!==null;)Xi(e,t,l),e=e.sibling}function qs(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&Gl(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 Cd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);st(t,a,l),t[tt]=e,t[pt]=l}catch(r){Me(e,e.return,r)}}var ml=!1,We=!1,Zi=!1,kd=typeof WeakSet=="function"?WeakSet:Set,et=null;function Wx(e,t){if(e=e.containerInfo,mc=ir,e=Ho(e),Hr(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var s=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{l.nodeType,r.nodeType}catch{l=null;break e}var c=0,f=-1,j=-1,R=0,L=0,H=e,M=null;t:for(;;){for(var O;H!==l||s!==0&&H.nodeType!==3||(f=c+s),H!==r||a!==0&&H.nodeType!==3||(j=c+a),H.nodeType===3&&(c+=H.nodeValue.length),(O=H.firstChild)!==null;)M=H,H=O;for(;;){if(H===e)break t;if(M===l&&++R===s&&(f=c),M===r&&++L===a&&(j=c),(O=H.nextSibling)!==null)break;H=M,M=H.parentNode}H=O}l=f===-1||j===-1?null:{start:f,end:j}}else l=null}l=l||{start:0,end:0}}else l=null;for(xc={focusedElem:e,selectionRange:l},ir=!1,et=t;et!==null;)if(t=et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,et=e;else for(;et!==null;){switch(t=et,r=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&&r!==null){e=void 0,l=t,s=r.memoizedProps,r=r.memoizedState,a=l.stateNode;try{var le=da(l.type,s);e=a.getSnapshotBeforeUpdate(le,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(oe){Me(l,l.return,oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)vc(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":vc(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,et=e;break}et=t.return}}function Ad(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:pl(e,l),a&4&&wn(5,l);break;case 1:if(pl(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(c){Me(l,l.return,c)}else{var s=da(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){Me(l,l.return,c)}}a&64&&Sd(l),a&512&&Mn(l,l.return);break;case 3:if(pl(e,l),a&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{fu(e,t)}catch(c){Me(l,l.return,c)}}break;case 27:t===null&&a&4&&Cd(l);case 26:case 5:pl(e,l),t===null&&a&4&&Ed(l),a&512&&Mn(l,l.return);break;case 12:pl(e,l);break;case 31:pl(e,l),a&4&&wd(e,l);break;case 13:pl(e,l),a&4&&Md(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=sp.bind(null,l),Tp(e,l))));break;case 22:if(a=l.memoizedState!==null||ml,!a){t=t!==null&&t.memoizedState!==null||We,s=ml;var r=We;ml=a,(We=t)&&!r?hl(e,l,(l.subtreeFlags&8772)!==0):pl(e,l),ml=s,We=r}break;case 30:break;default:pl(e,l)}}function _d(e){var t=e.alternate;t!==null&&(e.alternate=null,_d(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Sr(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 He=null,vt=!1;function xl(e,t,l){for(l=l.child;l!==null;)Rd(e,t,l),l=l.sibling}function Rd(e,t,l){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount($l,l)}catch{}switch(l.tag){case 26:We||Ft(l,t),xl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:We||Ft(l,t);var a=He,s=vt;Gl(l.type)&&(He=l.stateNode,vt=!1),xl(e,t,l),Gn(l.stateNode),He=a,vt=s;break;case 5:We||Ft(l,t);case 6:if(a=He,s=vt,He=null,xl(e,t,l),He=a,vt=s,He!==null)if(vt)try{(He.nodeType===9?He.body:He.nodeName==="HTML"?He.ownerDocument.body:He).removeChild(l.stateNode)}catch(r){Me(l,t,r)}else try{He.removeChild(l.stateNode)}catch(r){Me(l,t,r)}break;case 18:He!==null&&(vt?(e=He,Nf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),en(e)):Nf(He,l.stateNode));break;case 4:a=He,s=vt,He=l.stateNode.containerInfo,vt=!0,xl(e,t,l),He=a,vt=s;break;case 0:case 11:case 14:case 15:Ol(2,l,t),We||Ol(4,l,t),xl(e,t,l);break;case 1:We||(Ft(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Nd(l,t,a)),xl(e,t,l);break;case 21:xl(e,t,l);break;case 22:We=(a=We)||l.memoizedState!==null,xl(e,t,l),We=a;break;default:xl(e,t,l)}}function wd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{en(e)}catch(l){Me(t,t.return,l)}}}function Md(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{en(e)}catch(l){Me(t,t.return,l)}}function Fx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new kd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new kd),t;default:throw Error(u(435,e.tag))}}function Gs(e,t){var l=Fx(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var s=rp.bind(null,e,a);a.then(s,s)}})}function yt(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var s=l[a],r=e,c=t,f=c;e:for(;f!==null;){switch(f.tag){case 27:if(Gl(f.type)){He=f.stateNode,vt=!1;break e}break;case 5:He=f.stateNode,vt=!1;break e;case 3:case 4:He=f.stateNode.containerInfo,vt=!0;break e}f=f.return}if(He===null)throw Error(u(160));Rd(r,c,s),He=null,vt=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)zd(t,e),t=t.sibling}var Kt=null;function zd(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:yt(t,e),gt(e),a&4&&(Ol(3,e,e.return),wn(3,e),Ol(5,e,e.return));break;case 1:yt(t,e),gt(e),a&512&&(We||l===null||Ft(l,l.return)),a&64&&ml&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var s=Kt;if(yt(t,e),gt(e),a&512&&(We||l===null||Ft(l,l.return)),a&4){var r=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,s=s.ownerDocument||s;t:switch(a){case"title":r=s.getElementsByTagName("title")[0],(!r||r[nn]||r[tt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(a),s.head.insertBefore(r,s.querySelector("head > title"))),st(r,a,l),r[tt]=e,Pe(r),a=r;break e;case"link":var c=Of("link","href",s).get(a+(l.href||""));if(c){for(var f=0;f<c.length;f++)if(r=c[f],r.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&r.getAttribute("rel")===(l.rel==null?null:l.rel)&&r.getAttribute("title")===(l.title==null?null:l.title)&&r.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){c.splice(f,1);break t}}r=s.createElement(a),st(r,a,l),s.head.appendChild(r);break;case"meta":if(c=Of("meta","content",s).get(a+(l.content||""))){for(f=0;f<c.length;f++)if(r=c[f],r.getAttribute("content")===(l.content==null?null:""+l.content)&&r.getAttribute("name")===(l.name==null?null:l.name)&&r.getAttribute("property")===(l.property==null?null:l.property)&&r.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&r.getAttribute("charset")===(l.charSet==null?null:l.charSet)){c.splice(f,1);break t}}r=s.createElement(a),st(r,a,l),s.head.appendChild(r);break;default:throw Error(u(468,a))}r[tt]=e,Pe(r),a=r}e.stateNode=a}else Df(s,e.type,e.stateNode);else e.stateNode=zf(s,a,e.memoizedProps);else r!==a?(r===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):r.count--,a===null?Df(s,e.type,e.stateNode):zf(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Vi(e,e.memoizedProps,l.memoizedProps)}break;case 27:yt(t,e),gt(e),a&512&&(We||l===null||Ft(l,l.return)),l!==null&&a&4&&Vi(e,e.memoizedProps,l.memoizedProps);break;case 5:if(yt(t,e),gt(e),a&512&&(We||l===null||Ft(l,l.return)),e.flags&32){s=e.stateNode;try{Na(s,"")}catch(le){Me(e,e.return,le)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,Vi(e,s,l!==null?l.memoizedProps:s)),a&1024&&(Zi=!0);break;case 6:if(yt(t,e),gt(e),a&4){if(e.stateNode===null)throw Error(u(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(le){Me(e,e.return,le)}}break;case 3:if(ar=null,s=Kt,Kt=tr(t.containerInfo),yt(t,e),Kt=s,gt(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{en(t.containerInfo)}catch(le){Me(e,e.return,le)}Zi&&(Zi=!1,Od(e));break;case 4:a=Kt,Kt=tr(e.stateNode.containerInfo),yt(t,e),gt(e),Kt=a;break;case 12:yt(t,e),gt(e);break;case 31:yt(t,e),gt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gs(e,a)));break;case 13:yt(t,e),gt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Vs=qe()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gs(e,a)));break;case 22:s=e.memoizedState!==null;var j=l!==null&&l.memoizedState!==null,R=ml,L=We;if(ml=R||s,We=L||j,yt(t,e),We=L,ml=R,gt(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||j||ml||We||fa(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){j=l=t;try{if(r=j.stateNode,s)c=r.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{f=j.stateNode;var H=j.memoizedProps.style,M=H!=null&&H.hasOwnProperty("display")?H.display:null;f.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(le){Me(j,j.return,le)}}}else if(t.tag===6){if(l===null){j=t;try{j.stateNode.nodeValue=s?"":j.memoizedProps}catch(le){Me(j,j.return,le)}}}else if(t.tag===18){if(l===null){j=t;try{var O=j.stateNode;s?Ef(O,!0):Ef(j.stateNode,!1)}catch(le){Me(j,j.return,le)}}}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}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,Gs(e,l))));break;case 19:yt(t,e),gt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gs(e,a)));break;case 30:break;case 21:break;default:yt(t,e),gt(e)}}function gt(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(Td(a)){l=a;break}a=a.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var s=l.stateNode,r=Qi(e);qs(e,r,s);break;case 5:var c=l.stateNode;l.flags&32&&(Na(c,""),l.flags&=-33);var f=Qi(e);qs(e,f,c);break;case 3:case 4:var j=l.stateNode.containerInfo,R=Qi(e);Xi(e,R,j);break;default:throw Error(u(161))}}catch(L){Me(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Od(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Od(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function pl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ad(e,t.alternate,t),t=t.sibling}function fa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ol(4,t,t.return),fa(t);break;case 1:Ft(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Nd(t,t.return,l),fa(t);break;case 27:Gn(t.stateNode);case 26:case 5:Ft(t,t.return),fa(t);break;case 22:t.memoizedState===null&&fa(t);break;case 30:fa(t);break;default:fa(t)}e=e.sibling}}function hl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,c=r.flags;switch(r.tag){case 0:case 11:case 15:hl(s,r,l),wn(4,r);break;case 1:if(hl(s,r,l),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(R){Me(a,a.return,R)}if(a=r,s=a.updateQueue,s!==null){var f=a.stateNode;try{var j=s.shared.hiddenCallbacks;if(j!==null)for(s.shared.hiddenCallbacks=null,s=0;s<j.length;s++)du(j[s],f)}catch(R){Me(a,a.return,R)}}l&&c&64&&Sd(r),Mn(r,r.return);break;case 27:Cd(r);case 26:case 5:hl(s,r,l),l&&a===null&&c&4&&Ed(r),Mn(r,r.return);break;case 12:hl(s,r,l);break;case 31:hl(s,r,l),l&&c&4&&wd(s,r);break;case 13:hl(s,r,l),l&&c&4&&Md(s,r);break;case 22:r.memoizedState===null&&hl(s,r,l),Mn(r,r.return);break;case 30:break;default:hl(s,r,l)}t=t.sibling}}function Ki(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&&yn(l))}function Ji(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&yn(e))}function Jt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dd(e,t,l,a),t=t.sibling}function Dd(e,t,l,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Jt(e,t,l,a),s&2048&&wn(9,t);break;case 1:Jt(e,t,l,a);break;case 3:Jt(e,t,l,a),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&yn(e)));break;case 12:if(s&2048){Jt(e,t,l,a),e=t.stateNode;try{var r=t.memoizedProps,c=r.id,f=r.onPostCommit;typeof f=="function"&&f(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Me(t,t.return,j)}}else Jt(e,t,l,a);break;case 31:Jt(e,t,l,a);break;case 13:Jt(e,t,l,a);break;case 23:break;case 22:r=t.stateNode,c=t.alternate,t.memoizedState!==null?r._visibility&2?Jt(e,t,l,a):zn(e,t):r._visibility&2?Jt(e,t,l,a):(r._visibility|=2,Va(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Ki(c,t);break;case 24:Jt(e,t,l,a),s&2048&&Ji(t.alternate,t);break;default:Jt(e,t,l,a)}}function Va(e,t,l,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,c=t,f=l,j=a,R=c.flags;switch(c.tag){case 0:case 11:case 15:Va(r,c,f,j,s),wn(8,c);break;case 23:break;case 22:var L=c.stateNode;c.memoizedState!==null?L._visibility&2?Va(r,c,f,j,s):zn(r,c):(L._visibility|=2,Va(r,c,f,j,s)),s&&R&2048&&Ki(c.alternate,c);break;case 24:Va(r,c,f,j,s),s&&R&2048&&Ji(c.alternate,c);break;default:Va(r,c,f,j,s)}t=t.sibling}}function zn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,s=a.flags;switch(a.tag){case 22:zn(l,a),s&2048&&Ki(a.alternate,a);break;case 24:zn(l,a),s&2048&&Ji(a.alternate,a);break;default:zn(l,a)}t=t.sibling}}var On=8192;function Qa(e,t,l){if(e.subtreeFlags&On)for(e=e.child;e!==null;)Ld(e,t,l),e=e.sibling}function Ld(e,t,l){switch(e.tag){case 26:Qa(e,t,l),e.flags&On&&e.memoizedState!==null&&Bp(l,Kt,e.memoizedState,e.memoizedProps);break;case 5:Qa(e,t,l);break;case 3:case 4:var a=Kt;Kt=tr(e.stateNode.containerInfo),Qa(e,t,l),Kt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=On,On=16777216,Qa(e,t,l),On=a):Qa(e,t,l));break;default:Qa(e,t,l)}}function Bd(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 Dn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];et=a,Hd(a,e)}Bd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ud(e),e=e.sibling}function Ud(e){switch(e.tag){case 0:case 11:case 15:Dn(e),e.flags&2048&&Ol(9,e,e.return);break;case 3:Dn(e);break;case 12:Dn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ys(e)):Dn(e);break;default:Dn(e)}}function Ys(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];et=a,Hd(a,e)}Bd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ol(8,t,t.return),Ys(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Ys(t));break;default:Ys(t)}e=e.sibling}}function Hd(e,t){for(;et!==null;){var l=et;switch(l.tag){case 0:case 11:case 15:Ol(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:yn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,et=a;else e:for(l=e;et!==null;){a=et;var s=a.sibling,r=a.return;if(_d(a),a===l){et=null;break e}if(s!==null){s.return=r,et=s;break e}et=r}}}var Ix={getCacheForType:function(e){var t=at(Ke),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return at(Ke).controller.signal}},Px=typeof WeakMap=="function"?WeakMap:Map,_e=0,Le=null,be=null,Se=0,we=0,_t=null,Dl=!1,Xa=!1,$i=!1,vl=0,Ye=0,Ll=0,ma=0,Wi=0,Rt=0,Za=0,Ln=null,bt=null,Fi=!1,Vs=0,qd=0,Qs=1/0,Xs=null,Bl=null,Fe=0,Ul=null,Ka=null,yl=0,Ii=0,Pi=null,Gd=null,Bn=0,ec=null;function wt(){return(_e&2)!==0&&Se!==0?Se&-Se:N.T!==null?rc():lo()}function Yd(){if(Rt===0)if((Se&536870912)===0||Ee){var e=Pn;Pn<<=1,(Pn&3932160)===0&&(Pn=262144),Rt=e}else Rt=536870912;return e=kt.current,e!==null&&(e.flags|=32),Rt}function jt(e,t,l){(e===Le&&(we===2||we===9)||e.cancelPendingCommit!==null)&&(Ja(e,0),Hl(e,Se,Rt,!1)),an(e,l),((_e&2)===0||e!==Le)&&(e===Le&&((_e&2)===0&&(ma|=l),Ye===4&&Hl(e,Se,Rt,!1)),It(e))}function Vd(e,t,l){if((_e&6)!==0)throw Error(u(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||ln(e,t),s=a?lp(e,t):lc(e,t,!0),r=a;do{if(s===0){Xa&&!a&&Hl(e,t,0,!1);break}else{if(l=e.current.alternate,r&&!ep(l)){s=lc(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var f=e;s=Ln;var j=f.current.memoizedState.isDehydrated;if(j&&(Ja(f,c).flags|=256),c=lc(f,c,!1),c!==2){if($i&&!j){f.errorRecoveryDisabledLanes|=r,ma|=r,s=4;break e}r=bt,bt=s,r!==null&&(bt===null?bt=r:bt.push.apply(bt,r))}s=c}if(r=!1,s!==2)continue}}if(s===1){Ja(e,0),Hl(e,t,0,!0);break}e:{switch(a=e,r=s,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Hl(a,t,Rt,!Dl);break e;case 2:bt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=Vs+300-qe(),10<s)){if(Hl(a,t,Rt,!Dl),ts(a,0,!0)!==0)break e;yl=t,a.timeoutHandle=jf(Qd.bind(null,a,l,bt,Xs,Fi,t,Rt,ma,Za,Dl,r,"Throttled",-0,0),s);break e}Qd(a,l,bt,Xs,Fi,t,Rt,ma,Za,Dl,r,null,-0,0)}}break}while(!0);It(e)}function Qd(e,t,l,a,s,r,c,f,j,R,L,H,M,O){if(e.timeoutHandle=-1,H=t.subtreeFlags,H&8192||(H&16785408)===16785408){H={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:al},Ld(t,r,H);var le=(r&62914560)===r?Vs-qe():(r&4194048)===r?qd-qe():0;if(le=Up(H,le),le!==null){yl=r,e.cancelPendingCommit=le(Id.bind(null,e,t,r,l,a,s,c,f,j,L,H,null,M,O)),Hl(e,r,c,!R);return}}Id(e,t,r,l,a,s,c,f,j)}function ep(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 a=0;a<l.length;a++){var s=l[a],r=s.getSnapshot;s=s.value;try{if(!Tt(r(),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 Hl(e,t,l,a){t&=~Wi,t&=~ma,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-Et(s),c=1<<r;a[r]=-1,s&=~c}l!==0&&Pc(e,l,t)}function Zs(){return(_e&6)===0?(Un(0),!1):!0}function tc(){if(be!==null){if(we===0)var e=be.return;else e=be,il=na=null,vi(e),Ua=null,bn=0,e=be;for(;e!==null;)jd(e.alternate,e),e=e.return;be=null}}function Ja(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,bp(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),yl=0,tc(),Le=e,be=l=sl(e.current,null),Se=t,we=0,_t=null,Dl=!1,Xa=ln(e,t),$i=!1,Za=Rt=Wi=ma=Ll=Ye=0,bt=Ln=null,Fi=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var s=31-Et(a),r=1<<s;t|=e[s],a&=~r}return vl=t,ms(),l}function Xd(e,t){xe=null,N.H=An,t===Ba||t===js?(t=iu(),we=3):t===si?(t=iu(),we=4):we=t===zi?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,_t=t,be===null&&(Ye=1,Ds(e,Bt(t,e.current)))}function Zd(){var e=kt.current;return e===null?!0:(Se&4194048)===Se?Gt===null:(Se&62914560)===Se||(Se&536870912)!==0?e===Gt:!1}function Kd(){var e=N.H;return N.H=An,e===null?An:e}function Jd(){var e=N.A;return N.A=Ix,e}function Ks(){Ye=4,Dl||(Se&4194048)!==Se&&kt.current!==null||(Xa=!0),(Ll&134217727)===0&&(ma&134217727)===0||Le===null||Hl(Le,Se,Rt,!1)}function lc(e,t,l){var a=_e;_e|=2;var s=Kd(),r=Jd();(Le!==e||Se!==t)&&(Xs=null,Ja(e,t)),t=!1;var c=Ye;e:do try{if(we!==0&&be!==null){var f=be,j=_t;switch(we){case 8:tc(),c=6;break e;case 3:case 2:case 9:case 6:kt.current===null&&(t=!0);var R=we;if(we=0,_t=null,$a(e,f,j,R),l&&Xa){c=0;break e}break;default:R=we,we=0,_t=null,$a(e,f,j,R)}}tp(),c=Ye;break}catch(L){Xd(e,L)}while(!0);return t&&e.shellSuspendCounter++,il=na=null,_e=a,N.H=s,N.A=r,be===null&&(Le=null,Se=0,ms()),c}function tp(){for(;be!==null;)$d(be)}function lp(e,t){var l=_e;_e|=2;var a=Kd(),s=Jd();Le!==e||Se!==t?(Xs=null,Qs=qe()+500,Ja(e,t)):Xa=ln(e,t);e:do try{if(we!==0&&be!==null){t=be;var r=_t;t:switch(we){case 1:we=0,_t=null,$a(e,t,r,1);break;case 2:case 9:if(su(r)){we=0,_t=null,Wd(t);break}t=function(){we!==2&&we!==9||Le!==e||(we=7),It(e)},r.then(t,t);break e;case 3:we=7;break e;case 4:we=5;break e;case 7:su(r)?(we=0,_t=null,Wd(t)):(we=0,_t=null,$a(e,t,r,7));break;case 5:var c=null;switch(be.tag){case 26:c=be.memoizedState;case 5:case 27:var f=be;if(c?Lf(c):f.stateNode.complete){we=0,_t=null;var j=f.sibling;if(j!==null)be=j;else{var R=f.return;R!==null?(be=R,Js(R)):be=null}break t}}we=0,_t=null,$a(e,t,r,5);break;case 6:we=0,_t=null,$a(e,t,r,6);break;case 8:tc(),Ye=6;break e;default:throw Error(u(462))}}ap();break}catch(L){Xd(e,L)}while(!0);return il=na=null,N.H=a,N.A=s,_e=l,be!==null?0:(Le=null,Se=0,ms(),Ye)}function ap(){for(;be!==null&&!ha();)$d(be)}function $d(e){var t=gd(e.alternate,e,vl);e.memoizedProps=e.pendingProps,t===null?Js(e):be=t}function Wd(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=md(l,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=md(l,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:vi(t);default:jd(l,t),t=be=Jo(t,vl),t=gd(l,t,vl)}e.memoizedProps=e.pendingProps,t===null?Js(e):be=t}function $a(e,t,l,a){il=na=null,vi(t),Ua=null,bn=0;var s=t.return;try{if(Xx(e,s,t,l,Se)){Ye=1,Ds(e,Bt(l,e.current)),be=null;return}}catch(r){if(s!==null)throw be=s,r;Ye=1,Ds(e,Bt(l,e.current)),be=null;return}t.flags&32768?(Ee||a===1?e=!0:Xa||(Se&536870912)!==0?e=!1:(Dl=e=!0,(a===2||a===9||a===3||a===6)&&(a=kt.current,a!==null&&a.tag===13&&(a.flags|=16384))),Fd(t,e)):Js(t)}function Js(e){var t=e;do{if((t.flags&32768)!==0){Fd(t,Dl);return}e=t.return;var l=Jx(t.alternate,t,vl);if(l!==null){be=l;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Ye===0&&(Ye=5)}function Fd(e,t){do{var l=$x(e.alternate,e);if(l!==null){l.flags&=32767,be=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){be=e;return}be=e=l}while(e!==null);Ye=6,be=null}function Id(e,t,l,a,s,r,c,f,j){e.cancelPendingCommit=null;do $s();while(Fe!==0);if((_e&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(r=t.lanes|t.childLanes,r|=Qr,Lm(e,l,r,c,f,j),e===Le&&(be=Le=null,Se=0),Ka=t,Ul=e,yl=l,Ii=r,Pi=s,Gd=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ip(mt,function(){return af(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=N.T,N.T=null,s=k.p,k.p=2,c=_e,_e|=4;try{Wx(e,t,l)}finally{_e=c,k.p=s,N.T=a}}Fe=1,Pd(),ef(),tf()}}function Pd(){if(Fe===1){Fe=0;var e=Ul,t=Ka,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=N.T,N.T=null;var a=k.p;k.p=2;var s=_e;_e|=4;try{zd(t,e);var r=xc,c=Ho(e.containerInfo),f=r.focusedElem,j=r.selectionRange;if(c!==f&&f&&f.ownerDocument&&Uo(f.ownerDocument.documentElement,f)){if(j!==null&&Hr(f)){var R=j.start,L=j.end;if(L===void 0&&(L=R),"selectionStart"in f)f.selectionStart=R,f.selectionEnd=Math.min(L,f.value.length);else{var H=f.ownerDocument||document,M=H&&H.defaultView||window;if(M.getSelection){var O=M.getSelection(),le=f.textContent.length,oe=Math.min(j.start,le),De=j.end===void 0?oe:Math.min(j.end,le);!O.extend&&oe>De&&(c=De,De=oe,oe=c);var C=Bo(f,oe),E=Bo(f,De);if(C&&E&&(O.rangeCount!==1||O.anchorNode!==C.node||O.anchorOffset!==C.offset||O.focusNode!==E.node||O.focusOffset!==E.offset)){var _=H.createRange();_.setStart(C.node,C.offset),O.removeAllRanges(),oe>De?(O.addRange(_),O.extend(E.node,E.offset)):(_.setEnd(E.node,E.offset),O.addRange(_))}}}}for(H=[],O=f;O=O.parentNode;)O.nodeType===1&&H.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<H.length;f++){var U=H[f];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}ir=!!mc,xc=mc=null}finally{_e=s,k.p=a,N.T=l}}e.current=t,Fe=2}}function ef(){if(Fe===2){Fe=0;var e=Ul,t=Ka,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=N.T,N.T=null;var a=k.p;k.p=2;var s=_e;_e|=4;try{Ad(e,t.alternate,t)}finally{_e=s,k.p=a,N.T=l}}Fe=3}}function tf(){if(Fe===4||Fe===3){Fe=0,ft();var e=Ul,t=Ka,l=yl,a=Gd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Fe=5:(Fe=0,Ka=Ul=null,lf(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Bl=null),br(l),t=t.stateNode,Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot($l,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=N.T,s=k.p,k.p=2,N.T=null;try{for(var r=e.onRecoverableError,c=0;c<a.length;c++){var f=a[c];r(f.value,{componentStack:f.stack})}}finally{N.T=t,k.p=s}}(yl&3)!==0&&$s(),It(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===ec?Bn++:(Bn=0,ec=e):Bn=0,Un(0)}}function lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,yn(t)))}function $s(){return Pd(),ef(),tf(),af()}function af(){if(Fe!==5)return!1;var e=Ul,t=Ii;Ii=0;var l=br(yl),a=N.T,s=k.p;try{k.p=32>l?32:l,N.T=null,l=Pi,Pi=null;var r=Ul,c=yl;if(Fe=0,Ka=Ul=null,yl=0,(_e&6)!==0)throw Error(u(331));var f=_e;if(_e|=4,Ud(r.current),Dd(r,r.current,c,l),_e=f,Un(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot($l,r)}catch{}return!0}finally{k.p=s,N.T=a,lf(e,t)}}function nf(e,t,l){t=Bt(l,t),t=Mi(e.stateNode,t,2),e=wl(e,t,2),e!==null&&(an(e,2),It(e))}function Me(e,t,l){if(e.tag===3)nf(e,e,l);else for(;t!==null;){if(t.tag===3){nf(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Bl===null||!Bl.has(a))){e=Bt(l,e),l=sd(2),a=wl(t,l,2),a!==null&&(rd(l,a,t,e),an(a,2),It(a));break}}t=t.return}}function ac(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Px;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(l)||($i=!0,s.add(l),e=np.bind(null,e,t,l),t.then(e,e))}function np(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Le===e&&(Se&l)===l&&(Ye===4||Ye===3&&(Se&62914560)===Se&&300>qe()-Vs?(_e&2)===0&&Ja(e,0):Wi|=l,Za===Se&&(Za=0)),It(e)}function sf(e,t){t===0&&(t=Ic()),e=ta(e,t),e!==null&&(an(e,t),It(e))}function sp(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),sf(e,l)}function rp(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(l=s.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(u(314))}a!==null&&a.delete(t),sf(e,l)}function ip(e,t){return Ce(e,t)}var Ws=null,Wa=null,nc=!1,Fs=!1,sc=!1,ql=0;function It(e){e!==Wa&&e.next===null&&(Wa===null?Ws=Wa=e:Wa=Wa.next=e),Fs=!0,nc||(nc=!0,op())}function Un(e,t){if(!sc&&Fs){sc=!0;do for(var l=!1,a=Ws;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var c=a.suspendedLanes,f=a.pingedLanes;r=(1<<31-Et(42|e)+1)-1,r&=s&~(c&~f),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(l=!0,uf(a,r))}else r=Se,r=ts(a,a===Le?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||ln(a,r)||(l=!0,uf(a,r));a=a.next}while(l);sc=!1}}function cp(){rf()}function rf(){Fs=nc=!1;var e=0;ql!==0&&gp()&&(e=ql);for(var t=qe(),l=null,a=Ws;a!==null;){var s=a.next,r=cf(a,t);r===0?(a.next=null,l===null?Ws=s:l.next=s,s===null&&(Wa=l)):(l=a,(e!==0||(r&3)!==0)&&(Fs=!0)),a=s}Fe!==0&&Fe!==5||Un(e),ql!==0&&(ql=0)}function cf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var c=31-Et(r),f=1<<c,j=s[c];j===-1?((f&l)===0||(f&a)!==0)&&(s[c]=Dm(f,t)):j<=t&&(e.expiredLanes|=f),r&=~f}if(t=Le,l=Se,l=ts(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(we===2||we===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&el(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||ln(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&el(a),br(l)){case 2:case 8:l=zt;break;case 32:l=mt;break;case 268435456:l=xt;break;default:l=mt}return a=of.bind(null,e),l=Ce(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&el(a),e.callbackPriority=2,e.callbackNode=null,2}function of(e,t){if(Fe!==0&&Fe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if($s()&&e.callbackNode!==l)return null;var a=Se;return a=ts(e,e===Le?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Vd(e,a,t),cf(e,qe()),e.callbackNode!=null&&e.callbackNode===l?of.bind(null,e):null)}function uf(e,t){if($s())return null;Vd(e,t,!0)}function op(){jp(function(){(_e&6)!==0?Ce(Xt,cp):rf()})}function rc(){if(ql===0){var e=Da;e===0&&(e=In,In<<=1,(In&261888)===0&&(In=256)),ql=e}return ql}function df(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ss(""+e)}function ff(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 up(e,t,l,a,s){if(t==="submit"&&l&&l.stateNode===s){var r=df((s[pt]||null).action),c=a.submitter;c&&(t=(t=c[pt]||null)?df(t.formAction):c.getAttribute("formAction"),t!==null&&(r=t,c=null));var f=new os("action","action",null,a,s);e.push({event:f,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ql!==0){var j=c?ff(s,c):new FormData(s);Ci(l,{pending:!0,data:j,method:s.method,action:r},null,j)}}else typeof r=="function"&&(f.preventDefault(),j=c?ff(s,c):new FormData(s),Ci(l,{pending:!0,data:j,method:s.method,action:r},r,j))},currentTarget:s}]})}}for(var ic=0;ic<Vr.length;ic++){var cc=Vr[ic],dp=cc.toLowerCase(),fp=cc[0].toUpperCase()+cc.slice(1);Zt(dp,"on"+fp)}Zt(Yo,"onAnimationEnd"),Zt(Vo,"onAnimationIteration"),Zt(Qo,"onAnimationStart"),Zt("dblclick","onDoubleClick"),Zt("focusin","onFocus"),Zt("focusout","onBlur"),Zt(Ax,"onTransitionRun"),Zt(_x,"onTransitionStart"),Zt(Rx,"onTransitionCancel"),Zt(Xo,"onTransitionEnd"),ja("onMouseEnter",["mouseout","mouseover"]),ja("onMouseLeave",["mouseout","mouseover"]),ja("onPointerEnter",["pointerout","pointerover"]),ja("onPointerLeave",["pointerout","pointerover"]),Fl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hn="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(" "),mp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hn));function mf(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],s=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var c=a.length-1;0<=c;c--){var f=a[c],j=f.instance,R=f.currentTarget;if(f=f.listener,j!==r&&s.isPropagationStopped())break e;r=f,s.currentTarget=R;try{r(s)}catch(L){fs(L)}s.currentTarget=null,r=j}else for(c=0;c<a.length;c++){if(f=a[c],j=f.instance,R=f.currentTarget,f=f.listener,j!==r&&s.isPropagationStopped())break e;r=f,s.currentTarget=R;try{r(s)}catch(L){fs(L)}s.currentTarget=null,r=j}}}}function je(e,t){var l=t[jr];l===void 0&&(l=t[jr]=new Set);var a=e+"__bubble";l.has(a)||(xf(t,e,2,!1),l.add(a))}function oc(e,t,l){var a=0;t&&(a|=4),xf(l,e,a,t)}var Is="_reactListening"+Math.random().toString(36).slice(2);function uc(e){if(!e[Is]){e[Is]=!0,so.forEach(function(l){l!=="selectionchange"&&(mp.has(l)||oc(l,!1,e),oc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Is]||(t[Is]=!0,oc("selectionchange",!1,t))}}function xf(e,t,l,a){switch(Vf(t)){case 2:var s=Gp;break;case 8:s=Yp;break;default:s=Tc}l=s.bind(null,t,l,e),s=void 0,!Rr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),a?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 dc(e,t,l,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var c=a.tag;if(c===3||c===4){var f=a.stateNode.containerInfo;if(f===s)break;if(c===4)for(c=a.return;c!==null;){var j=c.tag;if((j===3||j===4)&&c.stateNode.containerInfo===s)return;c=c.return}for(;f!==null;){if(c=ya(f),c===null)return;if(j=c.tag,j===5||j===6||j===26||j===27){a=r=c;continue e}f=f.parentNode}}a=a.return}yo(function(){var R=r,L=Ar(l),H=[];e:{var M=Zo.get(e);if(M!==void 0){var O=os,le=e;switch(e){case"keypress":if(is(l)===0)break e;case"keydown":case"keyup":O=rx;break;case"focusin":le="focus",O=Or;break;case"focusout":le="blur",O=Or;break;case"beforeblur":case"afterblur":O=Or;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":O=jo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=Jm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=ox;break;case Yo:case Vo:case Qo:O=Fm;break;case Xo:O=dx;break;case"scroll":case"scrollend":O=Zm;break;case"wheel":O=mx;break;case"copy":case"cut":case"paste":O=Pm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=No;break;case"toggle":case"beforetoggle":O=px}var oe=(t&4)!==0,De=!oe&&(e==="scroll"||e==="scrollend"),C=oe?M!==null?M+"Capture":null:M;oe=[];for(var E=R,_;E!==null;){var U=E;if(_=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||_===null||C===null||(U=rn(E,C),U!=null&&oe.push(qn(E,U,_))),De)break;E=E.return}0<oe.length&&(M=new O(M,le,null,l,L),H.push({event:M,listeners:oe}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",M&&l!==kr&&(le=l.relatedTarget||l.fromElement)&&(ya(le)||le[va]))break e;if((O||M)&&(M=L.window===L?L:(M=L.ownerDocument)?M.defaultView||M.parentWindow:window,O?(le=l.relatedTarget||l.toElement,O=R,le=le?ya(le):null,le!==null&&(De=h(le),oe=le.tag,le!==De||oe!==5&&oe!==27&&oe!==6)&&(le=null)):(O=null,le=R),O!==le)){if(oe=jo,U="onMouseLeave",C="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(oe=No,U="onPointerLeave",C="onPointerEnter",E="pointer"),De=O==null?M:sn(O),_=le==null?M:sn(le),M=new oe(U,E+"leave",O,l,L),M.target=De,M.relatedTarget=_,U=null,ya(L)===R&&(oe=new oe(C,E+"enter",le,l,L),oe.target=_,oe.relatedTarget=De,U=oe),De=U,O&&le)t:{for(oe=xp,C=O,E=le,_=0,U=C;U;U=oe(U))_++;U=0;for(var ce=E;ce;ce=oe(ce))U++;for(;0<_-U;)C=oe(C),_--;for(;0<U-_;)E=oe(E),U--;for(;_--;){if(C===E||E!==null&&C===E.alternate){oe=C;break t}C=oe(C),E=oe(E)}oe=null}else oe=null;O!==null&&pf(H,M,O,oe,!1),le!==null&&De!==null&&pf(H,De,le,oe,!0)}}e:{if(M=R?sn(R):window,O=M.nodeName&&M.nodeName.toLowerCase(),O==="select"||O==="input"&&M.type==="file")var ke=wo;else if(_o(M))if(Mo)ke=Tx;else{ke=Nx;var se=Sx}else O=M.nodeName,!O||O.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?R&&Cr(R.elementType)&&(ke=wo):ke=Ex;if(ke&&(ke=ke(e,R))){Ro(H,ke,l,L);break e}se&&se(e,M,R),e==="focusout"&&R&&M.type==="number"&&R.memoizedProps.value!=null&&Tr(M,"number",M.value)}switch(se=R?sn(R):window,e){case"focusin":(_o(se)||se.contentEditable==="true")&&(ka=se,qr=R,pn=null);break;case"focusout":pn=qr=ka=null;break;case"mousedown":Gr=!0;break;case"contextmenu":case"mouseup":case"dragend":Gr=!1,qo(H,l,L);break;case"selectionchange":if(kx)break;case"keydown":case"keyup":qo(H,l,L)}var he;if(Lr)e:{switch(e){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else Ca?ko(e,l)&&(Ne="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ne="onCompositionStart");Ne&&(Eo&&l.locale!=="ko"&&(Ca||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&Ca&&(he=go()):(El=L,wr="value"in El?El.value:El.textContent,Ca=!0)),se=Ps(R,Ne),0<se.length&&(Ne=new So(Ne,e,null,l,L),H.push({event:Ne,listeners:se}),he?Ne.data=he:(he=Ao(l),he!==null&&(Ne.data=he)))),(he=vx?yx(e,l):gx(e,l))&&(Ne=Ps(R,"onBeforeInput"),0<Ne.length&&(se=new So("onBeforeInput","beforeinput",null,l,L),H.push({event:se,listeners:Ne}),se.data=he)),up(H,e,R,l,L)}mf(H,t)})}function qn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Ps(e,t){for(var l=t+"Capture",a=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=rn(e,l),s!=null&&a.unshift(qn(e,s,r)),s=rn(e,t),s!=null&&a.push(qn(e,s,r))),e.tag===3)return a;e=e.return}return[]}function xp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pf(e,t,l,a,s){for(var r=t._reactName,c=[];l!==null&&l!==a;){var f=l,j=f.alternate,R=f.stateNode;if(f=f.tag,j!==null&&j===a)break;f!==5&&f!==26&&f!==27||R===null||(j=R,s?(R=rn(l,r),R!=null&&c.unshift(qn(l,R,j))):s||(R=rn(l,r),R!=null&&c.push(qn(l,R,j)))),l=l.return}c.length!==0&&e.push({event:t,listeners:c})}var pp=/\r\n?/g,hp=/\u0000|\uFFFD/g;function hf(e){return(typeof e=="string"?e:""+e).replace(pp,`
49
+ `).replace(hp,"")}function vf(e,t){return t=hf(t),hf(e)===t}function Oe(e,t,l,a,s,r){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Na(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Na(e,""+a);break;case"className":as(e,"class",a);break;case"tabIndex":as(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":as(e,l,a);break;case"style":ho(e,a,r);break;case"data":if(t!=="object"){as(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=ss(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="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 r=="function"&&(l==="formAction"?(t!=="input"&&Oe(e,t,"name",s.name,s,null),Oe(e,t,"formEncType",s.formEncType,s,null),Oe(e,t,"formMethod",s.formMethod,s,null),Oe(e,t,"formTarget",s.formTarget,s,null)):(Oe(e,t,"encType",s.encType,s,null),Oe(e,t,"method",s.method,s,null),Oe(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=ss(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=al);break;case"onScroll":a!=null&&je("scroll",e);break;case"onScrollEnd":a!=null&&je("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=ss(""+a),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":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":je("beforetoggle",e),je("toggle",e),ls(e,"popover",a);break;case"xlinkActuate":ll(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":ll(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":ll(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":ll(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":ll(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":ll(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":ll(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":ll(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":ll(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ls(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Qm.get(l)||l,ls(e,l,a))}}function fc(e,t,l,a,s,r){switch(l){case"style":ho(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"children":typeof a=="string"?Na(e,a):(typeof a=="number"||typeof a=="bigint")&&Na(e,""+a);break;case"onScroll":a!=null&&je("scroll",e);break;case"onScrollEnd":a!=null&&je("scrollend",e);break;case"onClick":a!=null&&(e.onclick=al);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ro.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),t=l.slice(2,s?l.length-7:void 0),r=e[pt]||null,r=r!=null?r[l]:null,typeof r=="function"&&e.removeEventListener(t,r,s),typeof a=="function")){typeof r!="function"&&r!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,s);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):ls(e,l,a)}}}function st(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var a=!1,s=!1,r;for(r in l)if(l.hasOwnProperty(r)){var c=l[r];if(c!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Oe(e,t,r,c,l,null)}}s&&Oe(e,t,"srcSet",l.srcSet,l,null),a&&Oe(e,t,"src",l.src,l,null);return;case"input":je("invalid",e);var f=r=c=s=null,j=null,R=null;for(a in l)if(l.hasOwnProperty(a)){var L=l[a];if(L!=null)switch(a){case"name":s=L;break;case"type":c=L;break;case"checked":j=L;break;case"defaultChecked":R=L;break;case"value":r=L;break;case"defaultValue":f=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(u(137,t));break;default:Oe(e,t,a,L,l,null)}}fo(e,r,f,j,R,c,s,!1);return;case"select":je("invalid",e),a=c=r=null;for(s in l)if(l.hasOwnProperty(s)&&(f=l[s],f!=null))switch(s){case"value":r=f;break;case"defaultValue":c=f;break;case"multiple":a=f;default:Oe(e,t,s,f,l,null)}t=r,l=c,e.multiple=!!a,t!=null?Sa(e,!!a,t,!1):l!=null&&Sa(e,!!a,l,!0);return;case"textarea":je("invalid",e),r=s=a=null;for(c in l)if(l.hasOwnProperty(c)&&(f=l[c],f!=null))switch(c){case"value":a=f;break;case"defaultValue":s=f;break;case"children":r=f;break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(u(91));break;default:Oe(e,t,c,f,l,null)}xo(e,a,s,r);return;case"option":for(j in l)if(l.hasOwnProperty(j)&&(a=l[j],a!=null))switch(j){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Oe(e,t,j,a,l,null)}return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(a=0;a<Hn.length;a++)je(Hn[a],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("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)&&(a=l[R],a!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Oe(e,t,R,a,l,null)}return;default:if(Cr(t)){for(L in l)l.hasOwnProperty(L)&&(a=l[L],a!==void 0&&fc(e,t,L,a,l,void 0));return}}for(f in l)l.hasOwnProperty(f)&&(a=l[f],a!=null&&Oe(e,t,f,a,l,null))}function vp(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,r=null,c=null,f=null,j=null,R=null,L=null;for(O in l){var H=l[O];if(l.hasOwnProperty(O)&&H!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":j=H;default:a.hasOwnProperty(O)||Oe(e,t,O,null,a,H)}}for(var M in a){var O=a[M];if(H=l[M],a.hasOwnProperty(M)&&(O!=null||H!=null))switch(M){case"type":r=O;break;case"name":s=O;break;case"checked":R=O;break;case"defaultChecked":L=O;break;case"value":c=O;break;case"defaultValue":f=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:O!==H&&Oe(e,t,M,O,a,H)}}Er(e,c,f,j,R,L,r,s);return;case"select":O=c=f=M=null;for(r in l)if(j=l[r],l.hasOwnProperty(r)&&j!=null)switch(r){case"value":break;case"multiple":O=j;default:a.hasOwnProperty(r)||Oe(e,t,r,null,a,j)}for(s in a)if(r=a[s],j=l[s],a.hasOwnProperty(s)&&(r!=null||j!=null))switch(s){case"value":M=r;break;case"defaultValue":f=r;break;case"multiple":c=r;default:r!==j&&Oe(e,t,s,r,a,j)}t=f,l=c,a=O,M!=null?Sa(e,!!l,M,!1):!!a!=!!l&&(t!=null?Sa(e,!!l,t,!0):Sa(e,!!l,l?[]:"",!1));return;case"textarea":O=M=null;for(f in l)if(s=l[f],l.hasOwnProperty(f)&&s!=null&&!a.hasOwnProperty(f))switch(f){case"value":break;case"children":break;default:Oe(e,t,f,null,a,s)}for(c in a)if(s=a[c],r=l[c],a.hasOwnProperty(c)&&(s!=null||r!=null))switch(c){case"value":M=s;break;case"defaultValue":O=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==r&&Oe(e,t,c,s,a,r)}mo(e,M,O);return;case"option":for(var le in l)if(M=l[le],l.hasOwnProperty(le)&&M!=null&&!a.hasOwnProperty(le))switch(le){case"selected":e.selected=!1;break;default:Oe(e,t,le,null,a,M)}for(j in a)if(M=a[j],O=l[j],a.hasOwnProperty(j)&&M!==O&&(M!=null||O!=null))switch(j){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:Oe(e,t,j,M,a,O)}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 oe in l)M=l[oe],l.hasOwnProperty(oe)&&M!=null&&!a.hasOwnProperty(oe)&&Oe(e,t,oe,null,a,M);for(R in a)if(M=a[R],O=l[R],a.hasOwnProperty(R)&&M!==O&&(M!=null||O!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(u(137,t));break;default:Oe(e,t,R,M,a,O)}return;default:if(Cr(t)){for(var De in l)M=l[De],l.hasOwnProperty(De)&&M!==void 0&&!a.hasOwnProperty(De)&&fc(e,t,De,void 0,a,M);for(L in a)M=a[L],O=l[L],!a.hasOwnProperty(L)||M===O||M===void 0&&O===void 0||fc(e,t,L,M,a,O);return}}for(var C in l)M=l[C],l.hasOwnProperty(C)&&M!=null&&!a.hasOwnProperty(C)&&Oe(e,t,C,null,a,M);for(H in a)M=a[H],O=l[H],!a.hasOwnProperty(H)||M===O||M==null&&O==null||Oe(e,t,H,M,a,O)}function yf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var s=l[a],r=s.transferSize,c=s.initiatorType,f=s.duration;if(r&&f&&yf(c)){for(c=0,f=s.responseEnd,a+=1;a<l.length;a++){var j=l[a],R=j.startTime;if(R>f)break;var L=j.transferSize,H=j.initiatorType;L&&yf(H)&&(j=j.responseEnd,c+=L*(j<f?1:(f-R)/(j-R)))}if(--a,t+=8*(r+c)/(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 mc=null,xc=null;function er(e){return e.nodeType===9?e:e.ownerDocument}function gf(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 bf(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 pc(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 hc=null;function gp(){var e=window.event;return e&&e.type==="popstate"?e===hc?!1:(hc=e,!0):(hc=null,!1)}var jf=typeof setTimeout=="function"?setTimeout:void 0,bp=typeof clearTimeout=="function"?clearTimeout:void 0,Sf=typeof Promise=="function"?Promise:void 0,jp=typeof queueMicrotask=="function"?queueMicrotask:typeof Sf<"u"?function(e){return Sf.resolve(null).then(e).catch(Sp)}:jf;function Sp(e){setTimeout(function(){throw e})}function Gl(e){return e==="head"}function Nf(e,t){var l=t,a=0;do{var s=l.nextSibling;if(e.removeChild(l),s&&s.nodeType===8)if(l=s.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(s),en(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")Gn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Gn(l);for(var r=l.firstChild;r;){var c=r.nextSibling,f=r.nodeName;r[nn]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&r.rel.toLowerCase()==="stylesheet"||l.removeChild(r),r=c}}else l==="body"&&Gn(e.ownerDocument.body);l=s}while(l);en(t)}function Ef(e,t){var l=e;e=0;do{var a=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||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function vc(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":vc(l),Sr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Np(e,t,l,a){for(;e.nodeType===1;){var s=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[nn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==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(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Yt(e.nextSibling),e===null)break}return null}function Ep(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Yt(e.nextSibling),e===null))return null;return e}function Tf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Yt(e.nextSibling),e===null))return null;return e}function yc(e){return e.data==="$?"||e.data==="$~"}function gc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Tp(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Yt(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 bc=null;function Cf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Yt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function kf(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 Af(e,t,l){switch(t=er(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 Gn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Sr(e)}var Vt=new Map,_f=new Set;function tr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gl=k.d;k.d={f:Cp,r:kp,D:Ap,C:_p,L:Rp,m:wp,X:zp,S:Mp,M:Op};function Cp(){var e=gl.f(),t=Zs();return e||t}function kp(e){var t=ga(e);t!==null&&t.tag===5&&t.type==="form"?Xu(t):gl.r(e)}var Fa=typeof document>"u"?null:document;function Rf(e,t,l){var a=Fa;if(a&&typeof t=="string"&&t){var s=Dt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),_f.has(s)||(_f.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),st(t,"link",e),Pe(t),a.head.appendChild(t)))}}function Ap(e){gl.D(e),Rf("dns-prefetch",e,null)}function _p(e,t){gl.C(e,t),Rf("preconnect",e,t)}function Rp(e,t,l){gl.L(e,t,l);var a=Fa;if(a&&e&&t){var s='link[rel="preload"][as="'+Dt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Dt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Dt(l.imageSizes)+'"]')):s+='[href="'+Dt(e)+'"]';var r=s;switch(t){case"style":r=Ia(e);break;case"script":r=Pa(e)}Vt.has(r)||(e=g({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Vt.set(r,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Yn(r))||t==="script"&&a.querySelector(Vn(r))||(t=a.createElement("link"),st(t,"link",e),Pe(t),a.head.appendChild(t)))}}function wp(e,t){gl.m(e,t);var l=Fa;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Dt(a)+'"][href="'+Dt(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=Pa(e)}if(!Vt.has(r)&&(e=g({rel:"modulepreload",href:e},t),Vt.set(r,e),l.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Vn(r)))return}a=l.createElement("link"),st(a,"link",e),Pe(a),l.head.appendChild(a)}}}function Mp(e,t,l){gl.S(e,t,l);var a=Fa;if(a&&e){var s=ba(a).hoistableStyles,r=Ia(e);t=t||"default";var c=s.get(r);if(!c){var f={loading:0,preload:null};if(c=a.querySelector(Yn(r)))f.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Vt.get(r))&&jc(e,l);var j=c=a.createElement("link");Pe(j),st(j,"link",e),j._p=new Promise(function(R,L){j.onload=R,j.onerror=L}),j.addEventListener("load",function(){f.loading|=1}),j.addEventListener("error",function(){f.loading|=2}),f.loading|=4,lr(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:f},s.set(r,c)}}}function zp(e,t){gl.X(e,t);var l=Fa;if(l&&e){var a=ba(l).hoistableScripts,s=Pa(e),r=a.get(s);r||(r=l.querySelector(Vn(s)),r||(e=g({src:e,async:!0},t),(t=Vt.get(s))&&Sc(e,t),r=l.createElement("script"),Pe(r),st(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Op(e,t){gl.M(e,t);var l=Fa;if(l&&e){var a=ba(l).hoistableScripts,s=Pa(e),r=a.get(s);r||(r=l.querySelector(Vn(s)),r||(e=g({src:e,async:!0,type:"module"},t),(t=Vt.get(s))&&Sc(e,t),r=l.createElement("script"),Pe(r),st(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function wf(e,t,l,a){var s=(s=Y.current)?tr(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=Ia(l.href),l=ba(s).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Ia(l.href);var r=ba(s).hoistableStyles,c=r.get(e);if(c||(s=s.ownerDocument||s,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,c),(r=s.querySelector(Yn(e)))&&!r._p&&(c.instance=r,c.state.loading=5),Vt.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},Vt.set(e,l),r||Dp(s,e,l,c.state))),t&&a===null)throw Error(u(528,""));return c}if(t&&a!==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=Pa(l),l=ba(s).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Ia(e){return'href="'+Dt(e)+'"'}function Yn(e){return'link[rel="stylesheet"]['+e+"]"}function Mf(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Dp(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),st(t,"link",l),Pe(t),e.head.appendChild(t))}function Pa(e){return'[src="'+Dt(e)+'"]'}function Vn(e){return"script[async]"+e}function zf(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Dt(l.href)+'"]');if(a)return t.instance=a,Pe(a),a;var s=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Pe(a),st(a,"style",s),lr(a,l.precedence,e),t.instance=a;case"stylesheet":s=Ia(l.href);var r=e.querySelector(Yn(s));if(r)return t.state.loading|=4,t.instance=r,Pe(r),r;a=Mf(l),(s=Vt.get(s))&&jc(a,s),r=(e.ownerDocument||e).createElement("link"),Pe(r);var c=r;return c._p=new Promise(function(f,j){c.onload=f,c.onerror=j}),st(r,"link",a),t.state.loading|=4,lr(r,l.precedence,e),t.instance=r;case"script":return r=Pa(l.src),(s=e.querySelector(Vn(r)))?(t.instance=s,Pe(s),s):(a=l,(s=Vt.get(r))&&(a=g({},l),Sc(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),Pe(s),st(s,"link",a),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&&(a=t.instance,t.state.loading|=4,lr(a,l.precedence,e));return t.instance}function lr(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,r=s,c=0;c<a.length;c++){var f=a[c];if(f.dataset.precedence===t)r=f;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Sc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ar=null;function Of(e,t,l){if(ar===null){var a=new Map,s=ar=new Map;s.set(l,a)}else s=ar,a=s.get(l),a||(a=new Map,s.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),s=0;s<l.length;s++){var r=l[s];if(!(r[nn]||r[tt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var c=r.getAttribute(t)||"";c=e+c;var f=a.get(c);f?f.push(r):a.set(c,[r])}}return a}function Df(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Lp(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 Lf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Bp(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var s=Ia(a.href),r=t.querySelector(Yn(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=nr.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=r,Pe(r);return}r=t.ownerDocument||t,a=Mf(a),(s=Vt.get(s))&&jc(a,s),r=r.createElement("link"),Pe(r);var c=r;c._p=new Promise(function(f,j){c.onload=f,c.onerror=j}),st(r,"link",a),l.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=nr.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Nc=0;function Up(e,t){return e.stylesheets&&e.count===0&&rr(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&rr(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Nc===0&&(Nc=62500*yp());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&rr(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Nc?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function nr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)rr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sr=null;function rr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sr=new Map,t.forEach(Hp,e),sr=null,nr.call(e))}function Hp(e,t){if(!(t.state.loading&4)){var l=sr.get(e);if(l)var a=l.get(null);else{l=new Map,sr.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var c=s[r];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),a=c)}a&&l.set(null,a)}s=t.instance,c=s.getAttribute("data-precedence"),r=l.get(c)||a,r===a&&l.set(null,s),l.set(c,s),this.count++,a=nr.bind(this),s.addEventListener("load",a),s.addEventListener("error",a),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Qn={$$typeof:ie,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function qp(e,t,l,a,s,r,c,f,j){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=yr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yr(0),this.hiddenUpdates=yr(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function Bf(e,t,l,a,s,r,c,f,j,R,L,H){return e=new qp(e,t,l,c,j,R,L,H,f),t=1,r===!0&&(t|=24),r=Ct(3,null,null,t),e.current=r,r.stateNode=e,t=li(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:l,cache:t},ri(r),e}function Uf(e){return e?(e=Ra,e):Ra}function Hf(e,t,l,a,s,r){s=Uf(s),a.context===null?a.context=s:a.pendingContext=s,a=Rl(t),a.payload={element:l},r=r===void 0?null:r,r!==null&&(a.callback=r),l=wl(e,a,t),l!==null&&(jt(l,e,t),Sn(l,e,t))}function qf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Ec(e,t){qf(e,t),(e=e.alternate)&&qf(e,t)}function Gf(e){if(e.tag===13||e.tag===31){var t=ta(e,67108864);t!==null&&jt(t,e,67108864),Ec(e,67108864)}}function Yf(e){if(e.tag===13||e.tag===31){var t=wt();t=gr(t);var l=ta(e,t);l!==null&&jt(l,e,t),Ec(e,t)}}var ir=!0;function Gp(e,t,l,a){var s=N.T;N.T=null;var r=k.p;try{k.p=2,Tc(e,t,l,a)}finally{k.p=r,N.T=s}}function Yp(e,t,l,a){var s=N.T;N.T=null;var r=k.p;try{k.p=8,Tc(e,t,l,a)}finally{k.p=r,N.T=s}}function Tc(e,t,l,a){if(ir){var s=Cc(a);if(s===null)dc(e,t,a,cr,l),Qf(e,a);else if(Qp(s,e,t,l,a))a.stopPropagation();else if(Qf(e,a),t&4&&-1<Vp.indexOf(e)){for(;s!==null;){var r=ga(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var c=Wl(r.pendingLanes);if(c!==0){var f=r;for(f.pendingLanes|=2,f.entangledLanes|=2;c;){var j=1<<31-Et(c);f.entanglements[1]|=j,c&=~j}It(r),(_e&6)===0&&(Qs=qe()+500,Un(0))}}break;case 31:case 13:f=ta(r,2),f!==null&&jt(f,r,2),Zs(),Ec(r,2)}if(r=Cc(a),r===null&&dc(e,t,a,cr,l),r===s)break;s=r}s!==null&&a.stopPropagation()}else dc(e,t,a,null,l)}}function Cc(e){return e=Ar(e),kc(e)}var cr=null;function kc(e){if(cr=null,e=ya(e),e!==null){var t=h(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=x(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 cr=e,null}function Vf(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(jl()){case Xt:return 2;case zt:return 8;case mt:case Ze:return 32;case xt:return 268435456;default:return 32}default:return 32}}var Ac=!1,Yl=null,Vl=null,Ql=null,Xn=new Map,Zn=new Map,Xl=[],Vp="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 Qf(e,t){switch(e){case"focusin":case"focusout":Yl=null;break;case"dragenter":case"dragleave":Vl=null;break;case"mouseover":case"mouseout":Ql=null;break;case"pointerover":case"pointerout":Xn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zn.delete(t.pointerId)}}function Kn(e,t,l,a,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:r,targetContainers:[s]},t!==null&&(t=ga(t),t!==null&&Gf(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Qp(e,t,l,a,s){switch(t){case"focusin":return Yl=Kn(Yl,e,t,l,a,s),!0;case"dragenter":return Vl=Kn(Vl,e,t,l,a,s),!0;case"mouseover":return Ql=Kn(Ql,e,t,l,a,s),!0;case"pointerover":var r=s.pointerId;return Xn.set(r,Kn(Xn.get(r)||null,e,t,l,a,s)),!0;case"gotpointercapture":return r=s.pointerId,Zn.set(r,Kn(Zn.get(r)||null,e,t,l,a,s)),!0}return!1}function Xf(e){var t=ya(e.target);if(t!==null){var l=h(t);if(l!==null){if(t=l.tag,t===13){if(t=x(l),t!==null){e.blockedOn=t,ao(e.priority,function(){Yf(l)});return}}else if(t===31){if(t=b(l),t!==null){e.blockedOn=t,ao(e.priority,function(){Yf(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 or(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Cc(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);kr=a,l.target.dispatchEvent(a),kr=null}else return t=ga(l),t!==null&&Gf(t),e.blockedOn=l,!1;t.shift()}return!0}function Zf(e,t,l){or(e)&&l.delete(t)}function Xp(){Ac=!1,Yl!==null&&or(Yl)&&(Yl=null),Vl!==null&&or(Vl)&&(Vl=null),Ql!==null&&or(Ql)&&(Ql=null),Xn.forEach(Zf),Zn.forEach(Zf)}function ur(e,t){e.blockedOn===t&&(e.blockedOn=null,Ac||(Ac=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Xp)))}var dr=null;function Kf(e){dr!==e&&(dr=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){dr===e&&(dr=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],s=e[t+2];if(typeof a!="function"){if(kc(a||l)===null)continue;break}var r=ga(l);r!==null&&(e.splice(t,3),t-=3,Ci(r,{pending:!0,data:s,method:l.method,action:a},a,s))}}))}function en(e){function t(j){return ur(j,e)}Yl!==null&&ur(Yl,e),Vl!==null&&ur(Vl,e),Ql!==null&&ur(Ql,e),Xn.forEach(t),Zn.forEach(t);for(var l=0;l<Xl.length;l++){var a=Xl[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Xl.length&&(l=Xl[0],l.blockedOn===null);)Xf(l),l.blockedOn===null&&Xl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var s=l[a],r=l[a+1],c=s[pt]||null;if(typeof r=="function")c||Kf(l);else if(c){var f=null;if(r&&r.hasAttribute("formAction")){if(s=r,c=r[pt]||null)f=c.formAction;else if(kc(s)!==null)continue}else f=c.action;typeof f=="function"?l[a+1]=f:(l.splice(a,3),a-=3),Kf(l)}}}function Jf(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(c){return s=c})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function _c(e){this._internalRoot=e}fr.prototype.render=_c.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,a=wt();Hf(l,a,e,t,null,null)},fr.prototype.unmount=_c.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hf(e.current,2,null,e,null,null),Zs(),t[va]=null}};function fr(e){this._internalRoot=e}fr.prototype.unstable_scheduleHydration=function(e){if(e){var t=lo();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Xl.length&&t!==0&&t<Xl[l].priority;l++);Xl.splice(l,0,e),l===0&&Xf(e)}};var $f=o.version;if($f!=="19.2.4")throw Error(u(527,$f,"19.2.4"));k.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=m(t),e=e!==null?T(e):null,e=e===null?null:e.stateNode,e};var Zp={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mr.isDisabled&&mr.supportsFiber)try{$l=mr.inject(Zp),Nt=mr}catch{}}return $n.createRoot=function(e,t){if(!p(e))throw Error(u(299));var l=!1,a="",s=td,r=ld,c=ad;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Bf(e,1,!1,null,null,l,a,null,s,r,c,Jf),e[va]=t.current,uc(e),new _c(t)},$n.hydrateRoot=function(e,t,l){if(!p(e))throw Error(u(299));var a=!1,s="",r=td,c=ld,f=ad,j=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(r=l.onUncaughtError),l.onCaughtError!==void 0&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(f=l.onRecoverableError),l.formState!==void 0&&(j=l.formState)),t=Bf(e,1,!0,t,l??null,a,s,j,r,c,f,Jf),t.context=Uf(null),l=t.current,a=wt(),a=gr(a),s=Rl(a),s.callback=null,wl(l,s,a),l=a,t.current.lanes=l,an(t,l),It(t),e[va]=t.current,uc(e),new fr(t)},$n.version="19.2.4",$n}var sm;function lh(){if(sm)return Mc.exports;sm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(o){console.error(o)}}return i(),Mc.exports=th(),Mc.exports}var ah=lh();const Sm="";class Nm extends Error{constructor(o,d){super(o),this.name="ApiError",this.status=d}}async function Xe(i,o){const d=await fetch(`${Sm}${i}`,o);if(!d.ok){const u=await d.json().catch(()=>({error:d.statusText}));throw new Nm(u.error||`HTTP ${d.status}`,d.status)}return d.json()}const Re={getConfig(){return Xe("/api/config")},setConfig(i,o){return Xe("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,model:o})})},getSkills(){return Xe("/api/skills")},getSkillDetail(i,o){return Xe(`/api/skills/${i}/${o}`)},getEvals(i,o){return Xe(`/api/skills/${i}/${o}/evals`)},saveEvals(i,o,d){return Xe(`/api/skills/${i}/${o}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})},generateEvals(i,o){return Xe(`/api/skills/${i}/${o}/generate-evals`,{method:"POST"})},async getLatestBenchmark(i,o){const d=await fetch(`${Sm}/api/skills/${i}/${o}/benchmark/latest`);if(d.status===404)return null;if(!d.ok){const u=await d.json().catch(()=>({error:d.statusText}));throw new Nm(u.error||`HTTP ${d.status}`,d.status)}return d.json()},getHistory(i,o,d){const u=new URLSearchParams;d!=null&&d.model&&u.set("model",d.model),d!=null&&d.type&&u.set("type",d.type),d!=null&&d.from&&u.set("from",d.from),d!=null&&d.to&&u.set("to",d.to);const p=u.toString();return Xe(`/api/skills/${i}/${o}/history${p?"?"+p:""}`)},getHistoryEntry(i,o,d){return Xe(`/api/skills/${i}/${o}/history/${encodeURIComponent(d)}`)},compareRuns(i,o,d,u){return Xe(`/api/skills/${i}/${o}/history-compare?a=${encodeURIComponent(d)}&b=${encodeURIComponent(u)}`)},getCaseHistory(i,o,d,u){const p=new URLSearchParams;u&&p.set("model",u);const h=p.toString();return Xe(`/api/skills/${i}/${o}/history/case/${d}${h?"?"+h:""}`)},deleteHistoryEntry(i,o,d){return Xe(`/api/skills/${i}/${o}/history/${encodeURIComponent(d)}`,{method:"DELETE"})},improveSkill(i,o,d){return Xe(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})},instructEdit(i,o,d){return Xe(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...d})})},applyImprovement(i,o,d){return Xe(`/api/skills/${i}/${o}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:d})})},getStats(i,o){return Xe(`/api/skills/${i}/${o}/stats`)},getDependencies(i,o){return Xe(`/api/skills/${i}/${o}/dependencies`)},getProjectLayout(){return Xe("/api/project-layout")},createSkill(i){return Xe("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillCreatorStatus(){return Xe("/api/skill-creator-status")},generateSkill(i){return Xe("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}};function nh(i){const[o,d]=v.useState(()=>typeof window>"u"?!1:window.matchMedia(i).matches);return v.useEffect(()=>{const u=window.matchMedia(i);d(u.matches);const p=h=>d(h.matches);return u.addEventListener("change",p),()=>u.removeEventListener("change",p)},[i]),o}const sh={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function rh(i,o){switch(o.type){case"SELECT_SKILL":return{...i,selectedSkill:o.skill,mode:"browse",mobileView:i.isMobile?"detail":i.mobileView};case"CLEAR_SELECTION":return{...i,selectedSkill:null};case"SET_MODE":return{...i,mode:o.mode,selectedSkill:o.mode==="create"?null:i.selectedSkill};case"SET_SEARCH":return{...i,searchQuery:o.query};case"SET_SKILLS":return{...i,skills:o.skills,skillsLoading:!1,skillsError:null};case"SET_SKILLS_ERROR":return{...i,skillsError:o.error,skillsLoading:!1};case"SET_SKILLS_LOADING":return{...i,skillsLoading:o.loading};case"SET_MOBILE":return{...i,isMobile:o.isMobile};case"SET_MOBILE_VIEW":return{...i,mobileView:o.view};default:return i}}const Em=v.createContext(null);function xa(){const i=v.useContext(Em);if(!i)throw new Error("useStudio must be used within StudioProvider");return i}function ih({children:i}){const[o,d]=v.useReducer(rh,sh),u=nh("(max-width: 767px)");v.useEffect(()=>{d({type:"SET_MOBILE",isMobile:u})},[u]);const p=v.useCallback(()=>{d({type:"SET_SKILLS_LOADING",loading:!0}),Re.getSkills().then(g=>d({type:"SET_SKILLS",skills:g})).catch(g=>d({type:"SET_SKILLS_ERROR",error:g.message}))},[]);v.useEffect(()=>{p()},[p]);const h=v.useCallback(g=>{d({type:"SELECT_SKILL",skill:g})},[]),x=v.useCallback(()=>{d({type:"CLEAR_SELECTION"})},[]),b=v.useCallback(g=>{d({type:"SET_MODE",mode:g})},[]),y=v.useCallback(g=>{d({type:"SET_SEARCH",query:g})},[]),m=v.useCallback(g=>{d({type:"SET_MOBILE_VIEW",view:g})},[]),T=v.useMemo(()=>({state:o,selectSkill:h,clearSelection:x,setMode:b,setSearch:y,setMobileView:m,refreshSkills:p}),[o,h,x,b,y,m,p]);return n.jsx(Em.Provider,{value:T,children:i})}const ch={config:null,loading:!0};function oh(i,o){switch(o.type){case"SET_CONFIG":return{config:o.config,loading:!1};case"SET_LOADING":return{...i,loading:!0};default:return i}}const Tm=v.createContext(null);function tn(){const i=v.useContext(Tm);if(!i)throw new Error("useConfig must be used within ConfigProvider");return i}function uh({children:i}){const[o,d]=v.useReducer(oh,ch),u=v.useCallback(()=>{Re.getConfig().then(x=>d({type:"SET_CONFIG",config:x})).catch(()=>{})},[]);v.useEffect(()=>{u()},[u]);const p=v.useCallback(async(x,b)=>{const y=await Re.setConfig(x,b);return d({type:"SET_CONFIG",config:y}),y},[]),h=v.useMemo(()=>({config:o.config,loading:o.loading,updateConfig:p,refreshConfig:u}),[o,p,u]);return n.jsx(Tm.Provider,{value:h,children:i})}function dh({left:i,right:o}){const{state:d}=xa();return d.isMobile?n.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:d.mobileView==="list"?n.jsx("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-1)"},children:i}):n.jsx("div",{style:{height:"100%",overflowY:"auto"},children:o})}):n.jsxs("div",{className:"studio-grid",style:{display:"grid",gridTemplateColumns:"280px 1px 1fr",height:"100vh",overflow:"hidden"},children:[n.jsx("div",{style:{overflowY:"auto",background:"var(--surface-1)"},children:i}),n.jsx("div",{style:{background:"var(--border-subtle)"}}),n.jsx("div",{style:{overflowY:"auto",background:"var(--surface-0)"},children:o})]})}function fh(){const{state:i,setSearch:o}=xa(),[d,u]=v.useState(i.searchQuery),p=v.useRef(null);v.useEffect(()=>(p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{o(d)},200),()=>{p.current&&clearTimeout(p.current)}),[d,o]),v.useEffect(()=>{i.searchQuery===""&&d!==""&&u("")},[i.searchQuery]);const h=new Set(i.skills.map(x=>x.plugin)).size;return n.jsxs("div",{className:"px-3 py-2",children:[n.jsxs("div",{className:"relative",children:[n.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:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),n.jsx("input",{type:"text",value:d,onChange:x=>u(x.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:x=>{x.currentTarget.style.borderColor="var(--accent)"},onBlur:x=>{x.currentTarget.style.borderColor="var(--border-subtle)"}}),d&&n.jsx("button",{onClick:()=>{u(""),o("")},style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:2},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!i.skillsLoading&&n.jsxs("div",{className:"text-[11px] mt-1.5 px-1",style:{color:"var(--text-tertiary)"},children:[i.skills.length," skill",i.skills.length!==1?"s":""," across ",h," plugin",h!==1?"s":""]})]})}const rm={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 im({skill:i,isSelected:o,onSelect:d}){const u=rm[i.benchmarkStatus]||rm.missing,p=i.origin==="installed";return n.jsxs("button",{onClick:d,className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:o?"var(--surface-2)":"transparent",cursor:"pointer",borderTop:"none",borderRight:"none",borderBottom:"1px solid var(--border-subtle)",borderLeft:o?"2px solid var(--accent)":"2px solid transparent",display:"block",opacity:p?.7:1},onMouseEnter:h=>{o||(h.currentTarget.style.background="var(--surface-2)")},onMouseLeave:h=>{o||(h.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsxs("span",{className:"flex items-center gap-1.5 text-[13px] font-medium truncate",style:{color:"var(--text-primary)"},children:[p&&n.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:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),i.skill]}),n.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:[n.jsx("span",{className:"rounded-full",style:{width:5,height:5,background:u.dot}}),u.label]})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsxs("span",{children:[i.evalCount," eval",i.evalCount!==1?"s":""]}),n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsxs("span",{children:[i.assertionCount," assert",i.assertionCount!==1?"s":""]}),i.lastBenchmark&&n.jsxs(n.Fragment,{children:[n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsx("span",{children:new Date(i.lastBenchmark).toLocaleDateString()})]})]})]})}function cm(i){var d;const o={};for(const u of i)(o[d=u.plugin]||(o[d]=[])).push(u);return o}function mh(){const{state:i,selectSkill:o}=xa(),{skills:d,searchQuery:u,selectedSkill:p}=i,[h,x]=v.useState(!1),[b,y]=v.useState(()=>{try{return sessionStorage.getItem("vskill-origin-banner-dismissed")==="1"}catch{return!1}}),{sourceGroups:m,installedGroups:T}=v.useMemo(()=>{const g=u.toLowerCase(),A=g?d.filter(V=>V.skill.toLowerCase().includes(g)||V.plugin.toLowerCase().includes(g)):d,z=A.filter(V=>V.origin==="source"),B=A.filter(V=>V.origin==="installed");return{sourceGroups:Object.entries(cm(z)),installedGroups:Object.entries(cm(B))}},[d,u]);return i.skillsLoading?n.jsx("div",{className:"px-3 py-4 space-y-3",children:[1,2,3].map(g=>n.jsx("div",{className:"skeleton h-14 w-full rounded-lg"},g))}):m.length===0&&T.length===0?n.jsx("div",{className:"px-4 py-8 text-center",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No skills match your search"})}):n.jsxs("div",{className:"flex-1",children:[m.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(xh,{title:"Your Skills",count:m.reduce((g,[,A])=>g+A.length,0)}),m.map(([g,A])=>n.jsxs("div",{children:[n.jsx(om,{plugin:g,count:A.length}),A.map(z=>{const B=(p==null?void 0:p.plugin)===z.plugin&&(p==null?void 0:p.skill)===z.skill;return n.jsx(im,{skill:z,isSelected:B,onSelect:()=>o({plugin:z.plugin,skill:z.skill,origin:z.origin})},`${z.plugin}/${z.skill}`)})]},g))]}),T.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>x(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:h?"1px solid var(--border-subtle)":"none",cursor:"pointer"},children:[n.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:h?"rotate(90deg)":"rotate(0deg)",transition:"transform 150ms ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Installed"}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",T.reduce((g,[,A])=>g+A.length,0),")"]}),n.jsx("div",{className:"flex-1"}),n.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:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),h&&n.jsxs(n.Fragment,{children:[!b&&n.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[n.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."}),n.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:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),T.map(([g,A])=>n.jsxs("div",{children:[n.jsx(om,{plugin:g,count:A.length}),A.map(z=>{const B=(p==null?void 0:p.plugin)===z.plugin&&(p==null?void 0:p.skill)===z.skill;return n.jsx(im,{skill:z,isSelected:B,onSelect:()=>o({plugin:z.plugin,skill:z.skill,origin:z.origin})},`${z.plugin}/${z.skill}`)})]},g))]})]})]})}function xh({title:i,count:o}){return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",o,")"]})]})}function om({plugin:i,count:o}){const[d,u]=v.useState(!1),p=`/images/icons/${i}.webp`;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[d?n.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:n.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"})}):n.jsx("img",{src:p,width:16,height:16,alt:"",onError:()=>u(!0),style:{objectFit:"contain"}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:i}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",o,")"]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border-subtle)"}})]})}function ph(){const{config:i,updateConfig:o,refreshConfig:d}=tn(),[u,p]=v.useState(!1),[h,x]=v.useState(!1),b=v.useRef(null);v.useEffect(()=>{function g(A){b.current&&!b.current.contains(A.target)&&p(!1)}return u&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[u]);async function y(g,A){x(!0);try{await o(g.id,A.id),p(!1)}catch{d()}finally{x(!1)}}if(!i)return null;const m=vh(i),T=hh(i);return n.jsxs("div",{ref:b,className:"relative",children:[n.jsxs("button",{onClick:()=>p(!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:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:T!=null&&T.available?"var(--green)":"var(--text-tertiary)"}}),n.jsx("span",{className:"flex-1 text-left font-medium truncate",style:{color:"var(--text-primary)"},children:m}),n.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:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),u&&n.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:[n.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Select Model"})}),n.jsx("div",{className:"py-1 max-h-72 overflow-y-auto",children:i.providers.map(g=>n.jsxs("div",{children:[n.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[n.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}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",opacity:g.available?1:.5},children:g.label})]}),g.models.map(A=>{const z=Cm(i,g.id,A.id),B=!g.available||h;return n.jsxs("button",{onClick:()=>!B&&y(g,A),disabled:B,className:"w-full px-3 py-1.5 flex items-center gap-2.5 text-left transition-all duration-100",style:{background:z?"var(--accent-muted)":"transparent",color:B?"var(--text-tertiary)":"var(--text-primary)",opacity:B?.4:1,cursor:B?"not-allowed":"pointer"},onMouseEnter:V=>{!B&&!z&&(V.currentTarget.style.background="var(--surface-3)")},onMouseLeave:V=>{z||(V.currentTarget.style.background="transparent")},children:[n.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0 flex items-center justify-center",style:{border:`2px solid ${z?"var(--accent)":"var(--border-subtle)"}`},children:z&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}})}),n.jsx("span",{className:"text-[12px]",style:{fontWeight:z?600:400},title:A.id,children:A.label})]},`${g.id}-${A.id}`)})]},g.id))})]})]})}function Cm(i,o,d){return i.provider!==o?!1:o==="claude-cli"?i.model===`claude-${d}`:i.model===d}function hh(i){return i.providers.find(o=>o.id===i.provider)}function vh(i){for(const o of i.providers)for(const d of o.models)if(Cm(i,o.id,d.id))return d.label;return i.model}function yh(){const{state:i,setMode:o}=xa(),{config:d}=tn(),[u,p]=v.useState(null),[h,x]=v.useState(!1);return v.useEffect(()=>{Re.getSkillCreatorStatus().then(p).catch(()=>{})},[]),n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"var(--accent-muted)"},children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-[14px] font-semibold truncate",style:{color:"var(--text-primary)",letterSpacing:"-0.01em"},children:"Skill Studio"}),n.jsx("div",{className:"text-[11px] truncate",style:{color:"var(--text-tertiary)"},children:(d==null?void 0:d.projectName)||"vskill"})]})]}),n.jsx("div",{className:"mt-3",children:n.jsx(ph,{})})]}),n.jsx(fh,{}),n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("button",{onClick:()=>o("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:i.mode==="create"?"var(--accent)":"var(--surface-3)",color:i.mode==="create"?"#fff":"var(--text-secondary)",border:"none",cursor:"pointer"},onMouseEnter:b=>{i.mode!=="create"&&(b.currentTarget.style.background="var(--surface-4)",b.currentTarget.style.color="var(--text-primary)")},onMouseLeave:b=>{i.mode!=="create"&&(b.currentTarget.style.background="var(--surface-3)",b.currentTarget.style.color="var(--text-secondary)")},children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"New Skill"]})}),u&&n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:u.installed?n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--green)"}}),"Skill Creator installed"]}):n.jsxs("div",{className:"px-3 py-2 rounded-lg text-[11px]",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",style:{color:"var(--yellow)"},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--yellow)"}}),n.jsx("span",{className:"font-medium",children:"Skill Creator not installed"})]}),n.jsx("button",{onClick:()=>{navigator.clipboard.writeText(u.installCommand).then(()=>{x(!0),setTimeout(()=>x(!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:b=>{b.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:b=>{b.currentTarget.style.borderColor="var(--border-subtle)"},children:h?"Copied!":u.installCommand})]})}),n.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(mh,{})})]})}const gh="modulepreload",bh=function(i){return"/"+i},um={},jh=function(o,d,u){let p=Promise.resolve();if(d&&d.length>0){let x=function(m){return Promise.all(m.map(T=>Promise.resolve(T).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"));p=x(d.map(m=>{if(m=bh(m),m in um)return;um[m]=!0;const T=m.endsWith(".css"),g=T?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const A=document.createElement("link");if(A.rel=T?"stylesheet":gh,T||(A.as="script"),A.crossOrigin="",A.href=m,y&&A.setAttribute("nonce",y),document.head.appendChild(A),T)return new Promise((z,B)=>{A.addEventListener("load",z),A.addEventListener("error",()=>B(new Error(`Unable to preload CSS for ${m}`)))})}))}function h(x){const b=new Event("vite:preloadError",{cancelable:!0});if(b.payload=x,window.dispatchEvent(b),!b.defaultPrevented)throw x}return p.then(x=>{for(const b of x||[])b.status==="rejected"&&h(b.reason);return o().catch(h)})};function Lc(){const[i,o]=v.useState([]),[d,u]=v.useState(!1),[p,h]=v.useState(!1),[x,b]=v.useState(null),y=v.useRef(null),m=v.useCallback(async(g,A)=>{o([]),u(!0),h(!1),b(null);const z=new AbortController;y.current=z;try{const B=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json"},body:A?JSON.stringify(A):void 0,signal:z.signal});if(!B.ok||!B.body){let ie=`HTTP ${B.status}`;try{const q=await B.json();q.error&&(ie=q.error)}catch{}throw new Error(ie)}const V=B.body.getReader(),K=new TextDecoder;let te="",P="";for(;;){const{done:ie,value:q}=await V.read();if(ie)break;te+=K.decode(q,{stream:!0});const W=te.split(`
50
+ `);te=W.pop()||"";for(const ae of W)if(ae.startsWith("event: "))P=ae.slice(7).trim();else if(ae.startsWith("data: ")){try{const F=JSON.parse(ae.slice(6)),ne={event:P,data:F};P==="done"?(h(!0),o(I=>[...I,ne])):o(I=>[...I,ne])}catch{}P=""}}}catch(B){B.name!=="AbortError"&&b(B.message)}finally{u(!1),y.current=null}},[]),T=v.useCallback(()=>{var g;(g=y.current)==null||g.abort()},[]);return{events:i,running:d,done:p,error:x,start:m,stop:T}}function Sh(i){const o=v.useRef(i);o.current=i;const[d,u]=v.useState(new Set),p=v.useRef(new Map),h=v.useCallback(async(m,T,g)=>{var z;(z=p.current.get(m))==null||z.abort();const A=new AbortController;p.current.set(m,A),u(B=>{const V=new Set(B);return V.add(m),V});try{const B=await fetch(T,{method:"POST",headers:{"Content-Type":"application/json"},body:g?JSON.stringify(g):void 0,signal:A.signal});if(!B.ok||!B.body){let ie=`HTTP ${B.status}`;try{const q=await B.json();q.error&&(ie=q.error)}catch{}throw new Error(ie)}const V=B.body.getReader(),K=new TextDecoder;let te="",P="";for(;;){const{done:ie,value:q}=await V.read();if(ie)break;te+=K.decode(q,{stream:!0});const W=te.split(`
51
+ `);te=W.pop()||"";for(const ae of W)if(ae.startsWith("event: "))P=ae.slice(7).trim();else if(ae.startsWith("data: ")){try{const F=JSON.parse(ae.slice(6)),ne={event:P,data:F};o.current.onEvent(m,ne)}catch{}P=""}}o.current.onDone(m)}catch(B){B.name!=="AbortError"&&o.current.onError(m,B.message)}finally{u(B=>{const V=new Set(B);return V.delete(m),V}),p.current.delete(m)}},[]),x=v.useCallback(m=>{var T;(T=p.current.get(m))==null||T.abort()},[]),b=v.useCallback(()=>{for(const m of p.current.values())m.abort()},[]),y=d.size>0;return{runningSet:d,startCase:h,stopCase:x,stopAll:b,isAnyCaseRunning:y}}const Nh={plugin:"",skill:"",skillContent:"",savedContent:"",isDirty:!1,evals: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,loading:!0,error:null};function Eh(i,o){var d,u;switch(o.type){case"SET_LOADING":return{...i,loading:o.loading};case"SET_ERROR":return{...i,error:o.error};case"INIT_DATA":{const p=new Map;if(o.benchmark)for(const x of o.benchmark.cases)p.set(x.eval_id,{status:x.status,passRate:x.pass_rate,errorMessage:x.error_message||void 0,durationMs:x.durationMs,tokens:x.tokens,output:x.output,assertions:x.assertions.map(b=>({assertion_id:b.id,text:b.text,pass:b.pass,reasoning:b.reasoning}))});const h=((u=(d=o.evals)==null?void 0:d.evals[0])==null?void 0:u.id)??null;return{...i,skillContent:o.skillContent,savedContent:o.skillContent,isDirty:!1,evals:o.evals,latestBenchmark:o.benchmark,inlineResults:p,selectedCaseId:h,loading:!1,error:null}}case"SET_PANEL":return{...i,activePanel:o.panel};case"SET_CONTENT":return{...i,skillContent:o.content,isDirty:o.content!==i.savedContent};case"CONTENT_SAVED":return{...i,savedContent:i.skillContent,isDirty:!1};case"SET_EVALS":return{...i,evals:o.evals};case"SELECT_CASE":return{...i,selectedCaseId:o.caseId};case"CASE_RUN_START":{const p=new Map(i.caseRunStates);return p.set(o.caseId,{status:"running",startedAt:Date.now(),mode:o.mode}),{...i,caseRunStates:p,runMode:o.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const p=new Map(i.caseRunStates),h=p.get(o.caseId);p.set(o.caseId,{status:"complete",mode:h==null?void 0:h.mode});const x=new Map(i.inlineResults);return x.set(o.caseId,o.result),{...i,caseRunStates:p,inlineResults:x}}case"CASE_RUN_ERROR":{const p=new Map(i.caseRunStates),h=p.get(o.caseId);p.set(o.caseId,{status:"error",mode:h==null?void 0:h.mode});const x=new Map(i.inlineResults);return x.set(o.caseId,{status:"error",errorMessage:o.error,assertions:[]}),{...i,caseRunStates:p,inlineResults:x}}case"CASE_RUN_CANCEL":{const p=new Map(i.caseRunStates),h=p.get(o.caseId);return p.set(o.caseId,{status:"cancelled",mode:h==null?void 0:h.mode}),{...i,caseRunStates:p}}case"BULK_RUN_START":{const p=new Map(i.caseRunStates);for(const h of o.caseIds)p.set(h,{status:"queued",mode:o.mode});return{...i,caseRunStates:p,bulkRunActive:!0,runMode:o.mode,activePanel:"run"}}case"BULK_RUN_COMPLETE":return{...i,bulkRunActive:!1,latestBenchmark:o.benchmark??i.latestBenchmark,iterationCount:i.iterationCount+1};case"CANCEL_ALL":{const p=new Map(i.caseRunStates);for(const[h,x]of p)(x.status==="running"||x.status==="queued")&&p.set(h,{status:"cancelled"});return{...i,caseRunStates:p,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const p=new Map(i.inlineResults);return p.set(o.evalId,o.result),{...i,inlineResults:p}}case"OPEN_IMPROVE":return{...i,improveTarget:o.evalId,activePanel:"editor"};case"CLOSE_IMPROVE":return{...i,improveTarget:null};case"OPEN_AI_EDIT":return{...i,aiEditOpen:!0,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"CLOSE_AI_EDIT":return{...i,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"AI_EDIT_LOADING":return{...i,aiEditLoading:!0,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[]};case"AI_EDIT_PROGRESS":return{...i,aiEditProgress:[...i.aiEditProgress,o.entry]};case"AI_EDIT_RESULT":{const p=o.evalChanges??[],h=new Map;for(let x=0;x<p.length;x++)h.set(x,!0);return{...i,aiEditLoading:!1,aiEditResult:{improved:o.improved,reasoning:o.reasoning,evalChanges:p},aiEditEvalChanges:p,aiEditEvalSelections:h}}case"AI_EDIT_ERROR":return{...i,aiEditLoading:!1,aiEditError:o.message,aiEditClassifiedError:o.classified??null};case"GENERATE_EVALS_START":return{...i,generateEvalsLoading:!0,generateEvalsProgress:[],generateEvalsError:null};case"GENERATE_EVALS_PROGRESS":return{...i,generateEvalsProgress:[...i.generateEvalsProgress,o.entry]};case"GENERATE_EVALS_DONE":return{...i,generateEvalsLoading:!1,evals:o.evals};case"GENERATE_EVALS_ERROR":return{...i,generateEvalsLoading:!1,generateEvalsError:o.classified};case"TOGGLE_EVAL_CHANGE":{const p=new Map(i.aiEditEvalSelections);return p.set(o.index,!p.get(o.index)),{...i,aiEditEvalSelections:p}}case"SELECT_ALL_EVAL_CHANGES":{const p=new Map(i.aiEditEvalSelections);for(const h of p.keys())p.set(h,!0);return{...i,aiEditEvalSelections:p}}case"DESELECT_ALL_EVAL_CHANGES":{const p=new Map(i.aiEditEvalSelections);for(const h of p.keys())p.set(h,!1);return{...i,aiEditEvalSelections:p}}case"SET_EVALS_RETRY":return{...i,aiEditEvalsRetry:o.evalsFile};case"SET_REGRESSIONS":return{...i,regressions:o.regressions};case"INCREMENT_ITERATION":return{...i,iterationCount:i.iterationCount+1};case"SET_ACTIVATION_PROMPTS":return{...i,activationPrompts:o.prompts};case"ACTIVATION_START":return{...i,activationRunning:!0,activationResults:[],activationSummary:null,activationError:null};case"ACTIVATION_RESULT":return{...i,activationResults:[...i.activationResults,o.result]};case"ACTIVATION_DONE":return{...i,activationRunning:!1,activationSummary:o.summary};case"ACTIVATION_ERROR":return{...i,activationRunning:!1,activationError:o.error};case"ACTIVATION_RESET":return{...i,activationResults:[],activationSummary:null,activationError:null};default:return i}}const km=v.createContext(null);function Pt(){const i=v.useContext(km);if(!i)throw new Error("useWorkspace must be used within WorkspaceProvider");return i}function Th({plugin:i,skill:o,origin:d,children:u}){const p=d==="installed",[h,x]=v.useReducer(Eh,{...Nh,plugin:i,skill:o}),b=v.useRef(new Set),y=v.useRef(new Set),m=v.useRef(new Map),T=v.useCallback((w,G)=>{const Y=G.data;let $=m.current.get(w);if($||($={assertions:[]},m.current.set(w,$)),G.event==="output_ready"&&($.output=Y.output,Y.durationMs!=null&&($.durationMs=Y.durationMs),Y.tokens!=null&&($.tokens=Y.tokens)),G.event==="assertion_result"){const de={assertion_id:Y.assertion_id,text:Y.text,pass:Y.pass,reasoning:Y.reasoning};$.assertions.find(ge=>ge.assertion_id===de.assertion_id)||$.assertions.push(de)}G.event==="case_complete"&&($.status=Y.status,$.passRate=Y.pass_rate,$.errorMessage=Y.error_message||void 0,$.classifiedError=Y.classified_error||void 0),x({type:"UPDATE_INLINE_RESULT",evalId:w,result:{...$,assertions:[...$.assertions]}})},[]),g=v.useCallback(w=>{if(y.current.has(w))return;y.current.add(w);const G=m.current.get(w)??{assertions:[]};x({type:"CASE_RUN_COMPLETE",caseId:w,result:{...G,assertions:[...G.assertions]}}),b.current.has(w)&&(b.current.delete(w),b.current.size===0&&Re.getLatestBenchmark(i,o).then(Y=>x({type:"BULK_RUN_COMPLETE",benchmark:Y})).catch(()=>x({type:"BULK_RUN_COMPLETE",benchmark:null})))},[i,o]),A=v.useCallback((w,G)=>{y.current.has(w)||(y.current.add(w),x({type:"CASE_RUN_ERROR",caseId:w,error:G}),b.current.has(w)&&(b.current.delete(w),b.current.size===0&&Re.getLatestBenchmark(i,o).then(Y=>x({type:"BULK_RUN_COMPLETE",benchmark:Y})).catch(()=>x({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[i,o]),{startCase:z,stopCase:B,stopAll:V}=Sh({onEvent:T,onDone:g,onError:A});v.useEffect(()=>()=>{V()},[V]),v.useEffect(()=>{let w=!1;async function G(){try{const[Y,$,de]=await Promise.allSettled([Re.getSkillDetail(i,o),Re.getEvals(i,o),Re.getLatestBenchmark(i,o)]);if(w)return;x({type:"INIT_DATA",skillContent:Y.status==="fulfilled"?Y.value.skillContent:"",evals:$.status==="fulfilled"?$.value:null,benchmark:de.status==="fulfilled"?de.value:null})}catch(Y){w||x({type:"SET_ERROR",error:Y.message})}}return G(),()=>{w=!0}},[i,o]);const K=v.useCallback(async()=>{if(!p)try{await Re.applyImprovement(i,o,h.skillContent),x({type:"CONTENT_SAVED"})}catch(w){x({type:"SET_ERROR",error:w.message})}},[p,i,o,h.skillContent]),te=v.useCallback(async w=>{if(!p)try{const G=await Re.saveEvals(i,o,w);x({type:"SET_EVALS",evals:G})}catch(G){x({type:"SET_ERROR",error:G.message})}},[p,i,o]),P=v.useCallback((w,G="benchmark")=>{if(p)return;const Y=h.caseRunStates.get(w);if((Y==null?void 0:Y.status)!=="running")if(m.current.delete(w),y.current.delete(w),x({type:"CASE_RUN_START",caseId:w,mode:G}),G==="comparison"){const $=`/api/skills/${i}/${o}/compare`;z(w,$,{eval_ids:[w]})}else{const $=`/api/skills/${i}/${o}/benchmark/case/${w}`;z(w,$,G==="baseline"?{baseline_only:!0}:void 0)}},[p,i,o,h.caseRunStates,z]),ie=v.useCallback((w="benchmark")=>{var $;if(p)return;const G=(($=h.evals)==null?void 0:$.evals)??[];if(G.length===0)return;const Y=G.map(de=>de.id);for(const de of Y)m.current.delete(de),y.current.delete(de);x({type:"BULK_RUN_START",caseIds:Y,mode:w}),b.current=new Set(Y);for(const de of Y)if(w==="comparison")z(de,`/api/skills/${i}/${o}/compare`,{eval_ids:[de]});else{const ge=`/api/skills/${i}/${o}/benchmark/case/${de}`;z(de,ge,w==="baseline"?{baseline_only:!0}:void 0)}},[p,i,o,h.evals,z]),q=v.useCallback(w=>{B(w),x({type:"CASE_RUN_CANCEL",caseId:w}),b.current.delete(w),y.current.add(w)},[B]),W=v.useCallback(()=>{V(),x({type:"CANCEL_ALL"}),b.current.clear()},[V]),ae=v.useCallback(async(w,G)=>{x({type:"OPEN_IMPROVE",evalId:w})},[]),F=v.useCallback(async(w,G)=>{try{await Re.applyImprovement(i,o,G),x({type:"SET_CONTENT",content:G}),x({type:"CONTENT_SAVED"}),x({type:"CLOSE_IMPROVE"}),P(w,"benchmark")}catch(Y){x({type:"SET_ERROR",error:Y.message})}},[i,o,P]),ne=Lc(),I=v.useRef(null);v.useEffect(()=>{if(ne.events.length)for(const w of ne.events){const G=w.data;if(w.event==="progress"&&x({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:G.phase,message:G.message}}),w.event==="done"){const Y=G.improved,$=G.reasoning,de=G.evalChanges??[];x({type:"AI_EDIT_RESULT",improved:Y,reasoning:$,evalChanges:de})}if(w.event==="error"){const Y=G;x({type:"AI_EDIT_ERROR",message:Y.description||"Unknown error",classified:Y})}}},[ne.events]),v.useEffect(()=>{ne.error&&x({type:"AI_EDIT_ERROR",message:ne.error})},[ne.error]),v.useEffect(()=>()=>{ne.stop()},[ne.stop]);const Te=v.useCallback(async(w,G,Y)=>{p||(x({type:"AI_EDIT_LOADING"}),I.current=ne.stop,ne.start(`/api/skills/${i}/${o}/improve?sse`,{mode:"instruct",instruction:w,content:h.skillContent,evals:h.evals??{skill_name:o,evals:[]},provider:G,model:Y}))},[p,i,o,h.skillContent,h.evals,ne]),ve=v.useCallback(()=>{ne.stop(),x({type:"AI_EDIT_ERROR",message:"Cancelled"})},[ne]),ye=v.useCallback(async()=>{const w=h.aiEditResult;if(w!=null&&w.improved)try{if(await Re.applyImprovement(i,o,w.improved),x({type:"SET_CONTENT",content:w.improved}),x({type:"CONTENT_SAVED"}),h.aiEditEvalChanges.length>0&&Array.from(h.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:Y}=await jh(async()=>{const{mergeEvalChanges:ge}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:ge}},[]),$=h.evals??{skill_name:o,evals:[]},de=Y($,h.aiEditEvalChanges,h.aiEditEvalSelections);try{const ge=await Re.saveEvals(i,o,de);x({type:"SET_EVALS",evals:ge})}catch(ge){x({type:"SET_EVALS_RETRY",evalsFile:de}),x({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${ge.message}. You can retry from the AI Edit panel.`});return}}x({type:"CLOSE_AI_EDIT"})}catch(G){x({type:"SET_ERROR",error:G.message})}},[i,o,h.aiEditResult,h.evals,h.aiEditEvalChanges,h.aiEditEvalSelections]),Q=v.useCallback(()=>{x({type:"CLOSE_AI_EDIT"})},[]),ue=v.useCallback(w=>{x({type:"TOGGLE_EVAL_CHANGE",index:w})},[]),pe=v.useCallback(()=>{x({type:"SELECT_ALL_EVAL_CHANGES"})},[]),N=v.useCallback(()=>{x({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),k=v.useCallback(async()=>{const w=h.aiEditEvalsRetry;if(w)try{const G=await Re.saveEvals(i,o,w);x({type:"SET_EVALS",evals:G}),x({type:"SET_ERROR",error:null}),x({type:"CLOSE_AI_EDIT"})}catch(G){x({type:"SET_ERROR",error:`Retry failed: ${G.message}`})}},[i,o,h.aiEditEvalsRetry]),J=v.useCallback(async()=>{try{const w=await Re.getSkillDetail(i,o);x({type:"SET_CONTENT",content:w.skillContent}),x({type:"CONTENT_SAVED"})}catch{}},[i,o]),re=Lc();v.useEffect(()=>{if(re.events.length)for(const w of re.events){const G=w.data;if(w.event==="progress"&&x({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:G.phase,message:G.message}}),w.event==="done"){const Y=G;Re.saveEvals(i,o,Y).then($=>x({type:"GENERATE_EVALS_DONE",evals:$})).catch($=>x({type:"SET_ERROR",error:$.message}))}w.event==="error"&&x({type:"GENERATE_EVALS_ERROR",classified:G})}},[re.events,i,o]),v.useEffect(()=>{re.error&&x({type:"SET_ERROR",error:re.error})},[re.error]),v.useEffect(()=>()=>{re.stop()},[re.stop]);const me=v.useCallback(async()=>{p||(x({type:"GENERATE_EVALS_START"}),re.start(`/api/skills/${i}/${o}/generate-evals?sse`))},[p,i,o,re]),S=Lc();v.useEffect(()=>()=>{S.stop()},[S.stop]),v.useEffect(()=>{if(S.events.length)for(const w of S.events)w.event==="prompt_result"&&x({type:"ACTIVATION_RESULT",result:w.data}),w.event==="done"&&x({type:"ACTIVATION_DONE",summary:w.data})},[S.events]),v.useEffect(()=>{S.error&&x({type:"ACTIVATION_ERROR",error:S.error})},[S.error]);const D=v.useCallback(w=>{const Y=w.trim().split(`
52
+ `).filter(Boolean).map($=>$.startsWith("!")?{prompt:$.slice(1).trim(),expected:"should_not_activate"}:$.startsWith("+")?{prompt:$.slice(1).trim(),expected:"should_activate"}:{prompt:$.trim(),expected:"auto"});x({type:"ACTIVATION_START"}),S.start(`/api/skills/${i}/${o}/activation-test`,{prompts:Y})},[i,o,S]),Z=v.useMemo(()=>({state:h,dispatch:x,isReadOnly:p,saveContent:K,saveEvals:te,runCase:P,runAll:ie,cancelCase:q,cancelAll:W,improveForCase:ae,applyImproveAndRerun:F,refreshSkillContent:J,generateEvals:me,runActivationTest:D,submitAiEdit:Te,cancelAiEdit:ve,applyAiEdit:ye,discardAiEdit:Q,toggleEvalChange:ue,selectAllEvalChanges:pe,deselectAllEvalChanges:N,retryEvalsSave:k}),[h,p,K,te,P,ie,q,W,ae,F,J,me,D,Te,ve,ye,Q,ue,pe,N,k]);return n.jsx(km.Provider,{value:Z,children:u})}function Ch({state:i,isReadOnly:o}){const{plugin:d,skill:u,evals:p,latestBenchmark:h,isDirty:x,caseRunStates:b,regressions:y,iterationCount:m}=i,T=Array.from(b.values()).some(K=>K.status==="running"||K.status==="queued"),g=h==null?void 0:h.overall_pass_rate,A=(p==null?void 0:p.evals.reduce((K,te)=>K+te.assertions.length,0))??0,z=(p==null?void 0:p.evals.length)??0,B=g!=null?g>=80?"var(--green)":g>=50?"var(--yellow)":"var(--red)":"var(--text-tertiary)",V=g!=null?g>=80?"var(--green-muted)":g>=50?"var(--yellow-muted)":"var(--red-muted)":"var(--surface-3)";return n.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:[n.jsxs("div",{className:"flex items-center gap-2 text-[13px]",children:[n.jsx("span",{style:{color:"var(--text-tertiary)"},children:d}),n.jsx(kh,{}),n.jsx("span",{className:"font-medium",style:{color:"var(--text-primary)"},children:u}),o&&n.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:[n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"installed"]}),x&&n.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"}),T&&n.jsxs("span",{className:"ml-2 flex items-center gap-1.5 text-[11px]",style:{color:"var(--accent)"},children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}}),"Running..."]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[y.length>0&&n.jsxs("span",{className:"pill",style:{background:"var(--red-muted)",color:"var(--red)"},children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.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"}),n.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),n.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),y.length," regression",y.length>1?"s":""]}),m>0&&n.jsxs("span",{className:"pill",style:{background:"var(--purple-muted)",color:"var(--purple)"},children:["Iter ",m]}),n.jsx("span",{className:"pill",style:{background:V,color:B},children:g!=null?`${Math.round(g*100)}%`:"--"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[z," case",z!==1?"s":""," / ",A," assert",A!==1?"s":""]})]})]})}function kh(){return n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}const Ah=[{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:"deps",label:"Deps",shortcut:"6"}]}];function _h({id:i}){const o={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"};switch(i){case"editor":return n.jsxs("svg",{...o,children:[n.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),n.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 n.jsxs("svg",{...o,children:[n.jsx("path",{d:"M9 11l3 3L22 4"}),n.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 n.jsx("svg",{...o,children:n.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})});case"activation":return n.jsxs("svg",{...o,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("circle",{cx:"12",cy:"12",r:"6"}),n.jsx("circle",{cx:"12",cy:"12",r:"2"})]});case"history":return n.jsxs("svg",{...o,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"12 6 12 12 16 14"})]});case"deps":return n.jsxs("svg",{...o,children:[n.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"}),n.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 Rh({activePanel:i,onPanelChange:o,isDirty:d,isRunning:u,hasRegressions:p,isActivationRunning:h}){return n.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:Ah.map((x,b)=>n.jsxs("div",{className:"flex items-center",children:[b>0&&n.jsx("div",{style:{width:1,height:20,background:"var(--border-subtle)",margin:"0 6px",flexShrink:0}}),x.tabs.map(y=>{const m=i===y.id,T=y.id==="editor"&&d||y.id==="run"&&u||y.id==="activation"&&h||y.id==="history"&&p,g=y.id==="run"||y.id==="activation"?"var(--accent)":y.id==="history"?"var(--red)":"var(--yellow)";return n.jsxs("button",{onClick:()=>o(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:m?"var(--text-primary)":"var(--text-tertiary)",borderBottom:m?"2px solid var(--accent)":"2px solid transparent",cursor:"pointer",border:"none",borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:m?"var(--accent)":"transparent",whiteSpace:"nowrap"},onMouseEnter:A=>{m||(A.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:A=>{m||(A.currentTarget.style.color="var(--text-tertiary)")},children:[n.jsx(_h,{id:y.id}),y.label,T&&n.jsx("span",{className:"absolute top-1.5 right-1 rounded-full",style:{width:5,height:5,background:g}})]},y.id)})]},x.label))})}function wh(i){const o=i.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!o)return{metadata:{},body:i};const d=o[1],u=o[2].trim(),p={},h=d.split(`
53
+ `);let x="",b=!1;for(const y of h){const m=y.match(/^[ \t]+([\w-]+):\s*(.*)$/);if(m&&x&&b){const A=m[1],z=m[2].trim();let B=p[x];if((typeof B!="object"||Array.isArray(B))&&(B={},p[x]=B),!z)B[A]=[];else{const V=z.match(/^\[(.+)\]$/);V?B[A]=V[1].split(",").map(K=>K.trim().replace(/^["']|["']$/g,"")).filter(Boolean):B[A]=z.replace(/^["']|["']$/g,"")}continue}const T=y.match(/^\s+-\s+(.+)$/);if(T&&x){b=!1;const A=p[x];Array.isArray(A)?A.push(T[1].trim().replace(/^["']|["']$/g,"")):p[x]=[T[1].trim().replace(/^["']|["']$/g,"")];continue}const g=y.match(/^([\w-]+):\s*(.*)$/);if(g){x=g[1];const A=g[2].trim();if(b=!1,!A){p[x]={},b=!0;continue}const z=A.match(/^\[(.+)\]$/);if(z){p[x]=z[1].split(",").map(B=>B.trim().replace(/^["']|["']$/g,"")).filter(Boolean);continue}p[x]=A.replace(/^["']|["']$/g,"")}}return{metadata:p,body:u}}function Fc(i){if(!i)return"";let o=Mh(i);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}function Mh(i){const o=i.split(`
54
+ `),d=[];let u=0;for(;u<o.length;)if(o[u].trim().startsWith("|")&&u+1<o.length&&o[u+1].trim().startsWith("|")&&/\|[\s-:]+\|/.test(o[u+1])){const p=dm(o[u]);u+=2;const h=[];for(;u<o.length&&o[u].trim().startsWith("|");)h.push(dm(o[u])),u++;const x='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 m of p)y+=`<th ${x}>${m}</th>`;y+="</tr></thead><tbody>";for(const m of h){y+="<tr>";for(const T of m)y+=`<td ${b}>${T}</td>`;y+="</tr>"}y+="</tbody></table>",d.push(y)}else d.push(o[u]),u++;return d.join(`
55
+ `)}function dm(i){return i.split("|").map(o=>o.trim()).filter(o=>o.length>0)}function hr(i,o){const d=i.split(`
56
+ `),u=o.split(`
57
+ `);if(d.length>1e3||u.length>1e3)return[...d.map(T=>({type:"unchanged",content:T}))];const p=d.length,h=u.length,x=Array.from({length:p+1},()=>new Array(h+1).fill(0));for(let T=1;T<=p;T++)for(let g=1;g<=h;g++)d[T-1]===u[g-1]?x[T][g]=x[T-1][g-1]+1:x[T][g]=Math.max(x[T-1][g],x[T][g-1]);const b=[];let y=p,m=h;for(;y>0||m>0;)y>0&&m>0&&d[y-1]===u[m-1]?(b.push({type:"unchanged",content:d[y-1]}),y--,m--):m>0&&(y===0||x[y][m-1]>=x[y-1][m])?(b.push({type:"added",content:u[m-1]}),m--):(b.push({type:"removed",content:d[y-1]}),y--);return b.reverse()}function zh(i,o){if(o&&new Set(["generating","comparing","judging","judging_assertion","preparing","parsing","generating_skill","generating_baseline","scoring","action_items"]).has(i))return n.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 n.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:u.has(i)?"var(--accent)":"var(--green)"}})}function Fn({entries:i,isRunning:o}){const[d,u]=v.useState(!1),p=v.useRef(null);return v.useEffect(()=>{p.current&&!d&&(p.current.scrollTop=p.current.scrollHeight)},[i,d]),i.length===0&&!o?null:n.jsxs("div",{className:"mt-2 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("button",{onClick:()=>u(!d),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:h=>{h.currentTarget.style.color="var(--text-primary)"},onMouseLeave:h=>{h.currentTarget.style.color="var(--text-tertiary)"},children:[n.jsxs("span",{className:"flex items-center gap-2",children:[o&&n.jsx("div",{className:"spinner",style:{width:10,height:10}}),"Progress Log (",i.length,")"]}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{transform:d?"rotate(0)":"rotate(180deg)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!d&&n.jsx("div",{ref:p,className:"px-3 pb-3 space-y-1 max-h-48 overflow-y-auto",children:i.map((h,x)=>{const b=x===i.length-1&&o,y=x===0?"0s":`+${((h.timestamp-i[0].timestamp)/1e3).toFixed(1)}s`;return n.jsxs("div",{className:"flex items-center gap-2 text-[11px] animate-fade-in",style:{opacity:b?1:.7},children:[zh(h.phase,b),n.jsx("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)",width:40},children:y}),n.jsx("span",{style:{color:b?"var(--text-primary)":"var(--text-secondary)"},children:h.message}),h.current!=null&&h.total!=null&&n.jsxs("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)"},children:["[",h.current,"/",h.total,"]"]})]},x)})})]})}const fm={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 vr({error:i,onRetry:o,onDismiss:d}){const[u,p]=v.useState(null),h=v.useRef(null);v.useEffect(()=>(i.category==="rate_limit"&&i.retryAfterMs?p(Math.ceil(i.retryAfterMs/1e3)):p(null),()=>{h.current&&clearInterval(h.current)}),[i]),v.useEffect(()=>{if(!(u==null||u<=0))return h.current=setInterval(()=>{p(y=>y==null||y<=1?(h.current&&clearInterval(h.current),0):y-1)},1e3),()=>{h.current&&clearInterval(h.current)}},[u!=null&&u>0]);const x=fm[i.category]||fm.unknown,b=u!=null&&u>0;return n.jsxs("div",{className:"rounded-lg overflow-hidden animate-fade-in",style:{border:`1px solid color-mix(in srgb, ${x.color} 30%, transparent)`,background:`color-mix(in srgb, ${x.color} 6%, var(--surface-1))`},children:[n.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{style:{fontSize:14},children:x.icon}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:x.color},children:i.title})]}),d&&n.jsx("button",{onClick:d,className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-3.5 pb-3",children:[n.jsx("p",{className:"text-[11.5px] mb-1.5",style:{color:"var(--text-secondary)"},children:i.description}),n.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:i.hint}),(o||u!=null)&&n.jsx("div",{className:"flex items-center gap-2 mt-2.5",children:o&&n.jsx("button",{onClick:o,disabled:b,className:"btn btn-secondary text-[11px]",style:{padding:"4px 10px",opacity:b?.5:1},children:b?`Retry in ${u}s`:"Retry"})})]})]})}function Oh({plugin:i,skill:o,skillContent:d,onApplied:u}){const[p,h]=v.useState("closed"),{config:x}=tn(),[b,y]=v.useState("claude-cli"),[m,T]=v.useState("opus"),[g,A]=v.useState([]),[z,B]=v.useState(""),[V,K]=v.useState(""),[te,P]=v.useState(null),[ie,q]=v.useState(null),[W,ae]=v.useState([]),[F,ne]=v.useState(!1),I=v.useRef(null);v.useEffect(()=>{if(!x)return;x.providers.find(k=>k.id==="claude-cli"&&k.available)&&(y("claude-cli"),T("opus"))},[x]),v.useEffect(()=>()=>{var N;(N=I.current)==null||N.abort()},[]);function Te(){return x==null?void 0:x.providers.find(N=>N.id===b&&N.available)}const ve=v.useCallback(()=>{var N;(N=I.current)==null||N.abort(),h("open")},[]);async function ye(){h("loading"),P(null),q(null),ae([]);const N=new AbortController;I.current=N;try{const k=await fetch(`/api/skills/${encodeURIComponent(i)}/${encodeURIComponent(o)}/improve?sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,model:m}),signal:N.signal});if(!k.ok||!k.body){let D=`HTTP ${k.status}`;try{const Z=await k.json();Z.error&&(D=Z.error)}catch{}throw new Error(D)}const J=k.body.getReader(),re=new TextDecoder;let me="",S="";for(;;){const{done:D,value:Z}=await J.read();if(D)break;me+=re.decode(Z,{stream:!0});const w=me.split(`
58
+ `);me=w.pop()||"";for(const G of w)if(G.startsWith("event: "))S=G.slice(7).trim();else if(G.startsWith("data: ")){try{const Y=JSON.parse(G.slice(6));S==="progress"?ae($=>[...$,{phase:Y.phase,message:Y.message,timestamp:Date.now()}]):S==="done"||S==="complete"?(B(Y.improved),K(Y.reasoning||""),A(hr(Y.original||d,Y.improved)),h("diff_shown")):S==="error"&&(P(Y.message||Y.description||"Unknown error"),Y.category&&q(Y),h("open"))}catch{}S=""}}}catch(k){k.name!=="AbortError"&&(P(k.message),h("open"))}finally{I.current=null}}async function Q(){ne(!0);try{await Re.applyImprovement(i,o,z),u(z),h("closed")}catch(N){P(N.message)}finally{ne(!1)}}function ue(){h("closed"),A([]),B(""),K(""),P(null)}if(p==="closed")return n.jsxs("button",{onClick:()=>h("open"),className:"btn btn-secondary mb-5",disabled:!d,children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]}),"Improve Skill"]});const pe=Te();return n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden animate-fade-in",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.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:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Skill Improvement"})]}),n.jsx("button",{onClick:ue,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:N=>{N.currentTarget.style.background="var(--surface-3)"},onMouseLeave:N=>{N.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-5 py-4",children:[(p==="open"||p==="loading")&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-3 mb-4",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),n.jsx("select",{className:"input-field text-[12px] py-1.5",value:b,onChange:N=>{y(N.target.value);const k=x==null?void 0:x.providers.find(J=>J.id===N.target.value);k!=null&&k.models[0]&&T(k.models[0].id)},disabled:p==="loading",children:x==null?void 0:x.providers.filter(N=>N.available).map(N=>n.jsx("option",{value:N.id,children:N.label},N.id))})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsx("select",{className:"input-field text-[12px] py-1.5",value:m,onChange:N=>T(N.target.value),disabled:p==="loading",children:pe==null?void 0:pe.models.map(N=>n.jsx("option",{value:N.id,children:N.label},N.id))})]}),p==="loading"?n.jsx("button",{onClick:ve,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):n.jsx("button",{onClick:ye,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),p==="loading"&&W.length>0&&n.jsx("div",{className:"mt-3",children:n.jsx(Fn,{entries:W,isRunning:!0})})]}),te&&n.jsx("div",{className:"mb-4",children:ie?n.jsx(vr,{error:ie,onRetry:ye,onDismiss:()=>{P(null),q(null)}}):n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:te})}),p==="diff_shown"&&n.jsxs(n.Fragment,{children:[V&&n.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:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),V]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-4",style:{border:"1px solid var(--border-subtle)",maxHeight:"400px",overflowY:"auto"},children:g.map((N,k)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:N.type==="added"?"rgba(34,197,94,0.1)":N.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:N.type==="added"?"var(--green)":N.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:N.type==="added"?"3px solid var(--green)":N.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:N.type==="added"?"+":N.type==="removed"?"-":" "}),N.content]},k))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:Q,disabled:F,className:"btn btn-primary",children:F?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"spinner",style:{width:12,height:12}})," Applying..."]}):n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Apply"]})}),n.jsx("button",{onClick:ue,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const mm={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"}},Dh={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function Lh({change:i,index:o,selected:d,onToggle:u,originalEval:p}){var g;const[h,x]=v.useState(!1),b=mm[i.action]??mm.add,y=Dh[i.action]??"var(--border-subtle)",m=i.action==="remove"?(p==null?void 0:p.name)??`Eval #${i.evalId}`:((g=i.eval)==null?void 0:g.name)??"Unnamed",T=v.useCallback(()=>u(o),[u,o]);return n.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:d?1:.5},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsx("input",{type:"checkbox",checked:d,onChange:T,className:"flex-shrink-0",style:{accentColor:"var(--accent)"}}),n.jsx("span",{className:"pill text-[9px] font-bold flex-shrink-0",style:{background:b.bg,color:b.color,padding:"1px 6px"},children:b.label}),n.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:"var(--text-primary)"},children:m}),n.jsx("span",{className:"text-[11px] truncate flex-1",style:{color:"var(--text-tertiary)"},children:i.reason}),n.jsx("button",{onClick:()=>x(!h),className:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:A=>{A.currentTarget.style.background="var(--surface-3)"},onMouseLeave:A=>{A.currentTarget.style.background="transparent"},children:n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:h?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),h&&n.jsxs("div",{className:"px-4 pb-3 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[i.action==="add"&&i.eval&&n.jsx(Bh,{evalCase:i.eval}),i.action==="modify"&&i.eval&&p&&n.jsx(Uh,{original:p,proposed:i.eval}),i.action==="remove"&&p&&n.jsx(Hh,{evalCase:p})]})]})}function Bh({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[n.jsx(Xc,{label:"Prompt",value:i.prompt}),n.jsx(Xc,{label:"Expected",value:i.expected_output}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((o=i.assertions)==null?void 0:o.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-1",children:(i.assertions??[]).map(d=>n.jsxs("div",{className:"text-[11px] flex items-start gap-1.5",style:{color:"var(--text-secondary)"},children:[n.jsx("span",{style:{color:"var(--green)"},children:"+"})," ",d.text]},d.id))})]})]})}function Uh({original:i,proposed:o}){const d=[];i.name!==o.name&&d.push({label:"Name",old:i.name,new:o.name}),i.prompt!==o.prompt&&d.push({label:"Prompt",old:i.prompt,new:o.prompt}),i.expected_output!==o.expected_output&&d.push({label:"Expected",old:i.expected_output,new:o.expected_output});const u=i.assertions??[],p=o.assertions??[],h=new Set(u.map(m=>m.text)),x=new Set(p.map(m=>m.text)),b=p.filter(m=>!h.has(m.text)),y=u.filter(m=>!x.has(m.text));return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[d.map(m=>n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:m.label}),n.jsxs("div",{className:"mt-1 text-[11px] font-mono rounded p-2",style:{background:"var(--surface-1)"},children:[n.jsxs("div",{style:{color:"var(--red)",textDecoration:"line-through"},children:["- ",Zc(m.old,120)]}),n.jsxs("div",{style:{color:"var(--green)"},children:["+ ",Zc(m.new,120)]})]})]},m.label)),(b.length>0||y.length>0)&&n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Assertions"}),n.jsxs("div",{className:"mt-1 space-y-0.5",children:[y.map(m=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--red)"},children:["- ",m.text]},m.id)),b.map(m=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",m.text]},m.id))]})]}),d.length===0&&b.length===0&&y.length===0&&n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"No visible field changes"})]})}function Hh({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[n.jsx(Xc,{label:"Prompt",value:i.prompt}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((o=i.assertions)==null?void 0:o.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-0.5",children:(i.assertions??[]).map(d=>n.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:d.text},d.id))})]})]})}function Xc({label:i,value:o}){return n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),n.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:Zc(o,300)})]})}function Zc(i,o){return i.length>o?i.slice(0,o)+"...":i}const xm={remove:0,modify:1,add:2};function qh({changes:i,selections:o,currentEvals:d,onToggle:u,onSelectAll:p,onDeselectAll:h}){if(i.length===0)return null;const x=i.map((y,m)=>({change:y,originalIndex:m}));x.sort((y,m)=>(xm[y.change.action]??2)-(xm[m.change.action]??2));const b=Array.from(o.values()).filter(Boolean).length;return n.jsxs("div",{className:"mt-3 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Test Case Changes"}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",b,"/",i.length," selected)"]})]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:p,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"}),n.jsx("button",{onClick:h,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"})]})]}),n.jsx("div",{className:"space-y-1.5 overflow-auto",style:{maxHeight:240},children:x.map(({change:y,originalIndex:m})=>n.jsx(Lh,{change:y,index:m,selected:o.get(m)??!1,onToggle:u,originalEval:y.evalId!=null?d.find(T=>T.id===y.evalId):void 0},m))})]})}function Gh(){var N;const{state:i,dispatch:o,submitAiEdit:d,applyAiEdit:u,discardAiEdit:p,cancelAiEdit:h,toggleEvalChange:x,selectAllEvalChanges:b,deselectAllEvalChanges:y,retryEvalsSave:m}=Pt(),{aiEditLoading:T,aiEditResult:g,aiEditError:A,aiEditClassifiedError:z,aiEditProgress:B,aiEditEvalChanges:V,aiEditEvalSelections:K,aiEditEvalsRetry:te}=i,[P,ie]=v.useState(""),{config:q}=tn(),[W,ae]=v.useState("claude-cli"),[F,ne]=v.useState("opus"),I=v.useRef(null);v.useEffect(()=>{var k;(k=I.current)==null||k.focus()},[]),v.useEffect(()=>{if(!q)return;q.providers.find(J=>J.id==="claude-cli"&&J.available)&&(ae("claude-cli"),ne("opus"))},[q]);const Te=q==null?void 0:q.providers.find(k=>k.id===W&&k.available),ve=v.useCallback(()=>{const k=P.trim();!k||T||d(k,W,F)},[P,T,d,W,F]),ye=v.useCallback(k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),ve()),k.key==="Escape"&&(k.preventDefault(),T?h():p())},[ve,T,h,p]),Q=v.useCallback(()=>{o({type:"CLOSE_AI_EDIT"}),o({type:"OPEN_AI_EDIT"})},[o]),ue=g?hr(i.skillContent,g.improved):[],pe=((N=i.evals)==null?void 0:N.evals)??[];return n.jsxs("div",{className:"animate-fade-in",style:{background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)"},children:[n.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:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M15 4V2"}),n.jsx("path",{d:"M15 16v-2"}),n.jsx("path",{d:"M8 9h2"}),n.jsx("path",{d:"M20 9h2"}),n.jsx("path",{d:"M17.8 11.8L19 13"}),n.jsx("path",{d:"M15 9h.01"}),n.jsx("path",{d:"M17.8 6.2L19 5"}),n.jsx("path",{d:"M11 6.2L9.7 5"}),n.jsx("path",{d:"M3 21l9-9"})]})}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Edit"}),n.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:"Describe what to change — Enter to submit, Esc to dismiss"})]}),n.jsx("button",{onClick:p,className:"w-6 h-6 rounded-md flex items-center justify-center 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:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-4 py-3",children:[!g&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-2.5",children:[n.jsx("div",{className:"flex-1",children:n.jsx("textarea",{ref:I,value:P,onChange:k=>ie(k.target.value),onKeyDown:ye,placeholder:"e.g., Add an error handling section...",disabled:T,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:k=>{const J=k.currentTarget;J.style.height="auto",J.style.height=Math.min(J.scrollHeight,96)+"px"}})}),n.jsxs("div",{style:{minWidth:100},children:[n.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),n.jsx("select",{className:"input-field text-[11px] py-1",value:W,onChange:k=>{ae(k.target.value);const J=q==null?void 0:q.providers.find(re=>re.id===k.target.value);J!=null&&J.models[0]&&ne(J.models[0].id)},disabled:T,style:{width:"100%"},children:q==null?void 0:q.providers.filter(k=>k.available).map(k=>n.jsx("option",{value:k.id,children:k.label},k.id))})]}),n.jsxs("div",{style:{minWidth:80},children:[n.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsx("select",{className:"input-field text-[11px] py-1",value:F,onChange:k=>ne(k.target.value),disabled:T,style:{width:"100%"},children:Te==null?void 0:Te.models.map(k=>n.jsx("option",{value:k.id,children:k.label},k.id))})]}),T?n.jsx("button",{onClick:h,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):n.jsx("button",{onClick:ve,disabled:!P.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),T&&B.length>0&&n.jsx("div",{className:"mt-2.5",children:n.jsx(Fn,{entries:B,isRunning:!0})})]}),A&&n.jsx("div",{className:"mt-3",children:z?n.jsx(vr,{error:z,onRetry:Q,onDismiss:p}):n.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:A})}),g&&n.jsxs("div",{className:"animate-fade-in",children:[g.reasoning&&n.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:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),g.reasoning]}),n.jsx("div",{className:"mb-1",children:n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"})}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:300,overflowY:"auto"},children:ue.map((k,J)=>n.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:k.type==="added"?"rgba(34,197,94,0.1)":k.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:k.type==="added"?"var(--green)":k.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:k.type==="added"?"3px solid var(--green)":k.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:k.type==="added"?"+":k.type==="removed"?"-":" "}),k.content]},J))}),n.jsx(qh,{changes:V,selections:K,currentEvals:pe,onToggle:x,onSelectAll:b,onDeselectAll:y}),te&&n.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:[n.jsx("span",{children:"Test case save failed. SKILL.md was saved successfully."}),n.jsx("button",{onClick:m,className:"btn text-[11px]",style:{background:"rgba(251,191,36,0.2)",color:"#fbbf24",padding:"3px 10px"},children:"Retry Save"})]}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("button",{onClick:u,className:"btn btn-primary text-[11px]",style:{padding:"5px 12px"},children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),n.jsx("button",{onClick:p,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),n.jsx("button",{onClick:Q,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function Yh({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 18 22 12 16 6"}),n.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function Vh({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3"}),n.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"})]})}function Qh({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function Xh({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M15 4V2"}),n.jsx("path",{d:"M15 16v-2"}),n.jsx("path",{d:"M8 9h2"}),n.jsx("path",{d:"M20 9h2"}),n.jsx("path",{d:"M17.8 11.8L19 13"}),n.jsx("path",{d:"M15 9h.01"}),n.jsx("path",{d:"M17.8 6.2L19 5"}),n.jsx("path",{d:"M11 6.2L9.7 5"}),n.jsx("path",{d:"M3 21l9-9"})]})}function Bc({size:i=15}){return n.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M12 3l1.5 5.5L19 10l-5.5 1.5L12 17l-1.5-5.5L5 10l5.5-1.5L12 3z"})})}function Zh(){const{state:i,dispatch:o,saveContent:d,isReadOnly:u}=Pt(),{plugin:p,skill:h,skillContent:x,isDirty:b,improveTarget:y,aiEditOpen:m}=i,[T,g]=v.useState("split"),[A,z]=v.useState(!1),B=v.useRef(null),[V,K]=v.useState(!1),[te,P]=v.useState(""),[ie,q]=v.useState(!1),[W,ae]=v.useState(null),[F,ne]=v.useState([]),[I,Te]=v.useState([]),[ve,ye]=v.useState(null),Q=v.useRef(null),{config:ue}=tn();v.useEffect(()=>()=>{var ee;(ee=Q.current)==null||ee.abort()},[]);const{metadata:pe,body:N}=wh(x),k=pe["allowed-tools"],J=Array.isArray(k)?k:typeof k=="string"?[k]:[],re=pe.name,me=pe.description,S=pe.metadata,D=typeof S=="object"&&!Array.isArray(S)?S:null,Z=pe.version||(D==null?void 0:D.version),w=pe.tags||(D==null?void 0:D.tags),G=Array.isArray(w)?w:typeof w=="string"?w.split(",").map(ee=>ee.trim()).filter(Boolean):[],Y=new Set(["name","description","metadata","allowed-tools","version","tags"]),$=Object.entries(pe).filter(([ee])=>!Y.has(ee)),de=v.useCallback(async()=>{z(!0),await d(),z(!1)},[d]),ge=v.useCallback(ee=>{(ee.ctrlKey||ee.metaKey)&&ee.key==="s"&&(ee.preventDefault(),ee.stopPropagation(),b&&de()),(ee.ctrlKey||ee.metaKey)&&ee.key==="k"&&(ee.preventDefault(),ee.stopPropagation(),o({type:m?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[b,de,m,o]),ct=v.useCallback(async()=>{var Ie,dt;if(!te.trim())return;(Ie=Q.current)==null||Ie.abort();const ee=new AbortController;Q.current=ee,q(!0),ye(null),Te([]),ae(null),ne([]);try{const Qt=(ue==null?void 0:ue.provider)||"claude-cli",X=(ue==null?void 0:ue.model)||"sonnet",Ce=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:te,provider:Qt,model:X}),signal:ee.signal});if(!Ce.ok||!Ce.body){let jl=`HTTP ${Ce.status}`;try{const Xt=await Ce.json();Xt.error&&(jl=Xt.error)}catch{}throw new Error(jl)}const el=Ce.body.getReader(),ha=new TextDecoder;let ft="",qe="";for(;;){const{done:jl,value:Xt}=await el.read();if(jl)break;ft+=ha.decode(Xt,{stream:!0});const zt=ft.split(`
59
+ `);ft=zt.pop()||"";for(const mt of zt)if(mt.startsWith("event: "))qe=mt.slice(7).trim();else if(mt.startsWith("data: ")){try{const Ze=JSON.parse(mt.slice(6));if(qe==="progress")Te(xt=>[...xt,{phase:Ze.phase,message:Ze.message,timestamp:Date.now()}]);else if(qe==="done"||qe==="complete"){const xt=["---"];Ze.name&&xt.push(`name: ${Ze.name}`),Ze.description&&xt.push(`description: "${Ze.description.replace(/"/g,'\\"')}"`),Ze.model&&xt.push(`model: ${Ze.model}`),(dt=Ze.allowedTools)!=null&&dt.trim()&&xt.push(`allowed-tools: ${Ze.allowedTools.trim()}`),xt.push("---","",Ze.body||"");const tl=xt.join(`
60
+ `);ae(tl),ne(hr(x,tl)),q(!1)}else qe==="error"&&(ye(Ze.message||Ze.description||"Generation failed"),q(!1))}catch{}qe=""}}}catch(Qt){Qt.name!=="AbortError"&&ye(Qt.message)}finally{q(!1),Q.current=null}},[te,ue,x]),bl=v.useCallback(()=>{W&&o({type:"SET_CONTENT",content:W}),K(!1),ae(null),ne([]),P(""),Te([])},[W,o]),St=v.useCallback(()=>{K(!1),ae(null),ne([]),P(""),Te([]),ye(null)},[]),pa=v.useCallback(()=>{var ee;V?((ee=Q.current)==null||ee.abort(),St()):(m&&o({type:"CLOSE_AI_EDIT"}),K(!0))},[V,m,o,St]),Mt=[{mode:"raw",icon:n.jsx(Yh,{}),label:"Editor"},{mode:"split",icon:n.jsx(Vh,{}),label:"Split"},{mode:"preview",icon:n.jsx(Qh,{}),label:"Preview"}];return n.jsxs("div",{className:"flex flex-col h-full",onKeyDown:ge,tabIndex:-1,children:[n.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:[n.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:Mt.map(({mode:ee,icon:Ie,label:dt})=>n.jsxs("button",{onClick:()=>g(ee),title:dt,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:T===ee?"var(--surface-4)":"transparent",color:T===ee?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:T===ee?600:400,border:"none",cursor:"pointer"},children:[Ie,n.jsx("span",{style:{letterSpacing:"0.01em"},children:dt})]},ee))}),u?n.jsx("div",{className:"flex items-center gap-2",children:n.jsxs("span",{className:"flex items-center gap-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Read-only"]})}):n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{m?o({type:"CLOSE_AI_EDIT"}):(V&&St(),o({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:m?600:400,border:"none",cursor:"pointer",color:m?"#a855f7":"var(--text-tertiary)",background:m?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(Xh,{size:13}),n.jsx("span",{children:"AI Edit"})]}),n.jsxs("button",{onClick:pa,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:V?600:400,border:"none",cursor:"pointer",color:V?"#a855f7":"var(--text-tertiary)",background:V?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(Bc,{size:13}),n.jsx("span",{children:"Regenerate"})]}),n.jsx("div",{style:{width:1,height:16,background:"var(--border-subtle)"}}),b&&n.jsx("button",{onClick:()=>o({type:"SET_CONTENT",content:i.savedContent}),className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Discard"}),n.jsx("button",{onClick:de,disabled:!b||A,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:A?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]})]}),n.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:T==="raw"||T==="preview"?"1fr":"1fr 1fr"},children:[T!=="preview"&&n.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:T==="split"?"1px solid var(--border-subtle)":"none"},children:n.jsx("textarea",{ref:B,value:x,onChange:ee=>{u||o({type:"SET_CONTENT",content:ee.target.value})},onKeyDown:ge,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}})}),T!=="raw"&&n.jsx("div",{className:"overflow-auto",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"animate-fade-in",style:{padding:"20px 24px",maxWidth:720},children:[(re||Z||me)&&n.jsxs("div",{style:{marginBottom:20},children:[n.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[re&&n.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:re}),Z&&n.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",Z]})]}),me&&n.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:me})]}),G.length>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:G.map(ee=>n.jsx("span",{style:{fontSize:10,fontWeight:500,color:"var(--text-tertiary)",background:"var(--surface-2)",padding:"3px 8px",borderRadius:4,letterSpacing:"0.02em"},children:ee},ee))}),J.length>0&&n.jsx("div",{style:{marginBottom:16},children:n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",marginRight:4},children:"Tools"}),J.map(ee=>n.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:ee},ee))]})}),$.length>0&&n.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:$.map(([ee,Ie],dt)=>{const Qt=Array.isArray(Ie)?Ie.join(", "):typeof Ie=="object"?Object.entries(Ie).map(([X,Ce])=>`${X}: ${Array.isArray(Ce)?Ce.join(", "):Ce}`).join(" | "):Ie;return n.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:dt>0?"1px solid var(--border-subtle)":"none"},children:[n.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",minWidth:80,flexShrink:0},children:ee}),n.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:Qt})]},ee)})}),(re||me||G.length>0||J.length>0||$.length>0)&&N&&n.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),N&&n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Fc(N)}})]})})]}),m&&n.jsx(Gh,{}),V&&n.jsx("div",{className:"animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:n.jsxs("div",{className:"px-4 py-3",children:[!W&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Bc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerate Skill"})]}),n.jsx("div",{className:"flex gap-2 mb-2",children:n.jsx("textarea",{value:te,onChange:ee=>P(ee.target.value),placeholder:"Describe what this skill should do...",rows:2,disabled:ie,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:ie?.5:1},onKeyDown:ee=>{ee.key==="Enter"&&(ee.ctrlKey||ee.metaKey)&&te.trim()&&!ie&&(ee.preventDefault(),ct())}})}),n.jsxs("div",{className:"flex items-center gap-2",children:[ie?n.jsx("button",{onClick:()=>{var ee;(ee=Q.current)==null||ee.abort(),q(!1)},className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Cancel"}):n.jsx("button",{onClick:ct,disabled:!te.trim(),className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:"Generate"}),n.jsx("button",{onClick:St,className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Close"})]}),ie&&I.length>0&&n.jsx("div",{className:"mt-2",children:n.jsx(Fn,{entries:I,isRunning:!0})}),ve&&n.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:[ve,n.jsx("button",{onClick:ct,className:"ml-2 underline",style:{color:"var(--red)"},children:"Retry"})]})]}),W&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Bc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerated — Review Changes"})]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:"300px",overflowY:"auto"},children:F.map((ee,Ie)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:ee.type==="added"?"rgba(34,197,94,0.1)":ee.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:ee.type==="added"?"var(--green)":ee.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:ee.type==="added"?"3px solid var(--green)":ee.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:ee.type==="added"?"+":ee.type==="removed"?"-":" "}),ee.content]},Ie))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:bl,className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),n.jsx("button",{onClick:St,className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Discard"})]})]})]})}),y!==null&&p&&h&&n.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(Oh,{plugin:p,skill:h,skillContent:x,onApplied:ee=>{o({type:"SET_CONTENT",content:ee}),o({type:"CONTENT_SAVED"}),o({type:"CLOSE_IMPROVE"})}})})]})}function Kc(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Am(i){const o=new Date(i);return o.toLocaleDateString(void 0,{month:"short",day:"numeric"})+", "+o.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function _m(i){return i==null?"--":i>=1e3?`${(i/1e3).toFixed(1)}s`:`${i}ms`}function Rm({entries:i}){if(i.length<2)return null;const o=80,d=24,u=2,p=i.slice().reverse(),h=p.length,x=p.map((b,y)=>{const m=u+y/(h-1)*(o-u*2),T=u+(d-u*2)-b.pass_rate*(d-u*2);return`${m},${T}`});return n.jsxs("svg",{width:o,height:d,style:{display:"block",flexShrink:0},children:[n.jsx("polyline",{points:x.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),x.length>0&&n.jsx("circle",{cx:parseFloat(x[x.length-1].split(",")[0]),cy:parseFloat(x[x.length-1].split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function Kh(i,o,d){const[u,p]=v.useState(null),[h,x]=v.useState(!1),b=v.useRef("");v.useEffect(()=>{const m=`${i}/${o}/${d}`;b.current!==m&&(b.current=m,x(!0),Re.getCaseHistory(i,o,d).then(T=>p(T)).catch(()=>p([])).finally(()=>x(!1)))},[i,o,d]);const y=v.useCallback(()=>{x(!0),b.current="",Re.getCaseHistory(i,o,d).then(m=>p(m)).catch(()=>p([])).finally(()=>x(!1))},[i,o,d]);return{entries:u,loading:h,refetch:y}}function Jh(i,o,d){const u={flaky:!1,nonDiscriminating:!1,regression:!1};if(!d||d.length===0)return u;const h=d.slice(0,10).map(y=>y.assertions.find(m=>m.id===i)).filter(Boolean);if(h.length>=2){const m=h.filter(T=>T.pass).length/h.length;m>=.3&&m<=.7&&(u.flaky=!0)}const x=d.find(y=>y.type==="benchmark"),b=d.find(y=>y.type==="baseline");if(x&&b){const y=x.assertions.find(T=>T.id===i),m=b.assertions.find(T=>T.id===i);y!=null&&y.pass&&(m!=null&&m.pass)&&(u.nonDiscriminating=!0)}if(o&&!o.pass&&d.length>=1){const m=d[0].assertions.find(T=>T.id===i);m!=null&&m.pass&&(u.regression=!0)}return u}function $h(){var ne;const{state:i,dispatch:o,saveEvals:d,runCase:u,runAll:p,cancelCase:h,cancelAll:x,generateEvals:b,isReadOnly:y}=Pt(),{evals:m,selectedCaseId:T,inlineResults:g,caseRunStates:A,generateEvalsLoading:z,generateEvalsProgress:B,generateEvalsError:V}=i,K=v.useMemo(()=>{for(const I of A.values())if(I.status==="running"||I.status==="queued")return!0;return!1},[A]),[te,P]=v.useState(!1),ie={skill_name:i.skill,evals:[]},q=m??ie,W=q.evals,ae=W.find(I=>I.id===T)??null,F=v.useCallback(()=>{b()},[b]);return!m||W.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 px-8",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:"var(--accent-muted)"},children:n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M9 11l3 3L22 4"}),n.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}),n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No test cases yet"}),n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Create test cases to start evaluating your skill"})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>P(!0),disabled:y,className:"btn btn-primary text-[12px]",children:"Create Test Case"}),n.jsx("button",{onClick:F,disabled:z||y,className:"btn btn-secondary text-[12px]",children:z?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate with AI"})]}),z&&B.length>0&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(Fn,{entries:B,isRunning:!0})}),V&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(vr,{error:V,onRetry:F})}),te&&n.jsx(pm,{evals:q,onSave:I=>{d(I),P(!1)},onCancel:()=>P(!1)})]}):n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"280px 1fr",height:"100%",overflow:"hidden"},children:[n.jsxs("div",{className:"overflow-auto",style:{borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.jsxs("div",{className:"px-3 py-2 flex items-center justify-between",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Test Cases (",W.length,")"]}),n.jsx("div",{className:"flex items-center gap-1.5",children:K?n.jsx("button",{onClick:x,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"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>p("benchmark"),disabled:W.length===0||y,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),n.jsx("button",{onClick:()=>p("comparison"),disabled:W.length===0||y,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),n.jsx("div",{className:"py-1",children:W.map(I=>{const Te=g.get(I.id),ve=T===I.id;return n.jsxs("button",{onClick:()=>o({type:"SELECT_CASE",caseId:I.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:ve?"var(--accent-muted)":"transparent",borderLeft:ve?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:ye=>{ve||(ye.currentTarget.style.background="var(--surface-2)")},onMouseLeave:ye=>{ve||(ye.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[n.jsxs("span",{className:"text-[12px] font-medium truncate",style:{color:ve?"var(--text-primary)":"var(--text-secondary)"},children:["#",I.id," ",I.name]}),n.jsx(wm,{result:Te})]}),n.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[I.assertions.length," assertion",I.assertions.length!==1?"s":"",(Te==null?void 0:Te.passRate)!=null&&n.jsx(Ih,{passRate:Te.passRate})]})]},I.id)})}),n.jsx("div",{className:"px-3 py-2",children:!y&&n.jsx("button",{onClick:()=>P(!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:I=>{I.currentTarget.style.borderColor="var(--accent)",I.currentTarget.style.color="var(--accent)"},onMouseLeave:I=>{I.currentTarget.style.borderColor="var(--border-default)",I.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),n.jsx("div",{className:"overflow-auto",children:ae?n.jsx(Wh,{evalCase:ae,result:g.get(ae.id),evals:m,caseStatus:((ne=A.get(ae.id))==null?void 0:ne.status)??"idle",onSaveEvals:d,onRun:I=>u(I,"benchmark"),onCompare:I=>u(I,"comparison"),onCancel:I=>h(I),onImprove:I=>o({type:"OPEN_IMPROVE",evalId:I})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),te&&n.jsx(pm,{evals:q,onSave:I=>{d(I),P(!1)},onCancel:()=>P(!1)})]})}function Wh({evalCase:i,result:o,evals:d,caseStatus:u,onSaveEvals:p,onRun:h,onCompare:x,onCancel:b,onImprove:y}){const{state:m,isReadOnly:T}=Pt(),{plugin:g,skill:A}=m,{entries:z,loading:B}=Kh(g,A,i.id),[V,K]=v.useState(!1),[te,P]=v.useState(i.prompt),[ie,q]=v.useState(!1),[W,ae]=v.useState(i.expected_output);v.useState(()=>{P(i.prompt),ae(i.expected_output)});const F=v.useCallback(N=>{p({...d,evals:d.evals.map(k=>k.id===N.id?N:k)})},[d,p]),ne=v.useCallback(()=>{F({...i,prompt:te}),K(!1)},[i,te,F]),I=v.useCallback(()=>{F({...i,expected_output:W}),q(!1)},[i,W,F]),Te=v.useCallback(()=>{F({...i,assertions:[...i.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[i,F]),ve=v.useCallback((N,k)=>{F({...i,assertions:i.assertions.map(J=>J.id===N?{...J,text:k}:J)})},[i,F]),ye=v.useCallback(N=>{F({...i,assertions:i.assertions.filter(k=>k.id!==N)})},[i,F]),Q=v.useCallback(()=>{confirm("Delete this test case?")&&p({...d,evals:d.evals.filter(N=>N.id!==i.id)})},[d,i.id,p]),ue=o&&o.assertions.length>0&&o.assertions.every(N=>N.pass),pe=o&&o.assertions.some(N=>!N.pass);return n.jsxs("div",{className:"p-5 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"text-[16px] font-semibold",style:{color:"var(--text-primary)"},children:["#",i.id," ",i.name]}),n.jsx(wm,{result:o})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"||u==="queued"?n.jsxs("button",{onClick:()=>b(i.id),className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel"]}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>h(i.id),disabled:T,className:"btn btn-primary text-[12px]",children:"Run"}),n.jsx("button",{onClick:()=>x(i.id),disabled:T,className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),pe&&!T&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:()=>y(i.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),!T&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:Q,className:"btn btn-ghost text-[12px]",style:{color:"var(--red)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("polyline",{points:"3 6 5 6 21 6"}),n.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"})]})})]})]}),ue&&n.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:[n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",children:[n.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),n.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--green)"},children:"All assertions passing"})]}),n.jsx(Uc,{title:"Prompt",children:V?n.jsxs("div",{children:[n.jsx("textarea",{value:te,onChange:N=>P(N.target.value),className:"input-field w-full",rows:4,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx("button",{onClick:ne,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{P(i.prompt),K(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.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:T?"default":"pointer"},onClick:()=>{T||K(!0)},onMouseEnter:N=>{T||(N.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:N=>{N.currentTarget.style.borderColor="var(--border-subtle)"},children:i.prompt||n.jsx("span",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:T?"No prompt":"Click to edit prompt..."})})}),n.jsx(Uc,{title:"Expected Output",children:ie?n.jsxs("div",{children:[n.jsx("textarea",{value:W,onChange:N=>ae(N.target.value),className:"input-field w-full",rows:3,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx("button",{onClick:I,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{ae(i.expected_output),q(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.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:T?"default":"pointer"},onClick:()=>{T||q(!0)},onMouseEnter:N=>{T||(N.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:N=>{N.currentTarget.style.borderColor="var(--border-subtle)"},children:i.expected_output||n.jsx("span",{style:{fontStyle:"italic"},children:T?"No expected output":"Click to edit expected output..."})})}),n.jsx(Uc,{title:`Assertions (${i.assertions.length})`,action:T?void 0:n.jsx("button",{onClick:Te,className:"btn btn-ghost text-[11px]",children:"+ Add"}),children:i.assertions.length===0?n.jsx("div",{className:"text-[12px] text-center py-4",style:{color:"var(--text-tertiary)"},children:'No assertions. Click "+ Add" to create one.'}):n.jsx("div",{className:"space-y-2",children:i.assertions.map(N=>{const k=o==null?void 0:o.assertions.find(re=>re.assertion_id===N.id),J=Jh(N.id,k,z);return n.jsx(Fh,{assertion:N,result:k,badges:J,isReadOnly:T,onUpdate:re=>ve(N.id,re),onDelete:()=>ye(N.id)},N.id)})})}),(o==null?void 0:o.output)&&n.jsx(Ph,{output:o.output,durationMs:o.durationMs,tokens:o.tokens}),n.jsx(ev,{evalId:i.id,sharedEntries:z,sharedLoading:B})]},i.id)}function Fh({assertion:i,result:o,badges:d,isReadOnly:u,onUpdate:p,onDelete:h}){const[x,b]=v.useState(!1),[y,m]=v.useState(i.text),[T,g]=v.useState(!1),A=()=>{p(y),b(!1)};return n.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:n.jsxs("div",{className:"flex items-start gap-2",children:[o?n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",background:o.pass?"var(--green-muted)":"var(--red-muted)"},children:o.pass?n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}):n.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"}),(d==null?void 0:d.regression)&&n.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:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("polyline",{points:"19 12 12 19 5 12"})]})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsx("span",{className:"text-[10px] font-mono font-semibold",style:{color:"var(--text-tertiary)"},children:i.id}),(d==null?void 0:d.flaky)&&n.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"}),(d==null?void 0:d.nonDiscriminating)&&n.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."})]}),x?n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{value:y,onChange:z=>m(z.target.value),onKeyDown:z=>{z.key==="Enter"&&A(),z.key==="Escape"&&b(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),n.jsx("button",{onClick:A,className:"btn btn-primary text-[11px]",children:"Save"})]}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-secondary)",cursor:u?"default":"pointer"},onClick:()=>{u||(m(i.text),b(!0))},children:i.text}),(o==null?void 0:o.reasoning)&&n.jsx("button",{onClick:()=>g(!T),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:T?"Hide reasoning":"Show reasoning"}),T&&(o==null?void 0:o.reasoning)&&n.jsx("div",{className:"mt-1 text-[11px] p-2 rounded",style:{background:"var(--surface-1)",color:"var(--text-tertiary)"},children:o.reasoning})]}),!u&&n.jsx("button",{onClick:h,className:"btn btn-ghost p-1 opacity-0 group-hover:opacity-100",style:{color:"var(--text-tertiary)"},onMouseEnter:z=>{z.currentTarget.style.color="var(--red)",z.currentTarget.style.opacity="1"},onMouseLeave:z=>{z.currentTarget.style.color="var(--text-tertiary)",z.currentTarget.style.opacity=""},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})})}function Uc({title:i,action:o,children:d}){return n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),o]}),d]})}function wm({result:i}){if(!i||i.status==null)return n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"--"});const o=i.status==="pass";return n.jsx("span",{className:"pill text-[10px]",style:{background:o?"var(--green-muted)":"var(--red-muted)",color:o?"var(--green)":"var(--red)"},children:i.passRate!=null?`${Math.round(i.passRate*100)}%`:i.status})}function Ih({passRate:i}){const o=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-1",children:n.jsx("div",{className:"rounded-full overflow-hidden",style:{width:32,height:4,background:"var(--surface-4)"},children:n.jsx("div",{className:"h-full rounded-full",style:{width:`${o}%`,background:o>=80?"var(--green)":o>=50?"var(--yellow)":"var(--red)"}})})})}function Ph({output:i,durationMs:o,tokens:d}){const[u,p]=v.useState(!1);return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:()=>p(!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:[n.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:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"LLM Output",o!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",(o/1e3).toFixed(1),"s)"]}),d!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",d," tokens)"]})]}),u&&n.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:i})]})}function ev({evalId:i,sharedEntries:o,sharedLoading:d}){const{state:u,dispatch:p}=Pt(),{plugin:h,skill:x}=u,[b,y]=v.useState(!0),m=o??null,T=d??!1,g=v.useCallback(()=>{y(!b)},[b]),A=m?m.slice(0,10):[];return n.jsxs("div",{className:"mb-5",children:[n.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:[n.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:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"Execution History",m&&m.length>0&&n.jsxs("span",{style:{fontWeight:400},children:["(",m.length," run",m.length!==1?"s":"",")"]})]}),b&&n.jsx("div",{className:"animate-fade-in",children:T?n.jsxs("div",{className:"flex items-center gap-2 py-3",children:[n.jsx("div",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),n.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):!m||m.length===0?n.jsx("div",{className:"text-[12px] py-3",style:{color:"var(--text-tertiary)"},children:"No history for this case"}):n.jsxs("div",{children:[A.length>=2&&n.jsx("div",{className:"mb-2",children:n.jsx(Rm,{entries:A})}),n.jsx("div",{className:"space-y-2",children:A.map((z,B)=>n.jsxs("div",{className:"rounded-lg px-3 py-2.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Am(z.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:z.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:z.type==="benchmark"?"rgba(99,131,255,0.15)":z.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:z.type==="benchmark"?"#6383ff":z.type==="comparison"?"var(--purple)":"#fb923c"},children:z.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:Kc(z.pass_rate)},children:[Math.round(z.pass_rate*100),"%"]})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-1.5 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[z.durationMs!=null&&n.jsx("span",{children:_m(z.durationMs)}),z.tokens!=null&&n.jsxs("span",{children:[z.tokens>=1e3?`${(z.tokens/1e3).toFixed(1)}k`:z.tokens," tok"]})]}),n.jsx("div",{className:"space-y-0.5",children:z.assertions.map(V=>n.jsxs("div",{className:"flex items-start gap-1.5",children:[n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:14,height:14,display:"flex",alignItems:"center",justifyContent:"center",background:V.pass?"var(--green-muted)":"var(--red-muted)"},children:V.pass?n.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:V.text})]},V.id))})]},B))}),n.jsx("button",{onClick:()=>p({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:z=>{z.currentTarget.style.textDecoration="underline"},onMouseLeave:z=>{z.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function pm({evals:i,onSave:o,onCancel:d}){const[u,p]=v.useState(""),[h,x]=v.useState(""),[b,y]=v.useState(""),[m,T]=v.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),g=Math.max(0,...i.evals.map(z=>z.id))+1,A=()=>{if(!u.trim()||!h.trim())return;const z={id:g,name:u.trim(),prompt:h.trim(),expected_output:b.trim(),files:[],assertions:m.filter(B=>B.text.trim())};o({...i,evals:[...i.evals,z]})};return n.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:n.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)"},children:[n.jsx("div",{className:"text-[15px] font-semibold mb-4",style:{color:"var(--text-primary)"},children:"New Test Case"}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Name"}),n.jsx("input",{value:u,onChange:z=>p(z.target.value),className:"input-field",placeholder:"e.g., auth-check",autoFocus:!0})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Prompt"}),n.jsx("textarea",{value:h,onChange:z=>x(z.target.value),className:"input-field",rows:3,placeholder:"User prompt to test..."})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Expected Output"}),n.jsx("textarea",{value:b,onChange:z=>y(z.target.value),className:"input-field",rows:2,placeholder:"Description of expected behavior..."})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Assertions"}),m.map((z,B)=>n.jsxs("div",{className:"flex gap-2 mb-2",children:[n.jsx("input",{value:z.text,onChange:V=>T(m.map((K,te)=>te===B?{...K,text:V.target.value}:K)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),m.length>1&&n.jsx("button",{onClick:()=>T(m.filter((V,K)=>K!==B)),className:"btn btn-ghost p-1",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},z.id)),n.jsx("button",{onClick:()=>T([...m,{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--accent)"},children:"+ Add Assertion"})]}),n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:d,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsx("button",{onClick:A,disabled:!u.trim()||!h.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function tv(i,o){const d=i+o,u=d*10,p=d*25,h=x=>x>=60?`${Math.round(x/60)}m`:`${x}s`;return`${h(u)}–${h(p)}`}function lv(){const{state:i,runCase:o,runAll:d,cancelCase:u,cancelAll:p,isReadOnly:h}=Pt(),{evals:x,caseRunStates:b,bulkRunActive:y,latestBenchmark:m,inlineResults:T}=i,g=(x==null?void 0:x.evals)??[],A=v.useMemo(()=>{for(const q of b.values())if(q.status==="running"||q.status==="queued")return!0;return!1},[b]),z=g.filter(q=>{const W=b.get(q.id);return W&&(W.status==="complete"||W.status==="error"||W.status==="cancelled")}).length,B=g.filter(q=>{const W=b.get(q.id);return W&&(W.status==="running"||W.status==="queued")}).length,V=v.useRef(null),[K,te]=v.useState(0);v.useEffect(()=>{if(A&&!V.current&&(V.current=Date.now()),!A){V.current=null,te(0);return}const q=setInterval(()=>{V.current&&te(Math.round((Date.now()-V.current)/1e3))},1e3);return()=>clearInterval(q)},[A]);const P=g.reduce((q,W)=>q+W.assertions.length,0),ie=v.useMemo(()=>tv(g.length,P),[g.length,P]);return n.jsxs("div",{className:"p-5",children:[h&&n.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:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Installed skill — benchmarking is disabled. Edit the source skill to run benchmarks."]}),n.jsxs("div",{className:"rounded-xl p-4 mb-5",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Benchmark"}),A&&n.jsxs("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:[B," running"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[A&&n.jsxs("button",{onClick:p,className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel All"]}),n.jsx("button",{onClick:()=>d("comparison"),disabled:g.length===0||A||h,className:"btn btn-primary text-[12px]",children:"Compare All"}),n.jsx("button",{onClick:()=>d("benchmark"),disabled:g.length===0||A||h,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),n.jsx("button",{onClick:()=>d("baseline"),disabled:g.length===0||A||h,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),A&&g.length>0&&n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("span",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:["Progress: ",z,"/",g.length," cases"]}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[Math.round(z/g.length*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${z/g.length*100}%`,background:"var(--accent)"}})}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Elapsed: ",K>=60?`${Math.floor(K/60)}m ${K%60}s`:`${K}s`]}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",ie]})]})]}),n.jsx("div",{className:"space-y-3 stagger-children",children:g.map(q=>{const W=T.get(q.id),ae=b.get(q.id),F=(ae==null?void 0:ae.status)??"idle";return n.jsx(nv,{name:q.name,evalId:q.id,result:W,caseStatus:F,runMode:(ae==null?void 0:ae.mode)??null,isReadOnly:h,onRun:ne=>o(ne,"benchmark"),onBaseline:ne=>o(ne,"baseline"),onCompare:ne=>o(ne,"comparison"),onCancel:ne=>u(ne)},q.id)})}),!A&&m&&m.cases.length>0&&n.jsxs("div",{className:"mt-5",children:[n.jsxs("div",{className:"rounded-xl p-4 mb-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall Pass Rate"}),n.jsx("span",{className:"text-[20px] font-bold",style:{color:(m.overall_pass_rate??0)>=.8?"var(--green)":(m.overall_pass_rate??0)>=.5?"var(--yellow)":"var(--red)"},children:m.overall_pass_rate!=null?`${Math.round(m.overall_pass_rate*100)}%`:"--"})]}),m.totalDurationMs!=null&&n.jsxs("div",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:["Total: ",(m.totalDurationMs/1e3).toFixed(1),"s",m.model&&` | Model: ${m.model}`]}),m.overall_pass_rate===1&&!m.comparison&&n.jsx("button",{onClick:()=>d("comparison"),disabled:g.length===0||h,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"})]}),m.comparison&&n.jsxs("div",{className:"rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"Skill vs Baseline"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(hm,{label:"Skill",value:m.comparison.skillPassRate,color:"var(--accent)"}),n.jsx(hm,{label:"Baseline",value:m.comparison.baselinePassRate,color:"var(--text-tertiary)"})]}),n.jsxs("div",{className:"mt-3 text-[12px] font-medium",style:{color:m.comparison.delta>0?"var(--green)":m.comparison.delta<0?"var(--red)":"var(--text-tertiary)"},children:["Delta: ",m.comparison.delta>0?"+":"",(m.comparison.delta*100).toFixed(1),"%",m.verdict&&` | ${m.verdict}`]})]})]})]})}const av={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 nv({name:i,evalId:o,result:d,caseStatus:u,runMode:p,isReadOnly:h,onRun:x,onBaseline:b,onCompare:y,onCancel:m}){const[T,g]=v.useState(!1),A=u==="running"||u==="queued",z=u==="complete"||u==="error";return n.jsxs("div",{className:"rounded-xl overflow-hidden transition-all duration-200",style:{background:"var(--surface-1)",border:A?"1px solid var(--accent)":"1px solid var(--border-subtle)",boxShadow:A?"0 0 12px rgba(99, 131, 255, 0.15)":"none"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"&&n.jsx("span",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),u==="queued"&&n.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--text-tertiary)"},children:"queued"}),n.jsxs("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:["#",o," ",i]}),p&&(A||z)&&(()=>{const B=av[p];return B?n.jsx("span",{className:"pill text-[9px] font-semibold",style:{background:B.bg,color:B.color,padding:"1px 6px"},children:B.label}):null})()]}),n.jsxs("div",{className:"flex items-center gap-2",children:[A?n.jsx("button",{onClick:()=>m(o),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"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>y(o),disabled:h,className:"btn btn-primary text-[10px] px-2 py-1",children:"Compare"}),n.jsx("button",{onClick:()=>x(o),disabled:h,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Skill"}),n.jsx("button",{onClick:()=>b(o),disabled:h,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Base"})]}),d&&d.status!=null&&n.jsx("span",{className:"pill text-[10px]",style:{background:d.status==="pass"?"var(--green-muted)":(d.status==="error","var(--red-muted)"),color:d.status==="pass"?"var(--green)":"var(--red)"},children:d.passRate!=null?`${Math.round(d.passRate*100)}%`:d.status}),u==="cancelled"&&n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),d&&d.assertions.length>0&&n.jsxs("div",{className:"px-4 pb-3",children:[n.jsx("div",{className:"space-y-1",children:d.assertions.map(B=>n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsx("span",{style:{color:B.pass?"var(--green)":"var(--red)"},children:B.pass?"PASS":"FAIL"}),n.jsx("span",{style:{color:"var(--text-secondary)"},children:B.text})]},B.assertion_id))}),d.output&&n.jsx("button",{onClick:()=>g(!T),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:T?"Hide output":"Show output"}),T&&d.output&&n.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:d.output})]}),d&&d.errorMessage&&n.jsx(sv,{errorMessage:d.errorMessage,classifiedError:d.classifiedError})]})}const Hc={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function sv({errorMessage:i,classifiedError:o}){const[d,u]=v.useState(!1),p=(o==null?void 0:o.title)??"Error",h=o==null?void 0:o.hint,x=o?Hc[o.category]??Hc.unknown:Hc.unknown;return n.jsx("div",{className:"px-4 pb-3",children:n.jsxs("div",{className:"rounded-lg overflow-hidden",style:{background:"var(--red-muted)",border:"1px solid rgba(239,68,68,0.2)"},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[n.jsx("span",{style:{fontSize:12},children:x}),n.jsx("span",{className:"text-[11.5px] font-semibold flex-1",style:{color:"var(--red)"},children:p}),n.jsx("button",{onClick:()=>u(!d),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:d?"Hide details":"Details"})]}),h&&n.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:h}),d&&n.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:i})]})})}function hm({label:i,value:o,color:d}){return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:d},children:[Math.round(o*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${o*100}%`,background:d}})})]})}const vm={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)"}},rv=[{label:"Should activate",prompts:["+How do I use this feature?","+Show me best practices for this","+What's the recommended approach?"]},{label:"Should NOT activate",prompts:["!What's the weather today?","!Write me a poem","!How do I cook pasta?"]}];function iv(){const{state:i,dispatch:o,runActivationTest:d}=Pt(),{plugin:u,skill:p,activationPrompts:h,activationResults:x,activationSummary:b,activationRunning:y,activationError:m}=i,[T,g]=v.useState(h),[A,z]=v.useState(null),[B,V]=v.useState(!1);v.useEffect(()=>{o({type:"SET_ACTIVATION_PROMPTS",prompts:T})},[T,o]),v.useEffect(()=>{fetch(`/api/skills/${u}/${p}/description`).then(q=>q.json()).then(q=>z(q.rawContent||q.description||null)).catch(()=>z(null))},[u,p]);function K(){d(T)}function te(q){const W=T.trim(),ae=W?`${W}
61
+ ${q.join(`
62
+ `)}`:q.join(`
63
+ `);g(ae)}const P=x.filter(q=>q.classification==="TP"||q.classification==="TN"),ie=x.filter(q=>q.classification==="FP"||q.classification==="FN");return n.jsxs("div",{className:"p-5",children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("div",{className:"text-[14px] font-semibold",style:{color:"var(--text-primary)"},children:"Activation Test"}),n.jsx("div",{className:"text-[12px] mt-1",style:{color:"var(--text-tertiary)"},children:"Test whether this skill's description activates for relevant prompts and stays silent for irrelevant ones."})]}),n.jsxs("div",{className:"grid grid-cols-5 gap-4 mb-5",children:[n.jsxs("div",{className:"col-span-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[n.jsx("label",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:"Test Prompts"}),n.jsx("div",{className:"flex gap-1.5",children:rv.map(q=>n.jsxs("button",{onClick:()=>te(q.prompts),className:"text-[10px] px-2 py-1 rounded-md transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)"},onMouseEnter:W=>{W.currentTarget.style.color="var(--text-primary)",W.currentTarget.style.background="var(--surface-3)"},onMouseLeave:W=>{W.currentTarget.style.color="var(--text-tertiary)",W.currentTarget.style.background="var(--surface-2)"},children:["+ ",q.label]},q.label))})]}),n.jsx("textarea",{className:"input-field h-32 resize-y font-mono text-[12px]",value:T,onChange:q=>g(q.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`}),n.jsxs("div",{className:"flex items-center gap-4 mt-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{children:"One prompt per line"}),n.jsx("span",{children:"No prefix = auto-classify"}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"+"})," = must activate"]}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"!"})," = must NOT activate"]}),n.jsxs("span",{children:[T.trim().split(`
68
+ `).filter(Boolean).length," prompt",T.trim().split(`
69
+ `).filter(Boolean).length!==1?"s":""]})]})]}),n.jsx("div",{className:"col-span-2 flex flex-col",children:n.jsxs("div",{className:`glass-card flex flex-col ${B?"flex-1":""}`,children:[n.jsxs("button",{onClick:()=>V(!B),className:"w-full p-3 flex items-center justify-between text-left flex-shrink-0",style:{borderBottom:B?"1px solid var(--border-subtle)":void 0},children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Skill Description"}),n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:B?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),B&&A&&n.jsx("div",{className:"p-3 flex-1 overflow-auto animate-fade-in",style:{maxHeight:320},children:n.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:Fc(A)}})}),!B&&A&&n.jsx("div",{className:"px-3 pb-3 pt-1",children:n.jsx("div",{className:"text-[11px] line-clamp-2 leading-relaxed",style:{color:"var(--text-tertiary)"},children:A.replace(/^---[\s\S]*?---\s*/,"").trim().slice(0,150)})})]})})]}),n.jsx("button",{onClick:K,disabled:y||!T.trim(),className:"btn btn-primary mb-5",children:y?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"spinner",style:{borderTopColor:"#fff",borderColor:"rgba(255,255,255,0.2)",width:14,height:14}})," Testing..."]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("circle",{cx:"12",cy:"12",r:"6"}),n.jsx("circle",{cx:"12",cy:"12",r:"2"})]})," Run Activation Test"]})}),m&&n.jsx("div",{className:"mb-5 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:m}),x.length>0&&n.jsxs("div",{className:"space-y-5 mb-5",children:[ie.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),n.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--red)"},children:["Incorrect (",ie.length,")"]}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"— These need attention"})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:ie.map((q,W)=>n.jsx(ym,{result:q},`incorrect-${W}`))})]}),P.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"16 10 11 15 8 12"})]}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--green)"},children:["Correct (",P.length,")"]})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:P.map((q,W)=>n.jsx(ym,{result:q},`correct-${W}`))})]})]}),b&&n.jsxs("div",{className:"glass-card p-6 animate-fade-in-scale",style:{borderColor:"var(--border-active)",borderWidth:2},children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-2",style:{color:"var(--text-tertiary)"},children:"Summary"}),b.autoClassifiedCount!=null&&b.autoClassifiedCount>0&&n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:[b.autoClassifiedCount," of ",b.total," prompts auto-classified from skill name and tags"]}),n.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-5",children:[n.jsx(qc,{label:"Precision",value:b.precision,description:"Of all activations, how many were correct?",detail:`${b.tp} true / ${b.tp+b.fp} total activations`}),n.jsx(qc,{label:"Recall",value:b.recall,description:"Of expected activations, how many fired?",detail:`${b.tp} activated / ${b.tp+b.fn} expected`}),n.jsx(qc,{label:"Reliability",value:b.reliability,description:"Overall correct classification rate",detail:`${b.tp+b.tn} correct / ${b.total} total`})]}),n.jsxs("div",{className:"pt-4",style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-3 text-center",style:{color:"var(--text-tertiary)"},children:"Confusion Matrix"}),n.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-xs mx-auto",children:[n.jsx(xr,{label:"True Positive",abbr:"TP",count:b.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),n.jsx(xr,{label:"False Positive",abbr:"FP",count:b.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),n.jsx(xr,{label:"False Negative",abbr:"FN",count:b.fn,bg:"rgba(248,113,113,0.06)",color:"rgba(248,113,113,0.6)",description:"Missed activation"}),n.jsx(xr,{label:"True Negative",abbr:"TN",count:b.tn,bg:"rgba(52,211,153,0.06)",color:"rgba(52,211,153,0.6)",description:"Correctly silent"})]})]})]}),y&&x.length===0&&n.jsxs("div",{className:"text-center py-16 animate-fade-in",children:[n.jsx("div",{className:"spinner-lg mx-auto mb-4"}),n.jsx("p",{className:"text-[14px]",style:{color:"var(--text-secondary)"},children:"Testing activation against skill description..."})]})]})}function ym({result:i}){const o=vm[i.classification]||vm.FN,d=i.classification==="TP"||i.classification==="TN";return n.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl transition-all duration-200",style:{background:o.bg,border:"1px solid transparent"},children:[n.jsx("div",{className:"flex-shrink-0 mt-0.5",children:n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:`color-mix(in srgb, ${o.text} 20%, transparent)`},children:d?n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:o.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:o.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"flex items-center gap-2 mb-1",children:n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:i.prompt})}),n.jsxs("div",{className:"flex items-center gap-3 text-[12px]",children:[n.jsx("span",{className:"pill",style:{background:"rgba(0,0,0,0.1)",color:o.text,fontWeight:700,fontSize:"10px",padding:"1px 6px"},children:i.classification}),n.jsx("span",{style:{color:i.activate?"var(--green)":"var(--text-tertiary)"},children:i.activate?"Activated":"Silent"}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:["Expected: ",i.expected==="should_activate"?"activate":"stay silent"]}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:[i.confidence," confidence"]}),i.autoClassified&&n.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"})]}),i.reasoning&&n.jsx("div",{className:"text-[11px] mt-1.5",style:{color:"var(--text-tertiary)"},children:i.reasoning})]})]})}function qc({label:i,value:o,description:d,detail:u}){const p=Math.round(o*100),h=p>=80?"var(--green)":p>=60?"var(--yellow)":"var(--red)";return n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-[28px] font-bold tracking-tight",style:{color:h},children:[p,"%"]}),n.jsx("div",{className:"text-[12px] font-medium mt-0.5",style:{color:"var(--text-secondary)"},children:i}),n.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--text-tertiary)"},children:d}),n.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:u})]})}function xr({abbr:i,count:o,bg:d,color:u,description:p}){return n.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:d},children:[n.jsx("div",{className:"text-[20px] font-bold",style:{color:u},children:o}),n.jsx("div",{className:"text-[11px] font-semibold",style:{color:u},children:i}),n.jsx("div",{className:"text-[9px] mt-0.5",style:{color:"var(--text-tertiary)"},children:p})]})}const Gc={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},gm={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},Jc=600,$c=180,ut=40,Yc=Jc-ut*2,Kl=$c-ut*2,cv=[25,50,75,100];function bm(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function ov({entries:i}){const[o,d]=v.useState(null);if(i.length<2)return null;const u=i.length,p=i.map((b,y)=>{const m=ut+y/(u-1)*Yc,T=b.passRate*100,g=ut+Kl-T/100*Kl;return{x:m,y:g,pct:T,entry:b}}),h=p.map(b=>`${b.x},${b.y}`).join(" "),x=Array.from(new Set(i.map(b=>b.type)));return n.jsxs("div",{className:"glass-card p-5 animate-fade-in",style:{position:"relative"},children:[n.jsx("div",{className:"text-[13px] font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Pass Rate Trend"}),n.jsx("div",{className:"flex items-center gap-5 mb-3",children:x.map(b=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:Gc[b]??"var(--text-tertiary)"}}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:gm[b]??b})]},b))}),n.jsxs("svg",{width:Jc,height:$c,viewBox:`0 0 ${Jc} ${$c}`,style:{display:"block",overflow:"visible"},children:[cv.map(b=>{const y=ut+Kl-b/100*Kl;return n.jsxs("g",{children:[n.jsx("line",{x1:ut,y1:y,x2:ut+Yc,y2:y,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),n.jsxs("text",{x:ut-8,y:y+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[b,"%"]})]},b)}),n.jsx("line",{x1:ut,y1:ut+Kl,x2:ut+Yc,y2:ut+Kl,stroke:"var(--border-subtle)",strokeWidth:1}),n.jsx("text",{x:ut-8,y:ut+Kl+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:"0%"}),n.jsx("polyline",{points:h,fill:"none",stroke:"var(--border-subtle)",strokeWidth:1.5,strokeLinejoin:"round"}),p.map((b,y)=>n.jsx("circle",{cx:b.x,cy:b.y,r:5,fill:Gc[b.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:m=>{m.currentTarget.setAttribute("r","7"),d({x:b.x,y:b.y,entry:b.entry})},onMouseLeave:m=>{m.currentTarget.setAttribute("r","5"),d(null)}},y)),uv(u).map(b=>n.jsx("text",{x:p[b].x,y:ut+Kl+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:bm(i[b].timestamp)},b))]}),o&&n.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:[n.jsx("div",{className:"text-[11px] font-medium",style:{color:"var(--text-primary)"},children:bm(o.entry.timestamp)}),n.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-tertiary)"},children:o.entry.model}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:Gc[o.entry.type]??"var(--text-tertiary)",color:"#fff"},children:gm[o.entry.type]??o.entry.type}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:[Math.round(o.entry.passRate*100),"%"]})]})]})]})}function uv(i){return i<=3?Array.from({length:i},(o,d)=>d):i<=6?[0,Math.floor(i/2),i-1]:[0,Math.floor(i/3),Math.floor(2*i/3),i-1]}function pr(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function dv(i){return i>=1e3?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`}function fv({rate:i,label:o}){const d=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-primary)",maxWidth:"70%"},children:o}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:pr(i)},children:[d,"%"]})]}),n.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${d}%`,background:pr(i)}})})]})})}function mv({points:i}){if(i.length<2)return null;const o=200,d=48,u=4,p=i.length,h=i.map((y,m)=>{const T=u+m/(p-1)*(o-u*2),g=u+(d-u*2)-y.passRate*(d-u*2);return{x:T,y:g}}),x=`M ${h[0].x},${d-u} `+h.map(y=>`L ${y.x},${y.y}`).join(" ")+` L ${h[h.length-1].x},${d-u} Z`,b=h.map((y,m)=>`${m===0?"M":"L"} ${y.x},${y.y}`).join(" ");return n.jsxs("svg",{width:o,height:d,style:{display:"block"},children:[n.jsx("path",{d:x,fill:"var(--accent-muted)"}),n.jsx("path",{d:b,fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),n.jsx("circle",{cx:h[h.length-1].x,cy:h[h.length-1].y,r:3,fill:"var(--accent)"})]})}function xv({plugin:i,skill:o}){const[d,u]=v.useState(null),[p,h]=v.useState(!0);if(v.useEffect(()=>{h(!0),Re.getStats(i,o).then(u).catch(()=>u(null)).finally(()=>h(!1))},[i,o]),p)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"skeleton h-24 rounded-xl"}),n.jsx("div",{className:"skeleton h-48 rounded-xl"}),n.jsx("div",{className:"skeleton h-36 rounded-xl"})]});if(!d||d.totalRuns===0)return n.jsxs("div",{className:"text-center py-12",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mx-auto mb-3",style:{background:"var(--surface-2)"},children:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",children:[n.jsx("path",{d:"M18 20V10"}),n.jsx("path",{d:"M12 20V4"}),n.jsx("path",{d:"M6 20v-6"})]})}),n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark data yet"}),n.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"Run some benchmarks to see statistics"})]});const x=d.trendPoints.length>0?d.trendPoints[d.trendPoints.length-1].passRate:0,b=d.trendPoints.length>0?d.trendPoints[0].passRate:0,y=x-b,m=d.assertionStats.slice(0,10);return n.jsxs("div",{className:"space-y-4 stagger-children",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Total Runs"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:d.totalRuns})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Latest Pass Rate"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:pr(x)},children:[Math.round(x*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Trend"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:y>=0?"var(--green)":"var(--red)"},children:[y>=0?"+":"",Math.round(y*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Models Tested"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:d.modelStats.length})]})]}),d.trendPoints.length>=2&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Pass Rate Over Time"}),n.jsx(mv,{points:d.trendPoints})]}),d.modelStats.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Model Performance"}),n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[n.jsx("thead",{children:n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("th",{style:{textAlign:"left",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Model"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Runs"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Pass Rate"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Duration"})]})}),n.jsx("tbody",{children:d.modelStats.map(T=>n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:T.model}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:T.runs}),n.jsx("td",{style:{padding:"8px",textAlign:"center"},children:n.jsxs("span",{className:"font-semibold",style:{color:pr(T.avgPassRate)},children:[Math.round(T.avgPassRate*100),"%"]})}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:dv(T.avgDurationMs)})]},T.model))})]})]}),m.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Weakest Assertions"}),n.jsx("div",{className:"space-y-3",children:m.map(T=>n.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:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.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:["#",T.evalId]}),n.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:T.evalName}),n.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[T.totalRuns," runs"]})]}),n.jsx(fv,{rate:T.passRate,label:T.text})]},`${T.evalId}:${T.id}`))})]})]})}function pv({plugin:i,skill:o}){const[d,u]=v.useState(null),[p,h]=v.useState(null),[x,b]=v.useState({}),[y,m]=v.useState({});v.useEffect(()=>{Re.getEvals(i,o).then(u).catch(()=>u(null))},[i,o]);async function T(g){if(p===g){h(null);return}if(h(g),!x[g]){m(A=>({...A,[g]:!0}));try{const A=await Re.getCaseHistory(i,o,g);b(z=>({...z,[g]:A}))}catch{b(A=>({...A,[g]:[]}))}finally{m(A=>({...A,[g]:!1}))}}}return d?n.jsx("div",{className:"space-y-2 stagger-children",children:d.evals.map(g=>{const A=x[g.id]||[],z=p===g.id,B=y[g.id],V=A.length>0?A[0].pass_rate:null;return n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsxs("button",{onClick:()=>T(g.id),className:"w-full text-left p-4 flex items-center gap-3 transition-colors duration-150",style:{background:z?"var(--surface-2)":"transparent"},onMouseEnter:K=>{z||(K.currentTarget.style.background="var(--surface-2)")},onMouseLeave:K=>{z||(K.currentTarget.style.background="transparent")},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",strokeLinecap:"round",style:{transform:z?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease",flexShrink:0},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.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]}),n.jsx("span",{className:"text-[13px] font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:g.name}),A.length>=2&&n.jsx(Rm,{entries:A}),V!=null&&n.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:Kc(V)},children:[Math.round(V*100),"%"]}),A.length>0&&n.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[A.length," runs"]})]}),z&&n.jsx("div",{className:"border-t animate-fade-in",style:{borderColor:"var(--border-subtle)"},children:B?n.jsxs("div",{className:"p-4 flex items-center gap-2",children:[n.jsx("div",{className:"spinner",style:{width:14,height:14}}),n.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):A.length===0?n.jsx("div",{className:"p-4",children:n.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No history for this eval case"})}):n.jsx("div",{className:"divide-y",style:{borderColor:"var(--border-subtle)"},children:A.map((K,te)=>n.jsxs("div",{className:"p-4",style:{background:te===0?"var(--surface-2)":"transparent"},children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Am(K.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:K.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:K.type==="benchmark"?"rgba(99,131,255,0.15)":K.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:K.type==="benchmark"?"#6383ff":K.type==="comparison"?"var(--purple)":"#fb923c"},children:K.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:Kc(K.pass_rate)},children:[Math.round(K.pass_rate*100),"%"]})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-2 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[K.durationMs!=null&&n.jsx("span",{children:_m(K.durationMs)}),K.tokens!=null&&n.jsxs("span",{children:[K.tokens>=1e3?`${(K.tokens/1e3).toFixed(1)}k`:K.tokens," tok"]})]}),n.jsx("div",{className:"space-y-1",children:K.assertions.map(P=>n.jsxs("div",{className:"flex items-start gap-2 py-0.5",children:[n.jsx("div",{className:"w-3.5 h-3.5 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:P.pass?"var(--green)":"var(--red)"},children:n.jsx("svg",{width:"7",height:"7",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",children:P.pass?n.jsx("polyline",{points:"20 6 9 17 4 12"}):n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-primary)"},children:P.text}),P.reasoning&&n.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:P.reasoning})]})]},P.id))})]},te))})})]},g.id)})}):n.jsx("div",{className:"text-center py-12",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No eval cases found"})})}function hv(){const{state:i,dispatch:o}=Pt(),{plugin:d,skill:u}=i,[p,h]=v.useState("timeline"),[x,b]=v.useState([]),[y,m]=v.useState(!0),[T,g]=v.useState(""),[A,z]=v.useState(""),[B,V]=v.useState(!1),[K,te]=v.useState([]),[P,ie]=v.useState(null),[q,W]=v.useState(!1),[ae,F]=v.useState(null),[ne,I]=v.useState(!1);v.useEffect(()=>{m(!0),Re.getHistory(d,u,{model:T||void 0,type:A||void 0}).then(Q=>{b(Q),Q.length>=2&&Re.compareRuns(d,u,Q[0].timestamp,Q[1].timestamp).then(ue=>{const pe=ue.regressions.filter(N=>N.change==="regression");o({type:"SET_REGRESSIONS",regressions:pe})}).catch(()=>{})}).catch(()=>{}).finally(()=>m(!1))},[d,u,T,A]);const Te=v.useCallback(async Q=>{if(B){te(ue=>ue.includes(Q)?ue.filter(pe=>pe!==Q):ue.length>=2?[ue[1],Q]:[...ue,Q]);return}I(!0);try{const ue=await Re.getHistoryEntry(d,u,Q);F(ue)}catch{}finally{I(!1)}},[d,u,B]),ve=v.useCallback(async()=>{if(K.length===2){W(!0);try{const Q=await Re.compareRuns(d,u,K[0],K[1]);ie(Q)}catch{}finally{W(!1)}}},[d,u,K]),ye=[...new Set(x.map(Q=>Q.model))];return y?n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),n.jsx("div",{className:"skeleton h-48 rounded-xl mb-4"}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"skeleton h-12 rounded-lg"}),n.jsx("div",{className:"skeleton h-12 rounded-lg"})]})]}):n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"flex items-center gap-1 mb-4",children:["timeline","per-eval","statistics"].map(Q=>n.jsx("button",{onClick:()=>h(Q),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:p===Q?"var(--accent-muted)":"transparent",color:p===Q?"var(--accent)":"var(--text-tertiary)"},children:Q==="timeline"?"Timeline":Q==="per-eval"?"Per Eval":"Statistics"},Q))}),p==="timeline"&&n.jsxs("div",{children:[x.length>0&&n.jsx("div",{className:"mb-5 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:n.jsx(ov,{entries:x})}),n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("select",{value:T,onChange:Q=>g(Q.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Models"}),ye.map(Q=>n.jsx("option",{value:Q,children:Q},Q))]}),n.jsxs("select",{value:A,onChange:Q=>z(Q.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Types"}),n.jsx("option",{value:"benchmark",children:"Benchmark"}),n.jsx("option",{value:"comparison",children:"Comparison"}),n.jsx("option",{value:"baseline",children:"Baseline"}),n.jsx("option",{value:"model-compare",children:"Model Compare"}),n.jsx("option",{value:"improve",children:"AI Improve"}),n.jsx("option",{value:"instruct",children:"AI Edit"}),n.jsx("option",{value:"ai-generate",children:"AI Generate"}),n.jsx("option",{value:"eval-generate",children:"Eval Generate"})]}),n.jsx("div",{className:"flex-1"}),n.jsx("button",{onClick:()=>{V(!B),te([]),ie(null)},className:`btn text-[12px] ${B?"btn-primary":"btn-secondary"}`,children:B?"Exit Compare":"Compare Runs"}),B&&K.length===2&&n.jsx("button",{onClick:ve,disabled:q,className:"btn btn-primary text-[12px]",children:q?"Comparing...":"Compare"})]}),n.jsx("div",{className:"space-y-2",children:x.length===0?n.jsx("div",{className:"text-center py-8 text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark runs yet"}):x.map(Q=>{const ue=K.includes(Q.timestamp);return n.jsx("button",{onClick:()=>Te(Q.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:ue?"var(--accent-muted)":"var(--surface-1)",border:ue?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:pe=>{ue||(pe.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:pe=>{ue||(pe.currentTarget.style.borderColor="var(--border-subtle)")},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[B&&n.jsx("span",{className:"w-4 h-4 rounded border flex items-center justify-center",style:{borderColor:ue?"var(--accent)":"var(--border-default)",background:ue?"var(--accent)":"transparent"},children:ue&&n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:new Date(Q.timestamp).toLocaleString()}),n.jsx("span",{className:"pill text-[9px]",style:{background:Q.type==="comparison"?"var(--purple-muted)":Q.type==="baseline"?"var(--surface-3)":Q.type==="model-compare"?"rgba(56,189,248,0.15)":Q.type==="improve"||Q.type==="instruct"?"rgba(168,85,247,0.15)":Q.type==="ai-generate"?"rgba(34,197,94,0.15)":Q.type==="eval-generate"?"rgba(251,146,60,0.15)":"var(--accent-muted)",color:Q.type==="comparison"?"var(--purple)":Q.type==="baseline"?"var(--text-tertiary)":Q.type==="model-compare"?"#38bdf8":Q.type==="improve"||Q.type==="instruct"?"#a855f7":Q.type==="ai-generate"?"#22c55e":Q.type==="eval-generate"?"#fb923c":"var(--accent)"},children:Q.type==="model-compare"?"model compare":Q.type==="improve"?"ai improve":Q.type==="instruct"?"ai edit":Q.type==="ai-generate"?"ai generate":Q.type==="eval-generate"?"eval generate":Q.type})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:Q.model}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:Q.passRate>=.8?"var(--green)":Q.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(Q.passRate*100),"%"]})]})]})},Q.timestamp)})}),P&&n.jsx(vv,{result:P}),ae&&!B&&n.jsx(yv,{run:ae,onClose:()=>F(null)})]}),p==="per-eval"&&n.jsx(pv,{plugin:d,skill:u}),p==="statistics"&&n.jsx(xv,{plugin:d,skill:u})]})}function vv({result:i}){const o=i.regressions.filter(u=>u.change==="regression"),d=i.regressions.filter(u=>u.change==="improvement");return n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Comparison: ",new Date(i.runA.timestamp).toLocaleDateString()," vs ",new Date(i.runB.timestamp).toLocaleDateString()]}),o.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--red)"},children:["Regressions (",o.length,")"]}),o.map(u=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",n.jsx("span",{style:{color:"var(--red)"},children:u.assertionId})," (was passing, now failing)"]},`${u.evalId}-${u.assertionId}`))]}),d.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--green)"},children:["Improvements (",d.length,")"]}),d.map(u=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",n.jsx("span",{style:{color:"var(--green)"},children:u.assertionId})," (was failing, now passing)"]},`${u.evalId}-${u.assertionId}`))]}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 mt-3",style:{color:"var(--text-tertiary)"},children:"Case Diffs"}),n.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)"},children:n.jsxs("table",{className:"w-full text-[12px]",children:[n.jsx("thead",{children:n.jsxs("tr",{style:{background:"var(--surface-2)"},children:[n.jsx("th",{className:"text-left px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Case"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run A"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run B"})]})}),n.jsx("tbody",{children:i.caseDiffs.map(u=>n.jsxs("tr",{style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("td",{className:"px-3 py-2",style:{color:"var(--text-secondary)"},children:["#",u.eval_id," ",u.eval_name]}),n.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}),n.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 yv({run:i,onClose:o}){return(i.type==="improve"||i.type==="instruct")&&i.improve?n.jsx(gv,{run:i,onClose:o}):n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:["Run: ",new Date(i.timestamp).toLocaleString()]}),n.jsx("button",{onClick:o,className:"btn btn-ghost text-[11px]",children:"Close"})]}),n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:["Model: ",i.model," | Cases: ",i.cases.length," | Pass Rate: ",i.overall_pass_rate!=null?`${Math.round(i.overall_pass_rate*100)}%`:"--"]}),n.jsx("div",{className:"space-y-2",children:i.cases.map(d=>n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-2)"},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-[12px]",style:{color:"var(--text-secondary)"},children:["#",d.eval_id," ",d.eval_name]}),n.jsx("span",{className:"text-[11px] font-semibold",style:{color:d.status==="pass"?"var(--green)":"var(--red)"},children:d.pass_rate!=null?`${Math.round(d.pass_rate*100)}%`:d.status})]})},d.eval_id))})]})}function gv({run:i,onClose:o}){var h;const d=v.useMemo(()=>i.improve?hr(i.improve.original,i.improve.improved):[],[i.improve]),u=v.useMemo(()=>{const x=d.filter(y=>y.type==="added").length,b=d.filter(y=>y.type==="removed").length;return{added:x,removed:b}},[d]),p=v.useMemo(()=>{let x=0,b=0;return d.map(y=>y.type==="removed"?(x++,{...y,origNum:x,newNum:null}):y.type==="added"?(b++,{...y,origNum:null,newNum:b}):(x++,b++,{...y,origNum:x,newNum:b}))},[d]);return n.jsxs("div",{className:"mt-4 rounded-xl overflow-hidden animate-fade-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.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:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"}),n.jsxs("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[new Date(i.timestamp).toLocaleString()," · ",i.model]})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsxs("span",{style:{color:"var(--green)"},children:["+",u.added]}),n.jsxs("span",{style:{color:"var(--red)"},children:["-",u.removed]})]}),n.jsx("button",{onClick:o,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:x=>{x.currentTarget.style.background="var(--surface-3)"},onMouseLeave:x=>{x.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),((h=i.improve)==null?void 0:h.reasoning)&&n.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:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),i.improve.reasoning]}),n.jsx("div",{className:"mx-4 my-4 rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)",maxHeight:480,overflowY:"auto"},children:n.jsx("table",{className:"w-full",style:{borderCollapse:"collapse",fontFamily:"var(--font-mono, monospace)"},children:n.jsx("tbody",{children:p.map((x,b)=>n.jsxs("tr",{style:{background:x.type==="added"?"rgba(34,197,94,0.08)":x.type==="removed"?"rgba(239,68,68,0.08)":"transparent"},children:[n.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:x.type==="removed"?"rgba(239,68,68,0.5)":"var(--text-tertiary)",opacity:x.origNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:x.origNum??""}),n.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:x.type==="added"?"rgba(34,197,94,0.5)":"var(--text-tertiary)",opacity:x.newNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:x.newNum??""}),n.jsx("td",{className:"select-none text-center",style:{width:20,fontSize:11,fontWeight:700,color:x.type==="added"?"var(--green)":x.type==="removed"?"var(--red)":"transparent",borderRight:x.type==="added"?"2px solid var(--green)":x.type==="removed"?"2px solid var(--red)":"2px solid transparent"},children:x.type==="added"?"+":x.type==="removed"?"-":" "}),n.jsx("td",{className:"px-3 py-px whitespace-pre-wrap",style:{fontSize:11,lineHeight:1.6,color:x.type==="added"?"var(--green)":x.type==="removed"?"var(--red)":"var(--text-secondary)"},children:x.content||"​"})]},b))})})})]})}function bv({plugin:i,skill:o}){const[d,u]=v.useState([]),[p,h]=v.useState([]),[x,b]=v.useState(!0),[y,m]=v.useState(null);v.useEffect(()=>{Re.getDependencies(i,o).then(g=>{u(g.mcpDependencies),h(g.skillDependencies)}).catch(()=>{}).finally(()=>b(!1))},[i,o]);async function T(g,A){try{await navigator.clipboard.writeText(A),m(g),setTimeout(()=>m(null),2e3)}catch{}}return x?null:d.length===0&&p.length===0?n.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"}):n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.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:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(234,179,8,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#eab308",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.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"}),n.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"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Dependencies"}),n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:d.length+p.length})]}),n.jsxs("div",{className:"px-5 py-4",children:[d.length>0&&n.jsxs("div",{className:"space-y-3 mb-4",children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"MCP Servers"}),d.map(g=>n.jsxs("div",{className:"p-3 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:g.server}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:g.transport})]}),n.jsx("button",{onClick:()=>T(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?n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Copied!"]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),n.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"]})})]}),n.jsx("div",{className:"text-[11px] mb-2 font-mono",style:{color:"var(--text-tertiary)"},children:g.url}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.matchedTools.map(A=>n.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:A},A))})]},g.server))]}),p.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--text-tertiary)"},children:"Skill Dependencies"}),n.jsx("div",{className:"space-y-1.5",children:p.map(g=>n.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:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.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"})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:g.name}),n.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 jv(){const{state:i}=Pt(),{plugin:o,skill:d}=i,[u,p]=v.useState(null),[h,x]=v.useState(!0);return v.useEffect(()=>{Re.getDependencies(o,d).then(p).catch(()=>{}).finally(()=>x(!1))},[o,d]),h?n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),n.jsx("div",{className:"skeleton h-32 rounded-xl"})]}):u?n.jsx("div",{className:"p-5 max-w-3xl",children:n.jsx(bv,{plugin:o,skill:d})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"No dependency information available"})}const Sv=["editor","tests","run","activation","history","deps"];function Nv(i){return i!=null&&Sv.includes(i)}function Ev(){const{state:i,dispatch:o,saveContent:d,isReadOnly:u}=Pt();v.useEffect(()=>{const b=new URLSearchParams(window.location.search).get("panel");Nv(b)&&b!==i.activePanel&&o({type:"SET_PANEL",panel:b})},[]),v.useEffect(()=>{const x=new URLSearchParams(window.location.search);x.set("panel",i.activePanel);const b=`${window.location.pathname}?${x.toString()}${window.location.hash}`;history.replaceState(null,"",b)},[i.activePanel]);const p=v.useCallback(x=>{const b=x.ctrlKey||x.metaKey;if(b&&x.key>="1"&&x.key<="6"){x.preventDefault(),o({type:"SET_PANEL",panel:["editor","tests","run","activation","history","deps"][parseInt(x.key)-1]});return}if(b&&x.key==="s"&&!x.shiftKey){x.preventDefault(),i.isDirty&&d();return}},[i.isDirty,d,o]);if(v.useEffect(()=>(window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)),[p]),i.loading)return n.jsx("div",{className:"flex items-center justify-center h-full",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"flex flex-col items-center gap-3",children:[n.jsx("div",{className:"spinner spinner-lg"}),n.jsx("span",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"Loading workspace..."})]})});const h=Array.from(i.caseRunStates.values()).some(x=>x.status==="running"||x.status==="queued");return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsx(Ch,{state:i,isReadOnly:u}),n.jsx(Rh,{activePanel:i.activePanel,onPanelChange:x=>o({type:"SET_PANEL",panel:x}),isDirty:i.isDirty,isRunning:h,hasRegressions:i.regressions.length>0,isActivationRunning:i.activationRunning}),n.jsx("div",{className:"flex-1 overflow-hidden",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"animate-fade-in",style:{height:"100%",overflow:"auto"},children:[i.activePanel==="editor"&&n.jsx(Zh,{}),i.activePanel==="tests"&&n.jsx($h,{}),i.activePanel==="run"&&n.jsx(lv,{}),i.activePanel==="activation"&&n.jsx(iv,{}),i.activePanel==="history"&&n.jsx(hv,{}),i.activePanel==="deps"&&n.jsx(jv,{})]},i.activePanel)})]})}function Vc(i,o=!0){let d=i.toLowerCase().replace(/[^a-z0-9]+/g,"-");return o&&(d=d.replace(/^-+|-+$/g,"")),d}function Tv(i,o,d,u){const h=`.../${i.split("/").slice(-2).join("/")}`;switch(o){case 1:return`${h}/${d}/skills/${u}/SKILL.md`;case 2:return`${h}/plugins/${d}/skills/${u}/SKILL.md`;case 3:return`${h}/skills/${u}/SKILL.md`}}const Jl={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Wn({size:i=14,color:o="currentColor"}){return n.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.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 Cv({onCreated:i,onCancel:o}){const[d,u]=v.useState("manual"),[p,h]=v.useState(null),[x,b]=v.useState(!0),{config:y}=tn(),[m,T]=v.useState(""),[g,A]=v.useState(3),[z,B]=v.useState(""),[V,K]=v.useState(""),[te,P]=v.useState(""),[ie,q]=v.useState(""),[W,ae]=v.useState(""),[F,ne]=v.useState(""),[I,Te]=v.useState(null),[ve,ye]=v.useState("write"),[Q,ue]=v.useState(!1),[pe,N]=v.useState(null),[k,J]=v.useState(""),[re,me]=v.useState(!1),[S,D]=v.useState(null),[Z,w]=v.useState(null),[G,Y]=v.useState(null),[$,de]=v.useState([]),ge=v.useRef(null),ct=v.useRef(null);v.useEffect(()=>{Re.getProjectLayout().then(X=>{h(X),A(X.suggestedLayout);const Ce=X.detectedLayouts.find(el=>el.layout===X.suggestedLayout);Ce!=null&&Ce.existingPlugins.length&&B(Ce.existingPlugins[0])}).catch(()=>{}).finally(()=>b(!1))},[]),v.useEffect(()=>{var X;d==="ai"&&((X=ge.current)==null||X.focus())},[d]),v.useEffect(()=>()=>{var X;(X=ct.current)==null||X.abort()},[]);const bl=v.useMemo(()=>{var X;return p?((X=p.detectedLayouts.find(Ce=>Ce.layout===g))==null?void 0:X.existingPlugins)||[]:[]},[p,g]),St=z==="__new__"?V:z,pa=p?Tv(p.root,g,St||"{plugin}",m||"{skill}"):"",Mt=v.useMemo(()=>p?p.detectedLayouts.filter(X=>X.layout!==4):[],[p]),ee=v.useCallback(()=>{if(!y)return{provider:"claude-cli",model:"sonnet"};const X=y.provider||"claude-cli";let Ce=y.model||"sonnet";return X==="claude-cli"&&Ce.startsWith("claude-")&&(Ce=Ce.replace("claude-","")),{provider:X,model:Ce}},[y]),Ie=v.useCallback(()=>{var X;(X=ct.current)==null||X.abort(),me(!1)},[]);async function dt(){var ha;if(w(null),Y(null),D(null),de([]),!k.trim()){w("Describe what your skill should do");return}me(!0);const X=new AbortController;ct.current=X;const{provider:Ce,model:el}=ee();try{const ft=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:k.trim(),provider:Ce,model:el}),signal:X.signal});if(!ft.ok||!ft.body){let mt=`HTTP ${ft.status}`;try{const Ze=await ft.json();Ze.error&&(mt=Ze.error)}catch{}throw new Error(mt)}const qe=ft.body.getReader(),jl=new TextDecoder;let Xt="",zt="";for(;;){const{done:mt,value:Ze}=await qe.read();if(mt)break;Xt+=jl.decode(Ze,{stream:!0});const xt=Xt.split(`
70
+ `);Xt=xt.pop()||"";for(const tl of xt)if(tl.startsWith("event: "))zt=tl.slice(7).trim();else if(tl.startsWith("data: ")){try{const rt=JSON.parse(tl.slice(6));zt==="progress"?de($l=>[...$l,{phase:rt.phase,message:rt.message,timestamp:Date.now()}]):zt==="done"||zt==="complete"?(T(rt.name),P(rt.description),q(rt.model||""),ae(rt.allowedTools||""),ne(rt.body),Te((ha=rt.evals)!=null&&ha.length?rt.evals:null),D(rt.reasoning),u("manual")):zt==="error"&&(w(rt.message||rt.description||"Unknown error"),rt.category&&Y(rt))}catch{}zt=""}}}catch(ft){ft.name!=="AbortError"&&w(ft.message)}finally{me(!1),ct.current=null}}async function Qt(){if(N(null),!m.trim()){N("Skill name is required");return}if(!te.trim()){N("Description is required");return}if(g!==3&&!St.trim()){N("Plugin name is required");return}ue(!0);try{const X=await Re.createSkill({name:Vc(m),plugin:St||"",layout:g,description:te,model:ie||void 0,allowedTools:W||void 0,body:F,evals:I||void 0});i(X.plugin,X.skill)}catch(X){N(X.message)}finally{ue(!1)}}return n.jsxs("div",{className:"px-8 py-6 max-w-4xl animate-fade-in overflow-auto h-full",children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("h2",{className:"text-[20px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),n.jsx("div",{className:"flex items-center justify-between mt-2",children:n.jsxs("div",{className:"inline-flex rounded-lg p-0.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("button",{onClick:()=>u("manual"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:d==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:d==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:d==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none",cursor:"pointer",border:"none"},children:"Manual"}),n.jsx("button",{onClick:()=>u("ai"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:d==="ai"?"rgba(168,85,247,0.15)":"transparent",color:d==="ai"?"#a855f7":"var(--text-tertiary)",boxShadow:d==="ai"?"0 1px 3px rgba(168,85,247,0.15)":"none",cursor:"pointer",border:"none"},children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Wn,{size:12}),"AI-Assisted"]})})]})})]}),x&&n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),n.jsx("div",{className:"skeleton h-10 w-full rounded-lg"})]}),!x&&p&&d==="ai"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsx(Wn,{size:11,color:"#a855f7"})}),"Describe Your Skill"]}),n.jsx("textarea",{ref:ge,value:k,onChange:X=>J(X.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
71
+
72
+ Include any specific behaviors, constraints, or output formats you want.`,rows:5,disabled:re,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...Jl,minHeight:"120px"},onKeyDown:X=>{X.key==="Enter"&&(X.metaKey||X.ctrlKey)&&(X.preventDefault(),dt())}}),n.jsxs("p",{className:"text-[11px] mt-2",style:{color:"var(--text-tertiary)"},children:["Describe what the skill should do. The AI will generate the name, description, system prompt, and test cases.",n.jsx("span",{className:"ml-1",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]})]}),re&&$.length>0&&n.jsx(Fn,{entries:$,isRunning:!0}),Z&&n.jsx("div",{children:G?n.jsx(vr,{error:G,onRetry:dt,onDismiss:()=>{w(null),Y(null)}}):n.jsxs("div",{children:[n.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:Z}),n.jsx("button",{onClick:dt,className:"mt-2 text-[12px] font-medium",style:{color:"#a855f7",background:"none",border:"none",cursor:"pointer"},children:"Retry"})]})}),n.jsxs("div",{className:"flex items-center gap-3",children:[re?n.jsx("button",{onClick:Ie,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"}):n.jsxs("button",{onClick:dt,disabled:!k.trim(),className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:k.trim()?"#a855f7":"var(--surface-3)",color:k.trim()?"#fff":"var(--text-tertiary)",cursor:k.trim()?"pointer":"not-allowed",border:"none"},children:[n.jsx(Wn,{size:14}),"Generate"]}),n.jsx("button",{onClick:o,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"}),!re&&n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["or fill in the form manually",n.jsx("button",{onClick:()=>u("manual"),className:"ml-1 font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"below"})]})]})]}),!x&&p&&d==="manual"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[S&&n.jsx("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-start gap-2.5",children:[n.jsx("div",{className:"w-5 h-5 rounded flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:"rgba(168,85,247,0.15)"},children:n.jsx(Wn,{size:11,color:"#a855f7"})}),n.jsxs("div",{children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Generated"}),n.jsx("span",{className:"mx-1.5",style:{color:"var(--text-tertiary)"},children:"—"}),n.jsx("span",{children:S}),I&&I.length>0&&n.jsxs("span",{className:"ml-2 px-1.5 py-0.5 rounded text-[10px] font-medium",style:{background:"rgba(168,85,247,0.12)",color:"#a855f7"},children:["+",I.length," test cases"]})]})]}),n.jsx("button",{onClick:()=>{D(null),Te(null)},className:"flex-shrink-0 w-5 h-5 rounded flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},onMouseEnter:X=>{X.currentTarget.style.background="var(--surface-3)"},onMouseLeave:X=>{X.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Location"}),Mt.length>1&&n.jsxs("div",{className:"mb-3",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Layout"}),n.jsx("div",{className:"flex gap-2",children:Mt.map(X=>n.jsx("button",{onClick:()=>{A(X.layout),B(X.existingPlugins[0]||""),K("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:g===X.layout?"var(--accent)":"var(--surface-3)",color:g===X.layout?"#fff":"var(--text-secondary)",border:`1px solid ${g===X.layout?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},children:X.label},X.layout))})]}),g!==3&&n.jsxs("div",{className:"mb-3",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Plugin"}),n.jsxs("select",{value:z,onChange:X=>{B(X.target.value),K("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Jl,children:[bl.map(X=>n.jsx("option",{value:X,children:X},X)),n.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),z==="__new__"&&n.jsx("input",{type:"text",value:V,onChange:X=>K(Vc(X.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:Jl})]}),n.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:pa})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Skill Details"}),n.jsxs("div",{className:"mb-3",children:[n.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Name ",n.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),n.jsx("input",{type:"text",value:m,onChange:X=>T(Vc(X.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Jl})]}),n.jsxs("div",{className:"mb-3",children:[n.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Description ",n.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),n.jsx("textarea",{value:te,onChange:X=>P(X.target.value),placeholder:"Brief description",rows:3,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-y",style:{...Jl,minHeight:"72px"}})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsxs("select",{value:ie,onChange:X=>q(X.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Jl,children:[n.jsx("option",{value:"",children:"Any"}),n.jsx("option",{value:"opus",children:"Opus"}),n.jsx("option",{value:"sonnet",children:"Sonnet"}),n.jsx("option",{value:"haiku",children:"Haiku"})]})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Allowed Tools"}),n.jsx("input",{type:"text",value:W,onChange:X=>ae(X.target.value),placeholder:"Read, Write, Edit...",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Jl})]})]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--accent-muted)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"}),n.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),n.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md"}),n.jsx("span",{className:"text-[11px] ml-2",style:{color:"var(--text-tertiary)"},children:"Skill Definition"})]})]}),n.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:["write","preview"].map(X=>n.jsxs("button",{onClick:()=>ye(X),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:ve===X?"var(--surface-4)":"transparent",color:ve===X?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:ve===X?600:400,border:"none",cursor:"pointer"},children:[X==="write"?n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 18 22 12 16 6"}),n.jsx("polyline",{points:"8 6 2 12 8 18"})]}):n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),n.jsx("span",{children:X==="write"?"Write":"Preview"})]},X))})]}),ve==="write"?n.jsx("textarea",{value:F,onChange:X=>ne(X.target.value),placeholder:`# /my-skill
73
+
74
+ You are an expert at...
75
+ `,rows:8,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...Jl,minHeight:"150px"}}):n.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:F.trim()?{__html:Fc(F)}:void 0,children:!F.trim()&&n.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),I&&I.length>0&&n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx(Wn,{size:13,color:"#a855f7"}),"Generated Test Cases",n.jsxs("span",{className:"text-[11px] font-normal",style:{color:"var(--text-tertiary)"},children:["(",I.length," evals will be saved with the skill)"]})]}),n.jsx("div",{className:"space-y-2",children:I.map(X=>n.jsxs("div",{className:"px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--surface-0)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"font-medium mb-1",style:{color:"var(--text-primary)"},children:X.name}),n.jsxs("div",{className:"text-[11px] mb-1",style:{color:"var(--text-tertiary)"},children:["Prompt: ",X.prompt.length>120?X.prompt.slice(0,120)+"...":X.prompt]}),n.jsx("div",{className:"flex flex-wrap gap-1",children:X.assertions.map(Ce=>n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"rgba(168,85,247,0.1)",color:"#a855f7"},children:Ce.text.length>50?Ce.text.slice(0,50)+"...":Ce.text},Ce.id))})]},X.id))})]}),pe&&n.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:pe}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:Qt,disabled:Q||!m||!te,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:Q||!m||!te?"var(--surface-3)":"var(--accent)",color:Q||!m||!te?"var(--text-tertiary)":"#fff",cursor:Q||!m||!te?"not-allowed":"pointer",border:"none"},children:Q?"Creating...":"Create Skill"}),n.jsx("button",{onClick:o,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 kv(){return n.jsx("div",{className:"w-16 h-16 rounded-2xl flex items-center justify-center",style:{background:"var(--surface-2)"},children:n.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:[n.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"}),n.jsx("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),n.jsx("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]})})}function Qc({variant:i,message:o,onRetry:d}){const{setMode:u,setSearch:p}=xa(),[h,x]=v.useState(!1);return i==="no-selection"?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:[n.jsx("div",{className:"mb-5",children:h?n.jsx(kv,{}):n.jsx("img",{src:"/images/empty-studio.webp",width:128,height:128,alt:"",onError:()=>x(!0),style:{objectFit:"contain"}})}),n.jsx("p",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-secondary)"},children:"Select a skill to view details"}),n.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Choose a skill from the list to edit, test, and evaluate"})]}):i==="no-skills"?n.jsxs("div",{className:"text-center py-12 px-4 animate-fade-in-scale",children:[n.jsx("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mx-auto mb-4",style:{background:"var(--surface-2)"},children:n.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:n.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"})})}),n.jsx("p",{className:"text-[14px] font-medium",style:{color:"var(--text-secondary)"},children:"No skills found"}),n.jsxs("p",{className:"text-[12px] mt-1 mb-4",style:{color:"var(--text-tertiary)"},children:["Check your ",n.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"]}),n.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:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Create Your First Skill"]})]}):i==="error"?n.jsx("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:n.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:[n.jsx("p",{className:"text-[13px] mb-3",style:{color:"var(--red)"},children:o||"Failed to load skill data"}),d&&n.jsx("button",{onClick:d,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"})]})}):n.jsxs("div",{className:"px-4 py-8 text-center animate-fade-in",children:[n.jsx("p",{className:"text-[13px] mb-2",style:{color:"var(--text-tertiary)"},children:"No skills match your search"}),n.jsx("button",{onClick:()=>p(""),className:"text-[12px] font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear search"})]})}function jm(){const{state:i,setMobileView:o}=xa();return i.isMobile?n.jsxs("button",{onClick:()=>o("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:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"15 18 9 12 15 6"})}),"Back to skills"]}):null}function Av(){const{state:i,selectSkill:o,setMode:d,refreshSkills:u}=xa();if(i.mode==="create")return n.jsxs("div",{className:"h-full overflow-auto animate-fade-in",children:[n.jsx(jm,{}),n.jsx(Cv,{onCreated:(b,y)=>{d("browse"),u(),o({plugin:b,skill:y,origin:"source"})},onCancel:()=>d("browse")})]});if(!i.selectedSkill)return i.skillsError?n.jsx(Qc,{variant:"error",message:i.skillsError,onRetry:u}):!i.skillsLoading&&i.skills.length===0?n.jsx(Qc,{variant:"no-skills"}):n.jsx(Qc,{variant:"no-selection"});const{plugin:p,skill:h,origin:x}=i.selectedSkill;return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx(jm,{}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Th,{plugin:p,skill:h,origin:x,children:n.jsx(Ev,{})},`${p}/${h}`)})]})}function _v(){return n.jsx(uh,{children:n.jsx(ih,{children:n.jsx(dh,{left:n.jsx(yh,{}),right:n.jsx(Av,{})})})})}ah.createRoot(document.getElementById("root")).render(n.jsx(v.StrictMode,{children:n.jsx(_v,{})}));