vskill 0.5.11 → 0.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/eval/credentials.d.ts +12 -0
- package/dist/commands/eval/credentials.js +140 -0
- package/dist/commands/eval/credentials.js.map +1 -0
- package/dist/commands/eval/generate-all.d.ts +1 -1
- package/dist/commands/eval/generate-all.js +57 -12
- package/dist/commands/eval/generate-all.js.map +1 -1
- package/dist/commands/eval/init.d.ts +2 -1
- package/dist/commands/eval/init.js +76 -10
- package/dist/commands/eval/init.js.map +1 -1
- package/dist/commands/eval/run.d.ts +7 -1
- package/dist/commands/eval/run.js +207 -26
- package/dist/commands/eval/run.js.map +1 -1
- package/dist/commands/eval/sweep.d.ts +7 -0
- package/dist/commands/eval/sweep.js +99 -0
- package/dist/commands/eval/sweep.js.map +1 -0
- package/dist/commands/eval.d.ts +10 -0
- package/dist/commands/eval.js +62 -4
- package/dist/commands/eval.js.map +1 -1
- package/dist/eval/batch-judge.d.ts +27 -0
- package/dist/eval/batch-judge.js +242 -0
- package/dist/eval/batch-judge.js.map +1 -0
- package/dist/eval/chrome-profile.d.ts +16 -0
- package/dist/eval/chrome-profile.js +65 -0
- package/dist/eval/chrome-profile.js.map +1 -0
- package/dist/eval/comparator.d.ts +3 -1
- package/dist/eval/comparator.js +19 -3
- package/dist/eval/comparator.js.map +1 -1
- package/dist/eval/concurrency.d.ts +13 -0
- package/dist/eval/concurrency.js +53 -0
- package/dist/eval/concurrency.js.map +1 -0
- package/dist/eval/credential-resolver.d.ts +31 -0
- package/dist/eval/credential-resolver.js +111 -0
- package/dist/eval/credential-resolver.js.map +1 -0
- package/dist/eval/integration-runner.d.ts +12 -0
- package/dist/eval/integration-runner.js +303 -0
- package/dist/eval/integration-runner.js.map +1 -0
- package/dist/eval/integration-types.d.ts +65 -0
- package/dist/eval/integration-types.js +18 -0
- package/dist/eval/integration-types.js.map +1 -0
- package/dist/eval/judge-cache.d.ts +29 -0
- package/dist/eval/judge-cache.js +109 -0
- package/dist/eval/judge-cache.js.map +1 -0
- package/dist/eval/judge.d.ts +1 -1
- package/dist/eval/judge.js +20 -3
- package/dist/eval/judge.js.map +1 -1
- package/dist/eval/llm.d.ts +2 -1
- package/dist/eval/llm.js +54 -2
- package/dist/eval/llm.js.map +1 -1
- package/dist/eval/prompt-builder.d.ts +10 -0
- package/dist/eval/prompt-builder.js +167 -0
- package/dist/eval/prompt-builder.js.map +1 -1
- package/dist/eval/rate-limiter.d.ts +20 -0
- package/dist/eval/rate-limiter.js +62 -0
- package/dist/eval/rate-limiter.js.map +1 -0
- package/dist/eval/schema.d.ts +16 -0
- package/dist/eval/schema.js +58 -6
- package/dist/eval/schema.js.map +1 -1
- package/dist/eval/verdict.d.ts +9 -0
- package/dist/eval/verdict.js +50 -0
- package/dist/eval/verdict.js.map +1 -1
- package/dist/eval-server/api-routes.js +99 -3
- package/dist/eval-server/api-routes.js.map +1 -1
- package/dist/eval-server/benchmark-runner.d.ts +7 -0
- package/dist/eval-server/benchmark-runner.js +158 -42
- package/dist/eval-server/benchmark-runner.js.map +1 -1
- package/dist/eval-server/concurrency.d.ts +1 -13
- package/dist/eval-server/concurrency.js +3 -49
- package/dist/eval-server/concurrency.js.map +1 -1
- package/dist/eval-server/eval-server.js +4 -0
- package/dist/eval-server/eval-server.js.map +1 -1
- package/dist/eval-server/integration-routes.d.ts +2 -0
- package/dist/eval-server/integration-routes.js +100 -0
- package/dist/eval-server/integration-routes.js.map +1 -0
- package/dist/eval-server/skill-create-routes.js +151 -22
- package/dist/eval-server/skill-create-routes.js.map +1 -1
- package/dist/eval-server/sweep-routes.d.ts +2 -0
- package/dist/eval-server/sweep-routes.js +93 -0
- package/dist/eval-server/sweep-routes.js.map +1 -0
- package/dist/eval-server/sweep-runner.d.ts +93 -0
- package/dist/eval-server/sweep-runner.js +275 -0
- package/dist/eval-server/sweep-runner.js.map +1 -0
- package/dist/eval-ui/assets/index-C9_Pey9T.css +1 -0
- package/dist/eval-ui/assets/index-KfkLPyh3.js +74 -0
- package/dist/eval-ui/index.html +2 -2
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/eval-ui/assets/index-CxHCKEhf.js +0 -74
- package/dist/eval-ui/assets/index-D2UkOol1.css +0 -1
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))d(m);new MutationObserver(m=>{for(const h of m)if(h.type==="childList")for(const p of h.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&d(p)}).observe(document,{childList:!0,subtree:!0});function c(m){const h={};return m.integrity&&(h.integrity=m.integrity),m.referrerPolicy&&(h.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?h.credentials="include":m.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function d(m){if(m.ep)return;m.ep=!0;const h=c(m);fetch(m.href,h)}})();var Oc={exports:{}},Fn={};/**
|
|
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 ax;function rh(){if(ax)return Fn;ax=1;var i=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function c(d,m,h){var p=null;if(h!==void 0&&(p=""+h),m.key!==void 0&&(p=""+m.key),"key"in m){h={};for(var b in m)b!=="key"&&(h[b]=m[b])}else h=m;return m=h.ref,{$$typeof:i,type:d,key:p,ref:m!==void 0?m:null,props:h}}return Fn.Fragment=o,Fn.jsx=c,Fn.jsxs=c,Fn}var nx;function ih(){return nx||(nx=1,Oc.exports=rh()),Oc.exports}var n=ih(),Dc={exports:{}},de={};/**
|
|
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 sx;function ch(){if(sx)return de;sx=1;var i=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),p=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),T=Symbol.iterator;function z(S){return S===null||typeof S!="object"?null:(S=T&&S[T]||S["@@iterator"],typeof S=="function"?S:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},q=Object.assign,V={};function J(S,O,X){this.props=S,this.context=O,this.refs=V,this.updater=X||B}J.prototype.isReactComponent={},J.prototype.setState=function(S,O){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,O,"setState")},J.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function F(){}F.prototype=J.prototype;function ae(S,O,X){this.props=S,this.context=O,this.refs=V,this.updater=X||B}var G=ae.prototype=new F;G.constructor=ae,q(G,J.prototype),G.isPureReactComponent=!0;var W=Array.isArray;function te(){}var $={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function ge(S,O,X){var R=X.ref;return{$$typeof:i,type:S,key:O,ref:R!==void 0?R:null,props:X}}function se(S,O){return ge(S.type,O,S.props)}function Te(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function pe(S){var O={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(X){return O[X]})}var Z=/\/+/g;function ie(S,O){return typeof S=="object"&&S!==null&&S.key!=null?pe(""+S.key):O.toString(36)}function ve(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(te,te):(S.status="pending",S.then(function(O){S.status==="pending"&&(S.status="fulfilled",S.value=O)},function(O){S.status==="pending"&&(S.status="rejected",S.reason=O)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function N(S,O,X,R,Y){var Q=typeof S;(Q==="undefined"||Q==="boolean")&&(S=null);var P=!1;if(S===null)P=!0;else switch(Q){case"bigint":case"string":case"number":P=!0;break;case"object":switch(S.$$typeof){case i:case o:P=!0;break;case E:return P=S._init,N(P(S._payload),O,X,R,Y)}}if(P)return Y=Y(S),P=R===""?"."+ie(S,0):R,W(Y)?(X="",P!=null&&(X=P.replace(Z,"$&/")+"/"),N(Y,O,X,"",function(tt){return tt})):Y!=null&&(Te(Y)&&(Y=se(Y,X+(Y.key==null||S&&S.key===Y.key?"":(""+Y.key).replace(Z,"$&/")+"/")+P)),O.push(Y)),1;P=0;var ue=R===""?".":R+":";if(W(S))for(var he=0;he<S.length;he++)R=S[he],Q=ue+ie(R,he),P+=N(R,O,X,Q,Y);else if(he=z(S),typeof he=="function")for(S=he.call(S),he=0;!(R=S.next()).done;)R=R.value,Q=ue+ie(R,he++),P+=N(R,O,X,Q,Y);else if(Q==="object"){if(typeof S.then=="function")return N(ve(S),O,X,R,Y);throw O=String(S),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return P}function A(S,O,X){if(S==null)return S;var R=[],Y=0;return N(S,R,"","",function(Q){return O.call(X,Q,Y++)}),R}function K(S){if(S._status===-1){var O=S._result;O=O(),O.then(function(X){(S._status===0||S._status===-1)&&(S._status=1,S._result=X)},function(X){(S._status===0||S._status===-1)&&(S._status=2,S._result=X)}),S._status===-1&&(S._status=0,S._result=O)}if(S._status===1)return S._result.default;throw S._result}var ce=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=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(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},ye={map:A,forEach:function(S,O,X){A(S,function(){O.apply(this,arguments)},X)},count:function(S){var O=0;return A(S,function(){O++}),O},toArray:function(S){return A(S,function(O){return O})||[]},only:function(S){if(!Te(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return de.Activity=g,de.Children=ye,de.Component=J,de.Fragment=c,de.Profiler=m,de.PureComponent=ae,de.StrictMode=d,de.Suspense=y,de.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,de.__COMPILER_RUNTIME={__proto__:null,c:function(S){return $.H.useMemoCache(S)}},de.cache=function(S){return function(){return S.apply(null,arguments)}},de.cacheSignal=function(){return null},de.cloneElement=function(S,O,X){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var R=q({},S.props),Y=S.key;if(O!=null)for(Q in O.key!==void 0&&(Y=""+O.key),O)!le.call(O,Q)||Q==="key"||Q==="__self"||Q==="__source"||Q==="ref"&&O.ref===void 0||(R[Q]=O[Q]);var Q=arguments.length-2;if(Q===1)R.children=X;else if(1<Q){for(var P=Array(Q),ue=0;ue<Q;ue++)P[ue]=arguments[ue+2];R.children=P}return ge(S.type,Y,R)},de.createContext=function(S){return S={$$typeof:p,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:h,_context:S},S},de.createElement=function(S,O,X){var R,Y={},Q=null;if(O!=null)for(R in O.key!==void 0&&(Q=""+O.key),O)le.call(O,R)&&R!=="key"&&R!=="__self"&&R!=="__source"&&(Y[R]=O[R]);var P=arguments.length-2;if(P===1)Y.children=X;else if(1<P){for(var ue=Array(P),he=0;he<P;he++)ue[he]=arguments[he+2];Y.children=ue}if(S&&S.defaultProps)for(R in P=S.defaultProps,P)Y[R]===void 0&&(Y[R]=P[R]);return ge(S,Q,Y)},de.createRef=function(){return{current:null}},de.forwardRef=function(S){return{$$typeof:b,render:S}},de.isValidElement=Te,de.lazy=function(S){return{$$typeof:E,_payload:{_status:-1,_result:S},_init:K}},de.memo=function(S,O){return{$$typeof:f,type:S,compare:O===void 0?null:O}},de.startTransition=function(S){var O=$.T,X={};$.T=X;try{var R=S(),Y=$.S;Y!==null&&Y(X,R),typeof R=="object"&&R!==null&&typeof R.then=="function"&&R.then(te,ce)}catch(Q){ce(Q)}finally{O!==null&&X.types!==null&&(O.types=X.types),$.T=O}},de.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},de.use=function(S){return $.H.use(S)},de.useActionState=function(S,O,X){return $.H.useActionState(S,O,X)},de.useCallback=function(S,O){return $.H.useCallback(S,O)},de.useContext=function(S){return $.H.useContext(S)},de.useDebugValue=function(){},de.useDeferredValue=function(S,O){return $.H.useDeferredValue(S,O)},de.useEffect=function(S,O){return $.H.useEffect(S,O)},de.useEffectEvent=function(S){return $.H.useEffectEvent(S)},de.useId=function(){return $.H.useId()},de.useImperativeHandle=function(S,O,X){return $.H.useImperativeHandle(S,O,X)},de.useInsertionEffect=function(S,O){return $.H.useInsertionEffect(S,O)},de.useLayoutEffect=function(S,O){return $.H.useLayoutEffect(S,O)},de.useMemo=function(S,O){return $.H.useMemo(S,O)},de.useOptimistic=function(S,O){return $.H.useOptimistic(S,O)},de.useReducer=function(S,O,X){return $.H.useReducer(S,O,X)},de.useRef=function(S){return $.H.useRef(S)},de.useState=function(S){return $.H.useState(S)},de.useSyncExternalStore=function(S,O,X){return $.H.useSyncExternalStore(S,O,X)},de.useTransition=function(){return $.H.useTransition()},de.version="19.2.4",de}var rx;function no(){return rx||(rx=1,Dc.exports=ch()),Dc.exports}var v=no(),Bc={exports:{}},In={},Uc={exports:{}},Hc={};/**
|
|
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 ix;function oh(){return ix||(ix=1,(function(i){function o(N,A){var K=N.length;N.push(A);e:for(;0<K;){var ce=K-1>>>1,ye=N[ce];if(0<m(ye,A))N[ce]=A,N[K]=ye,K=ce;else break e}}function c(N){return N.length===0?null:N[0]}function d(N){if(N.length===0)return null;var A=N[0],K=N.pop();if(K!==A){N[0]=K;e:for(var ce=0,ye=N.length,S=ye>>>1;ce<S;){var O=2*(ce+1)-1,X=N[O],R=O+1,Y=N[R];if(0>m(X,K))R<ye&&0>m(Y,X)?(N[ce]=Y,N[R]=K,ce=R):(N[ce]=X,N[O]=K,ce=O);else if(R<ye&&0>m(Y,K))N[ce]=Y,N[R]=K,ce=R;else break e}}return A}function m(N,A){var K=N.sortIndex-A.sortIndex;return K!==0?K:N.id-A.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 p=Date,b=p.now();i.unstable_now=function(){return p.now()-b}}var y=[],f=[],E=1,g=null,T=3,z=!1,B=!1,q=!1,V=!1,J=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,ae=typeof setImmediate<"u"?setImmediate:null;function G(N){for(var A=c(f);A!==null;){if(A.callback===null)d(f);else if(A.startTime<=N)d(f),A.sortIndex=A.expirationTime,o(y,A);else break;A=c(f)}}function W(N){if(q=!1,G(N),!B)if(c(y)!==null)B=!0,te||(te=!0,pe());else{var A=c(f);A!==null&&ve(W,A.startTime-N)}}var te=!1,$=-1,le=5,ge=-1;function se(){return V?!0:!(i.unstable_now()-ge<le)}function Te(){if(V=!1,te){var N=i.unstable_now();ge=N;var A=!0;try{e:{B=!1,q&&(q=!1,F($),$=-1),z=!0;var K=T;try{t:{for(G(N),g=c(y);g!==null&&!(g.expirationTime>N&&se());){var ce=g.callback;if(typeof ce=="function"){g.callback=null,T=g.priorityLevel;var ye=ce(g.expirationTime<=N);if(N=i.unstable_now(),typeof ye=="function"){g.callback=ye,G(N),A=!0;break t}g===c(y)&&d(y),G(N)}else d(y);g=c(y)}if(g!==null)A=!0;else{var S=c(f);S!==null&&ve(W,S.startTime-N),A=!1}}break e}finally{g=null,T=K,z=!1}A=void 0}}finally{A?pe():te=!1}}}var pe;if(typeof ae=="function")pe=function(){ae(Te)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ie=Z.port2;Z.port1.onmessage=Te,pe=function(){ie.postMessage(null)}}else pe=function(){J(Te,0)};function ve(N,A){$=J(function(){N(i.unstable_now())},A)}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"):le=0<N?Math.floor(1e3/N):5},i.unstable_getCurrentPriorityLevel=function(){return T},i.unstable_next=function(N){switch(T){case 1:case 2:case 3:var A=3;break;default:A=T}var K=T;T=A;try{return N()}finally{T=K}},i.unstable_requestPaint=function(){V=!0},i.unstable_runWithPriority=function(N,A){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var K=T;T=N;try{return A()}finally{T=K}},i.unstable_scheduleCallback=function(N,A,K){var ce=i.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?ce+K:ce):K=ce,N){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=K+ye,N={id:E++,callback:A,priorityLevel:N,startTime:K,expirationTime:ye,sortIndex:-1},K>ce?(N.sortIndex=K,o(f,N),c(y)===null&&N===c(f)&&(q?(F($),$=-1):q=!0,ve(W,K-ce))):(N.sortIndex=ye,o(y,N),B||z||(B=!0,te||(te=!0,pe()))),N},i.unstable_shouldYield=se,i.unstable_wrapCallback=function(N){var A=T;return function(){var K=T;T=A;try{return N.apply(this,arguments)}finally{T=K}}}})(Hc)),Hc}var cx;function uh(){return cx||(cx=1,Uc.exports=oh()),Uc.exports}var qc={exports:{}},ut={};/**
|
|
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 ox;function dh(){if(ox)return ut;ox=1;var i=no();function o(y){var f="https://react.dev/errors/"+y;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var E=2;E<arguments.length;E++)f+="&args[]="+encodeURIComponent(arguments[E])}return"Minified React error #"+y+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var d={d:{f:c,r:function(){throw Error(o(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},m=Symbol.for("react.portal");function h(y,f,E){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:g==null?null:""+g,children:y,containerInfo:f,implementation:E}}var p=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(y,f){if(y==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,ut.createPortal=function(y,f){var E=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(o(299));return h(y,f,null,E)},ut.flushSync=function(y){var f=p.T,E=d.p;try{if(p.T=null,d.p=2,y)return y()}finally{p.T=f,d.p=E,d.d.f()}},ut.preconnect=function(y,f){typeof y=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,d.d.C(y,f))},ut.prefetchDNS=function(y){typeof y=="string"&&d.d.D(y)},ut.preinit=function(y,f){if(typeof y=="string"&&f&&typeof f.as=="string"){var E=f.as,g=b(E,f.crossOrigin),T=typeof f.integrity=="string"?f.integrity:void 0,z=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;E==="style"?d.d.S(y,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:T,fetchPriority:z}):E==="script"&&d.d.X(y,{crossOrigin:g,integrity:T,fetchPriority:z,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},ut.preinitModule=function(y,f){if(typeof y=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var E=b(f.as,f.crossOrigin);d.d.M(y,{crossOrigin:E,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&d.d.M(y)},ut.preload=function(y,f){if(typeof y=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var E=f.as,g=b(E,f.crossOrigin);d.d.L(y,E,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},ut.preloadModule=function(y,f){if(typeof y=="string")if(f){var E=b(f.as,f.crossOrigin);d.d.m(y,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:E,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else d.d.m(y)},ut.requestFormReset=function(y){d.d.r(y)},ut.unstable_batchedUpdates=function(y,f){return y(f)},ut.useFormState=function(y,f,E){return p.H.useFormState(y,f,E)},ut.useFormStatus=function(){return p.H.useHostTransitionStatus()},ut.version="19.2.4",ut}var ux;function fh(){if(ux)return qc.exports;ux=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(),qc.exports=dh(),qc.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 dx;function xh(){if(dx)return In;dx=1;var i=uh(),o=no(),c=fh();function d(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 m(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 p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function b(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(h(e)!==e)throw Error(d(188))}function f(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(d(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(d(188))}if(l.return!==a.return)l=s,a=r;else{for(var u=!1,x=s.child;x;){if(x===l){u=!0,l=s,a=r;break}if(x===a){u=!0,a=s,l=r;break}x=x.sibling}if(!u){for(x=r.child;x;){if(x===l){u=!0,l=r,a=s;break}if(x===a){u=!0,a=r,l=s;break}x=x.sibling}if(!u)throw Error(d(189))}}if(l.alternate!==a)throw Error(d(190))}if(l.tag!==3)throw Error(d(188));return l.stateNode.current===l?e:t}function E(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=E(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,T=Symbol.for("react.element"),z=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),ae=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),ge=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),Te=Symbol.iterator;function pe(e){return e===null||typeof e!="object"?null:(e=Te&&e[Te]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function ie(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case q:return"Fragment";case J:return"Profiler";case V:return"StrictMode";case W:return"Suspense";case te:return"SuspenseList";case ge:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case ae:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:ie(e.type)||"Memo";case le:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ve=Array.isArray,N=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},ce=[],ye=-1;function S(e){return{current:e}}function O(e){0>ye||(e.current=ce[ye],ce[ye]=null,ye--)}function X(e,t){ye++,ce[ye]=e.current,e.current=t}var R=S(null),Y=S(null),Q=S(null),P=S(null);function ue(e,t){switch(X(Q,t),X(Y,e),X(R,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Tf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Tf(t),e=Cf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}O(R),X(R,e)}function he(){O(R),O(Y),O(Q)}function tt(e){e.memoizedState!==null&&X(P,e);var t=R.current,l=Cf(t,e.type);t!==l&&(X(Y,e),X(R,l))}function nt(e){Y.current===e&&(O(R),O(Y)),P.current===e&&(O(P),Kn._currentValue=K)}var $t,Wt;function Qt(e){if($t===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);$t=t&&t[1]||"",Wt=-1<l.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+$t+e+Wt}var dt=!1;function al(e,t){if(!e||dt)return"";dt=!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(L){var M=L}Reflect.construct(e,[],H)}else{try{H.call()}catch(L){M=L}e.call(H.prototype)}}else{try{throw Error()}catch(L){M=L}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(L){if(L&&M&&typeof L.stack=="string")return[L.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(),u=r[0],x=r[1];if(u&&x){var j=u.split(`
|
|
44
|
-
`),_=x.split(`
|
|
45
|
-
`);for(s=a=0;a<j.length&&!j[a].includes("DetermineComponentFrameRoot");)a++;for(;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;if(a===j.length||s===_.length)for(a=j.length-1,s=_.length-1;1<=a&&0<=s&&j[a]!==_[s];)s--;for(;1<=a&&0<=s;a--,s--)if(j[a]!==_[s]){if(a!==1||s!==1)do if(a--,s--,0>s||j[a]!==_[s]){var D=`
|
|
46
|
-
`+j[a].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),D}while(1<=a&&0<=s);break}}}finally{dt=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Qt(l):""}function pa(e,t){switch(e.tag){case 26:case 27:case 5:return Qt(e.type);case 16:return Qt("Lazy");case 13:return e.child!==t&&t!==null?Qt("Suspense Fallback"):Qt("Suspense");case 19:return Qt("SuspenseList");case 0:case 15:return al(e.type,!1);case 11:return al(e.type.render,!1);case 1:return al(e.type,!0);case 31:return Qt("Activity");default:return""}}function vt(e){try{var t="",l=null;do t+=pa(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
|
|
47
|
-
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}var Ft=Object.prototype.hasOwnProperty,Xt=i.unstable_scheduleCallback,Wl=i.unstable_cancelCallback,an=i.unstable_shouldYield,I=i.unstable_requestPaint,Le=i.unstable_now,xe=i.unstable_getCurrentPriorityLevel,He=i.unstable_ImmediatePriority,yt=i.unstable_UserBlockingPriority,Re=i.unstable_NormalPriority,nn=i.unstable_LowPriority,ha=i.unstable_IdlePriority,nl=i.log,ft=i.unstable_setDisableYieldValue,xt=null,Qe=null;function gt(e){if(typeof nl=="function"&&ft(e),Qe&&typeof Qe.setStrictMode=="function")try{Qe.setStrictMode(xt,e)}catch{}}var Xe=Math.clz32?Math.clz32:va,Ce=Math.log,mt=Math.LN2;function va(e){return e>>>=0,e===0?32:31-(Ce(e)/mt|0)|0}var es=256,ts=262144,ls=4194304;function Fl(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 as(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,u=e.pingedLanes;e=e.warmLanes;var x=a&134217727;return x!==0?(a=x&~r,a!==0?s=Fl(a):(u&=x,u!==0?s=Fl(u):l||(l=x&~e,l!==0&&(s=Fl(l))))):(x=a&~r,x!==0?s=Fl(x):u!==0?s=Fl(u):l||(l=a&~e,l!==0&&(s=Fl(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 sn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Kx(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 so(){var e=ls;return ls<<=1,(ls&62914560)===0&&(ls=4194304),e}function Nr(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function rn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Jx(e,t,l,a,s,r){var u=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 x=e.entanglements,j=e.expirationTimes,_=e.hiddenUpdates;for(l=u&~l;0<l;){var D=31-Xe(l),H=1<<D;x[D]=0,j[D]=-1;var M=_[D];if(M!==null)for(_[D]=null,D=0;D<M.length;D++){var L=M[D];L!==null&&(L.lane&=-536870913)}l&=~H}a!==0&&ro(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(u&~t))}function ro(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Xe(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function io(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-Xe(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function co(e,t){var l=t&-t;return l=(l&42)!==0?1:Er(l),(l&(e.suspendedLanes|t))!==0?0:l}function Er(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 kr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function oo(){var e=A.p;return e!==0?e:(e=window.event,e===void 0?32:Wf(e.type))}function uo(e,t){var l=A.p;try{return A.p=e,t()}finally{A.p=l}}var Nl=Math.random().toString(36).slice(2),st="__reactFiber$"+Nl,bt="__reactProps$"+Nl,ya="__reactContainer$"+Nl,Tr="__reactEvents$"+Nl,$x="__reactListeners$"+Nl,Wx="__reactHandles$"+Nl,fo="__reactResources$"+Nl,cn="__reactMarker$"+Nl;function Cr(e){delete e[st],delete e[bt],delete e[Tr],delete e[$x],delete e[Wx]}function ga(e){var t=e[st];if(t)return t;for(var l=e.parentNode;l;){if(t=l[ya]||l[st]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Lf(e);e!==null;){if(l=e[st])return l;e=Lf(e)}return t}e=l,l=e.parentNode}return null}function ba(e){if(e=e[st]||e[ya]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function on(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(d(33))}function ja(e){var t=e[fo];return t||(t=e[fo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function lt(e){e[cn]=!0}var xo=new Set,mo={};function Il(e,t){Sa(e,t),Sa(e+"Capture",t)}function Sa(e,t){for(mo[e]=t,e=0;e<t.length;e++)xo.add(t[e])}var Fx=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]*$"),po={},ho={};function Ix(e){return Ft.call(ho,e)?!0:Ft.call(po,e)?!1:Fx.test(e)?ho[e]=!0:(po[e]=!0,!1)}function ns(e,t,l){if(Ix(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 ss(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 sl(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 Lt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Px(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(u){l=""+u,r.call(this,u)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(u){l=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ar(e){if(!e._valueTracker){var t=vo(e)?"checked":"value";e._valueTracker=Px(e,t,""+e[t])}}function yo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=vo(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function rs(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 em=/[\n"\\]/g;function Ot(e){return e.replace(em,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function wr(e,t,l,a,s,r,u,x){e.name="",u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.type=u:e.removeAttribute("type"),t!=null?u==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Lt(t)):e.value!==""+Lt(t)&&(e.value=""+Lt(t)):u!=="submit"&&u!=="reset"||e.removeAttribute("value"),t!=null?_r(e,u,Lt(t)):l!=null?_r(e,u,Lt(l)):a!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+Lt(x):e.removeAttribute("name")}function go(e,t,l,a,s,r,u,x){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)){Ar(e);return}l=l!=null?""+Lt(l):"",t=t!=null?""+Lt(t):l,x||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=x?e.checked:!!a,e.defaultChecked=!!a,u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.name=u),Ar(e)}function _r(e,t,l){t==="number"&&rs(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Na(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=""+Lt(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 bo(e,t,l){if(t!=null&&(t=""+Lt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Lt(l):""}function jo(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(d(92));if(ve(a)){if(1<a.length)throw Error(d(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=Lt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),Ar(e)}function Ea(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var tm=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 So(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||tm.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function No(e,t,l){if(t!=null&&typeof t!="object")throw Error(d(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&&So(e,s,a)}else for(var r in t)t.hasOwnProperty(r)&&So(e,r,t[r])}function Rr(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 lm=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"]]),am=/^[\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 is(e){return am.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function rl(){}var Mr=null;function zr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ka=null,Ta=null;function Eo(e){var t=ba(e);if(t&&(e=t.stateNode)){var l=e[bt]||null;e:switch(e=t.stateNode,t.type){case"input":if(wr(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="'+Ot(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var s=a[bt]||null;if(!s)throw Error(d(90));wr(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&&yo(a)}break e;case"textarea":bo(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Na(e,!!l.multiple,t,!1)}}}var Lr=!1;function ko(e,t,l){if(Lr)return e(t,l);Lr=!0;try{var a=e(t);return a}finally{if(Lr=!1,(ka!==null||Ta!==null)&&(Js(),ka&&(t=ka,e=Ta,Ta=ka=null,Eo(t),e)))for(t=0;t<e.length;t++)Eo(e[t])}}function un(e,t){var l=e.stateNode;if(l===null)return null;var a=l[bt]||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(d(231,t,typeof l));return l}var il=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Or=!1;if(il)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){Or=!0}}),window.addEventListener("test",dn,dn),window.removeEventListener("test",dn,dn)}catch{Or=!1}var El=null,Dr=null,cs=null;function To(){if(cs)return cs;var e,t=Dr,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 u=l-e;for(a=1;a<=u&&t[l-a]===s[r-a];a++);return cs=s.slice(e,1<a?1-a:void 0)}function os(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 us(){return!0}function Co(){return!1}function jt(e){function t(l,a,s,r,u){this._reactName=l,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=u,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(l=e[x],this[x]=l?l(r):r[x]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?us:Co,this.isPropagationStopped=Co,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=us)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=us)},persist:function(){},isPersistent:us}),t}var Pl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ds=jt(Pl),fn=g({},Pl,{view:0,detail:0}),nm=jt(fn),Br,Ur,xn,fs=g({},fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qr,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!==xn&&(xn&&e.type==="mousemove"?(Br=e.screenX-xn.screenX,Ur=e.screenY-xn.screenY):Ur=Br=0,xn=e),Br)},movementY:function(e){return"movementY"in e?e.movementY:Ur}}),Ao=jt(fs),sm=g({},fs,{dataTransfer:0}),rm=jt(sm),im=g({},fn,{relatedTarget:0}),Hr=jt(im),cm=g({},Pl,{animationName:0,elapsedTime:0,pseudoElement:0}),om=jt(cm),um=g({},Pl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dm=jt(um),fm=g({},Pl,{data:0}),wo=jt(fm),xm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mm={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"},pm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=pm[e])?!!t[e]:!1}function qr(){return hm}var vm=g({},fn,{key:function(e){if(e.key){var t=xm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=os(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qr,charCode:function(e){return e.type==="keypress"?os(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?os(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ym=jt(vm),gm=g({},fs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_o=jt(gm),bm=g({},fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qr}),jm=jt(bm),Sm=g({},Pl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nm=jt(Sm),Em=g({},fs,{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}),km=jt(Em),Tm=g({},Pl,{newState:0,oldState:0}),Cm=jt(Tm),Am=[9,13,27,32],Gr=il&&"CompositionEvent"in window,mn=null;il&&"documentMode"in document&&(mn=document.documentMode);var wm=il&&"TextEvent"in window&&!mn,Ro=il&&(!Gr||mn&&8<mn&&11>=mn),Mo=" ",zo=!1;function Lo(e,t){switch(e){case"keyup":return Am.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Oo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ca=!1;function _m(e,t){switch(e){case"compositionend":return Oo(t);case"keypress":return t.which!==32?null:(zo=!0,Mo);case"textInput":return e=t.data,e===Mo&&zo?null:e;default:return null}}function Rm(e,t){if(Ca)return e==="compositionend"||!Gr&&Lo(e,t)?(e=To(),cs=Dr=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 Ro&&t.locale!=="ko"?null:t.data;default:return null}}var Mm={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 Do(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mm[e.type]:t==="textarea"}function Bo(e,t,l,a){ka?Ta?Ta.push(a):Ta=[a]:ka=a,t=tr(t,"onChange"),0<t.length&&(l=new ds("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var pn=null,hn=null;function zm(e){bf(e,0)}function xs(e){var t=on(e);if(yo(t))return e}function Uo(e,t){if(e==="change")return t}var Ho=!1;if(il){var Yr;if(il){var Vr="oninput"in document;if(!Vr){var qo=document.createElement("div");qo.setAttribute("oninput","return;"),Vr=typeof qo.oninput=="function"}Yr=Vr}else Yr=!1;Ho=Yr&&(!document.documentMode||9<document.documentMode)}function Go(){pn&&(pn.detachEvent("onpropertychange",Yo),hn=pn=null)}function Yo(e){if(e.propertyName==="value"&&xs(hn)){var t=[];Bo(t,hn,e,zr(e)),ko(zm,t)}}function Lm(e,t,l){e==="focusin"?(Go(),pn=t,hn=l,pn.attachEvent("onpropertychange",Yo)):e==="focusout"&&Go()}function Om(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xs(hn)}function Dm(e,t){if(e==="click")return xs(t)}function Bm(e,t){if(e==="input"||e==="change")return xs(t)}function Um(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ct=typeof Object.is=="function"?Object.is:Um;function vn(e,t){if(Ct(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(!Ft.call(t,s)||!Ct(e[s],t[s]))return!1}return!0}function Vo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qo(e,t){var l=Vo(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=Vo(l)}}function Xo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=rs(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=rs(e.document)}return t}function Qr(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 Hm=il&&"documentMode"in document&&11>=document.documentMode,Aa=null,Xr=null,yn=null,Zr=!1;function Ko(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Zr||Aa==null||Aa!==rs(a)||(a=Aa,"selectionStart"in a&&Qr(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}),yn&&vn(yn,a)||(yn=a,a=tr(Xr,"onSelect"),0<a.length&&(t=new ds("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=Aa)))}function ea(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var wa={animationend:ea("Animation","AnimationEnd"),animationiteration:ea("Animation","AnimationIteration"),animationstart:ea("Animation","AnimationStart"),transitionrun:ea("Transition","TransitionRun"),transitionstart:ea("Transition","TransitionStart"),transitioncancel:ea("Transition","TransitionCancel"),transitionend:ea("Transition","TransitionEnd")},Kr={},Jo={};il&&(Jo=document.createElement("div").style,"AnimationEvent"in window||(delete wa.animationend.animation,delete wa.animationiteration.animation,delete wa.animationstart.animation),"TransitionEvent"in window||delete wa.transitionend.transition);function ta(e){if(Kr[e])return Kr[e];if(!wa[e])return e;var t=wa[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in Jo)return Kr[e]=t[l];return e}var $o=ta("animationend"),Wo=ta("animationiteration"),Fo=ta("animationstart"),qm=ta("transitionrun"),Gm=ta("transitionstart"),Ym=ta("transitioncancel"),Io=ta("transitionend"),Po=new Map,Jr="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(" ");Jr.push("scrollEnd");function Zt(e,t){Po.set(e,t),Il(t,[e])}var ms=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)},Dt=[],_a=0,$r=0;function ps(){for(var e=_a,t=$r=_a=0;t<e;){var l=Dt[t];Dt[t++]=null;var a=Dt[t];Dt[t++]=null;var s=Dt[t];Dt[t++]=null;var r=Dt[t];if(Dt[t++]=null,a!==null&&s!==null){var u=a.pending;u===null?s.next=s:(s.next=u.next,u.next=s),a.pending=s}r!==0&&eu(l,s,r)}}function hs(e,t,l,a){Dt[_a++]=e,Dt[_a++]=t,Dt[_a++]=l,Dt[_a++]=a,$r|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Wr(e,t,l,a){return hs(e,t,l,a),vs(e)}function la(e,t){return hs(e,null,null,t),vs(e)}function eu(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-Xe(l),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=l|536870912),r):null}function vs(e){if(50<qn)throw qn=0,sc=null,Error(d(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ra={};function Vm(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 At(e,t,l,a){return new Vm(e,t,l,a)}function Fr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cl(e,t){var l=e.alternate;return l===null?(l=At(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 tu(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 ys(e,t,l,a,s,r){var u=0;if(a=e,typeof e=="function")Fr(e)&&(u=1);else if(typeof e=="string")u=Jp(e,l,R.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ge:return e=At(31,l,t,s),e.elementType=ge,e.lanes=r,e;case q:return aa(l.children,s,r,t);case V:u=8,s|=24;break;case J:return e=At(12,l,t,s|2),e.elementType=J,e.lanes=r,e;case W:return e=At(13,l,t,s),e.elementType=W,e.lanes=r,e;case te:return e=At(19,l,t,s),e.elementType=te,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ae:u=10;break e;case F:u=9;break e;case G:u=11;break e;case $:u=14;break e;case le:u=16,a=null;break e}u=29,l=Error(d(130,e===null?"null":typeof e,"")),a=null}return t=At(u,l,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function aa(e,t,l,a){return e=At(7,e,a,t),e.lanes=l,e}function Ir(e,t,l){return e=At(6,e,null,t),e.lanes=l,e}function lu(e){var t=At(18,null,null,0);return t.stateNode=e,t}function Pr(e,t,l){return t=At(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var au=new WeakMap;function Bt(e,t){if(typeof e=="object"&&e!==null){var l=au.get(e);return l!==void 0?l:(t={value:e,source:t,stack:vt(t)},au.set(e,t),t)}return{value:e,source:t,stack:vt(t)}}var Ma=[],za=0,gs=null,gn=0,Ut=[],Ht=0,kl=null,It=1,Pt="";function ol(e,t){Ma[za++]=gn,Ma[za++]=gs,gs=e,gn=t}function nu(e,t,l){Ut[Ht++]=It,Ut[Ht++]=Pt,Ut[Ht++]=kl,kl=e;var a=It;e=Pt;var s=32-Xe(a)-1;a&=~(1<<s),l+=1;var r=32-Xe(t)+s;if(30<r){var u=s-s%5;r=(a&(1<<u)-1).toString(32),a>>=u,s-=u,It=1<<32-Xe(t)+s|l<<s|a,Pt=r+e}else It=1<<r|l<<s|a,Pt=e}function ei(e){e.return!==null&&(ol(e,1),nu(e,1,0))}function ti(e){for(;e===gs;)gs=Ma[--za],Ma[za]=null,gn=Ma[--za],Ma[za]=null;for(;e===kl;)kl=Ut[--Ht],Ut[Ht]=null,Pt=Ut[--Ht],Ut[Ht]=null,It=Ut[--Ht],Ut[Ht]=null}function su(e,t){Ut[Ht++]=It,Ut[Ht++]=Pt,Ut[Ht++]=kl,It=t.id,Pt=t.overflow,kl=e}var rt=null,qe=null,Ee=!1,Tl=null,qt=!1,li=Error(d(519));function Cl(e){var t=Error(d(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bn(Bt(t,e)),li}function ru(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[st]=e,t[bt]=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<Yn.length;l++)je(Yn[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),go(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),jo(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||Ef(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=rl),t=!0):t=!1,t||Cl(e,!0)}function iu(e){for(rt=e.return;rt;)switch(rt.tag){case 5:case 31:case 13:qt=!1;return;case 27:case 3:qt=!0;return;default:rt=rt.return}}function La(e){if(e!==rt)return!1;if(!Ee)return iu(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")||bc(e.type,e.memoizedProps)),l=!l),l&&qe&&Cl(e),iu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));qe=zf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));qe=zf(e)}else t===27?(t=qe,Gl(e.type)?(e=kc,kc=null,qe=e):qe=t):qe=rt?Yt(e.stateNode.nextSibling):null;return!0}function na(){qe=rt=null,Ee=!1}function ai(){var e=Tl;return e!==null&&(kt===null?kt=e:kt.push.apply(kt,e),Tl=null),e}function bn(e){Tl===null?Tl=[e]:Tl.push(e)}var ni=S(null),sa=null,ul=null;function Al(e,t,l){X(ni,t._currentValue),t._currentValue=l}function dl(e){e._currentValue=ni.current,O(ni)}function si(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 ri(e,t,l,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var u=s.child;r=r.firstContext;e:for(;r!==null;){var x=r;r=s;for(var j=0;j<t.length;j++)if(x.context===t[j]){r.lanes|=l,x=r.alternate,x!==null&&(x.lanes|=l),si(r.return,l,e),a||(u=null);break e}r=x.next}}else if(s.tag===18){if(u=s.return,u===null)throw Error(d(341));u.lanes|=l,r=u.alternate,r!==null&&(r.lanes|=l),si(u,l,e),u=null}else u=s.child;if(u!==null)u.return=s;else for(u=s;u!==null;){if(u===e){u=null;break}if(s=u.sibling,s!==null){s.return=u.return,u=s;break}u=u.return}s=u}}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 u=s.alternate;if(u===null)throw Error(d(387));if(u=u.memoizedProps,u!==null){var x=s.type;Ct(s.pendingProps.value,u.value)||(e!==null?e.push(x):e=[x])}}else if(s===P.current){if(u=s.alternate,u===null)throw Error(d(387));u.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Kn):e=[Kn])}s=s.return}e!==null&&ri(t,e,l,a),t.flags|=262144}function bs(e){for(e=e.firstContext;e!==null;){if(!Ct(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){sa=e,ul=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function it(e){return cu(sa,e)}function js(e,t){return sa===null&&ra(e),cu(e,t)}function cu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},ul===null){if(e===null)throw Error(d(308));ul=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ul=ul.next=t;return l}var Qm=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()})}},Xm=i.unstable_scheduleCallback,Zm=i.unstable_NormalPriority,We={$$typeof:ae,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ii(){return{controller:new Qm,data:new Map,refCount:0}}function jn(e){e.refCount--,e.refCount===0&&Xm(Zm,function(){e.controller.abort()})}var Sn=null,ci=0,Da=0,Ba=null;function Km(e,t){if(Sn===null){var l=Sn=[];ci=0,Da=dc(),Ba={status:"pending",value:void 0,then:function(a){l.push(a)}}}return ci++,t.then(ou,ou),t}function ou(){if(--ci===0&&Sn!==null){Ba!==null&&(Ba.status="fulfilled");var e=Sn;Sn=null,Da=0,Ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Jm(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 uu=N.S;N.S=function(e,t){Kd=Le(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Km(e,t),uu!==null&&uu(e,t)};var ia=S(null);function oi(){var e=ia.current;return e!==null?e:Ue.pooledCache}function Ss(e,t){t===null?X(ia,ia.current):X(ia,t.pool)}function du(){var e=oi();return e===null?null:{parent:We._currentValue,pool:e}}var Ua=Error(d(460)),ui=Error(d(474)),Ns=Error(d(542)),Es={then:function(){}};function fu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xu(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(rl,rl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pu(e),e;default:if(typeof t.status=="string")t.then(rl,rl);else{if(e=Ue,e!==null&&100<e.shellSuspendCounter)throw Error(d(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,pu(e),e}throw oa=t,Ua}}function ca(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(oa=l,Ua):l}}var oa=null;function mu(){if(oa===null)throw Error(d(459));var e=oa;return oa=null,e}function pu(e){if(e===Ua||e===Ns)throw Error(d(483))}var Ha=null,Nn=0;function ks(e){var t=Nn;return Nn+=1,Ha===null&&(Ha=[]),xu(Ha,e,t)}function En(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ts(e,t){throw t.$$typeof===T?Error(d(525)):(e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function hu(e){function t(C,k){if(e){var w=C.deletions;w===null?(C.deletions=[k],C.flags|=16):w.push(k)}}function l(C,k){if(!e)return null;for(;k!==null;)t(C,k),k=k.sibling;return null}function a(C){for(var k=new Map;C!==null;)C.key!==null?k.set(C.key,C):k.set(C.index,C),C=C.sibling;return k}function s(C,k){return C=cl(C,k),C.index=0,C.sibling=null,C}function r(C,k,w){return C.index=w,e?(w=C.alternate,w!==null?(w=w.index,w<k?(C.flags|=67108866,k):w):(C.flags|=67108866,k)):(C.flags|=1048576,k)}function u(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function x(C,k,w,U){return k===null||k.tag!==6?(k=Ir(w,C.mode,U),k.return=C,k):(k=s(k,w),k.return=C,k)}function j(C,k,w,U){var re=w.type;return re===q?D(C,k,w.props.children,U,w.key):k!==null&&(k.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===le&&ca(re)===k.type)?(k=s(k,w.props),En(k,w),k.return=C,k):(k=ys(w.type,w.key,w.props,null,C.mode,U),En(k,w),k.return=C,k)}function _(C,k,w,U){return k===null||k.tag!==4||k.stateNode.containerInfo!==w.containerInfo||k.stateNode.implementation!==w.implementation?(k=Pr(w,C.mode,U),k.return=C,k):(k=s(k,w.children||[]),k.return=C,k)}function D(C,k,w,U,re){return k===null||k.tag!==7?(k=aa(w,C.mode,U,re),k.return=C,k):(k=s(k,w),k.return=C,k)}function H(C,k,w){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=Ir(""+k,C.mode,w),k.return=C,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case z:return w=ys(k.type,k.key,k.props,null,C.mode,w),En(w,k),w.return=C,w;case B:return k=Pr(k,C.mode,w),k.return=C,k;case le:return k=ca(k),H(C,k,w)}if(ve(k)||pe(k))return k=aa(k,C.mode,w,null),k.return=C,k;if(typeof k.then=="function")return H(C,ks(k),w);if(k.$$typeof===ae)return H(C,js(C,k),w);Ts(C,k)}return null}function M(C,k,w,U){var re=k!==null?k.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return re!==null?null:x(C,k,""+w,U);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case z:return w.key===re?j(C,k,w,U):null;case B:return w.key===re?_(C,k,w,U):null;case le:return w=ca(w),M(C,k,w,U)}if(ve(w)||pe(w))return re!==null?null:D(C,k,w,U,null);if(typeof w.then=="function")return M(C,k,ks(w),U);if(w.$$typeof===ae)return M(C,k,js(C,w),U);Ts(C,w)}return null}function L(C,k,w,U,re){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return C=C.get(w)||null,x(k,C,""+U,re);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case z:return C=C.get(U.key===null?w:U.key)||null,j(k,C,U,re);case B:return C=C.get(U.key===null?w:U.key)||null,_(k,C,U,re);case le:return U=ca(U),L(C,k,w,U,re)}if(ve(U)||pe(U))return C=C.get(w)||null,D(k,C,U,re,null);if(typeof U.then=="function")return L(C,k,w,ks(U),re);if(U.$$typeof===ae)return L(C,k,w,js(k,U),re);Ts(k,U)}return null}function ee(C,k,w,U){for(var re=null,Ae=null,ne=k,me=k=0,Ne=null;ne!==null&&me<w.length;me++){ne.index>me?(Ne=ne,ne=null):Ne=ne.sibling;var we=M(C,ne,w[me],U);if(we===null){ne===null&&(ne=Ne);break}e&&ne&&we.alternate===null&&t(C,ne),k=r(we,k,me),Ae===null?re=we:Ae.sibling=we,Ae=we,ne=Ne}if(me===w.length)return l(C,ne),Ee&&ol(C,me),re;if(ne===null){for(;me<w.length;me++)ne=H(C,w[me],U),ne!==null&&(k=r(ne,k,me),Ae===null?re=ne:Ae.sibling=ne,Ae=ne);return Ee&&ol(C,me),re}for(ne=a(ne);me<w.length;me++)Ne=L(ne,C,me,w[me],U),Ne!==null&&(e&&Ne.alternate!==null&&ne.delete(Ne.key===null?me:Ne.key),k=r(Ne,k,me),Ae===null?re=Ne:Ae.sibling=Ne,Ae=Ne);return e&&ne.forEach(function(Zl){return t(C,Zl)}),Ee&&ol(C,me),re}function oe(C,k,w,U){if(w==null)throw Error(d(151));for(var re=null,Ae=null,ne=k,me=k=0,Ne=null,we=w.next();ne!==null&&!we.done;me++,we=w.next()){ne.index>me?(Ne=ne,ne=null):Ne=ne.sibling;var Zl=M(C,ne,we.value,U);if(Zl===null){ne===null&&(ne=Ne);break}e&&ne&&Zl.alternate===null&&t(C,ne),k=r(Zl,k,me),Ae===null?re=Zl:Ae.sibling=Zl,Ae=Zl,ne=Ne}if(we.done)return l(C,ne),Ee&&ol(C,me),re;if(ne===null){for(;!we.done;me++,we=w.next())we=H(C,we.value,U),we!==null&&(k=r(we,k,me),Ae===null?re=we:Ae.sibling=we,Ae=we);return Ee&&ol(C,me),re}for(ne=a(ne);!we.done;me++,we=w.next())we=L(ne,C,me,we.value,U),we!==null&&(e&&we.alternate!==null&&ne.delete(we.key===null?me:we.key),k=r(we,k,me),Ae===null?re=we:Ae.sibling=we,Ae=we);return e&&ne.forEach(function(sh){return t(C,sh)}),Ee&&ol(C,me),re}function Be(C,k,w,U){if(typeof w=="object"&&w!==null&&w.type===q&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case z:e:{for(var re=w.key;k!==null;){if(k.key===re){if(re=w.type,re===q){if(k.tag===7){l(C,k.sibling),U=s(k,w.props.children),U.return=C,C=U;break e}}else if(k.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===le&&ca(re)===k.type){l(C,k.sibling),U=s(k,w.props),En(U,w),U.return=C,C=U;break e}l(C,k);break}else t(C,k);k=k.sibling}w.type===q?(U=aa(w.props.children,C.mode,U,w.key),U.return=C,C=U):(U=ys(w.type,w.key,w.props,null,C.mode,U),En(U,w),U.return=C,C=U)}return u(C);case B:e:{for(re=w.key;k!==null;){if(k.key===re)if(k.tag===4&&k.stateNode.containerInfo===w.containerInfo&&k.stateNode.implementation===w.implementation){l(C,k.sibling),U=s(k,w.children||[]),U.return=C,C=U;break e}else{l(C,k);break}else t(C,k);k=k.sibling}U=Pr(w,C.mode,U),U.return=C,C=U}return u(C);case le:return w=ca(w),Be(C,k,w,U)}if(ve(w))return ee(C,k,w,U);if(pe(w)){if(re=pe(w),typeof re!="function")throw Error(d(150));return w=re.call(w),oe(C,k,w,U)}if(typeof w.then=="function")return Be(C,k,ks(w),U);if(w.$$typeof===ae)return Be(C,k,js(C,w),U);Ts(C,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,k!==null&&k.tag===6?(l(C,k.sibling),U=s(k,w),U.return=C,C=U):(l(C,k),U=Ir(w,C.mode,U),U.return=C,C=U),u(C)):l(C,k)}return function(C,k,w,U){try{Nn=0;var re=Be(C,k,w,U);return Ha=null,re}catch(ne){if(ne===Ua||ne===Ns)throw ne;var Ae=At(29,ne,null,C.mode);return Ae.lanes=U,Ae.return=C,Ae}finally{}}}var ua=hu(!0),vu=hu(!1),wl=!1;function di(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fi(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 _l(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Rl(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=vs(e),eu(e,null,l),t}return hs(e,a,t,l),vs(e)}function kn(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,io(e,l)}}function xi(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 u={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};r===null?s=r=u:r=r.next=u,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 mi=!1;function Tn(){if(mi){var e=Ba;if(e!==null)throw e}}function Cn(e,t,l,a){mi=!1;var s=e.updateQueue;wl=!1;var r=s.firstBaseUpdate,u=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var j=x,_=j.next;j.next=null,u===null?r=_:u.next=_,u=j;var D=e.alternate;D!==null&&(D=D.updateQueue,x=D.lastBaseUpdate,x!==u&&(x===null?D.firstBaseUpdate=_:x.next=_,D.lastBaseUpdate=j))}if(r!==null){var H=s.baseState;u=0,D=_=j=null,x=r;do{var M=x.lane&-536870913,L=M!==x.lane;if(L?(Se&M)===M:(a&M)===M){M!==0&&M===Da&&(mi=!0),D!==null&&(D=D.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ee=e,oe=x;M=t;var Be=l;switch(oe.tag){case 1:if(ee=oe.payload,typeof ee=="function"){H=ee.call(Be,H,M);break e}H=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=oe.payload,M=typeof ee=="function"?ee.call(Be,H,M):ee,M==null)break e;H=g({},H,M);break e;case 2:wl=!0}}M=x.callback,M!==null&&(e.flags|=64,L&&(e.flags|=8192),L=s.callbacks,L===null?s.callbacks=[M]:L.push(M))}else L={lane:M,tag:x.tag,payload:x.payload,callback:x.callback,next:null},D===null?(_=D=L,j=H):D=D.next=L,u|=M;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;L=x,x=L.next,L.next=null,s.lastBaseUpdate=L,s.shared.pending=null}}while(!0);D===null&&(j=H),s.baseState=j,s.firstBaseUpdate=_,s.lastBaseUpdate=D,r===null&&(s.shared.lanes=0),Dl|=u,e.lanes=u,e.memoizedState=H}}function yu(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function gu(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)yu(l[e],t)}var qa=S(null),Cs=S(0);function bu(e,t){e=bl,X(Cs,e),X(qa,t),bl=e|t.baseLanes}function pi(){X(Cs,bl),X(qa,qa.current)}function hi(){bl=Cs.current,O(qa),O(Cs)}var wt=S(null),Gt=null;function Ml(e){var t=e.alternate;X(Je,Je.current&1),X(wt,e),Gt===null&&(t===null||qa.current!==null||t.memoizedState!==null)&&(Gt=e)}function vi(e){X(Je,Je.current),X(wt,e),Gt===null&&(Gt=e)}function ju(e){e.tag===22?(X(Je,Je.current),X(wt,e),Gt===null&&(Gt=e)):zl()}function zl(){X(Je,Je.current),X(wt,wt.current)}function _t(e){O(wt),Gt===e&&(Gt=null),O(Je)}var Je=S(0);function As(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Nc(l)||Ec(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 fl=0,fe=null,Oe=null,Fe=null,ws=!1,Ga=!1,da=!1,_s=0,An=0,Ya=null,$m=0;function Ze(){throw Error(d(321))}function yi(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Ct(e[l],t[l]))return!1;return!0}function gi(e,t,l,a,s,r){return fl=r,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?nd:Li,da=!1,r=l(a,s),da=!1,Ga&&(r=Nu(t,l,a,s)),Su(e),r}function Su(e){N.H=Rn;var t=Oe!==null&&Oe.next!==null;if(fl=0,Fe=Oe=fe=null,ws=!1,An=0,Ya=null,t)throw Error(d(300));e===null||Ie||(e=e.dependencies,e!==null&&bs(e)&&(Ie=!0))}function Nu(e,t,l,a){fe=e;var s=0;do{if(Ga&&(Ya=null),An=0,Ga=!1,25<=s)throw Error(d(301));if(s+=1,Fe=Oe=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=sd,r=t(l,a)}while(Ga);return r}function Wm(){var e=N.H,t=e.useState()[0];return t=typeof t.then=="function"?wn(t):t,e=e.useState()[0],(Oe!==null?Oe.memoizedState:null)!==e&&(fe.flags|=1024),t}function bi(){var e=_s!==0;return _s=0,e}function ji(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Si(e){if(ws){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ws=!1}fl=0,Fe=Oe=fe=null,Ga=!1,An=_s=0,Ya=null}function pt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?fe.memoizedState=Fe=e:Fe=Fe.next=e,Fe}function $e(){if(Oe===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Oe.next;var t=Fe===null?fe.memoizedState:Fe.next;if(t!==null)Fe=t,Oe=e;else{if(e===null)throw fe.alternate===null?Error(d(467)):Error(d(310));Oe=e,e={memoizedState:Oe.memoizedState,baseState:Oe.baseState,baseQueue:Oe.baseQueue,queue:Oe.queue,next:null},Fe===null?fe.memoizedState=Fe=e:Fe=Fe.next=e}return Fe}function Rs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wn(e){var t=An;return An+=1,Ya===null&&(Ya=[]),e=xu(Ya,e,t),t=fe,(Fe===null?t.memoizedState:Fe.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?nd:Li),e}function Ms(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wn(e);if(e.$$typeof===ae)return it(e)}throw Error(d(438,String(e)))}function Ni(e){var t=null,l=fe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=fe.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=Rs(),fe.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]=se;return t.index++,l}function xl(e,t){return typeof t=="function"?t(e):t}function zs(e){var t=$e();return Ei(t,Oe,e)}function Ei(e,t,l){var a=e.queue;if(a===null)throw Error(d(311));a.lastRenderedReducer=l;var s=e.baseQueue,r=a.pending;if(r!==null){if(s!==null){var u=s.next;s.next=r.next,r.next=u}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var x=u=null,j=null,_=t,D=!1;do{var H=_.lane&-536870913;if(H!==_.lane?(Se&H)===H:(fl&H)===H){var M=_.revertLane;if(M===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),H===Da&&(D=!0);else if((fl&M)===M){_=_.next,M===Da&&(D=!0);continue}else H={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},j===null?(x=j=H,u=r):j=j.next=H,fe.lanes|=M,Dl|=M;H=_.action,da&&l(r,H),r=_.hasEagerState?_.eagerState:l(r,H)}else M={lane:H,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},j===null?(x=j=M,u=r):j=j.next=M,fe.lanes|=H,Dl|=H;_=_.next}while(_!==null&&_!==t);if(j===null?u=r:j.next=x,!Ct(r,e.memoizedState)&&(Ie=!0,D&&(l=Ba,l!==null)))throw l;e.memoizedState=r,e.baseState=u,e.baseQueue=j,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function ki(e){var t=$e(),l=t.queue;if(l===null)throw Error(d(311));l.lastRenderedReducer=e;var a=l.dispatch,s=l.pending,r=t.memoizedState;if(s!==null){l.pending=null;var u=s=s.next;do r=e(r,u.action),u=u.next;while(u!==s);Ct(r,t.memoizedState)||(Ie=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),l.lastRenderedState=r}return[r,a]}function Eu(e,t,l){var a=fe,s=$e(),r=Ee;if(r){if(l===void 0)throw Error(d(407));l=l()}else l=t();var u=!Ct((Oe||s).memoizedState,l);if(u&&(s.memoizedState=l,Ie=!0),s=s.queue,Ai(Cu.bind(null,a,s,e),[e]),s.getSnapshot!==t||u||Fe!==null&&Fe.memoizedState.tag&1){if(a.flags|=2048,Va(9,{destroy:void 0},Tu.bind(null,a,s,l,t),null),Ue===null)throw Error(d(349));r||(fl&127)!==0||ku(a,t,l)}return l}function ku(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=fe.updateQueue,t===null?(t=Rs(),fe.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Tu(e,t,l,a){t.value=l,t.getSnapshot=a,Au(t)&&wu(e)}function Cu(e,t,l){return l(function(){Au(t)&&wu(e)})}function Au(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Ct(e,l)}catch{return!0}}function wu(e){var t=la(e,2);t!==null&&Tt(t,e,2)}function Ti(e){var t=pt();if(typeof e=="function"){var l=e;if(e=l(),da){gt(!0);try{l()}finally{gt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:e},t}function _u(e,t,l,a){return e.baseState=l,Ei(e,Oe,typeof a=="function"?a:xl)}function Fm(e,t,l,a,s){if(Ds(e))throw Error(d(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(u){r.listeners.push(u)}};N.T!==null?l(!0):r.isTransition=!1,a(r),l=t.pending,l===null?(r.next=t.pending=r,Ru(t,r)):(r.next=l.next,t.pending=l.next=r)}}function Ru(e,t){var l=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=N.T,u={};N.T=u;try{var x=l(s,a),j=N.S;j!==null&&j(u,x),Mu(e,t,x)}catch(_){Ci(e,t,_)}finally{r!==null&&u.types!==null&&(r.types=u.types),N.T=r}}else try{r=l(s,a),Mu(e,t,r)}catch(_){Ci(e,t,_)}}function Mu(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){zu(e,t,a)},function(a){return Ci(e,t,a)}):zu(e,t,l)}function zu(e,t,l){t.status="fulfilled",t.value=l,Lu(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Ru(e,l)))}function Ci(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,Lu(t),t=t.next;while(t!==a)}e.action=null}function Lu(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ou(e,t){return t}function Du(e,t){if(Ee){var l=Ue.formState;if(l!==null){e:{var a=fe;if(Ee){if(qe){t:{for(var s=qe,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){qe=Yt(s.nextSibling),a=s.data==="F!";break e}}Cl(a)}a=!1}a&&(t=l[0])}}return l=pt(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ou,lastRenderedState:t},l.queue=a,l=td.bind(null,fe,a),a.dispatch=l,a=Ti(!1),r=zi.bind(null,fe,!1,a.queue),a=pt(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,l=Fm.bind(null,fe,s,r,l),s.dispatch=l,a.memoizedState=e,[t,l,!1]}function Bu(e){var t=$e();return Uu(t,Oe,e)}function Uu(e,t,l){if(t=Ei(e,t,Ou)[0],e=zs(xl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=wn(t)}catch(u){throw u===Ua?Ns:u}else a=t;t=$e();var s=t.queue,r=s.dispatch;return l!==t.memoizedState&&(fe.flags|=2048,Va(9,{destroy:void 0},Im.bind(null,s,l),null)),[a,r,e]}function Im(e,t){e.action=t}function Hu(e){var t=$e(),l=Oe;if(l!==null)return Uu(t,l,e);$e(),t=t.memoizedState,l=$e();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function Va(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=fe.updateQueue,t===null&&(t=Rs(),fe.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 qu(){return $e().memoizedState}function Ls(e,t,l,a){var s=pt();fe.flags|=e,s.memoizedState=Va(1|t,{destroy:void 0},l,a===void 0?null:a)}function Os(e,t,l,a){var s=$e();a=a===void 0?null:a;var r=s.memoizedState.inst;Oe!==null&&a!==null&&yi(a,Oe.memoizedState.deps)?s.memoizedState=Va(t,r,l,a):(fe.flags|=e,s.memoizedState=Va(1|t,r,l,a))}function Gu(e,t){Ls(8390656,8,e,t)}function Ai(e,t){Os(2048,8,e,t)}function Pm(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=Rs(),fe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Yu(e){var t=$e().memoizedState;return Pm({ref:t,nextImpl:e}),function(){if((_e&2)!==0)throw Error(d(440));return t.impl.apply(void 0,arguments)}}function Vu(e,t){return Os(4,2,e,t)}function Qu(e,t){return Os(4,4,e,t)}function Xu(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 Zu(e,t,l){l=l!=null?l.concat([e]):null,Os(4,4,Xu.bind(null,t,e),l)}function wi(){}function Ku(e,t){var l=$e();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&yi(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function Ju(e,t){var l=$e();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&yi(t,a[1]))return a[0];if(a=e(),da){gt(!0);try{e()}finally{gt(!1)}}return l.memoizedState=[a,t],a}function _i(e,t,l){return l===void 0||(fl&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=$d(),fe.lanes|=e,Dl|=e,l)}function $u(e,t,l,a){return Ct(l,t)?l:qa.current!==null?(e=_i(e,l,a),Ct(e,t)||(Ie=!0),e):(fl&42)===0||(fl&1073741824)!==0&&(Se&261930)===0?(Ie=!0,e.memoizedState=l):(e=$d(),fe.lanes|=e,Dl|=e,t)}function Wu(e,t,l,a,s){var r=A.p;A.p=r!==0&&8>r?r:8;var u=N.T,x={};N.T=x,zi(e,!1,t,l);try{var j=s(),_=N.S;if(_!==null&&_(x,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var D=Jm(j,a);_n(e,t,D,zt(e))}else _n(e,t,a,zt(e))}catch(H){_n(e,t,{then:function(){},status:"rejected",reason:H},zt())}finally{A.p=r,u!==null&&x.types!==null&&(u.types=x.types),N.T=u}}function ep(){}function Ri(e,t,l,a){if(e.tag!==5)throw Error(d(476));var s=Fu(e).queue;Wu(e,s,t,K,l===null?ep:function(){return Iu(e),l(a)})}function Fu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:K},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Iu(e){var t=Fu(e);t.next===null&&(t=e.alternate.memoizedState),_n(e,t.next.queue,{},zt())}function Mi(){return it(Kn)}function Pu(){return $e().memoizedState}function ed(){return $e().memoizedState}function tp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=zt();e=_l(l);var a=Rl(t,e,l);a!==null&&(Tt(a,t,l),kn(a,t,l)),t={cache:ii()},e.payload=t;return}t=t.return}}function lp(e,t,l){var a=zt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ds(e)?ld(t,l):(l=Wr(e,t,l,a),l!==null&&(Tt(l,e,a),ad(l,t,a)))}function td(e,t,l){var a=zt();_n(e,t,l,a)}function _n(e,t,l,a){var s={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))ld(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var u=t.lastRenderedState,x=r(u,l);if(s.hasEagerState=!0,s.eagerState=x,Ct(x,u))return hs(e,t,s,0),Ue===null&&ps(),!1}catch{}finally{}if(l=Wr(e,t,s,a),l!==null)return Tt(l,e,a),ad(l,t,a),!0}return!1}function zi(e,t,l,a){if(a={lane:2,revertLane:dc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ds(e)){if(t)throw Error(d(479))}else t=Wr(e,l,a,2),t!==null&&Tt(t,e,2)}function Ds(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function ld(e,t){Ga=ws=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function ad(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,io(e,l)}}var Rn={readContext:it,use:Ms,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};Rn.useEffectEvent=Ze;var nd={readContext:it,use:Ms,useCallback:function(e,t){return pt().memoizedState=[e,t===void 0?null:t],e},useContext:it,useEffect:Gu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Ls(4194308,4,Xu.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var l=pt();t=t===void 0?null:t;var a=e();if(da){gt(!0);try{e()}finally{gt(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=pt();if(l!==void 0){var s=l(t);if(da){gt(!0);try{l(t)}finally{gt(!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=lp.bind(null,fe,e),[a.memoizedState,e]},useRef:function(e){var t=pt();return e={current:e},t.memoizedState=e},useState:function(e){e=Ti(e);var t=e.queue,l=td.bind(null,fe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:wi,useDeferredValue:function(e,t){var l=pt();return _i(l,e,t)},useTransition:function(){var e=Ti(!1);return e=Wu.bind(null,fe,e.queue,!0,!1),pt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=fe,s=pt();if(Ee){if(l===void 0)throw Error(d(407));l=l()}else{if(l=t(),Ue===null)throw Error(d(349));(Se&127)!==0||ku(a,t,l)}s.memoizedState=l;var r={value:l,getSnapshot:t};return s.queue=r,Gu(Cu.bind(null,a,r,e),[e]),a.flags|=2048,Va(9,{destroy:void 0},Tu.bind(null,a,r,l,t),null),l},useId:function(){var e=pt(),t=Ue.identifierPrefix;if(Ee){var l=Pt,a=It;l=(a&~(1<<32-Xe(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=_s++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=$m++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Mi,useFormState:Du,useActionState:Du,useOptimistic:function(e){var t=pt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=zi.bind(null,fe,!0,l),l.dispatch=t,[e,t]},useMemoCache:Ni,useCacheRefresh:function(){return pt().memoizedState=tp.bind(null,fe)},useEffectEvent:function(e){var t=pt(),l={impl:e};return t.memoizedState=l,function(){if((_e&2)!==0)throw Error(d(440));return l.impl.apply(void 0,arguments)}}},Li={readContext:it,use:Ms,useCallback:Ku,useContext:it,useEffect:Ai,useImperativeHandle:Zu,useInsertionEffect:Vu,useLayoutEffect:Qu,useMemo:Ju,useReducer:zs,useRef:qu,useState:function(){return zs(xl)},useDebugValue:wi,useDeferredValue:function(e,t){var l=$e();return $u(l,Oe.memoizedState,e,t)},useTransition:function(){var e=zs(xl)[0],t=$e().memoizedState;return[typeof e=="boolean"?e:wn(e),t]},useSyncExternalStore:Eu,useId:Pu,useHostTransitionStatus:Mi,useFormState:Bu,useActionState:Bu,useOptimistic:function(e,t){var l=$e();return _u(l,Oe,e,t)},useMemoCache:Ni,useCacheRefresh:ed};Li.useEffectEvent=Yu;var sd={readContext:it,use:Ms,useCallback:Ku,useContext:it,useEffect:Ai,useImperativeHandle:Zu,useInsertionEffect:Vu,useLayoutEffect:Qu,useMemo:Ju,useReducer:ki,useRef:qu,useState:function(){return ki(xl)},useDebugValue:wi,useDeferredValue:function(e,t){var l=$e();return Oe===null?_i(l,e,t):$u(l,Oe.memoizedState,e,t)},useTransition:function(){var e=ki(xl)[0],t=$e().memoizedState;return[typeof e=="boolean"?e:wn(e),t]},useSyncExternalStore:Eu,useId:Pu,useHostTransitionStatus:Mi,useFormState:Hu,useActionState:Hu,useOptimistic:function(e,t){var l=$e();return Oe!==null?_u(l,Oe,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Ni,useCacheRefresh:ed};sd.useEffectEvent=Yu;function Oi(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 Di={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=zt(),s=_l(a);s.payload=t,l!=null&&(s.callback=l),t=Rl(e,s,a),t!==null&&(Tt(t,e,a),kn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=zt(),s=_l(a);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Rl(e,s,a),t!==null&&(Tt(t,e,a),kn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=zt(),a=_l(l);a.tag=2,t!=null&&(a.callback=t),t=Rl(e,a,l),t!==null&&(Tt(t,e,l),kn(t,e,l))}};function rd(e,t,l,a,s,r,u){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,u):t.prototype&&t.prototype.isPureReactComponent?!vn(l,a)||!vn(s,r):!0}function id(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&&Di.enqueueReplaceState(t,t.state,null)}function fa(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 cd(e){ms(e)}function od(e){console.error(e)}function ud(e){ms(e)}function Bs(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function dd(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 Bi(e,t,l){return l=_l(l),l.tag=3,l.payload={element:null},l.callback=function(){Bs(e,t)},l}function fd(e){return e=_l(e),e.tag=3,e}function xd(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(){dd(t,l,a)}}var u=l.stateNode;u!==null&&typeof u.componentDidCatch=="function"&&(e.callback=function(){dd(t,l,a),typeof s!="function"&&(Bl===null?Bl=new Set([this]):Bl.add(this));var x=a.stack;this.componentDidCatch(a.value,{componentStack:x!==null?x:""})})}function ap(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=wt.current,l!==null){switch(l.tag){case 31:case 13:return Gt===null?$s():l.alternate===null&&Ke===0&&(Ke=3),l.flags&=-257,l.flags|=65536,l.lanes=s,a===Es?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),cc(e,a,s)),!1;case 22:return l.flags|=65536,a===Es?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)),cc(e,a,s)),!1}throw Error(d(435,l.tag))}return cc(e,a,s),$s(),!1}if(Ee)return t=wt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==li&&(e=Error(d(422),{cause:a}),bn(Bt(e,l)))):(a!==li&&(t=Error(d(423),{cause:a}),bn(Bt(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Bt(a,l),s=Bi(e.stateNode,a,s),xi(e,s),Ke!==4&&(Ke=2)),!1;var r=Error(d(520),{cause:a});if(r=Bt(r,l),Hn===null?Hn=[r]:Hn.push(r),Ke!==4&&(Ke=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=Bi(l.stateNode,a,e),xi(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=fd(s),xd(s,e,l,a),xi(l,s),!1}l=l.return}while(l!==null);return!1}var Ui=Error(d(461)),Ie=!1;function ct(e,t,l,a){t.child=e===null?vu(t,null,l,a):ua(t,e.child,l,a)}function md(e,t,l,a,s){l=l.render;var r=t.ref;if("ref"in a){var u={};for(var x in a)x!=="ref"&&(u[x]=a[x])}else u=a;return ra(t),a=gi(e,t,l,u,r,s),x=bi(),e!==null&&!Ie?(ji(e,t,s),ml(e,t,s)):(Ee&&x&&ei(t),t.flags|=1,ct(e,t,a,s),t.child)}function pd(e,t,l,a,s){if(e===null){var r=l.type;return typeof r=="function"&&!Fr(r)&&r.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=r,hd(e,t,r,a,s)):(e=ys(l.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!Zi(e,s)){var u=r.memoizedProps;if(l=l.compare,l=l!==null?l:vn,l(u,a)&&e.ref===t.ref)return ml(e,t,s)}return t.flags|=1,e=cl(r,a),e.ref=t.ref,e.return=t,t.child=e}function hd(e,t,l,a,s){if(e!==null){var r=e.memoizedProps;if(vn(r,a)&&e.ref===t.ref)if(Ie=!1,t.pendingProps=a=r,Zi(e,s))(e.flags&131072)!==0&&(Ie=!0);else return t.lanes=e.lanes,ml(e,t,s)}return Hi(e,t,l,a,s)}function vd(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 yd(e,t,r,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ss(t,r!==null?r.cachePool:null),r!==null?bu(t,r):pi(),ju(t);else return a=t.lanes=536870912,yd(e,t,r!==null?r.baseLanes|l:l,l,a)}else r!==null?(Ss(t,r.cachePool),bu(t,r),zl(),t.memoizedState=null):(e!==null&&Ss(t,null),pi(),zl());return ct(e,t,s,l),t.child}function Mn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function yd(e,t,l,a,s){var r=oi();return r=r===null?null:{parent:We._currentValue,pool:r},t.memoizedState={baseLanes:l,cachePool:r},e!==null&&Ss(t,null),pi(),ju(t),e!==null&&Oa(e,t,a,!0),t.childLanes=s,null}function Us(e,t){return t=qs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function gd(e,t,l){return ua(t,e.child,null,l),e=Us(t,t.pendingProps),e.flags|=2,_t(t),t.memoizedState=null,e}function np(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=Us(t,a),t.lanes=536870912,Mn(null,e);if(vi(t),(e=qe)?(e=Mf(e,qt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:kl!==null?{id:It,overflow:Pt}:null,retryLane:536870912,hydrationErrors:null},l=lu(e),l.return=t,t.child=l,rt=t,qe=null)):e=null,e===null)throw Cl(t);return t.lanes=536870912,null}return Us(t,a)}var r=e.memoizedState;if(r!==null){var u=r.dehydrated;if(vi(t),s)if(t.flags&256)t.flags&=-257,t=gd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(d(558));else if(Ie||Oa(e,t,l,!1),s=(l&e.childLanes)!==0,Ie||s){if(a=Ue,a!==null&&(u=co(a,l),u!==0&&u!==r.retryLane))throw r.retryLane=u,la(e,u),Tt(a,e,u),Ui;$s(),t=gd(e,t,l)}else e=r.treeContext,qe=Yt(u.nextSibling),rt=t,Ee=!0,Tl=null,qt=!1,e!==null&&su(t,e),t=Us(t,a),t.flags|=4096;return t}return e=cl(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hs(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(d(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Hi(e,t,l,a,s){return ra(t),l=gi(e,t,l,a,void 0,s),a=bi(),e!==null&&!Ie?(ji(e,t,s),ml(e,t,s)):(Ee&&a&&ei(t),t.flags|=1,ct(e,t,l,s),t.child)}function bd(e,t,l,a,s,r){return ra(t),t.updateQueue=null,l=Nu(t,a,l,s),Su(e),a=bi(),e!==null&&!Ie?(ji(e,t,r),ml(e,t,r)):(Ee&&a&&ei(t),t.flags|=1,ct(e,t,l,r),t.child)}function jd(e,t,l,a,s){if(ra(t),t.stateNode===null){var r=Ra,u=l.contextType;typeof u=="object"&&u!==null&&(r=it(u)),r=new l(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Di,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},di(t),u=l.contextType,r.context=typeof u=="object"&&u!==null?it(u):Ra,r.state=t.memoizedState,u=l.getDerivedStateFromProps,typeof u=="function"&&(Oi(t,l,u,a),r.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(u=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),u!==r.state&&Di.enqueueReplaceState(r,r.state,null),Cn(t,a,r,s),Tn(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var x=t.memoizedProps,j=fa(l,x);r.props=j;var _=r.context,D=l.contextType;u=Ra,typeof D=="object"&&D!==null&&(u=it(D));var H=l.getDerivedStateFromProps;D=typeof H=="function"||typeof r.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,D||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(x||_!==u)&&id(t,r,a,u),wl=!1;var M=t.memoizedState;r.state=M,Cn(t,a,r,s),Tn(),_=t.memoizedState,x||M!==_||wl?(typeof H=="function"&&(Oi(t,l,H,a),_=t.memoizedState),(j=wl||rd(t,l,j,a,M,_,u))?(D||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.props=a,r.state=_,r.context=u,a=j):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,fi(e,t),u=t.memoizedProps,D=fa(l,u),r.props=D,H=t.pendingProps,M=r.context,_=l.contextType,j=Ra,typeof _=="object"&&_!==null&&(j=it(_)),x=l.getDerivedStateFromProps,(_=typeof x=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(u!==H||M!==j)&&id(t,r,a,j),wl=!1,M=t.memoizedState,r.state=M,Cn(t,a,r,s),Tn();var L=t.memoizedState;u!==H||M!==L||wl||e!==null&&e.dependencies!==null&&bs(e.dependencies)?(typeof x=="function"&&(Oi(t,l,x,a),L=t.memoizedState),(D=wl||rd(t,l,D,a,M,L,j)||e!==null&&e.dependencies!==null&&bs(e.dependencies))?(_||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,L,j),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,L,j)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||u===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=L),r.props=a,r.state=L,r.context=j,a=D):(typeof r.componentDidUpdate!="function"||u===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,Hs(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=ua(t,e.child,null,s),t.child=ua(t,null,l,s)):ct(e,t,l,s),t.memoizedState=r.state,e=t.child):e=ml(e,t,s),e}function Sd(e,t,l,a){return na(),t.flags|=256,ct(e,t,l,a),t.child}var qi={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gi(e){return{baseLanes:e,cachePool:du()}}function Yi(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Mt),e}function Nd(e,t,l){var a=t.pendingProps,s=!1,r=(t.flags&128)!==0,u;if((u=r)||(u=e!==null&&e.memoizedState===null?!1:(Je.current&2)!==0),u&&(s=!0,t.flags&=-129),u=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(s?Ml(t):zl(),(e=qe)?(e=Mf(e,qt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:kl!==null?{id:It,overflow:Pt}:null,retryLane:536870912,hydrationErrors:null},l=lu(e),l.return=t,t.child=l,rt=t,qe=null)):e=null,e===null)throw Cl(t);return Ec(e)?t.lanes=32:t.lanes=536870912,null}var x=a.children;return a=a.fallback,s?(zl(),s=t.mode,x=qs({mode:"hidden",children:x},s),a=aa(a,s,l,null),x.return=t,a.return=t,x.sibling=a,t.child=x,a=t.child,a.memoizedState=Gi(l),a.childLanes=Yi(e,u,l),t.memoizedState=qi,Mn(null,a)):(Ml(t),Vi(t,x))}var j=e.memoizedState;if(j!==null&&(x=j.dehydrated,x!==null)){if(r)t.flags&256?(Ml(t),t.flags&=-257,t=Qi(e,t,l)):t.memoizedState!==null?(zl(),t.child=e.child,t.flags|=128,t=null):(zl(),x=a.fallback,s=t.mode,a=qs({mode:"visible",children:a.children},s),x=aa(x,s,l,null),x.flags|=2,a.return=t,x.return=t,a.sibling=x,t.child=a,ua(t,e.child,null,l),a=t.child,a.memoizedState=Gi(l),a.childLanes=Yi(e,u,l),t.memoizedState=qi,t=Mn(null,a));else if(Ml(t),Ec(x)){if(u=x.nextSibling&&x.nextSibling.dataset,u)var _=u.dgst;u=_,a=Error(d(419)),a.stack="",a.digest=u,bn({value:a,source:null,stack:null}),t=Qi(e,t,l)}else if(Ie||Oa(e,t,l,!1),u=(l&e.childLanes)!==0,Ie||u){if(u=Ue,u!==null&&(a=co(u,l),a!==0&&a!==j.retryLane))throw j.retryLane=a,la(e,a),Tt(u,e,a),Ui;Nc(x)||$s(),t=Qi(e,t,l)}else Nc(x)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,qe=Yt(x.nextSibling),rt=t,Ee=!0,Tl=null,qt=!1,e!==null&&su(t,e),t=Vi(t,a.children),t.flags|=4096);return t}return s?(zl(),x=a.fallback,s=t.mode,j=e.child,_=j.sibling,a=cl(j,{mode:"hidden",children:a.children}),a.subtreeFlags=j.subtreeFlags&65011712,_!==null?x=cl(_,x):(x=aa(x,s,l,null),x.flags|=2),x.return=t,a.return=t,a.sibling=x,t.child=a,Mn(null,a),a=t.child,x=e.child.memoizedState,x===null?x=Gi(l):(s=x.cachePool,s!==null?(j=We._currentValue,s=s.parent!==j?{parent:j,pool:j}:s):s=du(),x={baseLanes:x.baseLanes|l,cachePool:s}),a.memoizedState=x,a.childLanes=Yi(e,u,l),t.memoizedState=qi,Mn(e.child,a)):(Ml(t),l=e.child,e=l.sibling,l=cl(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(u=t.deletions,u===null?(t.deletions=[e],t.flags|=16):u.push(e)),t.child=l,t.memoizedState=null,l)}function Vi(e,t){return t=qs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function qs(e,t){return e=At(22,e,null,t),e.lanes=0,e}function Qi(e,t,l){return ua(t,e.child,null,l),e=Vi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ed(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),si(e.return,t,l)}function Xi(e,t,l,a,s,r){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:s,treeForkCount:r}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=a,u.tail=l,u.tailMode=s,u.treeForkCount=r)}function kd(e,t,l){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var u=Je.current,x=(u&2)!==0;if(x?(u=u&1|2,t.flags|=128):u&=1,X(Je,u),ct(e,t,a,l),a=Ee?gn:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ed(e,l,t);else if(e.tag===19)Ed(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&&As(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),Xi(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&&As(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}Xi(t,!0,l,null,r,a);break;case"together":Xi(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function ml(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Dl|=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(d(153));if(t.child!==null){for(e=t.child,l=cl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=cl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Zi(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&bs(e)))}function sp(e,t,l){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Al(t,We,e.memoizedState.cache),na();break;case 27:case 5:tt(t);break;case 4:ue(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,vi(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?Nd(e,t,l):(Ml(t),e=ml(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 kd(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),X(Je,Je.current),a)break;return null;case 22:return t.lanes=0,vd(e,t,l,t.pendingProps);case 24:Al(t,We,e.memoizedState.cache)}return ml(e,t,l)}function Td(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ie=!0;else{if(!Zi(e,l)&&(t.flags&128)===0)return Ie=!1,sp(e,t,l);Ie=(e.flags&131072)!==0}else Ie=!1,Ee&&(t.flags&1048576)!==0&&nu(t,gn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ca(t.elementType),t.type=e,typeof e=="function")Fr(e)?(a=fa(e,a),t.tag=1,t=jd(null,t,e,a,l)):(t.tag=0,t=Hi(null,t,e,a,l));else{if(e!=null){var s=e.$$typeof;if(s===G){t.tag=11,t=md(null,t,e,a,l);break e}else if(s===$){t.tag=14,t=pd(null,t,e,a,l);break e}}throw t=ie(e)||e,Error(d(306,t,""))}}return t;case 0:return Hi(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,s=fa(a,t.pendingProps),jd(e,t,a,s,l);case 3:e:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(d(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,fi(e,t),Cn(t,a,null,l);var u=t.memoizedState;if(a=u.cache,Al(t,We,a),a!==r.cache&&ri(t,[We],l,!0),Tn(),a=u.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:u.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Sd(e,t,a,l);break e}else if(a!==s){s=Bt(Error(d(424)),t),bn(s),t=Sd(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(qe=Yt(e.firstChild),rt=t,Ee=!0,Tl=null,qt=!0,l=vu(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(na(),a===s){t=ml(e,t,l);break e}ct(e,t,a,l)}t=t.child}return t;case 26:return Hs(e,t),e===null?(l=Uf(t.type,null,t.pendingProps,null))?t.memoizedState=l:Ee||(l=t.type,e=t.pendingProps,a=lr(Q.current).createElement(l),a[st]=t,a[bt]=e,ot(a,l,e),lt(a),t.stateNode=a):t.memoizedState=Uf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return tt(t),e===null&&Ee&&(a=t.stateNode=Of(t.type,t.pendingProps,Q.current),rt=t,qt=!0,s=qe,Gl(t.type)?(kc=s,qe=Yt(a.firstChild)):qe=s),ct(e,t,t.pendingProps.children,l),Hs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((s=a=qe)&&(a=Op(a,t.type,t.pendingProps,qt),a!==null?(t.stateNode=a,rt=t,qe=Yt(a.firstChild),qt=!1,s=!0):s=!1),s||Cl(t)),tt(t),s=t.type,r=t.pendingProps,u=e!==null?e.memoizedProps:null,a=r.children,bc(s,r)?a=null:u!==null&&bc(s,u)&&(t.flags|=32),t.memoizedState!==null&&(s=gi(e,t,Wm,null,null,l),Kn._currentValue=s),Hs(e,t),ct(e,t,a,l),t.child;case 6:return e===null&&Ee&&((e=l=qe)&&(l=Dp(l,t.pendingProps,qt),l!==null?(t.stateNode=l,rt=t,qe=null,e=!0):e=!1),e||Cl(t)),null;case 13:return Nd(e,t,l);case 4:return ue(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ua(t,null,a,l):ct(e,t,a,l),t.child;case 11:return md(e,t,t.type,t.pendingProps,l);case 7:return ct(e,t,t.pendingProps,l),t.child;case 8:return ct(e,t,t.pendingProps.children,l),t.child;case 12:return ct(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,Al(t,t.type,a.value),ct(e,t,a.children,l),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,ra(t),s=it(s),a=a(s),t.flags|=1,ct(e,t,a,l),t.child;case 14:return pd(e,t,t.type,t.pendingProps,l);case 15:return hd(e,t,t.type,t.pendingProps,l);case 19:return kd(e,t,l);case 31:return np(e,t,l);case 22:return vd(e,t,l,t.pendingProps);case 24:return ra(t),a=it(We),e===null?(s=oi(),s===null&&(s=Ue,r=ii(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=l),s=r),t.memoizedState={parent:a,cache:s},di(t),Al(t,We,s)):((e.lanes&l)!==0&&(fi(e,t),Cn(t,null,null,l),Tn()),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,We,a)):(a=r.cache,Al(t,We,a),a!==s.cache&&ri(t,[We],l,!0))),ct(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(d(156,t.tag))}function pl(e){e.flags|=4}function Ki(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(Pd())e.flags|=8192;else throw oa=Es,ui}else e.flags&=-16777217}function Cd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Vf(t))if(Pd())e.flags|=8192;else throw oa=Es,ui}function Gs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?so():536870912,e.lanes|=t,Ka|=t)}function zn(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 Ge(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 rp(e,t,l){var a=t.pendingProps;switch(ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(t),null;case 1:return Ge(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),dl(We),he(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(La(t)?pl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ai())),Ge(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(pl(t),r!==null?(Ge(t),Cd(t,r)):(Ge(t),Ki(t,s,null,a,l))):r?r!==e.memoizedState?(pl(t),Ge(t),Cd(t,r)):(Ge(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&pl(t),Ge(t),Ki(t,s,e,a,l)),null;case 27:if(nt(t),l=Q.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&pl(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return Ge(t),null}e=R.current,La(t)?ru(t):(e=Of(s,a,l),t.stateNode=e,pl(t))}return Ge(t),null;case 5:if(nt(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&pl(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return Ge(t),null}if(r=R.current,La(t))ru(t);else{var u=lr(Q.current);switch(r){case 1:r=u.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=u.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=u.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=u.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=u.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?u.createElement("select",{is:a.is}):u.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?u.createElement(s,{is:a.is}):u.createElement(s)}}r[st]=t,r[bt]=a;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=r;e:switch(ot(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&&pl(t)}}return Ge(t),Ki(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&pl(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(d(166));if(e=Q.current,La(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=rt,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[st]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Ef(e.nodeValue,l)),e||Cl(t,!0)}else e=lr(e).createTextNode(a),e[st]=t,t.stateNode=e}return Ge(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=La(t),l!==null){if(e===null){if(!a)throw Error(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[st]=t}else na(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ge(t),e=!1}else l=ai(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(_t(t),t):(_t(t),null);if((t.flags&128)!==0)throw Error(d(558))}return Ge(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=La(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(d(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(d(317));s[st]=t}else na(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ge(t),s=!1}else s=ai(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(_t(t),t):(_t(t),null)}return _t(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),Gs(t,t.updateQueue),Ge(t),null);case 4:return he(),e===null&&pc(t.stateNode.containerInfo),Ge(t),null;case 10:return dl(t.type),Ge(t),null;case 19:if(O(Je),a=t.memoizedState,a===null)return Ge(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)zn(a,!1);else{if(Ke!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=As(e),r!==null){for(t.flags|=128,zn(a,!1),e=r.updateQueue,t.updateQueue=e,Gs(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)tu(l,e),l=l.sibling;return X(Je,Je.current&1|2),Ee&&ol(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Le()>Zs&&(t.flags|=128,s=!0,zn(a,!1),t.lanes=4194304)}else{if(!s)if(e=As(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Gs(t,e),zn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!Ee)return Ge(t),null}else 2*Le()-a.renderingStartTime>Zs&&l!==536870912&&(t.flags|=128,s=!0,zn(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=Le(),e.sibling=null,l=Je.current,X(Je,s?l&1|2:l&1),Ee&&ol(t,a.treeForkCount),e):(Ge(t),null);case 22:case 23:return _t(t),hi(),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&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),l=t.updateQueue,l!==null&&Gs(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&&O(ia),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),dl(We),Ge(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function ip(e,t){switch(ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return dl(We),he(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return nt(t),null;case 31:if(t.memoizedState!==null){if(_t(t),t.alternate===null)throw Error(d(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_t(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(Je),null;case 4:return he(),null;case 10:return dl(t.type),null;case 22:case 23:return _t(t),hi(),e!==null&&O(ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return dl(We),null;case 25:return null;default:return null}}function Ad(e,t){switch(ti(t),t.tag){case 3:dl(We),he();break;case 26:case 27:case 5:nt(t);break;case 4:he();break;case 31:t.memoizedState!==null&&_t(t);break;case 13:_t(t);break;case 19:O(Je);break;case 10:dl(t.type);break;case 22:case 23:_t(t),hi(),e!==null&&O(ia);break;case 24:dl(We)}}function Ln(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,u=l.inst;a=r(),u.destroy=a}l=l.next}while(l!==s)}}catch(x){ze(t,t.return,x)}}function Ll(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 u=a.inst,x=u.destroy;if(x!==void 0){u.destroy=void 0,s=t;var j=l,_=x;try{_()}catch(D){ze(s,j,D)}}}a=a.next}while(a!==r)}}catch(D){ze(t,t.return,D)}}function wd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{gu(t,l)}catch(a){ze(e,e.return,a)}}}function _d(e,t,l){l.props=fa(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){ze(e,t,a)}}function On(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){ze(e,t,s)}}function el(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(s){ze(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){ze(e,t,s)}else l.current=null}function Rd(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){ze(e,e.return,s)}}function Ji(e,t,l){try{var a=e.stateNode;wp(a,e.type,l,t),a[bt]=t}catch(s){ze(e,e.return,s)}}function Md(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Gl(e.type)||e.tag===4}function $i(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Md(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 Wi(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=rl));else if(a!==4&&(a===27&&Gl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Wi(e,t,l),e=e.sibling;e!==null;)Wi(e,t,l),e=e.sibling}function Ys(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(Ys(e,t,l),e=e.sibling;e!==null;)Ys(e,t,l),e=e.sibling}function zd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ot(t,a,l),t[st]=e,t[bt]=l}catch(r){ze(e,e.return,r)}}var hl=!1,Pe=!1,Fi=!1,Ld=typeof WeakSet=="function"?WeakSet:Set,at=null;function cp(e,t){if(e=e.containerInfo,yc=or,e=Zo(e),Qr(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 u=0,x=-1,j=-1,_=0,D=0,H=e,M=null;t:for(;;){for(var L;H!==l||s!==0&&H.nodeType!==3||(x=u+s),H!==r||a!==0&&H.nodeType!==3||(j=u+a),H.nodeType===3&&(u+=H.nodeValue.length),(L=H.firstChild)!==null;)M=H,H=L;for(;;){if(H===e)break t;if(M===l&&++_===s&&(x=u),M===r&&++D===a&&(j=u),(L=H.nextSibling)!==null)break;H=M,M=H.parentNode}H=L}l=x===-1||j===-1?null:{start:x,end:j}}else l=null}l=l||{start:0,end:0}}else l=null;for(gc={focusedElem:e,selectionRange:l},or=!1,at=t;at!==null;)if(t=at,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,at=e;else for(;at!==null;){switch(t=at,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 ee=fa(l.type,s);e=a.getSnapshotBeforeUpdate(ee,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(oe){ze(l,l.return,oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Sc(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Sc(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(d(163))}if(e=t.sibling,e!==null){e.return=t.return,at=e;break}at=t.return}}function Od(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:yl(e,l),a&4&&Ln(5,l);break;case 1:if(yl(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(u){ze(l,l.return,u)}else{var s=fa(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(u){ze(l,l.return,u)}}a&64&&wd(l),a&512&&On(l,l.return);break;case 3:if(yl(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{gu(e,t)}catch(u){ze(l,l.return,u)}}break;case 27:t===null&&a&4&&zd(l);case 26:case 5:yl(e,l),t===null&&a&4&&Rd(l),a&512&&On(l,l.return);break;case 12:yl(e,l);break;case 31:yl(e,l),a&4&&Ud(e,l);break;case 13:yl(e,l),a&4&&Hd(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=vp.bind(null,l),Bp(e,l))));break;case 22:if(a=l.memoizedState!==null||hl,!a){t=t!==null&&t.memoizedState!==null||Pe,s=hl;var r=Pe;hl=a,(Pe=t)&&!r?gl(e,l,(l.subtreeFlags&8772)!==0):yl(e,l),hl=s,Pe=r}break;case 30:break;default:yl(e,l)}}function Dd(e){var t=e.alternate;t!==null&&(e.alternate=null,Dd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Cr(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 Ve=null,St=!1;function vl(e,t,l){for(l=l.child;l!==null;)Bd(e,t,l),l=l.sibling}function Bd(e,t,l){if(Qe&&typeof Qe.onCommitFiberUnmount=="function")try{Qe.onCommitFiberUnmount(xt,l)}catch{}switch(l.tag){case 26:Pe||el(l,t),vl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Pe||el(l,t);var a=Ve,s=St;Gl(l.type)&&(Ve=l.stateNode,St=!1),vl(e,t,l),Qn(l.stateNode),Ve=a,St=s;break;case 5:Pe||el(l,t);case 6:if(a=Ve,s=St,Ve=null,vl(e,t,l),Ve=a,St=s,Ve!==null)if(St)try{(Ve.nodeType===9?Ve.body:Ve.nodeName==="HTML"?Ve.ownerDocument.body:Ve).removeChild(l.stateNode)}catch(r){ze(l,t,r)}else try{Ve.removeChild(l.stateNode)}catch(r){ze(l,t,r)}break;case 18:Ve!==null&&(St?(e=Ve,_f(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),tn(e)):_f(Ve,l.stateNode));break;case 4:a=Ve,s=St,Ve=l.stateNode.containerInfo,St=!0,vl(e,t,l),Ve=a,St=s;break;case 0:case 11:case 14:case 15:Ll(2,l,t),Pe||Ll(4,l,t),vl(e,t,l);break;case 1:Pe||(el(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&_d(l,t,a)),vl(e,t,l);break;case 21:vl(e,t,l);break;case 22:Pe=(a=Pe)||l.memoizedState!==null,vl(e,t,l),Pe=a;break;default:vl(e,t,l)}}function Ud(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{tn(e)}catch(l){ze(t,t.return,l)}}}function Hd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{tn(e)}catch(l){ze(t,t.return,l)}}function op(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ld),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ld),t;default:throw Error(d(435,e.tag))}}function Vs(e,t){var l=op(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var s=yp.bind(null,e,a);a.then(s,s)}})}function Nt(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var s=l[a],r=e,u=t,x=u;e:for(;x!==null;){switch(x.tag){case 27:if(Gl(x.type)){Ve=x.stateNode,St=!1;break e}break;case 5:Ve=x.stateNode,St=!1;break e;case 3:case 4:Ve=x.stateNode.containerInfo,St=!0;break e}x=x.return}if(Ve===null)throw Error(d(160));Bd(r,u,s),Ve=null,St=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)qd(t,e),t=t.sibling}var Kt=null;function qd(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Nt(t,e),Et(e),a&4&&(Ll(3,e,e.return),Ln(3,e),Ll(5,e,e.return));break;case 1:Nt(t,e),Et(e),a&512&&(Pe||l===null||el(l,l.return)),a&64&&hl&&(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(Nt(t,e),Et(e),a&512&&(Pe||l===null||el(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[cn]||r[st]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(a),s.head.insertBefore(r,s.querySelector("head > title"))),ot(r,a,l),r[st]=e,lt(r),a=r;break e;case"link":var u=Gf("link","href",s).get(a+(l.href||""));if(u){for(var x=0;x<u.length;x++)if(r=u[x],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)){u.splice(x,1);break t}}r=s.createElement(a),ot(r,a,l),s.head.appendChild(r);break;case"meta":if(u=Gf("meta","content",s).get(a+(l.content||""))){for(x=0;x<u.length;x++)if(r=u[x],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)){u.splice(x,1);break t}}r=s.createElement(a),ot(r,a,l),s.head.appendChild(r);break;default:throw Error(d(468,a))}r[st]=e,lt(r),a=r}e.stateNode=a}else Yf(s,e.type,e.stateNode);else e.stateNode=qf(s,a,e.memoizedProps);else r!==a?(r===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):r.count--,a===null?Yf(s,e.type,e.stateNode):qf(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Ji(e,e.memoizedProps,l.memoizedProps)}break;case 27:Nt(t,e),Et(e),a&512&&(Pe||l===null||el(l,l.return)),l!==null&&a&4&&Ji(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Nt(t,e),Et(e),a&512&&(Pe||l===null||el(l,l.return)),e.flags&32){s=e.stateNode;try{Ea(s,"")}catch(ee){ze(e,e.return,ee)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,Ji(e,s,l!==null?l.memoizedProps:s)),a&1024&&(Fi=!0);break;case 6:if(Nt(t,e),Et(e),a&4){if(e.stateNode===null)throw Error(d(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(ee){ze(e,e.return,ee)}}break;case 3:if(sr=null,s=Kt,Kt=ar(t.containerInfo),Nt(t,e),Kt=s,Et(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{tn(t.containerInfo)}catch(ee){ze(e,e.return,ee)}Fi&&(Fi=!1,Gd(e));break;case 4:a=Kt,Kt=ar(e.stateNode.containerInfo),Nt(t,e),Et(e),Kt=a;break;case 12:Nt(t,e),Et(e);break;case 31:Nt(t,e),Et(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Vs(e,a)));break;case 13:Nt(t,e),Et(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Xs=Le()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Vs(e,a)));break;case 22:s=e.memoizedState!==null;var j=l!==null&&l.memoizedState!==null,_=hl,D=Pe;if(hl=_||s,Pe=D||j,Nt(t,e),Pe=D,hl=_,Et(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||j||hl||Pe||xa(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){j=l=t;try{if(r=j.stateNode,s)u=r.style,typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none";else{x=j.stateNode;var H=j.memoizedProps.style,M=H!=null&&H.hasOwnProperty("display")?H.display:null;x.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(ee){ze(j,j.return,ee)}}}else if(t.tag===6){if(l===null){j=t;try{j.stateNode.nodeValue=s?"":j.memoizedProps}catch(ee){ze(j,j.return,ee)}}}else if(t.tag===18){if(l===null){j=t;try{var L=j.stateNode;s?Rf(L,!0):Rf(j.stateNode,!1)}catch(ee){ze(j,j.return,ee)}}}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,Vs(e,l))));break;case 19:Nt(t,e),Et(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Vs(e,a)));break;case 30:break;case 21:break;default:Nt(t,e),Et(e)}}function Et(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(Md(a)){l=a;break}a=a.return}if(l==null)throw Error(d(160));switch(l.tag){case 27:var s=l.stateNode,r=$i(e);Ys(e,r,s);break;case 5:var u=l.stateNode;l.flags&32&&(Ea(u,""),l.flags&=-33);var x=$i(e);Ys(e,x,u);break;case 3:case 4:var j=l.stateNode.containerInfo,_=$i(e);Wi(e,_,j);break;default:throw Error(d(161))}}catch(D){ze(e,e.return,D)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Gd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Od(e,t.alternate,t),t=t.sibling}function xa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ll(4,t,t.return),xa(t);break;case 1:el(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&_d(t,t.return,l),xa(t);break;case 27:Qn(t.stateNode);case 26:case 5:el(t,t.return),xa(t);break;case 22:t.memoizedState===null&&xa(t);break;case 30:xa(t);break;default:xa(t)}e=e.sibling}}function gl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,u=r.flags;switch(r.tag){case 0:case 11:case 15:gl(s,r,l),Ln(4,r);break;case 1:if(gl(s,r,l),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(_){ze(a,a.return,_)}if(a=r,s=a.updateQueue,s!==null){var x=a.stateNode;try{var j=s.shared.hiddenCallbacks;if(j!==null)for(s.shared.hiddenCallbacks=null,s=0;s<j.length;s++)yu(j[s],x)}catch(_){ze(a,a.return,_)}}l&&u&64&&wd(r),On(r,r.return);break;case 27:zd(r);case 26:case 5:gl(s,r,l),l&&a===null&&u&4&&Rd(r),On(r,r.return);break;case 12:gl(s,r,l);break;case 31:gl(s,r,l),l&&u&4&&Ud(s,r);break;case 13:gl(s,r,l),l&&u&4&&Hd(s,r);break;case 22:r.memoizedState===null&&gl(s,r,l),On(r,r.return);break;case 30:break;default:gl(s,r,l)}t=t.sibling}}function Ii(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&&jn(l))}function Pi(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&jn(e))}function Jt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Yd(e,t,l,a),t=t.sibling}function Yd(e,t,l,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Jt(e,t,l,a),s&2048&&Ln(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&&jn(e)));break;case 12:if(s&2048){Jt(e,t,l,a),e=t.stateNode;try{var r=t.memoizedProps,u=r.id,x=r.onPostCommit;typeof x=="function"&&x(u,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){ze(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,u=t.alternate,t.memoizedState!==null?r._visibility&2?Jt(e,t,l,a):Dn(e,t):r._visibility&2?Jt(e,t,l,a):(r._visibility|=2,Qa(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Ii(u,t);break;case 24:Jt(e,t,l,a),s&2048&&Pi(t.alternate,t);break;default:Jt(e,t,l,a)}}function Qa(e,t,l,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,u=t,x=l,j=a,_=u.flags;switch(u.tag){case 0:case 11:case 15:Qa(r,u,x,j,s),Ln(8,u);break;case 23:break;case 22:var D=u.stateNode;u.memoizedState!==null?D._visibility&2?Qa(r,u,x,j,s):Dn(r,u):(D._visibility|=2,Qa(r,u,x,j,s)),s&&_&2048&&Ii(u.alternate,u);break;case 24:Qa(r,u,x,j,s),s&&_&2048&&Pi(u.alternate,u);break;default:Qa(r,u,x,j,s)}t=t.sibling}}function Dn(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:Dn(l,a),s&2048&&Ii(a.alternate,a);break;case 24:Dn(l,a),s&2048&&Pi(a.alternate,a);break;default:Dn(l,a)}t=t.sibling}}var Bn=8192;function Xa(e,t,l){if(e.subtreeFlags&Bn)for(e=e.child;e!==null;)Vd(e,t,l),e=e.sibling}function Vd(e,t,l){switch(e.tag){case 26:Xa(e,t,l),e.flags&Bn&&e.memoizedState!==null&&$p(l,Kt,e.memoizedState,e.memoizedProps);break;case 5:Xa(e,t,l);break;case 3:case 4:var a=Kt;Kt=ar(e.stateNode.containerInfo),Xa(e,t,l),Kt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Bn,Bn=16777216,Xa(e,t,l),Bn=a):Xa(e,t,l));break;default:Xa(e,t,l)}}function Qd(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 Un(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];at=a,Zd(a,e)}Qd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xd(e),e=e.sibling}function Xd(e){switch(e.tag){case 0:case 11:case 15:Un(e),e.flags&2048&&Ll(9,e,e.return);break;case 3:Un(e);break;case 12:Un(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qs(e)):Un(e);break;default:Un(e)}}function Qs(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];at=a,Zd(a,e)}Qd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ll(8,t,t.return),Qs(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Qs(t));break;default:Qs(t)}e=e.sibling}}function Zd(e,t){for(;at!==null;){var l=at;switch(l.tag){case 0:case 11:case 15:Ll(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:jn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,at=a;else e:for(l=e;at!==null;){a=at;var s=a.sibling,r=a.return;if(Dd(a),a===l){at=null;break e}if(s!==null){s.return=r,at=s;break e}at=r}}}var up={getCacheForType:function(e){var t=it(We),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return it(We).controller.signal}},dp=typeof WeakMap=="function"?WeakMap:Map,_e=0,Ue=null,be=null,Se=0,Me=0,Rt=null,Ol=!1,Za=!1,ec=!1,bl=0,Ke=0,Dl=0,ma=0,tc=0,Mt=0,Ka=0,Hn=null,kt=null,lc=!1,Xs=0,Kd=0,Zs=1/0,Ks=null,Bl=null,et=0,Ul=null,Ja=null,jl=0,ac=0,nc=null,Jd=null,qn=0,sc=null;function zt(){return(_e&2)!==0&&Se!==0?Se&-Se:N.T!==null?dc():oo()}function $d(){if(Mt===0)if((Se&536870912)===0||Ee){var e=ts;ts<<=1,(ts&3932160)===0&&(ts=262144),Mt=e}else Mt=536870912;return e=wt.current,e!==null&&(e.flags|=32),Mt}function Tt(e,t,l){(e===Ue&&(Me===2||Me===9)||e.cancelPendingCommit!==null)&&($a(e,0),Hl(e,Se,Mt,!1)),rn(e,l),((_e&2)===0||e!==Ue)&&(e===Ue&&((_e&2)===0&&(ma|=l),Ke===4&&Hl(e,Se,Mt,!1)),tl(e))}function Wd(e,t,l){if((_e&6)!==0)throw Error(d(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||sn(e,t),s=a?mp(e,t):ic(e,t,!0),r=a;do{if(s===0){Za&&!a&&Hl(e,t,0,!1);break}else{if(l=e.current.alternate,r&&!fp(l)){s=ic(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var u=0;else u=e.pendingLanes&-536870913,u=u!==0?u:u&536870912?536870912:0;if(u!==0){t=u;e:{var x=e;s=Hn;var j=x.current.memoizedState.isDehydrated;if(j&&($a(x,u).flags|=256),u=ic(x,u,!1),u!==2){if(ec&&!j){x.errorRecoveryDisabledLanes|=r,ma|=r,s=4;break e}r=kt,kt=s,r!==null&&(kt===null?kt=r:kt.push.apply(kt,r))}s=u}if(r=!1,s!==2)continue}}if(s===1){$a(e,0),Hl(e,t,0,!0);break}e:{switch(a=e,r=s,r){case 0:case 1:throw Error(d(345));case 4:if((t&4194048)!==t)break;case 6:Hl(a,t,Mt,!Ol);break e;case 2:kt=null;break;case 3:case 5:break;default:throw Error(d(329))}if((t&62914560)===t&&(s=Xs+300-Le(),10<s)){if(Hl(a,t,Mt,!Ol),as(a,0,!0)!==0)break e;jl=t,a.timeoutHandle=Af(Fd.bind(null,a,l,kt,Ks,lc,t,Mt,ma,Ka,Ol,r,"Throttled",-0,0),s);break e}Fd(a,l,kt,Ks,lc,t,Mt,ma,Ka,Ol,r,null,-0,0)}}break}while(!0);tl(e)}function Fd(e,t,l,a,s,r,u,x,j,_,D,H,M,L){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:rl},Vd(t,r,H);var ee=(r&62914560)===r?Xs-Le():(r&4194048)===r?Kd-Le():0;if(ee=Wp(H,ee),ee!==null){jl=r,e.cancelPendingCommit=ee(sf.bind(null,e,t,r,l,a,s,u,x,j,D,H,null,M,L)),Hl(e,r,u,!_);return}}sf(e,t,r,l,a,s,u,x,j)}function fp(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(!Ct(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&=~tc,t&=~ma,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-Xe(s),u=1<<r;a[r]=-1,s&=~u}l!==0&&ro(e,l,t)}function Js(){return(_e&6)===0?(Gn(0),!1):!0}function rc(){if(be!==null){if(Me===0)var e=be.return;else e=be,ul=sa=null,Si(e),Ha=null,Nn=0,e=be;for(;e!==null;)Ad(e.alternate,e),e=e.return;be=null}}function $a(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Mp(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),jl=0,rc(),Ue=e,be=l=cl(e.current,null),Se=t,Me=0,Rt=null,Ol=!1,Za=sn(e,t),ec=!1,Ka=Mt=tc=ma=Dl=Ke=0,kt=Hn=null,lc=!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-Xe(a),r=1<<s;t|=e[s],a&=~r}return bl=t,ps(),l}function Id(e,t){fe=null,N.H=Rn,t===Ua||t===Ns?(t=mu(),Me=3):t===ui?(t=mu(),Me=4):Me=t===Ui?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Rt=t,be===null&&(Ke=1,Bs(e,Bt(t,e.current)))}function Pd(){var e=wt.current;return e===null?!0:(Se&4194048)===Se?Gt===null:(Se&62914560)===Se||(Se&536870912)!==0?e===Gt:!1}function ef(){var e=N.H;return N.H=Rn,e===null?Rn:e}function tf(){var e=N.A;return N.A=up,e}function $s(){Ke=4,Ol||(Se&4194048)!==Se&&wt.current!==null||(Za=!0),(Dl&134217727)===0&&(ma&134217727)===0||Ue===null||Hl(Ue,Se,Mt,!1)}function ic(e,t,l){var a=_e;_e|=2;var s=ef(),r=tf();(Ue!==e||Se!==t)&&(Ks=null,$a(e,t)),t=!1;var u=Ke;e:do try{if(Me!==0&&be!==null){var x=be,j=Rt;switch(Me){case 8:rc(),u=6;break e;case 3:case 2:case 9:case 6:wt.current===null&&(t=!0);var _=Me;if(Me=0,Rt=null,Wa(e,x,j,_),l&&Za){u=0;break e}break;default:_=Me,Me=0,Rt=null,Wa(e,x,j,_)}}xp(),u=Ke;break}catch(D){Id(e,D)}while(!0);return t&&e.shellSuspendCounter++,ul=sa=null,_e=a,N.H=s,N.A=r,be===null&&(Ue=null,Se=0,ps()),u}function xp(){for(;be!==null;)lf(be)}function mp(e,t){var l=_e;_e|=2;var a=ef(),s=tf();Ue!==e||Se!==t?(Ks=null,Zs=Le()+500,$a(e,t)):Za=sn(e,t);e:do try{if(Me!==0&&be!==null){t=be;var r=Rt;t:switch(Me){case 1:Me=0,Rt=null,Wa(e,t,r,1);break;case 2:case 9:if(fu(r)){Me=0,Rt=null,af(t);break}t=function(){Me!==2&&Me!==9||Ue!==e||(Me=7),tl(e)},r.then(t,t);break e;case 3:Me=7;break e;case 4:Me=5;break e;case 7:fu(r)?(Me=0,Rt=null,af(t)):(Me=0,Rt=null,Wa(e,t,r,7));break;case 5:var u=null;switch(be.tag){case 26:u=be.memoizedState;case 5:case 27:var x=be;if(u?Vf(u):x.stateNode.complete){Me=0,Rt=null;var j=x.sibling;if(j!==null)be=j;else{var _=x.return;_!==null?(be=_,Ws(_)):be=null}break t}}Me=0,Rt=null,Wa(e,t,r,5);break;case 6:Me=0,Rt=null,Wa(e,t,r,6);break;case 8:rc(),Ke=6;break e;default:throw Error(d(462))}}pp();break}catch(D){Id(e,D)}while(!0);return ul=sa=null,N.H=a,N.A=s,_e=l,be!==null?0:(Ue=null,Se=0,ps(),Ke)}function pp(){for(;be!==null&&!an();)lf(be)}function lf(e){var t=Td(e.alternate,e,bl);e.memoizedProps=e.pendingProps,t===null?Ws(e):be=t}function af(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=bd(l,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=bd(l,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:Si(t);default:Ad(l,t),t=be=tu(t,bl),t=Td(l,t,bl)}e.memoizedProps=e.pendingProps,t===null?Ws(e):be=t}function Wa(e,t,l,a){ul=sa=null,Si(t),Ha=null,Nn=0;var s=t.return;try{if(ap(e,s,t,l,Se)){Ke=1,Bs(e,Bt(l,e.current)),be=null;return}}catch(r){if(s!==null)throw be=s,r;Ke=1,Bs(e,Bt(l,e.current)),be=null;return}t.flags&32768?(Ee||a===1?e=!0:Za||(Se&536870912)!==0?e=!1:(Ol=e=!0,(a===2||a===9||a===3||a===6)&&(a=wt.current,a!==null&&a.tag===13&&(a.flags|=16384))),nf(t,e)):Ws(t)}function Ws(e){var t=e;do{if((t.flags&32768)!==0){nf(t,Ol);return}e=t.return;var l=rp(t.alternate,t,bl);if(l!==null){be=l;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Ke===0&&(Ke=5)}function nf(e,t){do{var l=ip(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);Ke=6,be=null}function sf(e,t,l,a,s,r,u,x,j){e.cancelPendingCommit=null;do Fs();while(et!==0);if((_e&6)!==0)throw Error(d(327));if(t!==null){if(t===e.current)throw Error(d(177));if(r=t.lanes|t.childLanes,r|=$r,Jx(e,l,r,u,x,j),e===Ue&&(be=Ue=null,Se=0),Ja=t,Ul=e,jl=l,ac=r,nc=s,Jd=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,gp(Re,function(){return df(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=N.T,N.T=null,s=A.p,A.p=2,u=_e,_e|=4;try{cp(e,t,l)}finally{_e=u,A.p=s,N.T=a}}et=1,rf(),cf(),of()}}function rf(){if(et===1){et=0;var e=Ul,t=Ja,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=N.T,N.T=null;var a=A.p;A.p=2;var s=_e;_e|=4;try{qd(t,e);var r=gc,u=Zo(e.containerInfo),x=r.focusedElem,j=r.selectionRange;if(u!==x&&x&&x.ownerDocument&&Xo(x.ownerDocument.documentElement,x)){if(j!==null&&Qr(x)){var _=j.start,D=j.end;if(D===void 0&&(D=_),"selectionStart"in x)x.selectionStart=_,x.selectionEnd=Math.min(D,x.value.length);else{var H=x.ownerDocument||document,M=H&&H.defaultView||window;if(M.getSelection){var L=M.getSelection(),ee=x.textContent.length,oe=Math.min(j.start,ee),Be=j.end===void 0?oe:Math.min(j.end,ee);!L.extend&&oe>Be&&(u=Be,Be=oe,oe=u);var C=Qo(x,oe),k=Qo(x,Be);if(C&&k&&(L.rangeCount!==1||L.anchorNode!==C.node||L.anchorOffset!==C.offset||L.focusNode!==k.node||L.focusOffset!==k.offset)){var w=H.createRange();w.setStart(C.node,C.offset),L.removeAllRanges(),oe>Be?(L.addRange(w),L.extend(k.node,k.offset)):(w.setEnd(k.node,k.offset),L.addRange(w))}}}}for(H=[],L=x;L=L.parentNode;)L.nodeType===1&&H.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<H.length;x++){var U=H[x];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}or=!!yc,gc=yc=null}finally{_e=s,A.p=a,N.T=l}}e.current=t,et=2}}function cf(){if(et===2){et=0;var e=Ul,t=Ja,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=N.T,N.T=null;var a=A.p;A.p=2;var s=_e;_e|=4;try{Od(e,t.alternate,t)}finally{_e=s,A.p=a,N.T=l}}et=3}}function of(){if(et===4||et===3){et=0,I();var e=Ul,t=Ja,l=jl,a=Jd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?et=5:(et=0,Ja=Ul=null,uf(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Bl=null),kr(l),t=t.stateNode,Qe&&typeof Qe.onCommitFiberRoot=="function")try{Qe.onCommitFiberRoot(xt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=N.T,s=A.p,A.p=2,N.T=null;try{for(var r=e.onRecoverableError,u=0;u<a.length;u++){var x=a[u];r(x.value,{componentStack:x.stack})}}finally{N.T=t,A.p=s}}(jl&3)!==0&&Fs(),tl(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===sc?qn++:(qn=0,sc=e):qn=0,Gn(0)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,jn(t)))}function Fs(){return rf(),cf(),of(),df()}function df(){if(et!==5)return!1;var e=Ul,t=ac;ac=0;var l=kr(jl),a=N.T,s=A.p;try{A.p=32>l?32:l,N.T=null,l=nc,nc=null;var r=Ul,u=jl;if(et=0,Ja=Ul=null,jl=0,(_e&6)!==0)throw Error(d(331));var x=_e;if(_e|=4,Xd(r.current),Yd(r,r.current,u,l),_e=x,Gn(0,!1),Qe&&typeof Qe.onPostCommitFiberRoot=="function")try{Qe.onPostCommitFiberRoot(xt,r)}catch{}return!0}finally{A.p=s,N.T=a,uf(e,t)}}function ff(e,t,l){t=Bt(l,t),t=Bi(e.stateNode,t,2),e=Rl(e,t,2),e!==null&&(rn(e,2),tl(e))}function ze(e,t,l){if(e.tag===3)ff(e,e,l);else for(;t!==null;){if(t.tag===3){ff(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=fd(2),a=Rl(t,l,2),a!==null&&(xd(l,a,t,e),rn(a,2),tl(a));break}}t=t.return}}function cc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new dp;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)||(ec=!0,s.add(l),e=hp.bind(null,e,t,l),t.then(e,e))}function hp(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ue===e&&(Se&l)===l&&(Ke===4||Ke===3&&(Se&62914560)===Se&&300>Le()-Xs?(_e&2)===0&&$a(e,0):tc|=l,Ka===Se&&(Ka=0)),tl(e)}function xf(e,t){t===0&&(t=so()),e=la(e,t),e!==null&&(rn(e,t),tl(e))}function vp(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),xf(e,l)}function yp(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(d(314))}a!==null&&a.delete(t),xf(e,l)}function gp(e,t){return Xt(e,t)}var Is=null,Fa=null,oc=!1,Ps=!1,uc=!1,ql=0;function tl(e){e!==Fa&&e.next===null&&(Fa===null?Is=Fa=e:Fa=Fa.next=e),Ps=!0,oc||(oc=!0,jp())}function Gn(e,t){if(!uc&&Ps){uc=!0;do for(var l=!1,a=Is;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var u=a.suspendedLanes,x=a.pingedLanes;r=(1<<31-Xe(42|e)+1)-1,r&=s&~(u&~x),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(l=!0,vf(a,r))}else r=Se,r=as(a,a===Ue?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||sn(a,r)||(l=!0,vf(a,r));a=a.next}while(l);uc=!1}}function bp(){mf()}function mf(){Ps=oc=!1;var e=0;ql!==0&&Rp()&&(e=ql);for(var t=Le(),l=null,a=Is;a!==null;){var s=a.next,r=pf(a,t);r===0?(a.next=null,l===null?Is=s:l.next=s,s===null&&(Fa=l)):(l=a,(e!==0||(r&3)!==0)&&(Ps=!0)),a=s}et!==0&&et!==5||Gn(e),ql!==0&&(ql=0)}function pf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var u=31-Xe(r),x=1<<u,j=s[u];j===-1?((x&l)===0||(x&a)!==0)&&(s[u]=Kx(x,t)):j<=t&&(e.expiredLanes|=x),r&=~x}if(t=Ue,l=Se,l=as(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(Me===2||Me===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Wl(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||sn(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Wl(a),kr(l)){case 2:case 8:l=yt;break;case 32:l=Re;break;case 268435456:l=ha;break;default:l=Re}return a=hf.bind(null,e),l=Xt(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Wl(a),e.callbackPriority=2,e.callbackNode=null,2}function hf(e,t){if(et!==0&&et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Fs()&&e.callbackNode!==l)return null;var a=Se;return a=as(e,e===Ue?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Wd(e,a,t),pf(e,Le()),e.callbackNode!=null&&e.callbackNode===l?hf.bind(null,e):null)}function vf(e,t){if(Fs())return null;Wd(e,t,!0)}function jp(){zp(function(){(_e&6)!==0?Xt(He,bp):mf()})}function dc(){if(ql===0){var e=Da;e===0&&(e=es,es<<=1,(es&261888)===0&&(es=256)),ql=e}return ql}function yf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:is(""+e)}function gf(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 Sp(e,t,l,a,s){if(t==="submit"&&l&&l.stateNode===s){var r=yf((s[bt]||null).action),u=a.submitter;u&&(t=(t=u[bt]||null)?yf(t.formAction):u.getAttribute("formAction"),t!==null&&(r=t,u=null));var x=new ds("action","action",null,a,s);e.push({event:x,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ql!==0){var j=u?gf(s,u):new FormData(s);Ri(l,{pending:!0,data:j,method:s.method,action:r},null,j)}}else typeof r=="function"&&(x.preventDefault(),j=u?gf(s,u):new FormData(s),Ri(l,{pending:!0,data:j,method:s.method,action:r},r,j))},currentTarget:s}]})}}for(var fc=0;fc<Jr.length;fc++){var xc=Jr[fc],Np=xc.toLowerCase(),Ep=xc[0].toUpperCase()+xc.slice(1);Zt(Np,"on"+Ep)}Zt($o,"onAnimationEnd"),Zt(Wo,"onAnimationIteration"),Zt(Fo,"onAnimationStart"),Zt("dblclick","onDoubleClick"),Zt("focusin","onFocus"),Zt("focusout","onBlur"),Zt(qm,"onTransitionRun"),Zt(Gm,"onTransitionStart"),Zt(Ym,"onTransitionCancel"),Zt(Io,"onTransitionEnd"),Sa("onMouseEnter",["mouseout","mouseover"]),Sa("onMouseLeave",["mouseout","mouseover"]),Sa("onPointerEnter",["pointerout","pointerover"]),Sa("onPointerLeave",["pointerout","pointerover"]),Il("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Il("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Il("onBeforeInput",["compositionend","keypress","textInput","paste"]),Il("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Il("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Il("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yn="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(" "),kp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yn));function bf(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 u=a.length-1;0<=u;u--){var x=a[u],j=x.instance,_=x.currentTarget;if(x=x.listener,j!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=_;try{r(s)}catch(D){ms(D)}s.currentTarget=null,r=j}else for(u=0;u<a.length;u++){if(x=a[u],j=x.instance,_=x.currentTarget,x=x.listener,j!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=_;try{r(s)}catch(D){ms(D)}s.currentTarget=null,r=j}}}}function je(e,t){var l=t[Tr];l===void 0&&(l=t[Tr]=new Set);var a=e+"__bubble";l.has(a)||(jf(t,e,2,!1),l.add(a))}function mc(e,t,l){var a=0;t&&(a|=4),jf(l,e,a,t)}var er="_reactListening"+Math.random().toString(36).slice(2);function pc(e){if(!e[er]){e[er]=!0,xo.forEach(function(l){l!=="selectionchange"&&(kp.has(l)||mc(l,!1,e),mc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[er]||(t[er]=!0,mc("selectionchange",!1,t))}}function jf(e,t,l,a){switch(Wf(t)){case 2:var s=Pp;break;case 8:s=eh;break;default:s=_c}l=s.bind(null,t,l,e),s=void 0,!Or||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 hc(e,t,l,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var u=a.tag;if(u===3||u===4){var x=a.stateNode.containerInfo;if(x===s)break;if(u===4)for(u=a.return;u!==null;){var j=u.tag;if((j===3||j===4)&&u.stateNode.containerInfo===s)return;u=u.return}for(;x!==null;){if(u=ga(x),u===null)return;if(j=u.tag,j===5||j===6||j===26||j===27){a=r=u;continue e}x=x.parentNode}}a=a.return}ko(function(){var _=r,D=zr(l),H=[];e:{var M=Po.get(e);if(M!==void 0){var L=ds,ee=e;switch(e){case"keypress":if(os(l)===0)break e;case"keydown":case"keyup":L=ym;break;case"focusin":ee="focus",L=Hr;break;case"focusout":ee="blur",L=Hr;break;case"beforeblur":case"afterblur":L=Hr;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":L=Ao;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=rm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=jm;break;case $o:case Wo:case Fo:L=om;break;case Io:L=Nm;break;case"scroll":case"scrollend":L=nm;break;case"wheel":L=km;break;case"copy":case"cut":case"paste":L=dm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=_o;break;case"toggle":case"beforetoggle":L=Cm}var oe=(t&4)!==0,Be=!oe&&(e==="scroll"||e==="scrollend"),C=oe?M!==null?M+"Capture":null:M;oe=[];for(var k=_,w;k!==null;){var U=k;if(w=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||w===null||C===null||(U=un(k,C),U!=null&&oe.push(Vn(k,U,w))),Be)break;k=k.return}0<oe.length&&(M=new L(M,ee,null,l,D),H.push({event:M,listeners:oe}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",M&&l!==Mr&&(ee=l.relatedTarget||l.fromElement)&&(ga(ee)||ee[ya]))break e;if((L||M)&&(M=D.window===D?D:(M=D.ownerDocument)?M.defaultView||M.parentWindow:window,L?(ee=l.relatedTarget||l.toElement,L=_,ee=ee?ga(ee):null,ee!==null&&(Be=h(ee),oe=ee.tag,ee!==Be||oe!==5&&oe!==27&&oe!==6)&&(ee=null)):(L=null,ee=_),L!==ee)){if(oe=Ao,U="onMouseLeave",C="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(oe=_o,U="onPointerLeave",C="onPointerEnter",k="pointer"),Be=L==null?M:on(L),w=ee==null?M:on(ee),M=new oe(U,k+"leave",L,l,D),M.target=Be,M.relatedTarget=w,U=null,ga(D)===_&&(oe=new oe(C,k+"enter",ee,l,D),oe.target=w,oe.relatedTarget=Be,U=oe),Be=U,L&&ee)t:{for(oe=Tp,C=L,k=ee,w=0,U=C;U;U=oe(U))w++;U=0;for(var re=k;re;re=oe(re))U++;for(;0<w-U;)C=oe(C),w--;for(;0<U-w;)k=oe(k),U--;for(;w--;){if(C===k||k!==null&&C===k.alternate){oe=C;break t}C=oe(C),k=oe(k)}oe=null}else oe=null;L!==null&&Sf(H,M,L,oe,!1),ee!==null&&Be!==null&&Sf(H,Be,ee,oe,!0)}}e:{if(M=_?on(_):window,L=M.nodeName&&M.nodeName.toLowerCase(),L==="select"||L==="input"&&M.type==="file")var Ae=Uo;else if(Do(M))if(Ho)Ae=Bm;else{Ae=Om;var ne=Lm}else L=M.nodeName,!L||L.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?_&&Rr(_.elementType)&&(Ae=Uo):Ae=Dm;if(Ae&&(Ae=Ae(e,_))){Bo(H,Ae,l,D);break e}ne&&ne(e,M,_),e==="focusout"&&_&&M.type==="number"&&_.memoizedProps.value!=null&&_r(M,"number",M.value)}switch(ne=_?on(_):window,e){case"focusin":(Do(ne)||ne.contentEditable==="true")&&(Aa=ne,Xr=_,yn=null);break;case"focusout":yn=Xr=Aa=null;break;case"mousedown":Zr=!0;break;case"contextmenu":case"mouseup":case"dragend":Zr=!1,Ko(H,l,D);break;case"selectionchange":if(Hm)break;case"keydown":case"keyup":Ko(H,l,D)}var me;if(Gr)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?Lo(e,l)&&(Ne="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ne="onCompositionStart");Ne&&(Ro&&l.locale!=="ko"&&(Ca||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&Ca&&(me=To()):(El=D,Dr="value"in El?El.value:El.textContent,Ca=!0)),ne=tr(_,Ne),0<ne.length&&(Ne=new wo(Ne,e,null,l,D),H.push({event:Ne,listeners:ne}),me?Ne.data=me:(me=Oo(l),me!==null&&(Ne.data=me)))),(me=wm?_m(e,l):Rm(e,l))&&(Ne=tr(_,"onBeforeInput"),0<Ne.length&&(ne=new wo("onBeforeInput","beforeinput",null,l,D),H.push({event:ne,listeners:Ne}),ne.data=me)),Sp(H,e,_,l,D)}bf(H,t)})}function Vn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function tr(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=un(e,l),s!=null&&a.unshift(Vn(e,s,r)),s=un(e,t),s!=null&&a.push(Vn(e,s,r))),e.tag===3)return a;e=e.return}return[]}function Tp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Sf(e,t,l,a,s){for(var r=t._reactName,u=[];l!==null&&l!==a;){var x=l,j=x.alternate,_=x.stateNode;if(x=x.tag,j!==null&&j===a)break;x!==5&&x!==26&&x!==27||_===null||(j=_,s?(_=un(l,r),_!=null&&u.unshift(Vn(l,_,j))):s||(_=un(l,r),_!=null&&u.push(Vn(l,_,j)))),l=l.return}u.length!==0&&e.push({event:t,listeners:u})}var Cp=/\r\n?/g,Ap=/\u0000|\uFFFD/g;function Nf(e){return(typeof e=="string"?e:""+e).replace(Cp,`
|
|
49
|
-
`).replace(Ap,"")}function Ef(e,t){return t=Nf(t),Nf(e)===t}function De(e,t,l,a,s,r){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ea(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ea(e,""+a);break;case"className":ss(e,"class",a);break;case"tabIndex":ss(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":ss(e,l,a);break;case"style":No(e,a,r);break;case"data":if(t!=="object"){ss(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=is(""+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"&&De(e,t,"name",s.name,s,null),De(e,t,"formEncType",s.formEncType,s,null),De(e,t,"formMethod",s.formMethod,s,null),De(e,t,"formTarget",s.formTarget,s,null)):(De(e,t,"encType",s.encType,s,null),De(e,t,"method",s.method,s,null),De(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=is(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=rl);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(d(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(d(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=is(""+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),ns(e,"popover",a);break;case"xlinkActuate":sl(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":sl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":sl(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":sl(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":sl(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":sl(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":sl(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":sl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":sl(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ns(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=lm.get(l)||l,ns(e,l,a))}}function vc(e,t,l,a,s,r){switch(l){case"style":No(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(d(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(d(60));e.innerHTML=l}}break;case"children":typeof a=="string"?Ea(e,a):(typeof a=="number"||typeof a=="bigint")&&Ea(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=rl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!mo.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[bt]||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,""):ns(e,l,a)}}}function ot(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 u=l[r];if(u!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:De(e,t,r,u,l,null)}}s&&De(e,t,"srcSet",l.srcSet,l,null),a&&De(e,t,"src",l.src,l,null);return;case"input":je("invalid",e);var x=r=u=s=null,j=null,_=null;for(a in l)if(l.hasOwnProperty(a)){var D=l[a];if(D!=null)switch(a){case"name":s=D;break;case"type":u=D;break;case"checked":j=D;break;case"defaultChecked":_=D;break;case"value":r=D;break;case"defaultValue":x=D;break;case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(d(137,t));break;default:De(e,t,a,D,l,null)}}go(e,r,x,j,_,u,s,!1);return;case"select":je("invalid",e),a=u=r=null;for(s in l)if(l.hasOwnProperty(s)&&(x=l[s],x!=null))switch(s){case"value":r=x;break;case"defaultValue":u=x;break;case"multiple":a=x;default:De(e,t,s,x,l,null)}t=r,l=u,e.multiple=!!a,t!=null?Na(e,!!a,t,!1):l!=null&&Na(e,!!a,l,!0);return;case"textarea":je("invalid",e),r=s=a=null;for(u in l)if(l.hasOwnProperty(u)&&(x=l[u],x!=null))switch(u){case"value":a=x;break;case"defaultValue":s=x;break;case"children":r=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(d(91));break;default:De(e,t,u,x,l,null)}jo(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:De(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<Yn.length;a++)je(Yn[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(_ in l)if(l.hasOwnProperty(_)&&(a=l[_],a!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:De(e,t,_,a,l,null)}return;default:if(Rr(t)){for(D in l)l.hasOwnProperty(D)&&(a=l[D],a!==void 0&&vc(e,t,D,a,l,void 0));return}}for(x in l)l.hasOwnProperty(x)&&(a=l[x],a!=null&&De(e,t,x,a,l,null))}function wp(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,u=null,x=null,j=null,_=null,D=null;for(L in l){var H=l[L];if(l.hasOwnProperty(L)&&H!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":j=H;default:a.hasOwnProperty(L)||De(e,t,L,null,a,H)}}for(var M in a){var L=a[M];if(H=l[M],a.hasOwnProperty(M)&&(L!=null||H!=null))switch(M){case"type":r=L;break;case"name":s=L;break;case"checked":_=L;break;case"defaultChecked":D=L;break;case"value":u=L;break;case"defaultValue":x=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(d(137,t));break;default:L!==H&&De(e,t,M,L,a,H)}}wr(e,u,x,j,_,D,r,s);return;case"select":L=u=x=M=null;for(r in l)if(j=l[r],l.hasOwnProperty(r)&&j!=null)switch(r){case"value":break;case"multiple":L=j;default:a.hasOwnProperty(r)||De(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":x=r;break;case"multiple":u=r;default:r!==j&&De(e,t,s,r,a,j)}t=x,l=u,a=L,M!=null?Na(e,!!l,M,!1):!!a!=!!l&&(t!=null?Na(e,!!l,t,!0):Na(e,!!l,l?[]:"",!1));return;case"textarea":L=M=null;for(x in l)if(s=l[x],l.hasOwnProperty(x)&&s!=null&&!a.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:De(e,t,x,null,a,s)}for(u in a)if(s=a[u],r=l[u],a.hasOwnProperty(u)&&(s!=null||r!=null))switch(u){case"value":M=s;break;case"defaultValue":L=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(d(91));break;default:s!==r&&De(e,t,u,s,a,r)}bo(e,M,L);return;case"option":for(var ee in l)if(M=l[ee],l.hasOwnProperty(ee)&&M!=null&&!a.hasOwnProperty(ee))switch(ee){case"selected":e.selected=!1;break;default:De(e,t,ee,null,a,M)}for(j in a)if(M=a[j],L=l[j],a.hasOwnProperty(j)&&M!==L&&(M!=null||L!=null))switch(j){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:De(e,t,j,M,a,L)}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)&&De(e,t,oe,null,a,M);for(_ in a)if(M=a[_],L=l[_],a.hasOwnProperty(_)&&M!==L&&(M!=null||L!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(d(137,t));break;default:De(e,t,_,M,a,L)}return;default:if(Rr(t)){for(var Be in l)M=l[Be],l.hasOwnProperty(Be)&&M!==void 0&&!a.hasOwnProperty(Be)&&vc(e,t,Be,void 0,a,M);for(D in a)M=a[D],L=l[D],!a.hasOwnProperty(D)||M===L||M===void 0&&L===void 0||vc(e,t,D,M,a,L);return}}for(var C in l)M=l[C],l.hasOwnProperty(C)&&M!=null&&!a.hasOwnProperty(C)&&De(e,t,C,null,a,M);for(H in a)M=a[H],L=l[H],!a.hasOwnProperty(H)||M===L||M==null&&L==null||De(e,t,H,M,a,L)}function kf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _p(){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,u=s.initiatorType,x=s.duration;if(r&&x&&kf(u)){for(u=0,x=s.responseEnd,a+=1;a<l.length;a++){var j=l[a],_=j.startTime;if(_>x)break;var D=j.transferSize,H=j.initiatorType;D&&kf(H)&&(j=j.responseEnd,u+=D*(j<x?1:(x-_)/(j-_)))}if(--a,t+=8*(r+u)/(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 yc=null,gc=null;function lr(e){return e.nodeType===9?e:e.ownerDocument}function Tf(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 Cf(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 bc(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 jc=null;function Rp(){var e=window.event;return e&&e.type==="popstate"?e===jc?!1:(jc=e,!0):(jc=null,!1)}var Af=typeof setTimeout=="function"?setTimeout:void 0,Mp=typeof clearTimeout=="function"?clearTimeout:void 0,wf=typeof Promise=="function"?Promise:void 0,zp=typeof queueMicrotask=="function"?queueMicrotask:typeof wf<"u"?function(e){return wf.resolve(null).then(e).catch(Lp)}:Af;function Lp(e){setTimeout(function(){throw e})}function Gl(e){return e==="head"}function _f(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),tn(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")Qn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Qn(l);for(var r=l.firstChild;r;){var u=r.nextSibling,x=r.nodeName;r[cn]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&r.rel.toLowerCase()==="stylesheet"||l.removeChild(r),r=u}}else l==="body"&&Qn(e.ownerDocument.body);l=s}while(l);tn(t)}function Rf(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 Sc(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":Sc(l),Cr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Op(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[cn])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 Dp(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 Mf(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 Nc(e){return e.data==="$?"||e.data==="$~"}function Ec(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Bp(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 kc=null;function zf(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 Lf(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 Of(e,t,l){switch(t=lr(l),e){case"html":if(e=t.documentElement,!e)throw Error(d(452));return e;case"head":if(e=t.head,!e)throw Error(d(453));return e;case"body":if(e=t.body,!e)throw Error(d(454));return e;default:throw Error(d(451))}}function Qn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Cr(e)}var Vt=new Map,Df=new Set;function ar(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sl=A.d;A.d={f:Up,r:Hp,D:qp,C:Gp,L:Yp,m:Vp,X:Xp,S:Qp,M:Zp};function Up(){var e=Sl.f(),t=Js();return e||t}function Hp(e){var t=ba(e);t!==null&&t.tag===5&&t.type==="form"?Iu(t):Sl.r(e)}var Ia=typeof document>"u"?null:document;function Bf(e,t,l){var a=Ia;if(a&&typeof t=="string"&&t){var s=Ot(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Df.has(s)||(Df.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),ot(t,"link",e),lt(t),a.head.appendChild(t)))}}function qp(e){Sl.D(e),Bf("dns-prefetch",e,null)}function Gp(e,t){Sl.C(e,t),Bf("preconnect",e,t)}function Yp(e,t,l){Sl.L(e,t,l);var a=Ia;if(a&&e&&t){var s='link[rel="preload"][as="'+Ot(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Ot(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Ot(l.imageSizes)+'"]')):s+='[href="'+Ot(e)+'"]';var r=s;switch(t){case"style":r=Pa(e);break;case"script":r=en(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(Xn(r))||t==="script"&&a.querySelector(Zn(r))||(t=a.createElement("link"),ot(t,"link",e),lt(t),a.head.appendChild(t)))}}function Vp(e,t){Sl.m(e,t);var l=Ia;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Ot(a)+'"][href="'+Ot(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=en(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(Zn(r)))return}a=l.createElement("link"),ot(a,"link",e),lt(a),l.head.appendChild(a)}}}function Qp(e,t,l){Sl.S(e,t,l);var a=Ia;if(a&&e){var s=ja(a).hoistableStyles,r=Pa(e);t=t||"default";var u=s.get(r);if(!u){var x={loading:0,preload:null};if(u=a.querySelector(Xn(r)))x.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Vt.get(r))&&Tc(e,l);var j=u=a.createElement("link");lt(j),ot(j,"link",e),j._p=new Promise(function(_,D){j.onload=_,j.onerror=D}),j.addEventListener("load",function(){x.loading|=1}),j.addEventListener("error",function(){x.loading|=2}),x.loading|=4,nr(u,t,a)}u={type:"stylesheet",instance:u,count:1,state:x},s.set(r,u)}}}function Xp(e,t){Sl.X(e,t);var l=Ia;if(l&&e){var a=ja(l).hoistableScripts,s=en(e),r=a.get(s);r||(r=l.querySelector(Zn(s)),r||(e=g({src:e,async:!0},t),(t=Vt.get(s))&&Cc(e,t),r=l.createElement("script"),lt(r),ot(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Zp(e,t){Sl.M(e,t);var l=Ia;if(l&&e){var a=ja(l).hoistableScripts,s=en(e),r=a.get(s);r||(r=l.querySelector(Zn(s)),r||(e=g({src:e,async:!0,type:"module"},t),(t=Vt.get(s))&&Cc(e,t),r=l.createElement("script"),lt(r),ot(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Uf(e,t,l,a){var s=(s=Q.current)?ar(s):null;if(!s)throw Error(d(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Pa(l.href),l=ja(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=Pa(l.href);var r=ja(s).hoistableStyles,u=r.get(e);if(u||(s=s.ownerDocument||s,u={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,u),(r=s.querySelector(Xn(e)))&&!r._p&&(u.instance=r,u.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||Kp(s,e,l,u.state))),t&&a===null)throw Error(d(528,""));return u}if(t&&a!==null)throw Error(d(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=en(l),l=ja(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(d(444,e))}}function Pa(e){return'href="'+Ot(e)+'"'}function Xn(e){return'link[rel="stylesheet"]['+e+"]"}function Hf(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Kp(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}),ot(t,"link",l),lt(t),e.head.appendChild(t))}function en(e){return'[src="'+Ot(e)+'"]'}function Zn(e){return"script[async]"+e}function qf(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ot(l.href)+'"]');if(a)return t.instance=a,lt(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"),lt(a),ot(a,"style",s),nr(a,l.precedence,e),t.instance=a;case"stylesheet":s=Pa(l.href);var r=e.querySelector(Xn(s));if(r)return t.state.loading|=4,t.instance=r,lt(r),r;a=Hf(l),(s=Vt.get(s))&&Tc(a,s),r=(e.ownerDocument||e).createElement("link"),lt(r);var u=r;return u._p=new Promise(function(x,j){u.onload=x,u.onerror=j}),ot(r,"link",a),t.state.loading|=4,nr(r,l.precedence,e),t.instance=r;case"script":return r=en(l.src),(s=e.querySelector(Zn(r)))?(t.instance=s,lt(s),s):(a=l,(s=Vt.get(r))&&(a=g({},l),Cc(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),lt(s),ot(s,"link",a),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,nr(a,l.precedence,e));return t.instance}function nr(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,u=0;u<a.length;u++){var x=a[u];if(x.dataset.precedence===t)r=x;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 Tc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Cc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var sr=null;function Gf(e,t,l){if(sr===null){var a=new Map,s=sr=new Map;s.set(l,a)}else s=sr,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[cn]||r[st]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var u=r.getAttribute(t)||"";u=e+u;var x=a.get(u);x?x.push(r):a.set(u,[r])}}return a}function Yf(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Jp(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 Vf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $p(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=Pa(a.href),r=t.querySelector(Xn(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=rr.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=r,lt(r);return}r=t.ownerDocument||t,a=Hf(a),(s=Vt.get(s))&&Tc(a,s),r=r.createElement("link"),lt(r);var u=r;u._p=new Promise(function(x,j){u.onload=x,u.onerror=j}),ot(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=rr.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Ac=0;function Wp(e,t){return e.stylesheets&&e.count===0&&cr(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&cr(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Ac===0&&(Ac=62500*_p());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&cr(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Ac?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function rr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ir=null;function cr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ir=new Map,t.forEach(Fp,e),ir=null,rr.call(e))}function Fp(e,t){if(!(t.state.loading&4)){var l=ir.get(e);if(l)var a=l.get(null);else{l=new Map,ir.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var u=s[r];(u.nodeName==="LINK"||u.getAttribute("media")!=="not all")&&(l.set(u.dataset.precedence,u),a=u)}a&&l.set(null,a)}s=t.instance,u=s.getAttribute("data-precedence"),r=l.get(u)||a,r===a&&l.set(null,s),l.set(u,s),this.count++,a=rr.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 Kn={$$typeof:ae,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function Ip(e,t,l,a,s,r,u,x,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=Nr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nr(0),this.hiddenUpdates=Nr(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=u,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function Qf(e,t,l,a,s,r,u,x,j,_,D,H){return e=new Ip(e,t,l,u,j,_,D,H,x),t=1,r===!0&&(t|=24),r=At(3,null,null,t),e.current=r,r.stateNode=e,t=ii(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:l,cache:t},di(r),e}function Xf(e){return e?(e=Ra,e):Ra}function Zf(e,t,l,a,s,r){s=Xf(s),a.context===null?a.context=s:a.pendingContext=s,a=_l(t),a.payload={element:l},r=r===void 0?null:r,r!==null&&(a.callback=r),l=Rl(e,a,t),l!==null&&(Tt(l,e,t),kn(l,e,t))}function Kf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function wc(e,t){Kf(e,t),(e=e.alternate)&&Kf(e,t)}function Jf(e){if(e.tag===13||e.tag===31){var t=la(e,67108864);t!==null&&Tt(t,e,67108864),wc(e,67108864)}}function $f(e){if(e.tag===13||e.tag===31){var t=zt();t=Er(t);var l=la(e,t);l!==null&&Tt(l,e,t),wc(e,t)}}var or=!0;function Pp(e,t,l,a){var s=N.T;N.T=null;var r=A.p;try{A.p=2,_c(e,t,l,a)}finally{A.p=r,N.T=s}}function eh(e,t,l,a){var s=N.T;N.T=null;var r=A.p;try{A.p=8,_c(e,t,l,a)}finally{A.p=r,N.T=s}}function _c(e,t,l,a){if(or){var s=Rc(a);if(s===null)hc(e,t,a,ur,l),Ff(e,a);else if(lh(s,e,t,l,a))a.stopPropagation();else if(Ff(e,a),t&4&&-1<th.indexOf(e)){for(;s!==null;){var r=ba(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var u=Fl(r.pendingLanes);if(u!==0){var x=r;for(x.pendingLanes|=2,x.entangledLanes|=2;u;){var j=1<<31-Xe(u);x.entanglements[1]|=j,u&=~j}tl(r),(_e&6)===0&&(Zs=Le()+500,Gn(0))}}break;case 31:case 13:x=la(r,2),x!==null&&Tt(x,r,2),Js(),wc(r,2)}if(r=Rc(a),r===null&&hc(e,t,a,ur,l),r===s)break;s=r}s!==null&&a.stopPropagation()}else hc(e,t,a,null,l)}}function Rc(e){return e=zr(e),Mc(e)}var ur=null;function Mc(e){if(ur=null,e=ga(e),e!==null){var t=h(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=p(t),e!==null)return e;e=null}else if(l===31){if(e=b(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ur=e,null}function Wf(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(xe()){case He:return 2;case yt:return 8;case Re:case nn:return 32;case ha:return 268435456;default:return 32}default:return 32}}var zc=!1,Yl=null,Vl=null,Ql=null,Jn=new Map,$n=new Map,Xl=[],th="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 Ff(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":Jn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$n.delete(t.pointerId)}}function Wn(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=ba(t),t!==null&&Jf(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function lh(e,t,l,a,s){switch(t){case"focusin":return Yl=Wn(Yl,e,t,l,a,s),!0;case"dragenter":return Vl=Wn(Vl,e,t,l,a,s),!0;case"mouseover":return Ql=Wn(Ql,e,t,l,a,s),!0;case"pointerover":var r=s.pointerId;return Jn.set(r,Wn(Jn.get(r)||null,e,t,l,a,s)),!0;case"gotpointercapture":return r=s.pointerId,$n.set(r,Wn($n.get(r)||null,e,t,l,a,s)),!0}return!1}function If(e){var t=ga(e.target);if(t!==null){var l=h(t);if(l!==null){if(t=l.tag,t===13){if(t=p(l),t!==null){e.blockedOn=t,uo(e.priority,function(){$f(l)});return}}else if(t===31){if(t=b(l),t!==null){e.blockedOn=t,uo(e.priority,function(){$f(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 dr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Rc(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);Mr=a,l.target.dispatchEvent(a),Mr=null}else return t=ba(l),t!==null&&Jf(t),e.blockedOn=l,!1;t.shift()}return!0}function Pf(e,t,l){dr(e)&&l.delete(t)}function ah(){zc=!1,Yl!==null&&dr(Yl)&&(Yl=null),Vl!==null&&dr(Vl)&&(Vl=null),Ql!==null&&dr(Ql)&&(Ql=null),Jn.forEach(Pf),$n.forEach(Pf)}function fr(e,t){e.blockedOn===t&&(e.blockedOn=null,zc||(zc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,ah)))}var xr=null;function ex(e){xr!==e&&(xr=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){xr===e&&(xr=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(Mc(a||l)===null)continue;break}var r=ba(l);r!==null&&(e.splice(t,3),t-=3,Ri(r,{pending:!0,data:s,method:l.method,action:a},a,s))}}))}function tn(e){function t(j){return fr(j,e)}Yl!==null&&fr(Yl,e),Vl!==null&&fr(Vl,e),Ql!==null&&fr(Ql,e),Jn.forEach(t),$n.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);)If(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],u=s[bt]||null;if(typeof r=="function")u||ex(l);else if(u){var x=null;if(r&&r.hasAttribute("formAction")){if(s=r,u=r[bt]||null)x=u.formAction;else if(Mc(s)!==null)continue}else x=u.action;typeof x=="function"?l[a+1]=x:(l.splice(a,3),a-=3),ex(l)}}}function tx(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(u){return s=u})},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 Lc(e){this._internalRoot=e}mr.prototype.render=Lc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(d(409));var l=t.current,a=zt();Zf(l,a,e,t,null,null)},mr.prototype.unmount=Lc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Zf(e.current,2,null,e,null,null),Js(),t[ya]=null}};function mr(e){this._internalRoot=e}mr.prototype.unstable_scheduleHydration=function(e){if(e){var t=oo();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&&If(e)}};var lx=o.version;if(lx!=="19.2.4")throw Error(d(527,lx,"19.2.4"));A.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(d(188)):(e=Object.keys(e).join(","),Error(d(268,e)));return e=f(t),e=e!==null?E(e):null,e=e===null?null:e.stateNode,e};var nh={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pr.isDisabled&&pr.supportsFiber)try{xt=pr.inject(nh),Qe=pr}catch{}}return In.createRoot=function(e,t){if(!m(e))throw Error(d(299));var l=!1,a="",s=cd,r=od,u=ud;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&&(u=t.onRecoverableError)),t=Qf(e,1,!1,null,null,l,a,null,s,r,u,tx),e[ya]=t.current,pc(e),new Lc(t)},In.hydrateRoot=function(e,t,l){if(!m(e))throw Error(d(299));var a=!1,s="",r=cd,u=od,x=ud,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&&(u=l.onCaughtError),l.onRecoverableError!==void 0&&(x=l.onRecoverableError),l.formState!==void 0&&(j=l.formState)),t=Qf(e,1,!0,t,l??null,a,s,j,r,u,x,tx),t.context=Xf(null),l=t.current,a=zt(),a=Er(a),s=_l(a),s.callback=null,Rl(l,s,a),l=a,t.current.lanes=l,rn(t,l),tl(t),e[ya]=t.current,pc(e),new mr(t)},In.version="19.2.4",In}var fx;function mh(){if(fx)return Bc.exports;fx=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(),Bc.exports=xh(),Bc.exports}var ph=mh();const Mx="";class zx extends Error{constructor(o,c){super(o),this.name="ApiError",this.status=c}}async function Ye(i,o){const c=await fetch(`${Mx}${i}`,o);if(!c.ok){const d=await c.json().catch(()=>({error:c.statusText}));throw new zx(d.error||`HTTP ${c.status}`,c.status)}return c.json()}const ke={getConfig(){return Ye("/api/config")},setConfig(i,o){return Ye("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,model:o})})},getSkills(){return Ye("/api/skills")},getSkillDetail(i,o){return Ye(`/api/skills/${i}/${o}`)},getEvals(i,o){return Ye(`/api/skills/${i}/${o}/evals`)},saveEvals(i,o,c){return Ye(`/api/skills/${i}/${o}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})},generateEvals(i,o){return Ye(`/api/skills/${i}/${o}/generate-evals`,{method:"POST"})},async getLatestBenchmark(i,o){const c=await fetch(`${Mx}/api/skills/${i}/${o}/benchmark/latest`);if(c.status===404)return null;if(!c.ok){const d=await c.json().catch(()=>({error:c.statusText}));throw new zx(d.error||`HTTP ${c.status}`,c.status)}return c.json()},getHistory(i,o,c){const d=new URLSearchParams;c!=null&&c.model&&d.set("model",c.model),c!=null&&c.type&&d.set("type",c.type),c!=null&&c.from&&d.set("from",c.from),c!=null&&c.to&&d.set("to",c.to);const m=d.toString();return Ye(`/api/skills/${i}/${o}/history${m?"?"+m:""}`)},getHistoryEntry(i,o,c){return Ye(`/api/skills/${i}/${o}/history/${encodeURIComponent(c)}`)},compareRuns(i,o,c,d){return Ye(`/api/skills/${i}/${o}/history-compare?a=${encodeURIComponent(c)}&b=${encodeURIComponent(d)}`)},getCaseHistory(i,o,c,d){const m=new URLSearchParams;d&&m.set("model",d);const h=m.toString();return Ye(`/api/skills/${i}/${o}/history/case/${c}${h?"?"+h:""}`)},deleteHistoryEntry(i,o,c){return Ye(`/api/skills/${i}/${o}/history/${encodeURIComponent(c)}`,{method:"DELETE"})},deleteSkill(i,o){return Ye(`/api/skills/${i}/${o}`,{method:"DELETE"})},improveSkill(i,o,c){return Ye(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})},instructEdit(i,o,c){return Ye(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...c})})},applyImprovement(i,o,c){return Ye(`/api/skills/${i}/${o}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:c})})},getStats(i,o){return Ye(`/api/skills/${i}/${o}/stats`)},getDependencies(i,o){return Ye(`/api/skills/${i}/${o}/dependencies`)},getProjectLayout(){return Ye("/api/project-layout")},createSkill(i){return Ye("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},saveDraft(i){return Ye("/api/skills/save-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillCreatorStatus(){return Ye("/api/skill-creator-status")},generateSkill(i){return Ye("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillFiles(i,o){return Ye(`/api/skills/${i}/${o}/files`)},getSkillFile(i,o,c){return Ye(`/api/skills/${i}/${o}/file?path=${encodeURIComponent(c)}`)}};function hh(i){const[o,c]=v.useState(()=>typeof window>"u"?!1:window.matchMedia(i).matches);return v.useEffect(()=>{const d=window.matchMedia(i);c(d.matches);const m=h=>c(h.matches);return d.addEventListener("change",m),()=>d.removeEventListener("change",m)},[i]),o}const vh={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function yh(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 Lx=v.createContext(null);function $l(){const i=v.useContext(Lx);if(!i)throw new Error("useStudio must be used within StudioProvider");return i}function gh({children:i}){const[o,c]=v.useReducer(yh,vh),d=hh("(max-width: 767px)");v.useEffect(()=>{c({type:"SET_MOBILE",isMobile:d})},[d]);const m=v.useCallback(()=>{c({type:"SET_SKILLS_LOADING",loading:!0}),ke.getSkills().then(g=>{c({type:"SET_SKILLS",skills:g});const z=window.location.hash.match(/^#\/skills\/([^/]+)\/([^/?]+)/);if(z){const[,B,q]=z,V=g.find(J=>J.plugin===B&&J.skill===q);V&&c({type:"SELECT_SKILL",skill:{plugin:B,skill:q,origin:V.origin}})}}).catch(g=>c({type:"SET_SKILLS_ERROR",error:g.message}))},[]);v.useEffect(()=>{m()},[m]);const h=v.useCallback(g=>{c({type:"SELECT_SKILL",skill:g}),window.location.hash=`/skills/${g.plugin}/${g.skill}`},[]),p=v.useCallback(()=>{c({type:"CLEAR_SELECTION"}),window.location.hash.startsWith("#/skills/")&&history.replaceState(null,"",window.location.pathname+window.location.search)},[]),b=v.useCallback(g=>{c({type:"SET_MODE",mode:g})},[]),y=v.useCallback(g=>{c({type:"SET_SEARCH",query:g})},[]),f=v.useCallback(g=>{c({type:"SET_MOBILE_VIEW",view:g})},[]),E=v.useMemo(()=>({state:o,selectSkill:h,clearSelection:p,setMode:b,setSearch:y,setMobileView:f,refreshSkills:m}),[o,h,p,b,y,f,m]);return n.jsx(Lx.Provider,{value:E,children:i})}const bh={config:null,loading:!0};function jh(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 Ox=v.createContext(null);function ln(){const i=v.useContext(Ox);if(!i)throw new Error("useConfig must be used within ConfigProvider");return i}function Sh({children:i}){const[o,c]=v.useReducer(jh,bh),d=v.useCallback(()=>{ke.getConfig().then(p=>c({type:"SET_CONFIG",config:p})).catch(()=>{})},[]);v.useEffect(()=>{d()},[d]);const m=v.useCallback(async(p,b)=>{const y=await ke.setConfig(p,b);return c({type:"SET_CONFIG",config:y}),y},[]),h=v.useMemo(()=>({config:o.config,loading:o.loading,updateConfig:m,refreshConfig:d}),[o,m,d]);return n.jsx(Ox.Provider,{value:h,children:i})}function Nh({left:i,right:o}){const{state:c}=$l();return c.isMobile?n.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:c.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 Eh(){const{state:i,setSearch:o}=$l(),[c,d]=v.useState(i.searchQuery),m=v.useRef(null);v.useEffect(()=>(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{o(c)},200),()=>{m.current&&clearTimeout(m.current)}),[c,o]),v.useEffect(()=>{i.searchQuery===""&&c!==""&&d("")},[i.searchQuery]);const h=new Set(i.skills.map(p=>p.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:c,onChange:p=>d(p.target.value),placeholder:"Search skills...",className:"w-full py-2 pl-8 pr-3 rounded-lg text-[13px] transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",outline:"none"},onFocus:p=>{p.currentTarget.style.borderColor="var(--accent)"},onBlur:p=>{p.currentTarget.style.borderColor="var(--border-subtle)"}}),c&&n.jsx("button",{onClick:()=>{d(""),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 xx={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 mx({skill:i,isSelected:o,onSelect:c}){const d=xx[i.benchmarkStatus]||xx.missing,m=i.origin==="installed";return n.jsxs("button",{onClick:c,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:m?.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:[m&&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:d.bg,color:d.text},children:[n.jsx("span",{className:"rounded-full",style:{width:5,height:5,background:d.dot}}),d.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 px(i){var c;const o={};for(const d of i)(o[c=d.plugin]||(o[c]=[])).push(d);return o}function kh(){const{state:i,selectSkill:o}=$l(),{skills:c,searchQuery:d,selectedSkill:m}=i,[h,p]=v.useState(!1),[b,y]=v.useState(()=>{try{return sessionStorage.getItem("vskill-origin-banner-dismissed")==="1"}catch{return!1}}),{sourceGroups:f,installedGroups:E}=v.useMemo(()=>{const g=d.toLowerCase(),T=g?c.filter(q=>q.skill.toLowerCase().includes(g)||q.plugin.toLowerCase().includes(g)):c,z=T.filter(q=>q.origin==="source"),B=T.filter(q=>q.origin==="installed");return{sourceGroups:Object.entries(px(z)),installedGroups:Object.entries(px(B))}},[c,d]);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))}):f.length===0&&E.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:[f.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Th,{title:"Your Skills",count:f.reduce((g,[,T])=>g+T.length,0)}),f.map(([g,T])=>n.jsxs("div",{children:[n.jsx(hx,{plugin:g,count:T.length}),T.map(z=>{const B=(m==null?void 0:m.plugin)===z.plugin&&(m==null?void 0:m.skill)===z.skill;return n.jsx(mx,{skill:z,isSelected:B,onSelect:()=>o({plugin:z.plugin,skill:z.skill,origin:z.origin})},`${z.plugin}/${z.skill}`)})]},g))]}),E.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>p(g=>!g),className:"w-full flex items-center gap-2 px-3 py-2.5 text-left",style:{background:"var(--surface-1)",border:"none",borderTop:"1px solid var(--border-subtle)",borderBottom: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:["(",E.reduce((g,[,T])=>g+T.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"})]})})]}),E.map(([g,T])=>n.jsxs("div",{children:[n.jsx(hx,{plugin:g,count:T.length}),T.map(z=>{const B=(m==null?void 0:m.plugin)===z.plugin&&(m==null?void 0:m.skill)===z.skill;return n.jsx(mx,{skill:z,isSelected:B,onSelect:()=>o({plugin:z.plugin,skill:z.skill,origin:z.origin})},`${z.plugin}/${z.skill}`)})]},g))]})]})]})}function Th({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 hx({plugin:i,count:o}){const[c,d]=v.useState(!1),m=`/images/icons/${i}.webp`;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[c?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:m,width:16,height:16,alt:"",onError:()=>d(!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 Ch(){const{config:i,updateConfig:o,refreshConfig:c}=ln(),[d,m]=v.useState(!1),[h,p]=v.useState(!1),b=v.useRef(null);v.useEffect(()=>{function g(T){b.current&&!b.current.contains(T.target)&&m(!1)}return d&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[d]);async function y(g,T){p(!0);try{await o(g.id,T.id),m(!1)}catch{c()}finally{p(!1)}}if(!i)return null;const f=wh(i),E=Ah(i);return n.jsxs("div",{ref:b,className:"relative",children:[n.jsxs("button",{onClick:()=>m(!d),className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] transition-all duration-150",style:{background:d?"var(--surface-3)":"var(--surface-2)",border:`1px solid ${d?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},onMouseEnter:g=>{d||(g.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:g=>{d||(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:E!=null&&E.available?"var(--green)":"var(--text-tertiary)"}}),n.jsx("span",{className:"flex-1 text-left font-medium truncate",style:{color:"var(--text-primary)"},children:f}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:d?"rotate(180deg)":"rotate(0)",transition:"transform 0.15s ease",flexShrink:0},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),d&&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(T=>{const z=Dx(i,g.id,T.id),B=!g.available||h;return n.jsxs("button",{onClick:()=>!B&&y(g,T),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:q=>{!B&&!z&&(q.currentTarget.style.background="var(--surface-3)")},onMouseLeave:q=>{z||(q.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:T.id,children:T.label})]},`${g.id}-${T.id}`)})]},g.id))})]})]})}function Dx(i,o,c){return i.provider!==o?!1:o==="claude-cli"?i.model===`claude-${c}`:i.model===c}function Ah(i){return i.providers.find(o=>o.id===i.provider)}function wh(i){for(const o of i.providers)for(const c of o.models)if(Dx(i,o.id,c.id))return c.label;return i.model}function _h(){const{state:i,setMode:o}=$l(),{config:c}=ln(),[d,m]=v.useState(null),[h,p]=v.useState(!1);return v.useEffect(()=>{ke.getSkillCreatorStatus().then(m).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:(c==null?void 0:c.projectName)||"vskill"})]})]}),n.jsx("div",{className:"mt-3",children:n.jsx(Ch,{})})]}),n.jsx(Eh,{}),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"]})}),d&&(()=>{const b=(c==null?void 0:c.provider)==="claude-cli";return d.installed&&b?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children: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"]})}):d.installed&&!b?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)",opacity:.5},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--text-tertiary)"}}),"Skill Creator (Claude only)"]})}):!d.installed&&b?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children: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(d.installCommand).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)}).catch(()=>{})},className:"w-full text-left px-2 py-1 rounded text-[10px] font-mono cursor-pointer transition-colors duration-150",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},title:"Click to copy",onMouseEnter:y=>{y.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:y=>{y.currentTarget.style.borderColor="var(--border-subtle)"},children:h?"Copied!":d.installCommand})]})}):null})(),n.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(kh,{})})]})}const Rh="modulepreload",Mh=function(i){return"/"+i},vx={},zh=function(o,c,d){let m=Promise.resolve();if(c&&c.length>0){let p=function(f){return Promise.all(f.map(E=>Promise.resolve(E).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"));m=p(c.map(f=>{if(f=Mh(f),f in vx)return;vx[f]=!0;const E=f.endsWith(".css"),g=E?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const T=document.createElement("link");if(T.rel=E?"stylesheet":Rh,E||(T.as="script"),T.crossOrigin="",T.href=f,y&&T.setAttribute("nonce",y),document.head.appendChild(T),E)return new Promise((z,B)=>{T.addEventListener("load",z),T.addEventListener("error",()=>B(new Error(`Unable to preload CSS for ${f}`)))})}))}function h(p){const b=new Event("vite:preloadError",{cancelable:!0});if(b.payload=p,window.dispatchEvent(b),!b.defaultPrevented)throw p}return m.then(p=>{for(const b of p||[])b.status==="rejected"&&h(b.reason);return o().catch(h)})};function Gc(){const[i,o]=v.useState([]),[c,d]=v.useState(!1),[m,h]=v.useState(!1),[p,b]=v.useState(null),y=v.useRef(null),f=v.useCallback(async(g,T)=>{o([]),d(!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:T?JSON.stringify(T):void 0,signal:z.signal});if(!B.ok||!B.body){let ae=`HTTP ${B.status}`;try{const G=await B.json();G.error&&(ae=G.error)}catch{}throw new Error(ae)}const q=B.body.getReader(),V=new TextDecoder;let J="",F="";for(;;){const{done:ae,value:G}=await q.read();if(ae)break;J+=V.decode(G,{stream:!0});const W=J.split(`
|
|
50
|
-
`);J=W.pop()||"";for(const te of W)if(te.startsWith("event: "))F=te.slice(7).trim();else if(te.startsWith("data: ")){try{const $=JSON.parse(te.slice(6)),le={event:F,data:$};F==="done"?(h(!0),o(ge=>[...ge,le])):o(ge=>[...ge,le])}catch{}F=""}}}catch(B){B.name!=="AbortError"&&b(B.message)}finally{d(!1),y.current=null}},[]),E=v.useCallback(()=>{var g;(g=y.current)==null||g.abort()},[]);return{events:i,running:c,done:m,error:p,start:f,stop:E}}function Lh(i){const o=v.useRef(i);o.current=i;const[c,d]=v.useState(new Set),m=v.useRef(new Map),h=v.useCallback(async(f,E,g)=>{var z;(z=m.current.get(f))==null||z.abort();const T=new AbortController;m.current.set(f,T),d(B=>{const q=new Set(B);return q.add(f),q});try{const B=await fetch(E,{method:"POST",headers:{"Content-Type":"application/json"},body:g?JSON.stringify(g):void 0,signal:T.signal});if(!B.ok||!B.body){let ae=`HTTP ${B.status}`;try{const G=await B.json();G.error&&(ae=G.error)}catch{}throw new Error(ae)}const q=B.body.getReader(),V=new TextDecoder;let J="",F="";for(;;){const{done:ae,value:G}=await q.read();if(ae)break;J+=V.decode(G,{stream:!0});const W=J.split(`
|
|
51
|
-
`);J=W.pop()||"";for(const te of W)if(te.startsWith("event: "))F=te.slice(7).trim();else if(te.startsWith("data: ")){try{const $=JSON.parse(te.slice(6)),le={event:F,data:$};o.current.onEvent(f,le)}catch{}F=""}}o.current.onDone(f)}catch(B){B.name!=="AbortError"&&o.current.onError(f,B.message)}finally{d(B=>{const q=new Set(B);return q.delete(f),q}),m.current.delete(f)}},[]),p=v.useCallback(f=>{var E;(E=m.current.get(f))==null||E.abort()},[]),b=v.useCallback(()=>{for(const f of m.current.values())f.abort()},[]),y=c.size>0;return{runningSet:c,startCase:h,stopCase:p,stopAll:b,isAnyCaseRunning:y}}const Oh={plugin:"",skill:"",skillContent:"",savedContent:"",isDirty:!1,evals:null,evalsError:null,activePanel:"tests",selectedCaseId:null,caseRunStates:new Map,bulkRunActive:!1,runMode:null,latestBenchmark:null,inlineResults:new Map,improveTarget:null,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null,generateEvalsLoading:!1,generateEvalsProgress:[],generateEvalsError:null,regressions:[],iterationCount:0,activationPrompts:"",activationResults:[],activationSummary:null,activationRunning:!1,activationError:null,loading:!0,error:null};function Dh(i,o){var c,d;switch(o.type){case"SET_LOADING":return{...i,loading:o.loading};case"SET_ERROR":return{...i,error:o.error};case"INIT_DATA":{const m=new Map;if(o.benchmark)for(const p of o.benchmark.cases)m.set(p.eval_id,{status:p.status,passRate:p.pass_rate,errorMessage:p.error_message||void 0,durationMs:p.durationMs,tokens:p.tokens,output:p.output,assertions:p.assertions.map(b=>({assertion_id:b.id,text:b.text,pass:b.pass,reasoning:b.reasoning}))});const h=((d=(c=o.evals)==null?void 0:c.evals[0])==null?void 0:d.id)??null;return{...i,skillContent:o.skillContent,savedContent:o.skillContent,isDirty:!1,evals:o.evals,evalsError:o.evalsError??null,latestBenchmark:o.benchmark,inlineResults:m,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 m=new Map(i.caseRunStates);return m.set(o.caseId,{status:"running",startedAt:Date.now(),mode:o.mode}),{...i,caseRunStates:m,runMode:o.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const m=new Map(i.caseRunStates),h=m.get(o.caseId);m.set(o.caseId,{status:"complete",mode:h==null?void 0:h.mode});const p=new Map(i.inlineResults);return p.set(o.caseId,o.result),{...i,caseRunStates:m,inlineResults:p}}case"CASE_RUN_ERROR":{const m=new Map(i.caseRunStates),h=m.get(o.caseId);m.set(o.caseId,{status:"error",mode:h==null?void 0:h.mode});const p=new Map(i.inlineResults);return p.set(o.caseId,{status:"error",errorMessage:o.error,assertions:[]}),{...i,caseRunStates:m,inlineResults:p}}case"CASE_RUN_CANCEL":{const m=new Map(i.caseRunStates),h=m.get(o.caseId);return m.set(o.caseId,{status:"cancelled",mode:h==null?void 0:h.mode}),{...i,caseRunStates:m}}case"BULK_RUN_START":{const m=new Map(i.caseRunStates);for(const h of o.caseIds)m.set(h,{status:"queued",mode:o.mode});return{...i,caseRunStates:m,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 m=new Map(i.caseRunStates);for(const[h,p]of m)(p.status==="running"||p.status==="queued")&&m.set(h,{status:"cancelled"});return{...i,caseRunStates:m,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const m=new Map(i.inlineResults);return m.set(o.evalId,o.result),{...i,inlineResults:m}}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 m=o.evalChanges??[],h=new Map;for(let p=0;p<m.length;p++)h.set(p,!0);return{...i,aiEditLoading:!1,aiEditResult:{improved:o.improved,reasoning:o.reasoning,evalChanges:m},aiEditEvalChanges:m,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 m=new Map(i.aiEditEvalSelections);return m.set(o.index,!m.get(o.index)),{...i,aiEditEvalSelections:m}}case"SELECT_ALL_EVAL_CHANGES":{const m=new Map(i.aiEditEvalSelections);for(const h of m.keys())m.set(h,!0);return{...i,aiEditEvalSelections:m}}case"DESELECT_ALL_EVAL_CHANGES":{const m=new Map(i.aiEditEvalSelections);for(const h of m.keys())m.set(h,!1);return{...i,aiEditEvalSelections:m}}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}}function Bh(i,o){const c=o.data;if(o.event==="output_ready"&&(i.output=c.output,c.durationMs!=null&&(i.durationMs=c.durationMs),c.tokens!=null&&(i.tokens=c.tokens)),o.event==="outputs_ready"&&(i.output=c.skillOutput,c.skillDurationMs!=null&&(i.durationMs=c.skillDurationMs),c.skillTokens!=null&&(i.tokens=c.skillTokens)),o.event==="assertion_result"){const d={assertion_id:c.assertion_id,text:c.text,pass:c.pass,reasoning:c.reasoning};i.assertions.find(m=>m.assertion_id===d.assertion_id)||i.assertions.push(d)}o.event==="case_complete"&&(i.status=c.status,i.passRate=c.pass_rate,i.errorMessage=c.error_message||void 0,i.classifiedError=c.classified_error||void 0)}const Bx=v.createContext(null);function ll(){const i=v.useContext(Bx);if(!i)throw new Error("useWorkspace must be used within WorkspaceProvider");return i}function Uh({plugin:i,skill:o,origin:c,children:d}){const m=c==="installed",[h,p]=v.useReducer(Dh,{...Oh,plugin:i,skill:o}),b=v.useRef(new Set),y=v.useRef(new Set),f=v.useRef(new Map),E=v.useCallback((R,Y)=>{let Q=f.current.get(R);Q||(Q={assertions:[]},f.current.set(R,Q)),Bh(Q,Y),p({type:"UPDATE_INLINE_RESULT",evalId:R,result:{...Q,assertions:[...Q.assertions]}})},[]),g=v.useCallback(R=>{if(y.current.has(R))return;y.current.add(R);const Y=f.current.get(R)??{assertions:[]};p({type:"CASE_RUN_COMPLETE",caseId:R,result:{...Y,assertions:[...Y.assertions]}}),b.current.has(R)&&(b.current.delete(R),b.current.size===0&&ke.getLatestBenchmark(i,o).then(Q=>p({type:"BULK_RUN_COMPLETE",benchmark:Q})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null})))},[i,o]),T=v.useCallback((R,Y)=>{y.current.has(R)||(y.current.add(R),p({type:"CASE_RUN_ERROR",caseId:R,error:Y}),b.current.has(R)&&(b.current.delete(R),b.current.size===0&&ke.getLatestBenchmark(i,o).then(Q=>p({type:"BULK_RUN_COMPLETE",benchmark:Q})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[i,o]),{startCase:z,stopCase:B,stopAll:q}=Lh({onEvent:E,onDone:g,onError:T});v.useEffect(()=>()=>{q()},[q]),v.useEffect(()=>{let R=!1;async function Y(){try{const[Q,P,ue]=await Promise.allSettled([ke.getSkillDetail(i,o),ke.getEvals(i,o),ke.getLatestBenchmark(i,o)]);if(R)return;let he=null,tt=null;if(P.status==="fulfilled")he=P.value;else{const nt=P.reason;(nt==null?void 0:nt.status)!==404&&(tt=(nt==null?void 0:nt.message)??"Failed to load test cases")}p({type:"INIT_DATA",skillContent:Q.status==="fulfilled"?Q.value.skillContent:"",evals:he,evalsError:tt,benchmark:ue.status==="fulfilled"?ue.value:null})}catch(Q){R||p({type:"SET_ERROR",error:Q.message})}}return Y(),()=>{R=!0}},[i,o]);const V=v.useCallback(async()=>{if(!m)try{await ke.applyImprovement(i,o,h.skillContent),p({type:"CONTENT_SAVED"})}catch(R){p({type:"SET_ERROR",error:R.message})}},[m,i,o,h.skillContent]),J=v.useCallback(async R=>{if(!m)try{const Y=await ke.saveEvals(i,o,R);p({type:"SET_EVALS",evals:Y})}catch(Y){p({type:"SET_ERROR",error:Y.message})}},[m,i,o]),F=v.useCallback((R,Y="benchmark")=>{if(m)return;const Q=h.caseRunStates.get(R);if((Q==null?void 0:Q.status)!=="running")if(f.current.delete(R),y.current.delete(R),p({type:"CASE_RUN_START",caseId:R,mode:Y}),Y==="comparison"){const P=`/api/skills/${i}/${o}/compare`;z(R,P,{eval_ids:[R]})}else{const P=`/api/skills/${i}/${o}/benchmark/case/${R}`;z(R,P,Y==="baseline"?{baseline_only:!0}:void 0)}},[m,i,o,h.caseRunStates,z]),ae=v.useCallback((R="benchmark")=>{var P;if(m)return;const Y=((P=h.evals)==null?void 0:P.evals)??[];if(Y.length===0)return;const Q=Y.map(ue=>ue.id);for(const ue of Q)f.current.delete(ue),y.current.delete(ue);p({type:"BULK_RUN_START",caseIds:Q,mode:R}),b.current=new Set(Q);for(const ue of Q)if(R==="comparison")z(ue,`/api/skills/${i}/${o}/compare`,{eval_ids:[ue]});else{const he=`/api/skills/${i}/${o}/benchmark/case/${ue}`;z(ue,he,R==="baseline"?{baseline_only:!0}:void 0)}},[m,i,o,h.evals,z]),G=v.useCallback(R=>{B(R),p({type:"CASE_RUN_CANCEL",caseId:R}),b.current.delete(R),y.current.add(R)},[B]),W=v.useCallback(()=>{q(),p({type:"CANCEL_ALL"}),b.current.clear()},[q]),te=v.useCallback(async(R,Y)=>{p({type:"OPEN_IMPROVE",evalId:R})},[]),$=v.useCallback(async(R,Y)=>{try{await ke.applyImprovement(i,o,Y),p({type:"SET_CONTENT",content:Y}),p({type:"CONTENT_SAVED"}),p({type:"CLOSE_IMPROVE"}),F(R,"benchmark")}catch(Q){p({type:"SET_ERROR",error:Q.message})}},[i,o,F]),le=Gc(),ge=v.useRef(null);v.useEffect(()=>{if(le.events.length)for(const R of le.events){const Y=R.data;if(R.event==="progress"&&p({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:Y.phase,message:Y.message}}),R.event==="done"){const Q=Y.improved,P=Y.reasoning,ue=Y.evalChanges??[];p({type:"AI_EDIT_RESULT",improved:Q,reasoning:P,evalChanges:ue})}if(R.event==="error"){const Q=Y;p({type:"AI_EDIT_ERROR",message:Q.description||"Unknown error",classified:Q})}}},[le.events]),v.useEffect(()=>{le.error&&p({type:"AI_EDIT_ERROR",message:le.error})},[le.error]),v.useEffect(()=>()=>{le.stop()},[le.stop]);const se=v.useCallback(async(R,Y,Q)=>{m||(p({type:"AI_EDIT_LOADING"}),ge.current=le.stop,le.start(`/api/skills/${i}/${o}/improve?sse`,{mode:"instruct",instruction:R,content:h.skillContent,evals:h.evals??{skill_name:o,evals:[]},provider:Y,model:Q}))},[m,i,o,h.skillContent,h.evals,le]),Te=v.useCallback(()=>{le.stop(),p({type:"AI_EDIT_ERROR",message:"Cancelled"})},[le]),pe=v.useCallback(async()=>{const R=h.aiEditResult;if(R!=null&&R.improved)try{if(await ke.applyImprovement(i,o,R.improved),p({type:"SET_CONTENT",content:R.improved}),p({type:"CONTENT_SAVED"}),h.aiEditEvalChanges.length>0&&Array.from(h.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:Q}=await zh(async()=>{const{mergeEvalChanges:he}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:he}},[]),P=h.evals??{skill_name:o,evals:[]},ue=Q(P,h.aiEditEvalChanges,h.aiEditEvalSelections);try{const he=await ke.saveEvals(i,o,ue);p({type:"SET_EVALS",evals:he})}catch(he){p({type:"SET_EVALS_RETRY",evalsFile:ue}),p({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${he.message}. You can retry from the AI Edit panel.`});return}}p({type:"CLOSE_AI_EDIT"})}catch(Y){p({type:"SET_ERROR",error:Y.message})}},[i,o,h.aiEditResult,h.evals,h.aiEditEvalChanges,h.aiEditEvalSelections]),Z=v.useCallback(()=>{p({type:"CLOSE_AI_EDIT"})},[]),ie=v.useCallback(R=>{p({type:"TOGGLE_EVAL_CHANGE",index:R})},[]),ve=v.useCallback(()=>{p({type:"SELECT_ALL_EVAL_CHANGES"})},[]),N=v.useCallback(()=>{p({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),A=v.useCallback(async()=>{const R=h.aiEditEvalsRetry;if(R)try{const Y=await ke.saveEvals(i,o,R);p({type:"SET_EVALS",evals:Y}),p({type:"SET_ERROR",error:null}),p({type:"CLOSE_AI_EDIT"})}catch(Y){p({type:"SET_ERROR",error:`Retry failed: ${Y.message}`})}},[i,o,h.aiEditEvalsRetry]),K=v.useCallback(async()=>{try{const R=await ke.getSkillDetail(i,o);p({type:"SET_CONTENT",content:R.skillContent}),p({type:"CONTENT_SAVED"})}catch{}},[i,o]),ce=Gc();v.useEffect(()=>{if(ce.events.length)for(const R of ce.events){const Y=R.data;if(R.event==="progress"&&p({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:Y.phase,message:Y.message}}),R.event==="done"){const Q=Y;ke.saveEvals(i,o,Q).then(P=>p({type:"GENERATE_EVALS_DONE",evals:P})).catch(P=>p({type:"SET_ERROR",error:P.message}))}R.event==="error"&&p({type:"GENERATE_EVALS_ERROR",classified:Y})}},[ce.events,i,o]),v.useEffect(()=>{ce.error&&p({type:"SET_ERROR",error:ce.error})},[ce.error]),v.useEffect(()=>()=>{ce.stop()},[ce.stop]);const ye=v.useCallback(async()=>{m||(p({type:"GENERATE_EVALS_START"}),ce.start(`/api/skills/${i}/${o}/generate-evals?sse`))},[m,i,o,ce]),S=Gc();v.useEffect(()=>()=>{S.stop()},[S.stop]),v.useEffect(()=>{if(S.events.length)for(const R of S.events)R.event==="prompt_result"&&p({type:"ACTIVATION_RESULT",result:R.data}),R.event==="done"&&p({type:"ACTIVATION_DONE",summary:R.data})},[S.events]),v.useEffect(()=>{S.error&&p({type:"ACTIVATION_ERROR",error:S.error})},[S.error]);const O=v.useCallback(R=>{const Q=R.trim().split(`
|
|
52
|
-
`).filter(Boolean).map(P=>P.startsWith("!")?{prompt:P.slice(1).trim(),expected:"should_not_activate"}:P.startsWith("+")?{prompt:P.slice(1).trim(),expected:"should_activate"}:{prompt:P.trim(),expected:"auto"});p({type:"ACTIVATION_START"}),S.start(`/api/skills/${i}/${o}/activation-test`,{prompts:Q})},[i,o,S]),X=v.useMemo(()=>({state:h,dispatch:p,isReadOnly:m,saveContent:V,saveEvals:J,runCase:F,runAll:ae,cancelCase:G,cancelAll:W,improveForCase:te,applyImproveAndRerun:$,refreshSkillContent:K,generateEvals:ye,runActivationTest:O,submitAiEdit:se,cancelAiEdit:Te,applyAiEdit:pe,discardAiEdit:Z,toggleEvalChange:ie,selectAllEvalChanges:ve,deselectAllEvalChanges:N,retryEvalsSave:A}),[h,m,V,J,F,ae,G,W,te,$,K,ye,O,se,Te,pe,Z,ie,ve,N,A]);return n.jsx(Bx.Provider,{value:X,children:d})}function Hh({state:i,isReadOnly:o,onDelete:c}){const{plugin:d,skill:m,evals:h,latestBenchmark:p,isDirty:b,caseRunStates:y,regressions:f,iterationCount:E}=i,g=Array.from(y.values()).some(J=>J.status==="running"||J.status==="queued"),T=p==null?void 0:p.overall_pass_rate,z=(h==null?void 0:h.evals.reduce((J,F)=>J+F.assertions.length,0))??0,B=(h==null?void 0:h.evals.length)??0,q=T!=null?T>=80?"var(--green)":T>=50?"var(--yellow)":"var(--red)":"var(--text-tertiary)",V=T!=null?T>=80?"var(--green-muted)":T>=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(qh,{}),n.jsx("span",{className:"font-medium",style:{color:"var(--text-primary)"},children:m}),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"]}),b&&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"}),g&&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:[!o&&c&&n.jsx("button",{disabled:g,onClick:()=>{window.confirm(`Delete skill "${m}"? This cannot be undone.`)&&c()},title:"Delete skill",className:"flex items-center justify-center transition-colors duration-150",style:{background:"none",border:"none",cursor:g?"not-allowed":"pointer",color:"var(--text-tertiary)",padding:4,opacity:g?.4:1,borderRadius:4},onMouseEnter:J=>{g||(J.currentTarget.style.color="var(--red)")},onMouseLeave:J=>{J.currentTarget.style.color="var(--text-tertiary)"},children:n.jsx(Gh,{})}),f.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"})]}),f.length," regression",f.length>1?"s":""]}),E>0&&n.jsxs("span",{className:"pill",style:{background:"var(--purple-muted)",color:"var(--purple)"},children:["Iter ",E]}),n.jsx("span",{className:"pill",style:{background:V,color:q},children:T!=null?`${Math.round(T*100)}%`:"--"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[B," case",B!==1?"s":""," / ",z," assert",z!==1?"s":""]})]})]})}function qh(){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"})})}function Gh(){return 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("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"}),n.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),n.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}const Yh=[{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 Vh({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 Qh({activePanel:i,onPanelChange:o,isDirty:c,isRunning:d,hasRegressions:m,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:Yh.map((p,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}}),p.tabs.map(y=>{const f=i===y.id,E=y.id==="editor"&&c||y.id==="run"&&d||y.id==="activation"&&h||y.id==="history"&&m,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:f?"var(--text-primary)":"var(--text-tertiary)",borderBottom:f?"2px solid var(--accent)":"2px solid transparent",cursor:"pointer",border:"none",borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:f?"var(--accent)":"transparent",whiteSpace:"nowrap"},onMouseEnter:T=>{f||(T.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:T=>{f||(T.currentTarget.style.color="var(--text-tertiary)")},children:[n.jsx(Vh,{id:y.id}),y.label,E&&n.jsx("span",{className:"absolute top-1.5 right-1 rounded-full",style:{width:5,height:5,background:g}})]},y.id)})]},p.label))})}function Xh(i){const o=i.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!o)return{metadata:{},body:i};const c=o[1],d=o[2].trim(),m={},h=c.split(`
|
|
53
|
-
`);let p="",b=!1;for(const y of h){const f=y.match(/^[ \t]+([\w-]+):\s*(.*)$/);if(f&&p&&b){const T=f[1],z=f[2].trim();let B=m[p];if((typeof B!="object"||Array.isArray(B))&&(B={},m[p]=B),!z)B[T]=[];else{const q=z.match(/^\[(.+)\]$/);q?B[T]=q[1].split(",").map(V=>V.trim().replace(/^["']|["']$/g,"")).filter(Boolean):B[T]=z.replace(/^["']|["']$/g,"")}continue}const E=y.match(/^\s+-\s+(.+)$/);if(E&&p){b=!1;const T=m[p];Array.isArray(T)?T.push(E[1].trim().replace(/^["']|["']$/g,"")):m[p]=[E[1].trim().replace(/^["']|["']$/g,"")];continue}const g=y.match(/^([\w-]+):\s*(.*)$/);if(g){p=g[1];const T=g[2].trim();if(b=!1,!T){m[p]={},b=!0;continue}const z=T.match(/^\[(.+)\]$/);if(z){m[p]=z[1].split(",").map(B=>B.trim().replace(/^["']|["']$/g,"")).filter(Boolean);continue}m[p]=T.replace(/^["']|["']$/g,"")}}return{metadata:m,body:d}}function br(i){if(!i)return"";try{let o=i.replace(/^---\n[\s\S]*?\n---\n?/,""),c=Zh(o);return c=c.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>'),c=c.replace(/^### (.+)$/gm,'<div style="font-weight:600;font-size:14px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),c=c.replace(/^## (.+)$/gm,'<div style="font-weight:700;font-size:15px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),c=c.replace(/^# (.+)$/gm,'<div style="font-weight:700;font-size:1rem;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),c=c.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--accent);text-decoration:underline">$1</a>'),c=c.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),c=c.replace(/\*([^*]+)\*/g,"<em>$1</em>"),c=c.replace(/`([^`]+)`/g,'<code style="background:var(--surface-3);padding:0.1rem 0.3rem;border-radius:3px;font-size:0.85em">$1</code>'),c=c.replace(/^- (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">• $1</div>'),c=c.replace(/^(\d+)\. (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">$1. $2</div>'),c=c.replace(/\n\n/g,'<div style="height:0.5rem"></div>'),c=c.replace(/\n/g,"<br/>"),c}catch{return`<pre style="white-space:pre-wrap;font-size:12px;line-height:1.5">${i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</pre>`}}function Zh(i){const o=i.split(`
|
|
54
|
-
`),c=[];let d=0;for(;d<o.length;)if(o[d].trim().startsWith("|")&&d+1<o.length&&o[d+1].trim().startsWith("|")&&/\|[\s-:]+\|/.test(o[d+1])){const m=yx(o[d]);d+=2;const h=[];for(;d<o.length&&o[d].trim().startsWith("|");)h.push(yx(o[d])),d++;const p='style="text-align:left;padding:0.4rem 0.6rem;font-weight:600;font-size:12px;color:var(--text-primary);border-bottom:1px solid var(--border-default)"',b='style="padding:0.4rem 0.6rem;font-size:12px;color:var(--text-secondary);border-bottom:1px solid var(--border-subtle)"';let y='<table style="width:100%;border-collapse:collapse;margin:0.5rem 0;border:1px solid var(--border-subtle);border-radius:6px;overflow:hidden">';y+="<thead><tr>";for(const f of m)y+=`<th ${p}>${f}</th>`;y+="</tr></thead><tbody>";for(const f of h){y+="<tr>";for(const E of f)y+=`<td ${b}>${E}</td>`;y+="</tr>"}y+="</tbody></table>",c.push(y)}else c.push(o[d]),d++;return c.join(`
|
|
55
|
-
`)}function yx(i){return i.split("|").map(o=>o.trim()).filter(o=>o.length>0)}function jr(i,o){const c=i.split(`
|
|
56
|
-
`),d=o.split(`
|
|
57
|
-
`);if(c.length>1e3||d.length>1e3)return[...c.map(E=>({type:"unchanged",content:E}))];const m=c.length,h=d.length,p=Array.from({length:m+1},()=>new Array(h+1).fill(0));for(let E=1;E<=m;E++)for(let g=1;g<=h;g++)c[E-1]===d[g-1]?p[E][g]=p[E-1][g-1]+1:p[E][g]=Math.max(p[E-1][g],p[E][g-1]);const b=[];let y=m,f=h;for(;y>0||f>0;)y>0&&f>0&&c[y-1]===d[f-1]?(b.push({type:"unchanged",content:c[y-1]}),y--,f--):f>0&&(y===0||p[y][f-1]>=p[y-1][f])?(b.push({type:"added",content:d[f-1]}),f--):(b.push({type:"removed",content:c[y-1]}),y--);return b.reverse()}function Kh(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 d=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:d.has(i)?"var(--accent)":"var(--green)"}})}function Pn({entries:i,isRunning:o}){const[c,d]=v.useState(!1),m=v.useRef(null);return v.useEffect(()=>{m.current&&!c&&(m.current.scrollTop=m.current.scrollHeight)},[i,c]),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:()=>d(!c),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:c?"rotate(0)":"rotate(180deg)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!c&&n.jsx("div",{ref:m,className:"px-3 pb-3 space-y-1 max-h-48 overflow-y-auto",children:i.map((h,p)=>{const b=p===i.length-1&&o,y=p===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:[Kh(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,"]"]})]},p)})})]})}const gx={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 Sr({error:i,onRetry:o,onDismiss:c}){const[d,m]=v.useState(null),h=v.useRef(null);v.useEffect(()=>(i.category==="rate_limit"&&i.retryAfterMs?m(Math.ceil(i.retryAfterMs/1e3)):m(null),()=>{h.current&&clearInterval(h.current)}),[i]),v.useEffect(()=>{if(!(d==null||d<=0))return h.current=setInterval(()=>{m(y=>y==null||y<=1?(h.current&&clearInterval(h.current),0):y-1)},1e3),()=>{h.current&&clearInterval(h.current)}},[d!=null&&d>0]);const p=gx[i.category]||gx.unknown,b=d!=null&&d>0;return n.jsxs("div",{className:"rounded-lg overflow-hidden animate-fade-in",style:{border:`1px solid color-mix(in srgb, ${p.color} 30%, transparent)`,background:`color-mix(in srgb, ${p.color} 6%, var(--surface-1))`},children:[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:p.icon}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:p.color},children:i.title})]}),c&&n.jsx("button",{onClick:c,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||d!=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 ${d}s`:"Retry"})})]})]})}function Jh({plugin:i,skill:o,skillContent:c,onApplied:d}){const[m,h]=v.useState("closed"),{config:p}=ln(),[b,y]=v.useState("claude-cli"),[f,E]=v.useState("opus"),[g,T]=v.useState([]),[z,B]=v.useState(""),[q,V]=v.useState(""),[J,F]=v.useState(null),[ae,G]=v.useState(null),[W,te]=v.useState([]),[$,le]=v.useState(!1),ge=v.useRef(null);v.useEffect(()=>{if(!p)return;p.providers.find(A=>A.id==="claude-cli"&&A.available)&&(y("claude-cli"),E("opus"))},[p]),v.useEffect(()=>()=>{var N;(N=ge.current)==null||N.abort()},[]);function se(){return p==null?void 0:p.providers.find(N=>N.id===b&&N.available)}const Te=v.useCallback(()=>{var N;(N=ge.current)==null||N.abort(),h("open")},[]);async function pe(){h("loading"),F(null),G(null),te([]);const N=new AbortController;ge.current=N;try{const A=await fetch(`/api/skills/${encodeURIComponent(i)}/${encodeURIComponent(o)}/improve?sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,model:f}),signal:N.signal});if(!A.ok||!A.body){let O=`HTTP ${A.status}`;try{const X=await A.json();X.error&&(O=X.error)}catch{}throw new Error(O)}const K=A.body.getReader(),ce=new TextDecoder;let ye="",S="";for(;;){const{done:O,value:X}=await K.read();if(O)break;ye+=ce.decode(X,{stream:!0});const R=ye.split(`
|
|
58
|
-
`);ye=R.pop()||"";for(const Y of R)if(Y.startsWith("event: "))S=Y.slice(7).trim();else if(Y.startsWith("data: ")){try{const Q=JSON.parse(Y.slice(6));S==="progress"?te(P=>[...P,{phase:Q.phase,message:Q.message,timestamp:Date.now()}]):S==="done"||S==="complete"?(B(Q.improved),V(Q.reasoning||""),T(jr(Q.original||c,Q.improved)),h("diff_shown")):S==="error"&&(F(Q.message||Q.description||"Unknown error"),Q.category&&G(Q),h("open"))}catch{}S=""}}}catch(A){A.name!=="AbortError"&&(F(A.message),h("open"))}finally{ge.current=null}}async function Z(){le(!0);try{await ke.applyImprovement(i,o,z),d(z),h("closed")}catch(N){F(N.message)}finally{le(!1)}}function ie(){h("closed"),T([]),B(""),V(""),F(null)}if(m==="closed")return n.jsxs("button",{onClick:()=>h("open"),className:"btn btn-secondary mb-5",disabled:!c,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 ve=se();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:ie,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:[(m==="open"||m==="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 A=p==null?void 0:p.providers.find(K=>K.id===N.target.value);A!=null&&A.models[0]&&E(A.models[0].id)},disabled:m==="loading",children:p==null?void 0:p.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:f,onChange:N=>E(N.target.value),disabled:m==="loading",children:ve==null?void 0:ve.models.map(N=>n.jsx("option",{value:N.id,children:N.label},N.id))})]}),m==="loading"?n.jsx("button",{onClick:Te,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):n.jsx("button",{onClick:pe,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),m==="loading"&&W.length>0&&n.jsx("div",{className:"mt-3",children:n.jsx(Pn,{entries:W,isRunning:!0})})]}),J&&n.jsx("div",{className:"mb-4",children:ae?n.jsx(Sr,{error:ae,onRetry:pe,onDismiss:()=>{F(null),G(null)}}):n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:J})}),m==="diff_shown"&&n.jsxs(n.Fragment,{children:[q&&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: "}),q]}),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,A)=>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]},A))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:Z,disabled:$,className:"btn btn-primary",children:$?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:ie,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const bx={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"}},$h={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function Wh({change:i,index:o,selected:c,onToggle:d,originalEval:m}){var g;const[h,p]=v.useState(!1),b=bx[i.action]??bx.add,y=$h[i.action]??"var(--border-subtle)",f=i.action==="remove"?(m==null?void 0:m.name)??`Eval #${i.evalId}`:((g=i.eval)==null?void 0:g.name)??"Unnamed",E=v.useCallback(()=>d(o),[d,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:c?1:.5},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsx("input",{type:"checkbox",checked:c,onChange:E,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:f}),n.jsx("span",{className:"text-[11px] truncate flex-1",style:{color:"var(--text-tertiary)"},children:i.reason}),n.jsx("button",{onClick:()=>p(!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:T=>{T.currentTarget.style.background="var(--surface-3)"},onMouseLeave:T=>{T.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(Fh,{evalCase:i.eval}),i.action==="modify"&&i.eval&&m&&n.jsx(Ih,{original:m,proposed:i.eval}),i.action==="remove"&&m&&n.jsx(Ph,{evalCase:m})]})]})}function Fh({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[n.jsx(Ic,{label:"Prompt",value:i.prompt}),n.jsx(Ic,{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(c=>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:"+"})," ",c.text]},c.id))})]})]})}function Ih({original:i,proposed:o}){const c=[];i.name!==o.name&&c.push({label:"Name",old:i.name,new:o.name}),i.prompt!==o.prompt&&c.push({label:"Prompt",old:i.prompt,new:o.prompt}),i.expected_output!==o.expected_output&&c.push({label:"Expected",old:i.expected_output,new:o.expected_output});const d=i.assertions??[],m=o.assertions??[],h=new Set(d.map(f=>f.text)),p=new Set(m.map(f=>f.text)),b=m.filter(f=>!h.has(f.text)),y=d.filter(f=>!p.has(f.text));return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[c.map(f=>n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:f.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:["- ",Pc(f.old,120)]}),n.jsxs("div",{style:{color:"var(--green)"},children:["+ ",Pc(f.new,120)]})]})]},f.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(f=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--red)"},children:["- ",f.text]},f.id)),b.map(f=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",f.text]},f.id))]})]}),c.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 Ph({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[n.jsx(Ic,{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(c=>n.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:c.text},c.id))})]})]})}function Ic({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:Pc(o,300)})]})}function Pc(i,o){return i.length>o?i.slice(0,o)+"...":i}const jx={remove:0,modify:1,add:2};function ev({changes:i,selections:o,currentEvals:c,onToggle:d,onSelectAll:m,onDeselectAll:h}){if(i.length===0)return null;const p=i.map((y,f)=>({change:y,originalIndex:f}));p.sort((y,f)=>(jx[y.change.action]??2)-(jx[f.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:m,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:p.map(({change:y,originalIndex:f})=>n.jsx(Wh,{change:y,index:f,selected:o.get(f)??!1,onToggle:d,originalEval:y.evalId!=null?c.find(E=>E.id===y.evalId):void 0},f))})]})}function tv(){var N;const{state:i,dispatch:o,submitAiEdit:c,applyAiEdit:d,discardAiEdit:m,cancelAiEdit:h,toggleEvalChange:p,selectAllEvalChanges:b,deselectAllEvalChanges:y,retryEvalsSave:f}=ll(),{aiEditLoading:E,aiEditResult:g,aiEditError:T,aiEditClassifiedError:z,aiEditProgress:B,aiEditEvalChanges:q,aiEditEvalSelections:V,aiEditEvalsRetry:J}=i,[F,ae]=v.useState(""),{config:G}=ln(),[W,te]=v.useState("claude-cli"),[$,le]=v.useState("opus"),ge=v.useRef(null);v.useEffect(()=>{var A;(A=ge.current)==null||A.focus()},[]),v.useEffect(()=>{if(!G)return;G.providers.find(K=>K.id==="claude-cli"&&K.available)&&(te("claude-cli"),le("opus"))},[G]);const se=G==null?void 0:G.providers.find(A=>A.id===W&&A.available),Te=v.useCallback(()=>{const A=F.trim();!A||E||c(A,W,$)},[F,E,c,W,$]),pe=v.useCallback(A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),Te()),A.key==="Escape"&&(A.preventDefault(),E?h():m())},[Te,E,h,m]),Z=v.useCallback(()=>{o({type:"CLOSE_AI_EDIT"}),o({type:"OPEN_AI_EDIT"})},[o]),ie=g?jr(i.skillContent,g.improved):[],ve=((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:m,className:"w-6 h-6 rounded-md flex items-center justify-center 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.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:ge,value:F,onChange:A=>ae(A.target.value),onKeyDown:pe,placeholder:"e.g., Add an error handling section...",disabled:E,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:A=>{const K=A.currentTarget;K.style.height="auto",K.style.height=Math.min(K.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:A=>{te(A.target.value);const K=G==null?void 0:G.providers.find(ce=>ce.id===A.target.value);K!=null&&K.models[0]&&le(K.models[0].id)},disabled:E,style:{width:"100%"},children:G==null?void 0:G.providers.filter(A=>A.available).map(A=>n.jsx("option",{value:A.id,children:A.label},A.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:$,onChange:A=>le(A.target.value),disabled:E,style:{width:"100%"},children:se==null?void 0:se.models.map(A=>n.jsx("option",{value:A.id,children:A.label},A.id))})]}),E?n.jsx("button",{onClick:h,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):n.jsx("button",{onClick:Te,disabled:!F.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),E&&B.length>0&&n.jsx("div",{className:"mt-2.5",children:n.jsx(Pn,{entries:B,isRunning:!0})})]}),T&&n.jsx("div",{className:"mt-3",children:z?n.jsx(Sr,{error:z,onRetry:Z,onDismiss:m}):n.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:T})}),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:ie.map((A,K)=>n.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:A.type==="added"?"rgba(34,197,94,0.1)":A.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:A.type==="added"?"var(--green)":A.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:A.type==="added"?"3px solid var(--green)":A.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:A.type==="added"?"+":A.type==="removed"?"-":" "}),A.content]},K))}),n.jsx(ev,{changes:q,selections:V,currentEvals:ve,onToggle:p,onSelectAll:b,onDeselectAll:y}),J&&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:f,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:d,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:m,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),n.jsx("button",{onClick:Z,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function lv(i,o){const[c,d]=v.useState([]),[m,h]=v.useState("SKILL.md"),[p,b]=v.useState(null),[y,f]=v.useState(!1),[E,g]=v.useState(null),T=v.useCallback(async()=>{try{const q=await ke.getSkillFiles(i,o);d(q.files)}catch{d([])}},[i,o]);v.useEffect(()=>{h("SKILL.md"),b(null),g(null),T()},[i,o,T]);const z=v.useCallback(async q=>{if(h(q),q==="SKILL.md"){b(null),g(null);return}f(!0),g(null);try{const V=await ke.getSkillFile(i,o,q);b(V)}catch(V){g(`Unable to open file: ${V.message}`),b(null)}finally{f(!1)}},[i,o]),B=v.useCallback(()=>{T()},[T]);return{files:c,activeFile:m,secondaryContent:p,loading:y,error:E,selectFile:z,refresh:B,isSkillMd:m==="SKILL.md"}}function av(i){const o=[],c=new Map;for(const d of i){const m=d.path.split("/"),p={name:m[m.length-1],path:d.path,type:d.type,children:[]};c.set(d.path,p)}for(const d of i){const m=d.path.split("/");if(m.length===1){const h=c.get(d.path);h&&o.push(h)}else{const h=m.slice(0,-1).join("/"),p=c.get(h),b=c.get(d.path);p&&b&&p.children.push(b)}}return o}function Ux({expanded:i}){return n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:i?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function Hx(){return n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function nv(){return n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",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"})]})}function sv(){return 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("polyline",{points:"23 4 23 10 17 10"}),n.jsx("polyline",{points:"1 20 1 14 7 14"}),n.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}function qx({node:i,depth:o,activeFile:c,onSelect:d}){const[m,h]=v.useState(!0),p=i.path===c;return i.type==="dir"?n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>h(!m),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+o*14}px`,paddingTop:2,paddingBottom:2,background:"none",border:"none",cursor:"pointer",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono, monospace)",textAlign:"left"},children:[n.jsx(Ux,{expanded:m}),n.jsx(Hx,{}),n.jsxs("span",{children:[i.name,"/"]})]}),m&&i.children.map(b=>n.jsx(qx,{node:b,depth:o+1,activeFile:c,onSelect:d},b.path))]}):n.jsxs("button",{onClick:()=>d(i.path),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+o*14}px`,paddingTop:2,paddingBottom:2,background:p?"var(--accent-muted)":"none",border:"none",cursor:"pointer",color:p?"var(--accent)":"var(--text-tertiary)",fontSize:11,fontFamily:"var(--font-mono, monospace)",textAlign:"left",borderRadius:3},children:[n.jsx("span",{style:{width:10}}),n.jsx(nv,{}),n.jsx("span",{children:i.name})]})}function rv({files:i,activeFile:o,onSelect:c,onRefresh:d}){const[m,h]=v.useState(!1),p=v.useMemo(()=>av(i),[i]);return n.jsxs("div",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"3px 8px",cursor:"pointer",userSelect:"none"},onClick:()=>h(!m),children:[n.jsx(Ux,{expanded:m}),n.jsx(Hx,{}),n.jsx("span",{style:{fontSize:11,fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o}),n.jsx("button",{onClick:b=>{b.stopPropagation(),d()},style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:"2px 4px",display:"flex",alignItems:"center",borderRadius:3},title:"Refresh file list",children:n.jsx(sv,{})})]}),m&&n.jsx("div",{style:{maxHeight:240,overflowY:"auto",padding:"2px 4px 4px"},children:p.length===0?n.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",padding:"4px 8px"},children:"No files found"}):p.map(b=>n.jsx(qx,{node:b,depth:0,activeFile:o,onSelect:y=>{c(y),h(!1)}},b.path))})]})}function hr(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function iv(i){try{return JSON.stringify(JSON.parse(i),null,2)}catch{return i}}function cv(i){const o=i.toLowerCase();return o.endsWith(".json")?"json":o.endsWith(".md")?"md":"other"}function Sx({content:i}){return n.jsx("textarea",{readOnly:!0,value:i,style:{flex:1,width:"100%",resize:"none",background:"var(--surface-1)",color:"var(--text-primary)",border:"none",outline:"none",padding:"12px 16px",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6}})}function Nx({content:i,fileType:o}){if(o==="json"){const c=iv(i);return n.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:c})}return o==="md"?n.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px 20px",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:13,lineHeight:1.6},dangerouslySetInnerHTML:{__html:br(i)}}):n.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i})}function ov({file:i,loading:o,error:c,viewMode:d}){const[m,h]=v.useState(d),p=d!==m?d:m;if(o)return n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:"Loading…"});if(c)return n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:n.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"16px 20px",maxWidth:400,textAlign:"center"},children:[n.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",fontWeight:600,marginBottom:6},children:"Unable to open file"}),n.jsx("div",{style:{fontSize:12,color:"var(--text-tertiary)"},children:c})]})});if(!i)return null;if(i.binary)return n.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:["Binary file (",hr(i.size),") — cannot be displayed"]});const b=i.content??"",y=cv(i.path);return n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[i.truncated&&n.jsxs("div",{style:{padding:"4px 12px",background:"var(--warning-muted, #fef3c7)",borderBottom:"1px solid var(--border-subtle)",fontSize:11,color:"var(--warning-text, #92400e)"},children:["File truncated at ",hr(512*1024)," — ",hr(i.size)," total"]}),y!=="other"&&n.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[["raw","split","preview"].map(f=>n.jsx("button",{onClick:()=>h(f),style:{padding:"2px 8px",fontSize:11,background:p===f?"var(--accent-muted)":"none",color:p===f?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer",textTransform:"capitalize"},children:f},f)),n.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-tertiary)",display:"flex",alignItems:"center"},children:[hr(i.size)," · read-only"]})]}),n.jsx("div",{style:{flex:1,display:"flex",minHeight:0},children:p==="split"&&y!=="other"?n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",borderRight:"1px solid var(--border-subtle)"},children:n.jsx(Sx,{content:b})}),n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:n.jsx(Nx,{content:b,fileType:y})})]}):p==="preview"&&y!=="other"?n.jsx(Nx,{content:b,fileType:y}):n.jsx(Sx,{content:b})})]})}function uv({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 dv({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 fv({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 xv({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 Yc({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 mv(){const{state:i,dispatch:o,saveContent:c,isReadOnly:d}=ll(),{plugin:m,skill:h,skillContent:p,isDirty:b,improveTarget:y,aiEditOpen:f}=i,[E,g]=v.useState("split"),[T,z]=v.useState(!1),B=v.useRef(null),[q,V]=v.useState(!1),[J,F]=v.useState(""),[ae,G]=v.useState(!1),[W,te]=v.useState(null),[$,le]=v.useState([]),[ge,se]=v.useState([]),[Te,pe]=v.useState(null),Z=v.useRef(null),{config:ie}=ln(),{files:ve,activeFile:N,secondaryContent:A,loading:K,error:ce,selectFile:ye,refresh:S,isSkillMd:O}=lv(m??"",h??"");v.useEffect(()=>()=>{var I;(I=Z.current)==null||I.abort()},[]);const{metadata:X,body:R}=Xh(p),Y=X["allowed-tools"],Q=Array.isArray(Y)?Y:typeof Y=="string"?[Y]:[],P=X.name,ue=X.description,he=X.metadata,tt=typeof he=="object"&&!Array.isArray(he)?he:null,nt=X.version||(tt==null?void 0:tt.version),$t=X.tags||(tt==null?void 0:tt.tags),Wt=Array.isArray($t)?$t:typeof $t=="string"?$t.split(",").map(I=>I.trim()).filter(Boolean):[],Qt=new Set(["name","description","metadata","allowed-tools","version","tags"]),dt=Object.entries(X).filter(([I])=>!Qt.has(I)),al=v.useCallback(async()=>{z(!0),await c(),z(!1)},[c]),pa=v.useCallback(I=>{(I.ctrlKey||I.metaKey)&&I.key==="s"&&(I.preventDefault(),I.stopPropagation(),b&&al()),(I.ctrlKey||I.metaKey)&&I.key==="k"&&(I.preventDefault(),I.stopPropagation(),o({type:f?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[b,al,f,o]),vt=v.useCallback(async()=>{var Le,xe;if(!J.trim())return;(Le=Z.current)==null||Le.abort();const I=new AbortController;Z.current=I,G(!0),pe(null),se([]),te(null),le([]);try{const He=(ie==null?void 0:ie.provider)||"claude-cli",yt=(ie==null?void 0:ie.model)||"sonnet",Re=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:J,provider:He,model:yt}),signal:I.signal});if(!Re.ok||!Re.body){let xt=`HTTP ${Re.status}`;try{const Qe=await Re.json();Qe.error&&(xt=Qe.error)}catch{}throw new Error(xt)}const nn=Re.body.getReader(),ha=new TextDecoder;let nl="",ft="";for(;;){const{done:xt,value:Qe}=await nn.read();if(xt)break;nl+=ha.decode(Qe,{stream:!0});const gt=nl.split(`
|
|
59
|
-
`);nl=gt.pop()||"";for(const Xe of gt)if(Xe.startsWith("event: "))ft=Xe.slice(7).trim();else if(Xe.startsWith("data: ")){try{const Ce=JSON.parse(Xe.slice(6));if(ft==="progress")se(mt=>[...mt,{phase:Ce.phase,message:Ce.message,timestamp:Date.now()}]);else if(ft==="done"||ft==="complete"){const mt=["---"];Ce.name&&mt.push(`name: ${Ce.name}`),Ce.description&&mt.push(`description: "${Ce.description.replace(/"/g,'\\"')}"`),Ce.model&&mt.push(`model: ${Ce.model}`),(xe=Ce.allowedTools)!=null&&xe.trim()&&mt.push(`allowed-tools: ${Ce.allowedTools.trim()}`),mt.push("---","",Ce.body||"");const va=mt.join(`
|
|
60
|
-
`);te(va),le(jr(p,va)),G(!1)}else ft==="error"&&(pe(Ce.message||Ce.description||"Generation failed"),G(!1))}catch{}ft=""}}}catch(He){He.name!=="AbortError"&&pe(He.message)}finally{G(!1),Z.current=null}},[J,ie,p]),Ft=v.useCallback(()=>{W&&o({type:"SET_CONTENT",content:W}),V(!1),te(null),le([]),F(""),se([])},[W,o]),Xt=v.useCallback(()=>{V(!1),te(null),le([]),F(""),se([]),pe(null)},[]),Wl=v.useCallback(()=>{var I;q?((I=Z.current)==null||I.abort(),Xt()):(f&&o({type:"CLOSE_AI_EDIT"}),V(!0))},[q,f,o,Xt]),an=[{mode:"raw",icon:n.jsx(uv,{}),label:"Editor"},{mode:"split",icon:n.jsx(dv,{}),label:"Split"},{mode:"preview",icon:n.jsx(fv,{}),label:"Preview"}];return n.jsxs("div",{className:"flex flex-col h-full",onKeyDown:pa,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:an.map(({mode:I,icon:Le,label:xe})=>n.jsxs("button",{onClick:()=>g(I),title:xe,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:E===I?"var(--surface-4)":"transparent",color:E===I?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:E===I?600:400,border:"none",cursor:"pointer"},children:[Le,n.jsx("span",{style:{letterSpacing:"0.01em"},children:xe})]},I))}),O?d?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:()=>{f?o({type:"CLOSE_AI_EDIT"}):(q&&Xt(),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:f?600:400,border:"none",cursor:"pointer",color:f?"#a855f7":"var(--text-tertiary)",background:f?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(xv,{size:13}),n.jsx("span",{children:"AI Edit"})]}),n.jsxs("button",{onClick:Wl,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:q?600:400,border:"none",cursor:"pointer",color:q?"#a855f7":"var(--text-tertiary)",background:q?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(Yc,{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:al,disabled:!b||T,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:T?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]}):null]}),m&&h&&n.jsx(rv,{files:ve,activeFile:N,onSelect:ye,onRefresh:S}),!O&&n.jsx(ov,{file:A,loading:K,error:ce,viewMode:E}),O&&n.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:E==="raw"||E==="preview"?"1fr":"1fr 1fr"},children:[E!=="preview"&&n.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:E==="split"?"1px solid var(--border-subtle)":"none"},children:n.jsx("textarea",{ref:B,value:p,onChange:I=>{d||o({type:"SET_CONTENT",content:I.target.value})},onKeyDown:pa,spellCheck:!1,readOnly:d,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:d?.7:1}})}),E!=="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:[(P||nt||ue)&&n.jsxs("div",{style:{marginBottom:20},children:[n.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[P&&n.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:P}),nt&&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",nt]})]}),ue&&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:ue})]}),Wt.length>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:Wt.map(I=>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:I},I))}),Q.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"}),Q.map(I=>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:I},I))]})}),dt.length>0&&n.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:dt.map(([I,Le],xe)=>{const He=Array.isArray(Le)?Le.join(", "):typeof Le=="object"?Object.entries(Le).map(([yt,Re])=>`${yt}: ${Array.isArray(Re)?Re.join(", "):Re}`).join(" | "):Le;return n.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:xe>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:I}),n.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:He})]},I)})}),(P||ue||Wt.length>0||Q.length>0||dt.length>0)&&R&&n.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),R&&n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:br(R)}})]})})]}),O&&f&&n.jsx(tv,{}),O&&q&&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(Yc,{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:J,onChange:I=>F(I.target.value),placeholder:"Describe what this skill should do...",rows:2,disabled:ae,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:ae?.5:1},onKeyDown:I=>{I.key==="Enter"&&(I.ctrlKey||I.metaKey)&&J.trim()&&!ae&&(I.preventDefault(),vt())}})}),n.jsxs("div",{className:"flex items-center gap-2",children:[ae?n.jsx("button",{onClick:()=>{var I;(I=Z.current)==null||I.abort(),G(!1)},className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Cancel"}):n.jsx("button",{onClick:vt,disabled:!J.trim(),className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:"Generate"}),n.jsx("button",{onClick:Xt,className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Close"})]}),ae&&ge.length>0&&n.jsx("div",{className:"mt-2",children:n.jsx(Pn,{entries:ge,isRunning:!0})}),Te&&n.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:[Te,n.jsx("button",{onClick:vt,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(Yc,{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:$.map((I,Le)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:I.type==="added"?"rgba(34,197,94,0.1)":I.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:I.type==="added"?"var(--green)":I.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:I.type==="added"?"3px solid var(--green)":I.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:I.type==="added"?"+":I.type==="removed"?"-":" "}),I.content]},Le))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:Ft,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:Xt,className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Discard"})]})]})]})}),O&&y!==null&&m&&h&&n.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(Jh,{plugin:m,skill:h,skillContent:p,onApplied:I=>{o({type:"SET_CONTENT",content:I}),o({type:"CONTENT_SAVED"}),o({type:"CLOSE_IMPROVE"})}})})]})}function eo(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Gx(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 Yx(i){return i==null?"--":i>=1e3?`${(i/1e3).toFixed(1)}s`:`${i}ms`}const pv=new Set(["benchmark","comparison","baseline"]);function Ex(i,o,c,d){return i.map(({rate:m,idx:h,total:p})=>{const b=d+h/(p-1)*(o-d*2),y=d+(c-d*2)-m*(c-d*2);return`${b},${y}`})}function Vx({entries:i}){const o=i.filter(g=>pv.has(g.type)).slice().reverse(),c=o.map((g,T,z)=>({rate:g.pass_rate,idx:T,total:z.length})).filter((g,T)=>{const z=o[T].type;return z==="benchmark"||z==="comparison"}),d=o.flatMap((g,T)=>g.type==="baseline"?[{rate:g.pass_rate,idx:T,total:o.length}]:g.type==="comparison"&&g.baselinePassRate!=null?[{rate:g.baselinePassRate,idx:T,total:o.length}]:[]);if(c.length<2&&d.length<2)return null;const m=80,h=24,p=2,b=c.length>=2?Ex(c,m,h,p):[],y=d.length>=2?Ex(d,m,h,p):[],f=b[b.length-1],E=y[y.length-1];return n.jsxs("svg",{width:m,height:h,style:{display:"block",flexShrink:0},children:[y.length>0&&n.jsx("polyline",{points:y.join(" "),fill:"none",stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeLinejoin:"round",strokeDasharray:"3 2"}),b.length>0&&n.jsx("polyline",{points:b.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),E&&n.jsx("circle",{cx:parseFloat(E.split(",")[0]),cy:parseFloat(E.split(",")[1]),r:2.5,fill:"var(--text-tertiary)"}),f&&n.jsx("circle",{cx:parseFloat(f.split(",")[0]),cy:parseFloat(f.split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function hv(i,o,c){const[d,m]=v.useState(null),[h,p]=v.useState(!1),b=v.useRef("");v.useEffect(()=>{const f=`${i}/${o}/${c}`;b.current!==f&&(b.current=f,p(!0),ke.getCaseHistory(i,o,c).then(E=>m(E)).catch(()=>m([])).finally(()=>p(!1)))},[i,o,c]);const y=v.useCallback(()=>{p(!0),b.current="",ke.getCaseHistory(i,o,c).then(f=>m(f)).catch(()=>m([])).finally(()=>p(!1))},[i,o,c]);return{entries:d,loading:h,refetch:y}}function vv(i,o,c){const d={flaky:!1,nonDiscriminating:!1,regression:!1};if(!c||c.length===0)return d;const h=c.slice(0,10).map(y=>y.assertions.find(f=>f.id===i)).filter(Boolean);if(h.length>=2){const f=h.filter(E=>E.pass).length/h.length;f>=.3&&f<=.7&&(d.flaky=!0)}const p=c.find(y=>y.type==="benchmark"),b=c.find(y=>y.type==="baseline");if(p&&b){const y=p.assertions.find(E=>E.id===i),f=b.assertions.find(E=>E.id===i);y!=null&&y.pass&&(f!=null&&f.pass)&&(d.nonDiscriminating=!0)}if(o&&!o.pass&&c.length>=1){const f=c[0].assertions.find(E=>E.id===i);f!=null&&f.pass&&(d.regression=!0)}return d}function yv(){var ge;const{state:i,dispatch:o,saveEvals:c,runCase:d,runAll:m,cancelCase:h,cancelAll:p,generateEvals:b,isReadOnly:y}=ll(),{evals:f,evalsError:E,selectedCaseId:g,inlineResults:T,caseRunStates:z,generateEvalsLoading:B,generateEvalsProgress:q,generateEvalsError:V}=i,J=v.useMemo(()=>{for(const se of z.values())if(se.status==="running"||se.status==="queued")return!0;return!1},[z]),[F,ae]=v.useState(!1),G={skill_name:i.skill,evals:[]},W=f??G,te=W.evals,$=te.find(se=>se.id===g)??null,le=v.useCallback(()=>{b()},[b]);return!f||te.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:E?"var(--error-muted, #3f1a1a)":"var(--accent-muted)"},children:E?n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--error, #f87171)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}):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.jsx("div",{className:"text-center",children:E?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--error, #f87171)"},children:"Invalid evals.json"}),n.jsx("div",{className:"text-[11px] font-mono px-3 py-2 rounded mt-1 max-w-sm text-left break-words",style:{color:"var(--text-secondary)",background:"var(--surface-2)"},children:E}),n.jsx("div",{className:"text-[12px] mt-2",style:{color:"var(--text-tertiary)"},children:"Fix the evals.json file and reload, or regenerate test cases with AI"})]}):n.jsxs(n.Fragment,{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:()=>ae(!0),disabled:y,className:"btn btn-primary text-[12px]",children:"Create Test Case"}),n.jsx("button",{onClick:le,disabled:B||y,className:"btn btn-secondary text-[12px]",children:B?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate with AI"})]}),B&&q.length>0&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(Pn,{entries:q,isRunning:!0})}),V&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(Sr,{error:V,onRetry:le})}),F&&n.jsx(kx,{evals:W,onSave:se=>{c(se),ae(!1)},onCancel:()=>ae(!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 (",te.length,")"]}),n.jsx("div",{className:"flex items-center gap-1.5",children:J?n.jsx("button",{onClick:p,className:"btn text-[10px] px-2 py-0.5",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:"Cancel All"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>m("benchmark"),disabled:te.length===0||y,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),n.jsx("button",{onClick:()=>m("comparison"),disabled:te.length===0||y,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),n.jsx("div",{className:"py-1",children:te.map(se=>{const Te=T.get(se.id),pe=g===se.id;return n.jsxs("button",{onClick:()=>o({type:"SELECT_CASE",caseId:se.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:pe?"var(--accent-muted)":"transparent",borderLeft:pe?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:Z=>{pe||(Z.currentTarget.style.background="var(--surface-2)")},onMouseLeave:Z=>{pe||(Z.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:pe?"var(--text-primary)":"var(--text-secondary)"},children:["#",se.id," ",se.name]}),n.jsx(Qx,{result:Te})]}),n.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[se.assertions.length," assertion",se.assertions.length!==1?"s":"",(Te==null?void 0:Te.passRate)!=null&&n.jsx(jv,{passRate:Te.passRate})]})]},se.id)})}),n.jsx("div",{className:"px-3 py-2",children:!y&&n.jsx("button",{onClick:()=>ae(!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:se=>{se.currentTarget.style.borderColor="var(--accent)",se.currentTarget.style.color="var(--accent)"},onMouseLeave:se=>{se.currentTarget.style.borderColor="var(--border-default)",se.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),n.jsx("div",{className:"overflow-auto",children:$?n.jsx(gv,{evalCase:$,result:T.get($.id),evals:f,caseStatus:((ge=z.get($.id))==null?void 0:ge.status)??"idle",onSaveEvals:c,onRun:se=>d(se,"benchmark"),onCompare:se=>d(se,"comparison"),onCancel:se=>h(se),onImprove:se=>o({type:"OPEN_IMPROVE",evalId:se})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),F&&n.jsx(kx,{evals:W,onSave:se=>{c(se),ae(!1)},onCancel:()=>ae(!1)})]})}function gv({evalCase:i,result:o,evals:c,caseStatus:d,onSaveEvals:m,onRun:h,onCompare:p,onCancel:b,onImprove:y}){const{state:f,isReadOnly:E}=ll(),{plugin:g,skill:T}=f,{entries:z,loading:B}=hv(g,T,i.id),[q,V]=v.useState(!1),[J,F]=v.useState(i.prompt),[ae,G]=v.useState(!1),[W,te]=v.useState(i.expected_output);v.useState(()=>{F(i.prompt),te(i.expected_output)});const $=v.useCallback(N=>{m({...c,evals:c.evals.map(A=>A.id===N.id?N:A)})},[c,m]),le=v.useCallback(()=>{$({...i,prompt:J}),V(!1)},[i,J,$]),ge=v.useCallback(()=>{$({...i,expected_output:W}),G(!1)},[i,W,$]),se=v.useCallback(()=>{$({...i,assertions:[...i.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[i,$]),Te=v.useCallback((N,A)=>{$({...i,assertions:i.assertions.map(K=>K.id===N?{...K,text:A}:K)})},[i,$]),pe=v.useCallback(N=>{$({...i,assertions:i.assertions.filter(A=>A.id!==N)})},[i,$]),Z=v.useCallback(()=>{confirm("Delete this test case?")&&m({...c,evals:c.evals.filter(N=>N.id!==i.id)})},[c,i.id,m]),ie=o&&o.assertions.length>0&&o.assertions.every(N=>N.pass),ve=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(Qx,{result:o})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[d==="running"||d==="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:E,className:"btn btn-primary text-[12px]",children:"Run"}),n.jsx("button",{onClick:()=>p(i.id),disabled:E,className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),ve&&!E&&d!=="running"&&d!=="queued"&&n.jsx("button",{onClick:()=>y(i.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),!E&&d!=="running"&&d!=="queued"&&n.jsx("button",{onClick:Z,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"})]})})]})]}),ie&&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(Vc,{title:"Prompt",children:q?n.jsxs("div",{children:[n.jsx("textarea",{value:J,onChange:N=>F(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:le,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{F(i.prompt),V(!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:E?"default":"pointer"},onClick:()=>{E||V(!0)},onMouseEnter:N=>{E||(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:E?"No prompt":"Click to edit prompt..."})})}),n.jsx(Vc,{title:"Expected Output",children:ae?n.jsxs("div",{children:[n.jsx("textarea",{value:W,onChange:N=>te(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:ge,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{te(i.expected_output),G(!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:E?"default":"pointer"},onClick:()=>{E||G(!0)},onMouseEnter:N=>{E||(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:E?"No expected output":"Click to edit expected output..."})})}),n.jsx(Vc,{title:`Assertions (${i.assertions.length})`,action:E?void 0:n.jsx("button",{onClick:se,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 A=o==null?void 0:o.assertions.find(ce=>ce.assertion_id===N.id),K=vv(N.id,A,z);return n.jsx(bv,{assertion:N,result:A,badges:K,isReadOnly:E,onUpdate:ce=>Te(N.id,ce),onDelete:()=>pe(N.id)},N.id)})})}),(o==null?void 0:o.output)&&n.jsx(Sv,{output:o.output,durationMs:o.durationMs,tokens:o.tokens}),n.jsx(Nv,{evalId:i.id,sharedEntries:z,sharedLoading:B})]},i.id)}function bv({assertion:i,result:o,badges:c,isReadOnly:d,onUpdate:m,onDelete:h}){const[p,b]=v.useState(!1),[y,f]=v.useState(i.text),[E,g]=v.useState(!1),T=()=>{m(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"}),(c==null?void 0:c.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}),(c==null?void 0:c.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"}),(c==null?void 0:c.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."})]}),p?n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{value:y,onChange:z=>f(z.target.value),onKeyDown:z=>{z.key==="Enter"&&T(),z.key==="Escape"&&b(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),n.jsx("button",{onClick:T,className:"btn btn-primary text-[11px]",children:"Save"})]}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-secondary)",cursor:d?"default":"pointer"},onClick:()=>{d||(f(i.text),b(!0))},children:i.text}),(o==null?void 0:o.reasoning)&&n.jsx("button",{onClick:()=>g(!E),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:E?"Hide reasoning":"Show reasoning"}),E&&(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})]}),!d&&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 Vc({title:i,action:o,children:c}){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]}),c]})}function Qx({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 jv({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 Sv({output:i,durationMs:o,tokens:c}){const[d,m]=v.useState(!1);return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:()=>m(!d),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:d?"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)"]}),c!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",c," tokens)"]})]}),d&&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 Qc(i){return i==="baseline"?"right":i==="comparison"?"full":"left"}function Xc({entry:i}){return 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:Gx(i.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:i.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:i.type==="benchmark"?"rgba(99,131,255,0.15)":i.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:i.type==="benchmark"?"#6383ff":i.type==="comparison"?"var(--purple)":"#fb923c"},children:i.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:eo(i.pass_rate)},children:[Math.round(i.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:[i.durationMs!=null&&n.jsx("span",{children:Yx(i.durationMs)}),i.tokens!=null&&n.jsxs("span",{children:[i.tokens>=1e3?`${(i.tokens/1e3).toFixed(1)}k`:i.tokens," tok"]})]}),i.type==="comparison"&&i.baselinePassRate!=null&&(()=>{const o=i.pass_rate-i.baselinePassRate,c=o>.001?"skill":o<-.001?"baseline":"tie",d=o>0?"+":"",m=c==="skill"?"var(--green)":c==="baseline"?"var(--red)":"var(--text-tertiary)";return n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"vs baseline:"}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:o>=0?"var(--green)":"var(--red)"},children:[d,(o*100).toFixed(1),"%"]}),n.jsx("span",{className:"pill text-[9px]",style:{padding:"1px 5px",background:"rgba(0,0,0,0.2)",color:m},children:c})]})})(),n.jsx("div",{className:"space-y-0.5",children:i.assertions.map(o=>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:o.pass?"var(--green-muted)":"var(--red-muted)"},children:o.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:o.text})]},o.id))})]})}function Nv({evalId:i,sharedEntries:o,sharedLoading:c}){const{state:d,dispatch:m}=ll(),{plugin:h,skill:p}=d,[b,y]=v.useState(!0),f=o??null,E=c??!1,g=v.useCallback(()=>{y(q=>!q)},[]),T=f?f.slice(0,10):[],z=T.some(q=>{const V=Qc(q.type);return V==="left"||V==="full"}),B=T.some(q=>{const V=Qc(q.type);return V==="right"||V==="full"});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",f&&f.length>0&&n.jsxs("span",{style:{fontWeight:400},children:["(",f.length," run",f.length!==1?"s":"",")"]})]}),b&&n.jsx("div",{className:"animate-fade-in",children:E?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..."})]}):!f||f.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:[T.length>=2&&n.jsx("div",{className:"mb-2",children:n.jsx(Vx,{entries:T})}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"1"},children:"Skill"}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"2"},children:"Baseline"}),!z&&n.jsx("div",{style:{gridColumn:"1",fontSize:12,color:"var(--text-tertiary)"},children:"No skill runs"}),!B&&n.jsx("div",{style:{gridColumn:"2",fontSize:12,color:"var(--text-tertiary)"},children:"No baseline runs"}),T.map((q,V)=>{const J=Qc(q.type);return J==="full"?n.jsx("div",{style:{gridColumn:"1 / -1"},children:n.jsx(Xc,{entry:q})},V):J==="left"?n.jsxs(v.Fragment,{children:[n.jsx("div",{style:{gridColumn:"1"},children:n.jsx(Xc,{entry:q})}),n.jsx("div",{style:{gridColumn:"2"}})]},V):n.jsxs(v.Fragment,{children:[n.jsx("div",{style:{gridColumn:"1"}}),n.jsx("div",{style:{gridColumn:"2"},children:n.jsx(Xc,{entry:q})})]},V)})]}),n.jsx("button",{onClick:()=>m({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:q=>{q.currentTarget.style.textDecoration="underline"},onMouseLeave:q=>{q.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function kx({evals:i,onSave:o,onCancel:c}){const[d,m]=v.useState(""),[h,p]=v.useState(""),[b,y]=v.useState(""),[f,E]=v.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),g=Math.max(0,...i.evals.map(z=>z.id))+1,T=()=>{if(!d.trim()||!h.trim())return;const z={id:g,name:d.trim(),prompt:h.trim(),expected_output:b.trim(),files:[],assertions:f.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:d,onChange:z=>m(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=>p(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"}),f.map((z,B)=>n.jsxs("div",{className:"flex gap-2 mb-2",children:[n.jsx("input",{value:z.text,onChange:q=>E(f.map((V,J)=>J===B?{...V,text:q.target.value}:V)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),f.length>1&&n.jsx("button",{onClick:()=>E(f.filter((q,V)=>V!==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:()=>E([...f,{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:c,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsx("button",{onClick:T,disabled:!d.trim()||!h.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function Ev(i,o){const c=i+o,d=c*10,m=c*25,h=p=>p>=60?`${Math.round(p/60)}m`:`${p}s`;return`${h(d)}–${h(m)}`}function kv(){const{state:i,runCase:o,runAll:c,cancelCase:d,cancelAll:m,isReadOnly:h}=ll(),{evals:p,caseRunStates:b,bulkRunActive:y,latestBenchmark:f,inlineResults:E}=i,g=(p==null?void 0:p.evals)??[],T=v.useMemo(()=>{for(const G of b.values())if(G.status==="running"||G.status==="queued")return!0;return!1},[b]),z=g.filter(G=>{const W=b.get(G.id);return W&&(W.status==="complete"||W.status==="error"||W.status==="cancelled")}).length,B=g.filter(G=>{const W=b.get(G.id);return W&&(W.status==="running"||W.status==="queued")}).length,q=v.useRef(null),[V,J]=v.useState(0);v.useEffect(()=>{if(T&&!q.current&&(q.current=Date.now()),!T){q.current=null,J(0);return}const G=setInterval(()=>{q.current&&J(Math.round((Date.now()-q.current)/1e3))},1e3);return()=>clearInterval(G)},[T]);const F=g.reduce((G,W)=>G+W.assertions.length,0),ae=v.useMemo(()=>Ev(g.length,F),[g.length,F]);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"}),T&&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:[T&&n.jsxs("button",{onClick:m,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:()=>c("comparison"),disabled:g.length===0||T||h,className:"btn btn-primary text-[12px]",children:"Compare All"}),n.jsx("button",{onClick:()=>c("benchmark"),disabled:g.length===0||T||h,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),n.jsx("button",{onClick:()=>c("baseline"),disabled:g.length===0||T||h,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),T&&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: ",V>=60?`${Math.floor(V/60)}m ${V%60}s`:`${V}s`]}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",ae]})]})]}),n.jsx("div",{className:"space-y-3 stagger-children",children:g.map(G=>{const W=E.get(G.id),te=b.get(G.id),$=(te==null?void 0:te.status)??"idle";return n.jsx(Cv,{name:G.name,evalId:G.id,result:W,caseStatus:$,runMode:(te==null?void 0:te.mode)??null,isReadOnly:h,onRun:le=>o(le,"benchmark"),onBaseline:le=>o(le,"baseline"),onCompare:le=>o(le,"comparison"),onCancel:le=>d(le)},G.id)})}),!T&&f&&f.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:(f.overall_pass_rate??0)>=.8?"var(--green)":(f.overall_pass_rate??0)>=.5?"var(--yellow)":"var(--red)"},children:f.overall_pass_rate!=null?`${Math.round(f.overall_pass_rate*100)}%`:"--"})]}),f.totalDurationMs!=null&&n.jsxs("div",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:["Total: ",(f.totalDurationMs/1e3).toFixed(1),"s",f.model&&` | Model: ${f.model}`]}),f.overall_pass_rate===1&&!f.comparison&&n.jsx("button",{onClick:()=>c("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"})]}),f.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(Tx,{label:"Skill",value:f.comparison.skillPassRate,color:"var(--accent)"}),n.jsx(Tx,{label:"Baseline",value:f.comparison.baselinePassRate,color:"var(--text-tertiary)"})]}),n.jsxs("div",{className:"mt-3 text-[12px] font-medium",style:{color:f.comparison.delta>0?"var(--green)":f.comparison.delta<0?"var(--red)":"var(--text-tertiary)"},children:["Delta: ",f.comparison.delta>0?"+":"",(f.comparison.delta*100).toFixed(1),"%",f.verdict&&` | ${f.verdict}`]})]})]})]})}const Tv={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 Cv({name:i,evalId:o,result:c,caseStatus:d,runMode:m,isReadOnly:h,onRun:p,onBaseline:b,onCompare:y,onCancel:f}){const[E,g]=v.useState(!1),T=d==="running"||d==="queued",z=d==="complete"||d==="error";return n.jsxs("div",{className:"rounded-xl overflow-hidden transition-all duration-200",style:{background:"var(--surface-1)",border:T?"1px solid var(--accent)":"1px solid var(--border-subtle)",boxShadow:T?"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:[d==="running"&&n.jsx("span",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),d==="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]}),m&&(T||z)&&(()=>{const B=Tv[m];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:[T?n.jsx("button",{onClick:()=>f(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:()=>p(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"})]}),c&&c.status!=null&&n.jsx("span",{className:"pill text-[10px]",style:{background:c.status==="pass"?"var(--green-muted)":(c.status==="error","var(--red-muted)"),color:c.status==="pass"?"var(--green)":"var(--red)"},children:c.passRate!=null?`${Math.round(c.passRate*100)}%`:c.status}),d==="cancelled"&&n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),c&&c.assertions.length>0&&n.jsxs("div",{className:"px-4 pb-3",children:[n.jsx("div",{className:"space-y-1",children:c.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))}),c.output&&n.jsx("button",{onClick:()=>g(!E),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:E?"Hide output":"Show output"}),E&&c.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:c.output})]}),c&&c.errorMessage&&n.jsx(Av,{errorMessage:c.errorMessage,classifiedError:c.classifiedError})]})}const Zc={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function Av({errorMessage:i,classifiedError:o}){const[c,d]=v.useState(!1),m=(o==null?void 0:o.title)??"Error",h=o==null?void 0:o.hint,p=o?Zc[o.category]??Zc.unknown:Zc.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:p}),n.jsx("span",{className:"text-[11.5px] font-semibold flex-1",style:{color:"var(--red)"},children:m}),n.jsx("button",{onClick:()=>d(!c),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:c?"Hide details":"Details"})]}),h&&n.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:h}),c&&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 Tx({label:i,value:o,color:c}){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:c},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:c}})})]})}const Cx={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)"}},wv=[{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 _v(){const{state:i,dispatch:o,runActivationTest:c}=ll(),{plugin:d,skill:m,activationPrompts:h,activationResults:p,activationSummary:b,activationRunning:y,activationError:f}=i,[E,g]=v.useState(h),[T,z]=v.useState(null);v.useEffect(()=>{o({type:"SET_ACTIVATION_PROMPTS",prompts:E})},[E,o]),v.useEffect(()=>{fetch(`/api/skills/${d}/${m}/description`).then(G=>G.json()).then(G=>z(G.rawContent||G.description||null)).catch(()=>z(null))},[d,m]);function B(){c(E)}function q(G){const W=E.trim(),te=W?`${W}
|
|
61
|
-
${G.join(`
|
|
62
|
-
`)}`:G.join(`
|
|
63
|
-
`);g(te)}const V=E.trim().split(`
|
|
64
|
-
`).filter(Boolean).length,J=p.filter(G=>G.classification==="TP"||G.classification==="TN"),F=p.filter(G=>G.classification==="FP"||G.classification==="FN"),ae=(T==null?void 0:T.replace(/^---[\s\S]*?---\s*/,"").trim())??null;return n.jsxs("div",{className:"p-5 space-y-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-[14px] font-semibold",style:{color:"var(--text-primary)"},children:"Activation Test"}),n.jsx("div",{className:"text-[12px] mt-0.5",style:{color:"var(--text-tertiary)"},children:"Test whether this skill's description activates for relevant prompts and stays silent for irrelevant ones."})]}),n.jsxs("div",{className:"grid grid-cols-[3fr_2fr] gap-4 items-stretch",children:[n.jsxs("div",{className:"glass-card p-4 flex flex-col gap-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("label",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Test Prompts"}),n.jsx("div",{className:"flex gap-1.5",children:wv.map(G=>n.jsxs("button",{onClick:()=>q(G.prompts),className:"text-[10px] px-2.5 py-1 rounded-md transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},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:["+ ",G.label]},G.label))})]}),n.jsx("textarea",{className:"input-field resize-y font-mono text-[12px]",style:{minHeight:140,height:140},value:E,onChange:G=>g(G.target.value),placeholder:`How do I write a unit test?
|
|
65
|
-
What edge cases should I test?
|
|
66
|
-
+Deploy this to production
|
|
67
|
-
!What's the weather like today?
|
|
68
|
-
!Write me a poem about flowers`}),n.jsxs("div",{className:"flex items-center flex-wrap gap-x-3 gap-y-1 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{children:"One prompt per line"}),n.jsx(vr,{}),n.jsx("span",{children:"No prefix = auto-classify"}),n.jsx(vr,{}),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.jsx(vr,{}),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.jsx(vr,{}),n.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[V," prompt",V!==1?"s":""]})]}),n.jsx("button",{onClick:B,disabled:y||!E.trim(),className:"btn btn-primary self-start",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"]})})]}),n.jsxs("div",{className:"glass-card flex flex-col overflow-hidden",children:[n.jsx("div",{className:"px-4 pt-3.5 pb-2.5 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Skill Description"})}),n.jsx("div",{className:"flex-1 overflow-auto px-4 py-3",style:{minHeight:0},children:ae?n.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:br(ae)}}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No description available"})})]})]}),f&&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:f}),y&&p.length===0&&n.jsxs("div",{className:"text-center py-12 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..."})]}),p.length>0&&n.jsxs("div",{className:"space-y-5",children:[F.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 (",F.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:F.map((G,W)=>n.jsx(Ax,{result:G},`incorrect-${W}`))})]}),J.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 (",J.length,")"]})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:J.map((G,W)=>n.jsx(Ax,{result:G},`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(Kc,{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(Kc,{label:"Recall",value:b.recall,description:"Of expected activations, how many fired?",detail:`${b.tp} activated / ${b.tp+b.fn} expected`}),n.jsx(Kc,{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(yr,{label:"True Positive",abbr:"TP",count:b.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),n.jsx(yr,{label:"False Positive",abbr:"FP",count:b.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),n.jsx(yr,{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(yr,{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"})]})]})]})]})}function vr(){return n.jsx("span",{style:{color:"var(--border-subtle)",userSelect:"none"},children:"·"})}function Ax({result:i}){const o=Cx[i.classification]||Cx.FN,c=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:c?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 Kc({label:i,value:o,description:c,detail:d}){const m=Math.round(o*100),h=m>=80?"var(--green)":m>=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:[m,"%"]}),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:c}),n.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:d})]})}function yr({abbr:i,count:o,bg:c,color:d,description:m}){return n.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:c},children:[n.jsx("div",{className:"text-[20px] font-bold",style:{color:d},children:o}),n.jsx("div",{className:"text-[11px] font-semibold",style:{color:d},children:i}),n.jsx("div",{className:"text-[9px] mt-0.5",style:{color:"var(--text-tertiary)"},children:m})]})}const Jc={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},wx={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},to=600,lo=180,ht=40,$c=to-ht*2,Kl=lo-ht*2,Rv=[25,50,75,100];function _x(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Mv({entries:i}){const[o,c]=v.useState(null);if(i.length<2)return null;const d=i.length,m=i.map((b,y)=>{const f=ht+y/(d-1)*$c,E=b.passRate*100,g=ht+Kl-E/100*Kl;return{x:f,y:g,pct:E,entry:b}}),h=m.map(b=>`${b.x},${b.y}`).join(" "),p=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:p.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:Jc[b]??"var(--text-tertiary)"}}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:wx[b]??b})]},b))}),n.jsxs("svg",{width:to,height:lo,viewBox:`0 0 ${to} ${lo}`,style:{display:"block",overflow:"visible"},children:[Rv.map(b=>{const y=ht+Kl-b/100*Kl;return n.jsxs("g",{children:[n.jsx("line",{x1:ht,y1:y,x2:ht+$c,y2:y,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),n.jsxs("text",{x:ht-8,y:y+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[b,"%"]})]},b)}),n.jsx("line",{x1:ht,y1:ht+Kl,x2:ht+$c,y2:ht+Kl,stroke:"var(--border-subtle)",strokeWidth:1}),n.jsx("text",{x:ht-8,y:ht+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"}),m.map((b,y)=>n.jsx("circle",{cx:b.x,cy:b.y,r:5,fill:Jc[b.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:f=>{f.currentTarget.setAttribute("r","7"),c({x:b.x,y:b.y,entry:b.entry})},onMouseLeave:f=>{f.currentTarget.setAttribute("r","5"),c(null)}},y)),zv(d).map(b=>n.jsx("text",{x:m[b].x,y:ht+Kl+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:_x(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:_x(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:Jc[o.entry.type]??"var(--text-tertiary)",color:"#fff"},children:wx[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 zv(i){return i<=3?Array.from({length:i},(o,c)=>c):i<=6?[0,Math.floor(i/2),i-1]:[0,Math.floor(i/3),Math.floor(2*i/3),i-1]}function gr(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Lv(i){return i>=1e3?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`}function Ov({rate:i,label:o}){const c=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:gr(i)},children:[c,"%"]})]}),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:`${c}%`,background:gr(i)}})})]})})}function Dv({points:i}){if(i.length<2)return null;const o=200,c=48,d=4,m=i.length,h=i.map((y,f)=>{const E=d+f/(m-1)*(o-d*2),g=d+(c-d*2)-y.passRate*(c-d*2);return{x:E,y:g}}),p=`M ${h[0].x},${c-d} `+h.map(y=>`L ${y.x},${y.y}`).join(" ")+` L ${h[h.length-1].x},${c-d} Z`,b=h.map((y,f)=>`${f===0?"M":"L"} ${y.x},${y.y}`).join(" ");return n.jsxs("svg",{width:o,height:c,style:{display:"block"},children:[n.jsx("path",{d:p,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 Bv({plugin:i,skill:o}){const[c,d]=v.useState(null),[m,h]=v.useState(!0);if(v.useEffect(()=>{h(!0),ke.getStats(i,o).then(d).catch(()=>d(null)).finally(()=>h(!1))},[i,o]),m)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(!c||c.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 p=c.trendPoints.length>0?c.trendPoints[c.trendPoints.length-1].passRate:0,b=c.trendPoints.length>0?c.trendPoints[0].passRate:0,y=p-b,f=c.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:c.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:gr(p)},children:[Math.round(p*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:c.modelStats.length})]})]}),c.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(Dv,{points:c.trendPoints})]}),c.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:c.modelStats.map(E=>n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:E.model}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:E.runs}),n.jsx("td",{style:{padding:"8px",textAlign:"center"},children:n.jsxs("span",{className:"font-semibold",style:{color:gr(E.avgPassRate)},children:[Math.round(E.avgPassRate*100),"%"]})}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:Lv(E.avgDurationMs)})]},E.model))})]})]}),f.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:f.map(E=>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:["#",E.evalId]}),n.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:E.evalName}),n.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[E.totalRuns," runs"]})]}),n.jsx(Ov,{rate:E.passRate,label:E.text})]},`${E.evalId}:${E.id}`))})]})]})}function Uv({plugin:i,skill:o}){const[c,d]=v.useState(null),[m,h]=v.useState(null),[p,b]=v.useState({}),[y,f]=v.useState({});v.useEffect(()=>{ke.getEvals(i,o).then(d).catch(()=>d(null))},[i,o]);async function E(g){if(m===g){h(null);return}if(h(g),!p[g]){f(T=>({...T,[g]:!0}));try{const T=await ke.getCaseHistory(i,o,g);b(z=>({...z,[g]:T}))}catch{b(T=>({...T,[g]:[]}))}finally{f(T=>({...T,[g]:!1}))}}}return c?n.jsx("div",{className:"space-y-2 stagger-children",children:c.evals.map(g=>{const T=p[g.id]||[],z=m===g.id,B=y[g.id],q=T.length>0?T[0].pass_rate:null;return n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsxs("button",{onClick:()=>E(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:V=>{z||(V.currentTarget.style.background="var(--surface-2)")},onMouseLeave:V=>{z||(V.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}),T.length>=2&&n.jsx(Vx,{entries:T}),q!=null&&n.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:eo(q)},children:[Math.round(q*100),"%"]}),T.length>0&&n.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[T.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..."})]}):T.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:T.map((V,J)=>n.jsxs("div",{className:"p-4",style:{background:J===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:Gx(V.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:V.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:V.type==="benchmark"?"rgba(99,131,255,0.15)":V.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:V.type==="benchmark"?"#6383ff":V.type==="comparison"?"var(--purple)":"#fb923c"},children:V.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:eo(V.pass_rate)},children:[Math.round(V.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:[V.durationMs!=null&&n.jsx("span",{children:Yx(V.durationMs)}),V.tokens!=null&&n.jsxs("span",{children:[V.tokens>=1e3?`${(V.tokens/1e3).toFixed(1)}k`:V.tokens," tok"]})]}),n.jsx("div",{className:"space-y-1",children:V.assertions.map(F=>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:F.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:F.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:F.text}),F.reasoning&&n.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:F.reasoning})]})]},F.id))})]},J))})})]},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}=ll(),{plugin:c,skill:d}=i,[m,h]=v.useState("timeline"),[p,b]=v.useState([]),[y,f]=v.useState(!0),[E,g]=v.useState(""),[T,z]=v.useState(""),[B,q]=v.useState(!1),[V,J]=v.useState([]),[F,ae]=v.useState(null),[G,W]=v.useState(!1),[te,$]=v.useState(null),[le,ge]=v.useState(!1);v.useEffect(()=>{f(!0),ke.getHistory(c,d,{model:E||void 0,type:T||void 0}).then(Z=>{b(Z),Z.length>=2&&ke.compareRuns(c,d,Z[0].timestamp,Z[1].timestamp).then(ie=>{const ve=ie.regressions.filter(N=>N.change==="regression");o({type:"SET_REGRESSIONS",regressions:ve})}).catch(()=>{})}).catch(()=>{}).finally(()=>f(!1))},[c,d,E,T]);const se=v.useCallback(async Z=>{if(B){J(ie=>ie.includes(Z)?ie.filter(ve=>ve!==Z):ie.length>=2?[ie[1],Z]:[...ie,Z]);return}ge(!0);try{const ie=await ke.getHistoryEntry(c,d,Z);$(ie)}catch{}finally{ge(!1)}},[c,d,B]),Te=v.useCallback(async()=>{if(V.length===2){W(!0);try{const Z=await ke.compareRuns(c,d,V[0],V[1]);ae(Z)}catch{}finally{W(!1)}}},[c,d,V]),pe=[...new Set(p.map(Z=>Z.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(Z=>n.jsx("button",{onClick:()=>h(Z),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:m===Z?"var(--accent-muted)":"transparent",color:m===Z?"var(--accent)":"var(--text-tertiary)"},children:Z==="timeline"?"Timeline":Z==="per-eval"?"Per Eval":"Statistics"},Z))}),m==="timeline"&&n.jsxs("div",{children:[p.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(Mv,{entries:p})}),n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("select",{value:E,onChange:Z=>g(Z.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Models"}),pe.map(Z=>n.jsx("option",{value:Z,children:Z},Z))]}),n.jsxs("select",{value:T,onChange:Z=>z(Z.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:()=>{q(!B),J([]),ae(null)},className:`btn text-[12px] ${B?"btn-primary":"btn-secondary"}`,children:B?"Exit Compare":"Compare Runs"}),B&&V.length===2&&n.jsx("button",{onClick:Te,disabled:G,className:"btn btn-primary text-[12px]",children:G?"Comparing...":"Compare"})]}),n.jsx("div",{className:"space-y-2",children:p.length===0?n.jsx("div",{className:"text-center py-8 text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark runs yet"}):p.map(Z=>{const ie=V.includes(Z.timestamp);return n.jsx("button",{onClick:()=>se(Z.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:ie?"var(--accent-muted)":"var(--surface-1)",border:ie?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:ve=>{ie||(ve.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:ve=>{ie||(ve.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:ie?"var(--accent)":"var(--border-default)",background:ie?"var(--accent)":"transparent"},children:ie&&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(Z.timestamp).toLocaleString()}),n.jsx("span",{className:"pill text-[9px]",style:{background:Z.type==="comparison"?"var(--purple-muted)":Z.type==="baseline"?"var(--surface-3)":Z.type==="model-compare"?"rgba(56,189,248,0.15)":Z.type==="improve"||Z.type==="instruct"?"rgba(168,85,247,0.15)":Z.type==="ai-generate"?"rgba(34,197,94,0.15)":Z.type==="eval-generate"?"rgba(251,146,60,0.15)":"var(--accent-muted)",color:Z.type==="comparison"?"var(--purple)":Z.type==="baseline"?"var(--text-tertiary)":Z.type==="model-compare"?"#38bdf8":Z.type==="improve"||Z.type==="instruct"?"#a855f7":Z.type==="ai-generate"?"#22c55e":Z.type==="eval-generate"?"#fb923c":"var(--accent)"},children:Z.type==="model-compare"?"model compare":Z.type==="improve"?"ai improve":Z.type==="instruct"?"ai edit":Z.type==="ai-generate"?"ai generate":Z.type==="eval-generate"?"eval generate":Z.type})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:Z.model}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:Z.passRate>=.8?"var(--green)":Z.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(Z.passRate*100),"%"]})]})]})},Z.timestamp)})}),F&&n.jsx(qv,{result:F}),te&&!B&&n.jsx(Gv,{run:te,onClose:()=>$(null)})]}),m==="per-eval"&&n.jsx(Uv,{plugin:c,skill:d}),m==="statistics"&&n.jsx(Bv,{plugin:c,skill:d})]})}function qv({result:i}){const o=i.regressions.filter(d=>d.change==="regression"),c=i.regressions.filter(d=>d.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(d=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",d.evalId," ",d.evalName,": ",n.jsx("span",{style:{color:"var(--red)"},children:d.assertionId})," (was passing, now failing)"]},`${d.evalId}-${d.assertionId}`))]}),c.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 (",c.length,")"]}),c.map(d=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",d.evalId," ",d.evalName,": ",n.jsx("span",{style:{color:"var(--green)"},children:d.assertionId})," (was failing, now passing)"]},`${d.evalId}-${d.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(d=>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:["#",d.eval_id," ",d.eval_name]}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:d.passRateA!=null?d.passRateA>=.8?"var(--green)":d.passRateA>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:d.passRateA!=null?`${Math.round(d.passRateA*100)}%`:d.statusA}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:d.passRateB!=null?d.passRateB>=.8?"var(--green)":d.passRateB>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:d.passRateB!=null?`${Math.round(d.passRateB*100)}%`:d.statusB})]},d.eval_id))})]})})]})}function Gv({run:i,onClose:o}){return(i.type==="improve"||i.type==="instruct")&&i.improve?n.jsx(Yv,{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(c=>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:["#",c.eval_id," ",c.eval_name]}),n.jsx("span",{className:"text-[11px] font-semibold",style:{color:c.status==="pass"?"var(--green)":"var(--red)"},children:c.pass_rate!=null?`${Math.round(c.pass_rate*100)}%`:c.status})]})},c.eval_id))})]})}function Yv({run:i,onClose:o}){var h;const c=v.useMemo(()=>i.improve?jr(i.improve.original,i.improve.improved):[],[i.improve]),d=v.useMemo(()=>{const p=c.filter(y=>y.type==="added").length,b=c.filter(y=>y.type==="removed").length;return{added:p,removed:b}},[c]),m=v.useMemo(()=>{let p=0,b=0;return c.map(y=>y.type==="removed"?(p++,{...y,origNum:p,newNum:null}):y.type==="added"?(b++,{...y,origNum:null,newNum:b}):(p++,b++,{...y,origNum:p,newNum:b}))},[c]);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:["+",d.added]}),n.jsxs("span",{style:{color:"var(--red)"},children:["-",d.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:p=>{p.currentTarget.style.background="var(--surface-3)"},onMouseLeave:p=>{p.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:m.map((p,b)=>n.jsxs("tr",{style:{background:p.type==="added"?"rgba(34,197,94,0.08)":p.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:p.type==="removed"?"rgba(239,68,68,0.5)":"var(--text-tertiary)",opacity:p.origNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:p.origNum??""}),n.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:p.type==="added"?"rgba(34,197,94,0.5)":"var(--text-tertiary)",opacity:p.newNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:p.newNum??""}),n.jsx("td",{className:"select-none text-center",style:{width:20,fontSize:11,fontWeight:700,color:p.type==="added"?"var(--green)":p.type==="removed"?"var(--red)":"transparent",borderRight:p.type==="added"?"2px solid var(--green)":p.type==="removed"?"2px solid var(--red)":"2px solid transparent"},children:p.type==="added"?"+":p.type==="removed"?"-":" "}),n.jsx("td",{className:"px-3 py-px whitespace-pre-wrap",style:{fontSize:11,lineHeight:1.6,color:p.type==="added"?"var(--green)":p.type==="removed"?"var(--red)":"var(--text-secondary)"},children:p.content||""})]},b))})})})]})}function Vv({plugin:i,skill:o}){const[c,d]=v.useState([]),[m,h]=v.useState([]),[p,b]=v.useState(!0),[y,f]=v.useState(null);v.useEffect(()=>{ke.getDependencies(i,o).then(g=>{d(g.mcpDependencies),h(g.skillDependencies)}).catch(()=>{}).finally(()=>b(!1))},[i,o]);async function E(g,T){try{await navigator.clipboard.writeText(T),f(g),setTimeout(()=>f(null),2e3)}catch{}}return p?null:c.length===0&&m.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:c.length+m.length})]}),n.jsxs("div",{className:"px-5 py-4",children:[c.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"}),c.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:()=>E(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(T=>n.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:T},T))})]},g.server))]}),m.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:m.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 Qv(){const{state:i}=ll(),{plugin:o,skill:c}=i,[d,m]=v.useState(null),[h,p]=v.useState(!0);return v.useEffect(()=>{ke.getDependencies(o,c).then(m).catch(()=>{}).finally(()=>p(!1))},[o,c]),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"})]}):d?n.jsx("div",{className:"p-5 max-w-3xl",children:n.jsx(Vv,{plugin:o,skill:c})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"No dependency information available"})}const Xv=["editor","tests","run","activation","history","deps"];function Zv(i){return i!=null&&Xv.includes(i)}function Kv(){const{state:i,dispatch:o,saveContent:c,isReadOnly:d}=ll(),{refreshSkills:m,clearSelection:h}=$l(),p=v.useCallback(async()=>{try{await ke.deleteSkill(i.plugin,i.skill),m(),h()}catch(f){const E=f instanceof Error?f.message:String(f);o({type:"SET_ERROR",error:`Failed to delete skill: ${E}`})}},[i.plugin,i.skill,m,h,o]);v.useEffect(()=>{const E=new URLSearchParams(window.location.search).get("panel");Zv(E)&&E!==i.activePanel&&o({type:"SET_PANEL",panel:E})},[]),v.useEffect(()=>{const f=new URLSearchParams(window.location.search);f.set("panel",i.activePanel);const E=`${window.location.pathname}?${f.toString()}${window.location.hash}`;history.replaceState(null,"",E)},[i.activePanel]);const b=v.useCallback(f=>{const E=f.ctrlKey||f.metaKey;if(E&&f.key>="1"&&f.key<="6"){f.preventDefault(),o({type:"SET_PANEL",panel:["editor","tests","run","activation","history","deps"][parseInt(f.key)-1]});return}if(E&&f.key==="s"&&!f.shiftKey){f.preventDefault(),i.isDirty&&c();return}},[i.isDirty,c,o]);if(v.useEffect(()=>(window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)),[b]),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 y=Array.from(i.caseRunStates.values()).some(f=>f.status==="running"||f.status==="queued");return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsx(Hh,{state:i,isReadOnly:d,onDelete:d?void 0:p}),i.error&&n.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("span",{className:"flex-1",children:i.error}),n.jsx("button",{onClick:()=>o({type:"SET_ERROR",error:null}),style:{background:"none",border:"none",cursor:"pointer",color:"var(--red)",padding:2},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("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsx(Qh,{activePanel:i.activePanel,onPanelChange:f=>o({type:"SET_PANEL",panel:f}),isDirty:i.isDirty,isRunning:y,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(mv,{}),i.activePanel==="tests"&&n.jsx(yv,{}),i.activePanel==="run"&&n.jsx(kv,{}),i.activePanel==="activation"&&n.jsx(_v,{}),i.activePanel==="history"&&n.jsx(Hv,{}),i.activePanel==="deps"&&n.jsx(Qv,{})]},i.activePanel)})]})}function ao(i,o=!0){let c=i.toLowerCase().replace(/[^a-z0-9]+/g,"-");return o&&(c=c.replace(/^-+|-+$/g,"")),c}function Jv(i,o,c,d){const h=`.../${i.split("/").slice(-2).join("/")}`;switch(o){case 1:return`${h}/${c}/skills/${d}/SKILL.md`;case 2:return`${h}/plugins/${c}/skills/${d}/SKILL.md`;case 3:return`${h}/skills/${d}/SKILL.md`}}function $v({onCreated:i,resolveAiConfigOverride:o}){const[c,d]=v.useState("ai"),[m,h]=v.useState(null),[p,b]=v.useState(!0),{config:y}=ln(),[f,E]=v.useState(""),[g,T]=v.useState(3),[z,B]=v.useState(""),[q,V]=v.useState(""),[J,F]=v.useState(""),[ae,G]=v.useState(""),[W,te]=v.useState(""),[$,le]=v.useState(""),[ge,se]=v.useState("write"),[Te,pe]=v.useState(!1),[Z,ie]=v.useState(null),[ve,N]=v.useState(""),[A,K]=v.useState(!1),[ce,ye]=v.useState(!1),[S,O]=v.useState(null),[X,R]=v.useState(null),[Y,Q]=v.useState([]),P=v.useRef(null),ue=v.useRef(null),he=v.useRef(null),[tt,nt]=v.useState(!1),[$t,Wt]=v.useState(!1);v.useEffect(()=>{ke.getProjectLayout().then(xe=>{h(xe),T(xe.suggestedLayout);const He=xe.detectedLayouts.find(yt=>yt.layout===xe.suggestedLayout);He!=null&&He.existingPlugins.length&&B(He.existingPlugins[0])}).catch(()=>{}).finally(()=>b(!1))},[]),v.useEffect(()=>{var xe;c==="ai"&&((xe=P.current)==null||xe.focus())},[c]),v.useEffect(()=>()=>{var xe;(xe=ue.current)==null||xe.abort()},[]);const Qt=v.useMemo(()=>{var xe;return m?((xe=m.detectedLayouts.find(He=>He.layout===g))==null?void 0:xe.existingPlugins)||[]:[]},[m,g]),dt=z==="__new__"?q:z,al=m?Jv(m.root,g,dt||"{plugin}",f||"{skill}"):"",pa=v.useMemo(()=>m?m.detectedLayouts.filter(xe=>xe.layout!==4):[],[m]),vt=v.useMemo(()=>{if(!m)return null;const xe=m.detectedLayouts.find(Re=>Re.layout===2&&Re.existingPlugins.length>0),He=m.detectedLayouts.find(Re=>Re.layout===1&&Re.existingPlugins.length>0),yt=xe||He;return yt?{layout:yt.layout,plugins:yt.existingPlugins}:null},[m]),Ft=v.useCallback(()=>{if(o)return o();if(!y)return{provider:"claude-cli",model:"sonnet"};const xe=y.provider||"claude-cli";let He=y.model||"sonnet";return xe==="claude-cli"&&He.startsWith("claude-")&&(He=He.replace("claude-","")),{provider:xe,model:He}},[y,o]),Xt=v.useCallback(()=>{var xe;(xe=ue.current)==null||xe.abort(),K(!1)},[]),Wl=v.useCallback(()=>{O(null),R(null)},[]),an=v.useCallback(async()=>{if(O(null),R(null),Q([]),he.current=null,!ve.trim()){O("Describe what your skill should do");return}K(!0);const xe=new AbortController;ue.current=xe;const{provider:He,model:yt}=Ft();try{const Re=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:ve.trim(),provider:He,model:yt}),signal:xe.signal});if(!Re.ok||!Re.body){let xt=`HTTP ${Re.status}`;try{const Qe=await Re.json();Qe.error&&(xt=Qe.error)}catch{}throw new Error(xt)}const nn=Re.body.getReader(),ha=new TextDecoder;let nl="",ft="";for(;;){const{done:xt,value:Qe}=await nn.read();if(xt)break;nl+=ha.decode(Qe,{stream:!0});const gt=nl.split(`
|
|
69
|
-
`);nl=gt.pop()||"";for(const Xe of gt)if(Xe.startsWith("event: "))ft=Xe.slice(7).trim();else if(Xe.startsWith("data: ")){try{const Ce=JSON.parse(Xe.slice(6));if(ft==="progress")Q(mt=>[...mt,{phase:Ce.phase,message:Ce.message,timestamp:Date.now()}]);else if(ft==="done"||ft==="complete"){const mt={prompt:ve.trim(),provider:Ft().provider,model:Ft().model,reasoning:Ce.reasoning||""};E(Ce.name),F(Ce.description),G(Ce.model||""),te(Ce.allowedTools||""),le(Ce.body),ye(!0),he.current=mt,d("manual"),g===3&&vt&&Wt(!0);const va={name:Ce.name,plugin:dt||"",layout:g,description:Ce.description,model:Ce.model||void 0,allowedTools:Ce.allowedTools||void 0,body:Ce.body,aiMeta:mt};ke.saveDraft(va).then(()=>{nt(!0)}).catch(()=>{})}else ft==="error"&&(O(Ce.message||Ce.description||"Unknown error"),Ce.category&&R(Ce))}catch{}ft=""}}}catch(Re){Re.name!=="AbortError"&&O(Re.message)}finally{K(!1),ue.current=null}},[ve,Ft,g,vt,dt]),I=v.useCallback(async()=>{if(ie(null),!f.trim()){ie("Skill name is required");return}if(!J.trim()){ie("Description is required");return}if(g!==3&&!dt.trim()){ie("Plugin name is required");return}pe(!0);try{const xe=await ke.createSkill({name:ao(f),plugin:dt||"",layout:g,description:J,model:ae||void 0,allowedTools:W||void 0,body:$,aiMeta:he.current||void 0});i(xe.plugin,xe.skill)}catch(xe){ie(xe.message)}finally{pe(!1)}},[f,J,g,dt,ae,W,$,i]),Le=v.useCallback(()=>{vt&&(T(vt.layout),B(vt.plugins[0]),Wt(!1))},[vt]);return{mode:c,setMode:d,layout:m,layoutLoading:p,selectedLayout:g,setSelectedLayout:T,creatableLayouts:pa,availablePlugins:Qt,pathPreview:al,plugin:z,setPlugin:B,newPlugin:q,setNewPlugin:V,effectivePlugin:dt,name:f,setName:E,description:J,setDescription:F,model:ae,setModel:G,allowedTools:W,setAllowedTools:te,body:$,setBody:le,bodyViewMode:ge,setBodyViewMode:se,aiPrompt:ve,setAiPrompt:N,generating:A,aiGenerated:ce,aiError:S,aiClassifiedError:X,aiProgress:Y,promptRef:P,handleGenerate:an,handleCancelGenerate:Xt,clearAiError:Wl,draftSaved:tt,showPluginRecommendation:$t,setShowPluginRecommendation:Wt,pluginLayoutInfo:vt,applyPluginRecommendation:Le,creating:Te,error:Z,handleCreate:I}}function Xx(){return n.jsx("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:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function Wv(){return 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:"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"})]})}function Zx({node:i,depth:o=0}){var c;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",style:{paddingLeft:`${o*16}px`,color:i.type==="dir"?"var(--text-secondary)":"var(--text-tertiary)",fontSize:12,fontFamily:"var(--font-mono, monospace)"},children:[i.type==="dir"?n.jsx(Xx,{}):n.jsx(Wv,{}),n.jsxs("span",{children:[i.name,i.type==="dir"?"/":""]})]}),(c=i.children)==null?void 0:c.map(d=>n.jsx(Zx,{node:d,depth:o+1},d.name))]})}function Fv(i,o,c){const d=[];o&&d.push({name:"evals.json",type:"file"}),d.push({name:"history",type:"dir"});const m=[{name:"SKILL.md",type:"file"},{name:"evals",type:"dir",children:d}];return c&&m.push({name:"draft.json",type:"file"}),{name:i||"{skill}",type:"dir",children:m}}function Iv({skillName:i,hasEvals:o,isDraft:c}){const d=Fv(i,o,c);return 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:"var(--accent-muted)"},children:n.jsx(Xx,{})}),"Skill Structure"]}),n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-0)",border:"1px solid var(--border-subtle)"},children:n.jsx(Zx,{node:d})})]})}const Jl={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Wc({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 Pv({onCreated:i,onCancel:o}){const c=$v({onCreated:i});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:()=>c.setMode("ai"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:c.mode==="ai"?"rgba(168,85,247,0.15)":"transparent",color:c.mode==="ai"?"#a855f7":"var(--text-tertiary)",boxShadow:c.mode==="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(Wc,{size:12}),"AI-Assisted"]})}),n.jsx("button",{onClick:()=>c.setMode("manual"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:c.mode==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:c.mode==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:c.mode==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none",cursor:"pointer",border:"none"},children:"Manual"})]})})]}),c.layoutLoading&&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"})]}),!c.layoutLoading&&c.layout&&c.mode==="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(Wc,{size:11,color:"#a855f7"})}),"Describe Your Skill"]}),n.jsx("textarea",{ref:c.promptRef,value:c.aiPrompt,onChange:d=>c.setAiPrompt(d.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
|
|
70
|
-
|
|
71
|
-
Include any specific behaviors, constraints, or output formats you want.`,rows:5,disabled:c.generating,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...Jl,minHeight:"120px"},onKeyDown:d=>{d.key==="Enter"&&(d.metaKey||d.ctrlKey)&&(d.preventDefault(),c.handleGenerate())}}),n.jsx("p",{className:"text-[11px] mt-2",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]}),c.generating&&c.aiProgress.length>0&&n.jsx(Pn,{entries:c.aiProgress,isRunning:!0}),c.aiError&&n.jsx("div",{children:c.aiClassifiedError?n.jsx(Sr,{error:c.aiClassifiedError,onRetry:c.handleGenerate,onDismiss:c.clearAiError}):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:c.aiError}),n.jsx("button",{onClick:c.handleGenerate,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:[c.generating?n.jsx("button",{onClick:c.handleCancelGenerate,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:"var(--surface-3)",color:"var(--text-secondary)",border:"none",cursor:"pointer"},children:"Cancel Generation"}):n.jsxs("button",{onClick:c.handleGenerate,disabled:!c.aiPrompt.trim(),className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:c.aiPrompt.trim()?"#a855f7":"var(--surface-3)",color:c.aiPrompt.trim()?"#fff":"var(--text-tertiary)",cursor:c.aiPrompt.trim()?"pointer":"not-allowed",border:"none"},children:[n.jsx(Wc,{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"}),!c.generating&&n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["or fill in the form manually",n.jsx("button",{onClick:()=>c.setMode("manual"),className:"ml-1 font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"below"})]})]})]}),!c.layoutLoading&&c.layout&&c.mode==="manual"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[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"}),c.creatableLayouts.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:c.creatableLayouts.map(d=>n.jsx("button",{onClick:()=>{c.setSelectedLayout(d.layout),c.setPlugin(d.existingPlugins[0]||""),c.setNewPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:c.selectedLayout===d.layout?"var(--accent)":"var(--surface-3)",color:c.selectedLayout===d.layout?"#fff":"var(--text-secondary)",border:`1px solid ${c.selectedLayout===d.layout?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},children:d.label},d.layout))})]}),c.selectedLayout!==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:c.plugin,onChange:d=>{c.setPlugin(d.target.value),c.setNewPlugin("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Jl,children:[c.availablePlugins.map(d=>n.jsx("option",{value:d,children:d},d)),n.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),c.plugin==="__new__"&&n.jsx("input",{type:"text",value:c.newPlugin,onChange:d=>c.setNewPlugin(ao(d.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:c.pathPreview})]}),c.showPluginRecommendation&&c.pluginLayoutInfo&&c.selectedLayout===3&&n.jsxs("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in flex items-center justify-between gap-3",style:{background:"rgba(59,130,246,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(59,130,246,0.2)"},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3b82f6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),n.jsxs("span",{children:["Plugins detected (",n.jsx("strong",{children:c.pluginLayoutInfo.plugins.slice(0,3).join(", ")}),"). Add this skill to a plugin for better organization."]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n.jsx("button",{onClick:c.applyPluginRecommendation,className:"px-3 py-1 rounded-md text-[11px] font-medium",style:{background:"#3b82f6",color:"#fff",border:"none",cursor:"pointer"},children:"Use plugin"}),n.jsx("button",{onClick:()=>c.setShowPluginRecommendation(!1),className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},children: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:"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:c.name,onChange:d=>c.setName(ao(d.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:c.description,onChange:d=>c.setDescription(d.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:c.model,onChange:d=>c.setModel(d.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:c.allowedTools,onChange:d=>c.setAllowedTools(d.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(d=>n.jsxs("button",{onClick:()=>c.setBodyViewMode(d),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:c.bodyViewMode===d?"var(--surface-4)":"transparent",color:c.bodyViewMode===d?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:c.bodyViewMode===d?600:400,border:"none",cursor:"pointer"},children:[d==="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:d==="write"?"Write":"Preview"})]},d))})]}),c.bodyViewMode==="write"?n.jsx("textarea",{value:c.body,onChange:d=>c.setBody(d.target.value),placeholder:`# /my-skill
|
|
72
|
-
|
|
73
|
-
You are an expert at...
|
|
74
|
-
`,rows:8,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...Jl,minHeight:"150px"}}):c.body.trim()?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:{__html:br(c.body)}}):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"},children:n.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),n.jsx(Iv,{skillName:c.name||"{skill}",hasEvals:!1,isDraft:c.draftSaved}),c.error&&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:c.error}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:c.handleCreate,disabled:c.creating||!c.name||!c.description,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:c.creating||!c.name||!c.description?"var(--surface-3)":"var(--accent)",color:c.creating||!c.name||!c.description?"var(--text-tertiary)":"#fff",cursor:c.creating||!c.name||!c.description?"not-allowed":"pointer",border:"none"},children:c.creating?"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 ey(){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 Fc({variant:i,message:o,onRetry:c}){const{setMode:d,setSearch:m}=$l(),[h,p]=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(ey,{}):n.jsx("img",{src:"/images/empty-studio.webp",width:128,height:128,alt:"",onError:()=>p(!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:()=>d("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"}),c&&n.jsx("button",{onClick:c,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:()=>m(""),className:"text-[12px] font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear search"})]})}function Rx(){const{state:i,setMobileView:o}=$l();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 ty(){const{state:i,selectSkill:o,setMode:c,refreshSkills:d}=$l();if(i.mode==="create")return n.jsxs("div",{className:"h-full overflow-auto animate-fade-in",children:[n.jsx(Rx,{}),n.jsx(Pv,{onCreated:(b,y)=>{c("browse"),d(),o({plugin:b,skill:y,origin:"source"})},onCancel:()=>c("browse")})]});if(!i.selectedSkill)return i.skillsError?n.jsx(Fc,{variant:"error",message:i.skillsError,onRetry:d}):!i.skillsLoading&&i.skills.length===0?n.jsx(Fc,{variant:"no-skills"}):n.jsx(Fc,{variant:"no-selection"});const{plugin:m,skill:h,origin:p}=i.selectedSkill;return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx(Rx,{}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Uh,{plugin:m,skill:h,origin:p,children:n.jsx(Kv,{})},`${m}/${h}`)})]})}function ly(){return n.jsx(Sh,{children:n.jsx(gh,{children:n.jsx(Nh,{left:n.jsx(_h,{}),right:n.jsx(ty,{})})})})}ph.createRoot(document.getElementById("root")).render(n.jsx(v.StrictMode,{children:n.jsx(ly,{})}));
|