sandboxy 0.0.4__py3-none-any.whl → 0.0.6__py3-none-any.whl
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.
- sandboxy/agents/llm_prompt.py +85 -14
- sandboxy/api/app.py +2 -1
- sandboxy/api/routes/local.py +34 -1
- sandboxy/api/routes/providers.py +369 -0
- sandboxy/cli/main.py +371 -0
- sandboxy/mlflow/exporter.py +7 -1
- sandboxy/providers/__init__.py +37 -3
- sandboxy/providers/config.py +243 -0
- sandboxy/providers/local.py +498 -0
- sandboxy/providers/registry.py +107 -13
- sandboxy/scenarios/unified.py +27 -3
- sandboxy/ui/dist/assets/index-BZFjoK-_.js +377 -0
- sandboxy/ui/dist/assets/index-Qf7gGJk_.css +1 -0
- sandboxy/ui/dist/index.html +2 -2
- {sandboxy-0.0.4.dist-info → sandboxy-0.0.6.dist-info}/METADATA +67 -27
- {sandboxy-0.0.4.dist-info → sandboxy-0.0.6.dist-info}/RECORD +19 -16
- sandboxy/ui/dist/assets/index-CU06wBqc.js +0 -362
- sandboxy/ui/dist/assets/index-Cgg2wY2m.css +0 -1
- {sandboxy-0.0.4.dist-info → sandboxy-0.0.6.dist-info}/WHEEL +0 -0
- {sandboxy-0.0.4.dist-info → sandboxy-0.0.6.dist-info}/entry_points.txt +0 -0
- {sandboxy-0.0.4.dist-info → sandboxy-0.0.6.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();function hm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lu={exports:{}},Sr={},Mu={exports:{}},Y={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its 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 ll=Symbol.for("react.element"),gm=Symbol.for("react.portal"),vm=Symbol.for("react.fragment"),ym=Symbol.for("react.strict_mode"),jm=Symbol.for("react.profiler"),Nm=Symbol.for("react.provider"),wm=Symbol.for("react.context"),bm=Symbol.for("react.forward_ref"),km=Symbol.for("react.suspense"),Sm=Symbol.for("react.memo"),Cm=Symbol.for("react.lazy"),Qo=Symbol.iterator;function Em(e){return e===null||typeof e!="object"?null:(e=Qo&&e[Qo]||e["@@iterator"],typeof e=="function"?e:null)}var Fu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ou=Object.assign,zu={};function ls(e,t,n){this.props=e,this.context=t,this.refs=zu,this.updater=n||Fu}ls.prototype.isReactComponent={};ls.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ls.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Du(){}Du.prototype=ls.prototype;function Ci(e,t,n){this.props=e,this.context=t,this.refs=zu,this.updater=n||Fu}var Ei=Ci.prototype=new Du;Ei.constructor=Ci;Ou(Ei,ls.prototype);Ei.isPureReactComponent=!0;var qo=Array.isArray,Iu=Object.prototype.hasOwnProperty,_i={current:null},$u={key:!0,ref:!0,__self:!0,__source:!0};function Uu(e,t,n){var s,r={},a=null,i=null;if(t!=null)for(s in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(a=""+t.key),t)Iu.call(t,s)&&!$u.hasOwnProperty(s)&&(r[s]=t[s]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];r.children=c}if(e&&e.defaultProps)for(s in o=e.defaultProps,o)r[s]===void 0&&(r[s]=o[s]);return{$$typeof:ll,type:e,key:a,ref:i,props:r,_owner:_i.current}}function _m(e,t){return{$$typeof:ll,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ri(e){return typeof e=="object"&&e!==null&&e.$$typeof===ll}function Rm(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Jo=/\/+/g;function Wr(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Rm(""+e.key):t.toString(36)}function Ll(e,t,n,s,r){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case ll:case gm:i=!0}}if(i)return i=e,r=r(i),e=s===""?"."+Wr(i,0):s,qo(r)?(n="",e!=null&&(n=e.replace(Jo,"$&/")+"/"),Ll(r,t,n,"",function(u){return u})):r!=null&&(Ri(r)&&(r=_m(r,n+(!r.key||i&&i.key===r.key?"":(""+r.key).replace(Jo,"$&/")+"/")+e)),t.push(r)),1;if(i=0,s=s===""?".":s+":",qo(e))for(var o=0;o<e.length;o++){a=e[o];var c=s+Wr(a,o);i+=Ll(a,t,n,c,r)}else if(c=Em(e),typeof c=="function")for(e=c.call(e),o=0;!(a=e.next()).done;)a=a.value,c=s+Wr(a,o++),i+=Ll(a,t,n,c,r);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function ml(e,t,n){if(e==null)return e;var s=[],r=0;return Ll(e,s,"","",function(a){return t.call(n,a,r++)}),s}function Tm(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Le={current:null},Ml={transition:null},Pm={ReactCurrentDispatcher:Le,ReactCurrentBatchConfig:Ml,ReactCurrentOwner:_i};function Bu(){throw Error("act(...) is not supported in production builds of React.")}Y.Children={map:ml,forEach:function(e,t,n){ml(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ml(e,function(){t++}),t},toArray:function(e){return ml(e,function(t){return t})||[]},only:function(e){if(!Ri(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Y.Component=ls;Y.Fragment=vm;Y.Profiler=jm;Y.PureComponent=Ci;Y.StrictMode=ym;Y.Suspense=km;Y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Pm;Y.act=Bu;Y.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=Ou({},e.props),r=e.key,a=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,i=_i.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)Iu.call(t,c)&&!$u.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];s.children=o}return{$$typeof:ll,type:e.type,key:r,ref:a,props:s,_owner:i}};Y.createContext=function(e){return e={$$typeof:wm,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Nm,_context:e},e.Consumer=e};Y.createElement=Uu;Y.createFactory=function(e){var t=Uu.bind(null,e);return t.type=e,t};Y.createRef=function(){return{current:null}};Y.forwardRef=function(e){return{$$typeof:bm,render:e}};Y.isValidElement=Ri;Y.lazy=function(e){return{$$typeof:Cm,_payload:{_status:-1,_result:e},_init:Tm}};Y.memo=function(e,t){return{$$typeof:Sm,type:e,compare:t===void 0?null:t}};Y.startTransition=function(e){var t=Ml.transition;Ml.transition={};try{e()}finally{Ml.transition=t}};Y.unstable_act=Bu;Y.useCallback=function(e,t){return Le.current.useCallback(e,t)};Y.useContext=function(e){return Le.current.useContext(e)};Y.useDebugValue=function(){};Y.useDeferredValue=function(e){return Le.current.useDeferredValue(e)};Y.useEffect=function(e,t){return Le.current.useEffect(e,t)};Y.useId=function(){return Le.current.useId()};Y.useImperativeHandle=function(e,t,n){return Le.current.useImperativeHandle(e,t,n)};Y.useInsertionEffect=function(e,t){return Le.current.useInsertionEffect(e,t)};Y.useLayoutEffect=function(e,t){return Le.current.useLayoutEffect(e,t)};Y.useMemo=function(e,t){return Le.current.useMemo(e,t)};Y.useReducer=function(e,t,n){return Le.current.useReducer(e,t,n)};Y.useRef=function(e){return Le.current.useRef(e)};Y.useState=function(e){return Le.current.useState(e)};Y.useSyncExternalStore=function(e,t,n){return Le.current.useSyncExternalStore(e,t,n)};Y.useTransition=function(){return Le.current.useTransition()};Y.version="18.3.1";Mu.exports=Y;var x=Mu.exports;const Am=hm(x);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its 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 Lm=x,Mm=Symbol.for("react.element"),Fm=Symbol.for("react.fragment"),Om=Object.prototype.hasOwnProperty,zm=Lm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Dm={key:!0,ref:!0,__self:!0,__source:!0};function Hu(e,t,n){var s,r={},a=null,i=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(i=t.ref);for(s in t)Om.call(t,s)&&!Dm.hasOwnProperty(s)&&(r[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)r[s]===void 0&&(r[s]=t[s]);return{$$typeof:Mm,type:e,key:a,ref:i,props:r,_owner:zm.current}}Sr.Fragment=Fm;Sr.jsx=Hu;Sr.jsxs=Hu;Lu.exports=Sr;var l=Lu.exports,ba={},Vu={exports:{}},qe={},Wu={exports:{}},Yu={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its 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
|
+
*/(function(e){function t(b,S){var T=b.length;b.push(S);e:for(;0<T;){var D=T-1>>>1,H=b[D];if(0<r(H,S))b[D]=S,b[T]=H,T=D;else break e}}function n(b){return b.length===0?null:b[0]}function s(b){if(b.length===0)return null;var S=b[0],T=b.pop();if(T!==S){b[0]=T;e:for(var D=0,H=b.length,te=H>>>1;D<te;){var X=2*(D+1)-1,lt=b[X],Fe=X+1,rt=b[Fe];if(0>r(lt,T))Fe<H&&0>r(rt,lt)?(b[D]=rt,b[Fe]=T,D=Fe):(b[D]=lt,b[X]=T,D=X);else if(Fe<H&&0>r(rt,T))b[D]=rt,b[Fe]=T,D=Fe;else break e}}return S}function r(b,S){var T=b.sortIndex-S.sortIndex;return T!==0?T:b.id-S.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],u=[],m=1,f=null,g=3,y=!1,j=!1,v=!1,N=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(b){for(var S=n(u);S!==null;){if(S.callback===null)s(u);else if(S.startTime<=b)s(u),S.sortIndex=S.expirationTime,t(c,S);else break;S=n(u)}}function k(b){if(v=!1,h(b),!j)if(n(c)!==null)j=!0,E(w);else{var S=n(u);S!==null&&_(k,S.startTime-b)}}function w(b,S){j=!1,v&&(v=!1,p(M),M=-1),y=!0;var T=g;try{for(h(S),f=n(c);f!==null&&(!(f.expirationTime>S)||b&&!A());){var D=f.callback;if(typeof D=="function"){f.callback=null,g=f.priorityLevel;var H=D(f.expirationTime<=S);S=e.unstable_now(),typeof H=="function"?f.callback=H:f===n(c)&&s(c),h(S)}else s(c);f=n(c)}if(f!==null)var te=!0;else{var X=n(u);X!==null&&_(k,X.startTime-S),te=!1}return te}finally{f=null,g=T,y=!1}}var R=!1,P=null,M=-1,O=5,z=-1;function A(){return!(e.unstable_now()-z<O)}function L(){if(P!==null){var b=e.unstable_now();z=b;var S=!0;try{S=P(!0,b)}finally{S?U():(R=!1,P=null)}}else R=!1}var U;if(typeof d=="function")U=function(){d(L)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,C=B.port2;B.port1.onmessage=L,U=function(){C.postMessage(null)}}else U=function(){N(L,0)};function E(b){P=b,R||(R=!0,U())}function _(b,S){M=N(function(){b(e.unstable_now())},S)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(b){b.callback=null},e.unstable_continueExecution=function(){j||y||(j=!0,E(w))},e.unstable_forceFrameRate=function(b){0>b||125<b?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<b?Math.floor(1e3/b):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(b){switch(g){case 1:case 2:case 3:var S=3;break;default:S=g}var T=g;g=S;try{return b()}finally{g=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(b,S){switch(b){case 1:case 2:case 3:case 4:case 5:break;default:b=3}var T=g;g=b;try{return S()}finally{g=T}},e.unstable_scheduleCallback=function(b,S,T){var D=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?D+T:D):T=D,b){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=T+H,b={id:m++,callback:S,priorityLevel:b,startTime:T,expirationTime:H,sortIndex:-1},T>D?(b.sortIndex=T,t(u,b),n(c)===null&&b===n(u)&&(v?(p(M),M=-1):v=!0,_(k,T-D))):(b.sortIndex=H,t(c,b),j||y||(j=!0,E(w))),b},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(b){var S=g;return function(){var T=g;g=S;try{return b.apply(this,arguments)}finally{g=T}}}})(Yu);Wu.exports=Yu;var Im=Wu.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its 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 $m=x,Qe=Im;function F(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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."}var Qu=new Set,Ls={};function kn(e,t){Kn(e,t),Kn(e+"Capture",t)}function Kn(e,t){for(Ls[e]=t,e=0;e<t.length;e++)Qu.add(t[e])}var _t=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ka=Object.prototype.hasOwnProperty,Um=/^[: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]*$/,Ko={},Go={};function Bm(e){return ka.call(Go,e)?!0:ka.call(Ko,e)?!1:Um.test(e)?Go[e]=!0:(Ko[e]=!0,!1)}function Hm(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Vm(e,t,n,s){if(t===null||typeof t>"u"||Hm(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Me(e,t,n,s,r,a,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){be[e]=new Me(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];be[t]=new Me(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){be[e]=new Me(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){be[e]=new Me(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){be[e]=new Me(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){be[e]=new Me(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){be[e]=new Me(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){be[e]=new Me(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){be[e]=new Me(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ti=/[\-:]([a-z])/g;function Pi(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ti,Pi);be[t]=new Me(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ti,Pi);be[t]=new Me(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ti,Pi);be[t]=new Me(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){be[e]=new Me(e,1,!1,e.toLowerCase(),null,!1,!1)});be.xlinkHref=new Me("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){be[e]=new Me(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ai(e,t,n,s){var r=be.hasOwnProperty(t)?be[t]:null;(r!==null?r.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Vm(t,n,r,s)&&(n=null),s||r===null?Bm(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=n===null?r.type===3?!1:"":n:(t=r.attributeName,s=r.attributeNamespace,n===null?e.removeAttribute(t):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Mt=$m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,xl=Symbol.for("react.element"),Tn=Symbol.for("react.portal"),Pn=Symbol.for("react.fragment"),Li=Symbol.for("react.strict_mode"),Sa=Symbol.for("react.profiler"),qu=Symbol.for("react.provider"),Ju=Symbol.for("react.context"),Mi=Symbol.for("react.forward_ref"),Ca=Symbol.for("react.suspense"),Ea=Symbol.for("react.suspense_list"),Fi=Symbol.for("react.memo"),Dt=Symbol.for("react.lazy"),Ku=Symbol.for("react.offscreen"),Xo=Symbol.iterator;function cs(e){return e===null||typeof e!="object"?null:(e=Xo&&e[Xo]||e["@@iterator"],typeof e=="function"?e:null)}var re=Object.assign,Yr;function vs(e){if(Yr===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Yr=t&&t[1]||""}return`
|
|
34
|
+
`+Yr+e}var Qr=!1;function qr(e,t){if(!e||Qr)return"";Qr=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var s=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){s=u}e.call(t.prototype)}else{try{throw Error()}catch(u){s=u}e()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var r=u.stack.split(`
|
|
35
|
+
`),a=s.stack.split(`
|
|
36
|
+
`),i=r.length-1,o=a.length-1;1<=i&&0<=o&&r[i]!==a[o];)o--;for(;1<=i&&0<=o;i--,o--)if(r[i]!==a[o]){if(i!==1||o!==1)do if(i--,o--,0>o||r[i]!==a[o]){var c=`
|
|
37
|
+
`+r[i].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=i&&0<=o);break}}}finally{Qr=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?vs(e):""}function Wm(e){switch(e.tag){case 5:return vs(e.type);case 16:return vs("Lazy");case 13:return vs("Suspense");case 19:return vs("SuspenseList");case 0:case 2:case 15:return e=qr(e.type,!1),e;case 11:return e=qr(e.type.render,!1),e;case 1:return e=qr(e.type,!0),e;default:return""}}function _a(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Pn:return"Fragment";case Tn:return"Portal";case Sa:return"Profiler";case Li:return"StrictMode";case Ca:return"Suspense";case Ea:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ju:return(e.displayName||"Context")+".Consumer";case qu:return(e._context.displayName||"Context")+".Provider";case Mi:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Fi:return t=e.displayName||null,t!==null?t:_a(e.type)||"Memo";case Dt:t=e._payload,e=e._init;try{return _a(e(t))}catch{}}return null}function Ym(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _a(t);case 8:return t===Li?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function en(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Qm(e){var t=Gu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(i){s=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(i){s=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function hl(e){e._valueTracker||(e._valueTracker=Qm(e))}function Xu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Gu(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Ql(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}}function Ra(e,t){var n=t.checked;return re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Zo(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=en(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Zu(e,t){t=t.checked,t!=null&&Ai(e,"checked",t,!1)}function Ta(e,t){Zu(e,t);var n=en(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Pa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Pa(e,t.type,en(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ec(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Pa(e,t,n){(t!=="number"||Ql(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ys=Array.isArray;function Vn(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+en(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Aa(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return re({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function tc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(F(92));if(ys(n)){if(1<n.length)throw Error(F(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:en(n)}}function ed(e,t){var n=en(t.value),s=en(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function nc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function td(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function La(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?td(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gl,nd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,r)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(gl=gl||document.createElement("div"),gl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=gl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ms(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var bs={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qm=["Webkit","ms","Moz","O"];Object.keys(bs).forEach(function(e){qm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bs[t]=bs[e]})});function sd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||bs.hasOwnProperty(e)&&bs[e]?(""+t).trim():t+"px"}function ld(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=sd(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,r):e[n]=r}}var Jm=re({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ma(e,t){if(t){if(Jm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function Fa(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Oa=null;function Oi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var za=null,Wn=null,Yn=null;function sc(e){if(e=il(e)){if(typeof za!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Tr(t),za(e.stateNode,e.type,t))}}function rd(e){Wn?Yn?Yn.push(e):Yn=[e]:Wn=e}function ad(){if(Wn){var e=Wn,t=Yn;if(Yn=Wn=null,sc(e),t)for(e=0;e<t.length;e++)sc(t[e])}}function id(e,t){return e(t)}function od(){}var Jr=!1;function cd(e,t,n){if(Jr)return e(t,n);Jr=!0;try{return id(e,t,n)}finally{Jr=!1,(Wn!==null||Yn!==null)&&(od(),ad())}}function Fs(e,t){var n=e.stateNode;if(n===null)return null;var s=Tr(n);if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(F(231,t,typeof n));return n}var Da=!1;if(_t)try{var us={};Object.defineProperty(us,"passive",{get:function(){Da=!0}}),window.addEventListener("test",us,us),window.removeEventListener("test",us,us)}catch{Da=!1}function Km(e,t,n,s,r,a,i,o,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(m){this.onError(m)}}var ks=!1,ql=null,Jl=!1,Ia=null,Gm={onError:function(e){ks=!0,ql=e}};function Xm(e,t,n,s,r,a,i,o,c){ks=!1,ql=null,Km.apply(Gm,arguments)}function Zm(e,t,n,s,r,a,i,o,c){if(Xm.apply(this,arguments),ks){if(ks){var u=ql;ks=!1,ql=null}else throw Error(F(198));Jl||(Jl=!0,Ia=u)}}function Sn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ud(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 lc(e){if(Sn(e)!==e)throw Error(F(188))}function e0(e){var t=e.alternate;if(!t){if(t=Sn(e),t===null)throw Error(F(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return lc(r),e;if(a===s)return lc(r),t;a=a.sibling}throw Error(F(188))}if(n.return!==s.return)n=r,s=a;else{for(var i=!1,o=r.child;o;){if(o===n){i=!0,n=r,s=a;break}if(o===s){i=!0,s=r,n=a;break}o=o.sibling}if(!i){for(o=a.child;o;){if(o===n){i=!0,n=a,s=r;break}if(o===s){i=!0,s=a,n=r;break}o=o.sibling}if(!i)throw Error(F(189))}}if(n.alternate!==s)throw Error(F(190))}if(n.tag!==3)throw Error(F(188));return n.stateNode.current===n?e:t}function dd(e){return e=e0(e),e!==null?fd(e):null}function fd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=fd(e);if(t!==null)return t;e=e.sibling}return null}var pd=Qe.unstable_scheduleCallback,rc=Qe.unstable_cancelCallback,t0=Qe.unstable_shouldYield,n0=Qe.unstable_requestPaint,oe=Qe.unstable_now,s0=Qe.unstable_getCurrentPriorityLevel,zi=Qe.unstable_ImmediatePriority,md=Qe.unstable_UserBlockingPriority,Kl=Qe.unstable_NormalPriority,l0=Qe.unstable_LowPriority,xd=Qe.unstable_IdlePriority,Cr=null,vt=null;function r0(e){if(vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(Cr,e,void 0,(e.current.flags&128)===128)}catch{}}var ut=Math.clz32?Math.clz32:o0,a0=Math.log,i0=Math.LN2;function o0(e){return e>>>=0,e===0?32:31-(a0(e)/i0|0)|0}var vl=64,yl=4194304;function js(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Gl(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,r=e.suspendedLanes,a=e.pingedLanes,i=n&268435455;if(i!==0){var o=i&~r;o!==0?s=js(o):(a&=i,a!==0&&(s=js(a)))}else i=n&~r,i!==0?s=js(i):a!==0&&(s=js(a));if(s===0)return 0;if(t!==0&&t!==s&&!(t&r)&&(r=s&-s,a=t&-t,r>=a||r===16&&(a&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-ut(t),r=1<<n,s|=e[n],t&=~r;return s}function c0(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function u0(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,a=e.pendingLanes;0<a;){var i=31-ut(a),o=1<<i,c=r[i];c===-1?(!(o&n)||o&s)&&(r[i]=c0(o,t)):c<=t&&(e.expiredLanes|=o),a&=~o}}function $a(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hd(){var e=vl;return vl<<=1,!(vl&4194240)&&(vl=64),e}function Kr(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ut(t),e[t]=n}function d0(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-ut(n),a=1<<r;t[r]=0,s[r]=-1,e[r]=-1,n&=~a}}function Di(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-ut(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}var q=0;function gd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var vd,Ii,yd,jd,Nd,Ua=!1,jl=[],Vt=null,Wt=null,Yt=null,Os=new Map,zs=new Map,$t=[],f0="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 submit".split(" ");function ac(e,t){switch(e){case"focusin":case"focusout":Vt=null;break;case"dragenter":case"dragleave":Wt=null;break;case"mouseover":case"mouseout":Yt=null;break;case"pointerover":case"pointerout":Os.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":zs.delete(t.pointerId)}}function ds(e,t,n,s,r,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:a,targetContainers:[r]},t!==null&&(t=il(t),t!==null&&Ii(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function p0(e,t,n,s,r){switch(t){case"focusin":return Vt=ds(Vt,e,t,n,s,r),!0;case"dragenter":return Wt=ds(Wt,e,t,n,s,r),!0;case"mouseover":return Yt=ds(Yt,e,t,n,s,r),!0;case"pointerover":var a=r.pointerId;return Os.set(a,ds(Os.get(a)||null,e,t,n,s,r)),!0;case"gotpointercapture":return a=r.pointerId,zs.set(a,ds(zs.get(a)||null,e,t,n,s,r)),!0}return!1}function wd(e){var t=dn(e.target);if(t!==null){var n=Sn(t);if(n!==null){if(t=n.tag,t===13){if(t=ud(n),t!==null){e.blockedOn=t,Nd(e.priority,function(){yd(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ba(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Oa=s,n.target.dispatchEvent(s),Oa=null}else return t=il(n),t!==null&&Ii(t),e.blockedOn=n,!1;t.shift()}return!0}function ic(e,t,n){Fl(e)&&n.delete(t)}function m0(){Ua=!1,Vt!==null&&Fl(Vt)&&(Vt=null),Wt!==null&&Fl(Wt)&&(Wt=null),Yt!==null&&Fl(Yt)&&(Yt=null),Os.forEach(ic),zs.forEach(ic)}function fs(e,t){e.blockedOn===t&&(e.blockedOn=null,Ua||(Ua=!0,Qe.unstable_scheduleCallback(Qe.unstable_NormalPriority,m0)))}function Ds(e){function t(r){return fs(r,e)}if(0<jl.length){fs(jl[0],e);for(var n=1;n<jl.length;n++){var s=jl[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Vt!==null&&fs(Vt,e),Wt!==null&&fs(Wt,e),Yt!==null&&fs(Yt,e),Os.forEach(t),zs.forEach(t),n=0;n<$t.length;n++)s=$t[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<$t.length&&(n=$t[0],n.blockedOn===null);)wd(n),n.blockedOn===null&&$t.shift()}var Qn=Mt.ReactCurrentBatchConfig,Xl=!0;function x0(e,t,n,s){var r=q,a=Qn.transition;Qn.transition=null;try{q=1,$i(e,t,n,s)}finally{q=r,Qn.transition=a}}function h0(e,t,n,s){var r=q,a=Qn.transition;Qn.transition=null;try{q=4,$i(e,t,n,s)}finally{q=r,Qn.transition=a}}function $i(e,t,n,s){if(Xl){var r=Ba(e,t,n,s);if(r===null)aa(e,t,s,Zl,n),ac(e,s);else if(p0(r,e,t,n,s))s.stopPropagation();else if(ac(e,s),t&4&&-1<f0.indexOf(e)){for(;r!==null;){var a=il(r);if(a!==null&&vd(a),a=Ba(e,t,n,s),a===null&&aa(e,t,s,Zl,n),a===r)break;r=a}r!==null&&s.stopPropagation()}else aa(e,t,s,null,n)}}var Zl=null;function Ba(e,t,n,s){if(Zl=null,e=Oi(s),e=dn(e),e!==null)if(t=Sn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ud(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Zl=e,null}function bd(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(s0()){case zi:return 1;case md:return 4;case Kl:case l0:return 16;case xd:return 536870912;default:return 16}default:return 16}}var Bt=null,Ui=null,Ol=null;function kd(){if(Ol)return Ol;var e,t=Ui,n=t.length,s,r="value"in Bt?Bt.value:Bt.textContent,a=r.length;for(e=0;e<n&&t[e]===r[e];e++);var i=n-e;for(s=1;s<=i&&t[n-s]===r[a-s];s++);return Ol=r.slice(e,1<s?1-s:void 0)}function zl(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 Nl(){return!0}function oc(){return!1}function Je(e){function t(n,s,r,a,i){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Nl:oc,this.isPropagationStopped=oc,this}return re(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Nl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Nl)},persist:function(){},isPersistent:Nl}),t}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bi=Je(rs),al=re({},rs,{view:0,detail:0}),g0=Je(al),Gr,Xr,ps,Er=re({},al,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hi,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!==ps&&(ps&&e.type==="mousemove"?(Gr=e.screenX-ps.screenX,Xr=e.screenY-ps.screenY):Xr=Gr=0,ps=e),Gr)},movementY:function(e){return"movementY"in e?e.movementY:Xr}}),cc=Je(Er),v0=re({},Er,{dataTransfer:0}),y0=Je(v0),j0=re({},al,{relatedTarget:0}),Zr=Je(j0),N0=re({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),w0=Je(N0),b0=re({},rs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),k0=Je(b0),S0=re({},rs,{data:0}),uc=Je(S0),C0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},E0={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"},_0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function R0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_0[e])?!!t[e]:!1}function Hi(){return R0}var T0=re({},al,{key:function(e){if(e.key){var t=C0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?E0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hi,charCode:function(e){return e.type==="keypress"?zl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),P0=Je(T0),A0=re({},Er,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dc=Je(A0),L0=re({},al,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hi}),M0=Je(L0),F0=re({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),O0=Je(F0),z0=re({},Er,{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}),D0=Je(z0),I0=[9,13,27,32],Vi=_t&&"CompositionEvent"in window,Ss=null;_t&&"documentMode"in document&&(Ss=document.documentMode);var $0=_t&&"TextEvent"in window&&!Ss,Sd=_t&&(!Vi||Ss&&8<Ss&&11>=Ss),fc=" ",pc=!1;function Cd(e,t){switch(e){case"keyup":return I0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ed(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var An=!1;function U0(e,t){switch(e){case"compositionend":return Ed(t);case"keypress":return t.which!==32?null:(pc=!0,fc);case"textInput":return e=t.data,e===fc&&pc?null:e;default:return null}}function B0(e,t){if(An)return e==="compositionend"||!Vi&&Cd(e,t)?(e=kd(),Ol=Ui=Bt=null,An=!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 Sd&&t.locale!=="ko"?null:t.data;default:return null}}var H0={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 mc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!H0[e.type]:t==="textarea"}function _d(e,t,n,s){rd(s),t=er(t,"onChange"),0<t.length&&(n=new Bi("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Cs=null,Is=null;function V0(e){Id(e,0)}function _r(e){var t=Fn(e);if(Xu(t))return e}function W0(e,t){if(e==="change")return t}var Rd=!1;if(_t){var ea;if(_t){var ta="oninput"in document;if(!ta){var xc=document.createElement("div");xc.setAttribute("oninput","return;"),ta=typeof xc.oninput=="function"}ea=ta}else ea=!1;Rd=ea&&(!document.documentMode||9<document.documentMode)}function hc(){Cs&&(Cs.detachEvent("onpropertychange",Td),Is=Cs=null)}function Td(e){if(e.propertyName==="value"&&_r(Is)){var t=[];_d(t,Is,e,Oi(e)),cd(V0,t)}}function Y0(e,t,n){e==="focusin"?(hc(),Cs=t,Is=n,Cs.attachEvent("onpropertychange",Td)):e==="focusout"&&hc()}function Q0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _r(Is)}function q0(e,t){if(e==="click")return _r(t)}function J0(e,t){if(e==="input"||e==="change")return _r(t)}function K0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ft=typeof Object.is=="function"?Object.is:K0;function $s(e,t){if(ft(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!ka.call(t,r)||!ft(e[r],t[r]))return!1}return!0}function gc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vc(e,t){var n=gc(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=gc(n)}}function Pd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ad(){for(var e=window,t=Ql();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ql(e.document)}return t}function Wi(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")}function G0(e){var t=Ad(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Pd(n.ownerDocument.documentElement,n)){if(s!==null&&Wi(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,a=Math.min(s.start,r);s=s.end===void 0?a:Math.min(s.end,r),!e.extend&&a>s&&(r=s,s=a,a=r),r=vc(n,a);var i=vc(n,s);r&&i&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),a>s?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var X0=_t&&"documentMode"in document&&11>=document.documentMode,Ln=null,Ha=null,Es=null,Va=!1;function yc(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Va||Ln==null||Ln!==Ql(s)||(s=Ln,"selectionStart"in s&&Wi(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Es&&$s(Es,s)||(Es=s,s=er(Ha,"onSelect"),0<s.length&&(t=new Bi("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Ln)))}function wl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Mn={animationend:wl("Animation","AnimationEnd"),animationiteration:wl("Animation","AnimationIteration"),animationstart:wl("Animation","AnimationStart"),transitionend:wl("Transition","TransitionEnd")},na={},Ld={};_t&&(Ld=document.createElement("div").style,"AnimationEvent"in window||(delete Mn.animationend.animation,delete Mn.animationiteration.animation,delete Mn.animationstart.animation),"TransitionEvent"in window||delete Mn.transitionend.transition);function Rr(e){if(na[e])return na[e];if(!Mn[e])return e;var t=Mn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ld)return na[e]=t[n];return e}var Md=Rr("animationend"),Fd=Rr("animationiteration"),Od=Rr("animationstart"),zd=Rr("transitionend"),Dd=new Map,jc="abort auxClick 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(" ");function rn(e,t){Dd.set(e,t),kn(t,[e])}for(var sa=0;sa<jc.length;sa++){var la=jc[sa],Z0=la.toLowerCase(),ex=la[0].toUpperCase()+la.slice(1);rn(Z0,"on"+ex)}rn(Md,"onAnimationEnd");rn(Fd,"onAnimationIteration");rn(Od,"onAnimationStart");rn("dblclick","onDoubleClick");rn("focusin","onFocus");rn("focusout","onBlur");rn(zd,"onTransitionEnd");Kn("onMouseEnter",["mouseout","mouseover"]);Kn("onMouseLeave",["mouseout","mouseover"]);Kn("onPointerEnter",["pointerout","pointerover"]);Kn("onPointerLeave",["pointerout","pointerover"]);kn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));kn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));kn("onBeforeInput",["compositionend","keypress","textInput","paste"]);kn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));kn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));kn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ns="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(" "),tx=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ns));function Nc(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,Zm(s,t,void 0,e),e.currentTarget=null}function Id(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var i=s.length-1;0<=i;i--){var o=s[i],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==a&&r.isPropagationStopped())break e;Nc(r,o,u),a=c}else for(i=0;i<s.length;i++){if(o=s[i],c=o.instance,u=o.currentTarget,o=o.listener,c!==a&&r.isPropagationStopped())break e;Nc(r,o,u),a=c}}}if(Jl)throw e=Ia,Jl=!1,Ia=null,e}function K(e,t){var n=t[Ja];n===void 0&&(n=t[Ja]=new Set);var s=e+"__bubble";n.has(s)||($d(t,e,2,!1),n.add(s))}function ra(e,t,n){var s=0;t&&(s|=4),$d(n,e,s,t)}var bl="_reactListening"+Math.random().toString(36).slice(2);function Us(e){if(!e[bl]){e[bl]=!0,Qu.forEach(function(n){n!=="selectionchange"&&(tx.has(n)||ra(n,!1,e),ra(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bl]||(t[bl]=!0,ra("selectionchange",!1,t))}}function $d(e,t,n,s){switch(bd(t)){case 1:var r=x0;break;case 4:r=h0;break;default:r=$i}n=r.bind(null,t,n,e),r=void 0,!Da||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function aa(e,t,n,s,r){var a=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var i=s.tag;if(i===3||i===4){var o=s.stateNode.containerInfo;if(o===r||o.nodeType===8&&o.parentNode===r)break;if(i===4)for(i=s.return;i!==null;){var c=i.tag;if((c===3||c===4)&&(c=i.stateNode.containerInfo,c===r||c.nodeType===8&&c.parentNode===r))return;i=i.return}for(;o!==null;){if(i=dn(o),i===null)return;if(c=i.tag,c===5||c===6){s=a=i;continue e}o=o.parentNode}}s=s.return}cd(function(){var u=a,m=Oi(n),f=[];e:{var g=Dd.get(e);if(g!==void 0){var y=Bi,j=e;switch(e){case"keypress":if(zl(n)===0)break e;case"keydown":case"keyup":y=P0;break;case"focusin":j="focus",y=Zr;break;case"focusout":j="blur",y=Zr;break;case"beforeblur":case"afterblur":y=Zr;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=cc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=y0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=M0;break;case Md:case Fd:case Od:y=w0;break;case zd:y=O0;break;case"scroll":y=g0;break;case"wheel":y=D0;break;case"copy":case"cut":case"paste":y=k0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=dc}var v=(t&4)!==0,N=!v&&e==="scroll",p=v?g!==null?g+"Capture":null:g;v=[];for(var d=u,h;d!==null;){h=d;var k=h.stateNode;if(h.tag===5&&k!==null&&(h=k,p!==null&&(k=Fs(d,p),k!=null&&v.push(Bs(d,k,h)))),N)break;d=d.return}0<v.length&&(g=new y(g,j,null,n,m),f.push({event:g,listeners:v}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",g&&n!==Oa&&(j=n.relatedTarget||n.fromElement)&&(dn(j)||j[Rt]))break e;if((y||g)&&(g=m.window===m?m:(g=m.ownerDocument)?g.defaultView||g.parentWindow:window,y?(j=n.relatedTarget||n.toElement,y=u,j=j?dn(j):null,j!==null&&(N=Sn(j),j!==N||j.tag!==5&&j.tag!==6)&&(j=null)):(y=null,j=u),y!==j)){if(v=cc,k="onMouseLeave",p="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(v=dc,k="onPointerLeave",p="onPointerEnter",d="pointer"),N=y==null?g:Fn(y),h=j==null?g:Fn(j),g=new v(k,d+"leave",y,n,m),g.target=N,g.relatedTarget=h,k=null,dn(m)===u&&(v=new v(p,d+"enter",j,n,m),v.target=h,v.relatedTarget=N,k=v),N=k,y&&j)t:{for(v=y,p=j,d=0,h=v;h;h=En(h))d++;for(h=0,k=p;k;k=En(k))h++;for(;0<d-h;)v=En(v),d--;for(;0<h-d;)p=En(p),h--;for(;d--;){if(v===p||p!==null&&v===p.alternate)break t;v=En(v),p=En(p)}v=null}else v=null;y!==null&&wc(f,g,y,v,!1),j!==null&&N!==null&&wc(f,N,j,v,!0)}}e:{if(g=u?Fn(u):window,y=g.nodeName&&g.nodeName.toLowerCase(),y==="select"||y==="input"&&g.type==="file")var w=W0;else if(mc(g))if(Rd)w=J0;else{w=Q0;var R=Y0}else(y=g.nodeName)&&y.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(w=q0);if(w&&(w=w(e,u))){_d(f,w,n,m);break e}R&&R(e,g,u),e==="focusout"&&(R=g._wrapperState)&&R.controlled&&g.type==="number"&&Pa(g,"number",g.value)}switch(R=u?Fn(u):window,e){case"focusin":(mc(R)||R.contentEditable==="true")&&(Ln=R,Ha=u,Es=null);break;case"focusout":Es=Ha=Ln=null;break;case"mousedown":Va=!0;break;case"contextmenu":case"mouseup":case"dragend":Va=!1,yc(f,n,m);break;case"selectionchange":if(X0)break;case"keydown":case"keyup":yc(f,n,m)}var P;if(Vi)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else An?Cd(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(Sd&&n.locale!=="ko"&&(An||M!=="onCompositionStart"?M==="onCompositionEnd"&&An&&(P=kd()):(Bt=m,Ui="value"in Bt?Bt.value:Bt.textContent,An=!0)),R=er(u,M),0<R.length&&(M=new uc(M,e,null,n,m),f.push({event:M,listeners:R}),P?M.data=P:(P=Ed(n),P!==null&&(M.data=P)))),(P=$0?U0(e,n):B0(e,n))&&(u=er(u,"onBeforeInput"),0<u.length&&(m=new uc("onBeforeInput","beforeinput",null,n,m),f.push({event:m,listeners:u}),m.data=P))}Id(f,t)})}function Bs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function er(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,a=r.stateNode;r.tag===5&&a!==null&&(r=a,a=Fs(e,n),a!=null&&s.unshift(Bs(e,a,r)),a=Fs(e,t),a!=null&&s.push(Bs(e,a,r))),e=e.return}return s}function En(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function wc(e,t,n,s,r){for(var a=t._reactName,i=[];n!==null&&n!==s;){var o=n,c=o.alternate,u=o.stateNode;if(c!==null&&c===s)break;o.tag===5&&u!==null&&(o=u,r?(c=Fs(n,a),c!=null&&i.unshift(Bs(n,c,o))):r||(c=Fs(n,a),c!=null&&i.push(Bs(n,c,o)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var nx=/\r\n?/g,sx=/\u0000|\uFFFD/g;function bc(e){return(typeof e=="string"?e:""+e).replace(nx,`
|
|
38
|
+
`).replace(sx,"")}function kl(e,t,n){if(t=bc(t),bc(e)!==t&&n)throw Error(F(425))}function tr(){}var Wa=null,Ya=null;function Qa(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qa=typeof setTimeout=="function"?setTimeout:void 0,lx=typeof clearTimeout=="function"?clearTimeout:void 0,kc=typeof Promise=="function"?Promise:void 0,rx=typeof queueMicrotask=="function"?queueMicrotask:typeof kc<"u"?function(e){return kc.resolve(null).then(e).catch(ax)}:qa;function ax(e){setTimeout(function(){throw e})}function ia(e,t){var n=t,s=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(s===0){e.removeChild(r),Ds(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);Ds(t)}function Qt(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==="$?")break;if(t==="/$")return null}}return e}function Sc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var as=Math.random().toString(36).slice(2),gt="__reactFiber$"+as,Hs="__reactProps$"+as,Rt="__reactContainer$"+as,Ja="__reactEvents$"+as,ix="__reactListeners$"+as,ox="__reactHandles$"+as;function dn(e){var t=e[gt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Rt]||n[gt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sc(e);e!==null;){if(n=e[gt])return n;e=Sc(e)}return t}e=n,n=e.parentNode}return null}function il(e){return e=e[gt]||e[Rt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function Tr(e){return e[Hs]||null}var Ka=[],On=-1;function an(e){return{current:e}}function G(e){0>On||(e.current=Ka[On],Ka[On]=null,On--)}function J(e,t){On++,Ka[On]=e.current,e.current=t}var tn={},Ee=an(tn),$e=an(!1),gn=tn;function Gn(e,t){var n=e.type.contextTypes;if(!n)return tn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var r={},a;for(a in n)r[a]=t[a];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function Ue(e){return e=e.childContextTypes,e!=null}function nr(){G($e),G(Ee)}function Cc(e,t,n){if(Ee.current!==tn)throw Error(F(168));J(Ee,t),J($e,n)}function Ud(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var r in s)if(!(r in t))throw Error(F(108,Ym(e)||"Unknown",r));return re({},n,s)}function sr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tn,gn=Ee.current,J(Ee,e),J($e,$e.current),!0}function Ec(e,t,n){var s=e.stateNode;if(!s)throw Error(F(169));n?(e=Ud(e,t,gn),s.__reactInternalMemoizedMergedChildContext=e,G($e),G(Ee),J(Ee,e)):G($e),J($e,n)}var bt=null,Pr=!1,oa=!1;function Bd(e){bt===null?bt=[e]:bt.push(e)}function cx(e){Pr=!0,Bd(e)}function on(){if(!oa&&bt!==null){oa=!0;var e=0,t=q;try{var n=bt;for(q=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}bt=null,Pr=!1}catch(r){throw bt!==null&&(bt=bt.slice(e+1)),pd(zi,on),r}finally{q=t,oa=!1}}return null}var zn=[],Dn=0,lr=null,rr=0,Ke=[],Ge=0,vn=null,kt=1,St="";function cn(e,t){zn[Dn++]=rr,zn[Dn++]=lr,lr=e,rr=t}function Hd(e,t,n){Ke[Ge++]=kt,Ke[Ge++]=St,Ke[Ge++]=vn,vn=e;var s=kt;e=St;var r=32-ut(s)-1;s&=~(1<<r),n+=1;var a=32-ut(t)+r;if(30<a){var i=r-r%5;a=(s&(1<<i)-1).toString(32),s>>=i,r-=i,kt=1<<32-ut(t)+r|n<<r|s,St=a+e}else kt=1<<a|n<<r|s,St=e}function Yi(e){e.return!==null&&(cn(e,1),Hd(e,1,0))}function Qi(e){for(;e===lr;)lr=zn[--Dn],zn[Dn]=null,rr=zn[--Dn],zn[Dn]=null;for(;e===vn;)vn=Ke[--Ge],Ke[Ge]=null,St=Ke[--Ge],Ke[Ge]=null,kt=Ke[--Ge],Ke[Ge]=null}var Ye=null,We=null,ee=!1,ct=null;function Vd(e,t){var n=Xe(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function _c(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ye=e,We=Qt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ye=e,We=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=vn!==null?{id:kt,overflow:St}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xe(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ye=e,We=null,!0):!1;default:return!1}}function Ga(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xa(e){if(ee){var t=We;if(t){var n=t;if(!_c(e,t)){if(Ga(e))throw Error(F(418));t=Qt(n.nextSibling);var s=Ye;t&&_c(e,t)?Vd(s,n):(e.flags=e.flags&-4097|2,ee=!1,Ye=e)}}else{if(Ga(e))throw Error(F(418));e.flags=e.flags&-4097|2,ee=!1,Ye=e}}}function Rc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ye=e}function Sl(e){if(e!==Ye)return!1;if(!ee)return Rc(e),ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Qa(e.type,e.memoizedProps)),t&&(t=We)){if(Ga(e))throw Wd(),Error(F(418));for(;t;)Vd(e,t),t=Qt(t.nextSibling)}if(Rc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){We=Qt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}We=null}}else We=Ye?Qt(e.stateNode.nextSibling):null;return!0}function Wd(){for(var e=We;e;)e=Qt(e.nextSibling)}function Xn(){We=Ye=null,ee=!1}function qi(e){ct===null?ct=[e]:ct.push(e)}var ux=Mt.ReactCurrentBatchConfig;function ms(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(F(309));var s=n.stateNode}if(!s)throw Error(F(147,e));var r=s,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(i){var o=r.refs;i===null?delete o[a]:o[a]=i},t._stringRef=a,t)}if(typeof e!="string")throw Error(F(284));if(!n._owner)throw Error(F(290,e))}return e}function Cl(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Tc(e){var t=e._init;return t(e._payload)}function Yd(e){function t(p,d){if(e){var h=p.deletions;h===null?(p.deletions=[d],p.flags|=16):h.push(d)}}function n(p,d){if(!e)return null;for(;d!==null;)t(p,d),d=d.sibling;return null}function s(p,d){for(p=new Map;d!==null;)d.key!==null?p.set(d.key,d):p.set(d.index,d),d=d.sibling;return p}function r(p,d){return p=Gt(p,d),p.index=0,p.sibling=null,p}function a(p,d,h){return p.index=h,e?(h=p.alternate,h!==null?(h=h.index,h<d?(p.flags|=2,d):h):(p.flags|=2,d)):(p.flags|=1048576,d)}function i(p){return e&&p.alternate===null&&(p.flags|=2),p}function o(p,d,h,k){return d===null||d.tag!==6?(d=xa(h,p.mode,k),d.return=p,d):(d=r(d,h),d.return=p,d)}function c(p,d,h,k){var w=h.type;return w===Pn?m(p,d,h.props.children,k,h.key):d!==null&&(d.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Dt&&Tc(w)===d.type)?(k=r(d,h.props),k.ref=ms(p,d,h),k.return=p,k):(k=Vl(h.type,h.key,h.props,null,p.mode,k),k.ref=ms(p,d,h),k.return=p,k)}function u(p,d,h,k){return d===null||d.tag!==4||d.stateNode.containerInfo!==h.containerInfo||d.stateNode.implementation!==h.implementation?(d=ha(h,p.mode,k),d.return=p,d):(d=r(d,h.children||[]),d.return=p,d)}function m(p,d,h,k,w){return d===null||d.tag!==7?(d=xn(h,p.mode,k,w),d.return=p,d):(d=r(d,h),d.return=p,d)}function f(p,d,h){if(typeof d=="string"&&d!==""||typeof d=="number")return d=xa(""+d,p.mode,h),d.return=p,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case xl:return h=Vl(d.type,d.key,d.props,null,p.mode,h),h.ref=ms(p,null,d),h.return=p,h;case Tn:return d=ha(d,p.mode,h),d.return=p,d;case Dt:var k=d._init;return f(p,k(d._payload),h)}if(ys(d)||cs(d))return d=xn(d,p.mode,h,null),d.return=p,d;Cl(p,d)}return null}function g(p,d,h,k){var w=d!==null?d.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return w!==null?null:o(p,d,""+h,k);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case xl:return h.key===w?c(p,d,h,k):null;case Tn:return h.key===w?u(p,d,h,k):null;case Dt:return w=h._init,g(p,d,w(h._payload),k)}if(ys(h)||cs(h))return w!==null?null:m(p,d,h,k,null);Cl(p,h)}return null}function y(p,d,h,k,w){if(typeof k=="string"&&k!==""||typeof k=="number")return p=p.get(h)||null,o(d,p,""+k,w);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case xl:return p=p.get(k.key===null?h:k.key)||null,c(d,p,k,w);case Tn:return p=p.get(k.key===null?h:k.key)||null,u(d,p,k,w);case Dt:var R=k._init;return y(p,d,h,R(k._payload),w)}if(ys(k)||cs(k))return p=p.get(h)||null,m(d,p,k,w,null);Cl(d,k)}return null}function j(p,d,h,k){for(var w=null,R=null,P=d,M=d=0,O=null;P!==null&&M<h.length;M++){P.index>M?(O=P,P=null):O=P.sibling;var z=g(p,P,h[M],k);if(z===null){P===null&&(P=O);break}e&&P&&z.alternate===null&&t(p,P),d=a(z,d,M),R===null?w=z:R.sibling=z,R=z,P=O}if(M===h.length)return n(p,P),ee&&cn(p,M),w;if(P===null){for(;M<h.length;M++)P=f(p,h[M],k),P!==null&&(d=a(P,d,M),R===null?w=P:R.sibling=P,R=P);return ee&&cn(p,M),w}for(P=s(p,P);M<h.length;M++)O=y(P,p,M,h[M],k),O!==null&&(e&&O.alternate!==null&&P.delete(O.key===null?M:O.key),d=a(O,d,M),R===null?w=O:R.sibling=O,R=O);return e&&P.forEach(function(A){return t(p,A)}),ee&&cn(p,M),w}function v(p,d,h,k){var w=cs(h);if(typeof w!="function")throw Error(F(150));if(h=w.call(h),h==null)throw Error(F(151));for(var R=w=null,P=d,M=d=0,O=null,z=h.next();P!==null&&!z.done;M++,z=h.next()){P.index>M?(O=P,P=null):O=P.sibling;var A=g(p,P,z.value,k);if(A===null){P===null&&(P=O);break}e&&P&&A.alternate===null&&t(p,P),d=a(A,d,M),R===null?w=A:R.sibling=A,R=A,P=O}if(z.done)return n(p,P),ee&&cn(p,M),w;if(P===null){for(;!z.done;M++,z=h.next())z=f(p,z.value,k),z!==null&&(d=a(z,d,M),R===null?w=z:R.sibling=z,R=z);return ee&&cn(p,M),w}for(P=s(p,P);!z.done;M++,z=h.next())z=y(P,p,M,z.value,k),z!==null&&(e&&z.alternate!==null&&P.delete(z.key===null?M:z.key),d=a(z,d,M),R===null?w=z:R.sibling=z,R=z);return e&&P.forEach(function(L){return t(p,L)}),ee&&cn(p,M),w}function N(p,d,h,k){if(typeof h=="object"&&h!==null&&h.type===Pn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case xl:e:{for(var w=h.key,R=d;R!==null;){if(R.key===w){if(w=h.type,w===Pn){if(R.tag===7){n(p,R.sibling),d=r(R,h.props.children),d.return=p,p=d;break e}}else if(R.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Dt&&Tc(w)===R.type){n(p,R.sibling),d=r(R,h.props),d.ref=ms(p,R,h),d.return=p,p=d;break e}n(p,R);break}else t(p,R);R=R.sibling}h.type===Pn?(d=xn(h.props.children,p.mode,k,h.key),d.return=p,p=d):(k=Vl(h.type,h.key,h.props,null,p.mode,k),k.ref=ms(p,d,h),k.return=p,p=k)}return i(p);case Tn:e:{for(R=h.key;d!==null;){if(d.key===R)if(d.tag===4&&d.stateNode.containerInfo===h.containerInfo&&d.stateNode.implementation===h.implementation){n(p,d.sibling),d=r(d,h.children||[]),d.return=p,p=d;break e}else{n(p,d);break}else t(p,d);d=d.sibling}d=ha(h,p.mode,k),d.return=p,p=d}return i(p);case Dt:return R=h._init,N(p,d,R(h._payload),k)}if(ys(h))return j(p,d,h,k);if(cs(h))return v(p,d,h,k);Cl(p,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,d!==null&&d.tag===6?(n(p,d.sibling),d=r(d,h),d.return=p,p=d):(n(p,d),d=xa(h,p.mode,k),d.return=p,p=d),i(p)):n(p,d)}return N}var Zn=Yd(!0),Qd=Yd(!1),ar=an(null),ir=null,In=null,Ji=null;function Ki(){Ji=In=ir=null}function Gi(e){var t=ar.current;G(ar),e._currentValue=t}function Za(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function qn(e,t){ir=e,Ji=In=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(De=!0),e.firstContext=null)}function et(e){var t=e._currentValue;if(Ji!==e)if(e={context:e,memoizedValue:t,next:null},In===null){if(ir===null)throw Error(F(308));In=e,ir.dependencies={lanes:0,firstContext:e}}else In=In.next=e;return t}var fn=null;function Xi(e){fn===null?fn=[e]:fn.push(e)}function qd(e,t,n,s){var r=t.interleaved;return r===null?(n.next=n,Xi(t)):(n.next=r.next,r.next=n),t.interleaved=n,Tt(e,s)}function Tt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var It=!1;function Zi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ct(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qt(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,Q&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,Tt(e,n)}return r=s.interleaved,r===null?(t.next=t,Xi(s)):(t.next=r.next,r.next=t),s.interleaved=t,Tt(e,n)}function Dl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Di(e,n)}}function Pc(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?r=a=i:a=a.next=i,n=n.next}while(n!==null);a===null?r=a=t:a=a.next=t}else r=a=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function or(e,t,n,s){var r=e.updateQueue;It=!1;var a=r.firstBaseUpdate,i=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var c=o,u=c.next;c.next=null,i===null?a=u:i.next=u,i=c;var m=e.alternate;m!==null&&(m=m.updateQueue,o=m.lastBaseUpdate,o!==i&&(o===null?m.firstBaseUpdate=u:o.next=u,m.lastBaseUpdate=c))}if(a!==null){var f=r.baseState;i=0,m=u=c=null,o=a;do{var g=o.lane,y=o.eventTime;if((s&g)===g){m!==null&&(m=m.next={eventTime:y,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var j=e,v=o;switch(g=t,y=n,v.tag){case 1:if(j=v.payload,typeof j=="function"){f=j.call(y,f,g);break e}f=j;break e;case 3:j.flags=j.flags&-65537|128;case 0:if(j=v.payload,g=typeof j=="function"?j.call(y,f,g):j,g==null)break e;f=re({},f,g);break e;case 2:It=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,g=r.effects,g===null?r.effects=[o]:g.push(o))}else y={eventTime:y,lane:g,tag:o.tag,payload:o.payload,callback:o.callback,next:null},m===null?(u=m=y,c=f):m=m.next=y,i|=g;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;g=o,o=g.next,g.next=null,r.lastBaseUpdate=g,r.shared.pending=null}}while(!0);if(m===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=m,t=r.shared.interleaved,t!==null){r=t;do i|=r.lane,r=r.next;while(r!==t)}else a===null&&(r.shared.lanes=0);jn|=i,e.lanes=i,e.memoizedState=f}}function Ac(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],r=s.callback;if(r!==null){if(s.callback=null,s=n,typeof r!="function")throw Error(F(191,r));r.call(s)}}}var ol={},yt=an(ol),Vs=an(ol),Ws=an(ol);function pn(e){if(e===ol)throw Error(F(174));return e}function eo(e,t){switch(J(Ws,t),J(Vs,e),J(yt,ol),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:La(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=La(t,e)}G(yt),J(yt,t)}function es(){G(yt),G(Vs),G(Ws)}function Kd(e){pn(Ws.current);var t=pn(yt.current),n=La(t,e.type);t!==n&&(J(Vs,e),J(yt,n))}function to(e){Vs.current===e&&(G(yt),G(Vs))}var ne=an(0);function cr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ca=[];function no(){for(var e=0;e<ca.length;e++)ca[e]._workInProgressVersionPrimary=null;ca.length=0}var Il=Mt.ReactCurrentDispatcher,ua=Mt.ReactCurrentBatchConfig,yn=0,se=null,fe=null,he=null,ur=!1,_s=!1,Ys=0,dx=0;function ke(){throw Error(F(321))}function so(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ft(e[n],t[n]))return!1;return!0}function lo(e,t,n,s,r,a){if(yn=a,se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Il.current=e===null||e.memoizedState===null?xx:hx,e=n(s,r),_s){a=0;do{if(_s=!1,Ys=0,25<=a)throw Error(F(301));a+=1,he=fe=null,t.updateQueue=null,Il.current=gx,e=n(s,r)}while(_s)}if(Il.current=dr,t=fe!==null&&fe.next!==null,yn=0,he=fe=se=null,ur=!1,t)throw Error(F(300));return e}function ro(){var e=Ys!==0;return Ys=0,e}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return he===null?se.memoizedState=he=e:he=he.next=e,he}function tt(){if(fe===null){var e=se.alternate;e=e!==null?e.memoizedState:null}else e=fe.next;var t=he===null?se.memoizedState:he.next;if(t!==null)he=t,fe=e;else{if(e===null)throw Error(F(310));fe=e,e={memoizedState:fe.memoizedState,baseState:fe.baseState,baseQueue:fe.baseQueue,queue:fe.queue,next:null},he===null?se.memoizedState=he=e:he=he.next=e}return he}function Qs(e,t){return typeof t=="function"?t(e):t}function da(e){var t=tt(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var s=fe,r=s.baseQueue,a=n.pending;if(a!==null){if(r!==null){var i=r.next;r.next=a.next,a.next=i}s.baseQueue=r=a,n.pending=null}if(r!==null){a=r.next,s=s.baseState;var o=i=null,c=null,u=a;do{var m=u.lane;if((yn&m)===m)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var f={lane:m,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(o=c=f,i=s):c=c.next=f,se.lanes|=m,jn|=m}u=u.next}while(u!==null&&u!==a);c===null?i=s:c.next=o,ft(s,t.memoizedState)||(De=!0),t.memoizedState=s,t.baseState=i,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){r=e;do a=r.lane,se.lanes|=a,jn|=a,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function fa(e){var t=tt(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,a=t.memoizedState;if(r!==null){n.pending=null;var i=r=r.next;do a=e(a,i.action),i=i.next;while(i!==r);ft(a,t.memoizedState)||(De=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function Gd(){}function Xd(e,t){var n=se,s=tt(),r=t(),a=!ft(s.memoizedState,r);if(a&&(s.memoizedState=r,De=!0),s=s.queue,ao(tf.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||he!==null&&he.memoizedState.tag&1){if(n.flags|=2048,qs(9,ef.bind(null,n,s,r,t),void 0,null),ve===null)throw Error(F(349));yn&30||Zd(n,t,r)}return r}function Zd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=se.updateQueue,t===null?(t={lastEffect:null,stores:null},se.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ef(e,t,n,s){t.value=n,t.getSnapshot=s,nf(t)&&sf(e)}function tf(e,t,n){return n(function(){nf(t)&&sf(e)})}function nf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ft(e,n)}catch{return!0}}function sf(e){var t=Tt(e,1);t!==null&&dt(t,e,1,-1)}function Lc(e){var t=ht();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qs,lastRenderedState:e},t.queue=e,e=e.dispatch=mx.bind(null,se,e),[t.memoizedState,e]}function qs(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=se.updateQueue,t===null?(t={lastEffect:null,stores:null},se.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function lf(){return tt().memoizedState}function $l(e,t,n,s){var r=ht();se.flags|=e,r.memoizedState=qs(1|t,n,void 0,s===void 0?null:s)}function Ar(e,t,n,s){var r=tt();s=s===void 0?null:s;var a=void 0;if(fe!==null){var i=fe.memoizedState;if(a=i.destroy,s!==null&&so(s,i.deps)){r.memoizedState=qs(t,n,a,s);return}}se.flags|=e,r.memoizedState=qs(1|t,n,a,s)}function Mc(e,t){return $l(8390656,8,e,t)}function ao(e,t){return Ar(2048,8,e,t)}function rf(e,t){return Ar(4,2,e,t)}function af(e,t){return Ar(4,4,e,t)}function of(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cf(e,t,n){return n=n!=null?n.concat([e]):null,Ar(4,4,of.bind(null,t,e),n)}function io(){}function uf(e,t){var n=tt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&so(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function df(e,t){var n=tt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&so(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function ff(e,t,n){return yn&21?(ft(n,t)||(n=hd(),se.lanes|=n,jn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,De=!0),e.memoizedState=n)}function fx(e,t){var n=q;q=n!==0&&4>n?n:4,e(!0);var s=ua.transition;ua.transition={};try{e(!1),t()}finally{q=n,ua.transition=s}}function pf(){return tt().memoizedState}function px(e,t,n){var s=Kt(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},mf(e))xf(t,n);else if(n=qd(e,t,n,s),n!==null){var r=Pe();dt(n,e,s,r),hf(n,t,s)}}function mx(e,t,n){var s=Kt(e),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(mf(e))xf(t,r);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,o=a(i,n);if(r.hasEagerState=!0,r.eagerState=o,ft(o,i)){var c=t.interleaved;c===null?(r.next=r,Xi(t)):(r.next=c.next,c.next=r),t.interleaved=r;return}}catch{}finally{}n=qd(e,t,r,s),n!==null&&(r=Pe(),dt(n,e,s,r),hf(n,t,s))}}function mf(e){var t=e.alternate;return e===se||t!==null&&t===se}function xf(e,t){_s=ur=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hf(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Di(e,n)}}var dr={readContext:et,useCallback:ke,useContext:ke,useEffect:ke,useImperativeHandle:ke,useInsertionEffect:ke,useLayoutEffect:ke,useMemo:ke,useReducer:ke,useRef:ke,useState:ke,useDebugValue:ke,useDeferredValue:ke,useTransition:ke,useMutableSource:ke,useSyncExternalStore:ke,useId:ke,unstable_isNewReconciler:!1},xx={readContext:et,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:et,useEffect:Mc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$l(4194308,4,of.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $l(4194308,4,e,t)},useInsertionEffect:function(e,t){return $l(4,2,e,t)},useMemo:function(e,t){var n=ht();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=ht();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=px.bind(null,se,e),[s.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:Lc,useDebugValue:io,useDeferredValue:function(e){return ht().memoizedState=e},useTransition:function(){var e=Lc(!1),t=e[0];return e=fx.bind(null,e[1]),ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=se,r=ht();if(ee){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),ve===null)throw Error(F(349));yn&30||Zd(s,t,n)}r.memoizedState=n;var a={value:n,getSnapshot:t};return r.queue=a,Mc(tf.bind(null,s,a,e),[e]),s.flags|=2048,qs(9,ef.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=ht(),t=ve.identifierPrefix;if(ee){var n=St,s=kt;n=(s&~(1<<32-ut(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ys++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=dx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hx={readContext:et,useCallback:uf,useContext:et,useEffect:ao,useImperativeHandle:cf,useInsertionEffect:rf,useLayoutEffect:af,useMemo:df,useReducer:da,useRef:lf,useState:function(){return da(Qs)},useDebugValue:io,useDeferredValue:function(e){var t=tt();return ff(t,fe.memoizedState,e)},useTransition:function(){var e=da(Qs)[0],t=tt().memoizedState;return[e,t]},useMutableSource:Gd,useSyncExternalStore:Xd,useId:pf,unstable_isNewReconciler:!1},gx={readContext:et,useCallback:uf,useContext:et,useEffect:ao,useImperativeHandle:cf,useInsertionEffect:rf,useLayoutEffect:af,useMemo:df,useReducer:fa,useRef:lf,useState:function(){return fa(Qs)},useDebugValue:io,useDeferredValue:function(e){var t=tt();return fe===null?t.memoizedState=e:ff(t,fe.memoizedState,e)},useTransition:function(){var e=fa(Qs)[0],t=tt().memoizedState;return[e,t]},useMutableSource:Gd,useSyncExternalStore:Xd,useId:pf,unstable_isNewReconciler:!1};function it(e,t){if(e&&e.defaultProps){t=re({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ei(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:re({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Lr={isMounted:function(e){return(e=e._reactInternals)?Sn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Pe(),r=Kt(e),a=Ct(s,r);a.payload=t,n!=null&&(a.callback=n),t=qt(e,a,r),t!==null&&(dt(t,e,r,s),Dl(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Pe(),r=Kt(e),a=Ct(s,r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=qt(e,a,r),t!==null&&(dt(t,e,r,s),Dl(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pe(),s=Kt(e),r=Ct(n,s);r.tag=2,t!=null&&(r.callback=t),t=qt(e,r,s),t!==null&&(dt(t,e,s,n),Dl(t,e,s))}};function Fc(e,t,n,s,r,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,i):t.prototype&&t.prototype.isPureReactComponent?!$s(n,s)||!$s(r,a):!0}function gf(e,t,n){var s=!1,r=tn,a=t.contextType;return typeof a=="object"&&a!==null?a=et(a):(r=Ue(t)?gn:Ee.current,s=t.contextTypes,a=(s=s!=null)?Gn(e,r):tn),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Lr,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=a),t}function Oc(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Lr.enqueueReplaceState(t,t.state,null)}function ti(e,t,n,s){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Zi(e);var a=t.contextType;typeof a=="object"&&a!==null?r.context=et(a):(a=Ue(t)?gn:Ee.current,r.context=Gn(e,a)),r.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(ei(e,t,a,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&Lr.enqueueReplaceState(r,r.state,null),or(e,n,r,s),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function ts(e,t){try{var n="",s=t;do n+=Wm(s),s=s.return;while(s);var r=n}catch(a){r=`
|
|
39
|
+
Error generating stack: `+a.message+`
|
|
40
|
+
`+a.stack}return{value:e,source:t,stack:r,digest:null}}function pa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ni(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var vx=typeof WeakMap=="function"?WeakMap:Map;function vf(e,t,n){n=Ct(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){pr||(pr=!0,fi=s),ni(e,t)},n}function yf(e,t,n){n=Ct(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var r=t.value;n.payload=function(){return s(r)},n.callback=function(){ni(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){ni(e,t),typeof s!="function"&&(Jt===null?Jt=new Set([this]):Jt.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function zc(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new vx;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(r.add(n),e=Ax.bind(null,e,t,n),t.then(e,e))}function Dc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ic(e,t,n,s,r){return e.mode&1?(e.flags|=65536,e.lanes=r,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ct(-1,1),t.tag=2,qt(n,t,1))),n.lanes|=1),e)}var yx=Mt.ReactCurrentOwner,De=!1;function Re(e,t,n,s){t.child=e===null?Qd(t,null,n,s):Zn(t,e.child,n,s)}function $c(e,t,n,s,r){n=n.render;var a=t.ref;return qn(t,r),s=lo(e,t,n,s,a,r),n=ro(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Pt(e,t,r)):(ee&&n&&Yi(t),t.flags|=1,Re(e,t,s,r),t.child)}function Uc(e,t,n,s,r){if(e===null){var a=n.type;return typeof a=="function"&&!ho(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,jf(e,t,a,s,r)):(e=Vl(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&r)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:$s,n(i,s)&&e.ref===t.ref)return Pt(e,t,r)}return t.flags|=1,e=Gt(a,s),e.ref=t.ref,e.return=t,t.child=e}function jf(e,t,n,s,r){if(e!==null){var a=e.memoizedProps;if($s(a,s)&&e.ref===t.ref)if(De=!1,t.pendingProps=s=a,(e.lanes&r)!==0)e.flags&131072&&(De=!0);else return t.lanes=e.lanes,Pt(e,t,r)}return si(e,t,n,s,r)}function Nf(e,t,n){var s=t.pendingProps,r=s.children,a=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},J(Un,Ve),Ve|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,J(Un,Ve),Ve|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,J(Un,Ve),Ve|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,J(Un,Ve),Ve|=s;return Re(e,t,r,n),t.child}function wf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function si(e,t,n,s,r){var a=Ue(n)?gn:Ee.current;return a=Gn(t,a),qn(t,r),n=lo(e,t,n,s,a,r),s=ro(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Pt(e,t,r)):(ee&&s&&Yi(t),t.flags|=1,Re(e,t,n,r),t.child)}function Bc(e,t,n,s,r){if(Ue(n)){var a=!0;sr(t)}else a=!1;if(qn(t,r),t.stateNode===null)Ul(e,t),gf(t,n,s),ti(t,n,s,r),s=!0;else if(e===null){var i=t.stateNode,o=t.memoizedProps;i.props=o;var c=i.context,u=n.contextType;typeof u=="object"&&u!==null?u=et(u):(u=Ue(n)?gn:Ee.current,u=Gn(t,u));var m=n.getDerivedStateFromProps,f=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==s||c!==u)&&Oc(t,i,s,u),It=!1;var g=t.memoizedState;i.state=g,or(t,s,i,r),c=t.memoizedState,o!==s||g!==c||$e.current||It?(typeof m=="function"&&(ei(t,n,m,s),c=t.memoizedState),(o=It||Fc(t,n,o,s,g,c,u))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),i.props=s,i.state=c,i.context=u,s=o):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{i=t.stateNode,Jd(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:it(t.type,o),i.props=u,f=t.pendingProps,g=i.context,c=n.contextType,typeof c=="object"&&c!==null?c=et(c):(c=Ue(n)?gn:Ee.current,c=Gn(t,c));var y=n.getDerivedStateFromProps;(m=typeof y=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==f||g!==c)&&Oc(t,i,s,c),It=!1,g=t.memoizedState,i.state=g,or(t,s,i,r);var j=t.memoizedState;o!==f||g!==j||$e.current||It?(typeof y=="function"&&(ei(t,n,y,s),j=t.memoizedState),(u=It||Fc(t,n,u,s,g,j,c)||!1)?(m||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(s,j,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(s,j,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=j),i.props=s,i.state=j,i.context=c,s=u):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),s=!1)}return li(e,t,n,s,a,r)}function li(e,t,n,s,r,a){wf(e,t);var i=(t.flags&128)!==0;if(!s&&!i)return r&&Ec(t,n,!1),Pt(e,t,a);s=t.stateNode,yx.current=t;var o=i&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&i?(t.child=Zn(t,e.child,null,a),t.child=Zn(t,null,o,a)):Re(e,t,o,a),t.memoizedState=s.state,r&&Ec(t,n,!0),t.child}function bf(e){var t=e.stateNode;t.pendingContext?Cc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Cc(e,t.context,!1),eo(e,t.containerInfo)}function Hc(e,t,n,s,r){return Xn(),qi(r),t.flags|=256,Re(e,t,n,s),t.child}var ri={dehydrated:null,treeContext:null,retryLane:0};function ai(e){return{baseLanes:e,cachePool:null,transitions:null}}function kf(e,t,n){var s=t.pendingProps,r=ne.current,a=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(r&2)!==0),o?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),J(ne,r&1),e===null)return Xa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=s.children,e=s.fallback,a?(s=t.mode,a=t.child,i={mode:"hidden",children:i},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=i):a=Or(i,s,0,null),e=xn(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ai(n),t.memoizedState=ri,e):oo(t,i));if(r=e.memoizedState,r!==null&&(o=r.dehydrated,o!==null))return jx(e,t,i,s,o,r,n);if(a){a=s.fallback,i=t.mode,r=e.child,o=r.sibling;var c={mode:"hidden",children:s.children};return!(i&1)&&t.child!==r?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Gt(r,c),s.subtreeFlags=r.subtreeFlags&14680064),o!==null?a=Gt(o,a):(a=xn(a,i,n,null),a.flags|=2),a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,i=e.child.memoizedState,i=i===null?ai(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},a.memoizedState=i,a.childLanes=e.childLanes&~n,t.memoizedState=ri,s}return a=e.child,e=a.sibling,s=Gt(a,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function oo(e,t){return t=Or({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function El(e,t,n,s){return s!==null&&qi(s),Zn(t,e.child,null,n),e=oo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jx(e,t,n,s,r,a,i){if(n)return t.flags&256?(t.flags&=-257,s=pa(Error(F(422))),El(e,t,i,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,r=t.mode,s=Or({mode:"visible",children:s.children},r,0,null),a=xn(a,r,i,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&Zn(t,e.child,null,i),t.child.memoizedState=ai(i),t.memoizedState=ri,a);if(!(t.mode&1))return El(e,t,i,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var o=s.dgst;return s=o,a=Error(F(419)),s=pa(a,s,void 0),El(e,t,i,s)}if(o=(i&e.childLanes)!==0,De||o){if(s=ve,s!==null){switch(i&-i){case 4:r=2;break;case 16:r=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(s.suspendedLanes|i)?0:r,r!==0&&r!==a.retryLane&&(a.retryLane=r,Tt(e,r),dt(s,e,r,-1))}return xo(),s=pa(Error(F(421))),El(e,t,i,s)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=Lx.bind(null,e),r._reactRetry=t,null):(e=a.treeContext,We=Qt(r.nextSibling),Ye=t,ee=!0,ct=null,e!==null&&(Ke[Ge++]=kt,Ke[Ge++]=St,Ke[Ge++]=vn,kt=e.id,St=e.overflow,vn=t),t=oo(t,s.children),t.flags|=4096,t)}function Vc(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Za(e.return,t,n)}function ma(e,t,n,s,r){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=r)}function Sf(e,t,n){var s=t.pendingProps,r=s.revealOrder,a=s.tail;if(Re(e,t,s.children,n),s=ne.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Vc(e,n,t);else if(e.tag===19)Vc(e,n,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}s&=1}if(J(ne,s),!(t.mode&1))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&cr(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),ma(t,!1,r,n,a);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&cr(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}ma(t,!0,n,null,a);break;case"together":ma(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ul(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),jn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,n=Gt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nx(e,t,n){switch(t.tag){case 3:bf(t),Xn();break;case 5:Kd(t);break;case 1:Ue(t.type)&&sr(t);break;case 4:eo(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,r=t.memoizedProps.value;J(ar,s._currentValue),s._currentValue=r;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(J(ne,ne.current&1),t.flags|=128,null):n&t.child.childLanes?kf(e,t,n):(J(ne,ne.current&1),e=Pt(e,t,n),e!==null?e.sibling:null);J(ne,ne.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Sf(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),J(ne,ne.current),s)break;return null;case 22:case 23:return t.lanes=0,Nf(e,t,n)}return Pt(e,t,n)}var Cf,ii,Ef,_f;Cf=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ii=function(){};Ef=function(e,t,n,s){var r=e.memoizedProps;if(r!==s){e=t.stateNode,pn(yt.current);var a=null;switch(n){case"input":r=Ra(e,r),s=Ra(e,s),a=[];break;case"select":r=re({},r,{value:void 0}),s=re({},s,{value:void 0}),a=[];break;case"textarea":r=Aa(e,r),s=Aa(e,s),a=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=tr)}Ma(n,s);var i;n=null;for(u in r)if(!s.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var o=r[u];for(i in o)o.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ls.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(o=r!=null?r[u]:void 0,s.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(i in o)!o.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in c)c.hasOwnProperty(i)&&o[i]!==c[i]&&(n||(n={}),n[i]=c[i])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ls.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&K("scroll",e),a||o===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};_f=function(e,t,n,s){n!==s&&(t.flags|=4)};function xs(e,t){if(!ee)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Se(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&14680064,s|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function wx(e,t,n){var s=t.pendingProps;switch(Qi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Se(t),null;case 1:return Ue(t.type)&&nr(),Se(t),null;case 3:return s=t.stateNode,es(),G($e),G(Ee),no(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Sl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ct!==null&&(xi(ct),ct=null))),ii(e,t),Se(t),null;case 5:to(t);var r=pn(Ws.current);if(n=t.type,e!==null&&t.stateNode!=null)Ef(e,t,n,s,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(F(166));return Se(t),null}if(e=pn(yt.current),Sl(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[gt]=t,s[Hs]=a,e=(t.mode&1)!==0,n){case"dialog":K("cancel",s),K("close",s);break;case"iframe":case"object":case"embed":K("load",s);break;case"video":case"audio":for(r=0;r<Ns.length;r++)K(Ns[r],s);break;case"source":K("error",s);break;case"img":case"image":case"link":K("error",s),K("load",s);break;case"details":K("toggle",s);break;case"input":Zo(s,a),K("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},K("invalid",s);break;case"textarea":tc(s,a),K("invalid",s)}Ma(n,a),r=null;for(var i in a)if(a.hasOwnProperty(i)){var o=a[i];i==="children"?typeof o=="string"?s.textContent!==o&&(a.suppressHydrationWarning!==!0&&kl(s.textContent,o,e),r=["children",o]):typeof o=="number"&&s.textContent!==""+o&&(a.suppressHydrationWarning!==!0&&kl(s.textContent,o,e),r=["children",""+o]):Ls.hasOwnProperty(i)&&o!=null&&i==="onScroll"&&K("scroll",s)}switch(n){case"input":hl(s),ec(s,a,!0);break;case"textarea":hl(s),nc(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=tr)}s=r,t.updateQueue=s,s!==null&&(t.flags|=4)}else{i=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=td(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=i.createElement(n,{is:s.is}):(e=i.createElement(n),n==="select"&&(i=e,s.multiple?i.multiple=!0:s.size&&(i.size=s.size))):e=i.createElementNS(e,n),e[gt]=t,e[Hs]=s,Cf(e,t,!1,!1),t.stateNode=e;e:{switch(i=Fa(n,s),n){case"dialog":K("cancel",e),K("close",e),r=s;break;case"iframe":case"object":case"embed":K("load",e),r=s;break;case"video":case"audio":for(r=0;r<Ns.length;r++)K(Ns[r],e);r=s;break;case"source":K("error",e),r=s;break;case"img":case"image":case"link":K("error",e),K("load",e),r=s;break;case"details":K("toggle",e),r=s;break;case"input":Zo(e,s),r=Ra(e,s),K("invalid",e);break;case"option":r=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},r=re({},s,{value:void 0}),K("invalid",e);break;case"textarea":tc(e,s),r=Aa(e,s),K("invalid",e);break;default:r=s}Ma(n,r),o=r;for(a in o)if(o.hasOwnProperty(a)){var c=o[a];a==="style"?ld(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&nd(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ms(e,c):typeof c=="number"&&Ms(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Ls.hasOwnProperty(a)?c!=null&&a==="onScroll"&&K("scroll",e):c!=null&&Ai(e,a,c,i))}switch(n){case"input":hl(e),ec(e,s,!1);break;case"textarea":hl(e),nc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+en(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?Vn(e,!!s.multiple,a,!1):s.defaultValue!=null&&Vn(e,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=tr)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Se(t),null;case 6:if(e&&t.stateNode!=null)_f(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(F(166));if(n=pn(Ws.current),pn(yt.current),Sl(t)){if(s=t.stateNode,n=t.memoizedProps,s[gt]=t,(a=s.nodeValue!==n)&&(e=Ye,e!==null))switch(e.tag){case 3:kl(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&kl(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[gt]=t,t.stateNode=s}return Se(t),null;case 13:if(G(ne),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ee&&We!==null&&t.mode&1&&!(t.flags&128))Wd(),Xn(),t.flags|=98560,a=!1;else if(a=Sl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(F(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(F(317));a[gt]=t}else Xn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Se(t),a=!1}else ct!==null&&(xi(ct),ct=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||ne.current&1?xe===0&&(xe=3):xo())),t.updateQueue!==null&&(t.flags|=4),Se(t),null);case 4:return es(),ii(e,t),e===null&&Us(t.stateNode.containerInfo),Se(t),null;case 10:return Gi(t.type._context),Se(t),null;case 17:return Ue(t.type)&&nr(),Se(t),null;case 19:if(G(ne),a=t.memoizedState,a===null)return Se(t),null;if(s=(t.flags&128)!==0,i=a.rendering,i===null)if(s)xs(a,!1);else{if(xe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=cr(e),i!==null){for(t.flags|=128,xs(a,!1),s=i.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)a=n,e=s,a.flags&=14680066,i=a.alternate,i===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,a.type=i.type,e=i.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return J(ne,ne.current&1|2),t.child}e=e.sibling}a.tail!==null&&oe()>ns&&(t.flags|=128,s=!0,xs(a,!1),t.lanes=4194304)}else{if(!s)if(e=cr(i),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),xs(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!ee)return Se(t),null}else 2*oe()-a.renderingStartTime>ns&&n!==1073741824&&(t.flags|=128,s=!0,xs(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(n=a.last,n!==null?n.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=oe(),t.sibling=null,n=ne.current,J(ne,s?n&1|2:n&1),t):(Se(t),null);case 22:case 23:return mo(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Ve&1073741824&&(Se(t),t.subtreeFlags&6&&(t.flags|=8192)):Se(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function bx(e,t){switch(Qi(t),t.tag){case 1:return Ue(t.type)&&nr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return es(),G($e),G(Ee),no(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return to(t),null;case 13:if(G(ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));Xn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(ne),null;case 4:return es(),null;case 10:return Gi(t.type._context),null;case 22:case 23:return mo(),null;case 24:return null;default:return null}}var _l=!1,Ce=!1,kx=typeof WeakSet=="function"?WeakSet:Set,I=null;function $n(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){ie(e,t,s)}else n.current=null}function oi(e,t,n){try{n()}catch(s){ie(e,t,s)}}var Wc=!1;function Sx(e,t){if(Wa=Xl,e=Ad(),Wi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var i=0,o=-1,c=-1,u=0,m=0,f=e,g=null;t:for(;;){for(var y;f!==n||r!==0&&f.nodeType!==3||(o=i+r),f!==a||s!==0&&f.nodeType!==3||(c=i+s),f.nodeType===3&&(i+=f.nodeValue.length),(y=f.firstChild)!==null;)g=f,f=y;for(;;){if(f===e)break t;if(g===n&&++u===r&&(o=i),g===a&&++m===s&&(c=i),(y=f.nextSibling)!==null)break;f=g,g=f.parentNode}f=y}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ya={focusedElem:e,selectionRange:n},Xl=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var j=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(j!==null){var v=j.memoizedProps,N=j.memoizedState,p=t.stateNode,d=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:it(t.type,v),N);p.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(k){ie(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return j=Wc,Wc=!1,j}function Rs(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var r=s=s.next;do{if((r.tag&e)===e){var a=r.destroy;r.destroy=void 0,a!==void 0&&oi(t,n,a)}r=r.next}while(r!==s)}}function Mr(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function ci(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Rf(e){var t=e.alternate;t!==null&&(e.alternate=null,Rf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[gt],delete t[Hs],delete t[Ja],delete t[ix],delete t[ox])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Tf(e){return e.tag===5||e.tag===3||e.tag===4}function Yc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tf(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.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 ui(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tr));else if(s!==4&&(e=e.child,e!==null))for(ui(e,t,n),e=e.sibling;e!==null;)ui(e,t,n),e=e.sibling}function di(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(di(e,t,n),e=e.sibling;e!==null;)di(e,t,n),e=e.sibling}var ye=null,ot=!1;function zt(e,t,n){for(n=n.child;n!==null;)Pf(e,t,n),n=n.sibling}function Pf(e,t,n){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(Cr,n)}catch{}switch(n.tag){case 5:Ce||$n(n,t);case 6:var s=ye,r=ot;ye=null,zt(e,t,n),ye=s,ot=r,ye!==null&&(ot?(e=ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ye.removeChild(n.stateNode));break;case 18:ye!==null&&(ot?(e=ye,n=n.stateNode,e.nodeType===8?ia(e.parentNode,n):e.nodeType===1&&ia(e,n),Ds(e)):ia(ye,n.stateNode));break;case 4:s=ye,r=ot,ye=n.stateNode.containerInfo,ot=!0,zt(e,t,n),ye=s,ot=r;break;case 0:case 11:case 14:case 15:if(!Ce&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){r=s=s.next;do{var a=r,i=a.destroy;a=a.tag,i!==void 0&&(a&2||a&4)&&oi(n,t,i),r=r.next}while(r!==s)}zt(e,t,n);break;case 1:if(!Ce&&($n(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(o){ie(n,t,o)}zt(e,t,n);break;case 21:zt(e,t,n);break;case 22:n.mode&1?(Ce=(s=Ce)||n.memoizedState!==null,zt(e,t,n),Ce=s):zt(e,t,n);break;default:zt(e,t,n)}}function Qc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new kx),t.forEach(function(s){var r=Mx.bind(null,e,s);n.has(s)||(n.add(s),s.then(r,r))})}}function at(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];try{var a=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 5:ye=o.stateNode,ot=!1;break e;case 3:ye=o.stateNode.containerInfo,ot=!0;break e;case 4:ye=o.stateNode.containerInfo,ot=!0;break e}o=o.return}if(ye===null)throw Error(F(160));Pf(a,i,r),ye=null,ot=!1;var c=r.alternate;c!==null&&(c.return=null),r.return=null}catch(u){ie(r,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Af(t,e),t=t.sibling}function Af(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(at(t,e),mt(e),s&4){try{Rs(3,e,e.return),Mr(3,e)}catch(v){ie(e,e.return,v)}try{Rs(5,e,e.return)}catch(v){ie(e,e.return,v)}}break;case 1:at(t,e),mt(e),s&512&&n!==null&&$n(n,n.return);break;case 5:if(at(t,e),mt(e),s&512&&n!==null&&$n(n,n.return),e.flags&32){var r=e.stateNode;try{Ms(r,"")}catch(v){ie(e,e.return,v)}}if(s&4&&(r=e.stateNode,r!=null)){var a=e.memoizedProps,i=n!==null?n.memoizedProps:a,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&a.type==="radio"&&a.name!=null&&Zu(r,a),Fa(o,i);var u=Fa(o,a);for(i=0;i<c.length;i+=2){var m=c[i],f=c[i+1];m==="style"?ld(r,f):m==="dangerouslySetInnerHTML"?nd(r,f):m==="children"?Ms(r,f):Ai(r,m,f,u)}switch(o){case"input":Ta(r,a);break;case"textarea":ed(r,a);break;case"select":var g=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!a.multiple;var y=a.value;y!=null?Vn(r,!!a.multiple,y,!1):g!==!!a.multiple&&(a.defaultValue!=null?Vn(r,!!a.multiple,a.defaultValue,!0):Vn(r,!!a.multiple,a.multiple?[]:"",!1))}r[Hs]=a}catch(v){ie(e,e.return,v)}}break;case 6:if(at(t,e),mt(e),s&4){if(e.stateNode===null)throw Error(F(162));r=e.stateNode,a=e.memoizedProps;try{r.nodeValue=a}catch(v){ie(e,e.return,v)}}break;case 3:if(at(t,e),mt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Ds(t.containerInfo)}catch(v){ie(e,e.return,v)}break;case 4:at(t,e),mt(e);break;case 13:at(t,e),mt(e),r=e.child,r.flags&8192&&(a=r.memoizedState!==null,r.stateNode.isHidden=a,!a||r.alternate!==null&&r.alternate.memoizedState!==null||(fo=oe())),s&4&&Qc(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?(Ce=(u=Ce)||m,at(t,e),Ce=u):at(t,e),mt(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!m&&e.mode&1)for(I=e,m=e.child;m!==null;){for(f=I=m;I!==null;){switch(g=I,y=g.child,g.tag){case 0:case 11:case 14:case 15:Rs(4,g,g.return);break;case 1:$n(g,g.return);var j=g.stateNode;if(typeof j.componentWillUnmount=="function"){s=g,n=g.return;try{t=s,j.props=t.memoizedProps,j.state=t.memoizedState,j.componentWillUnmount()}catch(v){ie(s,n,v)}}break;case 5:$n(g,g.return);break;case 22:if(g.memoizedState!==null){Jc(f);continue}}y!==null?(y.return=g,I=y):Jc(f)}m=m.sibling}e:for(m=null,f=e;;){if(f.tag===5){if(m===null){m=f;try{r=f.stateNode,u?(a=r.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(o=f.stateNode,c=f.memoizedProps.style,i=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=sd("display",i))}catch(v){ie(e,e.return,v)}}}else if(f.tag===6){if(m===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){ie(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;m===f&&(m=null),f=f.return}m===f&&(m=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:at(t,e),mt(e),s&4&&Qc(e);break;case 21:break;default:at(t,e),mt(e)}}function mt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Tf(n)){var s=n;break e}n=n.return}throw Error(F(160))}switch(s.tag){case 5:var r=s.stateNode;s.flags&32&&(Ms(r,""),s.flags&=-33);var a=Yc(e);di(e,a,r);break;case 3:case 4:var i=s.stateNode.containerInfo,o=Yc(e);ui(e,o,i);break;default:throw Error(F(161))}}catch(c){ie(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cx(e,t,n){I=e,Lf(e)}function Lf(e,t,n){for(var s=(e.mode&1)!==0;I!==null;){var r=I,a=r.child;if(r.tag===22&&s){var i=r.memoizedState!==null||_l;if(!i){var o=r.alternate,c=o!==null&&o.memoizedState!==null||Ce;o=_l;var u=Ce;if(_l=i,(Ce=c)&&!u)for(I=r;I!==null;)i=I,c=i.child,i.tag===22&&i.memoizedState!==null?Kc(r):c!==null?(c.return=i,I=c):Kc(r);for(;a!==null;)I=a,Lf(a),a=a.sibling;I=r,_l=o,Ce=u}qc(e)}else r.subtreeFlags&8772&&a!==null?(a.return=r,I=a):qc(e)}}function qc(e){for(;I!==null;){var t=I;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ce||Mr(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!Ce)if(n===null)s.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:it(t.type,n.memoizedProps);s.componentDidUpdate(r,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Ac(t,a,s);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ac(t,i,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var m=u.memoizedState;if(m!==null){var f=m.dehydrated;f!==null&&Ds(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}Ce||t.flags&512&&ci(t)}catch(g){ie(t,t.return,g)}}if(t===e){I=null;break}if(n=t.sibling,n!==null){n.return=t.return,I=n;break}I=t.return}}function Jc(e){for(;I!==null;){var t=I;if(t===e){I=null;break}var n=t.sibling;if(n!==null){n.return=t.return,I=n;break}I=t.return}}function Kc(e){for(;I!==null;){var t=I;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Mr(4,t)}catch(c){ie(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var r=t.return;try{s.componentDidMount()}catch(c){ie(t,r,c)}}var a=t.return;try{ci(t)}catch(c){ie(t,a,c)}break;case 5:var i=t.return;try{ci(t)}catch(c){ie(t,i,c)}}}catch(c){ie(t,t.return,c)}if(t===e){I=null;break}var o=t.sibling;if(o!==null){o.return=t.return,I=o;break}I=t.return}}var Ex=Math.ceil,fr=Mt.ReactCurrentDispatcher,co=Mt.ReactCurrentOwner,Ze=Mt.ReactCurrentBatchConfig,Q=0,ve=null,ce=null,je=0,Ve=0,Un=an(0),xe=0,Js=null,jn=0,Fr=0,uo=0,Ts=null,ze=null,fo=0,ns=1/0,wt=null,pr=!1,fi=null,Jt=null,Rl=!1,Ht=null,mr=0,Ps=0,pi=null,Bl=-1,Hl=0;function Pe(){return Q&6?oe():Bl!==-1?Bl:Bl=oe()}function Kt(e){return e.mode&1?Q&2&&je!==0?je&-je:ux.transition!==null?(Hl===0&&(Hl=hd()),Hl):(e=q,e!==0||(e=window.event,e=e===void 0?16:bd(e.type)),e):1}function dt(e,t,n,s){if(50<Ps)throw Ps=0,pi=null,Error(F(185));rl(e,n,s),(!(Q&2)||e!==ve)&&(e===ve&&(!(Q&2)&&(Fr|=n),xe===4&&Ut(e,je)),Be(e,s),n===1&&Q===0&&!(t.mode&1)&&(ns=oe()+500,Pr&&on()))}function Be(e,t){var n=e.callbackNode;u0(e,t);var s=Gl(e,e===ve?je:0);if(s===0)n!==null&&rc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&rc(n),t===1)e.tag===0?cx(Gc.bind(null,e)):Bd(Gc.bind(null,e)),rx(function(){!(Q&6)&&on()}),n=null;else{switch(gd(s)){case 1:n=zi;break;case 4:n=md;break;case 16:n=Kl;break;case 536870912:n=xd;break;default:n=Kl}n=Uf(n,Mf.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Mf(e,t){if(Bl=-1,Hl=0,Q&6)throw Error(F(327));var n=e.callbackNode;if(Jn()&&e.callbackNode!==n)return null;var s=Gl(e,e===ve?je:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=xr(e,s);else{t=s;var r=Q;Q|=2;var a=Of();(ve!==e||je!==t)&&(wt=null,ns=oe()+500,mn(e,t));do try{Tx();break}catch(o){Ff(e,o)}while(!0);Ki(),fr.current=a,Q=r,ce!==null?t=0:(ve=null,je=0,t=xe)}if(t!==0){if(t===2&&(r=$a(e),r!==0&&(s=r,t=mi(e,r))),t===1)throw n=Js,mn(e,0),Ut(e,s),Be(e,oe()),n;if(t===6)Ut(e,s);else{if(r=e.current.alternate,!(s&30)&&!_x(r)&&(t=xr(e,s),t===2&&(a=$a(e),a!==0&&(s=a,t=mi(e,a))),t===1))throw n=Js,mn(e,0),Ut(e,s),Be(e,oe()),n;switch(e.finishedWork=r,e.finishedLanes=s,t){case 0:case 1:throw Error(F(345));case 2:un(e,ze,wt);break;case 3:if(Ut(e,s),(s&130023424)===s&&(t=fo+500-oe(),10<t)){if(Gl(e,0)!==0)break;if(r=e.suspendedLanes,(r&s)!==s){Pe(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=qa(un.bind(null,e,ze,wt),t);break}un(e,ze,wt);break;case 4:if(Ut(e,s),(s&4194240)===s)break;for(t=e.eventTimes,r=-1;0<s;){var i=31-ut(s);a=1<<i,i=t[i],i>r&&(r=i),s&=~a}if(s=r,s=oe()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Ex(s/1960))-s,10<s){e.timeoutHandle=qa(un.bind(null,e,ze,wt),s);break}un(e,ze,wt);break;case 5:un(e,ze,wt);break;default:throw Error(F(329))}}}return Be(e,oe()),e.callbackNode===n?Mf.bind(null,e):null}function mi(e,t){var n=Ts;return e.current.memoizedState.isDehydrated&&(mn(e,t).flags|=256),e=xr(e,t),e!==2&&(t=ze,ze=n,t!==null&&xi(t)),e}function xi(e){ze===null?ze=e:ze.push.apply(ze,e)}function _x(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var r=n[s],a=r.getSnapshot;r=r.value;try{if(!ft(a(),r))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ut(e,t){for(t&=~uo,t&=~Fr,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ut(t),s=1<<n;e[n]=-1,t&=~s}}function Gc(e){if(Q&6)throw Error(F(327));Jn();var t=Gl(e,0);if(!(t&1))return Be(e,oe()),null;var n=xr(e,t);if(e.tag!==0&&n===2){var s=$a(e);s!==0&&(t=s,n=mi(e,s))}if(n===1)throw n=Js,mn(e,0),Ut(e,t),Be(e,oe()),n;if(n===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,un(e,ze,wt),Be(e,oe()),null}function po(e,t){var n=Q;Q|=1;try{return e(t)}finally{Q=n,Q===0&&(ns=oe()+500,Pr&&on())}}function Nn(e){Ht!==null&&Ht.tag===0&&!(Q&6)&&Jn();var t=Q;Q|=1;var n=Ze.transition,s=q;try{if(Ze.transition=null,q=1,e)return e()}finally{q=s,Ze.transition=n,Q=t,!(Q&6)&&on()}}function mo(){Ve=Un.current,G(Un)}function mn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,lx(n)),ce!==null)for(n=ce.return;n!==null;){var s=n;switch(Qi(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&nr();break;case 3:es(),G($e),G(Ee),no();break;case 5:to(s);break;case 4:es();break;case 13:G(ne);break;case 19:G(ne);break;case 10:Gi(s.type._context);break;case 22:case 23:mo()}n=n.return}if(ve=e,ce=e=Gt(e.current,null),je=Ve=t,xe=0,Js=null,uo=Fr=jn=0,ze=Ts=null,fn!==null){for(t=0;t<fn.length;t++)if(n=fn[t],s=n.interleaved,s!==null){n.interleaved=null;var r=s.next,a=n.pending;if(a!==null){var i=a.next;a.next=r,s.next=i}n.pending=s}fn=null}return e}function Ff(e,t){do{var n=ce;try{if(Ki(),Il.current=dr,ur){for(var s=se.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}ur=!1}if(yn=0,he=fe=se=null,_s=!1,Ys=0,co.current=null,n===null||n.return===null){xe=1,Js=t,ce=null;break}e:{var a=e,i=n.return,o=n,c=t;if(t=je,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,m=o,f=m.tag;if(!(m.mode&1)&&(f===0||f===11||f===15)){var g=m.alternate;g?(m.updateQueue=g.updateQueue,m.memoizedState=g.memoizedState,m.lanes=g.lanes):(m.updateQueue=null,m.memoizedState=null)}var y=Dc(i);if(y!==null){y.flags&=-257,Ic(y,i,o,a,t),y.mode&1&&zc(a,u,t),t=y,c=u;var j=t.updateQueue;if(j===null){var v=new Set;v.add(c),t.updateQueue=v}else j.add(c);break e}else{if(!(t&1)){zc(a,u,t),xo();break e}c=Error(F(426))}}else if(ee&&o.mode&1){var N=Dc(i);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Ic(N,i,o,a,t),qi(ts(c,o));break e}}a=c=ts(c,o),xe!==4&&(xe=2),Ts===null?Ts=[a]:Ts.push(a),a=i;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var p=vf(a,c,t);Pc(a,p);break e;case 1:o=c;var d=a.type,h=a.stateNode;if(!(a.flags&128)&&(typeof d.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Jt===null||!Jt.has(h)))){a.flags|=65536,t&=-t,a.lanes|=t;var k=yf(a,o,t);Pc(a,k);break e}}a=a.return}while(a!==null)}Df(n)}catch(w){t=w,ce===n&&n!==null&&(ce=n=n.return);continue}break}while(!0)}function Of(){var e=fr.current;return fr.current=dr,e===null?dr:e}function xo(){(xe===0||xe===3||xe===2)&&(xe=4),ve===null||!(jn&268435455)&&!(Fr&268435455)||Ut(ve,je)}function xr(e,t){var n=Q;Q|=2;var s=Of();(ve!==e||je!==t)&&(wt=null,mn(e,t));do try{Rx();break}catch(r){Ff(e,r)}while(!0);if(Ki(),Q=n,fr.current=s,ce!==null)throw Error(F(261));return ve=null,je=0,xe}function Rx(){for(;ce!==null;)zf(ce)}function Tx(){for(;ce!==null&&!t0();)zf(ce)}function zf(e){var t=$f(e.alternate,e,Ve);e.memoizedProps=e.pendingProps,t===null?Df(e):ce=t,co.current=null}function Df(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=bx(n,t),n!==null){n.flags&=32767,ce=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{xe=6,ce=null;return}}else if(n=wx(n,t,Ve),n!==null){ce=n;return}if(t=t.sibling,t!==null){ce=t;return}ce=t=e}while(t!==null);xe===0&&(xe=5)}function un(e,t,n){var s=q,r=Ze.transition;try{Ze.transition=null,q=1,Px(e,t,n,s)}finally{Ze.transition=r,q=s}return null}function Px(e,t,n,s){do Jn();while(Ht!==null);if(Q&6)throw Error(F(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(F(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(d0(e,a),e===ve&&(ce=ve=null,je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Rl||(Rl=!0,Uf(Kl,function(){return Jn(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Ze.transition,Ze.transition=null;var i=q;q=1;var o=Q;Q|=4,co.current=null,Sx(e,n),Af(n,e),G0(Ya),Xl=!!Wa,Ya=Wa=null,e.current=n,Cx(n),n0(),Q=o,q=i,Ze.transition=a}else e.current=n;if(Rl&&(Rl=!1,Ht=e,mr=r),a=e.pendingLanes,a===0&&(Jt=null),r0(n.stateNode),Be(e,oe()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],s(r.value,{componentStack:r.stack,digest:r.digest});if(pr)throw pr=!1,e=fi,fi=null,e;return mr&1&&e.tag!==0&&Jn(),a=e.pendingLanes,a&1?e===pi?Ps++:(Ps=0,pi=e):Ps=0,on(),null}function Jn(){if(Ht!==null){var e=gd(mr),t=Ze.transition,n=q;try{if(Ze.transition=null,q=16>e?16:e,Ht===null)var s=!1;else{if(e=Ht,Ht=null,mr=0,Q&6)throw Error(F(331));var r=Q;for(Q|=4,I=e.current;I!==null;){var a=I,i=a.child;if(I.flags&16){var o=a.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(I=u;I!==null;){var m=I;switch(m.tag){case 0:case 11:case 15:Rs(8,m,a)}var f=m.child;if(f!==null)f.return=m,I=f;else for(;I!==null;){m=I;var g=m.sibling,y=m.return;if(Rf(m),m===u){I=null;break}if(g!==null){g.return=y,I=g;break}I=y}}}var j=a.alternate;if(j!==null){var v=j.child;if(v!==null){j.child=null;do{var N=v.sibling;v.sibling=null,v=N}while(v!==null)}}I=a}}if(a.subtreeFlags&2064&&i!==null)i.return=a,I=i;else e:for(;I!==null;){if(a=I,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Rs(9,a,a.return)}var p=a.sibling;if(p!==null){p.return=a.return,I=p;break e}I=a.return}}var d=e.current;for(I=d;I!==null;){i=I;var h=i.child;if(i.subtreeFlags&2064&&h!==null)h.return=i,I=h;else e:for(i=d;I!==null;){if(o=I,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Mr(9,o)}}catch(w){ie(o,o.return,w)}if(o===i){I=null;break e}var k=o.sibling;if(k!==null){k.return=o.return,I=k;break e}I=o.return}}if(Q=r,on(),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(Cr,e)}catch{}s=!0}return s}finally{q=n,Ze.transition=t}}return!1}function Xc(e,t,n){t=ts(n,t),t=vf(e,t,1),e=qt(e,t,1),t=Pe(),e!==null&&(rl(e,1,t),Be(e,t))}function ie(e,t,n){if(e.tag===3)Xc(e,e,n);else for(;t!==null;){if(t.tag===3){Xc(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Jt===null||!Jt.has(s))){e=ts(n,e),e=yf(t,e,1),t=qt(t,e,1),e=Pe(),t!==null&&(rl(t,1,e),Be(t,e));break}}t=t.return}}function Ax(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=Pe(),e.pingedLanes|=e.suspendedLanes&n,ve===e&&(je&n)===n&&(xe===4||xe===3&&(je&130023424)===je&&500>oe()-fo?mn(e,0):uo|=n),Be(e,t)}function If(e,t){t===0&&(e.mode&1?(t=yl,yl<<=1,!(yl&130023424)&&(yl=4194304)):t=1);var n=Pe();e=Tt(e,t),e!==null&&(rl(e,t,n),Be(e,n))}function Lx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),If(e,n)}function Mx(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(F(314))}s!==null&&s.delete(t),If(e,n)}var $f;$f=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||$e.current)De=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return De=!1,Nx(e,t,n);De=!!(e.flags&131072)}else De=!1,ee&&t.flags&1048576&&Hd(t,rr,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;Ul(e,t),e=t.pendingProps;var r=Gn(t,Ee.current);qn(t,n),r=lo(null,t,s,e,r,n);var a=ro();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ue(s)?(a=!0,sr(t)):a=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Zi(t),r.updater=Lr,t.stateNode=r,r._reactInternals=t,ti(t,s,e,n),t=li(null,t,s,!0,a,n)):(t.tag=0,ee&&a&&Yi(t),Re(null,t,r,n),t=t.child),t;case 16:s=t.elementType;e:{switch(Ul(e,t),e=t.pendingProps,r=s._init,s=r(s._payload),t.type=s,r=t.tag=Ox(s),e=it(s,e),r){case 0:t=si(null,t,s,e,n);break e;case 1:t=Bc(null,t,s,e,n);break e;case 11:t=$c(null,t,s,e,n);break e;case 14:t=Uc(null,t,s,it(s.type,e),n);break e}throw Error(F(306,s,""))}return t;case 0:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:it(s,r),si(e,t,s,r,n);case 1:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:it(s,r),Bc(e,t,s,r,n);case 3:e:{if(bf(t),e===null)throw Error(F(387));s=t.pendingProps,a=t.memoizedState,r=a.element,Jd(e,t),or(t,s,null,n);var i=t.memoizedState;if(s=i.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){r=ts(Error(F(423)),t),t=Hc(e,t,s,n,r);break e}else if(s!==r){r=ts(Error(F(424)),t),t=Hc(e,t,s,n,r);break e}else for(We=Qt(t.stateNode.containerInfo.firstChild),Ye=t,ee=!0,ct=null,n=Qd(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Xn(),s===r){t=Pt(e,t,n);break e}Re(e,t,s,n)}t=t.child}return t;case 5:return Kd(t),e===null&&Xa(t),s=t.type,r=t.pendingProps,a=e!==null?e.memoizedProps:null,i=r.children,Qa(s,r)?i=null:a!==null&&Qa(s,a)&&(t.flags|=32),wf(e,t),Re(e,t,i,n),t.child;case 6:return e===null&&Xa(t),null;case 13:return kf(e,t,n);case 4:return eo(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Zn(t,null,s,n):Re(e,t,s,n),t.child;case 11:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:it(s,r),$c(e,t,s,r,n);case 7:return Re(e,t,t.pendingProps,n),t.child;case 8:return Re(e,t,t.pendingProps.children,n),t.child;case 12:return Re(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,r=t.pendingProps,a=t.memoizedProps,i=r.value,J(ar,s._currentValue),s._currentValue=i,a!==null)if(ft(a.value,i)){if(a.children===r.children&&!$e.current){t=Pt(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var o=a.dependencies;if(o!==null){i=a.child;for(var c=o.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=Ct(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var m=u.pending;m===null?c.next=c:(c.next=m.next,m.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Za(a.return,n,t),o.lanes|=n;break}c=c.next}}else if(a.tag===10)i=a.type===t.type?null:a.child;else if(a.tag===18){if(i=a.return,i===null)throw Error(F(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Za(i,n,t),i=a.sibling}else i=a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===t){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}Re(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,s=t.pendingProps.children,qn(t,n),r=et(r),s=s(r),t.flags|=1,Re(e,t,s,n),t.child;case 14:return s=t.type,r=it(s,t.pendingProps),r=it(s.type,r),Uc(e,t,s,r,n);case 15:return jf(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:it(s,r),Ul(e,t),t.tag=1,Ue(s)?(e=!0,sr(t)):e=!1,qn(t,n),gf(t,s,r),ti(t,s,r,n),li(null,t,s,!0,e,n);case 19:return Sf(e,t,n);case 22:return Nf(e,t,n)}throw Error(F(156,t.tag))};function Uf(e,t){return pd(e,t)}function Fx(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xe(e,t,n,s){return new Fx(e,t,n,s)}function ho(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ox(e){if(typeof e=="function")return ho(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Mi)return 11;if(e===Fi)return 14}return 2}function Gt(e,t){var n=e.alternate;return n===null?(n=Xe(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Vl(e,t,n,s,r,a){var i=2;if(s=e,typeof e=="function")ho(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Pn:return xn(n.children,r,a,t);case Li:i=8,r|=8;break;case Sa:return e=Xe(12,n,t,r|2),e.elementType=Sa,e.lanes=a,e;case Ca:return e=Xe(13,n,t,r),e.elementType=Ca,e.lanes=a,e;case Ea:return e=Xe(19,n,t,r),e.elementType=Ea,e.lanes=a,e;case Ku:return Or(n,r,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qu:i=10;break e;case Ju:i=9;break e;case Mi:i=11;break e;case Fi:i=14;break e;case Dt:i=16,s=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Xe(i,n,t,r),t.elementType=e,t.type=s,t.lanes=a,t}function xn(e,t,n,s){return e=Xe(7,e,s,t),e.lanes=n,e}function Or(e,t,n,s){return e=Xe(22,e,s,t),e.elementType=Ku,e.lanes=n,e.stateNode={isHidden:!1},e}function xa(e,t,n){return e=Xe(6,e,null,t),e.lanes=n,e}function ha(e,t,n){return t=Xe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function zx(e,t,n,s,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Kr(0),this.expirationTimes=Kr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kr(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function go(e,t,n,s,r,a,i,o,c){return e=new zx(e,t,n,o,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Xe(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zi(a),e}function Dx(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Tn,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function Bf(e){if(!e)return tn;e=e._reactInternals;e:{if(Sn(e)!==e||e.tag!==1)throw Error(F(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ue(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(F(171))}if(e.tag===1){var n=e.type;if(Ue(n))return Ud(e,n,t)}return t}function Hf(e,t,n,s,r,a,i,o,c){return e=go(n,s,!0,e,r,a,i,o,c),e.context=Bf(null),n=e.current,s=Pe(),r=Kt(n),a=Ct(s,r),a.callback=t??null,qt(n,a,r),e.current.lanes=r,rl(e,r,s),Be(e,s),e}function zr(e,t,n,s){var r=t.current,a=Pe(),i=Kt(r);return n=Bf(n),t.context===null?t.context=n:t.pendingContext=n,t=Ct(a,i),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=qt(r,t,i),e!==null&&(dt(e,r,i,a),Dl(e,r,i)),i}function hr(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Zc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vo(e,t){Zc(e,t),(e=e.alternate)&&Zc(e,t)}function Ix(){return null}var Vf=typeof reportError=="function"?reportError:function(e){console.error(e)};function yo(e){this._internalRoot=e}Dr.prototype.render=yo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));zr(e,t,null,null)};Dr.prototype.unmount=yo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nn(function(){zr(null,e,null,null)}),t[Rt]=null}};function Dr(e){this._internalRoot=e}Dr.prototype.unstable_scheduleHydration=function(e){if(e){var t=jd();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$t.length&&t!==0&&t<$t[n].priority;n++);$t.splice(n,0,e),n===0&&wd(e)}};function jo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ir(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function eu(){}function $x(e,t,n,s,r){if(r){if(typeof s=="function"){var a=s;s=function(){var u=hr(i);a.call(u)}}var i=Hf(t,s,e,0,null,!1,!1,"",eu);return e._reactRootContainer=i,e[Rt]=i.current,Us(e.nodeType===8?e.parentNode:e),Nn(),i}for(;r=e.lastChild;)e.removeChild(r);if(typeof s=="function"){var o=s;s=function(){var u=hr(c);o.call(u)}}var c=go(e,0,!1,null,null,!1,!1,"",eu);return e._reactRootContainer=c,e[Rt]=c.current,Us(e.nodeType===8?e.parentNode:e),Nn(function(){zr(t,c,n,s)}),c}function $r(e,t,n,s,r){var a=n._reactRootContainer;if(a){var i=a;if(typeof r=="function"){var o=r;r=function(){var c=hr(i);o.call(c)}}zr(t,i,e,r)}else i=$x(n,t,e,r,s);return hr(i)}vd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=js(t.pendingLanes);n!==0&&(Di(t,n|1),Be(t,oe()),!(Q&6)&&(ns=oe()+500,on()))}break;case 13:Nn(function(){var s=Tt(e,1);if(s!==null){var r=Pe();dt(s,e,1,r)}}),vo(e,1)}};Ii=function(e){if(e.tag===13){var t=Tt(e,134217728);if(t!==null){var n=Pe();dt(t,e,134217728,n)}vo(e,134217728)}};yd=function(e){if(e.tag===13){var t=Kt(e),n=Tt(e,t);if(n!==null){var s=Pe();dt(n,e,t,s)}vo(e,t)}};jd=function(){return q};Nd=function(e,t){var n=q;try{return q=e,t()}finally{q=n}};za=function(e,t,n){switch(t){case"input":if(Ta(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var r=Tr(s);if(!r)throw Error(F(90));Xu(s),Ta(s,r)}}}break;case"textarea":ed(e,n);break;case"select":t=n.value,t!=null&&Vn(e,!!n.multiple,t,!1)}};id=po;od=Nn;var Ux={usingClientEntryPoint:!1,Events:[il,Fn,Tr,rd,ad,po]},hs={findFiberByHostInstance:dn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Bx={bundleType:hs.bundleType,version:hs.version,rendererPackageName:hs.rendererPackageName,rendererConfig:hs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Mt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=dd(e),e===null?null:e.stateNode},findFiberByHostInstance:hs.findFiberByHostInstance||Ix,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tl.isDisabled&&Tl.supportsFiber)try{Cr=Tl.inject(Bx),vt=Tl}catch{}}qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ux;qe.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!jo(t))throw Error(F(200));return Dx(e,t,null,n)};qe.createRoot=function(e,t){if(!jo(e))throw Error(F(299));var n=!1,s="",r=Vf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=go(e,1,!1,null,null,n,!1,s,r),e[Rt]=t.current,Us(e.nodeType===8?e.parentNode:e),new yo(t)};qe.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(F(188)):(e=Object.keys(e).join(","),Error(F(268,e)));return e=dd(t),e=e===null?null:e.stateNode,e};qe.flushSync=function(e){return Nn(e)};qe.hydrate=function(e,t,n){if(!Ir(t))throw Error(F(200));return $r(null,e,t,!0,n)};qe.hydrateRoot=function(e,t,n){if(!jo(e))throw Error(F(405));var s=n!=null&&n.hydratedSources||null,r=!1,a="",i=Vf;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=Hf(t,null,e,1,n??null,r,!1,a,i),e[Rt]=t.current,Us(e),s)for(e=0;e<s.length;e++)n=s[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new Dr(t)};qe.render=function(e,t,n){if(!Ir(t))throw Error(F(200));return $r(null,e,t,!1,n)};qe.unmountComponentAtNode=function(e){if(!Ir(e))throw Error(F(40));return e._reactRootContainer?(Nn(function(){$r(null,null,e,!1,function(){e._reactRootContainer=null,e[Rt]=null})}),!0):!1};qe.unstable_batchedUpdates=po;qe.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!Ir(n))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return $r(e,t,n,!1,s)};qe.version="18.3.1-next-f1338f8080-20240426";function Wf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wf)}catch(e){console.error(e)}}Wf(),Vu.exports=qe;var Hx=Vu.exports,tu=Hx;ba.createRoot=tu.createRoot,ba.hydrateRoot=tu.hydrateRoot;/**
|
|
41
|
+
* react-router v7.12.0
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/var nu="popstate";function Vx(e={}){function t(s,r){let{pathname:a,search:i,hash:o}=s.location;return hi("",{pathname:a,search:i,hash:o},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:Ks(r)}return Yx(t,n,null,e)}function le(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Wx(){return Math.random().toString(36).substring(2,10)}function su(e,t){return{usr:e.state,key:e.key,idx:t}}function hi(e,t,n=null,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?is(t):t,state:n,key:t&&t.key||s||Wx()}}function Ks({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function is(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function Yx(e,t,n,s={}){let{window:r=document.defaultView,v5Compat:a=!1}=s,i=r.history,o="POP",c=null,u=m();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function m(){return(i.state||{idx:null}).idx}function f(){o="POP";let N=m(),p=N==null?null:N-u;u=N,c&&c({action:o,location:v.location,delta:p})}function g(N,p){o="PUSH";let d=hi(v.location,N,p);u=m()+1;let h=su(d,u),k=v.createHref(d);try{i.pushState(h,"",k)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;r.location.assign(k)}a&&c&&c({action:o,location:v.location,delta:1})}function y(N,p){o="REPLACE";let d=hi(v.location,N,p);u=m();let h=su(d,u),k=v.createHref(d);i.replaceState(h,"",k),a&&c&&c({action:o,location:v.location,delta:0})}function j(N){return Qx(N)}let v={get action(){return o},get location(){return e(r,i)},listen(N){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(nu,f),c=N,()=>{r.removeEventListener(nu,f),c=null}},createHref(N){return t(r,N)},createURL:j,encodeLocation(N){let p=j(N);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:g,replace:y,go(N){return i.go(N)}};return v}function Qx(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),le(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Ks(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function Yf(e,t,n="/"){return qx(e,t,n,!1)}function qx(e,t,n,s){let r=typeof t=="string"?is(t):t,a=At(r.pathname||"/",n);if(a==null)return null;let i=Qf(e);Jx(i);let o=null;for(let c=0;o==null&&c<i.length;++c){let u=ah(a);o=lh(i[c],u,s)}return o}function Qf(e,t=[],n=[],s="",r=!1){let a=(i,o,c=r,u)=>{let m={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(s)&&c)return;le(m.relativePath.startsWith(s),`Absolute route path "${m.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(s.length)}let f=Et([s,m.relativePath]),g=n.concat(m);i.children&&i.children.length>0&&(le(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Qf(i.children,t,g,f,c)),!(i.path==null&&!i.index)&&t.push({path:f,score:nh(f,i.index),routesMeta:g})};return e.forEach((i,o)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))a(i,o);else for(let u of qf(i.path))a(i,o,!0,u)}),t}function qf(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),a=n.replace(/\?$/,"");if(s.length===0)return r?[a,""]:[a];let i=qf(s.join("/")),o=[];return o.push(...i.map(c=>c===""?a:[a,c].join("/"))),r&&o.push(...i),o.map(c=>e.startsWith("/")&&c===""?"/":c)}function Jx(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:sh(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var Kx=/^:[\w-]+$/,Gx=3,Xx=2,Zx=1,eh=10,th=-2,lu=e=>e==="*";function nh(e,t){let n=e.split("/"),s=n.length;return n.some(lu)&&(s+=th),t&&(s+=Xx),n.filter(r=>!lu(r)).reduce((r,a)=>r+(Kx.test(a)?Gx:a===""?Zx:eh),s)}function sh(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function lh(e,t,n=!1){let{routesMeta:s}=e,r={},a="/",i=[];for(let o=0;o<s.length;++o){let c=s[o],u=o===s.length-1,m=a==="/"?t:t.slice(a.length)||"/",f=gr({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},m),g=c.route;if(!f&&u&&n&&!s[s.length-1].route.index&&(f=gr({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},m)),!f)return null;Object.assign(r,f.params),i.push({params:r,pathname:Et([a,f.pathname]),pathnameBase:uh(Et([a,f.pathnameBase])),route:g}),f.pathnameBase!=="/"&&(a=Et([a,f.pathnameBase]))}return i}function gr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=rh(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let a=r[0],i=a.replace(/(.)\/+$/,"$1"),o=r.slice(1);return{params:s.reduce((u,{paramName:m,isOptional:f},g)=>{if(m==="*"){let j=o[g]||"";i=a.slice(0,a.length-j.length).replace(/(.)\/+$/,"$1")}const y=o[g];return f&&!y?u[m]=void 0:u[m]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:i,pattern:e}}function rh(e,t=!1,n=!0){nt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,o,c)=>(s.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function ah(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return nt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function At(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}var Jf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ih=e=>Jf.test(e);function oh(e,t="/"){let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?is(e):e,a;if(n)if(ih(n))a=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),nt(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?a=ru(n.substring(1),"/"):a=ru(n,t)}else a=t;return{pathname:a,search:dh(s),hash:fh(r)}}function ru(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function ga(e,t,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ch(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Kf(e){let t=ch(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function Gf(e,t,n,s=!1){let r;typeof e=="string"?r=is(e):(r={...e},le(!r.pathname||!r.pathname.includes("?"),ga("?","pathname","search",r)),le(!r.pathname||!r.pathname.includes("#"),ga("#","pathname","hash",r)),le(!r.search||!r.search.includes("#"),ga("#","search","hash",r)));let a=e===""||r.pathname==="",i=a?"/":r.pathname,o;if(i==null)o=n;else{let f=t.length-1;if(!s&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),f-=1;r.pathname=g.join("/")}o=f>=0?t[f]:"/"}let c=oh(r,o),u=i&&i!=="/"&&i.endsWith("/"),m=(a||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||m)&&(c.pathname+="/"),c}var Et=e=>e.join("/").replace(/\/\/+/g,"/"),uh=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),dh=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ph=class{constructor(e,t,n,s=!1){this.status=e,this.statusText=t||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function mh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function xh(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Xf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Zf(e,t){let n=e;if(typeof n!="string"||!Jf.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,r=!1;if(Xf)try{let a=new URL(window.location.href),i=n.startsWith("//")?new URL(a.protocol+n):new URL(n),o=At(i.pathname,t);i.origin===a.origin&&o!=null?n=o+i.search+i.hash:r=!0}catch{nt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ep=["POST","PUT","PATCH","DELETE"];new Set(ep);var hh=["GET",...ep];new Set(hh);var os=x.createContext(null);os.displayName="DataRouter";var Ur=x.createContext(null);Ur.displayName="DataRouterState";var gh=x.createContext(!1),tp=x.createContext({isTransitioning:!1});tp.displayName="ViewTransition";var vh=x.createContext(new Map);vh.displayName="Fetchers";var yh=x.createContext(null);yh.displayName="Await";var st=x.createContext(null);st.displayName="Navigation";var cl=x.createContext(null);cl.displayName="Location";var pt=x.createContext({outlet:null,matches:[],isDataRoute:!1});pt.displayName="Route";var No=x.createContext(null);No.displayName="RouteError";var np="REACT_ROUTER_ERROR",jh="REDIRECT",Nh="ROUTE_ERROR_RESPONSE";function wh(e){if(e.startsWith(`${np}:${jh}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function bh(e){if(e.startsWith(`${np}:${Nh}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new ph(t.status,t.statusText,t.data)}catch{}}function kh(e,{relative:t}={}){le(ul(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=x.useContext(st),{hash:r,pathname:a,search:i}=dl(e,{relative:t}),o=a;return n!=="/"&&(o=a==="/"?n:Et([n,a])),s.createHref({pathname:o,search:i,hash:r})}function ul(){return x.useContext(cl)!=null}function Ft(){return le(ul(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(cl).location}var sp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function lp(e){x.useContext(st).static||x.useLayoutEffect(e)}function wo(){let{isDataRoute:e}=x.useContext(pt);return e?Ih():Sh()}function Sh(){le(ul(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(os),{basename:t,navigator:n}=x.useContext(st),{matches:s}=x.useContext(pt),{pathname:r}=Ft(),a=JSON.stringify(Kf(s)),i=x.useRef(!1);return lp(()=>{i.current=!0}),x.useCallback((c,u={})=>{if(nt(i.current,sp),!i.current)return;if(typeof c=="number"){n.go(c);return}let m=Gf(c,JSON.parse(a),r,u.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Et([t,m.pathname])),(u.replace?n.replace:n.push)(m,u.state,u)},[t,n,a,r,e])}var Ch=x.createContext(null);function Eh(e){let t=x.useContext(pt).outlet;return x.useMemo(()=>t&&x.createElement(Ch.Provider,{value:e},t),[t,e])}function rp(){let{matches:e}=x.useContext(pt),t=e[e.length-1];return t?t.params:{}}function dl(e,{relative:t}={}){let{matches:n}=x.useContext(pt),{pathname:s}=Ft(),r=JSON.stringify(Kf(n));return x.useMemo(()=>Gf(e,JSON.parse(r),s,t==="path"),[e,r,s,t])}function _h(e,t){return ap(e,t)}function ap(e,t,n,s,r){var d;le(ul(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(st),{matches:i}=x.useContext(pt),o=i[i.length-1],c=o?o.params:{},u=o?o.pathname:"/",m=o?o.pathnameBase:"/",f=o&&o.route;{let h=f&&f.path||"";op(u,!f||h.endsWith("*")||h.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${h}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
50
|
+
|
|
51
|
+
Please change the parent <Route path="${h}"> to <Route path="${h==="/"?"*":`${h}/*`}">.`)}let g=Ft(),y;if(t){let h=typeof t=="string"?is(t):t;le(m==="/"||((d=h.pathname)==null?void 0:d.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${h.pathname}" was given in the \`location\` prop.`),y=h}else y=g;let j=y.pathname||"/",v=j;if(m!=="/"){let h=m.replace(/^\//,"").split("/");v="/"+j.replace(/^\//,"").split("/").slice(h.length).join("/")}let N=Yf(e,{pathname:v});nt(f||N!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),nt(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let p=Lh(N&&N.map(h=>Object.assign({},h,{params:Object.assign({},c,h.params),pathname:Et([m,a.encodeLocation?a.encodeLocation(h.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?m:Et([m,a.encodeLocation?a.encodeLocation(h.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathnameBase])})),i,n,s,r);return t&&p?x.createElement(cl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},p):p}function Rh(){let e=Dh(),t=mh(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:s},a={padding:"2px 4px",backgroundColor:s},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:a},"ErrorBoundary")," or"," ",x.createElement("code",{style:a},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:r},n):null,i)}var Th=x.createElement(Rh,null),ip=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=bh(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(pt.Provider,{value:this.props.routeContext},x.createElement(No.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(Ph,{error:e},t):t}};ip.contextType=gh;var va=new WeakMap;function Ph({children:e,error:t}){let{basename:n}=x.useContext(st);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=wh(t.digest);if(s){let r=va.get(t);if(r)throw r;let a=Zf(s.location,n);if(Xf&&!va.get(t))if(a.isExternal||s.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:s.replace}));throw va.set(t,i),i}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Ah({routeContext:e,match:t,children:n}){let s=x.useContext(os);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(pt.Provider,{value:e},n)}function Lh(e,t=[],n=null,s=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=n==null?void 0:n.errors;if(i!=null){let m=a.findIndex(f=>f.route.id&&(i==null?void 0:i[f.route.id])!==void 0);le(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,m+1))}let o=!1,c=-1;if(n)for(let m=0;m<a.length;m++){let f=a[m];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=m),f.route.id){let{loaderData:g,errors:y}=n,j=f.route.loader&&!g.hasOwnProperty(f.route.id)&&(!y||y[f.route.id]===void 0);if(f.route.lazy||j){o=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}let u=n&&s?(m,f)=>{var g,y;s(m,{location:n.location,params:((y=(g=n.matches)==null?void 0:g[0])==null?void 0:y.params)??{},unstable_pattern:xh(n.matches),errorInfo:f})}:void 0;return a.reduceRight((m,f,g)=>{let y,j=!1,v=null,N=null;n&&(y=i&&f.route.id?i[f.route.id]:void 0,v=f.route.errorElement||Th,o&&(c<0&&g===0?(op("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,N=null):c===g&&(j=!0,N=f.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,g+1)),d=()=>{let h;return y?h=v:j?h=N:f.route.Component?h=x.createElement(f.route.Component,null):f.route.element?h=f.route.element:h=m,x.createElement(Ah,{match:f,routeContext:{outlet:m,matches:p,isDataRoute:n!=null},children:h})};return n&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?x.createElement(ip,{location:n.location,revalidation:n.revalidation,component:v,error:y,children:d(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:u}):d()},null)}function bo(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mh(e){let t=x.useContext(os);return le(t,bo(e)),t}function Fh(e){let t=x.useContext(Ur);return le(t,bo(e)),t}function Oh(e){let t=x.useContext(pt);return le(t,bo(e)),t}function ko(e){let t=Oh(e),n=t.matches[t.matches.length-1];return le(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function zh(){return ko("useRouteId")}function Dh(){var s;let e=x.useContext(No),t=Fh("useRouteError"),n=ko("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[n]}function Ih(){let{router:e}=Mh("useNavigate"),t=ko("useNavigate"),n=x.useRef(!1);return lp(()=>{n.current=!0}),x.useCallback(async(r,a={})=>{nt(n.current,sp),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...a}))},[e,t])}var au={};function op(e,t,n){!t&&!au[e]&&(au[e]=!0,nt(!1,n))}x.memo($h);function $h({routes:e,future:t,state:n,onError:s}){return ap(e,void 0,n,s,t)}function Uh(e){return Eh(e.context)}function xt(e){le(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Bh({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:r,static:a=!1,unstable_useTransitions:i}){le(!ul(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),c=x.useMemo(()=>({basename:o,navigator:r,static:a,unstable_useTransitions:i,future:{}}),[o,r,a,i]);typeof n=="string"&&(n=is(n));let{pathname:u="/",search:m="",hash:f="",state:g=null,key:y="default"}=n,j=x.useMemo(()=>{let v=At(u,o);return v==null?null:{location:{pathname:v,search:m,hash:f,state:g,key:y},navigationType:s}},[o,u,m,f,g,y,s]);return nt(j!=null,`<Router basename="${o}"> is not able to match the URL "${u}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:x.createElement(st.Provider,{value:c},x.createElement(cl.Provider,{children:t,value:j}))}function Hh({children:e,location:t}){return _h(gi(e),t)}function gi(e,t=[]){let n=[];return x.Children.forEach(e,(s,r)=>{if(!x.isValidElement(s))return;let a=[...t,r];if(s.type===x.Fragment){n.push.apply(n,gi(s.props.children,a));return}le(s.type===xt,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),le(!s.props.index||!s.props.children,"An index route cannot have child routes.");let i={id:s.props.id||a.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(i.children=gi(s.props.children,a)),n.push(i)}),n}var Wl="get",Yl="application/x-www-form-urlencoded";function Br(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Vh(e){return Br(e)&&e.tagName.toLowerCase()==="button"}function Wh(e){return Br(e)&&e.tagName.toLowerCase()==="form"}function Yh(e){return Br(e)&&e.tagName.toLowerCase()==="input"}function Qh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qh(e,t){return e.button===0&&(!t||t==="_self")&&!Qh(e)}function vi(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(r=>[n,r]):[[n,s]])},[]))}function Jh(e,t){let n=vi(e);return t&&t.forEach((s,r)=>{n.has(r)||t.getAll(r).forEach(a=>{n.append(r,a)})}),n}var Pl=null;function Kh(){if(Pl===null)try{new FormData(document.createElement("form"),0),Pl=!1}catch{Pl=!0}return Pl}var Gh=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ya(e){return e!=null&&!Gh.has(e)?(nt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yl}"`),null):e}function Xh(e,t){let n,s,r,a,i;if(Wh(e)){let o=e.getAttribute("action");s=o?At(o,t):null,n=e.getAttribute("method")||Wl,r=ya(e.getAttribute("enctype"))||Yl,a=new FormData(e)}else if(Vh(e)||Yh(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||o.getAttribute("action");if(s=c?At(c,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||Wl,r=ya(e.getAttribute("formenctype"))||ya(o.getAttribute("enctype"))||Yl,a=new FormData(o,e),!Kh()){let{name:u,type:m,value:f}=e;if(m==="image"){let g=u?`${u}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else u&&a.append(u,f)}}else{if(Br(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Wl,s=null,r=Yl,i=e}return a&&r==="text/plain"&&(i=a,a=void 0),{action:s,method:n.toLowerCase(),encType:r,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function So(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Zh(e,t,n,s){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${s}`:r.pathname=`${r.pathname}.${s}`:r.pathname==="/"?r.pathname=`_root.${s}`:t&&At(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${s}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${s}`,r}async function eg(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tg(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function ng(e,t,n){let s=await Promise.all(e.map(async r=>{let a=t.routes[r.route.id];if(a){let i=await eg(a,n);return i.links?i.links():[]}return[]}));return ag(s.flat(1).filter(tg).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function iu(e,t,n,s,r,a){let i=(c,u)=>n[u]?c.route.id!==n[u].route.id:!0,o=(c,u)=>{var m;return n[u].pathname!==c.pathname||((m=n[u].route.path)==null?void 0:m.endsWith("*"))&&n[u].params["*"]!==c.params["*"]};return a==="assets"?t.filter((c,u)=>i(c,u)||o(c,u)):a==="data"?t.filter((c,u)=>{var f;let m=s.routes[c.route.id];if(!m||!m.hasLoader)return!1;if(i(c,u)||o(c,u))return!0;if(c.route.shouldRevalidate){let g=c.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function sg(e,t,{includeHydrateFallback:n}={}){return lg(e.map(s=>{let r=t.routes[s.route.id];if(!r)return[];let a=[r.module];return r.clientActionModule&&(a=a.concat(r.clientActionModule)),r.clientLoaderModule&&(a=a.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(a=a.concat(r.hydrateFallbackModule)),r.imports&&(a=a.concat(r.imports)),a}).flat(1))}function lg(e){return[...new Set(e)]}function rg(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function ag(e,t){let n=new Set;return new Set(t),e.reduce((s,r)=>{let a=JSON.stringify(rg(r));return n.has(a)||(n.add(a),s.push({key:a,link:r})),s},[])}function cp(){let e=x.useContext(os);return So(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ig(){let e=x.useContext(Ur);return So(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Co=x.createContext(void 0);Co.displayName="FrameworkContext";function up(){let e=x.useContext(Co);return So(e,"You must render this element inside a <HydratedRouter> element"),e}function og(e,t){let n=x.useContext(Co),[s,r]=x.useState(!1),[a,i]=x.useState(!1),{onFocus:o,onBlur:c,onMouseEnter:u,onMouseLeave:m,onTouchStart:f}=t,g=x.useRef(null);x.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let v=p=>{p.forEach(d=>{i(d.isIntersecting)})},N=new IntersectionObserver(v,{threshold:.5});return g.current&&N.observe(g.current),()=>{N.disconnect()}}},[e]),x.useEffect(()=>{if(s){let v=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(v)}}},[s]);let y=()=>{r(!0)},j=()=>{r(!1),i(!1)};return n?e!=="intent"?[a,g,{}]:[a,g,{onFocus:gs(o,y),onBlur:gs(c,j),onMouseEnter:gs(u,y),onMouseLeave:gs(m,j),onTouchStart:gs(f,y)}]:[!1,g,{}]}function gs(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function cg({page:e,...t}){let{router:n}=cp(),s=x.useMemo(()=>Yf(n.routes,e,n.basename),[n.routes,e,n.basename]);return s?x.createElement(dg,{page:e,matches:s,...t}):null}function ug(e){let{manifest:t,routeModules:n}=up(),[s,r]=x.useState([]);return x.useEffect(()=>{let a=!1;return ng(e,t,n).then(i=>{a||r(i)}),()=>{a=!0}},[e,t,n]),s}function dg({page:e,matches:t,...n}){let s=Ft(),{future:r,manifest:a,routeModules:i}=up(),{basename:o}=cp(),{loaderData:c,matches:u}=ig(),m=x.useMemo(()=>iu(e,t,u,a,s,"data"),[e,t,u,a,s]),f=x.useMemo(()=>iu(e,t,u,a,s,"assets"),[e,t,u,a,s]),g=x.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let v=new Set,N=!1;if(t.forEach(d=>{var k;let h=a.routes[d.route.id];!h||!h.hasLoader||(!m.some(w=>w.route.id===d.route.id)&&d.route.id in c&&((k=i[d.route.id])!=null&&k.shouldRevalidate)||h.hasClientLoader?N=!0:v.add(d.route.id))}),v.size===0)return[];let p=Zh(e,o,r.unstable_trailingSlashAwareDataRequests,"data");return N&&v.size>0&&p.searchParams.set("_routes",t.filter(d=>v.has(d.route.id)).map(d=>d.route.id).join(",")),[p.pathname+p.search]},[o,r.unstable_trailingSlashAwareDataRequests,c,s,a,m,t,e,i]),y=x.useMemo(()=>sg(f,a),[f,a]),j=ug(f);return x.createElement(x.Fragment,null,g.map(v=>x.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),y.map(v=>x.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),j.map(({key:v,link:N})=>x.createElement("link",{key:v,nonce:n.nonce,...N})))}function fg(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var pg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{pg&&(window.__reactRouterVersion="7.12.0")}catch{}function mg({basename:e,children:t,unstable_useTransitions:n,window:s}){let r=x.useRef();r.current==null&&(r.current=Vx({window:s,v5Compat:!0}));let a=r.current,[i,o]=x.useState({action:a.action,location:a.location}),c=x.useCallback(u=>{n===!1?o(u):x.startTransition(()=>o(u))},[n]);return x.useLayoutEffect(()=>a.listen(c),[a,c]),x.createElement(Bh,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:a,unstable_useTransitions:n})}var dp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,de=x.forwardRef(function({onClick:t,discover:n="render",prefetch:s="none",relative:r,reloadDocument:a,replace:i,state:o,target:c,to:u,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:g,...y},j){let{basename:v,unstable_useTransitions:N}=x.useContext(st),p=typeof u=="string"&&dp.test(u),d=Zf(u,v);u=d.to;let h=kh(u,{relative:r}),[k,w,R]=og(s,y),P=vg(u,{replace:i,state:o,target:c,preventScrollReset:m,relative:r,viewTransition:f,unstable_defaultShouldRevalidate:g,unstable_useTransitions:N});function M(z){t&&t(z),z.defaultPrevented||P(z)}let O=x.createElement("a",{...y,...R,href:d.absoluteURL||h,onClick:d.isExternal||a?t:M,ref:fg(j,w),target:c,"data-discover":!p&&n==="render"?"true":void 0});return k&&!p?x.createElement(x.Fragment,null,O,x.createElement(cg,{page:h})):O});de.displayName="Link";var xg=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:r=!1,style:a,to:i,viewTransition:o,children:c,...u},m){let f=dl(i,{relative:u.relative}),g=Ft(),y=x.useContext(Ur),{navigator:j,basename:v}=x.useContext(st),N=y!=null&&kg(f)&&o===!0,p=j.encodeLocation?j.encodeLocation(f).pathname:f.pathname,d=g.pathname,h=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(d=d.toLowerCase(),h=h?h.toLowerCase():null,p=p.toLowerCase()),h&&v&&(h=At(h,v)||h);const k=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let w=d===p||!r&&d.startsWith(p)&&d.charAt(k)==="/",R=h!=null&&(h===p||!r&&h.startsWith(p)&&h.charAt(p.length)==="/"),P={isActive:w,isPending:R,isTransitioning:N},M=w?t:void 0,O;typeof s=="function"?O=s(P):O=[s,w?"active":null,R?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let z=typeof a=="function"?a(P):a;return x.createElement(de,{...u,"aria-current":M,className:O,ref:m,style:z,to:i,viewTransition:o},typeof c=="function"?c(P):c)});xg.displayName="NavLink";var hg=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:r,state:a,method:i=Wl,action:o,onSubmit:c,relative:u,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:g,...y},j)=>{let{unstable_useTransitions:v}=x.useContext(st),N=wg(),p=bg(o,{relative:u}),d=i.toLowerCase()==="get"?"get":"post",h=typeof o=="string"&&dp.test(o),k=w=>{if(c&&c(w),w.defaultPrevented)return;w.preventDefault();let R=w.nativeEvent.submitter,P=(R==null?void 0:R.getAttribute("formmethod"))||i,M=()=>N(R||w.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:r,state:a,relative:u,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:g});v&&n!==!1?x.startTransition(()=>M()):M()};return x.createElement("form",{ref:j,method:d,action:p,onSubmit:s?c:k,...y,"data-discover":!h&&e==="render"?"true":void 0})});hg.displayName="Form";function gg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fp(e){let t=x.useContext(os);return le(t,gg(e)),t}function vg(e,{target:t,replace:n,state:s,preventScrollReset:r,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:o,unstable_useTransitions:c}={}){let u=wo(),m=Ft(),f=dl(e,{relative:a});return x.useCallback(g=>{if(qh(g,t)){g.preventDefault();let y=n!==void 0?n:Ks(m)===Ks(f),j=()=>u(e,{replace:y,state:s,preventScrollReset:r,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:o});c?x.startTransition(()=>j()):j()}},[m,u,f,n,s,t,e,r,a,i,o,c])}function yg(e){nt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=x.useRef(vi(e)),n=x.useRef(!1),s=Ft(),r=x.useMemo(()=>Jh(s.search,n.current?null:t.current),[s.search]),a=wo(),i=x.useCallback((o,c)=>{const u=vi(typeof o=="function"?o(new URLSearchParams(r)):o);n.current=!0,a("?"+u,c)},[a,r]);return[r,i]}var jg=0,Ng=()=>`__${String(++jg)}__`;function wg(){let{router:e}=fp("useSubmit"),{basename:t}=x.useContext(st),n=zh(),s=e.fetch,r=e.navigate;return x.useCallback(async(a,i={})=>{let{action:o,method:c,encType:u,formData:m,body:f}=Xh(a,t);if(i.navigate===!1){let g=i.fetcherKey||Ng();await s(g,n,i.action||o,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:m,body:f,formMethod:i.method||c,formEncType:i.encType||u,flushSync:i.flushSync})}else await r(i.action||o,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:m,body:f,formMethod:i.method||c,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[s,r,t,n])}function bg(e,{relative:t}={}){let{basename:n}=x.useContext(st),s=x.useContext(pt);le(s,"useFormAction must be used inside a RouteContext");let[r]=s.matches.slice(-1),a={...dl(e||".",{relative:t})},i=Ft();if(e==null){a.search=i.search;let o=new URLSearchParams(a.search),c=o.getAll("index");if(c.some(m=>m==="")){o.delete("index"),c.filter(f=>f).forEach(f=>o.append("index",f));let m=o.toString();a.search=m?`?${m}`:""}}return(!e||e===".")&&r.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:Et([n,a.pathname])),Ks(a)}function kg(e,{relative:t}={}){let n=x.useContext(tp);le(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=fp("useViewTransitionState"),r=dl(e,{relative:t});if(!n.isTransitioning)return!1;let a=At(n.currentLocation.pathname,s)||n.currentLocation.pathname,i=At(n.nextLocation.pathname,s)||n.nextLocation.pathname;return gr(r.pathname,i)!=null||gr(r.pathname,a)!=null}/**
|
|
52
|
+
* @license lucide-react v0.468.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const Sg=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pp=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
|
|
57
|
+
* @license lucide-react v0.468.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/var Cg={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
62
|
+
* @license lucide-react v0.468.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const Eg=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:r="",children:a,iconNode:i,...o},c)=>x.createElement("svg",{ref:c,...Cg,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:pp("lucide",r),...o},[...i.map(([u,m])=>x.createElement(u,m)),...Array.isArray(a)?a:[a]]));/**
|
|
67
|
+
* @license lucide-react v0.468.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const W=(e,t)=>{const n=x.forwardRef(({className:s,...r},a)=>x.createElement(Eg,{ref:a,iconNode:t,className:pp(`lucide-${Sg(e)}`,s),...r}));return n.displayName=`${e}`,n};/**
|
|
72
|
+
* @license lucide-react v0.468.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const Gs=W("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
77
|
+
* @license lucide-react v0.468.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const Xs=W("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
82
|
+
* @license lucide-react v0.468.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const pe=W("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
87
|
+
* @license lucide-react v0.468.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const ge=W("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
92
|
+
* @license lucide-react v0.468.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const nn=W("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
97
|
+
* @license lucide-react v0.468.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const fl=W("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
102
|
+
* @license lucide-react v0.468.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const Eo=W("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
107
|
+
* @license lucide-react v0.468.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const _o=W("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
112
|
+
* @license lucide-react v0.468.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const Ro=W("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
117
|
+
* @license lucide-react v0.468.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const mp=W("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
122
|
+
* @license lucide-react v0.468.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const sn=W("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
127
|
+
* @license lucide-react v0.468.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const To=W("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
|
|
132
|
+
* @license lucide-react v0.468.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const _g=W("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
137
|
+
* @license lucide-react v0.468.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const xp=W("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
142
|
+
* @license lucide-react v0.468.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const hp=W("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
|
|
147
|
+
* @license lucide-react v0.468.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const Hr=W("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
152
|
+
* @license lucide-react v0.468.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const Rg=W("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
157
|
+
* @license lucide-react v0.468.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const ou=W("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
|
|
162
|
+
* @license lucide-react v0.468.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const Tg=W("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
|
|
167
|
+
* @license lucide-react v0.468.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const Pg=W("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
|
|
172
|
+
* @license lucide-react v0.468.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const cu=W("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
177
|
+
* @license lucide-react v0.468.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const vr=W("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
182
|
+
* @license lucide-react v0.468.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const gp=W("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
187
|
+
* @license lucide-react v0.468.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const Ag=W("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
192
|
+
* @license lucide-react v0.468.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const vp=W("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
|
|
197
|
+
* @license lucide-react v0.468.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const Lg=W("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
202
|
+
* @license lucide-react v0.468.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const Xt=W("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
207
|
+
* @license lucide-react v0.468.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const Ne=W("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
212
|
+
* @license lucide-react v0.468.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const Mg=W("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
217
|
+
* @license lucide-react v0.468.0 - ISC
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the ISC license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const yr=W("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
222
|
+
* @license lucide-react v0.468.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const Fg=W("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
|
|
227
|
+
* @license lucide-react v0.468.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const Po=W("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
232
|
+
* @license lucide-react v0.468.0 - ISC
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the ISC license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const Ao=W("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
237
|
+
* @license lucide-react v0.468.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const yp=W("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
242
|
+
* @license lucide-react v0.468.0 - ISC
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the ISC license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const Og=W("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
247
|
+
* @license lucide-react v0.468.0 - ISC
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the ISC license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const zg=W("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
252
|
+
* @license lucide-react v0.468.0 - ISC
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the ISC license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const yi=W("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
257
|
+
* @license lucide-react v0.468.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const Ae=W("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
262
|
+
* @license lucide-react v0.468.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const Lo=W("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
|
|
267
|
+
* @license lucide-react v0.468.0 - ISC
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the ISC license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const ji=W("Variable",[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]);/**
|
|
272
|
+
* @license lucide-react v0.468.0 - ISC
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the ISC license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/const wn=W("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
277
|
+
* @license lucide-react v0.468.0 - ISC
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the ISC license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const Nt=W("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
282
|
+
* @license lucide-react v0.468.0 - ISC
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the ISC license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const bn=W("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Dg=[{path:"/",label:"Dashboard",icon:Pg},{path:"/results",label:"Results",icon:Hr},{path:"/builder",label:"Builder",icon:wn},{path:"/datasets",label:"Datasets",icon:sn}];function Ig(){const e=Ft(),[t,n]=x.useState(()=>typeof window<"u"?localStorage.getItem("theme")==="light":!1);return x.useEffect(()=>{t?(document.documentElement.classList.add("light"),localStorage.setItem("theme","light")):(document.documentElement.classList.remove("light"),localStorage.setItem("theme","dark"))},[t]),l.jsxs("div",{className:"app-shell",children:[l.jsxs("aside",{className:"sidebar",children:[l.jsx("div",{className:"p-5 border-b border-slate-800/70",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--app-text)"},children:"Sandboxy Local"}),l.jsx("p",{className:"text-sm",style:{color:"var(--app-muted)"},children:"Development Server"})]}),l.jsx("button",{onClick:()=>n(!t),className:"p-2 rounded-lg transition-colors hover:bg-slate-500/20",title:t?"Switch to dark mode":"Switch to light mode",children:t?l.jsx(Ag,{size:20,style:{color:"var(--app-muted)"}}):l.jsx(zg,{size:20,style:{color:"var(--app-muted)"}})})]})}),l.jsx("nav",{className:"p-4",children:l.jsx("ul",{className:"space-y-2",children:Dg.map(({path:s,label:r,icon:a})=>l.jsx("li",{children:l.jsxs(de,{to:s,"data-active":e.pathname===s,className:"nav-link",children:[l.jsx(a,{size:20}),r]})},s))})})]}),l.jsx("main",{className:"flex-1 overflow-auto",children:l.jsx(Uh,{})})]})}const $g="/api/v1";class Ug{async fetch(t,n){const s=await fetch(`${$g}${t}`,{...n,headers:{"Content-Type":"application/json",...n==null?void 0:n.headers}});if(!s.ok){const r=await s.json().catch(()=>({detail:"Unknown error"}));throw new Error(r.detail||`HTTP ${s.status}`)}return s.json()}async getStatus(){return this.fetch("/local/status")}async listScenarios(){return this.fetch("/local/scenarios")}async getScenario(t){return this.fetch(`/local/scenarios/${encodeURIComponent(t)}`)}async getScenarioGoals(t){return this.fetch(`/local/scenarios/${encodeURIComponent(t)}/goals`)}async getScenarioTools(t){return this.fetch(`/local/scenarios/${encodeURIComponent(t)}/tools`)}async listTools(){return this.fetch("/local/tools")}async getTool(t){return this.fetch(`/local/tools/${encodeURIComponent(t)}`)}async listAgents(){return this.fetch("/local/agents")}async getAgent(t){return this.fetch(`/local/agents/${encodeURIComponent(t)}`)}async listModels(){return this.fetch("/local/models")}async listRuns(){return this.fetch("/local/runs")}async getRun(t){return this.fetch(`/local/runs/${encodeURIComponent(t)}`)}async runScenario(t){return this.fetch("/local/run",{method:"POST",body:JSON.stringify(t)})}async compareModels(t){return this.fetch("/local/compare",{method:"POST",body:JSON.stringify(t)})}async listDatasets(){return this.fetch("/local/datasets")}async getDataset(t){return this.fetch(`/local/datasets/${encodeURIComponent(t)}`)}async saveDataset(t,n){return this.fetch("/local/datasets",{method:"POST",body:JSON.stringify({id:t,content:n})})}async updateDataset(t,n){return this.fetch(`/local/datasets/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({id:t,content:n})})}async deleteDataset(t){return this.fetch(`/local/datasets/${encodeURIComponent(t)}`,{method:"DELETE"})}async runDataset(t){return this.fetch("/local/run-dataset",{method:"POST",body:JSON.stringify(t)})}}class Bg extends Ug{async listProviders(){return(await this.fetch("/providers")).providers}async addProvider(t){return this.fetch("/providers",{method:"POST",body:JSON.stringify(t)})}async getProvider(t){return this.fetch(`/providers/${encodeURIComponent(t)}`)}async deleteProvider(t){await this.fetch(`/providers/${encodeURIComponent(t)}`,{method:"DELETE"})}async testProvider(t){return this.fetch(`/providers/${encodeURIComponent(t)}/test`,{method:"POST"})}}const Z=new Bg;function Hg(){const[e,t]=x.useState(null),[n,s]=x.useState(!0),[r,a]=x.useState(null),[i,o]=x.useState([]),[c,u]=x.useState(!0),[m,f]=x.useState(!1),[g,y]=x.useState(null),[j,v]=x.useState({}),[N,p]=x.useState({name:"",type:"ollama",base_url:"http://localhost:11434/v1"}),[d,h]=x.useState(null),[k,w]=x.useState(!1),R=async()=>{try{const A=await Z.listProviders();o(A)}catch{o([])}finally{u(!1)}},P=async A=>{A.preventDefault(),h(null),w(!0);try{await Z.addProvider(N),await R(),f(!1),p({name:"",type:"ollama",base_url:"http://localhost:11434/v1"})}catch(L){h(L instanceof Error?L.message:"Failed to add provider")}finally{w(!1)}},M=async A=>{y(A);try{const L=await Z.testProvider(A);v(U=>({...U,[A]:{success:L.success,message:L.success?`Connected! Found ${L.models_found.length} models (${L.latency_ms}ms)`:L.error||"Connection failed"}}))}catch(L){v(U=>({...U,[A]:{success:!1,message:L instanceof Error?L.message:"Test failed"}}))}finally{y(null)}},O=async A=>{if(confirm(`Delete provider "${A}"?`))try{await Z.deleteProvider(A),await R(),v(L=>{const U={...L};return delete U[A],U})}catch(L){alert(L instanceof Error?L.message:"Failed to delete provider")}},z=A=>{switch(A){case"ollama":return"http://localhost:11434/v1";case"lmstudio":return"http://localhost:1234/v1";case"vllm":return"http://localhost:8000/v1";default:return"http://localhost:8000/v1"}};return x.useEffect(()=>{fetch("/api/v1/local/status").then(A=>{if(!A.ok)throw new Error("Failed to fetch status");return A.json()}).then(t).catch(A=>a(A.message)).finally(()=>s(!1)),R()},[]),n?l.jsx("div",{className:"p-8 page",children:l.jsx("div",{className:"text-slate-400",children:"Loading..."})}):r?l.jsx("div",{className:"p-8 page",children:l.jsxs("div",{className:"text-red-400",children:["Error: ",r]})}):e?l.jsxs("div",{className:"p-8 page",children:[l.jsxs("div",{className:"mb-8",children:[l.jsx("h1",{className:"text-2xl font-semibold text-slate-100 mb-2",children:"Dashboard"}),l.jsxs("p",{className:"text-slate-400",children:["Root: ",l.jsx("code",{className:"panel-subtle px-2 py-1 rounded",children:e.root_dir})]})]}),l.jsxs("section",{className:"mb-8",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("h2",{className:"text-lg font-semibold text-slate-100 flex items-center gap-2",children:[l.jsx(hp,{size:20}),"Scenarios (",e.scenarios.length,")"]}),l.jsxs(de,{to:"/builder",className:"flex items-center gap-1 px-3 py-1.5 bg-orange-400 hover:bg-orange-300 text-slate-900 rounded-lg text-sm font-semibold",children:[l.jsx(Ne,{size:16}),"Create Scenario"]})]}),e.scenarios.length===0?l.jsx("p",{className:"text-slate-400",children:"No scenarios found in scenarios/"}):l.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.scenarios.map(A=>l.jsxs("div",{className:"panel-card p-4 hover:border-slate-600 transition-colors",children:[l.jsxs(de,{to:`/scenario/${A.id}`,className:"block mb-3",children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsx("h3",{className:"font-medium text-slate-100 mb-1 hover:text-orange-400 transition-colors",children:A.name}),l.jsx(ge,{size:16,className:"text-slate-600 mt-1 flex-shrink-0"})]}),l.jsx("p",{className:"text-sm text-slate-400 line-clamp-2",children:A.description||"No description"})]}),l.jsxs("div",{className:"flex justify-between items-center pt-2 border-t border-slate-700/40",children:[l.jsx("span",{className:"text-xs text-slate-500",children:A.relative_path}),l.jsxs(de,{to:`/run/${A.id}`,className:"flex items-center gap-1 px-3 py-1 bg-orange-400 text-slate-900 rounded hover:bg-orange-300 transition-colors text-sm font-medium",children:[l.jsx(Xt,{size:14}),"Run"]})]})]},A.id))})]}),l.jsxs("section",{className:"mb-8",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("h2",{className:"text-lg font-semibold text-slate-100 flex items-center gap-2",children:[l.jsx(wn,{size:20}),"Tools (",e.tools.length,")"]}),l.jsxs(de,{to:"/tool-builder",className:"flex items-center gap-1 px-3 py-1.5 bg-emerald-400 hover:bg-emerald-300 text-slate-900 rounded-lg text-sm font-semibold",children:[l.jsx(Ne,{size:16}),"Create Tool"]})]}),e.tools.length===0?l.jsx("p",{className:"text-slate-400",children:"No tools found in tools/"}):l.jsx("div",{className:"flex flex-wrap gap-2",children:e.tools.map(A=>l.jsx("span",{className:"px-3 py-1 panel-subtle rounded-full text-sm text-slate-200 border border-slate-700/60",children:A.name},A.id))})]}),l.jsxs("section",{className:"mb-8",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("h2",{className:"text-lg font-semibold text-slate-100 flex items-center gap-2",children:[l.jsx(Ao,{size:20}),"Local Providers (",i.length,")"]}),l.jsxs("button",{onClick:()=>f(!m),className:"flex items-center gap-1 px-3 py-1.5 bg-purple-500 hover:bg-purple-400 text-white rounded-lg text-sm font-semibold",children:[l.jsx(Ne,{size:16}),"Add Provider"]})]}),m&&l.jsxs("div",{className:"panel-card p-4 mb-4",children:[l.jsx("h3",{className:"text-sm font-semibold text-slate-200 mb-3",children:"Add Local Provider"}),l.jsxs("form",{onSubmit:P,className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-400 mb-1",children:"Name"}),l.jsx("input",{type:"text",value:N.name,onChange:A=>p({...N,name:A.target.value}),placeholder:"ollama-local",className:"w-full px-3 py-1.5 bg-slate-800 border border-slate-700 rounded text-sm text-slate-100 placeholder-slate-500",required:!0})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-400 mb-1",children:"Type"}),l.jsxs("select",{value:N.type,onChange:A=>{const L=A.target.value;p({...N,type:L,base_url:z(L)})},className:"w-full px-3 py-1.5 bg-slate-800 border border-slate-700 rounded text-sm text-slate-100",children:[l.jsx("option",{value:"ollama",children:"Ollama"}),l.jsx("option",{value:"lmstudio",children:"LM Studio"}),l.jsx("option",{value:"vllm",children:"vLLM"}),l.jsx("option",{value:"openai-compatible",children:"OpenAI Compatible"})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-400 mb-1",children:"Base URL"}),l.jsx("input",{type:"url",value:N.base_url,onChange:A=>p({...N,base_url:A.target.value}),placeholder:"http://localhost:11434/v1",className:"w-full px-3 py-1.5 bg-slate-800 border border-slate-700 rounded text-sm text-slate-100 placeholder-slate-500",required:!0})]}),d&&l.jsx("p",{className:"text-red-400 text-xs",children:d}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx("button",{type:"button",onClick:()=>f(!1),className:"px-3 py-1.5 text-slate-400 hover:text-slate-200 text-sm",children:"Cancel"}),l.jsx("button",{type:"submit",disabled:k,className:"px-3 py-1.5 bg-purple-500 hover:bg-purple-400 text-white rounded text-sm font-medium disabled:opacity-50",children:k?"Adding...":"Add Provider"})]})]})]}),c?l.jsx("p",{className:"text-slate-400",children:"Loading providers..."}):i.length===0?l.jsxs("div",{className:"text-slate-400",children:[l.jsx("p",{className:"mb-2",children:"No local providers configured."}),l.jsx("p",{className:"text-sm",children:"Add a provider to use local models like Ollama, LM Studio, or vLLM."})]}):l.jsx("div",{className:"grid gap-3",children:i.map(A=>{var L,U;return l.jsxs("div",{className:"panel-card p-4 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[A.status==="connected"?l.jsx(fl,{size:18,className:"text-green-400"}):A.status==="error"?l.jsx(Eo,{size:18,className:"text-red-400"}):l.jsx(nn,{size:18,className:"text-slate-500"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium text-slate-100",children:A.name}),l.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-slate-700 rounded text-slate-300",children:A.type}),A.enabled&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-green-900/50 text-green-400 rounded",children:"enabled"})]}),l.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:A.base_url}),((L=A.models)==null?void 0:L.length)>0&&l.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:A.models.map(B=>l.jsx("span",{className:"text-xs px-2 py-0.5 bg-emerald-900/40 border border-emerald-700/50 rounded text-emerald-300",children:B},B))}),(((U=A.models)==null?void 0:U.length)===0||!A.models)&&A.status==="connected"&&l.jsx("div",{className:"text-xs text-slate-500 mt-1",children:"No models available"}),j[A.name]&&l.jsx("div",{className:`text-xs mt-1 ${j[A.name].success?"text-green-400":"text-red-400"}`,children:j[A.name].message})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>M(A.name),disabled:g===A.name,className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-700 rounded disabled:opacity-50",title:"Test connection",children:l.jsx(Mg,{size:16,className:g===A.name?"animate-spin":""})}),l.jsx("button",{onClick:()=>O(A.name),className:"p-1.5 text-slate-400 hover:text-red-400 hover:bg-slate-700 rounded",title:"Delete provider",children:l.jsx(Ae,{size:16})})]})]},A.name)})})]})]}):null}function Vg(){const{scenarioId:e}=rp(),[t,n]=x.useState(null),[s,r]=x.useState([]),[a,i]=x.useState([]),[o,c]=x.useState(!0),[u,m]=x.useState(null),[f,g]=x.useState(new Set(["tools","evaluation","interaction"])),y=L=>{g(U=>{const B=new Set(U);return B.has(L)?B.delete(L):B.add(L),B})};if(x.useEffect(()=>{e&&(c(!0),Promise.all([Z.getScenario(e),Z.getScenarioGoals(e).catch(()=>[]),Z.getScenarioTools(e).catch(()=>[])]).then(([L,U,B])=>{n(L),r(U),i(B)}).catch(L=>m(L.message)).finally(()=>c(!1)))},[e]),o)return l.jsx("div",{className:"p-8 page",children:l.jsx("div",{className:"text-slate-400",children:"Loading scenario..."})});if(u||!t)return l.jsxs("div",{className:"p-8 page",children:[l.jsxs("div",{className:"text-red-400",children:["Error: ",u||"Scenario not found"]}),l.jsx(de,{to:"/",className:"text-orange-400 hover:underline mt-4 inline-block",children:"← Back to Dashboard"})]});const j=t.content||{},v=j.steps||[],N=j.mcp_servers||[],p=j.tools||{},d=j.tools_from||[],h=j.evaluation?j.evaluation.judge:null,k=j.evaluation,w=k==null?void 0:k.goals,R=k?k.max_score||((w==null?void 0:w.reduce((L,U)=>L+(U.points||0),0))??0):null,P=t.variables||[],M=v.length>0,O=j.category||null,z=j.tags||[],A=a.length>0?a.length:Object.keys(p).length;return l.jsxs("div",{className:"p-8 page max-w-5xl",children:[l.jsxs(de,{to:"/",className:"inline-flex items-center gap-1 text-slate-400 hover:text-slate-200 mb-6 text-sm",children:[l.jsx(Gs,{size:16}),"Back to Dashboard"]}),l.jsxs("div",{className:"panel-card p-6 mb-6",children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("h1",{className:"text-2xl font-semibold text-slate-100 mb-2",children:t.name}),l.jsx("p",{className:"text-slate-400 mb-4",children:t.description}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[O&&l.jsx("span",{className:"px-2 py-1 bg-purple-900/40 border border-purple-700/50 rounded text-xs text-purple-300",children:O}),z.map(L=>l.jsx("span",{className:"px-2 py-1 bg-slate-700/50 border border-slate-600/50 rounded text-xs text-slate-300",children:L},L))]})]}),l.jsxs("div",{className:"flex gap-2 ml-4",children:[l.jsxs(de,{to:`/builder?scenario=${e}`,className:"flex items-center gap-1.5 px-3 py-2 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded-lg text-sm font-medium transition-colors",children:[l.jsx(Lg,{size:16}),"Edit"]}),l.jsxs(de,{to:`/run/${e}`,className:"flex items-center gap-1.5 px-4 py-2 bg-orange-400 hover:bg-orange-300 text-slate-900 rounded-lg text-sm font-semibold transition-colors",children:[l.jsx(Xt,{size:16}),"Run"]})]})]}),l.jsxs("div",{className:"flex gap-6 mt-6 pt-4 border-t border-slate-700/60",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(vr,{size:16,className:"text-slate-500"}),l.jsx("span",{className:"text-slate-400",children:M?`Multi-turn (${v.length} steps)`:"Single-turn"})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(wn,{size:16,className:"text-slate-500"}),l.jsx("span",{className:"text-slate-400",children:N.length>0&&A===0?`${N.length} MCP server${N.length!==1?"s":""}`:`${A} tool${A!==1?"s":""}${N.length>0?` + ${N.length} MCP`:""}`})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(yi,{size:16,className:"text-slate-500"}),l.jsxs("span",{className:"text-slate-400",children:[s.length," goal",s.length!==1?"s":"",R&&` (${R} pt${R!==1?"s":""})`]})]}),P.length>0&&l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(ji,{size:16,className:"text-slate-500"}),l.jsxs("span",{className:"text-slate-400",children:[P.length," variables"]})]})]})]}),l.jsxs("div",{className:"panel-card mb-4",children:[l.jsxs("button",{onClick:()=>y("tools"),className:"w-full flex items-center justify-between p-4 text-left hover:bg-slate-800/30 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(wn,{size:18,className:"text-emerald-400"}),l.jsxs("h2",{className:"font-semibold text-slate-100",children:["Tools",N.length>0&&A===0?l.jsxs("span",{className:"ml-2 text-sm font-normal text-slate-400",children:["(",N.length," MCP server",N.length>1?"s":"",")"]}):l.jsxs("span",{className:"ml-2 text-sm font-normal text-slate-400",children:["(",A,N.length>0?` + ${N.length} MCP`:"",")"]})]})]}),f.has("tools")?l.jsx(pe,{size:18,className:"text-slate-500"}):l.jsx(ge,{size:18,className:"text-slate-500"})]}),f.has("tools")&&l.jsxs("div",{className:"px-4 pb-4 space-y-4",children:[N.length>0&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2",children:"MCP Servers"}),N.map(L=>{var U;return l.jsxs("div",{className:"p-3 bg-slate-800/50 border border-slate-700/60 rounded-lg mb-2",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Ao,{size:14,className:"text-cyan-400"}),l.jsx("span",{className:"font-medium text-slate-200",children:L.name}),l.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-cyan-900/40 text-cyan-300 rounded",children:"MCP"})]}),l.jsx("div",{className:"text-xs text-slate-500 mb-2",children:L.url?l.jsx("span",{className:"font-mono",children:L.url}):L.command?l.jsxs("span",{className:"font-mono",children:[L.command," ",(U=L.args)==null?void 0:U.join(" ")]}):null}),a.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(B=>l.jsx("span",{className:"text-xs px-2 py-1 bg-emerald-900/30 border border-emerald-700/40 rounded text-emerald-300",title:B.description,children:B.name},B.name))})]},L.name)})]}),d.length>0&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2",children:"Tool Libraries"}),l.jsx("div",{className:"flex flex-wrap gap-2",children:d.map(L=>l.jsx("span",{className:"px-3 py-1.5 bg-slate-800/50 border border-slate-700/60 rounded text-sm text-slate-300",children:L},L))})]}),Object.keys(p).length>0&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2",children:"Inline Tools (Mock)"}),l.jsx("div",{className:"space-y-2",children:Object.entries(p).map(([L,U])=>{const B=U,C=B.actions,E=C?Object.keys(C):[];return l.jsxs("div",{className:"p-3 bg-slate-800/50 border border-slate-700/60 rounded-lg",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(bn,{size:14,className:"text-yellow-400"}),l.jsx("span",{className:"font-medium text-slate-200",children:L}),l.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-900/40 text-yellow-300 rounded",children:"Mock"})]}),typeof B.description=="string"&&B.description&&l.jsx("p",{className:"text-xs text-slate-500 mb-2",children:B.description}),E.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1.5",children:E.map(_=>l.jsx("span",{className:"text-xs px-2 py-1 bg-slate-700/50 rounded text-slate-400",children:_},_))})]},L)})})]}),N.length===0&&d.length===0&&Object.keys(p).length===0&&l.jsx("p",{className:"text-slate-500 text-sm",children:"No tools configured"})]})]}),l.jsxs("div",{className:"panel-card mb-4",children:[l.jsxs("button",{onClick:()=>y("evaluation"),className:"w-full flex items-center justify-between p-4 text-left hover:bg-slate-800/30 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(yi,{size:18,className:"text-orange-400"}),l.jsxs("h2",{className:"font-semibold text-slate-100",children:["Evaluation",R&&l.jsxs("span",{className:"ml-2 text-sm font-normal text-slate-400",children:["(",R," pts max)"]})]})]}),f.has("evaluation")?l.jsx(pe,{size:18,className:"text-slate-500"}):l.jsx(ge,{size:18,className:"text-slate-500"})]}),f.has("evaluation")&&l.jsxs("div",{className:"px-4 pb-4 space-y-4",children:[s.length>0&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:"Goals"}),l.jsx("div",{className:"space-y-2",children:s.map(L=>{const U=j.evaluation,B=U==null?void 0:U.goals,C=B==null?void 0:B.find(S=>S.id===L.id),E=C==null?void 0:C.detection,_=E==null?void 0:E.type,b=C==null?void 0:C.points;return l.jsxs("div",{className:"flex items-start gap-3 p-3 bg-slate-800/50 border border-slate-700/60 rounded-lg",children:[l.jsx(fl,{size:16,className:"text-slate-600 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"font-medium text-slate-200",children:L.name}),L.outcome&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-blue-900/40 text-blue-300 rounded",children:"outcome"})]}),L.description&&l.jsx("p",{className:"text-xs text-slate-500",children:L.description})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[_&&l.jsx("span",{className:"text-xs px-2 py-1 bg-slate-700/50 rounded text-slate-400 font-mono",children:_}),b!==void 0&&l.jsxs("span",{className:"text-sm font-semibold text-orange-400",children:[b," pts"]})]})]},L.id)})})]}),h&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:"Judge"}),l.jsxs("div",{className:"p-3 bg-slate-800/50 border border-slate-700/60 rounded-lg",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Fg,{size:14,className:"text-purple-400"}),l.jsxs("span",{className:"font-medium text-slate-200 capitalize",children:[h.type," Judge"]}),h.model&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-purple-900/40 text-purple-300 rounded",children:h.model})]}),h.pass_threshold!==void 0&&l.jsxs("p",{className:"text-xs text-slate-500 mb-2",children:["Pass threshold: ",(h.pass_threshold*100).toFixed(0),"%"]}),h.rubric&&l.jsxs("details",{className:"text-xs",children:[l.jsx("summary",{className:"text-slate-400 cursor-pointer hover:text-slate-300",children:"View rubric"}),l.jsx("pre",{className:"mt-2 p-2 bg-slate-900 rounded text-slate-400 overflow-auto max-h-48 whitespace-pre-wrap",children:h.rubric})]})]})]}),s.length===0&&!h&&l.jsx("p",{className:"text-slate-500 text-sm",children:"No evaluation configured"})]})]}),l.jsxs("div",{className:"panel-card mb-4",children:[l.jsxs("button",{onClick:()=>y("interaction"),className:"w-full flex items-center justify-between p-4 text-left hover:bg-slate-800/30 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(vr,{size:18,className:"text-blue-400"}),l.jsxs("h2",{className:"font-semibold text-slate-100",children:["Interaction",l.jsxs("span",{className:"ml-2 text-sm font-normal text-slate-400",children:["(",M?"Multi-turn":"Single-turn",")"]})]})]}),f.has("interaction")?l.jsx(pe,{size:18,className:"text-slate-500"}):l.jsx(ge,{size:18,className:"text-slate-500"})]}),f.has("interaction")&&l.jsxs("div",{className:"px-4 pb-4 space-y-4",children:[typeof j.system_prompt=="string"&&j.system_prompt&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2",children:"System Prompt"}),l.jsx("pre",{className:"p-3 bg-slate-800/50 border border-slate-700/60 rounded-lg text-xs text-slate-300 overflow-auto max-h-48 whitespace-pre-wrap",children:j.system_prompt})]}),M&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:"Steps"}),l.jsx("div",{className:"space-y-2",children:v.map((L,U)=>{var B;return l.jsxs("div",{className:"flex items-start gap-3 p-3 bg-slate-800/50 border border-slate-700/60 rounded-lg",children:[l.jsx("div",{className:"w-6 h-6 rounded-full bg-blue-900/40 border border-blue-700/50 flex items-center justify-center text-xs text-blue-300 flex-shrink-0",children:U+1}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"font-medium text-slate-200",children:L.id}),l.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-slate-700/50 text-slate-400 rounded font-mono",children:L.action})]}),typeof((B=L.params)==null?void 0:B.content)=="string"&&L.params.content&&l.jsxs("p",{className:"text-xs text-slate-500 line-clamp-2",children:[L.params.content.substring(0,100),L.params.content.length>100&&"..."]})]})]},L.id)})})]}),!M&&typeof j.prompt=="string"&&j.prompt&&l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2",children:"Prompt"}),l.jsx("pre",{className:"p-3 bg-slate-800/50 border border-slate-700/60 rounded-lg text-xs text-slate-300 overflow-auto max-h-48 whitespace-pre-wrap",children:j.prompt})]})]})]}),P.length>0&&l.jsxs("div",{className:"panel-card mb-4",children:[l.jsxs("button",{onClick:()=>y("variables"),className:"w-full flex items-center justify-between p-4 text-left hover:bg-slate-800/30 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ji,{size:18,className:"text-indigo-400"}),l.jsxs("h2",{className:"font-semibold text-slate-100",children:["Variables (",P.length,")"]})]}),f.has("variables")?l.jsx(pe,{size:18,className:"text-slate-500"}):l.jsx(ge,{size:18,className:"text-slate-500"})]}),f.has("variables")&&l.jsx("div",{className:"px-4 pb-4",children:l.jsx("div",{className:"grid gap-2",children:P.map(L=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-800/50 border border-slate-700/60 rounded-lg",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("code",{className:"text-sm font-mono text-indigo-300",children:`{{${L.name}}}`}),l.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-slate-700/50 text-slate-400 rounded",children:L.type}),L.required&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-red-900/40 text-red-300 rounded",children:"required"})]}),L.default!==void 0&&l.jsxs("span",{className:"text-xs text-slate-500",children:["default: ",JSON.stringify(L.default)]})]},L.name))})})]}),l.jsxs("div",{className:"panel-card",children:[l.jsxs("button",{onClick:()=>y("file"),className:"w-full flex items-center justify-between p-4 text-left hover:bg-slate-800/30 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Hr,{size:18,className:"text-slate-500"}),l.jsx("h2",{className:"font-semibold text-slate-100",children:"File"})]}),f.has("file")?l.jsx(pe,{size:18,className:"text-slate-500"}):l.jsx(ge,{size:18,className:"text-slate-500"})]}),f.has("file")&&l.jsx("div",{className:"px-4 pb-4",children:l.jsx("p",{className:"text-xs text-slate-500 font-mono",children:t.path})})]})]})}function Wg(){const[e,t]=x.useState("idle"),[n,s]=x.useState(null),[r,a]=x.useState(null),[i,o]=x.useState(null),c=x.useCallback(()=>{t("idle"),s(null),a(null),o(null)},[]),u=x.useCallback(async(f,g,y,j)=>{c(),t("running");try{const v=await Z.runScenario({scenario_id:f,model:g,variables:y,mlflow_export:j==null?void 0:j.enabled,mlflow_tracking_uri:j==null?void 0:j.trackingUri,mlflow_experiment:j==null?void 0:j.experiment,mlflow_tracing:j==null?void 0:j.tracing});v.error?(t("error"),o(v.error)):(t("completed"),s(v))}catch(v){t("error"),o(v instanceof Error?v.message:"Unknown error")}},[c]),m=x.useCallback(async(f,g,y=1,j,v)=>{c(),t("running");try{const N=await Z.compareModels({scenario_id:f,models:g,runs_per_model:y,variables:j,mlflow_export:v==null?void 0:v.enabled,mlflow_tracking_uri:v==null?void 0:v.trackingUri,mlflow_experiment:v==null?void 0:v.experiment,mlflow_tracing:v==null?void 0:v.tracing});t("completed"),a(N)}catch(N){t("error"),o(N instanceof Error?N.message:"Unknown error")}},[c]);return{state:e,result:n,comparison:r,error:i,runScenario:u,compareModels:m,reset:c}}function jp(e){return e==null?"-":e<1e-4?"<$0.0001":e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function Mo({result:e}){var s,r,a;const[t,n]=x.useState(!1);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:[e.evaluation&&l.jsxs("div",{className:"panel-card p-4 col-span-2 md:col-span-1",children:[l.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[l.jsx(Lo,{className:"w-4 h-4"}),"Score"]}),l.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.evaluation.percentage.toFixed(0),"%"]}),l.jsxs("div",{className:"text-xs text-slate-500",children:[e.evaluation.total_score.toFixed(0)," / ",e.evaluation.max_score.toFixed(0)," pts"]})]}),l.jsxs("div",{className:"panel-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[l.jsx(_o,{className:"w-4 h-4"}),"Latency"]}),l.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[((e.latency_ms||0)/1e3).toFixed(1),"s"]})]}),l.jsxs("div",{className:"panel-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[l.jsx(vr,{className:"w-4 h-4"}),"Messages"]}),l.jsx("div",{className:"text-2xl font-bold text-slate-100",children:((s=e.history)==null?void 0:s.length)||0})]}),l.jsxs("div",{className:"panel-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[l.jsx(bn,{className:"w-4 h-4"}),"Tool Calls"]}),l.jsx("div",{className:"text-2xl font-bold text-slate-100",children:((r=e.tool_calls)==null?void 0:r.length)||0})]}),l.jsxs("div",{className:"panel-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[l.jsx(Tg,{className:"w-4 h-4"}),"Tokens"]}),l.jsx("div",{className:"text-2xl font-bold text-slate-100",children:((e.input_tokens||0)+(e.output_tokens||0)).toLocaleString()}),l.jsxs("div",{className:"text-xs text-slate-500",children:[(e.input_tokens||0).toLocaleString()," in / ",(e.output_tokens||0).toLocaleString()," out"]})]}),l.jsxs("div",{className:"panel-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[l.jsx(To,{className:"w-4 h-4"}),"Cost"]}),l.jsx("div",{className:"text-2xl font-bold text-emerald-300",children:jp(e.cost_usd)})]})]}),e.evaluation&&e.evaluation.goals&&e.evaluation.goals.length>0&&l.jsxs("div",{className:"panel-card p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Goals"}),l.jsx("div",{className:"space-y-3",children:e.evaluation.goals.map(i=>l.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${i.achieved?"bg-emerald-500/10 border-emerald-400/40":"bg-slate-950/40 border-slate-800/70"}`,children:[l.jsxs("div",{className:"flex items-center gap-3",children:[i.achieved?l.jsx(fl,{className:"w-5 h-5 text-emerald-400"}):l.jsx(Eo,{className:"w-5 h-5 text-slate-500"}),l.jsxs("div",{children:[l.jsx("div",{className:"font-medium text-slate-100",children:i.name||i.id}),i.reason&&l.jsx("div",{className:"text-sm text-slate-400",children:i.reason})]})]}),l.jsxs("div",{className:`font-bold ${i.achieved?"text-emerald-300":"text-slate-500"}`,children:[i.achieved?`+${i.points}`:"0"," pts"]})]},i.id))})]}),((a=e.evaluation)==null?void 0:a.judge)&&l.jsxs("div",{className:"panel-card p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Judge Evaluation"}),l.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[l.jsxs("div",{className:`text-3xl font-bold ${e.evaluation.judge.passed?"text-emerald-300":"text-red-400"}`,children:[(e.evaluation.judge.score*100).toFixed(0),"%"]}),l.jsx("div",{className:`px-3 py-1 rounded-full text-sm ${e.evaluation.judge.passed?"bg-emerald-500/15 text-emerald-300":"bg-red-900/50 text-red-400"}`,children:e.evaluation.judge.passed?"Passed":"Failed"})]}),l.jsx("p",{className:"text-slate-400",children:e.evaluation.judge.reasoning})]}),e.response&&l.jsxs("div",{className:"panel-card p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Response"}),l.jsx("div",{className:"panel-subtle rounded-lg p-4 whitespace-pre-wrap text-slate-200",children:e.response||"(No response)"})]}),e.history&&e.history.length>0&&l.jsxs("div",{className:"panel-card",children:[l.jsxs("button",{onClick:()=>n(!t),className:"w-full p-4 text-left flex items-center justify-between hover:bg-slate-800/60 transition-colors rounded-lg",children:[l.jsxs("span",{className:"font-semibold text-slate-100",children:["Conversation History (",e.history.length," messages)"]}),l.jsx("span",{className:"text-slate-400",children:t?"Hide":"Show"})]}),t&&l.jsx("div",{className:"px-6 pb-6 space-y-4",children:e.history.map((i,o)=>l.jsxs("div",{className:`p-3 rounded-lg ${i.role==="user"?"bg-orange-500/10 border border-orange-400/40":i.role==="assistant"?"panel-subtle":i.role==="tool"?"bg-amber-500/10 border border-amber-400/40":"panel-subtle"}`,children:[l.jsx("div",{className:"text-xs font-medium text-slate-500 mb-1 uppercase",children:i.role}),l.jsx("div",{className:"text-slate-200 whitespace-pre-wrap text-sm",children:i.content||"(empty)"})]},o))})]}),e.tool_calls&&e.tool_calls.length>0&&l.jsxs("div",{className:"panel-card p-6",children:[l.jsxs("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:["Tool Calls (",e.tool_calls.length,")"]}),l.jsx("div",{className:"space-y-3",children:e.tool_calls.map((i,o)=>l.jsx(Yg,{call:i},o))})]}),e.error&&l.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-red-500 bg-red-950/30",children:[l.jsxs("div",{className:"flex items-center gap-2 text-red-400 mb-1",children:[l.jsx(nn,{className:"w-4 h-4"}),l.jsx("span",{className:"font-medium",children:"Error"})]}),l.jsx("p",{className:"text-sm text-red-300",children:e.error})]})]})}function uu(e){if(typeof e=="string")try{const t=JSON.parse(e);return JSON.stringify(t,null,2)}catch{return e}return JSON.stringify(e,null,2)}function Yg({call:e}){const[t,n]=x.useState(!1),s=e.result!==void 0&&e.result!==null,r=e.error!==void 0&&e.error!==null;return l.jsxs("div",{className:`panel-subtle rounded-lg overflow-hidden ${e.success?"":"border border-red-500/30"}`,children:[l.jsxs("button",{onClick:()=>n(!t),className:"w-full p-4 text-left flex items-center justify-between hover:bg-slate-800/40 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[t?l.jsx(pe,{className:"w-4 h-4 text-slate-500"}):l.jsx(ge,{className:"w-4 h-4 text-slate-500"}),l.jsxs("code",{className:"text-orange-300",children:[e.tool,".",e.action,"()"]})]}),l.jsx("span",{className:`text-sm ${e.success?"text-emerald-300":"text-red-400"}`,children:e.success?"✓ Success":"✗ Failed"})]}),t&&l.jsxs("div",{className:"px-4 pb-4 space-y-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-medium text-slate-500 mb-1",children:"Arguments"}),l.jsx("pre",{className:"text-xs text-slate-400 overflow-auto bg-slate-950/50 rounded p-2",children:uu(e.args)})]}),s&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-medium text-emerald-400 mb-1",children:"Result"}),l.jsx("pre",{className:"text-xs text-slate-400 overflow-auto bg-emerald-950/30 rounded p-2 max-h-48",children:uu(e.result)})]}),r&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-medium text-red-400 mb-1",children:"Error"}),l.jsx("pre",{className:"text-xs text-red-300 overflow-auto bg-red-950/30 rounded p-2",children:e.error})]})]})]})}function Qg(e){var o;const t=e.ranking||[],n=[];for(const c of t){const u=(o=e.stats)==null?void 0:o[c];if(!u)continue;const m=u.avg_score||0,f=u.avg_cost_usd||0,g=u.avg_latency_ms||0,y=f>0?m/(f*100):m>0?1/0:0;n.push({modelId:c,score:m,cost:f,latency:g,efficiency:y,badges:[]})}if(n.length===0)return n;const s=n.reduce((c,u)=>c.score>u.score?c:u),r=n.reduce((c,u)=>c.efficiency>u.efficiency?c:u),a=n.filter(c=>c.score>=s.score*.7),i=a.length>0?a.reduce((c,u)=>c.latency<u.latency?c:u):null;for(const c of n)c.modelId===s.modelId&&c.badges.push("quality"),c.modelId===r.modelId&&r.cost>0&&c.badges.push("value"),i&&c.modelId===i.modelId&&c.badges.push("fast");return n}function qg({type:e}){switch(e){case"quality":return l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-amber-500/20 text-amber-300 border border-amber-500/30",children:[l.jsx(Lo,{className:"w-3 h-3"})," Best Quality"]});case"value":return l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",children:[l.jsx(To,{className:"w-3 h-3"})," Best Value"]});case"fast":return l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-blue-500/20 text-blue-300 border border-blue-500/30",children:[l.jsx(bn,{className:"w-3 h-3"})," Fastest"]});default:return null}}function Jg({run:e,onClose:t}){return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70",onClick:t,children:l.jsxs("div",{className:"bg-slate-900 rounded-xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col",onClick:n=>n.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-800",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-slate-100",children:"Run Details"}),l.jsx("p",{className:"text-sm text-slate-400",children:e.model})]}),l.jsx("button",{onClick:t,className:"p-2 text-slate-400 hover:text-slate-100 hover:bg-slate-800 rounded-lg",children:l.jsx(Nt,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"overflow-auto p-4",children:l.jsx(Mo,{result:e})})]})})}function Np({comparison:e}){var m,f,g,y,j,v,N,p;const[t,n]=x.useState(null),[s,r]=x.useState(null),a=e.ranking||[],i=Qg(e),o=new Map(i.map(d=>[d.modelId,d])),c=new Map;if(e.results)for(const d of e.results){const h=c.get(d.model)||[];h.push(d),c.set(d.model,h)}const u=e.results&&e.results.length>0;return l.jsxs(l.Fragment,{children:[s&&l.jsx(Jg,{run:s,onClose:()=>r(null)}),l.jsxs("div",{className:"space-y-6",children:[i.length>0&&l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.find(d=>d.badges.includes("quality"))&&l.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-amber-400",children:[l.jsxs("div",{className:"flex items-center gap-2 text-amber-300 mb-1",children:[l.jsx(Lo,{className:"w-4 h-4"}),l.jsx("span",{className:"text-sm font-medium",children:"Best Quality"})]}),l.jsx("div",{className:"text-lg font-semibold text-slate-100",children:((m=i.find(d=>d.badges.includes("quality")))==null?void 0:m.modelId.split("/")[1])||((f=i.find(d=>d.badges.includes("quality")))==null?void 0:f.modelId)}),l.jsxs("div",{className:"text-xs text-slate-400 mt-1",children:["Highest score: ",(g=i.find(d=>d.badges.includes("quality")))==null?void 0:g.score.toFixed(1)," pts"]})]}),i.find(d=>d.badges.includes("value"))&&l.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-emerald-400",children:[l.jsxs("div",{className:"flex items-center gap-2 text-emerald-300 mb-1",children:[l.jsx(To,{className:"w-4 h-4"}),l.jsx("span",{className:"text-sm font-medium",children:"Best Value"})]}),l.jsx("div",{className:"text-lg font-semibold text-slate-100",children:((y=i.find(d=>d.badges.includes("value")))==null?void 0:y.modelId.split("/")[1])||((j=i.find(d=>d.badges.includes("value")))==null?void 0:j.modelId)}),l.jsx("div",{className:"text-xs text-slate-400 mt-1",children:(()=>{const d=i.find(R=>R.badges.includes("value")),h=i.find(R=>R.badges.includes("quality"));if(!d||!h)return"";if(d.cost===0)return"Free!";if(d.modelId===h.modelId)return"Also the best quality!";const k=Math.round(d.score/h.score*100),w=h.cost>0?Math.round(d.cost/h.cost*100):0;return w===0?`${k}% quality, nearly free`:`${k}% quality at ${w}% cost`})()})]}),i.find(d=>d.badges.includes("fast"))&&l.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-blue-400",children:[l.jsxs("div",{className:"flex items-center gap-2 text-blue-300 mb-1",children:[l.jsx(bn,{className:"w-4 h-4"}),l.jsx("span",{className:"text-sm font-medium",children:"Fastest"})]}),l.jsx("div",{className:"text-lg font-semibold text-slate-100",children:((v=i.find(d=>d.badges.includes("fast")))==null?void 0:v.modelId.split("/")[1])||((N=i.find(d=>d.badges.includes("fast")))==null?void 0:N.modelId)}),l.jsxs("div",{className:"text-xs text-slate-400 mt-1",children:[((((p=i.find(d=>d.badges.includes("fast")))==null?void 0:p.latency)||0)/1e3).toFixed(1),"s avg latency"]})]})]}),l.jsxs("div",{className:"panel-card overflow-hidden",children:[l.jsxs("div",{className:"p-4 border-b border-slate-800/70",children:[l.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Model Comparison"}),l.jsxs("p",{className:"text-sm text-slate-400",children:[e.runs_per_model," run(s) per model"]})]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{className:"bg-slate-950/70",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-4 py-3 text-left text-sm font-medium text-slate-400",children:"Rank"}),l.jsx("th",{className:"px-4 py-3 text-left text-sm font-medium text-slate-400",children:"Model"}),l.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Score"}),l.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Judge"}),l.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Latency"}),l.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Tokens"}),l.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Cost"})]})}),l.jsx("tbody",{children:a.map((d,h)=>{var M,O;const k=(M=e.stats)==null?void 0:M[d],w=o.get(d),R=c.get(d)||[],P=t===d;return k?l.jsxs(l.Fragment,{children:[l.jsxs("tr",{className:`border-t border-slate-800/70 hover:bg-slate-900/40 ${u?"cursor-pointer":""}`,onClick:()=>u&&n(P?null:d),children:[l.jsx("td",{className:"px-4 py-3",children:l.jsxs("div",{className:"flex items-center gap-2",children:[u&&(P?l.jsx(pe,{className:"w-4 h-4 text-slate-500"}):l.jsx(ge,{className:"w-4 h-4 text-slate-500"})),l.jsxs("span",{className:`font-bold ${h===0?"text-amber-300":"text-slate-400"}`,children:["#",h+1]})]})}),l.jsxs("td",{className:"px-4 py-3",children:[l.jsx("div",{className:"text-slate-100 font-medium",children:d}),w&&w.badges.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:w.badges.map(z=>l.jsx(qg,{type:z},z))})]}),l.jsx("td",{className:"px-4 py-3 text-right text-slate-100 font-semibold",children:((O=k.avg_score)==null?void 0:O.toFixed(1))||"0"}),l.jsx("td",{className:"px-4 py-3 text-right text-slate-400",children:k.avg_judge_score!=null?`${(k.avg_judge_score*100).toFixed(0)}%`:"-"}),l.jsxs("td",{className:"px-4 py-3 text-right text-slate-400",children:[((k.avg_latency_ms||0)/1e3).toFixed(1),"s"]}),l.jsx("td",{className:"px-4 py-3 text-right text-slate-400",children:((k.total_input_tokens||0)+(k.total_output_tokens||0)).toLocaleString()}),l.jsx("td",{className:"px-4 py-3 text-right text-emerald-300 font-medium",children:jp(k.avg_cost_usd)})]},d),P&&R.length>0&&l.jsx("tr",{children:l.jsx("td",{colSpan:7,className:"px-4 py-2 bg-slate-950/50",children:l.jsxs("div",{className:"ml-8 space-y-2",children:[l.jsxs("div",{className:"text-sm font-medium text-slate-400 mb-2",children:["Individual Runs (",R.length,")"]}),R.map((z,A)=>{var L,U,B;return l.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-slate-900/50 border border-slate-800/50 hover:bg-slate-800/50 cursor-pointer",onClick:C=>{C.stopPropagation(),r(z)},children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-slate-500 text-sm",children:["Run ",A+1]}),l.jsxs("span",{className:"text-slate-100 font-medium",children:[((U=(L=z.evaluation)==null?void 0:L.percentage)==null?void 0:U.toFixed(0))||0,"%"]}),((B=z.evaluation)==null?void 0:B.judge)&&l.jsx("span",{className:`text-sm ${z.evaluation.judge.passed?"text-emerald-300":"text-red-400"}`,children:z.evaluation.judge.passed?"✓ Passed":"✗ Failed"}),z.error&&l.jsxs("span",{className:"text-sm text-red-400 flex items-center gap-1",children:[l.jsx(nn,{className:"w-3 h-3"})," Error"]})]}),l.jsxs("button",{className:"flex items-center gap-1 text-sm text-orange-300 hover:text-orange-200",onClick:C=>{C.stopPropagation(),r(z)},children:[l.jsx(xp,{className:"w-4 h-4"}),"View Details"]})]},A)})]})})},`${d}-runs`)]}):null})})]})})]}),e.stats&&Object.values(e.stats).some(d=>d.goal_rates&&Object.keys(d.goal_rates).length>0)&&l.jsxs("div",{className:"panel-card p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Goal Achievement Rates"}),(()=>{const d=new Set;return Object.values(e.stats).forEach(h=>{h.goal_rates&&Object.keys(h.goal_rates).forEach(k=>d.add(k))}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{className:"bg-slate-950/70",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-4 py-3 text-left text-sm font-medium text-slate-400",children:"Model"}),Array.from(d).map(h=>l.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:h},h))]})}),l.jsx("tbody",{children:a.map(h=>{var w;const k=(w=e.stats)==null?void 0:w[h];return k?l.jsxs("tr",{className:"border-t border-slate-800/70",children:[l.jsx("td",{className:"px-4 py-3 text-slate-100 font-medium",children:h}),Array.from(d).map(R=>{var M;const P=((M=k.goal_rates)==null?void 0:M[R])??0;return l.jsx("td",{className:"px-4 py-3 text-right",children:l.jsxs("span",{className:P>=100?"text-emerald-300":P>=50?"text-amber-300":"text-red-400",children:[P.toFixed(0),"%"]})},R)})]},h):null})})]})})})()]})]})]})}function As(){return l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-emerald-500/20 border border-emerald-500/40 rounded text-xs text-emerald-400",children:[l.jsx(gp,{size:10}),"Local"]})}function du({models:e,value:t,onChange:n,disabled:s,placeholder:r="Select a model..."}){const[a,i]=x.useState(!1),[o,c]=x.useState(""),u=x.useRef(null),m=x.useRef(null),f=e.find(p=>p.id===t);x.useEffect(()=>{const p=d=>{u.current&&!u.current.contains(d.target)&&i(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),x.useEffect(()=>{a&&m.current&&m.current.focus()},[a]);const g=e.filter(p=>p.name.toLowerCase().includes(o.toLowerCase())||p.id.toLowerCase().includes(o.toLowerCase())),y=g.reduce((p,d)=>{const h=d.provider_name||d.id.split("/")[0]||"other";return p[h]||(p[h]=[]),p[h].push(d),p},{}),j=["openai","anthropic","google","x-ai","deepseek","meta-llama","mistralai","qwen","perplexity"],v=p=>{var d;return(d=y[p])==null?void 0:d.some(h=>h.is_local)},N=Object.keys(y).sort((p,d)=>{const h=v(p),k=v(d);if(h&&!k)return-1;if(!h&&k)return 1;const w=j.indexOf(p),R=j.indexOf(d);return w===-1&&R===-1?p.localeCompare(d):w===-1?1:R===-1?-1:w-R});return l.jsxs("div",{ref:u,className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>!s&&i(!a),disabled:s,className:`w-full flex items-center justify-between gap-2 px-4 py-2.5 panel-subtle text-left transition-colors ${s?"opacity-50 cursor-not-allowed":"hover:bg-slate-800 cursor-pointer"} ${a?"ring-2 ring-orange-400":""}`,children:[f?l.jsxs("div",{className:"flex items-center justify-between flex-1 min-w-0 gap-2",children:[l.jsx("span",{className:"text-slate-100 truncate",children:f.name}),f.is_local&&l.jsx(As,{}),l.jsx("span",{className:"text-xs text-slate-500 shrink-0",children:f.price})]}):l.jsx("span",{className:"text-slate-500",children:r}),l.jsx(pe,{size:18,className:`text-slate-400 shrink-0 transition-transform ${a?"rotate-180":""}`})]}),a&&l.jsxs("div",{className:"absolute z-50 w-full mt-1 panel-card border border-slate-700/80 dark:border-slate-700/80 shadow-xl max-h-[28rem] overflow-hidden flex flex-col",children:[l.jsx("div",{className:"p-2 border-b border-slate-800/70",children:l.jsxs("div",{className:"relative",children:[l.jsx(Po,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),l.jsx("input",{ref:m,type:"text",value:o,onChange:p=>c(p.target.value),placeholder:"Search models...",className:"w-full pl-9 pr-3 py-2 bg-slate-900 border border-slate-800/70 rounded text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:border-orange-400/60"})]})}),l.jsxs("div",{className:"overflow-y-auto flex-1",children:[N.map(p=>l.jsxs("div",{children:[l.jsxs("div",{className:"px-3 py-1.5 text-xs font-medium text-slate-500 uppercase bg-slate-900 sticky top-0 flex items-center gap-2",children:[p,v(p)&&l.jsx(As,{})]}),y[p].map(d=>l.jsxs("button",{type:"button",onClick:()=>{n(d.id),i(!1),c("")},className:`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors ${d.id===t?"bg-orange-500/20 text-orange-300":"hover:bg-slate-800 text-slate-100"}`,children:[l.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[l.jsx("div",{className:"truncate",children:d.name}),d.is_local&&!v(p)&&l.jsx(As,{})]}),l.jsx("span",{className:"text-xs text-slate-500 shrink-0",children:d.price}),d.id===t&&l.jsx(Xs,{size:16,className:"text-orange-400 shrink-0"})]},d.id))]},p)),g.length===0&&l.jsx("div",{className:"px-3 py-4 text-center text-slate-500 text-sm",children:"No models found"})]})]})]})}function Kg({models:e,selected:t,onChange:n,disabled:s}){const[r,a]=x.useState(!1),[i,o]=x.useState(""),c=x.useRef(null),u=x.useRef(null);x.useEffect(()=>{const p=d=>{c.current&&!c.current.contains(d.target)&&a(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),x.useEffect(()=>{r&&u.current&&u.current.focus()},[r]);const m=p=>{t.includes(p)?n(t.filter(d=>d!==p)):n([...t,p])},f=(p,d)=>{d.stopPropagation(),n(t.filter(h=>h!==p))},g=e.filter(p=>p.name.toLowerCase().includes(i.toLowerCase())||p.id.toLowerCase().includes(i.toLowerCase())),y=g.reduce((p,d)=>{const h=d.provider_name||d.id.split("/")[0]||"other";return p[h]||(p[h]=[]),p[h].push(d),p},{}),j=["openai","anthropic","google","x-ai","deepseek","meta-llama","mistralai","qwen","perplexity"],v=p=>{var d;return(d=y[p])==null?void 0:d.some(h=>h.is_local)},N=Object.keys(y).sort((p,d)=>{const h=v(p),k=v(d);if(h&&!k)return-1;if(!h&&k)return 1;const w=j.indexOf(p),R=j.indexOf(d);return w===-1&&R===-1?p.localeCompare(d):w===-1?1:R===-1?-1:w-R});return l.jsxs("div",{ref:c,className:"relative",children:[t.length>0&&l.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(p=>{const d=e.find(h=>h.id===p);return l.jsxs("span",{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full text-sm text-slate-100 ${d!=null&&d.is_local?"bg-emerald-500/20 border border-emerald-400/40":"bg-orange-500/20 border border-orange-400/40"}`,children:[(d==null?void 0:d.is_local)&&l.jsx(gp,{size:12,className:"text-emerald-400"}),(d==null?void 0:d.name)||p,l.jsx("button",{type:"button",onClick:h=>f(p,h),className:"hover:text-red-400 transition-colors",disabled:s,children:l.jsx(Nt,{size:14})})]},p)})}),l.jsxs("button",{type:"button",onClick:()=>!s&&a(!r),disabled:s,className:`w-full flex items-center justify-between gap-2 px-4 py-2.5 panel-subtle text-left transition-colors ${s?"opacity-50 cursor-not-allowed":"hover:bg-slate-800 cursor-pointer"} ${r?"ring-2 ring-orange-400":""}`,children:[l.jsx("span",{className:"text-slate-500",children:t.length===0?"Click to add models...":"Add more models..."}),l.jsx(pe,{size:18,className:`text-slate-400 shrink-0 transition-transform ${r?"rotate-180":""}`})]}),r&&l.jsxs("div",{className:"absolute z-50 w-full mt-1 panel-card border border-slate-700/80 dark:border-slate-700/80 shadow-xl max-h-[28rem] overflow-hidden flex flex-col",children:[l.jsx("div",{className:"p-2 border-b border-slate-800/70",children:l.jsxs("div",{className:"relative",children:[l.jsx(Po,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),l.jsx("input",{ref:u,type:"text",value:i,onChange:p=>o(p.target.value),placeholder:"Search models...",className:"w-full pl-9 pr-3 py-2 bg-slate-900 border border-slate-800/70 rounded text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:border-orange-400/60"})]})}),l.jsxs("div",{className:"overflow-y-auto flex-1",children:[N.map(p=>l.jsxs("div",{children:[l.jsxs("div",{className:"px-3 py-1.5 text-xs font-medium text-slate-500 uppercase bg-slate-900 sticky top-0 flex items-center gap-2",children:[p,v(p)&&l.jsx(As,{})]}),y[p].map(d=>{const h=t.includes(d.id);return l.jsxs("button",{type:"button",onClick:()=>m(d.id),className:`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors ${h?"bg-orange-500/20 text-orange-300":"hover:bg-slate-800 text-slate-100"}`,children:[l.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center shrink-0 ${h?"bg-orange-400 border-orange-400":"border-slate-600"}`,children:h&&l.jsx(Xs,{size:12,className:"text-slate-900"})}),l.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[l.jsx("div",{className:"truncate",children:d.name}),d.is_local&&!v(p)&&l.jsx(As,{})]}),l.jsx("span",{className:"text-xs text-slate-500 shrink-0",children:d.price})]},d.id)})]},p)),g.length===0&&l.jsx("div",{className:"px-3 py-4 text-center text-slate-500 text-sm",children:"No models found"})]})]})]})}function fu(){var Ho;const{scenarioId:e}=rp(),[t]=yg(),n=t.get("dataset"),s=parseInt(t.get("parallel")||"5"),[r,a]=x.useState([]),[i,o]=x.useState(null),[c,u]=x.useState(e||""),[m,f]=x.useState([]),[g,y]=x.useState(""),[j,v]=x.useState([]),[N,p]=x.useState(n?"dataset":"single"),[d,h]=x.useState(1),[k,w]=x.useState({}),[R,P]=x.useState(!0),[M,O]=x.useState(null),[z,A]=x.useState([]),[L,U]=x.useState(n||""),[B,C]=x.useState(null),[E,_]=x.useState(!1),[b,S]=x.useState(s),[T,D]=x.useState(!1),[H,te]=x.useState(!1),[X,lt]=x.useState(""),[Fe,rt]=x.useState(""),[Cn,pl]=x.useState(!0),{state:ae,result:Ot,comparison:Uo,error:Bo,runScenario:dm,compareModels:fm}=Wg();x.useEffect(()=>{(async()=>{try{const[Oe,He,xm]=await Promise.all([Z.listScenarios(),Z.listModels(),Z.listDatasets()]);if(a(Oe),f(He),A(xm),He.length>0&&y(He[0].id),e){u(e);const Vo=await Z.getScenario(e);o(Vo);const Wo={};for(const Yo of Vo.variables||[])Wo[Yo.name]=Yo.default??"";w(Wo)}}catch(Oe){O(Oe instanceof Error?Oe.message:"Failed to load data")}finally{P(!1)}})()},[e]),x.useEffect(()=>{c&&c!==e&&Z.getScenario(c).then(V=>{o(V);const Oe={};for(const He of V.variables||[])Oe[He.name]=He.default??"";w(Oe)}).catch(V=>O(V.message))},[c,e]);const pm=async()=>{const V=c||e;if(!V)return;const Oe=T?{enabled:!0,trackingUri:X||void 0,experiment:Fe||void 0,tracing:Cn}:void 0;if(N==="dataset"){if(!L||!g)return;_(!0),C(null);try{const He=await Z.runDataset({scenario_id:V,dataset_id:L,model:g,parallel:b,mlflow_enabled:T,mlflow_experiment:Fe||void 0});C(He)}catch(He){O(He instanceof Error?He.message:"Dataset run failed")}finally{_(!1)}}else if(N==="single"){if(!g)return;await dm(V,g,k,Oe)}else{if(j.length===0)return;await fm(V,j,d,k,Oe)}},mm=(V,Oe)=>{w(He=>({...He,[V]:Oe}))};return R?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(cu,{className:"w-8 h-8 animate-spin text-orange-400"})}):M?l.jsx("div",{className:"p-8 page",children:l.jsx("div",{className:"panel-solid p-4 text-red-400 border border-red-700/60",children:M})}):l.jsxs("div",{className:"p-8 max-w-6xl mx-auto page",children:[l.jsxs(de,{to:"/",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100 mb-6",children:[l.jsx(Gs,{size:20}),"Back to Dashboard"]}),l.jsxs("div",{className:"mb-8",children:[l.jsx("h1",{className:"text-2xl font-semibold text-slate-100 mb-2",children:(i==null?void 0:i.name)||e}),(i==null?void 0:i.description)&&l.jsx("p",{className:"text-slate-400",children:i.description})]}),l.jsxs("div",{className:"panel-card p-6 mb-6",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h2",{className:"text-lg font-semibold text-slate-100",children:"Run Configuration"}),l.jsxs(de,{to:"/builder",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100 text-sm",children:[l.jsx(Og,{size:16}),"Edit Scenario"]})]}),!e&&l.jsxs("div",{className:"mb-6",children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Scenario"}),l.jsxs("select",{value:c,onChange:V=>u(V.target.value),disabled:ae==="running"||E,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400",children:[l.jsx("option",{value:"",children:"Select a scenario..."}),r.map(V=>l.jsx("option",{value:V.id,children:V.name},V.id))]})]}),l.jsxs("div",{className:"mb-6",children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Mode"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>p("single"),disabled:ae==="running"||E,className:`px-4 py-2 rounded-lg transition-colors ${N==="single"?"bg-orange-400 text-slate-900":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:"Single Model"}),l.jsx("button",{onClick:()=>p("compare"),disabled:ae==="running"||E,className:`px-4 py-2 rounded-lg transition-colors ${N==="compare"?"bg-orange-400 text-slate-900":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:"Compare Models"}),l.jsxs("button",{onClick:()=>p("dataset"),disabled:ae==="running"||E||z.length===0,className:`flex items-center gap-2 px-4 py-2 rounded-lg transition-colors ${N==="dataset"?"bg-blue-500 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:[l.jsx(sn,{size:16}),"Dataset Benchmark"]})]})]}),N==="single"?l.jsxs("div",{className:"mb-6",children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Model"}),l.jsx(du,{models:m,value:g,onChange:y,disabled:ae==="running"})]}):N==="compare"?l.jsxs("div",{className:"space-y-4 mb-6",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Models to Compare"}),l.jsx(Kg,{models:m,selected:j,onChange:v,disabled:ae==="running"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Runs per Model"}),l.jsx("input",{type:"number",min:1,max:10,value:d,onChange:V=>h(Math.max(1,Math.min(10,parseInt(V.target.value)||1))),disabled:ae==="running",className:"w-32 panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),l.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"More runs = more statistical significance"})]})]}):l.jsxs("div",{className:"space-y-4 mb-6",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Dataset"}),l.jsxs("select",{value:L,onChange:V=>U(V.target.value),disabled:E,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-400",children:[l.jsx("option",{value:"",children:"Select a dataset..."}),z.map(V=>l.jsxs("option",{value:V.id,children:[V.name," (",V.case_count," cases)"]},V.id))]}),z.length===0&&l.jsxs("p",{className:"mt-1 text-xs text-slate-500",children:["No datasets found. ",l.jsx(de,{to:"/datasets",className:"text-blue-400 hover:underline",children:"Create one"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Model"}),l.jsx(du,{models:m,value:g,onChange:y,disabled:E})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Parallel Runs"}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"number",min:1,max:20,value:b,onChange:V=>S(Math.max(1,Math.min(20,parseInt(V.target.value)||1))),disabled:E,className:"w-20 panel-subtle px-3 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-400"}),l.jsx("span",{className:"text-sm text-slate-500",children:"concurrent cases"})]}),l.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Higher = faster, but may hit rate limits"})]})]}),i&&i.variables&&i.variables.length>0&&l.jsxs("div",{className:"mb-6 p-4 panel-subtle",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(yp,{size:18,className:"text-slate-400"}),l.jsx("h3",{className:"font-medium text-slate-100",children:"Variables"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:i.variables.map(V=>l.jsx(Xg,{variable:V,value:k[V.name],onChange:Oe=>mm(V.name,Oe),disabled:ae==="running"},V.name))})]}),l.jsxs("div",{className:"mb-6 p-4 panel-subtle",children:[l.jsxs("button",{onClick:()=>te(!H),className:"flex items-center gap-2 w-full text-left",children:[H?l.jsx(pe,{size:18}):l.jsx(ge,{size:18}),l.jsx("span",{className:"font-medium text-slate-100",children:"MLflow Tracking"}),T&&l.jsx("span",{className:"ml-2 px-2 py-0.5 text-xs bg-green-500/20 text-green-400 rounded",children:"Enabled"})]}),H&&l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:T,onChange:V=>D(V.target.checked),disabled:ae==="running"||E,className:"w-4 h-4 rounded border-slate-600 text-orange-400 focus:ring-orange-400"}),l.jsx("span",{className:"text-slate-200",children:"Enable MLflow tracking"})]}),T&&l.jsxs(l.Fragment,{children:[N!=="dataset"&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-1",children:"Tracking URI"}),l.jsx("input",{type:"text",value:X,onChange:V=>lt(V.target.value),disabled:ae==="running",placeholder:"http://127.0.0.1:5000 (uses MLFLOW_TRACKING_URI if empty)",className:"w-full panel-subtle px-3 py-2 text-slate-100 text-sm focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-1",children:"Experiment Name"}),l.jsx("input",{type:"text",value:Fe,onChange:V=>rt(V.target.value),disabled:ae==="running"||E,placeholder:N==="dataset"?`${(i==null?void 0:i.name)||"scenario"}-dataset`:(i==null?void 0:i.name)||"Defaults to scenario name",className:"w-full panel-subtle px-3 py-2 text-slate-100 text-sm focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),N!=="dataset"&&l.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:Cn,onChange:V=>pl(V.target.checked),disabled:ae==="running",className:"w-4 h-4 rounded border-slate-600 text-orange-400 focus:ring-orange-400"}),l.jsxs("div",{children:[l.jsx("span",{className:"text-slate-200",children:"Enable LLM Tracing"}),l.jsx("p",{className:"text-xs text-slate-500",children:"Capture detailed traces of each LLM call"})]})]}),l.jsxs("p",{className:"text-xs text-slate-500 flex items-center gap-1",children:[l.jsx(_g,{size:12}),"View results at your MLflow server after the run completes"]})]})]})]}),l.jsx("button",{onClick:pm,disabled:ae==="running"||E||!c||(N==="single"?!g:N==="compare"?j.length===0:!L||!g),className:`flex items-center gap-2 ${N==="dataset"?"bg-blue-500 hover:bg-blue-400":"bg-orange-400 hover:bg-orange-300"} disabled:bg-slate-700 disabled:text-slate-400 disabled:cursor-not-allowed text-slate-900 px-6 py-2 rounded-lg transition-colors font-semibold`,children:ae==="running"||E?l.jsxs(l.Fragment,{children:[l.jsx(cu,{className:"w-4 h-4 animate-spin"}),"Running..."]}):l.jsxs(l.Fragment,{children:[N==="dataset"?l.jsx(sn,{className:"w-4 h-4"}):l.jsx(Xt,{className:"w-4 h-4"}),N==="single"?"Run Scenario":N==="compare"?`Compare ${j.length} Models`:`Run ${((Ho=z.find(V=>V.id===L))==null?void 0:Ho.case_count)||0} Cases`]})})]}),Bo&&l.jsx("div",{className:"panel-solid border border-red-700/60 p-4 mb-6 text-red-400",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Eo,{className:"w-5 h-5"}),l.jsx("span",{children:Bo})]})}),Ot&&l.jsx(Mo,{result:Ot}),Uo&&l.jsx(Np,{comparison:Uo}),B&&l.jsx(Gg,{result:B})]})}function Gg({result:e}){const[t,n]=x.useState(new Set),s=r=>{const a=new Set(t);a.has(r)?a.delete(r):a.add(r),n(a)};return l.jsxs("div",{className:"panel-card p-6",children:[l.jsxs("h2",{className:"text-xl font-semibold text-slate-100 mb-4 flex items-center gap-2",children:[l.jsx(sn,{size:20}),"Dataset Benchmark Results"]}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[l.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[l.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.passed_cases,"/",e.total_cases]}),l.jsx("div",{className:"text-sm text-slate-400",children:"Cases Passed"})]}),l.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[l.jsxs("div",{className:`text-2xl font-bold ${e.pass_rate>=.9?"text-green-400":e.pass_rate>=.7?"text-yellow-400":"text-red-400"}`,children:[(e.pass_rate*100).toFixed(1),"%"]}),l.jsx("div",{className:"text-sm text-slate-400",children:"Pass Rate"})]}),l.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[l.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.avg_percentage.toFixed(1),"%"]}),l.jsx("div",{className:"text-sm text-slate-400",children:"Avg Score"})]}),l.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[l.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[(e.total_time_ms/1e3).toFixed(1),"s"]}),l.jsx("div",{className:"text-sm text-slate-400",children:"Total Time"})]})]}),Object.keys(e.by_expected).length>0&&l.jsxs("div",{className:"mb-6",children:[l.jsx("h3",{className:"font-medium text-slate-300 mb-3",children:"By Expected Outcome"}),l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:Object.entries(e.by_expected).map(([r,a])=>{const i=a.passed+a.failed,o=i>0?a.passed/i:0;return l.jsxs("div",{className:"panel-subtle p-3 rounded",children:[l.jsx("div",{className:"font-medium text-slate-200",children:r}),l.jsxs("div",{className:"text-sm text-slate-400",children:[a.passed,"/",i," (",(o*100).toFixed(0),"%)"]})]},r)})})]}),l.jsxs("div",{children:[l.jsxs("h3",{className:"font-medium text-slate-300 mb-3",children:["Case Results (",e.failed_cases," failed)"]}),l.jsx("div",{className:"space-y-2 max-h-[40vh] overflow-y-auto",children:e.case_results.map(r=>l.jsxs("div",{className:`panel-subtle rounded-lg overflow-hidden ${r.passed?"":"border border-red-500/30"}`,children:[l.jsxs("button",{onClick:()=>s(r.case_id),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-slate-700/50 transition-colors",children:[r.passed?l.jsx(Xs,{size:16,className:"text-green-400"}):l.jsx(Nt,{size:16,className:"text-red-400"}),l.jsx("span",{className:"font-medium text-slate-200",children:r.case_id}),r.expected&&l.jsxs("span",{className:"text-sm text-slate-400",children:["expected: ",r.expected]}),l.jsxs("span",{className:"ml-auto text-sm text-slate-400",children:[r.percentage.toFixed(0),"% | ",r.latency_ms,"ms"]})]}),t.has(r.case_id)&&l.jsxs("div",{className:"px-4 pb-3 pt-1 border-t border-slate-700",children:[r.failure_reason&&l.jsx("div",{className:"text-red-400 text-sm mb-2",children:r.failure_reason}),l.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-slate-400",children:"Expected:"})," ",l.jsx("span",{className:"text-slate-200",children:r.expected||"N/A"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-slate-400",children:"Actual:"})," ",l.jsx("span",{className:"text-slate-200",children:r.actual_outcome||"None"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-slate-400",children:"Score:"})," ",l.jsxs("span",{className:"text-slate-200",children:[r.goal_score,"/",r.max_score]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-slate-400",children:"Latency:"})," ",l.jsxs("span",{className:"text-slate-200",children:[r.latency_ms,"ms"]})]})]})]})]},r.case_id))})]})]})}function Xg({variable:e,value:t,onChange:n,disabled:s}){const r="w-full panel-subtle px-3 py-2 text-slate-100 text-sm focus:outline-none focus:ring-2 focus:ring-orange-400 disabled:opacity-50";return l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-1",children:[e.label,e.required&&l.jsx("span",{className:"text-red-400 ml-1",children:"*"})]}),e.type==="select"&&e.options.length>0?l.jsxs("select",{value:String(t??""),onChange:a=>n(a.target.value),disabled:s,className:r,children:[l.jsx("option",{value:"",children:"Select..."}),e.options.map(a=>l.jsx("option",{value:a,children:a},a))]}):e.type==="boolean"?l.jsxs("select",{value:String(t??""),onChange:a=>n(a.target.value==="true"),disabled:s,className:r,children:[l.jsx("option",{value:"",children:"Select..."}),l.jsx("option",{value:"true",children:"True"}),l.jsx("option",{value:"false",children:"False"})]}):e.type==="number"?l.jsx("input",{type:"number",value:String(t??""),onChange:a=>n(a.target.value?Number(a.target.value):""),disabled:s,placeholder:e.default!==null?`Default: ${e.default}`:"",className:r}):l.jsx("input",{type:"text",value:String(t??""),onChange:a=>n(a.target.value),disabled:s,placeholder:e.default!==null?`Default: ${e.default}`:"",className:r})]})}const pu=e=>e.scenario_id.endsWith("_comparison")||e.filename.includes("_comparison_"),mu=e=>e.scenario_id.includes("_dataset_")||e.filename.includes("_dataset_"),Al=e=>e.replace(/_comparison$/,"").replace(/_dataset_.*$/,"");function Zg(){const[e,t]=x.useState([]),[n,s]=x.useState(!0),[r,a]=x.useState(null),[i,o]=x.useState(null),[c,u]=x.useState(null),[m,f]=x.useState(!1),[g,y]=x.useState(!1),[j,v]=x.useState(""),[N,p]=x.useState("all"),[d,h]=x.useState(new Set),k=C=>{h(E=>{const _=new Set(E);return _.has(C)?_.delete(C):_.add(C),_})},{filteredResults:w,groupedResults:R,scenarioOrder:P}=x.useMemo(()=>{let C=e.filter(b=>{if(j){const S=j.toLowerCase();if(!b.scenario_id.toLowerCase().includes(S))return!1}if(N!=="all"){const S=pu(b),T=mu(b);if(N==="comparison"&&!S||N==="dataset"&&!T||N==="single"&&(S||T))return!1}return!0});C=C.sort((b,S)=>new Date(S.timestamp).getTime()-new Date(b.timestamp).getTime());const E={},_=[];for(const b of C){const S=Al(b.scenario_id);E[S]||(E[S]=[],_.push(S)),E[S].push(b)}return{filteredResults:C,groupedResults:E,scenarioOrder:_}},[e,j,N]);x.useEffect(()=>{fetch("/api/v1/local/runs").then(C=>{if(!C.ok)throw new Error("Failed to fetch results");return C.json()}).then(t).catch(C=>a(C.message)).finally(()=>s(!1))},[]);const M=async C=>{try{const E=await fetch(`/api/v1/local/runs/${encodeURIComponent(C)}`);if(!E.ok)throw new Error("Failed to fetch result");const _=await E.json();o(_),u(C),f(!1)}catch(E){console.error("Error fetching result:",E)}},O=async()=>{if(i)try{await navigator.clipboard.writeText(JSON.stringify(i,null,2)),y(!0),setTimeout(()=>y(!1),2e3)}catch(C){console.error("Failed to copy:",C)}},z=C=>{var D,H,te,X,lt;if(!C)return"unknown";const E=C.case_results||((D=C.result)==null?void 0:D.case_results),_=C.dataset_id||((H=C.result)==null?void 0:H.dataset_id);if(E||_)return"dataset";if(C.ranking||((te=C.result)==null?void 0:te.ranking))return"comparison";const S=C.model||((X=C.result)==null?void 0:X.model),T=C.response||((lt=C.result)==null?void 0:lt.response);return S||T!==void 0?"single":"unknown"},A=C=>{const E=C.result||C;return{id:E.id||"",scenario_id:E.scenario_id||C.scenario_id||"",model:E.model||"",response:E.response||"",history:E.history||[],tool_calls:E.tool_calls||[],final_state:E.final_state||{},evaluation:E.evaluation||null,latency_ms:E.latency_ms||0,input_tokens:E.input_tokens||0,output_tokens:E.output_tokens||0,cost_usd:E.cost_usd||null,error:E.error||null}},L=C=>{const E=C.result||C;return{scenario_id:E.scenario_id||C.scenario_id||"",scenario_name:E.scenario_name||C.scenario_id||"",models:E.models||[],runs_per_model:E.runs_per_model||1,stats:E.stats||{},ranking:E.ranking||[],winner:E.winner||null,results:E.results||[]}},U=C=>{const E=C.result||C;return{scenario_id:E.scenario_id||C.scenario_id||"",model:E.model||"",dataset_id:E.dataset_id||"",total_cases:E.total_cases||0,passed_cases:E.passed_cases||0,failed_cases:E.failed_cases||0,pass_rate:E.pass_rate||0,avg_score:E.avg_score||0,avg_percentage:E.avg_percentage||0,by_expected:E.by_expected||{},total_time_ms:E.total_time_ms||0,case_results:E.case_results||[]}};if(n)return l.jsx("div",{className:"p-8 page",children:l.jsx("div",{className:"text-slate-400",children:"Loading..."})});if(r)return l.jsx("div",{className:"p-8 page",children:l.jsxs("div",{className:"text-red-400",children:["Error: ",r]})});const B=z(i);return l.jsxs("div",{className:"p-8 page",children:[l.jsx("h1",{className:"text-2xl font-semibold text-slate-100 mb-6",children:"Run Results"}),e.length===0?l.jsxs("div",{className:"panel-card p-6 text-center",children:[l.jsx(Hr,{size:48,className:"mx-auto text-slate-600 mb-4"}),l.jsx("p",{className:"text-slate-400 mb-2",children:"No run results found"}),l.jsx("p",{className:"text-slate-500 text-sm mb-4",children:"Run a scenario to see results here."}),l.jsxs(de,{to:"/",className:"inline-flex items-center gap-2 text-orange-300 hover:text-orange-200",children:[l.jsx(Xt,{size:16}),"Go to Dashboard"]})]}):l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[l.jsxs("div",{className:"lg:col-span-1 space-y-4",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"relative",children:[l.jsx(Po,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),l.jsx("input",{type:"text",placeholder:"Search scenarios...",value:j,onChange:C=>v(C.target.value),className:"w-full bg-slate-900/60 border border-slate-700/50 rounded-lg pl-10 pr-4 py-2 text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:border-orange-400/50"})]}),l.jsxs("div",{className:"flex flex-wrap gap-1 p-1 bg-slate-900/60 rounded-lg border border-slate-700/50",children:[l.jsx("button",{onClick:()=>p("all"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors ${N==="all"?"bg-slate-700/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:"All"}),l.jsxs("button",{onClick:()=>p("single"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center justify-center gap-1 ${N==="single"?"bg-slate-700/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:[l.jsx(bn,{size:12}),"Single"]}),l.jsxs("button",{onClick:()=>p("comparison"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center justify-center gap-1 ${N==="comparison"?"bg-slate-700/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:[l.jsx(ou,{size:12}),"Compare"]}),l.jsxs("button",{onClick:()=>p("dataset"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center justify-center gap-1 ${N==="dataset"?"bg-blue-600/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:[l.jsx(sn,{size:12}),"Dataset"]})]})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("h2",{className:"text-sm font-medium text-slate-400",children:[w.length," result",w.length!==1?"s":""," in ",P.length," scenario",P.length!==1?"s":""]}),j&&l.jsx("button",{onClick:()=>v(""),className:"text-xs text-slate-500 hover:text-slate-300",children:"Clear"})]}),l.jsx("div",{className:"space-y-2 max-h-[70vh] overflow-y-auto pr-2",children:P.length===0?l.jsxs("div",{className:"text-center py-8 text-slate-500",children:[l.jsx(Rg,{size:24,className:"mx-auto mb-2 opacity-50"}),l.jsx("p",{className:"text-sm",children:"No results match your filters"})]}):P.map(C=>{const E=R[C],_=d.has(C);return l.jsxs("div",{className:"panel-card overflow-hidden",children:[l.jsxs("button",{onClick:()=>k(C),className:"w-full flex items-center justify-between p-3 hover:bg-slate-800/40 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[_?l.jsx(ge,{size:16,className:"text-slate-500"}):l.jsx(pe,{size:16,className:"text-slate-500"}),l.jsx("span",{className:"font-medium text-slate-200 text-sm",children:C})]}),l.jsx("span",{className:"text-xs text-slate-500 bg-slate-800/60 px-2 py-0.5 rounded",children:E.length})]}),!_&&l.jsx("div",{className:"border-t border-slate-800/50",children:E.map(b=>{const S=pu(b),T=mu(b);return l.jsxs("div",{className:`flex items-center justify-between p-3 cursor-pointer transition-colors border-l-2 ${c===b.filename?"bg-slate-800/60 border-l-orange-400":"hover:bg-slate-800/40 border-l-transparent"}`,onClick:()=>M(b.filename),children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[T?l.jsx(sn,{size:14,className:"text-blue-400 flex-shrink-0"}):S?l.jsx(ou,{size:14,className:"text-purple-400 flex-shrink-0"}):l.jsx(bn,{size:14,className:"text-orange-400 flex-shrink-0"}),l.jsx("div",{className:"min-w-0",children:l.jsxs("p",{className:"text-xs text-slate-400 flex items-center gap-1",children:[l.jsx(_o,{size:10}),new Date(b.timestamp).toLocaleString()]})})]}),l.jsx(de,{to:`/run/${Al(b.scenario_id)}`,onClick:D=>D.stopPropagation(),className:"p-1.5 text-slate-500 hover:text-orange-300 hover:bg-slate-700/60 rounded flex-shrink-0",title:"Run again",children:l.jsx(Xt,{size:12})})]},b.filename)})})]},C)})})]}),l.jsx("div",{className:"lg:col-span-2",children:i?l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"panel-card p-4",children:l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h2",{className:"font-semibold text-slate-100 truncate",children:Al(i.scenario_id)}),B==="single"&&A(i).model&&l.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["Model: ",A(i).model]}),B==="comparison"&&l.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Model Comparison"}),B==="dataset"&&l.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["Dataset: ",U(i).dataset_id," | Model: ",U(i).model]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[l.jsxs("button",{onClick:O,className:`flex items-center gap-1 text-xs px-2 py-1 border rounded whitespace-nowrap transition-colors ${g?"text-emerald-400 border-emerald-500/50 bg-emerald-500/10":"text-slate-400 hover:text-slate-100 border-slate-700/70"}`,children:[l.jsx(mp,{size:12}),g?"Copied!":"Copy JSON"]}),l.jsx("button",{onClick:()=>f(!m),className:"text-xs text-slate-400 hover:text-slate-100 px-2 py-1 border border-slate-700/70 rounded whitespace-nowrap",children:m?"View Details":"View JSON"}),l.jsxs(de,{to:`/run/${Al(i.scenario_id)}`,className:"flex items-center gap-1 bg-orange-400 hover:bg-orange-300 text-slate-900 px-3 py-1 rounded text-sm font-semibold whitespace-nowrap",children:[l.jsx(Xt,{size:14}),"Run Again"]})]})]})}),m?l.jsx("div",{className:"panel-card p-4",children:l.jsx("pre",{className:"text-xs text-slate-300 bg-slate-950/70 p-3 rounded overflow-auto max-h-[70vh]",children:JSON.stringify(i,null,2)})}):l.jsxs(l.Fragment,{children:[B==="single"&&l.jsx(Mo,{result:A(i)}),B==="comparison"&&l.jsx(Np,{comparison:L(i)}),B==="dataset"&&l.jsx(ev,{result:U(i)}),B==="unknown"&&l.jsx("div",{className:"panel-card p-6 text-center",children:l.jsx("p",{className:"text-slate-500",children:'Could not parse result format. Click "View JSON" to see raw data.'})})]})]}):l.jsxs("div",{className:"panel-card p-8 text-center",children:[l.jsx(xp,{size:32,className:"mx-auto text-slate-600 mb-3"}),l.jsx("p",{className:"text-slate-400",children:"Select a result to view details"})]})})]})]})}function ev({result:e}){const[t,n]=x.useState(new Set),s=o=>{const c=new Set(t);c.has(o)?c.delete(o):c.add(o),n(c)},r=e.passed_cases,a=e.total_cases,i=e.pass_rate;return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[l.jsxs("div",{className:"panel-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[l.jsx(sn,{className:"w-4 h-4"}),"Cases Passed"]}),l.jsxs("div",{className:`text-2xl font-bold ${i>=.9?"text-emerald-300":i>=.7?"text-amber-300":"text-red-400"}`,children:[r,"/",a]}),l.jsxs("div",{className:"text-xs text-slate-500",children:[(i*100).toFixed(1),"% pass rate"]})]}),l.jsxs("div",{className:"panel-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[l.jsx(Xs,{className:"w-4 h-4"}),"Avg Score"]}),l.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.avg_percentage.toFixed(1),"%"]}),l.jsxs("div",{className:"text-xs text-slate-500",children:[e.avg_score.toFixed(1)," points"]})]}),l.jsxs("div",{className:"panel-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[l.jsx(_o,{className:"w-4 h-4"}),"Total Time"]}),l.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[(e.total_time_ms/1e3).toFixed(1),"s"]}),l.jsxs("div",{className:"text-xs text-slate-500",children:[Math.round(e.total_time_ms/Math.max(a,1)),"ms/case"]})]}),l.jsxs("div",{className:"panel-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[l.jsx(Nt,{className:"w-4 h-4"}),"Failed"]}),l.jsx("div",{className:"text-2xl font-bold text-red-400",children:e.failed_cases}),l.jsxs("div",{className:"text-xs text-slate-500",children:[a-r," case",a-r!==1?"s":""," failed"]})]})]}),Object.keys(e.by_expected).length>0&&l.jsxs("div",{className:"panel-card p-6",children:[l.jsx("h3",{className:"font-semibold text-slate-100 mb-4",children:"By Expected Outcome"}),l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:Object.entries(e.by_expected).map(([o,c])=>{const u=c.passed+c.failed,m=u>0?c.passed/u:0;return l.jsxs("div",{className:"panel-subtle p-3 rounded-lg",children:[l.jsx("div",{className:"font-medium text-slate-200",children:o}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.jsxs("div",{className:`text-lg font-semibold ${m>=.9?"text-emerald-300":m>=.7?"text-amber-300":"text-red-400"}`,children:[c.passed,"/",u]}),l.jsxs("span",{className:"text-xs text-slate-500",children:["(",(m*100).toFixed(0),"%)"]})]})]},o)})})]}),l.jsxs("div",{className:"panel-card p-6",children:[l.jsxs("h3",{className:"font-semibold text-slate-100 mb-4",children:["Case Results (",e.failed_cases," failed, ",e.passed_cases," passed)"]}),l.jsx("div",{className:"space-y-2 max-h-[50vh] overflow-y-auto",children:e.case_results.map(o=>l.jsxs("div",{className:`panel-subtle rounded-lg overflow-hidden ${o.passed?"":"border border-red-500/30"}`,children:[l.jsxs("button",{onClick:()=>s(o.case_id),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-slate-700/50 transition-colors",children:[o.passed?l.jsx(Xs,{size:16,className:"text-emerald-400 flex-shrink-0"}):l.jsx(Nt,{size:16,className:"text-red-400 flex-shrink-0"}),l.jsx("span",{className:"font-medium text-slate-200",children:o.case_id}),o.expected&&o.expected.length>0&&l.jsxs("span",{className:"text-sm text-slate-400",children:["expected: ",o.expected.join(" or ")]}),l.jsxs("span",{className:"ml-auto text-sm text-slate-400 flex-shrink-0",children:[o.percentage.toFixed(0),"% | ",o.latency_ms,"ms"]}),t.has(o.case_id)?l.jsx(pe,{size:14,className:"text-slate-500 flex-shrink-0"}):l.jsx(ge,{size:14,className:"text-slate-500 flex-shrink-0"})]}),t.has(o.case_id)&&l.jsxs("div",{className:"px-4 pb-3 pt-1 border-t border-slate-700",children:[o.failure_reason&&l.jsx("div",{className:"text-red-400 text-sm mb-2 p-2 bg-red-950/30 rounded",children:o.failure_reason}),l.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-slate-500",children:"Expected:"})," ",l.jsx("span",{className:"text-slate-200",children:o.expected&&o.expected.length>0?o.expected.join(" or "):"N/A"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-slate-500",children:"Actual:"})," ",l.jsx("span",{className:"text-slate-200",children:o.actual_outcome||"None"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-slate-500",children:"Score:"})," ",l.jsxs("span",{className:"text-slate-200",children:[o.goal_score,"/",o.max_score]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-slate-500",children:"Latency:"})," ",l.jsxs("span",{className:"text-slate-200",children:[o.latency_ms,"ms"]})]})]})]})]},o.case_id))})]})]})}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function wp(e){return typeof e>"u"||e===null}function tv(e){return typeof e=="object"&&e!==null}function nv(e){return Array.isArray(e)?e:wp(e)?[]:[e]}function sv(e,t){var n,s,r,a;if(t)for(a=Object.keys(t),n=0,s=a.length;n<s;n+=1)r=a[n],e[r]=t[r];return e}function lv(e,t){var n="",s;for(s=0;s<t;s+=1)n+=e;return n}function rv(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var av=wp,iv=tv,ov=nv,cv=lv,uv=rv,dv=sv,me={isNothing:av,isObject:iv,toArray:ov,repeat:cv,isNegativeZero:uv,extend:dv};function bp(e,t){var n="",s=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
|
|
287
|
+
|
|
288
|
+
`+e.mark.snippet),s+" "+n):s}function Zs(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=bp(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Zs.prototype=Object.create(Error.prototype);Zs.prototype.constructor=Zs;Zs.prototype.toString=function(t){return this.name+": "+bp(this,t)};var Te=Zs;function ja(e,t,n,s,r){var a="",i="",o=Math.floor(r/2)-1;return s-t>o&&(a=" ... ",t=s-o+a.length),n-s>o&&(i=" ...",n=s+o-i.length),{str:a+e.slice(t,n).replace(/\t/g,"→")+i,pos:s-t+a.length}}function Na(e,t){return me.repeat(" ",t-e.length)+e}function fv(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,s=[0],r=[],a,i=-1;a=n.exec(e.buffer);)r.push(a.index),s.push(a.index+a[0].length),e.position<=a.index&&i<0&&(i=s.length-2);i<0&&(i=s.length-1);var o="",c,u,m=Math.min(e.line+t.linesAfter,r.length).toString().length,f=t.maxLength-(t.indent+m+3);for(c=1;c<=t.linesBefore&&!(i-c<0);c++)u=ja(e.buffer,s[i-c],r[i-c],e.position-(s[i]-s[i-c]),f),o=me.repeat(" ",t.indent)+Na((e.line-c+1).toString(),m)+" | "+u.str+`
|
|
289
|
+
`+o;for(u=ja(e.buffer,s[i],r[i],e.position,f),o+=me.repeat(" ",t.indent)+Na((e.line+1).toString(),m)+" | "+u.str+`
|
|
290
|
+
`,o+=me.repeat("-",t.indent+m+3+u.pos)+`^
|
|
291
|
+
`,c=1;c<=t.linesAfter&&!(i+c>=r.length);c++)u=ja(e.buffer,s[i+c],r[i+c],e.position-(s[i]-s[i+c]),f),o+=me.repeat(" ",t.indent)+Na((e.line+c+1).toString(),m)+" | "+u.str+`
|
|
292
|
+
`;return o.replace(/\n$/,"")}var pv=fv,mv=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],xv=["scalar","sequence","mapping"];function hv(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(s){t[String(s)]=n})}),t}function gv(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(mv.indexOf(n)===-1)throw new Te('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=hv(t.styleAliases||null),xv.indexOf(this.kind)===-1)throw new Te('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var we=gv;function xu(e,t){var n=[];return e[t].forEach(function(s){var r=n.length;n.forEach(function(a,i){a.tag===s.tag&&a.kind===s.kind&&a.multi===s.multi&&(r=i)}),n[r]=s}),n}function vv(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function s(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(s);return e}function Ni(e){return this.extend(e)}Ni.prototype.extend=function(t){var n=[],s=[];if(t instanceof we)s.push(t);else if(Array.isArray(t))s=s.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(s=s.concat(t.explicit));else throw new Te("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(a){if(!(a instanceof we))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new Te("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new Te("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),s.forEach(function(a){if(!(a instanceof we))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Ni.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(s),r.compiledImplicit=xu(r,"implicit"),r.compiledExplicit=xu(r,"explicit"),r.compiledTypeMap=vv(r.compiledImplicit,r.compiledExplicit),r};var kp=Ni,Sp=new we("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Cp=new we("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Ep=new we("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),_p=new kp({explicit:[Sp,Cp,Ep]});function yv(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function jv(){return null}function Nv(e){return e===null}var Rp=new we("tag:yaml.org,2002:null",{kind:"scalar",resolve:yv,construct:jv,predicate:Nv,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function wv(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function bv(e){return e==="true"||e==="True"||e==="TRUE"}function kv(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Tp=new we("tag:yaml.org,2002:bool",{kind:"scalar",resolve:wv,construct:bv,predicate:kv,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Sv(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Cv(e){return 48<=e&&e<=55}function Ev(e){return 48<=e&&e<=57}function _v(e){if(e===null)return!1;var t=e.length,n=0,s=!1,r;if(!t)return!1;if(r=e[n],(r==="-"||r==="+")&&(r=e[++n]),r==="0"){if(n+1===t)return!0;if(r=e[++n],r==="b"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;s=!0}return s&&r!=="_"}if(r==="x"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Sv(e.charCodeAt(n)))return!1;s=!0}return s&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Cv(e.charCodeAt(n)))return!1;s=!0}return s&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!Ev(e.charCodeAt(n)))return!1;s=!0}return!(!s||r==="_")}function Rv(e){var t=e,n=1,s;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),s=t[0],(s==="-"||s==="+")&&(s==="-"&&(n=-1),t=t.slice(1),s=t[0]),t==="0")return 0;if(s==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function Tv(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!me.isNegativeZero(e)}var Pp=new we("tag:yaml.org,2002:int",{kind:"scalar",resolve:_v,construct:Rv,predicate:Tv,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Pv=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Av(e){return!(e===null||!Pv.test(e)||e[e.length-1]==="_")}function Lv(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var Mv=/^[-+]?[0-9]+e/;function Fv(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(me.isNegativeZero(e))return"-0.0";return n=e.toString(10),Mv.test(n)?n.replace("e",".e"):n}function Ov(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||me.isNegativeZero(e))}var Ap=new we("tag:yaml.org,2002:float",{kind:"scalar",resolve:Av,construct:Lv,predicate:Ov,represent:Fv,defaultStyle:"lowercase"}),Lp=_p.extend({implicit:[Rp,Tp,Pp,Ap]}),Mp=Lp,Fp=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Op=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function zv(e){return e===null?!1:Fp.exec(e)!==null||Op.exec(e)!==null}function Dv(e){var t,n,s,r,a,i,o,c=0,u=null,m,f,g;if(t=Fp.exec(e),t===null&&(t=Op.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],s=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,s,r));if(a=+t[4],i=+t[5],o=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(m=+t[10],f=+(t[11]||0),u=(m*60+f)*6e4,t[9]==="-"&&(u=-u)),g=new Date(Date.UTC(n,s,r,a,i,o,c)),u&&g.setTime(g.getTime()-u),g}function Iv(e){return e.toISOString()}var zp=new we("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:zv,construct:Dv,instanceOf:Date,represent:Iv});function $v(e){return e==="<<"||e===null}var Dp=new we("tag:yaml.org,2002:merge",{kind:"scalar",resolve:$v}),Fo=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
293
|
+
\r`;function Uv(e){if(e===null)return!1;var t,n,s=0,r=e.length,a=Fo;for(n=0;n<r;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;s+=6}return s%8===0}function Bv(e){var t,n,s=e.replace(/[\r\n=]/g,""),r=s.length,a=Fo,i=0,o=[];for(t=0;t<r;t++)t%4===0&&t&&(o.push(i>>16&255),o.push(i>>8&255),o.push(i&255)),i=i<<6|a.indexOf(s.charAt(t));return n=r%4*6,n===0?(o.push(i>>16&255),o.push(i>>8&255),o.push(i&255)):n===18?(o.push(i>>10&255),o.push(i>>2&255)):n===12&&o.push(i>>4&255),new Uint8Array(o)}function Hv(e){var t="",n=0,s,r,a=e.length,i=Fo;for(s=0;s<a;s++)s%3===0&&s&&(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]),n=(n<<8)+e[s];return r=a%3,r===0?(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]):r===2?(t+=i[n>>10&63],t+=i[n>>4&63],t+=i[n<<2&63],t+=i[64]):r===1&&(t+=i[n>>2&63],t+=i[n<<4&63],t+=i[64],t+=i[64]),t}function Vv(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Ip=new we("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Uv,construct:Bv,predicate:Vv,represent:Hv}),Wv=Object.prototype.hasOwnProperty,Yv=Object.prototype.toString;function Qv(e){if(e===null)return!0;var t=[],n,s,r,a,i,o=e;for(n=0,s=o.length;n<s;n+=1){if(r=o[n],i=!1,Yv.call(r)!=="[object Object]")return!1;for(a in r)if(Wv.call(r,a))if(!i)i=!0;else return!1;if(!i)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function qv(e){return e!==null?e:[]}var $p=new we("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Qv,construct:qv}),Jv=Object.prototype.toString;function Kv(e){if(e===null)return!0;var t,n,s,r,a,i=e;for(a=new Array(i.length),t=0,n=i.length;t<n;t+=1){if(s=i[t],Jv.call(s)!=="[object Object]"||(r=Object.keys(s),r.length!==1))return!1;a[t]=[r[0],s[r[0]]]}return!0}function Gv(e){if(e===null)return[];var t,n,s,r,a,i=e;for(a=new Array(i.length),t=0,n=i.length;t<n;t+=1)s=i[t],r=Object.keys(s),a[t]=[r[0],s[r[0]]];return a}var Up=new we("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Kv,construct:Gv}),Xv=Object.prototype.hasOwnProperty;function Zv(e){if(e===null)return!0;var t,n=e;for(t in n)if(Xv.call(n,t)&&n[t]!==null)return!1;return!0}function ey(e){return e!==null?e:{}}var Bp=new we("tag:yaml.org,2002:set",{kind:"mapping",resolve:Zv,construct:ey}),Oo=Mp.extend({implicit:[zp,Dp],explicit:[Ip,$p,Up,Bp]}),ln=Object.prototype.hasOwnProperty,jr=1,Hp=2,Vp=3,Nr=4,wa=1,ty=2,hu=3,ny=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,sy=/[\x85\u2028\u2029]/,ly=/[,\[\]\{\}]/,Wp=/^(?:!|!!|![a-z\-]+!)$/i,Yp=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function gu(e){return Object.prototype.toString.call(e)}function jt(e){return e===10||e===13}function hn(e){return e===9||e===32}function Ie(e){return e===9||e===32||e===10||e===13}function Bn(e){return e===44||e===91||e===93||e===123||e===125}function ry(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function ay(e){return e===120?2:e===117?4:e===85?8:0}function iy(e){return 48<=e&&e<=57?e-48:-1}function vu(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
294
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function oy(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Qp(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var qp=new Array(256),Jp=new Array(256);for(var _n=0;_n<256;_n++)qp[_n]=vu(_n)?1:0,Jp[_n]=vu(_n);function cy(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Oo,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Kp(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=pv(n),new Te(t,n)}function $(e,t){throw Kp(e,t)}function wr(e,t){e.onWarning&&e.onWarning.call(null,Kp(e,t))}var yu={YAML:function(t,n,s){var r,a,i;t.version!==null&&$(t,"duplication of %YAML directive"),s.length!==1&&$(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(s[0]),r===null&&$(t,"ill-formed argument of the YAML directive"),a=parseInt(r[1],10),i=parseInt(r[2],10),a!==1&&$(t,"unacceptable YAML version of the document"),t.version=s[0],t.checkLineBreaks=i<2,i!==1&&i!==2&&wr(t,"unsupported YAML version of the document")},TAG:function(t,n,s){var r,a;s.length!==2&&$(t,"TAG directive accepts exactly two arguments"),r=s[0],a=s[1],Wp.test(r)||$(t,"ill-formed tag handle (first argument) of the TAG directive"),ln.call(t.tagMap,r)&&$(t,'there is a previously declared suffix for "'+r+'" tag handle'),Yp.test(a)||$(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{$(t,"tag prefix is malformed: "+a)}t.tagMap[r]=a}};function Zt(e,t,n,s){var r,a,i,o;if(t<n){if(o=e.input.slice(t,n),s)for(r=0,a=o.length;r<a;r+=1)i=o.charCodeAt(r),i===9||32<=i&&i<=1114111||$(e,"expected valid JSON character");else ny.test(o)&&$(e,"the stream contains non-printable characters");e.result+=o}}function ju(e,t,n,s){var r,a,i,o;for(me.isObject(n)||$(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),i=0,o=r.length;i<o;i+=1)a=r[i],ln.call(t,a)||(Qp(t,a,n[a]),s[a]=!0)}function Hn(e,t,n,s,r,a,i,o,c){var u,m;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),u=0,m=r.length;u<m;u+=1)Array.isArray(r[u])&&$(e,"nested arrays are not supported inside keys"),typeof r=="object"&&gu(r[u])==="[object Object]"&&(r[u]="[object Object]");if(typeof r=="object"&&gu(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),s==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(u=0,m=a.length;u<m;u+=1)ju(e,t,a[u],n);else ju(e,t,a,n);else!e.json&&!ln.call(n,r)&&ln.call(t,r)&&(e.line=i||e.line,e.lineStart=o||e.lineStart,e.position=c||e.position,$(e,"duplicated mapping key")),Qp(t,r,a),delete n[r];return t}function zo(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):$(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ue(e,t,n){for(var s=0,r=e.input.charCodeAt(e.position);r!==0;){for(;hn(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(jt(r))for(zo(e),r=e.input.charCodeAt(e.position),s++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return n!==-1&&s!==0&&e.lineIndent<n&&wr(e,"deficient indentation"),s}function Vr(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Ie(n)))}function Do(e,t){t===1?e.result+=" ":t>1&&(e.result+=me.repeat(`
|
|
295
|
+
`,t-1))}function uy(e,t,n){var s,r,a,i,o,c,u,m,f=e.kind,g=e.result,y;if(y=e.input.charCodeAt(e.position),Ie(y)||Bn(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(r=e.input.charCodeAt(e.position+1),Ie(r)||n&&Bn(r)))return!1;for(e.kind="scalar",e.result="",a=i=e.position,o=!1;y!==0;){if(y===58){if(r=e.input.charCodeAt(e.position+1),Ie(r)||n&&Bn(r))break}else if(y===35){if(s=e.input.charCodeAt(e.position-1),Ie(s))break}else{if(e.position===e.lineStart&&Vr(e)||n&&Bn(y))break;if(jt(y))if(c=e.line,u=e.lineStart,m=e.lineIndent,ue(e,!1,-1),e.lineIndent>=t){o=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=i,e.line=c,e.lineStart=u,e.lineIndent=m;break}}o&&(Zt(e,a,i,!1),Do(e,e.line-c),a=i=e.position,o=!1),hn(y)||(i=e.position+1),y=e.input.charCodeAt(++e.position)}return Zt(e,a,i,!1),e.result?!0:(e.kind=f,e.result=g,!1)}function dy(e,t){var n,s,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,s=r=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Zt(e,s,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)s=e.position,e.position++,r=e.position;else return!0;else jt(n)?(Zt(e,s,r,!0),Do(e,ue(e,!1,t)),s=r=e.position):e.position===e.lineStart&&Vr(e)?$(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);$(e,"unexpected end of the stream within a single quoted scalar")}function fy(e,t){var n,s,r,a,i,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=s=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return Zt(e,n,e.position,!0),e.position++,!0;if(o===92){if(Zt(e,n,e.position,!0),o=e.input.charCodeAt(++e.position),jt(o))ue(e,!1,t);else if(o<256&&qp[o])e.result+=Jp[o],e.position++;else if((i=ay(o))>0){for(r=i,a=0;r>0;r--)o=e.input.charCodeAt(++e.position),(i=ry(o))>=0?a=(a<<4)+i:$(e,"expected hexadecimal character");e.result+=oy(a),e.position++}else $(e,"unknown escape sequence");n=s=e.position}else jt(o)?(Zt(e,n,s,!0),Do(e,ue(e,!1,t)),n=s=e.position):e.position===e.lineStart&&Vr(e)?$(e,"unexpected end of the document within a double quoted scalar"):(e.position++,s=e.position)}$(e,"unexpected end of the stream within a double quoted scalar")}function py(e,t){var n=!0,s,r,a,i=e.tag,o,c=e.anchor,u,m,f,g,y,j=Object.create(null),v,N,p,d;if(d=e.input.charCodeAt(e.position),d===91)m=93,y=!1,o=[];else if(d===123)m=125,y=!0,o={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),d=e.input.charCodeAt(++e.position);d!==0;){if(ue(e,!0,t),d=e.input.charCodeAt(e.position),d===m)return e.position++,e.tag=i,e.anchor=c,e.kind=y?"mapping":"sequence",e.result=o,!0;n?d===44&&$(e,"expected the node content, but found ','"):$(e,"missed comma between flow collection entries"),N=v=p=null,f=g=!1,d===63&&(u=e.input.charCodeAt(e.position+1),Ie(u)&&(f=g=!0,e.position++,ue(e,!0,t))),s=e.line,r=e.lineStart,a=e.position,ss(e,t,jr,!1,!0),N=e.tag,v=e.result,ue(e,!0,t),d=e.input.charCodeAt(e.position),(g||e.line===s)&&d===58&&(f=!0,d=e.input.charCodeAt(++e.position),ue(e,!0,t),ss(e,t,jr,!1,!0),p=e.result),y?Hn(e,o,j,N,v,p,s,r,a):f?o.push(Hn(e,null,j,N,v,p,s,r,a)):o.push(v),ue(e,!0,t),d=e.input.charCodeAt(e.position),d===44?(n=!0,d=e.input.charCodeAt(++e.position)):n=!1}$(e,"unexpected end of the stream within a flow collection")}function my(e,t){var n,s,r=wa,a=!1,i=!1,o=t,c=0,u=!1,m,f;if(f=e.input.charCodeAt(e.position),f===124)s=!1;else if(f===62)s=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)wa===r?r=f===43?hu:ty:$(e,"repeat of a chomping mode identifier");else if((m=iy(f))>=0)m===0?$(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):i?$(e,"repeat of an indentation width identifier"):(o=t+m-1,i=!0);else break;if(hn(f)){do f=e.input.charCodeAt(++e.position);while(hn(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!jt(f)&&f!==0)}for(;f!==0;){for(zo(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!i||e.lineIndent<o)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!i&&e.lineIndent>o&&(o=e.lineIndent),jt(f)){c++;continue}if(e.lineIndent<o){r===hu?e.result+=me.repeat(`
|
|
296
|
+
`,a?1+c:c):r===wa&&a&&(e.result+=`
|
|
297
|
+
`);break}for(s?hn(f)?(u=!0,e.result+=me.repeat(`
|
|
298
|
+
`,a?1+c:c)):u?(u=!1,e.result+=me.repeat(`
|
|
299
|
+
`,c+1)):c===0?a&&(e.result+=" "):e.result+=me.repeat(`
|
|
300
|
+
`,c):e.result+=me.repeat(`
|
|
301
|
+
`,a?1+c:c),a=!0,i=!0,c=0,n=e.position;!jt(f)&&f!==0;)f=e.input.charCodeAt(++e.position);Zt(e,n,e.position,!1)}return!0}function Nu(e,t){var n,s=e.tag,r=e.anchor,a=[],i,o=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,$(e,"tab characters must not be used in indentation")),!(c!==45||(i=e.input.charCodeAt(e.position+1),!Ie(i))));){if(o=!0,e.position++,ue(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,ss(e,t,Vp,!1,!0),a.push(e.result),ue(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)$(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return o?(e.tag=s,e.anchor=r,e.kind="sequence",e.result=a,!0):!1}function xy(e,t,n){var s,r,a,i,o,c,u=e.tag,m=e.anchor,f={},g=Object.create(null),y=null,j=null,v=null,N=!1,p=!1,d;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),d=e.input.charCodeAt(e.position);d!==0;){if(!N&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,$(e,"tab characters must not be used in indentation")),s=e.input.charCodeAt(e.position+1),a=e.line,(d===63||d===58)&&Ie(s))d===63?(N&&(Hn(e,f,g,y,j,null,i,o,c),y=j=v=null),p=!0,N=!0,r=!0):N?(N=!1,r=!0):$(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,d=s;else{if(i=e.line,o=e.lineStart,c=e.position,!ss(e,n,Hp,!1,!0))break;if(e.line===a){for(d=e.input.charCodeAt(e.position);hn(d);)d=e.input.charCodeAt(++e.position);if(d===58)d=e.input.charCodeAt(++e.position),Ie(d)||$(e,"a whitespace character is expected after the key-value separator within a block mapping"),N&&(Hn(e,f,g,y,j,null,i,o,c),y=j=v=null),p=!0,N=!1,r=!1,y=e.tag,j=e.result;else if(p)$(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=m,!0}else if(p)$(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=m,!0}if((e.line===a||e.lineIndent>t)&&(N&&(i=e.line,o=e.lineStart,c=e.position),ss(e,t,Nr,!0,r)&&(N?j=e.result:v=e.result),N||(Hn(e,f,g,y,j,v,i,o,c),y=j=v=null),ue(e,!0,-1),d=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&d!==0)$(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return N&&Hn(e,f,g,y,j,null,i,o,c),p&&(e.tag=u,e.anchor=m,e.kind="mapping",e.result=f),p}function hy(e){var t,n=!1,s=!1,r,a,i;if(i=e.input.charCodeAt(e.position),i!==33)return!1;if(e.tag!==null&&$(e,"duplication of a tag property"),i=e.input.charCodeAt(++e.position),i===60?(n=!0,i=e.input.charCodeAt(++e.position)):i===33?(s=!0,r="!!",i=e.input.charCodeAt(++e.position)):r="!",t=e.position,n){do i=e.input.charCodeAt(++e.position);while(i!==0&&i!==62);e.position<e.length?(a=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):$(e,"unexpected end of the stream within a verbatim tag")}else{for(;i!==0&&!Ie(i);)i===33&&(s?$(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),Wp.test(r)||$(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),ly.test(a)&&$(e,"tag suffix cannot contain flow indicator characters")}a&&!Yp.test(a)&&$(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{$(e,"tag name is malformed: "+a)}return n?e.tag=a:ln.call(e.tagMap,r)?e.tag=e.tagMap[r]+a:r==="!"?e.tag="!"+a:r==="!!"?e.tag="tag:yaml.org,2002:"+a:$(e,'undeclared tag handle "'+r+'"'),!0}function gy(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&$(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Ie(n)&&!Bn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&$(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function vy(e){var t,n,s;if(s=e.input.charCodeAt(e.position),s!==42)return!1;for(s=e.input.charCodeAt(++e.position),t=e.position;s!==0&&!Ie(s)&&!Bn(s);)s=e.input.charCodeAt(++e.position);return e.position===t&&$(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),ln.call(e.anchorMap,n)||$(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ue(e,!0,-1),!0}function ss(e,t,n,s,r){var a,i,o,c=1,u=!1,m=!1,f,g,y,j,v,N;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=i=o=Nr===n||Vp===n,s&&ue(e,!0,-1)&&(u=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;hy(e)||gy(e);)ue(e,!0,-1)?(u=!0,o=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):o=!1;if(o&&(o=u||r),(c===1||Nr===n)&&(jr===n||Hp===n?v=t:v=t+1,N=e.position-e.lineStart,c===1?o&&(Nu(e,N)||xy(e,N,v))||py(e,v)?m=!0:(i&&my(e,v)||dy(e,v)||fy(e,v)?m=!0:vy(e)?(m=!0,(e.tag!==null||e.anchor!==null)&&$(e,"alias node should not have any properties")):uy(e,v,jr===n)&&(m=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(m=o&&Nu(e,N))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&$(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,g=e.implicitTypes.length;f<g;f+=1)if(j=e.implicitTypes[f],j.resolve(e.result)){e.result=j.construct(e.result),e.tag=j.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(ln.call(e.typeMap[e.kind||"fallback"],e.tag))j=e.typeMap[e.kind||"fallback"][e.tag];else for(j=null,y=e.typeMap.multi[e.kind||"fallback"],f=0,g=y.length;f<g;f+=1)if(e.tag.slice(0,y[f].tag.length)===y[f].tag){j=y[f];break}j||$(e,"unknown tag !<"+e.tag+">"),e.result!==null&&j.kind!==e.kind&&$(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+j.kind+'", not "'+e.kind+'"'),j.resolve(e.result,e.tag)?(e.result=j.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):$(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||m}function yy(e){var t=e.position,n,s,r,a=!1,i;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(i=e.input.charCodeAt(e.position))!==0&&(ue(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||i!==37));){for(a=!0,i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!Ie(i);)i=e.input.charCodeAt(++e.position);for(s=e.input.slice(n,e.position),r=[],s.length<1&&$(e,"directive name must not be less than one character in length");i!==0;){for(;hn(i);)i=e.input.charCodeAt(++e.position);if(i===35){do i=e.input.charCodeAt(++e.position);while(i!==0&&!jt(i));break}if(jt(i))break;for(n=e.position;i!==0&&!Ie(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}i!==0&&zo(e),ln.call(yu,s)?yu[s](e,s,r):wr(e,'unknown document directive "'+s+'"')}if(ue(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ue(e,!0,-1)):a&&$(e,"directives end mark is expected"),ss(e,e.lineIndent-1,Nr,!1,!0),ue(e,!0,-1),e.checkLineBreaks&&sy.test(e.input.slice(t,e.position))&&wr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Vr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ue(e,!0,-1));return}if(e.position<e.length-1)$(e,"end of the stream or a document separator is expected");else return}function Gp(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
302
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new cy(e,t),s=e.indexOf("\0");for(s!==-1&&(n.position=s,$(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)yy(n);return n.documents}function jy(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var s=Gp(e,n);if(typeof t!="function")return s;for(var r=0,a=s.length;r<a;r+=1)t(s[r])}function Ny(e,t){var n=Gp(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Te("expected a single document in the stream, but found more")}}var wy=jy,by=Ny,Xp={loadAll:wy,load:by},Zp=Object.prototype.toString,em=Object.prototype.hasOwnProperty,Io=65279,ky=9,el=10,Sy=13,Cy=32,Ey=33,_y=34,wi=35,Ry=37,Ty=38,Py=39,Ay=42,tm=44,Ly=45,br=58,My=61,Fy=62,Oy=63,zy=64,nm=91,sm=93,Dy=96,lm=123,Iy=124,rm=125,_e={};_e[0]="\\0";_e[7]="\\a";_e[8]="\\b";_e[9]="\\t";_e[10]="\\n";_e[11]="\\v";_e[12]="\\f";_e[13]="\\r";_e[27]="\\e";_e[34]='\\"';_e[92]="\\\\";_e[133]="\\N";_e[160]="\\_";_e[8232]="\\L";_e[8233]="\\P";var $y=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Uy=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function By(e,t){var n,s,r,a,i,o,c;if(t===null)return{};for(n={},s=Object.keys(t),r=0,a=s.length;r<a;r+=1)i=s[r],o=String(t[i]),i.slice(0,2)==="!!"&&(i="tag:yaml.org,2002:"+i.slice(2)),c=e.compiledTypeMap.fallback[i],c&&em.call(c.styleAliases,o)&&(o=c.styleAliases[o]),n[i]=o;return n}function Hy(e){var t,n,s;if(t=e.toString(16).toUpperCase(),e<=255)n="x",s=2;else if(e<=65535)n="u",s=4;else if(e<=4294967295)n="U",s=8;else throw new Te("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+me.repeat("0",s-t.length)+t}var Vy=1,tl=2;function Wy(e){this.schema=e.schema||Oo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=me.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=By(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?tl:Vy,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function wu(e,t){for(var n=me.repeat(" ",t),s=0,r=-1,a="",i,o=e.length;s<o;)r=e.indexOf(`
|
|
303
|
+
`,s),r===-1?(i=e.slice(s),s=o):(i=e.slice(s,r+1),s=r+1),i.length&&i!==`
|
|
304
|
+
`&&(a+=n),a+=i;return a}function bi(e,t){return`
|
|
305
|
+
`+me.repeat(" ",e.indent*t)}function Yy(e,t){var n,s,r;for(n=0,s=e.implicitTypes.length;n<s;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function kr(e){return e===Cy||e===ky}function nl(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Io||65536<=e&&e<=1114111}function bu(e){return nl(e)&&e!==Io&&e!==Sy&&e!==el}function ku(e,t,n){var s=bu(e),r=s&&!kr(e);return(n?s:s&&e!==tm&&e!==nm&&e!==sm&&e!==lm&&e!==rm)&&e!==wi&&!(t===br&&!r)||bu(t)&&!kr(t)&&e===wi||t===br&&r}function Qy(e){return nl(e)&&e!==Io&&!kr(e)&&e!==Ly&&e!==Oy&&e!==br&&e!==tm&&e!==nm&&e!==sm&&e!==lm&&e!==rm&&e!==wi&&e!==Ty&&e!==Ay&&e!==Ey&&e!==Iy&&e!==My&&e!==Fy&&e!==Py&&e!==_y&&e!==Ry&&e!==zy&&e!==Dy}function qy(e){return!kr(e)&&e!==br}function ws(e,t){var n=e.charCodeAt(t),s;return n>=55296&&n<=56319&&t+1<e.length&&(s=e.charCodeAt(t+1),s>=56320&&s<=57343)?(n-55296)*1024+s-56320+65536:n}function am(e){var t=/^\n* /;return t.test(e)}var im=1,ki=2,om=3,cm=4,Rn=5;function Jy(e,t,n,s,r,a,i,o){var c,u=0,m=null,f=!1,g=!1,y=s!==-1,j=-1,v=Qy(ws(e,0))&&qy(ws(e,e.length-1));if(t||i)for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=ws(e,c),!nl(u))return Rn;v=v&&ku(u,m,o),m=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=ws(e,c),u===el)f=!0,y&&(g=g||c-j-1>s&&e[j+1]!==" ",j=c);else if(!nl(u))return Rn;v=v&&ku(u,m,o),m=u}g=g||y&&c-j-1>s&&e[j+1]!==" "}return!f&&!g?v&&!i&&!r(e)?im:a===tl?Rn:ki:n>9&&am(e)?Rn:i?a===tl?Rn:ki:g?cm:om}function Ky(e,t,n,s,r){e.dump=function(){if(t.length===0)return e.quotingType===tl?'""':"''";if(!e.noCompatMode&&($y.indexOf(t)!==-1||Uy.test(t)))return e.quotingType===tl?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),i=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),o=s||e.flowLevel>-1&&n>=e.flowLevel;function c(u){return Yy(e,u)}switch(Jy(t,o,e.indent,i,c,e.quotingType,e.forceQuotes&&!s,r)){case im:return t;case ki:return"'"+t.replace(/'/g,"''")+"'";case om:return"|"+Su(t,e.indent)+Cu(wu(t,a));case cm:return">"+Su(t,e.indent)+Cu(wu(Gy(t,i),a));case Rn:return'"'+Xy(t)+'"';default:throw new Te("impossible error: invalid scalar style")}}()}function Su(e,t){var n=am(e)?String(t):"",s=e[e.length-1]===`
|
|
306
|
+
`,r=s&&(e[e.length-2]===`
|
|
307
|
+
`||e===`
|
|
308
|
+
`),a=r?"+":s?"":"-";return n+a+`
|
|
309
|
+
`}function Cu(e){return e[e.length-1]===`
|
|
310
|
+
`?e.slice(0,-1):e}function Gy(e,t){for(var n=/(\n+)([^\n]*)/g,s=function(){var u=e.indexOf(`
|
|
311
|
+
`);return u=u!==-1?u:e.length,n.lastIndex=u,Eu(e.slice(0,u),t)}(),r=e[0]===`
|
|
312
|
+
`||e[0]===" ",a,i;i=n.exec(e);){var o=i[1],c=i[2];a=c[0]===" ",s+=o+(!r&&!a&&c!==""?`
|
|
313
|
+
`:"")+Eu(c,t),r=a}return s}function Eu(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,s,r=0,a,i=0,o=0,c="";s=n.exec(e);)o=s.index,o-r>t&&(a=i>r?i:o,c+=`
|
|
314
|
+
`+e.slice(r,a),r=a+1),i=o;return c+=`
|
|
315
|
+
`,e.length-r>t&&i>r?c+=e.slice(r,i)+`
|
|
316
|
+
`+e.slice(i+1):c+=e.slice(r),c.slice(1)}function Xy(e){for(var t="",n=0,s,r=0;r<e.length;n>=65536?r+=2:r++)n=ws(e,r),s=_e[n],!s&&nl(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=s||Hy(n);return t}function Zy(e,t,n){var s="",r=e.tag,a,i,o;for(a=0,i=n.length;a<i;a+=1)o=n[a],e.replacer&&(o=e.replacer.call(n,String(a),o)),(Lt(e,t,o,!1,!1)||typeof o>"u"&&Lt(e,t,null,!1,!1))&&(s!==""&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=r,e.dump="["+s+"]"}function _u(e,t,n,s){var r="",a=e.tag,i,o,c;for(i=0,o=n.length;i<o;i+=1)c=n[i],e.replacer&&(c=e.replacer.call(n,String(i),c)),(Lt(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Lt(e,t+1,null,!0,!0,!1,!0))&&((!s||r!=="")&&(r+=bi(e,t)),e.dump&&el===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=a,e.dump=r||"[]"}function e1(e,t,n){var s="",r=e.tag,a=Object.keys(n),i,o,c,u,m;for(i=0,o=a.length;i<o;i+=1)m="",s!==""&&(m+=", "),e.condenseFlow&&(m+='"'),c=a[i],u=n[c],e.replacer&&(u=e.replacer.call(n,c,u)),Lt(e,t,c,!1,!1)&&(e.dump.length>1024&&(m+="? "),m+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Lt(e,t,u,!1,!1)&&(m+=e.dump,s+=m));e.tag=r,e.dump="{"+s+"}"}function t1(e,t,n,s){var r="",a=e.tag,i=Object.keys(n),o,c,u,m,f,g;if(e.sortKeys===!0)i.sort();else if(typeof e.sortKeys=="function")i.sort(e.sortKeys);else if(e.sortKeys)throw new Te("sortKeys must be a boolean or a function");for(o=0,c=i.length;o<c;o+=1)g="",(!s||r!=="")&&(g+=bi(e,t)),u=i[o],m=n[u],e.replacer&&(m=e.replacer.call(n,u,m)),Lt(e,t+1,u,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&el===e.dump.charCodeAt(0)?g+="?":g+="? "),g+=e.dump,f&&(g+=bi(e,t)),Lt(e,t+1,m,!0,f)&&(e.dump&&el===e.dump.charCodeAt(0)?g+=":":g+=": ",g+=e.dump,r+=g));e.tag=a,e.dump=r||"{}"}function Ru(e,t,n){var s,r,a,i,o,c;for(r=n?e.explicitTypes:e.implicitTypes,a=0,i=r.length;a<i;a+=1)if(o=r[a],(o.instanceOf||o.predicate)&&(!o.instanceOf||typeof t=="object"&&t instanceof o.instanceOf)&&(!o.predicate||o.predicate(t))){if(n?o.multi&&o.representName?e.tag=o.representName(t):e.tag=o.tag:e.tag="?",o.represent){if(c=e.styleMap[o.tag]||o.defaultStyle,Zp.call(o.represent)==="[object Function]")s=o.represent(t,c);else if(em.call(o.represent,c))s=o.represent[c](t,c);else throw new Te("!<"+o.tag+'> tag resolver accepts not "'+c+'" style');e.dump=s}return!0}return!1}function Lt(e,t,n,s,r,a,i){e.tag=null,e.dump=n,Ru(e,n,!1)||Ru(e,n,!0);var o=Zp.call(e.dump),c=s,u;s&&(s=e.flowLevel<0||e.flowLevel>t);var m=o==="[object Object]"||o==="[object Array]",f,g;if(m&&(f=e.duplicates.indexOf(n),g=f!==-1),(e.tag!==null&&e.tag!=="?"||g||e.indent!==2&&t>0)&&(r=!1),g&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(m&&g&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),o==="[object Object]")s&&Object.keys(e.dump).length!==0?(t1(e,t,e.dump,r),g&&(e.dump="&ref_"+f+e.dump)):(e1(e,t,e.dump),g&&(e.dump="&ref_"+f+" "+e.dump));else if(o==="[object Array]")s&&e.dump.length!==0?(e.noArrayIndent&&!i&&t>0?_u(e,t-1,e.dump,r):_u(e,t,e.dump,r),g&&(e.dump="&ref_"+f+e.dump)):(Zy(e,t,e.dump),g&&(e.dump="&ref_"+f+" "+e.dump));else if(o==="[object String]")e.tag!=="?"&&Ky(e,e.dump,t,a,c);else{if(o==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Te("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function n1(e,t){var n=[],s=[],r,a;for(Si(e,n,s),r=0,a=s.length;r<a;r+=1)t.duplicates.push(n[s[r]]);t.usedDuplicates=new Array(a)}function Si(e,t,n){var s,r,a;if(e!==null&&typeof e=="object")if(r=t.indexOf(e),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,a=e.length;r<a;r+=1)Si(e[r],t,n);else for(s=Object.keys(e),r=0,a=s.length;r<a;r+=1)Si(e[s[r]],t,n)}function s1(e,t){t=t||{};var n=new Wy(t);n.noRefs||n1(e,n);var s=e;return n.replacer&&(s=n.replacer.call({"":s},"",s)),Lt(n,0,s,!0,!0)?n.dump+`
|
|
317
|
+
`:""}var l1=s1,r1={dump:l1};function $o(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var a1=we,i1=kp,o1=_p,c1=Lp,u1=Mp,d1=Oo,f1=Xp.load,p1=Xp.loadAll,m1=r1.dump,x1=Te,h1={binary:Ip,float:Ap,map:Ep,null:Rp,pairs:Up,set:Bp,timestamp:zp,bool:Tp,int:Pp,merge:Dp,omap:$p,seq:Cp,str:Sp},g1=$o("safeLoad","load"),v1=$o("safeLoadAll","loadAll"),y1=$o("safeDump","dump"),sl={Type:a1,Schema:i1,FAILSAFE_SCHEMA:o1,JSON_SCHEMA:c1,CORE_SCHEMA:u1,DEFAULT_SCHEMA:d1,load:f1,loadAll:p1,dump:m1,YAMLException:x1,types:h1,safeLoad:g1,safeLoadAll:v1,safeDump:y1};const Tu={id:"",name:"",description:"",category:"",tags:[],variables:[],interactionMode:"prompt",prompt:"",style:"",systemPrompt:"",steps:[],toolsFrom:[],inlineTools:{},initialState:{},goals:[],judge:null,maxScore:null};function j1(){const[e,t]=x.useState(Tu),n=x.useMemo(()=>{const C={};e.id&&(C.id=e.id),e.name&&(C.name=e.name),e.description&&(C.description=e.description),e.category&&(C.category=e.category),e.tags.length>0&&(C.tags=e.tags),e.variables.length>0&&(C.variables=e.variables.map(_=>{const b={name:_.name,type:_.type};return _.label&&(b.label=_.label),_.default!==""&&_.default!==void 0&&(b.default=_.default),_.type==="select"&&_.options.length>0&&(b.options=_.options),_.required||(b.required=!1),b})),e.systemPrompt&&(C.system_prompt=e.systemPrompt),e.interactionMode==="prompt"?(e.prompt&&(C.prompt=e.prompt),e.style&&(C.style=e.style)):e.steps.length>0&&(C.steps=e.steps.map(_=>({id:_.id,action:_.action,params:_.params}))),e.toolsFrom.length>0&&(C.tools_from=e.toolsFrom),Object.keys(e.inlineTools).length>0&&(C.tools=e.inlineTools),Object.keys(e.initialState).length>0&&(C.initial_state=e.initialState);const E={};return e.goals.length>0&&(E.goals=e.goals.map(_=>({id:_.id,name:_.name,description:_.description,points:_.points,detection:_.detection}))),e.judge&&(E.judge=e.judge),e.maxScore!==null&&(E.max_score=e.maxScore),Object.keys(E).length>0&&(C.evaluation=E),sl.dump(C,{lineWidth:-1,noRefs:!0})},[e]),s=x.useMemo(()=>{const C=[];return e.id?/^[a-z0-9-]+$/.test(e.id)||C.push("ID must be lowercase letters, numbers, and hyphens only"):C.push("Scenario ID is required"),e.interactionMode==="prompt"&&!e.prompt&&C.push("Prompt is required for single-turn scenarios"),e.interactionMode==="steps"&&e.steps.length===0&&C.push("At least one step is required for multi-turn scenarios"),e.steps.forEach((E,_)=>{E.id||C.push(`Step ${_+1}: ID is required`),E.action==="inject_user"&&!E.params.content&&C.push(`Step ${_+1}: Content is required for inject_user`)}),e.goals.forEach((E,_)=>{E.id||C.push(`Goal ${_+1}: ID is required`),E.detection.type||C.push(`Goal ${_+1}: Detection type is required`)}),C},[e]),r=s.length===0,a=x.useCallback(C=>{t(E=>({...E,id:C}))},[]),i=x.useCallback(C=>{t(E=>({...E,name:C}))},[]),o=x.useCallback(C=>{t(E=>({...E,description:C}))},[]),c=x.useCallback(C=>{t(E=>({...E,category:C}))},[]),u=x.useCallback(C=>{t(E=>({...E,tags:C}))},[]),m=x.useCallback(C=>{t(E=>({...E,variables:[...E.variables,C]}))},[]),f=x.useCallback((C,E)=>{t(_=>({..._,variables:_.variables.map((b,S)=>S===C?E:b)}))},[]),g=x.useCallback(C=>{t(E=>({...E,variables:E.variables.filter((_,b)=>b!==C)}))},[]),y=x.useCallback(C=>{t(E=>({...E,interactionMode:C}))},[]),j=x.useCallback(C=>{t(E=>({...E,prompt:C}))},[]),v=x.useCallback(C=>{t(E=>({...E,style:C}))},[]),N=x.useCallback(C=>{t(E=>({...E,systemPrompt:C}))},[]),p=x.useCallback(C=>{t(E=>({...E,steps:[...E.steps,C]}))},[]),d=x.useCallback((C,E)=>{t(_=>({..._,steps:_.steps.map((b,S)=>S===C?E:b)}))},[]),h=x.useCallback(C=>{t(E=>({...E,steps:E.steps.filter((_,b)=>b!==C)}))},[]),k=x.useCallback((C,E)=>{t(_=>{const b=[..._.steps],[S]=b.splice(C,1);return b.splice(E,0,S),{..._,steps:b}})},[]),w=x.useCallback(C=>{t(E=>({...E,toolsFrom:C}))},[]),R=x.useCallback(C=>{t(E=>({...E,inlineTools:C}))},[]),P=x.useCallback(C=>{t(E=>({...E,initialState:C}))},[]),M=x.useCallback(C=>{t(E=>({...E,goals:[...E.goals,C]}))},[]),O=x.useCallback((C,E)=>{t(_=>({..._,goals:_.goals.map((b,S)=>S===C?E:b)}))},[]),z=x.useCallback(C=>{t(E=>({...E,goals:E.goals.filter((_,b)=>b!==C)}))},[]),A=x.useCallback(C=>{t(E=>({...E,judge:C}))},[]),L=x.useCallback(C=>{t(E=>({...E,maxScore:C}))},[]),U=x.useCallback(()=>{t(Tu)},[]),B=x.useCallback(C=>{var E,_,b,S;try{const T=sl.load(C);t({id:T.id||"",name:T.name||"",description:T.description||"",category:T.category||"",tags:T.tags||[],variables:(T.variables||[]).map(D=>({name:D.name||"",label:D.label||"",type:D.type||"string",default:D.default??"",options:D.options||[],required:D.required!==!1})),interactionMode:T.steps?"steps":"prompt",prompt:T.prompt||"",style:T.style||"",systemPrompt:T.system_prompt||"",steps:(T.steps||[]).map((D,H)=>({id:D.id||`step_${H}`,action:D.action||"await_agent",params:D.params||{}})),toolsFrom:T.tools_from||[],inlineTools:T.tools||{},initialState:T.initial_state||{},goals:((_=((E=T.evaluation)==null?void 0:E.goals)||T.goals)==null?void 0:_.map((D,H)=>({id:D.id||`goal_${H}`,name:D.name||"",description:D.description||"",points:D.points||0,detection:D.detection||{type:""}})))||[],judge:((b=T.evaluation)==null?void 0:b.judge)||null,maxScore:((S=T.evaluation)==null?void 0:S.max_score)||null})}catch(T){console.error("Failed to parse YAML:",T)}},[]);return{state:e,yamlPreview:n,isValid:r,validationErrors:s,setId:a,setName:i,setDescription:o,setCategory:c,setTags:u,addVariable:m,updateVariable:f,removeVariable:g,setInteractionMode:y,setPrompt:j,setStyle:v,setSystemPrompt:N,addStep:p,updateStep:d,removeStep:h,reorderSteps:k,setToolsFrom:w,setInlineTools:R,setInitialState:P,addGoal:M,updateGoal:O,removeGoal:z,setJudge:A,setMaxScore:L,reset:U,loadFromYaml:B}}const N1=["","brief","spicy","professional","formal","wholesome","chaotic","poetic"],w1=[{value:"tool_called",label:"Tool Called"},{value:"env_state",label:"Environment State"},{value:"agent_contains",label:"Agent Contains"},{value:"any_tool_called",label:"Any Tool Called"}];function b1(){const e=wo(),[t,n]=x.useState("basic"),[s,r]=x.useState(!0),[a,i]=x.useState([]),[o,c]=x.useState(!1),[u,m]=x.useState(null),f=j1();x.useEffect(()=>{Z.listTools().then(v=>{i(v.map(N=>N.id))}).catch(()=>{})},[]);const g=async()=>{if(!f.isValid)return!1;c(!0),m(null);try{const v=await fetch("/api/v1/local/scenarios",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:f.state.id,content:f.yamlPreview})});if(v.ok)return m({type:"success",text:"Scenario saved successfully!"}),!0;{const N=await v.json();return m({type:"error",text:N.detail||"Failed to save"}),!1}}catch(v){return m({type:"error",text:v instanceof Error?v.message:"Failed to save"}),!1}finally{c(!1)}},y=async()=>{await g()&&e(`/run/${f.state.id}`)},j=[{id:"basic",label:"Basic Info",icon:Hr},{id:"variables",label:"Variables",icon:ji},{id:"interaction",label:"Interaction",icon:vr},{id:"tools",label:"Tools",icon:wn},{id:"evaluation",label:"Evaluation",icon:yi}];return l.jsxs("div",{className:"flex h-full page",children:[l.jsxs("div",{className:`flex-1 flex flex-col ${s?"lg:mr-96":""}`,children:[l.jsxs("div",{className:"p-4 sm:p-6 border-b border-slate-800/70",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(de,{to:"/",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100",children:l.jsx(Gs,{size:20})}),l.jsx("h1",{className:"text-xl sm:text-2xl font-semibold text-slate-100",children:"Scenario Builder"})]}),l.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[l.jsxs("button",{onClick:()=>r(!s),className:"px-3 py-2 text-slate-400 hover:text-slate-100 border border-slate-700/70 rounded-lg text-sm",children:[l.jsxs("span",{className:"hidden sm:inline",children:[s?"Hide":"Show"," "]}),"YAML"]}),l.jsxs("button",{onClick:()=>g(),disabled:!f.isValid||o,className:"flex items-center gap-2 bg-slate-800 hover:bg-slate-700 disabled:bg-slate-900 disabled:text-slate-500 disabled:cursor-not-allowed text-slate-100 px-3 py-2 rounded-lg text-sm",children:[l.jsx(yr,{size:18}),l.jsx("span",{className:"hidden sm:inline",children:"Save"})]}),l.jsxs("button",{onClick:y,disabled:!f.isValid||o,className:"flex items-center gap-2 bg-emerald-400 hover:bg-emerald-300 disabled:bg-slate-700 disabled:text-slate-400 disabled:cursor-not-allowed text-slate-900 px-3 py-2 rounded-lg font-semibold text-sm",children:[l.jsx(Xt,{size:18}),l.jsx("span",{className:"hidden sm:inline",children:o?"Saving...":"Save & Run"})]})]})]}),u&&l.jsxs("div",{className:`mt-4 p-3 rounded-lg flex items-center gap-2 text-sm ${u.type==="success"?"bg-emerald-500/10 text-emerald-300 border border-emerald-400/40":"bg-red-900/30 text-red-400 border border-red-700/60"}`,children:[u.type==="success"?l.jsx(fl,{size:18}):l.jsx(nn,{size:18}),u.text]}),f.validationErrors.length>0&&l.jsxs("div",{className:"mt-4 p-3 bg-amber-500/10 border border-amber-400/50 rounded-lg",children:[l.jsxs("div",{className:"flex items-center gap-2 text-amber-300 font-medium mb-2 text-sm",children:[l.jsx(nn,{size:18}),"Validation Issues"]}),l.jsx("ul",{className:"list-disc list-inside text-amber-200/80 text-xs sm:text-sm space-y-1",children:f.validationErrors.map((v,N)=>l.jsx("li",{children:v},N))})]})]}),l.jsx("div",{className:"flex overflow-x-auto border-b border-slate-800/70 scrollbar-hide",children:j.map(v=>l.jsxs("button",{onClick:()=>n(v.id),className:`flex items-center gap-2 px-4 sm:px-6 py-3 font-medium transition-colors whitespace-nowrap ${t===v.id?"text-orange-300 border-b-2 border-orange-300":"text-slate-400 hover:text-slate-100"}`,children:[l.jsx(v.icon,{size:18}),l.jsx("span",{className:"hidden sm:inline",children:v.label})]},v.id))}),l.jsxs("div",{className:"flex-1 overflow-auto p-4 sm:p-6",children:[t==="basic"&&l.jsx(k1,{builder:f}),t==="variables"&&l.jsx(C1,{builder:f}),t==="interaction"&&l.jsx(_1,{builder:f}),t==="tools"&&l.jsx(P1,{builder:f,availableTools:a}),t==="evaluation"&&l.jsx(A1,{builder:f})]})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 bg-black/50 lg:hidden z-40",onClick:()=>r(!1)}),l.jsxs("div",{className:"fixed right-0 top-0 bottom-0 w-full sm:w-96 bg-slate-950 border-l border-slate-800/70 flex flex-col z-50",children:[l.jsxs("div",{className:"p-4 border-b border-slate-800/70 flex items-center justify-between",children:[l.jsx("h2",{className:"font-semibold text-slate-100",children:"YAML Preview"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>navigator.clipboard.writeText(f.yamlPreview),className:"text-slate-400 hover:text-slate-100 text-sm",children:"Copy"}),l.jsx("button",{onClick:()=>r(!1),className:"lg:hidden text-slate-400 hover:text-slate-100 p-1",children:l.jsx(Gs,{size:18})})]})]}),l.jsx("pre",{className:"flex-1 overflow-auto p-4 text-xs sm:text-sm text-slate-300 font-mono",children:f.yamlPreview})]})]})]})}function k1({builder:e}){return l.jsxs("div",{className:"space-y-6 max-w-2xl",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Scenario ID ",l.jsx("span",{className:"text-red-400",children:"*"})]}),l.jsx("input",{type:"text",value:e.state.id,onChange:t=>e.setId(t.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"-")),placeholder:"my-scenario",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),l.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Lowercase letters, numbers, and hyphens only"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Display Name"}),l.jsx("input",{type:"text",value:e.state.name,onChange:t=>e.setName(t.target.value),placeholder:"My Scenario",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Description"}),l.jsx("textarea",{value:e.state.description,onChange:t=>e.setDescription(t.target.value),placeholder:"Describe what this scenario tests...",rows:3,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Category"}),l.jsx("input",{type:"text",value:e.state.category,onChange:t=>e.setCategory(t.target.value),placeholder:"e.g., customer-service, coding, reasoning",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Tags"}),l.jsx("input",{type:"text",value:e.state.tags.join(", "),onChange:t=>e.setTags(t.target.value.split(",").map(n=>n.trim()).filter(Boolean)),placeholder:"tag1, tag2, tag3",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),l.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Comma-separated tags"})]})]})}const S1=[{value:"string",label:"Text"},{value:"number",label:"Number"},{value:"boolean",label:"Yes/No"},{value:"select",label:"Dropdown"}];function C1({builder:e}){const t=()=>{e.addVariable({name:`var_${e.state.variables.length+1}`,label:"",type:"string",default:"",options:[],required:!0})};return l.jsxs("div",{className:"space-y-6 max-w-2xl",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-slate-400",children:"Scenario Variables"}),l.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Define variables that can be filled in when running the scenario. Use ",l.jsx("code",{className:"text-orange-300",children:"{variable_name}"})," in prompts."]})]}),l.jsxs("button",{onClick:t,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold shrink-0",children:[l.jsx(Ne,{size:14})," Add Variable"]})]}),e.state.variables.length===0?l.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:"No variables defined. Add a variable to make your scenario parameterizable."}):l.jsx("div",{className:"space-y-4",children:e.state.variables.map((n,s)=>l.jsx(E1,{variable:n,onUpdate:r=>e.updateVariable(s,r),onRemove:()=>e.removeVariable(s)},s))}),e.state.variables.length>0&&l.jsxs("div",{className:"p-4 panel-subtle rounded-lg",children:[l.jsx("h4",{className:"text-xs font-medium text-slate-400 mb-2",children:"Usage Example"}),l.jsx("code",{className:"text-sm text-orange-300",children:e.state.variables.map(n=>`{${n.name}}`).join(", ")}),l.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"Use these placeholders in your prompts, system prompt, or step content."})]})]})}function E1({variable:e,onUpdate:t,onRemove:n}){const[s,r]=x.useState(!0);return l.jsxs("div",{className:"panel-card overflow-hidden",children:[l.jsxs("div",{className:"flex items-center gap-3 p-3 cursor-pointer hover:bg-slate-800/60",onClick:()=>r(!s),children:[s?l.jsx(pe,{size:18}):l.jsx(ge,{size:18}),l.jsx("code",{className:"text-orange-300",children:`{${e.name}}`}),l.jsx("span",{className:"text-slate-400 text-sm flex-1",children:e.label||e.name}),l.jsx("span",{className:"text-xs text-slate-500 px-2 py-0.5 bg-slate-800 rounded",children:e.type}),l.jsx("button",{onClick:a=>{a.stopPropagation(),n()},className:"text-slate-500 hover:text-red-400",children:l.jsx(Ae,{size:16})})]}),s&&l.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Variable Name"}),l.jsx("input",{type:"text",value:e.name,onChange:a=>t({...e,name:a.target.value.replace(/[^a-z0-9_]/gi,"_").toLowerCase()}),placeholder:"variable_name",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Type"}),l.jsx("select",{value:e.type,onChange:a=>t({...e,type:a.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:S1.map(a=>l.jsx("option",{value:a.value,children:a.label},a.value))})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Display Label"}),l.jsx("input",{type:"text",value:e.label,onChange:a=>t({...e,label:a.target.value}),placeholder:"Human-readable label",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Default Value"}),e.type==="boolean"?l.jsxs("select",{value:String(e.default),onChange:a=>t({...e,default:a.target.value==="true"}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:[l.jsx("option",{value:"true",children:"Yes"}),l.jsx("option",{value:"false",children:"No"})]}):e.type==="number"?l.jsx("input",{type:"number",value:e.default,onChange:a=>t({...e,default:Number(a.target.value)}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"}):e.type==="select"&&e.options.length>0?l.jsx("select",{value:String(e.default),onChange:a=>t({...e,default:a.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:e.options.map(a=>l.jsx("option",{value:a,children:a},a))}):l.jsx("input",{type:"text",value:String(e.default),onChange:a=>t({...e,default:a.target.value}),placeholder:"Default value",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),l.jsx("div",{className:"flex items-center sm:pt-5",children:l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:e.required,onChange:a=>t({...e,required:a.target.checked}),className:"w-4 h-4 rounded border-slate-600 text-orange-400 focus:ring-orange-400"}),l.jsx("span",{className:"text-sm text-slate-400",children:"Required"})]})})]}),e.type==="select"&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Options (comma-separated)"}),l.jsx("input",{type:"text",value:e.options.join(", "),onChange:a=>t({...e,options:a.target.value.split(",").map(i=>i.trim()).filter(Boolean)}),placeholder:"option1, option2, option3",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})]})}function _1({builder:e}){return l.jsxs("div",{className:"space-y-6 max-w-2xl",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Interaction Mode"}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[l.jsxs("button",{onClick:()=>e.setInteractionMode("prompt"),className:`flex-1 p-3 sm:p-4 rounded-lg border transition-colors ${e.state.interactionMode==="prompt"?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[l.jsx("div",{className:"font-medium text-slate-100",children:"Single-Turn"}),l.jsx("div",{className:"text-xs sm:text-sm text-slate-400",children:"Simple prompt → response"})]}),l.jsxs("button",{onClick:()=>e.setInteractionMode("steps"),className:`flex-1 p-3 sm:p-4 rounded-lg border transition-colors ${e.state.interactionMode==="steps"?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[l.jsx("div",{className:"font-medium text-slate-100",children:"Multi-Turn"}),l.jsx("div",{className:"text-xs sm:text-sm text-slate-400",children:"Conversation steps with tools"})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"System Prompt"}),l.jsx("textarea",{value:e.state.systemPrompt,onChange:t=>e.setSystemPrompt(t.target.value),placeholder:"Instructions for the AI agent...",rows:4,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono text-sm"})]}),e.state.interactionMode==="prompt"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Prompt ",l.jsx("span",{className:"text-red-400",children:"*"})]}),l.jsx("textarea",{value:e.state.prompt,onChange:t=>e.setPrompt(t.target.value),placeholder:"Enter the prompt for the AI...",rows:4,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Response Style"}),l.jsx("select",{value:e.state.style,onChange:t=>e.setStyle(t.target.value),className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400",children:N1.map(t=>l.jsx("option",{value:t,children:t||"(None)"},t))})]})]}):l.jsx(R1,{builder:e})]})}function R1({builder:e}){const t=n=>{const s={id:`step_${e.state.steps.length+1}`,action:n,params:n==="inject_user"?{content:""}:{}};e.addStep(s)};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400",children:"Conversation Steps"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("button",{onClick:()=>t("inject_user"),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold",children:[l.jsx(Ne,{size:14})," User"]}),l.jsxs("button",{onClick:()=>t("await_agent"),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-emerald-400 hover:bg-emerald-300 text-slate-900 rounded font-semibold",children:[l.jsx(Ne,{size:14})," Agent"]})]})]}),e.state.steps.length===0?l.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:"No steps yet. Add a step to start building your conversation."}):l.jsx("div",{className:"space-y-3",children:e.state.steps.map((n,s)=>l.jsx(T1,{step:n,onUpdate:r=>e.updateStep(s,r),onRemove:()=>e.removeStep(s)},s))})]})}function T1({step:e,onUpdate:t,onRemove:n}){const[s,r]=x.useState(!0),a={inject_user:"bg-orange-400 text-slate-900",await_agent:"bg-emerald-400 text-slate-900",await_user:"bg-amber-300 text-slate-900"};return l.jsxs("div",{className:"panel-card overflow-hidden",children:[l.jsxs("div",{className:"flex items-center gap-3 p-3 cursor-pointer hover:bg-slate-800/60",onClick:()=>r(!s),children:[s?l.jsx(pe,{size:18}):l.jsx(ge,{size:18}),l.jsx("span",{className:`px-2 py-0.5 rounded text-xs text-white ${a[e.action]||"bg-slate-700 text-slate-200"}`,children:e.action}),l.jsx("span",{className:"text-slate-400 text-sm flex-1",children:e.id}),l.jsx("button",{onClick:i=>{i.stopPropagation(),n()},className:"text-slate-500 hover:text-red-400",children:l.jsx(Ae,{size:16})})]}),s&&l.jsxs("div",{className:"p-3 border-t border-slate-800/70 space-y-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Step ID"}),l.jsx("input",{type:"text",value:e.id,onChange:i=>t({...e,id:i.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),e.action==="inject_user"&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Content"}),l.jsx("textarea",{value:e.params.content||"",onChange:i=>t({...e,params:{...e.params,content:i.target.value}}),rows:3,className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})]})}function P1({builder:e,availableTools:t}){const[n,s]=x.useState(()=>JSON.stringify(e.state.initialState,null,2)||"{}"),[r,a]=x.useState(null),i=c=>{e.state.toolsFrom.includes(c)?e.setToolsFrom(e.state.toolsFrom.filter(u=>u!==c)):e.setToolsFrom([...e.state.toolsFrom,c])},o=c=>{s(c);try{const u=JSON.parse(c);e.setInitialState(u),a(null)}catch{a("Invalid JSON")}};return l.jsxs("div",{className:"space-y-6 max-w-2xl",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Import Tool Libraries"}),t.length===0?l.jsx("div",{className:"text-slate-500 text-sm",children:"No tool libraries found in tools/ directory."}):l.jsx("div",{className:"space-y-2",children:t.map(c=>l.jsxs("label",{className:"flex items-center gap-3 p-3 panel-subtle rounded-lg cursor-pointer hover:border-slate-600/70",children:[l.jsx("input",{type:"checkbox",checked:e.state.toolsFrom.includes(c),onChange:()=>i(c),className:"w-4 h-4 rounded border-slate-600 text-orange-400 focus:ring-orange-400"}),l.jsx("code",{className:"text-orange-300",children:c})]},c))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Initial State (JSON)"}),l.jsx("textarea",{value:n,onChange:c=>o(c.target.value),placeholder:'{"key": "value"}',rows:4,className:`w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 font-mono text-sm ${r?"focus:ring-red-400 border-red-500/50":"focus:ring-orange-400"}`}),r&&l.jsx("p",{className:"mt-1 text-xs text-red-400",children:r})]})]})}function A1({builder:e}){return l.jsxs("div",{className:"space-y-6 max-w-3xl",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4",children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400",children:"Goals (Rule-Based Scoring)"}),l.jsxs("button",{onClick:()=>e.addGoal({id:`goal_${e.state.goals.length+1}`,name:"",description:"",points:10,detection:{type:""}}),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold shrink-0",children:[l.jsx(Ne,{size:14})," Add Goal"]})]}),e.state.goals.length===0?l.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:"No goals defined. Add a goal to enable rule-based scoring."}):l.jsx("div",{className:"space-y-4",children:e.state.goals.map((t,n)=>l.jsx(L1,{goal:t,onUpdate:s=>e.updateGoal(n,s),onRemove:()=>e.removeGoal(n)},n))})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4",children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400",children:"Judge (LLM-Based Scoring)"}),e.state.judge?l.jsxs("button",{onClick:()=>e.setJudge(null),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-red-500 hover:bg-red-400 text-slate-900 rounded font-semibold shrink-0",children:[l.jsx(Ae,{size:14})," Remove Judge"]}):l.jsxs("button",{onClick:()=>e.setJudge({type:"llm",model:"gpt-4o-mini",rubric:"",pass_threshold:.5}),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-emerald-400 hover:bg-emerald-300 text-slate-900 rounded font-semibold shrink-0",children:[l.jsx(Ne,{size:14})," Add Judge"]})]}),e.state.judge&&l.jsx(M1,{judge:e.state.judge,onUpdate:t=>e.setJudge(t)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Max Score (Optional)"}),l.jsx("input",{type:"number",value:e.state.maxScore??"",onChange:t=>e.setMaxScore(t.target.value?Number(t.target.value):null),placeholder:"Auto-calculated from goals",className:"w-48 panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]})]})}function L1({goal:e,onUpdate:t,onRemove:n}){const[s,r]=x.useState(!0);return l.jsxs("div",{className:"panel-card overflow-hidden",children:[l.jsxs("div",{className:"flex items-center gap-3 p-3 cursor-pointer hover:bg-slate-800/60",onClick:()=>r(!s),children:[s?l.jsx(pe,{size:18}):l.jsx(ge,{size:18}),l.jsx("span",{className:"text-slate-100 font-medium flex-1",children:e.name||e.id}),l.jsxs("span",{className:"text-emerald-300 text-sm",children:["+",e.points," pts"]}),l.jsx("button",{onClick:a=>{a.stopPropagation(),n()},className:"text-slate-500 hover:text-red-400",children:l.jsx(Ae,{size:16})})]}),s&&l.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Goal ID"}),l.jsx("input",{type:"text",value:e.id,onChange:a=>t({...e,id:a.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Points"}),l.jsx("input",{type:"number",value:e.points,onChange:a=>t({...e,points:Number(a.target.value)}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Name"}),l.jsx("input",{type:"text",value:e.name,onChange:a=>t({...e,name:a.target.value}),placeholder:"Human-readable name",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Detection Type"}),l.jsxs("select",{value:e.detection.type,onChange:a=>t({...e,detection:{type:a.target.value}}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:[l.jsx("option",{value:"",children:"Select type..."}),w1.map(a=>l.jsx("option",{value:a.value,children:a.label},a.value))]})]}),e.detection.type==="tool_called"&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Tool Name"}),l.jsx("input",{type:"text",value:e.detection.tool||"",onChange:a=>t({...e,detection:{...e.detection,tool:a.target.value}}),placeholder:"e.g., check_status",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),e.detection.type==="env_state"&&l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"State Key"}),l.jsx("input",{type:"text",value:e.detection.key||"",onChange:a=>t({...e,detection:{...e.detection,key:a.target.value}}),placeholder:"e.g., order_complete",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Expected Value"}),l.jsx("input",{type:"text",value:String(e.detection.value??""),onChange:a=>{let i=a.target.value;i==="true"?i=!0:i==="false"?i=!1:isNaN(Number(i))||(i=Number(i)),t({...e,detection:{...e.detection,value:i}})},placeholder:"true, false, or value",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),e.detection.type==="agent_contains"&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Patterns (comma-separated)"}),l.jsx("input",{type:"text",value:(e.detection.patterns||[]).join(", "),onChange:a=>t({...e,detection:{...e.detection,patterns:a.target.value.split(",").map(i=>i.trim()).filter(Boolean)}}),placeholder:"sorry, apologize, my mistake",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})]})}function M1({judge:e,onUpdate:t}){return l.jsxs("div",{className:"panel-card p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Judge Type"}),l.jsxs("select",{value:e.type,onChange:n=>t({...e,type:n.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:[l.jsx("option",{value:"llm",children:"LLM Judge"}),l.jsx("option",{value:"contains",children:"Contains"}),l.jsx("option",{value:"regex",children:"Regex"}),l.jsx("option",{value:"exact",children:"Exact Match"}),l.jsx("option",{value:"length",children:"Length"})]})]}),e.type==="llm"&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Judge Model"}),l.jsx("input",{type:"text",value:e.model||"",onChange:n=>t({...e,model:n.target.value}),placeholder:"gpt-4o-mini",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),e.type==="llm"&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Rubric"}),l.jsx("textarea",{value:e.rubric||"",onChange:n=>t({...e,rubric:n.target.value}),placeholder:"Score the response from 0.0 to 1.0 based on...",rows:4,className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),(e.type==="contains"||e.type==="regex"||e.type==="exact")&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Pattern"}),l.jsx("input",{type:"text",value:e.pattern||"",onChange:n=>t({...e,pattern:n.target.value}),placeholder:e.type==="regex"?"\\d+":"expected text",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),e.type==="length"&&l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Min Length"}),l.jsx("input",{type:"number",value:e.min_length??"",onChange:n=>t({...e,min_length:n.target.value?Number(n.target.value):void 0}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Max Length"}),l.jsx("input",{type:"number",value:e.max_length??"",onChange:n=>t({...e,max_length:n.target.value?Number(n.target.value):void 0}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Pass Threshold (0.0 - 1.0)"}),l.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",value:e.pass_threshold??.5,onChange:n=>t({...e,pass_threshold:Number(n.target.value)}),className:"w-32 panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})}const Pu={toolType:"yaml",name:"",description:"",actions:[],pythonClassName:"",pythonActions:[],mcpTransport:"stdio",mcpCommand:"",mcpArgs:[],mcpUrl:"",mcpEnv:[]};function F1(){const[e,t]=x.useState(Pu),n=x.useMemo(()=>e.toolType==="yaml"?O1(e):e.toolType==="python"?z1(e):D1(e),[e]),s=x.useMemo(()=>{const _=[];return e.name?/^[a-z0-9_]+$/.test(e.name)||_.push("Name must be lowercase letters, numbers, and underscores only"):_.push("Tool name is required"),e.toolType==="yaml"?(e.actions.length===0&&_.push("At least one action is required"),e.actions.forEach((b,S)=>{b.name?/^[a-z0-9_]+$/.test(b.name)||_.push(`Action ${S+1}: Name must be lowercase letters, numbers, and underscores`):_.push(`Action ${S+1}: Name is required`),b.params.forEach((T,D)=>{T.name||_.push(`Action ${S+1}, Param ${D+1}: Name is required`)})})):e.toolType==="python"?(e.pythonClassName?/^[A-Z][a-zA-Z0-9]*Tool$/.test(e.pythonClassName)||_.push('Class name should be PascalCase ending with "Tool" (e.g., MyCustomTool)'):_.push("Class name is required"),e.pythonActions.length===0&&_.push("At least one action is required")):e.toolType==="mcp"&&(e.mcpTransport==="stdio"&&!e.mcpCommand&&_.push("Command is required for stdio transport"),(e.mcpTransport==="sse"||e.mcpTransport==="http")&&!e.mcpUrl&&_.push("URL is required for HTTP/SSE transport")),_},[e]),r=s.length===0,a=x.useCallback(_=>{t(b=>({...b,toolType:_}))},[]),i=x.useCallback(_=>{t(b=>({...b,name:_}))},[]),o=x.useCallback(_=>{t(b=>({...b,description:_}))},[]),c=x.useCallback(()=>{t(_=>({..._,actions:[..._.actions,{id:`action_${Date.now()}`,name:`action_${_.actions.length+1}`,description:"",params:[],returns:"",returnsType:"simple",sideEffects:[]}]}))},[]),u=x.useCallback((_,b)=>{t(S=>({...S,actions:S.actions.map((T,D)=>D===_?b:T)}))},[]),m=x.useCallback(_=>{t(b=>({...b,actions:b.actions.filter((S,T)=>T!==_)}))},[]),f=x.useCallback(_=>{t(b=>({...b,actions:b.actions.map((S,T)=>T!==_?S:{...S,params:[...S.params,{name:`param_${S.params.length+1}`,type:"string",required:!0,description:""}]})}))},[]),g=x.useCallback((_,b,S)=>{t(T=>({...T,actions:T.actions.map((D,H)=>H!==_?D:{...D,params:D.params.map((te,X)=>X===b?S:te)})}))},[]),y=x.useCallback((_,b)=>{t(S=>({...S,actions:S.actions.map((T,D)=>D!==_?T:{...T,params:T.params.filter((H,te)=>te!==b)})}))},[]),j=x.useCallback(_=>{t(b=>({...b,actions:b.actions.map((S,T)=>T!==_?S:{...S,sideEffects:[...S.sideEffects,{set:"",value:""}]})}))},[]),v=x.useCallback((_,b,S)=>{t(T=>({...T,actions:T.actions.map((D,H)=>H!==_?D:{...D,sideEffects:D.sideEffects.map((te,X)=>X===b?S:te)})}))},[]),N=x.useCallback((_,b)=>{t(S=>({...S,actions:S.actions.map((T,D)=>D!==_?T:{...T,sideEffects:T.sideEffects.filter((H,te)=>te!==b)})}))},[]),p=x.useCallback(_=>{t(b=>({...b,actions:b.actions.map((S,T)=>{if(T!==_)return S;const D=Array.isArray(S.returns)?S.returns:[];return{...S,returnsType:"conditional",returns:[...D,{when:"",value:""}]}})}))},[]),d=x.useCallback((_,b,S)=>{t(T=>({...T,actions:T.actions.map((D,H)=>H!==_||!Array.isArray(D.returns)?D:{...D,returns:D.returns.map((te,X)=>X===b?S:te)})}))},[]),h=x.useCallback((_,b)=>{t(S=>({...S,actions:S.actions.map((T,D)=>{if(D!==_||!Array.isArray(T.returns))return T;const H=T.returns.filter((te,X)=>X!==b);return{...T,returnsType:H.length>0?"conditional":"simple",returns:H.length>0?H:""}})}))},[]),k=x.useCallback(_=>{t(b=>({...b,pythonClassName:_}))},[]),w=x.useCallback(()=>{t(_=>({..._,pythonActions:[..._.pythonActions,{name:`action_${_.pythonActions.length+1}`,description:"",params:[]}]}))},[]),R=x.useCallback((_,b)=>{t(S=>({...S,pythonActions:S.pythonActions.map((T,D)=>D===_?b:T)}))},[]),P=x.useCallback(_=>{t(b=>({...b,pythonActions:b.pythonActions.filter((S,T)=>T!==_)}))},[]),M=x.useCallback(_=>{t(b=>({...b,mcpTransport:_}))},[]),O=x.useCallback(_=>{t(b=>({...b,mcpCommand:_}))},[]),z=x.useCallback(_=>{t(b=>({...b,mcpArgs:_}))},[]),A=x.useCallback(_=>{t(b=>({...b,mcpUrl:_}))},[]),L=x.useCallback(()=>{t(_=>({..._,mcpEnv:[..._.mcpEnv,{key:"",value:""}]}))},[]),U=x.useCallback((_,b)=>{t(S=>({...S,mcpEnv:S.mcpEnv.map((T,D)=>D===_?b:T)}))},[]),B=x.useCallback(_=>{t(b=>({...b,mcpEnv:b.mcpEnv.filter((S,T)=>T!==_)}))},[]),C=x.useCallback(()=>{t(Pu)},[]),E=x.useCallback(_=>{try{const b=sl.load(_),S=[],T=b.tools;if(T)for(const[D,H]of Object.entries(T)){const te=[],X=H.params;if(X)for(const[ae,Ot]of Object.entries(X))te.push({name:ae,type:Ot.type||"string",required:Ot.required!==!1,default:Ot.default,description:Ot.description||"",enum:Ot.enum});const lt=[],Fe=H.side_effects;if(Fe)for(const ae of Fe)lt.push({set:ae.set,value:ae.value});const rt=H.returns;let Cn="",pl="simple";Array.isArray(rt)?(pl="conditional",Cn=rt.map(ae=>({when:ae.when,value:ae.value}))):typeof rt=="string"&&(Cn=rt),S.push({id:`action_${Date.now()}_${D}`,name:D,description:H.description||"",params:te,returns:Cn,returnsType:pl,errorWhen:H.error_when,returnsError:H.returns_error,sideEffects:lt})}t(D=>({...D,toolType:"yaml",name:b.name||"",description:b.description||"",actions:S}))}catch(b){console.error("Failed to parse YAML:",b)}},[]);return{state:e,preview:n,isValid:r,validationErrors:s,setToolType:a,setName:i,setDescription:o,addAction:c,updateAction:u,removeAction:m,addParam:f,updateParam:g,removeParam:y,addSideEffect:j,updateSideEffect:v,removeSideEffect:N,addConditionalReturn:p,updateConditionalReturn:d,removeConditionalReturn:h,setPythonClassName:k,addPythonAction:w,updatePythonAction:R,removePythonAction:P,setMcpTransport:M,setMcpCommand:O,setMcpArgs:z,setMcpUrl:A,addMcpEnvVar:L,updateMcpEnvVar:U,removeMcpEnvVar:B,reset:C,loadFromYaml:E}}function O1(e){const t={};if(e.name&&(t.name=e.name),e.description&&(t.description=e.description),e.actions.length>0){const n={};for(const s of e.actions){const r={};if(s.description&&(r.description=s.description),s.params.length>0){const a={};for(const i of s.params){const o={type:i.type};i.required&&(o.required=!0),i.default!==void 0&&i.default!==""&&(o.default=i.default),i.description&&(o.description=i.description),i.enum&&i.enum.length>0&&(o.enum=i.enum),a[i.name]=o}r.params=a}s.errorWhen&&(r.error_when=s.errorWhen),s.returnsError&&(r.returns_error=s.returnsError),s.returnsType==="conditional"&&Array.isArray(s.returns)?r.returns=s.returns.map(a=>({when:a.when,value:a.value})):typeof s.returns=="string"&&s.returns&&(r.returns=s.returns),s.sideEffects.length>0&&(r.side_effects=s.sideEffects.map(a=>({set:a.set,value:a.value}))),n[s.name]=r}t.tools=n}return sl.dump(t,{lineWidth:-1,noRefs:!0})}function z1(e){const t=e.pythonClassName||"MyCustomTool",n=e.name||"my_custom_tool";let s=`"""${e.description||"Custom tool implementation."}
|
|
318
|
+
|
|
319
|
+
Tool name: ${n}
|
|
320
|
+
"""
|
|
321
|
+
|
|
322
|
+
from sandboxy.tools.base import BaseTool, ToolConfig, ToolResult
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
class ${t}(BaseTool):
|
|
326
|
+
"""${e.description||"Custom tool implementation."}"""
|
|
327
|
+
|
|
328
|
+
def __init__(self, config: ToolConfig) -> None:
|
|
329
|
+
super().__init__(config)
|
|
330
|
+
# Add your initialization here
|
|
331
|
+
self.data: dict = {}
|
|
332
|
+
|
|
333
|
+
def invoke(self, action: str, args: dict, env_state: dict) -> ToolResult:
|
|
334
|
+
"""Handle tool actions."""
|
|
335
|
+
handlers = {
|
|
336
|
+
`;for(const r of e.pythonActions)s+=` "${r.name}": self._${r.name},
|
|
337
|
+
`;s+=` }
|
|
338
|
+
|
|
339
|
+
handler = handlers.get(action)
|
|
340
|
+
if not handler:
|
|
341
|
+
return ToolResult(success=False, error=f"Unknown action: {action}")
|
|
342
|
+
|
|
343
|
+
return handler(args, env_state)
|
|
344
|
+
`;for(const r of e.pythonActions){const a=r.params.map(i=>` ${i.name}: ${i.description||i.type}`).join(`
|
|
345
|
+
`);s+=`
|
|
346
|
+
def _${r.name}(self, args: dict, env_state: dict) -> ToolResult:
|
|
347
|
+
"""${r.description||"TODO: Add description"}
|
|
348
|
+
|
|
349
|
+
Args:
|
|
350
|
+
${a||" (no parameters)"}
|
|
351
|
+
"""
|
|
352
|
+
# TODO: Implement this action
|
|
353
|
+
${r.params.map(i=>`${i.name} = args.get("${i.name}")`).join(`
|
|
354
|
+
`)}
|
|
355
|
+
|
|
356
|
+
return ToolResult(success=True, data={"result": "TODO"})
|
|
357
|
+
`}s+=`
|
|
358
|
+
def get_actions(self) -> list[dict]:
|
|
359
|
+
"""Define available actions with their schemas."""
|
|
360
|
+
return [
|
|
361
|
+
`;for(const r of e.pythonActions){s+=` {
|
|
362
|
+
"name": "${r.name}",
|
|
363
|
+
"description": "${r.description||""}",
|
|
364
|
+
"parameters": {
|
|
365
|
+
"type": "object",
|
|
366
|
+
"properties": {
|
|
367
|
+
`;for(const a of r.params)s+=` "${a.name}": {"type": "${a.type}", "description": "${a.description||""}"},
|
|
368
|
+
`;s+=` },
|
|
369
|
+
"required": [${r.params.map(a=>`"${a.name}"`).join(", ")}],
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
`}return s+=` ]
|
|
373
|
+
`,s}function D1(e){const t={name:e.name||"my_mcp_server",type:"mcp",transport:e.mcpTransport};if(e.description&&(t.description=e.description),e.mcpTransport==="stdio"?(e.mcpCommand&&(t.command=e.mcpCommand),e.mcpArgs.length>0&&(t.args=e.mcpArgs)):e.mcpUrl&&(t.url=e.mcpUrl),e.mcpEnv.length>0){const n={};for(const s of e.mcpEnv)s.key&&(n[s.key]=s.value);Object.keys(n).length>0&&(t.env=n)}return sl.dump(t,{lineWidth:-1,noRefs:!0})}const I1=[{value:"string",label:"String"},{value:"boolean",label:"Boolean"},{value:"integer",label:"Integer"},{value:"number",label:"Number"},{value:"array",label:"Array"}],$1=[{value:"yaml",label:"Mock (YAML)",icon:hp,description:"Declarative tools with params, returns, and side effects"},{value:"python",label:"Python",icon:Ro,description:"Code-based tools for complex logic"},{value:"mcp",label:"MCP Server",icon:Ao,description:"Connect to an external MCP server"}];function U1(){const[e,t]=x.useState(!0),[n,s]=x.useState(!1),[r,a]=x.useState(null),i=F1(),o=async()=>{if(!i.isValid)return!1;s(!0),a(null);try{const u=await fetch("/api/v1/local/tools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.state.name,toolType:i.state.toolType,content:i.preview})});if(u.ok)return a({type:"success",text:"Tool saved successfully!"}),!0;{const m=await u.json();return a({type:"error",text:m.detail||"Failed to save"}),!1}}catch(u){return a({type:"error",text:u instanceof Error?u.message:"Failed to save"}),!1}finally{s(!1)}},c=i.state.toolType==="python"?"python":"yaml";return l.jsxs("div",{className:"flex h-full page",children:[l.jsxs("div",{className:`flex-1 flex flex-col ${e?"mr-[28rem]":""}`,children:[l.jsxs("div",{className:"p-6 border-b border-slate-800/70",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(de,{to:"/",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100",children:l.jsx(Gs,{size:20})}),l.jsx("h1",{className:"text-2xl font-semibold text-slate-100",children:"Tool Builder"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("button",{onClick:()=>t(!e),className:"px-4 py-2 text-slate-400 hover:text-slate-100 border border-slate-700/70 rounded-lg",children:[e?"Hide":"Show"," Preview"]}),l.jsxs("button",{onClick:()=>o(),disabled:!i.isValid||n,className:"flex items-center gap-2 bg-orange-400 hover:bg-orange-300 disabled:bg-slate-700 disabled:text-slate-400 disabled:cursor-not-allowed text-slate-900 px-4 py-2 rounded-lg font-semibold",children:[l.jsx(yr,{size:18}),n?"Saving...":"Save Tool"]})]})]}),r&&l.jsxs("div",{className:`mt-4 p-3 rounded-lg flex items-center gap-2 ${r.type==="success"?"bg-emerald-500/10 text-emerald-300 border border-emerald-400/40":"bg-red-900/30 text-red-400 border border-red-700/60"}`,children:[r.type==="success"?l.jsx(fl,{size:18}):l.jsx(nn,{size:18}),r.text]}),i.validationErrors.length>0&&l.jsxs("div",{className:"mt-4 p-3 bg-amber-500/10 border border-amber-400/50 rounded-lg",children:[l.jsxs("div",{className:"flex items-center gap-2 text-amber-300 font-medium mb-2",children:[l.jsx(nn,{size:18}),"Validation Issues"]}),l.jsx("ul",{className:"list-disc list-inside text-amber-200/80 text-sm space-y-1",children:i.validationErrors.map((u,m)=>l.jsx("li",{children:u},m))})]})]}),l.jsx("div",{className:"flex-1 overflow-auto p-6",children:l.jsxs("div",{className:"space-y-8 max-w-3xl",children:[l.jsxs("section",{children:[l.jsx("h2",{className:"text-lg font-medium text-slate-100 mb-4",children:"Tool Type"}),l.jsx("div",{className:"grid grid-cols-3 gap-4",children:$1.map(u=>l.jsxs("button",{onClick:()=>i.setToolType(u.value),className:`p-4 rounded-lg border text-left transition-colors ${i.state.toolType===u.value?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[l.jsx(u.icon,{size:24,className:i.state.toolType===u.value?"text-orange-400":"text-slate-400"}),l.jsx("div",{className:"font-medium text-slate-100 mt-2",children:u.label}),l.jsx("div",{className:"text-xs text-slate-400 mt-1",children:u.description})]},u.value))})]}),l.jsxs("section",{children:[l.jsxs("h2",{className:"text-lg font-medium text-slate-100 mb-4 flex items-center gap-2",children:[l.jsx(yp,{size:20}),"Basic Info"]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Tool Name ",l.jsx("span",{className:"text-red-400",children:"*"})]}),l.jsx("input",{type:"text",value:i.state.name,onChange:u=>i.setName(u.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")),placeholder:"my_custom_tool",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),l.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Lowercase letters, numbers, and underscores only"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Description"}),l.jsx("textarea",{value:i.state.description,onChange:u=>i.setDescription(u.target.value),placeholder:"Describe what this tool does...",rows:2,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]})]})]}),i.state.toolType==="yaml"&&l.jsx(B1,{builder:i}),i.state.toolType==="python"&&l.jsx(Q1,{builder:i}),i.state.toolType==="mcp"&&l.jsx(J1,{builder:i})]})})]}),e&&l.jsxs("div",{className:"fixed right-0 top-0 bottom-0 w-[28rem] bg-slate-950/80 border-l border-slate-800/70 flex flex-col",children:[l.jsxs("div",{className:"p-4 border-b border-slate-800/70 flex items-center justify-between",children:[l.jsxs("h2",{className:"font-semibold text-slate-100",children:[c==="python"?"Python Code":"YAML"," Preview"]}),l.jsx("button",{onClick:()=>navigator.clipboard.writeText(i.preview),className:"text-slate-400 hover:text-slate-100 text-sm",children:"Copy"})]}),l.jsx("pre",{className:`flex-1 overflow-auto p-4 text-sm text-slate-300 font-mono ${c==="python"?"text-xs":""}`,children:i.preview})]})]})}function B1({builder:e}){return l.jsxs("section",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("h2",{className:"text-lg font-medium text-slate-100 flex items-center gap-2",children:[l.jsx(wn,{size:20}),"Actions"]}),l.jsxs("button",{onClick:e.addAction,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold",children:[l.jsx(Ne,{size:14})," Add Action"]})]}),e.state.actions.length===0?l.jsxs("div",{className:"text-center py-12 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:[l.jsx(wn,{size:32,className:"mx-auto mb-3 opacity-50"}),l.jsx("p",{children:"No actions defined yet."}),l.jsx("p",{className:"text-sm mt-1",children:"Add an action to define what this tool can do."})]}):l.jsx("div",{className:"space-y-4",children:e.state.actions.map((t,n)=>l.jsx(H1,{action:t,index:n,builder:e},t.id))})]})}function H1({action:e,index:t,builder:n}){const[s,r]=x.useState(!0),a=(i,o)=>{n.updateAction(t,{...e,[i]:o})};return l.jsxs("div",{className:"panel-card overflow-hidden",children:[l.jsxs("div",{className:"flex items-center gap-3 p-4 cursor-pointer hover:bg-slate-800/60",onClick:()=>r(!s),children:[s?l.jsx(pe,{size:18}):l.jsx(ge,{size:18}),l.jsx("code",{className:"text-orange-300 font-medium",children:e.name||"unnamed_action"}),l.jsx("span",{className:"text-slate-500 text-sm flex-1 truncate",children:e.description||"No description"}),l.jsxs("span",{className:"text-xs text-slate-500 px-2 py-0.5 bg-slate-800 rounded",children:[e.params.length," params"]}),l.jsx("button",{onClick:i=>{i.stopPropagation(),n.removeAction(t)},className:"text-slate-500 hover:text-red-400",children:l.jsx(Ae,{size:16})})]}),s&&l.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action Name *"}),l.jsx("input",{type:"text",value:e.name,onChange:i=>a("name",i.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")),placeholder:"action_name",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),l.jsx("input",{type:"text",value:e.description,onChange:i=>a("description",i.target.value),placeholder:"What does this action do?",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Parameters"}),l.jsxs("button",{onClick:()=>n.addParam(t),className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[l.jsx(Ne,{size:12})," Add Param"]})]}),e.params.length===0?l.jsx("p",{className:"text-xs text-slate-500 italic",children:"No parameters"}):l.jsx("div",{className:"space-y-2",children:e.params.map((i,o)=>l.jsx(V1,{param:i,onUpdate:c=>n.updateParam(t,o,c),onRemove:()=>n.removeParam(t,o)},o))})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Returns"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>a("returnsType","simple"),className:`px-2 py-0.5 text-xs rounded ${e.returnsType==="simple"?"bg-orange-400 text-slate-900":"bg-slate-700 text-slate-300"}`,children:"Simple"}),l.jsx("button",{onClick:()=>{a("returnsType","conditional"),Array.isArray(e.returns)||a("returns",[])},className:`px-2 py-0.5 text-xs rounded ${e.returnsType==="conditional"?"bg-orange-400 text-slate-900":"bg-slate-700 text-slate-300"}`,children:"Conditional"})]})]}),e.returnsType==="simple"?l.jsx("textarea",{value:typeof e.returns=="string"?e.returns:"",onChange:i=>a("returns",i.target.value),placeholder:"Return value with {param} interpolation",rows:2,className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100 font-mono"}):l.jsxs("div",{className:"space-y-2",children:[Array.isArray(e.returns)&&e.returns.map((i,o)=>l.jsx(Y1,{ret:i,onUpdate:c=>n.updateConditionalReturn(t,o,c),onRemove:()=>n.removeConditionalReturn(t,o)},o)),l.jsxs("button",{onClick:()=>n.addConditionalReturn(t),className:"flex items-center gap-1 px-2 py-1 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[l.jsx(Ne,{size:12})," Add Condition"]})]}),l.jsxs("p",{className:"mt-1 text-xs text-slate-500",children:["Use ",l.jsx("code",{className:"text-orange-300",children:"{param_name}"})," or ",l.jsx("code",{className:"text-orange-300",children:"{state.key}"})," for interpolation"]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-medium text-slate-400 mb-2 block",children:"Error Handling (Optional)"}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsx("input",{type:"text",value:e.errorWhen||"",onChange:i=>a("errorWhen",i.target.value),placeholder:"error_when condition",className:"panel-subtle rounded px-3 py-1.5 text-xs text-slate-100 font-mono"}),l.jsx("input",{type:"text",value:e.returnsError||"",onChange:i=>a("returnsError",i.target.value),placeholder:"Error message",className:"panel-subtle rounded px-3 py-1.5 text-xs text-slate-100"})]})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("label",{className:"text-xs font-medium text-slate-400 flex items-center gap-1",children:[l.jsx(bn,{size:12}),"Side Effects"]}),l.jsxs("button",{onClick:()=>n.addSideEffect(t),className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[l.jsx(Ne,{size:12})," Add Effect"]})]}),e.sideEffects.length===0?l.jsx("p",{className:"text-xs text-slate-500 italic",children:"No side effects (tool doesn't modify state)"}):l.jsx("div",{className:"space-y-2",children:e.sideEffects.map((i,o)=>l.jsx(W1,{effect:i,onUpdate:c=>n.updateSideEffect(t,o,c),onRemove:()=>n.removeSideEffect(t,o)},o))})]})]})]})}function V1({param:e,onUpdate:t,onRemove:n}){const[s,r]=x.useState(e.enum&&e.enum.length>0);return l.jsxs("div",{className:"p-2 bg-slate-900/50 rounded space-y-2",children:[l.jsxs("div",{className:"flex gap-2 items-start",children:[l.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-2",children:[l.jsx("input",{type:"text",value:e.name,onChange:a=>t({...e,name:a.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")}),placeholder:"name",className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),l.jsx("select",{value:e.type,onChange:a=>t({...e,type:a.target.value}),className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100",children:I1.map(a=>l.jsx("option",{value:a.value,children:a.label},a.value))}),l.jsx("input",{type:"text",value:e.description,onChange:a=>t({...e,description:a.target.value}),placeholder:"description",className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("label",{className:"flex items-center gap-1 text-xs text-slate-400",children:[l.jsx("input",{type:"checkbox",checked:e.required,onChange:a=>t({...e,required:a.target.checked}),className:"w-3 h-3"}),"Req"]}),e.type==="string"&&l.jsxs("label",{className:"flex items-center gap-1 text-xs text-slate-400",children:[l.jsx("input",{type:"checkbox",checked:s,onChange:a=>{r(a.target.checked),a.target.checked||t({...e,enum:void 0})},className:"w-3 h-3"}),"Enum"]})]})]}),l.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:l.jsx(Ae,{size:14})})]}),s&&e.type==="string"&&l.jsx("input",{type:"text",value:(e.enum||[]).join(", "),onChange:a=>t({...e,enum:a.target.value.split(",").map(i=>i.trim()).filter(Boolean)}),placeholder:"option1, option2, option3",className:"w-full panel-subtle rounded px-2 py-1 text-xs text-slate-100"})]})}function W1({effect:e,onUpdate:t,onRemove:n}){return l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsx("span",{className:"text-xs text-slate-500",children:"set"}),l.jsx("input",{type:"text",value:e.set,onChange:s=>t({...e,set:s.target.value}),placeholder:"state_key",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),l.jsx("span",{className:"text-xs text-slate-500",children:"="}),l.jsx("input",{type:"text",value:String(e.value),onChange:s=>{let r=s.target.value;r==="true"?r=!0:r==="false"?r=!1:!isNaN(Number(r))&&r!==""&&(r=Number(r)),t({...e,value:r})},placeholder:"value",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),l.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:l.jsx(Ae,{size:14})})]})}function Y1({ret:e,onUpdate:t,onRemove:n}){return l.jsxs("div",{className:"flex gap-2 items-start p-2 bg-slate-900/50 rounded",children:[l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsx("span",{className:"text-xs text-slate-500 w-12",children:"when:"}),l.jsx("input",{type:"text",value:e.when,onChange:s=>t({...e,when:s.target.value}),placeholder:"condition or 'default'",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"})]}),l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsx("span",{className:"text-xs text-slate-500 w-12",children:"value:"}),l.jsx("input",{type:"text",value:e.value,onChange:s=>t({...e,value:s.target.value}),placeholder:"Return value",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"})]})]}),l.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:l.jsx(Ae,{size:14})})]})}function Q1({builder:e}){return l.jsxs("section",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Class Name ",l.jsx("span",{className:"text-red-400",children:"*"})]}),l.jsx("input",{type:"text",value:e.state.pythonClassName,onChange:t=>e.setPythonClassName(t.target.value),placeholder:"MyCustomTool",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),l.jsx("p",{className:"mt-1 text-xs text-slate-500",children:'PascalCase class name ending with "Tool"'})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("h3",{className:"text-lg font-medium text-slate-100 flex items-center gap-2",children:[l.jsx(Ro,{size:20}),"Actions"]}),l.jsxs("button",{onClick:e.addPythonAction,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold",children:[l.jsx(Ne,{size:14})," Add Action"]})]}),e.state.pythonActions.length===0?l.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:l.jsx("p",{children:"Define the actions your Python tool will support."})}):l.jsx("div",{className:"space-y-4",children:e.state.pythonActions.map((t,n)=>l.jsx(q1,{action:t,index:n,builder:e},n))})]}),l.jsxs("div",{className:"p-4 panel-subtle rounded-lg",children:[l.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-2",children:"What happens when you save:"}),l.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 list-disc list-inside",children:[l.jsxs("li",{children:["A Python file will be created in your ",l.jsx("code",{className:"text-orange-300",children:"tools/"})," directory"]}),l.jsx("li",{children:"The file includes TODO comments where you need to add your logic"}),l.jsx("li",{children:"The tool will be automatically discovered and available to use"})]})]})]})}function q1({action:e,index:t,builder:n}){const[s,r]=x.useState(!0),a=u=>{n.updatePythonAction(t,{...e,...u})},i=()=>{a({params:[...e.params,{name:"",type:"string",description:""}]})},o=(u,m)=>{a({params:e.params.map((f,g)=>g===u?{...f,...m}:f)})},c=u=>{a({params:e.params.filter((m,f)=>f!==u)})};return l.jsxs("div",{className:"panel-card overflow-hidden",children:[l.jsxs("div",{className:"flex items-center gap-3 p-4 cursor-pointer hover:bg-slate-800/60",onClick:()=>r(!s),children:[s?l.jsx(pe,{size:18}):l.jsx(ge,{size:18}),l.jsx("code",{className:"text-orange-300 font-medium",children:e.name||"unnamed"}),l.jsx("span",{className:"text-slate-500 text-sm flex-1 truncate",children:e.description||"No description"}),l.jsx("button",{onClick:u=>{u.stopPropagation(),n.removePythonAction(t)},className:"text-slate-500 hover:text-red-400",children:l.jsx(Ae,{size:16})})]}),s&&l.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action Name"}),l.jsx("input",{type:"text",value:e.name,onChange:u=>a({name:u.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")}),placeholder:"do_something",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),l.jsx("input",{type:"text",value:e.description,onChange:u=>a({description:u.target.value}),placeholder:"What does this do?",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Parameters"}),l.jsxs("button",{onClick:i,className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[l.jsx(Ne,{size:12})," Add"]})]}),e.params.length===0?l.jsx("p",{className:"text-xs text-slate-500 italic",children:"No parameters"}):l.jsx("div",{className:"space-y-2",children:e.params.map((u,m)=>l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsx("input",{type:"text",value:u.name,onChange:f=>o(m,{name:f.target.value}),placeholder:"name",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),l.jsxs("select",{value:u.type,onChange:f=>o(m,{type:f.target.value}),className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100",children:[l.jsx("option",{value:"string",children:"string"}),l.jsx("option",{value:"number",children:"number"}),l.jsx("option",{value:"boolean",children:"boolean"}),l.jsx("option",{value:"dict",children:"dict"}),l.jsx("option",{value:"list",children:"list"})]}),l.jsx("input",{type:"text",value:u.description,onChange:f=>o(m,{description:f.target.value}),placeholder:"description",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),l.jsx("button",{onClick:()=>c(m),className:"text-slate-500 hover:text-red-400 p-1",children:l.jsx(Ae,{size:14})})]},m))})]})]})]})}function J1({builder:e}){return l.jsxs("section",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Transport Type"}),l.jsx("div",{className:"flex gap-4",children:["stdio","sse","http"].map(t=>l.jsxs("button",{onClick:()=>e.setMcpTransport(t),className:`flex-1 p-3 rounded-lg border text-center transition-colors ${e.state.mcpTransport===t?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[l.jsx("div",{className:"font-medium text-slate-100",children:t.toUpperCase()}),l.jsx("div",{className:"text-xs text-slate-400 mt-1",children:t==="stdio"?"Local process":t==="sse"?"Server-sent events":"HTTP endpoint"})]},t))})]}),e.state.mcpTransport==="stdio"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Command ",l.jsx("span",{className:"text-red-400",children:"*"})]}),l.jsx("input",{type:"text",value:e.state.mcpCommand,onChange:t=>e.setMcpCommand(t.target.value),placeholder:"python -m my_mcp_server",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Arguments (optional)"}),l.jsx("input",{type:"text",value:e.state.mcpArgs.join(" "),onChange:t=>e.setMcpArgs(t.target.value.split(" ").filter(Boolean)),placeholder:"--port 8080 --debug",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono"})]})]}):l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["URL ",l.jsx("span",{className:"text-red-400",children:"*"})]}),l.jsx("input",{type:"text",value:e.state.mcpUrl,onChange:t=>e.setMcpUrl(t.target.value),placeholder:"https://api.example.com/mcp",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("label",{className:"text-sm font-medium text-slate-400",children:"Environment Variables"}),l.jsxs("button",{onClick:e.addMcpEnvVar,className:"flex items-center gap-1 px-2 py-1 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[l.jsx(Ne,{size:12})," Add"]})]}),e.state.mcpEnv.length===0?l.jsx("p",{className:"text-xs text-slate-500 italic",children:"No environment variables"}):l.jsx("div",{className:"space-y-2",children:e.state.mcpEnv.map((t,n)=>l.jsx(K1,{envVar:t,onUpdate:s=>e.updateMcpEnvVar(n,s),onRemove:()=>e.removeMcpEnvVar(n)},n))}),l.jsxs("p",{className:"mt-2 text-xs text-slate-500",children:["Use ",l.jsx("code",{className:"text-orange-300",children:"${ENV_VAR}"})," to reference system environment variables"]})]}),l.jsxs("div",{className:"p-4 panel-subtle rounded-lg",children:[l.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-2",children:"How MCP tools work:"}),l.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 list-disc list-inside",children:[l.jsx("li",{children:"MCP servers expose tools via the Model Context Protocol"}),l.jsx("li",{children:"The server will be started/connected when the tool is used"}),l.jsx("li",{children:"Tools are automatically discovered from the server"})]})]})]})}function K1({envVar:e,onUpdate:t,onRemove:n}){return l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsx("input",{type:"text",value:e.key,onChange:s=>t({...e,key:s.target.value}),placeholder:"KEY",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),l.jsx("span",{className:"text-slate-500",children:"="}),l.jsx("input",{type:"text",value:e.value,onChange:s=>t({...e,value:s.target.value}),placeholder:"value or ${ENV_VAR}",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),l.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:l.jsx(Ae,{size:14})})]})}function G1(){const[e,t]=x.useState([]),[n,s]=x.useState([]),[r,a]=x.useState(null),[i,o]=x.useState(null),[c,u]=x.useState(new Set),[m,f]=x.useState(!0),[g,y]=x.useState(null),[j,v]=x.useState(!1),[N,p]=x.useState(!1),[d,h]=x.useState(null),[k,w]=x.useState(!1),[R,P]=x.useState([]),[M,O]=x.useState([]),[z,A]=x.useState(!1);x.useEffect(()=>{L()},[]),x.useEffect(()=>{if(!(d!=null&&d.scenarioId)){P([]),O([]);return}Z.getScenarioGoals(d.scenarioId).then(S=>{const T=S.filter(D=>D.outcome);P(T.length>0?T:S)}).catch(()=>P([])),Z.getScenarioTools(d.scenarioId).then(O).catch(()=>O([]))},[d==null?void 0:d.scenarioId]),x.useEffect(()=>{r?Z.getDataset(r).then(S=>{o(S),y(null)}).catch(S=>y(S.message)):o(null)},[r]);async function L(){f(!0);try{const[S,T]=await Promise.all([Z.listDatasets(),Z.listScenarios()]);t(S),s(T),y(null)}catch(S){y(S instanceof Error?S.message:"Failed to load datasets")}finally{f(!1)}}function U(S){const T=new Set(c);T.has(S)?T.delete(S):T.add(S),u(T)}function B(){i&&(h(nj(i)),p(!0))}function C(){h({id:"",name:"",description:"",scenarioId:"",cases:[{id:"case_001",expected:[],variables:[{key:"",value:""}],toolResponses:[],tags:[]}]}),A(!0),p(!0)}async function E(){if(!d)return;const S=z?d.id:r;if(!S){y("Dataset ID is required");return}if(!/^[a-z0-9_-]+$/.test(S)){y("Dataset ID must contain only lowercase letters, numbers, hyphens, and underscores");return}v(!0);try{const T=um(d);z?await Z.saveDataset(S,T):await Z.updateDataset(S,T),p(!1),A(!1),h(null),await L(),a(S),y(null)}catch(T){y(T instanceof Error?T.message:"Failed to save dataset")}finally{v(!1)}}async function _(S){if(confirm(`Delete dataset "${S}"?`))try{await Z.deleteDataset(S),r===S&&(a(null),o(null)),await L(),y(null)}catch(T){y(T instanceof Error?T.message:"Failed to delete dataset")}}function b(){p(!1),A(!1),h(null)}return m?l.jsx("div",{className:"p-8 page",children:l.jsx("div",{className:"text-slate-400",children:"Loading datasets..."})}):l.jsxs("div",{className:"p-8 page",children:[l.jsxs("div",{className:"mb-6",children:[l.jsxs("h1",{className:"text-2xl font-semibold text-slate-100 mb-2 flex items-center gap-2",children:[l.jsx(sn,{size:24}),"Datasets"]}),l.jsx("p",{className:"text-slate-400",children:"Manage test case datasets for multi-case benchmarking"})]}),g&&l.jsxs("div",{className:"mb-4 p-3 bg-red-500/20 border border-red-500/50 rounded-lg flex items-center gap-2 text-red-300",children:[l.jsx(nn,{size:16}),g,l.jsx("button",{onClick:()=>y(null),className:"ml-auto",children:l.jsx(Nt,{size:16})})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[l.jsxs("div",{className:"panel-card p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h2",{className:"font-semibold text-slate-200",children:"Datasets"}),l.jsxs("button",{onClick:C,className:"flex items-center gap-1 px-2 py-1 bg-blue-500 hover:bg-blue-400 text-white rounded text-sm",children:[l.jsx(Ne,{size:14}),"New"]})]}),e.length===0?l.jsx("p",{className:"text-slate-500 text-sm",children:"No datasets found. Create one to get started."}):l.jsx("div",{className:"space-y-2",children:e.map(S=>l.jsxs("div",{className:`p-3 rounded-lg cursor-pointer transition-colors ${r===S.id?"bg-blue-500/20 border border-blue-500/50":"panel-subtle hover:bg-slate-700/50"}`,onClick:()=>{a(S.id),p(!1),A(!1)},children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"font-medium text-slate-200",children:S.name}),l.jsxs("span",{className:"text-xs text-slate-500",children:[S.case_count," cases"]})]}),S.description&&l.jsx("p",{className:"text-sm text-slate-400 mt-1 line-clamp-1",children:S.description})]},S.id))})]}),l.jsx("div",{className:"lg:col-span-2 panel-card p-4 overflow-auto max-h-[80vh]",children:N&&d?l.jsx(X1,{data:d,isNew:z,saving:j,showYaml:k,scenarios:n,outcomeGoals:R,scenarioTools:M,onDataChange:h,onToggleYaml:()=>w(!k),onSave:E,onCancel:b}):i?l.jsx(ej,{dataset:i,expandedCases:c,onToggleCase:U,onEdit:B,onDelete:()=>_(i.id)}):l.jsx("div",{className:"text-center text-slate-500 py-12",children:"Select a dataset or create a new one"})})]})]})}function X1({data:e,isNew:t,saving:n,showYaml:s,scenarios:r,outcomeGoals:a,scenarioTools:i,onDataChange:o,onToggleYaml:c,onSave:u,onCancel:m}){const f=(v,N)=>{const p=[...e.cases];p[v]={...p[v],...N},o({...e,cases:p})},g=()=>{const v=`case_${String(e.cases.length+1).padStart(3,"0")}`;o({...e,cases:[...e.cases,{id:v,expected:[],variables:[{key:"",value:""}],toolResponses:[],tags:[]}]})},y=v=>{e.cases.length<=1||o({...e,cases:e.cases.filter((N,p)=>p!==v)})},j=v=>{const N=e.cases[v],p=`${N.id}_copy`,d={...N,id:p,variables:[...N.variables.map(h=>({...h}))],toolResponses:N.toolResponses.map(h=>({...h,fields:[...h.fields.map(k=>({...k}))],rawJson:h.rawJson})),tags:[...N.tags]};o({...e,cases:[...e.cases.slice(0,v+1),d,...e.cases.slice(v+1)]})};return s?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-100",children:t?"New Dataset":`Edit: ${e.name}`}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("button",{onClick:c,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",children:[l.jsx(vp,{size:14}),"Form View"]}),l.jsxs("button",{onClick:m,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",disabled:n,children:[l.jsx(Nt,{size:14}),"Cancel"]}),l.jsxs("button",{onClick:u,className:"flex items-center gap-1 px-3 py-1.5 bg-green-500 hover:bg-green-400 text-white rounded text-sm",disabled:n,children:[l.jsx(yr,{size:14}),n?"Saving...":"Save"]})]})]}),l.jsx("pre",{className:"p-4 bg-slate-800 rounded-lg text-sm text-slate-300 overflow-auto max-h-[60vh]",children:um(e)})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-100",children:t?"New Dataset":`Edit: ${e.name}`}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("button",{onClick:c,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",children:[l.jsx(Ro,{size:14}),"YAML"]}),l.jsxs("button",{onClick:m,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",disabled:n,children:[l.jsx(Nt,{size:14}),"Cancel"]}),l.jsxs("button",{onClick:u,className:"flex items-center gap-1 px-3 py-1.5 bg-green-500 hover:bg-green-400 text-white rounded text-sm",disabled:n,children:[l.jsx(yr,{size:14}),n?"Saving...":"Save"]})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[t&&l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:["Dataset ID ",l.jsx("span",{className:"text-red-400",children:"*"})]}),l.jsx("input",{type:"text",value:e.id,onChange:v=>o({...e,id:v.target.value.toLowerCase().replace(/[^a-z0-9_-]/g,"-")}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"my-test-cases"})]}),l.jsxs("div",{className:t?"":"col-span-2",children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Name"}),l.jsx("input",{type:"text",value:e.name,onChange:v=>o({...e,name:v.target.value}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"My Test Cases"})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:["Scenario ",l.jsx("span",{className:"text-slate-500",children:"(for goal dropdown)"})]}),l.jsxs("select",{value:e.scenarioId,onChange:v=>o({...e,scenarioId:v.target.value}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",children:[l.jsx("option",{value:"",children:"Select a scenario..."}),r.map(v=>l.jsx("option",{value:v.id,children:v.name},v.id))]}),!e.scenarioId&&l.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Link to a scenario to enable outcome goal dropdown in case editor"})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Description"}),l.jsx("textarea",{value:e.description,onChange:v=>o({...e,description:v.target.value}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",rows:2,placeholder:"Test cases for evaluating..."})]})]}),l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsxs("h3",{className:"font-medium text-slate-200",children:["Test Cases (",e.cases.length,")"]}),l.jsxs("button",{onClick:g,className:"flex items-center gap-1 px-2 py-1 bg-blue-500/20 hover:bg-blue-500/30 text-blue-300 rounded text-sm",children:[l.jsx(Ne,{size:14}),"Add Case"]})]}),l.jsx("div",{className:"space-y-4",children:e.cases.map((v,N)=>l.jsx(Z1,{case_:v,index:N,outcomeGoals:a,scenarioTools:i,onChange:p=>f(N,p),onRemove:()=>y(N),onDuplicate:()=>j(N),canRemove:e.cases.length>1},N))})]})}function Z1({case_:e,index:t,outcomeGoals:n,scenarioTools:s,onChange:r,onRemove:a,onDuplicate:i,canRemove:o}){const[c,u]=x.useState(!0),m=w=>{e.expected.includes(w)?r({expected:e.expected.filter(R=>R!==w)}):r({expected:[...e.expected,w]})},f=()=>{r({variables:[...e.variables,{key:"",value:""}]})},g=(w,R,P)=>{const M=[...e.variables];M[w]={key:R,value:P},r({variables:M})},y=w=>{r({variables:e.variables.filter((R,P)=>P!==w)})},j=()=>{r({toolResponses:[...e.toolResponses,{tool:"",action:"",mode:"fields",fields:[{key:"",value:""}],rawJson:`{
|
|
374
|
+
|
|
375
|
+
}`}]})},v=(w,R)=>{const P=[...e.toolResponses];P[w]={...P[w],...R},r({toolResponses:P})},N=w=>{r({toolResponses:e.toolResponses.filter((R,P)=>P!==w)})},p=w=>{const R=[...e.toolResponses];R[w]={...R[w],fields:[...R[w].fields,{key:"",value:""}]},r({toolResponses:R})},d=(w,R,P,M)=>{const O=[...e.toolResponses],z=[...O[w].fields];z[R]={key:P,value:M},O[w]={...O[w],fields:z},r({toolResponses:O})},h=(w,R)=>{const P=[...e.toolResponses];P[w]={...P[w],fields:P[w].fields.filter((M,O)=>O!==R)},r({toolResponses:P})},k=w=>{const R=w.split(",").map(P=>P.trim()).filter(Boolean);r({tags:R})};return l.jsxs("div",{className:"panel-subtle rounded-lg overflow-hidden",children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-slate-700/50",onClick:()=>u(!c),children:[c?l.jsx(pe,{size:16}):l.jsx(ge,{size:16}),l.jsxs("span",{className:"font-medium text-slate-200",children:["Case ",t+1,": ",e.id]}),e.expected.length>0&&l.jsxs("span",{className:"text-sm text-blue-400",children:["expected: ",e.expected.join(" or ")]}),l.jsxs("div",{className:"ml-auto flex gap-1",onClick:w=>w.stopPropagation(),children:[l.jsx("button",{onClick:i,className:"p-1 text-slate-400 hover:text-slate-200",title:"Duplicate case",children:l.jsx(mp,{size:14})}),o&&l.jsx("button",{onClick:a,className:"p-1 text-red-400 hover:text-red-300",title:"Remove case",children:l.jsx(Ae,{size:14})})]})]}),c&&l.jsxs("div",{className:"px-4 pb-4 pt-2 border-t border-slate-700 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"Case ID"}),l.jsx("input",{type:"text",value:e.id,onChange:w=>r({id:w.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"case_001"})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:["Expected Outcome(s) ",e.expected.length>1&&l.jsx("span",{className:"text-blue-400",children:"(any)"})]}),n.length>0?l.jsx("div",{className:"space-y-1.5 max-h-32 overflow-y-auto p-2 bg-slate-800 border border-slate-700 rounded",children:n.map(w=>l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer hover:bg-slate-700/50 p-1 rounded",children:[l.jsx("input",{type:"checkbox",checked:e.expected.includes(w.id),onChange:()=>m(w.id),className:"w-4 h-4 rounded border-slate-600 bg-slate-800 text-blue-500 focus:ring-blue-500"}),l.jsx("span",{className:"text-sm text-slate-200",children:w.name||w.id}),w.description&&l.jsx("span",{className:"text-xs text-slate-500 truncate",children:w.description})]},w.id))}):l.jsx("input",{type:"text",value:e.expected.join(", "),onChange:w=>r({expected:w.target.value.split(",").map(R=>R.trim()).filter(Boolean)}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"goal_id (link scenario for dropdown)"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"Tags (comma-separated)"}),l.jsx("input",{type:"text",value:e.tags.join(", "),onChange:w=>k(w.target.value),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"basic, edge-case, high-value"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Variables"}),l.jsx("button",{onClick:f,className:"text-xs text-blue-400 hover:text-blue-300",children:"+ Add Variable"})]}),l.jsx("div",{className:"space-y-2",children:e.variables.map((w,R)=>l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",value:w.key,onChange:P=>g(R,P.target.value,w.value),className:"w-1/3 px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"key"}),l.jsx("input",{type:"text",value:w.value,onChange:P=>g(R,w.key,P.target.value),className:"flex-1 px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"value"}),l.jsx("button",{onClick:()=>y(R),className:"p-1.5 text-red-400 hover:text-red-300",children:l.jsx(Nt,{size:14})})]},R))})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Tool Response Overrides"}),l.jsx("button",{onClick:j,className:"text-xs text-blue-400 hover:text-blue-300",children:"+ Add Override"})]}),l.jsxs("div",{className:"space-y-3",children:[e.toolResponses.map((w,R)=>{const P=s.find(O=>O.name===w.tool),M=(P==null?void 0:P.actions)||[];return l.jsxs("div",{className:"p-3 bg-slate-800/50 rounded-lg border border-slate-700 space-y-3",children:[l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2",children:[s.length>0?l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Tool"}),l.jsxs("select",{value:w.tool,onChange:O=>{const z=O.target.value,A=s.find(U=>U.name===z),L=(A==null?void 0:A.actions.length)===1&&A.actions[0].name==="call"?"call":"";v(R,{tool:z,action:L})},className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",children:[l.jsx("option",{value:"",children:"Select tool..."}),s.map(O=>l.jsx("option",{value:O.name,children:O.name},O.name))]})]}):l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Tool"}),l.jsx("input",{type:"text",value:w.tool,onChange:O=>v(R,{tool:O.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"tool_name"})]}),M.length===1&&M[0].name==="call"?l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action"}),l.jsxs("div",{className:"px-2 py-1.5 bg-slate-900 border border-slate-600 rounded text-slate-400 text-sm",children:["call ",l.jsx("span",{className:"text-xs",children:"(single-action)"})]})]}):M.length>0?l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action"}),l.jsxs("select",{value:w.action,onChange:O=>v(R,{action:O.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",children:[l.jsx("option",{value:"",children:"Select action..."}),M.map(O=>l.jsx("option",{value:O.name,children:O.name},O.name))]})]}):l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action"}),l.jsx("input",{type:"text",value:w.action,onChange:O=>v(R,{action:O.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"call"})]})]}),l.jsx("button",{onClick:()=>N(R),className:"p-1.5 text-red-400 hover:text-red-300 self-end mb-1",title:"Remove override",children:l.jsx(Ae,{size:14})})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("label",{className:"text-xs text-slate-500",children:"Response Data"}),l.jsxs("div",{className:"flex text-xs bg-slate-900 rounded overflow-hidden border border-slate-600",children:[l.jsx("button",{onClick:()=>v(R,{mode:"fields"}),className:`px-2 py-1 ${w.mode==="fields"?"bg-blue-500 text-white":"text-slate-400 hover:text-slate-200"}`,children:"Fields"}),l.jsx("button",{onClick:()=>v(R,{mode:"json"}),className:`px-2 py-1 ${w.mode==="json"?"bg-blue-500 text-white":"text-slate-400 hover:text-slate-200"}`,children:"JSON"})]})]}),w.mode==="fields"&&l.jsx("button",{onClick:()=>p(R),className:"text-xs text-blue-400 hover:text-blue-300",children:"+ Add Field"})]}),w.mode==="fields"?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"space-y-2",children:w.fields.map((O,z)=>l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",value:O.key,onChange:A=>d(R,z,A.target.value,O.value),className:"w-1/3 px-2 py-1.5 bg-slate-900 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"field_name"}),l.jsx("input",{type:"text",value:O.value,onChange:A=>d(R,z,O.key,A.target.value),className:"flex-1 px-2 py-1.5 bg-slate-900 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"value (strings, numbers, or JSON)"}),w.fields.length>1&&l.jsx("button",{onClick:()=>h(R,z),className:"p-1.5 text-red-400 hover:text-red-300",children:l.jsx(Nt,{size:14})})]},z))}),l.jsx("p",{className:"mt-2 text-xs text-slate-500",children:"Each field becomes a key in the response object. Values are auto-parsed (numbers, booleans, JSON)."})]}):l.jsxs(l.Fragment,{children:[l.jsx("textarea",{value:w.rawJson,onChange:O=>v(R,{rawJson:O.target.value}),className:"w-full px-3 py-2 bg-slate-900 border border-slate-600 rounded text-slate-200 text-sm font-mono",rows:6,placeholder:'{"status": "open", "priority": "high", "items": [1, 2, 3]}'}),l.jsx("p",{className:"mt-2 text-xs text-slate-500",children:"Enter the complete JSON response object. This replaces the tool's normal return value."})]})]})]},R)}),e.toolResponses.length===0&&l.jsx("p",{className:"text-xs text-slate-500 p-3 bg-slate-800/30 rounded-lg border border-dashed border-slate-700",children:s.length>0?"Add overrides to inject custom tool responses for this test case":"Link a scenario above to enable tool dropdowns, or add overrides manually"})]})]})]})]})}function ej({dataset:e,expandedCases:t,onToggleCase:n,onEdit:s,onDelete:r}){const[a,i]=x.useState(5);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-100",children:e.name}),l.jsx("p",{className:"text-slate-400 text-sm",children:e.description})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("button",{onClick:s,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",children:[l.jsx(vp,{size:14}),"Edit"]}),l.jsxs("button",{onClick:r,className:"flex items-center gap-1 px-3 py-1.5 bg-red-500/20 hover:bg-red-500/30 text-red-300 rounded text-sm",children:[l.jsx(Ae,{size:14}),"Delete"]})]})]}),l.jsxs("div",{className:"mb-4 text-sm text-slate-400",children:[e.cases.length," test case",e.cases.length!==1?"s":"",e.generator&&" (generated)"]}),l.jsx("div",{className:"space-y-2 max-h-[50vh] overflow-y-auto",children:e.cases.map(o=>l.jsx(tj,{case_:o,expanded:t.has(o.id),onToggle:()=>n(o.id)},o.id))}),e.cases.length>0&&l.jsx("div",{className:"mt-4 pt-4 border-t border-slate-700",children:l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs(de,{to:`/run?dataset=${e.id}¶llel=${a}`,className:"flex items-center gap-2 px-4 py-2 bg-orange-400 hover:bg-orange-300 text-slate-900 rounded-lg font-medium",children:[l.jsx(Xt,{size:16}),"Run All Cases"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("label",{className:"text-sm text-slate-400",children:"Parallel:"}),l.jsx("input",{type:"number",min:1,max:20,value:a,onChange:o=>i(Math.max(1,Math.min(20,parseInt(o.target.value)||1))),className:"w-16 px-2 py-1 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm"}),l.jsx("span",{className:"text-xs text-slate-500",children:"concurrent runs"})]})]})})]})}function tj({case_:e,expanded:t,onToggle:n}){return l.jsxs("div",{className:"panel-subtle rounded-lg overflow-hidden",children:[l.jsxs("button",{onClick:n,className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-slate-700/50 transition-colors",children:[t?l.jsx(pe,{size:16}):l.jsx(ge,{size:16}),l.jsx("span",{className:"font-medium text-slate-200",children:e.id}),e.expected.length>0&&l.jsxs("span",{className:"text-sm text-blue-400",children:["expected: ",e.expected.join(" or ")]}),e.tags.length>0&&l.jsx("div",{className:"flex gap-1 ml-auto",children:e.tags.map(s=>l.jsx("span",{className:"px-2 py-0.5 bg-slate-700 rounded text-xs text-slate-400",children:s},s))})]}),t&&l.jsxs("div",{className:"px-4 pb-3 pt-1 border-t border-slate-700",children:[Object.keys(e.variables).length>0&&l.jsxs("div",{className:"mb-3",children:[l.jsx("h4",{className:"text-xs font-semibold text-slate-400 uppercase mb-2",children:"Variables"}),l.jsx("pre",{className:"text-sm text-slate-300 bg-slate-800 p-2 rounded overflow-x-auto",children:JSON.stringify(e.variables,null,2)})]}),Object.keys(e.tool_responses).length>0&&l.jsxs("div",{children:[l.jsx("h4",{className:"text-xs font-semibold text-slate-400 uppercase mb-2",children:"Tool Response Overrides"}),l.jsx("pre",{className:"text-sm text-slate-300 bg-slate-800 p-2 rounded overflow-x-auto",children:JSON.stringify(e.tool_responses,null,2)})]})]})]})}function nj(e){return{id:e.id,name:e.name,description:e.description,scenarioId:e.scenario_id||"",cases:e.cases.map(t=>({id:t.id,expected:t.expected||[],variables:Object.entries(t.variables).map(([n,s])=>({key:n,value:typeof s=="string"?s:JSON.stringify(s)})),toolResponses:Object.entries(t.tool_responses).map(([n,s])=>{const r=n.split("."),a=r[0]||n,i=r.slice(1).join(".")||"",o=[];let c=!1;if(typeof s=="object"&&s!==null)for(const[u,m]of Object.entries(s))typeof m=="object"&&m!==null&&(c=!0),o.push({key:u,value:typeof m=="string"?m:JSON.stringify(m)});return o.length===0&&o.push({key:"",value:""}),{tool:a,action:i,mode:c?"json":"fields",fields:o,rawJson:JSON.stringify(s,null,2)}}),tags:t.tags}))}}function um(e){const t=[];e.name&&t.push(`name: "${e.name}"`),e.description&&(t.push("description: |"),e.description.split(`
|
|
376
|
+
`).forEach(n=>{t.push(` ${n}`)})),e.scenarioId&&t.push(`scenario_id: ${e.scenarioId}`),t.push(""),t.push("cases:");for(const n of e.cases){t.push(` - id: ${n.id}`),n.expected.length===1?t.push(` expected: ${n.expected[0]}`):n.expected.length>1&&t.push(` expected: [${n.expected.join(", ")}]`);const s=n.variables.filter(a=>a.key.trim());if(s.length>0){t.push(" variables:");for(const a of s){const i=Au(a.value);typeof i=="string"?t.push(` ${a.key}: "${i}"`):t.push(` ${a.key}: ${JSON.stringify(i)}`)}}const r=n.toolResponses.filter(a=>a.tool.trim()?a.mode==="json"?a.rawJson.trim().length>0:a.fields.some(i=>i.key.trim()):!1);if(r.length>0){t.push(" tool_responses:");for(const a of r){const i=a.action?`${a.tool}.${a.action}`:a.tool;if(t.push(` ${i}:`),a.mode==="json")try{const o=JSON.parse(a.rawJson);if(typeof o=="object"&&o!==null)for(const[c,u]of Object.entries(o))typeof u=="string"?t.push(` ${c}: "${u}"`):t.push(` ${c}: ${JSON.stringify(u)}`)}catch{t.push(" # Invalid JSON")}else for(const o of a.fields){if(!o.key.trim())continue;const c=Au(o.value);typeof c=="string"?t.push(` ${o.key}: "${c}"`):t.push(` ${o.key}: ${JSON.stringify(c)}`)}}}n.tags.length>0&&t.push(` tags: [${n.tags.join(", ")}]`)}return t.join(`
|
|
377
|
+
`)}function Au(e){try{return JSON.parse(e)}catch{const t=Number(e);return!isNaN(t)&&e.trim()!==""?t:e.toLowerCase()==="true"?!0:e.toLowerCase()==="false"?!1:e}}function sj(){return l.jsx(Hh,{children:l.jsxs(xt,{path:"/",element:l.jsx(Ig,{}),children:[l.jsx(xt,{index:!0,element:l.jsx(Hg,{})}),l.jsx(xt,{path:"scenario/:scenarioId",element:l.jsx(Vg,{})}),l.jsx(xt,{path:"run/:scenarioId",element:l.jsx(fu,{})}),l.jsx(xt,{path:"run",element:l.jsx(fu,{})}),l.jsx(xt,{path:"results",element:l.jsx(Zg,{})}),l.jsx(xt,{path:"builder",element:l.jsx(b1,{})}),l.jsx(xt,{path:"tool-builder",element:l.jsx(U1,{})}),l.jsx(xt,{path:"datasets",element:l.jsx(G1,{})})]})})}ba.createRoot(document.getElementById("root")).render(l.jsx(Am.StrictMode,{children:l.jsx(mg,{children:l.jsx(sj,{})})}));
|